@arcgis/ai-components 6.0.0-next.1 → 6.0.0-next.2

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 (353) hide show
  1. package/dist/agent-utils/BaseAgent.js +1 -1
  2. package/dist/agent-utils/FunctionAgent.js +1 -1
  3. package/dist/agent-utils/LLMAgent.js +1 -1
  4. package/dist/agent-utils/SkillAgent.js +1 -1
  5. package/dist/agent-utils/WorkflowAgent.js +1 -1
  6. package/dist/agent-utils/createSchema.js +1 -1
  7. package/dist/agent-utils/middlewares/humanInTheLoop.js +1 -1
  8. package/dist/agent-utils/middlewares/middleware.js +1 -1
  9. package/dist/agent-utils/middlewares/trace.js +1 -1
  10. package/dist/agent-utils/middlewares/types.js +1 -1
  11. package/dist/agent-utils/tools/FunctionTool.js +1 -1
  12. package/dist/agent-utils/tools/MCPToolProvider.js +1 -1
  13. package/dist/agent-utils/tools/WebMCPToolProvider.js +1 -1
  14. package/dist/agent-utils/workflows/ConditionalWorkflow.js +1 -1
  15. package/dist/agent-utils/workflows/LoopWorkflow.js +1 -1
  16. package/dist/agent-utils/workflows/ParallelWorkflow.js +1 -1
  17. package/dist/agent-utils/workflows/RouterWorkflow.js +1 -1
  18. package/dist/agent-utils/workflows/SequentialWorkflow.js +1 -1
  19. package/dist/agent-utils/workflows/SwitchWorkflow.js +1 -1
  20. package/dist/agents/agents/arcgisKnowledge/graph/arcgisKnowledgeGraph.js +1 -1
  21. package/dist/agents/agents/dataExploration/dataExplorationAgent.js +1 -1
  22. package/dist/agents/agents/dataExplorationGraph/graph/dataExplorationGraph.js +1 -1
  23. package/dist/agents/agents/help/helpAgent.js +1 -1
  24. package/dist/agents/agents/helpGraph/graph/helpGraph.js +1 -1
  25. package/dist/agents/agents/layerStyling/context/layerStylingContext.js +1 -1
  26. package/dist/agents/agents/layerStyling/graph/layerStylingGraph.js +1 -1
  27. package/dist/agents/agents/navigation/navigationAgent.js +1 -1
  28. package/dist/agents/agents/navigationGraph/graph/navigationGraph.js +1 -1
  29. package/dist/agents/tools/filter/clearFilters/adapter.js +1 -1
  30. package/dist/agents/tools/filter/resetMap/adapter.js +1 -1
  31. package/dist/agents/tools/filter/setFeatureEffect/adapter.js +1 -1
  32. package/dist/agents/tools/help/listFields/adapter.js +1 -1
  33. package/dist/agents/tools/navigation/goToAddress/adapter.js +1 -1
  34. package/dist/agents/tools/navigation/goToBookmark/adapter.js +1 -1
  35. package/dist/agents/tools/navigation/goToFeatures/adapter.js +1 -1
  36. package/dist/agents/tools/navigation/goToFullExtent/adapter.js +1 -1
  37. package/dist/agents/tools/navigation/goToHomeExtent/adapter.js +1 -1
  38. package/dist/agents/tools/navigation/goToLayer/adapter.js +1 -1
  39. package/dist/agents/tools/navigation/goToScale/adapter.js +1 -1
  40. package/dist/agents/tools/navigation/goToViewpoint/adapter.js +1 -1
  41. package/dist/agents/tools/navigation/goToZoom/adapter.js +1 -1
  42. package/dist/agents/tools/query/getAttribute/adapter.js +1 -1
  43. package/dist/agents/tools/query/getStatistics/adapter.js +1 -1
  44. package/dist/agents/tools/query/getTopFeatures/adapter.js +1 -1
  45. package/dist/agents/tools/query/queryFeatures/adapter.js +1 -1
  46. package/dist/agents/tools/search/findRelevantFields/adapter.js +1 -1
  47. package/dist/agents/tools/search/findRelevantLayers/adapter.js +1 -1
  48. package/dist/agents/tools/shared/resolveToolArtifact.js +1 -1
  49. package/dist/agents/tools/shared/types.js +1 -1
  50. package/dist/cdn/24KEZCPF.js +2 -0
  51. package/dist/cdn/{2UKFCF2J.js → 272R36XK.js} +2 -2
  52. package/dist/cdn/{FX4LV2S3.js → 2H32MDP2.js} +1 -1
  53. package/dist/cdn/{VAXH6RUQ.js → 2HNGMLFD.js} +2 -2
  54. package/dist/cdn/{24TK55FP.js → 2JD3G7IW.js} +2 -2
  55. package/dist/cdn/{P4CHI7W3.js → 2NOLMOEP.js} +2 -2
  56. package/dist/cdn/{ZU2FHVNK.js → 2OW3DCUT.js} +2 -2
  57. package/dist/cdn/2PGZDONH.js +2 -0
  58. package/dist/cdn/2WY5MPMY.js +2 -0
  59. package/dist/cdn/{2DWN3SKH.js → 3COVQI26.js} +2 -2
  60. package/dist/cdn/{VIJVRJHL.js → 3UVQLYUK.js} +2 -2
  61. package/dist/cdn/{BIEX4MVV.js → 5HNKH5OK.js} +2 -2
  62. package/dist/cdn/{46DT6BIG.js → 5INBG23U.js} +1 -1
  63. package/dist/cdn/{YJXRCO4T.js → 5LBUP33F.js} +2 -2
  64. package/dist/cdn/{UZLQALHY.js → 5PV2GUZW.js} +1 -1
  65. package/dist/cdn/{YBWRFVA6.js → 5SRRG7WG.js} +2 -2
  66. package/dist/cdn/{EEHDAYOG.js → 5XZ5VL42.js} +2 -2
  67. package/dist/cdn/{DI3VGUJY.js → 63OF33IL.js} +2 -2
  68. package/dist/cdn/{NHWT7CXX.js → 6ELWX4W5.js} +2 -2
  69. package/dist/cdn/{OKVLGJAG.js → 6J3J7VLW.js} +2 -2
  70. package/dist/cdn/{AOVJ34QE.js → 6QOSUG64.js} +2 -2
  71. package/dist/cdn/{GVFJHADC.js → 6UGT2UG5.js} +2 -2
  72. package/dist/cdn/{JEWJ4M25.js → 7APXFHDF.js} +3 -3
  73. package/dist/cdn/{QEGO4B2W.js → 7GDMXAF5.js} +2 -2
  74. package/dist/cdn/7JIXXYZR.js +2 -0
  75. package/dist/cdn/{X5ET73QZ.js → 7OQK2F7O.js} +2 -2
  76. package/dist/cdn/{KX6CZEVZ.js → 7XVIZ7HK.js} +2 -2
  77. package/dist/cdn/{FSLPYC4Y.js → A4ZVCRVF.js} +2 -2
  78. package/dist/cdn/{OVIQ5NSE.js → AGDGDULE.js} +2 -2
  79. package/dist/cdn/{TPULIO6I.js → AMA67DVI.js} +2 -2
  80. package/dist/cdn/AO42IPOX.js +2 -0
  81. package/dist/cdn/{UOKYHQNO.js → AOT3PM2Q.js} +2 -2
  82. package/dist/cdn/{EG5BMYZO.js → AQ7KG25Q.js} +2 -2
  83. package/dist/cdn/{6PK2UPG3.js → AWH4VDPD.js} +2 -2
  84. package/dist/cdn/AY2ZONWQ.js +2 -0
  85. package/dist/cdn/{JZPPP4QY.js → BMVPOFHU.js} +2 -2
  86. package/dist/cdn/BWUQRZPK.js +2 -0
  87. package/dist/cdn/{XWNZMKQF.js → C3VLDYS2.js} +2 -2
  88. package/dist/cdn/{PQ2DPOFM.js → C5Q6E7UC.js} +2 -2
  89. package/dist/cdn/{FDOMMK2M.js → CETIZ4IQ.js} +1 -1
  90. package/dist/cdn/{TENUVOFJ.js → COANVCKH.js} +2 -2
  91. package/dist/cdn/{2O52MJ3D.js → D7CRICBG.js} +2 -2
  92. package/dist/cdn/D7FEOAW3.js +2 -0
  93. package/dist/cdn/{PGUEODFA.js → DY6MO2CA.js} +2 -2
  94. package/dist/cdn/EKMCGN6R.js +2 -0
  95. package/dist/cdn/EUIURCPS.js +2 -0
  96. package/dist/cdn/{DGCWQYN3.js → FGQH46Z2.js} +2 -2
  97. package/dist/cdn/FIZMK7GS.js +1 -0
  98. package/dist/cdn/FONIQ7VF.js +2 -0
  99. package/dist/cdn/G3KILEGJ.js +2 -0
  100. package/dist/cdn/{FYZATVB3.js → G7MCIFV2.js} +2 -2
  101. package/dist/cdn/{SDWWUWAF.js → GGAXXX5X.js} +2 -2
  102. package/dist/cdn/GS5JDPZH.js +2 -0
  103. package/dist/cdn/{T3SCINN5.js → H4QWVTEZ.js} +2 -2
  104. package/dist/cdn/{ZSLHB6MF.js → H6J65TWL.js} +2 -2
  105. package/dist/cdn/{UHEYPSOR.js → HCPI2RJE.js} +2 -2
  106. package/dist/cdn/{PCAMBPOA.js → HJOWCZPL.js} +2 -2
  107. package/dist/cdn/{7HVIVV3O.js → HOMSK66Q.js} +2 -2
  108. package/dist/cdn/{5REENYPV.js → HTNKDDEV.js} +2 -2
  109. package/dist/cdn/{6WYVG3JI.js → HU527DML.js} +2 -2
  110. package/dist/cdn/I37ZJHTM.js +2 -0
  111. package/dist/cdn/{GHFOAS7T.js → I724KIFI.js} +2 -2
  112. package/dist/cdn/IH5P2PWJ.js +2 -0
  113. package/dist/cdn/{C67KQCPS.js → J3T5HB77.js} +2 -2
  114. package/dist/cdn/{EXLDRGUC.js → JCWFLYB4.js} +2 -2
  115. package/dist/cdn/{IHP25JWI.js → JSRNLNOE.js} +2 -2
  116. package/dist/cdn/{MPWEXYYB.js → KDA5VPLO.js} +2 -2
  117. package/dist/cdn/KRPPMEOF.js +2 -0
  118. package/dist/cdn/{GBFRJF4F.js → KURNYULZ.js} +2 -2
  119. package/dist/cdn/{ZKWXHSEQ.js → L46O52F7.js} +2 -2
  120. package/dist/cdn/{BBB5EJUB.js → L5OYOLWV.js} +3 -3
  121. package/dist/cdn/{FJV7CI7O.js → LDDP7NSY.js} +2 -2
  122. package/dist/cdn/{ZQTCPJUV.js → LGIXZLOP.js} +2 -2
  123. package/dist/cdn/{OGZFST2A.js → LMAIOLS2.js} +2 -2
  124. package/dist/cdn/{CFAC4FN3.js → LWEKPFV6.js} +2 -2
  125. package/dist/cdn/{L5IPMRHC.js → M52LKZN7.js} +2 -2
  126. package/dist/cdn/{AQF6BBWC.js → M5UMOOL2.js} +2 -2
  127. package/dist/cdn/{HWIM4KWF.js → MHXM37QI.js} +2 -2
  128. package/dist/cdn/{7X22QXJP.js → MR3R5YHQ.js} +2 -2
  129. package/dist/cdn/{M6JQGHCE.js → MUSLUFKI.js} +2 -2
  130. package/dist/cdn/MYLY2ABI.js +2 -0
  131. package/dist/cdn/{AMP43OT2.js → N2GN5WOI.js} +2 -2
  132. package/dist/cdn/{RE7MJTEF.js → NAVK5JJ2.js} +3 -3
  133. package/dist/cdn/NDSYDURO.js +2 -0
  134. package/dist/cdn/{7ZTYHZIN.js → NK2QRPS6.js} +2 -2
  135. package/dist/cdn/{GMZUN5SF.js → NYFL2F5L.js} +2 -2
  136. package/dist/cdn/{PGH7POKS.js → OKDXM5D4.js} +2 -2
  137. package/dist/cdn/{JFL5IWPK.js → OMUWBY75.js} +2 -2
  138. package/dist/cdn/{34O57OGV.js → OPQCY33W.js} +1 -1
  139. package/dist/cdn/{R74ZHFA6.js → OUMTV5H5.js} +1 -1
  140. package/dist/cdn/{5FDBJI24.js → OZDRETY2.js} +2 -2
  141. package/dist/cdn/{DYSPEU7W.js → PR4VMSKD.js} +1 -1
  142. package/dist/cdn/{HSMAXOOA.js → PXBS2FXE.js} +2 -2
  143. package/dist/cdn/{DJG6DBCU.js → Q7BJGEFH.js} +3 -3
  144. package/dist/cdn/{XEJFVUNQ.js → QAVDW7A7.js} +1 -1
  145. package/dist/cdn/{ONQ6JSBJ.js → QBZP6XOE.js} +1 -1
  146. package/dist/cdn/{OT5ECP4V.js → RFIN7KO6.js} +2 -2
  147. package/dist/cdn/RNJ7T5GF.js +2 -0
  148. package/dist/cdn/{BMPBJXD7.js → S6OUM5X2.js} +2 -2
  149. package/dist/cdn/SG6PAUVR.js +2 -0
  150. package/dist/cdn/{7MCFHVEH.js → SRXUC4QB.js} +2 -2
  151. package/dist/cdn/{A22375P3.js → SUMXIUIS.js} +2 -2
  152. package/dist/cdn/SW3D6QD4.js +2 -0
  153. package/dist/cdn/{GEFFWUB2.js → T2OYUOSO.js} +1 -1
  154. package/dist/cdn/T7LYQ56H.js +2 -0
  155. package/dist/cdn/{DZOQFEOB.js → TFXK2POV.js} +2 -2
  156. package/dist/cdn/{XQ3NBBQ3.js → TIQUULA4.js} +1 -1
  157. package/dist/cdn/{LCI5MEDN.js → TOUYGIGK.js} +2 -2
  158. package/dist/cdn/{RFDMNYTA.js → UJMM5QA4.js} +2 -2
  159. package/dist/cdn/{5LA77ZBW.js → UMTRLI63.js} +2 -2
  160. package/dist/cdn/{NPV4MEAZ.js → UP7RW5K2.js} +2 -2
  161. package/dist/cdn/{XCLICBG7.js → UR2S7L6Z.js} +2 -2
  162. package/dist/cdn/{CEKOEHB3.js → UWHRBGWN.js} +2 -2
  163. package/dist/cdn/{UQRBY7ID.js → UXDRYDOD.js} +2 -2
  164. package/dist/cdn/{JUPTVXLY.js → UZ7XFHYI.js} +2 -2
  165. package/dist/cdn/V66TS2BB.js +2 -0
  166. package/dist/cdn/{AAUVOBPS.js → VINKTQFR.js} +1 -1
  167. package/dist/cdn/{SWXUQFB6.js → VU7IOGNS.js} +2 -2
  168. package/dist/cdn/{HC5DJL2U.js → W2SIOY2B.js} +2 -2
  169. package/dist/cdn/{FBARYPZ7.js → W36IUEUB.js} +2 -2
  170. package/dist/cdn/{5TW2NFES.js → WEBAQIUT.js} +2 -2
  171. package/dist/cdn/{WSIZ2OTL.js → WHIWOYHN.js} +1 -1
  172. package/dist/cdn/WOL5YMJ2.js +2 -0
  173. package/dist/cdn/{66VWTARH.js → X3YFCWQZ.js} +2 -2
  174. package/dist/cdn/{ICBIUFK7.js → X4EQEKM7.js} +2 -2
  175. package/dist/cdn/{TJBU5BQK.js → XBWGOD6I.js} +2 -2
  176. package/dist/cdn/{6E6T6U7W.js → XGDXTTYW.js} +2 -2
  177. package/dist/cdn/{CDS2HGQY.js → XLHYQNAM.js} +2 -2
  178. package/dist/cdn/{NEV6OZN3.js → XMQJWPXI.js} +2 -2
  179. package/dist/cdn/{QT3B5K4R.js → XQUKC4YK.js} +2 -2
  180. package/dist/cdn/{JEBRN3EU.js → XSH4B7FP.js} +2 -2
  181. package/dist/cdn/{LK7ZIQW6.js → XVWSIDZV.js} +2 -2
  182. package/dist/cdn/{J6A4AS7E.js → XYMIFFBW.js} +2 -2
  183. package/dist/cdn/{MPQ2OZXN.js → Y3ZKMD47.js} +2 -2
  184. package/dist/cdn/{YPLPDUMB.js → YAANCUW2.js} +2 -2
  185. package/dist/cdn/{KY7M4WHO.js → YD5LVM7V.js} +2 -2
  186. package/dist/cdn/{AMURN3LO.js → YGI277SH.js} +2 -2
  187. package/dist/cdn/{YI6NIHNI.js → YGSDJ4V3.js} +2 -2
  188. package/dist/cdn/YJEARDAZ.js +2 -0
  189. package/dist/cdn/{XC3T3Z5R.js → YSEHJQ4L.js} +2 -2
  190. package/dist/cdn/Z44NI2YQ.js +2 -0
  191. package/dist/cdn/{74CVYM72.js → ZEDDYT24.js} +2 -2
  192. package/dist/cdn/{MD2FTKQT.js → ZROI63CW.js} +2 -2
  193. package/dist/cdn/{UYP5PH5E.js → ZUKM4DGB.js} +2 -2
  194. package/dist/cdn/ZVVNATCX.js +2 -0
  195. package/dist/cdn/agent-utils/BaseAgent.js +2 -2
  196. package/dist/cdn/agent-utils/FunctionAgent.js +2 -2
  197. package/dist/cdn/agent-utils/LLMAgent.js +2 -2
  198. package/dist/cdn/agent-utils/SkillAgent.js +2 -2
  199. package/dist/cdn/agent-utils/WorkflowAgent.js +2 -2
  200. package/dist/cdn/agent-utils/createSchema.js +2 -2
  201. package/dist/cdn/agent-utils/middlewares/humanInTheLoop.js +2 -2
  202. package/dist/cdn/agent-utils/middlewares/middleware.js +2 -2
  203. package/dist/cdn/agent-utils/middlewares/trace.js +2 -2
  204. package/dist/cdn/agent-utils/tools/FunctionTool.js +2 -2
  205. package/dist/cdn/agent-utils/tools/MCPToolProvider.js +2 -2
  206. package/dist/cdn/agent-utils/tools/WebMCPToolProvider.js +2 -2
  207. package/dist/cdn/agent-utils/workflows/ConditionalWorkflow.js +2 -2
  208. package/dist/cdn/agent-utils/workflows/LoopWorkflow.js +2 -2
  209. package/dist/cdn/agent-utils/workflows/ParallelWorkflow.js +2 -2
  210. package/dist/cdn/agent-utils/workflows/RouterWorkflow.js +2 -2
  211. package/dist/cdn/agent-utils/workflows/SequentialWorkflow.js +2 -2
  212. package/dist/cdn/agent-utils/workflows/SwitchWorkflow.js +2 -2
  213. package/dist/cdn/index.js +2 -2
  214. package/dist/cdn/orchestrator/embeddings/getEmbeddings.js +2 -2
  215. package/dist/cdn/orchestrator/models/chatModel.js +2 -2
  216. package/dist/cdn/orchestrator/models/prompts.js +2 -2
  217. package/dist/cdn/orchestrator/signals.js +2 -2
  218. package/dist/cdn/orchestrator/state/runtime.js +2 -2
  219. package/dist/chunks/BaseWorkflow.js +1 -1
  220. package/dist/chunks/SKILL.js +1 -1
  221. package/dist/chunks/SKILL2.js +1 -1
  222. package/dist/chunks/SKILL3.js +1 -1
  223. package/dist/chunks/SKILL4.js +1 -1
  224. package/dist/chunks/adapter.js +1 -1
  225. package/dist/chunks/adapter2.js +1 -1
  226. package/dist/chunks/aiFactory.js +1 -1
  227. package/dist/chunks/aiUtilityService.js +1 -1
  228. package/dist/chunks/arcgisToolRegistry.js +1 -1
  229. package/dist/chunks/arcgis_knowledge_current_lc_context.js +1 -1
  230. package/dist/chunks/arcgis_knowledge_current_map_context.js +1 -1
  231. package/dist/chunks/arcgis_knowledge_cypher_query_prompt.js +1 -1
  232. package/dist/chunks/arcgis_knowledge_lucene_generation_prompt.js +1 -1
  233. package/dist/chunks/arcgis_knowledge_summarize_result_prompt.js +1 -1
  234. package/dist/chunks/arcgis_knowledge_tool_prompt.js +1 -1
  235. package/dist/chunks/converterUtils.js +1 -1
  236. package/dist/chunks/createSkillAgent.js +1 -1
  237. package/dist/chunks/data_explore_filter_prompt.js +1 -1
  238. package/dist/chunks/data_explore_query_prompt.js +1 -1
  239. package/dist/chunks/embeddings.worker.js +1 -1
  240. package/dist/chunks/fetchAgentContext.js +1 -1
  241. package/dist/chunks/fetchService.js +1 -1
  242. package/dist/chunks/fetchUtils.js +1 -1
  243. package/dist/chunks/fieldStatistics.js +1 -1
  244. package/dist/chunks/field_descriptions_prompt.js +1 -1
  245. package/dist/chunks/formatFeatureAttributes.js +1 -1
  246. package/dist/chunks/getPrompt.js +1 -1
  247. package/dist/chunks/graph.js +1 -1
  248. package/dist/chunks/helpState.js +1 -1
  249. package/dist/chunks/help_prompt.js +1 -1
  250. package/dist/chunks/intent_prompt.js +1 -1
  251. package/dist/chunks/layerQueryToolCalling.js +1 -1
  252. package/dist/chunks/layerStylingState.js +1 -1
  253. package/dist/chunks/layer_descriptions_prompt.js +1 -1
  254. package/dist/chunks/layer_styling_prompt.js +1 -1
  255. package/dist/chunks/localization.js +1 -1
  256. package/dist/chunks/mergeWhereClauses.js +1 -1
  257. package/dist/chunks/modelConfig.js +1 -1
  258. package/dist/chunks/modelPricing.js +1 -1
  259. package/dist/chunks/navigationState.js +1 -1
  260. package/dist/chunks/navigation_intent_prompt.js +1 -1
  261. package/dist/chunks/navigation_tool_prompt.js +1 -1
  262. package/dist/chunks/observationSnapshot.js +1 -1
  263. package/dist/chunks/reducers.js +1 -1
  264. package/dist/chunks/requireAgentServices.js +1 -1
  265. package/dist/chunks/resolveFieldNames.js +1 -1
  266. package/dist/chunks/resolveGeometryFilter.js +1 -1
  267. package/dist/chunks/runtime.js +2 -2
  268. package/dist/chunks/runtime2.js +1 -1
  269. package/dist/chunks/runtimeSpans.js +1 -1
  270. package/dist/chunks/schema.js +1 -1
  271. package/dist/chunks/slottableRequestUtils.js +1 -1
  272. package/dist/chunks/state.js +1 -1
  273. package/dist/chunks/summarize_query_response_prompt.js +1 -1
  274. package/dist/chunks/textFormatters.js +1 -1
  275. package/dist/chunks/toolCallResponse.js +1 -1
  276. package/dist/chunks/useT9n.js +1 -1
  277. package/dist/chunks/utils.js +1 -1
  278. package/dist/chunks/utils2.js +1 -1
  279. package/dist/chunks/utils3.js +1 -1
  280. package/dist/chunks/webmapSchema.js +1 -1
  281. package/dist/components/arcgis-assistant/customElement.js +1 -1
  282. package/dist/components/arcgis-assistant-agent/customElement.js +1 -1
  283. package/dist/components/arcgis-assistant-chat/customElement.js +1 -1
  284. package/dist/components/arcgis-assistant-chat-entry/customElement.js +1 -1
  285. package/dist/components/arcgis-assistant-data-exploration-agent/customElement.js +1 -1
  286. package/dist/components/arcgis-assistant-help-agent/customElement.js +1 -1
  287. package/dist/components/arcgis-assistant-interrupt/customElement.js +1 -1
  288. package/dist/components/arcgis-assistant-interrupt-preview/customElement.js +1 -1
  289. package/dist/components/arcgis-assistant-knowledge-agent/customElement.js +1 -1
  290. package/dist/components/arcgis-assistant-layer-styling-agent/customElement.js +1 -1
  291. package/dist/components/arcgis-assistant-message/customElement.js +1 -1
  292. package/dist/components/arcgis-assistant-message-block/customElement.js +1 -1
  293. package/dist/components/arcgis-assistant-message-feedback/customElement.js +1 -1
  294. package/dist/components/arcgis-assistant-message-footer/customElement.js +1 -1
  295. package/dist/components/arcgis-assistant-message-loading/customElement.js +1 -1
  296. package/dist/components/arcgis-assistant-message-log/customElement.js +1 -1
  297. package/dist/components/arcgis-assistant-message-read-aloud/customElement.js +1 -1
  298. package/dist/components/arcgis-assistant-message-text/customElement.js +1 -1
  299. package/dist/components/arcgis-assistant-navigation-agent/customElement.js +1 -1
  300. package/dist/components/arcgis-assistant-observation-inspector/customElement.js +1 -1
  301. package/dist/components/arcgis-assistant-observation-latency/customElement.js +1 -1
  302. package/dist/components/arcgis-assistant-observation-panel/customElement.js +1 -1
  303. package/dist/components/arcgis-assistant-observation-run/customElement.js +1 -1
  304. package/dist/components/arcgis-assistant-observation-usage/customElement.js +1 -1
  305. package/dist/components/arcgis-assistant-speech-input/customElement.js +1 -1
  306. package/dist/components/arcgis-assistant-suggested-prompts/customElement.js +1 -1
  307. package/dist/components/arcgis-assistant-user-message/customElement.js +1 -1
  308. package/dist/docs/api.json +1 -1
  309. package/dist/docs/docs.json +1 -1
  310. package/dist/docs/web-types.json +1 -1
  311. package/dist/index.js +1 -1
  312. package/dist/loader.js +1 -1
  313. package/dist/orchestrator/embeddings/cosineSimilarity.js +1 -1
  314. package/dist/orchestrator/embeddings/getEmbeddings.js +1 -1
  315. package/dist/orchestrator/embeddings/webmapEmbeddings.js +1 -1
  316. package/dist/orchestrator/models/chatModel.js +1 -1
  317. package/dist/orchestrator/models/prompts.js +1 -1
  318. package/dist/orchestrator/orchestrator/orchestrator.js +1 -1
  319. package/dist/orchestrator/orchestrator/orchestratorEvents.js +1 -1
  320. package/dist/orchestrator/signals.js +1 -1
  321. package/dist/orchestrator/state/runtime.js +1 -1
  322. package/dist/orchestrator/state/types.js +1 -1
  323. package/dist/orchestrator/types.js +1 -1
  324. package/dist/utils/index.js +1 -1
  325. package/package.json +5 -5
  326. package/dist/cdn/2UDDCWNW.js +0 -2
  327. package/dist/cdn/434TAA3J.js +0 -2
  328. package/dist/cdn/4KFTUBFL.js +0 -2
  329. package/dist/cdn/AO2G4EXA.js +0 -2
  330. package/dist/cdn/AWPLRVPS.js +0 -2
  331. package/dist/cdn/C76HLPKU.js +0 -2
  332. package/dist/cdn/CADNOKIK.js +0 -2
  333. package/dist/cdn/CHHC6YNW.js +0 -2
  334. package/dist/cdn/DBRBT54R.js +0 -2
  335. package/dist/cdn/DJKEGIQZ.js +0 -2
  336. package/dist/cdn/EGSD465U.js +0 -2
  337. package/dist/cdn/HLWG7OIR.js +0 -2
  338. package/dist/cdn/KKWCHNYQ.js +0 -2
  339. package/dist/cdn/M2G44RTS.js +0 -2
  340. package/dist/cdn/MB7SEHPZ.js +0 -2
  341. package/dist/cdn/MC2V5WT3.js +0 -2
  342. package/dist/cdn/MZFWD5CQ.js +0 -2
  343. package/dist/cdn/NMFEXE4D.js +0 -2
  344. package/dist/cdn/OYHYHALE.js +0 -2
  345. package/dist/cdn/QUZTFUWM.js +0 -1
  346. package/dist/cdn/RF6HWZMB.js +0 -2
  347. package/dist/cdn/RFPTOFM4.js +0 -2
  348. package/dist/cdn/RKURZ5T2.js +0 -2
  349. package/dist/cdn/SJ4UMNIS.js +0 -2
  350. package/dist/cdn/USPB2QBX.js +0 -2
  351. package/dist/cdn/V6EX4YCY.js +0 -2
  352. package/dist/cdn/VA4M72JC.js +0 -2
  353. package/dist/cdn/VQ67NANV.js +0 -2
@@ -1,2 +1,2 @@
1
- /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{b as $}from"./UYP5PH5E.js";import"./QUZTFUWM.js";import"./A22375P3.js";import"./DYSPEU7W.js";import{C as S,g as b,h as u,o as v,v as m,w as f,x as w,y as _}from"./RE7MJTEF.js";import"./R74ZHFA6.js";import"./UZLQALHY.js";export default $arcgis.t(([q])=>{var R=b`:host{--calcite-text-area-border-color: var(--calcite-color-border-1);--calcite-text-area-divider-color: var(--calcite-color-border-1);--calcite-text-area-corner-radius: var(--calcite-border-radius)}.input-container{display:flex;flex-direction:column}.footer-start{display:flex;gap:var(--calcite-spacing-md);flex-wrap:wrap;align-items:center}.footer-end{display:flex;gap:var(--calcite-spacing-md);align-items:center}.focused{--calcite-text-area-shadow: var(--calcite-shadow-sm)}.suggestions-loading{padding:var(--calcite-spacing-sm)}`,P={suggestions:[],loading:!1,selectedIndex:0};function I(c){return c.filter(({trigger:t})=>t!==""&&t!=="/").sort((t,e)=>e.trigger.length-t.trigger.length)}var y=class{constructor(t){this._onStateChange=t}#t=null;#o;#e=P;get state(){return this.#e}get activeSuggestion(){return this.#o}get selectedSuggestion(){return this.#e.suggestions[this.#e.selectedIndex]}moveSelection(t){this.#a({selectedIndex:Math.max(0,Math.min(this.#e.selectedIndex+t,this.#e.suggestions.length-1))})}async update(t,e,i){this.#t?.abort();let s=this.#i(t,e,i);if(!s){this.close();return}let n=new AbortController;this.#t=n,this.#o=s,this.#a({suggestions:[],loading:!0,selectedIndex:0});try{let r=await s.provider.getSuggestions(s.query,n.signal);if(n.signal.aborted||this.#t!==n)return;this.#a({suggestions:r,loading:!1,selectedIndex:0})}catch{n.signal.aborted||this.close()}}async resolveTypedInputs(t,e,i,s){let n=await this.#s(t,e.commandProvider,i,s);return s.aborted?[]:(n.push(...await this.#r(t,e.entityProviders,i,s)),n)}close(){this.#t?.abort(),this.#t=null,this.#o=void 0,this.#a({suggestions:[],loading:!1,selectedIndex:0})}#i(t,e,i){if(e==null)return;let s=t.slice(0,e),n=s.slice(1);if(i.commandProvider&&s.startsWith("/")&&!/\s/u.test(n))return{kind:"command",provider:i.commandProvider,start:0,end:e,query:n};let r=I(i.entityProviders);for(let a of r){let l=s.lastIndexOf(a.trigger),o=s.slice(l+a.trigger.length);if(l!==-1&&a.trigger&&!/\s/u.test(o)&&(l===0||/\s/u.test(s[l-1]??"")))return{kind:"entity",provider:a,start:l,end:e,query:o}}}async#s(t,e,i,s){let n=/^\/([^\s]+)/u.exec(t);if(!n||!e)return[];let[r,a]=n;if(i.some(h=>h.start===0&&h.end===r.length))return[];let l=await e.getSuggestions(a,s);if(s.aborted)return[];let o=l.find(h=>h.id===a);return o?[{start:0,end:r.length,part:{kind:"command",id:o.id,label:o.label,agentId:o.agentId,requiresText:o.requiresText||void 0,data:o.data}}]:[]}async#r(t,e,i,s){let n=I(e),r=[];for(let a of t.matchAll(/(?:^|\s)(\S+)/gu)){let l=a[1],o=n.find(g=>l.startsWith(g.trigger));if(!o)continue;let h=a.index+a[0].length-l.length;if(i.some(g=>g.start===h&&g.end===h+l.length))continue;let d=l.slice(o.trigger.length);if(!d)continue;let k=await o.getSuggestions(d,s);if(s.aborted)return[];let p=k.find(g=>g.id===d);p&&r.push({start:h,end:h+l.length,part:{kind:"entity",providerId:o.id,trigger:o.trigger,id:p.id,label:p.label,data:p.data}})}return r}#a(t){this.#e={...this.#e,...t},this._onStateChange(this.#e)}};function V(c,t,e,i){if(c===t&&!i)return[...e];let s=0,n=Math.min(c.length,t.length,i?.start??c.length);for(;s<n&&c[s]===t[s];)s+=1;let r=c.length,a=t.length,l=Math.max(s,i?.end??s);for(;r>l&&a>s&&c[r-1]===t[a-1];)r-=1,a-=1;let o=a-r;return e.flatMap(h=>{let d=h.end<=s?h:h.start>=r?{...h,start:h.start+o,end:h.end+o}:void 0;return d&&(d.part.kind!=="command"||d.start===0)&&(d.start===0||/\s/u.test(t[d.start-1]))&&(d.end===t.length||/\s/u.test(t[d.end]))?[d]:[]})}function D(c,t){for(let e of[...t].reverse())e.part.kind==="command"&&(c=c.slice(0,e.start)+c.slice(e.end).replace(/^[\t ]+/u,""));return c.trim()}function E(c,t){let e=0;return t.flatMap(i=>{let s=i.kind==="command"?`/${i.id}`:`${i.trigger}${i.id}`,n=c.indexOf(s,e);return n===-1?[]:(e=n+s.length,[{start:n,end:e,part:i}])})}var x=class extends w{constructor(){super(...arguments),this.#t=m(),this.#o=m(),this.#i=new y(t=>this._suggestionState=t),this.#s=[],this.#r="",this.#a="",this.#d=()=>{let t=this.#t.value?.shadowRoot?.querySelector("textarea");this.#l=t?{start:t.selectionStart,end:t.selectionEnd}:void 0},this.#c=t=>{t.stopPropagation();let e=t.detail;this._setDraftValue(e.value),e.focusInput&&this.#t.value&&this.#t.value.setFocus()},this.#u=t=>{let e=t.target.value??"",i=this.#l;this.#l=void 0,this.#h(e,i),this.inputValue=e;let s=this.#t.value?.shadowRoot?.querySelector("textarea")?.selectionStart;this.#i.update(e,s,{commandProvider:this.commandProvider,entityProviders:this.entityProviders??[]})},this.#g=async t=>{if(!(t.altKey||t.ctrlKey||t.metaKey||t.shiftKey||this.keyboardShortcutsDisabled)){if(this._suggestionState.suggestions.length>0){if(t.key==="ArrowDown"){t.preventDefault(),this.#i.moveSelection(1);return}if(t.key==="ArrowUp"){t.preventDefault(),this.#i.moveSelection(-1);return}if(t.key==="Enter"){t.preventDefault(),await this.#f(this.#i.selectedSuggestion);return}if(t.key==="Escape"){t.preventDefault(),this.#i.close();return}}switch(t.key){case"Enter":t.preventDefault(),await this.submitMessage();break;case"ArrowUp":await this._navigateHistory("up",t);break;case"ArrowDown":await this._navigateHistory("down",t);break}}},this._messages=$({blocking:!0}),this._inFocus=!1,this._suggestionState=this.#i.state,this._textRequired=!1,this.keyboardShortcutsDisabled=!1,this.awaitingResponse=!1,this.voiceInputEnabled=!1,this.messages=new q([]),this.disabled=!1,this.entityProviders=[],this.arcgisCancel=v(),this.arcgisSubmit=v({cancelable:!0})}static{this.properties={_inFocus:16,_suggestionState:16,_textRequired:16,keyboardShortcutsDisabled:5,entryPlaceholder:1,awaitingResponse:5,inputValue:1,status:1,voiceInputEnabled:5,messages:0,disabled:5,commandProvider:0,entityProviders:0}}static{this.styles=R}#t;#o;#e;#i;#s;#r;#a;#n;#l;#d;#c;#u;#g;get inputValue(){return this.#a}set inputValue(t){t!==this.#a&&(this.#a=t,this.#n?.abort(),this.#n=void 0)}async submitMessage(){if(this.awaitingResponse){this.#n?.abort(),this.#n=void 0,this.arcgisCancel.emit();return}let t=this.inputValue;this.#h(t),this.#n?.abort();let e=new AbortController;this.#n=e;let i;try{if(i=await this.#i.resolveTypedInputs(t,{commandProvider:this.commandProvider,entityProviders:this.entityProviders??[]},this.#s,e.signal),e.signal.aborted||this.#n!==e)return}catch(a){if(e.signal.aborted)return;throw a}finally{this.#n===e&&(this.#n=void 0)}this.#s.push(...i.filter(a=>!this.#s.some(l=>l.start===a.start&&l.end===a.end)));let s=D(t,this.#s);if(this._textRequired=!s&&this.#s.some(a=>a.part.kind==="command"&&(a.part.requiresText??!1)),this._textRequired){await this.#t.value?.setFocus();return}let n=this.#p();if(!s&&n.length===0)return;let r={prompt:s,displayText:t.trim(),parts:n};this.arcgisSubmit.emit(r.parts.length?r:s).defaultPrevented||(this.inputValue="",this.#s=[],this.#r="",this.#e=void 0,this.#i.close(),this.#o.value?.clearDraftSession(),this.#t.value&&await this.#t.value.setFocus())}loaded(){this.manager.onLifecycle(()=>(this.el.addEventListener("arcgisVoiceInputDraftChange",this.#c),{remove:()=>{this.el.removeEventListener("arcgisVoiceInputDraftChange",this.#c)}}))}async _navigateHistory(t,e){let i=this.#t.value;if(!i)return;let s=this.messages.toArray().filter(h=>h.role==="user");if(s.length===0)return;let n=i.value??"",r=i.shadowRoot?.querySelector("textarea"),a=r?.selectionStart,l=r?.selectionEnd;if(a==null||l==null||a!==l||t==="up"&&a!==0||t==="down"&&a!==n.length)return;if(t==="up"){this.#e?this.#e.index=Math.max(0,this.#e.index-1):this.#e={index:s.length-1,draft:this.#y()},this.#v(s[this.#e.index]),e.preventDefault();return}let o=this.#e;o&&(o.index<s.length-1?(o.index+=1,this.#v(s[o.index])):(this.#e=void 0,this.#m(o.draft)),e.preventDefault())}#y(){return this.#h(this.inputValue),{value:this.inputValue,parts:this.#p()}}#p(){return this.#s.map(t=>t.part)}#v(t){let e=t.parts??[];this.#m({value:t.content,parts:e})}#m(t){this.inputValue=t.value,this.#r=t.value,this.#s=E(t.value,t.parts),this.#l=void 0,this._textRequired=!1,this.#i.close()}_setDraftValue(t){this.#i.close(),this.#s=[],this.#r=t,this.#l=void 0,this._textRequired=!1,this.inputValue=t,this.#e=void 0}#h(t,e){this._textRequired=!1,this.#s=V(this.#r,t,this.#s,e),this.#r=t}async#f(t){let e=this.#i.activeSuggestion;if(!t||!e)return;let i=`${e.kind==="command"?"/":e.provider.trigger}${t.id}`,s=`${this.inputValue.slice(0,e.start)}${i} ${this.inputValue.slice(e.end)}`;this.#h(s),this.#s.push({start:e.start,end:e.start+i.length,part:e.kind==="command"?{kind:"command",id:t.id,label:t.label,agentId:"agentId"in t?t.agentId:void 0,requiresText:"requiresText"in t&&t.requiresText||void 0,data:t.data}:{kind:"entity",providerId:e.provider.id,trigger:e.provider.trigger,id:t.id,label:t.label,data:t.data}}),this.#s.sort((a,l)=>a.start-l.start),this.inputValue=s,this.#e=void 0;let n=e.start+i.length+1;this.#i.close(),await this.updateComplete,await this.#t.value?.setFocus();let r=this.#t.value?.shadowRoot?.querySelector("textarea");r&&(r.selectionStart=n,r.selectionEnd=n)}_onFocusIn(){this._inFocus=!0}_onFocusOut(){this._inFocus=!1}#x(t){return t?u`<calcite-popover .open=${this._suggestionState.suggestions.length>0||this._suggestionState.loading} placement=top-start .label=${this._messages.suggestions} .referenceElement=${t} trigger-disabled pointer-disabled focus-trap-disabled><calcite-list .label=${this._messages.suggestions} selection-appearance=highlight selection-mode=single-persist .loading=${this._suggestionState.loading}>${this._suggestionState.loading?null:this._suggestionState.suggestions.map((e,i)=>u`<calcite-list-item .label=${e.label} .description=${e.description} .selected=${i===this._suggestionState.selectedIndex} @click=${()=>{this.#f(e)}}></calcite-list-item>`)}</calcite-list>${this._suggestionState.loading?u`<div class="suggestions-loading" role=status>${this._messages.loadingSuggestions}</div>`:null}</calcite-popover>`:null}render(){let t=this.#t.value;return u`<div class="input-container">${this._textRequired?u`<div role=alert>${this._messages.textRequired}</div>`:null}<calcite-text-area class=${_({focused:this._inFocus})} .value=${this.inputValue} .placeholder=${this.entryPlaceholder??this._messages.entryPlaceholder} resize=vertical @calciteTextAreaInput=${this.#u} @beforeinput=${this.#d} .status=${this._textRequired?"invalid":"idle"} .disabled=${this.disabled} @keydown=${this.#g} @focusin=${this._onFocusIn} @focusout=${this._onFocusOut} ${f(this.#t)}><div slot=footer-start class="footer-start"><slot name=entry-actions-start></slot></div><div slot=footer-end class="footer-end">${this.voiceInputEnabled?u`<arcgis-assistant-speech-input .awaitingResponse=${this.awaitingResponse} .inputValue=${this.inputValue} ${f(this.#o)}></arcgis-assistant-speech-input>`:null}<slot name=entry-actions-end></slot></div></calcite-text-area>${this.#x(t)}</div>`}};S("arcgis-assistant-chat-entry",x);return x},"core/Collection")
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
+ import{b as $}from"./ZUKM4DGB.js";import"./FIZMK7GS.js";import"./SUMXIUIS.js";import"./PR4VMSKD.js";import{C as S,g as b,h as u,o as v,v as m,w as f,x as w,y as _}from"./NAVK5JJ2.js";import"./OUMTV5H5.js";import"./5PV2GUZW.js";export default $arcgis.t(([q])=>{var R=b`:host{--calcite-text-area-border-color: var(--calcite-color-border-1);--calcite-text-area-divider-color: var(--calcite-color-border-1);--calcite-text-area-corner-radius: var(--calcite-border-radius)}.input-container{display:flex;flex-direction:column}.footer-start{display:flex;gap:var(--calcite-spacing-md);flex-wrap:wrap;align-items:center}.footer-end{display:flex;gap:var(--calcite-spacing-md);align-items:center}.focused{--calcite-text-area-shadow: var(--calcite-shadow-sm)}.suggestions-loading{padding:var(--calcite-spacing-sm)}`,P={suggestions:[],loading:!1,selectedIndex:0};function I(c){return c.filter(({trigger:t})=>t!==""&&t!=="/").sort((t,e)=>e.trigger.length-t.trigger.length)}var y=class{constructor(t){this._onStateChange=t}#t=null;#o;#e=P;get state(){return this.#e}get activeSuggestion(){return this.#o}get selectedSuggestion(){return this.#e.suggestions[this.#e.selectedIndex]}moveSelection(t){this.#a({selectedIndex:Math.max(0,Math.min(this.#e.selectedIndex+t,this.#e.suggestions.length-1))})}async update(t,e,i){this.#t?.abort();let s=this.#i(t,e,i);if(!s){this.close();return}let n=new AbortController;this.#t=n,this.#o=s,this.#a({suggestions:[],loading:!0,selectedIndex:0});try{let r=await s.provider.getSuggestions(s.query,n.signal);if(n.signal.aborted||this.#t!==n)return;this.#a({suggestions:r,loading:!1,selectedIndex:0})}catch{n.signal.aborted||this.close()}}async resolveTypedInputs(t,e,i,s){let n=await this.#s(t,e.commandProvider,i,s);return s.aborted?[]:(n.push(...await this.#r(t,e.entityProviders,i,s)),n)}close(){this.#t?.abort(),this.#t=null,this.#o=void 0,this.#a({suggestions:[],loading:!1,selectedIndex:0})}#i(t,e,i){if(e==null)return;let s=t.slice(0,e),n=s.slice(1);if(i.commandProvider&&s.startsWith("/")&&!/\s/u.test(n))return{kind:"command",provider:i.commandProvider,start:0,end:e,query:n};let r=I(i.entityProviders);for(let a of r){let l=s.lastIndexOf(a.trigger),o=s.slice(l+a.trigger.length);if(l!==-1&&a.trigger&&!/\s/u.test(o)&&(l===0||/\s/u.test(s[l-1]??"")))return{kind:"entity",provider:a,start:l,end:e,query:o}}}async#s(t,e,i,s){let n=/^\/([^\s]+)/u.exec(t);if(!n||!e)return[];let[r,a]=n;if(i.some(h=>h.start===0&&h.end===r.length))return[];let l=await e.getSuggestions(a,s);if(s.aborted)return[];let o=l.find(h=>h.id===a);return o?[{start:0,end:r.length,part:{kind:"command",id:o.id,label:o.label,agentId:o.agentId,requiresText:o.requiresText||void 0,data:o.data}}]:[]}async#r(t,e,i,s){let n=I(e),r=[];for(let a of t.matchAll(/(?:^|\s)(\S+)/gu)){let l=a[1],o=n.find(g=>l.startsWith(g.trigger));if(!o)continue;let h=a.index+a[0].length-l.length;if(i.some(g=>g.start===h&&g.end===h+l.length))continue;let d=l.slice(o.trigger.length);if(!d)continue;let k=await o.getSuggestions(d,s);if(s.aborted)return[];let p=k.find(g=>g.id===d);p&&r.push({start:h,end:h+l.length,part:{kind:"entity",providerId:o.id,trigger:o.trigger,id:p.id,label:p.label,data:p.data}})}return r}#a(t){this.#e={...this.#e,...t},this._onStateChange(this.#e)}};function V(c,t,e,i){if(c===t&&!i)return[...e];let s=0,n=Math.min(c.length,t.length,i?.start??c.length);for(;s<n&&c[s]===t[s];)s+=1;let r=c.length,a=t.length,l=Math.max(s,i?.end??s);for(;r>l&&a>s&&c[r-1]===t[a-1];)r-=1,a-=1;let o=a-r;return e.flatMap(h=>{let d=h.end<=s?h:h.start>=r?{...h,start:h.start+o,end:h.end+o}:void 0;return d&&(d.part.kind!=="command"||d.start===0)&&(d.start===0||/\s/u.test(t[d.start-1]))&&(d.end===t.length||/\s/u.test(t[d.end]))?[d]:[]})}function D(c,t){for(let e of[...t].reverse())e.part.kind==="command"&&(c=c.slice(0,e.start)+c.slice(e.end).replace(/^[\t ]+/u,""));return c.trim()}function E(c,t){let e=0;return t.flatMap(i=>{let s=i.kind==="command"?`/${i.id}`:`${i.trigger}${i.id}`,n=c.indexOf(s,e);return n===-1?[]:(e=n+s.length,[{start:n,end:e,part:i}])})}var x=class extends w{constructor(){super(...arguments),this.#t=m(),this.#o=m(),this.#i=new y(t=>this._suggestionState=t),this.#s=[],this.#r="",this.#a="",this.#d=()=>{let t=this.#t.value?.shadowRoot?.querySelector("textarea");this.#l=t?{start:t.selectionStart,end:t.selectionEnd}:void 0},this.#c=t=>{t.stopPropagation();let e=t.detail;this._setDraftValue(e.value),e.focusInput&&this.#t.value&&this.#t.value.setFocus()},this.#u=t=>{let e=t.target.value??"",i=this.#l;this.#l=void 0,this.#h(e,i),this.inputValue=e;let s=this.#t.value?.shadowRoot?.querySelector("textarea")?.selectionStart;this.#i.update(e,s,{commandProvider:this.commandProvider,entityProviders:this.entityProviders??[]})},this.#g=async t=>{if(!(t.altKey||t.ctrlKey||t.metaKey||t.shiftKey||this.keyboardShortcutsDisabled)){if(this._suggestionState.suggestions.length>0){if(t.key==="ArrowDown"){t.preventDefault(),this.#i.moveSelection(1);return}if(t.key==="ArrowUp"){t.preventDefault(),this.#i.moveSelection(-1);return}if(t.key==="Enter"){t.preventDefault(),await this.#f(this.#i.selectedSuggestion);return}if(t.key==="Escape"){t.preventDefault(),this.#i.close();return}}switch(t.key){case"Enter":t.preventDefault(),await this.submitMessage();break;case"ArrowUp":await this._navigateHistory("up",t);break;case"ArrowDown":await this._navigateHistory("down",t);break}}},this._messages=$({blocking:!0}),this._inFocus=!1,this._suggestionState=this.#i.state,this._textRequired=!1,this.keyboardShortcutsDisabled=!1,this.awaitingResponse=!1,this.voiceInputEnabled=!1,this.messages=new q([]),this.disabled=!1,this.entityProviders=[],this.arcgisCancel=v(),this.arcgisSubmit=v({cancelable:!0})}static{this.properties={_inFocus:16,_suggestionState:16,_textRequired:16,keyboardShortcutsDisabled:5,entryPlaceholder:1,awaitingResponse:5,inputValue:1,status:1,voiceInputEnabled:5,messages:0,disabled:5,commandProvider:0,entityProviders:0}}static{this.styles=R}#t;#o;#e;#i;#s;#r;#a;#n;#l;#d;#c;#u;#g;get inputValue(){return this.#a}set inputValue(t){t!==this.#a&&(this.#a=t,this.#n?.abort(),this.#n=void 0)}async submitMessage(){if(this.awaitingResponse){this.#n?.abort(),this.#n=void 0,this.arcgisCancel.emit();return}let t=this.inputValue;this.#h(t),this.#n?.abort();let e=new AbortController;this.#n=e;let i;try{if(i=await this.#i.resolveTypedInputs(t,{commandProvider:this.commandProvider,entityProviders:this.entityProviders??[]},this.#s,e.signal),e.signal.aborted||this.#n!==e)return}catch(a){if(e.signal.aborted)return;throw a}finally{this.#n===e&&(this.#n=void 0)}this.#s.push(...i.filter(a=>!this.#s.some(l=>l.start===a.start&&l.end===a.end)));let s=D(t,this.#s);if(this._textRequired=!s&&this.#s.some(a=>a.part.kind==="command"&&(a.part.requiresText??!1)),this._textRequired){await this.#t.value?.setFocus();return}let n=this.#p();if(!s&&n.length===0)return;let r={prompt:s,displayText:t.trim(),parts:n};this.arcgisSubmit.emit(r.parts.length?r:s).defaultPrevented||(this.inputValue="",this.#s=[],this.#r="",this.#e=void 0,this.#i.close(),this.#o.value?.clearDraftSession(),this.#t.value&&await this.#t.value.setFocus())}loaded(){this.manager.onLifecycle(()=>(this.el.addEventListener("arcgisVoiceInputDraftChange",this.#c),{remove:()=>{this.el.removeEventListener("arcgisVoiceInputDraftChange",this.#c)}}))}async _navigateHistory(t,e){let i=this.#t.value;if(!i)return;let s=this.messages.toArray().filter(h=>h.role==="user");if(s.length===0)return;let n=i.value??"",r=i.shadowRoot?.querySelector("textarea"),a=r?.selectionStart,l=r?.selectionEnd;if(a==null||l==null||a!==l||t==="up"&&a!==0||t==="down"&&a!==n.length)return;if(t==="up"){this.#e?this.#e.index=Math.max(0,this.#e.index-1):this.#e={index:s.length-1,draft:this.#y()},this.#v(s[this.#e.index]),e.preventDefault();return}let o=this.#e;o&&(o.index<s.length-1?(o.index+=1,this.#v(s[o.index])):(this.#e=void 0,this.#m(o.draft)),e.preventDefault())}#y(){return this.#h(this.inputValue),{value:this.inputValue,parts:this.#p()}}#p(){return this.#s.map(t=>t.part)}#v(t){let e=t.parts??[];this.#m({value:t.content,parts:e})}#m(t){this.inputValue=t.value,this.#r=t.value,this.#s=E(t.value,t.parts),this.#l=void 0,this._textRequired=!1,this.#i.close()}_setDraftValue(t){this.#i.close(),this.#s=[],this.#r=t,this.#l=void 0,this._textRequired=!1,this.inputValue=t,this.#e=void 0}#h(t,e){this._textRequired=!1,this.#s=V(this.#r,t,this.#s,e),this.#r=t}async#f(t){let e=this.#i.activeSuggestion;if(!t||!e)return;let i=`${e.kind==="command"?"/":e.provider.trigger}${t.id}`,s=`${this.inputValue.slice(0,e.start)}${i} ${this.inputValue.slice(e.end)}`;this.#h(s),this.#s.push({start:e.start,end:e.start+i.length,part:e.kind==="command"?{kind:"command",id:t.id,label:t.label,agentId:"agentId"in t?t.agentId:void 0,requiresText:"requiresText"in t&&t.requiresText||void 0,data:t.data}:{kind:"entity",providerId:e.provider.id,trigger:e.provider.trigger,id:t.id,label:t.label,data:t.data}}),this.#s.sort((a,l)=>a.start-l.start),this.inputValue=s,this.#e=void 0;let n=e.start+i.length+1;this.#i.close(),await this.updateComplete,await this.#t.value?.setFocus();let r=this.#t.value?.shadowRoot?.querySelector("textarea");r&&(r.selectionStart=n,r.selectionEnd=n)}_onFocusIn(){this._inFocus=!0}_onFocusOut(){this._inFocus=!1}#x(t){return t?u`<calcite-popover .open=${this._suggestionState.suggestions.length>0||this._suggestionState.loading} placement=top-start .label=${this._messages.suggestions} .referenceElement=${t} trigger-disabled pointer-disabled focus-trap-disabled><calcite-list .label=${this._messages.suggestions} selection-appearance=highlight selection-mode=single-persist .loading=${this._suggestionState.loading}>${this._suggestionState.loading?null:this._suggestionState.suggestions.map((e,i)=>u`<calcite-list-item .label=${e.label} .description=${e.description} .selected=${i===this._suggestionState.selectedIndex} @click=${()=>{this.#f(e)}}></calcite-list-item>`)}</calcite-list>${this._suggestionState.loading?u`<div class="suggestions-loading" role=status>${this._messages.loadingSuggestions}</div>`:null}</calcite-popover>`:null}render(){let t=this.#t.value;return u`<div class="input-container">${this._textRequired?u`<div role=alert>${this._messages.textRequired}</div>`:null}<calcite-text-area class=${_({focused:this._inFocus})} .value=${this.inputValue} .placeholder=${this.entryPlaceholder??this._messages.entryPlaceholder} resize=vertical @calciteTextAreaInput=${this.#u} @beforeinput=${this.#d} .status=${this._textRequired?"invalid":"idle"} .disabled=${this.disabled} @keydown=${this.#g} @focusin=${this._onFocusIn} @focusout=${this._onFocusOut} ${f(this.#t)}><div slot=footer-start class="footer-start"><slot name=entry-actions-start></slot></div><div slot=footer-end class="footer-end">${this.voiceInputEnabled?u`<arcgis-assistant-speech-input .awaitingResponse=${this.awaitingResponse} .inputValue=${this.inputValue} ${f(this.#o)}></arcgis-assistant-speech-input>`:null}<slot name=entry-actions-end></slot></div></calcite-text-area>${this.#x(t)}</div>`}};S("arcgis-assistant-chat-entry",x);return x},"core/Collection")
@@ -1,5 +1,5 @@
1
- /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{S as r}from"./QEGO4B2W.js";var a=(e,t)=>t,d=(e,t)=>({...e,...t}),o=(e="",t)=>{let s=typeof t=="string"?t.trim():"";if(!s)return e;let u=e.trim();if(!u)return s;if(u===s)return e;let n=u.split(`
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
+ import{S as r}from"./7GDMXAF5.js";var a=(e,t)=>t,d=(e,t)=>({...e,...t}),o=(e="",t)=>{let s=typeof t=="string"?t.trim():"";if(!s)return e;let u=e.trim();if(!u)return s;if(u===s)return e;let n=u.split(`
3
3
 
4
4
  `);return n[n.length-1]?.trim()===s?e:`${e}
5
5
 
@@ -1,5 +1,5 @@
1
- /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import"./UZLQALHY.js";var e=`## Who you are
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
+ import"./5PV2GUZW.js";var e=`## Who you are
3
3
 
4
4
  You are a map assistant embedded inside a GIS application. You have no knowledge of history, science, people, events, cooking, or anything outside of this map and its data. You only know what is described in the Map Context below.
5
5
 
@@ -1,2 +1,2 @@
1
- /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{C as o,g as i,h as s,x as n}from"./RE7MJTEF.js";import"./R74ZHFA6.js";import"./UZLQALHY.js";var c=i`:host{display:block}`,e=class extends n{static{this.properties={block:0}}static{this.styles=c}_renderSuggestedPrompts(t){if(t.type!=="suggested-prompts")return null;let r=t.data?.prompts,a=Array.isArray(r)?r.filter(p=>typeof p=="string"):[];return a.length?s`<arcgis-assistant-suggested-prompts .prompts=${a}></arcgis-assistant-suggested-prompts>`:null}_renderBlock(t){switch(t.type){case"suggested-prompts":return this._renderSuggestedPrompts(t);case"text":return s`<arcgis-assistant-message-text .content=${t.data?.content} .parts=${t.data?.parts}></arcgis-assistant-message-text>`;default:return null}}render(){return this.block?this._renderBlock(this.block):null}};o("arcgis-assistant-message-block",e);export{e as ArcgisAssistantMessageBlock};
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
+ import{C as o,g as i,h as s,x as n}from"./NAVK5JJ2.js";import"./OUMTV5H5.js";import"./5PV2GUZW.js";var c=i`:host{display:block}`,e=class extends n{static{this.properties={block:0}}static{this.styles=c}_renderSuggestedPrompts(t){if(t.type!=="suggested-prompts")return null;let r=t.data?.prompts,a=Array.isArray(r)?r.filter(p=>typeof p=="string"):[];return a.length?s`<arcgis-assistant-suggested-prompts .prompts=${a}></arcgis-assistant-suggested-prompts>`:null}_renderBlock(t){switch(t.type){case"suggested-prompts":return this._renderSuggestedPrompts(t);case"text":return s`<arcgis-assistant-message-text .content=${t.data?.content} .parts=${t.data?.parts}></arcgis-assistant-message-text>`;default:return null}}render(){return this.block?this._renderBlock(this.block):null}};o("arcgis-assistant-message-block",e);export{e as ArcgisAssistantMessageBlock};
@@ -1,5 +1,5 @@
1
- /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import"./UZLQALHY.js";var e=`## Navigation Agent - Tool Intent Classifier
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
+ import"./5PV2GUZW.js";var e=`## Navigation Agent - Tool Intent Classifier
3
3
 
4
4
  You are an assistant that classifies the assigned task intent for navigation agent.
5
5
 
@@ -1,5 +1,5 @@
1
- /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import"./UZLQALHY.js";var e=`This Feature Layer is part of a Feature Service. The Feature Layer contains various fields, each with its own name, type, and description.
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
+ import"./5PV2GUZW.js";var e=`This Feature Layer is part of a Feature Service. The Feature Layer contains various fields, each with its own name, type, and description.
3
3
  The Feature Layer is a collection of geographic features that represent real-world entities. Each feature in the layer has attributes that provide additional information about the feature. The layer may include point, line, or polygon geometries, depending on the type of data it represents.
4
4
  The geometry type for this layer is {layerGeometryType}.
5
5
 
@@ -1,5 +1,5 @@
1
- /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import"./UZLQALHY.js";var e=`## Membership Bind Parameters
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
+ import"./5PV2GUZW.js";var e=`## Membership Bind Parameters
3
3
 
4
4
  The current link chart contains a subset of entities and relationships from the database. Their membership is available to Cypher queries as lists of string identifiers through these bind parameters:
5
5
 
@@ -1,2 +1,2 @@
1
- /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import a from"./JZPPP4QY.js";import{a as h}from"./ONQ6JSBJ.js";import{a as e}from"./RFPTOFM4.js";import{Ga as p}from"./FSLPYC4Y.js";export default $arcgis.t(([w,I,{a:u,d:m,e:b,f:y}])=>{var x=async(t,o,f,n,r,c)=>{let a=t.map?.allLayers.find(s=>s.id===o);if(!a)return{success:!1,error:`Layer '${o}' not found.`};let i=a.createQuery();i.where=f??"1=1",n&&(i.geometry=n,i.spatialRelationship="intersects",r&&(i.distance=r),c&&(i.units=c));try{let{extent:s,count:l}=await a.queryExtent(i);return!s||l===0?{success:!1,error:`No features found for filter (where: ${i.where}${n?", spatial filter used":""})`}:(await t.goTo(s),{success:!0})}catch(s){return{success:!1,error:s instanceof Error?s.message:String(s)}}},v=async(t,o,f,n,r,c)=>{let a=o.map?.allLayers.find(d=>d.id===t.layerId);if(!a)return`Could not find target layer with ID: ${t.layerId}`;let i;if(r){let d=await m(r,o);if("error"in d)return d.error;i=d.geometry}if(a.featureEffect=null,a.featureEffect=new w({filter:new I({...t.objectIds?.length?{objectIds:t.objectIds}:{where:t.where},geometry:i,spatialRelationship:"intersects",distance:r?.distance,units:r?.units}),includedEffect:f,excludedEffect:n}),a.visible=!0,c)return`Applied feature effects to "${a.title??t.layerId}" within current map extent.`;let s=t.objectIds?.length?`${a.objectIdField} IN (${t.objectIds.join(",")})`:t.where,l=await x(o,t.layerId,s,i,r?.distance,r?.units),g=a.title??t.layerId;return l.success?`Applied feature effects to target layer "${a.title??t.layerId}"${r&&"layerId"in r?` using geometry from layer "${r.layerId}"`:""}.`:`Applied filter to "${g}" but no features matched. ${l.error}`},j=async({targetLayer:t,geometryFilter:o,useCurrentExtent:f,includedEffect:n="drop-shadow(2px, 2px, 2px, gray)",excludedEffect:r="grayscale(100%) opacity(60%) blur(2px)"},c)=>{let{mapView:a}=h(c,["mapView"]),i=y(o,c.state?.agentExecutionContext?.sharedResources);return await v(t,a,n,r,i,f)},E=e.object({layerId:e.string().describe("The layerId of the layer containing the geometry by which to filter."),where:e.string().describe("The SQL-92 where clause representing the features from which to filter."),distance:e.number().optional().describe("The buffer distance around the geometry."),units:u.optional().describe("The units for the distance buffer.")}),T=e.object({point:e.object({x:e.number().describe("X coordinate (longitude) from navigation result"),y:e.number().describe("Y coordinate (latitude) from navigation result"),spatialReference:e.object({wkid:e.number().describe("Spatial reference WKID (e.g., 4326 for WGS84)")}).optional().describe("Spatial reference. Defaults to map's spatial reference if not provided.")}).describe("Point coordinates from a previous navigation/geocoding result"),distance:e.number().optional().describe("Optional buffer distance around the point."),units:u.optional().describe("The units for the distance buffer.")}),$=e.object({targetLayer:e.object({layerId:e.string().describe("The layerId of the layer on which to set a feature effect."),where:e.string().describe("The SQL-92 where clause representing the features to emphasize."),objectIds:e.array(e.number()).optional().describe("Array of objectIds from a previous query result. Use this instead of a where clause when the query returned objectIds (e.g. top N results). If provided, takes precedence over where clause.")}),geometryFilter:e.union([E,T,b]).optional().describe("Optional spatial filter. Use 'sharedResourceId' with an ID from listSharedResources for a previously geocoded location."),useCurrentExtent:e.boolean().optional().describe("Set to true when the previous query used the current map extent as a spatial filter. This ensures the feature effect applies only to features visible in the current view. Default is false."),includedEffect:e.string().default("drop-shadow(2px, 2px, 2px, gray)").describe("The effect applied to features that meet the filter requirements. Valid effects include: bloom, blur, brightness, contrast, drop-shadow, grayscale, hue-rotate, invert, opacity, saturate, and sepia. Prefer default unless specified."),excludedEffect:e.string().default("grayscale(100%) opacity(60%) blur(2px)").describe("The effect applied to features that do not meet the filter requirements. Valid effects include: bloom, blur, brightness, contrast, drop-shadow, grayscale, hue-rotate, invert, opacity, saturate, and sepia. Prefer default unless specified.")}),A=p(j,{name:"setFeatureEffect",description:"Sets a feature effect on a given layer with given filter parameters and feature effects to emphasize certain features that meet a filter requirement. If no feature effect information is provided, then use the default effect provided.",schema:$});return A},"layers/support/FeatureEffect","layers/support/FeatureFilter",a)
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
+ import a from"./BMVPOFHU.js";import{a as h}from"./QBZP6XOE.js";import{a as e}from"./GS5JDPZH.js";import{Ga as p}from"./A4ZVCRVF.js";export default $arcgis.t(([w,I,{a:u,d:m,e:b,f:y}])=>{var x=async(t,o,f,n,r,c)=>{let a=t.map?.allLayers.find(s=>s.id===o);if(!a)return{success:!1,error:`Layer '${o}' not found.`};let i=a.createQuery();i.where=f??"1=1",n&&(i.geometry=n,i.spatialRelationship="intersects",r&&(i.distance=r),c&&(i.units=c));try{let{extent:s,count:l}=await a.queryExtent(i);return!s||l===0?{success:!1,error:`No features found for filter (where: ${i.where}${n?", spatial filter used":""})`}:(await t.goTo(s),{success:!0})}catch(s){return{success:!1,error:s instanceof Error?s.message:String(s)}}},v=async(t,o,f,n,r,c)=>{let a=o.map?.allLayers.find(d=>d.id===t.layerId);if(!a)return`Could not find target layer with ID: ${t.layerId}`;let i;if(r){let d=await m(r,o);if("error"in d)return d.error;i=d.geometry}if(a.featureEffect=null,a.featureEffect=new w({filter:new I({...t.objectIds?.length?{objectIds:t.objectIds}:{where:t.where},geometry:i,spatialRelationship:"intersects",distance:r?.distance,units:r?.units}),includedEffect:f,excludedEffect:n}),a.visible=!0,c)return`Applied feature effects to "${a.title??t.layerId}" within current map extent.`;let s=t.objectIds?.length?`${a.objectIdField} IN (${t.objectIds.join(",")})`:t.where,l=await x(o,t.layerId,s,i,r?.distance,r?.units),g=a.title??t.layerId;return l.success?`Applied feature effects to target layer "${a.title??t.layerId}"${r&&"layerId"in r?` using geometry from layer "${r.layerId}"`:""}.`:`Applied filter to "${g}" but no features matched. ${l.error}`},j=async({targetLayer:t,geometryFilter:o,useCurrentExtent:f,includedEffect:n="drop-shadow(2px, 2px, 2px, gray)",excludedEffect:r="grayscale(100%) opacity(60%) blur(2px)"},c)=>{let{mapView:a}=h(c,["mapView"]),i=y(o,c.state?.agentExecutionContext?.sharedResources);return await v(t,a,n,r,i,f)},E=e.object({layerId:e.string().describe("The layerId of the layer containing the geometry by which to filter."),where:e.string().describe("The SQL-92 where clause representing the features from which to filter."),distance:e.number().optional().describe("The buffer distance around the geometry."),units:u.optional().describe("The units for the distance buffer.")}),T=e.object({point:e.object({x:e.number().describe("X coordinate (longitude) from navigation result"),y:e.number().describe("Y coordinate (latitude) from navigation result"),spatialReference:e.object({wkid:e.number().describe("Spatial reference WKID (e.g., 4326 for WGS84)")}).optional().describe("Spatial reference. Defaults to map's spatial reference if not provided.")}).describe("Point coordinates from a previous navigation/geocoding result"),distance:e.number().optional().describe("Optional buffer distance around the point."),units:u.optional().describe("The units for the distance buffer.")}),$=e.object({targetLayer:e.object({layerId:e.string().describe("The layerId of the layer on which to set a feature effect."),where:e.string().describe("The SQL-92 where clause representing the features to emphasize."),objectIds:e.array(e.number()).optional().describe("Array of objectIds from a previous query result. Use this instead of a where clause when the query returned objectIds (e.g. top N results). If provided, takes precedence over where clause.")}),geometryFilter:e.union([E,T,b]).optional().describe("Optional spatial filter. Use 'sharedResourceId' with an ID from listSharedResources for a previously geocoded location."),useCurrentExtent:e.boolean().optional().describe("Set to true when the previous query used the current map extent as a spatial filter. This ensures the feature effect applies only to features visible in the current view. Default is false."),includedEffect:e.string().default("drop-shadow(2px, 2px, 2px, gray)").describe("The effect applied to features that meet the filter requirements. Valid effects include: bloom, blur, brightness, contrast, drop-shadow, grayscale, hue-rotate, invert, opacity, saturate, and sepia. Prefer default unless specified."),excludedEffect:e.string().default("grayscale(100%) opacity(60%) blur(2px)").describe("The effect applied to features that do not meet the filter requirements. Valid effects include: bloom, blur, brightness, contrast, drop-shadow, grayscale, hue-rotate, invert, opacity, saturate, and sepia. Prefer default unless specified.")}),A=p(j,{name:"setFeatureEffect",description:"Sets a feature effect on a given layer with given filter parameters and feature effects to emphasize certain features that meet a filter requirement. If no feature effect information is provided, then use the default effect provided.",schema:$});return A},"layers/support/FeatureEffect","layers/support/FeatureFilter",a)
@@ -1,2 +1,2 @@
1
- /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{A as m,C as y,g as C,h as S,o as c,x as R}from"./RE7MJTEF.js";import"./R74ZHFA6.js";import"./UZLQALHY.js";export default $arcgis.t(([{watch:u},{property:d,subclass:f},w])=>{var I=C`.button{--calcite-button-background-color: var(--calcite-color-transparent);--calcite-button-border-color: transparent;--calcite-button-icon-color: var(--calcite-color-text-3);--calcite-button-text-color: var(--calcite-color-text-3);flex:0 0 auto;position:relative}.button[data-state=disabled]{--calcite-button-icon-color: var(--calcite-color-text-3);opacity:var(--calcite-opacity-disabled)}.button[data-state=listening]{--calcite-button-background-color: color-mix( in srgb, var(--calcite-color-brand) 14%, var(--calcite-color-foreground-1) );--calcite-button-border-color: color-mix(in srgb, var(--calcite-color-brand) 24%, transparent);--calcite-button-icon-color: var(--calcite-color-brand);--calcite-button-text-color: var(--calcite-color-brand);box-shadow:var(--calcite-shadow-sm)}.button[data-state=listening]:hover{--calcite-button-background-color: color-mix( in srgb, var(--calcite-color-brand-hover, var(--calcite-color-brand)) 18%, var(--calcite-color-foreground-1) )}.button[data-state=listening]:active{--calcite-button-background-color: color-mix( in srgb, var(--calcite-color-brand) 24%, var(--calcite-color-foreground-1) )}.button[data-state=processing]{--calcite-button-background-color: color-mix( in srgb, var(--calcite-color-brand) 10%, var(--calcite-color-foreground-1) );--calcite-button-border-color: color-mix(in srgb, var(--calcite-color-brand) 20%, transparent);--calcite-button-icon-color: var(--calcite-color-brand);--calcite-button-text-color: var(--calcite-color-brand)}.button[data-state=error]{--calcite-button-background-color: color-mix( in srgb, var(--calcite-color-status-danger) 12%, var(--calcite-color-foreground-1) );--calcite-button-border-color: color-mix(in srgb, var(--calcite-color-status-danger) 24%, transparent);--calcite-button-icon-color: var(--calcite-color-status-danger);--calcite-button-text-color: var(--calcite-color-status-danger)}.button[data-state=listening]:after{content:"";position:absolute;inset:-4px;border:1px solid color-mix(in srgb,var(--calcite-color-brand) 40%,transparent);border-radius:inherit;opacity:0;pointer-events:none;transform:scale(.92);animation:assistant-speech-input-recording-pulse 1.8s ease-out infinite}@keyframes assistant-speech-input-recording-pulse{0%{opacity:.65;transform:scale(.92)}70%{opacity:0;transform:scale(1.16)}to{opacity:0;transform:scale(1.16)}}@media(prefers-reduced-motion){.button[data-state=listening]:after{animation:none}}`,T=["audio/webm;codecs=opus","audio/webm","audio/mp4","audio/ogg;codecs=opus","audio/ogg"];function h(e){return e.replace(/\s+/gu," ").trim()}var x=Object.defineProperty,V=Object.getOwnPropertyDescriptor,p=(e,t,s,i)=>{for(var r=i>1?void 0:i?V(t,s):t,n=e.length-1,o;n>=0;n--)(o=e[n])&&(r=(i?o(t,s,r):o(r))||r);return i&&r&&x(t,s,r),r},a=class extends w{constructor(e){super(e),this.state="idle",this.liveTranscript="",this.transcript="",this.errorCode=void 0}static isSupported(){return!1}};p([d()],a.prototype,"language",2);p([d({readOnly:!0})],a.prototype,"state",2);p([d({readOnly:!0})],a.prototype,"liveTranscript",2);p([d({readOnly:!0})],a.prototype,"transcript",2);p([d({readOnly:!0})],a.prototype,"errorCode",2);a=p([f("SpeechController")],a);var O=Object.defineProperty,M=Object.getOwnPropertyDescriptor,g=(e,t,s,i)=>{for(var r=i>1?void 0:i?M(t,s):t,n=e.length-1,o;n>=0;n--)(o=e[n])&&(r=(i?o(t,s,r):o(r))||r);return i&&r&&O(t,s,r),r},l=class extends a{constructor(e){super(e),this._activeSessionId=null,this._mediaRecorder=null,this._mediaRecorderChunkIndex=0,this._mediaRecorderStopReason=null,this._mediaStream=null,this._pendingChunkOperations=new Set,this._recordedChunks=[],this.handleRecording=null,this.chunkTimeSlice=3e3}get _mimeType(){return typeof window>"u"||typeof window.MediaRecorder?.isTypeSupported!="function"?"":T.find(e=>window.MediaRecorder.isTypeSupported(e))??""}destroy(){this._mediaRecorder&&(this._mediaRecorder.onstart=null,this._mediaRecorder.ondataavailable=null,this._mediaRecorder.onerror=null,this._mediaRecorder.onstop=null),this.cancel(),this._mediaRecorder=null}_queuePendingChunkOperation(e){this._pendingChunkOperations.add(e),e.finally(()=>{this._pendingChunkOperations.delete(e)})}async _awaitPendingChunkOperations(){this._pendingChunkOperations.size&&await Promise.allSettled(Array.from(this._pendingChunkOperations))}_onDataAvailable(e){let t=this._activeSessionId;t!=null&&this._queuePendingChunkOperation(this._processDataAvailable(e,t))}async _processDataAvailable(e,t){let s=e.data;if(!s.size||t!==this._activeSessionId)return;this._recordedChunks.push(s);let i=s.type||this._mediaRecorder?.mimeType||this._mimeType,r=this._mediaRecorderStopReason==="toggle"&&this._mediaRecorder?.state==="inactive";try{if(!this.handleRecording)return;let n=h(await this.handleRecording(s,i,this._mediaRecorderChunkIndex,r)??"");if(t!==this._activeSessionId)return;n&&this._set("liveTranscript",h(`${this.liveTranscript} ${n}`))}catch(n){if(t!==this._activeSessionId)return;this._failSession(n instanceof Error&&n.message==="transcription-unavailable"?"transcription-unavailable":"transcription-failed");return}!r&&t===this._activeSessionId&&(this._mediaRecorderChunkIndex+=1)}_failSession(e){let t=this._mediaRecorder;if(t){t.onstart=null,t.ondataavailable=null,t.onerror=null,t.onstop=null;try{t.state!=="inactive"&&t.stop()}catch{}}this._activeSessionId=null,this._mediaRecorder=null,this._mediaRecorderChunkIndex=0,this._mediaRecorderStopReason=null,this._pendingChunkOperations.clear(),this._recordedChunks=[],this._releaseMediaStream(),this._set("liveTranscript",""),this._set("transcript",""),this._set("state","error"),this._set("errorCode",e)}_onError(){this._failSession("recording-failed")}_onStart(){this._set("state","listening")}_onStop(){this._handleStop()}_releaseMediaStream(){this._mediaStream?.getTracks().forEach(e=>e.stop()),this._mediaStream=null}async _handleStop(){let e=this._mediaRecorder,t=this._activeSessionId,s=this._mediaRecorderStopReason,i=e?.mimeType||this._recordedChunks.find(n=>!!n.type)?.type||"",r=[...this._recordedChunks];if(this._mediaRecorder=null,this._mediaRecorderChunkIndex=0,this._releaseMediaStream(),s==="cancel"){this._activeSessionId===t&&(this._activeSessionId=null),this._mediaRecorderStopReason=null,this._pendingChunkOperations.clear(),this._recordedChunks=[],this._set("liveTranscript",""),this._set("transcript",""),this._set("state","idle"),this._set("errorCode",void 0);return}if(t==null){this._mediaRecorderStopReason=null,this._pendingChunkOperations.clear(),this._recordedChunks=[],this._set("state","idle"),this._set("errorCode",void 0);return}if(await this._awaitPendingChunkOperations(),t===this._activeSessionId){if(!(i?new Blob(r,{type:i}):new Blob(r)).size){this._activeSessionId===t&&(this._activeSessionId=null),this._mediaRecorderStopReason=null,this._recordedChunks=[],this._set("state","error"),this._set("errorCode","recording-failed");return}this._set("state","processing"),this._set("transcript",h(`${this.transcript} ${this.liveTranscript}`)),this._set("liveTranscript",""),this._activeSessionId===t&&(this._activeSessionId=null),this._set("state","idle"),this._set("errorCode",void 0),this._mediaRecorderStopReason=null,this._recordedChunks=[]}}start(){if(!l.isSupported()){this._set("errorCode","not-supported");return}let e=Date.now();this._activeSessionId=e,this._mediaRecorderChunkIndex=0,this._mediaRecorderStopReason=null,this._pendingChunkOperations.clear(),this._recordedChunks=[],this._set("liveTranscript",""),this._set("transcript",""),this._set("errorCode",void 0),navigator.mediaDevices.getUserMedia({audio:!0}).then(t=>{if(e!==this._activeSessionId){t.getTracks().forEach(r=>r.stop());return}let s=this._mimeType,i=s?new window.MediaRecorder(t,{mimeType:s}):new window.MediaRecorder(t);this._mediaStream=t,this._mediaRecorder=i,this._mediaRecorderChunkIndex=0,this._mediaRecorderStopReason=null,this._recordedChunks=[],i.ondataavailable=this._onDataAvailable.bind(this),i.onerror=this._onError.bind(this),i.onstart=this._onStart.bind(this),i.onstop=this._onStop.bind(this),this._mediaRecorder.start(this.chunkTimeSlice)}).catch(t=>{e===this._activeSessionId&&(this._activeSessionId=null,this._mediaRecorder=null,this._mediaRecorderChunkIndex=0,this._mediaRecorderStopReason=null,this._pendingChunkOperations.clear(),this._recordedChunks=[],this._releaseMediaStream(),t instanceof DOMException&&t.name==="NotAllowedError"?(this._set("state","error"),this._set("errorCode","not-allowed")):(this._set("state","error"),this._set("errorCode","recording-failed")))})}stop(){if(this._mediaRecorder){this._mediaRecorderStopReason="toggle";try{this._mediaRecorder.state!=="inactive"?this._mediaRecorder.stop():this._handleStop()}catch{}}}cancel(){let e=this._mediaRecorder;if(this._activeSessionId=null,this._mediaRecorderStopReason="cancel",this._mediaRecorderChunkIndex=0,this._pendingChunkOperations.clear(),this._recordedChunks=[],this._set("liveTranscript",""),this._set("transcript",""),this._set("state","idle"),this._set("errorCode",void 0),!e){this._releaseMediaStream();return}try{if(e.state!=="inactive"){e.stop();return}}catch{}this._mediaRecorder=null,this._releaseMediaStream()}static isSupported(){return typeof window<"u"&&!!(window.MediaRecorder&&navigator.mediaDevices?.getUserMedia)}};g([d()],l.prototype,"_mimeType",1);g([d()],l.prototype,"handleRecording",2);g([d()],l.prototype,"chunkTimeSlice",2);l=g([f("MediaRecorderController")],l);var D=Object.getOwnPropertyDescriptor,E=(e,t,s,i)=>{for(var r=i>1?void 0:i?D(t,s):t,n=e.length-1,o;n>=0;n--)(o=e[n])&&(r=o(r)||r);return r};function k(){if(typeof window>"u")return null;let e=window;return e.SpeechRecognition??e.webkitSpeechRecognition??null}var _=class extends a{constructor(e){super(e),this._isCancelled=!1,this._recognition=null}initialize(){let e=k();if(!e)return;let t=new e;t.continuous=!0,t.interimResults=!0,this.language&&(t.lang=this.language),t.onstart=this._onStart.bind(this),t.onresult=this._onResult.bind(this),t.onerror=this._onError.bind(this),t.onend=this._onEnd.bind(this),t.onspeechend=this._onSpeechEnd.bind(this),this._recognition=t}destroy(){this._recognition&&(this._recognition.onstart=null,this._recognition.onresult=null,this._recognition.onerror=null,this._recognition.onend=null,this._recognition.onspeechend=null,this.cancel(),this._recognition=null)}_onStart(){this._isCancelled=!1,this._set("state","listening")}_onResult(e){let{finalTranscript:t,liveTranscript:s}=Array.from(e.results).reduce((i,r)=>(r.isFinal?i.finalTranscript+=r[0].transcript:i.liveTranscript+=r[0].transcript,i),{finalTranscript:"",liveTranscript:""});this._set("transcript",h(t)),this._set("liveTranscript",h(s))}_onError(e){if(e.error==="aborted"&&this._isCancelled){this._set("state","idle");return}let t="unhandled";switch(e.error){case"no-speech":t="no-speech";break;case"service-not-allowed":case"not-allowed":t="not-allowed";break;default:t="unhandled"}this._set("state","error"),this._set("errorCode",t)}_onEnd(){let e=h(`${this.transcript} ${this.liveTranscript}`);if(this._set("liveTranscript",""),this._isCancelled){this._set("transcript",""),this._set("state","idle"),this._set("errorCode",void 0);return}this.errorCode?this._set("transcript",""):(this._set("transcript",e),this._set("state","idle")),this._set("errorCode",void 0)}_onSpeechEnd(){this._set("state","processing")}_reset(e=!1){this._isCancelled=e,this._set("liveTranscript",""),this._set("transcript",""),this._set("errorCode",void 0),this._set("state","idle")}start(){if(!this._recognition){this._set("errorCode","not-supported");return}this._reset(!1);try{this._recognition.start()}catch{this._set("state","error"),this._set("errorCode","unhandled")}}stop(){if(this._recognition){this._set("state","processing");try{this._recognition.stop()}catch{}}}cancel(){if(this._recognition){this._reset(!0);try{this._recognition.abort()}catch{}}}static isSupported(){return!!k()}};_=E([f("WebSpeechController")],_);function b(e){let{baseValue:t,transcript:s}=e;if(!s)return t;let i=t.trim();return i?`${i} ${s}`:s}var v=class extends R{constructor(){super(...arguments),this.#t=null,this._resolvedMode="disabled",this.awaitingResponse=!1,this.inputValue="",this.mode="web-speech",this.arcgisVoiceInputDraftChange=c(),this.arcgisVoiceInputError=c(),this.arcgisVoiceInputInterimTranscription=c(),this.arcgisVoiceInputStart=c(),this.arcgisVoiceInputStop=c(),this.arcgisVoiceInputTranscription=c(),this.arcgisVoiceInputTranscriptionStreamChunk=c()}static{this.properties={_resolvedMode:16,_state:16,_errorCode:16,_liveTranscript:16,_transcript:16,_isButtonDisabled:16,_buttonLabel:16,awaitingResponse:5,inputValue:1,language:1,mode:1}}static{this.styles=I}#t;get _state(){return this._speechController?.state??"idle"}get _errorCode(){return this._speechController?.errorCode??null}get _liveTranscript(){return this._speechController?.liveTranscript??""}get _transcript(){return this._speechController?.transcript??""}get _isButtonDisabled(){return this._resolvedMode==="disabled"||this.awaitingResponse||this._state==="processing"}get _buttonLabel(){if(this.awaitingResponse)return"Voice input unavailable while assistant is responding";if(this._resolvedMode==="disabled")return"Voice input unavailable";switch(this._state){case"error":return this._errorCode==="not-allowed"?"Microphone permission denied. Retry voice input":"Retry voice input";case"listening":return"Stop voice input";case"processing":return"Processing voice input";default:return"Start voice input"}}clearDraftSession(){this.#t=null}loaded(){this.manager.onLifecycle(()=>[u(()=>[this.mode,this.language],()=>{this._configureController()},{initial:!0}),u(()=>this.awaitingResponse,t=>{t&&this._cancelActiveSession()},{initial:!0}),u(()=>this._liveTranscript,t=>{if(t){let s=h(`${this._transcript} ${t}`);this.arcgisVoiceInputInterimTranscription.emit({transcript:s}),this._applyVoiceInputTranscript(s)}}),u(()=>this._transcript,t=>{t&&(this.arcgisVoiceInputTranscription.emit({transcript:t}),this._applyVoiceInputTranscript(t,{final:!0}))}),u(()=>this._state,t=>{t==="error"&&this._errorCode&&this.arcgisVoiceInputError.emit({errorCode:this._errorCode})})])}disconnectedCallback(){super.disconnectedCallback(),this._destroySpeechController()}_configureController(){let t=this._resolveMode();this._destroySpeechController(),this._resolvedMode=t,t!=="disabled"&&(this._speechController=t==="web-speech"?new _({language:this.language}):new l({language:this.language,handleRecording:this._handleRecording.bind(this)}))}_destroySpeechController(){this._speechController?.cancel(),this._speechController?.destroy(),this._speechController=void 0}_emitDraftChange(t,s){this.arcgisVoiceInputDraftChange.emit({focusInput:s?.focusInput,value:t})}_startVoiceInputSession(){this.#t={baseValue:this.inputValue.trim(),phase:"listening",transcript:""}}_finishVoiceInputSession(){let t=this.#t;if(!t){this._emitDraftChange(this.inputValue.trim());return}let s={...t,phase:"stopped"},i=b(s);this.#t=s,this._emitDraftChange(i)}async _applyVoiceInputTranscript(t,s){let i=this.#t;if(!t||!i)return;if(i.phase==="stopped"){let o=b(i);if(this.inputValue.trim()!==o){this.clearDraftSession();return}}let r={...i,transcript:t},n=b(r);this.#t=r,this._emitDraftChange(n,{focusInput:s?.final&&r.phase==="stopped"})}async _handleToggle(){if(!(this._isButtonDisabled||!this._speechController)){if(this._state==="listening"){this._speechController.stop(),this._finishVoiceInputSession(),this.arcgisVoiceInputStop.emit();return}this._speechController.start(),this._startVoiceInputSession(),this.arcgisVoiceInputStart.emit()}}async _handleRecording(t,s,i,r){let n;return this.arcgisVoiceInputTranscriptionStreamChunk.emit({blob:t,chunkIndex:i,isFinal:r,mimeType:s,respondWithTranscript:o=>{n=o}}),n}_resolveMode(){return this.mode==="disabled"?"disabled":this.mode==="web-speech"&&_.isSupported()?"web-speech":l.isSupported()?"media-recorder":"disabled"}async _cancelActiveSession(){this._speechController&&this._resolvedMode!=="disabled"&&this._speechController.cancel(),this.clearDraftSession()}render(){return S`<calcite-button appearance=transparent class="button" data-mode=${this._resolvedMode??m} data-state=${(this._resolvedMode==="disabled"?"disabled":this._state)??m} .disabled=${this._isButtonDisabled} icon-start=microphone kind=neutral .label=${this._buttonLabel} .loading=${this._state==="processing"} round scale=m @click=${()=>{this._handleToggle()}}></calcite-button>`}};y("arcgis-assistant-speech-input",v);return v},"core/reactiveUtils","core/accessorSupport/decorators","core/Accessor")
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
+ import{A as m,C as y,g as C,h as S,o as c,x as R}from"./NAVK5JJ2.js";import"./OUMTV5H5.js";import"./5PV2GUZW.js";export default $arcgis.t(([{watch:u},{property:d,subclass:f},w])=>{var I=C`.button{--calcite-button-background-color: var(--calcite-color-transparent);--calcite-button-border-color: transparent;--calcite-button-icon-color: var(--calcite-color-text-3);--calcite-button-text-color: var(--calcite-color-text-3);flex:0 0 auto;position:relative}.button[data-state=disabled]{--calcite-button-icon-color: var(--calcite-color-text-3);opacity:var(--calcite-opacity-disabled)}.button[data-state=listening]{--calcite-button-background-color: color-mix( in srgb, var(--calcite-color-brand) 14%, var(--calcite-color-foreground-1) );--calcite-button-border-color: color-mix(in srgb, var(--calcite-color-brand) 24%, transparent);--calcite-button-icon-color: var(--calcite-color-brand);--calcite-button-text-color: var(--calcite-color-brand);box-shadow:var(--calcite-shadow-sm)}.button[data-state=listening]:hover{--calcite-button-background-color: color-mix( in srgb, var(--calcite-color-brand-hover, var(--calcite-color-brand)) 18%, var(--calcite-color-foreground-1) )}.button[data-state=listening]:active{--calcite-button-background-color: color-mix( in srgb, var(--calcite-color-brand) 24%, var(--calcite-color-foreground-1) )}.button[data-state=processing]{--calcite-button-background-color: color-mix( in srgb, var(--calcite-color-brand) 10%, var(--calcite-color-foreground-1) );--calcite-button-border-color: color-mix(in srgb, var(--calcite-color-brand) 20%, transparent);--calcite-button-icon-color: var(--calcite-color-brand);--calcite-button-text-color: var(--calcite-color-brand)}.button[data-state=error]{--calcite-button-background-color: color-mix( in srgb, var(--calcite-color-status-danger) 12%, var(--calcite-color-foreground-1) );--calcite-button-border-color: color-mix(in srgb, var(--calcite-color-status-danger) 24%, transparent);--calcite-button-icon-color: var(--calcite-color-status-danger);--calcite-button-text-color: var(--calcite-color-status-danger)}.button[data-state=listening]:after{content:"";position:absolute;inset:-4px;border:1px solid color-mix(in srgb,var(--calcite-color-brand) 40%,transparent);border-radius:inherit;opacity:0;pointer-events:none;transform:scale(.92);animation:assistant-speech-input-recording-pulse 1.8s ease-out infinite}@keyframes assistant-speech-input-recording-pulse{0%{opacity:.65;transform:scale(.92)}70%{opacity:0;transform:scale(1.16)}to{opacity:0;transform:scale(1.16)}}@media(prefers-reduced-motion){.button[data-state=listening]:after{animation:none}}`,T=["audio/webm;codecs=opus","audio/webm","audio/mp4","audio/ogg;codecs=opus","audio/ogg"];function h(e){return e.replace(/\s+/gu," ").trim()}var x=Object.defineProperty,V=Object.getOwnPropertyDescriptor,p=(e,t,s,i)=>{for(var r=i>1?void 0:i?V(t,s):t,n=e.length-1,o;n>=0;n--)(o=e[n])&&(r=(i?o(t,s,r):o(r))||r);return i&&r&&x(t,s,r),r},a=class extends w{constructor(e){super(e),this.state="idle",this.liveTranscript="",this.transcript="",this.errorCode=void 0}static isSupported(){return!1}};p([d()],a.prototype,"language",2);p([d({readOnly:!0})],a.prototype,"state",2);p([d({readOnly:!0})],a.prototype,"liveTranscript",2);p([d({readOnly:!0})],a.prototype,"transcript",2);p([d({readOnly:!0})],a.prototype,"errorCode",2);a=p([f("SpeechController")],a);var O=Object.defineProperty,M=Object.getOwnPropertyDescriptor,g=(e,t,s,i)=>{for(var r=i>1?void 0:i?M(t,s):t,n=e.length-1,o;n>=0;n--)(o=e[n])&&(r=(i?o(t,s,r):o(r))||r);return i&&r&&O(t,s,r),r},l=class extends a{constructor(e){super(e),this._activeSessionId=null,this._mediaRecorder=null,this._mediaRecorderChunkIndex=0,this._mediaRecorderStopReason=null,this._mediaStream=null,this._pendingChunkOperations=new Set,this._recordedChunks=[],this.handleRecording=null,this.chunkTimeSlice=3e3}get _mimeType(){return typeof window>"u"||typeof window.MediaRecorder?.isTypeSupported!="function"?"":T.find(e=>window.MediaRecorder.isTypeSupported(e))??""}destroy(){this._mediaRecorder&&(this._mediaRecorder.onstart=null,this._mediaRecorder.ondataavailable=null,this._mediaRecorder.onerror=null,this._mediaRecorder.onstop=null),this.cancel(),this._mediaRecorder=null}_queuePendingChunkOperation(e){this._pendingChunkOperations.add(e),e.finally(()=>{this._pendingChunkOperations.delete(e)})}async _awaitPendingChunkOperations(){this._pendingChunkOperations.size&&await Promise.allSettled(Array.from(this._pendingChunkOperations))}_onDataAvailable(e){let t=this._activeSessionId;t!=null&&this._queuePendingChunkOperation(this._processDataAvailable(e,t))}async _processDataAvailable(e,t){let s=e.data;if(!s.size||t!==this._activeSessionId)return;this._recordedChunks.push(s);let i=s.type||this._mediaRecorder?.mimeType||this._mimeType,r=this._mediaRecorderStopReason==="toggle"&&this._mediaRecorder?.state==="inactive";try{if(!this.handleRecording)return;let n=h(await this.handleRecording(s,i,this._mediaRecorderChunkIndex,r)??"");if(t!==this._activeSessionId)return;n&&this._set("liveTranscript",h(`${this.liveTranscript} ${n}`))}catch(n){if(t!==this._activeSessionId)return;this._failSession(n instanceof Error&&n.message==="transcription-unavailable"?"transcription-unavailable":"transcription-failed");return}!r&&t===this._activeSessionId&&(this._mediaRecorderChunkIndex+=1)}_failSession(e){let t=this._mediaRecorder;if(t){t.onstart=null,t.ondataavailable=null,t.onerror=null,t.onstop=null;try{t.state!=="inactive"&&t.stop()}catch{}}this._activeSessionId=null,this._mediaRecorder=null,this._mediaRecorderChunkIndex=0,this._mediaRecorderStopReason=null,this._pendingChunkOperations.clear(),this._recordedChunks=[],this._releaseMediaStream(),this._set("liveTranscript",""),this._set("transcript",""),this._set("state","error"),this._set("errorCode",e)}_onError(){this._failSession("recording-failed")}_onStart(){this._set("state","listening")}_onStop(){this._handleStop()}_releaseMediaStream(){this._mediaStream?.getTracks().forEach(e=>e.stop()),this._mediaStream=null}async _handleStop(){let e=this._mediaRecorder,t=this._activeSessionId,s=this._mediaRecorderStopReason,i=e?.mimeType||this._recordedChunks.find(n=>!!n.type)?.type||"",r=[...this._recordedChunks];if(this._mediaRecorder=null,this._mediaRecorderChunkIndex=0,this._releaseMediaStream(),s==="cancel"){this._activeSessionId===t&&(this._activeSessionId=null),this._mediaRecorderStopReason=null,this._pendingChunkOperations.clear(),this._recordedChunks=[],this._set("liveTranscript",""),this._set("transcript",""),this._set("state","idle"),this._set("errorCode",void 0);return}if(t==null){this._mediaRecorderStopReason=null,this._pendingChunkOperations.clear(),this._recordedChunks=[],this._set("state","idle"),this._set("errorCode",void 0);return}if(await this._awaitPendingChunkOperations(),t===this._activeSessionId){if(!(i?new Blob(r,{type:i}):new Blob(r)).size){this._activeSessionId===t&&(this._activeSessionId=null),this._mediaRecorderStopReason=null,this._recordedChunks=[],this._set("state","error"),this._set("errorCode","recording-failed");return}this._set("state","processing"),this._set("transcript",h(`${this.transcript} ${this.liveTranscript}`)),this._set("liveTranscript",""),this._activeSessionId===t&&(this._activeSessionId=null),this._set("state","idle"),this._set("errorCode",void 0),this._mediaRecorderStopReason=null,this._recordedChunks=[]}}start(){if(!l.isSupported()){this._set("errorCode","not-supported");return}let e=Date.now();this._activeSessionId=e,this._mediaRecorderChunkIndex=0,this._mediaRecorderStopReason=null,this._pendingChunkOperations.clear(),this._recordedChunks=[],this._set("liveTranscript",""),this._set("transcript",""),this._set("errorCode",void 0),navigator.mediaDevices.getUserMedia({audio:!0}).then(t=>{if(e!==this._activeSessionId){t.getTracks().forEach(r=>r.stop());return}let s=this._mimeType,i=s?new window.MediaRecorder(t,{mimeType:s}):new window.MediaRecorder(t);this._mediaStream=t,this._mediaRecorder=i,this._mediaRecorderChunkIndex=0,this._mediaRecorderStopReason=null,this._recordedChunks=[],i.ondataavailable=this._onDataAvailable.bind(this),i.onerror=this._onError.bind(this),i.onstart=this._onStart.bind(this),i.onstop=this._onStop.bind(this),this._mediaRecorder.start(this.chunkTimeSlice)}).catch(t=>{e===this._activeSessionId&&(this._activeSessionId=null,this._mediaRecorder=null,this._mediaRecorderChunkIndex=0,this._mediaRecorderStopReason=null,this._pendingChunkOperations.clear(),this._recordedChunks=[],this._releaseMediaStream(),t instanceof DOMException&&t.name==="NotAllowedError"?(this._set("state","error"),this._set("errorCode","not-allowed")):(this._set("state","error"),this._set("errorCode","recording-failed")))})}stop(){if(this._mediaRecorder){this._mediaRecorderStopReason="toggle";try{this._mediaRecorder.state!=="inactive"?this._mediaRecorder.stop():this._handleStop()}catch{}}}cancel(){let e=this._mediaRecorder;if(this._activeSessionId=null,this._mediaRecorderStopReason="cancel",this._mediaRecorderChunkIndex=0,this._pendingChunkOperations.clear(),this._recordedChunks=[],this._set("liveTranscript",""),this._set("transcript",""),this._set("state","idle"),this._set("errorCode",void 0),!e){this._releaseMediaStream();return}try{if(e.state!=="inactive"){e.stop();return}}catch{}this._mediaRecorder=null,this._releaseMediaStream()}static isSupported(){return typeof window<"u"&&!!(window.MediaRecorder&&navigator.mediaDevices?.getUserMedia)}};g([d()],l.prototype,"_mimeType",1);g([d()],l.prototype,"handleRecording",2);g([d()],l.prototype,"chunkTimeSlice",2);l=g([f("MediaRecorderController")],l);var D=Object.getOwnPropertyDescriptor,E=(e,t,s,i)=>{for(var r=i>1?void 0:i?D(t,s):t,n=e.length-1,o;n>=0;n--)(o=e[n])&&(r=o(r)||r);return r};function k(){if(typeof window>"u")return null;let e=window;return e.SpeechRecognition??e.webkitSpeechRecognition??null}var _=class extends a{constructor(e){super(e),this._isCancelled=!1,this._recognition=null}initialize(){let e=k();if(!e)return;let t=new e;t.continuous=!0,t.interimResults=!0,this.language&&(t.lang=this.language),t.onstart=this._onStart.bind(this),t.onresult=this._onResult.bind(this),t.onerror=this._onError.bind(this),t.onend=this._onEnd.bind(this),t.onspeechend=this._onSpeechEnd.bind(this),this._recognition=t}destroy(){this._recognition&&(this._recognition.onstart=null,this._recognition.onresult=null,this._recognition.onerror=null,this._recognition.onend=null,this._recognition.onspeechend=null,this.cancel(),this._recognition=null)}_onStart(){this._isCancelled=!1,this._set("state","listening")}_onResult(e){let{finalTranscript:t,liveTranscript:s}=Array.from(e.results).reduce((i,r)=>(r.isFinal?i.finalTranscript+=r[0].transcript:i.liveTranscript+=r[0].transcript,i),{finalTranscript:"",liveTranscript:""});this._set("transcript",h(t)),this._set("liveTranscript",h(s))}_onError(e){if(e.error==="aborted"&&this._isCancelled){this._set("state","idle");return}let t="unhandled";switch(e.error){case"no-speech":t="no-speech";break;case"service-not-allowed":case"not-allowed":t="not-allowed";break;default:t="unhandled"}this._set("state","error"),this._set("errorCode",t)}_onEnd(){let e=h(`${this.transcript} ${this.liveTranscript}`);if(this._set("liveTranscript",""),this._isCancelled){this._set("transcript",""),this._set("state","idle"),this._set("errorCode",void 0);return}this.errorCode?this._set("transcript",""):(this._set("transcript",e),this._set("state","idle")),this._set("errorCode",void 0)}_onSpeechEnd(){this._set("state","processing")}_reset(e=!1){this._isCancelled=e,this._set("liveTranscript",""),this._set("transcript",""),this._set("errorCode",void 0),this._set("state","idle")}start(){if(!this._recognition){this._set("errorCode","not-supported");return}this._reset(!1);try{this._recognition.start()}catch{this._set("state","error"),this._set("errorCode","unhandled")}}stop(){if(this._recognition){this._set("state","processing");try{this._recognition.stop()}catch{}}}cancel(){if(this._recognition){this._reset(!0);try{this._recognition.abort()}catch{}}}static isSupported(){return!!k()}};_=E([f("WebSpeechController")],_);function b(e){let{baseValue:t,transcript:s}=e;if(!s)return t;let i=t.trim();return i?`${i} ${s}`:s}var v=class extends R{constructor(){super(...arguments),this.#t=null,this._resolvedMode="disabled",this.awaitingResponse=!1,this.inputValue="",this.mode="web-speech",this.arcgisVoiceInputDraftChange=c(),this.arcgisVoiceInputError=c(),this.arcgisVoiceInputInterimTranscription=c(),this.arcgisVoiceInputStart=c(),this.arcgisVoiceInputStop=c(),this.arcgisVoiceInputTranscription=c(),this.arcgisVoiceInputTranscriptionStreamChunk=c()}static{this.properties={_resolvedMode:16,_state:16,_errorCode:16,_liveTranscript:16,_transcript:16,_isButtonDisabled:16,_buttonLabel:16,awaitingResponse:5,inputValue:1,language:1,mode:1}}static{this.styles=I}#t;get _state(){return this._speechController?.state??"idle"}get _errorCode(){return this._speechController?.errorCode??null}get _liveTranscript(){return this._speechController?.liveTranscript??""}get _transcript(){return this._speechController?.transcript??""}get _isButtonDisabled(){return this._resolvedMode==="disabled"||this.awaitingResponse||this._state==="processing"}get _buttonLabel(){if(this.awaitingResponse)return"Voice input unavailable while assistant is responding";if(this._resolvedMode==="disabled")return"Voice input unavailable";switch(this._state){case"error":return this._errorCode==="not-allowed"?"Microphone permission denied. Retry voice input":"Retry voice input";case"listening":return"Stop voice input";case"processing":return"Processing voice input";default:return"Start voice input"}}clearDraftSession(){this.#t=null}loaded(){this.manager.onLifecycle(()=>[u(()=>[this.mode,this.language],()=>{this._configureController()},{initial:!0}),u(()=>this.awaitingResponse,t=>{t&&this._cancelActiveSession()},{initial:!0}),u(()=>this._liveTranscript,t=>{if(t){let s=h(`${this._transcript} ${t}`);this.arcgisVoiceInputInterimTranscription.emit({transcript:s}),this._applyVoiceInputTranscript(s)}}),u(()=>this._transcript,t=>{t&&(this.arcgisVoiceInputTranscription.emit({transcript:t}),this._applyVoiceInputTranscript(t,{final:!0}))}),u(()=>this._state,t=>{t==="error"&&this._errorCode&&this.arcgisVoiceInputError.emit({errorCode:this._errorCode})})])}disconnectedCallback(){super.disconnectedCallback(),this._destroySpeechController()}_configureController(){let t=this._resolveMode();this._destroySpeechController(),this._resolvedMode=t,t!=="disabled"&&(this._speechController=t==="web-speech"?new _({language:this.language}):new l({language:this.language,handleRecording:this._handleRecording.bind(this)}))}_destroySpeechController(){this._speechController?.cancel(),this._speechController?.destroy(),this._speechController=void 0}_emitDraftChange(t,s){this.arcgisVoiceInputDraftChange.emit({focusInput:s?.focusInput,value:t})}_startVoiceInputSession(){this.#t={baseValue:this.inputValue.trim(),phase:"listening",transcript:""}}_finishVoiceInputSession(){let t=this.#t;if(!t){this._emitDraftChange(this.inputValue.trim());return}let s={...t,phase:"stopped"},i=b(s);this.#t=s,this._emitDraftChange(i)}async _applyVoiceInputTranscript(t,s){let i=this.#t;if(!t||!i)return;if(i.phase==="stopped"){let o=b(i);if(this.inputValue.trim()!==o){this.clearDraftSession();return}}let r={...i,transcript:t},n=b(r);this.#t=r,this._emitDraftChange(n,{focusInput:s?.final&&r.phase==="stopped"})}async _handleToggle(){if(!(this._isButtonDisabled||!this._speechController)){if(this._state==="listening"){this._speechController.stop(),this._finishVoiceInputSession(),this.arcgisVoiceInputStop.emit();return}this._speechController.start(),this._startVoiceInputSession(),this.arcgisVoiceInputStart.emit()}}async _handleRecording(t,s,i,r){let n;return this.arcgisVoiceInputTranscriptionStreamChunk.emit({blob:t,chunkIndex:i,isFinal:r,mimeType:s,respondWithTranscript:o=>{n=o}}),n}_resolveMode(){return this.mode==="disabled"?"disabled":this.mode==="web-speech"&&_.isSupported()?"web-speech":l.isSupported()?"media-recorder":"disabled"}async _cancelActiveSession(){this._speechController&&this._resolvedMode!=="disabled"&&this._speechController.cancel(),this.clearDraftSession()}render(){return S`<calcite-button appearance=transparent class="button" data-mode=${this._resolvedMode??m} data-state=${(this._resolvedMode==="disabled"?"disabled":this._state)??m} .disabled=${this._isButtonDisabled} icon-start=microphone kind=neutral .label=${this._buttonLabel} .loading=${this._state==="processing"} round scale=m @click=${()=>{this._handleToggle()}}></calcite-button>`}};y("arcgis-assistant-speech-input",v);return v},"core/reactiveUtils","core/accessorSupport/decorators","core/Accessor")
@@ -1,2 +1,2 @@
1
- /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{a as m}from"./ONQ6JSBJ.js";import{a as t}from"./RFPTOFM4.js";import{Ga as i}from"./FSLPYC4Y.js";async function r(o,e){return await e.goTo({zoom:o}),{text:`Successfully zoomed to: ${o}`}}async function a({zoom:o},e){let{mapView:n}=m(e,["mapView"]);return await r(o,n)}var c=t.object({zoom:t.number().min(1).max(20).describe("The zoom level of the view to go to.")}),p=i(a,{name:"goToZoom",description:'Go to the specified zoom level. If input is generic (e.g. "zoom in", then only zoom to the next appropriate level - increase level for zooming in and decrease for zooming out.).',schema:c});export{p as a};
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
+ import{a as m}from"./QBZP6XOE.js";import{a as t}from"./GS5JDPZH.js";import{Ga as i}from"./A4ZVCRVF.js";async function r(o,e){return await e.goTo({zoom:o}),{text:`Successfully zoomed to: ${o}`}}async function a({zoom:o},e){let{mapView:n}=m(e,["mapView"]);return await r(o,n)}var c=t.object({zoom:t.number().min(1).max(20).describe("The zoom level of the view to go to.")}),p=i(a,{name:"goToZoom",description:'Go to the specified zoom level. If input is generic (e.g. "zoom in", then only zoom to the next appropriate level - increase level for zooming in and decrease for zooming out.).',schema:c});export{p as a};
@@ -1,2 +1,2 @@
1
- /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{b as v,c as R,d as C,e as W,g as k}from"./GEFFWUB2.js";import{a as M,b as A}from"./AAUVOBPS.js";var x=["input","output","total","cacheRead","cacheWrite","reasoning"];function h(d,i=!1){let n={},c={input:0,output:0,total:0,cacheRead:0,cacheWrite:0,reasoning:0},u={input:!0,output:!0,total:!0,cacheRead:!0,cacheWrite:!0,reasoning:!0},e={input:0,cachedInput:0,cacheWrite:0,output:0,total:0},a=d.length>0;for(let r of d){for(let m of x){let p=r.metadata?.tokenUsage?.[m];p===void 0?u[m]=!1:c[m]+=p}let o=r.usage?.cost;o?(e.input+=o.input,e.cachedInput+=o.cachedInput,e.cacheWrite+=o.cacheWrite,e.output+=o.output,e.total+=o.total):a=!1}for(let r of x)u[r]&&(n[r]=c[r]);return{tokens:n,knownTokens:c,completeTokens:u,cost:a?{...e}:void 0,knownCost:e,completeCost:a,modelCalls:d.length,...i&&d[0]?.usage?.rates&&{rates:d[0].usage.rates},...n.input!==void 0&&(i||n.cacheRead!==void 0&&n.cacheWrite!==void 0)&&{uncached:n.input-(n.cacheRead??0)-(n.cacheWrite??0)}}}function b(d,i=M){let n=new Map;for(let e of d){let a=n.get(e.runId)??[];a.push(e),n.set(e.runId,a)}let c=[],u=[];for(let[e,a]of n){let r=v(a),o=R(a,r),m=new Set(a.filter(t=>t.phase==="started").map(t=>t.span.id)),p=[...r.values()].map(t=>{let s=A(t,i),l={...t,timingRecorded:m.has(t.id),...s&&{pricingTier:s.rates===(t.metadata?.model?i.models[t.metadata.model]?.longContext:void 0)?"long-context":"standard"}};return t.metadata?.tokenUsage&&(l.usage={...h([{...l,usage:s?{cost:s,rates:s.rates}:void 0}],!0),modelCalls:t.type==="model"?1:0}),l}),g=p.filter(t=>t.type==="model");u.push(...g);let f=new Map;for(let t of g){let s=t.metadata?.model,l=f.get(s)??[];l.push(t),f.set(s,l)}let I=Math.max(0,a.reduce((t,s)=>Math.max(t,s.timestamp),o.startedAt)-o.startedAt);c.push({id:e,number:c.length+1,prompt:W(r),status:o.status,startedAt:o.startedAt,endedAt:o.endedAt,durationMs:o.durationMs,spans:p,usage:h(g),models:[...f].map(([t,s])=>({model:t,usage:h(s)})),latency:{...C(o,a),timelineMs:I,steps:p.filter(k).sort((t,s)=>t.startedAt-s.startedAt).map(t=>({spanId:t.id,offsetMs:Math.max(0,t.startedAt-o.startedAt),durationMs:t.timingRecorded?t.durationMs:void 0,timingRecorded:t.timingRecorded}))}})}return{schemaVersion:1,pricing:i,runs:c,totals:{runCount:c.length,spanCount:c.reduce((e,a)=>e+a.spans.length,0),failedSpanCount:c.reduce((e,a)=>e+a.spans.filter(r=>r.status==="failed").length,0),usage:h(u)}}}export{b as a};
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
+ import{b as v,c as R,d as C,e as W,g as k}from"./T2OYUOSO.js";import{a as M,b as A}from"./VINKTQFR.js";var x=["input","output","total","cacheRead","cacheWrite","reasoning"];function h(d,i=!1){let n={},c={input:0,output:0,total:0,cacheRead:0,cacheWrite:0,reasoning:0},u={input:!0,output:!0,total:!0,cacheRead:!0,cacheWrite:!0,reasoning:!0},e={input:0,cachedInput:0,cacheWrite:0,output:0,total:0},a=d.length>0;for(let r of d){for(let m of x){let p=r.metadata?.tokenUsage?.[m];p===void 0?u[m]=!1:c[m]+=p}let o=r.usage?.cost;o?(e.input+=o.input,e.cachedInput+=o.cachedInput,e.cacheWrite+=o.cacheWrite,e.output+=o.output,e.total+=o.total):a=!1}for(let r of x)u[r]&&(n[r]=c[r]);return{tokens:n,knownTokens:c,completeTokens:u,cost:a?{...e}:void 0,knownCost:e,completeCost:a,modelCalls:d.length,...i&&d[0]?.usage?.rates&&{rates:d[0].usage.rates},...n.input!==void 0&&(i||n.cacheRead!==void 0&&n.cacheWrite!==void 0)&&{uncached:n.input-(n.cacheRead??0)-(n.cacheWrite??0)}}}function b(d,i=M){let n=new Map;for(let e of d){let a=n.get(e.runId)??[];a.push(e),n.set(e.runId,a)}let c=[],u=[];for(let[e,a]of n){let r=v(a),o=R(a,r),m=new Set(a.filter(t=>t.phase==="started").map(t=>t.span.id)),p=[...r.values()].map(t=>{let s=A(t,i),l={...t,timingRecorded:m.has(t.id),...s&&{pricingTier:s.rates===(t.metadata?.model?i.models[t.metadata.model]?.longContext:void 0)?"long-context":"standard"}};return t.metadata?.tokenUsage&&(l.usage={...h([{...l,usage:s?{cost:s,rates:s.rates}:void 0}],!0),modelCalls:t.type==="model"?1:0}),l}),g=p.filter(t=>t.type==="model");u.push(...g);let f=new Map;for(let t of g){let s=t.metadata?.model,l=f.get(s)??[];l.push(t),f.set(s,l)}let I=Math.max(0,a.reduce((t,s)=>Math.max(t,s.timestamp),o.startedAt)-o.startedAt);c.push({id:e,number:c.length+1,prompt:W(r),status:o.status,startedAt:o.startedAt,endedAt:o.endedAt,durationMs:o.durationMs,spans:p,usage:h(g),models:[...f].map(([t,s])=>({model:t,usage:h(s)})),latency:{...C(o,a),timelineMs:I,steps:p.filter(k).sort((t,s)=>t.startedAt-s.startedAt).map(t=>({spanId:t.id,offsetMs:Math.max(0,t.startedAt-o.startedAt),durationMs:t.timingRecorded?t.durationMs:void 0,timingRecorded:t.timingRecorded}))}})}return{schemaVersion:1,pricing:i,runs:c,totals:{runCount:c.length,spanCount:c.reduce((e,a)=>e+a.spans.length,0),failedSpanCount:c.reduce((e,a)=>e+a.spans.filter(r=>r.status==="failed").length,0),usage:h(u)}}}export{b as a};
@@ -1,5 +1,5 @@
1
- /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{a as V,b as I}from"./34O57OGV.js";import{a as x}from"./XEJFVUNQ.js";import a from"./JZPPP4QY.js";import{a as q}from"./ONQ6JSBJ.js";import{a as E}from"./FDOMMK2M.js";import{a as e}from"./RFPTOFM4.js";import{Ga as F}from"./FSLPYC4Y.js";export default $arcgis.t(([U,W,C,{a:v,b:L,c:T,d:N,e:O,f:R}])=>{var $=async p=>{let{targetLayer:s,fieldName:l,statisticType:n,mapView:r,layersAndFieldsRegistry:h,geometryFilter:t}=p,a=r.map?.allLayers.find(i=>i.id===s.layerId);if(!a)throw new Error(`Layer '${s.layerId}' not found.`);let w=await r.whenLayerView(a),S=x(l,a.fields.map(i=>i.name)),o=h.get(s.layerId)?.fieldRegistry.get(S),j=o?.alias;if(!o)throw new Error(`Field '${S}' not found.`);let b,c;if(t){let i=await N(t,r);if("error"in i)throw new Error(i.error);if(!i.geometry)throw T(t)?new Error(`No features found matching: ${t.where}`):new Error("Failed to create geometry");if(T(t)){let g=r.map?.allLayers.find(f=>f.id===t.layerId);b={geometryLayerName:g?.title??g?.id,geometryLayerId:t.layerId,geometryWhere:t.where,distance:t.distance,units:t.units,applied:!0}}else L(t)&&(b={point:t.point,distance:t.distance,units:t.units,applied:!0});c=new C({geometry:i.geometry,distance:t.distance,units:t.units,spatialRelationship:"intersects"})}let y=V(w,[l],!1),u=null,m=null,A=10;if(o.type!=="geometry"&&o.type!=="oid"&&o.type!=="global-id")try{let i={layer:a,useFeaturesInView:y,view:y?r:void 0,field:l,sqlWhere:I(a.definitionExpression,s.where),...c&&{filter:c},outStatisticTypes:{include:[n]}};u=await U(i);let g=["string","small-integer","integer"],f=o.domain?.type==="coded-value"?o.domain:null;(g.includes(o.type)||f)&&(m=(await W({layer:a,useFeaturesInView:y,view:y?r:void 0,field:l,sqlWhere:I(a.definitionExpression,s.where),...c&&{filter:c}})).uniqueValueInfos.sort((d,D)=>D.count-d.count).slice(0,A)),m&&o.domain?.type==="coded-value"&&(m=m.map(d=>({...d,value:f?f.getName(d.value)??d.value:d.value})))}catch(i){console.error("Statistics error:",i)}return{tool:"getStatistics",layerName:a.title??s.layerId,summary:`${n} = ${typeof u?.[n]=="number"?u[n]:"N/A"}`,details:{fieldName:l,fieldAlias:j,statisticType:n,statistic:u?.[n]??null,summaryStatistics:u,uniqueValues:m,where:s.where,spatialFilterInfo:b}}};async function Q({targetLayer:p,fieldName:s,statisticType:l,geometryFilter:n},r){let h=E(r,"layersAndFieldsRegistry"),{mapView:t}=q(r,["mapView"]),a=R(n,r.state?.agentExecutionContext?.sharedResources),w=await $({targetLayer:p,fieldName:s,statisticType:l,mapView:t,layersAndFieldsRegistry:h,geometryFilter:a});return JSON.stringify(w,null,2)}var G=e.object({layerId:e.string().describe("The layerId of the layer containing the geometry by which to filter."),where:e.string().describe("The SQL-92 where clause representing the features from which to filter."),distance:e.number().optional().describe("The buffer distance around the geometry."),units:v.optional().describe("The units for the distance buffer.")}),H=e.object({point:e.object({x:e.number().describe("X coordinate (longitude) from navigation result"),y:e.number().describe("Y coordinate (latitude) from navigation result"),spatialReference:e.object({wkid:e.number().describe("Spatial reference WKID (e.g., 4326 for WGS84)")}).optional().describe("Spatial reference. Defaults to map's spatial reference if not provided.")}).describe("Point coordinates from a previous navigation/geocoding result"),distance:e.number().optional().describe("Optional buffer distance around the point."),units:v.optional().describe("The units for the distance buffer.")}),J=e.object({targetLayer:e.object({layerId:e.string().describe("The layerId of the layer containing the field from which to get a value."),where:e.string().describe("The SQL-92 where clause representing the feature from which to get an attribute value.")}),geometryFilter:e.union([G,H,O]).optional().describe("Geometry filter for spatial queries. Use 'sharedResourceId' with an ID from listSharedResources for a previously geocoded location. Use 'point' for inline coordinates or 'layerId/where' for features from another layer."),fieldName:e.string().describe("The name of the field for which to get statistics. STRICTLY DO NOT use OBJECTID. Use any other field"),statisticType:e.enum(["avg","max","median","min","stddev","sum","variance","nullcount","count"]).describe("The statistic type to calculate.")}),te=F(Q,{name:"getStatistics",description:`Computes a single aggregate statistic (max, min, avg, sum, median, stddev, variance) for a numeric field across matching features. Also returns frequency analysis for categorical fields.
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
+ import{a as V,b as I}from"./OPQCY33W.js";import{a as x}from"./QAVDW7A7.js";import a from"./BMVPOFHU.js";import{a as q}from"./QBZP6XOE.js";import{a as E}from"./CETIZ4IQ.js";import{a as e}from"./GS5JDPZH.js";import{Ga as F}from"./A4ZVCRVF.js";export default $arcgis.t(([U,W,C,{a:v,b:L,c:T,d:N,e:O,f:R}])=>{var $=async p=>{let{targetLayer:s,fieldName:l,statisticType:n,mapView:r,layersAndFieldsRegistry:h,geometryFilter:t}=p,a=r.map?.allLayers.find(i=>i.id===s.layerId);if(!a)throw new Error(`Layer '${s.layerId}' not found.`);let w=await r.whenLayerView(a),S=x(l,a.fields.map(i=>i.name)),o=h.get(s.layerId)?.fieldRegistry.get(S),j=o?.alias;if(!o)throw new Error(`Field '${S}' not found.`);let b,c;if(t){let i=await N(t,r);if("error"in i)throw new Error(i.error);if(!i.geometry)throw T(t)?new Error(`No features found matching: ${t.where}`):new Error("Failed to create geometry");if(T(t)){let g=r.map?.allLayers.find(f=>f.id===t.layerId);b={geometryLayerName:g?.title??g?.id,geometryLayerId:t.layerId,geometryWhere:t.where,distance:t.distance,units:t.units,applied:!0}}else L(t)&&(b={point:t.point,distance:t.distance,units:t.units,applied:!0});c=new C({geometry:i.geometry,distance:t.distance,units:t.units,spatialRelationship:"intersects"})}let y=V(w,[l],!1),u=null,m=null,A=10;if(o.type!=="geometry"&&o.type!=="oid"&&o.type!=="global-id")try{let i={layer:a,useFeaturesInView:y,view:y?r:void 0,field:l,sqlWhere:I(a.definitionExpression,s.where),...c&&{filter:c},outStatisticTypes:{include:[n]}};u=await U(i);let g=["string","small-integer","integer"],f=o.domain?.type==="coded-value"?o.domain:null;(g.includes(o.type)||f)&&(m=(await W({layer:a,useFeaturesInView:y,view:y?r:void 0,field:l,sqlWhere:I(a.definitionExpression,s.where),...c&&{filter:c}})).uniqueValueInfos.sort((d,D)=>D.count-d.count).slice(0,A)),m&&o.domain?.type==="coded-value"&&(m=m.map(d=>({...d,value:f?f.getName(d.value)??d.value:d.value})))}catch(i){console.error("Statistics error:",i)}return{tool:"getStatistics",layerName:a.title??s.layerId,summary:`${n} = ${typeof u?.[n]=="number"?u[n]:"N/A"}`,details:{fieldName:l,fieldAlias:j,statisticType:n,statistic:u?.[n]??null,summaryStatistics:u,uniqueValues:m,where:s.where,spatialFilterInfo:b}}};async function Q({targetLayer:p,fieldName:s,statisticType:l,geometryFilter:n},r){let h=E(r,"layersAndFieldsRegistry"),{mapView:t}=q(r,["mapView"]),a=R(n,r.state?.agentExecutionContext?.sharedResources),w=await $({targetLayer:p,fieldName:s,statisticType:l,mapView:t,layersAndFieldsRegistry:h,geometryFilter:a});return JSON.stringify(w,null,2)}var G=e.object({layerId:e.string().describe("The layerId of the layer containing the geometry by which to filter."),where:e.string().describe("The SQL-92 where clause representing the features from which to filter."),distance:e.number().optional().describe("The buffer distance around the geometry."),units:v.optional().describe("The units for the distance buffer.")}),H=e.object({point:e.object({x:e.number().describe("X coordinate (longitude) from navigation result"),y:e.number().describe("Y coordinate (latitude) from navigation result"),spatialReference:e.object({wkid:e.number().describe("Spatial reference WKID (e.g., 4326 for WGS84)")}).optional().describe("Spatial reference. Defaults to map's spatial reference if not provided.")}).describe("Point coordinates from a previous navigation/geocoding result"),distance:e.number().optional().describe("Optional buffer distance around the point."),units:v.optional().describe("The units for the distance buffer.")}),J=e.object({targetLayer:e.object({layerId:e.string().describe("The layerId of the layer containing the field from which to get a value."),where:e.string().describe("The SQL-92 where clause representing the feature from which to get an attribute value.")}),geometryFilter:e.union([G,H,O]).optional().describe("Geometry filter for spatial queries. Use 'sharedResourceId' with an ID from listSharedResources for a previously geocoded location. Use 'point' for inline coordinates or 'layerId/where' for features from another layer."),fieldName:e.string().describe("The name of the field for which to get statistics. STRICTLY DO NOT use OBJECTID. Use any other field"),statisticType:e.enum(["avg","max","median","min","stddev","sum","variance","nullcount","count"]).describe("The statistic type to calculate.")}),te=F(Q,{name:"getStatistics",description:`Computes a single aggregate statistic (max, min, avg, sum, median, stddev, variance) for a numeric field across matching features. Also returns frequency analysis for categorical fields.
3
3
 
4
4
  USE THIS TOOL FOR:
5
5
  - "What is the average/maximum/minimum/total [field]?" \u2014 aggregate computations
@@ -0,0 +1,2 @@
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
+ import b from"./TOUYGIGK.js";import a from"./6UGT2UG5.js";import{b as i}from"./LDDP7NSY.js";import{b as t}from"./WHIWOYHN.js";import"./OUMTV5H5.js";import"./C3VLDYS2.js";import"./A4ZVCRVF.js";import"./N2GN5WOI.js";import"./272R36XK.js";import"./5PV2GUZW.js";export default $arcgis.t(([r,{b:a}])=>{var p=async(o={})=>{let{tier:e="default",config:m}=o,n=t[e],c=await a(e);return new i({modelName:n,apiKey:"dummy-key",configuration:{baseURL:c,fetch:await r({config:m})},batchSize:2048,maxConcurrency:10})};return p},a,b)
@@ -1,2 +1,2 @@
1
- /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{a as c}from"./ONQ6JSBJ.js";import{a}from"./RFPTOFM4.js";import{Ga as d}from"./FSLPYC4Y.js";export default $arcgis.t(([i,u,w,{addressToLocations:S},v])=>{async function y(e,s){let r=w.getDefault().helperServices,n=r.geocode.find(g=>g.name==="ArcGIS World Geocoding Service")??r.geocode[0];if(!n)throw new Error("No geocoding service found in helperServices.");let l=n.url,m=`${i.assetsPath?.endsWith("/")?i.assetsPath:`${i.assetsPath}/`}esri/images/search/search-symbol-32.png`,o=(await S(l,{address:{SingleLine:e},outFields:["Match_addr"]}))?.[0];if(!o?.extent||!o.location)throw new Error(`Could not find location for: ${e}`);let h=new v({url:m,width:24,height:24}),p=new u({geometry:o.location,symbol:h});s.graphics.removeAll(),s.graphics.add(p),await s.goTo(o.extent);let t={address:o.address??e,location:o.location.toJSON(),extent:o.extent.toJSON()},f={value:t,sharedStatePatch:{lastResolvedLocation:{value:t}},sharedResourceAdditions:[{kind:"point",description:t.address,payload:t.location}]};return[`Successfully zoomed to ${t.address}.`,f]}async function T({address:e},s){let{mapView:r}=c(s,["mapView"]);return await y(e,r)}var A=a.object({address:a.string().describe("The full address or place name to locate.")}),W=d(T,{name:"goToAddress",description:"Geocodes an address using Esri's World Geocoding Service and zooms the map to that location.",schema:A,responseFormat:"content_and_artifact"});return W},"config","Graphic","portal/Portal","rest/locator","symbols/PictureMarkerSymbol")
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
+ import{a as c}from"./QBZP6XOE.js";import{a}from"./GS5JDPZH.js";import{Ga as d}from"./A4ZVCRVF.js";export default $arcgis.t(([i,u,w,{addressToLocations:S},v])=>{async function y(e,s){let r=w.getDefault().helperServices,n=r.geocode.find(g=>g.name==="ArcGIS World Geocoding Service")??r.geocode[0];if(!n)throw new Error("No geocoding service found in helperServices.");let l=n.url,m=`${i.assetsPath?.endsWith("/")?i.assetsPath:`${i.assetsPath}/`}esri/images/search/search-symbol-32.png`,o=(await S(l,{address:{SingleLine:e},outFields:["Match_addr"]}))?.[0];if(!o?.extent||!o.location)throw new Error(`Could not find location for: ${e}`);let h=new v({url:m,width:24,height:24}),p=new u({geometry:o.location,symbol:h});s.graphics.removeAll(),s.graphics.add(p),await s.goTo(o.extent);let t={address:o.address??e,location:o.location.toJSON(),extent:o.extent.toJSON()},f={value:t,sharedStatePatch:{lastResolvedLocation:{value:t}},sharedResourceAdditions:[{kind:"point",description:t.address,payload:t.location}]};return[`Successfully zoomed to ${t.address}.`,f]}async function T({address:e},s){let{mapView:r}=c(s,["mapView"]);return await y(e,r)}var A=a.object({address:a.string().describe("The full address or place name to locate.")}),W=d(T,{name:"goToAddress",description:"Geocodes an address using Esri's World Geocoding Service and zooms the map to that location.",schema:A,responseFormat:"content_and_artifact"});return W},"config","Graphic","portal/Portal","rest/locator","symbols/PictureMarkerSymbol")
@@ -0,0 +1,2 @@
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
+ import a from"./6UGT2UG5.js";import"./OUMTV5H5.js";import"./5PV2GUZW.js";export default $arcgis.t(([a])=>{return a},a)
@@ -1,5 +1,5 @@
1
- /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import"./UZLQALHY.js";var e=`---
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
+ import"./5PV2GUZW.js";var e=`---
3
3
  name: help
4
4
  description: Answers questions about the current map, its layers and fields, available assistant capabilities, unsupported map actions, and unrelated requests that need a map-focused redirect.
5
5
  allowed-tools: listLayerFields
@@ -1,5 +1,5 @@
1
- /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{a as P}from"./XQ3NBBQ3.js";import l from"./BBB5EJUB.js";import{a as I,c as v}from"./GMZUN5SF.js";import"./KY7M4WHO.js";import k from"./UOKYHQNO.js";import j from"./YI6NIHNI.js";import i from"./L5IPMRHC.js";import g from"./UQRBY7ID.js";import f from"./FX4LV2S3.js";import"./34O57OGV.js";import"./XEJFVUNQ.js";import e from"./XC3T3Z5R.js";import"./KX6CZEVZ.js";import"./PGH7POKS.js";import d from"./NPV4MEAZ.js";import"./AQF6BBWC.js";import"./ZSLHB6MF.js";import"./TJBU5BQK.js";import c from"./C67KQCPS.js";import"./OVIQ5NSE.js";import"./QUZTFUWM.js";import"./OGZFST2A.js";import"./X5ET73QZ.js";import b from"./MPQ2OZXN.js";import a from"./JZPPP4QY.js";import"./ONQ6JSBJ.js";import"./2DWN3SKH.js";import{a as m}from"./FDOMMK2M.js";import"./DYSPEU7W.js";import{c as M}from"./66VWTARH.js";import"./24TK55FP.js";import"./FJV7CI7O.js";import"./WSIZ2OTL.js";import{C as x,x as S}from"./RE7MJTEF.js";import"./R74ZHFA6.js";import"./DJG6DBCU.js";import"./C76HLPKU.js";import"./RFPTOFM4.js";import{a as s}from"./CADNOKIK.js";import"./BMPBJXD7.js";import"./CDS2HGQY.js";import{Ea as L,a as w,b as h,s as E}from"./QEGO4B2W.js";import"./EEHDAYOG.js";import"./XWNZMKQF.js";import"./FSLPYC4Y.js";import"./AMP43OT2.js";import"./2UKFCF2J.js";import"./UZLQALHY.js";export default $arcgis.t(([,,,,,,,,,,,,,,{a:F,c:$,d:C,e:N,f:T,g:A,h:b,i:R,j:_,k:k,l:q,m:V,n:u,o:j}])=>{var z=async(t,r)=>{let e=t.tool_calls??[];if(e.length===0){await s({text:`LLM did not request any tool calls: ${String(t?.content)}`},r);return}await Promise.all(e.map(async a=>await s({text:`LLM invoked ${a.name} tool with arguments: ${JSON.stringify(a.args,null,2)}`},r)))};var D=.7,B=10,J=async(t,r)=>{try{await s({text:"Similarity search to find fields"},r);let e=m(r,"fieldSearch"),a=m(r,"layersAndFieldsRegistry"),i=m(r,"embeddingCache"),o=await e.searchFields({text:t.agentExecutionContext.assignedTask,layerIds:t.vectorSearchLayerIds,minScore:D,topResults:B,embeddingCache:i}),p=o.map(({layerId:c,results:d})=>{let g=d.map(n=>` - ${n.name} (${n.score.toFixed(2)})`).join(`
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
+ import{a as P}from"./TIQUULA4.js";import l from"./L5OYOLWV.js";import{a as I,c as v}from"./NYFL2F5L.js";import"./YD5LVM7V.js";import k from"./AOT3PM2Q.js";import j from"./YGSDJ4V3.js";import i from"./M52LKZN7.js";import g from"./UXDRYDOD.js";import f from"./2H32MDP2.js";import"./OPQCY33W.js";import"./QAVDW7A7.js";import e from"./YSEHJQ4L.js";import"./7XVIZ7HK.js";import"./OKDXM5D4.js";import d from"./UP7RW5K2.js";import"./M5UMOOL2.js";import"./H6J65TWL.js";import"./XBWGOD6I.js";import c from"./J3T5HB77.js";import"./AGDGDULE.js";import"./FIZMK7GS.js";import"./LMAIOLS2.js";import"./7OQK2F7O.js";import b from"./Y3ZKMD47.js";import a from"./BMVPOFHU.js";import"./QBZP6XOE.js";import"./3COVQI26.js";import{a as m}from"./CETIZ4IQ.js";import"./PR4VMSKD.js";import{c as M}from"./X3YFCWQZ.js";import"./2JD3G7IW.js";import"./LDDP7NSY.js";import"./WHIWOYHN.js";import{C as x,x as S}from"./NAVK5JJ2.js";import"./OUMTV5H5.js";import"./Q7BJGEFH.js";import"./V66TS2BB.js";import"./GS5JDPZH.js";import{a as s}from"./2WY5MPMY.js";import"./S6OUM5X2.js";import"./XLHYQNAM.js";import{Ea as L,a as w,b as h,s as E}from"./7GDMXAF5.js";import"./5XZ5VL42.js";import"./C3VLDYS2.js";import"./A4ZVCRVF.js";import"./N2GN5WOI.js";import"./272R36XK.js";import"./5PV2GUZW.js";export default $arcgis.t(([,,,,,,,,,,,,,,{a:F,c:$,d:C,e:N,f:T,g:A,h:b,i:R,j:_,k:k,l:q,m:V,n:u,o:j}])=>{var z=async(t,r)=>{let e=t.tool_calls??[];if(e.length===0){await s({text:`LLM did not request any tool calls: ${String(t?.content)}`},r);return}await Promise.all(e.map(async a=>await s({text:`LLM invoked ${a.name} tool with arguments: ${JSON.stringify(a.args,null,2)}`},r)))};var D=.7,B=10,J=async(t,r)=>{try{await s({text:"Similarity search to find fields"},r);let e=m(r,"fieldSearch"),a=m(r,"layersAndFieldsRegistry"),i=m(r,"embeddingCache"),o=await e.searchFields({text:t.agentExecutionContext.assignedTask,layerIds:t.vectorSearchLayerIds,minScore:D,topResults:B,embeddingCache:i}),p=o.map(({layerId:c,results:d})=>{let g=d.map(n=>` - ${n.name} (${n.score.toFixed(2)})`).join(`
3
3
  `);return`${a.get(c)?.layerItem.name??c}:
4
4
  ${g}`}).join(`
5
5
  `),l;return o.length>0?l=`Vector search completed. Matching layers and fields with scores:
@@ -1,2 +1,2 @@
1
- /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{a as w,b as L}from"./A22375P3.js";import{D as O,a as b,b as E,c as u,d as h,e as y,f as x,n as f,o as C,p as P}from"./RE7MJTEF.js";var _=e=>(...n)=>{let t=h(),o=new e(...n),s=o.exports;u(t.at(-1));let r=o.component.manager;r.W(o,s),o.watchExports(r.W.bind(r,o)),y(o);let i=[o.component,...t].reverse();return f(i,a=>a===void 0?void 0:M(o,a,s),s)},M=(e,{host:n,key:t,isReactive:o},s)=>{let r=n,i=r[t]!==e.exports,a=r[t]!==s,p=s!==e.exports;if(i&&!a&&p&&(r[t]=e.exports),n===e.component){if(o){let l=e.component.manager;a&&l.W(e,r[t]),e.onUpdate(m=>{if(m.has(t)){let g=r[t];g!==e.exports&&l.W(e,g)}})}e.O=o?void 0:t}let c=e.component.constructor.elementProperties.get(t)?.readOnly;e.watchExports(()=>{r[t]!==e.exports&&(c?x(()=>{r[t]=e.exports}):r[t]=e.exports)})};var D=e=>R(void 0,e);var v=class extends P{constructor(n,t){super(n);let o=this.exports;try{E(this.component);let s=t(this.component,this),r=this.exports!==o;if(b(s)){r||this.setProvisionalExports(s);let i=s.then(a=>{this.exports=a,super.catchUpLifecycle()}).catch(a=>{this.P.reject(a)});this.onLoad(async()=>await i)}else(!r||s!==void 0)&&(this.exports=s),queueMicrotask(()=>super.catchUpLifecycle())}catch(s){this.P.reject(s)}}catchUpLifecycle(){}},R=_(v);var S=(e,n,t)=>D((o,s)=>{let r=n,i=C({bubbles:!1,composed:!1});return s.onUpdated(a=>{if(!r.some(c=>a.has(c)))return;let p=t(A(e,r,a)),d=t(A(e,r));p.forEach((c,l)=>{d.has(l)||i.emit({...c,data:void 0})}),d.forEach((c,l)=>{let m=p.get(l);(!m||!N(m,c))&&i.emit(c)})}),i});function A(e,n,t){let o={};return n.forEach(s=>{o[s]=t?.has(s)?t.get(s):e[s]}),o}function N(e,n){if(e===n)return!0;if(!e||!n||typeof e!="object"||typeof n!="object"||Array.isArray(e)||Array.isArray(n))return!1;let t=Object.entries(e),o=Object.entries(n);return t.length!==o.length?!1:t.every(([s,r])=>N(r,n[s]))}var V=e=>(n={})=>D((t,o)=>{let s=w(t.el),r={_lang:s.lang,_t9nLocale:s.t9nLocale,_loading:!0},i=t;o.onLifecycle(()=>L(t.el,()=>e("./assets"),({t9nLocale:p,t9nStrings:d,lang:c})=>{let l={...d,_lang:c,_t9nLocale:p,_loading:!1};o.exports=l;let m=d.componentLabel;typeof m=="string"&&"label"in t&&t.label==null&&(t.label??=m),a(i.messageOverrides)},n.name));let a=p=>{let d=o.exports,c=d._original??d,l=j(c,p);p&&(l._original=c),o.exports=l};return"messageOverrides"in i&&o.onUpdate(p=>{p.has("messageOverrides")&&a(i.messageOverrides)}),n.blocking?(o.setProvisionalExports(r,!1),o.ready):r}),j=(e,n)=>{if(!n)return e;let t={...e};return Object.entries(n).forEach(([o,s])=>{e[o]!==void 0&&(typeof s=="object"?t[o]=j(e[o],s):t[o]=s??e[o])}),t};var X=V(O);export{S as a,X as b};
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
+ import{a as w,b as L}from"./SUMXIUIS.js";import{D as O,a as b,b as E,c as u,d as h,e as y,f as x,n as f,o as C,p as P}from"./NAVK5JJ2.js";var _=e=>(...n)=>{let t=h(),o=new e(...n),s=o.exports;u(t.at(-1));let r=o.component.manager;r.W(o,s),o.watchExports(r.W.bind(r,o)),y(o);let i=[o.component,...t].reverse();return f(i,a=>a===void 0?void 0:M(o,a,s),s)},M=(e,{host:n,key:t,isReactive:o},s)=>{let r=n,i=r[t]!==e.exports,a=r[t]!==s,p=s!==e.exports;if(i&&!a&&p&&(r[t]=e.exports),n===e.component){if(o){let l=e.component.manager;a&&l.W(e,r[t]),e.onUpdate(m=>{if(m.has(t)){let g=r[t];g!==e.exports&&l.W(e,g)}})}e.O=o?void 0:t}let c=e.component.constructor.elementProperties.get(t)?.readOnly;e.watchExports(()=>{r[t]!==e.exports&&(c?x(()=>{r[t]=e.exports}):r[t]=e.exports)})};var D=e=>R(void 0,e);var v=class extends P{constructor(n,t){super(n);let o=this.exports;try{E(this.component);let s=t(this.component,this),r=this.exports!==o;if(b(s)){r||this.setProvisionalExports(s);let i=s.then(a=>{this.exports=a,super.catchUpLifecycle()}).catch(a=>{this.P.reject(a)});this.onLoad(async()=>await i)}else(!r||s!==void 0)&&(this.exports=s),queueMicrotask(()=>super.catchUpLifecycle())}catch(s){this.P.reject(s)}}catchUpLifecycle(){}},R=_(v);var S=(e,n,t)=>D((o,s)=>{let r=n,i=C({bubbles:!1,composed:!1});return s.onUpdated(a=>{if(!r.some(c=>a.has(c)))return;let p=t(A(e,r,a)),d=t(A(e,r));p.forEach((c,l)=>{d.has(l)||i.emit({...c,data:void 0})}),d.forEach((c,l)=>{let m=p.get(l);(!m||!N(m,c))&&i.emit(c)})}),i});function A(e,n,t){let o={};return n.forEach(s=>{o[s]=t?.has(s)?t.get(s):e[s]}),o}function N(e,n){if(e===n)return!0;if(!e||!n||typeof e!="object"||typeof n!="object"||Array.isArray(e)||Array.isArray(n))return!1;let t=Object.entries(e),o=Object.entries(n);return t.length!==o.length?!1:t.every(([s,r])=>N(r,n[s]))}var V=e=>(n={})=>D((t,o)=>{let s=w(t.el),r={_lang:s.lang,_t9nLocale:s.t9nLocale,_loading:!0},i=t;o.onLifecycle(()=>L(t.el,()=>e("./assets"),({t9nLocale:p,t9nStrings:d,lang:c})=>{let l={...d,_lang:c,_t9nLocale:p,_loading:!1};o.exports=l;let m=d.componentLabel;typeof m=="string"&&"label"in t&&t.label==null&&(t.label??=m),a(i.messageOverrides)},n.name));let a=p=>{let d=o.exports,c=d._original??d,l=j(c,p);p&&(l._original=c),o.exports=l};return"messageOverrides"in i&&o.onUpdate(p=>{p.has("messageOverrides")&&a(i.messageOverrides)}),n.blocking?(o.setProvisionalExports(r,!1),o.ready):r}),j=(e,n)=>{if(!n)return e;let t={...e};return Object.entries(n).forEach(([o,s])=>{e[o]!==void 0&&(typeof s=="object"?t[o]=j(e[o],s):t[o]=s??e[o])}),t};var X=V(O);export{S as a,X as b};
@@ -0,0 +1,2 @@
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
+ import a from"./UP7RW5K2.js";import"./QBZP6XOE.js";import"./GS5JDPZH.js";import"./A4ZVCRVF.js";import"./N2GN5WOI.js";import"./272R36XK.js";import"./5PV2GUZW.js";export default $arcgis.t(([a])=>{return a},a)
@@ -1,2 +1,2 @@
1
- /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{a}from"../6WYVG3JI.js";import"../5TW2NFES.js";import"../CDS2HGQY.js";import"../QEGO4B2W.js";import"../EEHDAYOG.js";import"../XWNZMKQF.js";import"../FSLPYC4Y.js";import"../AMP43OT2.js";import"../2UKFCF2J.js";import"../UZLQALHY.js";export{a as BaseAgent};
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
+ import{a}from"../HU527DML.js";import"../WEBAQIUT.js";import"../XLHYQNAM.js";import"../7GDMXAF5.js";import"../5XZ5VL42.js";import"../C3VLDYS2.js";import"../A4ZVCRVF.js";import"../N2GN5WOI.js";import"../272R36XK.js";import"../5PV2GUZW.js";export{a as BaseAgent};
@@ -1,2 +1,2 @@
1
- /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{a as i,b as h,c as m}from"../VIJVRJHL.js";import{a as u}from"../GHFOAS7T.js";import{a as c}from"../6WYVG3JI.js";import{d as o}from"../5TW2NFES.js";import"../CDS2HGQY.js";import{y as n}from"../QEGO4B2W.js";import"../EEHDAYOG.js";import"../XWNZMKQF.js";import"../FSLPYC4Y.js";import"../AMP43OT2.js";import"../2UKFCF2J.js";import"../UZLQALHY.js";var d=class extends c{constructor(t){super(),this.middlewares=[],Object.assign(this,t),this.generate()}generate(){let t=o([this.inputSchema,this.outputSchema].filter(Boolean)),e=`${this.id}-execute`,r={[e]:this._invokeExecuteNode.bind(this)},s=[{from:e,decide:()=>{}}];this.workspace=t,this.createGraph=()=>u(r,s,t,{agent:this,entryNode:e,middlewares:this.middlewares})}async _invokeExecuteNode(t,e){try{return this.outputSchema?await this._invokeStructured(t,e):await this._invokeUnstructured(t,e)}catch(r){if(n(r)||e?.signal?.aborted||r instanceof Error&&r.name==="AbortError")throw r;let s=r instanceof Error?r.message:String(r);return i({outputMessage:s},"failed",s)}}async _invokeStructured(t,e){if(!this.outputSchema)throw new Error("Output schema is required for structured invocation.");let r=this._validateInputState(t),s=await this.execute(r,e);if(typeof s=="string")throw new Error("Expected execute function to return an object matching the output schema, but received a string.");return h(s,this.outputSchema,t.agentExecutionContext.messages)}async _invokeUnstructured(t,e){let r=this._validateInputState(t),s=await this.execute(r,e),a=typeof s=="string"?s:JSON.stringify(s),p=a.trim()||"FunctionAgent completed.";return i({outputMessage:a},"success",p)}_validateInputState(t){if(!this.inputSchema)return t;let e=this.inputSchema.safeParse(m(t,this.inputSchema));if(!e.success)throw new Error(`FunctionAgent input schema validation failed: ${e.error.message}`);return{...t,...e.data}}};export{d as FunctionAgent};
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
+ import{a as i,b as h,c as m}from"../3UVQLYUK.js";import{a as u}from"../I724KIFI.js";import{a as c}from"../HU527DML.js";import{d as o}from"../WEBAQIUT.js";import"../XLHYQNAM.js";import{y as n}from"../7GDMXAF5.js";import"../5XZ5VL42.js";import"../C3VLDYS2.js";import"../A4ZVCRVF.js";import"../N2GN5WOI.js";import"../272R36XK.js";import"../5PV2GUZW.js";var d=class extends c{constructor(t){super(),this.middlewares=[],Object.assign(this,t),this.generate()}generate(){let t=o([this.inputSchema,this.outputSchema].filter(Boolean)),e=`${this.id}-execute`,r={[e]:this._invokeExecuteNode.bind(this)},s=[{from:e,decide:()=>{}}];this.workspace=t,this.createGraph=()=>u(r,s,t,{agent:this,entryNode:e,middlewares:this.middlewares})}async _invokeExecuteNode(t,e){try{return this.outputSchema?await this._invokeStructured(t,e):await this._invokeUnstructured(t,e)}catch(r){if(n(r)||e?.signal?.aborted||r instanceof Error&&r.name==="AbortError")throw r;let s=r instanceof Error?r.message:String(r);return i({outputMessage:s},"failed",s)}}async _invokeStructured(t,e){if(!this.outputSchema)throw new Error("Output schema is required for structured invocation.");let r=this._validateInputState(t),s=await this.execute(r,e);if(typeof s=="string")throw new Error("Expected execute function to return an object matching the output schema, but received a string.");return h(s,this.outputSchema,t.agentExecutionContext.messages)}async _invokeUnstructured(t,e){let r=this._validateInputState(t),s=await this.execute(r,e),a=typeof s=="string"?s:JSON.stringify(s),p=a.trim()||"FunctionAgent completed.";return i({outputMessage:a},"success",p)}_validateInputState(t){if(!this.inputSchema)return t;let e=this.inputSchema.safeParse(m(t,this.inputSchema));if(!e.success)throw new Error(`FunctionAgent input schema validation failed: ${e.error.message}`);return{...t,...e.data}}};export{d as FunctionAgent};
@@ -1,2 +1,2 @@
1
- /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{a}from"../2O52MJ3D.js";import"../DI3VGUJY.js";import"../VIJVRJHL.js";import"../BMPBJXD7.js";import"../GHFOAS7T.js";import"../6WYVG3JI.js";import"../5TW2NFES.js";import"../CDS2HGQY.js";import"../QEGO4B2W.js";import"../EEHDAYOG.js";import"../XWNZMKQF.js";import"../FSLPYC4Y.js";import"../AMP43OT2.js";import"../2UKFCF2J.js";import"../UZLQALHY.js";export{a as LLMAgent};
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
+ import{a}from"../D7CRICBG.js";import"../63OF33IL.js";import"../3UVQLYUK.js";import"../S6OUM5X2.js";import"../I724KIFI.js";import"../HU527DML.js";import"../WEBAQIUT.js";import"../XLHYQNAM.js";import"../7GDMXAF5.js";import"../5XZ5VL42.js";import"../C3VLDYS2.js";import"../A4ZVCRVF.js";import"../N2GN5WOI.js";import"../272R36XK.js";import"../5PV2GUZW.js";export{a as LLMAgent};
@@ -1,2 +1,2 @@
1
- /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{a as o}from"../DJG6DBCU.js";import"../C76HLPKU.js";import"../RFPTOFM4.js";import"../CADNOKIK.js";import"../BMPBJXD7.js";import{a as i}from"../6WYVG3JI.js";import"../5TW2NFES.js";import"../CDS2HGQY.js";import"../QEGO4B2W.js";import"../EEHDAYOG.js";import"../XWNZMKQF.js";import"../FSLPYC4Y.js";import"../AMP43OT2.js";import"../2UKFCF2J.js";import"../UZLQALHY.js";var r=class extends i{constructor(t){super(),this.modelTier="default",Object.assign(this,t),this.generate()}generate(){let t=this.toolLoaders?Object.fromEntries(Object.entries(this.toolLoaders).map(([a,n])=>[a,async()=>{let e=await n();return"getTool"in e?e.getTool():e}])):void 0,s=o({id:this.id,name:this.name,description:this.description,systemPrompt:this.systemPrompt,skillLoaders:this.skillLoaders,toolLoaders:t,modelTier:this.modelTier,runtimeContextLoader:this.runtimeContextLoader,instructions:this.instructions});this.createGraph=s.createGraph,this.workspace=s.workspace}};export{r as SkillAgent};
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
+ import{a as o}from"../Q7BJGEFH.js";import"../V66TS2BB.js";import"../GS5JDPZH.js";import"../2WY5MPMY.js";import"../S6OUM5X2.js";import{a as i}from"../HU527DML.js";import"../WEBAQIUT.js";import"../XLHYQNAM.js";import"../7GDMXAF5.js";import"../5XZ5VL42.js";import"../C3VLDYS2.js";import"../A4ZVCRVF.js";import"../N2GN5WOI.js";import"../272R36XK.js";import"../5PV2GUZW.js";var r=class extends i{constructor(t){super(),this.modelTier="default",Object.assign(this,t),this.generate()}generate(){let t=this.toolLoaders?Object.fromEntries(Object.entries(this.toolLoaders).map(([a,n])=>[a,async()=>{let e=await n();return"getTool"in e?e.getTool():e}])):void 0,s=o({id:this.id,name:this.name,description:this.description,systemPrompt:this.systemPrompt,skillLoaders:this.skillLoaders,toolLoaders:t,modelTier:this.modelTier,runtimeContextLoader:this.runtimeContextLoader,instructions:this.instructions});this.createGraph=s.createGraph,this.workspace=s.workspace}};export{r as SkillAgent};
@@ -1,2 +1,2 @@
1
- /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{a as i}from"../GHFOAS7T.js";import{a}from"../6WYVG3JI.js";import"../5TW2NFES.js";import"../CDS2HGQY.js";import"../QEGO4B2W.js";import"../EEHDAYOG.js";import"../XWNZMKQF.js";import"../FSLPYC4Y.js";import"../AMP43OT2.js";import"../2UKFCF2J.js";import"../UZLQALHY.js";var r=class extends a{constructor(e){super(),this.middlewares=[],Object.assign(this,e),this.generate()}generate(){let{workspace:e,createGraph:s}=this.workflow.generate({additionalSchemas:[this.inputSchema,this.outputSchema]});if(this.workspace=e,!this.middlewares.length)this.createGraph=s;else{let t=this.id,h=s().compile(),o={[t]:async(n,d)=>await h.invoke(n,d)},c=[{from:t,decide:()=>{}}];this.createGraph=()=>i(o,c,e,{agent:this,entryNode:t,middlewares:this.middlewares})}}};export{r as WorkflowAgent};
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
+ import{a as i}from"../I724KIFI.js";import{a}from"../HU527DML.js";import"../WEBAQIUT.js";import"../XLHYQNAM.js";import"../7GDMXAF5.js";import"../5XZ5VL42.js";import"../C3VLDYS2.js";import"../A4ZVCRVF.js";import"../N2GN5WOI.js";import"../272R36XK.js";import"../5PV2GUZW.js";var r=class extends a{constructor(e){super(),this.middlewares=[],Object.assign(this,e),this.generate()}generate(){let{workspace:e,createGraph:s}=this.workflow.generate({additionalSchemas:[this.inputSchema,this.outputSchema]});if(this.workspace=e,!this.middlewares.length)this.createGraph=s;else{let t=this.id,h=s().compile(),o={[t]:async(n,d)=>await h.invoke(n,d)},c=[{from:t,decide:()=>{}}];this.createGraph=()=>i(o,c,e,{agent:this,entryNode:t,middlewares:this.middlewares})}}};export{r as WorkflowAgent};
@@ -1,2 +1,2 @@
1
- /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import"../UZLQALHY.js";async function e(t){let{createZodObjectSchema:c}=await import("../2UDDCWNW.js");return c(t)}export{e as createSchema};
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
+ import"../5PV2GUZW.js";async function e(t){let{createZodObjectSchema:c}=await import("../FONIQ7VF.js");return c(t)}export{e as createSchema};
@@ -1,2 +1,2 @@
1
- /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{a,b,c}from"../../7MCFHVEH.js";import"../../DI3VGUJY.js";import"../../BMPBJXD7.js";import"../../QEGO4B2W.js";import"../../EEHDAYOG.js";import"../../XWNZMKQF.js";import"../../FSLPYC4Y.js";import"../../AMP43OT2.js";import"../../2UKFCF2J.js";import"../../UZLQALHY.js";export{a as createHumanInTheLoopMiddleware,b as createHumanInTheLoopToolMiddleware,c as getHumanInTheLoopPayload};
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
+ import{a,b,c}from"../../SRXUC4QB.js";import"../../63OF33IL.js";import"../../S6OUM5X2.js";import"../../7GDMXAF5.js";import"../../5XZ5VL42.js";import"../../C3VLDYS2.js";import"../../A4ZVCRVF.js";import"../../N2GN5WOI.js";import"../../272R36XK.js";import"../../5PV2GUZW.js";export{a as createHumanInTheLoopMiddleware,b as createHumanInTheLoopToolMiddleware,c as getHumanInTheLoopPayload};
@@ -1,2 +1,2 @@
1
- /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{a,b,c}from"../../DI3VGUJY.js";import"../../BMPBJXD7.js";import"../../QEGO4B2W.js";import"../../EEHDAYOG.js";import"../../XWNZMKQF.js";import"../../FSLPYC4Y.js";import"../../AMP43OT2.js";import"../../2UKFCF2J.js";import"../../UZLQALHY.js";export{c as convertToLangChainMiddlewares,a as createAgentMiddleware,b as createToolMiddleware};
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
+ import{a,b,c}from"../../63OF33IL.js";import"../../S6OUM5X2.js";import"../../7GDMXAF5.js";import"../../5XZ5VL42.js";import"../../C3VLDYS2.js";import"../../A4ZVCRVF.js";import"../../N2GN5WOI.js";import"../../272R36XK.js";import"../../5PV2GUZW.js";export{c as convertToLangChainMiddlewares,a as createAgentMiddleware,b as createToolMiddleware};
@@ -1,2 +1,2 @@
1
- /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{a as l,b as c}from"../../DI3VGUJY.js";import{a as o}from"../../CADNOKIK.js";import"../../BMPBJXD7.js";import"../../QEGO4B2W.js";import"../../EEHDAYOG.js";import"../../XWNZMKQF.js";import"../../FSLPYC4Y.js";import"../../AMP43OT2.js";import{V as s,fa as i}from"../../2UKFCF2J.js";import"../../UZLQALHY.js";var m="agent-trace",d="tool-trace";function M(){return l(m,{wrapModelCall:async(t,e)=>{let a=await e(t),r=t.runtime,g=u(a);return await Promise.all(g.map(async n=>await o({text:`LLM requested tool call "${n.name}" with arguments: ${JSON.stringify(n.args,null,2)}`},r))),a}})}function y(){return c(d,{wrapToolCall:async(t,e)=>{let a=await e(t),r=t.config;return await o({text:`Finished executing tool: ${s.isInstance(a)?a.text:typeof a=="string"?a:t.tool.name}`},r),a}})}function u(t){return!i.isInstance(t)||!Array.isArray(t.tool_calls)?[]:t.tool_calls.filter(e=>typeof e?.name=="string")}export{M as createAgentTraceMiddleware,y as createToolTraceMiddleware};
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
+ import{a as l,b as c}from"../../63OF33IL.js";import{a as o}from"../../2WY5MPMY.js";import"../../S6OUM5X2.js";import"../../7GDMXAF5.js";import"../../5XZ5VL42.js";import"../../C3VLDYS2.js";import"../../A4ZVCRVF.js";import"../../N2GN5WOI.js";import{V as s,fa as i}from"../../272R36XK.js";import"../../5PV2GUZW.js";var m="agent-trace",d="tool-trace";function M(){return l(m,{wrapModelCall:async(t,e)=>{let a=await e(t),r=t.runtime,g=u(a);return await Promise.all(g.map(async n=>await o({text:`LLM requested tool call "${n.name}" with arguments: ${JSON.stringify(n.args,null,2)}`},r))),a}})}function y(){return c(d,{wrapToolCall:async(t,e)=>{let a=await e(t),r=t.config;return await o({text:`Finished executing tool: ${s.isInstance(a)?a.text:typeof a=="string"?a:t.tool.name}`},r),a}})}function u(t){return!i.isInstance(t)||!Array.isArray(t.tool_calls)?[]:t.tool_calls.filter(e=>typeof e?.name=="string")}export{M as createAgentTraceMiddleware,y as createToolTraceMiddleware};
@@ -1,2 +1,2 @@
1
- /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{Ga as a}from"../../FSLPYC4Y.js";import"../../AMP43OT2.js";import"../../2UKFCF2J.js";import"../../UZLQALHY.js";var r=class{constructor(t){this.resultMode="continue",this.responseFormat="content",this.middlewares=[],Object.assign(this,t)}getTool(){return a(this._executeWithMiddlewares.bind(this),{name:this.name,description:this.description,returnDirect:this.resultMode==="terminal",schema:this.inputSchema,responseFormat:this.responseFormat==="content-and-artifact"?"content_and_artifact":"content"})}async _executeWithMiddlewares(t,e){let c=async i=>{let n=await this.execute(i.input,i.config);return this._validateOutput(n)},s=await this.middlewares.reduceRight((i,n)=>async u=>await n.handler(u,i),c)({config:e,input:t,tool:this,toolCallId:d(e)});return this.responseFormat==="content-and-artifact"&&typeof s=="string"?[s,void 0]:s}_validateOutput(t){if(!this.outputSchema)return t;let e=this.outputSchema.safeParse(t);if(!e.success)throw new Error(`FunctionTool output schema validation failed: ${e.error.message}`);return e.data}};function d(o){let t=o?.toolCall;return typeof t?.id=="string"?t.id:void 0}export{r as FunctionTool};
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
+ import{Ga as a}from"../../A4ZVCRVF.js";import"../../N2GN5WOI.js";import"../../272R36XK.js";import"../../5PV2GUZW.js";var r=class{constructor(t){this.resultMode="continue",this.responseFormat="content",this.middlewares=[],Object.assign(this,t)}getTool(){return a(this._executeWithMiddlewares.bind(this),{name:this.name,description:this.description,returnDirect:this.resultMode==="terminal",schema:this.inputSchema,responseFormat:this.responseFormat==="content-and-artifact"?"content_and_artifact":"content"})}async _executeWithMiddlewares(t,e){let c=async i=>{let n=await this.execute(i.input,i.config);return this._validateOutput(n)},s=await this.middlewares.reduceRight((i,n)=>async u=>await n.handler(u,i),c)({config:e,input:t,tool:this,toolCallId:d(e)});return this.responseFormat==="content-and-artifact"&&typeof s=="string"?[s,void 0]:s}_validateOutput(t){if(!this.outputSchema)return t;let e=this.outputSchema.safeParse(t);if(!e.success)throw new Error(`FunctionTool output schema validation failed: ${e.error.message}`);return e.data}};function d(o){let t=o?.toolCall;return typeof t?.id=="string"?t.id:void 0}export{r as FunctionTool};