@arcgis/ai-components 5.2.0-next.8 → 5.2.0-next.85
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE.md +4 -2
- package/README.md +2 -2
- package/dist/agent-utils/FunctionAgent.d.ts +2 -2
- package/dist/agent-utils/LLMAgent.d.ts +7 -4
- package/dist/agent-utils/LLMAgent.js +3 -2
- package/dist/agent-utils/WorkflowAgent.d.ts +2 -2
- package/dist/agent-utils/index.d.ts +177 -0
- package/dist/agent-utils/index.js +167 -0
- package/dist/agent-utils/middlewares/trace.d.ts +2 -0
- package/dist/agent-utils/middlewares/trace.js +25 -33
- package/dist/agent-utils/tools/FunctionTool.d.ts +2 -2
- package/dist/agent-utils/types.d.ts +37 -8
- package/dist/agent-utils/workflows/ConditionalWorkflow.d.ts +2 -2
- package/dist/agent-utils/workflows/LoopWorkflow.d.ts +2 -2
- package/dist/agent-utils/workflows/ParallelWorkflow.d.ts +2 -2
- package/dist/agent-utils/workflows/RouterWorkflow.d.ts +2 -2
- package/dist/agent-utils/workflows/SequentialWorkflow.d.ts +2 -2
- package/dist/agent-utils/workflows/SwitchWorkflow.d.ts +2 -2
- package/dist/agentic-workflow/AgenticWorkflowRuntime.d.ts +24 -0
- package/dist/agentic-workflow/Edge.d.ts +16 -0
- package/dist/agentic-workflow/WebAgent.d.ts +39 -0
- package/dist/agentic-workflow/jsonTypes.d.ts +183 -0
- package/dist/agentic-workflow/nodes/AgentNode.d.ts +27 -0
- package/dist/agentic-workflow/nodes/BaseNode.d.ts +35 -0
- package/dist/agentic-workflow/nodes/EndMessageNode.d.ts +25 -0
- package/dist/agentic-workflow/nodes/StartNode.d.ts +21 -0
- package/dist/agentic-workflow/nodes/tools/ArcgisTool.d.ts +21 -0
- package/dist/agentic-workflow/types.d.ts +29 -0
- package/dist/agents/tools/filter/clearFilters/adapter.d.ts +8 -0
- package/dist/agents/tools/filter/clearFilters/adapter.js +22 -0
- package/dist/agents/tools/filter/resetMap/adapter.d.ts +8 -0
- package/dist/agents/tools/filter/resetMap/adapter.js +22 -0
- package/dist/agents/tools/filter/setFeatureEffect/adapter.d.ts +8 -0
- package/dist/agents/tools/filter/setFeatureEffect/adapter.js +109 -0
- package/dist/agents/tools/help/listFields/adapter.d.ts +11 -0
- package/dist/agents/tools/help/listFields/adapter.js +30 -0
- package/dist/agents/tools/navigation/goToAddress/adapter.d.ts +10 -0
- package/dist/agents/tools/navigation/goToAddress/adapter.js +52 -0
- package/dist/agents/tools/navigation/goToBookmark/adapter.d.ts +8 -0
- package/dist/agents/tools/navigation/goToBookmark/adapter.js +30 -0
- package/dist/agents/tools/navigation/goToFeatures/adapter.d.ts +8 -0
- package/dist/agents/tools/navigation/goToFeatures/adapter.js +50 -0
- package/dist/agents/tools/navigation/goToFullExtent/adapter.d.ts +8 -0
- package/dist/agents/tools/navigation/goToFullExtent/adapter.js +27 -0
- package/dist/agents/tools/navigation/goToHomeExtent/adapter.d.ts +8 -0
- package/dist/agents/tools/navigation/goToHomeExtent/adapter.js +24 -0
- package/dist/agents/tools/navigation/goToLayer/adapter.d.ts +8 -0
- package/dist/agents/tools/navigation/goToLayer/adapter.js +26 -0
- package/dist/agents/tools/navigation/goToScale/adapter.d.ts +8 -0
- package/dist/agents/tools/navigation/goToScale/adapter.js +21 -0
- package/dist/agents/tools/navigation/goToViewpoint/adapter.d.ts +8 -0
- package/dist/agents/tools/navigation/goToViewpoint/adapter.js +42 -0
- package/dist/agents/tools/navigation/goToZoom/adapter.d.ts +8 -0
- package/dist/agents/tools/navigation/goToZoom/adapter.js +21 -0
- package/dist/agents/tools/query/getAttribute/adapter.d.ts +8 -0
- package/dist/agents/tools/query/getAttribute/adapter.js +40 -0
- package/dist/agents/tools/query/getStatistics/adapter.d.ts +8 -0
- package/dist/agents/tools/query/getStatistics/adapter.js +154 -0
- package/dist/agents/tools/query/getTopFeatures/adapter.d.ts +8 -0
- package/dist/agents/tools/query/getTopFeatures/adapter.js +141 -0
- package/dist/agents/tools/query/queryFeatures/adapter.d.ts +8 -0
- package/dist/agents/tools/query/queryFeatures/adapter.js +127 -0
- package/dist/agents/tools/search/findRelevantFields/adapter.d.ts +8 -0
- package/dist/agents/tools/search/findRelevantFields/adapter.js +57 -0
- package/dist/agents/tools/search/findRelevantLayers/adapter.d.ts +8 -0
- package/dist/agents/tools/search/findRelevantLayers/adapter.js +38 -0
- package/dist/cdn/2EY3BQQX.js +2 -0
- package/dist/cdn/34O57OGV.js +2 -0
- package/dist/cdn/3POGAH2X.js +2 -0
- package/dist/cdn/3SEKXQVK.js +9 -0
- package/dist/cdn/{AMP6IALT.js → 3UEKINYC.js} +1 -1
- package/dist/cdn/434TAA3J.js +2 -0
- package/dist/cdn/4HDDRBIY.js +2 -0
- package/dist/cdn/4NJ2FF7H.js +2 -0
- package/dist/cdn/4OGR5QKS.js +2 -0
- package/dist/cdn/4QGVOLW6.js +22 -0
- package/dist/cdn/4WIDLQUH.js +2 -0
- package/dist/cdn/5WYRJMBW.js +2 -0
- package/dist/cdn/5X7EG7D2.js +2 -0
- package/dist/cdn/5ZFUGNRN.js +2 -0
- package/dist/cdn/6HF36IKA.js +2 -0
- package/dist/cdn/6KFMRBAA.js +2 -0
- package/dist/cdn/6NHYXISD.js +2 -0
- package/dist/cdn/6U4GTCLJ.js +66 -0
- package/dist/cdn/7BCQMK6D.js +2 -0
- package/dist/cdn/7GMCLVSZ.js +2 -0
- package/dist/cdn/7M6VKBTK.js +6 -0
- package/dist/cdn/{GGSZM7KV.js → 7Q5EESAR.js} +6 -4
- package/dist/cdn/7SRLZQVC.js +5 -0
- package/dist/cdn/7TXR75RG.js +2 -0
- package/dist/cdn/7V6OSTFC.js +2 -0
- package/dist/cdn/7VAQUCBU.js +9 -0
- package/dist/cdn/7ZFAFKJT.js +2 -0
- package/dist/cdn/ACJTJLZN.js +2 -0
- package/dist/cdn/AI6DYOKR.js +181 -0
- package/dist/cdn/{ZS2TZ6BF.js → AOVJ34QE.js} +1 -1
- package/dist/cdn/APFZY4PI.js +2 -0
- package/dist/cdn/AT4XVTJR.js +44 -0
- package/dist/cdn/AZ5G7YZH.js +3 -0
- package/dist/cdn/{FL4W4VYN.js → BL273EGZ.js} +17 -1
- package/dist/cdn/BM3WFHJG.js +2 -0
- package/dist/cdn/{DHOVCT6R.js → BPCBE7J6.js} +1 -1
- package/dist/cdn/CCC6LBMY.js +2 -0
- package/dist/cdn/{5ZZGKP7N.js → CEKOEHB3.js} +1 -1
- package/dist/cdn/CJMUJXPL.js +2 -0
- package/dist/cdn/CP5BVGJU.js +2 -0
- package/dist/cdn/CZM4URK7.js +2 -0
- package/dist/cdn/DPALM2OW.js +2 -0
- package/dist/cdn/E7JZ7GUW.js +18 -0
- package/dist/cdn/EMLOVMD4.js +2 -0
- package/dist/cdn/EWLXNGKH.js +208 -0
- package/dist/cdn/F2J6BMMX.js +36 -0
- package/dist/cdn/FAR3DFFK.js +2 -0
- package/dist/cdn/FDOMMK2M.js +2 -0
- package/dist/cdn/{ZLXN7NMF.js → FYZATVB3.js} +10 -8
- package/dist/cdn/GFEOVHJK.js +2 -0
- package/dist/cdn/HDM2D2GD.js +2 -0
- package/dist/cdn/HHFNQR6Z.js +2 -0
- package/dist/cdn/HMUWQCXU.js +2 -0
- package/dist/cdn/I3ONG4AX.js +2 -0
- package/dist/cdn/IBZ2NEAO.js +2 -0
- package/dist/cdn/{FX7UOGHP.js → ICBIUFK7.js} +1 -1
- package/dist/cdn/IFJM5XEQ.js +2 -0
- package/dist/cdn/IHP25JWI.js +99 -0
- package/dist/cdn/J6A4AS7E.js +22 -0
- package/dist/cdn/J6SZIQJA.js +2 -0
- package/dist/cdn/{NE7E52YR.js → JEBRN3EU.js} +9 -3
- package/dist/cdn/JKIESH74.js +2 -0
- package/dist/cdn/JO5ETMPS.js +2 -0
- package/dist/cdn/JWIE3YK3.js +2 -0
- package/dist/cdn/K2R6XVK3.js +2 -0
- package/dist/cdn/KITIP6J2.js +2 -0
- package/dist/cdn/KPO4XX6J.js +2 -0
- package/dist/cdn/KWD2ECTM.js +2 -0
- package/dist/cdn/L7XTRDFM.js +3 -0
- package/dist/cdn/{7RCQFLPP.js → LK7ZIQW6.js} +1 -1
- package/dist/cdn/LLUGJKAQ.js +2 -0
- package/dist/cdn/LMPNXXTQ.js +2 -0
- package/dist/cdn/LYKCYBGB.js +2 -0
- package/dist/cdn/{3PKJWIC3.js → M2L5R4LA.js} +1 -1
- package/dist/cdn/{V2P4AIGG.js → M4URMXDS.js} +1 -1
- package/dist/cdn/MDAKBX7N.js +2 -0
- package/dist/cdn/MWYBF3F3.js +66 -0
- package/dist/cdn/NEV6OZN3.js +71 -0
- package/dist/cdn/NQDOAPE3.js +2 -0
- package/dist/cdn/OAKRPM7D.js +2 -0
- package/dist/cdn/{23EQTPO3.js → OKVLGJAG.js} +1 -1
- package/dist/cdn/ONMNQBPO.js +2 -0
- package/dist/cdn/ONQ6JSBJ.js +2 -0
- package/dist/cdn/OWTGH34K.js +2 -0
- package/dist/cdn/{LQ6R5YRN.js → PQ2DPOFM.js} +1 -1
- package/dist/cdn/PSYRZMX2.js +2 -0
- package/dist/cdn/PUHRBGKB.js +2 -0
- package/dist/cdn/Q57QWN5W.js +2 -0
- package/dist/cdn/QNNGPA3Q.js +2 -0
- package/dist/cdn/R74ZHFA6.js +2 -0
- package/dist/cdn/RBE55SWR.js +2 -0
- package/dist/cdn/RHYNE5OE.js +2 -0
- package/dist/cdn/RLEHNAIA.js +2 -0
- package/dist/cdn/RV55GABG.js +2 -0
- package/dist/cdn/RWWOOC7S.js +2 -0
- package/dist/cdn/{X2ZDYHCG.js → SDWWUWAF.js} +10 -5
- package/dist/cdn/T4RIGOXB.js +2 -0
- package/dist/cdn/TACBKKBI.js +2 -0
- package/dist/cdn/TMJMDCSA.js +4 -0
- package/dist/cdn/TPULIO6I.js +34 -0
- package/dist/cdn/U2D53TAX.js +14 -0
- package/dist/cdn/UEEH5ZQK.js +156 -0
- package/dist/cdn/{6YMR4QSD.js → UHEYPSOR.js} +1 -1
- package/dist/cdn/UHZG7SKO.js +2 -0
- package/dist/cdn/UZLQALHY.js +2 -0
- package/dist/cdn/V52XWEGV.js +11 -0
- package/dist/cdn/V6HOUZPZ.js +2 -0
- package/dist/cdn/VAXH6RUQ.js +134 -0
- package/dist/cdn/VLLZ2FFU.js +2 -0
- package/dist/cdn/VNJMTA6O.js +2 -0
- package/dist/cdn/VOKXKU7M.js +56 -0
- package/dist/cdn/VXFQANGJ.js +2 -0
- package/dist/cdn/W5G35GO4.js +2 -0
- package/dist/cdn/WKTQVBFJ.js +2 -0
- package/dist/cdn/WLH47YFC.js +14 -0
- package/dist/cdn/WP7ORLSB.js +6 -0
- package/dist/cdn/Y7XD7ZRD.js +2 -0
- package/dist/cdn/YEZ3AMNX.js +2 -0
- package/dist/cdn/YLVJA4ZE.js +2 -0
- package/dist/cdn/Z5W4V7RC.js +2 -0
- package/dist/cdn/ZLWWWTH4.js +2 -0
- package/dist/cdn/ZOEMBHRF.js +2 -0
- package/dist/cdn/ZQMBJ6MI.js +2 -0
- package/dist/cdn/ZRESBCJL.js +2 -0
- package/dist/cdn/{ZTBA5PM7.js → ZU2FHVNK.js} +1 -1
- package/dist/cdn/ZUNLFO6M.js +3 -0
- package/dist/cdn/agent-utils/index.js +2 -0
- package/dist/cdn/agent-utils/middlewares/humanInTheLoop.js +3 -0
- package/dist/cdn/agent-utils/middlewares/middleware.js +2 -0
- package/dist/cdn/agent-utils/middlewares/trace.js +2 -0
- package/dist/cdn/assets/assistant/t9n/messages.en.json +1 -1
- package/dist/cdn/assets/assistant-interrupt/t9n/messages.en.json +1 -1
- package/dist/cdn/assets/assistant-interrupt-preview/t9n/messages.en.json +1 -0
- package/dist/cdn/assets/assistant-message/t9n/messages.en.json +1 -0
- package/dist/cdn/assets/assistant-message-loading/t9n/messages.en.json +1 -0
- package/dist/cdn/index.js +1 -1
- package/dist/chunks/adapter.js +1294 -2112
- package/dist/chunks/arcgisKnowledgeGraph.js +127 -72
- package/dist/chunks/arcgis_knowledge_current_lc_context.js +19 -2
- package/dist/chunks/arcgis_knowledge_current_map_context.js +31 -2
- package/dist/chunks/arcgis_knowledge_cypher_query_prompt.js +102 -0
- package/dist/chunks/arcgis_knowledge_summarize_result_prompt.js +116 -27
- package/dist/chunks/baseAgentState.js +56 -0
- package/dist/chunks/converterUtils.js +66 -41
- package/dist/chunks/dataExplorationGraph.js +132 -177
- package/dist/chunks/data_explore_query_prompt.js +9 -4
- package/dist/chunks/fetchAgentContext.js +13 -0
- package/dist/chunks/fetchService.js +10 -0
- package/dist/chunks/fieldStatistics.js +79 -0
- package/dist/chunks/formatFeatureAttributes.js +132 -0
- package/dist/chunks/generateLayerDescriptions.js +259 -282
- package/dist/chunks/helpGraph.js +34 -25
- package/dist/chunks/help_prompt.js +34 -17
- package/dist/chunks/index.js +11 -0
- package/dist/chunks/intent_prompt.js +16 -0
- package/dist/chunks/layerStylingGraph.js +36 -31
- package/dist/chunks/mergeWhereClauses.js +15 -0
- package/dist/chunks/navigationGraph.js +123 -103
- package/dist/chunks/navigation_intent_prompt.js +8 -2
- package/dist/chunks/orchestrator.js +205 -175
- package/dist/chunks/slottableRequestUtils.js +3 -7
- package/dist/chunks/state.js +21 -27
- package/dist/chunks/summarize_query_response_prompt.js +9 -7
- package/dist/chunks/toolCallResponse.js +13 -10
- package/dist/chunks/types.js +59 -0
- package/dist/chunks/utils2.js +11 -11
- package/dist/components/arcgis-assistant/customElement.d.ts +56 -0
- package/dist/components/arcgis-assistant/customElement.js +387 -155
- package/dist/components/arcgis-assistant/index.js +2 -3
- package/dist/components/arcgis-assistant/types.d.ts +14 -1
- package/dist/components/arcgis-assistant-agent/customElement.d.ts +13 -1
- package/dist/components/arcgis-assistant-agent/customElement.js +608 -10
- package/dist/components/arcgis-assistant-chat/customElement.d.ts +2 -1
- package/dist/components/arcgis-assistant-chat/customElement.js +23 -18
- package/dist/components/arcgis-assistant-chat-entry/customElement.d.ts +2 -0
- package/dist/components/arcgis-assistant-chat-entry/customElement.js +25 -18
- package/dist/components/arcgis-assistant-data-exploration-agent/customElement.js +19 -3
- package/dist/components/arcgis-assistant-help-agent/customElement.js +28 -6
- package/dist/components/arcgis-assistant-interrupt/customElement.d.ts +4 -0
- package/dist/components/arcgis-assistant-interrupt/customElement.js +17 -14
- package/dist/components/arcgis-assistant-interrupt-preview/customElement.js +24 -0
- package/dist/components/arcgis-assistant-interrupt-preview/index.js +2 -0
- package/dist/components/arcgis-assistant-knowledge-agent/customElement.d.ts +7 -7
- package/dist/components/arcgis-assistant-knowledge-agent/customElement.js +39 -16
- package/dist/components/arcgis-assistant-layer-styling-agent/customElement.js +29 -6
- package/dist/components/arcgis-assistant-message/customElement.d.ts +5 -0
- package/dist/components/arcgis-assistant-message/customElement.js +29 -26
- package/dist/components/arcgis-assistant-message/index.js +2 -0
- package/dist/components/arcgis-assistant-message-block/customElement.js +18 -11
- package/dist/components/arcgis-assistant-message-block/index.js +1 -0
- package/dist/components/arcgis-assistant-message-loading/customElement.d.ts +7 -0
- package/dist/components/arcgis-assistant-message-loading/customElement.js +8 -7
- package/dist/components/arcgis-assistant-message-loading/index.js +1 -0
- package/dist/components/arcgis-assistant-message-text/customElement.d.ts +1 -0
- package/dist/components/arcgis-assistant-message-text/customElement.js +12 -12
- package/dist/components/arcgis-assistant-navigation-agent/customElement.js +17 -3
- package/dist/components/arcgis-assistant-speech-input/customElement.js +29 -46
- package/dist/components/arcgis-assistant-suggested-prompts/customElement.js +8 -8
- package/dist/components/arcgis-assistant-user-message/customElement.d.ts +2 -0
- package/dist/components/arcgis-assistant-user-message/customElement.js +15 -10
- package/dist/docs/api.json +1 -1
- package/dist/docs/docs.json +1 -1
- package/dist/docs/vscode.html-custom-data.json +1 -1
- package/dist/docs/web-types.json +1 -1
- package/dist/loader.js +9 -8
- package/dist/oauth-callback.html +1 -1
- package/dist/types/lumina.d.ts +9 -8
- package/dist/types/preact.d.ts +9 -8
- package/dist/types/react.d.ts +9 -8
- package/dist/types/stencil.d.ts +11 -10
- package/dist/utils/index.d.ts +10 -10
- package/dist/utils/index.js +56 -55
- package/package.json +32 -12
- package/dist/cdn/2AXF774U.js +0 -2
- package/dist/cdn/462JBSEV.js +0 -422
- package/dist/cdn/53ZCUPKK.js +0 -22
- package/dist/cdn/5QAHYX7Y.js +0 -5
- package/dist/cdn/5XRDJL7R.js +0 -14
- package/dist/cdn/7BCR6TUO.js +0 -2
- package/dist/cdn/7GH7VSB2.js +0 -2
- package/dist/cdn/7PLV4QH6.js +0 -2
- package/dist/cdn/AO7BQHKC.js +0 -2
- package/dist/cdn/AXDZBBNL.js +0 -45
- package/dist/cdn/DDLZOMUY.js +0 -2
- package/dist/cdn/EECZLT6C.js +0 -166
- package/dist/cdn/ETRWZ3MS.js +0 -108
- package/dist/cdn/F2AHA4GB.js +0 -54
- package/dist/cdn/FX5JFRDL.js +0 -2
- package/dist/cdn/H7422XUG.js +0 -2
- package/dist/cdn/HB5A5R2E.js +0 -2
- package/dist/cdn/I6HNBTWY.js +0 -2
- package/dist/cdn/IG6YKZH3.js +0 -3
- package/dist/cdn/KMQ3SP4I.js +0 -5
- package/dist/cdn/MH5RPXHM.js +0 -2
- package/dist/cdn/NAUXSHIE.js +0 -72
- package/dist/cdn/NVI3I46B.js +0 -2
- package/dist/cdn/OAVEHGB6.js +0 -2
- package/dist/cdn/OH64RMOR.js +0 -4
- package/dist/cdn/P26NON3Z.js +0 -16
- package/dist/cdn/P6OPJQMC.js +0 -3
- package/dist/cdn/QR54T33D.js +0 -2
- package/dist/cdn/RVOAPUBN.js +0 -2
- package/dist/cdn/S3VPZFWQ.js +0 -36
- package/dist/cdn/SXDLXCIM.js +0 -2
- package/dist/cdn/USMDJUFS.js +0 -2
- package/dist/cdn/Y333DGV6.js +0 -2
- package/dist/cdn/YIMNOUTF.js +0 -2
|
@@ -1,43 +1,46 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import { c as
|
|
3
|
-
import { css as
|
|
4
|
-
import { LitElement as
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
}),
|
|
2
|
+
import { c as o } from "../../chunks/runtime.js";
|
|
3
|
+
import { css as l, html as e } from "lit";
|
|
4
|
+
import { LitElement as c, nothing as d } from "@arcgis/lumina";
|
|
5
|
+
import { u as g } from "../../chunks/useT9n.js";
|
|
6
|
+
import { useSlottableRequest as m } from "@arcgis/lumina/controllers";
|
|
7
|
+
import { g as r } from "../../chunks/slottableRequestUtils.js";
|
|
8
|
+
const p = l`:host{display:block;container-type:inline-size}.container{display:flex;flex-direction:column;align-items:flex-start;gap:var(--calcite-spacing-sm);width:100%;text-align:left}.icon{padding:var(--calcite-spacing-sm);border-radius:var(--calcite-spacing-xl);background:var(--calcite-color-brand);color:var(--calcite-color-foreground-1)}.content-container{display:flex;flex:1;flex-direction:column;width:100%;min-width:0;gap:var(--calcite-spacing-md)}.content{display:flex;flex-direction:column;min-width:0;gap:var(--calcite-spacing-sm)}.blocks{display:flex;flex-direction:column;gap:var(--calcite-spacing-sm)}.block-pending{display:flex;justify-content:center;align-items:center;padding:var(--calcite-spacing-sm);background:linear-gradient(90deg,color-mix(in srgb,var(--calcite-color-foreground-2) 65%,transparent),color-mix(in srgb,var(--calcite-color-foreground-3) 85%,transparent),color-mix(in srgb,var(--calcite-color-foreground-2) 65%,transparent));background-size:200% 100%;animation:assistant-message-loading-shimmer 2s ease-in-out infinite;border-radius:var(--calcite-border-radius);min-height:100px}.message-error{font-style:italic}@container (min-width: 480px){.container{max-width:80%}}@keyframes assistant-message-loading-shimmer{0%{background-position:-150% 0}to{background-position:150% 0}}@media(prefers-reduced-motion){.block-pending{animation:none}}`;
|
|
9
|
+
function b({ message: t }) {
|
|
10
|
+
const s = /* @__PURE__ */ new Map();
|
|
11
|
+
return t && t.blocks?.forEach((a, i) => {
|
|
12
|
+
if (!a.isPending) {
|
|
13
|
+
const n = r(t.id, i);
|
|
14
|
+
s.set(n, { data: { block: a, index: i, message: t }, name: "block", slotName: n });
|
|
15
|
+
}
|
|
16
|
+
}), s;
|
|
17
17
|
}
|
|
18
|
-
class
|
|
18
|
+
class u extends c {
|
|
19
19
|
constructor() {
|
|
20
|
-
super(...arguments), this.arcgisSlottableRequest =
|
|
20
|
+
super(...arguments), this._messages = g({ blocking: !0 }), this.arcgisSlottableRequest = m(this, ["message"], b), this.feedbackEnabled = !1, this.logEnabled = !1, this.copyEnabled = !1, this.readAloudEnabled = !1, this.footerDisabled = !1, this.assistantAvatarEnabled = !1;
|
|
21
21
|
}
|
|
22
22
|
static {
|
|
23
|
-
this.properties = { feedbackEnabled: 5, logEnabled: 5, copyEnabled: 5, readAloudEnabled: 5, footerDisabled: 5, message: 0 };
|
|
23
|
+
this.properties = { _isStreaming: 16, feedbackEnabled: 5, logEnabled: 5, copyEnabled: 5, readAloudEnabled: 5, footerDisabled: 5, message: 0, assistantAvatarEnabled: 5 };
|
|
24
24
|
}
|
|
25
25
|
static {
|
|
26
|
-
this.styles =
|
|
26
|
+
this.styles = p;
|
|
27
|
+
}
|
|
28
|
+
get _isStreaming() {
|
|
29
|
+
return !!this.message?.isStreaming;
|
|
27
30
|
}
|
|
28
31
|
_renderContent() {
|
|
29
|
-
const
|
|
30
|
-
if (
|
|
31
|
-
return
|
|
32
|
+
const s = this.message, a = s?.id;
|
|
33
|
+
if (a)
|
|
34
|
+
return e`<div class="content"><arcgis-assistant-interrupt-preview .interrupts=${this.message?.interrupts}></arcgis-assistant-interrupt-preview>${s.blocks?.length ? e`<div class="blocks">${s.blocks.map((i, n) => i.isPending && i.type !== "text" ? e`<div class="block-pending"></div>` : e`<slot name=${r(a, n) ?? d}></slot>`)}</div>` : null}</div>`;
|
|
32
35
|
}
|
|
33
36
|
_renderFooter() {
|
|
34
|
-
return
|
|
37
|
+
return e`<arcgis-assistant-message-footer .message=${this.message} .feedbackEnabled=${this.feedbackEnabled} .logEnabled=${this.logEnabled} .copyEnabled=${this.copyEnabled} .readAloudEnabled=${this.readAloudEnabled}></arcgis-assistant-message-footer>`;
|
|
35
38
|
}
|
|
36
39
|
render() {
|
|
37
|
-
return
|
|
40
|
+
return e`<div class="container">${this.assistantAvatarEnabled ? e`<slot name=icon><calcite-icon icon=effects class="icon" scale=s></calcite-icon></slot>` : null}<div class="content-container"><slot name=content>${this._renderContent()}</slot>${this.message?.error ? e`<div class="message-error">${this.message.error}</div>` : null}${this._isStreaming ? e`<div class="streaming-indicator"><calcite-loader .label=${this._messages.loadingLabel} inline></calcite-loader></div>` : null}${!this.footerDisabled && !this._isStreaming ? e`<slot name=footer>${this._renderFooter()}</slot>` : null}</div></div>`;
|
|
38
41
|
}
|
|
39
42
|
}
|
|
40
|
-
|
|
43
|
+
o("arcgis-assistant-message", u);
|
|
41
44
|
export {
|
|
42
|
-
|
|
45
|
+
u as ArcgisAssistantMessage
|
|
43
46
|
};
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import "../arcgis-assistant-interrupt-preview/index.js";
|
|
1
2
|
import "../arcgis-assistant-message-footer/index.js";
|
|
2
3
|
import "@esri/calcite-components/components/calcite-icon";
|
|
4
|
+
import "@esri/calcite-components/components/calcite-loader";
|
|
3
5
|
export * from "./customElement.js";
|
|
@@ -1,29 +1,36 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import { c as
|
|
3
|
-
import { css as i, html as
|
|
4
|
-
import { LitElement as
|
|
5
|
-
const
|
|
6
|
-
class
|
|
2
|
+
import { c as n } from "../../chunks/runtime.js";
|
|
3
|
+
import { css as i, html as r } from "lit";
|
|
4
|
+
import { LitElement as o } from "@arcgis/lumina";
|
|
5
|
+
const p = i`:host{display:block}`;
|
|
6
|
+
class c extends o {
|
|
7
7
|
static {
|
|
8
8
|
this.properties = { block: 0 };
|
|
9
9
|
}
|
|
10
10
|
static {
|
|
11
|
-
this.styles =
|
|
11
|
+
this.styles = p;
|
|
12
12
|
}
|
|
13
13
|
_renderSuggestedPrompts(s) {
|
|
14
14
|
if (s.type !== "suggested-prompts")
|
|
15
15
|
return null;
|
|
16
|
-
const t = s.data?.prompts, e = Array.isArray(t) ? t.filter((
|
|
17
|
-
return e.length ?
|
|
16
|
+
const t = s.data?.prompts, e = Array.isArray(t) ? t.filter((a) => typeof a == "string") : [];
|
|
17
|
+
return e.length ? r`<arcgis-assistant-suggested-prompts .prompts=${e}></arcgis-assistant-suggested-prompts>` : null;
|
|
18
18
|
}
|
|
19
19
|
_renderBlock(s) {
|
|
20
|
-
|
|
20
|
+
switch (s.type) {
|
|
21
|
+
case "suggested-prompts":
|
|
22
|
+
return this._renderSuggestedPrompts(s);
|
|
23
|
+
case "text":
|
|
24
|
+
return r`<arcgis-assistant-message-text .content=${s.data?.content} .parts=${s.data?.parts}></arcgis-assistant-message-text>`;
|
|
25
|
+
default:
|
|
26
|
+
return null;
|
|
27
|
+
}
|
|
21
28
|
}
|
|
22
29
|
render() {
|
|
23
30
|
return this.block ? this._renderBlock(this.block) : null;
|
|
24
31
|
}
|
|
25
32
|
}
|
|
26
|
-
|
|
33
|
+
n("arcgis-assistant-message-block", c);
|
|
27
34
|
export {
|
|
28
|
-
|
|
35
|
+
c as ArcgisAssistantMessageBlock
|
|
29
36
|
};
|
|
@@ -1,11 +1,18 @@
|
|
|
1
1
|
/// <reference path="../../index.d.ts" />
|
|
2
2
|
import type { PublicLitElement as LitElement } from "@arcgis/lumina";
|
|
3
|
+
import type { AssistantMessage } from "../arcgis-assistant/types.js";
|
|
4
|
+
import type { T9nMeta } from "@arcgis/lumina/controllers";
|
|
3
5
|
|
|
4
6
|
/**
|
|
5
7
|
* Shows in-progress assistant response UI. Use it to display thinking or loading state while work is running.
|
|
6
8
|
* Offers a default loading message shell with icon/content slot overrides.
|
|
7
9
|
*/
|
|
8
10
|
export abstract class ArcgisAssistantMessageLoading extends LitElement {
|
|
11
|
+
/** @internal */
|
|
12
|
+
protected _messages: { loadingLabel: string; } & T9nMeta<{ loadingLabel: string; }>;
|
|
13
|
+
/** @default false */
|
|
14
|
+
accessor assistantAvatarEnabled: boolean;
|
|
15
|
+
accessor interrupts: AssistantMessage["interrupts"] | undefined;
|
|
9
16
|
/** @default false */
|
|
10
17
|
accessor loading: boolean;
|
|
11
18
|
/** @default "" */
|
|
@@ -1,20 +1,21 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
2
|
import { c as a } from "../../chunks/runtime.js";
|
|
3
3
|
import { css as e, html as s } from "lit";
|
|
4
|
-
import { LitElement as
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
import { LitElement as t } from "@arcgis/lumina";
|
|
5
|
+
import { u as i } from "../../chunks/useT9n.js";
|
|
6
|
+
const n = e`:host{display:contents}.icon{padding:var(--calcite-spacing-sm);border-radius:var(--calcite-spacing-xl);background:var(--calcite-color-brand);color:var(--calcite-color-foreground-1)}.loading-container{display:flex;flex-direction:column;gap:var(--calcite-spacing-sm);padding:0 var(--calcite-spacing-sm)}.loading{display:flex;align-items:center;gap:var(--calcite-spacing-sm)}.text{font-style:italic;word-wrap:break-word;word-break:break-all;overflow:hidden;text-overflow:ellipsis;display:-webkit-box;-webkit-line-clamp:1;line-clamp:1;-webkit-box-orient:vertical}.skeleton-block{display:flex;flex-direction:column;gap:var(--calcite-spacing-sm);width:100%}.skeleton-text{display:block;height:.95em;border-radius:var(--calcite-border-radius);background:linear-gradient(90deg,color-mix(in srgb,var(--calcite-color-foreground-2) 65%,transparent),color-mix(in srgb,var(--calcite-color-foreground-3) 85%,transparent),color-mix(in srgb,var(--calcite-color-foreground-2) 65%,transparent));background-size:200% 100%;animation:assistant-message-loading-shimmer 1.2s ease-in-out infinite;width:85%}.skeleton-text:last-child{width:70%}@keyframes assistant-message-loading-shimmer{0%{background-position:-150% 0}to{background-position:150% 0}}@media(prefers-reduced-motion){.skeleton-text{animation:none}}`;
|
|
7
|
+
class o extends t {
|
|
7
8
|
constructor() {
|
|
8
|
-
super(...arguments), this.loading = !1, this.loadingMessage = "";
|
|
9
|
+
super(...arguments), this._messages = i({ blocking: !0 }), this.loading = !1, this.loadingMessage = "", this.assistantAvatarEnabled = !1;
|
|
9
10
|
}
|
|
10
11
|
static {
|
|
11
|
-
this.properties = { loading: 5, loadingMessage: 1 };
|
|
12
|
+
this.properties = { loading: 5, loadingMessage: 1, assistantAvatarEnabled: 5, interrupts: 0 };
|
|
12
13
|
}
|
|
13
14
|
static {
|
|
14
|
-
this.styles =
|
|
15
|
+
this.styles = n;
|
|
15
16
|
}
|
|
16
17
|
render() {
|
|
17
|
-
return this.loading ? s`<arcgis-assistant-message footer-disabled
|
|
18
|
+
return this.loading ? s`<arcgis-assistant-message .assistantAvatarEnabled=${this.assistantAvatarEnabled} footer-disabled>${this.assistantAvatarEnabled ? s`<slot name=icon slot=icon><calcite-icon class="icon" icon=effects scale=s></calcite-icon></slot>` : null}<slot name=content slot=content><arcgis-assistant-interrupt-preview .interrupts=${this.interrupts}></arcgis-assistant-interrupt-preview><div class="loading-container"><div class="loading"><calcite-loader .label=${this._messages.loadingLabel} inline></calcite-loader><div class="text">${this.loadingMessage}</div></div><div class="skeleton-block"><span class="skeleton-text"></span><span class="skeleton-text"></span></div></div></slot></arcgis-assistant-message>` : null;
|
|
18
19
|
}
|
|
19
20
|
}
|
|
20
21
|
a("arcgis-assistant-message-loading", o);
|
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import { c as
|
|
3
|
-
import { css as
|
|
4
|
-
import { LitElement as
|
|
5
|
-
import { unsafeHTML as
|
|
6
|
-
import { p as
|
|
7
|
-
const
|
|
8
|
-
class
|
|
2
|
+
import { c as r } from "../../chunks/runtime.js";
|
|
3
|
+
import { css as i, html as t } from "lit";
|
|
4
|
+
import { LitElement as c } from "@arcgis/lumina";
|
|
5
|
+
import { unsafeHTML as a } from "lit/directives/unsafe-html.js";
|
|
6
|
+
import { a as n, p as o } from "../../chunks/converterUtils.js";
|
|
7
|
+
const s = i`.container{color:var(--calcite-color-text-1);min-width:0}.content{min-width:0;overflow-wrap:anywhere}.content>*{margin:0}.content>*+*{margin-block-start:var(--calcite-spacing-sm)}.content :is(ol,ul){padding-inline-start:var(--calcite-spacing-lg)}.content>calcite-table{display:block;max-width:100%}.content pre{background-color:var(--calcite-color-foreground-1);padding:var(--calcite-spacing-sm);border-radius:var(--calcite-border-radius);color:var(--calcite-color-text-1);direction:ltr;max-width:100%;overflow:auto}.content pre code{display:block;white-space:pre;font-family:var(--calcite-code-family)}.part{animation:part-reveal calc(3 * var(--calcite-animation-timing)) ease-out}@keyframes part-reveal{0%{opacity:0;transform:translateY(var(--calcite-size-fixed-xxs))}to{opacity:1;transform:translateY(0)}}@media(prefers-reduced-motion:reduce){.part{animation:none}}`;
|
|
8
|
+
class l extends c {
|
|
9
9
|
static {
|
|
10
|
-
this.properties = { content: 1 };
|
|
10
|
+
this.properties = { content: 1, parts: 0 };
|
|
11
11
|
}
|
|
12
12
|
static {
|
|
13
|
-
this.styles =
|
|
13
|
+
this.styles = s;
|
|
14
14
|
}
|
|
15
15
|
render() {
|
|
16
|
-
return
|
|
16
|
+
return t`<div class="container"><div class="content">${this.parts?.map((e) => t`<span class="part">${a(n(e))}</span>`) ?? a(o(this.content))}</div></div>`;
|
|
17
17
|
}
|
|
18
18
|
}
|
|
19
|
-
|
|
19
|
+
r("arcgis-assistant-message-text", l);
|
|
20
20
|
export {
|
|
21
|
-
|
|
21
|
+
l as ArcgisAssistantMessageText
|
|
22
22
|
};
|
|
@@ -6,21 +6,31 @@ import "@langchain/langgraph/web";
|
|
|
6
6
|
import "../../chunks/adapter.js";
|
|
7
7
|
import "@arcgis/core/identity/IdentityManager.js";
|
|
8
8
|
import "@arcgis/core/portal/Portal.js";
|
|
9
|
+
import "@arcgis/core/request.js";
|
|
10
|
+
import "@arcgis/toolkit/string";
|
|
9
11
|
import "../../chunks/generateLayerDescriptions.js";
|
|
10
12
|
import "@langchain/core/messages";
|
|
11
13
|
import "@langchain/core/callbacks/dispatch/web";
|
|
12
14
|
import "@langchain/openai";
|
|
15
|
+
import "@arcgis/core/config.js";
|
|
13
16
|
import "@arcgis/core/core/reactiveUtils.js";
|
|
14
17
|
import "@arcgis/core/layers/FeatureLayer.js";
|
|
15
|
-
import "@arcgis/core/request.js";
|
|
16
18
|
import "@langchain/core/prompts";
|
|
19
|
+
import "../../agents/tools/filter/clearFilters/adapter.js";
|
|
20
|
+
import "../../agents/tools/filter/resetMap/adapter.js";
|
|
21
|
+
import "../../agents/tools/filter/setFeatureEffect/adapter.js";
|
|
22
|
+
import "../../agents/tools/query/getAttribute/adapter.js";
|
|
23
|
+
import "../../agents/tools/query/getStatistics/adapter.js";
|
|
24
|
+
import "../../agents/tools/query/getTopFeatures/adapter.js";
|
|
25
|
+
import "../../agents/tools/query/queryFeatures/adapter.js";
|
|
17
26
|
import "@arcgis/core/intl.js";
|
|
18
27
|
import "@langchain/langgraph/prebuilt";
|
|
19
28
|
import "@arcgis/core/smartMapping/statistics/summaryStatistics.js";
|
|
20
29
|
import "@arcgis/core/smartMapping/statistics/uniqueValues.js";
|
|
30
|
+
import "../../agents/tools/help/listFields/adapter.js";
|
|
21
31
|
import "@arcgis/core/views/LinkChartView.js";
|
|
22
32
|
import "@arcgis/core/rest/knowledgeGraphService.js";
|
|
23
|
-
import { r as o,
|
|
33
|
+
import { r as o, i as s } from "../../chunks/utils2.js";
|
|
24
34
|
class a extends i {
|
|
25
35
|
constructor() {
|
|
26
36
|
super(...arguments), this.agent = r;
|
|
@@ -29,13 +39,17 @@ class a extends i {
|
|
|
29
39
|
this.properties = { referenceElement: 1 };
|
|
30
40
|
}
|
|
31
41
|
#t;
|
|
42
|
+
#i;
|
|
32
43
|
getContext() {
|
|
33
44
|
if (!this.#t)
|
|
34
45
|
throw new Error("arcgis-assistant-navigation-agent requires a mapView");
|
|
35
46
|
return { mapView: this.#t };
|
|
36
47
|
}
|
|
37
48
|
load() {
|
|
38
|
-
this.#t = o(this, "arcgis-assistant-navigation-agent"), s(this);
|
|
49
|
+
this.#t = o(this, "arcgis-assistant-navigation-agent"), this.#i = s(this);
|
|
50
|
+
}
|
|
51
|
+
disconnectedCallback() {
|
|
52
|
+
this.#i?.unregister(this.agent.id), super.disconnectedCallback();
|
|
39
53
|
}
|
|
40
54
|
}
|
|
41
55
|
t("arcgis-assistant-navigation-agent", a);
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import { c as
|
|
3
|
-
import { css as
|
|
4
|
-
import {
|
|
5
|
-
import { LitElement as
|
|
6
|
-
import
|
|
2
|
+
import { c as C } from "../../chunks/runtime.js";
|
|
3
|
+
import { css as S, html as R } from "lit";
|
|
4
|
+
import { watch as p } from "@arcgis/core/core/reactiveUtils.js";
|
|
5
|
+
import { LitElement as y, createEvent as d, nothing as v } from "@arcgis/lumina";
|
|
6
|
+
import w from "@arcgis/core/core/Accessor.js";
|
|
7
7
|
import { property as l, subclass as f } from "@arcgis/core/core/accessorSupport/decorators.js";
|
|
8
|
-
const
|
|
9
|
-
var
|
|
10
|
-
for (var r = i > 1 ? void 0 : i ?
|
|
8
|
+
const I = S`.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}}`;
|
|
9
|
+
var T = Object.defineProperty, k = Object.getOwnPropertyDescriptor, u = (t, e, s, i) => {
|
|
10
|
+
for (var r = i > 1 ? void 0 : i ? k(e, s) : e, n = t.length - 1, o; n >= 0; n--)
|
|
11
11
|
(o = t[n]) && (r = (i ? o(e, s, r) : o(r)) || r);
|
|
12
|
-
return i && r &&
|
|
12
|
+
return i && r && T(e, s, r), r;
|
|
13
13
|
};
|
|
14
|
-
let a = class extends
|
|
14
|
+
let a = class extends w {
|
|
15
15
|
constructor(t) {
|
|
16
16
|
super(t), this.state = "idle", this.liveTranscript = "", this.transcript = "", this.errorCode = void 0;
|
|
17
17
|
}
|
|
@@ -37,7 +37,7 @@ u([
|
|
|
37
37
|
a = u([
|
|
38
38
|
f("SpeechController")
|
|
39
39
|
], a);
|
|
40
|
-
const
|
|
40
|
+
const x = [
|
|
41
41
|
"audio/webm;codecs=opus",
|
|
42
42
|
"audio/webm",
|
|
43
43
|
"audio/mp4",
|
|
@@ -47,27 +47,17 @@ const V = [
|
|
|
47
47
|
function h(t) {
|
|
48
48
|
return t.replace(/\s+/gu, " ").trim();
|
|
49
49
|
}
|
|
50
|
-
var
|
|
51
|
-
for (var r = i > 1 ? void 0 : i ?
|
|
50
|
+
var V = Object.defineProperty, O = Object.getOwnPropertyDescriptor, g = (t, e, s, i) => {
|
|
51
|
+
for (var r = i > 1 ? void 0 : i ? O(e, s) : e, n = t.length - 1, o; n >= 0; n--)
|
|
52
52
|
(o = t[n]) && (r = (i ? o(e, s, r) : o(r)) || r);
|
|
53
|
-
return i && r &&
|
|
53
|
+
return i && r && V(e, s, r), r;
|
|
54
54
|
};
|
|
55
55
|
let c = class extends a {
|
|
56
56
|
constructor(t) {
|
|
57
57
|
super(t), this._activeSessionId = null, this._mediaRecorder = null, this._mediaRecorderChunkIndex = 0, this._mediaRecorderStopReason = null, this._mediaStream = null, this._pendingChunkOperations = /* @__PURE__ */ new Set(), this._recordedChunks = [], this.handleRecording = null, this.chunkTimeSlice = 3e3;
|
|
58
58
|
}
|
|
59
59
|
get _mimeType() {
|
|
60
|
-
return typeof window > "u" || typeof window.MediaRecorder?.isTypeSupported != "function" ? "" :
|
|
61
|
-
}
|
|
62
|
-
initialize() {
|
|
63
|
-
c.isSupported() && this.addHandles(
|
|
64
|
-
C(
|
|
65
|
-
() => !!this.errorCode,
|
|
66
|
-
() => {
|
|
67
|
-
this._set("state", "error");
|
|
68
|
-
}
|
|
69
|
-
)
|
|
70
|
-
);
|
|
60
|
+
return typeof window > "u" || typeof window.MediaRecorder?.isTypeSupported != "function" ? "" : x.find((t) => window.MediaRecorder.isTypeSupported(t)) ?? "";
|
|
71
61
|
}
|
|
72
62
|
destroy() {
|
|
73
63
|
this._mediaRecorder && (this._mediaRecorder.onstart = null, this._mediaRecorder.ondataavailable = null, this._mediaRecorder.onerror = null, this._mediaRecorder.onstop = null), this.cancel(), this._mediaRecorder = null;
|
|
@@ -119,7 +109,7 @@ let c = class extends a {
|
|
|
119
109
|
} catch {
|
|
120
110
|
}
|
|
121
111
|
}
|
|
122
|
-
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("errorCode", t);
|
|
112
|
+
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", t);
|
|
123
113
|
}
|
|
124
114
|
_onError() {
|
|
125
115
|
this._failSession("recording-failed");
|
|
@@ -146,7 +136,7 @@ let c = class extends a {
|
|
|
146
136
|
if (await this._awaitPendingChunkOperations(), e !== this._activeSessionId)
|
|
147
137
|
return;
|
|
148
138
|
if (!(i ? new Blob(r, { type: i }) : new Blob(r)).size) {
|
|
149
|
-
this._activeSessionId === e && (this._activeSessionId = null), this._mediaRecorderStopReason = null, this._recordedChunks = [], this._set("errorCode", "recording-failed");
|
|
139
|
+
this._activeSessionId === e && (this._activeSessionId = null), this._mediaRecorderStopReason = null, this._recordedChunks = [], this._set("state", "error"), this._set("errorCode", "recording-failed");
|
|
150
140
|
return;
|
|
151
141
|
}
|
|
152
142
|
this._set("state", "processing"), this._set("transcript", h(`${this.transcript} ${this.liveTranscript}`)), this._set("liveTranscript", ""), this._activeSessionId === e && (this._activeSessionId = null), this._set("state", "idle"), this._set("errorCode", void 0), this._mediaRecorderStopReason = null, this._recordedChunks = [];
|
|
@@ -165,7 +155,7 @@ let c = class extends a {
|
|
|
165
155
|
const s = this._mimeType, i = s ? new window.MediaRecorder(e, { mimeType: s }) : new window.MediaRecorder(e);
|
|
166
156
|
this._mediaStream = e, 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);
|
|
167
157
|
}).catch((e) => {
|
|
168
|
-
t === this._activeSessionId && (this._activeSessionId = null, this._mediaRecorder = null, this._mediaRecorderChunkIndex = 0, this._mediaRecorderStopReason = null, this._pendingChunkOperations.clear(), this._recordedChunks = [], this._releaseMediaStream(), e instanceof DOMException && e.name === "NotAllowedError" ? this._set("errorCode", "not-allowed") : this._set("errorCode", "recording-failed"));
|
|
158
|
+
t === this._activeSessionId && (this._activeSessionId = null, this._mediaRecorder = null, this._mediaRecorderChunkIndex = 0, this._mediaRecorderStopReason = null, this._pendingChunkOperations.clear(), this._recordedChunks = [], this._releaseMediaStream(), e instanceof DOMException && e.name === "NotAllowedError" ? (this._set("state", "error"), this._set("errorCode", "not-allowed")) : (this._set("state", "error"), this._set("errorCode", "recording-failed")));
|
|
169
159
|
});
|
|
170
160
|
}
|
|
171
161
|
stop() {
|
|
@@ -208,8 +198,8 @@ g([
|
|
|
208
198
|
c = g([
|
|
209
199
|
f("MediaRecorderController")
|
|
210
200
|
], c);
|
|
211
|
-
var
|
|
212
|
-
for (var r = i > 1 ? void 0 : i ?
|
|
201
|
+
var M = Object.getOwnPropertyDescriptor, D = (t, e, s, i) => {
|
|
202
|
+
for (var r = i > 1 ? void 0 : i ? M(e, s) : e, n = t.length - 1, o; n >= 0; n--)
|
|
213
203
|
(o = t[n]) && (r = o(r) || r);
|
|
214
204
|
return r;
|
|
215
205
|
};
|
|
@@ -228,14 +218,7 @@ let _ = class extends a {
|
|
|
228
218
|
if (!t)
|
|
229
219
|
return;
|
|
230
220
|
const e = new t();
|
|
231
|
-
e.continuous = !0, e.interimResults = !0, this.language && (e.lang = this.language), e.onstart = this._onStart.bind(this), e.onresult = this._onResult.bind(this), e.onerror = this._onError.bind(this), e.onend = this._onEnd.bind(this), e.onspeechend = this._onSpeechEnd.bind(this), this._recognition = e
|
|
232
|
-
C(
|
|
233
|
-
() => !!this.errorCode,
|
|
234
|
-
() => {
|
|
235
|
-
this._set("state", "error");
|
|
236
|
-
}
|
|
237
|
-
)
|
|
238
|
-
);
|
|
221
|
+
e.continuous = !0, e.interimResults = !0, this.language && (e.lang = this.language), e.onstart = this._onStart.bind(this), e.onresult = this._onResult.bind(this), e.onerror = this._onError.bind(this), e.onend = this._onEnd.bind(this), e.onspeechend = this._onSpeechEnd.bind(this), this._recognition = e;
|
|
239
222
|
}
|
|
240
223
|
destroy() {
|
|
241
224
|
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);
|
|
@@ -268,7 +251,7 @@ let _ = class extends a {
|
|
|
268
251
|
default:
|
|
269
252
|
e = "unhandled";
|
|
270
253
|
}
|
|
271
|
-
this._set("errorCode", e);
|
|
254
|
+
this._set("state", "error"), this._set("errorCode", e);
|
|
272
255
|
}
|
|
273
256
|
// Natural end can arrive before the last interim segment becomes final, so preserve that trailing text.
|
|
274
257
|
_onEnd() {
|
|
@@ -294,7 +277,7 @@ let _ = class extends a {
|
|
|
294
277
|
try {
|
|
295
278
|
this._recognition.start();
|
|
296
279
|
} catch {
|
|
297
|
-
this._set("errorCode", "unhandled");
|
|
280
|
+
this._set("state", "error"), this._set("errorCode", "unhandled");
|
|
298
281
|
}
|
|
299
282
|
}
|
|
300
283
|
stop() {
|
|
@@ -319,7 +302,7 @@ let _ = class extends a {
|
|
|
319
302
|
return !!b();
|
|
320
303
|
}
|
|
321
304
|
};
|
|
322
|
-
_ =
|
|
305
|
+
_ = D([
|
|
323
306
|
f("WebSpeechController")
|
|
324
307
|
], _);
|
|
325
308
|
function m(t) {
|
|
@@ -329,7 +312,7 @@ function m(t) {
|
|
|
329
312
|
const i = e.trim();
|
|
330
313
|
return i ? `${i} ${s}` : s;
|
|
331
314
|
}
|
|
332
|
-
class
|
|
315
|
+
class $ extends y {
|
|
333
316
|
constructor() {
|
|
334
317
|
super(...arguments), this.#e = null, this._resolvedMode = "disabled", this.awaitingResponse = !1, this.inputValue = "", this.mode = "web-speech", this.arcgisVoiceInputDraftChange = d(), this.arcgisVoiceInputError = d(), this.arcgisVoiceInputInterimTranscription = d(), this.arcgisVoiceInputStart = d(), this.arcgisVoiceInputStop = d(), this.arcgisVoiceInputTranscription = d(), this.arcgisVoiceInputTranscriptionStreamChunk = d();
|
|
335
318
|
}
|
|
@@ -337,7 +320,7 @@ class E extends w {
|
|
|
337
320
|
this.properties = { _resolvedMode: 16, _state: 16, _errorCode: 16, _liveTranscript: 16, _transcript: 16, _isButtonDisabled: 16, _buttonLabel: 16, awaitingResponse: 5, inputValue: 1, language: 1, mode: 1 };
|
|
338
321
|
}
|
|
339
322
|
static {
|
|
340
|
-
this.styles =
|
|
323
|
+
this.styles = I;
|
|
341
324
|
}
|
|
342
325
|
#e;
|
|
343
326
|
get _state() {
|
|
@@ -477,12 +460,12 @@ class E extends w {
|
|
|
477
460
|
this._speechController && this._resolvedMode !== "disabled" && this._speechController.cancel(), this.clearDraftSession();
|
|
478
461
|
}
|
|
479
462
|
render() {
|
|
480
|
-
return
|
|
463
|
+
return R`<calcite-button appearance=transparent class="button" data-mode=${this._resolvedMode ?? v} data-state=${(this._resolvedMode === "disabled" ? "disabled" : this._state) ?? v} .disabled=${this._isButtonDisabled} icon-start=microphone kind=neutral .label=${this._buttonLabel} .loading=${this._state === "processing"} round scale=m @click=${() => {
|
|
481
464
|
this._handleToggle();
|
|
482
465
|
}}></calcite-button>`;
|
|
483
466
|
}
|
|
484
467
|
}
|
|
485
|
-
|
|
468
|
+
C("arcgis-assistant-speech-input", $);
|
|
486
469
|
export {
|
|
487
|
-
|
|
470
|
+
$ as ArcgisAssistantSpeechInput
|
|
488
471
|
};
|
|
@@ -1,27 +1,27 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import { c as
|
|
3
|
-
import { css as i, html as
|
|
2
|
+
import { c as s } from "../../chunks/runtime.js";
|
|
3
|
+
import { css as i, html as e } from "lit";
|
|
4
4
|
import { LitElement as r, createEvent as l } from "@arcgis/lumina";
|
|
5
|
-
import { u as
|
|
6
|
-
const
|
|
5
|
+
import { u as a } from "../../chunks/useT9n.js";
|
|
6
|
+
const c = i`:host{display:block;max-width:100%}.group{max-width:100%}.prompt{max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-style:normal;cursor:pointer;font-weight:var(--calcite-font-weight-regular)}calcite-chip{max-width:100%}`;
|
|
7
7
|
class o extends r {
|
|
8
8
|
constructor() {
|
|
9
|
-
super(...arguments), this._messages =
|
|
9
|
+
super(...arguments), this._messages = a({ blocking: !0 }), this.prompts = [], this.arcgisPromptSelect = l();
|
|
10
10
|
}
|
|
11
11
|
static {
|
|
12
12
|
this.properties = { label: 1, prompts: 0 };
|
|
13
13
|
}
|
|
14
14
|
static {
|
|
15
|
-
this.styles =
|
|
15
|
+
this.styles = c;
|
|
16
16
|
}
|
|
17
17
|
_emitPromptSelect(t) {
|
|
18
18
|
this.arcgisPromptSelect.emit({ prompt: t });
|
|
19
19
|
}
|
|
20
20
|
render() {
|
|
21
|
-
return this.prompts.length ?
|
|
21
|
+
return this.prompts.length ? e`<calcite-chip-group class="group" .label=${this.label ?? this._messages.suggestedPromptsLabel}>${this.prompts.map((t) => e`<calcite-chip .value=${t} .label=${t} appearance=outline-fill kind=brand @calciteChipSelect=${() => this._emitPromptSelect(t)}><div class="prompt">${t}</div></calcite-chip>`)}</calcite-chip-group>` : null;
|
|
22
22
|
}
|
|
23
23
|
}
|
|
24
|
-
|
|
24
|
+
s("arcgis-assistant-suggested-prompts", o);
|
|
25
25
|
export {
|
|
26
26
|
o as ArcgisAssistantSuggestedPrompts
|
|
27
27
|
};
|
|
@@ -1,23 +1,28 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import { c as
|
|
3
|
-
import { css as e, html as
|
|
4
|
-
import { LitElement as
|
|
5
|
-
|
|
6
|
-
|
|
2
|
+
import { c as a } from "../../chunks/runtime.js";
|
|
3
|
+
import { css as e, html as t } from "lit";
|
|
4
|
+
import { LitElement as i } from "@arcgis/lumina";
|
|
5
|
+
import { p as r } from "../../chunks/converterUtils.js";
|
|
6
|
+
import { unsafeHTML as s } from "lit/directives/unsafe-html.js";
|
|
7
|
+
const c = e`:host{display:block;min-width:0}.container{display:flex;align-items:center;gap:var(--calcite-spacing-md);background:color-mix(in srgb,var(--calcite-color-brand) 15%,var(--calcite-color-foreground-1));color:var(--calcite-color-text-1);padding:var(--calcite-spacing-md);border-radius:var(--calcite-border-radius);width:fit-content;max-width:100%;min-width:0;margin-left:auto;justify-content:flex-end}.container>div:first-child{min-width:0}.avatar{display:flex;align-items:center;justify-content:center}.content{min-width:0;overflow-wrap:anywhere;>*{margin:0}>*+*{margin-block-start:var(--calcite-spacing-sm)}:is(ol,ul){padding-inline-start:var(--calcite-spacing-lg)}>calcite-table{display:block;max-width:100%}pre{background-color:var(--calcite-color-foreground-1);padding:var(--calcite-spacing-sm);border-radius:var(--calcite-border-radius);color:var(--calcite-color-text-1);direction:ltr;max-width:100%;overflow:auto}pre code{display:block;white-space:pre;font-family:var(--calcite-code-family)}}@container (min-width: 480px){.container{max-width:80%}}`;
|
|
8
|
+
class n extends i {
|
|
9
|
+
constructor() {
|
|
10
|
+
super(...arguments), this.userAvatarEnabled = !1;
|
|
11
|
+
}
|
|
7
12
|
static {
|
|
8
|
-
this.properties = { content: 1, user: 1, message: 0 };
|
|
13
|
+
this.properties = { content: 1, user: 1, message: 0, userAvatarEnabled: 5 };
|
|
9
14
|
}
|
|
10
15
|
static {
|
|
11
|
-
this.styles =
|
|
16
|
+
this.styles = c;
|
|
12
17
|
}
|
|
13
18
|
_getContent() {
|
|
14
19
|
return this.message?.role === "user" ? this.message.content : this.content;
|
|
15
20
|
}
|
|
16
21
|
render() {
|
|
17
|
-
return
|
|
22
|
+
return t`<div class="container"><div><slot name=content><div class="content">${s(r(this._getContent()))}</div></slot></div>${this.userAvatarEnabled ? t`<slot name=icon><div class="avatar"><calcite-avatar .fullName=${this.user} scale=s></calcite-avatar></div></slot>` : null}</div>`;
|
|
18
23
|
}
|
|
19
24
|
}
|
|
20
|
-
|
|
25
|
+
a("arcgis-assistant-user-message", n);
|
|
21
26
|
export {
|
|
22
|
-
|
|
27
|
+
n as ArcgisAssistantUserMessage
|
|
23
28
|
};
|