@arcgis/core 4.34.0-next.56 → 4.34.0-next.57

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 (184) hide show
  1. package/analysis/VolumeMeasurement/VolumeMeasurementCutFillOptions.d.ts +4 -0
  2. package/analysis/VolumeMeasurement/{CutFillOptions.js → VolumeMeasurementCutFillOptions.js} +1 -1
  3. package/analysis/VolumeMeasurementAnalysis.js +1 -1
  4. package/assets/esri/core/workers/RemoteClient.js +1 -1
  5. package/assets/esri/core/workers/chunks/02902303e5585a16ebea.js +1 -0
  6. package/assets/esri/core/workers/chunks/02a31483e09652a1a1a2.js +1 -0
  7. package/assets/esri/core/workers/chunks/0390f3aa624e3f380ce2.js +1 -0
  8. package/assets/esri/core/workers/chunks/047d6f7b1677cc7ab271.js +1 -0
  9. package/assets/esri/core/workers/chunks/04e652df94790f5ca08a.js +1 -0
  10. package/assets/esri/core/workers/chunks/{9f178cf73c63caaea190.js → 06d2251d6f6b3e44800a.js} +1 -1
  11. package/assets/esri/core/workers/chunks/07d5e0633cc2f765037f.js +1 -0
  12. package/assets/esri/core/workers/chunks/{8fa50cac57b6e1ecec76.js → 08393d9cc2ed846dd5b4.js} +1 -1
  13. package/assets/esri/core/workers/chunks/{18ceea59e469a0f2721b.js → 094c741fa8139c3f40cf.js} +1 -1
  14. package/assets/esri/core/workers/chunks/0d946a226b846b3c0849.js +1 -0
  15. package/assets/esri/core/workers/chunks/0f51e51db83f303ce5a6.js +1 -0
  16. package/assets/esri/core/workers/chunks/{6530449cd1975deb61f1.js → 184d3c88ac2fc1d7e2c3.js} +1 -1
  17. package/assets/esri/core/workers/chunks/1cbd59918c60a1a21494.js +1 -0
  18. package/assets/esri/core/workers/chunks/2ded2446700f89155ccd.js +1 -0
  19. package/assets/esri/core/workers/chunks/{19391d60c76a1dc7c262.js → 2f7e192ee2066f863e1d.js} +1 -1
  20. package/assets/esri/core/workers/chunks/{6b11476b2004b4db576e.js → 3445ffd752262673fb13.js} +1 -1
  21. package/assets/esri/core/workers/chunks/38f09e36e174792646bd.js +1 -0
  22. package/assets/esri/core/workers/chunks/{adf11d31f95481f89a55.js → 3b51b61a7b8a1ef87c9b.js} +1 -1
  23. package/assets/esri/core/workers/chunks/3c57b2e13628b5c1f6de.js +1 -0
  24. package/assets/esri/core/workers/chunks/{65e1f5b20a585e04655a.js → 44dc7ec52c4abb700783.js} +1 -1
  25. package/assets/esri/core/workers/chunks/{c91217d977a6baaee74a.js → 4558f2e3e77831758fdc.js} +1 -1
  26. package/assets/esri/core/workers/chunks/4753793daf0b7ff8b5ff.js +1 -0
  27. package/assets/esri/core/workers/chunks/{853b9f29b4d62fa621b9.js → 4d2473e680324dc17cfa.js} +1 -1
  28. package/assets/esri/core/workers/chunks/52917b753c5ceab0c1f7.js +353 -0
  29. package/assets/esri/core/workers/chunks/{6940bb6524938894a246.js → 53873f26a2c24cd75e4a.js} +1 -1
  30. package/assets/esri/core/workers/chunks/561a2078458bc0339f83.js +1 -0
  31. package/assets/esri/core/workers/chunks/{6dc0009889f2b7cc8cff.js → 5691d504ffe5592bc40f.js} +1 -1
  32. package/assets/esri/core/workers/chunks/56b4dcd04c844eaacd60.js +1 -0
  33. package/assets/esri/core/workers/chunks/5f079be7f322768aef21.js +1 -0
  34. package/assets/esri/core/workers/chunks/61a294f9411bf884f2ab.js +1 -0
  35. package/assets/esri/core/workers/chunks/{ad93a2621f75270f06cb.js → 69fbe363bb130fdd8146.js} +1 -1
  36. package/assets/esri/core/workers/chunks/{722931d1a60be461e521.js → 70cf81ec5a901782d2db.js} +1 -1
  37. package/assets/esri/core/workers/chunks/{24ac204d8a045aa821be.js → 7388e8c905d93dea1c05.js} +1 -1
  38. package/assets/esri/core/workers/chunks/749c7159e0902388e828.js +1 -0
  39. package/assets/esri/core/workers/chunks/76ff7ccfe583927918f3.js +969 -0
  40. package/assets/esri/core/workers/chunks/{ae73ac81bd10614c2b53.js → 7714228825fb44d506df.js} +1 -1
  41. package/assets/esri/core/workers/chunks/{6130bc641aa7c1bcaaa8.js → 7c23be93d394f1bee941.js} +1 -1
  42. package/assets/esri/core/workers/chunks/7c86af4f60cea383ed96.js +1 -0
  43. package/assets/esri/core/workers/chunks/7eda1c400658b6a99be8.js +1 -0
  44. package/assets/esri/core/workers/chunks/{97ae2fdb6cb98249f5fa.js → 7f80bbbd0897082c1af3.js} +1 -1
  45. package/assets/esri/core/workers/chunks/80a69897fa3ce1eaa6e7.js +1 -0
  46. package/assets/esri/core/workers/chunks/80bd5988180f4618fd61.js +1 -0
  47. package/assets/esri/core/workers/chunks/{b47688e3263099540873.js → 81e518dd62bd95611d00.js} +1 -1
  48. package/assets/esri/core/workers/chunks/{10b46438885916d18425.js → 8257352421f453a669e9.js} +1 -1
  49. package/assets/esri/core/workers/chunks/8762928d10c3821738ad.js +1 -0
  50. package/assets/esri/core/workers/chunks/88a5e7415f8858c454f7.js +1 -0
  51. package/assets/esri/core/workers/chunks/893e5eb5c028c4704317.js +1 -0
  52. package/assets/esri/core/workers/chunks/8ead467a5af0d9bba804.js +1 -0
  53. package/assets/esri/core/workers/chunks/91e04d03b0013bcaad82.js +1 -0
  54. package/assets/esri/core/workers/chunks/{c7d4c296011c5393bcaa.js → 9275313e0f1f521b2658.js} +1 -1
  55. package/assets/esri/core/workers/chunks/{e666ca4d14b6490485d6.js → 92b60d4fb09711919601.js} +1 -1
  56. package/assets/esri/core/workers/chunks/977582cb3c8f17a2cb4c.js +1 -0
  57. package/assets/esri/core/workers/chunks/{5c556468e2a598ab793a.js → 9940e59033a8a1eff2a9.js} +1 -1
  58. package/assets/esri/core/workers/chunks/998c38974372720b1c52.js +1 -0
  59. package/assets/esri/core/workers/chunks/{9928e432b884c75c3436.js → 9d920f3488d59e7f276c.js} +1 -1
  60. package/assets/esri/core/workers/chunks/{d0124b0dd62b331afe58.js → 9fef330b241f958b55df.js} +1 -1
  61. package/assets/esri/core/workers/chunks/{a778a72456fefdf40115.js → a249e56a0be8cef33ba8.js} +1 -1
  62. package/assets/esri/core/workers/chunks/a3ee76b7e46d3fba7cf7.js +1 -0
  63. package/assets/esri/core/workers/chunks/a7530dcb08b43e37bbb2.js +1 -0
  64. package/assets/esri/core/workers/chunks/{2cda605c302176905e84.js → a96ac5c68d84122e7751.js} +1 -1
  65. package/assets/esri/core/workers/chunks/{e6bf4f3f6868dc9028e3.js → aab349d4624b78ef429f.js} +1 -1
  66. package/assets/esri/core/workers/chunks/acf13a64df2991a4cb6b.js +1 -0
  67. package/assets/esri/core/workers/chunks/b5640f9623a9c9ded92a.js +1 -0
  68. package/assets/esri/core/workers/chunks/{d42fd0effc560eefb14b.js → b6a201e86f9caef45ff0.js} +1 -1
  69. package/assets/esri/core/workers/chunks/bb67d491f62a5cce96cd.js +1 -0
  70. package/assets/esri/core/workers/chunks/{862fe2f96d4b777ff5b8.js → bbdbb618a18542f7a4a2.js} +1 -1
  71. package/assets/esri/core/workers/chunks/bc9f54a6b577c43189fd.js +1 -0
  72. package/assets/esri/core/workers/chunks/{6fe738748ce837811ff4.js → bd4125d163f372a7e978.js} +1 -1
  73. package/assets/esri/core/workers/chunks/bead38898c3f4d4d3569.js +1 -0
  74. package/assets/esri/core/workers/chunks/c51e2a048df152abd901.js +1 -0
  75. package/assets/esri/core/workers/chunks/{22334a464f798b5279b2.js → c80c032c5b7a11db177a.js} +1 -1
  76. package/assets/esri/core/workers/chunks/{3490d47cac7c8dec70cd.js → c9c109d43a1e5160955d.js} +2 -2
  77. package/assets/esri/core/workers/chunks/{4d5abcf57a6ded4750ba.js → cac060a187f3a27a19ba.js} +1 -1
  78. package/assets/esri/core/workers/chunks/cc748d4f4adb9c584aa4.js +1 -0
  79. package/assets/esri/core/workers/chunks/cf699b9bb530b87be14c.js +1 -0
  80. package/assets/esri/core/workers/chunks/d578c3880eaf2dd62324.js +1 -0
  81. package/assets/esri/core/workers/chunks/{5d331f7628514a572f82.js → d6ab4d55f1023ee6ec6a.js} +1 -1
  82. package/assets/esri/core/workers/chunks/d71836cf70b9604832f1.js +1 -0
  83. package/assets/esri/core/workers/chunks/{4874aabdb5c60ca66216.js → db2b8d8cf7131554cf7e.js} +1 -1
  84. package/assets/esri/core/workers/chunks/de4da985c398c8bcf2e7.js +1 -0
  85. package/assets/esri/core/workers/chunks/{cb57cdff976d2d4b0b41.js → e1b25b1ce3bd4f0f2cda.js} +1 -1
  86. package/assets/esri/core/workers/chunks/ef85cd0e82d59db8a26f.js +33 -0
  87. package/assets/esri/core/workers/chunks/{faf4002f9547a0cc4e33.js → fae6030a81cb91a91b69.js} +1 -1
  88. package/assets/esri/core/workers/chunks/fd1fdb97a294a1b7041d.js +1 -0
  89. package/assets/esri/core/workers/chunks/{ff42b24b48019a03d841.js → fe55833c80cf59df9c2b.js} +1 -1
  90. package/assets/esri/core/workers/chunks/{ff8a4bf1bceb362d67ab.js → ff7962063d132c1ec814.js} +1 -1
  91. package/config.js +1 -1
  92. package/geometry/Multipoint.js +1 -1
  93. package/geometry/support/boundsUtils.js +1 -1
  94. package/geometry/support/contains.js +1 -1
  95. package/geometry/support/curves/circleUtils.js +1 -1
  96. package/geometry/support/curves/circularArcUtils.js +1 -1
  97. package/geometry/support/curves/curveUtils.js +1 -1
  98. package/geometry/support/curves/ellipticArc7Utils.js +1 -1
  99. package/geometry/support/curves/rotate.js +5 -0
  100. package/geometry/support/extentUtils.js +1 -1
  101. package/geometry/support/rotate.js +1 -1
  102. package/graphic/ImageryGraphicOrigin.js +5 -0
  103. package/graphic/ImageryTileGraphicOrigin.js +5 -0
  104. package/graphic/WCSGraphicOrigin.js +5 -0
  105. package/graphic/isImageryGraphicOrigin.js +5 -0
  106. package/graphic/isImageryTileGraphicOrigin.js +5 -0
  107. package/graphic/isWCSGraphicOrigin.js +5 -0
  108. package/interfaces.d.ts +12 -15
  109. package/kernel.js +1 -1
  110. package/layers/CatalogLayer.js +1 -1
  111. package/layers/FeatureLayer.js +1 -1
  112. package/layers/GroundLayer.js +5 -0
  113. package/layers/ImageryLayer.js +1 -1
  114. package/layers/ImageryTileLayer.js +1 -1
  115. package/layers/WCSLayer.js +1 -1
  116. package/layers/catalog/CatalogFootprintLayer.js +1 -1
  117. package/layers/mixins/ArcGISImageService.js +1 -1
  118. package/package.json +1 -1
  119. package/support/revision.js +1 -1
  120. package/views/2d/layers/ImageryLayerView2D.js +1 -1
  121. package/views/2d/layers/ImageryTileLayerView2D.js +1 -1
  122. package/views/2d/layers/features/layerAdapters/CatalogFootprintLayerAdapter.js +1 -1
  123. package/views/2d/layers/imagery/ImageryTileView2D.js +1 -1
  124. package/views/3d/analysis/VolumeMeasurement/{CutFillVolumeMeasurementComputation.js → VolumeMeasurementCutFillComputation.js} +1 -1
  125. package/views/3d/analysis/VolumeMeasurement/{CutFillVolumeMeasurementController.js → VolumeMeasurementCutFillController.js} +1 -1
  126. package/views/3d/analysis/VolumeMeasurement/{CutFillVolumeMeasurementVisualization.js → VolumeMeasurementCutFillVisualization.js} +1 -1
  127. package/views/3d/analysis/VolumeMeasurementAnalysisView3D.js +1 -1
  128. package/views/3d/layers/CatalogFootprintLayerView3D.js +1 -1
  129. package/views/3d/layers/IntegratedMesh3DTilesLayerView3D.js +1 -1
  130. package/views/GroundView.js +1 -1
  131. package/views/draw/support/Box.js +1 -1
  132. package/views/draw/support/Reshape.js +1 -1
  133. package/views/draw/support/drawUtils.js +1 -1
  134. package/views/interactive/editGeometry/operations/RotateVertex.js +1 -1
  135. package/views/interactive/editGeometry/operations/curveOperationUtils.js +1 -1
  136. package/views/layers/ImageryLayerView.js +1 -1
  137. package/views/layers/ImageryTileLayerView.js +1 -1
  138. package/analysis/VolumeMeasurement/CutFillOptions.d.ts +0 -4
  139. package/assets/esri/core/workers/chunks/01e8b9dc77a57d1c2a52.js +0 -1
  140. package/assets/esri/core/workers/chunks/027cfcde29fe87aa2ffe.js +0 -1
  141. package/assets/esri/core/workers/chunks/03ee4d63aa8de44958ab.js +0 -1
  142. package/assets/esri/core/workers/chunks/0a4586e596413ef7a4b5.js +0 -1
  143. package/assets/esri/core/workers/chunks/0a6d33d013628f671aea.js +0 -1
  144. package/assets/esri/core/workers/chunks/1166ed298cf5ca7ad444.js +0 -1
  145. package/assets/esri/core/workers/chunks/13797036850dcc3671c3.js +0 -1
  146. package/assets/esri/core/workers/chunks/1a2278b9fe9666342728.js +0 -1
  147. package/assets/esri/core/workers/chunks/1e01aaebdeffdfc0c6bd.js +0 -1
  148. package/assets/esri/core/workers/chunks/222f981e876f60ae282f.js +0 -1
  149. package/assets/esri/core/workers/chunks/277941bec15525dbd3a0.js +0 -1
  150. package/assets/esri/core/workers/chunks/2cb14d040e67a261b31c.js +0 -1
  151. package/assets/esri/core/workers/chunks/31c088966ccfff2ea1db.js +0 -1
  152. package/assets/esri/core/workers/chunks/3245d20ea4bb779f87ef.js +0 -1
  153. package/assets/esri/core/workers/chunks/46a470bea2a3601182dc.js +0 -1
  154. package/assets/esri/core/workers/chunks/4b58da6cb91f7bf6af8b.js +0 -1
  155. package/assets/esri/core/workers/chunks/5900dde7a201a7d47469.js +0 -1
  156. package/assets/esri/core/workers/chunks/5b2ff220aebe464dac23.js +0 -1
  157. package/assets/esri/core/workers/chunks/5f518931a660b3c4f519.js +0 -1
  158. package/assets/esri/core/workers/chunks/66f3659ba18f92cd623e.js +0 -1
  159. package/assets/esri/core/workers/chunks/67355372ac5fd8a15d18.js +0 -1
  160. package/assets/esri/core/workers/chunks/6801b92bce7a918fda6f.js +0 -1
  161. package/assets/esri/core/workers/chunks/7b560ac0be93c6aa9940.js +0 -1
  162. package/assets/esri/core/workers/chunks/7bdfc7c7ce1d94c00745.js +0 -353
  163. package/assets/esri/core/workers/chunks/83737d86584bf1b32368.js +0 -1
  164. package/assets/esri/core/workers/chunks/854bfda25bb406814929.js +0 -1
  165. package/assets/esri/core/workers/chunks/855f25ce748aaef44b1a.js +0 -1
  166. package/assets/esri/core/workers/chunks/87f68c2b9361bd3f8cac.js +0 -1
  167. package/assets/esri/core/workers/chunks/9307108821d82c131654.js +0 -1
  168. package/assets/esri/core/workers/chunks/97a38d700f2cb8807d51.js +0 -1
  169. package/assets/esri/core/workers/chunks/9e9be7f6ea32957f1088.js +0 -33
  170. package/assets/esri/core/workers/chunks/af4412e79275c5a87539.js +0 -1
  171. package/assets/esri/core/workers/chunks/cbec768cd98caff212f2.js +0 -1
  172. package/assets/esri/core/workers/chunks/d3a7747f23e91d1f1b5e.js +0 -1
  173. package/assets/esri/core/workers/chunks/d3ae88fcde2d7fb3e2e2.js +0 -1
  174. package/assets/esri/core/workers/chunks/d81c4afad4abe2d1d0b9.js +0 -1
  175. package/assets/esri/core/workers/chunks/d87fdc64a5cc6be4bd69.js +0 -1
  176. package/assets/esri/core/workers/chunks/db5d3feeb61ccb5ede98.js +0 -1
  177. package/assets/esri/core/workers/chunks/dfb12f42b8d319ffa5fc.js +0 -1
  178. package/assets/esri/core/workers/chunks/ead1acf95c3385630da8.js +0 -1001
  179. package/assets/esri/core/workers/chunks/f3e3c2340452c1d60c95.js +0 -1
  180. package/assets/esri/core/workers/chunks/f4d7cbd33ef8710d7316.js +0 -1
  181. package/assets/esri/core/workers/chunks/f74b0cdc1c2b56bac5f0.js +0 -1
  182. package/assets/esri/core/workers/chunks/f807e7fc90e0e7ce6b67.js +0 -1
  183. package/assets/esri/core/workers/chunks/ff4e15a872de94d2b438.js +0 -1
  184. /package/assets/esri/core/workers/chunks/{3490d47cac7c8dec70cd.js.LICENSE.txt → c9c109d43a1e5160955d.js.LICENSE.txt} +0 -0
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[1863],{162:(e,t,r)=>{r.r(t),r.d(t,{default:()=>B});var i=r(31635),s=r(7762),n=r(38961),o=r(92071),l=r(74887),a=r(36708),u=r(84952),c=r(10107),h=(r(44208),r(53966),r(87811),r(36005)),p=r(40608),d=r(43937),y=r(5443),f=r(16930),m=r(4146),g=r(63074),b=r(16131),v=r(8303),_=r(54310),w=r(25036),F=r(10873),M=r(65529),S=r(25482),T=r(92474),x=r(799),C=r(56507),I=r(99959);const A=Symbol("isKMLGraphicOrigin");var P;class Z extends I.A{static{P=A}constructor(e,t){super(),this[P]=!0,this.type="kml",this.layer=e,this.sublayer=t}}var O=r(92602),R=r(70333),E=(r(13874),r(78888)),N=r(4718),L=r(70328),G=r(16079);r(65494),r(22671);const j={esriGeometryPoint:"points",esriGeometryPolyline:"polylines",esriGeometryPolygon:"polygons"};function k(e){const t=e.folders||[],r=t.slice(),i=new Map,s=new Map,n=new Map,o=new Map,l=new Map,a={esriGeometryPoint:s,esriGeometryPolyline:n,esriGeometryPolygon:o};(e.featureCollection?.layers||[]).forEach(e=>{const t=(0,N.o8)(e);t.featureSet.features=[];const r=e.featureSet.geometryType;i.set(r,t);const l=e.layerDefinition.objectIdField;"esriGeometryPoint"===r?$(s,l,e.featureSet.features):"esriGeometryPolyline"===r?$(n,l,e.featureSet.features):"esriGeometryPolygon"===r&&$(o,l,e.featureSet.features)}),e.groundOverlays&&e.groundOverlays.forEach(e=>{l.set(e.id,e)}),t.forEach(t=>{t.networkLinkIds.forEach(i=>{const s=function(e,t,r){const i=function(e,t){let r;return t.some(t=>t.id===e&&(r=t,!0)),r}(e,r);return i&&(i.parentFolderId=t,i.networkLink=i),i}(i,t.id,e.networkLinks);s&&r.push(s)})}),r.forEach(e=>{if(e.featureInfos){e.points=(0,N.o8)(i.get("esriGeometryPoint")),e.polylines=(0,N.o8)(i.get("esriGeometryPolyline")),e.polygons=(0,N.o8)(i.get("esriGeometryPolygon")),e.mapImages=[];for(const t of e.featureInfos)switch(t.type){case"esriGeometryPoint":case"esriGeometryPolyline":case"esriGeometryPolygon":{const r=a[t.type].get(t.id);r&&e[j[t.type]]?.featureSet.features.push(r);break}case"GroundOverlay":{const r=l.get(t.id);r&&e.mapImages.push(r);break}}e.fullExtent=J([e])}});const u=J(r);return{folders:t,sublayers:r,extent:u}}function D(e,t,r,i){const s=R.id?.findCredential(e);e=(0,u.a6)(e,{token:s?.token});const n=O.A.kmlServiceUrl;return(0,E.A)(n,{query:{url:e,model:"simple",folders:"",refresh:0!==r||void 0,outSR:JSON.stringify(t)},responseType:"json",signal:i})}function q(e,t,r=null,i=[]){const s=[],n={},o=t.sublayers,l=new Set(t.folders.map(e=>e.id));return o.forEach(t=>{const o=new e;if(r?o.read(t,r):o.read(t),i.length&&l.has(o.id)&&(o.visible=i.includes(o.id)),n[t.id]=o,null!=t.parentFolderId&&-1!==t.parentFolderId){const e=n[t.parentFolderId];e.sublayers||(e.sublayers=[]),e.sublayers?.unshift(o)}else s.unshift(o)}),s}function $(e,t,r){r.forEach(r=>{e.set(r.attributes[t],r)})}function J(e){const t=(0,L.vt)(L.qv),r=(0,L.vt)(L.qv);for(const i of e){if(i.polygons?.featureSet?.features)for(const e of i.polygons.featureSet.features)(0,G.LJ)(t,e.geometry),(0,L.RF)(r,t);if(i.polylines?.featureSet?.features)for(const e of i.polylines.featureSet.features)(0,G.LJ)(t,e.geometry),(0,L.RF)(r,t);if(i.points?.featureSet?.features)for(const e of i.points.featureSet.features)(0,G.LJ)(t,e.geometry),(0,L.RF)(r,t);if(i.mapImages)for(const e of i.mapImages)(0,G.LJ)(t,e.extent),(0,L.RF)(r,t)}return(0,L.aI)(r,L.qv)?void 0:{xmin:r[0],ymin:r[1],zmin:r[2],xmax:r[3],ymax:r[4],zmax:r[5],spatialReference:f.A.WGS84}}var z;let U=z=class extends((0,M.Zt)((0,S.T)(T.x_))){constructor(...e){super(...e),this.description=null,this.fullExtent=null,this.id=null,this.networkLink=null,this.parent=null,this.sublayers=null,this.title=null,this.sourceJSON=null,this.layer=null,this.addHandles([(0,a.on)(()=>this.sublayers,"after-add",({item:e})=>{e.parent=this,e.layer=this.layer},a.OH),(0,a.on)(()=>this.sublayers,"after-remove",({item:e})=>{e.layer=e.parent=null},a.OH),(0,a.wB)(()=>this.sublayers,(e,t)=>{if(t)for(const e of t)e.layer=e.parent=null;if(e)for(const t of e)t.parent=this,t.layer=this.layer},a.OH),(0,a.wB)(()=>this.layer,e=>{if(this.sublayers)for(const t of this.sublayers)t.layer=e},a.OH)])}initialize(){(0,a.C_)(()=>this.networkLink).then(()=>(0,a.C_)(()=>!0===this.visible)).then(()=>this.load())}load(e){if(!this.networkLink)return;if(this.networkLink.viewFormat)return;const t=null!=e?e.signal:null,r=this._fetchService(this._get("networkLink")?.href??"",t).then(e=>{const t=J(e.sublayers);this.fullExtent=y.A.fromJSON(t),this.sourceJSON=e;const r=(0,C.dp)(s.A.ofType(z),q(z,e));this.sublayers?this.sublayers.addMany(r):this.sublayers=r,this.layer?.emit("sublayer-update"),this.layer&&this.layer.notifyChange("visibleSublayers")});return this.addResolvingPromise(r),Promise.resolve(this)}get visible(){return this._get("visible")}set visible(e){this._get("visible")!==e&&(this._set("visible",e),this.layer&&this.layer.notifyChange("visibleSublayers"))}readVisible(e,t){return!!t.visibility}get origin(){return this.layer?new Z(this.layer,this):null}_fetchService(e,t){return D(e,this.layer.outSpatialReference,this.layer.refreshInterval,t).then(e=>k(e.data))}};(0,i.Cg)([(0,c.MZ)()],U.prototype,"description",void 0),(0,i.Cg)([(0,c.MZ)({type:y.A})],U.prototype,"fullExtent",void 0),(0,i.Cg)([(0,c.MZ)()],U.prototype,"id",void 0),(0,i.Cg)([(0,c.MZ)({readOnly:!0,value:null})],U.prototype,"networkLink",void 0),(0,i.Cg)([(0,c.MZ)({json:{write:{allowNull:!0}}})],U.prototype,"parent",void 0),(0,i.Cg)([(0,c.MZ)({type:s.A.ofType(U),json:{write:{allowNull:!0}}})],U.prototype,"sublayers",void 0),(0,i.Cg)([(0,c.MZ)({value:null,json:{read:{source:"name",reader:e=>(0,x._e)(e)}}})],U.prototype,"title",void 0),(0,i.Cg)([(0,c.MZ)({value:!0})],U.prototype,"visible",null),(0,i.Cg)([(0,h.w)("visible",["visibility"])],U.prototype,"readVisible",null),(0,i.Cg)([(0,c.MZ)()],U.prototype,"sourceJSON",void 0),(0,i.Cg)([(0,c.MZ)()],U.prototype,"layer",void 0),(0,i.Cg)([(0,c.MZ)()],U.prototype,"origin",null),U=z=(0,i.Cg)([(0,p.$)("esri.layers.support.KMLSublayer")],U);const V=["kml","xml"];let H=class extends((0,g.dM)((0,_.J)((0,w.j)((0,b.q)((0,v.A)((0,o.P)(m.A))))))){constructor(...e){super(...e),this._visibleFolders=[],this.allSublayers=new n.A({getCollections:()=>[this.sublayers],getChildrenFunction:e=>e.sublayers}),this.outSpatialReference=f.A.WGS84,this.path=null,this.legendEnabled=!1,this.operationalLayerType="KML",this.sublayers=null,this.type="kml",this.url=null}initialize(){this.addHandles([(0,a.wB)(()=>this.sublayers,(e,t)=>{t&&t.forEach(e=>{e.parent=null,e.layer=null}),e&&e.forEach(e=>{e.parent=this,e.layer=this})},a.OH),this.on("sublayer-update",()=>this.notifyChange("fullExtent"))])}normalizeCtorArgs(e,t){return"string"==typeof e?{url:e,...t}:e}get sublayerById(){const e=new Map;for(const t of this.allSublayers)e.set(t.id,t);return e}readSublayersFromItemOrWebMap(e,t){this._visibleFolders=t.visibleFolders}readSublayers(e,t,r){return q(U,t,r,this._visibleFolders)}writeSublayers(e,t){const r=[],i=e.toArray();for(;i.length;){const e=i[0];e.networkLink||(e.visible&&r.push(e.id),e.sublayers&&i.push(...e.sublayers.toArray())),i.shift()}t.visibleFolders=r}get title(){const e=this._get("title");return e&&"defaults"!==this.originOf("title")?e:this.url?(0,u.e7)(this.url,V)||"KML":e}set title(e){this._set("title",e)}get visibleSublayers(){const e=this.sublayers,t=[],r=e=>{e.visible&&(t.push(e),e.sublayers&&e.sublayers.forEach(r))};return e?.forEach(r),t}get fullExtent(){return this._recomputeFullExtent()}load(e){const t=null!=e?e.signal:null;return this.addResolvingPromise(this.loadFromPortal({supportedTypes:["KML"],supportsData:!1},e).catch(l.QP).then(()=>this._fetchService(t))),Promise.resolve(this)}destroy(){super.destroy(),this.allSublayers.destroy()}async _fetchService(e){const t=k((await Promise.resolve().then(()=>this.resourceInfo?{ssl:!1,data:this.resourceInfo}:D(this.url??"",this.outSpatialReference,this.refreshInterval,e))).data);t&&this.read(t,{origin:"service"})}_recomputeFullExtent(){let e=null;null!=this.extent&&(e=this.extent.clone());const t=r=>{if(r.sublayers)for(const i of r.sublayers.items)t(i),i.visible&&i.fullExtent&&(null!=e?e.union(i.fullExtent):e=i.fullExtent.clone())};return t(this),e}};(0,i.Cg)([(0,c.MZ)({readOnly:!0})],H.prototype,"allSublayers",void 0),(0,i.Cg)([(0,c.MZ)({readOnly:!0})],H.prototype,"sublayerById",null),(0,i.Cg)([(0,c.MZ)({type:f.A})],H.prototype,"outSpatialReference",void 0),(0,i.Cg)([(0,c.MZ)({type:String,json:{origins:{"web-scene":{read:!0,write:!0}},read:!1}})],H.prototype,"path",void 0),(0,i.Cg)([(0,c.MZ)({readOnly:!0,json:{read:!1,write:!1}})],H.prototype,"legendEnabled",void 0),(0,i.Cg)([(0,c.MZ)({type:["show","hide","hide-children"]})],H.prototype,"listMode",void 0),(0,i.Cg)([(0,c.MZ)({type:["KML"]})],H.prototype,"operationalLayerType",void 0),(0,i.Cg)([(0,c.MZ)({})],H.prototype,"resourceInfo",void 0),(0,i.Cg)([(0,c.MZ)({type:s.A.ofType(U),json:{write:{ignoreOrigin:!0}}})],H.prototype,"sublayers",void 0),(0,i.Cg)([(0,h.w)(["web-map","portal-item"],"sublayers",["visibleFolders"])],H.prototype,"readSublayersFromItemOrWebMap",null),(0,i.Cg)([(0,h.w)("service","sublayers",["sublayers"])],H.prototype,"readSublayers",null),(0,i.Cg)([(0,d.K)("sublayers")],H.prototype,"writeSublayers",null),(0,i.Cg)([(0,c.MZ)({readOnly:!0,json:{read:!1}})],H.prototype,"type",void 0),(0,i.Cg)([(0,c.MZ)({json:{origins:{"web-map":{read:{source:"title"}}},write:{ignoreOrigin:!0}}})],H.prototype,"title",null),(0,i.Cg)([(0,c.MZ)(F.OZ)],H.prototype,"url",void 0),(0,i.Cg)([(0,c.MZ)({readOnly:!0})],H.prototype,"visibleSublayers",null),(0,i.Cg)([(0,c.MZ)({type:y.A})],H.prototype,"extent",void 0),(0,i.Cg)([(0,c.MZ)()],H.prototype,"fullExtent",null),H=(0,i.Cg)([(0,p.$)("esri.layers.KMLLayer")],H);const B=H},4197:(e,t,r)=>{r.d(t,{Vj:()=>u,cj:()=>a,jh:()=>n,l5:()=>l,xm:()=>o});var i=r(34275),s=r(9093);function n(e){return e<=i.y9?new Array(e).fill(0):new Float64Array(e)}function o(e){return((0,i.iu)(e)?e.byteLength/8:e.length)<=i.y9?Array.from(e):new Float64Array(e)}function l(e,t,r){return Array.isArray(e)?e.slice(t,t+r):e.subarray(t,t+r)}function a(e){return[...e]}function u(e){const t=(0,s.vt)();for(let r=0;r<16;++r)t[r]=e[r];return t}},6797:(e,t,r)=>{r.d(t,{Mj:()=>p,Ui:()=>y,w2:()=>d});var i=r(65008),s=r(7762),n=r(88620);const o=new Set(["esri.Color","esri.portal.Portal","esri.symbols.support.Symbol3DAnchorPosition2D","esri.symbols.support.Symbol3DAnchorPosition3D"]);function l(e){return e instanceof i.A}function a(e){return e instanceof s.A?Object.keys(e.items):l(e)?(0,n.oY)(e).keys():e?Object.keys(e):[]}function u(e,t){return e instanceof s.A?e.items[t]:e[t]}function c(e){return e?e.declaredClass:null}function h(e,t){const r=e.diff;if(r&&"function"==typeof r)return r(e,t);const i=a(e),s=a(t);if(0===i.length&&0===s.length)return;if(!i.length||!s.length||function(e,t){return!(!Array.isArray(e)||!Array.isArray(t))&&e.length!==t.length}(e,t))return{type:"complete",oldValue:e,newValue:t};const n=s.filter(e=>!i.includes(e)),p=i.filter(e=>!s.includes(e)),d=i.filter(r=>s.includes(r)&&u(e,r)!==u(t,r)).concat(n,p).sort(),y=c(e);if(y&&o.has(y)&&d.length)return{type:"complete",oldValue:e,newValue:t};let f;const m=l(e)&&l(t);for(const i of d){const s=u(e,i),n=u(t,i);let o;if((m||"function"!=typeof s&&"function"!=typeof n)&&s!==n&&(null!=s||null!=n)){if(r&&r[i]&&"function"==typeof r[i])o=r[i]?.(s,n);else if(s instanceof Date&&n instanceof Date){if(s.getTime()===n.getTime())continue;o={type:"complete",oldValue:s,newValue:n}}else o="object"==typeof s&&"object"==typeof n&&c(s)===c(n)?h(s,n):{type:"complete",oldValue:s,newValue:n};null!=o&&(null!=f?f.diff[i]=o:f={type:"partial",diff:{[i]:o}})}}return f}function p(e,t){return function(e,t){if(null==e)return!1;const r=t.split(".");let i=e;for(const e of r){if("complete"===i.type)return!0;if("partial"!==i.type)return!1;{const t=i.diff[e];if(!t)return!1;i=t}}return!0}(e,t)}function d(e,t){if(!e)return!1;if("partial"===e.type){const r=Object.keys(e.diff);return 1===r.length&&r[0]===t}return!1}function y(e,t){if("function"!=typeof e&&"function"!=typeof t&&(null!=e||null!=t))return null==e||null==t||"object"==typeof e&&"object"==typeof t&&c(e)!==c(t)?{type:"complete",oldValue:e,newValue:t}:h(e,t)}},8303:(e,t,r)=>{r.d(t,{A:()=>F});var i=r(31635),s=r(92602),n=r(70333),o=r(78888),l=r(60999),a=r(49186),u=r(53966),c=r(97768),h=r(74887),p=r(84952),d=r(10107),y=(r(44208),r(87811),r(36005)),f=r(40608),m=r(43937),g=r(77548),b=r(20655),v=r(80812),_=r(41318),w=r(10407);const F=e=>{const t=e;let F=class extends t{constructor(){super(...arguments),this.resourceReferences={portalItem:null,paths:[]},this.userHasEditingPrivileges=!0,this.userHasFullEditingPrivileges=!1,this.userHasUpdateItemPrivileges=!1}destroy(){this.portalItem=(0,c.pR)(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?.portal})}writePortalItem(e,t){e?.id&&(t.itemId=e.id)}async loadFromPortal(e,t){if(this.portalItem?.id)try{const{load:i}=await r.e(1204).then(r.bind(r,41204));return(0,h.Te)(t),await i({instance:this,supportedTypes:e.supportedTypes,validateItem:e.validateItem,supportsData:e.supportsData,layerModuleTypeMap:e.layerModuleTypeMap,populateGroupLayer:e.populateGroupLayer},t)}catch(e){throw(0,h.zf)(e)||u.A.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.QP)(e),!0)))}async setUserPrivileges(e,t){if(!s.A.userPrivilegesApplied)return this.finishLoadEditablePortalLayer(t);if(this.url)try{const{features:{edit:r,fullEdit:i},content:{updateItem:s}}=await this._fetchUserPrivileges(e,t);this._set("userHasEditingPrivileges",r),this._set("userHasFullEditingPrivileges",i),this._set("userHasUpdateItemPrivileges",s)}catch(e){(0,h.QP)(e)}}async _fetchUserPrivileges(e,t){let r=this.portalItem;if(!e||!r||!r.loaded||r.sourceUrl)return this._fetchFallbackUserPrivileges(t);const i=!n.id?.findCredential(this.url),s=e===r.id;if(s&&r.portal.user)return this._getUserPrivileges(r,i);let o,l;if(s)o=r.portal.url;else try{o=await(0,g.wI)(this.url,t)}catch(e){(0,h.QP)(e)}if(!o||!(0,p.b8)(o,r.portal.url))return this._fetchFallbackUserPrivileges(t);try{const e=null!=t?t.signal:null;l=await(n.id?.getCredential(`${o}/sharing`,{prompt:!1,signal:e}))}catch(e){(0,h.QP)(e)}const a=!0,u=!1,c=!1;if(!l)return{features:{edit:a,fullEdit:u},content:{updateItem:c}};try{if(s?await r.reload():(r=new v.default({id:e,portal:{url:o}}),await r.load(t)),r.portal.user)return this._getUserPrivileges(r,i)}catch(e){(0,h.QP)(e)}return{features:{edit:a,fullEdit:u},content:{updateItem:c}}}_getUserPrivileges(e,t){const r=(0,w.It)(e);return t&&(r.features.edit=!0),r}async _fetchFallbackUserPrivileges(e){let t=!0;try{t=await this._fetchUserHasEditingPrivileges(e)}catch(e){(0,h.QP)(e)}return{features:{edit:t,fullEdit:!1},content:{updateItem:!1}}}async _fetchUserHasEditingPrivileges(e){const t=this.url?n.id?.findCredential(this.url):null;if(!t)return!0;const r=M.credential===t?M.user:await this._fetchEditingUser(e);return M.credential=t,M.user=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=n.id?.findServerInfo(this.url??"");if(!r?.owningSystemUrl)return null;const i=`${r.owningSystemUrl}/sharing/rest`,s=b.A.getDefault();if(s&&s.loaded&&(0,p.S8)(s.restUrl)===(0,p.S8)(i))return s.user;const a=`${i}/community/self`,u=null!=e?e.signal:null,c=await(0,l.Ke)((0,o.A)(a,{authMode:"no-prompt",query:{f:"json"},signal:u}));return c.ok?_.A.fromJSON(c.value.data):null}read(e,t){t&&(t.layer=this),super.read(e,t)}write(e,t){const r=t?.portal,i=this.portalItem?.id&&(this.portalItem.portal||b.A.getDefault());return r&&i&&!(0,p.ut)(i.restUrl,r.restUrl)?(t.messages&&t.messages.push(new a.A("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.Cg)([(0,d.MZ)({type:v.default})],F.prototype,"portalItem",null),(0,i.Cg)([(0,y.w)("web-document","portalItem",["itemId"])],F.prototype,"readPortalItem",null),(0,i.Cg)([(0,m.K)("web-document","portalItem",{itemId:{type:String}})],F.prototype,"writePortalItem",null),(0,i.Cg)([(0,d.MZ)({clonable:!1})],F.prototype,"resourceReferences",void 0),(0,i.Cg)([(0,d.MZ)({type:Boolean,readOnly:!0})],F.prototype,"userHasEditingPrivileges",void 0),(0,i.Cg)([(0,d.MZ)({type:Boolean,readOnly:!0})],F.prototype,"userHasFullEditingPrivileges",void 0),(0,i.Cg)([(0,d.MZ)({type:Boolean,readOnly:!0})],F.prototype,"userHasUpdateItemPrivileges",void 0),F=(0,i.Cg)([(0,f.$)("esri.layers.mixins.PortalLayer")],F),F},M={credential:null,user:null}},9093:(e,t,r)=>{function i(){return[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]}function s(e){return[e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8],e[9],e[10],e[11],e[12],e[13],e[14],e[15]]}r.d(t,{o8:()=>s,vt:()=>i,zK:()=>n});const n=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];Object.freeze(Object.defineProperty({__proto__:null,IDENTITY:n,clone:s,create:i,fromValues:function(e,t,r,i,s,n,o,l,a,u,c,h,p,d,y,f){return[e,t,r,i,s,n,o,l,a,u,c,h,p,d,y,f]}},Symbol.toStringTag,{value:"Module"}))},22671:(e,t,r)=>{r.d(t,{A:()=>b});var i,s=r(31635),n=r(52106),o=r(66552),l=r(25482),a=r(4718),u=r(10107),c=(r(44208),r(53966),r(36005)),h=r(40608),p=r(43937),d=r(16930),y=r(65864),f=r(50498),m=r(20437);const g=new o.J({esriGeometryPoint:"point",esriGeometryMultipoint:"multipoint",esriGeometryPolyline:"polyline",esriGeometryPolygon:"polygon",esriGeometryEnvelope:"extent",mesh:"mesh","":null});let b=i=class extends l.o{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){return this.readFeaturesWithClass(e,t,n.A)}writeGeometryType(e,t,r,i){if(e)return void g.write(e,t,r,i);const{features:s}=this;if(s)for(const e of s)if(null!=e?.geometry)return void g.write(e.geometry.type,t,r,i)}readQueryGeometry(e,t){if(!e)return null;const r=!!e.spatialReference,i=(0,y.rS)(e);return i&&!r&&t.spatialReference&&(i.spatialReference=d.A.fromJSON(t.spatialReference)),i}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 i(this.cloneProperties())}cloneProperties(){return(0,a.o8)({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 i=t.features[r];if(i.geometry){const t=e?.[r];i.geometry=t?.toJSON()||i.geometry}}return t}quantize(e){const{scale:[t,r],translate:[i,s]}=e,n=this.features,o=this._getQuantizationFunction(this.geometryType,e=>Math.round((e-i)/t),e=>Math.round((s-e)/r));for(let e=0,t=n.length;e<t;e++)o?.(n[e].geometry)||(n.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:[i,s],scale:[n,o]}=r;let l=null,a=null;if(this.hasZ&&null!=r?.scale?.[2]){const{translate:[,,e],scale:[,,t]}=r;l=r=>r*t+e}if(this.hasM&&null!=r?.scale?.[3]){const{translate:[,,,e],scale:[,,,t]}=r;a=r=>null==r?r:r*t+e}const u=this._getHydrationFunction(e,e=>e*n+i,e=>s-e*o,l,a);for(const{geometry:e}of t)null!=e&&u&&u(e);return this.transform=null,this}readFeaturesWithClass(e,t,r){const i=d.A.fromJSON(t.spatialReference),s=[];for(let t=0;t<e.length;t++){const n=e[t],o=r.fromJSON(n),l=n.geometry?.spatialReference;null==o.geometry||l||(o.geometry.spatialReference=i);const a=n.aggregateGeometries,u=o.aggregateGeometries;if(a&&null!=u)for(const e in u){const t=u[e],r=a[e],s=r?.spatialReference;null==t||s||(t.spatialReference=i)}s.push(o)}return s}_quantizePoints(e,t,r){let i,s;const n=[];for(let o=0,l=e.length;o<l;o++){const l=e[o];if(o>0){const e=t(l[0]),o=r(l[1]);e===i&&o===s||(n.push([e-i,o-s]),i=e,s=o)}else i=t(l[0]),s=r(l[1]),n.push([i,s])}return n.length>0?n: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 i=(0,y.Bi)(e)?e.rings:e.paths,s=[];for(let e=0,n=i.length;e<n;e++){const n=i[e],o=this._quantizePoints(n,t,r);o&&s.push(o)}return s.length>0?((0,y.Bi)(e)?e.rings=s:e.paths=s,e):null}:"multipoint"===e?e=>{const i=this._quantizePoints(e.points,t,r);return i&&i.length>0?(e.points=i,e):null}:"extent"===e?e=>e:null}_getHydrationFunction(e,t,r,i,s){return"point"===e?e=>{e.x=t(e.x),e.y=r(e.y),i&&(e.z=i(e.z))}:"polyline"===e||"polygon"===e?e=>{const n=(0,y.Bi)(e)?e.rings:e.paths;let o,l;for(let e=0,i=n.length;e<i;e++){const i=n[e];for(let e=0,s=i.length;e<s;e++){const s=i[e];e>0?(o+=s[0],l+=s[1]):(o=s[0],l=s[1]),s[0]=t(o),s[1]=r(l)}}if(i&&s)for(let e=0,t=n.length;e<t;e++){const t=n[e];for(let e=0,r=t.length;e<r;e++){const r=t[e];r[2]=i(r[2]),r[3]=s(r[3])}}else if(i)for(let e=0,t=n.length;e<t;e++){const t=n[e];for(let e=0,r=t.length;e<r;e++){const r=t[e];r[2]=i(r[2])}}else if(s)for(let e=0,t=n.length;e<t;e++){const t=n[e];for(let e=0,r=t.length;e<r;e++){const r=t[e];r[2]=s(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),i&&null!=e.zmax&&null!=e.zmin&&(e.zmax=i(e.zmax),e.zmin=i(e.zmin)),s&&null!=e.mmax&&null!=e.mmin&&(e.mmax=s(e.mmax),e.mmin=s(e.mmin))}:"multipoint"===e?e=>{const n=e.points;let o,l;for(let e=0,i=n.length;e<i;e++){const i=n[e];e>0?(o+=i[0],l+=i[1]):(o=i[0],l=i[1]),i[0]=t(o),i[1]=r(l)}if(i&&s)for(let e=0,t=n.length;e<t;e++){const t=n[e];t[2]=i(t[2]),t[3]=s(t[3])}else if(i)for(let e=0,t=n.length;e<t;e++){const t=n[e];t[2]=i(t[2])}else if(s)for(let e=0,t=n.length;e<t;e++){const t=n[e];t[2]=s(t[2])}}:null}};(0,s.Cg)([(0,u.MZ)({type:String,json:{write:!0}})],b.prototype,"displayFieldName",void 0),(0,s.Cg)([(0,u.MZ)({type:Boolean,json:{write:{overridePolicy:e=>({enabled:e})}}})],b.prototype,"exceededTransferLimit",void 0),(0,s.Cg)([(0,u.MZ)({type:[n.A],json:{write:!0}})],b.prototype,"features",void 0),(0,s.Cg)([(0,c.w)("features")],b.prototype,"readFeatures",null),(0,s.Cg)([(0,u.MZ)({type:[m.A],json:{write:!0}})],b.prototype,"fields",void 0),(0,s.Cg)([(0,u.MZ)({type:["point","multipoint","polyline","polygon","extent","mesh"],json:{read:{reader:g.read}}})],b.prototype,"geometryType",void 0),(0,s.Cg)([(0,p.K)("geometryType")],b.prototype,"writeGeometryType",null),(0,s.Cg)([(0,u.MZ)({type:Boolean,json:{write:{overridePolicy:e=>({enabled:e})}}})],b.prototype,"hasM",void 0),(0,s.Cg)([(0,u.MZ)({type:Boolean,json:{write:{overridePolicy:e=>({enabled:e})}}})],b.prototype,"hasZ",void 0),(0,s.Cg)([(0,u.MZ)({types:f.yR,json:{write:!0}})],b.prototype,"queryGeometry",void 0),(0,s.Cg)([(0,c.w)("queryGeometry")],b.prototype,"readQueryGeometry",null),(0,s.Cg)([(0,u.MZ)({type:d.A,json:{write:!0}})],b.prototype,"spatialReference",void 0),(0,s.Cg)([(0,p.K)("spatialReference")],b.prototype,"writeSpatialReference",null),(0,s.Cg)([(0,u.MZ)({json:{write:!0}})],b.prototype,"transform",void 0),b=i=(0,s.Cg)([(0,h.$)("esri.rest.support.FeatureSet")],b),b.prototype.toJSON.isDefaultToJSON=!0},38961:(e,t,r)=>{r.d(t,{A:()=>u});var i=r(31635),s=r(7762),n=r(36708),o=r(10107),l=r(40608),a=r(80559);let u=class extends s.A{constructor(e){super(e),this.getCollections=null}initialize(){this.addHandles((0,a.fm)(()=>this._refresh(),n.OH))}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)}_createNewInstance(e){return new s.A(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.Cg)([(0,o.MZ)()],u.prototype,"getCollections",void 0),(0,i.Cg)([(0,o.MZ)()],u.prototype,"getChildrenFunction",void 0),(0,i.Cg)([(0,o.MZ)()],u.prototype,"itemFilterFunction",void 0),u=(0,i.Cg)([(0,l.$)("esri.core.CollectionFlattener")],u)},46140:(e,t,r)=>{r.d(t,{R:()=>s});var i=r(49186);let s=class e{constructor(e,t,r=""){this.major=e,this.minor=t,this._context=r}lessThan(e,t){return this.major<e||e===this.major&&this.minor<t}greaterEqual(e,t){return!this.lessThan(e,t)}validate(e){if(this.major!==e.major){const t=this._context&&this._context+":",r=this._context&&this._context+" ";throw new i.A(t+"unsupported-version",`Required major ${r}version is '${this.major}', but got '\${version.major}.\${version.minor}'`,{version:e})}}clone(){return new e(this.major,this.minor,this._context)}static parse(t,r=""){const[s,n]=t.split("."),o=/^\s*\d+\s*$/;if(!s?.match||!o.test(s))throw new i.A((r&&r+":")+"invalid-version","Expected major version to be a number, but got '${version}'",{version:t});if(!n?.match||!o.test(n))throw new i.A((r&&r+":")+"invalid-version","Expected minor version to be a number, but got '${version}'",{version:t});const l=parseInt(s,10),a=parseInt(n,10);return new e(l,a,r)}}},50498:(e,t,r)=>{r.d(t,{Ye:()=>h,gy:()=>c,yR:()=>p});var i=r(66552),s=r(5443),n=r(91075),o=r(48526),l=r(86738),a=r(39829),u=r(82799);const c=(0,i.O)()({esriGeometryPoint:"point",esriGeometryMultipoint:"multipoint",esriGeometryPolyline:"polyline",esriGeometryPolygon:"polygon"}),h=(0,i.O)()({esriGeometryPoint:"point",esriGeometryMultipoint:"multipoint",esriGeometryPolyline:"polyline",esriGeometryPolygon:"polygon",esriGeometryEnvelope:"extent",mesh:"mesh"}),p={base:n.A,key:"type",typeMap:{extent:s.A,multipoint:o.A,point:l.A,polyline:u.A,polygon:a.A}}},52106:(e,t,r)=>{r.d(t,{A:()=>_});var i,s=r(31635),n=r(13874),o=r(69540),l=r(51447),a=r(25482),u=r(53966),c=r(36708),h=r(24326),p=r(10107),d=(r(44208),r(87811),r(40608)),y=r(12195),f=r(65864),m=r(50498),g=r(54339),b=r(33910);function v(e){if(null==e)return null;const t={};for(const r in e){const i=e[r];i&&(t[r]=i.toJSON())}return 0!==Object.keys(t).length?t:null}let _=class extends((0,o.O)(a.o)){static{i=this}constructor(e){super(e),this.isAggregate=!1,this.layer=null,this.origin=null,this.sourceLayer=null,this._version=0,Object.defineProperty(this,"uid",{value:(0,h.c)(),configurable:!0}),Object.defineProperty(this,"_lastMeshTransform",{value:{},configurable:!0,writable:!0,enumerable:!1}),arguments.length>1&&(0,l.eF)(u.A.getLogger(this),"Graphic",{version:"4.30"})}initialize(){this._watchMeshGeometryChanges()}set aggregateGeometries(e){const t=this._get("aggregateGeometries");JSON.stringify(t)!==JSON.stringify(e)&&this._set("aggregateGeometries",e)}set attributes(e){const t=this._get("attributes");t!==e&&(this._set("attributes",e),this._notifyLayer("attributes",t,e))}set geometry(e){const t=this._get("geometry");t!==e&&(this._set("geometry",e),"mesh"!==e?.type&&this._notifyLayer("geometry",t,e))}set popupTemplate(e){const t=this._get("popupTemplate");t!==e&&(this._set("popupTemplate",e),this._notifyLayer("popupTemplate",t,e))}set symbol(e){const t=this._get("symbol");t!==e&&(this._set("symbol",e),this._notifyLayer("symbol",t,e))}get version(){return this._version}set visible(e){const t=this._get("visible");t!==e&&(this._set("visible",e),this._notifyLayer("visible",t,e))}cloneShallow(){return new i({aggregateGeometries:this.aggregateGeometries,attributes:this.attributes,geometry:this.geometry,isAggregate:this.isAggregate,layer:this.layer,popupTemplate:this.popupTemplate,sourceLayer:this.sourceLayer,symbol:this.symbol,visible:this.visible,origin:this.origin})}getEffectivePopupTemplate(e=!1){if(this.popupTemplate)return this.popupTemplate;const t=this.origin&&"layer"in this.origin?this.origin.layer:null;for(const r of[t,this.sourceLayer,this.layer])if(r&&"object"==typeof r){if("popupTemplate"in r&&r.popupTemplate)return r.popupTemplate;if(e&&"defaultPopupTemplate"in r&&null!=r.defaultPopupTemplate)return r.defaultPopupTemplate}return null}getAttribute(e){return this.attributes?.[e]}setAttribute(e,t){if(this.attributes){const r=this.getAttribute(e);this.attributes[e]=t,this._notifyLayer("attributes",r,t,e)}else this.attributes={[e]:t}}getObjectId(){const e=this.sourceLayer??this.layer;return e?(0,g.r)(this,e):null}getGlobalId(){const e=this.sourceLayer??this.layer;return e&&"globalIdField"in e&&e.globalIdField?this.getAttribute(e.globalIdField):null}toJSON(){return{aggregateGeometries:v(this.aggregateGeometries),geometry:null!=this.geometry?this.geometry.toJSON():null,symbol:null!=this.symbol?this.symbol.toJSON():null,attributes:(0,y.W)(this.attributes)?this.attributes.toJSON():{...this.attributes},popupTemplate:this.popupTemplate?.toJSON()??null}}notifyMeshTransformChanged(e={}){const{geometry:t}=this;if("mesh"===t?.type){const r={origin:t.origin,transform:t.transform};this._notifyLayer("origin-transform",r,r,e.action)}}_notifyLayer(e,t,r,i){if(this._version++,!this.layer||!("graphicChanged"in this.layer))return;const s={graphic:this,property:e,oldValue:t,newValue:r};"origin-transform"===e&&(s.action=i),"attributes"===e&&(s.attributeName=i),this.layer.graphicChanged(s)}_watchMeshGeometryChanges(){this.addHandles([(0,c.z7)(()=>"mesh"===this.geometry?.type&&this.geometry.vertexSpace.origin?{localMatrix:this.geometry.transform?.localMatrix,origin:this.geometry.vertexSpace.origin}:void 0,({localMatrix:e,origin:t})=>{this._lastMeshTransform.localMatrix===e&&this._lastMeshTransform.origin===t||(this._lastMeshTransform.localMatrix=e,this._lastMeshTransform.origin=t,this.notifyMeshTransformChanged())}),(0,c.z7)(()=>"mesh"===this.geometry?.type?{vertexAttributes:this.geometry.vertexAttributes}:void 0,()=>{const e=this.geometry;"mesh"===e?.type&&e.vertexSpace.origin?(this._lastMeshTransform.localMatrix=e.transform?.localMatrix,this._lastMeshTransform.origin=e.vertexSpace.origin):(this._lastMeshTransform.localMatrix=void 0,this._lastMeshTransform.origin=void 0),this._notifyLayer("geometry",this.geometry,this.geometry)},{equals:(e,t)=>e===t,sync:!0})])}};(0,s.Cg)([(0,p.MZ)({value:null,json:{read:function(e){if(!e)return null;const t={};for(const r in e){const i=(0,f.rS)(e[r]);i&&(t[r]=i)}return 0!==Object.keys(t).length?t:null}}})],_.prototype,"aggregateGeometries",null),(0,s.Cg)([(0,p.MZ)({value:null})],_.prototype,"attributes",null),(0,s.Cg)([(0,p.MZ)({value:null,types:m.yR,json:{read:f.rS}})],_.prototype,"geometry",null),(0,s.Cg)([(0,p.MZ)({type:Boolean})],_.prototype,"isAggregate",void 0),(0,s.Cg)([(0,p.MZ)({clonable:!1})],_.prototype,"layer",void 0),(0,s.Cg)([(0,p.MZ)({clonable:"reference"})],_.prototype,"origin",void 0),(0,s.Cg)([(0,p.MZ)({type:n.A,value:null})],_.prototype,"popupTemplate",null),(0,s.Cg)([(0,p.MZ)({clonable:"reference"})],_.prototype,"sourceLayer",void 0),(0,s.Cg)([(0,p.MZ)({value:null,types:b.Es})],_.prototype,"symbol",null),(0,s.Cg)([(0,p.MZ)({clonable:!1,json:{read:!1,write:!1}})],_.prototype,"_version",void 0),(0,s.Cg)([(0,p.MZ)({type:Boolean,value:!0})],_.prototype,"visible",null),_=i=(0,s.Cg)([(0,d.$)("esri.Graphic")],_)},54339:(e,t,r)=>{function i(e,t){switch(t.type){case"object-id":case"unique-id-simple":return e.attributes[t.fieldName];case"unique-id-composite":{const r=[];for(const i of t.fieldNames)r.push(e.attributes[i]??null);return JSON.stringify(r)}}}function s(e,t){if("uniqueIdFields"in t&&t.uniqueIdFields?.length){if(1===t.uniqueIdFields.length)return e.attributes?.[t.uniqueIdFields[0]];const r=t.uniqueIdFields.map(t=>e.attributes?.[t]);return JSON.stringify(r)}return"objectIdField"in t&&t.objectIdField?e.attributes?.[t.objectIdField]:null}r.d(t,{W:()=>i,r:()=>s})},55674:(e,t,r)=>{r.d(t,{Ad:()=>d,Gj:()=>m,QY:()=>p,lL:()=>g,xR:()=>y});var i=r(66131),s=r(49186),n=(r(44208),r(44729)),o=r(15032),l=r(65864),a=r(95466),u=r(43668),c=r(98623);const h=["geometry","scale","timeProperties"];function p(e,t){if(null!=t)for(const r of h)t.hasArcadeDependency(r)&&e.add(r);return e}function d(e,t){return f.create(e,t,null,["$feature","$view"])}function y(e,t,r){return f.create(e,t,r,["$feature","$view","$config"])}class f{static async create(e,t,r,i){const{arcade:n,Dictionary:o}=await(0,u.l)();let l;try{l=n.parseScript(e)}catch(t){throw new s.A("arcade-bad-expression","Failed to parse arcade script",{script:e,error:t})}const a=n.scriptUsesGeometryEngine(l);a&&await n.enableGeometrySupport(),await n.loadDependentModules(new Set,l,null,!1,a);const c={vars:i.reduce((e,t)=>({...e,[t]:null}),{}),spatialReference:t,useAsync:!1},h=n.compileScript(l,c);let p=null;null!=r&&(p=new o(r),p.immutable=!0);const d=new o;return d.immutable=!1,d.setField("scale",0),new f(e,n,l,h,t,d,p,o)}constructor(e,t,r,i,s,n,o,l){this.script=e,this._arcade=t,this._syntaxTree=r,this._compiled=i,this._spatialReference=s,this._viewDict=n,this._configDict=o,this._dictionaryCtor=l,this._dependencies=new Map,this._featureReader=new m,this._dependencies.set("geometry",t.scriptTouchesGeometry(this._syntaxTree)),this._dependencies.set("scale",this._arcade.referencesMember(this._syntaxTree,"scale")),this._dependencies.set("timeProperties",this._arcade.scriptUsesViewProperties(this._syntaxTree,["timeProperties"]))}evaluate(e,t){const r=t.$view?.timeZone;if(t.$view){let e;if(this._viewDict.setField("scale",t.$view.scale),null!=t.$view.timeProperties){const{currentStart:s,currentEnd:n}=t.$view.timeProperties;e=new this._dictionaryCtor({currentStart:null!=s?null!=r?i.lY.epochToArcadeDate(s,r):i.lY.unknownEpochToArcadeDate(s):void 0,currentEnd:null!=n?null!=r?i.lY.epochToArcadeDate(n,r):i.lY.unknownEpochToArcadeDate(n):void 0,startIncluded:!0,endIncluded:!0})}this._viewDict.setField("timeProperties",e)}return this._compiled({vars:{$view:this._viewDict,$config:this._configDict,$feature:e},spatialReference:this._spatialReference,timeZone:r})}repurposeFeature(e,t){return this._featureReader.bind(e,t,this._spatialReference),this._featureReader}references(e){return this._dependencies.get(e)??!1}}class m{constructor(){this._boundTarget=null,this._boundSchema={fields:null,fieldsIndex:null,spatialReference:null,get geometryType(){return null},get objectIdField(){return null}},this.arcadeDeclaredClass="esri.arcade.Feature",this._contextTimeZone=null}bind(e,t,r){const i=t??new a.A(g(e.attributes));this._boundTarget=e,this._boundSchema.fields=i.fields,this._boundSchema.fieldsIndex=i,this._boundSchema.spatialReference=r}_getField(e){return this._boundSchema.fieldsIndex.get(e)}get contextTimeZone(){return this._contextTimeZone}set contextTimeZone(e){this._contextTimeZone=e}readArcadeFeature(){return this}hasField(e){return this._boundSchema.fieldsIndex.has(e)}geometry(){if("fromJSON"in this._boundTarget)return this._boundTarget.geometry;const e=(0,l.rS)(this._boundTarget.geometry);if(e){if(!this._boundSchema.spatialReference)throw new Error("InternalError: Expected spatial reference to be defined");e.spatialReference=this._boundSchema.spatialReference}return e}isUnknownDateTimeField(e){return this._boundSchema.fieldsIndex.getTimeZone(e)===c.L5}field(e,t=!0){const r=this._getField(e);if(r){const t=this._boundTarget.attributes[r.name];if(null==t)return null;switch(r.type){case"date-only":case"esriFieldTypeDateOnly":return n.n.fromReader(t);case"time-only":case"esriFieldTypeTimeOnly":return o.k.fromReader(t);case"esriFieldTypeTimestampOffset":case"timestamp-offset":return i.lY.fromReaderAsTimeStampOffset(t);case"date":case"esriFieldTypeDate":return this.isUnknownDateTimeField(e)?i.lY.unknownEpochToArcadeDate(t):i.lY.epochToArcadeDate(t,this.contextTimeZone??c.qU);default:return t}}if(t)throw new Error(`Field ${e} does not exist`);return null}setField(e,t){throw new Error("Unable to update feature attribute values, feature is readonly")}keys(){return this._boundSchema.fieldsIndex.fields.map(e=>e.name)}castToText(e=!1){return JSON.stringify(this._boundTarget)}gdbVersion(){return null}fullSchema(){return this._boundSchema}castAsJson(e=null){return{attributes:this._boundTarget.attributes,geometry:!0===e?.keepGeometryType?this.geometry():this.geometry()?.toJSON()??null}}castAsJsonAsync(e=null,t=null){return Promise.resolve(this.castAsJson(t))}}function g(e){const t=[];for(const r in e)t.push({name:r,alias:r,type:"string"==typeof e[r]?"esriFieldTypeString":"esriFieldTypeDouble"});return t}},65494:(e,t,r)=>{r.d(t,{L:()=>a,r:()=>o});var i=r(67076),s=r(90360),n=r(41214);function o(e,t){return a(e,null,t)}const l=(0,s.C)({types:n.Hg});function a(e,t,r){return e?e&&(e.styleName||e.styleUrl)&&"uniqueValue"!==e.type?(r?.messages&&r.messages.push(new i.A("renderer:unsupported","Only UniqueValueRenderer can be referenced from a web style, but found '"+e.type+"'",{definition:e,context:r})),null):l(e,t,r):null}},70328:(e,t,r)=>{r.d(t,{BI:()=>v,DC:()=>h,Ej:()=>d,Ie:()=>g,Jt:()=>b,Ne:()=>y,RF:()=>c,aI:()=>w,fA:()=>o,gE:()=>a,hZ:()=>m,iT:()=>p,is:()=>_,qv:()=>F,vI:()=>f,vY:()=>l,v_:()=>M,vt:()=>n,w1:()=>u});var i=r(5443),s=(r(19419),r(4197));function n(e=M){return[e[0],e[1],e[2],e[3],e[4],e[5]]}function o(e,t,r,i,s,o,l=n()){return l[0]=e,l[1]=t,l[2]=r,l[3]=i,l[4]=s,l[5]=o,l}function l(e,t=n()){return function(e,t,r,i=n()){return m(i,F),function(e,t,r=0,i=t.length/3){let s=e[0],n=e[1],o=e[2],l=e[3],a=e[4],u=e[5];for(let e=0;e<i;e++)s=Math.min(s,t[r+3*e]),n=Math.min(n,t[r+3*e+1]),o=Math.min(o,t[r+3*e+2]),l=Math.max(l,t[r+3*e]),a=Math.max(a,t[r+3*e+1]),u=Math.max(u,t[r+3*e+2]);e[0]=s,e[1]=n,e[2]=o,e[3]=l,e[4]=a,e[5]=u}(i,e,t,r),i}(e,0,e.length/3,t)}function a(e,t=(0,s.jh)(24)){const[r,i,n,o,l,a]=e;return t[0]=r,t[1]=i,t[2]=n,t[3]=r,t[4]=i,t[5]=a,t[6]=r,t[7]=l,t[8]=n,t[9]=r,t[10]=l,t[11]=a,t[12]=o,t[13]=i,t[14]=n,t[15]=o,t[16]=i,t[17]=a,t[18]=o,t[19]=l,t[20]=n,t[21]=o,t[22]=l,t[23]=a,t}function u(e,t){const r=isFinite(e[2])||isFinite(e[5]);return new i.A(r?{xmin:e[0],xmax:e[3],ymin:e[1],ymax:e[4],zmin:e[2],zmax:e[5],spatialReference:t}:{xmin:e[0],xmax:e[3],ymin:e[1],ymax:e[4],spatialReference:t})}function c(e,t){e[0]=Math.min(e[0],t[0]),e[1]=Math.min(e[1],t[1]),e[2]=Math.min(e[2],t[2]),e[3]=Math.max(e[3],t[3]),e[4]=Math.max(e[4],t[4]),e[5]=Math.max(e[5],t[5])}function h(e,t){e[0]=Math.min(e[0],t[0]),e[1]=Math.min(e[1],t[1]),e[3]=Math.max(e[3],t[2]),e[4]=Math.max(e[4],t[3])}function p(e,t){e[0]=Math.min(e[0],t[0]),e[1]=Math.min(e[1],t[1]),e[2]=Math.min(e[2],t[2]),e[3]=Math.max(e[3],t[0]),e[4]=Math.max(e[4],t[1]),e[5]=Math.max(e[5],t[2])}function d(e,t=[0,0,0]){return t[0]=function(e){return e[0]>=e[3]?0:e[3]-e[0]}(e),t[1]=function(e){return e[1]>=e[4]?0:e[4]-e[1]}(e),t[2]=function(e){return e[2]>=e[5]?0:e[5]-e[2]}(e),t}function y(e,t,r=e){return r[0]=t[0],r[1]=t[1],r[2]=t[2],r!==e&&(r[3]=e[3],r[4]=e[4],r[5]=e[5]),r}function f(e,t,r=e){return r[3]=t[0],r[4]=t[1],r[5]=t[2],r!==e&&(r[0]=e[0],r[1]=e[1],r[2]=e[2]),e}function m(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e}function g(e){return e?m(e,F):n(F)}function b(e,t){return e[0]=t[0],e[1]=t[1],e[2]=Number.NEGATIVE_INFINITY,e[3]=t[2],e[4]=t[3],e[5]=Number.POSITIVE_INFINITY,e}function v(e,t,r,i,s){return e[0]=t,e[1]=r,e[2]=Number.NEGATIVE_INFINITY,e[3]=i,e[4]=s,e[5]=Number.POSITIVE_INFINITY,e}function _(e){return 6===e.length}function w(e,t,r){if(null==e||null==t)return e===t;if(!_(e)||!_(t))return!1;if(r){for(let i=0;i<e.length;i++)if(!r(e[i],t[i]))return!1}else for(let r=0;r<e.length;r++)if(e[r]!==t[r])return!1;return!0}const F=[1/0,1/0,1/0,-1/0,-1/0,-1/0],M=[0,0,0,0,0,0];n()},73681:(e,t,r)=>{r.d(t,{n:()=>a});var i=r(49186),s=r(53966),n=r(46140),o=r(95466),l=r(55674);class a{static async from(e,t,r){const o=e.dictionary_version?n.R.parse(e.dictionary_version):null,c=new Set(e.itemsNames),h={};if(t)for(const e in t)h[e]=t[e];if(e.authoringInfo.configuration)for(const t of e.authoringInfo.configuration)h.hasOwnProperty(t.name)||(h[t.name]=t.value);const p=new Set(e.authoringInfo.symbol);for(const e of Object.keys(r))p.delete(e);p.size&&s.A.getLogger("esri.renderers.support.DictionaryScriptEvaluator").warnOnce("missing-fields: fieldMap entries for the following symbol fields are missing",{symbolFields:p});const d=await(0,l.xR)(e.expression,null,h);if(!d)throw new i.A("dictionary-renderer:expression-error","Unable to create dictionary renderer expression");const y=!o||!o.greaterEqual(4,0);y&&s.A.getLogger("esri.renderers.support.DictionaryScriptEvaluator").warnOnce("Dictionary script does not support native field types. Applying fallback",{version:o});const f=new u(r,y);return new a(y,c,d,f)}constructor(e,t,r,i){this._requiresFieldCoercionToString=e,this._itemNames=t,this._compiled=r,this._reader=i}get itemNames(){return this._itemNames}evaluate(e,t,r,i){try{return this._reader.bind(e,r,i),this._compiled.evaluate(this._reader,{$view:{scale:t}})}catch(e){s.A.getLogger("esri.renderers.support.DictionaryScriptEvaluator").warnOnce("arcade: dictionary script evaluation failed",{error:e})}return null}createDictionaryFieldsIndex(e){if(!this._requiresFieldCoercionToString)return new o.A(e);const t=e.map(e=>({...e,type:"esriFieldTypeString"}));return new o.A(t)}}class u extends l.Gj{constructor(e,t){super(),this._fieldMap=e,this._requiresFieldCoercionToString=t}_getField(e){const t=this._fieldMap[e]??e;return this._boundSchema.fieldsIndex.get(t)}field(e){if(!this._requiresFieldCoercionToString)return super.field(e,!1);const t=this._getField(e);return null==t||null==this._boundTarget.attributes[t.name]?"":""+this._boundTarget.attributes[t.name]}}},95466:(e,t,r)=>{r.d(t,{A:()=>d});var i=r(49186),s=r(53966),n=r(91869),o=r(3330),l=r(12195),a=r(30524),u=r(98623),c=r(56400),h=r(96285);const p=new Map;class d{static fromJSON(e){return new d(e.fields,e.timeZoneByFieldName)}static fromLayer(e){return new d(e.fields??[],g(e))}static fromLayerJSON(e){return new d(e.fields??[],g(e))}constructor(e=[],t){this._fieldsMap=new Map,this._normalizedFieldsMap=new Map,this._dateFieldsSet=new Set,this._numericFieldsSet=new Set,this._requiredFields=null,this.dateFields=[],this.numericFields=[],this.fields=e||[],this._timeZoneByFieldName=t?new Map(t):null;const r=[];for(const e of this.fields){const t=e?.name,i=f(t);if(t&&i){const s=y(t);this._fieldsMap.set(t,e),this._fieldsMap.set(s,e),this._normalizedFieldsMap.set(i,e),r.push(`${s}:${e.type}:${this._timeZoneByFieldName?.get(t)}`),(0,a.vE)(e)?(this.dateFields.push(e),this._dateFieldsSet.add(e)):(0,a.WA)(e)&&(this._numericFieldsSet.add(e),this.numericFields.push(e)),(0,a.te)(e)||(0,a.Xz)(e)||(e.editable=null==e.editable||!!e.editable,e.nullable=null==e.nullable||!!e.nullable)}}r.sort(),this.uid=r.join()}get requiredFields(){if(!this._requiredFields){this._requiredFields=[];for(const e of this.fields)(0,a.te)(e)||(0,a.Xz)(e)||e.nullable||void 0!==(0,a.lD)(e)||this._requiredFields.push(e)}return this._requiredFields}equals(e){return this.uid===e?.uid}has(e){return null!=this.get(e)}get(e){if(!e)return;let t=this._fieldsMap.get(e);return t||(t=this._fieldsMap.get(y(e))??this._normalizedFieldsMap.get(f(e)),t&&this._fieldsMap.set(e,t),t)}getTimeZone(e){const t=this.get(e&&"string"!=typeof e?e.name:e);return t?this._timeZoneByFieldName?this._timeZoneByFieldName.get(t.name):"date"===t.type||"esriFieldTypeDate"===t.type?(s.A.getLogger("esri.layers.support.FieldsIndex").errorOnce(new i.A("getTimeZone:no-timezone-information",`no time zone information for field '${t.name}'`)),u.n$):m.has(t.type)?u.L5:null:null}getLuxonTimeZone(e){const t=this.getTimeZone(e);return t?t===u.L5?o.GB.instance:t===u.n$?h.mQ.utcInstance:(0,n.tE)(p,t,()=>h.oh.create(t)):null}isDateField(e){return this._dateFieldsSet.has(this.get(e))}isTimeOnlyField(e){return(0,a.OH)(this.get(e))}isNumericField(e){return this._numericFieldsSet.has(this.get(e))}normalizeFieldName(e){return this.get(e)?.name??void 0}toJSON(){return{fields:this.fields.map(e=>(0,l.W)(e)?e.toJSON():e),timeZoneByFieldName:this._timeZoneByFieldName?Array.from(this._timeZoneByFieldName.entries()):null}}}function y(e){return e.trim().toLowerCase()}function f(e){return(0,a.rS)(e)?.toLowerCase()??""}const m=new Set(["time-only","date-only","timestamp-offset","esriFieldTypeDateOnly","esriFieldTypeTimeOnly","esriFieldTypeTimestampOffset"]);function g(e){const t=new Map;if(!e.fields)return t;const r=!0===e.datesInUnknownTimezone,{timeInfo:i,editFieldsInfo:s}=e,n=(i?"startField"in i?i.startField:i.startTimeField:"")??"",o=(i?"endField"in i?i.endField:i.endTimeField:"")??"",l=function(e){return"dateFieldsTimeZone"in e}(e)?e.dateFieldsTimeZone??null:e.dateFieldsTimeReference?(0,c.ZS)(e.dateFieldsTimeReference):null,a=s?function(e){return"timeZone"in e}(s)?s.timeZone??l:s.dateFieldsTimeReference?(0,c.ZS)(s.dateFieldsTimeReference):l??u.n$:null,h=i?function(e){return"timeZone"in e}(i)?i.timeZone??l:i.timeReference?(0,c.ZS)(i.timeReference):l:null,p=new Map([[y(s?.creationDateField??""),a],[y(s?.editDateField??""),a],[y(n),h],[y(o),h]]);for(const{name:i,type:s}of e.fields)if(m.has(s))t.set(i,u.L5);else if("date"!==s&&"esriFieldTypeDate"!==s)t.set(i,null);else if(r)t.set(i,u.L5);else{const e=p.get(y(i??""))??l;t.set(i,e)}return t}},96576:(e,t,r)=>{r.d(t,{A:()=>p});var i,s=r(31635),n=r(4718),o=r(10107),l=(r(44208),r(53966),r(93223)),a=r(40608),u=r(92438),c=r(63988),h=r(49849);let p=i=class extends((0,c.h)(u.A)){constructor(e){super(e),this.description=null,this.label=null,this.symbol=null,this.type="simple"}async collectRequiredFields(e,t){await Promise.all([this.collectSymbolFields(e,t),this.collectVVRequiredFields(e,t)])}async collectSymbolFields(e,t){await Promise.all(this.symbols.map(r=>r.collectRequiredFields(e,t)))}getSymbol(e,t){return this.symbol}async getSymbolAsync(e,t){return this.symbol}get symbols(){return this.symbol?[this.symbol]:[]}getAttributeHash(){return this.visualVariables?.reduce((e,t)=>e+t.getAttributeHash(),"")??""}getMeshHash(){return this.symbols.reduce((e,t)=>e+JSON.stringify(t),"")}get arcadeRequired(){return this.arcadeRequiredForVisualVariables}clone(){return new i({description:this.description,label:this.label,symbol:(0,n.o8)(this.symbol),visualVariables:(0,n.o8)(this.visualVariables),authoringInfo:(0,n.o8)(this.authoringInfo)})}};(0,s.Cg)([(0,o.MZ)({type:String,json:{write:!0}})],p.prototype,"description",void 0),(0,s.Cg)([(0,o.MZ)({type:String,json:{write:!0}})],p.prototype,"label",void 0),(0,s.Cg)([(0,o.MZ)(h.Wp)],p.prototype,"symbol",void 0),(0,s.Cg)([(0,l.e)({simple:"simple"})],p.prototype,"type",void 0),p=i=(0,s.Cg)([(0,a.$)("esri.renderers.SimpleRenderer")],p)},99959:(e,t,r)=>{r.d(t,{A:()=>n});var i=r(31635),s=(r(53966),r(44208),r(87811),r(49186),r(40608));let n=class{};n=(0,i.Cg)([(0,s.$)("esri.graphic.GraphicOrigin")],n)}}]);
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[5363],{41560:(e,t,n)=>{n.d(t,{Ch:()=>s,mW:()=>i});var r=n(34727),o=n(39516);function i(e,t){return{...t,filterMode:e.mode}}function s(e,t,n){const i=function(e){if("manual"===u(e))return null;const t=[Number.NEGATIVE_INFINITY,Number.POSITIVE_INFINITY];for(const{minScale:n,maxScale:r}of e.filters)t[0]=Math.max(t[0],c(n)),t[1]=Math.min(t[1],p(r));return t}(e);if(i&&((0,r.gg)(t,i[0])||(0,r.ZH)(n,i[1])))return"";const s=Array.from(a(e,t,n)),l=function(e,t,n){if(0===e.length)return!0;const o=c(e.at(0)?.minScale),i=p(e.at(-1)?.maxScale);if((0,r.ZH)(o,t)||(0,r.gg)(i,n))return!0;for(let t=0;t<e.length-1;t++){const n=e[t],o=e[t+1];if((0,r.ZH)(c(o.minScale),p(n.maxScale)))return!0}return!1}(s,t,n)?"1=1":s.map(e=>e.where||"1=1").reduce((e,t)=>(0,o.IW)(e,t),"");return l&&"1=1"!==l?l:""}function*a(e,t,n){if("manual"===u(e)){const t=e.filters.find(t=>t.id===e.activeFilterId);t&&(yield t)}else{"object"==typeof t&&(t=t.scale);for(const r of e.filters)l(r.minScale,r.maxScale,t,n)&&(yield r)}}function l(e,t,n,o){return e=c(e),n=c(n),t=p(t),!(!(0,r.Sp)(n,e)&&(o??n)>e||(0,r.Hx)(t,n)||void 0!==o&&(0,r.Sp)(o,e))}function u(e){return"mode"in e?e.mode:e.filterMode}function c(e){return e||Number.POSITIVE_INFINITY}function p(e){return e||0}},46140:(e,t,n)=>{n.d(t,{R:()=>o});var r=n(49186);let o=class e{constructor(e,t,n=""){this.major=e,this.minor=t,this._context=n}lessThan(e,t){return this.major<e||e===this.major&&this.minor<t}greaterEqual(e,t){return!this.lessThan(e,t)}validate(e){if(this.major!==e.major){const t=this._context&&this._context+":",n=this._context&&this._context+" ";throw new r.A(t+"unsupported-version",`Required major ${n}version is '${this.major}', but got '\${version.major}.\${version.minor}'`,{version:e})}}clone(){return new e(this.major,this.minor,this._context)}static parse(t,n=""){const[o,i]=t.split("."),s=/^\s*\d+\s*$/;if(!o?.match||!s.test(o))throw new r.A((n&&n+":")+"invalid-version","Expected major version to be a number, but got '${version}'",{version:t});if(!i?.match||!s.test(i))throw new r.A((n&&n+":")+"invalid-version","Expected minor version to be a number, but got '${version}'",{version:t});const a=parseInt(o,10),l=parseInt(i,10);return new e(a,l,n)}}},64714:(e,t,n)=>{n.d(t,{F0:()=>a,Vx:()=>c,e2:()=>f,f:()=>d});var r=n(44208),o=n(4718),i=n(99352),s=n(93470);function a(e){return{renderer:{type:"simple",symbol:"esriGeometryPoint"===e||"esriGeometryMultipoint"===e?s.Cb:"esriGeometryPolyline"===e?s.yM:s.WR}}}const l=/^[_$a-zA-Z][_$a-zA-Z0-9]*$/;let u=1;function c(e,t){if((0,r.A)("esri-csp-restrictions"))return()=>({[t]:null,...e});try{let n=`this${p(t)} = null;`;for(const t in e)n+=`this${p(t)} = ${JSON.stringify(e[t])};`;const r=new Function(`\n return class AttributesClass$${u++} {\n constructor() {\n ${n};\n }\n }\n `)();return()=>new r}catch(n){return()=>({[t]:null,...e})}}function p(e){return l.test(e)?`.${e}`:`["${e}"]`}function f(e={}){return[{name:"New Feature",description:"",prototype:{attributes:(0,o.o8)(e)}}]}function d(e,t){return{analytics:{supportsCacheHint:!1},attachment:null,data:{isVersioned:!1,isBranchVersioned:!1,supportsAttachment:!1,supportsM:!1,supportsZ:e},metadata:{supportsAdvancedFieldProperties:!1},operations:{supportsCalculate:!1,supportsTruncate:!1,supportsValidateSql:!1,supportsAdd:t,supportsDelete:t,supportsEditing:t,supportsChangeTracking:!1,supportsQuery:!0,supportsQueryBins:!0,supportsQueryAnalytics:!1,supportsQueryAttachments:!1,supportsQueryTopFeatures:!1,supportsResizeAttachments:!1,supportsSync:!1,supportsUpdate:t,supportsExceedsLimitStatistics:!0,supportsAsyncConvert3D:!1},query:i.F,queryRelated:{supportsCount:!0,supportsOrderBy:!0,supportsPagination:!0,supportsCacheHint:!1},queryTopFeatures:{supportsCacheHint:!1},queryAttributeBins:i.P,editing:{supportsGeometryUpdate:t,supportsGlobalId:!1,supportsReturnServiceEditsInSourceSpatialReference:!1,supportsRollbackOnFailure:!1,supportsUpdateWithoutM:!1,supportsUploadWithItemId:!1,supportsDeleteByAnonymous:!1,supportsDeleteByOthers:!1,supportsUpdateByAnonymous:!1,supportsUpdateByOthers:!1,supportsAsyncApplyEdits:!1,zDefault:void 0}}}},67482:(e,t,n)=>{function r(e){return null!=a(e)||null!=s(e)}function o(e){return l.test(e)}function i(e){return a(e)??s(e)}function s(e){const t=new Date(e);return function(e,t){if(Number.isNaN(e.getTime()))return!1;let n=!0;if(c&&/\d+\W*$/.test(t)){const e=t.match(/[a-zA-Z]{2,}/);if(e){let t=!1,r=0;for(;!t&&r<=e.length;)t=!u.test(e[r]),r++;n=!t}}return n}(t,e)?Number.isNaN(t.getTime())?null:t.getTime()-6e4*t.getTimezoneOffset():null}function a(e){const t=l.exec(e);if(!t?.groups)return null;const n=t.groups,r=+n.year,o=+n.month-1,i=+n.day,s=+(n.hours??"0"),a=+(n.minutes??"0"),u=+(n.seconds??"0");if(s>23)return null;if(a>59)return null;if(u>59)return null;const c=n.ms??"0",p=c?+c.padEnd(3,"0").slice(0,3):0;let f;if(n.isUTC||!n.offsetSign)f=Date.UTC(r,o,i,s,a,u,p);else{const e=+n.offsetHours,t=+n.offsetMinutes;f=6e4*("+"===n.offsetSign?-1:1)*(60*e+t)+Date.UTC(r,o,i,s,a,u,p)}return Number.isNaN(f)?null:f}n.d(t,{Br:()=>o,Cq:()=>r,_U:()=>i});const l=/^(?:(?<year>-?\d{4,})-(?<month>\d{2})-(?<day>\d{2}))(?:T(?<hours>\d{2}):(?<minutes>\d{2}):(?<seconds>\d{2})(?:\.(?<ms>\d+))?)?(?:(?<isUTC>Z)|(?:(?<offsetSign>\+|-)(?<offsetHours>\d{2}):(?<offsetMinutes>\d{2})))?$/,u=/^((jan(uary)?)|(feb(ruary)?)|(mar(ch)?)|(apr(il)?)|(may)|(jun(e)?)|(jul(y)?)|(aug(ust)?)|(sep(tember)?)|(oct(ober)?)|(nov(ember)?)|(dec(ember)?)|(am)|(pm)|(gmt)|(utc))$/i,c=!Number.isNaN(new Date("technology 10").getTime())},75321:(e,t,n)=>{n.d(t,{GA:()=>x,GL:()=>F,I:()=>k,J0:()=>N,Ki:()=>v,Px:()=>j,QE:()=>A,bV:()=>S,bW:()=>P,vJ:()=>T});var r=n(78888),o=n(49186),i=n(53966),s=n(84952),a=n(16930),l=n(21325),u=n(28735),c=n(90708),p=n(58512),f=n(85113),d=n(64714),m=n(82832),y=n(95466),g=n(98453),h=n(98623);const w=()=>i.A.getLogger("esri.layers.ogc.ogcFeatureUtils"),b="startindex",I=new Set([b,"offset"]),T="http://www.opengis.net/def/crs/",A=`${T}OGC/1.3/CRS84`;async function F(e,t,n={},i=5){const{links:a}=e,l=G(a,"items","application/geo+json")||G(a,"http://www.opengis.net/def/rel/ogc/1.0/items","application/geo+json");if(null==l)throw new o.A("ogc-feature-layer:missing-items-page","Missing items url");const{apiKey:u,customParameters:c,signal:p}=n,m=(0,s.s2)(l.href,e.landingPage.url),I={limit:i,...c,token:u},T=(0,s.a6)(m,I),{data:A}=await(0,r.A)(T,{signal:p,headers:{accept:"application/geo+json"}}),F=E(T,i,A.links)??b;(0,f.sO)(A);const S=(0,f.BM)(A,{geometryType:t.geometryType}),j=t.fields||S.fields||[],v=null!=t.hasZ?t.hasZ:S.hasZ,x=S.geometryType,N=t.objectIdField||S.objectIdFieldName||"OBJECTID";let P=t.timeInfo;const k=j.find(({name:e})=>e===N);if(k)k.editable=!1,k.nullable=!1;else{if(!S.objectIdFieldType)throw new o.A("ogc-feature-layer:missing-feature-id","Collection geojson require a feature id as a unique identifier");j.unshift({name:N,alias:N,type:"number"===S.objectIdFieldType?"esriFieldTypeOID":"esriFieldTypeString",editable:!1,nullable:!1})}if(N!==S.objectIdFieldName){const e=j.find(({name:e})=>e===S.objectIdFieldName);e&&(e.type="esriFieldTypeInteger")}j===S.fields&&S.unknownFields.length>0&&w().warn({name:"ogc-feature-layer:unknown-field-types",message:"Some fields types couldn't be inferred from the features and were dropped",details:{unknownFields:S.unknownFields}});for(const e of j){if(null==e.name&&(e.name=e.alias),null==e.alias&&(e.alias=e.name),"esriFieldTypeOID"!==e.type&&"esriFieldTypeGlobalID"!==e.type&&(e.editable=null==e.editable||!!e.editable,e.nullable=null==e.nullable||!!e.nullable),!e.name)throw new o.A("ogc-feature-layer:invalid-field-name","field name is missing",{field:e});if(!g.m.jsonValues.includes(e.type))throw new o.A("ogc-feature-layer:invalid-field-type",`invalid type for field "${e.name}"`,{field:e})}if(P){const e=new y.A(j);if(P.startTimeField){const t=e.get(P.startTimeField);t?(P.startTimeField=t.name,t.type="esriFieldTypeDate"):P.startTimeField=null}if(P.endTimeField){const t=e.get(P.endTimeField);t?(P.endTimeField=t.name,t.type="esriFieldTypeDate"):P.endTimeField=null}if(P.trackIdField){const t=e.get(P.trackIdField);t?P.trackIdField=t.name:(P.trackIdField=null,w().warn({name:"ogc-feature-layer:invalid-timeInfo-trackIdField",message:"trackIdField is missing",details:{timeInfo:P}}))}P.timeReference||={timeZoneIANA:h.n$},P.startTimeField||P.endTimeField||(w().warn({name:"ogc-feature-layer:invalid-timeInfo",message:"startTimeField and endTimeField are missing",details:{timeInfo:P}}),P=void 0)}return{drawingInfo:x?(0,d.F0)(x):null,extent:O(e),geometryType:x,fields:j,hasZ:!!v,objectIdField:N,paginationParameter:F,timeInfo:P}}async function S(e,t={}){const{links:n,url:i}=e,a=G(n,"data","application/json")||G(n,"http://www.opengis.net/def/rel/ogc/1.0/data","application/json");if(null==a)throw new o.A("ogc-feature-layer:missing-collections-page","Missing collections url");const{apiKey:l,customParameters:u,signal:c}=t,p=(0,s.s2)(a.href,i),{data:f}=await(0,r.A)(p,{signal:c,headers:{accept:"application/json"},query:{...u,token:l}});for(const t of f.collections)t.landingPage=e;return f}async function j(e,t={}){const{links:n,url:i}=e,a=G(n,"conformance","application/json")||G(n,"http://www.opengis.net/def/rel/ogc/1.0/conformance","application/json");if(null==a)throw new o.A("ogc-feature-layer:missing-conformance-page","Missing conformance url");const{apiKey:l,customParameters:u,signal:c}=t,p=(0,s.s2)(a.href,i),{data:f}=await(0,r.A)(p,{signal:c,headers:{accept:"application/json"},query:{...u,token:l}});return f}async function v(e,t={}){const{apiKey:n,customParameters:o,signal:i}=t,{data:s}=await(0,r.A)(e,{signal:i,headers:{accept:"application/json"},query:{...o,token:n}});return s.url=e,s}async function x(e,t={}){const{links:n,url:o}=e,i=G(n,"service-desc","application/vnd.oai.openapi+json;version=3.0");if(null==i)return w().warn("ogc-feature-layer:missing-openapi-page","The OGC API-Features server does not have an OpenAPI page."),null;const{apiKey:a,customParameters:l,signal:u}=t,c=(0,s.s2)(i.href,o),{data:p}=await(0,r.A)(c,{signal:u,headers:{accept:"application/vnd.oai.openapi+json;version=3.0"},query:{...l,token:a}});return p}function N(e){const t=/^http:\/\/www\.opengis.net\/def\/crs\/(?<authority>.*)\/(?<version>.*)\/(?<code>.*)$/i.exec(e),n=t?.groups;if(!n)return null;const{authority:r,code:o}=n;switch(r.toLowerCase()){case"ogc":switch(o.toLowerCase()){case"crs27":return a.A.GCS_NAD_1927.wkid;case"crs83":return 4269;case"crs84":case"crs84h":return a.A.WGS84.wkid;default:return null}case"esri":case"epsg":{const e=Number.parseInt(o,10);return Number.isNaN(e)?null:e}default:return null}}async function P(e,t,n){const r=await k(e,t,n);return(0,c.ZF)(r)}async function k(e,t,n){const{collection:{links:i,landingPage:{url:d}},layerDefinition:g,maxRecordCount:h,queryParameters:{apiKey:w,customParameters:b},spatialReference:I,supportedCrs:T}=e,A=G(i,"items","application/geo+json")||G(i,"http://www.opengis.net/def/rel/ogc/1.0/items","application/geo+json");if(null==A)throw new o.A("ogc-feature-layer:missing-items-page","Missing items url");const{geometry:F,num:S,start:j,timeExtent:v,where:x}=t;if(t.objectIds)throw new o.A("ogc-feature-layer:query-by-objectids-not-supported","Queries with object ids are not supported");const N=a.A.fromJSON(I),P=t.outSpatialReference??N,k=P.isWGS84?null:C(P,T),$=M(F,T),O=function(e){if(null==e)return null;const{start:t,end:n}=e;return`${null!=t?t.toISOString():".."}/${null!=n?n.toISOString():".."}`}(v),E=null!=(J=x)&&J&&"1=1"!==J?J:null,R=S??(null==j?h:10),q=0===j?void 0:j,{fields:D,geometryType:B,hasZ:W,objectIdField:Z,paginationParameter:_}=g,L=(0,s.s2)(A.href,d),{data:U}=await(0,r.A)(L,{...n,query:{...b,...$,crs:k,datetime:O,query:E,limit:R,[_]:q,token:w},headers:{accept:"application/geo+json"}}),V=(0,f.bd)(U,{geometryType:B,hasZ:W,objectIdField:Z}),z=V.length===R&&!!G(U.links??[],"next","application/geo+json"),H=new y.A(D);var J;for(const e of V){const t={};(0,m.MB)(H,t,e.attributes,!0);for(const e of H.fields)e.nullable&&!(e.name in t)&&(t[e.name]=null);t[Z]=e.attributes[Z],e.attributes=t}if(!k&&P.isWebMercator)for(const e of V)if(null!=e.geometry&&null!=B){const t=(0,c.zv)(e.geometry,B,W,!1);t.spatialReference=a.A.WGS84,e.geometry=(0,c.Ux)((0,u.Cv)(t,P))}for(const e of V)e.objectId=e.attributes[Z];const K=k||!k&&P.isWebMercator?P.toJSON():l.KK,Q=new p.A;return Q.exceededTransferLimit=z,Q.features=V,Q.fields=D,Q.geometryType=B,Q.hasZ=W,Q.spatialReference=K,Q}function C(e,t){const{isWebMercator:n,wkid:r}=e;if(!r)return null;const o=n?t[3857]??t[102100]??t[102113]??t[900913]:t[e.wkid];return o?`${T}${o}`:null}function $(e){if(null==e)return"";const{xmin:t,ymin:n,xmax:r,ymax:o}=e;return`${t},${n},${r},${o}`}function M(e,t){if(!function(e){return null!=e&&"extent"===e.type}(e))return null;const{spatialReference:n}=e;if(!n||n.isWGS84)return{bbox:$(e)};const r=C(n,t);return null!=r?{bbox:$(e),"bbox-crs":r}:n.isWebMercator?{bbox:$((0,u.Cv)(e,a.A.WGS84))}:null}function O(e){const t=e.extent?.spatial;if(!t)return null;const n=t.bbox[0],r=4===n.length,[o,i]=n,s=r?void 0:n[2];return{xmin:o,ymin:i,xmax:r?n[2]:n[3],ymax:r?n[3]:n[4],zmin:s,zmax:r?void 0:n[5],spatialReference:a.A.WGS84.toJSON()}}function G(e,t,n){return e.find(({rel:e,type:r})=>e===t&&r===n)??e.find(({rel:e,type:n})=>e===t&&!n)}function E(e,t,n){if(!n)return;const r=G(n,"next","application/geo+json"),o=(0,s.An)(r?.href)?.query;if(!o)return;const i=(0,s.An)(e).query,a=Object.keys(i??{}),l=Object.entries(o).filter(([e])=>!a.includes(e)).find(([e,n])=>I.has(e.toLowerCase())&&Number.parseInt(n,10)===t),u=l?.[0];return u}},82832:(e,t,n)=>{n.d(t,{$1:()=>g,CR:()=>y,MB:()=>f,PC:()=>h,Yx:()=>l,bP:()=>c});var r=n(67482),o=n(21325),i=n(30524);class s{constructor(e){this.description=e,this.code=null}}class a{constructor(e){this.globalId=null,this.objectId=null,this.success=!1,this.uniqueId=null,this.error=new s(e)}}function l(e){return new a(e)}class u{constructor(e){this.globalId=null,this.success=!0,this.objectId=this.uniqueId=e}}function c(e){return new u(e)}const p=new Set;function f(e,t,n,r=!1){p.clear();for(const o in n){const s=e.get(o);if(!s)continue;const a=d(s,n[o]);if(p.add(s.name),s&&(r||s.editable)){const e=(0,i.CJ)(s,a);if(e)return l((0,i.uo)(e,s,a));t[s.name]=a}}for(const t of e.requiredFields??[])if(!p.has(t.name))return l(`missing required field "${t.name}"`);return null}function d(e,t){let n=t;return(0,i.WA)(e)&&"string"==typeof t?n=parseFloat(t):(0,i.yM)(e)&&null!=t&&"string"!=typeof t?n=String(t):(0,i.vE)(e)&&"string"==typeof t&&(n=(0,r._U)(t)),(0,i.WX)(n)}let m;function y(e,t){if(!e||!(0,o.fn)(t))return e;if("rings"in e||"paths"in e){if(null==m)throw new TypeError("geometry engine not loaded");return m.simplify(t,e)}return e}async function g(e,t){!(0,o.fn)(e)||"esriGeometryPolygon"!==t&&"esriGeometryPolyline"!==t||await async function(){return null==m&&(m=await Promise.all([n.e(9930),n.e(7559)]).then(n.bind(n,47559))),m}()}const h={supportsAutoIntervalBin:!0,supportsFixedIntervalBin:!0,supportsFixedBoundariesBin:!0,supportsDateBin:!0,supportsStackBy:!0,supportsSplitBy:!0,supportsNormalization:!0,supportedStatisticTypes:["COUNT","SUM","AVG","VAR","STDDEV","MIN","MAX","PERCENTILE_CONT","PERCENTILE_DISC","CentroidAggregate","EnvelopeAggregate","ConvexHullAggregate"],supportedNormalizationTypes:["field","log","naturalLog","percentOfTotal","squareRoot"]}},85113:(e,t,n)=>{n.d(t,{BM:()=>S,bd:()=>j,sO:()=>F,xD:()=>c});var r=n(67482),o=n(49186),i=n(21325),s=n(43334),a=n(92722),l=n(30524);const u={LineString:"esriGeometryPolyline",MultiLineString:"esriGeometryPolyline",MultiPoint:"esriGeometryMultipoint",Point:"esriGeometryPoint",Polygon:"esriGeometryPolygon",MultiPolygon:"esriGeometryPolygon"};function c(e){return u[e]}function*p(e){switch(e.type){case"Feature":yield e;break;case"FeatureCollection":for(const t of e.features)t&&(yield t)}}function*f(e){if(e)switch(e.type){case"Point":yield e.coordinates;break;case"LineString":case"MultiPoint":yield*e.coordinates;break;case"MultiLineString":case"Polygon":for(const t of e.coordinates)yield*t;break;case"MultiPolygon":for(const t of e.coordinates)for(const e of t)yield*e}}function d(e){for(const t of e)if(t.length>2)return!0;return!1}function m(e){let t=0;for(let n=0;n<e.length;n++){const r=e[n],o=e[(n+1)%e.length];t+=r[0]*o[1]-o[0]*r[1]}return t<=0}function y(e){const t=e[0],n=e[e.length-1];return t[0]===n[0]&&t[1]===n[1]&&t[2]===n[2]||e.push(t),e}function g(e,t,n){switch(t.type){case"LineString":case"MultiPoint":return function(e,t,n){return b(e,t.coordinates,n),e}(e,t,n);case"MultiLineString":return function(e,t,n){for(const r of t.coordinates)b(e,r,n);return e}(e,t,n);case"MultiPolygon":return function(e,t,n){for(const r of t.coordinates){h(e,r[0],n);for(let t=1;t<r.length;t++)w(e,r[t],n)}return e}(e,t,n);case"Point":return function(e,t,n){return T(e,t.coordinates,n),e}(e,t,n);case"Polygon":return function(e,t,n){const r=t.coordinates;h(e,r[0],n);for(let t=1;t<r.length;t++)w(e,r[t],n);return e}(e,t,n)}}function h(e,t,n){const r=y(t);!function(e){return!m(e)}(r)?b(e,r,n):I(e,r,n)}function w(e,t,n){const r=y(t);!function(e){return m(e)}(r)?b(e,r,n):I(e,r,n)}function b(e,t,n){for(const r of t)T(e,r,n);e.lengths.push(t.length)}function I(e,t,n){for(let r=t.length-1;r>=0;r--)T(e,t[r],n);e.lengths.push(t.length)}function T(e,t,n){const[r,o,i]=t;e.coords.push(r,o),n.hasZ&&e.coords.push(i||0)}function A(e){switch(typeof e){case"string":return(0,r.Br)(e)?"esriFieldTypeDate":"esriFieldTypeString";case"number":return"esriFieldTypeDouble";default:return"unknown"}}function F(e,t=4326){if(!e)throw new o.A("geojson-layer:empty","GeoJSON data is empty");if("Feature"!==e.type&&"FeatureCollection"!==e.type)throw new o.A("geojson-layer:unsupported-geojson-object","missing or not supported GeoJSON object type",{data:e});const{crs:n}=e;if(!n)return;const r="string"==typeof n?n:"name"===n.type?n.properties.name:"EPSG"===n.type?n.properties.code:null,s=(0,i.oT)({wkid:t})?new RegExp(".*(CRS84H?|4326)$","i"):new RegExp(`.*(${t})$`,"i");if(!r||!s.test(r))throw new o.A("geojson:unsupported-crs","unsupported GeoJSON 'crs' member",{crs:n})}function S(e,t={}){const n=[],r=new Set,o=new Set;let i,s=!1,a=null,u=!1,{geometryType:m=null}=t;for(const t of p(e)){const{geometry:e,properties:p,id:y}=t;if((!e||(m||(m=c(e.type)),c(e.type)===m))&&(s||(s=d(f(e))),u||(u=null!=y,u&&(i=typeof y,p&&(a=Object.keys(p).filter(e=>p[e]===y)))),p&&a&&u&&null!=y&&(a.length>1?a=a.filter(e=>p[e]===y):1===a.length&&(a=p[a[0]]===y?a:[])),p))for(const e in p){if(r.has(e))continue;const t=A(p[e]);if("unknown"===t){o.add(e);continue}o.delete(e),r.add(e);const i=(0,l.rS)(e);i&&n.push({name:i,alias:e,type:t})}}const y=(0,l.rS)(1===a?.length&&a[0]||null)??void 0;if(y)for(const e of n)if(e.name===y&&(0,l.WA)(e)){e.type="esriFieldTypeOID";break}return{fields:n,geometryType:m,hasZ:s,objectIdFieldName:y,objectIdFieldType:i,unknownFields:Array.from(o)}}function j(e,t){return Array.from(function*(e,t={}){const{geometryType:n,objectIdField:r}=t;for(const o of e){const{geometry:e,properties:i,id:l}=o;if(e&&c(e.type)!==n)continue;const u=i||{};let p;r&&(p=u[r],null==l||p||(u[r]=p=l));const f=new s.Om(e?g(new a.A,e,t):null,u,null,p);yield f}}(p(e),t))}}}]);
@@ -1 +1 @@
1
- "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[3747],{13069:(e,t,r)=>{r.d(t,{AG:()=>a,lk:()=>i,vD:()=>o,yS:()=>n});const s="randomUUID"in crypto;function i(){if(s)return crypto.randomUUID();const e=crypto.getRandomValues(new Uint16Array(8));e[3]=4095&e[3]|16384,e[4]=16383&e[4]|32768;const t=t=>e[t].toString(16).padStart(4,"0");return t(0)+t(1)+"-"+t(2)+"-"+t(3)+"-"+t(4)+"-"+t(5)+t(6)+t(7)}function n(){return`{${i().toUpperCase()}}`}function o(){return`{${i()}}`}function a(e){const t=e.toUpperCase();return e.startsWith("{")?t:`{${t}}`}},16494:(e,t,r)=>{r.d(t,{W5:()=>o});var s=r(37330);const i=["dd","dl","dt","h1","h2","h3","h4","h5","h6","sub","sup","animate","animatetransform","circle","clippath","defs","ellipse","g","image","line","lineargradient","marker","mask","path","pattern","polygon","polyline","radialgradient","rect","stop","svg","switch","symbol","text","textpath","tspan","use"].reduce((e,t)=>(e[t]=[],e),{}),n=["align","alink","alt","bgcolor","border","cellpadding","cellspacing","class","color","cols","colspan","coords","d","dir","face","height","hspace","ismap","lang","marginheight","marginwidth","multiple","nohref","noresize","noshade","nowrap","ref","rel","rev","rows","rowspan","scrolling","shape","span","summary","tabindex","title","usemap","valign","value","vlink","vspace","width"],o=new s.I({whiteList:i,onTagAttr:(e,t,r)=>{const s=`${t}="${r}"`;if(n.includes(t))return s},stripIgnoreTag:!0,stripIgnoreTagBody:["script","style"]},!0)},18047:(e,t,r)=>{r.d(t,{ZV:()=>l,yx:()=>a});var s=r(73444);const i={ar:"ar-u-nu-latn",bs:"sr-Latn-CS",nn:"no-NN"};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 r=(0,s.lR)(),o=r&&i[r]||(0,s.QC)();n.set(t,new Intl.NumberFormat(o,e))}return n.get(t)}(t).format(e)}(0,s.Ml)(()=>{n=new WeakMap,o={}}),new Map},36708:(e,t,r)=>{r.d(t,{C_:()=>u,OH:()=>g,Vh:()=>m,on:()=>c,pc:()=>v,wB:()=>l,z7:()=>h});var s=r(37955),i=r(36563),n=r(97768),o=r(74887),a=r(14012);function l(e,t,r={}){return d(e,t,r,p)}function h(e,t,r={}){return d(e,t,r,f)}function d(e,t,r={},s){let i=null;const o=r.once?(e,r)=>{s(e)&&((0,n.xt)(i),t(e,r))}:(e,r)=>{s(e)&&t(e,r)};if(i=(0,a.Cn)(e,o,r.sync,r.equals),r.initial){const t=e();o(t,t)}return i}function c(e,t,r,o={}){let a=null,h=null,d=null;function c(){a&&h&&(h.remove(),o.onListenerRemove?.(a),a=null,h=null)}function u(e){o.once&&o.once&&(0,n.xt)(d),r(e)}const p=l(e,(e,r)=>{c(),(0,s.wb)(e)&&(a=e,h=(0,s.on)(e,t,u),o.onListenerAdd?.(e))},{sync:o.sync,initial:!0});return d=(0,i.hA)(()=>{p.remove(),c()}),d}function u(e,t){return function(e,t,r){if((0,o.G4)(r))return Promise.reject((0,o.NK)());const s=e();if(t?.(s))return Promise.resolve(s);let a=null;function l(){a=(0,n.xt)(a)}return new Promise((s,n)=>{a=(0,i.vE)([(0,o.u7)(r,()=>{l(),n((0,o.NK)())}),d(e,e=>{l(),s(e)},{sync:!1,once:!0},t??p)])})}(e,f,t)}function p(e){return!0}function f(e){return!!e}r(80559);const g={sync:!0},m={initial:!0},v={sync:!0,initial:!0}},47566:(e,t,r)=>{r(97770),r(18047),r(71754),r(73444);var s=r(10838),i=r(78888),n=r(49186);async function o(e){if(null!=l.fetchBundleAsset)return l.fetchBundleAsset(e);const t=await(0,i.A)(e,{responseType:"text"});return JSON.parse(t.data)}class a{constructor({base:e="",pattern:t,location:r=new URL(window.location.href)}){let s;s="string"==typeof r?e=>new URL(e,new URL(r,window.location.href)).href:r instanceof URL?e=>new URL(e,r).href:r,this.pattern="string"==typeof t?new RegExp(`^${t}`):t,this.getAssetUrl=s,e=e?e.endsWith("/")?e:e+"/":"",this.matcher=new RegExp(`^${e}(?:(.*)\\/)?(.*)$`)}fetchMessageBundle(e,t){return async function(e,t,r,i){const a=t.exec(r);if(!a)throw new n.A("esri-intl:invalid-bundle",`Bundle id "${r}" is not compatible with the pattern "${t}"`);const l=a[1]?`${a[1]}/`:"",h=a[2],d=(0,s.xO)(i),c=`${l}${h}.json`,u=d?`${l}${h}_${d}.json`:c;let p;try{p=await o(e(u))}catch(t){if(u===c)throw new n.A("intl:unknown-bundle",`Bundle "${r}" cannot be loaded`,{error:t});try{p=await o(e(c))}catch(e){throw new n.A("intl:unknown-bundle",`Bundle "${r}" cannot be loaded`,{error:e})}}return p}(this.getAssetUrl,this.matcher,e,t)}}const l={};var h,d=r(2741);(0,s.ao)((h={pattern:"esri/",location:d.s},new a(h)))},61893:(e,t,r)=>{r.d(t,{Z:()=>d,g:()=>h});var s=r(31635),i=r(65008),n=r(36563),o=r(74887),a=r(40608);class l{constructor(){this._resolver=(0,o.Tw)(),this._status=0,this._resolvingPromises=[],this._resolver.promise.then(()=>{this._status=1,this._cleanUp()},()=>{this._status=2,this._cleanUp()}),this.promise=this._resolver.promise}destroy(){this._cleanUp()}addResolvingPromise(e){this._resolvingPromises.push(e),this._tryResolve()}isResolved(){return 1===this._status}isRejected(){return 2===this._status}isFulfilled(){return 0!==this._status}abort(){this._resolver.reject((0,o.NK)())}_cleanUp(){this._allPromise=null,this._resolvingPromises=null}_tryResolve(){if(this.isFulfilled())return;const e=(0,o.Tw)(),t=[...this._resolvingPromises,e.promise],r=this._allPromise=Promise.all(t);r.then(()=>{this.isFulfilled()||this._allPromise!==r||this._resolver.resolve()},e=>{this.isFulfilled()||this._allPromise!==r||(0,o.zf)(e)||this._resolver.reject(e)}),e.resolve()}}const h=e=>{const t=e;let r=class extends t{constructor(...e){super(...e),this._promiseProps=new l,this.addResolvingPromise(Promise.resolve())}destroy(){this._promiseProps.destroy()}isResolved(){return this._promiseProps.isResolved()}isRejected(){return this._promiseProps.isRejected()}isFulfilled(){return this._promiseProps.isFulfilled()}when(e,t){return this._promiseProps.promise.then(()=>this).then(e,t)}catch(e){return this.when(null,e)}addResolvingPromise(e){e&&!this._promiseProps.isFulfilled()&&this._promiseProps.addResolvingPromise("_promiseProps"in e?e.when():e)}addResolvingTask(e){e&&!this._promiseProps.isFulfilled()&&(this.addHandles((0,n.rE)(e)),this._promiseProps.addResolvingPromise(e.promise))}};return r=(0,s.Cg)([(0,a.$)("esri.core.Promise")],r),r},d=h(i.A)},71754:(e,t,r)=>{r.d(t,{V:()=>h});var s=r(53966),i=r(93637),n=r(799),o=r(97770),a=r(18047);const l=()=>s.A.getLogger("esri.intl.substitute");function h(e,t,r={}){const{format:s={}}=r;return(0,n.HC)(e,e=>function(e,t,r){let s,n;const o=e.indexOf(":");if(-1===o?s=e.trim():(s=e.slice(0,o).trim(),n=e.slice(o+1).trim()),!s)return"";const a=(0,i.wc)(s,t);if(null==a)return"";const l=(n?r?.[n]:null)??r?.[s];return l?d(a,l):n?c(a,n):u(a)}(e,t,s))}function d(e,t){switch(t.type){case"date":return(0,o.Yq)(e,t.intlOptions);case"number":return(0,a.ZV)(e,t.intlOptions);default:return l().warn("missing format descriptor for key {key}"),u(e)}}function c(e,t){switch(t.toLowerCase()){case"dateformat":return(0,o.Yq)(e);case"numberformat":return(0,a.ZV)(e);default:return l().warn(`inline format is unsupported since 4.12: ${t}`),/^(dateformat|datestring)/i.test(t)?(0,o.Yq)(e):/^numberformat/i.test(t)?(0,a.ZV)(e):u(e)}}function u(e){switch(typeof e){case"string":return e;case"number":return(0,a.ZV)(e);case"boolean":return""+e;default:return e instanceof Date?(0,o.Yq)(e):""}}},73747:(e,t,r)=>{r.r(t),r.d(t,{default:()=>dt});var s=r(70333),i=r(31635),n=r(92602),o=r(78888),a=r(49186),l=r(65529),h=r(37955),d=r(4718),c=r(93637),u=r(74887),p=r(84952),f=r(10107),g=(r(44208),r(53966)),m=r(40608);r(47566),r(87811);var v=r(97768),_=r(61893),y=r(36708),w=r(13069),S=r(79901),I=r(62788),A=r(71429),k=r(16494);const U="http://www.w3.org/",C=`${U}2000/svg`,P=`${U}1999/xlink`;let b=[],x=(e,t)=>{let r={};return Object.keys(e).forEach(t=>{r[t]=e[t]}),t&&Object.keys(t).forEach(e=>{r[e]=t[e]}),r},T=(e,t)=>e.vnodeSelector===t.vnodeSelector&&(e.properties&&t.properties?e.properties.key===t.properties.key&&e.properties.bind===t.properties.bind:!e.properties&&!t.properties),R=e=>{if("string"!=typeof e)throw new Error("Style values must be strings")},O=(e,t,r)=>{if(""!==t.vnodeSelector)for(let s=r;s<e.length;s++)if(T(e[s],t))return s;return-1},N=(e,t,r,s)=>{let i=e[t];if(""===i.vnodeSelector)return;let n=i.properties;if(!(n?void 0===n.key?n.bind:n.key:void 0))for(let n=0;n<e.length;n++)if(n!==t){let t=e[n];if(T(t,i))throw new Error(`${r.vnodeSelector} had a ${i.vnodeSelector} child ${"added"===s?s:"removed"}, but there is now more than one. You must add unique key properties to make them distinguishable.`)}},M=e=>{if(e.properties){let t=e.properties.enterAnimation;t&&t(e.domNode,e.properties)}},D=[],j=!1,E=e=>{(e.children||[]).forEach(E),e.properties&&e.properties.afterRemoved&&e.properties.afterRemoved.apply(e.properties.bind||e.properties,[e.domNode])},L=()=>{j=!1,D.forEach(E),D.length=0},q=e=>{D.push(e),j||(j=!0,"undefined"!=typeof window&&"requestIdleCallback"in window?window.requestIdleCallback(L,{timeout:16}):setTimeout(L,16))},$=e=>{let t=e.domNode;if(e.properties){let r=e.properties.exitAnimation;if(r){t.style.pointerEvents="none";let s=()=>{t.parentNode&&(t.parentNode.removeChild(t),q(e))};return void r(t,s,e.properties)}}t.parentNode&&(t.parentNode.removeChild(t),q(e))},Z=(e,t,r)=>{if(!t)return;let s=r.eventHandlerInterceptor,i=Object.keys(t),n=i.length;for(let o=0;o<n;o++){let n=i[o],a=t[n];if("className"===n)throw new Error('Property "className" is not supported, use "class".');if("class"===n)z(e,a,!0);else if("classes"===n){let t=Object.keys(a),r=t.length;for(let s=0;s<r;s++){let r=t[s];a[r]&&e.classList.add(r)}}else if("styles"===n){let t=Object.keys(a),s=t.length;for(let i=0;i<s;i++){let s=t[i],n=a[s];n&&(R(n),r.styleApplyer(e,s,n))}}else if("key"!==n&&null!=a){let i=typeof a;"function"===i?(0===n.lastIndexOf("on",0)&&(s&&(a=s(n,a,e,t)),"oninput"===n&&function(){let e=a;a=function(t){e.apply(this,[t]),t.target["oninput-value"]=t.target.value}}()),e[n]=a):r.namespace===C?"href"===n?e.setAttributeNS(P,n,a):e.setAttribute(n,a):"string"===i&&"value"!==n?"innerHTML"===n?e[n]=k.W5.sanitize(a):F(e)&&n in e?e[n]=a:e.setAttribute(n,a):e[n]=a}}};function F(e){if(!(e instanceof Element&&e.tagName.includes("-")))return!1;const t=window.customElements.get(e.tagName.toLowerCase());return!!t&&e instanceof t}let V,B=(e,t,r)=>{((e,t,r)=>{if(t)for(let s of t)H(s,e,void 0,r)})(e,t.children,r),t.text&&(e.textContent=t.text),Z(e,t.properties,r),t.properties&&t.properties.afterCreate&&t.properties.afterCreate.apply(t.properties.bind||t.properties,[e,r,t.vnodeSelector,t.properties,t.children])},H=(e,t,r,s)=>{let i,n=0,o=e.vnodeSelector,a=t.ownerDocument;if(""===o)i=e.domNode=a.createTextNode(e.text),void 0!==r?t.insertBefore(i,r):t.appendChild(i);else{for(let l=0;l<=o.length;++l){let h=o.charAt(l);if(l===o.length||"."===h||"#"===h){let h=o.charAt(n-1),d=o.slice(n,l);"."===h?i.classList.add(d):"#"===h?i.id=d:("svg"===d&&(s=x(s,{namespace:C})),void 0!==s.namespace?i=e.domNode=a.createElementNS(s.namespace,d):(i=e.domNode=e.domNode||a.createElement(d),"input"===d&&e.properties&&void 0!==e.properties.type&&i.setAttribute("type",e.properties.type)),void 0!==r?t.insertBefore(i,r):i.parentNode!==t&&t.appendChild(i)),n=l+1}}B(i,e,s)}},z=(e,t,r)=>{t&&t.split(" ").forEach(t=>{t&&e.classList.toggle(t,r)})},W=(e,t,r,s)=>{if(!r)return;let i=!1,n=Object.keys(r),o=n.length;for(let a=0;a<o;a++){let o=n[a],l=r[o],h=t[o];if("class"===o)h!==l&&(z(e,h,!1),z(e,l,!0));else if("classes"===o){let t=e.classList,r=Object.keys(l),s=r.length;for(let e=0;e<s;e++){let s=r[e],n=!!l[s];n!==!!h[s]&&(i=!0,n?t.add(s):t.remove(s))}}else if("styles"===o){let t=Object.keys(l),r=t.length;for(let n=0;n<r;n++){let r=t[n],o=l[r];o!==h[r]&&(i=!0,o?(R(o),s.styleApplyer(e,r,o)):s.styleApplyer(e,r,""))}}else if(l||"string"!=typeof h||(l=""),"value"!==o||F(e)){if(l!==h){let t=typeof l;"function"===t&&s.eventHandlerInterceptor||(s.namespace===C?"href"===o?e.setAttributeNS(P,o,l):e.setAttribute(o,l):"string"===t?"innerHTML"===o?e[o]=k.W5.sanitize(l):"role"===o&&""===l?e.removeAttribute(o):F(e)&&o in e?e[o]=l:e.setAttribute(o,l):e[o]!==l&&(e[o]=l),i=!0)}}else{let t=e[o];t!==l&&(e["oninput-value"]?t===e["oninput-value"]:l!==h)&&(e[o]=l,e["oninput-value"]=void 0),l!==h&&(i=!0)}}return i},J=(e,t,r,s,i)=>{if(r===s)return!1;s=s||b;let n,o=(r=r||b).length,a=s.length,l=0,h=0,d=!1;for(;h<a;){let a=l<o?r[l]:void 0,c=s[h];if(void 0!==a&&T(a,c))d=V(a,c,i)||d,l++;else{let a=O(r,c,l+1);if(a>=0){for(n=l;n<a;n++)$(r[n]),N(r,n,e,"removed");d=V(r[a],c,i)||d,l=a+1}else H(c,t,l<o?r[l].domNode:void 0,i),M(c),N(s,h,e,"added")}h++}if(o>l)for(n=l;n<o;n++)$(r[n]),N(r,n,e,"removed");return d};V=(e,t,r)=>{let s=e.domNode,i=!1;if(e===t)return!1;let n=!1;if(""===t.vnodeSelector){if(t.text!==e.text){let e=s.ownerDocument.createTextNode(t.text);return s.parentNode.replaceChild(e,s),t.domNode=e,i=!0,i}t.domNode=s}else 0===t.vnodeSelector.lastIndexOf("svg",0)&&(r=x(r,{namespace:C})),e.text!==t.text&&(n=!0,void 0===t.text?s.removeChild(s.firstChild):s.textContent=t.text),t.domNode=s,n=J(t,s,e.children,t.children,r)||n,n=W(s,e.properties,t.properties,r)||n,t.properties&&t.properties.afterUpdate&&t.properties.afterUpdate.apply(t.properties.bind||t.properties,[s,r,t.vnodeSelector,t.properties,t.children]);return n&&t.properties&&t.properties.updateAnimation&&t.properties.updateAnimation(s,t.properties,e.properties),i};let G=(e,t)=>({getLastRender:()=>e,update:r=>{if(e.vnodeSelector!==r.vnodeSelector)throw new Error("The selector for the root VNode may not be changed. (consider using dom.merge and add one extra level to the virtual DOM)");let s=e;e=r,V(s,r,t)},domNode:e.domNode});const X={namespace:void 0,performanceLogger:()=>{},eventHandlerInterceptor:void 0,styleApplyer:(e,t,r)=>{"-"===t.charAt(0)?e.style.setProperty(t,r):e.style[t]=r}};let Y,K=e=>x(X,e),Q=(e,t,r)=>(r=K(r),H(t,e,void 0,r),G(t,r)),ee=(e,t,r)=>(r=K(r),H(t,e.parentNode,e,r),G(t,r)),te=(e,t,r)=>(r=K(r),t.domNode=e,B(e,t,r),G(t,r)),re=(e,t,r)=>(r=K(r),H(t,e.parentNode,e,r),e.parentNode.removeChild(e),G(t,r));Y=Array.prototype.find?(e,t)=>e.find(t):(e,t)=>e.filter(t)[0];const se={handleInterceptedEvent:(e,t,r,s)=>(e.scheduleRender(),t.properties[`on${s.type}`].apply(t.properties.bind||r,[s]))},ie={namespace:void 0,performanceLogger:()=>{},eventHandlerInterceptor:void 0,styleApplyer:(e,t,r)=>{t.startsWith("-")?e.style.setProperty(t,r):e.style[t]=r}},ne=(e,t,r=!1)=>{let s=e;return t.forEach((e,i)=>{const n=s?.children?((e,t)=>e.find(t))(s.children,t=>t.domNode===e):void 0;r&&!n&&i!==t.length-1||(s=n)}),s};var oe=r(14813),ae=r(2741);let le;le="components/assets";var he=r(36563);const de=Symbol("widget"),ce=Symbol("widget-test-data"),ue=[],pe={},fe=new WeakMap;function ge(e,t){let r=t.children;if(r?.length)for(let t=0;t<r.length;++t)r[t]=ge(e,r[t]);else r=ue;const s=t.vnodeSelector;if(ye(s)){const i=t.properties||pe,n=i.key||s,o={key:n,afterCreate:me,afterUpdate:ve,afterRemoved:_e,parentWidget:e,widgetConstructor:s,widgetProperties:{...i,key:n,children:r}};return{vnodeSelector:s.vnodeSelector,properties:o,children:void 0,text:void 0,domNode:null}}return t}function me(e,t,r,{parentWidget:s,widgetConstructor:i,widgetProperties:n}){const o=new i(n);o.container=e,fe.set(e,o),o.afterCreate?.(o,e),s.addHandles((0,he.hA)(()=>_e(e))),queueMicrotask(()=>{o[ce].projector.renderNow()})}function ve(e,t,r,{widgetProperties:s}){const i=fe.get(e);i&&(i.set(s),i.afterUpdate?.(i,e))}function _e(e){const t=fe.get(e);t&&(t.afterRemoved?.(t,e),t.destroy(),fe.delete(e))}function ye(e){return"function"==typeof e&&e[de]}const we=new Set;new Map;const Se=new Map;function Ie(){Se.clear()}function Ae(e){Se.delete(e)}var ke=r(98291),Ue=r(96211);function Ce(...e){const t=ke.A.acquire();for(let r=0;r<e.length;r++){const s=e[r],i=typeof s;if("string"===i)t.push(s);else if(Array.isArray(s))t.push.apply(t,s);else if("object"===i)for(const e in s)s[e]&&t.push(e)}const r=t.join(" ");return ke.A.release(t),r}(()=>{const e=new Map;new ResizeObserver(t=>{Ie();for(const r of t)e.get(r.target)?.(r)})})();var Pe,be=r(10838),xe=r(73444);let Te=0;function Re(e,t){const r=Object.prototype.hasOwnProperty;for(const s in t)r.call(t,s)&&r.call(e,s)&&(null!=e[s]&&null!=t[s]&&"object"==typeof e[s]&&"object"==typeof t[s]?Re(e[s],t[s]):e[s]=t[s]);return e}const Oe=(e=>{let t;const r={...se,...e},s=(n=r,{...ie,...n}),i=s.performanceLogger;var n;let o,a=!0,l=!1;const h=[],d=[],c=(e,n,o)=>{let a;s.eventHandlerInterceptor=(e,s,n,o)=>function(e){let s;i("domEvent",e);const n=((e,t)=>{const r=[];for(;e&&e!==t;)r.push(e),e=e.parentNode;return r})(e.currentTarget,a.domNode),o=n.some(e=>customElements.get(e?.tagName?.toLowerCase()));if(e.eventPhase!==Event.CAPTURING_PHASE&&o){const t=e.composedPath(),r=t.slice(t.indexOf(e.currentTarget),t.indexOf(a.domNode)).reverse();s=ne(a.getLastRender(),r,!0)}else n.reverse(),s=ne(a.getLastRender(),n);let l;return s&&(l=r.handleInterceptedEvent(t,s,this,e)),i("domEventProcessed",e),l},r.postProcessProjectionOptions?.(s);const l=o();a=e(n,l,s),s.eventHandlerInterceptor=void 0,h.push(a),d.push(o),r.afterFirstVNodeRendered&&r.afterFirstVNodeRendered(a,l)};let u=()=>{if(o=void 0,a){a=!1,i("renderStart",void 0);for(let e=0;e<h.length;e++){const t=d[e]();i("rendered",void 0);try{h[e].update(t)}catch(e){console.error(e)}i("patched",void 0)}i("renderDone",void 0),a=!0}};return r.modifyDoRenderImplementation&&(u=r.modifyDoRenderImplementation(u,h,d)),t={renderNow:u,scheduleRender:()=>{o||l||(o=requestAnimationFrame(u))},stop:()=>{o&&(cancelAnimationFrame(o),o=void 0),l=!0},resume:()=>{l=!1,a=!0,t.scheduleRender()},append:(e,t)=>{c(Q,e,t)},insertBefore:(e,t)=>{c(ee,e,t)},merge:(e,t)=>{c(te,e,t)},replace:(e,t)=>{c(re,e,t)},detach:e=>{for(let t=0;t<d.length;t++)if(d[t]===e)return d.splice(t,1),h.splice(t,1)[0];throw new Error("renderFunction was not found")}},t})({postProcessProjectionOptions(e){const t=e.eventHandlerInterceptor,r=/capture$/i;e.eventHandlerInterceptor=(e,s,i,n)=>{const o=t?.(e,s,i,n),a=r.test(e);if(!((e=e.replace(r,"")).toLowerCase()in i)||a){const t=e[2].toLowerCase()+e.slice(3),r=e=>o?.call(i,e);i.addEventListener(t,r,a);const s=()=>i.removeEventListener(t,r,a),l=n.afterRemoved;n.afterRemoved=e=>{l?.(e),s()}}return o}},handleInterceptedEvent(e,t,r,s){const{eventPhase:i,type:n}=s,o=i===Event.CAPTURING_PHASE;let a=`on${n}${o?"capture":""}`;const l=t.properties;(l&&a in l||(a=`on${n[0].toUpperCase()}${n.slice(1)}${o?"Capture":""}`,l&&a in l))&&(Ie(),e.scheduleRender(),l[a].call(l.bind||r,s))}});let Ne=!1,Me=class extends((0,_.g)(l.nJ)){static{this[Pe]=!0}constructor(e,t){super(e,t),this._attached=!1,this._projector=Oe,this._readyForTrueRender=!1,this.key=this,this.autoRenderingEnabled=!0,this._loadLocale=(0,u.sg)(async()=>{if(this._messageBundleProps?.length){const e=await Promise.allSettled(this._messageBundleProps.map(async({bundlePath:e,propertyName:t})=>{if(this.destroyed)return;let r=await(0,be.ud)(e);this.destroyed||(this.uiStrings&&Object.keys(this.uiStrings)&&(r=Re((0,d.o8)(r),this.uiStrings)),this[t]=r)}));if(this.destroyed)return;for(const t of e)"rejected"===t.status&&g.A.getLogger(this).error("widget-intl:locale-error",this.declaredClass,t.reason)}await this.loadLocale()}),this.addHandles((0,he.hA)()),oe.qu||(0,oe.Qu)((0,p.s2)((0,ae.s)("components/assets")));const r="esri-widget-uid-"+(0,w.lk)(),s=this.render.bind(this);this._trackingTarget=new A.r(()=>{this.autoRenderingEnabled&&this.scheduleRender()});const i=()=>({vnodeSelector:"div",properties:{key:`${r}-hidden`,class:"",styles:{display:"none"}},domNode:null,children:void 0,text:void 0}),n=()=>{if(!this._readyForTrueRender||this.destroyed)return null;const e=s()??i(),t=e.properties??={};if(t.key??=r,ye(e.vnodeSelector)){if(!this.visible)return i()}else this.visible?t.styles||(t.styles={}):(t.class="",t.styles={display:"none"}),t.styles.display??="";let n=0;return e.children?.forEach(e=>{ye(e.vnodeSelector)||(e.properties??={},e.properties.key??=`${this.id}--${n++}`)}),ge(this,e)};this.render=()=>{if(Ne)return n();let e=function(e){return Se.get(e)}(this)??null;if(e)return e;this._trackingTarget.clear(),Ne=!0;try{e=(0,I.a)(this._trackingTarget,n)}catch(e){throw g.A.getLogger(this).error(e),e}finally{Ne=!1}return e&&function(e,t){Se.set(e,t)}(this,e),e};const o=this.beforeFirstRender();o?this._resourcesFetch=o.then(()=>{this.destroyed||(this._readyForTrueRender=!0,this._postInitialize())}):(this._resourcesFetch=Promise.resolve().then(()=>{this.destroyed||this._postInitialize()}),this._readyForTrueRender=!0),this.addResolvingPromise(this._resourcesFetch),function(e){we.add(e),e.finally(()=>we.delete(e))}(this._resourcesFetch)}normalizeCtorArgs(e,t){const r={...e};return t&&(r.container=t),r}postInitialize(){}beforeFirstRender(){const e=this.loadDependencies();return this._messageBundleProps?.length||e?Promise.all([e,this._loadLocale()]).then(()=>{}).catch(u.jH):null}loadDependencies(){return null}loadLocale(){return null}destroy(){this.destroyed||((0,v.pR)(this._trackingTarget),(0,v.pR)(this.viewModel),this._detach(this.container),this._set("container",null),this.render=()=>null,this._projector=null,Ae(this))}set container(e){this._get("container")||this._set("container",e)}castContainer(e){return"string"==typeof(t=e)?document.getElementById(t):t??null;var t}get destroyed(){return super.destroyed}get domNode(){return this.container}set domNode(e){this.container=e}get icon(){return null}set icon(e){this._overrideIfSome("icon",e)}get id(){return this._get("id")||this.container?.id||Date.now().toString(16)+"-widget-"+Te++}set id(e){e&&this._set("id",e)}get label(){return this.declaredClass.split(".").pop()}set label(e){this._overrideIfSome("label",e)}get renderable(){return this._resourcesFetch}get visible(){return this._get("visible")}set visible(e){this._set("visible",e)}get[(Pe=de,ce)](){return{projector:this._projector}}static{this.vnodeSelector="div"}render(){throw new Error("not implemented")}scheduleRender(){this.destroyed||(Ae(this),this._projector.scheduleRender())}classes(...e){return Ce.apply(this,e)}renderNow(){Ae(this),this._projector.renderNow()}_postInitialize(){if(this.destroyed)return;this.scheduleRender(),this._delegatedEventNames?.length&&this.addHandles((0,y.wB)(()=>this.viewModel,(e,t)=>{t&&this.removeHandles("delegated-events"),e&&(0,h.wb)(e)&&this.addHandles(this._delegatedEventNames.map(t=>(0,h.on)(e,t,e=>{this.emit(t,e)})),"delegated-events")},y.pc)),this.postInitialize();const e=async()=>{await this._loadLocale().catch(u.jH),this.scheduleRender()};this.addHandles([(0,xe.oQ)(e),(0,y.wB)(()=>this.uiStrings,e)]),this.addHandles((0,y.z7)(()=>this.container,e=>{this.destroyed||this._attach(e)},{initial:!0,once:!0}))}_attach(e){e&&(this._projector.merge(e,this.render),this._attached=!0)}_detach(e){this._attached&&(this._projector.detach(this.render),this._attached=!1),e?.parentNode?.removeChild(e)}};(0,i.Cg)([(0,f.MZ)()],Me.prototype,"_readyForTrueRender",void 0),(0,i.Cg)([(0,f.MZ)({value:null})],Me.prototype,"container",null),(0,i.Cg)([(0,S.w)("container")],Me.prototype,"castContainer",null),(0,i.Cg)([(0,f.MZ)()],Me.prototype,"icon",null),(0,i.Cg)([(0,f.MZ)()],Me.prototype,"id",null),(0,i.Cg)([(0,f.MZ)()],Me.prototype,"label",null),(0,i.Cg)([(0,f.MZ)()],Me.prototype,"renderable",null),(0,i.Cg)([(0,f.MZ)()],Me.prototype,"uiStrings",void 0),(0,i.Cg)([(0,f.MZ)()],Me.prototype,"viewModel",void 0),(0,i.Cg)([(0,f.MZ)({value:!0})],Me.prototype,"visible",null),(0,i.Cg)([(0,f.MZ)()],Me.prototype,"key",void 0),(0,i.Cg)([(0,f.MZ)()],Me.prototype,"children",void 0),(0,i.Cg)([(0,f.MZ)()],Me.prototype,"afterCreate",void 0),(0,i.Cg)([(0,f.MZ)()],Me.prototype,"afterUpdate",void 0),(0,i.Cg)([(0,f.MZ)()],Me.prototype,"afterRemoved",void 0),Me=(0,i.Cg)([(0,m.$)("esri.widgets.Widget")],Me);const De=Me;function je(e){return(t,r)=>{t.hasOwnProperty("_messageBundleProps")||(t._messageBundleProps=t._messageBundleProps?t._messageBundleProps.slice():[]),t._messageBundleProps.push({bundlePath:e,propertyName:r})}}var Ee=function(e){return{vnodeSelector:"",properties:void 0,children:void 0,text:e.toString(),domNode:null}},Le=function(e,t){for(var r=0,s=e.length;r<s;r++){var i=e[r];Array.isArray(i)?Le(i,t):null!=i&&!1!==i&&(i.hasOwnProperty("vnodeSelector")||(i=Ee(i)),t.push(i))}};function qe(e,t,...r){return"function"!=typeof e||ye(e)?function(e,t){for(var r=[],s=2;s<arguments.length;s++)r[s-2]=arguments[s];if(1===r.length&&"string"==typeof r[0])return{vnodeSelector:e,properties:t||void 0,children:void 0,text:r[0],domNode:null};var i=[];return Le(r,i),{vnodeSelector:e,properties:t||void 0,children:i,text:void 0,domNode:null}}(e,t??null,...r):e(t,...r)}const $e=/\W/g;function Ze(){const e=getComputedStyle(document.body).getPropertyValue("--esri-calcite-mode-name").replaceAll($e,"").toLowerCase();switch(e){case"dark":case"light":return`calcite-mode-${e}`;default:return null}}var Fe=r(71754);const Ve="esri-identity-modal",Be={base:Ve,info:`${Ve}__info`,notice:`${Ve}__notice`};let He=class extends De{constructor(e,t){super(e,t),this.container=document.createElement("div"),this.error=null,this.oAuthPrompt=!1,this.open=!1,this.signingIn=!1,this.server=null,this.resource=null,this._usernameInputNode=null,this._passwordInputNode=null,document.body.appendChild(this.container)}loadDependencies(){return function(e){const t=[];for(const r of Object.keys(e))customElements.get(`calcite-${r}`)||t.push(e[r]?.());return t.length>0?Promise.all(t):null}({button:()=>Promise.all([r.e(9e3),r.e(9402),r.e(7836)]).then(r.bind(r,37836)),dialog:()=>Promise.all([r.e(9e3),r.e(9402),r.e(2893)]).then(r.bind(r,52893)),input:()=>Promise.all([r.e(9e3),r.e(9402),r.e(4546)]).then(r.bind(r,2165)),label:()=>Promise.all([r.e(9e3),r.e(224)]).then(r.bind(r,87843)),notice:()=>Promise.all([r.e(9e3),r.e(9402),r.e(8098)]).then(r.bind(r,48098))})}get title(){return this.commonMessages?.auth.signIn}render(){const{open:e,title:t,messages:r,signingIn:s,oAuthPrompt:i,server:n,resource:o,error:a}=this,{info:l,oAuthInfo:h,lblItem:d,invalidUser:c,noAuthService:u,lblUser:p,lblPwd:f,lblCancel:g,lblSigning:m,lblOk:v}=r;return qe("div",{class:this.classes(Be.base,Ze())},qe("form",{bind:this,onsubmit:this._submit},qe("calcite-dialog",{bind:this,heading:t,modal:!0,open:e,outsideCloseDisabled:!0,scale:"s",widthScale:"s",onCalciteDialogClose:this._cancel,onCalciteDialogOpen:this._focusUsernameInput},qe("div",{class:Be.info},(0,Fe.V)(i?h:l,{server:n&&/\.arcgis\.com/i.test(n)?"ArcGIS Online":n,resource:`(${o||d})`})),a?qe("calcite-notice",{class:Be.notice,icon:"exclamation-mark-triangle",kind:"danger",open:!0},qe("div",{slot:"message"},a.details?.httpStatus?c:u)):null,i?null:[qe("calcite-label",null,p,qe("calcite-input",{afterCreate:e=>this._usernameInputNode=e,autocomplete:"off",bind:this,name:"username",required:!0,spellcheck:!1,type:"text",value:""})),qe("calcite-label",null,f,qe("calcite-input",{afterCreate:e=>this._passwordInputNode=e,bind:this,name:"password",required:!0,type:"password",value:""}))],qe("calcite-button",{appearance:"outline",bind:this,onclick:this._cancel,slot:"footer-end",type:"button"},g),qe("calcite-button",{loading:!!s,slot:"footer-end",type:"submit"},s?m:v))))}_focusUsernameInput(){return async function(e){await(0,Ue.$m)((0,u.Mq)(void 0));const t=e();t&&("setFocus"in t&&"function"==typeof t.setFocus?await t.setFocus():t instanceof HTMLElement&&t.focus())}(()=>this._usernameInputNode)}_cancel(){this._set("signingIn",!1),this.open=!1,this._usernameInputNode&&(this._usernameInputNode.value=""),this._passwordInputNode&&(this._passwordInputNode.value=""),this.emit("cancel")}_submit(e){e.preventDefault(),this._set("signingIn",!0);const t=this.oAuthPrompt?{}:{username:this._usernameInputNode?.value,password:this._passwordInputNode?.value};this.emit("submit",t)}};(0,i.Cg)([(0,f.MZ)({readOnly:!0})],He.prototype,"container",void 0),(0,i.Cg)([(0,f.MZ)(),je("esri/t9n/common")],He.prototype,"commonMessages",void 0),(0,i.Cg)([(0,f.MZ)()],He.prototype,"error",void 0),(0,i.Cg)([(0,f.MZ)(),je("esri/identity/t9n/identity")],He.prototype,"messages",void 0),(0,i.Cg)([(0,f.MZ)()],He.prototype,"oAuthPrompt",void 0),(0,i.Cg)([(0,f.MZ)()],He.prototype,"open",void 0),(0,i.Cg)([(0,f.MZ)()],He.prototype,"signingIn",void 0),(0,i.Cg)([(0,f.MZ)()],He.prototype,"server",void 0),(0,i.Cg)([(0,f.MZ)({readOnly:!0})],He.prototype,"title",null),(0,i.Cg)([(0,f.MZ)()],He.prototype,"resource",void 0),He=(0,i.Cg)([(0,m.$)("esri.identity.IdentityModal")],He);const ze=He,We="esriJSAPIOAuth";class Je{constructor(e,t){this.oAuthInfo=null,this.storage=null,this.appId=null,this.codeVerifier=null,this.expires=null,this.refreshToken=null,this.ssl=null,this.stateUID=null,this.token=null,this.userId=null,this.oAuthInfo=e,this.storage=t,this._init()}isValid(){let e=!1;if(this.oAuthInfo&&this.userId&&(this.refreshToken||this.token))if(null==this.expires&&this.refreshToken)e=!0;else if(this.expires){const t=Date.now();this.expires>t&&(this.expires-t)/1e3>60*this.oAuthInfo.minTimeUntilExpiration&&(e=!0)}return e}save(){if(!this.storage)return!1;const e=this._load(),t=this.oAuthInfo;if(t?.authNamespace&&t.portalUrl){let r=e[t.authNamespace];r||(r=e[t.authNamespace]={}),this.appId||(this.appId=t.appId),r[t.portalUrl]={appId:this.appId,codeVerifier:this.codeVerifier,expires:this.expires,refreshToken:this.refreshToken,ssl:this.ssl,stateUID:this.stateUID,token:this.token,userId:this.userId};try{this.storage.setItem(We,JSON.stringify(e))}catch(e){return console.warn(e),!1}return!0}return!1}destroy(){const e=this._load(),t=this.oAuthInfo;if(t?.appId&&t?.portalUrl&&(null==this.expires||this.expires>Date.now())&&(this.refreshToken||this.token)){const e=t.portalUrl.replace(/^http:/i,"https:")+"/sharing/rest/oauth2/revokeToken";(0,o.A)(e,{authMode:"anonymous",keepAlive:!0,method:"post",query:{f:"json",auth_token:this.refreshToken||this.token,client_id:t.appId,token_type_hint:this.refreshToken?"refresh_token":"access_token"}})}if(t?.authNamespace&&t.portalUrl&&this.storage){const r=e[t.authNamespace];if(r){delete r[t.portalUrl];try{this.storage.setItem(We,JSON.stringify(e))}catch(e){console.log(e)}}}t&&(t._oAuthCred=null,this.oAuthInfo=null)}_init(){const e=this._load(),t=this.oAuthInfo;if(t?.authNamespace&&t.portalUrl){let r=e[t.authNamespace];r&&(r=r[t.portalUrl],r&&(this.appId=r.appId,this.codeVerifier=r.codeVerifier,this.expires=r.expires,this.refreshToken=r.refreshToken,this.ssl=r.ssl,this.stateUID=r.stateUID,this.token=r.token,this.userId=r.userId))}}_load(){let e={};if(this.storage){const t=this.storage.getItem(We);if(t)try{e=JSON.parse(t)}catch(e){console.warn(e)}}return e}}Je.prototype.declaredClass="esri.identity.OAuthCredential";var Ge,Xe=r(25482);let Ye=class extends Xe.o{static{Ge=this}constructor(e){super(e),this._oAuthCred=null,this.appId=null,this.authNamespace="/",this.expiration=20160,this.flowType="auto",this.forceLogin=!1,this.forceUserId=!1,this.locale=null,this.minTimeUntilExpiration=30,this.popup=!1,this.popupCallbackUrl="oauth-callback.html",this.popupWindowFeatures="height=490,width=800,resizable,scrollbars,status",this.portalUrl="https://www.arcgis.com",this.preserveUrlHash=!1,this.userId=null}clone(){return Ge.fromJSON(this.toJSON())}};(0,i.Cg)([(0,f.MZ)({json:{write:!0}})],Ye.prototype,"appId",void 0),(0,i.Cg)([(0,f.MZ)({json:{write:!0}})],Ye.prototype,"authNamespace",void 0),(0,i.Cg)([(0,f.MZ)({json:{write:!0}})],Ye.prototype,"expiration",void 0),(0,i.Cg)([(0,f.MZ)({json:{write:!0}})],Ye.prototype,"flowType",void 0),(0,i.Cg)([(0,f.MZ)({json:{write:!0}})],Ye.prototype,"forceLogin",void 0),(0,i.Cg)([(0,f.MZ)({json:{write:!0}})],Ye.prototype,"forceUserId",void 0),(0,i.Cg)([(0,f.MZ)({json:{write:!0}})],Ye.prototype,"locale",void 0),(0,i.Cg)([(0,f.MZ)({json:{write:!0}})],Ye.prototype,"minTimeUntilExpiration",void 0),(0,i.Cg)([(0,f.MZ)({json:{write:!0}})],Ye.prototype,"popup",void 0),(0,i.Cg)([(0,f.MZ)({json:{write:!0}})],Ye.prototype,"popupCallbackUrl",void 0),(0,i.Cg)([(0,f.MZ)({json:{write:!0}})],Ye.prototype,"popupWindowFeatures",void 0),(0,i.Cg)([(0,f.MZ)({json:{write:!0}})],Ye.prototype,"portalUrl",void 0),(0,i.Cg)([(0,f.MZ)({json:{write:!0}})],Ye.prototype,"preserveUrlHash",void 0),(0,i.Cg)([(0,f.MZ)({json:{write:!0}})],Ye.prototype,"userId",void 0),Ye=Ge=(0,i.Cg)([(0,m.$)("esri.identity.OAuthInfo")],Ye);const Ke=Ye;let Qe=class extends Xe.o{constructor(e){super(e),this.adminTokenServiceUrl=null,this.currentVersion=null,this.hasPortal=null,this.hasServer=null,this.owningSystemUrl=null,this.owningTenant=null,this.server=null,this.shortLivedTokenValidity=null,this.tokenServiceUrl=null,this.webTierAuth=null}};(0,i.Cg)([(0,f.MZ)({json:{write:!0}})],Qe.prototype,"adminTokenServiceUrl",void 0),(0,i.Cg)([(0,f.MZ)({json:{write:!0}})],Qe.prototype,"currentVersion",void 0),(0,i.Cg)([(0,f.MZ)({json:{write:!0}})],Qe.prototype,"hasPortal",void 0),(0,i.Cg)([(0,f.MZ)({json:{write:!0}})],Qe.prototype,"hasServer",void 0),(0,i.Cg)([(0,f.MZ)({json:{write:!0}})],Qe.prototype,"owningSystemUrl",void 0),(0,i.Cg)([(0,f.MZ)({json:{write:!0}})],Qe.prototype,"owningTenant",void 0),(0,i.Cg)([(0,f.MZ)({json:{write:!0}})],Qe.prototype,"server",void 0),(0,i.Cg)([(0,f.MZ)({json:{write:!0}})],Qe.prototype,"shortLivedTokenValidity",void 0),(0,i.Cg)([(0,f.MZ)({json:{write:!0}})],Qe.prototype,"tokenServiceUrl",void 0),(0,i.Cg)([(0,f.MZ)({json:{write:!0}})],Qe.prototype,"webTierAuth",void 0),Qe=(0,i.Cg)([(0,m.$)("esri.identity.ServerInfo")],Qe);const et=Qe;var tt=r(39131);const rt={},st=e=>{const t=new p.s0(e.owningSystemUrl).host,r=new p.s0(e.server).host,s=/.+\.arcgis\.com$/i;return s.test(t)&&s.test(r)},it=(e,t)=>!!(st(e)&&t&&t.some(t=>t.test(e.server)));let nt=null,ot=null;try{nt=window.localStorage,ot=window.sessionStorage}catch{}class at extends l.a${constructor(){super(),this._portalConfig=globalThis.esriGeowConfig,this.serverInfos=[],this.oAuthInfos=[],this.credentials=[],this._soReqs=[],this._xoReqs=[],this._portals=[],this._defaultOAuthInfo=null,this._defaultTokenValidity=60,this.dialog=null,this.tokenValidity=null,this.normalizeWebTierAuth=!1,this._appOrigin="null"!==window.origin?window.origin:window.location.origin,this._appUrlObj=(0,p.An)(window.location.href),this._busy=null,this._rejectOnPersistedPageShow=!1,this._oAuthLocationParams=null,this._gwTokenUrl="/sharing/rest/generateToken",this._agsRest="/rest/services",this._agsPortal=/\/sharing(\/|$)/i,this._agsAdmin=/(https?:\/\/[^/]+\/[^/]+)\/admin\/?(\/.*)?$/i,this._adminSvcs=/\/rest\/admin\/services(\/|$)/i,this._gwDomains=[{regex:/^https?:\/\/www\.arcgis\.com/i,customBaseUrl:"maps.arcgis.com",tokenServiceUrl:"https://www.arcgis.com/sharing/rest/generateToken"},{regex:/^https?:\/\/(?:dev|[a-z\d-]+\.mapsdev)\.arcgis\.com/i,customBaseUrl:"mapsdev.arcgis.com",tokenServiceUrl:"https://dev.arcgis.com/sharing/rest/generateToken"},{regex:/^https?:\/\/(?:devext|[a-z\d-]+\.mapsdevext)\.arcgis\.com/i,customBaseUrl:"mapsdevext.arcgis.com",tokenServiceUrl:"https://devext.arcgis.com/sharing/rest/generateToken"},{regex:/^https?:\/\/(?:qaext|[a-z\d-]+\.mapsqa)\.arcgis\.com/i,customBaseUrl:"mapsqa.arcgis.com",tokenServiceUrl:"https://qaext.arcgis.com/sharing/rest/generateToken"},{regex:/^https?:\/\/[a-z\d-]+\.maps\.arcgis\.com/i,customBaseUrl:"maps.arcgis.com",tokenServiceUrl:"https://www.arcgis.com/sharing/rest/generateToken"}],this._legacyFed=[],this._regexSDirUrl=/http.+\/rest\/services\/?/gi,this._regexServerType=/(\/(FeatureServer|GPServer|GeoDataServer|GeocodeServer|GeoenrichmentServer|GeometryServer|GlobeServer|ImageServer|KnowledgeGraphServer|MapServer|MissionServer|MobileServer|NAServer|NetworkDiagramServer|OGCFeatureServer|ParcelFabricServer|RelationalCatalogServer|SceneServer|StreamServer|UtilityNetworkServer|ValidationServer|VectorTileServer|VersionManagementServer|VideoServer)).*/gi,this._gwUser=/http.+\/users\/([^/]+).*/i,this._gwItem=/http.+\/items\/([^/]+).*/i,this._gwGroup=/http.+\/groups\/([^/]+).*/i,this._rePortalTokenSvc=/\/sharing(\/rest)?\/generatetoken/i,this._createDefaultOAuthInfo=!0,this._hasTestedIfAppIsOnPortal=!1,this._getPlatformSelfError=null,this._getOAuthLocationParams(),window.addEventListener("pageshow",e=>{this._pageShowHandler(e)})}registerServers(e){const t=this.serverInfos;t?(e=e.filter(e=>!this.findServerInfo(e.server)),this.serverInfos=t.concat(e)):this.serverInfos=e,e.forEach(e=>{e.owningSystemUrl&&this._portals.push(e.owningSystemUrl),e.hasPortal&&this._portals.push(e.server)})}registerOAuthInfos(e){const t=this.oAuthInfos;if(t){for(const r of e){const e=this.findOAuthInfo(r.portalUrl);e&&t.splice(t.indexOf(e),1)}this.oAuthInfos=t.concat(e)}else this.oAuthInfos=e}registerToken(e){e={...e};const t=this._sanitizeUrl(e.server),r=this._isServerRsrc(t);let s,i=this.findServerInfo(t),n=!0;i||(i=new et,i.server=this._getServerInstanceRoot(t),r?i.hasServer=!0:(i.tokenServiceUrl=this._getTokenSvcUrl(t),i.hasPortal=!0),this.registerServers([i])),s=this._findCredential(t),s?(delete e.server,Object.assign(s,e),n=!1):(s=new lt({userId:e.userId,server:i.server??void 0,token:e.token,expires:e.expires,ssl:e.ssl,scope:r?"server":"portal"}),s.resources=[t],this.credentials.push(s)),s.emitTokenChange(!1),n||s.refreshServerTokens()}toJSON(){return(0,d.oy)({serverInfos:this.serverInfos.map(e=>e.toJSON()),oAuthInfos:this.oAuthInfos.map(e=>e.toJSON()),credentials:this.credentials.map(e=>e.toJSON())})}initialize(e){if(!e)return;"string"==typeof e&&(e=JSON.parse(e));const t=e.serverInfos,r=e.oAuthInfos,s=e.credentials;if(t){const e=[];t.forEach(t=>{t.server&&t.tokenServiceUrl&&e.push(t.declaredClass?t:new et(t))}),e.length&&this.registerServers(e)}if(r){const e=[];r.forEach(t=>{t.appId&&e.push(t.declaredClass?t:new Ke(t))}),e.length&&this.registerOAuthInfos(e)}s&&s.forEach(e=>{e.server&&e.token&&e.expires&&e.expires>Date.now()&&((e=e.declaredClass?e:new lt(e)).emitTokenChange(),this.credentials.push(e))})}findServerInfo(e){let t;e=this._sanitizeUrl(e);for(const r of this.serverInfos)if(this._hasSameServerInstance(r.server,e)){t=r;break}return t}findOAuthInfo(e){let t;e=this._sanitizeUrl(e);for(const r of this.oAuthInfos)if(this._hasSameServerInstance(r.portalUrl,e)){t=r;break}return t}findCredential(e,t){if(!e)return;let r;e=this._sanitizeUrl(e);const s=this._isServerRsrc(e)?"server":"portal";if(t){for(const i of this.credentials)if(this._hasSameServerInstance(i.server,e)&&t===i.userId&&i.scope===s){r=i;break}}else for(const t of this.credentials)if(this._hasSameServerInstance(t.server,e)&&-1!==this._getIdenticalSvcIdx(e,t)&&t.scope===s){r=t;break}return r}getCredential(e,t){let r,s=!1,i=!0;t&&(s=!(!t.token&&!t.credential),r=t.error,i=!1!==t.prompt),t={...t},e=this._sanitizeUrl(e);const n=new AbortController,o=(0,u.Tw)();if(t.signal&&(0,u.u7)(t.signal,()=>{n.abort()}),(0,u.u7)(n,()=>{o.reject(new a.A("identity-manager:user-aborted","ABORTED"))}),(0,u.G4)(n))return o.promise;t.signal=n.signal;const l=this._isAdminResource(e),h=s?this.findCredential(e):null;let d;if(h&&498===r?.details?.httpStatus)h.destroy();else if(h)return d=new a.A("identity-manager:not-authorized","You are currently signed in as: '"+h.userId+"'. You do not have access to this resource: "+e,{error:r}),o.reject(d),o.promise;const c=this._findCredential(e,t);if(c)return o.resolve(c),o.promise;let f=this.findServerInfo(e);if(f)!f.hasPortal&&f.server&&f.owningSystemUrl&&this._hasSameServerInstance(f.server,f.owningSystemUrl)&&(f.hasPortal=!0),!f.hasServer&&this._isServerRsrc(e)&&(f._restInfoPms=this._getTokenSvcUrl(e),f.hasServer=!0);else{const t=this._getTokenSvcUrl(e);if(!t)return d=new a.A("identity-manager:unknown-resource","Unknown resource - could not find token service endpoint."),o.reject(d),o.promise;f=new et,f.server=this._getServerInstanceRoot(e),"string"==typeof t?(f.tokenServiceUrl=t,f.hasPortal=!0):(f._restInfoPms=t,f.hasServer=!0),this.registerServers([f])}return f.hasPortal&&void 0===f._selfReq&&(i||(0,p.FX)(f.tokenServiceUrl,this._appOrigin)||this._gwDomains.some(e=>e.tokenServiceUrl===f.tokenServiceUrl))&&(f._selfReq={owningTenant:t?.owningTenant,selfDfd:this._getPortalSelf(f.tokenServiceUrl.replace(this._rePortalTokenSvc,"/sharing/rest/portals/self"),e)}),this._enqueue(e,f,t,o,l)}getResourceName(e){return this._isRESTService(e)?e.replace(this._regexSDirUrl,"").replace(this._regexServerType,"")||"":this._gwUser.test(e)&&e.replace(this._gwUser,"$1")||this._gwItem.test(e)&&e.replace(this._gwItem,"$1")||this._gwGroup.test(e)&&e.replace(this._gwGroup,"$1")||""}generateToken(e,t,r){const s=this._rePortalTokenSvc.test(e.tokenServiceUrl),i=new p.s0(this._appOrigin),n=e.shortLivedTokenValidity;let l,h,d,c,u,f,g,m;t&&(m=this.tokenValidity||n||this._defaultTokenValidity,m>n&&n>0&&(m=n)),r&&(l=r.isAdmin,h=r.serverUrl,d=r.token,f=r.signal,g=r.ssl,e.customParameters=r.customParameters),l?c=e.adminTokenServiceUrl:(c=e.tokenServiceUrl,u=new p.s0(c.toLowerCase()),e.webTierAuth&&r?.serverUrl&&!g&&"http"===i.scheme&&((0,p.FX)(i.uri,c,!0)||"https"===u.scheme&&i.host===u.host&&"7080"===i.port&&"7443"===u.port)&&(c=c.replace(/^https:/i,"http:").replace(/:7443/i,":7080")));const v={query:{request:"getToken",username:t?.username,password:t?.password,serverUrl:h,token:d,expiration:m,referer:l||s?this._appOrigin:null,client:l?"referer":null,f:"json",...e.customParameters},method:"post",authMode:"anonymous",useProxy:this._useProxy(e,r),signal:f,...r?.ioArgs};return s||(v.withCredentials=!1),(0,o.A)(c,v).then(r=>{const s=r.data;if(!s?.token)return new a.A("identity-manager:authentication-failed","Unable to generate token");const i=e.server;return rt[i]||(rt[i]={}),t&&(rt[i][t.username]=t.password),s.validity=m,s})}isBusy(){return!!this._busy}async checkSignInStatus(e){return(await this.checkAppAccess(e,"")).credential}checkAppAccess(e,t,r){let s=!1;return this.getCredential(e,{prompt:!1}).then(i=>{let n;const l={f:"json"};if("portal"===i.scope)if(t&&(this._doPortalSignIn(e)||r?.force))n=i.server+"/sharing/rest/oauth2/validateAppAccess",l.client_id=t;else{if(!i.token)return{credential:i};n=i.server+"/sharing/rest"}else{if(!i.token)return{credential:i};n=i.server+"/rest/services"}return i.token&&(l.token=i.token),(0,o.A)(n,{query:l,authMode:"anonymous"}).then(e=>{if(!1===e.data.valid)throw new a.A("identity-manager:not-authorized",`You are currently signed in as: '${i.userId}'.`,e.data);return s=!!e.data.viewOnlyUserTypeApp,{credential:i}}).catch(e=>{if("identity-manager:not-authorized"===e.name)throw e;const t=e.details?.httpStatus;if(498===t)throw i.destroy(),new a.A("identity-manager:not-authenticated","User is not signed in.");if(400===t)throw new a.A("identity-manager:invalid-request","Bad request");return{credential:i}})}).then(e=>({credential:e.credential,viewOnly:s}))}setOAuthResponseHash(e){e&&(e.startsWith("#")&&(e=e.slice(1)),this._processOAuthPopupParams((0,p.zf)(e)))}setOAuthRedirectionHandler(e){this._oAuthRedirectFunc=e}setProtocolErrorHandler(e){this._protocolFunc=e}signIn(e,t,r={}){const s=(0,u.Tw)(),i=()=>{l?.remove(),h?.remove(),this.dialog?.destroy(),this.dialog=l=h=null},n=()=>{i(),this._oAuthDfd=null,s.reject(new a.A("identity-manager:user-aborted","ABORTED"))};r.signal&&(0,u.u7)(r.signal,()=>{n()});const o=new ze({open:!0,resource:this.getResourceName(e),server:t.server});this.dialog=o,this.emit("dialog-create");let l=o.on("cancel",n),h=o.on("submit",e=>{this.generateToken(t,e,{isAdmin:r.isAdmin,signal:r.signal}).then(n=>{i();const o=new lt({userId:e.username,server:t.server??void 0,token:n.token,expires:null!=n.expires?Number(n.expires):null,ssl:!!n.ssl,isAdmin:r.isAdmin,validity:n.validity});s.resolve(o)}).catch(e=>{o.error=e,o.signingIn=!1})});return s.promise}oAuthSignIn(e,t,r,s){this._oAuthDfd=(0,u.Tw)();const i=this._oAuthDfd;let n;s?.signal&&(0,u.u7)(s.signal,()=>{const e=this._oAuthDfd&&this._oAuthDfd.oAuthWin_;e&&!e.closed?e.close():this.dialog&&d()}),i.resUrl_=e,i.sinfo_=t,i.oinfo_=r;const o=r._oAuthCred;if(o.storage&&("authorization-code"===r.flowType||"auto"===r.flowType&&t.currentVersion>=8.4)){let e=crypto.getRandomValues(new Uint8Array(32));n=(0,p.$1)(e),o.codeVerifier=n,e=crypto.getRandomValues(new Uint8Array(32)),o.stateUID=(0,p.$1)(e),o.save()||(o.codeVerifier=n=null)}else o.codeVerifier=null;let l,h;this._getCodeChallenge(n).then(i=>{const n=!s||!1!==s.oAuthPopupConfirmation;if(!r.popup||!n)return void this._doOAuthSignIn(e,t,r,i);const o=new ze({oAuthPrompt:!0,server:t.server,open:!0});this.dialog=o,this.emit("dialog-create"),l=o.on("cancel",d),h=o.on("submit",()=>{c(),this._doOAuthSignIn(e,t,r,i)})});const d=()=>{c(),this._oAuthDfd=null,i.reject(new a.A("identity-manager:user-aborted","ABORTED"))},c=()=>{l?.remove(),h?.remove(),this.dialog?.destroy(),this.dialog=null};return i.promise}destroyCredentials(){this.credentials&&this.credentials.slice().forEach(e=>{e.destroy()}),this.emit("credentials-destroy")}enablePostMessageAuth(e="https://www.arcgis.com/sharing/rest"){this._postMessageAuthHandle&&this._postMessageAuthHandle.remove(),this._postMessageAuthHandle=(0,h.on)(window,"message",t=>{if((t.origin===this._appOrigin||t.origin.endsWith(".arcgis.com"))&&"arcgis:auth:requestCredential"===t.data?.type){const r=t.source;this.getCredential(e).then(e=>{r.postMessage({type:"arcgis:auth:credential",credential:{expires:e.expires,server:e.server,ssl:e.ssl,token:e.token,userId:e.userId}},t.origin)}).catch(e=>{r.postMessage({type:"arcgis:auth:error",error:{name:e.name,message:e.message}},t.origin)})}})}disablePostMessageAuth(){this._postMessageAuthHandle&&(this._postMessageAuthHandle.remove(),this._postMessageAuthHandle=null)}_getOAuthLocationParams(){let e=window.location.hash;if(e){e.startsWith("#")&&(e=e.slice(1));const t=(0,p.zf)(e);let r=!1;if(t.access_token&&t.expires_in&&t.state&&t.hasOwnProperty("username"))try{t.state=JSON.parse(t.state),t.state.portalUrl&&(this._oAuthLocationParams=t,r=!0)}catch{}else if(t.error&&t.error_description&&(console.log("IdentityManager OAuth Error: ",t.error," - ",t.error_description),"access_denied"===t.error&&(r=!0,t.state)))try{t.state=JSON.parse(t.state)}catch{}r&&(window.location.hash=t.state?.hash||"")}let t=window.location.search;if(t){t.startsWith("?")&&(t=t.slice(1));const e=(0,p.zf)(t);let r=!1;if(e.code&&e.state)try{e.state=JSON.parse(e.state),e.state.portalUrl&&e.state.uid&&(this._oAuthLocationParams=e,r=!0)}catch{}else if(e.error&&e.error_description&&(console.log("IdentityManager OAuth Error: ",e.error," - ",e.error_description),"access_denied"===e.error&&(r=!0,e.state)))try{e.state=JSON.parse(e.state)}catch{}if(r){const t={...e};["code","error","error_description","message_code","persist","state"].forEach(e=>{delete t[e]});const r=(0,p.x0)(t),s=window.location.pathname+(r?`?${r}`:"")+(e.state?.hash||"");window.history.replaceState(window.history.state,"",s)}}}_getOAuthToken(e,t,r,s,i){return e=e.replace(/^http:/i,"https:"),(0,o.A)(`${e}/sharing/rest/oauth2/token`,{authMode:"anonymous",method:"post",query:s&&i?{grant_type:"authorization_code",code:t,redirect_uri:s,client_id:r,code_verifier:i}:{grant_type:"refresh_token",refresh_token:t,client_id:r}}).then(e=>e.data)}async _getCodeChallenge(e){if(e&&globalThis.isSecureContext){const t=(new TextEncoder).encode(e),r=await crypto.subtle.digest("SHA-256",t);return(0,p.$1)(new Uint8Array(r))}return null}_pageShowHandler(e){if(e.persisted&&this.isBusy()&&this._rejectOnPersistedPageShow){const e=new a.A("identity-manager:user-aborted","ABORTED");this._errbackFunc(e)}}_findCredential(e,t){let r,s,i,n,o=-1;const a=t?.token,l=t?.resource,h=this._isServerRsrc(e)?"server":"portal",d=this.credentials.filter(t=>this._hasSameServerInstance(t.server,e)&&t.scope===h);if(e=l||e,d.length)if(1===d.length){if(r=d[0],i=this.findServerInfo(r.server),s=i?.owningSystemUrl,n=s?this.findCredential(s,r.userId):void 0,o=this._getIdenticalSvcIdx(e,r),!a)return-1===o&&r.resources.push(e),this._addResource(e,n),r;-1!==o&&(r.resources.splice(o,1),this._removeResource(e,n))}else{let t,r;if(d.some(a=>(r=this._getIdenticalSvcIdx(e,a),-1!==r&&(t=a,i=this.findServerInfo(t.server),s=i?.owningSystemUrl,n=s?this.findCredential(s,t.userId):void 0,o=r,!0))),a)t&&(t.resources.splice(o,1),this._removeResource(e,n));else if(t)return this._addResource(e,n),t}}_findOAuthInfo(e){let t=this.findOAuthInfo(e);if(!t)for(const r of this.oAuthInfos)if(this._isIdProvider(r.portalUrl,e)){t=r;break}return t}_addResource(e,t){t&&-1===this._getIdenticalSvcIdx(e,t)&&t.resources.push(e)}_removeResource(e,t){let r=-1;t&&(r=this._getIdenticalSvcIdx(e,t),r>-1&&t.resources.splice(r,1))}_useProxy(e,t){return t?.isAdmin&&!(0,p.FX)(e.adminTokenServiceUrl,this._appOrigin)||!this._isPortalDomain(e.tokenServiceUrl)&&"10.1"===String(e.currentVersion)&&!(0,p.FX)(e.tokenServiceUrl,this._appOrigin)}_getOrigin(e){const t=new p.s0(e);return t.scheme+"://"+t.host+(null!=t.port?":"+t.port:"")}_getServerInstanceRoot(e){const t=e.toLowerCase();let r=t.indexOf(this._agsRest);return-1===r&&this._isAdminResource(e)&&(r=this._agsAdmin.test(e)?e.replace(this._agsAdmin,"$1").length:e.search(this._adminSvcs)),-1!==r||(0,tt.$E)(t)||(r=t.indexOf("/sharing")),-1===r&&t.endsWith("/")&&(r=t.length-1),r>-1?e.slice(0,r):e}_hasSameServerInstance(e,t){return e.endsWith("/")&&(e=e.slice(0,-1)),e=e.toLowerCase(),t=this._getServerInstanceRoot(t).toLowerCase(),e=(0,tt.qG)(e),t=(0,tt.qG)(t),(e=e.slice(Math.max(0,e.indexOf(":"))))===t.slice(Math.max(0,t.indexOf(":")))}_sanitizeUrl(e){const t=(n.A.request.proxyUrl||"").toLowerCase(),r=t?e.toLowerCase().indexOf(t+"?"):-1;return-1!==r&&(e=e.slice(r+t.length+1)),e=(0,p.S8)(e),(0,p.An)(e).path}_isRESTService(e){return e.includes(this._agsRest)}_isAdminResource(e){return this._agsAdmin.test(e)||this._adminSvcs.test(e)}_isServerRsrc(e){return this._isRESTService(e)||this._isAdminResource(e)}_isIdenticalService(e,t){let r=!1;if(this._isRESTService(e)&&this._isRESTService(t)){const s=this._getSuffix(e).toLowerCase(),i=this._getSuffix(t).toLowerCase();if(r=s===i,!r){const e=/(.*)\/(MapServer|FeatureServer|UtilityNetworkServer).*/gi;r=s.replaceAll(e,"$1")===i.replaceAll(e,"$1")}}else this._isAdminResource(e)&&this._isAdminResource(t)?r=!0:this._isServerRsrc(e)||this._isServerRsrc(t)||!this._isPortalDomain(e)||(r=!0);return r}_isPortalDomain(e){const t=new p.s0(e.toLowerCase()),r=this._portalConfig;let s=this._gwDomains.some(e=>e.regex.test(t.uri));return!s&&r&&(s=this._hasSameServerInstance(this._getServerInstanceRoot(r.restBaseUrl),t.uri)),s||n.A.portalUrl&&(s=(0,p.FX)(t,n.A.portalUrl,!0)),s||(s=this._portals.some(e=>this._hasSameServerInstance(e,t.uri))),s=s||this._agsPortal.test(t.path),s}_isIdProvider(e,t){let r=-1,s=-1;this._gwDomains.forEach((i,n)=>{-1===r&&i.regex.test(e)&&(r=n),-1===s&&i.regex.test(t)&&(s=n)});let i=!1;if(r>-1&&s>-1&&(0===r||4===r?0!==s&&4!==s||(i=!0):1===r?1!==s&&2!==s||(i=!0):2===r?2===s&&(i=!0):3===r&&3===s&&(i=!0)),!i){const r=this.findServerInfo(t),s=r?.owningSystemUrl;s&&st(r)&&this._isPortalDomain(s)&&this._isIdProvider(e,s)&&(i=!0)}return i}_getIdenticalSvcIdx(e,t){let r=-1;for(let s=0;s<t.resources.length;s++){const i=t.resources[s];if(this._isIdenticalService(e,i)){r=s;break}}return r}_getSuffix(e){return e.replace(this._regexSDirUrl,"").replace(this._regexServerType,"$1")}_getTokenSvcUrl(e){let t,r,s;if(this._isRESTService(e)||this._isAdminResource(e)){const s=this._getServerInstanceRoot(e);return t=s+"/admin/generateToken",r=(0,o.A)(e=s+"/rest/info",{query:{f:"json"}}).then(e=>e.data),{adminUrl:t,promise:r}}if(this._isPortalDomain(e)){let t="";if(this._gwDomains.some(r=>(r.regex.test(e)&&(t=r.tokenServiceUrl),!!t)),t||this._portals.some(r=>(this._hasSameServerInstance(r,e)&&(t=r+this._gwTokenUrl),!!t)),t||(s=e.toLowerCase().indexOf("/sharing"),-1!==s&&(t=e.slice(0,s)+this._gwTokenUrl)),t||(t=this._getOrigin(e)+this._gwTokenUrl),t){const r=new p.s0(e).port;/^http:\/\//i.test(e)&&"7080"===r&&(t=t.replace(/:7080/i,":7443")),t=t.replace(/http:/i,"https:")}return t}}_processOAuthResponseParams(e,t,r){const s=t._oAuthCred;if(e.code){const i=s.codeVerifier;return s.codeVerifier=null,s.stateUID=null,s.save(),this._getOAuthToken(r.server,e.code,t.appId,this._getRedirectURI(t,!0),i).then(i=>{const n=new lt({userId:i.username,server:r.server??void 0,token:i.access_token,expires:Date.now()+1e3*i.expires_in,ssl:i.ssl,oAuthState:e.state,_oAuthCred:s});return t.userId=n.userId,s.storage=i.persist?nt:ot,s.refreshToken=i.refresh_token,s.token=null,s.expires=i.refresh_token_expires_in?Date.now()+1e3*i.refresh_token_expires_in:null,s.userId=n.userId,s.ssl=n.ssl,s.save(),n})}const i=new lt({userId:e.username,server:r.server??void 0,token:e.access_token,expires:Date.now()+1e3*Number(e.expires_in),ssl:"true"===e.ssl,oAuthState:e.state,_oAuthCred:s});return t.userId=i.userId,s.storage=e.persist?nt:ot,s.refreshToken=null,s.token=i.token,s.expires=i.expires,s.userId=i.userId,s.ssl=i.ssl,s.save(),Promise.resolve(i)}_processOAuthPopupParams(e){const t=this._oAuthDfd;if(this._oAuthDfd=null,t)if(clearInterval(this._oAuthIntervalId),this._oAuthOnPopupHandle?.remove(),e.error){const r="access_denied"===e.error,s=new a.A(r?"identity-manager:user-aborted":"identity-manager:authentication-failed",r?"ABORTED":"OAuth: "+e.error+" - "+e.error_description);t.reject(s)}else this._processOAuthResponseParams(e,t.oinfo_,t.sinfo_).then(e=>{t.resolve(e)}).catch(e=>{t.reject(e)})}_setOAuthResponseQueryString(e){e&&(e.startsWith("?")&&(e=e.slice(1)),this._processOAuthPopupParams((0,p.zf)(e)))}async _exchangeToken(e,t,r){return(await(0,o.A)(`${e}/sharing/rest/oauth2/exchangeToken`,{authMode:"anonymous",method:"post",query:{f:"json",client_id:t,token:r}})).data.token}async _getPlatformSelf(e,t){if(this._getPlatformSelfError&&Date.now()-this._getPlatformSelfError[1]<1e3)throw this._getPlatformSelfError[0];e=e.replace(/^http:/i,"https:");try{const r=await(0,o.A)(`${e}/sharing/rest/oauth2/platformSelf`,{authMode:"anonymous",headers:{"X-Esri-Auth-Client-Id":t,"X-Esri-Auth-Redirect-Uri":window.location.href.replace(/#.*$/,"")},method:"post",query:{f:"json",expiration:30},withCredentials:!0});return this._getPlatformSelfError=null,r.data}catch(e){throw"OAUTH_0066"===e.details?.messageCode&&(this._getPlatformSelfError=[e,Date.now()]),e}}_getPortalSelf(e,t){let r;return this._gwDomains.some(t=>(t.regex.test(e)&&(r=t.customBaseUrl),!!r)),r?Promise.resolve({allSSL:!0,currentVersion:"8.4",customBaseUrl:r,portalMode:"multitenant",supportsOAuth:!0}):(this._appOrigin.startsWith("https:")?e=e.replace(/^http:/i,"https:").replace(/:7080/i,":7443"):/^http:/i.test(t)&&(e=e.replace(/^https:/i,"http:").replace(/:7443/i,":7080")),(0,o.A)(e,{query:{f:"json"},authMode:"anonymous",withCredentials:!0}).then(e=>e.data))}_doPortalSignIn(e){const t=this._portalConfig,r=window.location.href,s=this.findServerInfo(e);return!(!t&&!this._isPortalDomain(r)||!(s?s.hasPortal||s.owningSystemUrl&&this._isPortalDomain(s.owningSystemUrl):this._isPortalDomain(e))||!(this._isIdProvider(r,e)||t&&(this._hasSameServerInstance(this._getServerInstanceRoot(t.restBaseUrl),e)||this._isIdProvider(t.restBaseUrl,e))||(0,p.FX)(r,e,!0)))}_checkProtocol(e,t,r,s){let i=!0;const n=s?t.adminTokenServiceUrl:t.tokenServiceUrl;return n.trim().toLowerCase().startsWith("https:")&&!this._appOrigin.startsWith("https:")&&(0,p.zs)(n)&&(i=!!this._protocolFunc&&!!this._protocolFunc({resourceUrl:e,serverInfo:t}),!i)&&r(new a.A("identity-manager:aborted","Aborted the Sign-In process to avoid sending password over insecure connection.")),i}_enqueue(e,t,r,s,i,n){return s||(s=(0,u.Tw)()),s.resUrl_=e,s.sinfo_=t,s.options_=r,s.admin_=i,s.refresh_=n,this._busy?this._hasSameServerInstance(this._getServerInstanceRoot(e),this._busy.resUrl_)?(this._oAuthDfd&&this._oAuthDfd.oAuthWin_&&this._oAuthDfd.oAuthWin_.focus(),this._soReqs.push(s)):this._xoReqs.push(s):this._doSignIn(s),s.promise}_doSignIn(e){this._busy=e,this._rejectOnPersistedPageShow=!1;const t=t=>{const r=e.options_?.resource,s=e.resUrl_,i=e.refresh_;let n=!1;this.credentials.includes(t)||(i&&this.credentials.includes(i)?(i.userId=t.userId,i.token=t.token,i.expires=t.expires,i.validity=t.validity,i.ssl=t.ssl,i.creationTime=t.creationTime,n=!0,t=i):this.credentials.push(t)),t.resources||(t.resources=[]),t.resources.includes(r||s)||t.resources.push(r||s),t.scope=this._isServerRsrc(s)?"server":"portal",t.emitTokenChange();const o=this._soReqs,a={};this._soReqs=[],o.forEach(e=>{if(!this._isIdenticalService(s,e.resUrl_)){const r=this._getSuffix(e.resUrl_);a[r]||(a[r]=!0,t.resources.push(e.resUrl_))}}),e.resolve(t),o.forEach(e=>{this._hasSameServerInstance(this._getServerInstanceRoot(s),e.resUrl_)?e.resolve(t):this._soReqs.push(e)}),this._busy=e.resUrl_=e.sinfo_=e.refresh_=null,n||this.emit("credential-create",{credential:t}),this._soReqs.length?this._doSignIn(this._soReqs.shift()):this._xoReqs.length&&this._doSignIn(this._xoReqs.shift())},r=t=>{e.reject(t),this._busy=e.resUrl_=e.sinfo_=e.refresh_=null,this._soReqs.length?this._doSignIn(this._soReqs.shift()):this._xoReqs.length&&this._doSignIn(this._xoReqs.shift())},s=(i,n,o,l)=>{const d=e.sinfo_,c=!e.options_||!1!==e.options_.prompt,f=d.hasPortal&&this._findOAuthInfo(e.resUrl_);let g,m;if(i)t(new lt({userId:i,server:d.server??void 0,token:o??void 0,expires:null!=l?Number(l):null,ssl:!!n}));else if(window!==window.parent&&this._appUrlObj.query?.["arcgis-auth-origin"]&&this._appUrlObj.query?.["arcgis-auth-portal"]&&this._hasSameServerInstance(this._getServerInstanceRoot(this._appUrlObj.query["arcgis-auth-portal"]),e.resUrl_)){window.parent.postMessage({type:"arcgis:auth:requestCredential"},this._appUrlObj.query["arcgis-auth-origin"]);const s=(0,h.on)(window,"message",e=>{e.source===window.parent&&e.data&&("arcgis:auth:credential"===e.data.type?(s.remove(),e.data.credential.expires<Date.now()?r(new a.A("identity-manager:credential-request-failed","Parent application's token has expired.")):t(new lt(e.data.credential))):"arcgis:auth:error"===e.data.type&&(s.remove(),"tokenExpiredError"===e.data.error.name?r(new a.A("identity-manager:credential-request-failed","Parent application's token has expired.")):r(a.A.fromJSON(e.data.error))))});(0,u.u7)(e.options_?.signal,()=>{s.remove()})}else if(f){let i=f._oAuthCred;if(!i){const e=new Je(f,nt),t=new Je(f,ot);e.isValid()&&t.isValid()?e.expires>t.expires?(i=e,t.destroy()):(i=t,e.destroy()):i=e.isValid()?e:t,f._oAuthCred=i}if(i.isValid()){g=new lt({userId:i.userId??void 0,server:d.server??void 0,token:i.token??void 0,expires:i.expires,ssl:i.ssl??void 0,_oAuthCred:i});const n=f.appId!==i.appId&&this._doPortalSignIn(e.resUrl_);n||i.refreshToken?(e._pendingDfd=i.refreshToken?this._getOAuthToken(d.server,i.refreshToken,i.appId).then(e=>(g.expires=Date.now()+1e3*e.expires_in,g.token=e.access_token,g)):Promise.resolve(g),e._pendingDfd.then(e=>n?this._exchangeToken(e.server,f.appId,e.token).then(t=>(e.token=t,e)).catch(()=>e):e).then(e=>{t(e)}).catch(e=>{const t=e.details?.httpStatus;t>0&&404!==t?(i.destroy(),s()):r(e)})):t(g)}else if(this._oAuthLocationParams&&this._hasSameServerInstance(f.portalUrl,this._oAuthLocationParams.state.portalUrl)&&(this._oAuthLocationParams.access_token||this._oAuthLocationParams.code&&this._oAuthLocationParams.state.uid===i.stateUID&&i.codeVerifier)){const s=this._oAuthLocationParams;this._oAuthLocationParams=null,e._pendingDfd=this._processOAuthResponseParams(s,f,d).then(e=>{t(e)}).catch(r)}else{const s=()=>{c?e._pendingDfd=this.oAuthSignIn(e.resUrl_,d,f,e.options_).then(t,r):(m=new a.A("identity-manager:not-authenticated","User is not signed in."),r(m))};this._doPortalSignIn(e.resUrl_)?e._pendingDfd=this._getPlatformSelf(d.server,f.appId).then(e=>{(0,p.FX)(e.portalUrl,this._appOrigin,!0)?(g=new lt({userId:e.username,server:d.server??void 0,expires:Date.now()+1e3*e.expires_in,token:e.token}),t(g)):s()}).catch(s):s()}}else if(c){if(this._checkProtocol(e.resUrl_,d,r,e.admin_)){let s=e.options_;e.admin_&&(s=s||{},s.isAdmin=!0),e._pendingDfd=this.signIn(e.resUrl_,d,s).then(t,r)}}else m=new a.A("identity-manager:not-authenticated","User is not signed in."),r(m)},i=()=>{const s=e.sinfo_,i=s.owningSystemUrl,n=e.options_;let o,a,l,h;if(n&&(o=n.token,a=n.error,l=n.prompt),h=this._findCredential(i,{token:o,resource:e.resUrl_}),!h)for(const e of this.credentials)if(this._isIdProvider(i,e.server)){h=e;break}if(h){const i=this.findCredential(e.resUrl_,h.userId);if(i)t(i);else if(it(s,this._legacyFed)){const e=h.toJSON();e.server=s.server,e.resources=null,t(new lt(e))}else(e._pendingDfd=this.generateToken(this.findServerInfo(h.server),null,{serverUrl:e.resUrl_,token:h.token,signal:e.options_.signal,ssl:h.ssl})).then(r=>{t(new lt({userId:h?.userId,server:s.server??void 0,token:r.token,expires:null!=r.expires?Number(r.expires):null,ssl:!!r.ssl,isAdmin:e.admin_,validity:r.validity}))},r)}else this._busy=null,o&&(e.options_.token=null),(e._pendingDfd=this.getCredential(i.replace(/\/?$/,"/sharing"),{resource:e.resUrl_,owningTenant:s.owningTenant,signal:e.options_.signal,token:o,error:a,prompt:l})).then(()=>{this._enqueue(e.resUrl_,e.sinfo_,e.options_,e,e.admin_)},t=>{e.resUrl_=e.sinfo_=e.refresh_=null,e.reject(t)})};this._errbackFunc=r;const n=e.sinfo_.owningSystemUrl,o=this._isServerRsrc(e.resUrl_),l=e.sinfo_._restInfoPms;l?l.promise.then(t=>{const r=e.sinfo_;if(r._restInfoPms){r.adminTokenServiceUrl=r._restInfoPms.adminUrl,r._restInfoPms=null,r.tokenServiceUrl=((0,c.wc)("authInfo.tokenServicesUrl",t)||(0,c.wc)("authInfo.tokenServiceUrl",t)||(0,c.wc)("tokenServiceUrl",t))??null,r.shortLivedTokenValidity=(0,c.wc)("authInfo.shortLivedTokenValidity",t)??null,r.currentVersion=t.currentVersion,r.owningTenant=t.owningTenant;const e=r.owningSystemUrl=t.owningSystemUrl;e&&this._portals.push(e)}o&&r.owningSystemUrl?i():s()},()=>{e.sinfo_._restInfoPms=null;const t=new a.A("identity-manager:server-identification-failed","Unknown resource - could not find token service endpoint.");r(t)}):o&&n?i():e.sinfo_._selfReq?e.sinfo_._selfReq.selfDfd.then(t=>{const r={};let s,i,n,o;return t&&(s=t.user?.username,r.username=s,r.allSSL=t.allSSL,i=t.supportsOAuth,o=parseFloat(t.currentVersion),"multitenant"===t.portalMode&&(n=t.customBaseUrl),e.sinfo_.currentVersion=o),e.sinfo_.webTierAuth=!!s,s&&this.normalizeWebTierAuth?this.generateToken(e.sinfo_,null,{ssl:r.allSSL}).catch(()=>null).then(e=>(r.portalToken=e?.token,r.tokenExpiration=e?.expires,r)):!s&&i&&o>=4.4&&!this._findOAuthInfo(e.resUrl_)?this._generateOAuthInfo({portalUrl:e.sinfo_.server,customBaseUrl:n,owningTenant:e.sinfo_._selfReq.owningTenant}).catch(()=>null).then(()=>r):r}).catch(()=>null).then(t=>{e.sinfo_._selfReq=null,t?s(t.username,t.allSSL,t.portalToken,t.tokenExpiration):s()}):s()}_generateOAuthInfo(e){let t,r=null,s=e.portalUrl;const i=e.customBaseUrl,n=e.owningTenant,a=!this._defaultOAuthInfo&&this._createDefaultOAuthInfo&&!this._hasTestedIfAppIsOnPortal;if(a){r=this._appUrlObj.path;const e=r.search(/\/(apps|home)\//);r=e>-1?r.slice(0,e):null}return a&&r?(this._hasTestedIfAppIsOnPortal=!0,t=(0,o.A)(r+"/sharing/rest",{query:{f:"json"}}).then(()=>{this._defaultOAuthInfo=new Ke({appId:"arcgisonline",popupCallbackUrl:r+"/home/oauth-callback.html"})})):t=Promise.resolve(),t.then(()=>{if(this._defaultOAuthInfo)return s=s.replace(/^http:/i,"https:"),(0,o.A)(s+"/sharing/rest/oauth2/validateRedirectUri",{query:{accountId:n,client_id:this._defaultOAuthInfo.appId,redirect_uri:(0,p.s2)(this._defaultOAuthInfo.popupCallbackUrl),f:"json"}}).then(e=>{if(e.data.valid){const t=this._defaultOAuthInfo.clone();e.data.urlKey&&i?t.portalUrl="https://"+e.data.urlKey.toLowerCase()+"."+i:t.portalUrl=s,t.popup=window!==window.top||!((0,p.FX)(s,this._appOrigin)||this._gwDomains.some(e=>e.regex.test(s)&&e.regex.test(this._appOrigin))),this.oAuthInfos.push(t)}})})}_doOAuthSignIn(e,t,r,s){const i=r._oAuthCred,n={portalUrl:r.portalUrl};!r.popup&&r.preserveUrlHash&&window.location.hash&&(n.hash=window.location.hash),i.stateUID&&(n.uid=i.stateUID);const o={client_id:r.appId,response_type:i.codeVerifier?"code":"token",state:JSON.stringify(n),expiration:r.expiration,locale:r.locale,redirect_uri:this._getRedirectURI(r,!!i.codeVerifier)};r.forceLogin&&(o.force_login=!0),r.forceUserId&&r.userId&&(o.prepopulatedusername=r.userId),!r.popup&&this._doPortalSignIn(e)&&(o.redirectToUserOrgUrl=!0),i.codeVerifier&&(o.code_challenge=s||i.codeVerifier,o.code_challenge_method=s?"S256":"plain");const l=r.portalUrl.replace(/^http:/i,"https:")+"/sharing/oauth2/authorize",d=l+"?"+(0,p.x0)(o);if(r.popup){const e=window.open(d,"esriJSAPIOAuth",r.popupWindowFeatures);if(e)e.focus(),this._oAuthDfd.oAuthWin_=e,this._oAuthIntervalId=setInterval(()=>{if(e.closed){clearInterval(this._oAuthIntervalId),this._oAuthOnPopupHandle.remove();const e=this._oAuthDfd;if(e){const t=new a.A("identity-manager:user-aborted","ABORTED");e.reject(t)}}},500),this._oAuthOnPopupHandle=(0,h.on)(window,["arcgis:auth:hash","arcgis:auth:location:search"],e=>{"arcgis:auth:hash"===e.type?this.setOAuthResponseHash(e.detail):this._setOAuthResponseQueryString(e.detail)});else{const e=new a.A("identity-manager:popup-blocked","ABORTED");this._oAuthDfd.reject(e)}}else this._rejectOnPersistedPageShow=!0,this._oAuthRedirectFunc?this._oAuthRedirectFunc({authorizeParams:o,authorizeUrl:l,resourceUrl:e,serverInfo:t,oAuthInfo:r}):window.location.href=d}_getRedirectURI(e,t){const r=window.location.href.replace(/#.*$/,"");if(e.popup)return(0,p.s2)(e.popupCallbackUrl);if(t){const e=(0,p.An)(r);return e.query&&["code","error","error_description","message_code","persist","state"].forEach(t=>{delete e.query[t]}),(0,p.a6)(e.path,e.query)}return r}}at.prototype.declaredClass="esri.identity.IdentityManagerBase";let lt=class extends l.nJ{constructor(e){super(e),this._oAuthCred=null,this.tokenRefreshBuffer=2,e?._oAuthCred&&(this._oAuthCred=e._oAuthCred)}initialize(){this.resources=this.resources||[],null==this.creationTime&&(this.creationTime=Date.now())}refreshToken(){const e=s.id,t=e.findServerInfo(this.server),r=t?.owningSystemUrl,i=!!r&&"server"===this.scope,n=i&&it(t,e._legacyFed),o=t.webTierAuth,a=o&&e.normalizeWebTierAuth,l=rt[this.server],h=l?.[this.userId];let d,c=this.resources&&this.resources[0],u=i?e.findServerInfo(r):null,p={username:this.userId,password:h};if(o&&!a)return;i&&!u&&e.serverInfos.some(t=>(e._isIdProvider(r,t.server)&&(u=t),!!u));const f=u?e.findCredential(u.server,this.userId):null;if(!i||f){if(!n){if(i)d={serverUrl:c,token:f?.token,ssl:f?.ssl};else if(a)p=null,d={ssl:this.ssl};else{if(!h){let r;return c&&(c=e._sanitizeUrl(c),this._enqueued=1,r=e._enqueue(c,t,null,null,this.isAdmin,this),r.then(()=>{this._enqueued=0,this.refreshServerTokens()}).catch(()=>{this._enqueued=0})),r}this.isAdmin&&(d={isAdmin:!0})}return e.generateToken(i?u:t,i?null:p,d).then(e=>{this.token=e.token,this.expires=null!=e.expires?Number(e.expires):null,this.creationTime=Date.now(),this.validity=e.validity,this.emitTokenChange(),this.refreshServerTokens()}).catch(()=>{})}f?.refreshToken()}}refreshServerTokens(){if("portal"===this.scope){const e=s.id;e.credentials.forEach(t=>{const r=e.findServerInfo(t.server),s=r?.owningSystemUrl;t!==this&&t.userId===this.userId&&s&&"server"===t.scope&&(e._hasSameServerInstance(this.server,s)||e._isIdProvider(s,this.server))&&(it(r,e._legacyFed)?(t.token=this.token,t.expires=this.expires,t.creationTime=this.creationTime,t.validity=this.validity,t.emitTokenChange()):t.refreshToken())})}}emitTokenChange(e){clearTimeout(this._refreshTimer);const t=s.id,r=this.server?t.findServerInfo(this.server):null,i=r?.owningSystemUrl,n=i?t.findServerInfo(i):null;!1===e||i&&"portal"!==this.scope&&(!n?.webTierAuth||t.normalizeWebTierAuth)||null==this.expires&&null==this.validity||this._startRefreshTimer(),this.emit("token-change")}destroy(){this.userId=this.server=this.token=this.expires=this.validity=this.resources=this.creationTime=null,this._oAuthCred&&(this._oAuthCred.destroy(),this._oAuthCred=null);const e=s.id,t=e.credentials.indexOf(this);t>-1&&e.credentials.splice(t,1),this.emitTokenChange(),this.emit("destroy")}toJSON(){const e=(0,d.oy)({userId:this.userId,server:this.server,token:this.token,expires:this.expires,validity:this.validity,ssl:this.ssl,isAdmin:this.isAdmin,creationTime:this.creationTime,scope:this.scope}),t=this.resources;return t&&t.length>0&&(e.resources=t.slice()),e}_startRefreshTimer(){clearTimeout(this._refreshTimer);const e=6e4*this.tokenRefreshBuffer,t=2**31-1;let r=(this.validity?this.creationTime+6e4*this.validity:this.expires)-Date.now();r<0?r=0:r>t&&(r=t),this._refreshTimer=setTimeout(this.refreshToken.bind(this),r>e?r-e:r)}};(0,i.Cg)([(0,f.MZ)()],lt.prototype,"creationTime",void 0),(0,i.Cg)([(0,f.MZ)()],lt.prototype,"expires",void 0),(0,i.Cg)([(0,f.MZ)()],lt.prototype,"isAdmin",void 0),(0,i.Cg)([(0,f.MZ)()],lt.prototype,"oAuthState",void 0),(0,i.Cg)([(0,f.MZ)()],lt.prototype,"resources",void 0),(0,i.Cg)([(0,f.MZ)()],lt.prototype,"scope",void 0),(0,i.Cg)([(0,f.MZ)()],lt.prototype,"server",void 0),(0,i.Cg)([(0,f.MZ)()],lt.prototype,"ssl",void 0),(0,i.Cg)([(0,f.MZ)()],lt.prototype,"token",void 0),(0,i.Cg)([(0,f.MZ)()],lt.prototype,"tokenRefreshBuffer",void 0),(0,i.Cg)([(0,f.MZ)()],lt.prototype,"userId",void 0),(0,i.Cg)([(0,f.MZ)()],lt.prototype,"validity",void 0),lt=(0,i.Cg)([(0,m.$)("esri.identity.Credential")],lt);class ht extends at{}ht.prototype.declaredClass="esri.identity.IdentityManager";const dt=new ht;(0,s.Aq)(dt)}}]);
1
+ "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[3747],{13069:(e,t,r)=>{r.d(t,{AG:()=>a,lk:()=>i,vD:()=>o,yS:()=>n});const s="randomUUID"in crypto;function i(){if(s)return crypto.randomUUID();const e=crypto.getRandomValues(new Uint16Array(8));e[3]=4095&e[3]|16384,e[4]=16383&e[4]|32768;const t=t=>e[t].toString(16).padStart(4,"0");return t(0)+t(1)+"-"+t(2)+"-"+t(3)+"-"+t(4)+"-"+t(5)+t(6)+t(7)}function n(){return`{${i().toUpperCase()}}`}function o(){return`{${i()}}`}function a(e){const t=e.toUpperCase();return e.startsWith("{")?t:`{${t}}`}},16494:(e,t,r)=>{r.d(t,{W5:()=>o});var s=r(37330);const i=["dd","dl","dt","h1","h2","h3","h4","h5","h6","sub","sup","animate","animatetransform","circle","clippath","defs","ellipse","g","image","line","lineargradient","marker","mask","path","pattern","polygon","polyline","radialgradient","rect","stop","svg","switch","symbol","text","textpath","tspan","use"].reduce((e,t)=>(e[t]=[],e),{}),n=["align","alink","alt","bgcolor","border","cellpadding","cellspacing","class","color","cols","colspan","coords","d","dir","face","height","hspace","ismap","lang","marginheight","marginwidth","multiple","nohref","noresize","noshade","nowrap","ref","rel","rev","rows","rowspan","scrolling","shape","span","summary","tabindex","title","usemap","valign","value","vlink","vspace","width"],o=new s.I({whiteList:i,onTagAttr:(e,t,r)=>{const s=`${t}="${r}"`;if(n.includes(t))return s},stripIgnoreTag:!0,stripIgnoreTagBody:["script","style"]},!0)},18047:(e,t,r)=>{r.d(t,{ZV:()=>l,yx:()=>a});var s=r(73444);const i={ar:"ar-u-nu-latn",bs:"sr-Latn-CS",nn:"no-NN"};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 r=(0,s.lR)(),o=r&&i[r]||(0,s.QC)();n.set(t,new Intl.NumberFormat(o,e))}return n.get(t)}(t).format(e)}(0,s.Ml)(()=>{n=new WeakMap,o={}}),new Map},36708:(e,t,r)=>{r.d(t,{C_:()=>u,OH:()=>g,Vh:()=>m,on:()=>c,pc:()=>v,wB:()=>l,z7:()=>h});var s=r(37955),i=r(36563),n=r(97768),o=r(74887),a=r(14012);function l(e,t,r={}){return d(e,t,r,p)}function h(e,t,r={}){return d(e,t,r,f)}function d(e,t,r={},s){let i=null;const o=r.once?(e,r)=>{s(e)&&((0,n.xt)(i),t(e,r))}:(e,r)=>{s(e)&&t(e,r)};if(i=(0,a.Cn)(e,o,r.sync,r.equals),r.initial){const t=e();o(t,t)}return i}function c(e,t,r,o={}){let a=null,h=null,d=null;function c(){a&&h&&(h.remove(),o.onListenerRemove?.(a),a=null,h=null)}function u(e){o.once&&o.once&&(0,n.xt)(d),r(e)}const p=l(e,(e,r)=>{c(),(0,s.wb)(e)&&(a=e,h=(0,s.on)(e,t,u),o.onListenerAdd?.(e))},{sync:o.sync,initial:!0});return d=(0,i.hA)(()=>{p.remove(),c()}),d}function u(e,t){return function(e,t,r){if((0,o.G4)(r))return Promise.reject((0,o.NK)());const s=e();if(t?.(s))return Promise.resolve(s);let a=null;function l(){a=(0,n.xt)(a)}return new Promise((s,n)=>{a=(0,i.vE)([(0,o.u7)(r,()=>{l(),n((0,o.NK)())}),d(e,e=>{l(),s(e)},{sync:!1,once:!0},t??p)])})}(e,f,t)}function p(e){return!0}function f(e){return!!e}r(80559);const g={sync:!0},m={initial:!0},v={sync:!0,initial:!0}},47566:(e,t,r)=>{r(97770),r(18047),r(71754),r(73444);var s=r(10838),i=r(78888),n=r(49186);async function o(e){if(null!=l.fetchBundleAsset)return l.fetchBundleAsset(e);const t=await(0,i.A)(e,{responseType:"text"});return JSON.parse(t.data)}class a{constructor({base:e="",pattern:t,location:r=new URL(window.location.href)}){let s;s="string"==typeof r?e=>new URL(e,new URL(r,window.location.href)).href:r instanceof URL?e=>new URL(e,r).href:r,this.pattern="string"==typeof t?new RegExp(`^${t}`):t,this.getAssetUrl=s,e=e?e.endsWith("/")?e:e+"/":"",this.matcher=new RegExp(`^${e}(?:(.*)\\/)?(.*)$`)}fetchMessageBundle(e,t){return async function(e,t,r,i){const a=t.exec(r);if(!a)throw new n.A("esri-intl:invalid-bundle",`Bundle id "${r}" is not compatible with the pattern "${t}"`);const l=a[1]?`${a[1]}/`:"",h=a[2],d=(0,s.xO)(i),c=`${l}${h}.json`,u=d?`${l}${h}_${d}.json`:c;let p;try{p=await o(e(u))}catch(t){if(u===c)throw new n.A("intl:unknown-bundle",`Bundle "${r}" cannot be loaded`,{error:t});try{p=await o(e(c))}catch(e){throw new n.A("intl:unknown-bundle",`Bundle "${r}" cannot be loaded`,{error:e})}}return p}(this.getAssetUrl,this.matcher,e,t)}}const l={};var h,d=r(2741);(0,s.ao)((h={pattern:"esri/",location:d.s},new a(h)))},61893:(e,t,r)=>{r.d(t,{Z:()=>d,g:()=>h});var s=r(31635),i=r(65008),n=r(36563),o=r(74887),a=r(40608);class l{constructor(){this._resolver=(0,o.Tw)(),this._status=0,this._resolvingPromises=[],this._resolver.promise.then(()=>{this._status=1,this._cleanUp()},()=>{this._status=2,this._cleanUp()}),this.promise=this._resolver.promise}destroy(){this._cleanUp()}addResolvingPromise(e){this._resolvingPromises.push(e),this._tryResolve()}isResolved(){return 1===this._status}isRejected(){return 2===this._status}isFulfilled(){return 0!==this._status}abort(){this._resolver.reject((0,o.NK)())}_cleanUp(){this._allPromise=null,this._resolvingPromises=null}_tryResolve(){if(this.isFulfilled())return;const e=(0,o.Tw)(),t=[...this._resolvingPromises,e.promise],r=this._allPromise=Promise.all(t);r.then(()=>{this.isFulfilled()||this._allPromise!==r||this._resolver.resolve()},e=>{this.isFulfilled()||this._allPromise!==r||(0,o.zf)(e)||this._resolver.reject(e)}),e.resolve()}}const h=e=>{const t=e;let r=class extends t{constructor(...e){super(...e),this._promiseProps=new l,this.addResolvingPromise(Promise.resolve())}destroy(){this._promiseProps.destroy()}isResolved(){return this._promiseProps.isResolved()}isRejected(){return this._promiseProps.isRejected()}isFulfilled(){return this._promiseProps.isFulfilled()}when(e,t){return this._promiseProps.promise.then(()=>this).then(e,t)}catch(e){return this.when(null,e)}addResolvingPromise(e){e&&!this._promiseProps.isFulfilled()&&this._promiseProps.addResolvingPromise("_promiseProps"in e?e.when():e)}addResolvingTask(e){e&&!this._promiseProps.isFulfilled()&&(this.addHandles((0,n.rE)(e)),this._promiseProps.addResolvingPromise(e.promise))}};return r=(0,s.Cg)([(0,a.$)("esri.core.Promise")],r),r},d=h(i.A)},71754:(e,t,r)=>{r.d(t,{V:()=>h});var s=r(53966),i=r(93637),n=r(799),o=r(97770),a=r(18047);const l=()=>s.A.getLogger("esri.intl.substitute");function h(e,t,r={}){const{format:s={}}=r;return(0,n.HC)(e,e=>function(e,t,r){let s,n;const o=e.indexOf(":");if(-1===o?s=e.trim():(s=e.slice(0,o).trim(),n=e.slice(o+1).trim()),!s)return"";const a=(0,i.wc)(s,t);if(null==a)return"";const l=(n?r?.[n]:null)??r?.[s];return l?d(a,l):n?c(a,n):u(a)}(e,t,s))}function d(e,t){switch(t.type){case"date":return(0,o.Yq)(e,t.intlOptions);case"number":return(0,a.ZV)(e,t.intlOptions);default:return l().warn("missing format descriptor for key {key}"),u(e)}}function c(e,t){switch(t.toLowerCase()){case"dateformat":return(0,o.Yq)(e);case"numberformat":return(0,a.ZV)(e);default:return l().warn(`inline format is unsupported since 4.12: ${t}`),/^(dateformat|datestring)/i.test(t)?(0,o.Yq)(e):/^numberformat/i.test(t)?(0,a.ZV)(e):u(e)}}function u(e){switch(typeof e){case"string":return e;case"number":return(0,a.ZV)(e);case"boolean":return""+e;default:return e instanceof Date?(0,o.Yq)(e):""}}},73747:(e,t,r)=>{r.r(t),r.d(t,{default:()=>dt});var s=r(70333),i=r(31635),n=r(92602),o=r(78888),a=r(49186),l=r(65529),h=r(37955),d=r(4718),c=r(93637),u=r(74887),p=r(84952),f=r(10107),g=(r(44208),r(53966)),m=r(40608);r(47566),r(87811);var v=r(97768),_=r(61893),y=r(36708),w=r(13069),S=r(79901),I=r(62788),A=r(71429),k=r(16494);const U="http://www.w3.org/",C=`${U}2000/svg`,P=`${U}1999/xlink`;let b=[],x=(e,t)=>{let r={};return Object.keys(e).forEach(t=>{r[t]=e[t]}),t&&Object.keys(t).forEach(e=>{r[e]=t[e]}),r},T=(e,t)=>e.vnodeSelector===t.vnodeSelector&&(e.properties&&t.properties?e.properties.key===t.properties.key&&e.properties.bind===t.properties.bind:!e.properties&&!t.properties),R=e=>{if("string"!=typeof e)throw new Error("Style values must be strings")},O=(e,t,r)=>{if(""!==t.vnodeSelector)for(let s=r;s<e.length;s++)if(T(e[s],t))return s;return-1},N=(e,t,r,s)=>{let i=e[t];if(""===i.vnodeSelector)return;let n=i.properties;if(!(n?void 0===n.key?n.bind:n.key:void 0))for(let n=0;n<e.length;n++)if(n!==t){let t=e[n];if(T(t,i))throw new Error(`${r.vnodeSelector} had a ${i.vnodeSelector} child ${"added"===s?s:"removed"}, but there is now more than one. You must add unique key properties to make them distinguishable.`)}},M=e=>{if(e.properties){let t=e.properties.enterAnimation;t&&t(e.domNode,e.properties)}},D=[],j=!1,E=e=>{(e.children||[]).forEach(E),e.properties&&e.properties.afterRemoved&&e.properties.afterRemoved.apply(e.properties.bind||e.properties,[e.domNode])},L=()=>{j=!1,D.forEach(E),D.length=0},q=e=>{D.push(e),j||(j=!0,"undefined"!=typeof window&&"requestIdleCallback"in window?window.requestIdleCallback(L,{timeout:16}):setTimeout(L,16))},$=e=>{let t=e.domNode;if(e.properties){let r=e.properties.exitAnimation;if(r){t.style.pointerEvents="none";let s=()=>{t.parentNode&&(t.parentNode.removeChild(t),q(e))};return void r(t,s,e.properties)}}t.parentNode&&(t.parentNode.removeChild(t),q(e))},Z=(e,t,r)=>{if(!t)return;let s=r.eventHandlerInterceptor,i=Object.keys(t),n=i.length;for(let o=0;o<n;o++){let n=i[o],a=t[n];if("className"===n)throw new Error('Property "className" is not supported, use "class".');if("class"===n)z(e,a,!0);else if("classes"===n){let t=Object.keys(a),r=t.length;for(let s=0;s<r;s++){let r=t[s];a[r]&&e.classList.add(r)}}else if("styles"===n){let t=Object.keys(a),s=t.length;for(let i=0;i<s;i++){let s=t[i],n=a[s];n&&(R(n),r.styleApplyer(e,s,n))}}else if("key"!==n&&null!=a){let i=typeof a;"function"===i?(0===n.lastIndexOf("on",0)&&(s&&(a=s(n,a,e,t)),"oninput"===n&&function(){let e=a;a=function(t){e.apply(this,[t]),t.target["oninput-value"]=t.target.value}}()),e[n]=a):r.namespace===C?"href"===n?e.setAttributeNS(P,n,a):e.setAttribute(n,a):"string"===i&&"value"!==n?"innerHTML"===n?e[n]=k.W5.sanitize(a):F(e)&&n in e?e[n]=a:e.setAttribute(n,a):e[n]=a}}};function F(e){if(!(e instanceof Element&&e.tagName.includes("-")))return!1;const t=window.customElements.get(e.tagName.toLowerCase());return!!t&&e instanceof t}let V,B=(e,t,r)=>{((e,t,r)=>{if(t)for(let s of t)H(s,e,void 0,r)})(e,t.children,r),t.text&&(e.textContent=t.text),Z(e,t.properties,r),t.properties&&t.properties.afterCreate&&t.properties.afterCreate.apply(t.properties.bind||t.properties,[e,r,t.vnodeSelector,t.properties,t.children])},H=(e,t,r,s)=>{let i,n=0,o=e.vnodeSelector,a=t.ownerDocument;if(""===o)i=e.domNode=a.createTextNode(e.text),void 0!==r?t.insertBefore(i,r):t.appendChild(i);else{for(let l=0;l<=o.length;++l){let h=o.charAt(l);if(l===o.length||"."===h||"#"===h){let h=o.charAt(n-1),d=o.slice(n,l);"."===h?i.classList.add(d):"#"===h?i.id=d:("svg"===d&&(s=x(s,{namespace:C})),void 0!==s.namespace?i=e.domNode=a.createElementNS(s.namespace,d):(i=e.domNode=e.domNode||a.createElement(d),"input"===d&&e.properties&&void 0!==e.properties.type&&i.setAttribute("type",e.properties.type)),void 0!==r?t.insertBefore(i,r):i.parentNode!==t&&t.appendChild(i)),n=l+1}}B(i,e,s)}},z=(e,t,r)=>{t&&t.split(" ").forEach(t=>{t&&e.classList.toggle(t,r)})},W=(e,t,r,s)=>{if(!r)return;let i=!1,n=Object.keys(r),o=n.length;for(let a=0;a<o;a++){let o=n[a],l=r[o],h=t[o];if("class"===o)h!==l&&(z(e,h,!1),z(e,l,!0));else if("classes"===o){let t=e.classList,r=Object.keys(l),s=r.length;for(let e=0;e<s;e++){let s=r[e],n=!!l[s];n!==!!h[s]&&(i=!0,n?t.add(s):t.remove(s))}}else if("styles"===o){let t=Object.keys(l),r=t.length;for(let n=0;n<r;n++){let r=t[n],o=l[r];o!==h[r]&&(i=!0,o?(R(o),s.styleApplyer(e,r,o)):s.styleApplyer(e,r,""))}}else if(l||"string"!=typeof h||(l=""),"value"!==o||F(e)){if(l!==h){let t=typeof l;"function"===t&&s.eventHandlerInterceptor||(s.namespace===C?"href"===o?e.setAttributeNS(P,o,l):e.setAttribute(o,l):"string"===t?"innerHTML"===o?e[o]=k.W5.sanitize(l):"role"===o&&""===l?e.removeAttribute(o):F(e)&&o in e?e[o]=l:e.setAttribute(o,l):e[o]!==l&&(e[o]=l),i=!0)}}else{let t=e[o];t!==l&&(e["oninput-value"]?t===e["oninput-value"]:l!==h)&&(e[o]=l,e["oninput-value"]=void 0),l!==h&&(i=!0)}}return i},J=(e,t,r,s,i)=>{if(r===s)return!1;s=s||b;let n,o=(r=r||b).length,a=s.length,l=0,h=0,d=!1;for(;h<a;){let a=l<o?r[l]:void 0,c=s[h];if(void 0!==a&&T(a,c))d=V(a,c,i)||d,l++;else{let a=O(r,c,l+1);if(a>=0){for(n=l;n<a;n++)$(r[n]),N(r,n,e,"removed");d=V(r[a],c,i)||d,l=a+1}else H(c,t,l<o?r[l].domNode:void 0,i),M(c),N(s,h,e,"added")}h++}if(o>l)for(n=l;n<o;n++)$(r[n]),N(r,n,e,"removed");return d};V=(e,t,r)=>{let s=e.domNode,i=!1;if(e===t)return!1;let n=!1;if(""===t.vnodeSelector){if(t.text!==e.text){let e=s.ownerDocument.createTextNode(t.text);return s.parentNode.replaceChild(e,s),t.domNode=e,i=!0,i}t.domNode=s}else 0===t.vnodeSelector.lastIndexOf("svg",0)&&(r=x(r,{namespace:C})),e.text!==t.text&&(n=!0,void 0===t.text?s.removeChild(s.firstChild):s.textContent=t.text),t.domNode=s,n=J(t,s,e.children,t.children,r)||n,n=W(s,e.properties,t.properties,r)||n,t.properties&&t.properties.afterUpdate&&t.properties.afterUpdate.apply(t.properties.bind||t.properties,[s,r,t.vnodeSelector,t.properties,t.children]);return n&&t.properties&&t.properties.updateAnimation&&t.properties.updateAnimation(s,t.properties,e.properties),i};let G=(e,t)=>({getLastRender:()=>e,update:r=>{if(e.vnodeSelector!==r.vnodeSelector)throw new Error("The selector for the root VNode may not be changed. (consider using dom.merge and add one extra level to the virtual DOM)");let s=e;e=r,V(s,r,t)},domNode:e.domNode});const X={namespace:void 0,performanceLogger:()=>{},eventHandlerInterceptor:void 0,styleApplyer:(e,t,r)=>{"-"===t.charAt(0)?e.style.setProperty(t,r):e.style[t]=r}};let Y,K=e=>x(X,e),Q=(e,t,r)=>(r=K(r),H(t,e,void 0,r),G(t,r)),ee=(e,t,r)=>(r=K(r),H(t,e.parentNode,e,r),G(t,r)),te=(e,t,r)=>(r=K(r),t.domNode=e,B(e,t,r),G(t,r)),re=(e,t,r)=>(r=K(r),H(t,e.parentNode,e,r),e.parentNode.removeChild(e),G(t,r));Y=Array.prototype.find?(e,t)=>e.find(t):(e,t)=>e.filter(t)[0];const se={handleInterceptedEvent:(e,t,r,s)=>(e.scheduleRender(),t.properties[`on${s.type}`].apply(t.properties.bind||r,[s]))},ie={namespace:void 0,performanceLogger:()=>{},eventHandlerInterceptor:void 0,styleApplyer:(e,t,r)=>{t.startsWith("-")?e.style.setProperty(t,r):e.style[t]=r}},ne=(e,t,r=!1)=>{let s=e;return t.forEach((e,i)=>{const n=s?.children?((e,t)=>e.find(t))(s.children,t=>t.domNode===e):void 0;r&&!n&&i!==t.length-1||(s=n)}),s};var oe=r(14813),ae=r(2741);let le;le="components/assets";var he=r(36563);const de=Symbol("widget"),ce=Symbol("widget-test-data"),ue=[],pe={},fe=new WeakMap;function ge(e,t){let r=t.children;if(r?.length)for(let t=0;t<r.length;++t)r[t]=ge(e,r[t]);else r=ue;const s=t.vnodeSelector;if(ye(s)){const i=t.properties||pe,n=i.key||s,o={key:n,afterCreate:me,afterUpdate:ve,afterRemoved:_e,parentWidget:e,widgetConstructor:s,widgetProperties:{...i,key:n,children:r}};return{vnodeSelector:s.vnodeSelector,properties:o,children:void 0,text:void 0,domNode:null}}return t}function me(e,t,r,{parentWidget:s,widgetConstructor:i,widgetProperties:n}){const o=new i(n);o.container=e,fe.set(e,o),o.afterCreate?.(o,e),s.addHandles((0,he.hA)(()=>_e(e))),queueMicrotask(()=>{o[ce].projector.renderNow()})}function ve(e,t,r,{widgetProperties:s}){const i=fe.get(e);i&&(i.set(s),i.afterUpdate?.(i,e))}function _e(e){const t=fe.get(e);t&&(t.afterRemoved?.(t,e),t.destroy(),fe.delete(e))}function ye(e){return"function"==typeof e&&e[de]}const we=new Set;new Map;const Se=new Map;function Ie(){Se.clear()}function Ae(e){Se.delete(e)}var ke=r(98291),Ue=r(96211);function Ce(...e){const t=ke.A.acquire();for(let r=0;r<e.length;r++){const s=e[r],i=typeof s;if("string"===i)t.push(s);else if(Array.isArray(s))t.push.apply(t,s);else if("object"===i)for(const e in s)s[e]&&t.push(e)}const r=t.join(" ");return ke.A.release(t),r}(()=>{const e=new Map;new ResizeObserver(t=>{Ie();for(const r of t)e.get(r.target)?.(r)})})();var Pe,be=r(10838),xe=r(73444);let Te=0;function Re(e,t){const r=Object.prototype.hasOwnProperty;for(const s in t)r.call(t,s)&&r.call(e,s)&&(null!=e[s]&&null!=t[s]&&"object"==typeof e[s]&&"object"==typeof t[s]?Re(e[s],t[s]):e[s]=t[s]);return e}const Oe=(e=>{let t;const r={...se,...e},s=(n=r,{...ie,...n}),i=s.performanceLogger;var n;let o,a=!0,l=!1;const h=[],d=[],c=(e,n,o)=>{let a;s.eventHandlerInterceptor=(e,s,n,o)=>function(e){let s;i("domEvent",e);const n=((e,t)=>{const r=[];for(;e&&e!==t;)r.push(e),e=e.parentNode;return r})(e.currentTarget,a.domNode),o=n.some(e=>customElements.get(e?.tagName?.toLowerCase()));if(e.eventPhase!==Event.CAPTURING_PHASE&&o){const t=e.composedPath(),r=t.slice(t.indexOf(e.currentTarget),t.indexOf(a.domNode)).reverse();s=ne(a.getLastRender(),r,!0)}else n.reverse(),s=ne(a.getLastRender(),n);let l;return s&&(l=r.handleInterceptedEvent(t,s,this,e)),i("domEventProcessed",e),l},r.postProcessProjectionOptions?.(s);const l=o();a=e(n,l,s),s.eventHandlerInterceptor=void 0,h.push(a),d.push(o),r.afterFirstVNodeRendered&&r.afterFirstVNodeRendered(a,l)};let u=()=>{if(o=void 0,a){a=!1,i("renderStart",void 0);for(let e=0;e<h.length;e++){const t=d[e]();i("rendered",void 0);try{h[e].update(t)}catch(e){console.error(e)}i("patched",void 0)}i("renderDone",void 0),a=!0}};return r.modifyDoRenderImplementation&&(u=r.modifyDoRenderImplementation(u,h,d)),t={renderNow:u,scheduleRender:()=>{o||l||(o=requestAnimationFrame(u))},stop:()=>{o&&(cancelAnimationFrame(o),o=void 0),l=!0},resume:()=>{l=!1,a=!0,t.scheduleRender()},append:(e,t)=>{c(Q,e,t)},insertBefore:(e,t)=>{c(ee,e,t)},merge:(e,t)=>{c(te,e,t)},replace:(e,t)=>{c(re,e,t)},detach:e=>{for(let t=0;t<d.length;t++)if(d[t]===e)return d.splice(t,1),h.splice(t,1)[0];throw new Error("renderFunction was not found")}},t})({postProcessProjectionOptions(e){const t=e.eventHandlerInterceptor,r=/capture$/i;e.eventHandlerInterceptor=(e,s,i,n)=>{const o=t?.(e,s,i,n),a=r.test(e);if(!((e=e.replace(r,"")).toLowerCase()in i)||a){const t=e[2].toLowerCase()+e.slice(3),r=e=>o?.call(i,e);i.addEventListener(t,r,a);const s=()=>i.removeEventListener(t,r,a),l=n.afterRemoved;n.afterRemoved=e=>{l?.(e),s()}}return o}},handleInterceptedEvent(e,t,r,s){const{eventPhase:i,type:n}=s,o=i===Event.CAPTURING_PHASE;let a=`on${n}${o?"capture":""}`;const l=t.properties;(l&&a in l||(a=`on${n[0].toUpperCase()}${n.slice(1)}${o?"Capture":""}`,l&&a in l))&&(Ie(),e.scheduleRender(),l[a].call(l.bind||r,s))}});let Ne=!1,Me=class extends((0,_.g)(l.nJ)){static{this[Pe]=!0}constructor(e,t){super(e,t),this._attached=!1,this._projector=Oe,this._readyForTrueRender=!1,this.key=this,this.autoRenderingEnabled=!0,this._loadLocale=(0,u.sg)(async()=>{if(this._messageBundleProps?.length){const e=await Promise.allSettled(this._messageBundleProps.map(async({bundlePath:e,propertyName:t})=>{if(this.destroyed)return;let r=await(0,be.ud)(e);this.destroyed||(this.uiStrings&&Object.keys(this.uiStrings)&&(r=Re((0,d.o8)(r),this.uiStrings)),this[t]=r)}));if(this.destroyed)return;for(const t of e)"rejected"===t.status&&g.A.getLogger(this).error("widget-intl:locale-error",this.declaredClass,t.reason)}await this.loadLocale()}),this.addHandles((0,he.hA)()),oe.qu||(0,oe.Qu)((0,p.s2)((0,ae.s)("components/assets")));const r="esri-widget-uid-"+(0,w.lk)(),s=this.render.bind(this);this._trackingTarget=new A.r(()=>{this.autoRenderingEnabled&&this.scheduleRender()});const i=()=>({vnodeSelector:"div",properties:{key:`${r}-hidden`,class:"",styles:{display:"none"}},domNode:null,children:void 0,text:void 0}),n=()=>{if(!this._readyForTrueRender||this.destroyed)return null;const e=s()??i(),t=e.properties??={};if(t.key??=r,ye(e.vnodeSelector)){if(!this.visible)return i()}else this.visible?t.styles||(t.styles={}):(t.class="",t.styles={display:"none"}),t.styles.display??="";let n=0;return e.children?.forEach(e=>{ye(e.vnodeSelector)||(e.properties??={},e.properties.key??=`${this.id}--${n++}`)}),ge(this,e)};this.render=()=>{if(Ne)return n();let e=function(e){return Se.get(e)}(this)??null;if(e)return e;this._trackingTarget.clear(),Ne=!0;try{e=(0,I.a)(this._trackingTarget,n)}catch(e){throw g.A.getLogger(this).error(e),e}finally{Ne=!1}return e&&function(e,t){Se.set(e,t)}(this,e),e};const o=this.beforeFirstRender();o?this._resourcesFetch=o.then(()=>{this.destroyed||(this._readyForTrueRender=!0,this._postInitialize())}):(this._resourcesFetch=Promise.resolve().then(()=>{this.destroyed||this._postInitialize()}),this._readyForTrueRender=!0),this.addResolvingPromise(this._resourcesFetch),function(e){we.add(e),e.finally(()=>we.delete(e))}(this._resourcesFetch)}normalizeCtorArgs(e,t){const r={...e};return t&&(r.container=t),r}postInitialize(){}beforeFirstRender(){const e=this.loadDependencies();return this._messageBundleProps?.length||e?Promise.all([e,this._loadLocale()]).then(()=>{}).catch(u.jH):null}loadDependencies(){return null}loadLocale(){return null}destroy(){this.destroyed||((0,v.pR)(this._trackingTarget),(0,v.pR)(this.viewModel),this._detach(this.container),this._set("container",null),this.render=()=>null,this._projector=null,Ae(this))}set container(e){this._get("container")||this._set("container",e)}castContainer(e){return"string"==typeof(t=e)?document.getElementById(t):t??null;var t}get destroyed(){return super.destroyed}get domNode(){return this.container}set domNode(e){this.container=e}get icon(){return null}set icon(e){this._overrideIfSome("icon",e)}get id(){return this._get("id")||this.container?.id||Date.now().toString(16)+"-widget-"+Te++}set id(e){e&&this._set("id",e)}get label(){return this.declaredClass.split(".").pop()}set label(e){this._overrideIfSome("label",e)}get renderable(){return this._resourcesFetch}get visible(){return this._get("visible")}set visible(e){this._set("visible",e)}get[(Pe=de,ce)](){return{projector:this._projector}}static{this.vnodeSelector="div"}render(){throw new Error("not implemented")}scheduleRender(){this.destroyed||(Ae(this),this._projector.scheduleRender())}classes(...e){return Ce.apply(this,e)}renderNow(){Ae(this),this._projector.renderNow()}_postInitialize(){if(this.destroyed)return;this.scheduleRender(),this._delegatedEventNames?.length&&this.addHandles((0,y.wB)(()=>this.viewModel,(e,t)=>{t&&this.removeHandles("delegated-events"),e&&(0,h.wb)(e)&&this.addHandles(this._delegatedEventNames.map(t=>(0,h.on)(e,t,e=>{this.emit(t,e)})),"delegated-events")},y.pc)),this.postInitialize();const e=async()=>{await this._loadLocale().catch(u.jH),this.scheduleRender()};this.addHandles([(0,xe.oQ)(e),(0,y.wB)(()=>this.uiStrings,e)]),this.addHandles((0,y.z7)(()=>this.container,e=>{this.destroyed||this._attach(e)},{initial:!0,once:!0}))}_attach(e){e&&(this._projector.merge(e,this.render),this._attached=!0)}_detach(e){this._attached&&(this._projector.detach(this.render),this._attached=!1),e?.parentNode?.removeChild(e)}};(0,i.Cg)([(0,f.MZ)()],Me.prototype,"_readyForTrueRender",void 0),(0,i.Cg)([(0,f.MZ)({value:null})],Me.prototype,"container",null),(0,i.Cg)([(0,S.w)("container")],Me.prototype,"castContainer",null),(0,i.Cg)([(0,f.MZ)()],Me.prototype,"icon",null),(0,i.Cg)([(0,f.MZ)()],Me.prototype,"id",null),(0,i.Cg)([(0,f.MZ)()],Me.prototype,"label",null),(0,i.Cg)([(0,f.MZ)()],Me.prototype,"renderable",null),(0,i.Cg)([(0,f.MZ)()],Me.prototype,"uiStrings",void 0),(0,i.Cg)([(0,f.MZ)()],Me.prototype,"viewModel",void 0),(0,i.Cg)([(0,f.MZ)({value:!0})],Me.prototype,"visible",null),(0,i.Cg)([(0,f.MZ)()],Me.prototype,"key",void 0),(0,i.Cg)([(0,f.MZ)()],Me.prototype,"children",void 0),(0,i.Cg)([(0,f.MZ)()],Me.prototype,"afterCreate",void 0),(0,i.Cg)([(0,f.MZ)()],Me.prototype,"afterUpdate",void 0),(0,i.Cg)([(0,f.MZ)()],Me.prototype,"afterRemoved",void 0),Me=(0,i.Cg)([(0,m.$)("esri.widgets.Widget")],Me);const De=Me;function je(e){return(t,r)=>{t.hasOwnProperty("_messageBundleProps")||(t._messageBundleProps=t._messageBundleProps?t._messageBundleProps.slice():[]),t._messageBundleProps.push({bundlePath:e,propertyName:r})}}var Ee=function(e){return{vnodeSelector:"",properties:void 0,children:void 0,text:e.toString(),domNode:null}},Le=function(e,t){for(var r=0,s=e.length;r<s;r++){var i=e[r];Array.isArray(i)?Le(i,t):null!=i&&!1!==i&&(i.hasOwnProperty("vnodeSelector")||(i=Ee(i)),t.push(i))}};function qe(e,t,...r){return"function"!=typeof e||ye(e)?function(e,t){for(var r=[],s=2;s<arguments.length;s++)r[s-2]=arguments[s];if(1===r.length&&"string"==typeof r[0])return{vnodeSelector:e,properties:t||void 0,children:void 0,text:r[0],domNode:null};var i=[];return Le(r,i),{vnodeSelector:e,properties:t||void 0,children:i,text:void 0,domNode:null}}(e,t??null,...r):e(t,...r)}const $e=/\W/g;function Ze(){const e=getComputedStyle(document.body).getPropertyValue("--esri-calcite-mode-name").replaceAll($e,"").toLowerCase();switch(e){case"dark":case"light":return`calcite-mode-${e}`;default:return null}}var Fe=r(71754);const Ve="esri-identity-modal",Be={base:Ve,info:`${Ve}__info`,notice:`${Ve}__notice`};let He=class extends De{constructor(e,t){super(e,t),this.container=document.createElement("div"),this.error=null,this.oAuthPrompt=!1,this.open=!1,this.signingIn=!1,this.server=null,this.resource=null,this._usernameInputNode=null,this._passwordInputNode=null,document.body.appendChild(this.container)}loadDependencies(){return function(e){const t=[];for(const r of Object.keys(e))customElements.get(`calcite-${r}`)||t.push(e[r]?.());return t.length>0?Promise.all(t):null}({button:()=>Promise.all([r.e(9e3),r.e(9402),r.e(7836)]).then(r.bind(r,37836)),dialog:()=>Promise.all([r.e(9e3),r.e(9402),r.e(2893)]).then(r.bind(r,52893)),input:()=>Promise.all([r.e(9e3),r.e(9402),r.e(2165)]).then(r.bind(r,2165)),label:()=>Promise.all([r.e(9e3),r.e(224)]).then(r.bind(r,87843)),notice:()=>Promise.all([r.e(9e3),r.e(9402),r.e(8098)]).then(r.bind(r,48098))})}get title(){return this.commonMessages?.auth.signIn}render(){const{open:e,title:t,messages:r,signingIn:s,oAuthPrompt:i,server:n,resource:o,error:a}=this,{info:l,oAuthInfo:h,lblItem:d,invalidUser:c,noAuthService:u,lblUser:p,lblPwd:f,lblCancel:g,lblSigning:m,lblOk:v}=r;return qe("div",{class:this.classes(Be.base,Ze())},qe("form",{bind:this,onsubmit:this._submit},qe("calcite-dialog",{bind:this,heading:t,modal:!0,open:e,outsideCloseDisabled:!0,scale:"s",widthScale:"s",onCalciteDialogClose:this._cancel,onCalciteDialogOpen:this._focusUsernameInput},qe("div",{class:Be.info},(0,Fe.V)(i?h:l,{server:n&&/\.arcgis\.com/i.test(n)?"ArcGIS Online":n,resource:`(${o||d})`})),a?qe("calcite-notice",{class:Be.notice,icon:"exclamation-mark-triangle",kind:"danger",open:!0},qe("div",{slot:"message"},a.details?.httpStatus?c:u)):null,i?null:[qe("calcite-label",null,p,qe("calcite-input",{afterCreate:e=>this._usernameInputNode=e,autocomplete:"off",bind:this,name:"username",required:!0,spellcheck:!1,type:"text",value:""})),qe("calcite-label",null,f,qe("calcite-input",{afterCreate:e=>this._passwordInputNode=e,bind:this,name:"password",required:!0,type:"password",value:""}))],qe("calcite-button",{appearance:"outline",bind:this,onclick:this._cancel,slot:"footer-end",type:"button"},g),qe("calcite-button",{loading:!!s,slot:"footer-end",type:"submit"},s?m:v))))}_focusUsernameInput(){return async function(e){await(0,Ue.$m)((0,u.Mq)(void 0));const t=e();t&&("setFocus"in t&&"function"==typeof t.setFocus?await t.setFocus():t instanceof HTMLElement&&t.focus())}(()=>this._usernameInputNode)}_cancel(){this._set("signingIn",!1),this.open=!1,this._usernameInputNode&&(this._usernameInputNode.value=""),this._passwordInputNode&&(this._passwordInputNode.value=""),this.emit("cancel")}_submit(e){e.preventDefault(),this._set("signingIn",!0);const t=this.oAuthPrompt?{}:{username:this._usernameInputNode?.value,password:this._passwordInputNode?.value};this.emit("submit",t)}};(0,i.Cg)([(0,f.MZ)({readOnly:!0})],He.prototype,"container",void 0),(0,i.Cg)([(0,f.MZ)(),je("esri/t9n/common")],He.prototype,"commonMessages",void 0),(0,i.Cg)([(0,f.MZ)()],He.prototype,"error",void 0),(0,i.Cg)([(0,f.MZ)(),je("esri/identity/t9n/identity")],He.prototype,"messages",void 0),(0,i.Cg)([(0,f.MZ)()],He.prototype,"oAuthPrompt",void 0),(0,i.Cg)([(0,f.MZ)()],He.prototype,"open",void 0),(0,i.Cg)([(0,f.MZ)()],He.prototype,"signingIn",void 0),(0,i.Cg)([(0,f.MZ)()],He.prototype,"server",void 0),(0,i.Cg)([(0,f.MZ)({readOnly:!0})],He.prototype,"title",null),(0,i.Cg)([(0,f.MZ)()],He.prototype,"resource",void 0),He=(0,i.Cg)([(0,m.$)("esri.identity.IdentityModal")],He);const ze=He,We="esriJSAPIOAuth";class Je{constructor(e,t){this.oAuthInfo=null,this.storage=null,this.appId=null,this.codeVerifier=null,this.expires=null,this.refreshToken=null,this.ssl=null,this.stateUID=null,this.token=null,this.userId=null,this.oAuthInfo=e,this.storage=t,this._init()}isValid(){let e=!1;if(this.oAuthInfo&&this.userId&&(this.refreshToken||this.token))if(null==this.expires&&this.refreshToken)e=!0;else if(this.expires){const t=Date.now();this.expires>t&&(this.expires-t)/1e3>60*this.oAuthInfo.minTimeUntilExpiration&&(e=!0)}return e}save(){if(!this.storage)return!1;const e=this._load(),t=this.oAuthInfo;if(t?.authNamespace&&t.portalUrl){let r=e[t.authNamespace];r||(r=e[t.authNamespace]={}),this.appId||(this.appId=t.appId),r[t.portalUrl]={appId:this.appId,codeVerifier:this.codeVerifier,expires:this.expires,refreshToken:this.refreshToken,ssl:this.ssl,stateUID:this.stateUID,token:this.token,userId:this.userId};try{this.storage.setItem(We,JSON.stringify(e))}catch(e){return console.warn(e),!1}return!0}return!1}destroy(){const e=this._load(),t=this.oAuthInfo;if(t?.appId&&t?.portalUrl&&(null==this.expires||this.expires>Date.now())&&(this.refreshToken||this.token)){const e=t.portalUrl.replace(/^http:/i,"https:")+"/sharing/rest/oauth2/revokeToken";(0,o.A)(e,{authMode:"anonymous",keepAlive:!0,method:"post",query:{f:"json",auth_token:this.refreshToken||this.token,client_id:t.appId,token_type_hint:this.refreshToken?"refresh_token":"access_token"}})}if(t?.authNamespace&&t.portalUrl&&this.storage){const r=e[t.authNamespace];if(r){delete r[t.portalUrl];try{this.storage.setItem(We,JSON.stringify(e))}catch(e){console.log(e)}}}t&&(t._oAuthCred=null,this.oAuthInfo=null)}_init(){const e=this._load(),t=this.oAuthInfo;if(t?.authNamespace&&t.portalUrl){let r=e[t.authNamespace];r&&(r=r[t.portalUrl],r&&(this.appId=r.appId,this.codeVerifier=r.codeVerifier,this.expires=r.expires,this.refreshToken=r.refreshToken,this.ssl=r.ssl,this.stateUID=r.stateUID,this.token=r.token,this.userId=r.userId))}}_load(){let e={};if(this.storage){const t=this.storage.getItem(We);if(t)try{e=JSON.parse(t)}catch(e){console.warn(e)}}return e}}Je.prototype.declaredClass="esri.identity.OAuthCredential";var Ge,Xe=r(25482);let Ye=class extends Xe.o{static{Ge=this}constructor(e){super(e),this._oAuthCred=null,this.appId=null,this.authNamespace="/",this.expiration=20160,this.flowType="auto",this.forceLogin=!1,this.forceUserId=!1,this.locale=null,this.minTimeUntilExpiration=30,this.popup=!1,this.popupCallbackUrl="oauth-callback.html",this.popupWindowFeatures="height=490,width=800,resizable,scrollbars,status",this.portalUrl="https://www.arcgis.com",this.preserveUrlHash=!1,this.userId=null}clone(){return Ge.fromJSON(this.toJSON())}};(0,i.Cg)([(0,f.MZ)({json:{write:!0}})],Ye.prototype,"appId",void 0),(0,i.Cg)([(0,f.MZ)({json:{write:!0}})],Ye.prototype,"authNamespace",void 0),(0,i.Cg)([(0,f.MZ)({json:{write:!0}})],Ye.prototype,"expiration",void 0),(0,i.Cg)([(0,f.MZ)({json:{write:!0}})],Ye.prototype,"flowType",void 0),(0,i.Cg)([(0,f.MZ)({json:{write:!0}})],Ye.prototype,"forceLogin",void 0),(0,i.Cg)([(0,f.MZ)({json:{write:!0}})],Ye.prototype,"forceUserId",void 0),(0,i.Cg)([(0,f.MZ)({json:{write:!0}})],Ye.prototype,"locale",void 0),(0,i.Cg)([(0,f.MZ)({json:{write:!0}})],Ye.prototype,"minTimeUntilExpiration",void 0),(0,i.Cg)([(0,f.MZ)({json:{write:!0}})],Ye.prototype,"popup",void 0),(0,i.Cg)([(0,f.MZ)({json:{write:!0}})],Ye.prototype,"popupCallbackUrl",void 0),(0,i.Cg)([(0,f.MZ)({json:{write:!0}})],Ye.prototype,"popupWindowFeatures",void 0),(0,i.Cg)([(0,f.MZ)({json:{write:!0}})],Ye.prototype,"portalUrl",void 0),(0,i.Cg)([(0,f.MZ)({json:{write:!0}})],Ye.prototype,"preserveUrlHash",void 0),(0,i.Cg)([(0,f.MZ)({json:{write:!0}})],Ye.prototype,"userId",void 0),Ye=Ge=(0,i.Cg)([(0,m.$)("esri.identity.OAuthInfo")],Ye);const Ke=Ye;let Qe=class extends Xe.o{constructor(e){super(e),this.adminTokenServiceUrl=null,this.currentVersion=null,this.hasPortal=null,this.hasServer=null,this.owningSystemUrl=null,this.owningTenant=null,this.server=null,this.shortLivedTokenValidity=null,this.tokenServiceUrl=null,this.webTierAuth=null}};(0,i.Cg)([(0,f.MZ)({json:{write:!0}})],Qe.prototype,"adminTokenServiceUrl",void 0),(0,i.Cg)([(0,f.MZ)({json:{write:!0}})],Qe.prototype,"currentVersion",void 0),(0,i.Cg)([(0,f.MZ)({json:{write:!0}})],Qe.prototype,"hasPortal",void 0),(0,i.Cg)([(0,f.MZ)({json:{write:!0}})],Qe.prototype,"hasServer",void 0),(0,i.Cg)([(0,f.MZ)({json:{write:!0}})],Qe.prototype,"owningSystemUrl",void 0),(0,i.Cg)([(0,f.MZ)({json:{write:!0}})],Qe.prototype,"owningTenant",void 0),(0,i.Cg)([(0,f.MZ)({json:{write:!0}})],Qe.prototype,"server",void 0),(0,i.Cg)([(0,f.MZ)({json:{write:!0}})],Qe.prototype,"shortLivedTokenValidity",void 0),(0,i.Cg)([(0,f.MZ)({json:{write:!0}})],Qe.prototype,"tokenServiceUrl",void 0),(0,i.Cg)([(0,f.MZ)({json:{write:!0}})],Qe.prototype,"webTierAuth",void 0),Qe=(0,i.Cg)([(0,m.$)("esri.identity.ServerInfo")],Qe);const et=Qe;var tt=r(39131);const rt={},st=e=>{const t=new p.s0(e.owningSystemUrl).host,r=new p.s0(e.server).host,s=/.+\.arcgis\.com$/i;return s.test(t)&&s.test(r)},it=(e,t)=>!!(st(e)&&t&&t.some(t=>t.test(e.server)));let nt=null,ot=null;try{nt=window.localStorage,ot=window.sessionStorage}catch{}class at extends l.a${constructor(){super(),this._portalConfig=globalThis.esriGeowConfig,this.serverInfos=[],this.oAuthInfos=[],this.credentials=[],this._soReqs=[],this._xoReqs=[],this._portals=[],this._defaultOAuthInfo=null,this._defaultTokenValidity=60,this.dialog=null,this.tokenValidity=null,this.normalizeWebTierAuth=!1,this._appOrigin="null"!==window.origin?window.origin:window.location.origin,this._appUrlObj=(0,p.An)(window.location.href),this._busy=null,this._rejectOnPersistedPageShow=!1,this._oAuthLocationParams=null,this._gwTokenUrl="/sharing/rest/generateToken",this._agsRest="/rest/services",this._agsPortal=/\/sharing(\/|$)/i,this._agsAdmin=/(https?:\/\/[^/]+\/[^/]+)\/admin\/?(\/.*)?$/i,this._adminSvcs=/\/rest\/admin\/services(\/|$)/i,this._gwDomains=[{regex:/^https?:\/\/www\.arcgis\.com/i,customBaseUrl:"maps.arcgis.com",tokenServiceUrl:"https://www.arcgis.com/sharing/rest/generateToken"},{regex:/^https?:\/\/(?:dev|[a-z\d-]+\.mapsdev)\.arcgis\.com/i,customBaseUrl:"mapsdev.arcgis.com",tokenServiceUrl:"https://dev.arcgis.com/sharing/rest/generateToken"},{regex:/^https?:\/\/(?:devext|[a-z\d-]+\.mapsdevext)\.arcgis\.com/i,customBaseUrl:"mapsdevext.arcgis.com",tokenServiceUrl:"https://devext.arcgis.com/sharing/rest/generateToken"},{regex:/^https?:\/\/(?:qaext|[a-z\d-]+\.mapsqa)\.arcgis\.com/i,customBaseUrl:"mapsqa.arcgis.com",tokenServiceUrl:"https://qaext.arcgis.com/sharing/rest/generateToken"},{regex:/^https?:\/\/[a-z\d-]+\.maps\.arcgis\.com/i,customBaseUrl:"maps.arcgis.com",tokenServiceUrl:"https://www.arcgis.com/sharing/rest/generateToken"}],this._legacyFed=[],this._regexSDirUrl=/http.+\/rest\/services\/?/gi,this._regexServerType=/(\/(FeatureServer|GPServer|GeoDataServer|GeocodeServer|GeoenrichmentServer|GeometryServer|GlobeServer|ImageServer|KnowledgeGraphServer|MapServer|MissionServer|MobileServer|NAServer|NetworkDiagramServer|OGCFeatureServer|ParcelFabricServer|RelationalCatalogServer|SceneServer|StreamServer|UtilityNetworkServer|ValidationServer|VectorTileServer|VersionManagementServer|VideoServer)).*/gi,this._gwUser=/http.+\/users\/([^/]+).*/i,this._gwItem=/http.+\/items\/([^/]+).*/i,this._gwGroup=/http.+\/groups\/([^/]+).*/i,this._rePortalTokenSvc=/\/sharing(\/rest)?\/generatetoken/i,this._createDefaultOAuthInfo=!0,this._hasTestedIfAppIsOnPortal=!1,this._getPlatformSelfError=null,this._getOAuthLocationParams(),window.addEventListener("pageshow",e=>{this._pageShowHandler(e)})}registerServers(e){const t=this.serverInfos;t?(e=e.filter(e=>!this.findServerInfo(e.server)),this.serverInfos=t.concat(e)):this.serverInfos=e,e.forEach(e=>{e.owningSystemUrl&&this._portals.push(e.owningSystemUrl),e.hasPortal&&this._portals.push(e.server)})}registerOAuthInfos(e){const t=this.oAuthInfos;if(t){for(const r of e){const e=this.findOAuthInfo(r.portalUrl);e&&t.splice(t.indexOf(e),1)}this.oAuthInfos=t.concat(e)}else this.oAuthInfos=e}registerToken(e){e={...e};const t=this._sanitizeUrl(e.server),r=this._isServerRsrc(t);let s,i=this.findServerInfo(t),n=!0;i||(i=new et,i.server=this._getServerInstanceRoot(t),r?i.hasServer=!0:(i.tokenServiceUrl=this._getTokenSvcUrl(t),i.hasPortal=!0),this.registerServers([i])),s=this._findCredential(t),s?(delete e.server,Object.assign(s,e),n=!1):(s=new lt({userId:e.userId,server:i.server??void 0,token:e.token,expires:e.expires,ssl:e.ssl,scope:r?"server":"portal"}),s.resources=[t],this.credentials.push(s)),s.emitTokenChange(!1),n||s.refreshServerTokens()}toJSON(){return(0,d.oy)({serverInfos:this.serverInfos.map(e=>e.toJSON()),oAuthInfos:this.oAuthInfos.map(e=>e.toJSON()),credentials:this.credentials.map(e=>e.toJSON())})}initialize(e){if(!e)return;"string"==typeof e&&(e=JSON.parse(e));const t=e.serverInfos,r=e.oAuthInfos,s=e.credentials;if(t){const e=[];t.forEach(t=>{t.server&&t.tokenServiceUrl&&e.push(t.declaredClass?t:new et(t))}),e.length&&this.registerServers(e)}if(r){const e=[];r.forEach(t=>{t.appId&&e.push(t.declaredClass?t:new Ke(t))}),e.length&&this.registerOAuthInfos(e)}s&&s.forEach(e=>{e.server&&e.token&&e.expires&&e.expires>Date.now()&&((e=e.declaredClass?e:new lt(e)).emitTokenChange(),this.credentials.push(e))})}findServerInfo(e){let t;e=this._sanitizeUrl(e);for(const r of this.serverInfos)if(this._hasSameServerInstance(r.server,e)){t=r;break}return t}findOAuthInfo(e){let t;e=this._sanitizeUrl(e);for(const r of this.oAuthInfos)if(this._hasSameServerInstance(r.portalUrl,e)){t=r;break}return t}findCredential(e,t){if(!e)return;let r;e=this._sanitizeUrl(e);const s=this._isServerRsrc(e)?"server":"portal";if(t){for(const i of this.credentials)if(this._hasSameServerInstance(i.server,e)&&t===i.userId&&i.scope===s){r=i;break}}else for(const t of this.credentials)if(this._hasSameServerInstance(t.server,e)&&-1!==this._getIdenticalSvcIdx(e,t)&&t.scope===s){r=t;break}return r}getCredential(e,t){let r,s=!1,i=!0;t&&(s=!(!t.token&&!t.credential),r=t.error,i=!1!==t.prompt),t={...t},e=this._sanitizeUrl(e);const n=new AbortController,o=(0,u.Tw)();if(t.signal&&(0,u.u7)(t.signal,()=>{n.abort()}),(0,u.u7)(n,()=>{o.reject(new a.A("identity-manager:user-aborted","ABORTED"))}),(0,u.G4)(n))return o.promise;t.signal=n.signal;const l=this._isAdminResource(e),h=s?this.findCredential(e):null;let d;if(h&&498===r?.details?.httpStatus)h.destroy();else if(h)return d=new a.A("identity-manager:not-authorized","You are currently signed in as: '"+h.userId+"'. You do not have access to this resource: "+e,{error:r}),o.reject(d),o.promise;const c=this._findCredential(e,t);if(c)return o.resolve(c),o.promise;let f=this.findServerInfo(e);if(f)!f.hasPortal&&f.server&&f.owningSystemUrl&&this._hasSameServerInstance(f.server,f.owningSystemUrl)&&(f.hasPortal=!0),!f.hasServer&&this._isServerRsrc(e)&&(f._restInfoPms=this._getTokenSvcUrl(e),f.hasServer=!0);else{const t=this._getTokenSvcUrl(e);if(!t)return d=new a.A("identity-manager:unknown-resource","Unknown resource - could not find token service endpoint."),o.reject(d),o.promise;f=new et,f.server=this._getServerInstanceRoot(e),"string"==typeof t?(f.tokenServiceUrl=t,f.hasPortal=!0):(f._restInfoPms=t,f.hasServer=!0),this.registerServers([f])}return f.hasPortal&&void 0===f._selfReq&&(i||(0,p.FX)(f.tokenServiceUrl,this._appOrigin)||this._gwDomains.some(e=>e.tokenServiceUrl===f.tokenServiceUrl))&&(f._selfReq={owningTenant:t?.owningTenant,selfDfd:this._getPortalSelf(f.tokenServiceUrl.replace(this._rePortalTokenSvc,"/sharing/rest/portals/self"),e)}),this._enqueue(e,f,t,o,l)}getResourceName(e){return this._isRESTService(e)?e.replace(this._regexSDirUrl,"").replace(this._regexServerType,"")||"":this._gwUser.test(e)&&e.replace(this._gwUser,"$1")||this._gwItem.test(e)&&e.replace(this._gwItem,"$1")||this._gwGroup.test(e)&&e.replace(this._gwGroup,"$1")||""}generateToken(e,t,r){const s=this._rePortalTokenSvc.test(e.tokenServiceUrl),i=new p.s0(this._appOrigin),n=e.shortLivedTokenValidity;let l,h,d,c,u,f,g,m;t&&(m=this.tokenValidity||n||this._defaultTokenValidity,m>n&&n>0&&(m=n)),r&&(l=r.isAdmin,h=r.serverUrl,d=r.token,f=r.signal,g=r.ssl,e.customParameters=r.customParameters),l?c=e.adminTokenServiceUrl:(c=e.tokenServiceUrl,u=new p.s0(c.toLowerCase()),e.webTierAuth&&r?.serverUrl&&!g&&"http"===i.scheme&&((0,p.FX)(i.uri,c,!0)||"https"===u.scheme&&i.host===u.host&&"7080"===i.port&&"7443"===u.port)&&(c=c.replace(/^https:/i,"http:").replace(/:7443/i,":7080")));const v={query:{request:"getToken",username:t?.username,password:t?.password,serverUrl:h,token:d,expiration:m,referer:l||s?this._appOrigin:null,client:l?"referer":null,f:"json",...e.customParameters},method:"post",authMode:"anonymous",useProxy:this._useProxy(e,r),signal:f,...r?.ioArgs};return s||(v.withCredentials=!1),(0,o.A)(c,v).then(r=>{const s=r.data;if(!s?.token)return new a.A("identity-manager:authentication-failed","Unable to generate token");const i=e.server;return rt[i]||(rt[i]={}),t&&(rt[i][t.username]=t.password),s.validity=m,s})}isBusy(){return!!this._busy}async checkSignInStatus(e){return(await this.checkAppAccess(e,"")).credential}checkAppAccess(e,t,r){let s=!1;return this.getCredential(e,{prompt:!1}).then(i=>{let n;const l={f:"json"};if("portal"===i.scope)if(t&&(this._doPortalSignIn(e)||r?.force))n=i.server+"/sharing/rest/oauth2/validateAppAccess",l.client_id=t;else{if(!i.token)return{credential:i};n=i.server+"/sharing/rest"}else{if(!i.token)return{credential:i};n=i.server+"/rest/services"}return i.token&&(l.token=i.token),(0,o.A)(n,{query:l,authMode:"anonymous"}).then(e=>{if(!1===e.data.valid)throw new a.A("identity-manager:not-authorized",`You are currently signed in as: '${i.userId}'.`,e.data);return s=!!e.data.viewOnlyUserTypeApp,{credential:i}}).catch(e=>{if("identity-manager:not-authorized"===e.name)throw e;const t=e.details?.httpStatus;if(498===t)throw i.destroy(),new a.A("identity-manager:not-authenticated","User is not signed in.");if(400===t)throw new a.A("identity-manager:invalid-request","Bad request");return{credential:i}})}).then(e=>({credential:e.credential,viewOnly:s}))}setOAuthResponseHash(e){e&&(e.startsWith("#")&&(e=e.slice(1)),this._processOAuthPopupParams((0,p.zf)(e)))}setOAuthRedirectionHandler(e){this._oAuthRedirectFunc=e}setProtocolErrorHandler(e){this._protocolFunc=e}signIn(e,t,r={}){const s=(0,u.Tw)(),i=()=>{l?.remove(),h?.remove(),this.dialog?.destroy(),this.dialog=l=h=null},n=()=>{i(),this._oAuthDfd=null,s.reject(new a.A("identity-manager:user-aborted","ABORTED"))};r.signal&&(0,u.u7)(r.signal,()=>{n()});const o=new ze({open:!0,resource:this.getResourceName(e),server:t.server});this.dialog=o,this.emit("dialog-create");let l=o.on("cancel",n),h=o.on("submit",e=>{this.generateToken(t,e,{isAdmin:r.isAdmin,signal:r.signal}).then(n=>{i();const o=new lt({userId:e.username,server:t.server??void 0,token:n.token,expires:null!=n.expires?Number(n.expires):null,ssl:!!n.ssl,isAdmin:r.isAdmin,validity:n.validity});s.resolve(o)}).catch(e=>{o.error=e,o.signingIn=!1})});return s.promise}oAuthSignIn(e,t,r,s){this._oAuthDfd=(0,u.Tw)();const i=this._oAuthDfd;let n;s?.signal&&(0,u.u7)(s.signal,()=>{const e=this._oAuthDfd&&this._oAuthDfd.oAuthWin_;e&&!e.closed?e.close():this.dialog&&d()}),i.resUrl_=e,i.sinfo_=t,i.oinfo_=r;const o=r._oAuthCred;if(o.storage&&("authorization-code"===r.flowType||"auto"===r.flowType&&t.currentVersion>=8.4)){let e=crypto.getRandomValues(new Uint8Array(32));n=(0,p.$1)(e),o.codeVerifier=n,e=crypto.getRandomValues(new Uint8Array(32)),o.stateUID=(0,p.$1)(e),o.save()||(o.codeVerifier=n=null)}else o.codeVerifier=null;let l,h;this._getCodeChallenge(n).then(i=>{const n=!s||!1!==s.oAuthPopupConfirmation;if(!r.popup||!n)return void this._doOAuthSignIn(e,t,r,i);const o=new ze({oAuthPrompt:!0,server:t.server,open:!0});this.dialog=o,this.emit("dialog-create"),l=o.on("cancel",d),h=o.on("submit",()=>{c(),this._doOAuthSignIn(e,t,r,i)})});const d=()=>{c(),this._oAuthDfd=null,i.reject(new a.A("identity-manager:user-aborted","ABORTED"))},c=()=>{l?.remove(),h?.remove(),this.dialog?.destroy(),this.dialog=null};return i.promise}destroyCredentials(){this.credentials&&this.credentials.slice().forEach(e=>{e.destroy()}),this.emit("credentials-destroy")}enablePostMessageAuth(e="https://www.arcgis.com/sharing/rest"){this._postMessageAuthHandle&&this._postMessageAuthHandle.remove(),this._postMessageAuthHandle=(0,h.on)(window,"message",t=>{if((t.origin===this._appOrigin||t.origin.endsWith(".arcgis.com"))&&"arcgis:auth:requestCredential"===t.data?.type){const r=t.source;this.getCredential(e).then(e=>{r.postMessage({type:"arcgis:auth:credential",credential:{expires:e.expires,server:e.server,ssl:e.ssl,token:e.token,userId:e.userId}},t.origin)}).catch(e=>{r.postMessage({type:"arcgis:auth:error",error:{name:e.name,message:e.message}},t.origin)})}})}disablePostMessageAuth(){this._postMessageAuthHandle&&(this._postMessageAuthHandle.remove(),this._postMessageAuthHandle=null)}_getOAuthLocationParams(){let e=window.location.hash;if(e){e.startsWith("#")&&(e=e.slice(1));const t=(0,p.zf)(e);let r=!1;if(t.access_token&&t.expires_in&&t.state&&t.hasOwnProperty("username"))try{t.state=JSON.parse(t.state),t.state.portalUrl&&(this._oAuthLocationParams=t,r=!0)}catch{}else if(t.error&&t.error_description&&(console.log("IdentityManager OAuth Error: ",t.error," - ",t.error_description),"access_denied"===t.error&&(r=!0,t.state)))try{t.state=JSON.parse(t.state)}catch{}r&&(window.location.hash=t.state?.hash||"")}let t=window.location.search;if(t){t.startsWith("?")&&(t=t.slice(1));const e=(0,p.zf)(t);let r=!1;if(e.code&&e.state)try{e.state=JSON.parse(e.state),e.state.portalUrl&&e.state.uid&&(this._oAuthLocationParams=e,r=!0)}catch{}else if(e.error&&e.error_description&&(console.log("IdentityManager OAuth Error: ",e.error," - ",e.error_description),"access_denied"===e.error&&(r=!0,e.state)))try{e.state=JSON.parse(e.state)}catch{}if(r){const t={...e};["code","error","error_description","message_code","persist","state"].forEach(e=>{delete t[e]});const r=(0,p.x0)(t),s=window.location.pathname+(r?`?${r}`:"")+(e.state?.hash||"");window.history.replaceState(window.history.state,"",s)}}}_getOAuthToken(e,t,r,s,i){return e=e.replace(/^http:/i,"https:"),(0,o.A)(`${e}/sharing/rest/oauth2/token`,{authMode:"anonymous",method:"post",query:s&&i?{grant_type:"authorization_code",code:t,redirect_uri:s,client_id:r,code_verifier:i}:{grant_type:"refresh_token",refresh_token:t,client_id:r}}).then(e=>e.data)}async _getCodeChallenge(e){if(e&&globalThis.isSecureContext){const t=(new TextEncoder).encode(e),r=await crypto.subtle.digest("SHA-256",t);return(0,p.$1)(new Uint8Array(r))}return null}_pageShowHandler(e){if(e.persisted&&this.isBusy()&&this._rejectOnPersistedPageShow){const e=new a.A("identity-manager:user-aborted","ABORTED");this._errbackFunc(e)}}_findCredential(e,t){let r,s,i,n,o=-1;const a=t?.token,l=t?.resource,h=this._isServerRsrc(e)?"server":"portal",d=this.credentials.filter(t=>this._hasSameServerInstance(t.server,e)&&t.scope===h);if(e=l||e,d.length)if(1===d.length){if(r=d[0],i=this.findServerInfo(r.server),s=i?.owningSystemUrl,n=s?this.findCredential(s,r.userId):void 0,o=this._getIdenticalSvcIdx(e,r),!a)return-1===o&&r.resources.push(e),this._addResource(e,n),r;-1!==o&&(r.resources.splice(o,1),this._removeResource(e,n))}else{let t,r;if(d.some(a=>(r=this._getIdenticalSvcIdx(e,a),-1!==r&&(t=a,i=this.findServerInfo(t.server),s=i?.owningSystemUrl,n=s?this.findCredential(s,t.userId):void 0,o=r,!0))),a)t&&(t.resources.splice(o,1),this._removeResource(e,n));else if(t)return this._addResource(e,n),t}}_findOAuthInfo(e){let t=this.findOAuthInfo(e);if(!t)for(const r of this.oAuthInfos)if(this._isIdProvider(r.portalUrl,e)){t=r;break}return t}_addResource(e,t){t&&-1===this._getIdenticalSvcIdx(e,t)&&t.resources.push(e)}_removeResource(e,t){let r=-1;t&&(r=this._getIdenticalSvcIdx(e,t),r>-1&&t.resources.splice(r,1))}_useProxy(e,t){return t?.isAdmin&&!(0,p.FX)(e.adminTokenServiceUrl,this._appOrigin)||!this._isPortalDomain(e.tokenServiceUrl)&&"10.1"===String(e.currentVersion)&&!(0,p.FX)(e.tokenServiceUrl,this._appOrigin)}_getOrigin(e){const t=new p.s0(e);return t.scheme+"://"+t.host+(null!=t.port?":"+t.port:"")}_getServerInstanceRoot(e){const t=e.toLowerCase();let r=t.indexOf(this._agsRest);return-1===r&&this._isAdminResource(e)&&(r=this._agsAdmin.test(e)?e.replace(this._agsAdmin,"$1").length:e.search(this._adminSvcs)),-1!==r||(0,tt.$E)(t)||(r=t.indexOf("/sharing")),-1===r&&t.endsWith("/")&&(r=t.length-1),r>-1?e.slice(0,r):e}_hasSameServerInstance(e,t){return e.endsWith("/")&&(e=e.slice(0,-1)),e=e.toLowerCase(),t=this._getServerInstanceRoot(t).toLowerCase(),e=(0,tt.qG)(e),t=(0,tt.qG)(t),(e=e.slice(Math.max(0,e.indexOf(":"))))===t.slice(Math.max(0,t.indexOf(":")))}_sanitizeUrl(e){const t=(n.A.request.proxyUrl||"").toLowerCase(),r=t?e.toLowerCase().indexOf(t+"?"):-1;return-1!==r&&(e=e.slice(r+t.length+1)),e=(0,p.S8)(e),(0,p.An)(e).path}_isRESTService(e){return e.includes(this._agsRest)}_isAdminResource(e){return this._agsAdmin.test(e)||this._adminSvcs.test(e)}_isServerRsrc(e){return this._isRESTService(e)||this._isAdminResource(e)}_isIdenticalService(e,t){let r=!1;if(this._isRESTService(e)&&this._isRESTService(t)){const s=this._getSuffix(e).toLowerCase(),i=this._getSuffix(t).toLowerCase();if(r=s===i,!r){const e=/(.*)\/(MapServer|FeatureServer|UtilityNetworkServer).*/gi;r=s.replaceAll(e,"$1")===i.replaceAll(e,"$1")}}else this._isAdminResource(e)&&this._isAdminResource(t)?r=!0:this._isServerRsrc(e)||this._isServerRsrc(t)||!this._isPortalDomain(e)||(r=!0);return r}_isPortalDomain(e){const t=new p.s0(e.toLowerCase()),r=this._portalConfig;let s=this._gwDomains.some(e=>e.regex.test(t.uri));return!s&&r&&(s=this._hasSameServerInstance(this._getServerInstanceRoot(r.restBaseUrl),t.uri)),s||n.A.portalUrl&&(s=(0,p.FX)(t,n.A.portalUrl,!0)),s||(s=this._portals.some(e=>this._hasSameServerInstance(e,t.uri))),s=s||this._agsPortal.test(t.path),s}_isIdProvider(e,t){let r=-1,s=-1;this._gwDomains.forEach((i,n)=>{-1===r&&i.regex.test(e)&&(r=n),-1===s&&i.regex.test(t)&&(s=n)});let i=!1;if(r>-1&&s>-1&&(0===r||4===r?0!==s&&4!==s||(i=!0):1===r?1!==s&&2!==s||(i=!0):2===r?2===s&&(i=!0):3===r&&3===s&&(i=!0)),!i){const r=this.findServerInfo(t),s=r?.owningSystemUrl;s&&st(r)&&this._isPortalDomain(s)&&this._isIdProvider(e,s)&&(i=!0)}return i}_getIdenticalSvcIdx(e,t){let r=-1;for(let s=0;s<t.resources.length;s++){const i=t.resources[s];if(this._isIdenticalService(e,i)){r=s;break}}return r}_getSuffix(e){return e.replace(this._regexSDirUrl,"").replace(this._regexServerType,"$1")}_getTokenSvcUrl(e){let t,r,s;if(this._isRESTService(e)||this._isAdminResource(e)){const s=this._getServerInstanceRoot(e);return t=s+"/admin/generateToken",r=(0,o.A)(e=s+"/rest/info",{query:{f:"json"}}).then(e=>e.data),{adminUrl:t,promise:r}}if(this._isPortalDomain(e)){let t="";if(this._gwDomains.some(r=>(r.regex.test(e)&&(t=r.tokenServiceUrl),!!t)),t||this._portals.some(r=>(this._hasSameServerInstance(r,e)&&(t=r+this._gwTokenUrl),!!t)),t||(s=e.toLowerCase().indexOf("/sharing"),-1!==s&&(t=e.slice(0,s)+this._gwTokenUrl)),t||(t=this._getOrigin(e)+this._gwTokenUrl),t){const r=new p.s0(e).port;/^http:\/\//i.test(e)&&"7080"===r&&(t=t.replace(/:7080/i,":7443")),t=t.replace(/http:/i,"https:")}return t}}_processOAuthResponseParams(e,t,r){const s=t._oAuthCred;if(e.code){const i=s.codeVerifier;return s.codeVerifier=null,s.stateUID=null,s.save(),this._getOAuthToken(r.server,e.code,t.appId,this._getRedirectURI(t,!0),i).then(i=>{const n=new lt({userId:i.username,server:r.server??void 0,token:i.access_token,expires:Date.now()+1e3*i.expires_in,ssl:i.ssl,oAuthState:e.state,_oAuthCred:s});return t.userId=n.userId,s.storage=i.persist?nt:ot,s.refreshToken=i.refresh_token,s.token=null,s.expires=i.refresh_token_expires_in?Date.now()+1e3*i.refresh_token_expires_in:null,s.userId=n.userId,s.ssl=n.ssl,s.save(),n})}const i=new lt({userId:e.username,server:r.server??void 0,token:e.access_token,expires:Date.now()+1e3*Number(e.expires_in),ssl:"true"===e.ssl,oAuthState:e.state,_oAuthCred:s});return t.userId=i.userId,s.storage=e.persist?nt:ot,s.refreshToken=null,s.token=i.token,s.expires=i.expires,s.userId=i.userId,s.ssl=i.ssl,s.save(),Promise.resolve(i)}_processOAuthPopupParams(e){const t=this._oAuthDfd;if(this._oAuthDfd=null,t)if(clearInterval(this._oAuthIntervalId),this._oAuthOnPopupHandle?.remove(),e.error){const r="access_denied"===e.error,s=new a.A(r?"identity-manager:user-aborted":"identity-manager:authentication-failed",r?"ABORTED":"OAuth: "+e.error+" - "+e.error_description);t.reject(s)}else this._processOAuthResponseParams(e,t.oinfo_,t.sinfo_).then(e=>{t.resolve(e)}).catch(e=>{t.reject(e)})}_setOAuthResponseQueryString(e){e&&(e.startsWith("?")&&(e=e.slice(1)),this._processOAuthPopupParams((0,p.zf)(e)))}async _exchangeToken(e,t,r){return(await(0,o.A)(`${e}/sharing/rest/oauth2/exchangeToken`,{authMode:"anonymous",method:"post",query:{f:"json",client_id:t,token:r}})).data.token}async _getPlatformSelf(e,t){if(this._getPlatformSelfError&&Date.now()-this._getPlatformSelfError[1]<1e3)throw this._getPlatformSelfError[0];e=e.replace(/^http:/i,"https:");try{const r=await(0,o.A)(`${e}/sharing/rest/oauth2/platformSelf`,{authMode:"anonymous",headers:{"X-Esri-Auth-Client-Id":t,"X-Esri-Auth-Redirect-Uri":window.location.href.replace(/#.*$/,"")},method:"post",query:{f:"json",expiration:30},withCredentials:!0});return this._getPlatformSelfError=null,r.data}catch(e){throw"OAUTH_0066"===e.details?.messageCode&&(this._getPlatformSelfError=[e,Date.now()]),e}}_getPortalSelf(e,t){let r;return this._gwDomains.some(t=>(t.regex.test(e)&&(r=t.customBaseUrl),!!r)),r?Promise.resolve({allSSL:!0,currentVersion:"8.4",customBaseUrl:r,portalMode:"multitenant",supportsOAuth:!0}):(this._appOrigin.startsWith("https:")?e=e.replace(/^http:/i,"https:").replace(/:7080/i,":7443"):/^http:/i.test(t)&&(e=e.replace(/^https:/i,"http:").replace(/:7443/i,":7080")),(0,o.A)(e,{query:{f:"json"},authMode:"anonymous",withCredentials:!0}).then(e=>e.data))}_doPortalSignIn(e){const t=this._portalConfig,r=window.location.href,s=this.findServerInfo(e);return!(!t&&!this._isPortalDomain(r)||!(s?s.hasPortal||s.owningSystemUrl&&this._isPortalDomain(s.owningSystemUrl):this._isPortalDomain(e))||!(this._isIdProvider(r,e)||t&&(this._hasSameServerInstance(this._getServerInstanceRoot(t.restBaseUrl),e)||this._isIdProvider(t.restBaseUrl,e))||(0,p.FX)(r,e,!0)))}_checkProtocol(e,t,r,s){let i=!0;const n=s?t.adminTokenServiceUrl:t.tokenServiceUrl;return n.trim().toLowerCase().startsWith("https:")&&!this._appOrigin.startsWith("https:")&&(0,p.zs)(n)&&(i=!!this._protocolFunc&&!!this._protocolFunc({resourceUrl:e,serverInfo:t}),!i)&&r(new a.A("identity-manager:aborted","Aborted the Sign-In process to avoid sending password over insecure connection.")),i}_enqueue(e,t,r,s,i,n){return s||(s=(0,u.Tw)()),s.resUrl_=e,s.sinfo_=t,s.options_=r,s.admin_=i,s.refresh_=n,this._busy?this._hasSameServerInstance(this._getServerInstanceRoot(e),this._busy.resUrl_)?(this._oAuthDfd&&this._oAuthDfd.oAuthWin_&&this._oAuthDfd.oAuthWin_.focus(),this._soReqs.push(s)):this._xoReqs.push(s):this._doSignIn(s),s.promise}_doSignIn(e){this._busy=e,this._rejectOnPersistedPageShow=!1;const t=t=>{const r=e.options_?.resource,s=e.resUrl_,i=e.refresh_;let n=!1;this.credentials.includes(t)||(i&&this.credentials.includes(i)?(i.userId=t.userId,i.token=t.token,i.expires=t.expires,i.validity=t.validity,i.ssl=t.ssl,i.creationTime=t.creationTime,n=!0,t=i):this.credentials.push(t)),t.resources||(t.resources=[]),t.resources.includes(r||s)||t.resources.push(r||s),t.scope=this._isServerRsrc(s)?"server":"portal",t.emitTokenChange();const o=this._soReqs,a={};this._soReqs=[],o.forEach(e=>{if(!this._isIdenticalService(s,e.resUrl_)){const r=this._getSuffix(e.resUrl_);a[r]||(a[r]=!0,t.resources.push(e.resUrl_))}}),e.resolve(t),o.forEach(e=>{this._hasSameServerInstance(this._getServerInstanceRoot(s),e.resUrl_)?e.resolve(t):this._soReqs.push(e)}),this._busy=e.resUrl_=e.sinfo_=e.refresh_=null,n||this.emit("credential-create",{credential:t}),this._soReqs.length?this._doSignIn(this._soReqs.shift()):this._xoReqs.length&&this._doSignIn(this._xoReqs.shift())},r=t=>{e.reject(t),this._busy=e.resUrl_=e.sinfo_=e.refresh_=null,this._soReqs.length?this._doSignIn(this._soReqs.shift()):this._xoReqs.length&&this._doSignIn(this._xoReqs.shift())},s=(i,n,o,l)=>{const d=e.sinfo_,c=!e.options_||!1!==e.options_.prompt,f=d.hasPortal&&this._findOAuthInfo(e.resUrl_);let g,m;if(i)t(new lt({userId:i,server:d.server??void 0,token:o??void 0,expires:null!=l?Number(l):null,ssl:!!n}));else if(window!==window.parent&&this._appUrlObj.query?.["arcgis-auth-origin"]&&this._appUrlObj.query?.["arcgis-auth-portal"]&&this._hasSameServerInstance(this._getServerInstanceRoot(this._appUrlObj.query["arcgis-auth-portal"]),e.resUrl_)){window.parent.postMessage({type:"arcgis:auth:requestCredential"},this._appUrlObj.query["arcgis-auth-origin"]);const s=(0,h.on)(window,"message",e=>{e.source===window.parent&&e.data&&("arcgis:auth:credential"===e.data.type?(s.remove(),e.data.credential.expires<Date.now()?r(new a.A("identity-manager:credential-request-failed","Parent application's token has expired.")):t(new lt(e.data.credential))):"arcgis:auth:error"===e.data.type&&(s.remove(),"tokenExpiredError"===e.data.error.name?r(new a.A("identity-manager:credential-request-failed","Parent application's token has expired.")):r(a.A.fromJSON(e.data.error))))});(0,u.u7)(e.options_?.signal,()=>{s.remove()})}else if(f){let i=f._oAuthCred;if(!i){const e=new Je(f,nt),t=new Je(f,ot);e.isValid()&&t.isValid()?e.expires>t.expires?(i=e,t.destroy()):(i=t,e.destroy()):i=e.isValid()?e:t,f._oAuthCred=i}if(i.isValid()){g=new lt({userId:i.userId??void 0,server:d.server??void 0,token:i.token??void 0,expires:i.expires,ssl:i.ssl??void 0,_oAuthCred:i});const n=f.appId!==i.appId&&this._doPortalSignIn(e.resUrl_);n||i.refreshToken?(e._pendingDfd=i.refreshToken?this._getOAuthToken(d.server,i.refreshToken,i.appId).then(e=>(g.expires=Date.now()+1e3*e.expires_in,g.token=e.access_token,g)):Promise.resolve(g),e._pendingDfd.then(e=>n?this._exchangeToken(e.server,f.appId,e.token).then(t=>(e.token=t,e)).catch(()=>e):e).then(e=>{t(e)}).catch(e=>{const t=e.details?.httpStatus;t>0&&404!==t?(i.destroy(),s()):r(e)})):t(g)}else if(this._oAuthLocationParams&&this._hasSameServerInstance(f.portalUrl,this._oAuthLocationParams.state.portalUrl)&&(this._oAuthLocationParams.access_token||this._oAuthLocationParams.code&&this._oAuthLocationParams.state.uid===i.stateUID&&i.codeVerifier)){const s=this._oAuthLocationParams;this._oAuthLocationParams=null,e._pendingDfd=this._processOAuthResponseParams(s,f,d).then(e=>{t(e)}).catch(r)}else{const s=()=>{c?e._pendingDfd=this.oAuthSignIn(e.resUrl_,d,f,e.options_).then(t,r):(m=new a.A("identity-manager:not-authenticated","User is not signed in."),r(m))};this._doPortalSignIn(e.resUrl_)?e._pendingDfd=this._getPlatformSelf(d.server,f.appId).then(e=>{(0,p.FX)(e.portalUrl,this._appOrigin,!0)?(g=new lt({userId:e.username,server:d.server??void 0,expires:Date.now()+1e3*e.expires_in,token:e.token}),t(g)):s()}).catch(s):s()}}else if(c){if(this._checkProtocol(e.resUrl_,d,r,e.admin_)){let s=e.options_;e.admin_&&(s=s||{},s.isAdmin=!0),e._pendingDfd=this.signIn(e.resUrl_,d,s).then(t,r)}}else m=new a.A("identity-manager:not-authenticated","User is not signed in."),r(m)},i=()=>{const s=e.sinfo_,i=s.owningSystemUrl,n=e.options_;let o,a,l,h;if(n&&(o=n.token,a=n.error,l=n.prompt),h=this._findCredential(i,{token:o,resource:e.resUrl_}),!h)for(const e of this.credentials)if(this._isIdProvider(i,e.server)){h=e;break}if(h){const i=this.findCredential(e.resUrl_,h.userId);if(i)t(i);else if(it(s,this._legacyFed)){const e=h.toJSON();e.server=s.server,e.resources=null,t(new lt(e))}else(e._pendingDfd=this.generateToken(this.findServerInfo(h.server),null,{serverUrl:e.resUrl_,token:h.token,signal:e.options_.signal,ssl:h.ssl})).then(r=>{t(new lt({userId:h?.userId,server:s.server??void 0,token:r.token,expires:null!=r.expires?Number(r.expires):null,ssl:!!r.ssl,isAdmin:e.admin_,validity:r.validity}))},r)}else this._busy=null,o&&(e.options_.token=null),(e._pendingDfd=this.getCredential(i.replace(/\/?$/,"/sharing"),{resource:e.resUrl_,owningTenant:s.owningTenant,signal:e.options_.signal,token:o,error:a,prompt:l})).then(()=>{this._enqueue(e.resUrl_,e.sinfo_,e.options_,e,e.admin_)},t=>{e.resUrl_=e.sinfo_=e.refresh_=null,e.reject(t)})};this._errbackFunc=r;const n=e.sinfo_.owningSystemUrl,o=this._isServerRsrc(e.resUrl_),l=e.sinfo_._restInfoPms;l?l.promise.then(t=>{const r=e.sinfo_;if(r._restInfoPms){r.adminTokenServiceUrl=r._restInfoPms.adminUrl,r._restInfoPms=null,r.tokenServiceUrl=((0,c.wc)("authInfo.tokenServicesUrl",t)||(0,c.wc)("authInfo.tokenServiceUrl",t)||(0,c.wc)("tokenServiceUrl",t))??null,r.shortLivedTokenValidity=(0,c.wc)("authInfo.shortLivedTokenValidity",t)??null,r.currentVersion=t.currentVersion,r.owningTenant=t.owningTenant;const e=r.owningSystemUrl=t.owningSystemUrl;e&&this._portals.push(e)}o&&r.owningSystemUrl?i():s()},()=>{e.sinfo_._restInfoPms=null;const t=new a.A("identity-manager:server-identification-failed","Unknown resource - could not find token service endpoint.");r(t)}):o&&n?i():e.sinfo_._selfReq?e.sinfo_._selfReq.selfDfd.then(t=>{const r={};let s,i,n,o;return t&&(s=t.user?.username,r.username=s,r.allSSL=t.allSSL,i=t.supportsOAuth,o=parseFloat(t.currentVersion),"multitenant"===t.portalMode&&(n=t.customBaseUrl),e.sinfo_.currentVersion=o),e.sinfo_.webTierAuth=!!s,s&&this.normalizeWebTierAuth?this.generateToken(e.sinfo_,null,{ssl:r.allSSL}).catch(()=>null).then(e=>(r.portalToken=e?.token,r.tokenExpiration=e?.expires,r)):!s&&i&&o>=4.4&&!this._findOAuthInfo(e.resUrl_)?this._generateOAuthInfo({portalUrl:e.sinfo_.server,customBaseUrl:n,owningTenant:e.sinfo_._selfReq.owningTenant}).catch(()=>null).then(()=>r):r}).catch(()=>null).then(t=>{e.sinfo_._selfReq=null,t?s(t.username,t.allSSL,t.portalToken,t.tokenExpiration):s()}):s()}_generateOAuthInfo(e){let t,r=null,s=e.portalUrl;const i=e.customBaseUrl,n=e.owningTenant,a=!this._defaultOAuthInfo&&this._createDefaultOAuthInfo&&!this._hasTestedIfAppIsOnPortal;if(a){r=this._appUrlObj.path;const e=r.search(/\/(apps|home)\//);r=e>-1?r.slice(0,e):null}return a&&r?(this._hasTestedIfAppIsOnPortal=!0,t=(0,o.A)(r+"/sharing/rest",{query:{f:"json"}}).then(()=>{this._defaultOAuthInfo=new Ke({appId:"arcgisonline",popupCallbackUrl:r+"/home/oauth-callback.html"})})):t=Promise.resolve(),t.then(()=>{if(this._defaultOAuthInfo)return s=s.replace(/^http:/i,"https:"),(0,o.A)(s+"/sharing/rest/oauth2/validateRedirectUri",{query:{accountId:n,client_id:this._defaultOAuthInfo.appId,redirect_uri:(0,p.s2)(this._defaultOAuthInfo.popupCallbackUrl),f:"json"}}).then(e=>{if(e.data.valid){const t=this._defaultOAuthInfo.clone();e.data.urlKey&&i?t.portalUrl="https://"+e.data.urlKey.toLowerCase()+"."+i:t.portalUrl=s,t.popup=window!==window.top||!((0,p.FX)(s,this._appOrigin)||this._gwDomains.some(e=>e.regex.test(s)&&e.regex.test(this._appOrigin))),this.oAuthInfos.push(t)}})})}_doOAuthSignIn(e,t,r,s){const i=r._oAuthCred,n={portalUrl:r.portalUrl};!r.popup&&r.preserveUrlHash&&window.location.hash&&(n.hash=window.location.hash),i.stateUID&&(n.uid=i.stateUID);const o={client_id:r.appId,response_type:i.codeVerifier?"code":"token",state:JSON.stringify(n),expiration:r.expiration,locale:r.locale,redirect_uri:this._getRedirectURI(r,!!i.codeVerifier)};r.forceLogin&&(o.force_login=!0),r.forceUserId&&r.userId&&(o.prepopulatedusername=r.userId),!r.popup&&this._doPortalSignIn(e)&&(o.redirectToUserOrgUrl=!0),i.codeVerifier&&(o.code_challenge=s||i.codeVerifier,o.code_challenge_method=s?"S256":"plain");const l=r.portalUrl.replace(/^http:/i,"https:")+"/sharing/oauth2/authorize",d=l+"?"+(0,p.x0)(o);if(r.popup){const e=window.open(d,"esriJSAPIOAuth",r.popupWindowFeatures);if(e)e.focus(),this._oAuthDfd.oAuthWin_=e,this._oAuthIntervalId=setInterval(()=>{if(e.closed){clearInterval(this._oAuthIntervalId),this._oAuthOnPopupHandle.remove();const e=this._oAuthDfd;if(e){const t=new a.A("identity-manager:user-aborted","ABORTED");e.reject(t)}}},500),this._oAuthOnPopupHandle=(0,h.on)(window,["arcgis:auth:hash","arcgis:auth:location:search"],e=>{"arcgis:auth:hash"===e.type?this.setOAuthResponseHash(e.detail):this._setOAuthResponseQueryString(e.detail)});else{const e=new a.A("identity-manager:popup-blocked","ABORTED");this._oAuthDfd.reject(e)}}else this._rejectOnPersistedPageShow=!0,this._oAuthRedirectFunc?this._oAuthRedirectFunc({authorizeParams:o,authorizeUrl:l,resourceUrl:e,serverInfo:t,oAuthInfo:r}):window.location.href=d}_getRedirectURI(e,t){const r=window.location.href.replace(/#.*$/,"");if(e.popup)return(0,p.s2)(e.popupCallbackUrl);if(t){const e=(0,p.An)(r);return e.query&&["code","error","error_description","message_code","persist","state"].forEach(t=>{delete e.query[t]}),(0,p.a6)(e.path,e.query)}return r}}at.prototype.declaredClass="esri.identity.IdentityManagerBase";let lt=class extends l.nJ{constructor(e){super(e),this._oAuthCred=null,this.tokenRefreshBuffer=2,e?._oAuthCred&&(this._oAuthCred=e._oAuthCred)}initialize(){this.resources=this.resources||[],null==this.creationTime&&(this.creationTime=Date.now())}refreshToken(){const e=s.id,t=e.findServerInfo(this.server),r=t?.owningSystemUrl,i=!!r&&"server"===this.scope,n=i&&it(t,e._legacyFed),o=t.webTierAuth,a=o&&e.normalizeWebTierAuth,l=rt[this.server],h=l?.[this.userId];let d,c=this.resources&&this.resources[0],u=i?e.findServerInfo(r):null,p={username:this.userId,password:h};if(o&&!a)return;i&&!u&&e.serverInfos.some(t=>(e._isIdProvider(r,t.server)&&(u=t),!!u));const f=u?e.findCredential(u.server,this.userId):null;if(!i||f){if(!n){if(i)d={serverUrl:c,token:f?.token,ssl:f?.ssl};else if(a)p=null,d={ssl:this.ssl};else{if(!h){let r;return c&&(c=e._sanitizeUrl(c),this._enqueued=1,r=e._enqueue(c,t,null,null,this.isAdmin,this),r.then(()=>{this._enqueued=0,this.refreshServerTokens()}).catch(()=>{this._enqueued=0})),r}this.isAdmin&&(d={isAdmin:!0})}return e.generateToken(i?u:t,i?null:p,d).then(e=>{this.token=e.token,this.expires=null!=e.expires?Number(e.expires):null,this.creationTime=Date.now(),this.validity=e.validity,this.emitTokenChange(),this.refreshServerTokens()}).catch(()=>{})}f?.refreshToken()}}refreshServerTokens(){if("portal"===this.scope){const e=s.id;e.credentials.forEach(t=>{const r=e.findServerInfo(t.server),s=r?.owningSystemUrl;t!==this&&t.userId===this.userId&&s&&"server"===t.scope&&(e._hasSameServerInstance(this.server,s)||e._isIdProvider(s,this.server))&&(it(r,e._legacyFed)?(t.token=this.token,t.expires=this.expires,t.creationTime=this.creationTime,t.validity=this.validity,t.emitTokenChange()):t.refreshToken())})}}emitTokenChange(e){clearTimeout(this._refreshTimer);const t=s.id,r=this.server?t.findServerInfo(this.server):null,i=r?.owningSystemUrl,n=i?t.findServerInfo(i):null;!1===e||i&&"portal"!==this.scope&&(!n?.webTierAuth||t.normalizeWebTierAuth)||null==this.expires&&null==this.validity||this._startRefreshTimer(),this.emit("token-change")}destroy(){this.userId=this.server=this.token=this.expires=this.validity=this.resources=this.creationTime=null,this._oAuthCred&&(this._oAuthCred.destroy(),this._oAuthCred=null);const e=s.id,t=e.credentials.indexOf(this);t>-1&&e.credentials.splice(t,1),this.emitTokenChange(),this.emit("destroy")}toJSON(){const e=(0,d.oy)({userId:this.userId,server:this.server,token:this.token,expires:this.expires,validity:this.validity,ssl:this.ssl,isAdmin:this.isAdmin,creationTime:this.creationTime,scope:this.scope}),t=this.resources;return t&&t.length>0&&(e.resources=t.slice()),e}_startRefreshTimer(){clearTimeout(this._refreshTimer);const e=6e4*this.tokenRefreshBuffer,t=2**31-1;let r=(this.validity?this.creationTime+6e4*this.validity:this.expires)-Date.now();r<0?r=0:r>t&&(r=t),this._refreshTimer=setTimeout(this.refreshToken.bind(this),r>e?r-e:r)}};(0,i.Cg)([(0,f.MZ)()],lt.prototype,"creationTime",void 0),(0,i.Cg)([(0,f.MZ)()],lt.prototype,"expires",void 0),(0,i.Cg)([(0,f.MZ)()],lt.prototype,"isAdmin",void 0),(0,i.Cg)([(0,f.MZ)()],lt.prototype,"oAuthState",void 0),(0,i.Cg)([(0,f.MZ)()],lt.prototype,"resources",void 0),(0,i.Cg)([(0,f.MZ)()],lt.prototype,"scope",void 0),(0,i.Cg)([(0,f.MZ)()],lt.prototype,"server",void 0),(0,i.Cg)([(0,f.MZ)()],lt.prototype,"ssl",void 0),(0,i.Cg)([(0,f.MZ)()],lt.prototype,"token",void 0),(0,i.Cg)([(0,f.MZ)()],lt.prototype,"tokenRefreshBuffer",void 0),(0,i.Cg)([(0,f.MZ)()],lt.prototype,"userId",void 0),(0,i.Cg)([(0,f.MZ)()],lt.prototype,"validity",void 0),lt=(0,i.Cg)([(0,m.$)("esri.identity.Credential")],lt);class ht extends at{}ht.prototype.declaredClass="esri.identity.IdentityManager";const dt=new ht;(0,s.Aq)(dt)}}]);