@arcgis/portal-components 5.2.0-next.8 → 5.2.0-next.85

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 (515) hide show
  1. package/LICENSE.md +4 -2
  2. package/README.md +2 -2
  3. package/dist/cdn/2GBRZSEC.js +2 -0
  4. package/dist/cdn/2Q3FIPE2.js +2 -0
  5. package/dist/cdn/{GQFWFZXP.js → 3OBIA66A.js} +1 -1
  6. package/dist/cdn/3YCG5UCH.js +2 -0
  7. package/dist/cdn/44ORWHRO.js +2 -0
  8. package/dist/cdn/4QA4AYHJ.js +3 -0
  9. package/dist/cdn/4UANPBCB.js +2 -0
  10. package/dist/cdn/{QNUYUNEY.js → 5A54YFFZ.js} +1 -1
  11. package/dist/cdn/{WOZDQW3S.js → 5CB5N3QF.js} +1 -1
  12. package/dist/cdn/5HEZSRAM.js +2 -0
  13. package/dist/cdn/5MVBQWW3.js +2 -0
  14. package/dist/cdn/{7WZHZP6U.js → 63THOLAY.js} +9 -3
  15. package/dist/cdn/6BALICUQ.js +660 -0
  16. package/dist/cdn/6KVA4AKM.js +2 -0
  17. package/dist/cdn/6TO2BYXU.js +2 -0
  18. package/dist/cdn/76A6NXMY.js +2 -0
  19. package/dist/cdn/77U3PPBC.js +2 -0
  20. package/dist/cdn/7FISFQAB.js +2 -0
  21. package/dist/cdn/AMBLICID.js +2 -0
  22. package/dist/cdn/APIPQGZL.js +2 -0
  23. package/dist/cdn/BBVFGC6Y.js +2 -0
  24. package/dist/cdn/BSUUZZ2V.js +2 -0
  25. package/dist/cdn/BTLJZVSE.js +2 -0
  26. package/dist/cdn/{DHHSKOUY.js → BXCQOWAD.js} +1 -1
  27. package/dist/cdn/C747DAF4.js +2 -0
  28. package/dist/cdn/{DKBTJJMW.js → C7ZFXRPS.js} +1 -1
  29. package/dist/cdn/CD2GV5YW.js +2 -0
  30. package/dist/cdn/CFBSBZSS.js +2 -0
  31. package/dist/cdn/DHWAQSKG.js +2 -0
  32. package/dist/cdn/DPDTU2XT.js +2 -0
  33. package/dist/cdn/E4D3U6ZA.js +2 -0
  34. package/dist/cdn/EBYEZR4N.js +2 -0
  35. package/dist/cdn/ECA5GSSU.js +2 -0
  36. package/dist/cdn/EHJZA2TD.js +2 -0
  37. package/dist/cdn/EZYI6JU7.js +2 -0
  38. package/dist/cdn/F3ODJVJC.js +2 -0
  39. package/dist/cdn/FUZGJQMO.js +66 -0
  40. package/dist/cdn/FWJOBVEA.js +2 -0
  41. package/dist/cdn/GADH24KO.js +2 -0
  42. package/dist/cdn/GAZBGDIO.js +2 -0
  43. package/dist/cdn/GP3HHUGX.js +2 -0
  44. package/dist/cdn/{ZTHTFEYA.js → GY2BYUKF.js} +1 -1
  45. package/dist/cdn/H4SORY4B.js +2 -0
  46. package/dist/cdn/H5X6CZD4.js +2 -0
  47. package/dist/cdn/IJ3CLFAU.js +22 -0
  48. package/dist/cdn/ILDTKRON.js +2 -0
  49. package/dist/cdn/J57ZXL3U.js +2 -0
  50. package/dist/cdn/JCYCRSPL.js +451 -0
  51. package/dist/cdn/K3HEPB7Q.js +2 -0
  52. package/dist/cdn/KL4DIIKW.js +2 -0
  53. package/dist/cdn/{3PAHY5KA.js → KNRJ3WXR.js} +1 -1
  54. package/dist/cdn/KQCTBRGJ.js +2 -0
  55. package/dist/cdn/{F6V7MLPY.js → L6KBBJEC.js} +1 -1
  56. package/dist/cdn/LDIZD36E.js +2 -0
  57. package/dist/cdn/LRADZ46B.js +2 -0
  58. package/dist/cdn/MK3S5P4U.js +2 -0
  59. package/dist/cdn/NASFEWDT.js +2 -0
  60. package/dist/cdn/O2WST7EA.js +2 -0
  61. package/dist/cdn/{LQ3DMZ3K.js → O3RR6UMN.js} +1 -1
  62. package/dist/cdn/OAKVCMNN.js +2 -0
  63. package/dist/cdn/OBBYT2AV.js +2 -0
  64. package/dist/cdn/OHEUIODH.js +2 -0
  65. package/dist/cdn/OSA2BEVZ.js +2 -0
  66. package/dist/cdn/{53MSUMA3.js → OT4PZJNB.js} +17 -1
  67. package/dist/cdn/OTP4IA4V.js +2 -0
  68. package/dist/cdn/P2PZMKRD.js +2 -0
  69. package/dist/cdn/{LAFNDBTQ.js → P7YQCAM2.js} +1 -1
  70. package/dist/cdn/QE4CNVDQ.js +34 -0
  71. package/dist/cdn/{AQWTJKUH.js → QKCV7CY2.js} +10 -8
  72. package/dist/cdn/QREMLELA.js +2 -0
  73. package/dist/cdn/QS3GXAIH.js +2 -0
  74. package/dist/cdn/R5MGNFM2.js +2 -0
  75. package/dist/cdn/RHABZWTF.js +2 -0
  76. package/dist/cdn/SKRCLDPZ.js +2 -0
  77. package/dist/cdn/SLTFLCVR.js +99 -0
  78. package/dist/cdn/SOJ5KMMZ.js +2 -0
  79. package/dist/cdn/{GT26WGJS.js → T3LU5V74.js} +1 -1
  80. package/dist/cdn/T4DHIZOR.js +2 -0
  81. package/dist/cdn/TGTT2CVD.js +2 -0
  82. package/dist/cdn/{DXCPWJU4.js → TKCE4WYE.js} +1 -1
  83. package/dist/cdn/TUBYAQ6R.js +2 -0
  84. package/dist/cdn/TZ4TGONL.js +2 -0
  85. package/dist/cdn/UEL7BVMB.js +2 -0
  86. package/dist/cdn/UZLQALHY.js +2 -0
  87. package/dist/cdn/{RR4BIAPA.js → V4EYW3O6.js} +1 -1
  88. package/dist/cdn/V6N5BWDA.js +2 -0
  89. package/dist/cdn/V6VNED6L.js +2 -0
  90. package/dist/cdn/VBJRF4J7.js +2 -0
  91. package/dist/cdn/VMQIDO4Z.js +2 -0
  92. package/dist/cdn/{74XFARCV.js → VW7DSKPH.js} +1 -1
  93. package/dist/cdn/W2SYL7IJ.js +71 -0
  94. package/dist/cdn/{W6PSG4GX.js → W4FGRGLV.js} +10 -5
  95. package/dist/cdn/{SYJSVUUR.js → W4SAWMXS.js} +1 -1
  96. package/dist/cdn/WBZLQZYR.js +134 -0
  97. package/dist/cdn/WNZF3XVD.js +2 -0
  98. package/dist/cdn/XEK22IDA.js +2 -0
  99. package/dist/cdn/XRPX4IA3.js +2 -0
  100. package/dist/cdn/Y36YTONO.js +2 -0
  101. package/dist/cdn/Y72RYETN.js +2 -0
  102. package/dist/cdn/YDYJ5MIY.js +2 -0
  103. package/dist/cdn/YVKSTDL6.js +2 -0
  104. package/dist/cdn/ZAB6B2B6.js +2 -0
  105. package/dist/cdn/ZD6WCKLD.js +2 -0
  106. package/dist/cdn/assets/portal-account-switcher/t9n/messages.en.json +1 -0
  107. package/dist/cdn/assets/portal-ai-assistant/t9n/messages.en.json +1 -1
  108. package/dist/cdn/assets/portal-browser/t9n/messages.en.json +1 -0
  109. package/dist/cdn/assets/portal-group-browser/t9n/messages.en.json +1 -0
  110. package/dist/cdn/assets/portal-group-card/t9n/messages.en.json +1 -0
  111. package/dist/cdn/assets/portal-item-badges/t9n/messages.en.json +1 -0
  112. package/dist/cdn/assets/portal-item-card/t9n/messages.en.json +1 -0
  113. package/dist/cdn/assets/portal-item-favorite/t9n/messages.en.json +1 -0
  114. package/dist/cdn/assets/portal-item-type/icons/applicationtheme16.svg +1 -0
  115. package/dist/cdn/assets/portal-item-type/icons/applicationtheme32.svg +1 -0
  116. package/dist/cdn/assets/portal-item-type/icons/knowledgegraphconfiguration16.svg +1 -0
  117. package/dist/cdn/assets/portal-item-type/icons/knowledgegraphconfiguration32.svg +1 -0
  118. package/dist/cdn/assets/portal-item-type/icons/layout16.svg +1 -0
  119. package/dist/cdn/assets/portal-item-type/icons/layout32.svg +1 -0
  120. package/dist/cdn/assets/portal-item-type/icons/parquetfeaturelayer16.svg +1 -0
  121. package/dist/cdn/assets/portal-item-type/icons/parquetfeaturelayer32.svg +1 -0
  122. package/dist/cdn/assets/portal-item-type/icons/storymapframe16.svg +1 -0
  123. package/dist/cdn/assets/portal-item-type/icons/storymapframe32.svg +1 -0
  124. package/dist/cdn/assets/portal-item-type/t9n/messages.en.json +1 -1
  125. package/dist/cdn/assets/portal-navigation/apps/api-for-python.avif +0 -0
  126. package/dist/cdn/assets/portal-navigation/apps/appstudio.avif +0 -0
  127. package/dist/cdn/assets/portal-navigation/apps/arcade.avif +0 -0
  128. package/dist/cdn/assets/portal-navigation/apps/arcgis-360-vr.avif +0 -0
  129. package/dist/cdn/assets/portal-navigation/apps/arcgis-earth.avif +0 -0
  130. package/dist/cdn/assets/portal-navigation/apps/arcgis-enterprise.avif +0 -0
  131. package/dist/cdn/assets/portal-navigation/apps/arcgis-experience-builder.avif +0 -0
  132. package/dist/cdn/assets/portal-navigation/apps/arcgis-geoanalytics.avif +0 -0
  133. package/dist/cdn/assets/portal-navigation/apps/arcgis-hub.avif +0 -0
  134. package/dist/cdn/assets/portal-navigation/apps/arcgis-online.avif +0 -0
  135. package/dist/cdn/assets/portal-navigation/apps/arcgis-pro.avif +0 -0
  136. package/dist/cdn/assets/portal-navigation/apps/arcgis-reality-studio.avif +0 -0
  137. package/dist/cdn/assets/portal-navigation/apps/arcgis-urban.avif +0 -0
  138. package/dist/cdn/assets/portal-navigation/apps/blank.avif +0 -0
  139. package/dist/cdn/assets/portal-navigation/apps/business-analyst.avif +0 -0
  140. package/dist/cdn/assets/portal-navigation/apps/city-engine.avif +0 -0
  141. package/dist/cdn/assets/portal-navigation/apps/collector.avif +0 -0
  142. package/dist/cdn/assets/portal-navigation/apps/community-analyst.avif +0 -0
  143. package/dist/cdn/assets/portal-navigation/apps/configurable-apps.avif +0 -0
  144. package/dist/cdn/assets/portal-navigation/apps/dashboards-beta.avif +0 -0
  145. package/dist/cdn/assets/portal-navigation/apps/dashboards-classic.avif +0 -0
  146. package/dist/cdn/assets/portal-navigation/apps/data-pipelines.avif +0 -0
  147. package/dist/cdn/assets/portal-navigation/apps/deeplearningstudio.avif +0 -0
  148. package/dist/cdn/assets/portal-navigation/apps/demographics.avif +0 -0
  149. package/dist/cdn/assets/portal-navigation/apps/drone2map.avif +0 -0
  150. package/dist/cdn/assets/portal-navigation/apps/esri-events.avif +0 -0
  151. package/dist/cdn/assets/portal-navigation/apps/essential-apps.avif +0 -0
  152. package/dist/cdn/assets/portal-navigation/apps/excalibur.avif +0 -0
  153. package/dist/cdn/assets/portal-navigation/apps/explorer.avif +0 -0
  154. package/dist/cdn/assets/portal-navigation/apps/field-apps.avif +0 -0
  155. package/dist/cdn/assets/portal-navigation/apps/fieldmaps-beta.avif +0 -0
  156. package/dist/cdn/assets/portal-navigation/apps/fieldmaps-ea.avif +0 -0
  157. package/dist/cdn/assets/portal-navigation/apps/fieldmaps.avif +0 -0
  158. package/dist/cdn/assets/portal-navigation/apps/generic-app.avif +0 -0
  159. package/dist/cdn/assets/portal-navigation/apps/geobim.avif +0 -0
  160. package/dist/cdn/assets/portal-navigation/apps/geoplanner.avif +0 -0
  161. package/dist/cdn/assets/portal-navigation/apps/grid-view-9.avif +0 -0
  162. package/dist/cdn/assets/portal-navigation/apps/indoor.avif +0 -0
  163. package/dist/cdn/assets/portal-navigation/apps/indoors.avif +0 -0
  164. package/dist/cdn/assets/portal-navigation/apps/insights.avif +0 -0
  165. package/dist/cdn/assets/portal-navigation/apps/instant-apps.avif +0 -0
  166. package/dist/cdn/assets/portal-navigation/apps/ips.avif +0 -0
  167. package/dist/cdn/assets/portal-navigation/apps/knowledge-studio.avif +0 -0
  168. package/dist/cdn/assets/portal-navigation/apps/living-atlas.avif +0 -0
  169. package/dist/cdn/assets/portal-navigation/apps/location-platform.avif +0 -0
  170. package/dist/cdn/assets/portal-navigation/apps/map-maker.avif +0 -0
  171. package/dist/cdn/assets/portal-navigation/apps/map-viewer-beta.avif +0 -0
  172. package/dist/cdn/assets/portal-navigation/apps/map-viewer-classic.avif +0 -0
  173. package/dist/cdn/assets/portal-navigation/apps/map-viewer.avif +0 -0
  174. package/dist/cdn/assets/portal-navigation/apps/maps-adobe-cloud.avif +0 -0
  175. package/dist/cdn/assets/portal-navigation/apps/maps-for-office.avif +0 -0
  176. package/dist/cdn/assets/portal-navigation/apps/maps-for-power-bi.avif +0 -0
  177. package/dist/cdn/assets/portal-navigation/apps/maps-for-sharepoint.avif +0 -0
  178. package/dist/cdn/assets/portal-navigation/apps/marketplace.avif +0 -0
  179. package/dist/cdn/assets/portal-navigation/apps/mission.avif +0 -0
  180. package/dist/cdn/assets/portal-navigation/apps/monitor.avif +0 -0
  181. package/dist/cdn/assets/portal-navigation/apps/navigator.avif +0 -0
  182. package/dist/cdn/assets/portal-navigation/apps/notebook.avif +0 -0
  183. package/dist/cdn/assets/portal-navigation/apps/office-apps.avif +0 -0
  184. package/dist/cdn/assets/portal-navigation/apps/open-data.avif +0 -0
  185. package/dist/cdn/assets/portal-navigation/apps/operations-dashboard.avif +0 -0
  186. package/dist/cdn/assets/portal-navigation/apps/ortho-maker.avif +0 -0
  187. package/dist/cdn/assets/portal-navigation/apps/pro-extension.avif +0 -0
  188. package/dist/cdn/assets/portal-navigation/apps/quick-capture.avif +0 -0
  189. package/dist/cdn/assets/portal-navigation/apps/redistricting.avif +0 -0
  190. package/dist/cdn/assets/portal-navigation/apps/runtime.avif +0 -0
  191. package/dist/cdn/assets/portal-navigation/apps/scene-viewer.avif +0 -0
  192. package/dist/cdn/assets/portal-navigation/apps/sites.avif +0 -0
  193. package/dist/cdn/assets/portal-navigation/apps/solutions.avif +0 -0
  194. package/dist/cdn/assets/portal-navigation/apps/story-maps.avif +0 -0
  195. package/dist/cdn/assets/portal-navigation/apps/streetmap-premium.avif +0 -0
  196. package/dist/cdn/assets/portal-navigation/apps/survey123.avif +0 -0
  197. package/dist/cdn/assets/portal-navigation/apps/svg-app-circle.svg +1 -0
  198. package/dist/cdn/assets/portal-navigation/apps/svg-app-icon.svg +1 -0
  199. package/dist/cdn/assets/portal-navigation/apps/track-viewer.avif +0 -0
  200. package/dist/cdn/assets/portal-navigation/apps/user-type-extension-online.avif +0 -0
  201. package/dist/cdn/assets/portal-navigation/apps/user-type-extension.avif +0 -0
  202. package/dist/cdn/assets/portal-navigation/apps/vector-tile-style-editor.avif +0 -0
  203. package/dist/cdn/assets/portal-navigation/apps/velocity.avif +0 -0
  204. package/dist/cdn/assets/portal-navigation/apps/web-app-builder.avif +0 -0
  205. package/dist/cdn/assets/portal-navigation/apps/web-editor.avif +0 -0
  206. package/dist/cdn/assets/portal-navigation/apps/web-mapping.avif +0 -0
  207. package/dist/cdn/assets/portal-navigation/apps/workflow-manager-beta.avif +0 -0
  208. package/dist/cdn/assets/portal-navigation/apps/workflow-manager.avif +0 -0
  209. package/dist/cdn/assets/portal-navigation/apps/workforce.avif +0 -0
  210. package/dist/cdn/assets/portal-navigation/product-logos/advanced-editing-user-type-extension-glyph-32.svg +1 -0
  211. package/dist/cdn/assets/portal-navigation/product-logos/arc-hydro-glyph-32.svg +1 -0
  212. package/dist/cdn/assets/portal-navigation/product-logos/arcgis-360-vr-glyph-32.svg +1 -0
  213. package/dist/cdn/assets/portal-navigation/product-logos/arcgis-api-for-python-glyph-32.svg +1 -0
  214. package/dist/cdn/assets/portal-navigation/product-logos/arcgis-appstudio-glyph-32.svg +1 -0
  215. package/dist/cdn/assets/portal-navigation/product-logos/arcgis-arcade-expression-language-glyph-32.svg +1 -0
  216. package/dist/cdn/assets/portal-navigation/product-logos/arcgis-business-analyst-glyph-32.svg +1 -0
  217. package/dist/cdn/assets/portal-navigation/product-logos/arcgis-cityengine-glyph-32.svg +1 -0
  218. package/dist/cdn/assets/portal-navigation/product-logos/arcgis-collector-glyph-32.svg +1 -0
  219. package/dist/cdn/assets/portal-navigation/product-logos/arcgis-community-analyst-glyph-32.svg +1 -0
  220. package/dist/cdn/assets/portal-navigation/product-logos/arcgis-connectors-for-power-automate-glyph-32.svg +1 -0
  221. package/dist/cdn/assets/portal-navigation/product-logos/arcgis-dashboards-glyph-32.svg +1 -0
  222. package/dist/cdn/assets/portal-navigation/product-logos/arcgis-data-interoperability-glyph-32.svg +1 -0
  223. package/dist/cdn/assets/portal-navigation/product-logos/arcgis-data-pipelines-glyph-32.svg +1 -0
  224. package/dist/cdn/assets/portal-navigation/product-logos/arcgis-data-reviewer-glyph-32.svg +1 -0
  225. package/dist/cdn/assets/portal-navigation/product-logos/arcgis-deep-learning-studio-glyph-32.svg +1 -0
  226. package/dist/cdn/assets/portal-navigation/product-logos/arcgis-drone2map-glyph-32.svg +1 -0
  227. package/dist/cdn/assets/portal-navigation/product-logos/arcgis-earth-glyph-32.svg +1 -0
  228. package/dist/cdn/assets/portal-navigation/product-logos/arcgis-enterprise-glyph-32.svg +1 -0
  229. package/dist/cdn/assets/portal-navigation/product-logos/arcgis-excalibur-glyph-32.svg +1 -0
  230. package/dist/cdn/assets/portal-navigation/product-logos/arcgis-excalibur-gray-glyph-32.svg +1 -0
  231. package/dist/cdn/assets/portal-navigation/product-logos/arcgis-experience-builder-glyph-32.svg +1 -0
  232. package/dist/cdn/assets/portal-navigation/product-logos/arcgis-explorer-glyph-32.svg +1 -0
  233. package/dist/cdn/assets/portal-navigation/product-logos/arcgis-field-maps-designer-ea-glyph-32.svg +1 -0
  234. package/dist/cdn/assets/portal-navigation/product-logos/arcgis-field-maps-glyph-32.svg +1 -0
  235. package/dist/cdn/assets/portal-navigation/product-logos/arcgis-flight-glyph-32.svg +1 -0
  236. package/dist/cdn/assets/portal-navigation/product-logos/arcgis-for-autocad-glyph-32.svg +1 -0
  237. package/dist/cdn/assets/portal-navigation/product-logos/arcgis-for-autodesk-forma-glyph-32.svg +1 -0
  238. package/dist/cdn/assets/portal-navigation/product-logos/arcgis-for-developers-glyph-32.svg +1 -0
  239. package/dist/cdn/assets/portal-navigation/product-logos/arcgis-for-excel-glyph-32.svg +1 -0
  240. package/dist/cdn/assets/portal-navigation/product-logos/arcgis-for-microsoft-365-glyph-32.svg +1 -0
  241. package/dist/cdn/assets/portal-navigation/product-logos/arcgis-for-power-apps-glyph-32.svg +1 -0
  242. package/dist/cdn/assets/portal-navigation/product-logos/arcgis-for-teams-glyph-32.svg +1 -0
  243. package/dist/cdn/assets/portal-navigation/product-logos/arcgis-geoanalytics-engine-glyph-32.svg +1 -0
  244. package/dist/cdn/assets/portal-navigation/product-logos/arcgis-geobim-glyph-32.svg +1 -0
  245. package/dist/cdn/assets/portal-navigation/product-logos/arcgis-geoplanner-glyph-32.svg +1 -0
  246. package/dist/cdn/assets/portal-navigation/product-logos/arcgis-hub-glyph-32.svg +1 -0
  247. package/dist/cdn/assets/portal-navigation/product-logos/arcgis-image-glyph-32.svg +1 -0
  248. package/dist/cdn/assets/portal-navigation/product-logos/arcgis-indoors-glyph-32.svg +1 -0
  249. package/dist/cdn/assets/portal-navigation/product-logos/arcgis-insights-glyph-32.svg +1 -0
  250. package/dist/cdn/assets/portal-navigation/product-logos/arcgis-instant-apps-glyph-32.svg +1 -0
  251. package/dist/cdn/assets/portal-navigation/product-logos/arcgis-knowledge-glyph-32.svg +1 -0
  252. package/dist/cdn/assets/portal-navigation/product-logos/arcgis-living-atlas-of-the-world-glyph-32.svg +1 -0
  253. package/dist/cdn/assets/portal-navigation/product-logos/arcgis-location-platform-glyph-32.svg +1 -0
  254. package/dist/cdn/assets/portal-navigation/product-logos/arcgis-logo-glyph-32.svg +76 -0
  255. package/dist/cdn/assets/portal-navigation/product-logos/arcgis-maps-for-adobe-creative-cloud-glyph-32.svg +1 -0
  256. package/dist/cdn/assets/portal-navigation/product-logos/arcgis-maps-for-power-bi-glyph-32.svg +1 -0
  257. package/dist/cdn/assets/portal-navigation/product-logos/arcgis-maps-for-sharepoint-glyph-32.svg +1 -0
  258. package/dist/cdn/assets/portal-navigation/product-logos/arcgis-maps-sdk-for-javascript-glyph-32.svg +1 -0
  259. package/dist/cdn/assets/portal-navigation/product-logos/arcgis-maps-sdks-for-game-engines-glyph-32.svg +1 -0
  260. package/dist/cdn/assets/portal-navigation/product-logos/arcgis-maps-sdks-for-native-apps-glyph-32.svg +1 -0
  261. package/dist/cdn/assets/portal-navigation/product-logos/arcgis-maritime-glyph-32.svg +1 -0
  262. package/dist/cdn/assets/portal-navigation/product-logos/arcgis-marketplace-glyph-32.svg +1 -0
  263. package/dist/cdn/assets/portal-navigation/product-logos/arcgis-mission-glyph-32.svg +1 -0
  264. package/dist/cdn/assets/portal-navigation/product-logos/arcgis-monitor-glyph-32.svg +1 -0
  265. package/dist/cdn/assets/portal-navigation/product-logos/arcgis-monitor-white-glyph-32.svg +1 -0
  266. package/dist/cdn/assets/portal-navigation/product-logos/arcgis-navigator-glyph-32.svg +1 -0
  267. package/dist/cdn/assets/portal-navigation/product-logos/arcgis-notebooks-glyph-32.svg +1 -0
  268. package/dist/cdn/assets/portal-navigation/product-logos/arcgis-online-glyph-32.svg +1 -0
  269. package/dist/cdn/assets/portal-navigation/product-logos/arcgis-open-data-glyph-32.svg +1 -0
  270. package/dist/cdn/assets/portal-navigation/product-logos/arcgis-open-source-apps-glyph-32.svg +1 -0
  271. package/dist/cdn/assets/portal-navigation/product-logos/arcgis-ortho-maker-glyph-32.svg +1 -0
  272. package/dist/cdn/assets/portal-navigation/product-logos/arcgis-parcel-fabric-glyph-32.svg +1 -0
  273. package/dist/cdn/assets/portal-navigation/product-logos/arcgis-pipeline-referencing-glyph-32.svg +1 -0
  274. package/dist/cdn/assets/portal-navigation/product-logos/arcgis-pro-for-intelligence-glyph-32.svg +1 -0
  275. package/dist/cdn/assets/portal-navigation/product-logos/arcgis-pro-glyph-32.svg +1 -0
  276. package/dist/cdn/assets/portal-navigation/product-logos/arcgis-quickcapture-glyph-32.svg +1 -0
  277. package/dist/cdn/assets/portal-navigation/product-logos/arcgis-reality-studio-glyph-32.svg +1 -0
  278. package/dist/cdn/assets/portal-navigation/product-logos/arcgis-roads-and-highways-glyph-32.svg +1 -0
  279. package/dist/cdn/assets/portal-navigation/product-logos/arcgis-sites-glyph-32.svg +1 -0
  280. package/dist/cdn/assets/portal-navigation/product-logos/arcgis-solutions-glyph-32.svg +1 -0
  281. package/dist/cdn/assets/portal-navigation/product-logos/arcgis-storymaps-glyph-32.svg +1 -0
  282. package/dist/cdn/assets/portal-navigation/product-logos/arcgis-streetmap-premium-glyph-32.svg +1 -0
  283. package/dist/cdn/assets/portal-navigation/product-logos/arcgis-survey123-connect-glyph-32.svg +1 -0
  284. package/dist/cdn/assets/portal-navigation/product-logos/arcgis-survey123-glyph-32.svg +1 -0
  285. package/dist/cdn/assets/portal-navigation/product-logos/arcgis-tracker-glyph-32.svg +1 -0
  286. package/dist/cdn/assets/portal-navigation/product-logos/arcgis-urban-glyph-32.svg +1 -0
  287. package/dist/cdn/assets/portal-navigation/product-logos/arcgis-utility-network-management-glyph-32.svg +1 -0
  288. package/dist/cdn/assets/portal-navigation/product-logos/arcgis-velocity-glyph-32.svg +6 -0
  289. package/dist/cdn/assets/portal-navigation/product-logos/arcgis-web-appbuilder-glyph-32.svg +1 -0
  290. package/dist/cdn/assets/portal-navigation/product-logos/arcgis-web-editor-glyph-32.svg +1 -0
  291. package/dist/cdn/assets/portal-navigation/product-logos/arcgis-workflow-manager-glyph-32.svg +1 -0
  292. package/dist/cdn/assets/portal-navigation/product-logos/arcgis-workforce-glyph-32.svg +1 -0
  293. package/dist/cdn/assets/portal-navigation/product-logos/arcgis-world-geocoder-glyph-32.svg +1 -0
  294. package/dist/cdn/assets/portal-navigation/product-logos/calcite-design-system-glyph-32.svg +1 -0
  295. package/dist/cdn/assets/portal-navigation/product-logos/esri-community-glyph-32.svg +1 -0
  296. package/dist/cdn/assets/portal-navigation/product-logos/esri-demographics-glyph-32.svg +1 -0
  297. package/dist/cdn/assets/portal-navigation/product-logos/esri-events-glyph-32.svg +1 -0
  298. package/dist/cdn/assets/portal-navigation/product-logos/esri-offline-documentation-center--glyph-32.svg +1 -0
  299. package/dist/cdn/assets/portal-navigation/product-logos/esri-redistricting-glyph-32.svg +1 -0
  300. package/dist/cdn/assets/portal-navigation/product-logos/esri-reports-glyph-32.svg +1 -0
  301. package/dist/cdn/assets/portal-navigation/product-logos/esri-support-glyph-32.svg +1 -0
  302. package/dist/cdn/assets/portal-navigation/product-logos/map-viewer-glyph-32.svg +1 -0
  303. package/dist/cdn/assets/portal-navigation/product-logos/sceneviewer-glyph-32.svg +1 -0
  304. package/dist/cdn/assets/portal-navigation/product-logos/site-scan-for-arcgis-glyph-32.svg +1 -0
  305. package/dist/cdn/assets/portal-navigation/product-logos/site-scan-for-arcgis-le-glyph-32.svg +1 -0
  306. package/dist/cdn/assets/portal-navigation/product-logos/vector-tile-style-editor-glyph-32.svg +1 -0
  307. package/dist/cdn/assets/portal-navigation/product-logos/xr-viewer-glyph-32.svg +1 -0
  308. package/dist/cdn/assets/portal-navigation/t9n/messages.en.json +1 -0
  309. package/dist/cdn/index.js +1 -1
  310. package/dist/cdn/main.css +1 -1
  311. package/dist/chunks/dom.js +41 -0
  312. package/dist/chunks/fieldAddDelete.js +1 -1
  313. package/dist/chunks/functionalities.js +6 -4
  314. package/dist/chunks/groups.js +8 -83
  315. package/dist/chunks/groups2.js +64 -0
  316. package/dist/chunks/icons.js +11 -0
  317. package/dist/chunks/info.js +179 -0
  318. package/dist/chunks/item.js +29 -123
  319. package/dist/chunks/item2.js +128 -0
  320. package/dist/chunks/items.js +16 -0
  321. package/dist/chunks/loadClassificationData.js +19 -19
  322. package/dist/chunks/portal-account-switcher.js +6 -0
  323. package/dist/chunks/portal-browser.js +220 -0
  324. package/dist/chunks/portal-item-badge.js +349 -0
  325. package/dist/chunks/portal.js +91 -8
  326. package/dist/chunks/portal2.js +59 -0
  327. package/dist/chunks/query.js +159 -0
  328. package/dist/chunks/request.js +87 -0
  329. package/dist/chunks/requests.js +92 -44
  330. package/dist/chunks/store.js +14 -0
  331. package/dist/chunks/string.js +36 -0
  332. package/dist/chunks/thumbnail.js +189 -0
  333. package/dist/chunks/ui.js +9 -0
  334. package/dist/chunks/url.js +17 -0
  335. package/dist/chunks/user.js +99 -4
  336. package/dist/chunks/user2.js +13 -107
  337. package/dist/chunks/users.js +7 -0
  338. package/dist/chunks/utils.js +88 -0
  339. package/dist/chunks/utils2.js +656 -0
  340. package/dist/chunks/verified.js +40 -0
  341. package/dist/components/arcgis-portal-account-switcher/customElement.d.ts +99 -0
  342. package/dist/components/arcgis-portal-account-switcher/customElement.js +365 -0
  343. package/dist/components/arcgis-portal-account-switcher/index.d.ts +1 -0
  344. package/dist/components/arcgis-portal-account-switcher/index.js +11 -0
  345. package/dist/components/arcgis-portal-account-switcher-accounts/customElement.d.ts +100 -0
  346. package/dist/components/arcgis-portal-account-switcher-accounts/customElement.js +31 -0
  347. package/dist/components/arcgis-portal-account-switcher-accounts/index.d.ts +1 -0
  348. package/dist/components/arcgis-portal-account-switcher-accounts/index.js +5 -0
  349. package/dist/components/arcgis-portal-account-switcher-list/customElement.d.ts +104 -0
  350. package/dist/components/arcgis-portal-account-switcher-list/customElement.js +51 -0
  351. package/dist/components/arcgis-portal-account-switcher-list/index.d.ts +1 -0
  352. package/dist/components/arcgis-portal-account-switcher-list/index.js +7 -0
  353. package/dist/components/arcgis-portal-ai-assistant/agents/portalRouteKeys.d.ts +26 -0
  354. package/dist/components/arcgis-portal-ai-assistant/agents/types.d.ts +77 -3
  355. package/dist/components/arcgis-portal-ai-assistant/customElement.d.ts +59 -3
  356. package/dist/components/arcgis-portal-ai-assistant/customElement.js +1911 -595
  357. package/dist/components/arcgis-portal-ai-assistant/data/capability-registries/types.d.ts +34 -0
  358. package/dist/components/arcgis-portal-browser/customElement.d.ts +243 -0
  359. package/dist/components/arcgis-portal-browser/customElement.js +16 -0
  360. package/dist/components/arcgis-portal-browser/index.d.ts +1 -0
  361. package/dist/components/arcgis-portal-browser/index.js +6 -0
  362. package/dist/components/arcgis-portal-browser/utils/store.d.ts +35 -0
  363. package/dist/components/arcgis-portal-browser/utils/types.d.ts +24 -0
  364. package/dist/components/arcgis-portal-browser-actions/customElement.d.ts +185 -0
  365. package/dist/components/arcgis-portal-browser-actions/customElement.js +73 -0
  366. package/dist/components/arcgis-portal-browser-actions/index.d.ts +1 -0
  367. package/dist/components/arcgis-portal-browser-actions/index.js +6 -0
  368. package/dist/components/arcgis-portal-browser-actions/types.d.ts +9 -0
  369. package/dist/components/arcgis-portal-browser-filter-status/customElement.d.ts +193 -0
  370. package/dist/components/arcgis-portal-browser-filter-status/customElement.js +56 -0
  371. package/dist/components/arcgis-portal-browser-filter-status/index.d.ts +1 -0
  372. package/dist/components/arcgis-portal-browser-filter-status/index.js +5 -0
  373. package/dist/components/arcgis-portal-browser-pagination/customElement.d.ts +194 -0
  374. package/dist/components/arcgis-portal-browser-pagination/customElement.js +49 -0
  375. package/dist/components/arcgis-portal-browser-pagination/index.d.ts +1 -0
  376. package/dist/components/arcgis-portal-browser-pagination/index.js +2 -0
  377. package/dist/components/arcgis-portal-browser-search/customElement.d.ts +195 -0
  378. package/dist/components/arcgis-portal-browser-search/customElement.js +62 -0
  379. package/dist/components/arcgis-portal-browser-search/index.d.ts +1 -0
  380. package/dist/components/arcgis-portal-browser-search/index.js +3 -0
  381. package/dist/components/arcgis-portal-browser-sort/customElement.d.ts +196 -0
  382. package/dist/components/arcgis-portal-browser-sort/customElement.js +93 -0
  383. package/dist/components/arcgis-portal-browser-sort/index.d.ts +1 -0
  384. package/dist/components/arcgis-portal-browser-sort/index.js +9 -0
  385. package/dist/components/arcgis-portal-browser-sort/utils.d.ts +3 -0
  386. package/dist/components/arcgis-portal-browser-top-bar/customElement.d.ts +190 -0
  387. package/dist/components/arcgis-portal-browser-top-bar/customElement.js +50 -0
  388. package/dist/components/arcgis-portal-browser-top-bar/index.d.ts +1 -0
  389. package/dist/components/arcgis-portal-browser-top-bar/index.js +3 -0
  390. package/dist/components/arcgis-portal-browser-view/customElement.d.ts +21 -0
  391. package/dist/components/arcgis-portal-browser-view/customElement.js +30 -0
  392. package/dist/components/arcgis-portal-browser-view/index.d.ts +1 -0
  393. package/dist/components/arcgis-portal-browser-view/index.js +5 -0
  394. package/dist/components/arcgis-portal-classification-config/customElement.js +7 -7
  395. package/dist/components/arcgis-portal-classification-favorite/customElement.js +1 -1
  396. package/dist/components/arcgis-portal-field-delete/customElement.js +2 -1
  397. package/dist/components/arcgis-portal-group-badges/customElement.d.ts +0 -1
  398. package/dist/components/arcgis-portal-group-badges/customElement.js +26 -33
  399. package/dist/components/arcgis-portal-group-browser/customElement.d.ts +475 -0
  400. package/dist/components/arcgis-portal-group-browser/customElement.js +493 -0
  401. package/dist/components/arcgis-portal-group-browser/index.d.ts +1 -0
  402. package/dist/components/arcgis-portal-group-browser/index.js +6 -0
  403. package/dist/components/arcgis-portal-group-browser/types.d.ts +209 -0
  404. package/dist/components/arcgis-portal-group-browser-preview/customElement.d.ts +225 -0
  405. package/dist/components/arcgis-portal-group-browser-preview/customElement.js +150 -0
  406. package/dist/components/arcgis-portal-group-browser-preview/index.d.ts +1 -0
  407. package/dist/components/arcgis-portal-group-browser-preview/index.js +12 -0
  408. package/dist/components/arcgis-portal-group-browser-preview-card/customElement.d.ts +82 -0
  409. package/dist/components/arcgis-portal-group-browser-preview-card/customElement.js +93 -0
  410. package/dist/components/arcgis-portal-group-browser-preview-card/index.d.ts +1 -0
  411. package/dist/components/arcgis-portal-group-browser-preview-card/index.js +6 -0
  412. package/dist/components/arcgis-portal-group-card/customElement.d.ts +171 -0
  413. package/dist/components/arcgis-portal-group-card/customElement.js +163 -0
  414. package/dist/components/arcgis-portal-group-card/index.d.ts +1 -0
  415. package/dist/components/arcgis-portal-group-card/index.js +8 -0
  416. package/dist/components/arcgis-portal-info-banner/customElement.d.ts +14 -0
  417. package/dist/components/arcgis-portal-info-banner/customElement.js +31 -0
  418. package/dist/components/arcgis-portal-info-banner/index.d.ts +1 -0
  419. package/dist/components/arcgis-portal-info-banner/index.js +1 -0
  420. package/dist/components/arcgis-portal-item-actions/customElement.d.ts +74 -0
  421. package/dist/components/arcgis-portal-item-actions/customElement.js +89 -0
  422. package/dist/components/arcgis-portal-item-actions/index.d.ts +1 -0
  423. package/dist/components/arcgis-portal-item-actions/index.js +5 -0
  424. package/dist/components/arcgis-portal-item-badge/customElement.d.ts +260 -0
  425. package/dist/components/arcgis-portal-item-badge/customElement.js +9 -0
  426. package/dist/components/arcgis-portal-item-badge/index.d.ts +1 -0
  427. package/dist/components/arcgis-portal-item-badge/index.js +5 -0
  428. package/dist/components/arcgis-portal-item-badges/customElement.d.ts +48 -0
  429. package/dist/components/arcgis-portal-item-badges/customElement.js +35 -0
  430. package/dist/components/arcgis-portal-item-badges/index.d.ts +1 -0
  431. package/dist/components/arcgis-portal-item-badges/index.js +2 -0
  432. package/dist/components/arcgis-portal-item-badges/types.d.ts +1 -0
  433. package/dist/components/arcgis-portal-item-card/customElement.d.ts +215 -0
  434. package/dist/components/arcgis-portal-item-card/customElement.js +190 -0
  435. package/dist/components/arcgis-portal-item-card/index.d.ts +1 -0
  436. package/dist/components/arcgis-portal-item-card/index.js +10 -0
  437. package/dist/components/arcgis-portal-item-favorite/customElement.d.ts +36 -0
  438. package/dist/components/arcgis-portal-item-favorite/customElement.js +66 -0
  439. package/dist/components/arcgis-portal-item-favorite/index.d.ts +1 -0
  440. package/dist/components/arcgis-portal-item-favorite/index.js +3 -0
  441. package/dist/components/arcgis-portal-item-favorite/utils.d.ts +4 -0
  442. package/dist/components/arcgis-portal-item-type/customElement.d.ts +3 -1
  443. package/dist/components/arcgis-portal-item-type/customElement.js +22 -651
  444. package/dist/components/arcgis-portal-mentionable-text-area/customElement.js +40 -38
  445. package/dist/components/arcgis-portal-navigation/customElement.d.ts +530 -0
  446. package/dist/components/arcgis-portal-navigation/customElement.js +1858 -0
  447. package/dist/components/arcgis-portal-navigation/index.d.ts +1 -0
  448. package/dist/components/arcgis-portal-navigation/index.js +30 -0
  449. package/dist/components/arcgis-portal-navigation/types.d.ts +44 -0
  450. package/dist/components/arcgis-portal-replacement-item-redirect/customElement.js +53 -410
  451. package/dist/components/arcgis-portal-user-avatar/customElement.js +2 -2
  452. package/dist/components/arcgis-portal-user-popup/customElement.d.ts +5 -2
  453. package/dist/components/arcgis-portal-user-popup/customElement.js +82 -141
  454. package/dist/components/arcgis-portal-voice-input/customElement.d.ts +1 -1
  455. package/dist/components/portal-browser/components/portal-browser-filter/customElement.js +14 -0
  456. package/dist/components/portal-browser/components/portal-browser-filter/index.js +3 -0
  457. package/dist/components/portal-browser/components/portal-browser-filter-date/customElement.js +59 -0
  458. package/dist/components/portal-browser/components/portal-browser-filter-date/index.js +4 -0
  459. package/dist/components/portal-browser/components/portal-browser-filters/customElement.js +11 -0
  460. package/dist/components/portal-browser/components/portal-browser-filters/index.js +2 -0
  461. package/dist/components/portal-group-browser-filters/customElement.js +129 -0
  462. package/dist/components/portal-group-browser-filters/index.js +5 -0
  463. package/dist/components/portal-group-browser-pagination/customElement.js +13 -0
  464. package/dist/components/portal-group-browser-pagination/index.js +2 -0
  465. package/dist/components/portal-group-browser-sort/customElement.js +16 -0
  466. package/dist/components/portal-group-browser-sort/index.js +2 -0
  467. package/dist/docs/api.json +1 -1
  468. package/dist/docs/docs.json +1 -1
  469. package/dist/docs/vscode.css-custom-data.json +1 -1
  470. package/dist/docs/vscode.html-custom-data.json +1 -1
  471. package/dist/docs/web-types.json +1 -1
  472. package/dist/index.d.ts +198 -2
  473. package/dist/loader.js +26 -4
  474. package/dist/types/app-switcher.d.ts +71 -0
  475. package/dist/types/group.d.ts +14 -16
  476. package/dist/types/item.d.ts +80 -1
  477. package/dist/types/lumina.d.ts +160 -1
  478. package/dist/types/portal.d.ts +6 -0
  479. package/dist/types/preact.d.ts +182 -1
  480. package/dist/types/react.d.ts +204 -1
  481. package/dist/types/search.d.ts +30 -0
  482. package/dist/types/stencil.d.ts +162 -3
  483. package/dist/types/user.d.ts +16 -3
  484. package/package.json +10 -11
  485. package/dist/cdn/2EV3TV75.js +0 -65
  486. package/dist/cdn/35SKVD6F.js +0 -2
  487. package/dist/cdn/5VSDGPHH.js +0 -2
  488. package/dist/cdn/72N3KAXN.js +0 -2
  489. package/dist/cdn/ANPXRYLV.js +0 -5
  490. package/dist/cdn/B7633S2A.js +0 -422
  491. package/dist/cdn/BEHLBKKM.js +0 -2
  492. package/dist/cdn/EVDOPN3G.js +0 -54
  493. package/dist/cdn/F2AM2M4H.js +0 -2
  494. package/dist/cdn/G47ZZQYL.js +0 -2
  495. package/dist/cdn/GAHILDQF.js +0 -45
  496. package/dist/cdn/GHQ3ZW4U.js +0 -2
  497. package/dist/cdn/JNRN6DTV.js +0 -2
  498. package/dist/cdn/K3HS2LQ7.js +0 -2
  499. package/dist/cdn/KEKBRUUC.js +0 -2
  500. package/dist/cdn/MX3F5ZCL.js +0 -2
  501. package/dist/cdn/O3KBWLGU.js +0 -2
  502. package/dist/cdn/OQDPULPD.js +0 -2
  503. package/dist/cdn/QB34ACZ2.js +0 -2
  504. package/dist/cdn/RBC6VGDJ.js +0 -516
  505. package/dist/cdn/RNLVNDGG.js +0 -2
  506. package/dist/cdn/TMYTUOSS.js +0 -2
  507. package/dist/cdn/UPEVTVNZ.js +0 -2
  508. package/dist/cdn/V2EOXGK2.js +0 -2
  509. package/dist/cdn/WZC4LHVH.js +0 -2
  510. package/dist/cdn/X5NBQPTM.js +0 -2
  511. package/dist/cdn/YG5YYL6X.js +0 -2
  512. package/dist/cdn/YIMNOUTF.js +0 -2
  513. package/dist/cdn/YL7PGYWC.js +0 -5
  514. package/dist/cdn/YMPTDKT6.js +0 -2
  515. package/dist/cdn/YVJRXWM3.js +0 -3
@@ -1,375 +1,205 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import { c as Z } from "../../chunks/runtime.js";
3
- import { LitElement as tt, createEvent as et } from "@arcgis/lumina";
4
- import { css as st, render as at, html as w } from "lit";
5
- import { createRef as M, ref as T } from "lit/directives/ref.js";
6
- import { u as rt } from "../../chunks/useT9n.js";
7
- import { a as P, t as ot } from "../../chunks/functionalities.js";
8
- import { Annotation as h, StateGraph as $, START as G, END as y, NodeInterrupt as V } from "@langchain/langgraph/web";
9
- import { sendTraceMessage as g, invokeStructuredPrompt as b, createChatModel as F, sendUXSuggestion as B, createAgentRuntimeStateWithSharedState as E } from "@arcgis/ai-components/utils/index.js";
10
- import n from "zod";
11
- import { ChatPromptTemplate as L } from "@langchain/core/prompts";
12
- import { createAgent as Q } from "langchain";
13
- import { tool as K } from "@langchain/core/tools";
14
- import { s as nt, g as it, a as lt, c as ct, q as ut } from "../../chunks/groups.js";
15
- import mt from "@arcgis/core/identity/IdentityManager.js";
16
- import k from "@arcgis/core/request.js";
17
- import { Annotation as dt } from "@langchain/langgraph";
18
- const x = (s) => {
19
- for (let t = s.length - 1; t >= 0; t -= 1) {
20
- const e = s[t];
21
- if (e.type !== "human")
22
- continue;
23
- const a = e.content;
24
- if (typeof a == "string")
25
- return a;
26
- if (Array.isArray(a))
27
- return a.map(
28
- (r) => typeof r == "string" ? r : "text" in r && typeof r.text == "string" ? r.text : ""
29
- ).join(" ").trim();
30
- }
31
- return "";
32
- }, pt = () => ({ latestItemId: null, memory: {} }), N = (s) => {
33
- const t = s?.agentExecutionContext.sharedState.portalItemAnalyticsSummaryMemory?.value;
34
- return t ? { latestItemId: t.latestItemId, memory: t.memory } : pt();
35
- }, gt = n.object({
36
- intent: n.enum(["summarize", "followUp", "clarify"]),
37
- itemId: n.string().default(""),
38
- question: n.string().default("")
39
- }), ht = n.object({ summary: n.string(), followUpQuestions: n.array(n.string()).default([]) }), ft = n.object({ answer: n.string(), isRelevant: n.boolean() }), yt = async (s, t) => {
40
- await g({ text: "Answering follow-up...", agentName: "analytics" }, t);
41
- const e = N(s), a = s.analyticsItemId ?? e.latestItemId, r = a ? e.memory[a] : void 0, l = s.analyticsQuestion || x(s.agentExecutionContext.messages);
42
- return r ? {
43
- status: "success",
44
- outputMessage: (await b({
45
- promptText: bt,
46
- schema: ft,
47
- modelTier: "default",
48
- inputVariables: {
49
- summary: r.summary,
50
- question: l,
51
- fullContext: JSON.stringify(r.fullContext)
52
- }
53
- })).answer
54
- } : {
55
- status: "success",
56
- outputMessage: "I don't have enough information yet. Please ask me to summarize the item first using summarize item <item id>."
57
- };
58
- }, bt = `
59
- You answer follow-up questions about an ArcGIS item.
60
-
61
- Ground your answer in the provided item context.
62
- If the answer is not available from the provided context, state that clearly and suggest what to check next.
63
-
64
- Response rules:
65
- - Reply in concise markdown.
66
- - Keep the answer focused on the follow-up question.
67
- - Do not include internal identifiers.
68
- - Mark isRelevant=false when the question is not about this item or cannot be grounded in this item context.
69
-
70
- Item summary:
71
- {summary}
72
-
73
- Item full context
74
- {fullContext}
75
-
76
- Question:
77
- {question}
78
- `;
79
- function I(s) {
80
- const { portal: t, user: e } = s ?? {};
81
- if (!s || !t || !e)
2
+ import { c as Rt } from "../../chunks/runtime.js";
3
+ import { LitElement as Ut, createEvent as Ft } from "@arcgis/lumina";
4
+ import { css as Ot, render as Lt, html as v } from "lit";
5
+ import { createRef as P, ref as q } from "lit/directives/ref.js";
6
+ import { u as jt } from "../../chunks/useT9n.js";
7
+ import { NodeInterrupt as ft, Annotation as h, StateGraph as A, START as N, END as w } from "@langchain/langgraph/web";
8
+ import { sendTraceMessage as m, invokeStructuredPrompt as b, sendUXSuggestion as Q, createAgentRuntimeStateWithSharedState as G, createChatModel as W, getEmbeddings as Vt } from "@arcgis/ai-components/utils/index.js";
9
+ import s from "zod";
10
+ import { a as Bt, c as Kt, q as Qt } from "../../chunks/groups2.js";
11
+ import Wt from "@arcgis/core/identity/IdentityManager.js";
12
+ import H from "@arcgis/core/request.js";
13
+ import { a as D, t as Jt, b as B } from "../../chunks/functionalities.js";
14
+ import { ChatPromptTemplate as J } from "@langchain/core/prompts";
15
+ import { tool as yt } from "@langchain/core/tools";
16
+ import { s as _t, a as Yt } from "../../chunks/item.js";
17
+ import { g as Ht, e as Xt, i as Zt, c as te, a as ee } from "../../chunks/groups.js";
18
+ import ae from "@arcgis/core/portal/Portal.js";
19
+ const wt = (t) => {
20
+ const { portal: e, user: a } = t ?? {};
21
+ return !!t && !!e && !!a;
22
+ };
23
+ function T(t) {
24
+ if (!wt(t))
82
25
  throw new Error("Invalid context: PortalAssistantContext with portal and user is required.");
83
26
  }
84
- const W = K(
85
- async ({ itemTitle: s }, t) => {
86
- const e = s.trim();
87
- if (!e)
88
- return null;
89
- const a = t?.configurable?.context;
90
- I(a);
91
- const { result: r, error: l } = await nt(a.portal, e, { num: 1 });
92
- return l && console.error("Error searching for portal item by title:", l), r?.results[0]?.id || null;
93
- },
94
- {
95
- name: "resolvePortalItemIdByTitle",
96
- description: 'Resolves an ArcGIS Portal item title to the best-match item id. Use this when a user references an item by title (including hash mentions like #title or #"title with spaces") instead of an explicit item id.',
97
- schema: n.object({
98
- itemTitle: n.string().describe("The portal item title to resolve to an item id.")
99
- })
100
- }
101
- ), It = async (s, t) => {
102
- await g({ text: "Analyzing intent...", agentName: "analytics" }, t);
103
- const e = x(s.agentExecutionContext.messages), a = !!N(s).latestItemId, r = await L.fromTemplate(wt).format({
104
- userMessage: e,
105
- hasSummaryContext: String(a)
106
- }), c = await Q({
107
- model: await F({ modelTier: "fast" }),
108
- tools: [W],
109
- systemPrompt: r,
110
- responseFormat: gt,
111
- checkpointer: !0
112
- }).invoke({ messages: s.agentExecutionContext.messages }, t), { intent: i, itemId: o, question: u } = c.structuredResponse, m = i === "clarify" || i === "summarize" && !o || i === "followUp" && !u;
113
- return {
114
- agentExecutionContext: { ...s.agentExecutionContext },
115
- analyticsIntent: m ? "clarify" : i,
116
- analyticsItemId: o || null,
117
- analyticsQuestion: u || "",
118
- status: "success",
119
- outputMessage: m ? 'Please clarify with summarize item <item id>, summarize item #<title>, or summarize item #"<title with spaces>".' : ""
120
- };
121
- }, wt = `
122
- Classify the user analytics request.
27
+ const ne = `
28
+ Write a concise, friendly success message for adding members to a group.
123
29
 
124
30
  Rules:
125
- - intent="summarize" only when the user explicitly asks to summarize/overview/recap an item.
126
- - intent="followUp" for analytical questions about item details, including schema/fields/attributes/layers.
127
- - intent="clarify" when neither summarize nor follow-up intent is clear.
128
- - itemId must be the final resolved item id.
129
- - If request has explicit item id, set itemId directly.
130
- - If request references item title (for example #title, #"title with spaces", or plain quoted title), call resolvePortalItemIdByTitle and set itemId to the returned value.
131
- - Never return item titles in output fields.
132
- - If intent is "followUp", set question to the user's full question/request text.
133
- - If intent is "summarize", set question="".
134
- - When user asks to show/list/explain fields, schema, attributes, columns, or layer details, classify as "followUp" unless they explicitly request a summary.
135
- - If hasSummaryContext is true, prefer "followUp" for detail-oriented requests that do not explicitly ask to summarize.
136
-
137
- Examples:
138
- - "Summarize item 0123456789abcdef0123456789abcdef" => summarize, itemId="0123456789abcdef0123456789abcdef"
139
- - "Summarize item #california" => summarize, call resolvePortalItemIdByTitle("california") and set itemId to tool result
140
- - "Summarize item #"california farmland"" => summarize, call resolvePortalItemIdByTitle("california farmland") and set itemId to tool result
141
- - "Show the layer's available fields" => followUp
142
- - "List attributes and explain what status means" => followUp
143
- - "What fields are available?" with hasSummaryContext=true => followUp
144
- - "Give me an overview of item 0123456789abcdef0123456789abcdef" => summarize
31
+ - Keep it to 1-2 short sentences.
32
+ - Use plain text only.
33
+ - If there is no notAddedMembers, confirm that all requested members were added successfully.
34
+ - If there are notAddedMembers, acknowledge that some members could not be added and list the added and not added members separately then mention why based on the context
35
+ - Make sure to bold the usernames
145
36
 
146
- hasSummaryContext:
147
- {hasSummaryContext}
37
+ Added members:
38
+ {addedMembers}
148
39
 
149
- User message:
150
- {userMessage}
151
- `, xt = async (s, t) => {
152
- const e = s.analyticsItemId;
153
- if (!e)
154
- return {
155
- status: "success",
156
- outputMessage: 'Please clarify with summarize item <item id>, summarize item #<title>, or summarize item #"<title with spaces>".'
157
- };
158
- await g({ text: `Summarizing item ${e}...`, agentName: "analytics" }, t);
159
- const a = t?.configurable?.context;
160
- I(a);
161
- const { portal: r, user: l } = a, { result: c, error: i } = await it(l, r, e);
162
- if (i || !c)
163
- return await g({ text: "Failed to get item context for summarization", agentName: "analytics" }, t), {
164
- status: "success",
165
- outputMessage: "Unable to retrieve item context for summarization."
166
- };
167
- const { context: o } = c, u = await b({
168
- promptText: vt,
169
- schema: ht,
170
- modelTier: "default",
171
- inputVariables: { context: JSON.stringify(o) }
172
- }), { followUpQuestions: d, summary: p } = u, m = N(s), f = {
173
- latestItemId: e,
174
- memory: {
175
- ...m.memory,
176
- [e]: { summary: p, followUpQuestions: d, fullContext: o }
177
- }
178
- };
179
- return d.length && await B({ type: "suggested-prompts", data: { prompts: d } }, t), {
180
- status: "success",
181
- outputMessage: p,
182
- sharedStatePatch: { portalItemAnalyticsSummaryMemory: { value: f } }
183
- };
184
- }, vt = `
185
- You are a item summary tool for ArcGIS. Your job is to summarize an item's info based on the provided context.
186
- Summary rules:
187
- - The summary should be concise markdown, make sure to format the output nicely so it's easy to read.
188
- - Target length: 80-150 words.
189
- - Provide one short descriptive paragraph.
190
- - Also propose 3 concise follow-up questions grounded in the item summary.
191
- - Keep follow-up questions specific and actionable.
192
- Follow-up questions rules:
193
- - These questions should be in the format of a prompt that the user can click on.
194
- - Make sure the questions are relevant to the item summary and that you can answer based solely on the provided context.
195
- Do not include internal identifiers.
196
- If the user asks for a detailed summary, you may expand the response up to 300 words.
197
- Item context:
198
- {context}
199
- `, C = (s, t) => t ?? s, O = h.Root({
200
- ...E(),
201
- // States shared only across nodes in the graph, not between invocations
202
- analyticsIntent: h({
203
- reducer: C,
204
- default: () => "clarify"
205
- }),
206
- analyticsItemId: h({
207
- reducer: C,
208
- default: () => null
209
- }),
210
- analyticsQuestion: h({
211
- reducer: C,
212
- default: () => ""
213
- })
214
- }), St = () => new $(O).addNode("detectAnalyticsIntent", It).addNode("summarizePortalItem", xt).addNode("answerAnalyticsFollowUp", yt).addEdge(G, "detectAnalyticsIntent").addConditionalEdges("detectAnalyticsIntent", (t) => t.analyticsIntent === "summarize" ? "summarizePortalItem" : t.analyticsIntent === "followUp" ? "answerAnalyticsFollowUp" : y).addEdge("summarizePortalItem", y).addEdge("answerAnalyticsFollowUp", y), Mt = String.raw`- **portal-item-analytics** - Portal item analytics assistant:
215
- - summarizes ArcGIS portal items from item context
216
- - suggests follow-up prompts grounded in the item
217
- `, Tt = {
218
- id: "portal-item-analytics",
219
- name: "Portal Item Analytics",
220
- description: Mt,
221
- createGraph: St,
222
- workspace: O
223
- }, Pt = (s) => s.map((t) => `"${t}"`).join(", "), At = n.object({
224
- successMessage: n.string().default("")
225
- }), q = "portal-group-creation", D = "approveAddMembers", Ct = async (s, t) => {
226
- if (s.intentParams.intent !== "addMembers")
40
+ Not added members:
41
+ {notAddedMembers}
42
+ `, oe = (t) => t.map((e) => `"${e}"`).join(", "), re = s.object({
43
+ successMessage: s.string().default("")
44
+ }), X = "portal-group-creation", Z = "approveAddMembers", se = async (t, e) => {
45
+ if (t.intentParams.intent !== "addMembers")
227
46
  return {
228
47
  status: "success",
229
48
  outputMessage: "Use @mention usernames for the members you want to add."
230
49
  };
231
- const e = s.agentExecutionContext.sharedState.createdGroupId?.value;
232
- if (!e)
50
+ const a = t.agentExecutionContext.sharedState.createdGroupId?.value;
51
+ if (!a)
233
52
  return {
234
53
  status: "success",
235
54
  outputMessage: "Create a group first, then add members using @mention usernames."
236
55
  };
237
- const a = s.intentParams.memberInfo.memberIdentifiers.map((m) => m.trim()).filter(Boolean);
238
- if (!a.length)
56
+ const n = t.intentParams.memberInfo.memberIdentifiers.map((p) => p.trim()).filter(Boolean);
57
+ if (!n.length)
239
58
  return {
240
59
  status: "success",
241
60
  outputMessage: "Use @mention usernames for the members you want to add."
242
61
  };
243
- const l = `The following member(s) will be added to the newly created group:
62
+ const r = `The following member(s) will be added to the newly created group:
244
63
 
245
- ${a.map((m) => `- **@${m}**`).join(`
64
+ ${n.map((p) => `- **@${p}**`).join(`
246
65
  `)}
247
66
 
248
- Do you want to continue?`, { hitlResponse: c } = t?.configurable ?? {};
249
- if (c?.agentId !== q || c.id !== D) {
250
- const m = {
251
- agentId: q,
252
- id: D,
67
+ Do you want to continue?`, { hitlResponse: c } = e?.configurable ?? {};
68
+ if (c?.agentId !== X || c.id !== Z) {
69
+ const p = {
70
+ agentId: X,
71
+ id: Z,
253
72
  kind: "booleanChoice",
254
- message: l,
73
+ message: r,
255
74
  metadata: {
256
75
  action: "addMembers",
257
- groupId: e,
258
- members: [...a]
76
+ groupId: a,
77
+ members: [...n]
259
78
  }
260
79
  };
261
- throw new V(m);
80
+ throw new ft(p);
262
81
  }
263
82
  if (c.payload !== !0)
264
83
  return {
265
84
  status: "success",
266
85
  outputMessage: "Okay, I cancelled adding members to the group."
267
86
  };
268
- await g(
269
- { text: `Adding members ${Pt(a)}...`, agentName: "group-creation" },
270
- t
87
+ await m(
88
+ { text: `Adding members ${oe(n)}...`, agentName: "group-creation" },
89
+ e
271
90
  );
272
- const i = t?.configurable?.context;
273
- I(i);
274
- const { result: o, error: u } = await lt(i.portal, e, a);
275
- if (u || !o)
91
+ const i = e?.configurable?.context;
92
+ T(i);
93
+ const { result: l, error: u } = await Bt(i.portal, a, n);
94
+ if (u || !l)
276
95
  return {
277
96
  status: "success",
278
97
  outputMessage: "I could not add members to that group. Please confirm group access and user accounts, then try again."
279
98
  };
280
- const { addedUsernames: d, notAddedUsers: p } = o;
99
+ const { addedUsernames: d, notAddedUsers: g } = l;
281
100
  try {
282
101
  const f = (await b({
283
- promptText: $t,
284
- schema: At,
102
+ promptText: ne,
103
+ schema: re,
285
104
  modelTier: "fast",
286
105
  inputVariables: {
287
106
  addedMembers: d.join(", "),
288
107
  notAddedMembers: JSON.stringify(
289
- p.map((v) => ({ username: v.username, reason: v.error.message }))
108
+ g.map((y) => ({ username: y.username, reason: y.error.message }))
290
109
  )
291
110
  }
292
111
  })).successMessage;
293
112
  if (f)
294
113
  return { status: "success", outputMessage: f };
295
- } catch (m) {
296
- console.error("Error generating add-members success message:", m);
114
+ } catch (p) {
115
+ console.error("Error generating add-members success message:", p);
297
116
  }
298
117
  return {};
299
- }, $t = `
300
- Write a concise, friendly success message for adding members to a group.
118
+ }, ie = `
119
+ Write a concise, friendly success message after creating a portal group.
120
+
121
+ Rules:
122
+ - Mention that the group was created successfully.
123
+ - Mention that the user can add members by using @mention usernames.
124
+ - Keep it to 1-2 short sentences.
125
+ - Make sure to bold the group title in the message.
126
+
127
+ Group title:
128
+ {groupTitle}
129
+ `, ce = `
130
+ Write a concise, friendly failure message after an attempt to create a portal group.
301
131
 
302
132
  Rules:
303
133
  - Keep it to 1-2 short sentences.
304
134
  - Use plain text only.
305
- - If there is no notAddedMembers, confirm that all requested members were added successfully.
306
- - If there are notAddedMembers, acknowledge that some members could not be added and list the added and not added members separately then mention why based on the context
307
- - Make sure to bold the usernames
135
+ - Mention that group creation failed.
136
+ - Include the failure reason in user-friendly language.
137
+ - End with a clear next step the user can try.
308
138
 
309
- Added members:
310
- {addedMembers}
139
+ Group title:
140
+ {groupTitle}
311
141
 
312
- Not added members:
313
- {notAddedMembers}
314
- `, R = "portal-group-creation", U = "approveCreateGroup", Gt = n.object({
315
- successMessage: n.string().default("")
316
- }), Et = n.object({
317
- failureMessage: n.string().default("")
318
- }), Nt = async (s, t) => {
319
- if (s.intentParams.intent !== "create")
142
+ Failure reason:
143
+ {failureReason}
144
+ `, tt = "portal-group-creation", et = "approveCreateGroup", ue = s.object({
145
+ successMessage: s.string().default("")
146
+ }), le = s.object({
147
+ failureMessage: s.string().default("")
148
+ }), de = async (t, e) => {
149
+ if (t.intentParams.intent !== "create")
320
150
  return {
321
151
  status: "success",
322
152
  outputMessage: "Tell me the group title you want to use."
323
153
  };
324
- const e = s.intentParams.title.trim();
325
- if (!e)
154
+ const a = t.intentParams.title.trim();
155
+ if (!a)
326
156
  return {
327
157
  status: "success",
328
158
  outputMessage: "What title would you like for the new group?"
329
159
  };
330
- const a = `A group with the title **${e}** will be created. Do you want to continue?`, { hitlResponse: r } = t?.configurable;
331
- if (r?.agentId !== R || r.id !== U) {
160
+ const n = `A group with the title **${a}** will be created. Do you want to continue?`, { hitlResponse: o } = e?.configurable;
161
+ if (o?.agentId !== tt || o.id !== et) {
332
162
  const u = {
333
- agentId: R,
334
- id: U,
163
+ agentId: tt,
164
+ id: et,
335
165
  kind: "booleanChoice",
336
- message: a,
166
+ message: n,
337
167
  metadata: {
338
168
  action: "createGroup",
339
- title: e,
169
+ title: a,
340
170
  access: "private"
341
171
  }
342
172
  };
343
- throw new V(u);
173
+ throw new ft(u);
344
174
  }
345
- if (r.payload !== !0)
175
+ if (o.payload !== !0)
346
176
  return {
347
177
  status: "success",
348
- outputMessage: `Okay, I cancelled creating **${e}**.`
178
+ outputMessage: `Okay, I cancelled creating **${a}**.`
349
179
  };
350
- await g({ text: `Creating group "${e}"...`, agentName: "group-creation" }, t);
351
- const l = t?.configurable?.context;
352
- I(l);
353
- const { result: c, error: i } = await ct(l.portal, {
354
- title: e,
180
+ await m({ text: `Creating group "${a}"...`, agentName: "group-creation" }, e);
181
+ const r = e?.configurable?.context;
182
+ T(r);
183
+ const { result: c, error: i } = await Kt(r.portal, {
184
+ title: a,
355
185
  access: "private"
356
186
  });
357
187
  if (i || !c) {
358
188
  const u = i?.message?.trim() || "No additional details were provided.";
359
189
  try {
360
- const p = (await b({
361
- promptText: qt,
362
- schema: Et,
190
+ const g = (await b({
191
+ promptText: ce,
192
+ schema: le,
363
193
  modelTier: "fast",
364
194
  inputVariables: {
365
- groupTitle: e,
195
+ groupTitle: a,
366
196
  failureReason: u
367
197
  }
368
198
  })).failureMessage.trim();
369
- if (p)
199
+ if (g)
370
200
  return {
371
201
  status: "success",
372
- outputMessage: p
202
+ outputMessage: g
373
203
  };
374
204
  } catch (d) {
375
205
  console.error("Error generating create-group failure message:", d);
@@ -379,72 +209,42 @@ Not added members:
379
209
  outputMessage: "I could not create that group. Please confirm your permissions and try again with the group title."
380
210
  };
381
211
  }
382
- const o = c.id;
212
+ const l = c.id;
383
213
  try {
384
214
  const d = (await b({
385
- promptText: kt,
386
- schema: Gt,
215
+ promptText: ie,
216
+ schema: ue,
387
217
  modelTier: "fast",
388
218
  inputVariables: {
389
- groupTitle: e
219
+ groupTitle: a
390
220
  }
391
221
  })).successMessage.trim();
392
222
  if (d)
393
223
  return {
394
224
  status: "success",
395
225
  outputMessage: d,
396
- sharedStatePatch: { createdGroupId: { value: o } },
397
- createdGroupId: o
226
+ sharedStatePatch: { createdGroupId: { value: l } },
227
+ createdGroupId: l
398
228
  };
399
229
  } catch (u) {
400
230
  console.error("Error generating create-group success message:", u);
401
231
  }
402
232
  return {};
403
- }, kt = `
404
- Write a concise, friendly success message after creating a portal group.
405
-
406
- Rules:
407
- - Mention that the group was created successfully.
408
- - Mention that the user can add members by using @mention usernames.
409
- - Keep it to 1-2 short sentences.
410
- - Make sure to bold the group title in the message.
411
-
412
- Group title:
413
- {groupTitle}
414
- `, qt = `
415
- Write a concise, friendly failure message after an attempt to create a portal group.
416
-
417
- Rules:
418
- - Keep it to 1-2 short sentences.
419
- - Use plain text only.
420
- - Mention that group creation failed.
421
- - Include the failure reason in user-friendly language.
422
- - End with a clear next step the user can try.
423
-
424
- Group title:
425
- {groupTitle}
426
-
427
- Failure reason:
428
- {failureReason}
429
- `, Dt = n.object({
430
- intent: n.enum(["clarify", "create", "addMembers"]).default("clarify"),
431
- title: n.string().default(""),
432
- memberIdentifiers: n.array(n.string()).default([]),
433
- clarifyMessage: n.string().default("")
434
- }), Rt = async (s, t) => {
435
- await g({ text: "Thinking about groups...", agentName: "group-creation" }, t);
436
- const e = x(s.agentExecutionContext.messages).trim(), a = await b({
437
- promptText: Ut,
438
- schema: Dt,
439
- modelTier: "default",
440
- inputVariables: { userMessage: e }
441
- }), r = a.title.trim(), l = a.memberIdentifiers.filter(Boolean), c = a.clarifyMessage.trim(), i = a.intent === "create" && !!r, o = a.intent === "addMembers" && l.length > 0;
442
- return {
443
- intentParams: i ? { intent: "create", title: r } : o ? { intent: "addMembers", memberInfo: { memberIdentifiers: l } } : { intent: "clarify" },
444
- status: "success",
445
- outputMessage: !i && !o ? c : ""
446
- };
447
- }, Ut = `
233
+ }, I = (t) => {
234
+ for (let e = t.length - 1; e >= 0; e -= 1) {
235
+ const a = t[e];
236
+ if (a.type !== "human")
237
+ continue;
238
+ const n = a.content;
239
+ if (typeof n == "string")
240
+ return n;
241
+ if (Array.isArray(n))
242
+ return n.map(
243
+ (o) => typeof o == "string" ? o : "text" in o && typeof o.text == "string" ? o.text : ""
244
+ ).join(" ").trim();
245
+ }
246
+ return "";
247
+ }, pe = `
448
248
  You classify whether a user is asking to create a new ArcGIS Portal group or add members to an existing group.
449
249
 
450
250
  Rules:
@@ -470,385 +270,1901 @@ Examples:
470
270
 
471
271
  User message:
472
272
  {userMessage}
473
- `, zt = n.discriminatedUnion("destinationType", [
474
- n.object({
475
- destinationType: n.literal("portal-content")
476
- }),
477
- n.object({
478
- destinationType: n.literal("portal-groups")
479
- }),
480
- n.object({
481
- destinationType: n.literal("portal-item"),
482
- itemId: n.string().trim().min(1)
483
- }),
484
- n.object({
485
- destinationType: n.literal("portal-group"),
486
- groupId: n.string().trim().min(1)
487
- })
488
- ]);
489
- function jt(s) {
490
- const t = zt.safeParse(s);
491
- return t.success ? t.data : void 0;
492
- }
493
- const _ = "portal-navigation", J = async (s, t) => {
494
- await B({ type: _, data: { ...s } }, t);
495
- }, Vt = async (s, t) => {
496
- const e = s.createdGroupId ?? s.agentExecutionContext.sharedState.createdGroupId?.value;
497
- return e ? (await g({ text: "Preparing navigation...", agentName: "group-creation" }, t), await J({ destinationType: "portal-group", groupId: e }, t), {}) : {};
498
- }, z = (s, t) => t ?? s, Y = h.Root({
499
- ...E(),
273
+ `, me = s.object({
274
+ intent: s.enum(["clarify", "create", "addMembers"]).default("clarify"),
275
+ title: s.string().default(""),
276
+ memberIdentifiers: s.array(s.string()).default([]),
277
+ clarifyMessage: s.string().default("")
278
+ }), ge = async (t, e) => {
279
+ await m({ text: "Thinking about groups...", agentName: "group-creation" }, e);
280
+ const a = I(t.agentExecutionContext.messages).trim(), n = await b({
281
+ promptText: pe,
282
+ schema: me,
283
+ modelTier: "default",
284
+ inputVariables: { userMessage: a }
285
+ }), o = n.title.trim(), r = n.memberIdentifiers.filter(Boolean), c = n.clarifyMessage.trim(), i = n.intent === "create" && !!o, l = n.intent === "addMembers" && r.length > 0;
286
+ return {
287
+ intentParams: i ? { intent: "create", title: o } : l ? { intent: "addMembers", memberInfo: { memberIdentifiers: r } } : { intent: "clarify" },
288
+ status: "success",
289
+ outputMessage: !i && !l ? c : ""
290
+ };
291
+ }, he = [
292
+ "customSignInSection",
293
+ "loginsSection",
294
+ "changeLoginProviderSection",
295
+ "multiFactorAuthSection",
296
+ "multifactorEnforcementSection",
297
+ "multifactorDesignatedAdminsSection"
298
+ ], fe = ["customSignInCard", "loginCard", "multifactorAuthCard"], ye = ["newItem", "createLayer", "developerCredentials"], we = {
299
+ customSignInSection: "customSignInCard",
300
+ loginsSection: "loginCard",
301
+ changeLoginProviderSection: "loginCard",
302
+ multiFactorAuthSection: "multifactorAuthCard",
303
+ multifactorEnforcementSection: "multifactorAuthCard",
304
+ multifactorDesignatedAdminsSection: "multifactorAuthCard"
305
+ }, ve = ["favorites", "group", "living-atlas", "org"], be = ["featured", "my", "organization"], Ie = ["licenses", "members", "overview", "reports", "settings", "status"], Se = s.object({
306
+ destinationType: s.literal("portal-content"),
307
+ hash: s.enum(ve).optional(),
308
+ queryParams: s.object({
309
+ newItem: s.enum(ye).optional()
310
+ }).optional()
311
+ }), xe = s.object({
312
+ destinationType: s.literal("portal-groups"),
313
+ hash: s.enum(be).optional()
314
+ }), Te = s.object({
315
+ destinationType: s.literal("portal-org"),
316
+ hash: s.enum(Ie).optional(),
317
+ queryParams: s.object({
318
+ tab: s.literal("security").optional(),
319
+ section: s.enum(fe).optional(),
320
+ subsection: s.enum(he).optional(),
321
+ period: s.string().optional(),
322
+ startTime: s.string().optional(),
323
+ endTime: s.string().optional()
324
+ }).optional()
325
+ }), Ce = s.object({
326
+ destinationType: s.literal("portal-item"),
327
+ itemId: s.string().trim().min(1)
328
+ }), Me = s.object({
329
+ destinationType: s.literal("portal-group"),
330
+ groupId: s.string().trim().min(1)
331
+ }), Ae = s.object({
332
+ destinationType: s.union([
333
+ s.literal("portal-gallery"),
334
+ s.literal("portal-map-viewer"),
335
+ s.literal("portal-notebooks"),
336
+ s.literal("portal-scene-viewer")
337
+ ])
338
+ }), Ne = s.union([
339
+ Se,
340
+ xe,
341
+ Te,
342
+ Ce,
343
+ Me,
344
+ Ae
345
+ ]), vt = "portal-navigation", R = async (t, e) => {
346
+ const a = e?.configurable?.context;
347
+ !wt(a) || !a.navigationTargetMap?.[t.destinationType] || await Q({ type: vt, data: { ...t } }, e);
348
+ }, Ge = async (t, e) => {
349
+ const a = t.createdGroupId ?? t.agentExecutionContext.sharedState.createdGroupId?.value;
350
+ return a ? (await m({ text: "Preparing navigation...", agentName: "group-creation" }, e), await R({ destinationType: "portal-group", groupId: a }, e), {}) : {};
351
+ }, at = (t, e) => e ?? t, bt = h.Root({
352
+ ...G(),
500
353
  // * Shared state between nodes (but not persisted to the agent execution context)
501
354
  /** Parameters related to the user's intent for group creation actions */
502
- intentParams: h({ reducer: z, default: () => ({ intent: "clarify" }) }),
355
+ intentParams: h({ reducer: at, default: () => ({ intent: "clarify" }) }),
503
356
  /** The ID of the group that was created
504
357
  * even though we already have this in the shared state
505
358
  * we still need it here to also share between nodes
506
359
  */
507
- createdGroupId: h({ reducer: z, default: () => "" })
508
- }), Ft = () => new $(Y).addNode("detectGroupCreationIntent", Rt).addNode("createPortalGroup", Nt).addNode("addMembersToPortalGroup", Ct).addNode("suggestCreatedGroupNavigation", Vt).addEdge(G, "detectGroupCreationIntent").addConditionalEdges("detectGroupCreationIntent", (t) => {
509
- switch (t.intentParams.intent) {
360
+ createdGroupId: h({ reducer: at, default: () => "" })
361
+ }), Pe = () => new A(bt).addNode("detectGroupCreationIntent", ge).addNode("createPortalGroup", de).addNode("addMembersToPortalGroup", se).addNode("suggestCreatedGroupNavigation", Ge).addEdge(N, "detectGroupCreationIntent").addConditionalEdges("detectGroupCreationIntent", (e) => {
362
+ switch (e.intentParams.intent) {
510
363
  case "create":
511
364
  return "createPortalGroup";
512
365
  case "addMembers":
513
366
  return "addMembersToPortalGroup";
514
367
  default:
515
- return y;
368
+ return w;
516
369
  }
517
- }).addEdge("createPortalGroup", "suggestCreatedGroupNavigation").addEdge("addMembersToPortalGroup", "suggestCreatedGroupNavigation").addEdge("suggestCreatedGroupNavigation", y), Bt = String.raw`- **portal-group-creation** - Portal group creation assistant:
370
+ }).addEdge("createPortalGroup", "suggestCreatedGroupNavigation").addEdge("addMembersToPortalGroup", "suggestCreatedGroupNavigation").addEdge("suggestCreatedGroupNavigation", w), qe = String.raw`- **portal-group-creation** - Portal group creation assistant:
518
371
  - creates a new ArcGIS Portal group for the signed-in user
519
372
  - adds users to the newly created group using @mention usernames
520
- `, Lt = {
373
+ `, Ee = {
521
374
  id: "portal-group-creation",
522
375
  name: "Portal Group Creation",
523
- description: Bt,
524
- createGraph: Ft,
525
- workspace: Y
526
- }, H = "portalDocAssistantMemory", Qt = () => ({ conversationId: "" }), Kt = (s) => {
527
- const t = s?.[H]?.value;
528
- if (!t || typeof t != "object")
529
- return Qt();
530
- const e = t;
376
+ description: qe,
377
+ createGraph: Pe,
378
+ workspace: bt
379
+ }, It = "portalDocAssistantMemory", ze = () => ({ conversationId: "" }), ke = (t) => {
380
+ const e = t?.[It]?.value;
381
+ if (!e || typeof e != "object")
382
+ return ze();
383
+ const a = e;
384
+ return {
385
+ conversationId: typeof a.conversationId == "string" ? a.conversationId : ""
386
+ };
387
+ }, $e = (t) => ({
388
+ [It]: { value: t }
389
+ }), De = {
390
+ pipeline: {
391
+ follow_up: { allow: !1 }
392
+ }
393
+ };
394
+ function Re(t) {
531
395
  return {
532
- conversationId: typeof e.conversationId == "string" ? e.conversationId : ""
396
+ kind: "DocAIAssistantRequest",
397
+ filters: {
398
+ ...De,
399
+ persona: { persona: t }
400
+ }
533
401
  };
534
- }, Wt = (s) => ({
535
- [H]: { value: s }
536
- });
537
- async function Ot({
538
- portal: s,
539
- question: t,
540
- persona: e,
541
- previousConversationId: a,
542
- signal: r,
543
- skillId: l
402
+ }
403
+ async function Ue({
404
+ portal: t,
405
+ question: e,
406
+ persona: a,
407
+ previousConversationId: n,
408
+ signal: o,
409
+ skillId: r
544
410
  }) {
545
- l ??= "doc_ai_assistant";
546
- const i = await _t({
547
- portal: s,
548
- skillId: l,
549
- message: t,
550
- options: { context: {
551
- kind: "DocAIAssistantRequest",
552
- filters: { persona: { persona: e } }
553
- }, previousConversationId: a, signal: r }
411
+ r ??= "doc_ai_assistant";
412
+ const c = Re(a), i = await Fe({
413
+ portal: t,
414
+ skillId: r,
415
+ message: e,
416
+ options: { context: c, previousConversationId: n, signal: o }
554
417
  });
555
418
  return {
556
- reply: Jt(i, l),
419
+ reply: Oe(i, r),
557
420
  conversationId: i[0]?.conversationId ?? ""
558
421
  };
559
422
  }
560
- async function _t({
561
- portal: s,
562
- skillId: t,
563
- message: e,
564
- options: a
423
+ async function Fe({
424
+ portal: t,
425
+ skillId: e,
426
+ message: a,
427
+ options: n
565
428
  }) {
566
- const l = `${s.helperServices.aiAssistantServices.url}/skills/${t}/chat`, c = {
429
+ const r = `${t.helperServices.aiAssistantServices.url}/skills/${e}/chat`, c = {
567
430
  "Content-Type": "application/json",
568
- token: mt.findCredential(s.url)?.token ?? ""
569
- }, i = await k(l, {
431
+ token: Wt.findCredential(t.url)?.token ?? ""
432
+ }, i = await H(r, {
570
433
  method: "post",
571
434
  body: JSON.stringify({
572
- message: e,
573
- context: a.context,
574
- conversationId: a.previousConversationId
435
+ message: a,
436
+ context: n.context,
437
+ conversationId: n.previousConversationId
575
438
  }),
576
439
  headers: c,
577
- signal: a.signal
440
+ signal: n.signal
578
441
  });
579
442
  if (i.httpStatus !== 200)
580
443
  throw new Error(`Doc assistant chat failed (${i.httpStatus})`, {
581
444
  cause: i.data
582
445
  });
583
- const o = i.data, u = [o], { conversationId: d, inquiryId: p } = o, m = async (f, v) => {
584
- if (!v)
446
+ const l = i.data, u = [l], { conversationId: d, inquiryId: g } = l, p = async (f, y) => {
447
+ if (!y)
585
448
  return;
586
- await ot(1e3);
587
- const S = await k(l, {
449
+ await Jt(500);
450
+ const S = await H(r, {
588
451
  method: "post",
589
- body: JSON.stringify({ conversationId: d, inquiryId: p, ackSequenceNumber: f }),
452
+ body: JSON.stringify({ conversationId: d, inquiryId: g, ackSequenceNumber: f }),
590
453
  headers: c,
591
- signal: a.signal
454
+ signal: n.signal
592
455
  });
593
456
  if (S.httpStatus !== 200)
594
457
  throw new Error(`Doc assistant poll failed (${S.httpStatus})`, {
595
458
  cause: S.data
596
459
  });
597
- const A = S.data;
598
- u.push(A), await m(A.sequenceNumber, A.hasMore);
460
+ const C = S.data;
461
+ u.push(C), await p(C.sequenceNumber, C.hasMore);
599
462
  };
600
- return o.hasMore && await m(o.sequenceNumber, o.hasMore), u;
463
+ return l.hasMore && await p(l.sequenceNumber, l.hasMore), u;
601
464
  }
602
- function Jt(s, t) {
603
- switch (t) {
465
+ function Oe(t, e) {
466
+ switch (e) {
604
467
  case "doc_chat":
605
- return s.find((e) => e.message != null)?.message ?? "";
468
+ return t.find((a) => a.message != null)?.message ?? "";
606
469
  case "doc_ai_assistant":
607
- for (let e = s.length - 1; e >= 0; e -= 1) {
608
- const a = s[e];
609
- if (a.context?.kind === "DocAIAssistantContext") {
610
- const r = a.context.results?.[0]?.reply;
611
- if (r)
612
- return r;
470
+ for (let a = t.length - 1; a >= 0; a -= 1) {
471
+ const n = t[a];
472
+ if (n.context?.kind === "DocAIAssistantContext") {
473
+ const o = n.context.results?.[0]?.reply;
474
+ if (o)
475
+ return o;
613
476
  }
614
477
  }
615
478
  return "";
616
479
  default:
617
- return P(t);
480
+ return D(e);
618
481
  }
619
482
  }
620
- const Yt = async (s, t) => {
621
- await g({ text: "Asking documentation assistant...", agentName: "doc-assistant" }, t);
622
- const e = x(s.agentExecutionContext.messages).trim();
623
- if (!e)
483
+ const Le = async (t, e) => {
484
+ await m({ text: "Asking documentation assistant...", agentName: "doc-assistant" }, e);
485
+ const a = I(t.agentExecutionContext.messages).trim();
486
+ if (!a)
624
487
  return {
625
488
  status: "success",
626
489
  outputMessage: "Please share your question and I can help with ArcGIS and Portal documentation."
627
490
  };
628
- const a = t?.configurable?.context;
629
- I(a);
630
- const r = Kt(s.agentExecutionContext.sharedState), { reply: l, conversationId: c } = await Ot({
631
- portal: a.portal,
632
- question: e,
633
- previousConversationId: r.conversationId || void 0,
491
+ const n = e?.configurable?.context;
492
+ T(n);
493
+ const o = ke(t.agentExecutionContext.sharedState), { reply: r, conversationId: c } = await Ue({
494
+ portal: n.portal,
495
+ question: a,
496
+ previousConversationId: o.conversationId || void 0,
634
497
  skillId: "doc_ai_assistant",
635
- persona: "developers"
498
+ persona: "doc-online"
636
499
  });
637
500
  return {
638
501
  status: "success",
639
- outputMessage: l.trim() || "I could not retrieve a response from the documentation assistant.",
640
- sharedStatePatch: Wt({
641
- conversationId: c || r.conversationId
502
+ outputMessage: r.trim() || "I could not retrieve a response from the documentation assistant.",
503
+ sharedStatePatch: $e({
504
+ conversationId: c || o.conversationId
642
505
  })
643
506
  };
644
- }, Ht = K(
645
- async ({ groupTitle: s }, t) => {
646
- const e = s.trim();
647
- if (!e)
507
+ }, St = yt(
508
+ async ({ groupTitle: t }, e) => {
509
+ const a = t.trim();
510
+ if (!a)
648
511
  return null;
649
- const a = t?.configurable?.context;
650
- I(a);
512
+ const n = e?.configurable?.context;
513
+ T(n);
651
514
  try {
652
- return (await ut(a.portal, { query: `title:${e}`, num: 1 }))?.results[0]?.id || null;
653
- } catch (r) {
654
- return console.error("Error searching for portal group by title:", r), null;
515
+ return (await Qt(n.portal, { query: `title:${a}`, num: 1 }))?.results[0]?.id || null;
516
+ } catch (o) {
517
+ return console.error("Error searching for portal group by title:", o), null;
655
518
  }
656
519
  },
657
520
  {
658
521
  name: "resolvePortalGroupIdByTitle",
659
522
  description: "Resolves an ArcGIS Portal group title to the best-match group id. Use this when a user references a group by title instead of an explicit group id.",
660
- schema: n.object({
661
- groupTitle: n.string().describe("The portal group title to resolve to a group id.")
523
+ schema: s.object({
524
+ groupTitle: s.string().describe("The portal group title to resolve to a group id.")
662
525
  })
663
526
  }
664
- ), j = n.object({
665
- shouldSuggestNavigation: n.boolean().default(!1),
666
- destinationType: n.enum(["none", "portal-content", "portal-item", "portal-groups", "portal-group"]).default("none"),
667
- itemId: n.string().default(""),
668
- groupId: n.string().default("")
669
- }), Xt = async (s, t) => {
670
- await g({ text: "Extracting navigation intent...", agentName: "doc-assistant" }, t);
671
- const e = s.outputMessage.trim();
672
- if (!e)
673
- return {};
674
- const a = x(s.agentExecutionContext.messages).trim(), r = await L.fromTemplate(te).format({
675
- question: a,
676
- response: e
677
- }), c = await Q({
678
- model: await F({ modelTier: "default" }),
679
- tools: [W, Ht],
680
- systemPrompt: r,
681
- responseFormat: j,
682
- checkpointer: !0
683
- }).invoke({ messages: s.agentExecutionContext.messages }, t), i = j.parse(c.structuredResponse ?? {});
684
- if (!i.shouldSuggestNavigation || i.destinationType === "none")
685
- return {};
686
- const o = Zt(i);
687
- return o ? (await J(o, t), {}) : {};
688
- };
689
- function Zt({
690
- destinationType: s,
691
- itemId: t,
692
- groupId: e
693
- }) {
694
- switch (s) {
695
- case "portal-content":
696
- return { destinationType: "portal-content" };
697
- case "portal-groups":
698
- return { destinationType: "portal-groups" };
699
- case "portal-item":
700
- return t ? { destinationType: "portal-item", itemId: t } : null;
701
- case "portal-group":
702
- return e ? { destinationType: "portal-group", groupId: e } : null;
703
- case "none":
527
+ ), xt = yt(
528
+ async ({ itemTitle: t }, e) => {
529
+ const a = t.trim();
530
+ if (!a)
704
531
  return null;
705
- default:
706
- return P(s);
532
+ const n = e?.configurable?.context;
533
+ T(n);
534
+ const { result: o, error: r } = await _t(n.portal, a, { num: 1 });
535
+ return r && console.error("Error searching for portal item by title:", r), o?.results[0]?.id || null;
536
+ },
537
+ {
538
+ name: "resolvePortalItemIdByTitle",
539
+ description: 'Resolves an ArcGIS Portal item title to the best-match item id. Use this when a user references an item by title (including hash mentions like #title or #"title with spaces") instead of an explicit item id.',
540
+ schema: s.object({
541
+ itemTitle: s.string().describe("The portal item title to resolve to an item id.")
542
+ })
707
543
  }
544
+ );
545
+ function M(t, e = "#") {
546
+ const a = t.match(new RegExp(`\\${e}"([^"]+)"`, "u"));
547
+ if (a?.[1])
548
+ return a[1].trim();
549
+ const n = t.match(new RegExp(`\\${e}([^\\s"']+)`, "u"));
550
+ return n?.[1] ? n[1].trim() : null;
551
+ }
552
+ function je(t) {
553
+ const e = B(t).flatMap((a) => {
554
+ const n = a, o = t[a], r = [
555
+ n,
556
+ {
557
+ description: o.description,
558
+ hints: o.hints
559
+ }
560
+ ], c = o.sections ? B(o.sections).map((i) => {
561
+ const l = o.sections?.[i];
562
+ return [`${n}-${i}`, l];
563
+ }) : [];
564
+ return [r, ...c];
565
+ });
566
+ return Object.fromEntries(e);
567
+ }
568
+ function Ve(t) {
569
+ return Object.entries(t).map(([e, { description: a, hints: n }]) => ` - ${e}: ${a} (hints: ${n.join(", ")})`).join(`
570
+ `);
708
571
  }
709
- const te = `
572
+ const Be = {
573
+ // Example prompt: "Take me to my content"
574
+ "portal-content": {
575
+ description: "The main content page of the portal.",
576
+ hints: ["My content", "Content"]
577
+ },
578
+ // Example prompt: "Show my content favorites"
579
+ "portal-content-favorites": {
580
+ description: "The Favorites view under Content in the portal.",
581
+ hints: ["My favorites", "Favorites", "Content favorites"]
582
+ },
583
+ // Example prompt: "Open group content"
584
+ "portal-content-group": {
585
+ description: "The Groups view under Content in the portal.",
586
+ hints: ["Content groups", "Group content", "My groups content"]
587
+ },
588
+ // Example prompt: "Browse Living Atlas content"
589
+ "portal-content-living-atlas": {
590
+ description: "The Living Atlas view under Content in the portal.",
591
+ hints: ["Living Atlas", "Content living atlas"]
592
+ },
593
+ // Example prompt: "Show my organization's content"
594
+ "portal-content-organization": {
595
+ description: "The Organization view under Content in the portal.",
596
+ hints: ["Organization content", "Content organization", "My organization content"]
597
+ },
598
+ // Example prompt: "Open the gallery"
599
+ "portal-gallery": {
600
+ description: "The gallery page of the portal.",
601
+ hints: ["Gallery", "Featured content", "Maps and apps"]
602
+ },
603
+ // Example prompt: "Go to the group called #Urban Planning"
604
+ "portal-group": {
605
+ description: "A specific group page in the portal.",
606
+ hints: ["Group", "group page"]
607
+ },
608
+ // Example prompt: "Browse groups"
609
+ "portal-groups": {
610
+ description: "The groups listing page of the portal.",
611
+ hints: ["Groups", "Browse groups"]
612
+ },
613
+ // Example prompt: "Show featured groups"
614
+ "portal-groups-featured": {
615
+ description: "The Featured groups view under Groups in the portal.",
616
+ hints: ["Featured groups", "Groups featured"]
617
+ },
618
+ // Example prompt: "Show my groups"
619
+ "portal-groups-my": {
620
+ description: "The My groups view under Groups in the portal.",
621
+ hints: ["My groups", "Groups my"]
622
+ },
623
+ // Example prompt: "Show organization groups"
624
+ "portal-groups-organization": {
625
+ description: "The Organization groups view under Groups in the portal.",
626
+ hints: ["Organization groups", "Groups organization", "My organization groups"]
627
+ },
628
+ // Example prompt: "Open item #Road Closures Map"
629
+ "portal-item": {
630
+ description: "A specific item page in the portal.",
631
+ hints: ["Item", "item page"]
632
+ },
633
+ // Example prompt: "Open Map Viewer"
634
+ "portal-map-viewer": {
635
+ description: "The Map Viewer app of the portal.",
636
+ hints: ["Map Viewer", "Map", "Open map"]
637
+ },
638
+ // Example prompt: "Take me to notebooks"
639
+ "portal-notebooks": {
640
+ description: "The Notebooks home page of the portal.",
641
+ hints: ["Notebooks", "Notebook home", "My notebooks"]
642
+ },
643
+ // Example prompt: "Open Scene Viewer"
644
+ "portal-scene-viewer": {
645
+ description: "The Scene Viewer app of the portal.",
646
+ hints: ["Scene Viewer", "Scene", "3D scene"]
647
+ },
648
+ // Example prompt: "Open organization security settings"
649
+ "portal-org-security": {
650
+ description: "The Organization > Settings > Security page of the portal.",
651
+ hints: ["Organization settings", "Security", "Organization > Settings > Security"],
652
+ sections: {
653
+ // Example prompt: "How do I set up custom sign in?"
654
+ "custom-sign-in": {
655
+ description: "The Organization > Settings > Security > Custom Sign In section of the portal.",
656
+ hints: ["Custom Sign In", "Organization > Settings > Security > Custom Sign In"]
657
+ },
658
+ // Example prompt: "How do I configure login options?"
659
+ logins: {
660
+ description: "The Organization > Settings > Security > Logins section of the portal.",
661
+ hints: ["Logins", "Organization > Settings > Security > Logins"]
662
+ },
663
+ // Example prompt: "How do I change our login provider?"
664
+ "change-login-provider": {
665
+ description: "The Organization > Settings > Security > Change Login Provider section of the portal.",
666
+ hints: ["Change Login Provider", "Organization > Settings > Security > Change Login Provider"]
667
+ },
668
+ // Example prompt: "How do I configure MFA?"
669
+ "multifactor-auth": {
670
+ description: "The Organization > Settings > Security > Multifactor Authentication section of the portal.",
671
+ hints: ["MFA", "Multifactor Authentication", "Organization > Settings > Security > MFA"]
672
+ },
673
+ // Example prompt: "How do I configure Enforce MFA?"
674
+ "multifactor-enforcement": {
675
+ description: "The Organization > Settings > Security > Enforce MFA section of the portal.",
676
+ hints: ["Enforce MFA", "MFA enforcement", "Organization > Settings > Security > Enforce MFA"]
677
+ },
678
+ // Example prompt: "How do I set designated admins for MFA?"
679
+ "multifactor-designated-admins": {
680
+ description: "The Organization > Settings > Security > Designated Admins section of the portal.",
681
+ hints: ["Designated admins", "MFA designated admins", "Organization > Settings > Security > Designated Admins"]
682
+ }
683
+ }
684
+ },
685
+ // Example prompt: "I want to add a new item"
686
+ "portal-content-new-item": {
687
+ description: "The Content page with the New Item flow opened.",
688
+ hints: ["New item", "Create new item", "Content > My Content > New Item"],
689
+ sections: {
690
+ // Example prompt: "Create a new feature layer"
691
+ "feature-layer": {
692
+ description: "The Content page with New Item flow set to Feature Layer as the starting step.",
693
+ hints: ["Feature Layer", "New Feature Layer", "Content > My Content > New Item > Feature Layer"]
694
+ },
695
+ // Example prompt: "Create developer credentials"
696
+ "developer-credentials": {
697
+ description: "The Content page with New Item flow set to Developer Credentials as the starting step.",
698
+ hints: [
699
+ "Developer Credentials",
700
+ "New developer credentials",
701
+ "Content > My Content > New Item > Developer Credentials"
702
+ ]
703
+ }
704
+ }
705
+ }
706
+ }, Tt = je(Be), Ke = B(Tt), Qe = Ve(Tt), We = `
710
707
  You decide whether the assistant response should include a navigation action to ArcGIS Portal.
711
708
 
712
709
  Given the user question and assistant response:
713
710
  - Decide if a navigation action would help the user complete the task.
714
- - If yes, choose one destination type:
715
- - portal-content: portal content page
716
- - portal-groups: groups listing page
717
- - portal-item: specific item page (requires itemId)
718
- - portal-group: specific group page (requires groupId)
711
+ - If yes, choose one destinationType:
712
+ ${Qe}
719
713
 
720
714
  Rules:
715
+ - Only suggest navigation when you are highly confident the destination will help complete the user's task.
716
+ - If confidence is below 0.85, set shouldSuggestNavigation=false and destinationType=none.
717
+ - If there is no clear destination from the allowed types, set shouldSuggestNavigation=false and destinationType=none.
721
718
  - If no navigation is useful, set shouldSuggestNavigation=false and destinationType=none.
722
- - If destinationType is portal-item and user references an item by title (for example #title, #"title with spaces", or plain quoted title), call resolvePortalItemIdByTitle and set itemId from the tool result.
723
- - If destinationType is portal-group and user references a group by title (for example $title, $"title with spaces", or plain quoted group title), call resolvePortalGroupIdByTitle and set groupId from the tool result.
724
- - Do not invent itemId.
725
- - Do not invent groupId.
726
- - Prefer destinationType=portal-content for generic "go to content" guidance.
719
+ - Prefer the most specific destination that is clearly supported by the question and response.
720
+ - Use entity-level destinations over collection/root destinations when both could apply and the entity target is explicit.
721
+ - Use collection/root destinations only for generic browsing intent with no specific entity target.
722
+ - If a chosen destination requires parameters, include all required parameters.
723
+ - If required parameters are missing or uncertain, set shouldSuggestNavigation=false and destinationType=none.
724
+ - Do not invent required parameters.
725
+ - Always include a confidence score from 0 to 1 in the output.
726
+ - Confidence means confidence that a navigation suggestion should be shown to the user.
727
+ - If shouldSuggestNavigation=false or destinationType=none, confidence must be <= 0.5.
728
+ - Use confidence >= 0.85 only when shouldSuggestNavigation=true and destinationType is not none.
727
729
 
728
730
  User question:
729
731
  {question}
730
732
 
731
733
  Assistant response:
732
734
  {response}
733
- `, X = dt.Root({
734
- ...E()
735
- }), ee = () => new $(X).addNode("answerDocQuestion", Yt).addNode("extractNavigationIntent", Xt).addEdge(G, "answerDocQuestion").addEdge("answerDocQuestion", "extractNavigationIntent").addEdge("extractNavigationIntent", y), se = String.raw`- **portal-doc-assistant** - General ArcGIS documentation and Portal help assistant:
736
- - answers general ArcGIS, Portal, Enterprise, and JavaScript SDK questions
737
- - acts as a fallback when specialized agents are not applicable
738
- `, ae = {
739
- id: "portal-doc-assistant",
740
- name: "Portal Doc Assistant",
741
- description: se,
742
- createGraph: ee,
743
- workspace: X
744
- }, re = st`:host{height:100%;border-width:1px;border-style:solid;border-color:var(--calcite-color-border-3);display:block;width:100%;--tw-shadow: 0 1px 6px -1px rgba(0, 0, 0, .16), 0 1px 2px -1px rgba(0, 0, 0, .08);--tw-shadow-colored: 0 1px 6px -1px var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.chat-entry{display:flex;flex-direction:column;gap:.75rem;width:100%}.chat-actions{display:flex;justify-content:flex-end;gap:.5rem}.header-actions{display:flex;gap:.5rem;padding-inline-start:.75rem}.navigation-block{display:flex;flex-direction:column;align-items:stretch;gap:.35rem;margin-top:.5rem}.navigation-button{width:100%;margin-block:.25rem}.navigation-block-description{font-size:.75rem;color:var(--calcite-color-text-3)}`, oe = (s, t) => {
745
- const { destinationType: e } = s, a = `${t.url}/home`;
746
- switch (e) {
747
- case "portal-content":
748
- return `${a}/content.html`;
749
- case "portal-groups":
750
- return `${a}/groups.html`;
751
- case "portal-item":
752
- return `${a}/item.html?id=${s.itemId}`;
753
- case "portal-group":
754
- return `${a}/group.html?id=${s.groupId}`;
735
+ `, nt = s.object({
736
+ shouldSuggestNavigation: s.boolean().default(!1),
737
+ destinationType: s.enum(["none", ...Ke]).default("none"),
738
+ itemId: s.string().default(""),
739
+ groupId: s.string().default(""),
740
+ confidence: s.number().min(0).max(1).default(0)
741
+ }), Je = async (t, e) => {
742
+ await m({ text: "Extracting navigation intent...", agentName: "doc-assistant" }, e);
743
+ const a = t.outputMessage.trim();
744
+ if (!a)
745
+ return {};
746
+ const n = I(t.agentExecutionContext.messages).trim(), o = await J.fromTemplate(We).format({
747
+ question: n,
748
+ response: a
749
+ }), c = (await W({ modelTier: "fast" })).withStructuredOutput(nt), i = nt.parse(await c.invoke(o));
750
+ if (!i.shouldSuggestNavigation || i.destinationType === "none")
751
+ return {};
752
+ if (i.destinationType === "portal-item" && !i.itemId) {
753
+ const u = M(n, "#");
754
+ u && (i.itemId = await xt.invoke({ itemTitle: u }, e) ?? "");
755
+ }
756
+ if (i.destinationType === "portal-group" && !i.groupId) {
757
+ const u = M(n, "$") ?? M(n, "#");
758
+ u && (i.groupId = await St.invoke({ groupTitle: u }, e) ?? "");
759
+ }
760
+ const l = _e(i);
761
+ return l ? (await R(l, e), {}) : {};
762
+ };
763
+ function _e({
764
+ destinationType: t,
765
+ itemId: e,
766
+ groupId: a
767
+ }) {
768
+ switch (t) {
769
+ case "portal-content":
770
+ case "portal-gallery":
771
+ case "portal-groups":
772
+ case "portal-map-viewer":
773
+ case "portal-notebooks":
774
+ case "portal-scene-viewer":
775
+ return { destinationType: t };
776
+ case "portal-org-security":
777
+ return {
778
+ destinationType: "portal-org",
779
+ hash: "settings",
780
+ queryParams: {
781
+ tab: "security"
782
+ }
783
+ };
784
+ case "portal-content-new-item":
785
+ case "portal-content-new-item-feature-layer":
786
+ case "portal-content-new-item-developer-credentials":
787
+ return {
788
+ queryParams: {
789
+ newItem: Ye[t]
790
+ },
791
+ destinationType: "portal-content"
792
+ };
793
+ case "portal-content-favorites":
794
+ case "portal-content-group":
795
+ case "portal-content-living-atlas":
796
+ case "portal-content-organization":
797
+ return { destinationType: "portal-content", hash: He[t] };
798
+ case "portal-groups-featured":
799
+ case "portal-groups-my":
800
+ case "portal-groups-organization":
801
+ return { destinationType: "portal-groups", hash: Xe[t] };
802
+ case "portal-org-security-custom-sign-in":
803
+ case "portal-org-security-logins":
804
+ case "portal-org-security-change-login-provider":
805
+ case "portal-org-security-multifactor-auth":
806
+ case "portal-org-security-multifactor-enforcement":
807
+ case "portal-org-security-multifactor-designated-admins":
808
+ const n = Ze[t];
809
+ return {
810
+ destinationType: "portal-org",
811
+ hash: "settings",
812
+ queryParams: {
813
+ tab: "security",
814
+ section: we[n],
815
+ subsection: n
816
+ }
817
+ };
818
+ case "portal-item":
819
+ return e ? { destinationType: t, itemId: e } : null;
820
+ case "portal-group":
821
+ return a ? { destinationType: t, groupId: a } : null;
822
+ case "none":
823
+ return null;
824
+ default:
825
+ return D(t);
826
+ }
827
+ }
828
+ const Ye = {
829
+ "portal-content-new-item": "newItem",
830
+ "portal-content-new-item-feature-layer": "createLayer",
831
+ "portal-content-new-item-developer-credentials": "developerCredentials"
832
+ }, He = {
833
+ "portal-content-favorites": "favorites",
834
+ "portal-content-group": "group",
835
+ "portal-content-living-atlas": "living-atlas",
836
+ "portal-content-organization": "org"
837
+ }, Xe = {
838
+ "portal-groups-featured": "featured",
839
+ "portal-groups-my": "my",
840
+ "portal-groups-organization": "organization"
841
+ }, Ze = {
842
+ "portal-org-security-custom-sign-in": "customSignInSection",
843
+ "portal-org-security-logins": "loginsSection",
844
+ "portal-org-security-change-login-provider": "changeLoginProviderSection",
845
+ "portal-org-security-multifactor-auth": "multiFactorAuthSection",
846
+ "portal-org-security-multifactor-enforcement": "multifactorEnforcementSection",
847
+ "portal-org-security-multifactor-designated-admins": "multifactorDesignatedAdminsSection"
848
+ }, Ct = h.Root({
849
+ ...G()
850
+ }), ta = () => new A(Ct).addNode("answerDocQuestion", Le).addNode("extractNavigationIntent", Je).addEdge(N, "answerDocQuestion").addEdge("answerDocQuestion", "extractNavigationIntent").addEdge("extractNavigationIntent", w), ea = String.raw`- **portal-doc-assistant** - General ArcGIS documentation and Portal help assistant:
851
+ - answers general ArcGIS, Portal, Enterprise, and JavaScript SDK questions
852
+ - acts as a fallback when specialized agents are not applicable
853
+ `, aa = {
854
+ id: "portal-doc-assistant",
855
+ name: "Portal Doc Assistant",
856
+ description: ea,
857
+ createGraph: ta,
858
+ workspace: Ct
859
+ }, na = () => ({ latestGroupId: null, memory: {} }), U = (t) => {
860
+ const e = t?.agentExecutionContext.sharedState.portalGroupSummaryMemory?.value;
861
+ return e ? { latestGroupId: e.latestGroupId, memory: e.memory } : na();
862
+ }, Mt = `
863
+ Shared markdown formatting rules:
864
+ - Use clear markdown headings (##) to separate sections.
865
+ - Use concise bullet points for lists of facts, counts, or signals.
866
+ - Emphasize key metrics with bold labels (for example: **Recent items:** 4).
867
+ - Keep wording direct and analytical; avoid filler language but make sure the language is friendly.
868
+ - Do not include raw internal IDs unless explicitly requested.
869
+ `, oa = `
870
+ You answer follow-up questions about ArcGIS group analytics.
871
+
872
+ ${Mt}
873
+
874
+ Ground your answer in the provided group analytics summary and context.
875
+ If the answer is not available from the provided context, state that clearly and suggest what to check next.
876
+
877
+ Response rules:
878
+ - Reply in concise markdown with this section structure:
879
+ 1) ## Answer
880
+ 2) ## Evidence
881
+ 3) ## Gaps (only when data is missing)
882
+ - Keep the answer focused on the follow-up question.
883
+ - Do not include internal identifiers.
884
+ - Mark isRelevant=false when the question is not about this group or cannot be grounded in this group context.
885
+
886
+ Group analytics summary:
887
+ {summary}
888
+
889
+ Group full context:
890
+ {fullContext}
891
+
892
+ Question:
893
+ {question}
894
+ `, ra = async (t, e) => {
895
+ await m({ text: "Answering group follow-up...", agentName: "group-analytics" }, e);
896
+ const a = U(t), n = t.groupSummaryGroupId ?? a.latestGroupId, o = n ? a.memory[n] : void 0, r = t.groupSummaryQuestion || I(t.agentExecutionContext.messages);
897
+ return o ? {
898
+ status: "success",
899
+ outputMessage: (await b({
900
+ promptText: oa,
901
+ schema: sa,
902
+ modelTier: "default",
903
+ inputVariables: {
904
+ summary: o.summary,
905
+ question: r,
906
+ fullContext: JSON.stringify(o.fullContext)
907
+ }
908
+ })).answer
909
+ } : {
910
+ status: "success",
911
+ outputMessage: "I do not have group analytics context yet. Ask me to analyze a group first with analyze group <group id>."
912
+ };
913
+ }, sa = s.object({
914
+ answer: s.string(),
915
+ isRelevant: s.boolean()
916
+ }), ia = `
917
+ Classify the user's request for ArcGIS Portal group analytics.
918
+
919
+ Rules:
920
+ - intent="summarize" only when the user explicitly asks to summarize, analyze, overview, or recap a group.
921
+ - intent="followUp" for follow-up questions about a previously analyzed group.
922
+ - intent="navigation" when the user asks to open, go to, navigate to, or view the group page.
923
+ - intent="clarify" when intent or required group target is missing.
924
+ - groupId must be the final resolved group id.
925
+ - If request has explicit group id, set groupId directly.
926
+ - If request references group title (for example $title, $"title with spaces", or plain quoted group title), call resolvePortalGroupIdByTitle and set groupId to the tool result.
927
+ - Never return group titles in output fields.
928
+ - If intent is "followUp", set question to the user's full question/request text.
929
+ - If intent is "navigation", set question="".
930
+ - If intent is "summarize", set question="".
931
+ - If intent is "navigation" and no group is specified, leave groupId empty so the system can navigate to the groups listing page.
932
+ - If hasAnalyticsContext is true and the user asks about the same group context without an explicit summarize/analyze command, prefer "followUp".
933
+
934
+ Examples:
935
+ - "Analyze group 0123456789abcdef0123456789abcdef" => summarize, groupId="0123456789abcdef0123456789abcdef"
936
+ - "Analyze group $living atlas" => summarize, call resolvePortalGroupIdByTitle("living atlas") and set groupId to tool result
937
+ - "Analyze group $"living atlas basemaps"" => summarize, call resolvePortalGroupIdByTitle("living atlas basemaps") and set groupId to tool result
938
+ - "Is this group active?" with hasAnalyticsContext=true => followUp
939
+
940
+ hasAnalyticsContext:
941
+ {hasAnalyticsContext}
942
+
943
+ User message:
944
+ {userMessage}
945
+ `, ca = async (t, e) => {
946
+ await m({ text: "Analyzing group-analytics intent...", agentName: "group-analytics" }, e);
947
+ const a = I(t.agentExecutionContext.messages), n = !!U(t).latestGroupId, o = await J.fromTemplate(ia).format({
948
+ userMessage: a,
949
+ hasAnalyticsContext: String(n)
950
+ }), c = (await W({ modelTier: "fast" })).withStructuredOutput(ot), i = ot.parse(await c.invoke(o));
951
+ let l = i.groupId;
952
+ if ((i.intent === "summarize" || i.intent === "navigation") && !l) {
953
+ const y = M(a, "$");
954
+ y && (l = await St.invoke({ groupTitle: y }, e) ?? "");
955
+ }
956
+ const { intent: u, question: d } = i, g = u === "summarize" && !l, p = u === "followUp" && !(d ?? "").trim(), f = u === "clarify" || g || p;
957
+ return {
958
+ groupSummaryIntent: f ? "clarify" : u,
959
+ groupSummaryGroupId: l || null,
960
+ groupSummaryQuestion: d || "",
961
+ status: "success",
962
+ outputMessage: f ? "Please clarify with a group id or title" : ""
963
+ };
964
+ }, ot = s.object({
965
+ intent: s.enum(["summarize", "followUp", "navigation", "clarify"]),
966
+ groupId: s.string().default(""),
967
+ question: s.string().default("")
968
+ }), ua = async (t, e) => {
969
+ const a = U(t), n = t.groupSummaryGroupId ?? a.latestGroupId;
970
+ return await m({ text: "Preparing navigation...", agentName: "group-analytics" }, e), await R(
971
+ n ? { destinationType: "portal-group", groupId: n } : { destinationType: "portal-groups" },
972
+ e
973
+ ), { status: "success" };
974
+ };
975
+ function At({ timestamp: t, now: e, windowMs: a }) {
976
+ return t ? e - t <= a : !1;
977
+ }
978
+ const la = 720 * 60 * 60 * 1e3;
979
+ function da(t) {
980
+ const e = Ht(t);
981
+ return {
982
+ id: t.id ?? "",
983
+ title: t.title ?? "",
984
+ description: t.description ?? "",
985
+ snippet: t.snippet ?? "",
986
+ access: t.access ?? null,
987
+ owner: t.owner ?? "",
988
+ tags: t.tags ?? [],
989
+ created: t.created?.getTime(),
990
+ modified: t.modified?.getTime(),
991
+ isInvitationOnly: t.isInvitationOnly,
992
+ sourceSignals: {
993
+ capabilities: ee(t),
994
+ membershipAccess: te(t),
995
+ isOpenData: Zt(t),
996
+ isDistributedCollaborationGroup: Xt(t),
997
+ orgId: e.orgId,
998
+ hiddenMembers: e.hiddenMembers,
999
+ isViewOnly: e.isViewOnly,
1000
+ isReadOnly: e.isReadOnly,
1001
+ leavingDisallowed: e.leavingDisallowed
1002
+ }
1003
+ };
1004
+ }
1005
+ async function pa(t) {
1006
+ const e = { owner: t.owner ?? "", admins: [], users: [] };
1007
+ try {
1008
+ return await t.fetchMembers();
1009
+ } catch (a) {
1010
+ return console.warn("Unable to fetch group members for analytics context", a), e;
1011
+ }
1012
+ }
1013
+ function ma(t) {
1014
+ return t.map((e) => ({
1015
+ id: e.id ?? "",
1016
+ title: e.title ?? "Untitled",
1017
+ type: e.type ?? "Unknown",
1018
+ owner: e.owner ?? "",
1019
+ created: e.created?.getTime(),
1020
+ modified: e.modified?.getTime()
1021
+ }));
1022
+ }
1023
+ function ga(t, e) {
1024
+ return t.filter(
1025
+ (a) => a.modified ? At({ timestamp: a.modified, now: e, windowMs: la }) : !1
1026
+ );
1027
+ }
1028
+ function ha(t) {
1029
+ const e = /* @__PURE__ */ new Map();
1030
+ for (const a of t)
1031
+ e.set(a.type, (e.get(a.type) ?? 0) + 1);
1032
+ return [...e.entries()].sort((a, n) => n[1] - a[1] || a[0].localeCompare(n[0])).slice(0, 6).map(([a, n]) => ({ type: a, count: n }));
1033
+ }
1034
+ async function fa(t) {
1035
+ const e = await t.queryItems({ num: 20, sortField: "modified", sortOrder: "desc" }), a = ma(e.results), n = Date.now();
1036
+ return {
1037
+ total: e.total,
1038
+ topItems: a,
1039
+ recentlyModifiedItems: ga(a, n),
1040
+ topItemTypes: ha(a)
1041
+ };
1042
+ }
1043
+ async function ya(t, e) {
1044
+ if (!e)
1045
+ return { error: { code: "missingGroupId", message: "Group id is required." } };
1046
+ try {
1047
+ const n = (await t.queryGroups({ query: `id:${e}`, num: 1 })).results[0];
1048
+ if (!n)
1049
+ return { error: { code: "groupNotFound", message: `No group found for id: ${e}` } };
1050
+ const o = da(n), r = await pa(n), c = await fa(n);
1051
+ return { result: { group: o, members: r, items: c } };
1052
+ } catch (a) {
1053
+ return console.error("Error fetching portal group analytics context:", a), { error: { code: "unhandledError" } };
1054
+ }
1055
+ }
1056
+ const wa = `
1057
+ You summarize ArcGIS Portal groups based on structured context and deterministic activity signals.
1058
+
1059
+ ${Mt}
1060
+
1061
+ Output format requirements:
1062
+ - Return concise markdown with clear sections in this order:
1063
+ 1) Overview
1064
+ 2) Activity
1065
+ 3) Members
1066
+ 4) Content Theme
1067
+ 5) Contribution Model
1068
+ 6) Unknowns / Data Gaps
1069
+ - Keep total response about 180-280 words unless the user asked for extra detail.
1070
+ - Avoid internal-only implementation details and do not expose raw IDs unless user explicitly asks.
1071
+
1072
+ Reasoning rules:
1073
+ - Use deterministicSignals as the source of truth for active/recent status.
1074
+ - If group description/snippet are empty, infer purpose from tags, item title patterns, and item type distribution.
1075
+ - For members, report owner/admin/user counts when available; if unavailable due to permission scope, explicitly say so.
1076
+ - For contribution model, use membershipAccess, capabilities, and sourceJSON flags to characterize collaboration vs distribution behavior.
1077
+ - Be explicit when signals are heuristic or unavailable.
1078
+
1079
+ Follow-up prompt rules:
1080
+ - Generate exactly 3 follow-up prompts.
1081
+ - Write them as direct first-person user chat prompts that can be clicked and sent as-is.
1082
+ - Do not write meta-questions such as "Would you like..." or "Do you want me to...".
1083
+ - Keep each prompt short, specific, and actionable.
1084
+ - Every prompt must be answerable using only the provided group context and deterministic signals.
1085
+ - Do not require external data, navigation, or additional fetches.
1086
+ - Tailor each prompt to this specific group's available signals (content mix, activity, members, and contribution model).
1087
+ - Avoid repeating phrasing from prior prompts or using generic template wording.
1088
+ - If a signal is unavailable (for example members), do not ask follow-ups that depend on that missing signal.
1089
+
1090
+ Group context:
1091
+ {context}
1092
+
1093
+ Deterministic signals:
1094
+ {deterministicSignals}
1095
+ `, va = 2160 * 60 * 60 * 1e3, ba = async (t, e) => {
1096
+ const a = t.groupSummaryGroupId;
1097
+ if (!a)
1098
+ return {
1099
+ status: "success",
1100
+ outputMessage: 'Please clarify with analyze group <group id>, analyze group $<title>, or analyze group $"<title with spaces>".'
1101
+ };
1102
+ await m({ text: `Analyzing group ${a}...`, agentName: "group-analytics" }, e);
1103
+ const n = e?.configurable?.context;
1104
+ T(n);
1105
+ const { result: o, error: r } = await ya(n.portal, a);
1106
+ if (r || !o)
1107
+ return await m({ text: "Failed to fetch group context", agentName: "group-analytics" }, e), {
1108
+ status: "success",
1109
+ outputMessage: "Unable to retrieve group context for analytics."
1110
+ };
1111
+ const { group: c, items: i } = o, l = Date.now(), u = c.modified, d = u ? At({ timestamp: u, now: l, windowMs: va }) : !1, g = i.recentlyModifiedItems.length, p = g > 0, f = d || p, y = await b({
1112
+ promptText: wa,
1113
+ schema: Ia,
1114
+ modelTier: "default",
1115
+ inputVariables: {
1116
+ context: JSON.stringify(o),
1117
+ deterministicSignals: JSON.stringify({
1118
+ isGroupActive: f,
1119
+ isGroupRecentlyModified: d,
1120
+ hasRecentlyAddedOrUpdatedContent: p,
1121
+ recentItemCount: g
1122
+ })
1123
+ }
1124
+ }), { followUpQuestions: S, summary: C } = y, $t = U(t), Dt = {
1125
+ latestGroupId: a,
1126
+ memory: {
1127
+ ...$t.memory,
1128
+ [a]: { summary: C, followUpQuestions: S, fullContext: o }
1129
+ }
1130
+ };
1131
+ return S.length && await Q({ type: "suggested-prompts", data: { prompts: S } }, e), {
1132
+ status: "success",
1133
+ outputMessage: C,
1134
+ sharedStatePatch: { portalGroupSummaryMemory: { value: Dt } }
1135
+ };
1136
+ }, Ia = s.object({
1137
+ summary: s.string(),
1138
+ followUpQuestions: s.array(s.string()).default([])
1139
+ }), F = (t, e) => e ?? t, Nt = h.Root({
1140
+ ...G(),
1141
+ groupSummaryIntent: h({
1142
+ reducer: F,
1143
+ default: () => "clarify"
1144
+ }),
1145
+ groupSummaryGroupId: h({
1146
+ reducer: F,
1147
+ default: () => null
1148
+ }),
1149
+ groupSummaryQuestion: h({
1150
+ reducer: F,
1151
+ default: () => ""
1152
+ })
1153
+ }), Sa = () => new A(Nt).addNode("detectGroupSummaryIntent", ca).addNode("summarizePortalGroup", ba).addNode("answerGroupSummaryFollowUp", ra).addNode("suggestGroupSummaryNavigation", ua).addEdge(N, "detectGroupSummaryIntent").addConditionalEdges("detectGroupSummaryIntent", (e) => e.groupSummaryIntent === "summarize" ? "summarizePortalGroup" : e.groupSummaryIntent === "followUp" ? "answerGroupSummaryFollowUp" : e.groupSummaryIntent === "navigation" ? "suggestGroupSummaryNavigation" : w).addEdge("summarizePortalGroup", w).addEdge("answerGroupSummaryFollowUp", w).addEdge("suggestGroupSummaryNavigation", w), xa = String.raw`- **portal-group-analytics** - Portal group analytics assistant:
1154
+ - summarizes ArcGIS portal groups from group context and sourceJSON details
1155
+ - answers follow-up questions grounded in the summarized group
1156
+ - suggests navigation to groups when relevant
1157
+ `, Ta = {
1158
+ id: "portal-group-analytics",
1159
+ name: "Portal Group Analytics",
1160
+ description: xa,
1161
+ createGraph: Sa,
1162
+ workspace: Nt
1163
+ }, Ca = () => ({ latestItemId: null, memory: {} }), _ = (t) => {
1164
+ const e = t?.agentExecutionContext.sharedState.portalItemAnalyticsSummaryMemory?.value;
1165
+ return e ? { latestItemId: e.latestItemId, memory: e.memory } : Ca();
1166
+ }, rt = s.object({
1167
+ intent: s.enum(["summarize", "followUp", "clarify"]),
1168
+ itemId: s.string().default(""),
1169
+ question: s.string().default("")
1170
+ }), Ma = s.object({ summary: s.string(), followUpQuestions: s.array(s.string()).default([]) }), Aa = s.object({ answer: s.string(), isRelevant: s.boolean() }), Na = `
1171
+ You answer follow-up questions about an ArcGIS item.
1172
+
1173
+ Ground your answer in the provided item context.
1174
+ If the answer is not available from the provided context, state that clearly and suggest what to check next.
1175
+
1176
+ Response rules:
1177
+ - Reply in concise markdown.
1178
+ - Keep the answer focused on the follow-up question.
1179
+ - Do not include internal identifiers.
1180
+ - Mark isRelevant=false when the question is not about this item or cannot be grounded in this item context.
1181
+
1182
+ Item summary:
1183
+ {summary}
1184
+
1185
+ Item full context
1186
+ {fullContext}
1187
+
1188
+ Question:
1189
+ {question}
1190
+ `, Ga = async (t, e) => {
1191
+ await m({ text: "Answering follow-up...", agentName: "analytics" }, e);
1192
+ const a = _(t), n = t.analyticsItemId ?? a.latestItemId, o = n ? a.memory[n] : void 0, r = t.analyticsQuestion || I(t.agentExecutionContext.messages);
1193
+ return o ? {
1194
+ status: "success",
1195
+ outputMessage: (await b({
1196
+ promptText: Na,
1197
+ schema: Aa,
1198
+ modelTier: "default",
1199
+ inputVariables: {
1200
+ summary: o.summary,
1201
+ question: r,
1202
+ fullContext: JSON.stringify(o.fullContext)
1203
+ }
1204
+ })).answer
1205
+ } : {
1206
+ status: "success",
1207
+ outputMessage: "I don't have enough information yet. Please ask me to summarize the item first using summarize item <item id>."
1208
+ };
1209
+ }, Pa = `
1210
+ Classify the user analytics request.
1211
+
1212
+ Rules:
1213
+ - intent="summarize" only when the user explicitly asks to summarize/overview/recap an item.
1214
+ - intent="followUp" for analytical questions about item details, including schema/fields/attributes/layers.
1215
+ - intent="clarify" when neither summarize nor follow-up intent is clear.
1216
+ - itemId must be the final resolved item id.
1217
+ - If request has explicit item id, set itemId directly.
1218
+ - If request references item title (for example #title, #"title with spaces", or plain quoted title), call resolvePortalItemIdByTitle and set itemId to the returned value.
1219
+ - Never return item titles in output fields.
1220
+ - If intent is "followUp", set question to the user's full question/request text.
1221
+ - If intent is "summarize", set question="".
1222
+ - When user asks to show/list/explain fields, schema, attributes, columns, or layer details, classify as "followUp" unless they explicitly request a summary.
1223
+ - If hasSummaryContext is true, prefer "followUp" for detail-oriented requests that do not explicitly ask to summarize.
1224
+
1225
+ Examples:
1226
+ - "Summarize item 0123456789abcdef0123456789abcdef" => summarize, itemId="0123456789abcdef0123456789abcdef"
1227
+ - "Summarize item #california" => summarize, call resolvePortalItemIdByTitle("california") and set itemId to tool result
1228
+ - "Summarize item #"california farmland"" => summarize, call resolvePortalItemIdByTitle("california farmland") and set itemId to tool result
1229
+ - "Show the layer's available fields" => followUp
1230
+ - "List attributes and explain what status means" => followUp
1231
+ - "What fields are available?" with hasSummaryContext=true => followUp
1232
+ - "Give me an overview of item 0123456789abcdef0123456789abcdef" => summarize
1233
+
1234
+ hasSummaryContext:
1235
+ {hasSummaryContext}
1236
+
1237
+ User message:
1238
+ {userMessage}
1239
+ `, qa = async (t, e) => {
1240
+ await m({ text: "Analyzing intent...", agentName: "analytics" }, e);
1241
+ const a = I(t.agentExecutionContext.messages), n = !!_(t).latestItemId, o = await J.fromTemplate(Pa).format({
1242
+ userMessage: a,
1243
+ hasSummaryContext: String(n)
1244
+ }), c = (await W({ modelTier: "fast" })).withStructuredOutput(rt), i = rt.parse(await c.invoke(o));
1245
+ let l = i.itemId;
1246
+ if (i.intent === "summarize" && !l) {
1247
+ const y = M(a, "#");
1248
+ y && (l = await xt.invoke({ itemTitle: y }, e) ?? "");
1249
+ }
1250
+ const { intent: u, question: d } = i, f = u === "clarify" || u === "summarize" && !l || u === "followUp" && !d;
1251
+ return {
1252
+ agentExecutionContext: { ...t.agentExecutionContext },
1253
+ analyticsIntent: f ? "clarify" : u,
1254
+ analyticsItemId: l || null,
1255
+ analyticsQuestion: d || "",
1256
+ status: "success",
1257
+ outputMessage: f ? 'Please clarify with summarize item <item id>, summarize item #<title>, or summarize item #"<title with spaces>".' : ""
1258
+ };
1259
+ }, Ea = `
1260
+ You are a item summary tool for ArcGIS. Your job is to summarize an item's info based on the provided context.
1261
+ Summary rules:
1262
+ - The summary should be concise markdown, make sure to format the output nicely so it's easy to read.
1263
+ - Target length: 80-150 words.
1264
+ - Provide one short descriptive paragraph.
1265
+ - Also propose 3 concise follow-up questions grounded in the item summary.
1266
+ - Keep follow-up questions specific and actionable.
1267
+ Follow-up questions rules:
1268
+ - These questions should be in the format of a prompt that the user can click on.
1269
+ - Make sure the questions are relevant to the item summary and that you can answer based solely on the provided context.
1270
+ Do not include internal identifiers.
1271
+ If the user asks for a detailed summary, you may expand the response up to 300 words.
1272
+ Item context:
1273
+ {context}
1274
+ `, za = async (t, e) => {
1275
+ const a = t.analyticsItemId;
1276
+ if (!a)
1277
+ return {
1278
+ status: "success",
1279
+ outputMessage: 'Please clarify with summarize item <item id>, summarize item #<title>, or summarize item #"<title with spaces>".'
1280
+ };
1281
+ await m({ text: `Summarizing item ${a}...`, agentName: "analytics" }, e);
1282
+ const n = e?.configurable?.context;
1283
+ T(n);
1284
+ const { portal: o, user: r } = n, { result: c, error: i } = await Yt(r, o, a);
1285
+ if (i || !c)
1286
+ return await m({ text: "Failed to get item context for summarization", agentName: "analytics" }, e), {
1287
+ status: "success",
1288
+ outputMessage: "Unable to retrieve item context for summarization."
1289
+ };
1290
+ const { context: l } = c, u = await b({
1291
+ promptText: Ea,
1292
+ schema: Ma,
1293
+ modelTier: "default",
1294
+ inputVariables: { context: JSON.stringify(l) }
1295
+ }), { followUpQuestions: d, summary: g } = u, p = _(t), f = {
1296
+ latestItemId: a,
1297
+ memory: {
1298
+ ...p.memory,
1299
+ [a]: { summary: g, followUpQuestions: d, fullContext: l }
1300
+ }
1301
+ };
1302
+ return d.length && await Q({ type: "suggested-prompts", data: { prompts: d } }, e), {
1303
+ status: "success",
1304
+ outputMessage: g,
1305
+ sharedStatePatch: { portalItemAnalyticsSummaryMemory: { value: f } }
1306
+ };
1307
+ }, O = (t, e) => e ?? t, Gt = h.Root({
1308
+ ...G(),
1309
+ // States shared only across nodes in the graph, not between invocations
1310
+ analyticsIntent: h({
1311
+ reducer: O,
1312
+ default: () => "clarify"
1313
+ }),
1314
+ analyticsItemId: h({
1315
+ reducer: O,
1316
+ default: () => null
1317
+ }),
1318
+ analyticsQuestion: h({
1319
+ reducer: O,
1320
+ default: () => ""
1321
+ })
1322
+ }), ka = () => new A(Gt).addNode("detectAnalyticsIntent", qa).addNode("summarizePortalItem", za).addNode("answerAnalyticsFollowUp", Ga).addEdge(N, "detectAnalyticsIntent").addConditionalEdges("detectAnalyticsIntent", (e) => e.analyticsIntent === "summarize" ? "summarizePortalItem" : e.analyticsIntent === "followUp" ? "answerAnalyticsFollowUp" : w).addEdge("summarizePortalItem", w).addEdge("answerAnalyticsFollowUp", w), $a = String.raw`- **portal-item-analytics** - Portal item analytics assistant:
1323
+ - answers questions about one specific ArcGIS portal item when item context is present
1324
+ - summarizes item details, metadata, and context grounded in that item
1325
+ - suggests follow-up prompts grounded in the same item
1326
+ - use for item-specific requests, not for gallery browsing, featured content, or opening Map Viewer
1327
+ `, Da = {
1328
+ id: "portal-item-analytics",
1329
+ name: "Portal Item Analytics",
1330
+ description: $a,
1331
+ createGraph: ka,
1332
+ workspace: Gt
1333
+ }, Ra = {
1334
+ schemaVersion: "1.0",
1335
+ capabilities: [
1336
+ {
1337
+ id: "my-content",
1338
+ title: "My content",
1339
+ description: "Browse, discover, search, and filter ArcGIS content—including maps, apps, datasets, and other items—that you own or can access.",
1340
+ hints: ["view my content", "show my content", "my content"],
1341
+ platforms: ["online", "enterprise"],
1342
+ resolutions: {
1343
+ navigate: {
1344
+ routeKey: "content"
1345
+ }
1346
+ }
1347
+ },
1348
+ {
1349
+ id: "create-feature-layer",
1350
+ title: "Create feature layer",
1351
+ description: "Generate an editable feature layer by copying fields from templates or existing layers.",
1352
+ hints: ["add a feature layer", "make a feature layer", "generate a feature layer"],
1353
+ platforms: ["online", "enterprise"],
1354
+ resolutions: {
1355
+ navigate: {
1356
+ routeKey: "content"
1357
+ }
1358
+ }
1359
+ },
1360
+ {
1361
+ id: "create-folder",
1362
+ title: "Create folder",
1363
+ description: "Create a new folder in your ArcGIS content to organize your items.",
1364
+ hints: ["create a folder", "make a folder", "set up a folder", "new folder"],
1365
+ platforms: ["online", "enterprise"],
1366
+ resolutions: {
1367
+ navigate: {
1368
+ routeKey: "content"
1369
+ }
1370
+ }
1371
+ }
1372
+ ]
1373
+ }, Ua = {
1374
+ schemaVersion: "1.0",
1375
+ capabilities: [
1376
+ {
1377
+ id: "my groups",
1378
+ title: "My groups",
1379
+ description: "Browse, discover, search, and filter ArcGIS content collections—including maps, apps, datasets, and other items—that you own, belong to, or can access.",
1380
+ hints: ["view my groups", "show my groups", "my groups"],
1381
+ platforms: ["online", "enterprise"],
1382
+ resolutions: {
1383
+ navigate: {
1384
+ routeKey: "groups"
1385
+ }
1386
+ }
1387
+ },
1388
+ {
1389
+ id: "create-group",
1390
+ title: "Create group",
1391
+ description: "Create a new ArcGIS Portal group owned by the signed-in user.",
1392
+ hints: ["create a group", "make a group", "set up a group", "new group"],
1393
+ platforms: ["online", "enterprise"],
1394
+ resolutions: {
1395
+ navigate: {
1396
+ routeKey: "groups"
1397
+ }
1398
+ }
1399
+ },
1400
+ {
1401
+ id: "featured-groups",
1402
+ title: "Featured groups",
1403
+ description: "Browse, discover, search, and filter ArcGIS content collections—including maps, apps, datasets, and other items—that organization administrators choose to highlight in ArcGIS.",
1404
+ hints: ["view featured groups", "show featured groups", "highlighted groups", "top groups"],
1405
+ platforms: ["online", "enterprise"],
1406
+ resolutions: {
1407
+ navigate: {
1408
+ routeKey: "groups",
1409
+ hash: "featured"
1410
+ }
1411
+ }
1412
+ },
1413
+ {
1414
+ id: "organization-groups",
1415
+ title: "Organization groups",
1416
+ description: "Browse, discover, search, and filter ArcGIS content collections—including maps, apps, datasets, and other items—that are specific to your organization in ArcGIS.",
1417
+ hints: ["view organization groups", "show organization groups"],
1418
+ platforms: ["online", "enterprise"],
1419
+ resolutions: {
1420
+ navigate: {
1421
+ routeKey: "groups",
1422
+ hash: "organization"
1423
+ }
1424
+ }
1425
+ }
1426
+ ]
1427
+ }, Fa = {
1428
+ schemaVersion: "1.0",
1429
+ capabilities: [
1430
+ {
1431
+ id: "org-config-mfa",
1432
+ title: "Multifactor Authentication (MFA)",
1433
+ description: "Configure organization-level multifactor authentication (MFA) settings. Administrators can enable MFA for ArcGIS logins, allow recovery codes for members, view MFA adoption status, enforce MFA requirements for all members, manage the MFA exemption list, and designate administrators who can troubleshoot MFA issues.",
1434
+ hints: ["config MFA", "set up MFA"],
1435
+ platforms: ["online", "enterprise"],
1436
+ resolutions: {
1437
+ navigate: {
1438
+ routeKey: "organization",
1439
+ queryParams: {
1440
+ tab: "security"
1441
+ },
1442
+ hash: "settings"
1443
+ }
1444
+ }
1445
+ }
1446
+ ]
1447
+ }, Oa = {
1448
+ "contentRouteRegistry.ts": Ra,
1449
+ "groupsRouteRegistry.ts": Ua,
1450
+ "orgSettingsRouteRegistry.ts": Fa
1451
+ };
1452
+ function st(t) {
1453
+ const e = [], a = /* @__PURE__ */ new Set();
1454
+ for (const [n, o] of Object.entries(t))
1455
+ for (const r of o.capabilities) {
1456
+ if (a.has(r.id))
1457
+ throw new Error(`${n}: duplicate capability id "${r.id}" across registries`);
1458
+ a.add(r.id), e.push(r);
1459
+ }
1460
+ return e;
1461
+ }
1462
+ let E;
1463
+ function x(t) {
1464
+ return t ? E = st({ customCapabilities: t }) : E || (E = st(Oa)), E;
1465
+ }
1466
+ const La = /^(?:take me to|navigate to|go to|show me|open)\s+(?:the\s+)?/u;
1467
+ function $(t) {
1468
+ return t.toLowerCase().replace(/[^a-z0-9]+/gu, " ").trim().replace(La, "").trim();
1469
+ }
1470
+ const ja = s.object({
1471
+ capabilityIds: s.array(s.string()).default([]),
1472
+ confidence: s.number().min(0).max(1).default(0),
1473
+ reason: s.string().default("")
1474
+ }), it = 0.8, Va = String.raw`You select Portal navigation capabilities for a user's request.
1475
+
1476
+ Select only capability IDs from the supplied candidates. Return an empty array when none fit.
1477
+ A named surface is required: do not select a capability on another Portal surface.
1478
+ Retrieval scores are hints only, not ground truth.
1479
+
1480
+ User request:
1481
+ {userRequest}
1482
+
1483
+ Candidates:
1484
+ {candidates}`, Ba = async (t, e) => {
1485
+ if (t.outputMessage || t.targets.length === 0)
1486
+ return {};
1487
+ const a = I(t.agentExecutionContext.messages).trim(), n = Ka(a, t);
1488
+ if (n.length === 1)
1489
+ return console.info("[arcgis-portal-ai-assistant] navigation capability selection:", {
1490
+ method: "exact-match",
1491
+ request: a,
1492
+ selectedCapabilityIds: n
1493
+ }), { chosenCapabilityIds: n };
1494
+ await m({ text: "Choosing a navigation destination...", agentName: "navigation" }, e);
1495
+ const o = JSON.stringify(
1496
+ t.targets.map(({ capability: r, keywordScore: c, semanticScore: i }) => ({
1497
+ id: r.id,
1498
+ title: r.title,
1499
+ description: r.description,
1500
+ route: r.resolutions.navigate,
1501
+ keywordScore: c,
1502
+ semanticScore: i
1503
+ }))
1504
+ );
1505
+ try {
1506
+ const r = await b({
1507
+ promptText: Va,
1508
+ schema: ja,
1509
+ modelTier: "fast",
1510
+ inputVariables: { candidates: o, userRequest: a }
1511
+ }), c = new Set(t.targets.map(({ capability: l }) => l.id)), i = r.capabilityIds.filter((l) => c.has(l));
1512
+ return console.info("[arcgis-portal-ai-assistant] navigation capability selection:", {
1513
+ confidence: r.confidence,
1514
+ method: "structured-model",
1515
+ reason: r.reason,
1516
+ request: a,
1517
+ selectedCapabilityIds: i
1518
+ }), r.confidence < it ? {
1519
+ chosenCapabilityIds: [],
1520
+ status: "failed",
1521
+ summary: `Navigation selection confidence ${r.confidence} is below the required ${it}; defer to the Portal Doc Assistant.`
1522
+ } : { chosenCapabilityIds: i };
1523
+ } catch {
1524
+ return console.info("[arcgis-portal-ai-assistant] navigation capability selection:", {
1525
+ method: "structured-model-unavailable",
1526
+ request: a,
1527
+ selectedCapabilityIds: []
1528
+ }), { chosenCapabilityIds: [] };
1529
+ }
1530
+ };
1531
+ function Ka(t, e) {
1532
+ const a = $(t);
1533
+ return e.targets.filter(
1534
+ ({ capability: n }) => [n.title, ...n.hints].some(
1535
+ (o) => $(o) === a
1536
+ )
1537
+ ).map(({ capability: n }) => n.id);
1538
+ }
1539
+ const Pt = /* @__PURE__ */ new Set(["1d", "7d", "14d", "30d", "3m", "6m"]), Qa = s.object({
1540
+ period: s.string(),
1541
+ startTime: s.string(),
1542
+ endTime: s.string()
1543
+ }), Wa = String.raw`Extract temporal filters for an ArcGIS storage-credits query.
1544
+
1545
+ Return JSON only with these optional string fields:
1546
+ - period
1547
+ - startTime
1548
+ - endTime
1549
+
1550
+ Rules:
1551
+ - period must use <integer><unit> with unit in d,w,m (examples: 7d, 2w, 3m).
1552
+ - If the request is a relative range and period can be determined, always include period.
1553
+ - For "last quarter" or "previous quarter", use calendar-quarter boundaries and include period as 3m with both startTime and endTime.
1554
+ - For "last quarter" or "previous quarter", endTime must be the UTC end of the previous quarter, not "now".
1555
+ - If period matches one of these supported periods and the range ends today, period alone is sufficient:
1556
+ 1d, 7d, 14d, 30d, 3m, 6m.
1557
+ - If the request implies a range not supported as period (for example 2m or 10d), include startTime and endTime.
1558
+ - For custom date ranges (for example "last december"), provide startTime and endTime.
1559
+ - startTime and endTime must be epoch milliseconds as strings.
1560
+ - If the end of range is "now", set endTime to {nowEpochMs}.
1561
+ - If temporal intent is unclear, return empty strings for all fields.
1562
+
1563
+ Now UTC:
1564
+ - ISO: {nowIso}
1565
+ - Epoch ms: {nowEpochMs}
1566
+
1567
+ User request:
1568
+ {userRequest}`;
1569
+ async function Ja(t, e = /* @__PURE__ */ new Date()) {
1570
+ const a = t.trim();
1571
+ if (!a)
1572
+ return {};
1573
+ try {
1574
+ const n = await b({
1575
+ promptText: Wa,
1576
+ schema: Qa,
1577
+ modelTier: "fast",
1578
+ inputVariables: {
1579
+ nowEpochMs: String(e.getTime()),
1580
+ nowIso: e.toISOString(),
1581
+ userRequest: a
1582
+ }
1583
+ });
1584
+ return _a(n, e);
1585
+ } catch (n) {
1586
+ return console.error(n), {};
1587
+ }
1588
+ }
1589
+ function _a(t, e = /* @__PURE__ */ new Date()) {
1590
+ const a = ct(t.startTime), n = ct(t.endTime), o = Ya(t.period);
1591
+ if (o) {
1592
+ if (a !== void 0 && n !== void 0 && a < n)
1593
+ return { period: o, startTime: String(a), endTime: String(n) };
1594
+ const r = Pt.has(o);
1595
+ if (!r || n !== void 0 && !Xa(n, e.getTime())) {
1596
+ const i = n ?? e.getTime(), l = Ha(o, new Date(i));
1597
+ if (l !== void 0)
1598
+ return {
1599
+ period: o,
1600
+ startTime: String(l),
1601
+ endTime: String(i)
1602
+ };
1603
+ }
1604
+ return r ? {
1605
+ period: o,
1606
+ ...a !== void 0 ? { startTime: String(a) } : {},
1607
+ ...n !== void 0 ? { endTime: String(n) } : {}
1608
+ } : { period: o };
1609
+ }
1610
+ return a !== void 0 && n !== void 0 && a < n ? { startTime: String(a), endTime: String(n) } : a !== void 0 ? { startTime: String(a), endTime: String(e.getTime()) } : {};
1611
+ }
1612
+ function Ya(t) {
1613
+ const e = t?.trim().match(/^(\d+)\s*([dwm])$/iu);
1614
+ if (!e)
1615
+ return;
1616
+ const a = Number.parseInt(e[1], 10);
1617
+ if (!Number.isFinite(a) || a <= 0)
1618
+ return;
1619
+ const n = e[2].toLowerCase();
1620
+ if (n === "w") {
1621
+ const o = a * 7;
1622
+ if (Pt.has(`${o}d`))
1623
+ return `${o}d`;
1624
+ }
1625
+ return `${a}${n}`;
1626
+ }
1627
+ function Ha(t, e) {
1628
+ const a = t.match(/^(\d+)([dwm])$/u);
1629
+ if (!a)
1630
+ return;
1631
+ const n = Number.parseInt(a[1], 10);
1632
+ if (!Number.isFinite(n) || n <= 0)
1633
+ return;
1634
+ const o = a[2];
1635
+ if (o === "d")
1636
+ return e.getTime() - n * 24 * 60 * 60 * 1e3;
1637
+ if (o === "w")
1638
+ return e.getTime() - n * 7 * 24 * 60 * 60 * 1e3;
1639
+ const r = new Date(e.getTime());
1640
+ return r.setUTCMonth(r.getUTCMonth() - n), r.getTime();
1641
+ }
1642
+ function ct(t) {
1643
+ if (!t)
1644
+ return;
1645
+ const e = Number.parseInt(t, 10);
1646
+ if (!(!Number.isFinite(e) || e <= 0))
1647
+ return e;
1648
+ }
1649
+ function Xa(t, e) {
1650
+ const a = new Date(t), n = new Date(e);
1651
+ return a.getUTCFullYear() === n.getUTCFullYear() && a.getUTCMonth() === n.getUTCMonth() && a.getUTCDate() === n.getUTCDate();
1652
+ }
1653
+ async function Za(t, e, a) {
1654
+ const n = x().find((r) => r.id === t);
1655
+ if (!n)
1656
+ return;
1657
+ const o = await en(tn(n), a);
1658
+ return o && nn(o, e) ? { capability: n, target: o } : void 0;
1659
+ }
1660
+ function tn(t) {
1661
+ const { hash: e, queryParams: a, routeKey: n } = t.resolutions.navigate;
1662
+ switch (n) {
1663
+ case "content":
1664
+ switch (t.id) {
1665
+ case "my-content":
1666
+ return { destinationType: "portal-content" };
1667
+ case "create-feature-layer":
1668
+ return { destinationType: "portal-content" };
1669
+ case "create-folder":
1670
+ return { destinationType: "portal-content" };
1671
+ default:
1672
+ return { destinationType: "portal-content" };
1673
+ }
1674
+ case "groups":
1675
+ if (e === "featured")
1676
+ return { destinationType: "portal-groups", hash: "featured" };
1677
+ if (e === "organization")
1678
+ return { destinationType: "portal-groups", hash: "organization" };
1679
+ switch (t.id) {
1680
+ case "my groups":
1681
+ return { destinationType: "portal-groups", hash: "my" };
1682
+ case "create-group":
1683
+ return { destinationType: "portal-groups" };
1684
+ default:
1685
+ return { destinationType: "portal-groups" };
1686
+ }
1687
+ case "organization":
1688
+ return {
1689
+ destinationType: "portal-org",
1690
+ hash: e,
1691
+ queryParams: a,
1692
+ buttonLabel: t.buttonLabel
1693
+ };
755
1694
  default:
756
- return P(e);
1695
+ return;
1696
+ }
1697
+ }
1698
+ async function en(t, e) {
1699
+ if (!t || !e || !an(t))
1700
+ return t;
1701
+ const a = await Ja(e);
1702
+ if (!a.period && !a.startTime && !a.endTime)
1703
+ return t;
1704
+ const n = {
1705
+ ...t.queryParams ?? {},
1706
+ ...a.period ? { period: a.period } : {},
1707
+ ...a.startTime ? { startTime: a.startTime } : {},
1708
+ ...a.endTime ? { endTime: a.endTime } : {}
1709
+ };
1710
+ return { ...t, queryParams: n };
1711
+ }
1712
+ function an(t) {
1713
+ return t.destinationType === "portal-org" && t.hash === "status";
1714
+ }
1715
+ function nn(t, e) {
1716
+ return !e || !!e[t.destinationType];
1717
+ }
1718
+ const on = async (t, e) => {
1719
+ if (t.outputMessage || t.status === "failed")
1720
+ return {};
1721
+ const a = t.targets.find(({ capability: r }) => t.chosenCapabilityIds.includes(r.id)) ?? t.targets[0];
1722
+ if (!a)
1723
+ return {
1724
+ outputMessage: "I couldn't find a matching Portal page. Try asking to open your content, groups, or organization settings.",
1725
+ sharedStatePatch: { navLastAnsweredRequest: { value: ut(t) } },
1726
+ status: "success",
1727
+ summary: "Navigation could not find a matching capability; route another agent if appropriate."
1728
+ };
1729
+ const n = ut(t), o = await Za(a.capability.id, void 0, n);
1730
+ return o ? (await m({ text: "Preparing navigation...", agentName: "navigation" }, e), await R(o.target, e), {
1731
+ outputMessage: t.chosenCapabilityIds.length ? a.capability.description : `The closest place to start is ${a.capability.title}. Click the button below to open it.`,
1732
+ status: "success",
1733
+ summary: `Navigation suggested ${a.capability.id}${t.retrievalDegraded ? " using keyword-only retrieval" : ""}.`,
1734
+ sharedStatePatch: { navLastAnsweredRequest: { value: n } }
1735
+ }) : (console.warn(`Navigation capability ${a.capability.id} was not found in the resolver.`), {
1736
+ outputMessage: "I found a possible destination, but couldn't resolve a valid Portal navigation target. Try asking to open your content, groups, or organization settings.",
1737
+ status: "success",
1738
+ summary: `Navigation resolver could not map ${a.capability.id}.`,
1739
+ sharedStatePatch: { navLastAnsweredRequest: { value: n } }
1740
+ });
1741
+ };
1742
+ function ut(t) {
1743
+ return I(t.agentExecutionContext.messages) || t.agentExecutionContext.userRequest;
1744
+ }
1745
+ async function qt(t) {
1746
+ return t.length === 0 ? [] : (await ae.getDefault().load(), await Vt(t));
1747
+ }
1748
+ const rn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1749
+ __proto__: null,
1750
+ generateEmbeddings: qt
1751
+ }, Symbol.toStringTag, { value: "Module" }));
1752
+ function sn(t) {
1753
+ const e = [], a = `${t.title}. ${t.description}`;
1754
+ a.trim().length > 0 && e.push({ field: "summary", text: a });
1755
+ const n = t.hints;
1756
+ if (Array.isArray(n))
1757
+ for (const o of n)
1758
+ typeof o == "string" && o.trim().length > 0 && e.push({ field: "hint", text: o });
1759
+ return e;
1760
+ }
1761
+ let z, Y, k = 0;
1762
+ async function cn(t = {}) {
1763
+ const e = k;
1764
+ return z ??= ln(t.embed ?? dn).then((a) => (e === k && (Y = a), a)).catch((a) => {
1765
+ throw e === k && (z = void 0), a;
1766
+ }), await z;
1767
+ }
1768
+ function un() {
1769
+ return Y;
1770
+ }
1771
+ function lt() {
1772
+ k += 1, Y = void 0, z = void 0;
1773
+ }
1774
+ async function ln(t) {
1775
+ const e = pn(), a = await t(e.map((n) => n.text));
1776
+ if (a.length !== e.length)
1777
+ throw new Error(`Expected ${e.length} vectors, got ${a.length}`);
1778
+ return e.map((n, o) => ({
1779
+ ...n,
1780
+ vector: a[o]
1781
+ }));
1782
+ }
1783
+ async function dn(t) {
1784
+ const { generateEmbeddings: e } = await Promise.resolve().then(() => rn);
1785
+ return await e(t);
1786
+ }
1787
+ function pn() {
1788
+ return x().flatMap(
1789
+ (t) => sn(t).map(({ field: e, text: a }) => ({
1790
+ capabilityId: t.id,
1791
+ field: e,
1792
+ text: a
1793
+ }))
1794
+ );
1795
+ }
1796
+ const dt = 1.2, pt = 0.75, mn = 60, gn = 0.65, L = {
1797
+ description: 1,
1798
+ hint: 2,
1799
+ title: 3
1800
+ };
1801
+ let K;
1802
+ function hn() {
1803
+ K = void 0;
1804
+ }
1805
+ async function fn(t, e = {}) {
1806
+ const a = bn(Et(t));
1807
+ let n = [], o = !1, r;
1808
+ if (t.trim()) {
1809
+ const c = e.loadEmbeddings, i = un();
1810
+ if (!c && !i)
1811
+ o = !0, r = "Capability embeddings are still loading.";
1812
+ else
1813
+ try {
1814
+ if (c) {
1815
+ const [l, u] = await Promise.all([
1816
+ (e.embedQuery ?? gt)(t),
1817
+ c()
1818
+ ]);
1819
+ n = mt(l, u);
1820
+ } else if (i) {
1821
+ const l = await (e.embedQuery ?? gt)(t);
1822
+ n = mt(l, i);
1823
+ }
1824
+ } catch {
1825
+ o = !0, r = "Semantic search is unavailable.";
1826
+ }
1827
+ }
1828
+ return {
1829
+ degraded: o,
1830
+ ...r ? { degradedReason: r } : {},
1831
+ // RRF combines ranks rather than raw scores because BM25 and cosine
1832
+ // similarity are on different scales.
1833
+ matches: Sn(a, n, e.topN ?? 5)
1834
+ };
1835
+ }
1836
+ function yn() {
1837
+ return K ??= wn(x()), K;
1838
+ }
1839
+ function wn(t) {
1840
+ const e = /* @__PURE__ */ new Map(), a = t.map((n) => {
1841
+ const o = /* @__PURE__ */ new Map();
1842
+ j(o, n.title, L.title), j(o, n.description, L.description);
1843
+ for (const r of n.hints)
1844
+ j(o, r, L.hint);
1845
+ for (const r of o.keys())
1846
+ e.set(r, (e.get(r) ?? 0) + 1);
1847
+ return {
1848
+ capability: n,
1849
+ length: vn(o),
1850
+ termFrequencies: o
1851
+ };
1852
+ });
1853
+ return {
1854
+ averageDocumentLength: a.length ? a.reduce((n, o) => n + o.length, 0) / a.length : 0,
1855
+ documentFrequency: e,
1856
+ documents: a
1857
+ };
1858
+ }
1859
+ function j(t, e, a) {
1860
+ for (const n of Et(e))
1861
+ t.set(n, (t.get(n) ?? 0) + a);
1862
+ }
1863
+ function vn(t) {
1864
+ return [...t.values()].reduce((e, a) => e + a, 0);
1865
+ }
1866
+ function Et(t) {
1867
+ return t.toLowerCase().split(/[^a-z0-9]+/u).filter(Boolean);
1868
+ }
1869
+ function bn(t) {
1870
+ const e = yn(), a = new Set(t), n = e.documents.length;
1871
+ return e.documents.map(({ capability: o, length: r, termFrequencies: c }) => {
1872
+ let i = 0;
1873
+ for (const l of a) {
1874
+ const u = c.get(l), d = e.documentFrequency.get(l);
1875
+ if (!u || !d)
1876
+ continue;
1877
+ const g = Math.log(1 + (n - d + 0.5) / (d + 0.5)), p = dt * (1 - pt + pt * (r / e.averageDocumentLength));
1878
+ i += g * (u * (dt + 1) / (u + p));
1879
+ }
1880
+ return { capability: o, score: i };
1881
+ }).filter(({ score: o }) => o > 0).sort(zt);
1882
+ }
1883
+ function mt(t, e) {
1884
+ const a = /* @__PURE__ */ new Map();
1885
+ for (const o of e) {
1886
+ const r = In(t, o.vector);
1887
+ if (r === void 0)
1888
+ continue;
1889
+ const c = a.get(o.capabilityId);
1890
+ (c === void 0 || r > c) && a.set(o.capabilityId, r);
1891
+ }
1892
+ const n = new Map(x().map((o) => [o.id, o]));
1893
+ return [...a.entries()].flatMap(([o, r]) => {
1894
+ const c = n.get(o);
1895
+ return c && r >= gn ? [{ capability: c, score: r }] : [];
1896
+ }).sort(zt);
1897
+ }
1898
+ function In(t, e) {
1899
+ if (t.length === 0 || t.length !== e.length)
1900
+ return;
1901
+ let a = 0, n = 0, o = 0;
1902
+ for (let c = 0; c < t.length; c += 1)
1903
+ a += t[c] * e[c], n += t[c] ** 2, o += e[c] ** 2;
1904
+ const r = Math.sqrt(n) * Math.sqrt(o);
1905
+ return r === 0 ? void 0 : a / r;
1906
+ }
1907
+ async function gt(t) {
1908
+ const [e] = await qt([t]);
1909
+ if (!e)
1910
+ throw new Error("Expected one query embedding.");
1911
+ return e;
1912
+ }
1913
+ function Sn(t, e, a) {
1914
+ const n = /* @__PURE__ */ new Map();
1915
+ return ht(n, t, "keyword"), ht(n, e, "semantic"), [...n.values()].sort((o, r) => r.score !== o.score ? r.score - o.score : (r.semanticScore ?? 0) !== (o.semanticScore ?? 0) ? (r.semanticScore ?? 0) - (o.semanticScore ?? 0) : (r.keywordScore ?? 0) !== (o.keywordScore ?? 0) ? (r.keywordScore ?? 0) - (o.keywordScore ?? 0) : o.capability.id.localeCompare(r.capability.id)).slice(0, Math.max(0, a));
1916
+ }
1917
+ function ht(t, e, a) {
1918
+ for (const [n, { capability: o, score: r }] of e.entries()) {
1919
+ const c = n + 1, i = t.get(o.id) ?? { capability: o, score: 0 };
1920
+ i.score += 1 / (mn + c), a === "keyword" ? (i.keywordRank = c, i.keywordScore = r) : (i.semanticRank = c, i.semanticScore = r), t.set(o.id, i);
1921
+ }
1922
+ }
1923
+ function zt(t, e) {
1924
+ return e.score - t.score || t.capability.id.localeCompare(e.capability.id);
1925
+ }
1926
+ const xn = async (t, e) => {
1927
+ await m({ text: "Finding a place to navigate...", agentName: "navigation" }, e);
1928
+ const a = I(t.agentExecutionContext.messages).trim();
1929
+ try {
1930
+ const n = await fn(a, { topN: 5 });
1931
+ return console.table(
1932
+ n.matches.map(({ capability: o, keywordRank: r, keywordScore: c, semanticRank: i, semanticScore: l, score: u }) => ({
1933
+ capability: o.title,
1934
+ fusedScore: u,
1935
+ keywordRank: r,
1936
+ keywordScore: c,
1937
+ semanticRank: i,
1938
+ semanticScore: l
1939
+ }))
1940
+ ), n.degradedReason && console.info("[arcgis-portal-ai-assistant] navigation semantic search:", n.degradedReason), {
1941
+ chosenCapabilityIds: [],
1942
+ retrievalDegraded: n.degradedReason ?? "",
1943
+ targets: Tn(a, n.matches)
1944
+ };
1945
+ } catch {
1946
+ return {
1947
+ chosenCapabilityIds: [],
1948
+ outputMessage: "I couldn't look up a Portal page right now. Please try again.",
1949
+ status: "failed",
1950
+ targets: []
1951
+ };
757
1952
  }
758
1953
  };
759
- class ne extends tt {
1954
+ function Tn(t, e) {
1955
+ const a = $(t), n = e.filter(
1956
+ ({ capability: r }) => [r.title, ...r.hints].some(
1957
+ (c) => $(c) === a
1958
+ )
1959
+ );
1960
+ if (n.length !== 1)
1961
+ return e;
1962
+ const [o] = n;
1963
+ return [o, ...e.filter((r) => r !== o)];
1964
+ }
1965
+ const V = (t, e) => e ?? t, kt = h.Root({
1966
+ ...G(),
1967
+ chosenCapabilityIds: h({ reducer: V, default: () => [] }),
1968
+ // Empty when hybrid keyword-and-semantic retrieval succeeds; otherwise
1969
+ // contains the semantic-search failure reason for response diagnostics.
1970
+ retrievalDegraded: h({ reducer: V, default: () => "" }),
1971
+ targets: h({ reducer: V, default: () => [] })
1972
+ }), Cn = () => new A(kt).addNode("retrieveNavigationTargets", xn).addNode("chooseNavigationTargets", Ba).addNode("respondWithNavigation", on).addEdge(N, "retrieveNavigationTargets").addEdge("retrieveNavigationTargets", "chooseNavigationTargets").addEdge("chooseNavigationTargets", "respondWithNavigation").addEdge("respondWithNavigation", w);
1973
+ function Mn() {
1974
+ const t = x().map(({ hints: e, title: a }) => e[0] ?? a).join(", ");
1975
+ return String.raw`- **portal-navigation** - Portal page navigation assistant:
1976
+ - routes requests to open, show, or navigate to a Portal page, including creation-flow pages
1977
+ - falls back to the closest Portal page where a workflow starts when another agent cannot perform the action
1978
+ - handles short navigation follow-ups after asking the user to open a page
1979
+ - capability examples: ${t}
1980
+ - do not use for general "how do I" questions unless the user explicitly asks to reach a page
1981
+ `;
1982
+ }
1983
+ const An = {
1984
+ id: "navigation",
1985
+ name: "Portal Navigation",
1986
+ get description() {
1987
+ return Mn();
1988
+ },
1989
+ createGraph: Cn,
1990
+ workspace: kt
1991
+ }, Nn = Ot`:host{height:100%;border-width:1px;border-style:solid;border-color:var(--calcite-color-border-3);display:block;width:100%;--tw-shadow: 0 1px 6px -1px rgba(0, 0, 0, .16), 0 1px 2px -1px rgba(0, 0, 0, .08);--tw-shadow-colored: 0 1px 6px -1px var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.chat-entry{display:flex;flex-direction:column;gap:.75rem;width:100%}.chat-actions{display:flex;justify-content:flex-end;gap:.5rem}.header-actions{display:flex;gap:.5rem;padding-inline-start:.75rem}.navigation-block{display:flex;flex-direction:column;align-items:stretch;gap:.35rem;margin-top:.5rem}.navigation-button{width:100%;margin-block:.25rem}.navigation-block-description{font-size:.75rem;color:var(--calcite-color-text-3)}`;
1992
+ function Gn(t, e) {
1993
+ if (!e)
1994
+ return;
1995
+ const { destinationType: a } = t;
1996
+ switch (a) {
1997
+ case "portal-content":
1998
+ return e[a]?.(t.hash, t.queryParams);
1999
+ case "portal-groups":
2000
+ return e[a]?.(t.hash);
2001
+ case "portal-org":
2002
+ return e[a]?.(t.hash, t.queryParams);
2003
+ case "portal-gallery":
2004
+ return e[a];
2005
+ case "portal-map-viewer":
2006
+ case "portal-notebooks":
2007
+ case "portal-scene-viewer":
2008
+ return e[a];
2009
+ case "portal-item":
2010
+ return e[a]?.(t.itemId);
2011
+ case "portal-group":
2012
+ return e[a]?.(t.groupId);
2013
+ default:
2014
+ return D(a);
2015
+ }
2016
+ }
2017
+ function Pn(t) {
2018
+ const e = Ne.safeParse(t);
2019
+ return e.success ? e.data : void 0;
2020
+ }
2021
+ function qn(t, e) {
2022
+ const a = e.navigation;
2023
+ switch (t.destinationType) {
2024
+ case "portal-content":
2025
+ switch (t.hash) {
2026
+ case "favorites":
2027
+ return a.openContentFavorites;
2028
+ case "group":
2029
+ return a.openContentGroup;
2030
+ case "living-atlas":
2031
+ return a.openContentLivingAtlas;
2032
+ case "org":
2033
+ return a.openContentOrganization;
2034
+ default:
2035
+ return a.openContent;
2036
+ }
2037
+ case "portal-gallery":
2038
+ return a.openGallery;
2039
+ case "portal-groups":
2040
+ switch (t.hash) {
2041
+ case "featured":
2042
+ return a.openGroupsFeatured;
2043
+ case "my":
2044
+ return a.openGroupsMy;
2045
+ case "organization":
2046
+ return a.openGroupsOrganization;
2047
+ default:
2048
+ return a.openGroups;
2049
+ }
2050
+ case "portal-map-viewer":
2051
+ return a.openMapViewer;
2052
+ case "portal-notebooks":
2053
+ return a.openNotebooks;
2054
+ case "portal-scene-viewer":
2055
+ return a.openSceneViewer;
2056
+ case "portal-org":
2057
+ return a.openOrgSettings;
2058
+ case "portal-item":
2059
+ return a.openItem;
2060
+ case "portal-group":
2061
+ return a.openGroup;
2062
+ default:
2063
+ return D(t);
2064
+ }
2065
+ }
2066
+ class En extends Ut {
760
2067
  constructor() {
761
- super(...arguments), this.t9n = rt({ blocking: !0 }), this.assistantEl = M(), this.formEl = M(), this.voiceInputEl = M(), this.inputEl = M(), this.navigationSlotElements = /* @__PURE__ */ new Map(), this.handleSlottableRequest = (t) => {
762
- const e = t.detail, a = e.data?.block;
763
- if (!a)
2068
+ super(), this.t9n = jt({ blocking: !0 }), this.assistantEl = P(), this.formEl = P(), this.voiceInputEl = P(), this.inputEl = P(), this.navigationSlotElements = /* @__PURE__ */ new Map(), this.handleSlottableRequest = (e) => {
2069
+ const a = e.detail, n = a.data?.block;
2070
+ if (!n)
764
2071
  return;
765
- const r = this.getNavigationAction(a);
766
- r && this.upsertNavigationSlotElement(e.slotName, r);
767
- }, this.inputText = "", this.showVoiceInput = !0, this.isListening = !1, this.isVoiceInputDisabled = !1, this.interrupt = null, this.autoDestroyDisabled = !1, this.defaultClosed = !1, this.arcgisPortalNavigationRequest = et();
2072
+ const o = this.getNavigationAction(n);
2073
+ o && this.upsertNavigationSlotElement(a.slotName, o);
2074
+ }, this.inputText = "", this.showVoiceInput = !0, this.isListening = !1, this.isVoiceInputDisabled = !1, this.interrupt = null, this.autoDestroyDisabled = !1, this.defaultClosed = !1, this.arcgisPortalNavigationRequest = Ft(), x();
768
2075
  }
769
2076
  static {
770
- this.properties = { inputText: 16, showVoiceInput: 16, isListening: 16, isVoiceInputDisabled: 16, interrupt: 16, autoDestroyDisabled: 5, portal: 0, user: 0, config: 0, defaultClosed: 5 };
2077
+ this.properties = { inputText: 16, showVoiceInput: 16, isListening: 16, isVoiceInputDisabled: 16, interrupt: 16, autoDestroyDisabled: 5, portal: 0, user: 0, config: 0, navigationTargetMap: 0, disabledAgents: 0, defaultClosed: 5, navigationCapabilities: 0 };
771
2078
  }
772
2079
  static {
773
- this.styles = re;
2080
+ this.styles = Nn;
774
2081
  }
775
- getNavigationAction(t) {
776
- if (t?.type !== _)
2082
+ async load() {
2083
+ await this.refreshCapabilityEmbeddings();
2084
+ }
2085
+ willUpdate(e) {
2086
+ !this.hasUpdated || !e.has("navigationCapabilities") || this.refreshCapabilityEmbeddings();
2087
+ }
2088
+ async clearEmbeddingsCache() {
2089
+ lt();
2090
+ }
2091
+ isAgentEnabled(e) {
2092
+ return !this.disabledAgents?.[e];
2093
+ }
2094
+ async refreshCapabilityEmbeddings() {
2095
+ try {
2096
+ x(this.navigationCapabilities), hn(), lt(), await cn();
2097
+ } catch (e) {
2098
+ console.warn("[arcgis-portal-ai-assistant] embeddings warm-up failed:", e);
2099
+ }
2100
+ }
2101
+ getNavigationAction(e) {
2102
+ if (e?.type !== vt)
777
2103
  return;
778
- const e = jt(t.data);
779
- if (!e)
2104
+ const a = e.data, n = Pn(a);
2105
+ if (!n)
780
2106
  return;
781
- const a = oe(e, this.portal);
782
- if (a)
783
- return { href: a, targetDetail: e, label: this.getNavigationText(e.destinationType) };
2107
+ const o = Gn(a, this.navigationTargetMap);
2108
+ if (o)
2109
+ return {
2110
+ href: o,
2111
+ targetDetail: a,
2112
+ label: a?.buttonLabel || qn(n, this.t9n)
2113
+ };
784
2114
  }
785
- upsertNavigationSlotElement(t, e) {
786
- const a = this.assistantEl.value;
787
- if (!a)
2115
+ upsertNavigationSlotElement(e, a) {
2116
+ const n = this.assistantEl.value;
2117
+ if (!n)
788
2118
  return;
789
- let r = this.navigationSlotElements.get(t);
790
- r || (r = document.createElement("div"), r.slot = t, this.navigationSlotElements.set(t, r), a.append(r)), at(w`<div><calcite-button class="navigation-button" appearance=outline width=full .href=${e.href} icon-end=launch @click=${(l) => {
791
- l.preventDefault(), this.arcgisPortalNavigationRequest.emit({
792
- href: e.href,
793
- targetDetail: e.targetDetail
2119
+ const o = `navigation:${e}`;
2120
+ let r = this.navigationSlotElements.get(o);
2121
+ r || (r = document.createElement("div"), r.slot = e, this.navigationSlotElements.set(o, r), n.append(r)), Lt(v`<div><calcite-button class="navigation-button" appearance=outline width=full .href=${a.href} icon-end=launch @click=${(c) => {
2122
+ c.preventDefault(), this.arcgisPortalNavigationRequest.emit({
2123
+ href: a.href,
2124
+ targetDetail: a.targetDetail
794
2125
  });
795
- }}>${e.label}</calcite-button>${e.description ? w`<div class="navigation-block-description">${e.description}</div>` : null}</div>`, r);
796
- }
797
- getNavigationText(t) {
798
- const e = this.t9n.navigation;
799
- switch (t) {
800
- case "portal-content":
801
- return e.openContent;
802
- case "portal-groups":
803
- return e.openGroups;
804
- case "portal-item":
805
- return e.openItem;
806
- case "portal-group":
807
- return e.openGroup;
808
- default:
809
- return P(t);
810
- }
2126
+ }}>${a.label}</calcite-button>${a.description ? v`<div class="navigation-block-description">${a.description}</div>` : null}</div>`, r);
811
2127
  }
812
2128
  render() {
813
- const { t9n: t, inputText: e, portal: a, user: r, showVoiceInput: l, isListening: c, isVoiceInputDisabled: i } = this;
814
- return w`<arcgis-assistant log-enabled keep-suggested-prompts .heading=${t.heading} .entryMessage=${t.entryMessage} @arcgisSlottableRequest=${this.handleSlottableRequest} @arcgisInterrupt=${({ detail: o }) => {
815
- this.interrupt = o;
2129
+ const { t9n: e, inputText: a, portal: n, user: o, navigationTargetMap: r, showVoiceInput: c, isListening: i, isVoiceInputDisabled: l } = this;
2130
+ return v`<arcgis-assistant log-enabled keep-suggested-prompts .heading=${e.heading} .entryMessage=${e.entryMessage} @arcgisSlottableRequest=${this.handleSlottableRequest} @arcgisInterrupt=${({ detail: u }) => {
2131
+ this.interrupt = u;
816
2132
  }} @arcgisInterruptCancel=${() => {
817
2133
  this.interrupt = null;
818
2134
  }} @arcgisInterruptSubmit=${() => {
819
2135
  this.interrupt = null;
820
- }} @arcgisPromptSelect=${({ detail: o }) => {
821
- this.inputText = o.prompt, requestAnimationFrame(() => {
2136
+ }} @arcgisPromptSelect=${({ detail: u }) => {
2137
+ this.inputText = u.prompt, requestAnimationFrame(() => {
822
2138
  this.inputEl.value?.focusTextArea();
823
2139
  });
824
- }} ${T(this.assistantEl)}><div slot=header-actions-start class="header-actions"><calcite-icon icon=effects></calcite-icon></div><form slot=chat-entry class="chat-entry" @submit=${(o) => {
825
- o.preventDefault();
826
- const u = e.trim();
827
- u && (this.assistantEl.value?.submitMessage(u), this.inputText = "");
828
- }} ${T(this.formEl)}><arcgis-portal-mentionable-text-area .portal=${a} .user=${r} rows=3 .popoverListLabel=${t.mentionEntities} .placeholder=${t.placeholder} .value=${e} @arcgisUserMentionableTextAreaKeyDown=${({ detail: o }) => {
829
- o.key === "Enter" && !o.shiftKey && (o.preventDefault(), this.formEl.value?.requestSubmit());
830
- }} @arcgisUserMentionableTextAreaChange=${({ detail: o }) => {
831
- this.inputText = o ?? "";
832
- }} ${T(this.inputEl)}></arcgis-portal-mentionable-text-area><div class="chat-actions"><arcgis-portal-voice-input @arcgisVoiceInputStart=${() => {
2140
+ }} ${q(this.assistantEl)}><div slot=header-actions-start class="header-actions"><calcite-icon icon=effects></calcite-icon></div><form slot=chat-entry class="chat-entry" @submit=${(u) => {
2141
+ u.preventDefault();
2142
+ const d = a.trim();
2143
+ d && (this.assistantEl.value?.submitMessage(d), this.inputText = "");
2144
+ }} ${q(this.formEl)}><arcgis-portal-mentionable-text-area .portal=${n} .user=${o} rows=3 .popoverListLabel=${e.mentionEntities} .placeholder=${e.placeholder} .value=${a} @arcgisUserMentionableTextAreaKeyDown=${({ detail: u }) => {
2145
+ u.key === "Enter" && !u.shiftKey && (u.preventDefault(), this.formEl.value?.requestSubmit());
2146
+ }} @arcgisUserMentionableTextAreaChange=${({ detail: u }) => {
2147
+ this.inputText = u ?? "";
2148
+ }} ${q(this.inputEl)}></arcgis-portal-mentionable-text-area><div class="chat-actions"><arcgis-portal-voice-input @arcgisVoiceInputStart=${() => {
833
2149
  this.isListening = !0, this.isVoiceInputDisabled = !1;
834
2150
  }} @arcgisVoiceInputStop=${() => {
835
2151
  this.isListening = !1, this.isVoiceInputDisabled = !1;
836
- }} @arcgisVoiceInputError=${(o) => {
837
- o.detail.errorCode === "not-supported" && (this.showVoiceInput = !1);
838
- }} @arcgisVoiceInputInterimTranscription=${(o) => {
839
- this.inputText = o.detail.text;
840
- }} ${T(this.voiceInputEl)}></arcgis-portal-voice-input>${l && w`<calcite-button icon-start=microphone .label=${t.voiceInput} round .disabled=${i} .appearance=${c ? "solid" : "outline-fill"} @click=${async () => {
2152
+ }} @arcgisVoiceInputError=${(u) => {
2153
+ u.detail.errorCode === "not-supported" && (this.showVoiceInput = !1);
2154
+ }} @arcgisVoiceInputInterimTranscription=${(u) => {
2155
+ this.inputText = u.detail.text;
2156
+ }} ${q(this.voiceInputEl)}></arcgis-portal-voice-input>${c && v`<calcite-button icon-start=microphone .label=${e.voiceInput} round .disabled=${l} .appearance=${i ? "solid" : "outline-fill"} @click=${async () => {
841
2157
  this.isVoiceInputDisabled = !0;
842
- const o = this.voiceInputEl.value;
843
- c ? await o?.stopListening() : await o?.startListening();
844
- }}></calcite-button>` || ""}<calcite-button type=submit icon-start=send round .disabled=${!e.trim()} .label=${t.send}>${t.send}</calcite-button></div></form><arcgis-assistant-agent .agent=${Tt} .context=${{ portal: a, user: r }}></arcgis-assistant-agent><arcgis-assistant-agent .agent=${Lt} .context=${{ portal: a, user: r }}></arcgis-assistant-agent><arcgis-assistant-agent .agent=${ae} .context=${{ portal: a, user: r }}></arcgis-assistant-agent>${this.interrupt && w`<arcgis-portal-ai-assistant-interrupt slot=interrupt .type=${this.interrupt.type} .message=${this.interrupt.message} .options=${this.interrupt.options} @arcgisSubmit=${({ detail: o }) => {
845
- this.assistantEl.value?.submitInterrupt(o);
2158
+ const u = this.voiceInputEl.value;
2159
+ i ? await u?.stopListening() : await u?.startListening();
2160
+ }}></calcite-button>` || ""}<calcite-button type=submit icon-start=send round .disabled=${!a.trim()} .label=${e.send}>${e.send}</calcite-button></div></form>${this.isAgentEnabled("itemAnalytics") && v`<arcgis-assistant-agent .agent=${Da} .context=${{ portal: n, user: o, navigationTargetMap: r }}></arcgis-assistant-agent>` || ""}${this.isAgentEnabled("groupCreation") && v`<arcgis-assistant-agent .agent=${Ee} .context=${{ portal: n, user: o, navigationTargetMap: r }}></arcgis-assistant-agent>` || ""}${this.isAgentEnabled("docAssistant") && v`<arcgis-assistant-agent .agent=${aa} .context=${{ portal: n, user: o, navigationTargetMap: r }}></arcgis-assistant-agent>` || ""}${this.isAgentEnabled("groupAnalytics") && v`<arcgis-assistant-agent .agent=${Ta} .context=${{ portal: n, user: o, navigationTargetMap: r }}></arcgis-assistant-agent>` || ""}${this.isAgentEnabled("navigation") && v`<arcgis-assistant-agent .agent=${An} .context=${{ portal: n, user: o, navigationTargetMap: r }}></arcgis-assistant-agent>` || ""}${this.interrupt && v`<arcgis-portal-ai-assistant-interrupt slot=interrupt .type=${this.interrupt.type} .message=${this.interrupt.message} .options=${this.interrupt.options} @arcgisSubmit=${({ detail: u }) => {
2161
+ this.assistantEl.value?.submitInterrupt(u);
846
2162
  }} @arcgisCancel=${() => {
847
2163
  this.assistantEl.value?.cancelInterrupt();
848
2164
  }}></arcgis-portal-ai-assistant-interrupt>` || ""}</arcgis-assistant>`;
849
2165
  }
850
2166
  }
851
- Z("arcgis-portal-ai-assistant", ne);
2167
+ Rt("arcgis-portal-ai-assistant", En);
852
2168
  export {
853
- ne as ArcgisPortalAiAssistant
2169
+ En as ArcgisPortalAiAssistant
854
2170
  };