@arcgis/core 4.28.0-next.20230819 → 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 (169) hide show
  1. package/assets/esri/core/workers/RemoteClient.js +1 -1
  2. package/assets/esri/core/workers/chunks/003744a45b07865f1be9.js +1 -0
  3. package/assets/esri/core/workers/chunks/034accc7cab6c88a3b31.js +1 -0
  4. package/assets/esri/core/workers/chunks/{a67e5b22adc91e850b4e.js → 05ab09713d599687afa3.js} +1 -1
  5. package/assets/esri/core/workers/chunks/{3724f23b6f5ac8ec2568.js → 12b8fe0374fa9ab4ca09.js} +1 -1
  6. package/assets/esri/core/workers/chunks/16d1a72014074e87ecb9.js +1 -0
  7. package/assets/esri/core/workers/chunks/{e4b6565c16430b28ad93.js → 19857e5420cdf23c5f2e.js} +1 -1
  8. package/assets/esri/core/workers/chunks/{1a804dea42c0fb5e5c07.js → 1bab408eaffd2c18976d.js} +1 -1
  9. package/assets/esri/core/workers/chunks/201365f53509e3f78e17.js +1 -0
  10. package/assets/esri/core/workers/chunks/{2031451b82ff70fb201a.js → 2f48f4a9a0a056ac5e1c.js} +1 -1
  11. package/assets/esri/core/workers/chunks/318b51fdee09c1fd750f.js +1 -0
  12. package/assets/esri/core/workers/chunks/{5b799dc155adeb728c74.js → 3361e3e8385f8de8820c.js} +1 -1
  13. package/assets/esri/core/workers/chunks/3ce1870c28ab6ac3648e.js +1 -0
  14. package/assets/esri/core/workers/chunks/41929e4531787389804b.js +1 -0
  15. package/assets/esri/core/workers/chunks/{55ac725127c5ea9fb942.js → 4e39252f40bc57be9d12.js} +1 -1
  16. package/assets/esri/core/workers/chunks/{8ed83426ef88a3eccecd.js → 4e496b03ce24b1206f86.js} +1 -1
  17. package/assets/esri/core/workers/chunks/54513578f735d274a20e.js +1 -0
  18. package/assets/esri/core/workers/chunks/{d46f8ef92e79d12384c9.js → 587437526ea77f764986.js} +1 -1
  19. package/assets/esri/core/workers/chunks/{ab720e2f0a35138564b2.js → 5ffabd1a90c5b08109aa.js} +1 -1
  20. package/assets/esri/core/workers/chunks/6108d72faf48a592c8ba.js +1 -0
  21. package/assets/esri/core/workers/chunks/6479439afae01f9bb5e6.js +1 -0
  22. package/assets/esri/core/workers/chunks/69306dfc89e877539223.js +1 -0
  23. package/assets/esri/core/workers/chunks/{ed499c328ae3a704791c.js → 6db4a6f9d25691830829.js} +1 -1
  24. package/assets/esri/core/workers/chunks/{61393fd3376ea599a447.js → 76e27cece1559ae815df.js} +1 -1
  25. package/assets/esri/core/workers/chunks/81526909c0fa11639038.js +1 -0
  26. package/assets/esri/core/workers/chunks/873111ddf4813cdd4903.js +1 -0
  27. package/assets/esri/core/workers/chunks/8d4f1170394a8be15da9.js +1 -0
  28. package/assets/esri/core/workers/chunks/8d8bdfda09c24e363f78.js +1 -0
  29. package/assets/esri/core/workers/chunks/9b54b5bdb6367c36f6e9.js +1 -0
  30. package/assets/esri/core/workers/chunks/{88f0b5c0fe751bf35af2.js → b2752e038c5fa3c21e49.js} +1 -1
  31. package/assets/esri/core/workers/chunks/{dd3b7cfc6f78552249a4.js → b78dc6cbe14e5817b4d9.js} +1 -1
  32. package/assets/esri/core/workers/chunks/{e31d0c7363cbceeb5ac9.js → c35b850fbfcb28133235.js} +1 -1
  33. package/assets/esri/core/workers/chunks/c83e1be4ee64320cf2fe.js +1 -0
  34. package/assets/esri/core/workers/chunks/c88869d2a647c22dc3e6.js +1 -0
  35. package/assets/esri/core/workers/chunks/cb0a5bc6deaa98026bb5.js +1 -0
  36. package/assets/esri/core/workers/chunks/{767467738aeabec14abd.js → d0c4367a197b193e95d4.js} +1 -1
  37. package/assets/esri/core/workers/chunks/{f113141e254505116b82.js → d1cc2c050423595e54e0.js} +1 -1
  38. package/assets/esri/core/workers/chunks/{7f34945036495ad7c3f8.js → d2a8bf2d090b94cb294b.js} +1 -1
  39. package/assets/esri/core/workers/chunks/{08af7f7f1950a59a8e47.js → d6c96a20e9640b433719.js} +4 -4
  40. package/assets/esri/core/workers/chunks/da5453e67d00ff546640.js +1 -0
  41. package/assets/esri/core/workers/chunks/daa79c14150c12d8bc3d.js +1 -0
  42. package/assets/esri/core/workers/chunks/ef03b78659c72de93076.js +1 -0
  43. package/assets/esri/core/workers/chunks/{c3cace5b25b5170228ba.js → f2fe89b6ac6bf6817e71.js} +1 -1
  44. package/assets/esri/core/workers/chunks/f3554627664a419e00fa.js +1 -0
  45. package/assets/esri/themes/base/widgets/_Editor.scss +65 -4
  46. package/assets/esri/themes/base/widgets/_UtilityNetworkAssociations.scss +97 -39
  47. package/assets/esri/themes/dark/main.css +1 -1
  48. package/assets/esri/themes/light/main.css +1 -1
  49. package/assets/esri/themes/light/view.css +1 -1
  50. package/assets/esri/widgets/Editor/t9n/Editor.json +1 -1
  51. package/assets/esri/widgets/Editor/t9n/Editor_en.json +1 -1
  52. package/assets/esri/widgets/UtilityNetworkAssociations/assets/img/line-caps/butt.png +0 -0
  53. package/assets/esri/widgets/UtilityNetworkAssociations/assets/img/line-caps/round.png +0 -0
  54. package/assets/esri/widgets/UtilityNetworkAssociations/assets/img/line-caps/square.png +0 -0
  55. package/assets/esri/widgets/UtilityNetworkAssociations/assets/img/line-patterns/dash-dot.png +0 -0
  56. package/assets/esri/widgets/UtilityNetworkAssociations/assets/img/line-patterns/dash.png +0 -0
  57. package/assets/esri/widgets/UtilityNetworkAssociations/assets/img/line-patterns/dot.png +0 -0
  58. package/assets/esri/widgets/UtilityNetworkAssociations/assets/img/line-patterns/long-dash-dot-dot.png +0 -0
  59. package/assets/esri/widgets/UtilityNetworkAssociations/assets/img/line-patterns/long-dash-dot.png +0 -0
  60. package/assets/esri/widgets/UtilityNetworkAssociations/assets/img/line-patterns/long-dash.png +0 -0
  61. package/assets/esri/widgets/UtilityNetworkAssociations/assets/img/line-patterns/short-dash-dot-dot.png +0 -0
  62. package/assets/esri/widgets/UtilityNetworkAssociations/assets/img/line-patterns/short-dash-dot.png +0 -0
  63. package/assets/esri/widgets/UtilityNetworkAssociations/assets/img/line-patterns/short-dash.png +0 -0
  64. package/assets/esri/widgets/UtilityNetworkAssociations/assets/img/line-patterns/short-dot.png +0 -0
  65. package/assets/esri/widgets/UtilityNetworkAssociations/assets/img/line-patterns/solid.png +0 -0
  66. package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations.json +1 -1
  67. package/assets/esri/widgets/UtilityNetworkAssociations/t9n/UtilityNetworkAssociations_en.json +1 -1
  68. package/chunks/HighlightBlur.glsl.js +3 -3
  69. package/chunks/HighlightDownsample.glsl.js +24 -6
  70. package/chunks/SSAO.glsl.js +2 -2
  71. package/core/timeUtils.js +1 -1
  72. package/intl/date.js +1 -1
  73. package/layers/FeatureLayer.js +1 -1
  74. package/layers/ImageryLayer.js +1 -1
  75. package/layers/ImageryTileLayer.js +1 -1
  76. package/layers/StreamLayer.js +1 -1
  77. package/layers/SubtypeGroupLayer.js +1 -1
  78. package/layers/VoxelWasmPerSceneView.js +1 -1
  79. package/layers/graphics/sources/support/uploads.js +1 -1
  80. package/layers/save/featureLayerUtils.js +1 -1
  81. package/layers/save/imageryUtils.js +1 -1
  82. package/layers/save/streamLayerUtils.js +1 -1
  83. package/package.json +1 -1
  84. package/popup/support/FieldInfoFormat.js +1 -1
  85. package/support/revision.js +1 -1
  86. package/views/3d/environment/EnvironmentRenderer.js +1 -1
  87. package/views/3d/externalRenderers/ExternalRendererStore.js +1 -1
  88. package/views/3d/layers/i3s/PointRenderer.js +1 -1
  89. package/views/3d/support/LaserLineRenderer.js +1 -1
  90. package/views/3d/terrain/OverlayRenderer.js +1 -1
  91. package/views/3d/terrain/TerrainRenderer.js +1 -1
  92. package/views/3d/terrain/TerrainSurface.js +1 -1
  93. package/views/3d/webgl-engine/core/renderPasses/RenderPassManager.js +1 -1
  94. package/views/3d/webgl-engine/effects/RenderPlugin.js +1 -1
  95. package/views/3d/webgl-engine/effects/RenderPluginManager.js +1 -1
  96. package/views/3d/webgl-engine/effects/highlight/Highlight.js +1 -1
  97. package/views/3d/webgl-engine/effects/highlight/ShadowHighlight.js +1 -1
  98. package/views/3d/webgl-engine/effects/smaa/SMAA.js +1 -1
  99. package/views/3d/webgl-engine/effects/ssao/SSAO.js +1 -1
  100. package/views/3d/webgl-engine/lib/GLMaterialRepository.js +1 -1
  101. package/views/3d/webgl-engine/lib/GLMaterials.js +1 -1
  102. package/views/3d/webgl-engine/lib/Renderer.js +1 -1
  103. package/views/3d/webgl-engine/lib/lodRendering/LodRenderer.js +1 -1
  104. package/views/3d/webgl-engine/materials/CheckerBoardMaterial.js +1 -1
  105. package/views/3d/webgl-engine/materials/ColorMaterial.js +1 -1
  106. package/views/3d/webgl-engine/materials/DefaultMaterial.js +1 -1
  107. package/views/3d/webgl-engine/materials/HUDMaterial.js +1 -1
  108. package/views/3d/webgl-engine/materials/HeatmapDensityMaterial.js +1 -1
  109. package/views/3d/webgl-engine/materials/ImageMaterial.js +1 -1
  110. package/views/3d/webgl-engine/materials/LineCalloutMaterial.js +1 -1
  111. package/views/3d/webgl-engine/materials/LineMarkerMaterial.js +1 -1
  112. package/views/3d/webgl-engine/materials/MeasurementArrowMaterial.js +1 -1
  113. package/views/3d/webgl-engine/materials/NativeLineMaterial.js +1 -1
  114. package/views/3d/webgl-engine/materials/PathMaterial.js +1 -1
  115. package/views/3d/webgl-engine/materials/PatternMaterial.js +1 -1
  116. package/views/3d/webgl-engine/materials/RibbonLineMaterial.js +1 -1
  117. package/views/3d/webgl-engine/materials/ShadedColorMaterial.js +1 -1
  118. package/views/3d/webgl-engine/materials/SlicePlaneMaterial.js +1 -1
  119. package/views/3d/webgl-engine/materials/WaterMaterial.js +1 -1
  120. package/views/3d/webgl-engine/materials/renderers/MergedRenderer.js +1 -1
  121. package/views/3d/webgl-engine/shaders/HighlightDownsample.glsl.js +1 -1
  122. package/views/draw/DrawGraphicTool.js +1 -1
  123. package/views/draw/DrawOperation.js +1 -1
  124. package/views/interactive/sketch/constraints.js +1 -1
  125. package/views/interactive/sketch/normalizedPoint.js +1 -1
  126. package/views/interactive/snapping/SnappingManager.js +1 -1
  127. package/views/interactive/snapping/candidates/IntersectionSnappingCandidate.js +1 -1
  128. package/views/interactive/tooltip/TooltipEditableField.js +1 -1
  129. package/views/interactive/tooltip/TooltipEditableFieldAngle.js +1 -1
  130. package/views/interactive/tooltip/constraintUtils.js +5 -0
  131. package/views/support/angularMeasurementUtils.js +1 -1
  132. package/widgets/Editor/EditorViewModel.js +1 -1
  133. package/widgets/Editor/Upload.js +1 -1
  134. package/widgets/Editor/components/CreateFeaturesPanelContent.js +1 -1
  135. package/widgets/Editor/components/UploadDetails.js +1 -1
  136. package/widgets/Editor/modelUploadUtils.js +1 -1
  137. package/widgets/Editor.js +1 -1
  138. package/widgets/ElevationProfile/support/chartUtils.js +1 -1
  139. package/widgets/ElevationProfile.js +1 -1
  140. package/widgets/Feature/FeatureViewModel.js +1 -1
  141. package/widgets/Feature/support/featureUtils.js +1 -1
  142. package/widgets/UtilityNetworkAssociations/UtilityNetworkAssociationsLineSymbolPicker.js +5 -0
  143. package/widgets/UtilityNetworkAssociations/UtilityNetworkAssociationsViewModel.js +1 -1
  144. package/widgets/UtilityNetworkAssociations/VisibleElements.js +5 -0
  145. package/widgets/UtilityNetworkAssociations/VisibleElementsSettingsPane.js +5 -0
  146. package/widgets/UtilityNetworkAssociations.js +1 -1
  147. package/assets/esri/core/workers/chunks/11abbbf97093b55e2417.js +0 -1
  148. package/assets/esri/core/workers/chunks/1b2a081f2c3b97ba7e00.js +0 -1
  149. package/assets/esri/core/workers/chunks/235f333177ed7ea21e01.js +0 -1
  150. package/assets/esri/core/workers/chunks/3725dd14c2da0f47198f.js +0 -1
  151. package/assets/esri/core/workers/chunks/42595c4870c673ed451c.js +0 -1
  152. package/assets/esri/core/workers/chunks/481cdd2a4bc40c6fef66.js +0 -1
  153. package/assets/esri/core/workers/chunks/54893132e70c515ea7e3.js +0 -1
  154. package/assets/esri/core/workers/chunks/6509a4198972b323d9b6.js +0 -1
  155. package/assets/esri/core/workers/chunks/68598d2806d4aa3d8acc.js +0 -1
  156. package/assets/esri/core/workers/chunks/718d2e8ea61f3b7b70c5.js +0 -1
  157. package/assets/esri/core/workers/chunks/7bce4b5eec630ef57f1e.js +0 -1
  158. package/assets/esri/core/workers/chunks/8706dc9f852df9b2095d.js +0 -1
  159. package/assets/esri/core/workers/chunks/8ef26aac0fe7feb8c324.js +0 -1
  160. package/assets/esri/core/workers/chunks/91e61da22f258d9e86c5.js +0 -1
  161. package/assets/esri/core/workers/chunks/9f039bf79b34d8fd75ae.js +0 -1
  162. package/assets/esri/core/workers/chunks/a20fd9e7db37b3c3b041.js +0 -1
  163. package/assets/esri/core/workers/chunks/aa83dce42d64034a0a13.js +0 -1
  164. package/assets/esri/core/workers/chunks/cdcf0a5e05283d37b3ac.js +0 -1
  165. package/assets/esri/core/workers/chunks/d4f9106bf2ea5d66d96a.js +0 -1
  166. package/assets/esri/core/workers/chunks/e6bfbc4347fa13db4df2.js +0 -1
  167. package/assets/esri/core/workers/chunks/f1d5487f2d828fb142ba.js +0 -1
  168. package/assets/esri/core/workers/chunks/f97f165d05439e668e05.js +0 -1
  169. package/assets/esri/core/workers/chunks/fe973d8155c22d73a4f9.js +0 -1
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[9059,5732],{92835:(e,t,r)=>{r.d(t,{Z:()=>m});var i,n=r(43697),s=r(96674),o=r(35463),a=r(5600),l=(r(75215),r(67676),r(80442),r(71715)),d=r(52011),u=r(30556);let h=i=class extends s.wq{static get allTime(){return y}static get empty(){return c}constructor(e){super(e),this.end=null,this.start=null}readEnd(e,t){return null!=t.end?new Date(t.end):null}writeEnd(e,t){t.end=e?.getTime()??null}get isAllTime(){return this.equals(i.allTime)}get isEmpty(){return this.equals(i.empty)}readStart(e,t){return null!=t.start?new Date(t.start):null}writeStart(e,t){t.start=e?.getTime()??null}clone(){return new i({end:this.end,start:this.start})}equals(e){if(!e)return!1;const t=this.start?.getTime()??this.start,r=this.end?.getTime()??this.end,i=e.start?.getTime()??e.start,n=e.end?.getTime()??e.end;return t===i&&r===n}expandTo(e,t="system"){if(this.isEmpty||this.isAllTime)return this.clone();let r=this.start;r&&(r=(0,o.JE)(r,e,t));let n=this.end;if(n){const r=(0,o.JE)(n,e,t);n=n.getTime()===r.getTime()?r:(0,o.Nm)(r,1,e,t)}return new i({start:r,end:n})}intersection(e){if(!e)return this.clone();if(this.isEmpty||e.isEmpty)return i.empty;if(this.isAllTime)return e.clone();if(e.isAllTime)return this.clone();const t=this.start?.getTime()??-1/0,r=this.end?.getTime()??1/0,n=e.start?.getTime()??-1/0,s=e.end?.getTime()??1/0;let o,a;if(n>=t&&n<=r?o=n:t>=n&&t<=s&&(o=t),r>=n&&r<=s?a=r:s>=t&&s<=r&&(a=s),null!=o&&null!=a&&!isNaN(o)&&!isNaN(a)){const e=new i;return e.start=o===-1/0?null:new Date(o),e.end=a===1/0?null:new Date(a),e}return i.empty}offset(e,t,r="system"){if(this.isEmpty||this.isAllTime)return this.clone();const n=new i,{start:s,end:a}=this;return null!=s&&(n.start=(0,o.Nm)(s,e,t,r)),null!=a&&(n.end=(0,o.Nm)(a,e,t,r)),n}union(e){if(!e||e.isEmpty)return this.clone();if(this.isEmpty)return e.clone();if(this.isAllTime||e.isAllTime)return y.clone();const t=null!=this.start&&null!=e.start?new Date(Math.min(this.start.getTime(),e.start.getTime())):null,r=null!=this.end&&null!=e.end?new Date(Math.max(this.end.getTime(),e.end.getTime())):null;return new i({start:t,end:r})}};(0,n._)([(0,a.Cb)({type:Date,json:{write:{allowNull:!0}}})],h.prototype,"end",void 0),(0,n._)([(0,l.r)("end")],h.prototype,"readEnd",null),(0,n._)([(0,u.c)("end")],h.prototype,"writeEnd",null),(0,n._)([(0,a.Cb)({readOnly:!0,json:{read:!1}})],h.prototype,"isAllTime",null),(0,n._)([(0,a.Cb)({readOnly:!0,json:{read:!1}})],h.prototype,"isEmpty",null),(0,n._)([(0,a.Cb)({type:Date,json:{write:{allowNull:!0}}})],h.prototype,"start",void 0),(0,n._)([(0,l.r)("start")],h.prototype,"readStart",null),(0,n._)([(0,u.c)("start")],h.prototype,"writeStart",null),h=i=(0,n._)([(0,d.j)("esri.TimeExtent")],h);const y=new h,c=new h({start:void 0,end:void 0}),m=h},5732:(e,t,r)=>{r.d(t,{c:()=>i,g:()=>n});var i="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function n(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}},57435:(e,t,r)=>{r.d(t,{Z:()=>d});var i=r(43697),n=r(46791),s=(r(66643),r(20102),r(92604),r(26258),r(87538)),o=r(5600),a=r(52011);let l=class extends n.Z{constructor(e){super(e),this.getCollections=null}initialize(){this.addHandles((0,s.EH)((()=>this._refresh())))}destroy(){this.getCollections=null}_refresh(){const e=null!=this.getCollections?this.getCollections():null;if(null==e)return void this.removeAll();let t=0;for(const r of e)null!=r&&(t=this._processCollection(t,r));this.splice(t,this.length)}_createNewInstance(e){return new n.Z(e)}_processCollection(e,t){if(!t)return e;const r=this.itemFilterFunction??(e=>!!e);for(const i of t)if(i){if(r(i)){const t=this.indexOf(i,e);t>=0?t!==e&&this.reorder(i,e):this.add(i,e),++e}if(this.getChildrenFunction){const t=this.getChildrenFunction(i);if(Array.isArray(t))for(const r of t)e=this._processCollection(e,r);else e=this._processCollection(e,t)}}return e}};(0,i._)([(0,o.Cb)()],l.prototype,"getCollections",void 0),(0,i._)([(0,o.Cb)()],l.prototype,"getChildrenFunction",void 0),(0,i._)([(0,o.Cb)()],l.prototype,"itemFilterFunction",void 0),l=(0,i._)([(0,a.j)("esri.core.CollectionFlattener")],l);const d=l},70921:(e,t,r)=>{r.d(t,{R:()=>s,Z:()=>n});var i=r(46791);function n(e,t,r=i.Z){return t||(t=new r),t===e||(t.removeAll(),(n=e)&&(Array.isArray(n)||"items"in n&&Array.isArray(n.items))?t.addMany(e):e&&t.add(e)),t;var n}function s(e){return e}},68668:(e,t,r)=>{r.d(t,{G:()=>o,w:()=>a});var i=r(66643),n=r(46791),s=r(83379);async function o(e,t){return await e.load(),a(e,t)}async function a(e,t){const r=[],o=(...e)=>{for(const t of e)null!=t&&(Array.isArray(t)?o(...t):n.Z.isCollection(t)?t.forEach((e=>o(e))):s.Z.isLoadable(t)&&r.push(t))};t(o);let a=null;if(await(0,i.UI)(r,(async e=>{const t=await(0,i.q6)(function(e){return"loadAll"in e&&"function"==typeof e.loadAll}(e)?e.loadAll():e.load());!1!==t.ok||a||(a=t)})),a)throw a.error;return e}},17445:(e,t,r)=>{r.d(t,{N1:()=>y,YP:()=>l,Z_:()=>p,gx:()=>d,nn:()=>f,on:()=>h,tX:()=>g}),r(66643),r(46791);var i=r(91460),n=r(50758),s=r(70586),o=r(95330),a=r(26258);function l(e,t,r={}){return u(e,t,r,c)}function d(e,t,r={}){return u(e,t,r,m)}function u(e,t,r={},i){let n=null;const o=r.once?(e,r)=>{i(e)&&((0,s.hw)(n),t(e,r))}:(e,r)=>{i(e)&&t(e,r)};if(n=(0,a.aQ)(e,o,r.sync,r.equals),r.initial){const t=e();o(t,t)}return n}function h(e,t,r,o={}){let a=null,d=null,u=null;function h(){a&&d&&(d.remove(),o.onListenerRemove?.(a),a=null,d=null)}function y(e){o.once&&o.once&&(0,s.hw)(u),r(e)}const c=l(e,((e,r)=>{h(),(0,i.vT)(e)&&(a=e,d=(0,i.on)(e,t,y),o.onListenerAdd?.(e))}),{sync:o.sync,initial:!0});return u=(0,n.kB)((()=>{c.remove(),h()})),u}function y(e,t){return function(e,t,r){if((0,o.Hc)(r))return Promise.reject((0,o.zE)());const i=e();if(t?.(i))return Promise.resolve(i);let a=null;function l(){a=(0,s.hw)(a)}return new Promise(((i,s)=>{a=(0,n.AL)([(0,o.fu)(r,(()=>{l(),s((0,o.zE)())})),u(e,(e=>{l(),i(e)}),{sync:!1,once:!0},t??c)])}))}(e,m,t)}function c(e){return!0}function m(e){return!!e}r(87538);const p={sync:!0},f={initial:!0},g={sync:!0,initial:!0}},35463:(e,t,r)=>{r.d(t,{JE:()=>a,Nm:()=>o,rJ:()=>l});var i=r(90344),n=r(17126);const s={milliseconds:1,seconds:1e3,minutes:6e4,hours:36e5,days:864e5,weeks:6048e5,months:26784e5,years:31536e6,decades:31536e7,centuries:31536e8};function o(e,t,r,i="system"){const s=u(i),o=n.ou.fromJSDate(e,{zone:s}),a="decades"===r||"centuries"===r?"year":d(r);return"decades"===r&&(t*=10),"centuries"===r&&(t*=100),o.plus({[a]:t}).toJSDate()}function a(e,t,r="system"){const i=u(r),s=n.ou.fromJSDate(e,{zone:i});if("decades"===t||"centuries"===t){const e=s.startOf("year"),{year:r}=e,i=r-r%("decades"===t?10:100);return e.set({year:i}).toJSDate()}const o=d(t);return s.startOf(o).toJSDate()}function l(e,t,r){return 0===e?0:e*s[t]/s[r]}function d(e){switch(e){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 u(e){const t=(0,i.f1)(e);return t?new n.vF(t):n.Oh.instance}},90344:(e,t,r)=>{r.d(t,{LJ:()=>L,Xr:()=>g,Ze:()=>_,cZ:()=>d,f1:()=>I,i$:()=>E,o8:()=>C,p6:()=>T});var i=r(35454),n=r(70171),s=r(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},d={timeZone:"Etc/UTC"},u={year:"numeric",month:"numeric",day:"numeric"},h={year:"numeric",month:"long",day:"numeric"},y={year:"numeric",month:"short",day:"numeric"},c={year:"numeric",month:"long",weekday:"long",day:"numeric"},m={hour:"numeric",minute:"numeric"},p={...m,second:"numeric"},f={"short-date":u,"short-date-short-time":{...u,...m},"short-date-short-time-24":{...u,...m,hour12:!1},"short-date-long-time":{...u,...p},"short-date-long-time-24":{...u,...p,hour12:!1},"short-date-le":u,"short-date-le-short-time":{...u,...m},"short-date-le-short-time-24":{...u,...m,hour12:!1},"short-date-le-long-time":{...u,...p},"short-date-le-long-time-24":{...u,...p,hour12:!1},"long-month-day-year":h,"long-month-day-year-short-time":{...h,...m},"long-month-day-year-short-time-24":{...h,...m,hour12:!1},"long-month-day-year-long-time":{...h,...p},"long-month-day-year-long-time-24":{...h,...p,hour12:!1},"day-short-month-year":y,"day-short-month-year-short-time":{...y,...m},"day-short-month-year-short-time-24":{...y,...m,hour12:!1},"day-short-month-year-long-time":{...y,...p},"day-short-month-year-long-time-24":{...y,...p,hour12:!1},"long-date":c,"long-date-short-time":{...c,...m},"long-date-short-time-24":{...c,...m,hour12:!1},"long-date-long-time":{...c,...p},"long-date-long-time-24":{...c,...p,hour12:!1},"long-month-year":{month:"long",year:"numeric"},"short-month-year":{month:"short",year:"numeric"},year:{year:"numeric"},"short-time":m,"long-time":p},g=(0,i.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 b=new WeakMap;const w=f["short-date-short-time"];function _(e){return f[e]}function T(e,t=w){return function(e){let t=b.get(e);if(!t){const r=(0,n.Kd)(),i=v[r]||r,s=I(e.timeZone??"system"),o={...e,timeZone:s};t=new Intl.DateTimeFormat(i,o),b.set(e,t)}return t}(t).format(e)}function C(e,t=w){return T(new Date(e),{...t,...d,...a})}function L(e,t=w){return T(new Date(`1970-01-01T${e}Z`),{...t,...d,...o})}function E(e,t=w){const r=s.ou.fromISO(e,{setZone:!0}),i=(0,n.Kd)(),o=v[i]??i;return r.toLocaleString({...l,...t},{locale:o})}function I(e){switch(e){case"system":return;case"unknown":return"UTC";default:return e}}(0,n.Ze)((()=>{b=new WeakMap}))},40504:(e,t,r)=>{r.r(t),r.d(t,{default:()=>D});var i=r(43697),n=r(57435),s=r(68668),o=r(92604),a=r(16453),l=r(17445),d=r(5600),u=(r(75215),r(67676),r(80442),r(1153)),h=r(52011),y=r(30556),c=r(87085),m=r(71612),p=r(38009),f=r(16859),g=r(72965),v=r(87344),b=r(46791),w=r(70921),_=r(95330);function T(e,t,r){let i,n;if(e)for(let s=0,o=e.length;s<o;s++){if(i=e.at(s),i?.[t]===r)return i;if("group"===i?.type&&(n=T(i.layers,t,r),n))return n}}const C=e=>{let t=class extends e{constructor(...e){super(...e),this.layers=new b.Z;const t=e=>{e.parent=this,this.layerAdded(e),"elevation"!==e.type&&"base-elevation"!==e.type||o.Z.getLogger(this).error(`Layer 'title:${e.title}, id:${e.id}' of type '${e.type}' is not supported as an operational layer and will therefore be ignored.`)},r=e=>{e.parent=null,this.layerRemoved(e)};this.addHandles([this.layers.on("before-add",(e=>(e=>{e.parent&&"remove"in e.parent&&e.parent.remove(e)})(e.item))),this.layers.on("after-add",(e=>t(e.item))),this.layers.on("after-remove",(e=>r(e.item)))])}destroy(){const e=this.layers.toArray();for(const t of e)t.destroy();this.layers.destroy()}set layers(e){this._set("layers",(0,w.Z)(e,this._get("layers")))}add(e,t){const r=this.layers;if(t=r.getNextIndex(t),e instanceof c.Z){const i=e;i.parent===this?this.reorder(i,t):r.add(i,t)}else(0,_.y8)(e)?e.then((e=>{this.destroyed||this.add(e,t)})):o.Z.getLogger(this).error("#add()","The item being added is not a Layer or a Promise that resolves to a Layer.")}addMany(e,t){const r=this.layers;let i=r.getNextIndex(t);e.slice().forEach((e=>{e.parent!==this?(r.add(e,i),i+=1):this.reorder(e,i)}))}findLayerById(e){return T(this.layers,"id",e)}findLayerByUid(e){return T(this.layers,"uid",e)}remove(e){return this.layers.remove(e)}removeMany(e){return this.layers.removeMany(e)}removeAll(){return this.layers.removeAll()}reorder(e,t){return this.layers.reorder(e,t)}layerAdded(e){}layerRemoved(e){}};return(0,i._)([(0,d.Cb)()],t.prototype,"layers",null),t=(0,i._)([(0,h.j)("esri.support.LayersMixin")],t),t};function L(e,t,r){if(e)for(let i=0,n=e.length;i<n;i++){const n=e.at(i);if(n[t]===r)return n;if("group"===n?.type){const e=L(n.tables,t,r);if(e)return e}}}const E=e=>{let t=class extends e{constructor(...e){super(...e),this.tables=new b.Z,this.addHandles([this.tables.on("after-add",(e=>{const t=e.item;t.parent&&t.parent!==this&&"tables"in t.parent&&t.parent.tables.remove(t),t.parent=this,"feature"!==t.type&&o.Z.getLogger(this).error(`Layer 'title:${t.title}, id:${t.id}' of type '${t.type}' is not supported as a table and will therefore be ignored.`)})),this.tables.on("after-remove",(e=>{e.item.parent=null}))])}destroy(){const e=this.tables.toArray();for(const t of e)t.destroy();this.tables.destroy()}set tables(e){this._set("tables",(0,w.Z)(e,this._get("tables")))}findTableById(e){return L(this.tables,"id",e)}findTableByUid(e){return L(this.tables,"uid",e)}};return(0,i._)([(0,d.Cb)()],t.prototype,"tables",null),t=(0,i._)([(0,h.j)("esri.support.TablesMixin")],t),t},I=Symbol("WebScene");var S=r(15650);let M=class extends((0,m.h)((0,g.M)((0,p.q)((0,f.I)(E(C((0,a.R)(c.Z)))))))){constructor(e){var t;super(e),this.allLayers=new n.Z({getCollections:()=>[this.layers],getChildrenFunction:e=>"layers"in e?e.layers:null}),this.allTables=(t=this,new n.Z({getCollections:()=>[t.tables,t.layers],getChildrenFunction:e=>{const t=[];return"tables"in e&&t.push(e.tables),"layers"in e&&t.push(e.layers),t},itemFilterFunction:e=>{const t=e.parent;return!!t&&"tables"in t&&t.tables.includes(e)}})),this.fullExtent=void 0,this.operationalLayerType="GroupLayer",this.spatialReference=void 0,this.type="group"}initialize(){this._enforceVisibility(this.visibilityMode,this.visible),this.addHandles([(0,l.YP)((()=>{let e=this.parent;for(;e&&"parent"in e&&e.parent;)e=e.parent;return e&&I in e}),(e=>{const t="prevent-adding-tables";this.removeHandles(t),e&&(this.tables.removeAll(),this.addHandles((0,l.on)((()=>this.tables),"before-add",(e=>{e.preventDefault(),o.Z.getLogger(this).errorOnce("tables","Tables are not yet supported in a WebScene so they can't be added.")})),t))}),l.tX),(0,l.YP)((()=>this.visible),this._onVisibilityChange.bind(this),l.Z_)])}destroy(){this.allLayers.destroy(),this.allTables.destroy()}_writeLayers(e,t,r,i){const n=[];if(!e)return n;e.forEach((e=>{const t=(0,S.Nw)(e,i.webmap?i.webmap.getLayerJSONFromResourceInfo(e):null,i);null!=t&&t.layerType&&n.push(t)})),t.layers=n}set portalItem(e){this._set("portalItem",e)}set visibilityMode(e){const t=this._get("visibilityMode")!==e;this._set("visibilityMode",e),t&&this._enforceVisibility(e,this.visible)}load(e){return this.addResolvingPromise(this.loadFromPortal({supportedTypes:["Feature Service","Feature Collection","Scene Service"],layerModuleTypeMap:v.T},e)),Promise.resolve(this)}async loadAll(){return(0,s.G)(this,(e=>{e(this.layers,this.tables)}))}layerAdded(e){e.visible&&"exclusive"===this.visibilityMode?this._turnOffOtherLayers(e):"inherited"===this.visibilityMode&&(e.visible=this.visible),this.hasHandles(e.uid)?console.error(`Layer readded to Grouplayer: uid=${e.uid}`):this.addHandles((0,l.YP)((()=>e.visible),(t=>this._onChildVisibilityChange(e,t)),l.Z_),e.uid)}layerRemoved(e){this.removeHandles(e.uid),this._enforceVisibility(this.visibilityMode,this.visible)}_turnOffOtherLayers(e){this.layers.forEach((t=>{t!==e&&(t.visible=!1)}))}_enforceVisibility(e,t){if(!(0,u.vw)(this).initialized)return;const r=this.layers;let i=r.find((e=>e.visible));switch(e){case"exclusive":r.length&&!i&&(i=r.at(0),i.visible=!0),this._turnOffOtherLayers(i);break;case"inherited":r.forEach((e=>{e.visible=t}))}}_onVisibilityChange(e){"inherited"===this.visibilityMode&&this.layers.forEach((t=>{t.visible=e}))}_onChildVisibilityChange(e,t){switch(this.visibilityMode){case"exclusive":t?this._turnOffOtherLayers(e):this._isAnyLayerVisible()||(e.visible=!0);break;case"inherited":e.visible=this.visible}}_isAnyLayerVisible(){return this.layers.some((e=>e.visible))}};(0,i._)([(0,d.Cb)({readOnly:!0,dependsOn:[]})],M.prototype,"allLayers",void 0),(0,i._)([(0,d.Cb)({readOnly:!0})],M.prototype,"allTables",void 0),(0,i._)([(0,d.Cb)()],M.prototype,"fullExtent",void 0),(0,i._)([(0,d.Cb)({json:{read:!0,write:!0}})],M.prototype,"blendMode",void 0),(0,i._)([(0,d.Cb)({json:{read:!1,write:{ignoreOrigin:!0}}})],M.prototype,"layers",void 0),(0,i._)([(0,y.c)("layers")],M.prototype,"_writeLayers",null),(0,i._)([(0,d.Cb)({type:["GroupLayer"]})],M.prototype,"operationalLayerType",void 0),(0,i._)([(0,d.Cb)({json:{origins:{"web-document":{read:!1,write:!1}}}})],M.prototype,"portalItem",null),(0,i._)([(0,d.Cb)()],M.prototype,"spatialReference",void 0),(0,i._)([(0,d.Cb)({json:{read:!1},readOnly:!0,value:"group"})],M.prototype,"type",void 0),(0,i._)([(0,d.Cb)({type:["independent","inherited","exclusive"],value:"independent",json:{write:!0,origins:{"web-map":{type:["independent","exclusive"],write:(e,t,r)=>{"inherited"!==e&&(t[r]=e)}}}}})],M.prototype,"visibilityMode",null),M=(0,i._)([(0,h.j)("esri.layers.GroupLayer")],M);const D=M},16859:(e,t,r)=>{r.d(t,{I:()=>T});var i=r(43697),n=r(68773),s=r(40330),o=r(3172),a=r(66643),l=r(20102),d=r(92604),u=r(70586),h=r(95330),y=r(17452),c=r(5600),m=(r(75215),r(67676),r(80442),r(71715)),p=r(52011),f=r(30556),g=r(84230),v=r(48522),b=r(15235),w=r(86082),_=r(14661);const T=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,u.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 b.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:i}=await r.e(8062).then(r.bind(r,18062));return(0,h.k_)(t),await i({instance:this,supportedTypes:e.supportedTypes,validateItem:e.validateItem,supportsData:e.supportsData,layerModuleTypeMap:e.layerModuleTypeMap},t)}catch(e){throw(0,h.D_)(e)||d.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,h.r9)(e),!0))))}async setUserPrivileges(e,t){if(!n.default.userPrivilegesApplied)return this.finishLoadEditablePortalLayer(t);if(this.url)try{const{features:{edit:r,fullEdit:i},content:{updateItem:n}}=await this._fetchUserPrivileges(e,t);this._set("userHasEditingPrivileges",r),this._set("userHasFullEditingPrivileges",i),this._set("userHasUpdateItemPrivileges",n)}catch(e){(0,h.r9)(e)}}async _fetchUserPrivileges(e,t){let r=this.portalItem;if(!e||!r||!r.loaded||r.sourceUrl)return this._fetchFallbackUserPrivileges(t);const i=e===r.id;if(i&&r.portal.user)return(0,_.Ss)(r);let n,o;if(i)n=r.portal.url;else try{n=await(0,g.oP)(this.url,t)}catch(e){(0,h.r9)(e)}if(!n||!(0,y.Zo)(n,r.portal.url))return this._fetchFallbackUserPrivileges(t);try{const e=null!=t?t.signal:null;o=await(s.id?.getCredential(`${n}/sharing`,{prompt:!1,signal:e}))}catch(e){(0,h.r9)(e)}if(!o)return{features:{edit:!0,fullEdit:!1},content:{updateItem:!1}};try{if(i?await r.reload():(r=new b.default({id:e,portal:{url:n}}),await r.load(t)),r.portal.user)return(0,_.Ss)(r)}catch(e){(0,h.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,h.r9)(e)}return{features:{edit:t,fullEdit:!1},content:{updateItem:!1}}}async _fetchUserHasEditingPrivileges(e){const t=this.url?s.id?.findCredential(this.url):null;if(!t)return!0;const r=C.credential===t?C.user:await this._fetchEditingUser(e);return C.credential=t,C.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=s.id.findServerInfo(this.url??"");if(!r?.owningSystemUrl)return null;const i=`${r.owningSystemUrl}/sharing/rest`,n=v.Z.getDefault();if(n&&n.loaded&&(0,y.Fv)(n.restUrl)===(0,y.Fv)(i))return n.user;const l=`${i}/community/self`,d=null!=e?e.signal:null,u=await(0,a.q6)((0,o.Z)(l,{authMode:"no-prompt",query:{f:"json"},signal:d}));return u.ok?w.Z.fromJSON(u.value.data):null}read(e,t){t&&(t.layer=this),super.read(e,t)}write(e,t){const r=t&&t.portal,i=this.portalItem&&this.portalItem.id&&(this.portalItem.portal||v.Z.getDefault());return r&&i&&!(0,y.tm)(i.restUrl,r.restUrl)?(t.messages&&t.messages.push(new l.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,i._)([(0,c.Cb)({type:b.default})],t.prototype,"portalItem",null),(0,i._)([(0,m.r)("web-document","portalItem",["itemId"])],t.prototype,"readPortalItem",null),(0,i._)([(0,f.c)("web-document","portalItem",{itemId:{type:String}})],t.prototype,"writePortalItem",null),(0,i._)([(0,c.Cb)({clonable:!1})],t.prototype,"resourceReferences",void 0),(0,i._)([(0,c.Cb)({type:Boolean,readOnly:!0})],t.prototype,"userHasEditingPrivileges",void 0),(0,i._)([(0,c.Cb)({type:Boolean,readOnly:!0})],t.prototype,"userHasFullEditingPrivileges",void 0),(0,i._)([(0,c.Cb)({type:Boolean,readOnly:!0})],t.prototype,"userHasUpdateItemPrivileges",void 0),t=(0,i._)([(0,p.j)("esri.layers.mixins.PortalLayer")],t),t},C={credential:null,user:null}},15650:(e,t,r)=>{r.d(t,{Nw:()=>h});var i=r(20102),n=r(22974),s=r(78286),o=r(827),a=r(84230);const l=new Set(["bing-maps","imagery","imagery-tile","map-image","open-street-map","tile","unknown","unsupported","vector-tile","web-tile","wms","wmts"]),d=new Set(["csv","feature","geo-rss","geojson","group","imagery","imagery-tile","kml","map-image","map-notes","media","ogc-feature","route","stream","subtype-group","tile","unknown","unsupported","vector-tile","web-tile","wfs","wms","wmts"]);function u(e,t){"maxScale"in e&&(t.maxScale=(0,o.k)(e.maxScale)??void 0),"minScale"in e&&(t.minScale=(0,o.k)(e.minScale)??void 0)}function h(e,t,r){if(!("write"in e)||!e.write)return r&&r.messages&&r.messages.push(new i.Z("layer:unsupported",`Layers (${e.title}, ${e.id}) of type '${e.declaredClass}' cannot be persisted`,{layer:e})),null;if(function(e,t){if(t.restrictedWebMapWriting){const r=function(e){return"basemap"===e.layerContainerType?l:"operational-layers"===e.layerContainerType?d:null}(t);return null==r||r.has(e.type)&&!(0,a.rQ)(e)}return!0}(e,r)){const t={};return e.write(t,r)?t:null}return null!=t&&function(e,t){if(function(e,t){if(t)if((0,a.rQ)(e)){const r=(0,s.hS)("featureCollection.layers",t),i=r&&r[0]&&r[0].layerDefinition;i&&u(e,i)}else"group"!==e.type&&u(e,t)}(e,t),t&&("blendMode"in e&&(t.blendMode=e.blendMode,"normal"===t.blendMode&&delete t.blendMode),t.opacity=(0,o.k)(e.opacity)??void 0,t.title=e.title||"Layer",t.visibility=e.visible,"legendEnabled"in e&&"wmts"!==e.type))if((0,a.rQ)(e)){const r=t.featureCollection;r&&(r.showLegend=e.legendEnabled)}else t.showLegend=e.legendEnabled}(e,t=(0,n.d9)(t)),t}}}]);
@@ -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}}}}]);
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[2530],{92835:(e,t,i)=>{i.d(t,{Z:()=>p});var r,s=i(43697),n=i(96674),o=i(35463),a=i(5600),l=(i(75215),i(67676),i(80442),i(71715)),h=i(52011),u=i(30556);let c=r=class extends n.wq{static get allTime(){return d}static get empty(){return m}constructor(e){super(e),this.end=null,this.start=null}readEnd(e,t){return null!=t.end?new Date(t.end):null}writeEnd(e,t){t.end=e?.getTime()??null}get isAllTime(){return this.equals(r.allTime)}get isEmpty(){return this.equals(r.empty)}readStart(e,t){return null!=t.start?new Date(t.start):null}writeStart(e,t){t.start=e?.getTime()??null}clone(){return new r({end:this.end,start:this.start})}equals(e){if(!e)return!1;const t=this.start?.getTime()??this.start,i=this.end?.getTime()??this.end,r=e.start?.getTime()??e.start,s=e.end?.getTime()??e.end;return t===r&&i===s}expandTo(e,t="system"){if(this.isEmpty||this.isAllTime)return this.clone();let i=this.start;i&&(i=(0,o.JE)(i,e,t));let s=this.end;if(s){const i=(0,o.JE)(s,e,t);s=s.getTime()===i.getTime()?i:(0,o.Nm)(i,1,e,t)}return new r({start:i,end:s})}intersection(e){if(!e)return this.clone();if(this.isEmpty||e.isEmpty)return r.empty;if(this.isAllTime)return e.clone();if(e.isAllTime)return this.clone();const t=this.start?.getTime()??-1/0,i=this.end?.getTime()??1/0,s=e.start?.getTime()??-1/0,n=e.end?.getTime()??1/0;let o,a;if(s>=t&&s<=i?o=s:t>=s&&t<=n&&(o=t),i>=s&&i<=n?a=i:n>=t&&n<=i&&(a=n),null!=o&&null!=a&&!isNaN(o)&&!isNaN(a)){const e=new r;return e.start=o===-1/0?null:new Date(o),e.end=a===1/0?null:new Date(a),e}return r.empty}offset(e,t,i="system"){if(this.isEmpty||this.isAllTime)return this.clone();const s=new r,{start:n,end:a}=this;return null!=n&&(s.start=(0,o.Nm)(n,e,t,i)),null!=a&&(s.end=(0,o.Nm)(a,e,t,i)),s}union(e){if(!e||e.isEmpty)return this.clone();if(this.isEmpty)return e.clone();if(this.isAllTime||e.isAllTime)return d.clone();const t=null!=this.start&&null!=e.start?new Date(Math.min(this.start.getTime(),e.start.getTime())):null,i=null!=this.end&&null!=e.end?new Date(Math.max(this.end.getTime(),e.end.getTime())):null;return new r({start:t,end:i})}};(0,s._)([(0,a.Cb)({type:Date,json:{write:{allowNull:!0}}})],c.prototype,"end",void 0),(0,s._)([(0,l.r)("end")],c.prototype,"readEnd",null),(0,s._)([(0,u.c)("end")],c.prototype,"writeEnd",null),(0,s._)([(0,a.Cb)({readOnly:!0,json:{read:!1}})],c.prototype,"isAllTime",null),(0,s._)([(0,a.Cb)({readOnly:!0,json:{read:!1}})],c.prototype,"isEmpty",null),(0,s._)([(0,a.Cb)({type:Date,json:{write:{allowNull:!0}}})],c.prototype,"start",void 0),(0,s._)([(0,l.r)("start")],c.prototype,"readStart",null),(0,s._)([(0,u.c)("start")],c.prototype,"writeStart",null),c=r=(0,s._)([(0,h.j)("esri.TimeExtent")],c);const d=new c,m=new c({start:void 0,end:void 0}),p=c},25929:(e,t,i)=>{i.d(t,{M:()=>p,a:()=>g,e:()=>d,f:()=>s,i:()=>u,p:()=>c,r:()=>o,t:()=>n,w:()=>a});var r=i(17452);function s(e,t){const i=t&&t.url&&t.url.path;if(e&&i&&(e=(0,r.hF)(e,i,{preserveProtocolRelative:!0}),t.portalItem&&t.readResourcePaths)){const i=(0,r.PF)(e,t.portalItem.itemUrl);null!=i&&h.test(i)&&t.readResourcePaths.push(t.portalItem.resourceFromPath(i).path)}return m(e,t&&t.portal)}function n(e,t,i=p.YES){if(null==e)return e;!(0,r.YP)(e)&&t&&t.blockedRelativeUrls&&t.blockedRelativeUrls.push(e);let s=(0,r.hF)(e);if(t){const i=t.verifyItemRelativeUrls&&t.verifyItemRelativeUrls.rootPath||t.url&&t.url.path;if(i){const n=m(i,t.portal),o=m(s,t.portal);s=(0,r.PF)(o,n,n),null!=s&&s!==o&&s!==e&&t.verifyItemRelativeUrls&&t.verifyItemRelativeUrls.writtenUrls.push(s)}}return s=d(s,t?.portal),(0,r.YP)(s)&&(s=(0,r.Fv)(s)),t?.resources&&t?.portalItem&&!(0,r.YP)(s)&&!(0,r.HK)(s)&&i===p.YES&&t.resources.toKeep.push({resource:t.portalItem.resourceFromPath(s),compress:!1}),s}function o(e,t,i){return s(e,i)}function a(e,t,i,r){const s=n(e,r);void 0!==s&&(t[i]=s)}const l=/\/items\/([^\/]+)\/resources\/(.*)/,h=/^\.\/resources\//;function u(e){const t=e?.match(l)??null;return t?.[1]??null}function c(e){const t=e?.match(l)??null;if(null==t)return null;const i=t[2],s=i.lastIndexOf("/");if(-1===s){const{path:e,extension:t}=(0,r.fZ)(i);return{prefix:null,filename:e,extension:t}}const{path:n,extension:o}=(0,r.fZ)(i.slice(s+1));return{prefix:i.slice(0,s),filename:n,extension:o}}function d(e,t){return t&&!t.isPortal&&t.urlKey&&t.customBaseUrl?(0,r.Ie)(e,`${t.urlKey}.${t.customBaseUrl}`,t.portalHostname):e}function m(e,t){if(!t||t.isPortal||!t.urlKey||!t.customBaseUrl)return e;const i=`${t.urlKey}.${t.customBaseUrl}`,s=(0,r.TI)();return(0,r.D6)(s,`${s.scheme}://${i}`)?(0,r.Ie)(e,t.portalHostname,i):(0,r.Ie)(e,i,t.portalHostname)}var p,y;(y=p||(p={}))[y.YES=0]="YES",y[y.NO=1]="NO";const g=Object.freeze(Object.defineProperty({__proto__:null,get MarkKeep(){return p},ensureMainOnlineDomain:d,fromJSON:s,itemIdFromResourceUrl:u,prefixAndFilenameFromResourceUrl:c,read:o,toJSON:n,write:a},Symbol.toStringTag,{value:"Module"}))},10699:(e,t,i)=>{i.d(t,{IG:()=>o,iv:()=>a});var r=i(43697),s=i(52011);let n=0;const o=e=>{let t=class extends e{constructor(...e){super(...e),Object.defineProperty(this,"uid",{writable:!1,configurable:!1,value:Date.now().toString(16)+"-object-"+n++})}};return t=(0,r._)([(0,s.j)("esri.core.Identifiable")],t),t},a=e=>{let t=class extends e{constructor(...e){super(...e),Object.defineProperty(this,"uid",{writable:!1,configurable:!1,value:n++})}};return t=(0,r._)([(0,s.j)("esri.core.NumericIdentifiable")],t),t};let l=class extends(o(class{})){};l=(0,r._)([(0,s.j)("esri.core.Identifiable")],l)},13867:(e,t,i)=>{i.d(t,{z:()=>s});var r=i(69801);class s{constructor(e,t){this._storage=new r.WJ,this.id="",this.name="",this.size=0,this._storage.maxSize=e,this._storage.register(this),t&&this._storage.registerRemoveFunc("",t)}destroy(){this._storage.deregister(this),this._storage.destroy()}put(e,t,i=1){this._storage.put(this,e,t,i,1)}pop(e){return this._storage.pop(this,e)}get(e){return this._storage.get(this,e)}clear(){this._storage.clearAll()}get maxSize(){return this._storage.maxSize}set maxSize(e){this._storage.maxSize=e}resetHitRate(){}}},69801:(e,t,i)=>{i.d(t,{WJ:()=>a,Xq:()=>o});var r,s,n=i(44553);(s=r||(r={}))[s.ALL=0]="ALL",s[s.SOME=1]="SOME";class o{constructor(e,t,i){this.name=e,this._storage=t,this.id=l+++":",this.size=0,this.maxSize=0,this._removeFunc=!1,this._hit=0,this._miss=0,this._storage.register(this),i&&(this._storage.registerRemoveFunc(this.id,i),this._removeFunc=!0)}destroy(){this._storage.clear(this),this._removeFunc&&this._storage.deregisterRemoveFunc(this.id),this._storage.deregister(this),this._storage=null}get hitRate(){return this._hit/(this._hit+this._miss)}get sizeAll(){return this._storage.size}resetHitRate(){this._hit=this._miss=0}put(e,t,i,r=0){this._storage.put(this,e,t,i,r)}get(e){const t=this._storage.get(this,e);return void 0===t?++this._miss:++this._hit,t}peek(e){return this._storage.peek(this,e)}pop(e){const t=this._storage.pop(this,e);return void 0===t?++this._miss:++this._hit,t}updateSize(e,t,i){this._storage.updateSize(this,e,t,i)}clear(){this._storage.clear(this)}clearAll(){this._storage.clearAll()}get performanceInfo(){return this._storage.performanceInfo}resetStats(){this._storage.resetStats()}}class a{get size(){return this._size}constructor(e=10485760){this._maxSize=e,this._db=new Map,this._size=0,this._hit=0,this._miss=0,this._removeFuncs=new n.Z,this._users=new n.Z}destroy(){this.clearAll(),this._removeFuncs.clear(),this._users.clear(),this._db=null}register(e){this._users.push(e)}deregister(e){this._users.removeUnordered(e)}registerRemoveFunc(e,t){this._removeFuncs.push([e,t])}deregisterRemoveFunc(e){this._removeFuncs.filterInPlace((t=>t[0]!==e))}get maxSize(){return this._maxSize}set maxSize(e){this._maxSize=Math.max(e,0),this._checkSizeLimits()}put(e,t,i,s,n){t=e.id+t;const o=this._db.get(t);if(o&&(this._size-=o.size,e.size-=o.size,this._db.delete(t),o.entry!==i&&this._notifyRemove(t,o.entry,r.ALL)),s>this._maxSize)return void this._notifyRemove(t,i,r.ALL);if(void 0===i)return void console.warn("Refusing to cache undefined entry ");if(!s||s<0)return void console.warn("Refusing to cache entry with invalid size "+s);const a=1+Math.max(n,-3)- -3;this._db.set(t,{entry:i,size:s,lifetime:a,lives:a}),this._size+=s,e.size+=s,this._checkSizeLimits()}updateSize(e,t,i,s){t=e.id+t;const n=this._db.get(t);if(n&&n.entry===i){for(this._size-=n.size,e.size-=n.size;s>this._maxSize;){const e=this._notifyRemove(t,i,r.SOME);if(!(null!=e&&e>0))return void this._db.delete(t);s=e}n.size=s,this._size+=s,e.size+=s,this._checkSizeLimits()}}pop(e,t){t=e.id+t;const i=this._db.get(t);if(i)return this._size-=i.size,e.size-=i.size,this._db.delete(t),++this._hit,i.entry;++this._miss}get(e,t){t=e.id+t;const i=this._db.get(t);if(void 0!==i)return this._db.delete(t),i.lives=i.lifetime,this._db.set(t,i),++this._hit,i.entry;++this._miss}peek(e,t){const i=this._db.get(e.id+t);return i?++this._hit:++this._miss,i?.entry}get performanceInfo(){const e={Size:Math.round(this._size/1048576)+"/"+Math.round(this._maxSize/1048576)+"MB","Hit rate":Math.round(100*this._getHitRate())+"%",Entries:this._db.size.toString()},t={},i=new Array;this._db.forEach(((e,r)=>{const s=e.lifetime;i[s]=(i[s]||0)+e.size,this._users.forAll((i=>{const{id:s,name:n}=i;if(r.startsWith(s)){const i=t[n]||0;t[n]=i+e.size}}))}));const r={};this._users.forAll((e=>{const i=e.name;if("hitRate"in e&&"number"==typeof e.hitRate&&!isNaN(e.hitRate)&&e.hitRate>0){const s=t[i]||0;t[i]=s,r[i]=Math.round(100*e.hitRate)+"%"}else r[i]="0%"}));const s=Object.keys(t);s.sort(((e,i)=>t[i]-t[e])),s.forEach((i=>e[i]=Math.round(t[i]/2**20)+"MB / "+r[i]));for(let t=i.length-1;t>=0;--t){const r=i[t];r&&(e["Priority "+(t+-3-1)]=Math.round(r/this._size*100)+"%")}return e}resetStats(){this._hit=this._miss=0,this._users.forAll((e=>e.resetHitRate()))}clear(e){const t=e.id;this._db.forEach(((e,i)=>{i.startsWith(t)&&(this._size-=e.size,this._db.delete(i),this._notifyRemove(i,e.entry,r.ALL))})),e.size=0}clearAll(){this._db.forEach(((e,t)=>this._notifyRemove(t,e.entry,r.ALL))),this._users.forEach((e=>e.size=0)),this._size=0,this._db.clear()}_getHitRate(){return this._hit/(this._hit+this._miss)}_notifyRemove(e,t,i){let r;return this._removeFuncs.some((s=>{if(e.startsWith(s[0])){const e=s[1](t,i);return"number"==typeof e&&(r=e),!0}return!1})),r}_checkSizeLimits(){if(this._size>this._maxSize)for(const[e,t]of this._db)if(this._purgeItem(e,t),this._size<=.9*this.maxSize)return;this._users.forEach((e=>{if(e.maxSize>0&&e.size>e.maxSize)for(const[t,i]of this._db)if(t.startsWith(e.id)&&(this._purgeItem(t,i,e),e.size<=.9*e.maxSize))return}))}_purgeItem(e,t,i=this._users.find((t=>e.startsWith(t.id)))){if(this._db.delete(e),t.lives<=1){this._size-=t.size,i&&(i.size-=t.size);const s=this._notifyRemove(e,t.entry,r.SOME);null!=s&&s>0&&(this._size+=s,i&&(i.size+=s),t.lives=t.lifetime,t.size=s,this._db.set(e,t))}else--t.lives,this._db.set(e,t)}}let l=0},17445:(e,t,i)=>{i.d(t,{N1:()=>d,YP:()=>l,Z_:()=>y,gx:()=>h,nn:()=>g,on:()=>c,tX:()=>_}),i(66643),i(46791);var r=i(91460),s=i(50758),n=i(70586),o=i(95330),a=i(26258);function l(e,t,i={}){return u(e,t,i,m)}function h(e,t,i={}){return u(e,t,i,p)}function u(e,t,i={},r){let s=null;const o=i.once?(e,i)=>{r(e)&&((0,n.hw)(s),t(e,i))}:(e,i)=>{r(e)&&t(e,i)};if(s=(0,a.aQ)(e,o,i.sync,i.equals),i.initial){const t=e();o(t,t)}return s}function c(e,t,i,o={}){let a=null,h=null,u=null;function c(){a&&h&&(h.remove(),o.onListenerRemove?.(a),a=null,h=null)}function d(e){o.once&&o.once&&(0,n.hw)(u),i(e)}const m=l(e,((e,i)=>{c(),(0,r.vT)(e)&&(a=e,h=(0,r.on)(e,t,d),o.onListenerAdd?.(e))}),{sync:o.sync,initial:!0});return u=(0,s.kB)((()=>{m.remove(),c()})),u}function d(e,t){return function(e,t,i){if((0,o.Hc)(i))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,s.AL)([(0,o.fu)(i,(()=>{l(),n((0,o.zE)())})),u(e,(e=>{l(),r(e)}),{sync:!1,once:!0},t??m)])}))}(e,p,t)}function m(e){return!0}function p(e){return!!e}i(87538);const y={sync:!0},g={initial:!0},_={sync:!0,initial:!0}},35463:(e,t,i)=>{i.d(t,{JE:()=>a,Nm:()=>o,rJ:()=>l});var r=i(90344),s=i(17126);const n={milliseconds:1,seconds:1e3,minutes:6e4,hours:36e5,days:864e5,weeks:6048e5,months:26784e5,years:31536e6,decades:31536e7,centuries:31536e8};function o(e,t,i,r="system"){const n=u(r),o=s.ou.fromJSDate(e,{zone:n}),a="decades"===i||"centuries"===i?"year":h(i);return"decades"===i&&(t*=10),"centuries"===i&&(t*=100),o.plus({[a]:t}).toJSDate()}function a(e,t,i="system"){const r=u(i),n=s.ou.fromJSDate(e,{zone:r});if("decades"===t||"centuries"===t){const e=n.startOf("year"),{year:i}=e,r=i-i%("decades"===t?10:100);return e.set({year:r}).toJSDate()}const o=h(t);return n.startOf(o).toJSDate()}function l(e,t,i){return 0===e?0:e*n[t]/n[i]}function h(e){switch(e){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 u(e){const t=(0,r.f1)(e);return t?new s.vF(t):s.Oh.instance}},79235:(e,t,i)=>{i.d(t,{Z:()=>v});var r,s=i(43697),n=i(67676),o=i(35454),a=i(96674),l=i(67900),h=i(20941),u=i(5600),c=(i(75215),i(80442),i(71715)),d=i(52011),m=i(30556);const p=(0,o.w)()({orthometric:"gravity-related-height",gravity_related_height:"gravity-related-height",ellipsoidal:"ellipsoidal"}),y=p.jsonValues.slice();(0,n.e$)(y,"orthometric");const g=(0,o.w)()({meter:"meters",foot:"feet","us-foot":"us-feet","clarke-foot":"clarke-feet","clarke-yard":"clarke-yards","clarke-link":"clarke-links","sears-yard":"sears-yards","sears-foot":"sears-feet","sears-chain":"sears-chains","benoit-1895-b-chain":"benoit-1895-b-chains","indian-yard":"indian-yards","indian-1937-yard":"indian-1937-yards","gold-coast-foot":"gold-coast-feet","sears-1922-truncated-chain":"sears-1922-truncated-chains","50-kilometers":"50-kilometers","150-kilometers":"150-kilometers"});let _=r=class extends a.wq{constructor(e){super(e),this.heightModel="gravity-related-height",this.heightUnit="meters",this.vertCRS=null}writeHeightModel(e,t,i){return p.write(e,t,i)}readHeightModel(e,t,i){return p.read(e)||(i&&i.messages&&i.messages.push(function(e,t){return new h.Z("height-model:unsupported",`Height model of value '${e}' is not supported`,t)}(e,{context:i})),null)}readHeightUnit(e,t,i){return g.read(e)||(i&&i.messages&&i.messages.push(f(e,{context:i})),null)}readHeightUnitService(e,t,i){return(0,l.$C)(e)||g.read(e)||(i&&i.messages&&i.messages.push(f(e,{context:i})),null)}readVertCRS(e,t){return t.vertCRS||t.ellipsoid||t.geoid}clone(){return new r({heightModel:this.heightModel,heightUnit:this.heightUnit,vertCRS:this.vertCRS})}equals(e){return!!e&&(this===e||this.heightModel===e.heightModel&&this.heightUnit===e.heightUnit&&this.vertCRS===e.vertCRS)}static deriveUnitFromSR(e,t){const i=(0,l.cM)(t);return new r({heightModel:e.heightModel,heightUnit:i,vertCRS:e.vertCRS})}write(e,t){return t={origin:"web-scene",...t},super.write(e,t)}static fromJSON(e){if(!e)return null;const t=new r;return t.read(e,{origin:"web-scene"}),t}};function f(e,t){return new h.Z("height-unit:unsupported",`Height unit of value '${e}' is not supported`,t)}(0,s._)([(0,u.Cb)({type:p.apiValues,constructOnly:!0,json:{origins:{"web-scene":{type:y,default:"ellipsoidal"}}}})],_.prototype,"heightModel",void 0),(0,s._)([(0,m.c)("web-scene","heightModel")],_.prototype,"writeHeightModel",null),(0,s._)([(0,c.r)(["web-scene","service"],"heightModel")],_.prototype,"readHeightModel",null),(0,s._)([(0,u.Cb)({type:g.apiValues,constructOnly:!0,json:{origins:{"web-scene":{type:g.jsonValues,write:g.write}}}})],_.prototype,"heightUnit",void 0),(0,s._)([(0,c.r)("web-scene","heightUnit")],_.prototype,"readHeightUnit",null),(0,s._)([(0,c.r)("service","heightUnit")],_.prototype,"readHeightUnitService",null),(0,s._)([(0,u.Cb)({type:String,constructOnly:!0,json:{origins:{"web-scene":{write:!0}}}})],_.prototype,"vertCRS",void 0),(0,s._)([(0,c.r)("service","vertCRS",["vertCRS","ellipsoid","geoid"])],_.prototype,"readVertCRS",null),_=r=(0,s._)([(0,d.j)("esri.geometry.HeightModelInfo")],_);const v=_},90344:(e,t,i)=>{i.d(t,{LJ:()=>T,Xr:()=>_,Ze:()=>w,cZ:()=>h,f1:()=>L,i$:()=>z,o8:()=>D,p6:()=>S});var r=i(35454),s=i(70171),n=i(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"},u={year:"numeric",month:"numeric",day:"numeric"},c={year:"numeric",month:"long",day:"numeric"},d={year:"numeric",month:"short",day:"numeric"},m={year:"numeric",month:"long",weekday:"long",day:"numeric"},p={hour:"numeric",minute:"numeric"},y={...p,second:"numeric"},g={"short-date":u,"short-date-short-time":{...u,...p},"short-date-short-time-24":{...u,...p,hour12:!1},"short-date-long-time":{...u,...y},"short-date-long-time-24":{...u,...y,hour12:!1},"short-date-le":u,"short-date-le-short-time":{...u,...p},"short-date-le-short-time-24":{...u,...p,hour12:!1},"short-date-le-long-time":{...u,...y},"short-date-le-long-time-24":{...u,...y,hour12:!1},"long-month-day-year":c,"long-month-day-year-short-time":{...c,...p},"long-month-day-year-short-time-24":{...c,...p,hour12:!1},"long-month-day-year-long-time":{...c,...y},"long-month-day-year-long-time-24":{...c,...y,hour12:!1},"day-short-month-year":d,"day-short-month-year-short-time":{...d,...p},"day-short-month-year-short-time-24":{...d,...p,hour12:!1},"day-short-month-year-long-time":{...d,...y},"day-short-month-year-long-time-24":{...d,...y,hour12:!1},"long-date":m,"long-date-short-time":{...m,...p},"long-date-short-time-24":{...m,...p,hour12:!1},"long-date-long-time":{...m,...y},"long-date-long-time-24":{...m,...y,hour12:!1},"long-month-year":{month:"long",year:"numeric"},"short-month-year":{month:"short",year:"numeric"},year:{year:"numeric"},"short-time":p,"long-time":y},_=(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"}),f={ar:"ar-u-nu-latn-ca-gregory"};let v=new WeakMap;const b=g["short-date-short-time"];function w(e){return g[e]}function S(e,t=b){return function(e){let t=v.get(e);if(!t){const i=(0,s.Kd)(),r=f[i]||i,n=L(e.timeZone??"system"),o={...e,timeZone:n};t=new Intl.DateTimeFormat(r,o),v.set(e,t)}return t}(t).format(e)}function D(e,t=b){return S(new Date(e),{...t,...h,...a})}function T(e,t=b){return S(new Date(`1970-01-01T${e}Z`),{...t,...h,...o})}function z(e,t=b){const i=n.ou.fromISO(e,{setZone:!0}),r=(0,s.Kd)(),o=f[r]??r;return i.toLocaleString({...l,...t},{locale:o})}function L(e){switch(e){case"system":return;case"unknown":return"UTC";default:return e}}(0,s.Ze)((()=>{v=new WeakMap}))},18848:(e,t,i)=>{i.d(t,{sh:()=>a,uf:()=>l});var r=i(70171);const s={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 i=(0,r.Kd)(),o=s[(0,r.Kd)()]||i;n.set(t,new Intl.NumberFormat(o,e))}return n.get(t)}(t).format(e)}(0,r.Ze)((()=>{n=new WeakMap,o={}}))},65665:(e,t,i)=>{i.r(t),i.d(t,{default:()=>I});var r=i(43697),s=i(3172),n=i(20102),o=i(70586),a=i(16453),l=i(95330),h=i(17452),u=i(5600),c=(i(75215),i(67676)),d=(i(80442),i(71715)),m=i(52011),p=i(79235),y=i(87085),g=i(46486),_=i(17287),f=i(38009),v=i(16859),b=i(21506);class w{constructor(e,t,i,r){this._hasNoDataValues=null,this._minValue=null,this._maxValue=null,"pixelData"in e?(this.values=e.pixelData,this.width=e.width,this.height=e.height,this.noDataValue=e.noDataValue):(this.values=e,this.width=t,this.height=i,this.noDataValue=r)}get hasNoDataValues(){if(null==this._hasNoDataValues){const e=this.noDataValue;this._hasNoDataValues=this.values.includes(e)}return this._hasNoDataValues}get minValue(){return this._ensureBounds(),this._minValue}get maxValue(){return this._ensureBounds(),this._maxValue}_ensureBounds(){if(null!=this._minValue)return;const{noDataValue:e,values:t}=this;let i=1/0,r=-1/0,s=!0;for(const n of t)n===e?this._hasNoDataValues=!0:(i=n<i?n:i,r=n>r?n:r,s=!1);s?(this._minValue=0,this._maxValue=0):(this._minValue=i,this._maxValue=r>-3e38?r:0)}}var S=i(50758),D=i(92604),T=i(56569);class z{constructor(e,t,i,r,s={}){this._mainMethod=t,this._transferLists=i,this._listeners=[],this._promise=(0,T.bA)(e,{...s,schedule:r}).then((e=>{if(void 0===this._thread){this._thread=e,this._promise=null,s.hasInitialize&&this.broadcast({},"initialize");for(const e of this._listeners)this._connectListener(e)}else e.close()})),this._promise.catch((t=>D.Z.getLogger("esri.core.workers.WorkerHandle").error(`Failed to initialize ${e} worker: ${t}`)))}on(e,t){const i={removed:!1,eventName:e,callback:t,threadHandle:null};return this._listeners.push(i),this._connectListener(i),(0,S.kB)((()=>{i.removed=!0,(0,c.Od)(this._listeners,i),this._thread&&null!=i.threadHandle&&i.threadHandle.remove()}))}destroy(){this._thread&&(this._thread.close(),this._thread=null),this._promise=null,this._listeners.length=0,this._transferLists={}}invoke(e,t){return this.invokeMethod(this._mainMethod,e,t)}invokeMethod(e,t,i){if(this._thread){const r=this._transferLists[e],s=r?r(t):[];return this._thread.invoke(e,t,{transferList:s,signal:i})}return this._promise?this._promise.then((()=>((0,l.k_)(i),this.invokeMethod(e,t,i)))):Promise.reject(null)}broadcast(e,t){return this._thread?Promise.all(this._thread.broadcast(t,e)).then((()=>{})):this._promise?this._promise.then((()=>this.broadcast(e,t))):Promise.reject()}get promise(){return this._promise}_connectListener(e){this._thread&&this._thread.on(e.eventName,e.callback).then((t=>{e.removed||(e.threadHandle=t)}))}}class L extends z{constructor(e=null){super("LercWorker","_decode",{_decode:e=>[e.buffer]},e,{strategy:"dedicated"}),this.schedule=e,this.ref=0}decode(e,t,i){return e&&0!==e.byteLength?this.invoke({buffer:e,options:t},i):Promise.resolve(null)}release(){--this.ref<=0&&(x.forEach(((e,t)=>{e===this&&x.delete(t)})),this.destroy())}}const x=new Map;let C=class extends((0,g.Z)((0,_.Y)((0,f.q)((0,v.I)((0,a.R)(y.Z)))))){constructor(...e){super(...e),this.capabilities={operations:{supportsTileMap:!1}},this.copyright=null,this.heightModelInfo=null,this.path=null,this.minScale=void 0,this.maxScale=void 0,this.opacity=1,this.operationalLayerType="ArcGISTiledElevationServiceLayer",this.sourceJSON=null,this.type="elevation",this.url=null,this.version=null,this._lercDecoder=function(e=null){let t=x.get(e);return t||(null!=e?(t=new L((t=>e.immediate.schedule(t))),x.set(e,t)):(t=new L,x.set(null,t))),++t.ref,t}()}normalizeCtorArgs(e,t){return"string"==typeof e?{url:e,...t}:e}destroy(){this._lercDecoder=(0,o.RY)(this._lercDecoder)}readCapabilities(e,t){const i=t.capabilities&&t.capabilities.split(",").map((e=>e.toLowerCase().trim()));return i?{operations:{supportsTileMap:i.includes("tilemap")}}:{operations:{supportsTileMap:!1}}}readVersion(e,t){let i=t.currentVersion;return i||(i=9.3),i}load(e){const t=null!=e?e.signal:null;return this.addResolvingPromise(this.loadFromPortal({supportedTypes:["Image Service"],supportsData:!1,validateItem:e=>{for(let t=0;t<e.typeKeywords.length;t++)if("elevation 3d layer"===e.typeKeywords[t].toLowerCase())return!0;throw new n.Z("portal:invalid-layer-item-type","Invalid layer item type '${type}', expected '${expectedType}' ",{type:"Image Service",expectedType:"Image Service Elevation 3D Layer"})}},e).catch(l.r9).then((()=>this._fetchImageService(t)))),Promise.resolve(this)}fetchTile(e,t,i,r){const n=null!=(r=r||{signal:null}).signal?r.signal:r.signal=(new AbortController).signal,o={responseType:"array-buffer",signal:n},a={noDataValue:r.noDataValue,returnFileInfo:!0};return this.load().then((()=>this._fetchTileAvailability(e,t,i,r))).then((()=>(0,s.Z)(this.getTileUrl(e,t,i),o))).then((e=>this._lercDecoder.decode(e.data,a,n))).then((e=>new w(e)))}getTileUrl(e,t,i){const r=!this.capabilities.operations.supportsTileMap&&this.supportsBlankTile,s=(0,h.B7)({...this.parsedUrl.query,blankTile:!r&&null});return`${this.parsedUrl.path}/tile/${e}/${t}/${i}${s?"?"+s:""}`}async queryElevation(e,t){const{ElevationQuery:r}=await i.e(5642).then(i.bind(i,55642));return(0,l.k_)(t),(new r).query(this,e,t)}async createElevationSampler(e,t){const{ElevationQuery:r}=await i.e(5642).then(i.bind(i,55642));return(0,l.k_)(t),(new r).createSampler(this,e,t)}_fetchTileAvailability(e,t,i,r){return this.tilemapCache?this.tilemapCache.fetchAvailability(e,t,i,r):Promise.resolve("unknown")}async _fetchImageService(e){if(this.sourceJSON)return this.sourceJSON;const t={query:{f:"json",...this.parsedUrl.query},responseType:"json",signal:e},i=await(0,s.Z)(this.parsedUrl.path,t);i.ssl&&(this.url=this.url?.replace(/^http:/i,"https:")),this.sourceJSON=i.data,this.read(i.data,{origin:"service",url:this.parsedUrl})}get hasOverriddenFetchTile(){return!this.fetchTile[M]}};(0,r._)([(0,u.Cb)({readOnly:!0})],C.prototype,"capabilities",void 0),(0,r._)([(0,d.r)("service","capabilities",["capabilities"])],C.prototype,"readCapabilities",null),(0,r._)([(0,u.Cb)({json:{read:{source:"copyrightText"}}})],C.prototype,"copyright",void 0),(0,r._)([(0,u.Cb)({readOnly:!0,type:p.Z})],C.prototype,"heightModelInfo",void 0),(0,r._)([(0,u.Cb)({type:String,json:{origins:{"web-scene":{read:!0,write:!0}},read:!1}})],C.prototype,"path",void 0),(0,r._)([(0,u.Cb)({type:["show","hide"]})],C.prototype,"listMode",void 0),(0,r._)([(0,u.Cb)({json:{read:!1,write:!1,origins:{service:{read:!1,write:!1},"portal-item":{read:!1,write:!1},"web-document":{read:!1,write:!1}}},readOnly:!0})],C.prototype,"minScale",void 0),(0,r._)([(0,u.Cb)({json:{read:!1,write:!1,origins:{service:{read:!1,write:!1},"portal-item":{read:!1,write:!1},"web-document":{read:!1,write:!1}}},readOnly:!0})],C.prototype,"maxScale",void 0),(0,r._)([(0,u.Cb)({json:{read:!1,write:!1,origins:{"web-document":{read:!1,write:!1}}}})],C.prototype,"opacity",void 0),(0,r._)([(0,u.Cb)({type:["ArcGISTiledElevationServiceLayer"]})],C.prototype,"operationalLayerType",void 0),(0,r._)([(0,u.Cb)()],C.prototype,"sourceJSON",void 0),(0,r._)([(0,u.Cb)({json:{read:!1},value:"elevation",readOnly:!0})],C.prototype,"type",void 0),(0,r._)([(0,u.Cb)(b.HQ)],C.prototype,"url",void 0),(0,r._)([(0,u.Cb)()],C.prototype,"version",void 0),(0,r._)([(0,d.r)("version",["currentVersion"])],C.prototype,"readVersion",null),C=(0,r._)([(0,m.j)("esri.layers.ElevationLayer")],C);const M=Symbol("default-fetch-tile");C.prototype.fetchTile[M]=!0;const I=C},87085:(e,t,i)=>{i.d(t,{Z:()=>v});var r=i(43697),s=(i(66577),i(3172)),n=i(20102),o=i(32448),a=i(10699),l=i(83379),h=i(92604),u=i(95330),c=i(17452),d=i(5600),m=(i(75215),i(67676),i(80442),i(52011)),p=i(68773),y=i(6570),g=i(82971);let _=0,f=class extends(o.Z.EventedMixin((0,a.IG)(l.Z))){constructor(){super(...arguments),this.attributionDataUrl=null,this.fullExtent=new y.Z(-180,-90,180,90,g.Z.WGS84),this.id=Date.now().toString(16)+"-layer-"+_++,this.legendEnabled=!0,this.listMode="show",this.opacity=1,this.parent=null,this.popupEnabled=!0,this.attributionVisible=!0,this.spatialReference=g.Z.WGS84,this.title=null,this.type=null,this.url=null,this.visible=!0}static async fromArcGISServerUrl(e){const t="string"==typeof e?{url:e}:e;return(await i.e(3529).then(i.bind(i,63529))).fromUrl(t)}static fromPortalItem(e){return async function(e){const t="portalItem"in e?e:{portalItem:e},{fromItem:r}=await i.e(8008).then(i.bind(i,28008));try{return await r(t)}catch(e){const i=t&&t.portalItem,r=i&&i.id||"unset",s=i&&i.portal&&i.portal.url||p.default.portalUrl;throw h.Z.getLogger("esri.layers.support.fromPortalItem").error("#fromPortalItem()","Failed to create layer from portal item (portal: '"+s+"', id: '"+r+"')",e),e}}(e)}initialize(){this.when().catch((e=>{(0,u.D_)(e)||h.Z.getLogger(this).error("#load()",`Failed to load layer (title: '${this.title??"no title"}', id: '${this.id??"no id"}')`,{error:e})}))}destroy(){const e=this.parent;if(e){const t=this;"layers"in e&&e.layers.includes(t)?e.layers.remove(t):"tables"in e&&e.tables.includes(t)?e.tables.remove(t):"baseLayers"in e&&e.baseLayers.includes(t)?e.baseLayers.remove(t):"referenceLayers"in e&&e.referenceLayers.includes(t)&&e.referenceLayers.remove(t),this._set("parent",null)}}get hasAttributionData(){return null!=this.attributionDataUrl}get parsedUrl(){return(0,c.mN)(this.url)}async fetchAttributionData(){const e=this.attributionDataUrl;if(this.hasAttributionData&&e)return(await(0,s.Z)(e,{query:{f:"json"},responseType:"json"})).data;throw new n.Z("layer:no-attribution-data","Layer does not have attribution data")}};(0,r._)([(0,d.Cb)({type:String})],f.prototype,"attributionDataUrl",void 0),(0,r._)([(0,d.Cb)({type:y.Z})],f.prototype,"fullExtent",void 0),(0,r._)([(0,d.Cb)({readOnly:!0})],f.prototype,"hasAttributionData",null),(0,r._)([(0,d.Cb)({type:String,clonable:!1})],f.prototype,"id",void 0),(0,r._)([(0,d.Cb)({type:Boolean,nonNullable:!0})],f.prototype,"legendEnabled",void 0),(0,r._)([(0,d.Cb)({type:["show","hide","hide-children"]})],f.prototype,"listMode",void 0),(0,r._)([(0,d.Cb)({type:Number,range:{min:0,max:1},nonNullable:!0})],f.prototype,"opacity",void 0),(0,r._)([(0,d.Cb)({clonable:!1})],f.prototype,"parent",void 0),(0,r._)([(0,d.Cb)({readOnly:!0})],f.prototype,"parsedUrl",null),(0,r._)([(0,d.Cb)({type:Boolean})],f.prototype,"popupEnabled",void 0),(0,r._)([(0,d.Cb)({type:Boolean})],f.prototype,"attributionVisible",void 0),(0,r._)([(0,d.Cb)({type:g.Z})],f.prototype,"spatialReference",void 0),(0,r._)([(0,d.Cb)({type:String})],f.prototype,"title",void 0),(0,r._)([(0,d.Cb)({readOnly:!0,json:{read:!1}})],f.prototype,"type",void 0),(0,r._)([(0,d.Cb)()],f.prototype,"url",void 0),(0,r._)([(0,d.Cb)({type:Boolean,nonNullable:!0})],f.prototype,"visible",void 0),f=(0,r._)([(0,m.j)("esri.layers.Layer")],f);const v=f},46486:(e,t,i)=>{i.d(t,{Z:()=>c});var r=i(43697),s=(i(66577),i(5600)),n=(i(75215),i(67676),i(80442),i(71715)),o=i(52011),a=i(11145),l=i(42238),h=i(28589),u=i(82971);const c=e=>{let t=class extends e{constructor(){super(...arguments),this.copyright=null,this.minScale=0,this.maxScale=0,this.spatialReference=null,this.tileInfo=null,this.tilemapCache=null}destroy(){this.tilemapCache?.destroy?.()}readMinScale(e,t){return null!=t.minLOD&&null!=t.maxLOD?e:0}readMaxScale(e,t){return null!=t.minLOD&&null!=t.maxLOD?e:0}get supportsBlankTile(){return this.version>=10.2}readTilemapCache(e,t,i){const r=t.capabilities?.includes("Tilemap");let{minLOD:s,maxLOD:n,minScale:o,maxScale:u}=t;if(null==s&&null==n&&0!==o&&0!==u){const e=e=>Math.round(1e4*e)/1e4;o=e(o||t.tileInfo.lods[0].scale),u=e(u||t.tileInfo.lods[t.tileInfo.lods.length-1].scale);for(const i of t.tileInfo.lods){const t=e(i.scale);s=t>=o?i.level:s,n=t>=u?i.level:n}}if(r)return new h.y({layer:this,minLOD:s,maxLOD:n});if(t.tileInfo){const e=new a.Z;return e.read(t.tileInfo,i),new l.Z(e,s,n)}return null}};return(0,r._)([(0,s.Cb)({json:{read:{source:"copyrightText"}}})],t.prototype,"copyright",void 0),(0,r._)([(0,s.Cb)()],t.prototype,"minScale",void 0),(0,r._)([(0,n.r)("service","minScale")],t.prototype,"readMinScale",null),(0,r._)([(0,s.Cb)()],t.prototype,"maxScale",void 0),(0,r._)([(0,n.r)("service","maxScale")],t.prototype,"readMaxScale",null),(0,r._)([(0,s.Cb)({type:u.Z})],t.prototype,"spatialReference",void 0),(0,r._)([(0,s.Cb)({readOnly:!0})],t.prototype,"supportsBlankTile",null),(0,r._)([(0,s.Cb)({type:a.Z})],t.prototype,"tileInfo",void 0),(0,r._)([(0,s.Cb)()],t.prototype,"tilemapCache",void 0),(0,r._)([(0,n.r)("service","tilemapCache",["capabilities","tileInfo"])],t.prototype,"readTilemapCache",null),(0,r._)([(0,s.Cb)()],t.prototype,"version",void 0),t=(0,r._)([(0,o.j)("esri.layers.mixins.ArcGISCachedService")],t),t}},42238:(e,t,i)=>{i.d(t,{Z:()=>n});var r=i(20102),s=i(95330);class n{constructor(e,t=0,i=e.lods[e.lods.length-1].level){this.tileInfo=e,this.minLOD=t,this.maxLOD=i,e.lodAt(t)||(this.minLOD=e.lods[0].level),e.lodAt(i)||(this.maxLOD=e.lods[e.lods.length-1].level)}get effectiveMinLOD(){return this.minLOD??this.tileInfo.lods[0].level}get effectiveMaxLOD(){return this.maxLOD??this.tileInfo.lods[this.tileInfo.lods.length-1].level}getAvailability(e,t,i){const r=this.tileInfo?.lodAt(e);return!r||e<this.minLOD||e>this.maxLOD?"unavailable":r.cols&&r.rows?i>=r.cols[0]&&i<=r.cols[1]&&t>=r.rows[0]&&t<=r.rows[1]?"unknown":"unavailable":"unknown"}async fetchAvailability(e,t,i,n){await(0,s.Yn)(n);const o=this.getAvailability(e,t,i);if("unavailable"===o)throw new r.Z("tile-map:tile-unavailable","Tile is not available",{level:e,row:t,col:i});return o}async fetchAvailabilityUpsample(e,t,i,r,n){await(0,s.Yn)(n),r.level=e,r.row=t,r.col=i;const o=this.tileInfo;return o.updateTileInfo(r),this.fetchAvailability(e,t,i,n).catch((e=>{if((0,s.D_)(e))throw e;if(o.upsampleTile(r))return this.fetchAvailabilityUpsample(r.level,r.row,r.col,r,n);throw e}))}}}}]);
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[3776,5732],{92835:(e,t,s)=>{s.d(t,{Z:()=>f});var i,n=s(43697),r=s(96674),o=s(35463),a=s(5600),l=(s(75215),s(67676),s(80442),s(71715)),h=s(52011),u=s(30556);let d=i=class extends r.wq{static get allTime(){return c}static get empty(){return _}constructor(e){super(e),this.end=null,this.start=null}readEnd(e,t){return null!=t.end?new Date(t.end):null}writeEnd(e,t){t.end=e?.getTime()??null}get isAllTime(){return this.equals(i.allTime)}get isEmpty(){return this.equals(i.empty)}readStart(e,t){return null!=t.start?new Date(t.start):null}writeStart(e,t){t.start=e?.getTime()??null}clone(){return new i({end:this.end,start:this.start})}equals(e){if(!e)return!1;const t=this.start?.getTime()??this.start,s=this.end?.getTime()??this.end,i=e.start?.getTime()??e.start,n=e.end?.getTime()??e.end;return t===i&&s===n}expandTo(e,t="system"){if(this.isEmpty||this.isAllTime)return this.clone();let s=this.start;s&&(s=(0,o.JE)(s,e,t));let n=this.end;if(n){const s=(0,o.JE)(n,e,t);n=n.getTime()===s.getTime()?s:(0,o.Nm)(s,1,e,t)}return new i({start:s,end:n})}intersection(e){if(!e)return this.clone();if(this.isEmpty||e.isEmpty)return i.empty;if(this.isAllTime)return e.clone();if(e.isAllTime)return this.clone();const t=this.start?.getTime()??-1/0,s=this.end?.getTime()??1/0,n=e.start?.getTime()??-1/0,r=e.end?.getTime()??1/0;let o,a;if(n>=t&&n<=s?o=n:t>=n&&t<=r&&(o=t),s>=n&&s<=r?a=s:r>=t&&r<=s&&(a=r),null!=o&&null!=a&&!isNaN(o)&&!isNaN(a)){const e=new i;return e.start=o===-1/0?null:new Date(o),e.end=a===1/0?null:new Date(a),e}return i.empty}offset(e,t,s="system"){if(this.isEmpty||this.isAllTime)return this.clone();const n=new i,{start:r,end:a}=this;return null!=r&&(n.start=(0,o.Nm)(r,e,t,s)),null!=a&&(n.end=(0,o.Nm)(a,e,t,s)),n}union(e){if(!e||e.isEmpty)return this.clone();if(this.isEmpty)return e.clone();if(this.isAllTime||e.isAllTime)return c.clone();const t=null!=this.start&&null!=e.start?new Date(Math.min(this.start.getTime(),e.start.getTime())):null,s=null!=this.end&&null!=e.end?new Date(Math.max(this.end.getTime(),e.end.getTime())):null;return new i({start:t,end:s})}};(0,n._)([(0,a.Cb)({type:Date,json:{write:{allowNull:!0}}})],d.prototype,"end",void 0),(0,n._)([(0,l.r)("end")],d.prototype,"readEnd",null),(0,n._)([(0,u.c)("end")],d.prototype,"writeEnd",null),(0,n._)([(0,a.Cb)({readOnly:!0,json:{read:!1}})],d.prototype,"isAllTime",null),(0,n._)([(0,a.Cb)({readOnly:!0,json:{read:!1}})],d.prototype,"isEmpty",null),(0,n._)([(0,a.Cb)({type:Date,json:{write:{allowNull:!0}}})],d.prototype,"start",void 0),(0,n._)([(0,l.r)("start")],d.prototype,"readStart",null),(0,n._)([(0,u.c)("start")],d.prototype,"writeStart",null),d=i=(0,n._)([(0,h.j)("esri.TimeExtent")],d);const c=new d,_=new d({start:void 0,end:void 0}),f=d},5732:(e,t,s)=>{s.d(t,{c:()=>i,g:()=>n});var i="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function n(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}},25929:(e,t,s)=>{s.d(t,{M:()=>f,a:()=>p,e:()=>c,f:()=>n,i:()=>u,p:()=>d,r:()=>o,t:()=>r,w:()=>a});var i=s(17452);function n(e,t){const s=t&&t.url&&t.url.path;if(e&&s&&(e=(0,i.hF)(e,s,{preserveProtocolRelative:!0}),t.portalItem&&t.readResourcePaths)){const s=(0,i.PF)(e,t.portalItem.itemUrl);null!=s&&h.test(s)&&t.readResourcePaths.push(t.portalItem.resourceFromPath(s).path)}return _(e,t&&t.portal)}function r(e,t,s=f.YES){if(null==e)return e;!(0,i.YP)(e)&&t&&t.blockedRelativeUrls&&t.blockedRelativeUrls.push(e);let n=(0,i.hF)(e);if(t){const s=t.verifyItemRelativeUrls&&t.verifyItemRelativeUrls.rootPath||t.url&&t.url.path;if(s){const r=_(s,t.portal),o=_(n,t.portal);n=(0,i.PF)(o,r,r),null!=n&&n!==o&&n!==e&&t.verifyItemRelativeUrls&&t.verifyItemRelativeUrls.writtenUrls.push(n)}}return n=c(n,t?.portal),(0,i.YP)(n)&&(n=(0,i.Fv)(n)),t?.resources&&t?.portalItem&&!(0,i.YP)(n)&&!(0,i.HK)(n)&&s===f.YES&&t.resources.toKeep.push({resource:t.portalItem.resourceFromPath(n),compress:!1}),n}function o(e,t,s){return n(e,s)}function a(e,t,s,i){const n=r(e,i);void 0!==n&&(t[s]=n)}const l=/\/items\/([^\/]+)\/resources\/(.*)/,h=/^\.\/resources\//;function u(e){const t=e?.match(l)??null;return t?.[1]??null}function d(e){const t=e?.match(l)??null;if(null==t)return null;const s=t[2],n=s.lastIndexOf("/");if(-1===n){const{path:e,extension:t}=(0,i.fZ)(s);return{prefix:null,filename:e,extension:t}}const{path:r,extension:o}=(0,i.fZ)(s.slice(n+1));return{prefix:s.slice(0,n),filename:r,extension:o}}function c(e,t){return t&&!t.isPortal&&t.urlKey&&t.customBaseUrl?(0,i.Ie)(e,`${t.urlKey}.${t.customBaseUrl}`,t.portalHostname):e}function _(e,t){if(!t||t.isPortal||!t.urlKey||!t.customBaseUrl)return e;const s=`${t.urlKey}.${t.customBaseUrl}`,n=(0,i.TI)();return(0,i.D6)(n,`${n.scheme}://${s}`)?(0,i.Ie)(e,t.portalHostname,s):(0,i.Ie)(e,s,t.portalHostname)}var f,m;(m=f||(f={}))[m.YES=0]="YES",m[m.NO=1]="NO";const p=Object.freeze(Object.defineProperty({__proto__:null,get MarkKeep(){return f},ensureMainOnlineDomain:c,fromJSON:n,itemIdFromResourceUrl:u,prefixAndFilenameFromResourceUrl:d,read:o,toJSON:r,write:a},Symbol.toStringTag,{value:"Module"}))},91303:(e,t,s)=>{var i;s.d(t,{Y:()=>i}),function(e){e[e.KILOBYTES=1024]="KILOBYTES",e[e.MEGABYTES=1048576]="MEGABYTES",e[e.GIGABYTES=1073741824]="GIGABYTES"}(i||(i={}))},13867:(e,t,s)=>{s.d(t,{z:()=>n});var i=s(69801);class n{constructor(e,t){this._storage=new i.WJ,this.id="",this.name="",this.size=0,this._storage.maxSize=e,this._storage.register(this),t&&this._storage.registerRemoveFunc("",t)}destroy(){this._storage.deregister(this),this._storage.destroy()}put(e,t,s=1){this._storage.put(this,e,t,s,1)}pop(e){return this._storage.pop(this,e)}get(e){return this._storage.get(this,e)}clear(){this._storage.clearAll()}get maxSize(){return this._storage.maxSize}set maxSize(e){this._storage.maxSize=e}resetHitRate(){}}},69801:(e,t,s)=>{s.d(t,{WJ:()=>a,Xq:()=>o});var i,n,r=s(44553);(n=i||(i={}))[n.ALL=0]="ALL",n[n.SOME=1]="SOME";class o{constructor(e,t,s){this.name=e,this._storage=t,this.id=l+++":",this.size=0,this.maxSize=0,this._removeFunc=!1,this._hit=0,this._miss=0,this._storage.register(this),s&&(this._storage.registerRemoveFunc(this.id,s),this._removeFunc=!0)}destroy(){this._storage.clear(this),this._removeFunc&&this._storage.deregisterRemoveFunc(this.id),this._storage.deregister(this),this._storage=null}get hitRate(){return this._hit/(this._hit+this._miss)}get sizeAll(){return this._storage.size}resetHitRate(){this._hit=this._miss=0}put(e,t,s,i=0){this._storage.put(this,e,t,s,i)}get(e){const t=this._storage.get(this,e);return void 0===t?++this._miss:++this._hit,t}peek(e){return this._storage.peek(this,e)}pop(e){const t=this._storage.pop(this,e);return void 0===t?++this._miss:++this._hit,t}updateSize(e,t,s){this._storage.updateSize(this,e,t,s)}clear(){this._storage.clear(this)}clearAll(){this._storage.clearAll()}get performanceInfo(){return this._storage.performanceInfo}resetStats(){this._storage.resetStats()}}class a{get size(){return this._size}constructor(e=10485760){this._maxSize=e,this._db=new Map,this._size=0,this._hit=0,this._miss=0,this._removeFuncs=new r.Z,this._users=new r.Z}destroy(){this.clearAll(),this._removeFuncs.clear(),this._users.clear(),this._db=null}register(e){this._users.push(e)}deregister(e){this._users.removeUnordered(e)}registerRemoveFunc(e,t){this._removeFuncs.push([e,t])}deregisterRemoveFunc(e){this._removeFuncs.filterInPlace((t=>t[0]!==e))}get maxSize(){return this._maxSize}set maxSize(e){this._maxSize=Math.max(e,0),this._checkSizeLimits()}put(e,t,s,n,r){t=e.id+t;const o=this._db.get(t);if(o&&(this._size-=o.size,e.size-=o.size,this._db.delete(t),o.entry!==s&&this._notifyRemove(t,o.entry,i.ALL)),n>this._maxSize)return void this._notifyRemove(t,s,i.ALL);if(void 0===s)return void console.warn("Refusing to cache undefined entry ");if(!n||n<0)return void console.warn("Refusing to cache entry with invalid size "+n);const a=1+Math.max(r,-3)- -3;this._db.set(t,{entry:s,size:n,lifetime:a,lives:a}),this._size+=n,e.size+=n,this._checkSizeLimits()}updateSize(e,t,s,n){t=e.id+t;const r=this._db.get(t);if(r&&r.entry===s){for(this._size-=r.size,e.size-=r.size;n>this._maxSize;){const e=this._notifyRemove(t,s,i.SOME);if(!(null!=e&&e>0))return void this._db.delete(t);n=e}r.size=n,this._size+=n,e.size+=n,this._checkSizeLimits()}}pop(e,t){t=e.id+t;const s=this._db.get(t);if(s)return this._size-=s.size,e.size-=s.size,this._db.delete(t),++this._hit,s.entry;++this._miss}get(e,t){t=e.id+t;const s=this._db.get(t);if(void 0!==s)return this._db.delete(t),s.lives=s.lifetime,this._db.set(t,s),++this._hit,s.entry;++this._miss}peek(e,t){const s=this._db.get(e.id+t);return s?++this._hit:++this._miss,s?.entry}get performanceInfo(){const e={Size:Math.round(this._size/1048576)+"/"+Math.round(this._maxSize/1048576)+"MB","Hit rate":Math.round(100*this._getHitRate())+"%",Entries:this._db.size.toString()},t={},s=new Array;this._db.forEach(((e,i)=>{const n=e.lifetime;s[n]=(s[n]||0)+e.size,this._users.forAll((s=>{const{id:n,name:r}=s;if(i.startsWith(n)){const s=t[r]||0;t[r]=s+e.size}}))}));const i={};this._users.forAll((e=>{const s=e.name;if("hitRate"in e&&"number"==typeof e.hitRate&&!isNaN(e.hitRate)&&e.hitRate>0){const n=t[s]||0;t[s]=n,i[s]=Math.round(100*e.hitRate)+"%"}else i[s]="0%"}));const n=Object.keys(t);n.sort(((e,s)=>t[s]-t[e])),n.forEach((s=>e[s]=Math.round(t[s]/2**20)+"MB / "+i[s]));for(let t=s.length-1;t>=0;--t){const i=s[t];i&&(e["Priority "+(t+-3-1)]=Math.round(i/this._size*100)+"%")}return e}resetStats(){this._hit=this._miss=0,this._users.forAll((e=>e.resetHitRate()))}clear(e){const t=e.id;this._db.forEach(((e,s)=>{s.startsWith(t)&&(this._size-=e.size,this._db.delete(s),this._notifyRemove(s,e.entry,i.ALL))})),e.size=0}clearAll(){this._db.forEach(((e,t)=>this._notifyRemove(t,e.entry,i.ALL))),this._users.forEach((e=>e.size=0)),this._size=0,this._db.clear()}_getHitRate(){return this._hit/(this._hit+this._miss)}_notifyRemove(e,t,s){let i;return this._removeFuncs.some((n=>{if(e.startsWith(n[0])){const e=n[1](t,s);return"number"==typeof e&&(i=e),!0}return!1})),i}_checkSizeLimits(){if(this._size>this._maxSize)for(const[e,t]of this._db)if(this._purgeItem(e,t),this._size<=.9*this.maxSize)return;this._users.forEach((e=>{if(e.maxSize>0&&e.size>e.maxSize)for(const[t,s]of this._db)if(t.startsWith(e.id)&&(this._purgeItem(t,s,e),e.size<=.9*e.maxSize))return}))}_purgeItem(e,t,s=this._users.find((t=>e.startsWith(t.id)))){if(this._db.delete(e),t.lives<=1){this._size-=t.size,s&&(s.size-=t.size);const n=this._notifyRemove(e,t.entry,i.SOME);null!=n&&n>0&&(this._size+=n,s&&(s.size+=n),t.lives=t.lifetime,t.size=n,this._db.set(e,t))}else--t.lives,this._db.set(e,t)}}let l=0},43090:(e,t,s)=>{function i(e){return 32+e.length}function n(e){if(!e)return 0;let t=l;for(const s in e)if(e.hasOwnProperty(s)){const n=e[s];switch(typeof n){case"string":t+=i(n);break;case"number":t+=16;break;case"boolean":t+=4}}return t}function r(e){if(!e)return 0;if(Array.isArray(e))return function(e){const t=e.length;if(0===t||"number"==typeof e[0])return 32+8*t;let s=h;for(let i=0;i<t;i++)s+=o(e[i]);return s}(e);let t=l;for(const s in e)e.hasOwnProperty(s)&&(t+=o(e[s]));return t}function o(e){switch(typeof e){case"object":return r(e);case"string":return i(e);case"number":return 16;case"boolean":return 4;default:return 8}}function a(e,t){return h+e.length*t}s.d(t,{Ul:()=>r,do:()=>a,f2:()=>n});const l=32,h=32},24133:(e,t,s)=>{s.d(t,{Q:()=>o});var i=s(67676),n=s(44553),r=s(88764);class o{constructor(e=9,t){this._compareMinX=u,this._compareMinY=d,this._toBBox=e=>e,this._maxEntries=Math.max(4,e||9),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),t&&("function"==typeof t?this._toBBox=t:this._initFormat(t)),this.clear()}destroy(){this.clear(),E.prune(),v.prune(),x.prune(),b.prune()}all(e){this._all(this._data,e)}search(e,t){let s=this._data;const i=this._toBBox;if(g(e,s))for(E.clear();s;){for(let n=0,r=s.children.length;n<r;n++){const r=s.children[n],o=s.leaf?i(r):r;g(e,o)&&(s.leaf?t(r):p(e,o)?this._all(r,t):E.push(r))}s=E.pop()}}collides(e){let t=this._data;const s=this._toBBox;if(!g(e,t))return!1;for(E.clear();t;){for(let i=0,n=t.children.length;i<n;i++){const n=t.children[i],r=t.leaf?s(n):n;if(g(e,r)){if(t.leaf||p(e,r))return!0;E.push(n)}}t=E.pop()}return!1}load(e){if(!e.length)return this;if(e.length<this._minEntries){for(let t=0,s=e.length;t<s;t++)this.insert(e[t]);return this}let t=this._build(e.slice(0,e.length),0,e.length-1,0);if(this._data.children.length)if(this._data.height===t.height)this._splitRoot(this._data,t);else{if(this._data.height<t.height){const e=this._data;this._data=t,t=e}this._insert(t,this._data.height-t.height-1,!0)}else this._data=t;return this}insert(e){return e&&this._insert(e,this._data.height-1),this}clear(){return this._data=new T([]),this}remove(e){if(!e)return this;let t,s=this._data,n=null,r=0,o=!1;const a=this._toBBox(e);for(x.clear(),b.clear();s||x.length>0;){if(s||(s=x.pop(),n=x.data[x.length-1],r=b.pop()??0,o=!0),s.leaf&&(t=(0,i.cq)(s.children,e,s.children.length,s.indexHint),-1!==t))return s.children.splice(t,1),x.push(s),this._condense(x),this;o||s.leaf||!p(s,a)?n?(r++,s=n.children[r],o=!1):s=null:(x.push(s),b.push(r),r=0,n=s,s=s.children[0])}return this}toJSON(){return this._data}fromJSON(e){return this._data=e,this}_all(e,t){let s=e;for(v.clear();s;){if(!0===s.leaf)for(const e of s.children)t(e);else v.pushArray(s.children);s=v.pop()??null}}_build(e,t,s,i){const n=s-t+1;let r=this._maxEntries;if(n<=r){const i=new T(e.slice(t,s+1));return a(i,this._toBBox),i}i||(i=Math.ceil(Math.log(n)/Math.log(r)),r=Math.ceil(n/r**(i-1)));const o=new I([]);o.height=i;const l=Math.ceil(n/r),h=l*Math.ceil(Math.sqrt(r));y(e,t,s,h,this._compareMinX);for(let n=t;n<=s;n+=h){const t=Math.min(n+h-1,s);y(e,n,t,l,this._compareMinY);for(let s=n;s<=t;s+=l){const n=Math.min(s+l-1,t);o.children.push(this._build(e,s,n,i-1))}}return a(o,this._toBBox),o}_chooseSubtree(e,t,s,i){for(;i.push(t),!0!==t.leaf&&i.length-1!==s;){let s,i=1/0,n=1/0;for(let r=0,o=t.children.length;r<o;r++){const o=t.children[r],a=c(o),l=f(e,o)-a;l<n?(n=l,i=a<i?a:i,s=o):l===n&&a<i&&(i=a,s=o)}t=s||t.children[0]}return t}_insert(e,t,s){const i=this._toBBox,n=s?e:i(e);x.clear();const r=this._chooseSubtree(n,this._data,t,x);for(r.children.push(e),h(r,n);t>=0&&x.data[t].children.length>this._maxEntries;)this._split(x,t),t--;this._adjustParentBBoxes(n,x,t)}_split(e,t){const s=e.data[t],i=s.children.length,n=this._minEntries;this._chooseSplitAxis(s,n,i);const r=this._chooseSplitIndex(s,n,i);if(!r)return void console.log(" Error: assertion failed at PooledRBush._split: no valid split index");const o=s.children.splice(r,s.children.length-r),l=s.leaf?new T(o):new I(o);l.height=s.height,a(s,this._toBBox),a(l,this._toBBox),t?e.data[t-1].children.push(l):this._splitRoot(s,l)}_splitRoot(e,t){this._data=new I([e,t]),this._data.height=e.height+1,a(this._data,this._toBBox)}_chooseSplitIndex(e,t,s){let i,n,r;i=n=1/0;for(let o=t;o<=s-t;o++){const t=l(e,0,o,this._toBBox),a=l(e,o,s,this._toBBox),h=m(t,a),u=c(t)+c(a);h<i?(i=h,r=o,n=u<n?u:n):h===i&&u<n&&(n=u,r=o)}return r}_chooseSplitAxis(e,t,s){const i=e.leaf?this._compareMinX:u,n=e.leaf?this._compareMinY:d;this._allDistMargin(e,t,s,i)<this._allDistMargin(e,t,s,n)&&e.children.sort(i)}_allDistMargin(e,t,s,i){e.children.sort(i);const n=this._toBBox,r=l(e,0,t,n),o=l(e,s-t,s,n);let a=_(r)+_(o);for(let i=t;i<s-t;i++){const t=e.children[i];h(r,e.leaf?n(t):t),a+=_(r)}for(let i=s-t-1;i>=t;i--){const t=e.children[i];h(o,e.leaf?n(t):t),a+=_(o)}return a}_adjustParentBBoxes(e,t,s){for(let i=s;i>=0;i--)h(t.data[i],e)}_condense(e){for(let t=e.length-1;t>=0;t--){const s=e.data[t];if(0===s.children.length)if(t>0){const n=e.data[t-1],r=n.children;r.splice((0,i.cq)(r,s,r.length,n.indexHint),1)}else this.clear();else a(s,this._toBBox)}}_initFormat(e){const t=["return a"," - b",";"];this._compareMinX=new Function("a","b",t.join(e[0])),this._compareMinY=new Function("a","b",t.join(e[1])),this._toBBox=new Function("a","return {minX: a"+e[0]+", minY: a"+e[1]+", maxX: a"+e[2]+", maxY: a"+e[3]+"};")}}function a(e,t){l(e,0,e.children.length,t,e)}function l(e,t,s,i,n){n||(n=new T([])),n.minX=1/0,n.minY=1/0,n.maxX=-1/0,n.maxY=-1/0;for(let r,o=t;o<s;o++)r=e.children[o],h(n,e.leaf?i(r):r);return n}function h(e,t){e.minX=Math.min(e.minX,t.minX),e.minY=Math.min(e.minY,t.minY),e.maxX=Math.max(e.maxX,t.maxX),e.maxY=Math.max(e.maxY,t.maxY)}function u(e,t){return e.minX-t.minX}function d(e,t){return e.minY-t.minY}function c(e){return(e.maxX-e.minX)*(e.maxY-e.minY)}function _(e){return e.maxX-e.minX+(e.maxY-e.minY)}function f(e,t){return(Math.max(t.maxX,e.maxX)-Math.min(t.minX,e.minX))*(Math.max(t.maxY,e.maxY)-Math.min(t.minY,e.minY))}function m(e,t){const s=Math.max(e.minX,t.minX),i=Math.max(e.minY,t.minY),n=Math.min(e.maxX,t.maxX),r=Math.min(e.maxY,t.maxY);return Math.max(0,n-s)*Math.max(0,r-i)}function p(e,t){return e.minX<=t.minX&&e.minY<=t.minY&&t.maxX<=e.maxX&&t.maxY<=e.maxY}function g(e,t){return t.minX<=e.maxX&&t.minY<=e.maxY&&t.maxX>=e.minX&&t.maxY>=e.minY}function y(e,t,s,i,n){const o=[t,s];for(;o.length;){const t=o.pop(),s=o.pop();if(t-s<=i)continue;const a=s+Math.ceil((t-s)/i/2)*i;(0,r.q)(e,a,s,t,n),o.push(s,a,a,t)}}const E=new n.Z,v=new n.Z,x=new n.Z,b=new n.Z({deallocator:void 0});class S{constructor(){this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0}}class C extends S{constructor(){super(...arguments),this.height=1,this.indexHint=new i.SO}}class T extends C{constructor(e){super(),this.children=e,this.leaf=!0}}class I extends C{constructor(e){super(),this.children=e,this.leaf=!1}}},17445:(e,t,s)=>{s.d(t,{N1:()=>c,YP:()=>l,Z_:()=>m,gx:()=>h,nn:()=>p,on:()=>d,tX:()=>g}),s(66643),s(46791);var i=s(91460),n=s(50758),r=s(70586),o=s(95330),a=s(26258);function l(e,t,s={}){return u(e,t,s,_)}function h(e,t,s={}){return u(e,t,s,f)}function u(e,t,s={},i){let n=null;const o=s.once?(e,s)=>{i(e)&&((0,r.hw)(n),t(e,s))}:(e,s)=>{i(e)&&t(e,s)};if(n=(0,a.aQ)(e,o,s.sync,s.equals),s.initial){const t=e();o(t,t)}return n}function d(e,t,s,o={}){let a=null,h=null,u=null;function d(){a&&h&&(h.remove(),o.onListenerRemove?.(a),a=null,h=null)}function c(e){o.once&&o.once&&(0,r.hw)(u),s(e)}const _=l(e,((e,s)=>{d(),(0,i.vT)(e)&&(a=e,h=(0,i.on)(e,t,c),o.onListenerAdd?.(e))}),{sync:o.sync,initial:!0});return u=(0,n.kB)((()=>{_.remove(),d()})),u}function c(e,t){return function(e,t,s){if((0,o.Hc)(s))return Promise.reject((0,o.zE)());const i=e();if(t?.(i))return Promise.resolve(i);let a=null;function l(){a=(0,r.hw)(a)}return new Promise(((i,r)=>{a=(0,n.AL)([(0,o.fu)(s,(()=>{l(),r((0,o.zE)())})),u(e,(e=>{l(),i(e)}),{sync:!1,once:!0},t??_)])}))}(e,f,t)}function _(e){return!0}function f(e){return!!e}s(87538);const m={sync:!0},p={initial:!0},g={sync:!0,initial:!0}},35463:(e,t,s)=>{s.d(t,{JE:()=>a,Nm:()=>o,rJ:()=>l});var i=s(90344),n=s(17126);const r={milliseconds:1,seconds:1e3,minutes:6e4,hours:36e5,days:864e5,weeks:6048e5,months:26784e5,years:31536e6,decades:31536e7,centuries:31536e8};function o(e,t,s,i="system"){const r=u(i),o=n.ou.fromJSDate(e,{zone:r}),a="decades"===s||"centuries"===s?"year":h(s);return"decades"===s&&(t*=10),"centuries"===s&&(t*=100),o.plus({[a]:t}).toJSDate()}function a(e,t,s="system"){const i=u(s),r=n.ou.fromJSDate(e,{zone:i});if("decades"===t||"centuries"===t){const e=r.startOf("year"),{year:s}=e,i=s-s%("decades"===t?10:100);return e.set({year:i}).toJSDate()}const o=h(t);return r.startOf(o).toJSDate()}function l(e,t,s){return 0===e?0:e*r[t]/r[s]}function h(e){switch(e){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 u(e){const t=(0,i.f1)(e);return t?new n.vF(t):n.Oh.instance}},90344:(e,t,s)=>{s.d(t,{LJ:()=>C,Xr:()=>g,Ze:()=>x,cZ:()=>h,f1:()=>I,i$:()=>T,o8:()=>S,p6:()=>b});var i=s(35454),n=s(70171),r=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"},u={year:"numeric",month:"numeric",day:"numeric"},d={year:"numeric",month:"long",day:"numeric"},c={year:"numeric",month:"short",day:"numeric"},_={year:"numeric",month:"long",weekday:"long",day:"numeric"},f={hour:"numeric",minute:"numeric"},m={...f,second:"numeric"},p={"short-date":u,"short-date-short-time":{...u,...f},"short-date-short-time-24":{...u,...f,hour12:!1},"short-date-long-time":{...u,...m},"short-date-long-time-24":{...u,...m,hour12:!1},"short-date-le":u,"short-date-le-short-time":{...u,...f},"short-date-le-short-time-24":{...u,...f,hour12:!1},"short-date-le-long-time":{...u,...m},"short-date-le-long-time-24":{...u,...m,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,...m},"long-month-day-year-long-time-24":{...d,...m,hour12:!1},"day-short-month-year":c,"day-short-month-year-short-time":{...c,...f},"day-short-month-year-short-time-24":{...c,...f,hour12:!1},"day-short-month-year-long-time":{...c,...m},"day-short-month-year-long-time-24":{...c,...m,hour12:!1},"long-date":_,"long-date-short-time":{..._,...f},"long-date-short-time-24":{..._,...f,hour12:!1},"long-date-long-time":{..._,...m},"long-date-long-time-24":{..._,...m,hour12:!1},"long-month-year":{month:"long",year:"numeric"},"short-month-year":{month:"short",year:"numeric"},year:{year:"numeric"},"short-time":f,"long-time":m},g=(0,i.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"}),y={ar:"ar-u-nu-latn-ca-gregory"};let E=new WeakMap;const v=p["short-date-short-time"];function x(e){return p[e]}function b(e,t=v){return function(e){let t=E.get(e);if(!t){const s=(0,n.Kd)(),i=y[s]||s,r=I(e.timeZone??"system"),o={...e,timeZone:r};t=new Intl.DateTimeFormat(i,o),E.set(e,t)}return t}(t).format(e)}function S(e,t=v){return b(new Date(e),{...t,...h,...a})}function C(e,t=v){return b(new Date(`1970-01-01T${e}Z`),{...t,...h,...o})}function T(e,t=v){const s=r.ou.fromISO(e,{setZone:!0}),i=(0,n.Kd)(),o=y[i]??i;return s.toLocaleString({...l,...t},{locale:o})}function I(e){switch(e){case"system":return;case"unknown":return"UTC";default:return e}}(0,n.Ze)((()=>{E=new WeakMap}))},37549:(e,t,s)=>{s.d(t,{H:()=>a});var i=s(80442),n=s(24133),r=s(24470);const o={minX:0,minY:0,maxX:0,maxY:0};class a{constructor(){this._indexInvalid=!1,this._boundsToLoad=[],this._boundsById=new Map,this._idByBounds=new Map,this._index=new n.Q(9,(0,i.Z)("esri-csp-restrictions")?e=>({minX:e[0],minY:e[1],maxX:e[2],maxY:e[3]}):["[0]","[1]","[2]","[3]"]),this._loadIndex=()=>{if(this._indexInvalid){const e=new Array(this._idByBounds.size);let t=0;this._idByBounds.forEach(((s,i)=>{e[t++]=i})),this._indexInvalid=!1,this._index.clear(),this._index.load(e)}else this._boundsToLoad.length&&(this._index.load(Array.from(new Set(this._boundsToLoad.filter((e=>this._idByBounds.has(e)))))),this._boundsToLoad.length=0)}}get fullBounds(){if(!this._boundsById.size)return null;const e=(0,r.cS)();for(const t of this._boundsById.values())t&&(e[0]=Math.min(t[0],e[0]),e[1]=Math.min(t[1],e[1]),e[2]=Math.max(t[2],e[2]),e[3]=Math.max(t[3],e[3]));return e}get valid(){return!this._indexInvalid}clear(){this._indexInvalid=!1,this._boundsToLoad.length=0,this._boundsById.clear(),this._idByBounds.clear(),this._index.clear()}delete(e){const t=this._boundsById.get(e);this._boundsById.delete(e),t&&(this._idByBounds.delete(t),this._indexInvalid||this._index.remove(t))}forEachInBounds(e,t){this._loadIndex(),function(e,t,s){(function(e){o.minX=e[0],o.minY=e[1],o.maxX=e[2],o.maxY=e[3]})(t),e.search(o,s)}(this._index,e,(e=>t(this._idByBounds.get(e))))}get(e){return this._boundsById.get(e)}has(e){return this._boundsById.has(e)}invalidateIndex(){this._indexInvalid||(this._indexInvalid=!0,this._boundsToLoad.length=0)}set(e,t){if(!this._indexInvalid){const t=this._boundsById.get(e);t&&(this._index.remove(t),this._idByBounds.delete(t))}this._boundsById.set(e,t),t&&(this._idByBounds.set(t,e),this._indexInvalid||(this._boundsToLoad.push(t),this._boundsToLoad.length>5e4&&this._loadIndex()))}}},57191:(e,t,s)=>{s.d(t,{Z:()=>p});var i=s(20102),n=s(32448),r=s(92604),o=s(60437),a=s(24470),l=s(98732),h=s(37549),u=s(29730),d=s(70272),c=s(5428);const _={getObjectId:e=>e.objectId,getAttributes:e=>e.attributes,getAttribute:(e,t)=>e.attributes[t],cloneWithGeometry:(e,t)=>new d.u_(t,e.attributes,null,e.objectId),getGeometry:e=>e.geometry,getCentroid:(e,t)=>(null==e.centroid&&(e.centroid=(0,u.Y)(new c.Z,e.geometry,t.hasZ,t.hasM)),e.centroid)};var f=s(11490);const m=(0,o.Ue)();class p{constructor(e){this.geometryInfo=e,this._boundsStore=new h.H,this._featuresById=new Map,this._markedIds=new Set,this.events=new n.Z,this.featureAdapter=_}get geometryType(){return this.geometryInfo.geometryType}get hasM(){return this.geometryInfo.hasM}get hasZ(){return this.geometryInfo.hasZ}get numFeatures(){return this._featuresById.size}get fullBounds(){return this._boundsStore.fullBounds}get storeStatistics(){let e=0;return this._featuresById.forEach((t=>{null!=t.geometry&&t.geometry.coords&&(e+=t.geometry.coords.length)})),{featureCount:this._featuresById.size,vertexCount:e/(this.hasZ?this.hasM?4:3:this.hasM?3:2)}}getFullExtent(e){if(null==this.fullBounds)return null;const[t,s,i,n]=this.fullBounds;return{xmin:t,ymin:s,xmax:i,ymax:n,spatialReference:(0,f.S2)(e)}}add(e){this._add(e),this._emitChanged()}addMany(e){for(const t of e)this._add(t);this._emitChanged()}clear(){this._featuresById.clear(),this._boundsStore.clear(),this._emitChanged()}removeById(e){const t=this._featuresById.get(e);return t?(this._remove(t),this._emitChanged(),t):null}removeManyById(e){this._boundsStore.invalidateIndex();for(const t of e){const e=this._featuresById.get(t);e&&this._remove(e)}this._emitChanged()}forEachBounds(e,t){for(const s of e){const e=this._boundsStore.get(s.objectId);e&&t((0,o.JR)(m,e))}}getFeature(e){return this._featuresById.get(e)}has(e){return this._featuresById.has(e)}forEach(e){this._featuresById.forEach((t=>e(t)))}forEachInBounds(e,t){this._boundsStore.forEachInBounds(e,(e=>{t(this._featuresById.get(e))}))}startMarkingUsedFeatures(){this._boundsStore.invalidateIndex(),this._markedIds.clear()}sweep(){let e=!1;this._featuresById.forEach(((t,s)=>{this._markedIds.has(s)||(e=!0,this._remove(t))})),this._markedIds.clear(),e&&this._emitChanged()}_emitChanged(){this.events.emit("changed",void 0)}_add(e){if(!e)return;const t=e.objectId;if(null==t)return void r.Z.getLogger("esri.layers.graphics.data.FeatureStore").error(new i.Z("featurestore:invalid-feature","feature id is missing",{feature:e}));const s=this._featuresById.get(t);let n;if(this._markedIds.add(t),s?(e.displayId=s.displayId,n=this._boundsStore.get(t),this._boundsStore.delete(t)):null!=this.onFeatureAdd&&this.onFeatureAdd(e),null==e.geometry||!e.geometry.coords||!e.geometry.coords.length)return this._boundsStore.set(t,null),void this._featuresById.set(t,e);n=(0,l.$)(null!=n?n:(0,a.Ue)(),e.geometry,this.geometryInfo.hasZ,this.geometryInfo.hasM),null!=n&&this._boundsStore.set(t,n),this._featuresById.set(t,e)}_remove(e){null!=this.onFeatureRemove&&this.onFeatureRemove(e);const t=e.objectId;return this._markedIds.delete(t),this._boundsStore.delete(t),this._featuresById.delete(t),e}}},99282:(e,t,s)=>{s.d(t,{a:()=>r});var i=s(67900),n=s(68441);const r={unknown:1,inches:(0,i.En)(1,"meters","inches"),feet:(0,i.En)(1,"meters","feet"),"us-feet":(0,i.En)(1,"meters","us-feet"),yards:(0,i.En)(1,"meters","yards"),miles:(0,i.En)(1,"meters","miles"),"nautical-miles":(0,i.En)(1,"meters","nautical-miles"),millimeters:(0,i.En)(1,"meters","millimeters"),centimeters:(0,i.En)(1,"meters","centimeters"),decimeters:(0,i.En)(1,"meters","decimeters"),meters:(0,i.En)(1,"meters","meters"),kilometers:(0,i.En)(1,"meters","kilometers"),"decimal-degrees":1/(0,i.ty)(1,"meters",n.sv.radius)}},86787:(e,t,s)=>{s.d(t,{Z:()=>v});var i,n=s(43697),r=s(35454),o=s(96674),a=s(70586),l=s(5600),h=(s(75215),s(67676),s(80442),s(71715)),u=s(52011),d=s(30556),c=s(35671);let _=i=class extends o.wq{constructor(e){super(e)}async collectRequiredFields(e,t){return(0,c.io)(e,t,this.expression)}clone(){return new i({expression:this.expression,title:this.title})}equals(e){return this.expression===e.expression&&this.title===e.title}};(0,n._)([(0,l.Cb)({type:String,json:{write:!0}})],_.prototype,"expression",void 0),(0,n._)([(0,l.Cb)({type:String,json:{write:!0}})],_.prototype,"title",void 0),_=i=(0,n._)([(0,u.j)("esri.layers.support.FeatureExpressionInfo")],_);const f=_;var m,p=s(12541);const g=(0,r.w)()({onTheGround:"on-the-ground",relativeToGround:"relative-to-ground",relativeToScene:"relative-to-scene",absoluteHeight:"absolute-height"}),y=new r.X({foot:"feet",kilometer:"kilometers",meter:"meters",mile:"miles","us-foot":"us-feet",yard:"yards"});let E=m=class extends o.wq{constructor(e){super(e),this.offset=null}readFeatureExpressionInfo(e,t){return null!=e?e:t.featureExpression&&0===t.featureExpression.value?{expression:"0"}:void 0}writeFeatureExpressionInfo(e,t,s,i){t[s]=e.write({},i),"0"===e.expression&&(t.featureExpression={value:0})}get mode(){const{offset:e,featureExpressionInfo:t}=this;return this._isOverridden("mode")?this._get("mode"):null!=e||t?"relative-to-ground":"on-the-ground"}set mode(e){this._override("mode",e)}set unit(e){this._set("unit",e)}write(e,t){return this.offset||this.mode||this.featureExpressionInfo||this.unit?super.write(e,t):null}clone(){return new m({mode:this.mode,offset:this.offset,featureExpressionInfo:this.featureExpressionInfo?this.featureExpressionInfo.clone():void 0,unit:this.unit})}equals(e){return this.mode===e.mode&&this.offset===e.offset&&this.unit===e.unit&&(0,a._W)(this.featureExpressionInfo,e.featureExpressionInfo)}};(0,n._)([(0,l.Cb)({type:f,json:{write:!0}})],E.prototype,"featureExpressionInfo",void 0),(0,n._)([(0,h.r)("featureExpressionInfo",["featureExpressionInfo","featureExpression"])],E.prototype,"readFeatureExpressionInfo",null),(0,n._)([(0,d.c)("featureExpressionInfo",{featureExpressionInfo:{type:f},"featureExpression.value":{type:[0]}})],E.prototype,"writeFeatureExpressionInfo",null),(0,n._)([(0,l.Cb)({type:g.apiValues,nonNullable:!0,json:{type:g.jsonValues,read:g.read,write:{writer:g.write,isRequired:!0}}})],E.prototype,"mode",null),(0,n._)([(0,l.Cb)({type:Number,json:{write:!0}})],E.prototype,"offset",void 0),(0,n._)([(0,l.Cb)({type:p.f9,json:{type:String,read:y.read,write:y.write}})],E.prototype,"unit",null),E=m=(0,n._)([(0,u.j)("esri.layers.support.ElevationInfo")],E);const v=E},12541:(e,t,s)=>{s.d(t,{Z7:()=>n,f9:()=>r});var i=s(99282);function n(e){return 1/(i.a[e]||1)}const r=function(){const e=Object.keys(i.a);return e.sort(),e}()},65967:(e,t,s)=>{s.r(t),s.d(t,{default:()=>Ee});var i=s(43697),n=s(32448),r=s(95330),o=s(17445),a=s(5600),l=(s(75215),s(67676)),h=(s(80442),s(52011)),u=s(19402),d=s(82971),c=s(57191),_=s(11028),f=s(11145),m=s(14165),p=s(86787),g=s(13867),y=s(30175),E=s(67900),v=s(12541);function x(e=!1,t){if(e){const{elevationInfo:e,alignPointsInFeatures:s,spatialReference:i}=t;return new S(e,s,i)}return new b}class b{async alignCandidates(e,t){return e}notifyElevationSourceChange(){}}class S{constructor(e,t,s){this._elevationInfo=e,this._alignPointsInFeatures=t,this.spatialReference=s,this._alignmentsCache=new g.z(1024),this._cacheVersion=0,this._metersPerVerticalUnit=(0,E._R)(s)}async alignCandidates(e,t){const s=this._elevationInfo;return null==s||"absolute-height"!==s.mode||s.featureExpressionInfo?this._alignComputedElevationCandidates(e,t):(this._alignAbsoluteElevationCandidates(e,s),e)}notifyElevationSourceChange(){this._alignmentsCache.clear(),this._cacheVersion++}_alignAbsoluteElevationCandidates(e,t){const{offset:s,unit:i}=t;if(null==s)return;const n=s*((0,v.Z7)(i??"meters")/this._metersPerVerticalUnit);for(const t of e)switch(t.type){case"edge":t.start.z+=n,t.end.z+=n;continue;case"vertex":t.target.z+=n;continue}}async _alignComputedElevationCandidates(e,t){const s=new Map;for(const t of e)(0,y.s1)(s,t.objectId,I).push(t);const[i,n,o]=this._prepareQuery(s),a=await this._alignPointsInFeatures(i,t);if((0,r.k_)(t),o!==this._cacheVersion)return this._alignComputedElevationCandidates(e,t);this._applyCacheAndResponse(i,a,n);const{drapedObjectIds:l,failedObjectIds:h}=a,u=[];for(const t of e){const{objectId:e}=t;l.has(e)&&"edge"===t.type&&(t.draped=!0),h.has(e)||u.push(t)}return u}_prepareQuery(e){const t=[],s=[];for(const[i,n]of e){const e=[];for(const t of n)this._addToQueriesOrCachedResult(i,t.target,e,s),"edge"===t.type&&(this._addToQueriesOrCachedResult(i,t.start,e,s),this._addToQueriesOrCachedResult(i,t.end,e,s));0!==e.length&&t.push({objectId:i,points:e})}return[t,s,this._cacheVersion]}_addToQueriesOrCachedResult(e,t,s,i){const n=T(e,t),r=this._alignmentsCache.get(n);null==r?s.push(t):i.push(new C(t,r))}_applyCacheAndResponse(e,{elevations:t,drapedObjectIds:s,failedObjectIds:i},n){for(const e of n)e.apply();let r=0;const o=this._alignmentsCache;for(const{objectId:n,points:a}of e){if(i.has(n)){r+=a.length;continue}const e=!s.has(n);for(const s of a){const i=T(n,s),a=t[r++];s.z=a,e&&o.put(i,a,1)}}}}class C{constructor(e,t){this.point=e,this.z=t}apply(){this.point.z=this.z}}function T(e,{x:t,y:s,z:i}){return`${e}-${t}-${s}-${i??0}}`}function I(){return[]}class F{filter(e,t){return t}notifyElevationSourceChange(){}}class w{filter(e,t){const{point:s,distance:i}=e,{z:n}=s;if(null==n)return t;if(0===t.length)return t;const r=function(e){return"number"==typeof e?{x:e,y:e,z:e}:e}(i),o=this._updateCandidatesTo3D(t,s,r).filter(z);return o.sort(A),o}_updateCandidatesTo3D(e,t,s){for(const i of e)switch(i.type){case"edge":B(i,t,s);continue;case"vertex":R(i,t,s);continue}return e}}function z(e){return e.distance<=1}function M(e=!1){return e?new w:new F}function B(e,t,{x:s,y:i,z:n}){const{start:r,end:o,target:a}=e;e.draped||function(e,t,s,i){const n=i.x-s.x,r=i.y-s.y,o=i.z-s.z,a=n*n+r*r+o*o,l=(t.x-s.x)*n+(t.y-s.y)*r+o*(t.z-s.z),h=Math.min(1,Math.max(0,l/a)),u=s.x+n*h,d=s.y+r*h,c=s.z+o*h;e.x=u,e.y=d,e.z=c}(a,t,r,o);const l=(t.x-a.x)/s,h=(t.y-a.y)/i,u=(t.z-a.z)/n;e.distance=Math.sqrt(l*l+h*h+u*u)}function R(e,t,{x:s,y:i,z:n}){const{target:r}=e,o=(t.x-r.x)/s,a=(t.y-r.y)/i,l=(t.z-r.z)/n,h=Math.sqrt(o*o+a*a+l*l);e.distance=h}function A(e,t){return e.distance-t.distance}var O=s(22974),D=s(19153);function P(e=!1,t){return e?new k(t):new H}class H{async fetch(){return[]}notifySymbologyChange(){}}class k{constructor(e){this._getSymbologyCandidates=e,this._candidatesCache=new g.z(1024),this._cacheVersion=0}async fetch(e,t){if(0===e.length)return[];const s=[],i=[],n=this._candidatesCache;for(const t of e){const e=Y(t),r=n.get(e);if(r)for(const e of r)i.push((0,O.d9)(e));else s.push(t),n.put(e,[],1)}if(0===s.length)return i;const o=this._cacheVersion,{candidates:a,sourceCandidateIndices:l}=await this._getSymbologyCandidates(s,t);if((0,r.k_)(t),o!==this._cacheVersion)return this.fetch(e,t);const h=[],{length:u}=a;for(let e=0;e<u;++e){const t=a[e],i=Y(s[l[e]]),r=n.get(i);r.push(t),n.put(i,r,r.length),h.push((0,O.d9)(t))}return i.concat(h)}notifySymbologyChange(){this._candidatesCache.clear(),this._cacheVersion++}}function Y(e){switch(e.type){case"vertex":{const{objectId:t,target:s}=e,i=`${t}-vertex-${s.x}-${s.y}-${s.z??0}`;return(0,D.hP)(i).toString()}case"edge":{const{objectId:t,start:s,end:i}=e,n=`${t}-edge-${s.x}-${s.y}-${s.z??0}-to-${i.x}-${i.y}-${i.z??0}`;return(0,D.hP)(n).toString()}default:return""}}var N=s(92036);let j=class extends N.Z{constructor(){super(...arguments),this.updating=!1,this._pending=[]}push(e,t){this._pending.push({promise:e,callback:t}),1===this._pending.length&&this._process()}_process(){if(!this._pending.length)return void(this.updating=!1);this.updating=!0;const e=this._pending[0];e.promise.then((t=>e.callback(t))).catch((()=>{})).then((()=>{this._pending.shift(),this._process()}))}};(0,i._)([(0,a.Cb)()],j.prototype,"updating",void 0),j=(0,i._)([(0,h.j)("esri.core.AsyncSequence")],j);var U,Z=s(66643),L=s(50758),X=s(92604),q=s(6570),J=s(24470),$=s(98732),V=s(66677),G=s(78760),Q=s(34599);class W{constructor(e,t){this.data=e,this.resolution=t,this.state={type:U.CREATED},this.alive=!0}process(e){switch(this.state.type){case U.CREATED:return this.state=this._gotoFetchCount(this.state,e),this.state.task.promise.then(e.resume,e.resume);case U.FETCH_COUNT:break;case U.FETCHED_COUNT:return this.state=this._gotoFetchFeatures(this.state,e),this.state.task.promise.then(e.resume,e.resume);case U.FETCH_FEATURES:break;case U.FETCHED_FEATURES:this.state=this._goToDone(this.state,e);case U.DONE:}return null}get debugInfo(){return{data:this.data,featureCount:this._featureCount,state:this._stateToString}}get _featureCount(){switch(this.state.type){case U.CREATED:case U.FETCH_COUNT:return 0;case U.FETCHED_COUNT:return this.state.featureCount;case U.FETCH_FEATURES:return this.state.previous.featureCount;case U.FETCHED_FEATURES:return this.state.features.length;case U.DONE:return this.state.previous.features.length}}get _stateToString(){switch(this.state.type){case U.CREATED:return"created";case U.FETCH_COUNT:return"fetch-count";case U.FETCHED_COUNT:return"fetched-count";case U.FETCH_FEATURES:return"fetch-features";case U.FETCHED_FEATURES:return"fetched-features";case U.DONE:return"done"}}_gotoFetchCount(e,t){return{type:U.FETCH_COUNT,previous:e,task:(0,Z.vr)((async e=>{const s=await(0,Z.mt)(t.fetchCount(this,e));this.state.type===U.FETCH_COUNT&&(this.state=this._gotoFetchedCount(this.state,s.ok?s.value:1/0))}))}}_gotoFetchedCount(e,t){return{type:U.FETCHED_COUNT,featureCount:t,previous:e}}_gotoFetchFeatures(e,t){return{type:U.FETCH_FEATURES,previous:e,task:(0,Z.vr)((async s=>{const i=await(0,Z.mt)(t.fetchFeatures(this,e.featureCount,s));this.state.type===U.FETCH_FEATURES&&(this.state=this._gotoFetchedFeatures(this.state,i.ok?i.value:[]))}))}}_gotoFetchedFeatures(e,t){return{type:U.FETCHED_FEATURES,previous:e,features:t}}_goToDone(e,t){return t.finish(this,e.features),{type:U.DONE,previous:e}}reset(){const e=this.state;switch(this.state={type:U.CREATED},e.type){case U.CREATED:case U.FETCHED_COUNT:case U.FETCHED_FEATURES:case U.DONE:break;case U.FETCH_COUNT:case U.FETCH_FEATURES:e.task.abort()}}intersects(e){return null==e||!this.data.extent||((0,J.oJ)(e,K),(0,J.kK)(this.data.extent,K))}}!function(e){e[e.CREATED=0]="CREATED",e[e.FETCH_COUNT=1]="FETCH_COUNT",e[e.FETCHED_COUNT=2]="FETCHED_COUNT",e[e.FETCH_FEATURES=3]="FETCH_FEATURES",e[e.FETCHED_FEATURES=4]="FETCHED_FEATURES",e[e.DONE=5]="DONE"}(U||(U={}));const K=(0,J.Ue)();let ee=class extends N.Z{get _minimumVerticesPerFeature(){switch(this.store?.featureStore.geometryType){case"esriGeometryPoint":case"esriGeometryMultipoint":return 1;case"esriGeometryPolygon":return 4;case"esriGeometryPolyline":return 2}}set filter(e){const t=this._get("filter"),s=this._filterProperties(e);JSON.stringify(t)!==JSON.stringify(s)&&this._set("filter",s)}set customParameters(e){const t=this._get("customParameters");JSON.stringify(t)!==JSON.stringify(e)&&this._set("customParameters",e)}get _configuration(){return{filter:this.filter,customParameters:this.customParameters,tileInfo:this.tileInfo,tileSize:this.tileSize}}set tileInfo(e){const t=this._get("tileInfo");t!==e&&(null!=e&&null!=t&&JSON.stringify(e)===JSON.stringify(t)||(this._set("tileInfo",e),this.store.tileInfo=e))}set tileSize(e){this._get("tileSize")!==e&&this._set("tileSize",e)}get updating(){return this.updatingExcludingEdits||this._pendingEdits.updating}get updatingExcludingEdits(){return this._updatingHandles.updating}get hasZ(){return this.store.featureStore.hasZ}constructor(e){super(e),this.suspended=!0,this.tilesOfInterest=[],this.availability=0,this._pendingTiles=new Map,this._updatingHandles=new u.R,this._pendingEdits=new j,this._pendingEditsAbortController=new AbortController}initialize(){this._initializeFetchExtent(),this._updatingHandles.add((()=>this._configuration),(()=>this.refresh())),this._updatingHandles.add((()=>this.tilesOfInterest),((e,t)=>{(0,l.fS)(e,t,(({id:e},{id:t})=>e===t))||this._process()}),o.Z_),this.addHandles((0,o.gx)((()=>!this.suspended),(()=>this._process())))}destroy(){this._pendingTiles.forEach((e=>this._deletePendingTile(e))),this._pendingTiles.clear(),this.store.destroy(),this.tilesOfInterest.length=0,this._pendingEditsAbortController.abort(),this._pendingEditsAbortController=null,this._updatingHandles.destroy()}refresh(){this.store.refresh(),this._pendingTiles.forEach((e=>this._deletePendingTile(e))),this._process()}applyEdits(e){this._pendingEdits.push(e,(async e=>{if(0===e.addedFeatures.length&&0===e.updatedFeatures.length&&0===e.deletedFeatures.length)return;for(const[,e]of this._pendingTiles)e.reset();const t={...e,deletedFeatures:e.deletedFeatures.map((({objectId:e,globalId:t})=>e&&-1!==e?e:this._lookupObjectIdByGlobalId(t)))};await this._updatingHandles.addPromise(this.store.processEdits(t,((e,t)=>this._queryFeaturesById(e,t)),this._pendingEditsAbortController.signal)),this._processPendingTiles()}))}_initializeFetchExtent(){if(!this.capabilities.query.supportsExtent||!(0,V.M8)(this.url))return;const e=(0,Z.vr)((async e=>{try{const t=await(0,Q.Vr)(this.url,new m.Z({where:"1=1",outSpatialReference:this.spatialReference,cacheHint:this.capabilities.query.supportsCacheHint??void 0}),{query:this._configuration.customParameters,signal:e});this.store.extent=q.Z.fromJSON(t.data?.extent)}catch(e){(0,r.r9)(e),X.Z.getLogger(this).warn("Failed to fetch data extent",e)}}));this._updatingHandles.addPromise(e.promise.then((()=>this._process()))),this.addHandles((0,L.kB)((()=>e.abort())))}get debugInfo(){return{numberOfFeatures:this.store.featureStore.numFeatures,tilesOfInterest:this.tilesOfInterest,pendingTiles:Array.from(this._pendingTiles.values()).map((e=>e.debugInfo)),storedTiles:this.store.debugInfo}}_process(){this._markTilesNotAlive(),this._createPendingTiles(),this._deletePendingTiles(),this._processPendingTiles()}_markTilesNotAlive(){for(const[,e]of this._pendingTiles)e.alive=!1}_createPendingTiles(){if(this.suspended)return;const e=this._collectMissingTilesInfo();if(this._setAvailability(null==e?1:e.coveredArea/e.fullArea),null!=e)for(const{data:t,resolution:s}of e.missingTiles){const e=this._pendingTiles.get(t.id);e?(e.resolution=s,e.alive=!0):this._createPendingTile(t,s)}}_collectMissingTilesInfo(){let e=null;for(let t=this.tilesOfInterest.length-1;t>=0;t--){const s=this.tilesOfInterest[t],i=this.store.process(s,((e,t)=>this._verifyTileComplexity(e,t)));null==e?e=i:e.prepend(i)}return e}_deletePendingTiles(){for(const[,e]of this._pendingTiles)e.alive||this._deletePendingTile(e)}_processPendingTiles(){const e={fetchCount:(e,t)=>this._fetchCount(e,t),fetchFeatures:(e,t,s)=>this._fetchFeatures(e,t,s),finish:(e,t)=>this._finishPendingTile(e,t),resume:()=>this._processPendingTiles()};if(this._ensureFetchAllCounts(e))for(const[,t]of this._pendingTiles)this._verifyTileComplexity(this.store.getFeatureCount(t.data),t.resolution)&&this._updatingHandles.addPromise(t.process(e))}_verifyTileComplexity(e,t){return this._verifyVertexComplexity(e)&&this._verifyFeatureDensity(e,t)}_verifyVertexComplexity(e){return e*this._minimumVerticesPerFeature<ie}_verifyFeatureDensity(e,t){if(null==this.tileInfo)return!1;const s=this.tileSize*t;return e*(ne/(s*s))<re}_ensureFetchAllCounts(e){let t=!0;for(const[,s]of this._pendingTiles)s.state.type<U.FETCHED_COUNT&&this._updatingHandles.addPromise(s.process(e)),s.state.type<=U.FETCH_COUNT&&(t=!1);return t}_finishPendingTile(e,t){this.store.add(e.data,t),this._deletePendingTile(e),this._updateAvailability()}_updateAvailability(){const e=this._collectMissingTilesInfo();this._setAvailability(null==e?1:e.coveredArea/e.fullArea)}_setAvailability(e){this._set("availability",e)}_createPendingTile(e,t){const s=new W(e,t);return this._pendingTiles.set(e.id,s),s}_deletePendingTile(e){e.reset(),this._pendingTiles.delete(e.data.id)}async _fetchCount(e,t){return this.store.fetchCount(e.data,this.url,this._createCountQuery(e),{query:this.customParameters,timeout:se,signal:t})}async _fetchFeatures(e,t,s){let i=0;const n=[];let r=0,o=t;for(;;){const a=this._createFeaturesQuery(e),l=this._setPagingParameters(a,i,o),{features:h,exceededTransferLimit:u}=await this._queryFeatures(a,s);l&&(i+=a.num),r+=h.length;for(const e of h)n.push(e);if(o=t-r,!l||!u||o<=0)return n}}_filterProperties(e){return null==e?{where:"1=1",gdbVersion:void 0,timeExtent:void 0}:{where:e.where||"1=1",timeExtent:e.timeExtent,gdbVersion:e.gdbVersion}}_lookupObjectIdByGlobalId(e){const t=this.globalIdField,s=this.objectIdField;if(null==t)throw new Error("Expected globalIdField to be defined");let i=null;if(this.store.featureStore.forEach((n=>{e===n.attributes[t]&&(i=n.objectId??n.attributes[s])})),null==i)throw new Error(`Expected to find a feature with globalId ${e}`);return i}_queryFeaturesById(e,t){const s=this._createFeaturesQuery();return s.objectIds=e,this._queryFeatures(s,t)}_queryFeatures(e,t){return this.capabilities.query.supportsFormatPBF?this._queryFeaturesPBF(e,t):this._queryFeaturesJSON(e,t)}async _queryFeaturesPBF(e,t){const{sourceSpatialReference:s}=this,{data:i}=await(0,Q.qp)(this.url,e,new G.J({sourceSpatialReference:s}),{query:this._configuration.customParameters,timeout:se,signal:t});return(0,$.lM)(i)}async _queryFeaturesJSON(e,t){const{sourceSpatialReference:s}=this,{data:i}=await(0,Q.JT)(this.url,e,s,{query:this._configuration.customParameters,timeout:se,signal:t});return(0,$.h_)(i,this.objectIdField)}_createCountQuery(e){const t=this._createBaseQuery(e);return this.capabilities.query.supportsCacheHint&&(t.cacheHint=!0),t}_createFeaturesQuery(e=null){const t=this._createBaseQuery(e);return t.outFields=this.globalIdField?[this.globalIdField,this.objectIdField]:[this.objectIdField],t.returnGeometry=!0,null!=e&&(this.capabilities.query.supportsResultType?t.resultType="tile":this.capabilities.query.supportsCacheHint&&(t.cacheHint=!0)),t}_createBaseQuery(e){const t=new m.Z({returnZ:this.hasZ,returnM:!1,geometry:null!=this.tileInfo&&null!=e?(0,J.HH)(e.data.extent,this.tileInfo.spatialReference):void 0}),s=this._configuration.filter;return null!=s&&(t.where=s.where,t.gdbVersion=s.gdbVersion,t.timeExtent=s.timeExtent),t.outSpatialReference=this.spatialReference,t}_setPagingParameters(e,t,s){if(!this.capabilities.query.supportsPagination)return!1;const{supportsMaxRecordCountFactor:i,supportsCacheHint:n,tileMaxRecordCount:r,maxRecordCount:o,supportsResultType:a}=this.capabilities.query,l=i?m.Z.MAX_MAX_RECORD_COUNT_FACTOR:1,h=l*((a||n)&&r?r:o||te);return e.start=t,i?(e.maxRecordCountFactor=Math.min(l,Math.ceil(s/h)),e.num=Math.min(s,e.maxRecordCountFactor*h)):e.num=Math.min(s,h),!0}};(0,i._)([(0,a.Cb)({constructOnly:!0})],ee.prototype,"url",void 0),(0,i._)([(0,a.Cb)({constructOnly:!0})],ee.prototype,"objectIdField",void 0),(0,i._)([(0,a.Cb)({constructOnly:!0})],ee.prototype,"globalIdField",void 0),(0,i._)([(0,a.Cb)({constructOnly:!0})],ee.prototype,"capabilities",void 0),(0,i._)([(0,a.Cb)({constructOnly:!0})],ee.prototype,"sourceSpatialReference",void 0),(0,i._)([(0,a.Cb)({constructOnly:!0})],ee.prototype,"spatialReference",void 0),(0,i._)([(0,a.Cb)({constructOnly:!0})],ee.prototype,"store",void 0),(0,i._)([(0,a.Cb)({readOnly:!0})],ee.prototype,"_minimumVerticesPerFeature",null),(0,i._)([(0,a.Cb)()],ee.prototype,"suspended",void 0),(0,i._)([(0,a.Cb)()],ee.prototype,"filter",null),(0,i._)([(0,a.Cb)()],ee.prototype,"customParameters",null),(0,i._)([(0,a.Cb)({readOnly:!0})],ee.prototype,"_configuration",null),(0,i._)([(0,a.Cb)()],ee.prototype,"tileInfo",null),(0,i._)([(0,a.Cb)()],ee.prototype,"tileSize",null),(0,i._)([(0,a.Cb)()],ee.prototype,"tilesOfInterest",void 0),(0,i._)([(0,a.Cb)({readOnly:!0})],ee.prototype,"updating",null),(0,i._)([(0,a.Cb)({readOnly:!0})],ee.prototype,"updatingExcludingEdits",null),(0,i._)([(0,a.Cb)({readOnly:!0})],ee.prototype,"availability",void 0),(0,i._)([(0,a.Cb)()],ee.prototype,"hasZ",null),ee=(0,i._)([(0,h.j)("esri.views.interactive.snapping.featureSources.featureServiceSource.FeatureServiceTiledFetcher")],ee);const te=2e3,se=6e5,ie=1e6,ne=25,re=1;var oe=s(43090),ae=s(91303),le=s(37549),he=s(43077);class ue{constructor(){this._store=new Map,this._byteSize=0}set(e,t){this.delete(e),this._store.set(e,t),this._byteSize+=t.byteSize}delete(e){const t=this._store.get(e);return!!this._store.delete(e)&&(null!=t&&(this._byteSize-=t.byteSize),!0)}get(e){return this._used(e),this._store.get(e)}has(e){return this._used(e),this._store.has(e)}clear(){this._store.clear()}applyByteSizeLimit(e,t){for(const[s,i]of this._store){if(this._byteSize<=e)break;this.delete(s),t(i)}}values(){return this._store.values()}[Symbol.iterator](){return this._store[Symbol.iterator]()}_used(e){const t=this._store.get(e);t&&(this._store.delete(e),this._store.set(e,t))}}let de=class extends N.Z{constructor(e){super(e),this.tileInfo=null,this.extent=null,this.maximumByteSize=10*ae.Y.MEGABYTES,this._tileBounds=new le.H,this._tiles=new ue,this._refCounts=new Map,this._tileFeatureCounts=new Map,this._tmpBoundingRect=(0,J.Ue)()}add(e,t){const s=[];for(const e of t)this._referenceFeature(e.objectId)===ge.ADDED&&s.push(e);this._addTileStorage(e,new Set(t.map((e=>e.objectId))),function(e){return e.reduce(((e,t)=>e+function(e){return 32+function(e){if(null==e)return 0;const t=(0,oe.do)(e.lengths,4);return 32+(0,oe.do)(e.coords,8)+t}(e.geometry)+(0,oe.f2)(e.attributes)}(t)),0)}(t)),this.featureStore.addMany(s),this._tiles.applyByteSizeLimit(this.maximumByteSize,(e=>this._removeTileStorage(e)))}destroy(){this.clear(),this._tileFeatureCounts.clear()}clear(){this.featureStore.clear(),this._tileBounds.clear(),this._tiles.clear(),this._refCounts.clear()}refresh(){this.clear(),this._tileFeatureCounts.clear()}processEdits(e,t,s){return this._processEditsDelete(e.deletedFeatures.concat(e.updatedFeatures)),this._processEditsRefetch(e.addedFeatures.concat(e.updatedFeatures),t,s)}_addTileStorage(e,t,s){const i=e.id;this._tiles.set(i,new ce(e,t,s)),this._tileBounds.set(i,e.extent),this._tileFeatureCounts.set(i,t.size)}_remove({id:e}){const t=this._tiles.get(e);t&&this._removeTileStorage(t)}_removeTileStorage(e){const t=[];for(const s of e.objectIds)this._unreferenceFeature(s)===ge.REMOVED&&t.push(s);this.featureStore.removeManyById(t);const s=e.data.id;this._tiles.delete(s),this._tileBounds.delete(s)}_processEditsDelete(e){this.featureStore.removeManyById(e);for(const[,t]of this._tiles){for(const s of e)t.objectIds.delete(s);this._tileFeatureCounts.set(t.data.id,t.objectIds.size)}for(const t of e)this._refCounts.delete(t)}async _processEditsRefetch(e,t,s){const i=(await t(e,s)).features,{hasZ:n,hasM:r}=this.featureStore;for(const e of i){const t=(0,$.$)(this._tmpBoundingRect,e.geometry,n,r);null!=t&&this._tileBounds.forEachInBounds(t,(t=>{const s=this._tiles.get(t);this.featureStore.add(e);const i=e.objectId;s.objectIds.has(i)||(s.objectIds.add(i),this._referenceFeature(i),this._tileFeatureCounts.set(s.data.id,s.objectIds.size))}))}}process(e,t=(()=>!0)){if(null==this.tileInfo||!e.extent||null!=this.extent&&!(0,J.kK)((0,J.oJ)(this.extent,this._tmpBoundingRect),e.extent))return new fe(e);if(this._tiles.has(e.id))return new fe(e);const s=this._createTileTree(e,this.tileInfo);return this._simplify(s,t,null,0,1),this._collectMissingTiles(e,s,this.tileInfo)}get debugInfo(){return Array.from(this._tiles.values()).map((({data:e})=>({data:e,featureCount:this._tileFeatureCounts.get(e.id)||0})))}getFeatureCount(e){return this._tileFeatureCounts.get(e.id)??0}async fetchCount(e,t,s,i){const n=this._tileFeatureCounts.get(e.id);if(null!=n)return n;const r=await(0,Q.hH)(t,s,i);return this._tileFeatureCounts.set(e.id,r.data.count),r.data.count}_createTileTree(e,t){const s=new _e(e.level,e.row,e.col);return t.updateTileInfo(s,f.Z.ExtrapolateOptions.POWER_OF_TWO),this._tileBounds.forEachInBounds(e.extent,(i=>{const n=this._tiles.get(i)?.data;n&&this._tilesAreRelated(e,n)&&this._populateChildren(s,n,t,this._tileFeatureCounts.get(n.id)||0)})),s}_tilesAreRelated(e,t){if(!e||!t)return!1;if(e.level===t.level)return e.row===t.row&&e.col===t.col;const s=e.level<t.level,i=s?e:t,n=s?t:e,r=1<<n.level-i.level;return Math.floor(n.row/r)===i.row&&Math.floor(n.col/r)===i.col}_populateChildren(e,t,s,i){const n=t.level-e.level-1;if(n<0)return void(e.isLeaf=!0);const r=t.row>>n,o=t.col>>n,a=e.row<<1,l=o-(e.col<<1)+(r-a<<1),h=e.children[l];if(null!=h)this._populateChildren(h,t,s,i);else{const n=new _e(e.level+1,r,o);s.updateTileInfo(n,f.Z.ExtrapolateOptions.POWER_OF_TWO),e.children[l]=n,this._populateChildren(n,t,s,i)}}_simplify(e,t,s,i,n){const r=n*n;if(e.isLeaf)return t(this.getFeatureCount(e),n)?0:(this._remove(e),null!=s&&(s.children[i]=null),r);const o=n/2,a=o*o;let l=0;for(let s=0;s<e.children.length;s++){const i=e.children[s];l+=null!=i?this._simplify(i,t,e,s,o):a}return 0===l?this._mergeChildren(e):1-l/r<pe&&(this._purge(e),null!=s&&(s.children[i]=null),l=r),l}_mergeChildren(e){const t=new Set;let s=0;this._forEachLeaf(e,(e=>{const i=this._tiles.get(e.id);if(i){s+=i.byteSize;for(const e of i.objectIds)t.has(e)||(t.add(e),this._referenceFeature(e));this._remove(e)}})),this._addTileStorage(e,t,s),e.isLeaf=!0,e.children[0]=e.children[1]=e.children[2]=e.children[3]=null,this._tileFeatureCounts.set(e.id,t.size)}_forEachLeaf(e,t){for(const s of e.children)null!=s&&(s.isLeaf?t(s):this._forEachLeaf(s,t))}_purge(e){if(null!=e)if(e.isLeaf)this._remove(e);else for(let t=0;t<e.children.length;t++){const s=e.children[t];this._purge(s),e.children[t]=null}}_collectMissingTiles(e,t,s){const i=new me(s,e,this.extent);return this._collectMissingTilesRecurse(t,i,1),i.info}_collectMissingTilesRecurse(e,t,s){if(e.isLeaf)return;if(!e.hasChildren)return void t.addMissing(e.level,e.row,e.col,s);const i=s/2;for(let s=0;s<e.children.length;s++){const n=e.children[s];null==n?t.addMissing(e.level+1,(e.row<<1)+((2&s)>>1),(e.col<<1)+(1&s),i):this._collectMissingTilesRecurse(n,t,i)}}_referenceFeature(e){const t=(this._refCounts.get(e)||0)+1;return this._refCounts.set(e,t),1===t?ge.ADDED:ge.UNCHANGED}_unreferenceFeature(e){const t=(this._refCounts.get(e)||0)-1;return 0===t?(this._refCounts.delete(e),ge.REMOVED):(t>0&&this._refCounts.set(e,t),ge.UNCHANGED)}get test(){return{tiles:Array.from(this._tiles.values()).map((e=>`${e.data.id}:[${Array.from(e.objectIds)}]`)),featureReferences:Array.from(this._refCounts.keys()).map((e=>`${e}:${this._refCounts.get(e)}`))}}};(0,i._)([(0,a.Cb)({constructOnly:!0})],de.prototype,"featureStore",void 0),(0,i._)([(0,a.Cb)()],de.prototype,"tileInfo",void 0),(0,i._)([(0,a.Cb)()],de.prototype,"extent",void 0),(0,i._)([(0,a.Cb)()],de.prototype,"maximumByteSize",void 0),de=(0,i._)([(0,h.j)("esri.views.interactive.snapping.featureSources.featureServiceSource.FeatureServiceTileStore")],de);class ce{constructor(e,t,s){this.data=e,this.objectIds=t,this.byteSize=s}}class _e{constructor(e,t,s){this.level=e,this.row=t,this.col=s,this.isLeaf=!1,this.extent=null,this.children=[null,null,null,null]}get hasChildren(){return!this.isLeaf&&(null!=this.children[0]||null!=this.children[1]||null!=this.children[2]||null!=this.children[3])}}class fe{constructor(e,t=[]){this.missingTiles=t,this.fullArea=0,this.coveredArea=0,this.fullArea=(0,J.SO)(e.extent),this.coveredArea=this.fullArea}prepend(e){this.missingTiles=e.missingTiles.concat(this.missingTiles),this.coveredArea+=e.coveredArea,this.fullArea+=e.fullArea}}class me{constructor(e,t,s){this._tileInfo=e,this._extent=null,this.info=new fe(t),null!=s&&(this._extent=(0,J.oJ)(s))}addMissing(e,t,s,i){const n=new he.f(null,e,t,s);this._tileInfo.updateTileInfo(n,f.Z.ExtrapolateOptions.POWER_OF_TWO),null==n.extent||null!=this._extent&&!(0,J.kK)(this._extent,n.extent)||(this.info.missingTiles.push({data:n,resolution:i}),this.info.coveredArea-=(0,J.SO)(n.extent))}}const pe=.18751;var ge;!function(e){e[e.ADDED=0]="ADDED",e[e.REMOVED=1]="REMOVED",e[e.UNCHANGED=2]="UNCHANGED"}(ge||(ge={}));let ye=class extends n.Z.EventedAccessor{constructor(){super(...arguments),this._isInitializing=!0,this.remoteClient=null,this._whenSetup=(0,r.hh)(),this._elevationAligner=x(),this._elevationFilter=M(),this._symbologyCandidatesFetcher=P(),this._updatingHandles=new u.R,this._editsUpdatingHandles=new u.R,this._pendingApplyEdits=new Map,this._alignPointsInFeatures=async(e,t)=>{const s={points:e},i=await this.remoteClient.invoke("alignElevation",s,{signal:t});return(0,r.k_)(t),i},this._getSymbologyCandidates=async(e,t)=>{const s={candidates:e,spatialReference:this._spatialReference.toJSON()},i=await this.remoteClient.invoke("getSymbologyCandidates",s,{signal:t});return(0,r.k_)(t),i}}get updating(){return this.updatingExcludingEdits||this._editsUpdatingHandles.updating||this._featureFetcher.updating}get updatingExcludingEdits(){return this._featureFetcher.updatingExcludingEdits||this._isInitializing||this._updatingHandles.updating}destroy(){this._featureFetcher?.destroy(),this._queryEngine?.destroy(),this._featureStore?.clear()}async setup(e){if(this.destroyed)return{result:{}};const{geometryType:t,objectIdField:s,timeInfo:i,fields:n}=e.serviceInfo,{hasZ:r}=e,a=d.Z.fromJSON(e.spatialReference);this._spatialReference=a,this._featureStore=new c.Z({...e.serviceInfo,hasZ:r,hasM:!1}),this._queryEngine=new _.q({spatialReference:e.spatialReference,featureStore:this._featureStore,geometryType:t,fields:n,hasZ:r,hasM:!1,objectIdField:s,timeInfo:i}),this._featureFetcher=new ee({store:new de({featureStore:this._featureStore}),url:e.serviceInfo.url,objectIdField:e.serviceInfo.objectIdField,globalIdField:e.serviceInfo.globalIdField,capabilities:e.serviceInfo.capabilities,spatialReference:a,sourceSpatialReference:d.Z.fromJSON(e.serviceInfo.spatialReference)});const l="3d"===e.configuration.viewType;return this._elevationAligner=x(l,{elevationInfo:null!=e.elevationInfo?p.Z.fromJSON(e.elevationInfo):null,alignPointsInFeatures:this._alignPointsInFeatures,spatialReference:a}),this._elevationFilter=M(l),this.addHandles([(0,o.YP)((()=>this._featureFetcher.availability),(e=>this.emit("notify-availability",{availability:e})),o.Z_),(0,o.YP)((()=>this.updating),(()=>this._notifyUpdating()))]),this._whenSetup.resolve(),this._isInitializing=!1,this.configure(e.configuration)}async configure(e){return await this._updatingHandles.addPromise(this._whenSetup.promise),this._updateFeatureFetcherConfiguration(e),ve}async setSuspended(e,t){return await this._updatingHandles.addPromise(this._whenSetup.promise),(0,r.k_)(t),this._featureFetcher.suspended=e,ve}async fetchCandidates(e,t){await this._whenSetup.promise,(0,r.k_)(t);const s=function(e){return{point:e.point,mode:e.mode,distance:e.distance,returnEdge:e.returnEdge,returnVertex:e.returnVertex,query:null!=e.filter?e.filter:{where:"1=1"}}}(e),i=null!=t?t.signal:null,n=await this._queryEngine.executeQueryForSnapping(s,i);(0,r.k_)(i);const o=await this._elevationAligner.alignCandidates(n.candidates,i);(0,r.k_)(i);const a=await this._symbologyCandidatesFetcher.fetch(o,i);(0,r.k_)(i);const l=0===a.length?o:o.concat(a);return{result:{candidates:this._elevationFilter.filter(s,l)}}}async updateTiles(e,t){return await this._updatingHandles.addPromise(this._whenSetup.promise),(0,r.k_)(t),this._featureFetcher.tileSize=e.tileSize,this._featureFetcher.tilesOfInterest=e.tiles,this._featureFetcher.tileInfo=null!=e.tileInfo?f.Z.fromJSON(e.tileInfo):null,ve}async refresh(e,t){return await this._updatingHandles.addPromise(this._whenSetup.promise),(0,r.k_)(t),this._featureFetcher.refresh(),ve}async whenNotUpdating(e,t){return await this._updatingHandles.addPromise(this._whenSetup.promise),(0,r.k_)(t),await(0,o.N1)((()=>!this.updatingExcludingEdits),t),(0,r.k_)(t),ve}async getDebugInfo(e,t){return(0,r.k_)(t),{result:this._featureFetcher.debugInfo}}async beginApplyEdits(e,t){this._updatingHandles.addPromise(this._whenSetup.promise),(0,r.k_)(t);const s=(0,r.hh)();return this._pendingApplyEdits.set(e.id,s),this._featureFetcher.applyEdits(s.promise),this._editsUpdatingHandles.addPromise(s.promise),ve}async endApplyEdits(e,t){const s=this._pendingApplyEdits.get(e.id);return s&&s.resolve(e.edits),(0,r.k_)(t),ve}async notifyElevationSourceChange(e,t){return this._elevationAligner.notifyElevationSourceChange(),ve}async notifySymbologyChange(e,t){return this._symbologyCandidatesFetcher.notifySymbologyChange(),ve}async setSymbologySnappingSupported(e){return this._symbologyCandidatesFetcher=P(e,this._getSymbologyCandidates),ve}_updateFeatureFetcherConfiguration(e){this._featureFetcher.filter=null!=e.filter?m.Z.fromJSON(e.filter):null,this._featureFetcher.customParameters=e.customParameters}_notifyUpdating(){this.emit("notify-updating",{updating:this.updating})}};(0,i._)([(0,a.Cb)({readOnly:!0})],ye.prototype,"updating",null),(0,i._)([(0,a.Cb)({readOnly:!0})],ye.prototype,"updatingExcludingEdits",null),(0,i._)([(0,a.Cb)()],ye.prototype,"_isInitializing",void 0),ye=(0,i._)([(0,h.j)("esri.views.interactive.snapping.featureSources.featureServiceSource.FeatureServiceSnappingSourceWorker")],ye);const Ee=ye,ve={result:{}}}}]);