@arcgis/ai-components 5.1.0-next.67 → 5.1.0-next.69
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/dist/cdn/3D2FSGMT.js +75 -0
- package/dist/cdn/{344C2EEF.js → 5PT7ZFXF.js} +20 -8
- package/dist/cdn/{WRENCTR3.js → 6TDOQJ45.js} +1 -1
- package/dist/cdn/{LTBEINKG.js → ABCHVJTB.js} +13 -1
- package/dist/cdn/{4ZJM5GT4.js → ABNCEYLL.js} +1 -1
- package/dist/cdn/BDNPOFE3.js +2 -0
- package/dist/cdn/{SA7B3M2J.js → ESTSYVJP.js} +14 -1
- package/dist/cdn/{E4J4SWHB.js → EUFX6NVB.js} +1 -1
- package/dist/cdn/{VJGA26MX.js → GDZJLYX3.js} +1 -1
- package/dist/cdn/{H3DVSYQV.js → H3PQFXNE.js} +1 -1
- package/dist/cdn/{SOPNKXO5.js → HXFRR6EC.js} +1 -1
- package/dist/cdn/{TTLSUI5H.js → IRWH2Z5B.js} +1 -1
- package/dist/cdn/{XI5SV3HJ.js → KWBMH7LU.js} +17 -3
- package/dist/cdn/{AAEEDEN7.js → L7YTPHKQ.js} +80 -79
- package/dist/cdn/{RBFFW5ZM.js → MZJGADGH.js} +22 -9
- package/dist/cdn/{O5QYUL5C.js → NDR3JRNG.js} +1 -1
- package/dist/cdn/{UGJXHTYH.js → NPL674O3.js} +23 -18
- package/dist/cdn/{DLTK3ENO.js → OCRLLTMY.js} +1 -1
- package/dist/cdn/{NXIQDF7N.js → PXWXEVZS.js} +1 -1
- package/dist/cdn/{5RA2JKQ5.js → PZNHMI2L.js} +1 -1
- package/dist/cdn/{UX7NRZPV.js → WEBEIOLW.js} +1 -1
- package/dist/cdn/Y4RSINW4.js +225 -0
- package/dist/cdn/{IUMTWQJI.js → Z6HX4HRX.js} +1 -1
- package/dist/cdn/{W2A22QZU.js → ZDEYVBH7.js} +15 -3
- package/dist/cdn/{MP7AEALE.js → ZIGYCHMU.js} +1 -1
- package/dist/cdn/assets/assistant/t9n/messages.ar.json +1 -1
- package/dist/cdn/assets/assistant/t9n/messages.bg.json +1 -1
- package/dist/cdn/assets/assistant/t9n/messages.bs.json +1 -1
- package/dist/cdn/assets/assistant/t9n/messages.ca.json +1 -1
- package/dist/cdn/assets/assistant/t9n/messages.cs.json +1 -1
- package/dist/cdn/assets/assistant/t9n/messages.da.json +1 -1
- package/dist/cdn/assets/assistant/t9n/messages.de.json +1 -1
- package/dist/cdn/assets/assistant/t9n/messages.el.json +1 -1
- package/dist/cdn/assets/assistant/t9n/messages.es.json +1 -1
- package/dist/cdn/assets/assistant/t9n/messages.et.json +1 -1
- package/dist/cdn/assets/assistant/t9n/messages.fi.json +1 -1
- package/dist/cdn/assets/assistant/t9n/messages.fr.json +1 -1
- package/dist/cdn/assets/assistant/t9n/messages.he.json +1 -1
- package/dist/cdn/assets/assistant/t9n/messages.hr.json +1 -1
- package/dist/cdn/assets/assistant/t9n/messages.hu.json +1 -1
- package/dist/cdn/assets/assistant/t9n/messages.id.json +1 -1
- package/dist/cdn/assets/assistant/t9n/messages.it.json +1 -1
- package/dist/cdn/assets/assistant/t9n/messages.ja.json +1 -1
- package/dist/cdn/assets/assistant/t9n/messages.ko.json +1 -1
- package/dist/cdn/assets/assistant/t9n/messages.lt.json +1 -1
- package/dist/cdn/assets/assistant/t9n/messages.lv.json +1 -1
- package/dist/cdn/assets/assistant/t9n/messages.nl.json +1 -1
- package/dist/cdn/assets/assistant/t9n/messages.no.json +1 -1
- package/dist/cdn/assets/assistant/t9n/messages.pl.json +1 -1
- package/dist/cdn/assets/assistant/t9n/messages.pt-BR.json +1 -1
- package/dist/cdn/assets/assistant/t9n/messages.pt-PT.json +1 -1
- package/dist/cdn/assets/assistant/t9n/messages.ro.json +1 -1
- package/dist/cdn/assets/assistant/t9n/messages.ru.json +1 -1
- package/dist/cdn/assets/assistant/t9n/messages.sk.json +1 -1
- package/dist/cdn/assets/assistant/t9n/messages.sl.json +1 -1
- package/dist/cdn/assets/assistant/t9n/messages.sr.json +1 -1
- package/dist/cdn/assets/assistant/t9n/messages.sv.json +1 -1
- package/dist/cdn/assets/assistant/t9n/messages.th.json +1 -1
- package/dist/cdn/assets/assistant/t9n/messages.tr.json +1 -1
- package/dist/cdn/assets/assistant/t9n/messages.uk.json +1 -1
- package/dist/cdn/assets/assistant/t9n/messages.vi.json +1 -1
- package/dist/cdn/assets/assistant/t9n/messages.zh-CN.json +1 -1
- package/dist/cdn/assets/assistant/t9n/messages.zh-HK.json +1 -1
- package/dist/cdn/assets/assistant/t9n/messages.zh-TW.json +1 -1
- package/dist/cdn/assets/assistant-chat-card/t9n/messages.ar.json +1 -1
- package/dist/cdn/assets/assistant-chat-card/t9n/messages.bg.json +1 -1
- package/dist/cdn/assets/assistant-chat-card/t9n/messages.bs.json +1 -1
- package/dist/cdn/assets/assistant-chat-card/t9n/messages.ca.json +1 -1
- package/dist/cdn/assets/assistant-chat-card/t9n/messages.cs.json +1 -1
- package/dist/cdn/assets/assistant-chat-card/t9n/messages.da.json +1 -1
- package/dist/cdn/assets/assistant-chat-card/t9n/messages.de.json +1 -1
- package/dist/cdn/assets/assistant-chat-card/t9n/messages.el.json +1 -1
- package/dist/cdn/assets/assistant-chat-card/t9n/messages.es.json +1 -1
- package/dist/cdn/assets/assistant-chat-card/t9n/messages.et.json +1 -1
- package/dist/cdn/assets/assistant-chat-card/t9n/messages.fi.json +1 -1
- package/dist/cdn/assets/assistant-chat-card/t9n/messages.fr.json +1 -1
- package/dist/cdn/assets/assistant-chat-card/t9n/messages.he.json +1 -1
- package/dist/cdn/assets/assistant-chat-card/t9n/messages.hr.json +1 -1
- package/dist/cdn/assets/assistant-chat-card/t9n/messages.hu.json +1 -1
- package/dist/cdn/assets/assistant-chat-card/t9n/messages.id.json +1 -1
- package/dist/cdn/assets/assistant-chat-card/t9n/messages.it.json +1 -1
- package/dist/cdn/assets/assistant-chat-card/t9n/messages.ja.json +1 -1
- package/dist/cdn/assets/assistant-chat-card/t9n/messages.ko.json +1 -1
- package/dist/cdn/assets/assistant-chat-card/t9n/messages.lt.json +1 -1
- package/dist/cdn/assets/assistant-chat-card/t9n/messages.lv.json +1 -1
- package/dist/cdn/assets/assistant-chat-card/t9n/messages.nl.json +1 -1
- package/dist/cdn/assets/assistant-chat-card/t9n/messages.no.json +1 -1
- package/dist/cdn/assets/assistant-chat-card/t9n/messages.pl.json +1 -1
- package/dist/cdn/assets/assistant-chat-card/t9n/messages.pt-BR.json +1 -1
- package/dist/cdn/assets/assistant-chat-card/t9n/messages.pt-PT.json +1 -1
- package/dist/cdn/assets/assistant-chat-card/t9n/messages.ro.json +1 -1
- package/dist/cdn/assets/assistant-chat-card/t9n/messages.ru.json +1 -1
- package/dist/cdn/assets/assistant-chat-card/t9n/messages.sk.json +1 -1
- package/dist/cdn/assets/assistant-chat-card/t9n/messages.sl.json +1 -1
- package/dist/cdn/assets/assistant-chat-card/t9n/messages.sr.json +1 -1
- package/dist/cdn/assets/assistant-chat-card/t9n/messages.sv.json +1 -1
- package/dist/cdn/assets/assistant-chat-card/t9n/messages.th.json +1 -1
- package/dist/cdn/assets/assistant-chat-card/t9n/messages.tr.json +1 -1
- package/dist/cdn/assets/assistant-chat-card/t9n/messages.uk.json +1 -1
- package/dist/cdn/assets/assistant-chat-card/t9n/messages.vi.json +1 -1
- package/dist/cdn/assets/assistant-chat-card/t9n/messages.zh-CN.json +1 -1
- package/dist/cdn/assets/assistant-chat-card/t9n/messages.zh-HK.json +1 -1
- package/dist/cdn/assets/assistant-chat-card/t9n/messages.zh-TW.json +1 -1
- package/dist/cdn/assets/assistant-chat-entry/t9n/messages.ar.json +1 -1
- package/dist/cdn/assets/assistant-chat-entry/t9n/messages.bg.json +1 -1
- package/dist/cdn/assets/assistant-chat-entry/t9n/messages.bs.json +1 -1
- package/dist/cdn/assets/assistant-chat-entry/t9n/messages.ca.json +1 -1
- package/dist/cdn/assets/assistant-chat-entry/t9n/messages.cs.json +1 -1
- package/dist/cdn/assets/assistant-chat-entry/t9n/messages.da.json +1 -1
- package/dist/cdn/assets/assistant-chat-entry/t9n/messages.de.json +1 -1
- package/dist/cdn/assets/assistant-chat-entry/t9n/messages.el.json +1 -1
- package/dist/cdn/assets/assistant-chat-entry/t9n/messages.es.json +1 -1
- package/dist/cdn/assets/assistant-chat-entry/t9n/messages.et.json +1 -1
- package/dist/cdn/assets/assistant-chat-entry/t9n/messages.fi.json +1 -1
- package/dist/cdn/assets/assistant-chat-entry/t9n/messages.fr.json +1 -1
- package/dist/cdn/assets/assistant-chat-entry/t9n/messages.he.json +1 -1
- package/dist/cdn/assets/assistant-chat-entry/t9n/messages.hr.json +1 -1
- package/dist/cdn/assets/assistant-chat-entry/t9n/messages.hu.json +1 -1
- package/dist/cdn/assets/assistant-chat-entry/t9n/messages.id.json +1 -1
- package/dist/cdn/assets/assistant-chat-entry/t9n/messages.it.json +1 -1
- package/dist/cdn/assets/assistant-chat-entry/t9n/messages.ja.json +1 -1
- package/dist/cdn/assets/assistant-chat-entry/t9n/messages.ko.json +1 -1
- package/dist/cdn/assets/assistant-chat-entry/t9n/messages.lt.json +1 -1
- package/dist/cdn/assets/assistant-chat-entry/t9n/messages.lv.json +1 -1
- package/dist/cdn/assets/assistant-chat-entry/t9n/messages.nl.json +1 -1
- package/dist/cdn/assets/assistant-chat-entry/t9n/messages.no.json +1 -1
- package/dist/cdn/assets/assistant-chat-entry/t9n/messages.pl.json +1 -1
- package/dist/cdn/assets/assistant-chat-entry/t9n/messages.pt-BR.json +1 -1
- package/dist/cdn/assets/assistant-chat-entry/t9n/messages.pt-PT.json +1 -1
- package/dist/cdn/assets/assistant-chat-entry/t9n/messages.ro.json +1 -1
- package/dist/cdn/assets/assistant-chat-entry/t9n/messages.ru.json +1 -1
- package/dist/cdn/assets/assistant-chat-entry/t9n/messages.sk.json +1 -1
- package/dist/cdn/assets/assistant-chat-entry/t9n/messages.sl.json +1 -1
- package/dist/cdn/assets/assistant-chat-entry/t9n/messages.sr.json +1 -1
- package/dist/cdn/assets/assistant-chat-entry/t9n/messages.sv.json +1 -1
- package/dist/cdn/assets/assistant-chat-entry/t9n/messages.th.json +1 -1
- package/dist/cdn/assets/assistant-chat-entry/t9n/messages.tr.json +1 -1
- package/dist/cdn/assets/assistant-chat-entry/t9n/messages.uk.json +1 -1
- package/dist/cdn/assets/assistant-chat-entry/t9n/messages.vi.json +1 -1
- package/dist/cdn/assets/assistant-chat-entry/t9n/messages.zh-CN.json +1 -1
- package/dist/cdn/assets/assistant-chat-entry/t9n/messages.zh-HK.json +1 -1
- package/dist/cdn/assets/assistant-chat-entry/t9n/messages.zh-TW.json +1 -1
- package/dist/cdn/assets/assistant-interrupt/t9n/messages.ar.json +1 -1
- package/dist/cdn/assets/assistant-interrupt/t9n/messages.bg.json +1 -1
- package/dist/cdn/assets/assistant-interrupt/t9n/messages.bs.json +1 -1
- package/dist/cdn/assets/assistant-interrupt/t9n/messages.ca.json +1 -1
- package/dist/cdn/assets/assistant-interrupt/t9n/messages.cs.json +1 -1
- package/dist/cdn/assets/assistant-interrupt/t9n/messages.da.json +1 -1
- package/dist/cdn/assets/assistant-interrupt/t9n/messages.de.json +1 -1
- package/dist/cdn/assets/assistant-interrupt/t9n/messages.el.json +1 -1
- package/dist/cdn/assets/assistant-interrupt/t9n/messages.es.json +1 -1
- package/dist/cdn/assets/assistant-interrupt/t9n/messages.et.json +1 -1
- package/dist/cdn/assets/assistant-interrupt/t9n/messages.fi.json +1 -1
- package/dist/cdn/assets/assistant-interrupt/t9n/messages.fr.json +1 -1
- package/dist/cdn/assets/assistant-interrupt/t9n/messages.he.json +1 -1
- package/dist/cdn/assets/assistant-interrupt/t9n/messages.hr.json +1 -1
- package/dist/cdn/assets/assistant-interrupt/t9n/messages.hu.json +1 -1
- package/dist/cdn/assets/assistant-interrupt/t9n/messages.id.json +1 -1
- package/dist/cdn/assets/assistant-interrupt/t9n/messages.it.json +1 -1
- package/dist/cdn/assets/assistant-interrupt/t9n/messages.ja.json +1 -1
- package/dist/cdn/assets/assistant-interrupt/t9n/messages.ko.json +1 -1
- package/dist/cdn/assets/assistant-interrupt/t9n/messages.lt.json +1 -1
- package/dist/cdn/assets/assistant-interrupt/t9n/messages.lv.json +1 -1
- package/dist/cdn/assets/assistant-interrupt/t9n/messages.nl.json +1 -1
- package/dist/cdn/assets/assistant-interrupt/t9n/messages.no.json +1 -1
- package/dist/cdn/assets/assistant-interrupt/t9n/messages.pl.json +1 -1
- package/dist/cdn/assets/assistant-interrupt/t9n/messages.pt-BR.json +1 -1
- package/dist/cdn/assets/assistant-interrupt/t9n/messages.pt-PT.json +1 -1
- package/dist/cdn/assets/assistant-interrupt/t9n/messages.ro.json +1 -1
- package/dist/cdn/assets/assistant-interrupt/t9n/messages.ru.json +1 -1
- package/dist/cdn/assets/assistant-interrupt/t9n/messages.sk.json +1 -1
- package/dist/cdn/assets/assistant-interrupt/t9n/messages.sl.json +1 -1
- package/dist/cdn/assets/assistant-interrupt/t9n/messages.sr.json +1 -1
- package/dist/cdn/assets/assistant-interrupt/t9n/messages.sv.json +1 -1
- package/dist/cdn/assets/assistant-interrupt/t9n/messages.th.json +1 -1
- package/dist/cdn/assets/assistant-interrupt/t9n/messages.tr.json +1 -1
- package/dist/cdn/assets/assistant-interrupt/t9n/messages.uk.json +1 -1
- package/dist/cdn/assets/assistant-interrupt/t9n/messages.vi.json +1 -1
- package/dist/cdn/assets/assistant-interrupt/t9n/messages.zh-CN.json +1 -1
- package/dist/cdn/assets/assistant-interrupt/t9n/messages.zh-HK.json +1 -1
- package/dist/cdn/assets/assistant-interrupt/t9n/messages.zh-TW.json +1 -1
- package/dist/cdn/assets/assistant-shell/t9n/messages.ar.json +1 -1
- package/dist/cdn/assets/assistant-shell/t9n/messages.bg.json +1 -1
- package/dist/cdn/assets/assistant-shell/t9n/messages.bs.json +1 -1
- package/dist/cdn/assets/assistant-shell/t9n/messages.ca.json +1 -1
- package/dist/cdn/assets/assistant-shell/t9n/messages.cs.json +1 -1
- package/dist/cdn/assets/assistant-shell/t9n/messages.da.json +1 -1
- package/dist/cdn/assets/assistant-shell/t9n/messages.de.json +1 -1
- package/dist/cdn/assets/assistant-shell/t9n/messages.el.json +1 -1
- package/dist/cdn/assets/assistant-shell/t9n/messages.es.json +1 -1
- package/dist/cdn/assets/assistant-shell/t9n/messages.et.json +1 -1
- package/dist/cdn/assets/assistant-shell/t9n/messages.fi.json +1 -1
- package/dist/cdn/assets/assistant-shell/t9n/messages.fr.json +1 -1
- package/dist/cdn/assets/assistant-shell/t9n/messages.he.json +1 -1
- package/dist/cdn/assets/assistant-shell/t9n/messages.hr.json +1 -1
- package/dist/cdn/assets/assistant-shell/t9n/messages.hu.json +1 -1
- package/dist/cdn/assets/assistant-shell/t9n/messages.id.json +1 -1
- package/dist/cdn/assets/assistant-shell/t9n/messages.it.json +1 -1
- package/dist/cdn/assets/assistant-shell/t9n/messages.ja.json +1 -1
- package/dist/cdn/assets/assistant-shell/t9n/messages.ko.json +1 -1
- package/dist/cdn/assets/assistant-shell/t9n/messages.lt.json +1 -1
- package/dist/cdn/assets/assistant-shell/t9n/messages.lv.json +1 -1
- package/dist/cdn/assets/assistant-shell/t9n/messages.nl.json +1 -1
- package/dist/cdn/assets/assistant-shell/t9n/messages.no.json +1 -1
- package/dist/cdn/assets/assistant-shell/t9n/messages.pl.json +1 -1
- package/dist/cdn/assets/assistant-shell/t9n/messages.pt-BR.json +1 -1
- package/dist/cdn/assets/assistant-shell/t9n/messages.pt-PT.json +1 -1
- package/dist/cdn/assets/assistant-shell/t9n/messages.ro.json +1 -1
- package/dist/cdn/assets/assistant-shell/t9n/messages.ru.json +1 -1
- package/dist/cdn/assets/assistant-shell/t9n/messages.sk.json +1 -1
- package/dist/cdn/assets/assistant-shell/t9n/messages.sl.json +1 -1
- package/dist/cdn/assets/assistant-shell/t9n/messages.sr.json +1 -1
- package/dist/cdn/assets/assistant-shell/t9n/messages.sv.json +1 -1
- package/dist/cdn/assets/assistant-shell/t9n/messages.th.json +1 -1
- package/dist/cdn/assets/assistant-shell/t9n/messages.tr.json +1 -1
- package/dist/cdn/assets/assistant-shell/t9n/messages.uk.json +1 -1
- package/dist/cdn/assets/assistant-shell/t9n/messages.vi.json +1 -1
- package/dist/cdn/assets/assistant-shell/t9n/messages.zh-CN.json +1 -1
- package/dist/cdn/assets/assistant-shell/t9n/messages.zh-HK.json +1 -1
- package/dist/cdn/assets/assistant-shell/t9n/messages.zh-TW.json +1 -1
- package/dist/cdn/index.js +1 -1
- package/dist/components/arcgis-assistant/customElement.js +3 -1
- package/dist/components/arcgis-assistant-chat-entry/customElement.js +3 -1
- package/dist/components/arcgis-assistant-chat-entry-speech-input/customElement.js +3 -1
- package/dist/docs/api.json +1 -1
- package/dist/docs/docs.json +1 -1
- package/dist/docs/web-types.json +1 -1
- package/package.json +7 -7
- package/dist/cdn/6IDESYBP.js +0 -2
- package/dist/cdn/BSIB6MUI.js +0 -20
- package/dist/cdn/X34ZV777.js +0 -225
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
+
import"./CFDTXKJ6.js";var e=`## GIS Agent Orchestrator
|
|
3
|
+
|
|
4
|
+
You are an orchestrator for an ArcGIS Maps SDK for JavaScript system.
|
|
5
|
+
|
|
6
|
+
Your job is to decide the single best next agent to execute for the current step.
|
|
7
|
+
|
|
8
|
+
You are given:
|
|
9
|
+
|
|
10
|
+
- the latest user request
|
|
11
|
+
- relevant chat history
|
|
12
|
+
- the list of registered agents
|
|
13
|
+
- optional prior steps from earlier agent executions
|
|
14
|
+
|
|
15
|
+
Return either:
|
|
16
|
+
|
|
17
|
+
- one decision with:
|
|
18
|
+
1. \`agentId\` \u2014 the next agent to execute
|
|
19
|
+
2. \`assignedTask\` \u2014 a clear, actionable task for that agent
|
|
20
|
+
3. \`requiresFollowUp\` \u2014 whether another orchestration step will likely be needed after this agent succeeds
|
|
21
|
+
- or \`null\` if no registered agent applies
|
|
22
|
+
|
|
23
|
+
Latest user request:
|
|
24
|
+
{userRequest}
|
|
25
|
+
|
|
26
|
+
Registered agents are provided in this format:
|
|
27
|
+
{{id: string, name: string, description: string}}[]
|
|
28
|
+
|
|
29
|
+
{registeredAgents}
|
|
30
|
+
|
|
31
|
+
Prior steps performed by agents are provided:
|
|
32
|
+
|
|
33
|
+
Each step has:
|
|
34
|
+
|
|
35
|
+
- agentId: string
|
|
36
|
+
- assignedTask: string
|
|
37
|
+
- summary: string
|
|
38
|
+
- status: "success" | "failed" | "partial"
|
|
39
|
+
|
|
40
|
+
Use prior steps to:
|
|
41
|
+
|
|
42
|
+
- Avoid repeating work that has already succeeded
|
|
43
|
+
- Continue or refine steps that were partial
|
|
44
|
+
- Retry or adjust steps that failed when appropriate
|
|
45
|
+
|
|
46
|
+
{priorSteps}
|
|
47
|
+
|
|
48
|
+
Rules:
|
|
49
|
+
|
|
50
|
+
- Focus primarily on the latest user request.
|
|
51
|
+
- Use relevant chat history only when the latest request clearly depends on earlier context; otherwise ignore it.
|
|
52
|
+
- Use prior steps to determine what has already been attempted or completed.
|
|
53
|
+
- Do not plan the full workflow up front. Only decide the next best step.
|
|
54
|
+
- Prefer an agent that can directly complete the user\u2019s request.
|
|
55
|
+
- Only break the request into multiple steps when necessary.
|
|
56
|
+
|
|
57
|
+
Assigned Task Guidelines (IMPORTANT):
|
|
58
|
+
|
|
59
|
+
- The assignedTask should be specific, short, and directly executable by the selected agent.
|
|
60
|
+
- Keep it as close as possible to the user\u2019s request.
|
|
61
|
+
- Prefer minimal transformation of the user\u2019s wording.
|
|
62
|
+
- It should be a concise restatement, not a rewritten or expanded version.
|
|
63
|
+
- Do not rephrase into more detailed or formal language than the user\u2019s request.
|
|
64
|
+
- Use only information explicitly present in the user request or provided context.
|
|
65
|
+
- Do not enrich, elaborate, or add unstated details.
|
|
66
|
+
- Do not clarify or expand the request beyond what the user explicitly stated.
|
|
67
|
+
- Do not add implementation details, UI behavior, or inferred steps.
|
|
68
|
+
- The assignedTask may represent only part of the user\u2019s full request when multiple steps are necessary.
|
|
69
|
+
|
|
70
|
+
requiresFollowUp Guidelines:
|
|
71
|
+
|
|
72
|
+
- requiresFollowUp should indicate a likely next agent step, not uncertainty about the current request.
|
|
73
|
+
- Set requiresFollowUp to true only when another orchestration step will likely be needed after this agent succeeds.
|
|
74
|
+
- Set requiresFollowUp to false when a successful result from this agent would likely complete the user-visible task.
|
|
75
|
+
`;export{e as default};
|
|
@@ -3,7 +3,7 @@ import"./CFDTXKJ6.js";var e=`# ArcGIS JavaScript SDK FeatureLayerView Query Assi
|
|
|
3
3
|
|
|
4
4
|
You are a GIS assistant that generates query parameters for the ArcGIS JavaScript SDK FeatureLayerView \`queryFeatures()\` method.
|
|
5
5
|
|
|
6
|
-
Analyze the
|
|
6
|
+
Analyze the assigned task and construct appropriate query parameters for each relevant layer. Only include parameters that are necessary to answer the assigned task.
|
|
7
7
|
|
|
8
8
|
## Layer and Field Information
|
|
9
9
|
|
|
@@ -16,7 +16,7 @@ You are only allowed to use the field names listed under each layer. Do not inve
|
|
|
16
16
|
|
|
17
17
|
## Critical Guard \u2014 Do NOT Hallucinate Fields
|
|
18
18
|
|
|
19
|
-
If the
|
|
19
|
+
If the assigned task asks for a filter that requires a field not present in the list above, do not invent the field and do not include it.
|
|
20
20
|
|
|
21
21
|
Instead:
|
|
22
22
|
If you can still answer something with the allowed fields, do so (for example: return an unfiltered count).
|
|
@@ -27,11 +27,23 @@ Validator: Before producing output, verify every field used exists in the listed
|
|
|
27
27
|
|
|
28
28
|
## Input
|
|
29
29
|
|
|
30
|
-
|
|
30
|
+
Assigned task:
|
|
31
|
+
{assignedTask}
|
|
32
|
+
|
|
33
|
+
Latest user request:
|
|
34
|
+
{userRequest}
|
|
35
|
+
|
|
36
|
+
Prior steps:
|
|
37
|
+
{priorSteps}
|
|
38
|
+
|
|
39
|
+
Use the assigned task as the primary instruction for the current query.
|
|
40
|
+
Use the latest user request as supporting context when needed.
|
|
41
|
+
Use prior steps only when the assigned task or user request clearly depends on earlier results.
|
|
42
|
+
Use chat history only when necessary to understand conversational references, and do not override the assigned task.
|
|
31
43
|
|
|
32
44
|
### Fresh WHERE clause rule
|
|
33
45
|
|
|
34
|
-
Start with a fresh WHERE clause for each new question. Do not inherit filters from previous questions UNLESS the
|
|
46
|
+
Start with a fresh WHERE clause for each new question. Do not inherit filters from previous questions UNLESS the assigned task explicitly references previous results (see "Referencing Previously Identified Features" below).
|
|
35
47
|
|
|
36
48
|
### Rules for generating WHERE clause SQL expressions:
|
|
37
49
|
|
|
@@ -51,7 +63,7 @@ Start with a fresh WHERE clause for each new question. Do not inherit filters fr
|
|
|
51
63
|
|
|
52
64
|
This is an exception to the "fresh WHERE clause" rule above.
|
|
53
65
|
|
|
54
|
-
When the
|
|
66
|
+
When the assigned task uses words like "these", "those", "them", "the same ones" referring to features from a previous turn:
|
|
55
67
|
|
|
56
68
|
- If the previous query used useCurrentExtent: true \u2192 use useCurrentExtent: true with where: "1=1"
|
|
57
69
|
- If the previous assistant response mentions specific objectIds or feature IDs \u2192 use {{objectIdField}} IN (id1, id2, ...) to scope to those features
|
|
@@ -95,7 +107,7 @@ not a large collection that requires union operations.
|
|
|
95
107
|
|
|
96
108
|
### NOTE:
|
|
97
109
|
|
|
98
|
-
If the
|
|
110
|
+
If the assigned task includes no filter (where: 1=1) and the answer can be derived from precomputed fieldStatistics, do NOT call a tool. Instead, respond directly using the provided statistics.
|
|
99
111
|
|
|
100
112
|
If you cannot answer directly, you MUST call a tool.
|
|
101
113
|
|
|
@@ -111,6 +123,6 @@ Format: \`TIMESTAMP 'YYYY-MM-DD HH:MM:SS'\`
|
|
|
111
123
|
|
|
112
124
|
## Your Task
|
|
113
125
|
|
|
114
|
-
1. Analyze the
|
|
115
|
-
2. Select zero or one most appropriate tool to call based on the
|
|
126
|
+
1. Analyze the assigned task and the provided layer and field information.
|
|
127
|
+
2. Select zero or one most appropriate tool to call based on the assigned task.
|
|
116
128
|
`;export{e as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
2
|
var Y=globalThis,Z=Y.ShadowRoot&&(Y.ShadyCSS===void 0||Y.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,gt=Symbol(),Mt=new WeakMap,M=class{constructor(t,e,s){if(this._$cssResult$=!0,s!==gt)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o,e=this.t;if(Z&&t===void 0){let s=e!==void 0&&e.length===1;s&&(t=Mt.get(e)),t===void 0&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),s&&Mt.set(e,t))}return t}toString(){return this.cssText}},kt=o=>new M(typeof o=="string"?o:o+"",void 0,gt),be=(o,...t)=>{let e=o.length===1?o[0]:t.reduce((s,r,n)=>s+(i=>{if(i._$cssResult$===!0)return i.cssText;if(typeof i=="number")return i;throw Error("Value passed to 'css' function must be a 'css' function result: "+i+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(r)+o[n+1],o[0]);return new M(e,o,gt)},jt=(o,t)=>{if(Z)o.adoptedStyleSheets=t.map(e=>e instanceof CSSStyleSheet?e:e.styleSheet);else for(let e of t){let s=document.createElement("style"),r=Y.litNonce;r!==void 0&&s.setAttribute("nonce",r),s.textContent=e.cssText,o.appendChild(s)}},vt=Z?o=>o:o=>o instanceof CSSStyleSheet?(t=>{let e="";for(let s of t.cssRules)e+=s.cssText;return kt(e)})(o):o;var{is:_e,defineProperty:Ae,getOwnPropertyDescriptor:Ce,getOwnPropertyNames:we,getOwnPropertySymbols:Oe,getPrototypeOf:Te}=Object,tt=globalThis,Ht=tt.trustedTypes,Se=Ht?Ht.emptyScript:"",Pe=tt.reactiveElementPolyfillSupport,k=(o,t)=>o,X={toAttribute(o,t){switch(t){case Boolean:o=o?Se:null;break;case Object:case Array:o=o==null?o:JSON.stringify(o)}return o},fromAttribute(o,t){let e=o;switch(t){case Boolean:e=o!==null;break;case Number:e=o===null?null:Number(o);break;case Object:case Array:try{e=JSON.parse(o)}catch{e=null}}return e}},j=(o,t)=>!_e(o,t),zt={attribute:!0,type:String,converter:X,reflect:!1,useDefault:!1,hasChanged:j};Symbol.metadata??=Symbol("metadata"),tt.litPropertyMetadata??=new WeakMap;var _=class extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??=[]).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,e=zt){if(e.state&&(e.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(t)&&((e=Object.create(e)).wrapped=!0),this.elementProperties.set(t,e),!e.noAccessor){let s=Symbol(),r=this.getPropertyDescriptor(t,s,e);r!==void 0&&Ae(this.prototype,t,r)}}static getPropertyDescriptor(t,e,s){let{get:r,set:n}=Ce(this.prototype,t)??{get(){return this[e]},set(i){this[e]=i}};return{get:r,set(i){let a=r?.call(this);n?.call(this,i),this.requestUpdate(t,a,s)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??zt}static _$Ei(){if(this.hasOwnProperty(k("elementProperties")))return;let t=Te(this);t.finalize(),t.l!==void 0&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(k("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(k("properties"))){let e=this.properties,s=[...we(e),...Oe(e)];for(let r of s)this.createProperty(r,e[r])}let t=this[Symbol.metadata];if(t!==null){let e=litPropertyMetadata.get(t);if(e!==void 0)for(let[s,r]of e)this.elementProperties.set(s,r)}this._$Eh=new Map;for(let[e,s]of this.elementProperties){let r=this._$Eu(e,s);r!==void 0&&this._$Eh.set(r,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){let e=[];if(Array.isArray(t)){let s=new Set(t.flat(1/0).reverse());for(let r of s)e.unshift(vt(r))}else t!==void 0&&e.push(vt(t));return e}static _$Eu(t,e){let s=e.attribute;return s===!1?void 0:typeof s=="string"?s:typeof t=="string"?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise(t=>this.enableUpdating=t),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach(t=>t(this))}addController(t){(this._$EO??=new Set).add(t),this.renderRoot!==void 0&&this.isConnected&&t.hostConnected?.()}removeController(t){this._$EO?.delete(t)}_$E_(){let t=new Map,e=this.constructor.elementProperties;for(let s of e.keys())this.hasOwnProperty(s)&&(t.set(s,this[s]),delete this[s]);t.size>0&&(this._$Ep=t)}createRenderRoot(){let t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return jt(t,this.constructor.elementStyles),t}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach(t=>t.hostConnected?.())}enableUpdating(t){}disconnectedCallback(){this._$EO?.forEach(t=>t.hostDisconnected?.())}attributeChangedCallback(t,e,s){this._$AK(t,s)}_$ET(t,e){let s=this.constructor.elementProperties.get(t),r=this.constructor._$Eu(t,s);if(r!==void 0&&s.reflect===!0){let n=(s.converter?.toAttribute!==void 0?s.converter:X).toAttribute(e,s.type);this._$Em=t,n==null?this.removeAttribute(r):this.setAttribute(r,n),this._$Em=null}}_$AK(t,e){let s=this.constructor,r=s._$Eh.get(t);if(r!==void 0&&this._$Em!==r){let n=s.getPropertyOptions(r),i=typeof n.converter=="function"?{fromAttribute:n.converter}:n.converter?.fromAttribute!==void 0?n.converter:X;this._$Em=r;let a=i.fromAttribute(e,n.type);this[r]=a??this._$Ej?.get(r)??a,this._$Em=null}}requestUpdate(t,e,s,r=!1,n){if(t!==void 0){let i=this.constructor;if(r===!1&&(n=this[t]),s??=i.getPropertyOptions(t),!((s.hasChanged??j)(n,e)||s.useDefault&&s.reflect&&n===this._$Ej?.get(t)&&!this.hasAttribute(i._$Eu(t,s))))return;this.C(t,e,s)}this.isUpdatePending===!1&&(this._$ES=this._$EP())}C(t,e,{useDefault:s,reflect:r,wrapped:n},i){s&&!(this._$Ej??=new Map).has(t)&&(this._$Ej.set(t,i??e??this[t]),n!==!0||i!==void 0)||(this._$AL.has(t)||(this.hasUpdated||s||(e=void 0),this._$AL.set(t,e)),r===!0&&this._$Em!==t&&(this._$Eq??=new Set).add(t))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(e){Promise.reject(e)}let t=this.scheduleUpdate();return t!=null&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(let[r,n]of this._$Ep)this[r]=n;this._$Ep=void 0}let s=this.constructor.elementProperties;if(s.size>0)for(let[r,n]of s){let{wrapped:i}=n,a=this[r];i!==!0||this._$AL.has(r)||a===void 0||this.C(r,void 0,n,a)}}let t=!1,e=this._$AL;try{t=this.shouldUpdate(e),t?(this.willUpdate(e),this._$EO?.forEach(s=>s.hostUpdate?.()),this.update(e)):this._$EM()}catch(s){throw t=!1,this._$EM(),s}t&&this._$AE(e)}willUpdate(t){}_$AE(t){this._$EO?.forEach(e=>e.hostUpdated?.()),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return!0}update(t){this._$Eq&&=this._$Eq.forEach(e=>this._$ET(e,this[e])),this._$EM()}updated(t){}firstUpdated(t){}};_.elementStyles=[],_.shadowRootOptions={mode:"open"},_[k("elementProperties")]=new Map,_[k("finalized")]=new Map,Pe?.({ReactiveElement:_}),(tt.reactiveElementVersions??=[]).push("2.1.2");var $t=globalThis,Vt=o=>o,et=$t.trustedTypes,Bt=et?et.createPolicy("lit-html",{createHTML:o=>o}):void 0,bt="$lit$",A=`lit$${Math.random().toFixed(9).slice(2)}$`,_t="?"+A,Ne=`<${_t}>`,T=document,z=()=>T.createComment(""),V=o=>o===null||typeof o!="object"&&typeof o!="function",At=Array.isArray,Qt=o=>At(o)||typeof o?.[Symbol.iterator]=="function",Et=`[
|
|
3
3
|
\f\r]`,H=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,Wt=/-->/g,Ft=/>/g,w=RegExp(`>|${Et}(?:([^\\s"'>=/]+)(${Et}*=${Et}*(?:[^
|
|
4
|
-
\f\r"'\`<>=]|("|')|))|$)`,"g"),qt=/'/g,Gt=/"/g,Jt=/^(?:script|style|textarea|title)$/i,Ct=o=>(t,...e)=>({_$litType$:o,strings:t,values:e}),ps=Ct(1),us=Ct(2),fs=Ct(3),f=Symbol.for("lit-noChange"),d=Symbol.for("lit-nothing"),Kt=new WeakMap,O=T.createTreeWalker(T,129);function Yt(o,t){if(!At(o)||!o.hasOwnProperty("raw"))throw Error("invalid template strings array");return Bt!==void 0?Bt.createHTML(t):t}var Zt=(o,t)=>{let e=o.length-1,s=[],r,n=t===2?"<svg>":t===3?"<math>":"",i=H;for(let a=0;a<e;a++){let c=o[a],h,u,l=-1,m=0;for(;m<c.length&&(i.lastIndex=m,u=i.exec(c),u!==null);)m=i.lastIndex,i===H?u[1]==="!--"?i=Wt:u[1]!==void 0?i=Ft:u[2]!==void 0?(Jt.test(u[2])&&(r=RegExp("</"+u[2],"g")),i=w):u[3]!==void 0&&(i=w):i===w?u[0]===">"?(i=r??H,l=-1):u[1]===void 0?l=-2:(l=i.lastIndex-u[2].length,h=u[1],i=u[3]===void 0?w:u[3]==='"'?Gt:qt):i===Gt||i===qt?i=w:i===Wt||i===Ft?i=H:(i=w,r=void 0);let v=i===w&&o[a+1].startsWith("/>")?" ":"";n+=i===H?c+Ne:l>=0?(s.push(h),c.slice(0,l)+bt+c.slice(l)+A+v):c+A+(l===-2?a:v)}return[Yt(o,n+(o[e]||"<?>")+(t===2?"</svg>":t===3?"</math>":"")),s]},B=class o{constructor({strings:t,_$litType$:e},s){let r;this.parts=[];let n=0,i=0,a=t.length-1,c=this.parts,[h,u]=Zt(t,e);if(this.el=o.createElement(h,s),O.currentNode=this.el.content,e===2||e===3){let l=this.el.content.firstChild;l.replaceWith(...l.childNodes)}for(;(r=O.nextNode())!==null&&c.length<a;){if(r.nodeType===1){if(r.hasAttributes())for(let l of r.getAttributeNames())if(l.endsWith(bt)){let m=u[i++],v=r.getAttribute(l).split(A),C=/([.?@])?(.*)/.exec(m);c.push({type:1,index:n,name:C[2],strings:v,ctor:C[1]==="."?ot:C[1]==="?"?rt:C[1]==="@"?nt:P}),r.removeAttribute(l)}else l.startsWith(A)&&(c.push({type:6,index:n}),r.removeAttribute(l));if(Jt.test(r.tagName)){let l=r.textContent.split(A),m=l.length-1;if(m>0){r.textContent=et?et.emptyScript:"";for(let v=0;v<m;v++)r.append(l[v],z()),O.nextNode(),c.push({type:2,index:++n});r.append(l[m],z())}}}else if(r.nodeType===8)if(r.data===_t)c.push({type:2,index:n});else{let l=-1;for(;(l=r.data.indexOf(A,l+1))!==-1;)c.push({type:7,index:n}),l+=A.length-1}n++}}static createElement(t,e){let s=T.createElement("template");return s.innerHTML=t,s}};function S(o,t,e=o,s){if(t===f)return t;let r=s!==void 0?e._$Co?.[s]:e._$Cl,n=V(t)?void 0:t._$litDirective$;return r?.constructor!==n&&(r?._$AO?.(!1),n===void 0?r=void 0:(r=new n(o),r._$AT(o,e,s)),s!==void 0?(e._$Co??=[])[s]=r:e._$Cl=r),r!==void 0&&(t=S(o,r._$AS(o,t.values),r,s)),t}var st=class{constructor(t,e){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=e}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){let{el:{content:e},parts:s}=this._$AD,r=(t?.creationScope??T).importNode(e,!0);O.currentNode=r;let n=O.nextNode(),i=0,a=0,c=s[0];for(;c!==void 0;){if(i===c.index){let h;c.type===2?h=new L(n,n.nextSibling,this,t):c.type===1?h=new c.ctor(n,c.name,c.strings,this,t):c.type===6&&(h=new it(n,this,t)),this._$AV.push(h),c=s[++a]}i!==c?.index&&(n=O.nextNode(),i++)}return O.currentNode=T,r}p(t){let e=0;for(let s of this._$AV)s!==void 0&&(s.strings!==void 0?(s._$AI(t,s,e),e+=s.strings.length-2):s._$AI(t[e])),e++}},L=class o{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(t,e,s,r){this.type=2,this._$AH=d,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=s,this.options=r,this._$Cv=r?.isConnected??!0}get parentNode(){let t=this._$AA.parentNode,e=this._$AM;return e!==void 0&&t?.nodeType===11&&(t=e.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,e=this){t=S(this,t,e),V(t)?t===d||t==null||t===""?(this._$AH!==d&&this._$AR(),this._$AH=d):t!==this._$AH&&t!==f&&this._(t):t._$litType$!==void 0?this.$(t):t.nodeType!==void 0?this.T(t):Qt(t)?this.k(t):this._(t)}O(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.O(t))}_(t){this._$AH!==d&&V(this._$AH)?this._$AA.nextSibling.data=t:this.T(T.createTextNode(t)),this._$AH=t}$(t){let{values:e,_$litType$:s}=t,r=typeof s=="number"?this._$AC(t):(s.el===void 0&&(s.el=B.createElement(Yt(s.h,s.h[0]),this.options)),s);if(this._$AH?._$AD===r)this._$AH.p(e);else{let n=new st(r,this),i=n.u(this.options);n.p(e),this.T(i),this._$AH=n}}_$AC(t){let e=Kt.get(t.strings);return e===void 0&&Kt.set(t.strings,e=new B(t)),e}k(t){At(this._$AH)||(this._$AH=[],this._$AR());let e=this._$AH,s,r=0;for(let n of t)r===e.length?e.push(s=new o(this.O(z()),this.O(z()),this,this.options)):s=e[r],s._$AI(n),r++;r<e.length&&(this._$AR(s&&s._$AB.nextSibling,r),e.length=r)}_$AR(t=this._$AA.nextSibling,e){for(this._$AP?.(!1,!0,e);t!==this._$AB;){let s=Vt(t).nextSibling;Vt(t).remove(),t=s}}setConnected(t){this._$AM===void 0&&(this._$Cv=t,this._$AP?.(t))}},P=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,e,s,r,n){this.type=1,this._$AH=d,this._$AN=void 0,this.element=t,this.name=e,this._$AM=r,this.options=n,s.length>2||s[0]!==""||s[1]!==""?(this._$AH=Array(s.length-1).fill(new String),this.strings=s):this._$AH=d}_$AI(t,e=this,s,r){let n=this.strings,i=!1;if(n===void 0)t=S(this,t,e,0),i=!V(t)||t!==this._$AH&&t!==f,i&&(this._$AH=t);else{let a=t,c,h;for(t=n[0],c=0;c<n.length-1;c++)h=S(this,a[s+c],e,c),h===f&&(h=this._$AH[c]),i||=!V(h)||h!==this._$AH[c],h===d?t=d:t!==d&&(t+=(h??"")+n[c+1]),this._$AH[c]=h}i&&!r&&this.j(t)}j(t){t===d?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"")}},ot=class extends P{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===d?void 0:t}},rt=class extends P{constructor(){super(...arguments),this.type=4}j(t){this.element.toggleAttribute(this.name,!!t&&t!==d)}},nt=class extends P{constructor(t,e,s,r,n){super(t,e,s,r,n),this.type=5}_$AI(t,e=this){if((t=S(this,t,e,0)??d)===f)return;let s=this._$AH,r=t===d&&s!==d||t.capture!==s.capture||t.once!==s.once||t.passive!==s.passive,n=t!==d&&(s===d||r);r&&this.element.removeEventListener(this.name,this,s),n&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){typeof this._$AH=="function"?this._$AH.call(this.options?.host??this.element,t):this._$AH.handleEvent(t)}},it=class{constructor(t,e,s){this.element=t,this.type=6,this._$AN=void 0,this._$AM=e,this.options=s}get _$AU(){return this._$AM._$AU}_$AI(t){S(this,t)}},Xt={M:bt,P:A,A:_t,C:1,L:Zt,R:st,D:Qt,V:S,I:L,H:P,N:rt,U:nt,B:ot,F:it},De=$t.litHtmlPolyfillSupport;De?.(B,L),($t.litHtmlVersions??=[]).push("3.3.2");var wt=(o,t,e)=>{let s=e?.renderBefore??t,r=s._$litPart$;if(r===void 0){let n=e?.renderBefore??null;s._$litPart$=r=new L(t.insertBefore(z(),n),n,void 0,e??{})}return r._$AI(o),r};var Ot=globalThis,E=class extends _{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){let t=super.createRenderRoot();return this.renderOptions.renderBefore??=t.firstChild,t}update(t){let e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=wt(e,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return f}};E._$litElement$=!0,E.finalized=!0,Ot.litElementHydrateSupport?.({LitElement:E});var xe=Ot.litElementPolyfillSupport;xe?.({LitElement:E});(Ot.litElementVersions??=[]).push("4.2.2");var te=new Set,ee;var se=o=>typeof o=="string"?o:"el"in o?o.el.localName:"localName"in o?o.localName:o.declaredClass,Ts=(o,t,e,s)=>{let r=se(t);if(s?.once){let i=`${o}${r}${e}`;if(te.has(i))return;te.add(i)}let n;if(s?.detail){n={};for(let[i,a]of Object.entries(s.detail))if((typeof a=="object"||typeof a=="function")&&a!==null){let c=new WeakRef(a);Object.defineProperty(n,i,{get(){return c.deref()}})}else n[i]=a;ee?.log.interceptors?.forEach(i=>i(o,r,e,n)),console[o](`[${r}]: ${e}`,n)}else ee?.log.interceptors?.forEach(i=>i(o,r,e)),console[o](`[${r}]: ${e}`)},oe=o=>{let t=`[${se(o)}] `;return e=>{let s=e instanceof Error&&e.message?e:new Error(String(e));s.message=`${t}${s.message}`,setTimeout(()=>{throw e})}};var p=(o,t,...e)=>{try{return o?.call(t,...e)}catch(s){console.error(s,o)}},W=async(o,t,...e)=>{try{return await o?.call(t,...e)}catch(s){console.error(s,o)}};var q=Symbol.for("controller"),Le=o=>typeof o=="object"&&o!==null&&(q in o||"hostConnected"in o||"hostDisconnected"in o||"hostUpdate"in o||"hostUpdated"in o),Ns=o=>typeof o?.then=="function";var F,D=o=>{F!==o&&(F=o,queueMicrotask(()=>F===o?F=void 0:0))},G=o=>F,N=[],re=o=>{if(o===void 0){N=[];return}let t=N.indexOf(o);N=t===-1?[...N,o]:N.slice(0,t+1),queueMicrotask(()=>N=[])},ne=()=>N,U,Ds=o=>{U!==o&&(U=o,queueMicrotask(()=>U===o?U=void 0:0))},Ue=()=>{let o=U;return U=void 0,o},ie=async(o,t)=>{let e=ct(o);if(e===void 0)return o;if(await e.ready,typeof t=="function"){let s=e.watchExports(r=>t(r,s))}return e.exports},ae=async o=>{let t=ct(o);return await t.ready,t},ct=o=>{let e=G().manager.X(o);if(e!==void 0)return e;if(Le(o))return o;let s=Ue();if(s!==void 0)return s},at=!1,xs=o=>{at=!0;try{return o()}finally{at=!1}};var b=class{constructor(){this.promise=new Promise((t,e)=>{this.resolve=t,this.reject=e})}},ce=(o,t)=>{let e=t>Re?Ie:t/Me,s=0,r=setInterval(()=>{s+=e,s>=t&&(clearInterval(r),o())},e);return r},Re=4e3,Ie=2e3,Me=4;var ke=(o,t,e)=>{let s=Object.keys(o),r=s.length;R===void 0&&queueMicrotask(I),R??=new Map;let n=R.get(o);return n===void 0&&(n={callbacks:[],keyCount:r},R.set(o,n)),n.keyCount!==r&&(n.callbacks.forEach(i=>i(s)),n.callbacks=[],n.keyCount=r),n.callbacks.push(i=>{let a=h=>p(t,null,h),c=i[r];c===void 0?a(void 0):o[c]===e?a(c):a(void 0)}),e},R,I=()=>{R?.forEach(({callbacks:o},t)=>{let e=Object.keys(t);o.forEach(s=>s(e))}),R=void 0},je=(o,t,e)=>{let s=o.manager;return s.V!==d&&s.V!==e&&s.S(void 0,void 0),s.T.length===0&&queueMicrotask(()=>s.S(void 0,void 0)),s.V=e,s.T.push((r,n)=>p(t,void 0,e===n?r:void 0)),e},He=(o=[G(),...ne()],t,e)=>{let s=Array.isArray(o)?o:[o],r=s.length+1,n=i=>{r-=1,i!==void 0&&(r=Math.min(r,0)),r===0&&t(i)};s.forEach(i=>ke(i,a=>n(a===void 0?void 0:{key:a,host:i,isReactive:!1}),e));for(let i of s)if("manager"in i&&i.manager.component===i){je(i,a=>n(a===void 0?void 0:{key:a,host:i,isReactive:!0}),e);break}return e},ze=(o="",t={},e=G())=>{let s={emit:r=>{o===""&&I();let n=new CustomEvent(o,{detail:r,cancelable:!0,bubbles:!0,composed:!0,...t});return e.el.dispatchEvent(n),n}};return o===""&&He(void 0,r=>o=r.key,s),s},Ve=ze.bind(null,""),de;de=q;var Tt=class{constructor(t){this.#t=[],this.#e=[],this.#s=[],this.#r=[],this.#n=[],this.#c=[],this.#l=[],this.#d=[],this.#i=[],this.#p=!1,this.P=new b,this.connectedCalled=!1,this.loadedCalled=!1,this[de]=!0,this.#h=[];let e=this,s=t??G(new.target.name);e.#o=s,e.ready=e.P.promise,e.#a=he(e),e.component=s,e.#o.addController(e),e.#o.manager===void 0||(re(e),queueMicrotask(()=>e.catchUpLifecycle()))}#t;#e;#s;#r;#n;#c;#l;#d;#i;#p;#o;catchUpLifecycle(){let{manager:t}=this.#o;t.connectedCalled&&!this.connectedCalled&&this.triggerConnected(),t.#p&&this.triggerLoad().then(()=>t.loadedCalled&&this.triggerLoaded()).catch(oe(this.#o))}#a;get exports(){return this.#a}set exports(t){let e=this.#a;e!==t&&(this.#a=t,this.#h.forEach(p),this.connectedCalled&&this.O!==!1&&this.#o.requestUpdate(this.O,e)),this.P.resolve(t)}setProvisionalExports(t,e=!0){this.#a=e?he(t):t,this.#h.forEach(p)}#h;watchExports(t){let e=()=>t(this.#a);return this.#h.push(e),()=>void this.#h.splice(this.#h.indexOf(e),1)}get use(){return D(this.#o),ie}get useRef(){return D(this.#o),ae}get useRefSync(){return D(this.#o),ct}controllerRemoved(){this.#o.el.isConnected&&this.triggerDisconnected(),this.triggerDestroy()}onConnected(t){this.#t.push(t)}onDisconnected(t){this.#e.push(t)}onLoad(t){this.#s.push(t)}onLoaded(t){this.#r.push(t)}onUpdate(t){this.#n.push(t)}onUpdated(t){this.#c.push(t)}onDestroy(t){this.#l.push(t)}onLifecycle(t){this.#d.push(t),this.connectedCalled&&this.#o.el.isConnected&&this.#u(t)}triggerConnected(){let t=this;t.hostConnected&&p(t.hostConnected,t),t.#t.forEach(p),t.triggerLifecycle(),t.connectedCalled=!0}triggerDisconnected(){let t=this;t.hostDisconnected&&p(t.hostDisconnected,t),t.#e.forEach(p),t.#i.forEach(p),t.#i=[]}async triggerLoad(){if(this.#p)return;this.#p=!0;let t=this;t.hostLoad&&await W(t.hostLoad,t),this.#s.length>0&&await Promise.allSettled(this.#s.map(W)),this.P.resolve(this.#a)}triggerLoaded(){this.loadedCalled||(this.hostLoaded&&p(this.hostLoaded,this),this.#r.forEach(p),this.loadedCalled=!0)}triggerUpdate(t){this.hostUpdate&&p(this.hostUpdate,this,t),this.#n.forEach(le,t)}triggerUpdated(t){this.hostUpdated&&p(this.hostUpdated,this,t),this.#c.forEach(le,t)}triggerDestroy(){this.hostDestroy&&p(this.hostDestroy,this),this.#l.forEach(p)}triggerLifecycle(){this.hostLifecycle&&this.#u(()=>this.hostLifecycle()),this.#d.forEach(this.#u,this)}#u(t){D(this.#o);let e=p(t);(Array.isArray(e)?e:[e]).forEach(r=>{typeof r=="function"?this.#i.push(r):typeof r=="object"&&typeof r.remove=="function"&&this.#i.push(r.remove)})}};function le(o){p(o,void 0,this)}var pe=Tt,he=o=>{if(typeof o!="object"&&typeof o!="function"||o===null)return o;let t={get(s,r,n){if(!((r==="exports"||r==="_exports")&&r in s&&s[r]===e)&&(r in s||r in Promise.prototype||typeof r=="symbol"))return typeof s=="function"?s[r]:Reflect.get(s,r,n)}},e=new Proxy(o,t);return e};var{I:Bs}=Xt;var lt=o=>o.strings===void 0;var Be={},ue=(o,t=Be)=>o._$AH=t;var y={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},$=o=>(...t)=>({_$litDirective$:o,values:t}),g=class{constructor(t){}get _$AU(){return this._$AM._$AU}_$AT(t,e,s){this._$Ct=t,this._$AM=e,this._$Ci=s}_$AS(t,e){return this.update(t,e)}update(t,e){return this.render(...e)}};var K=(o,t)=>{let e=o._$AN;if(e===void 0)return!1;for(let s of e)s._$AO?.(t,!1),K(s,t);return!0},ht=o=>{let t,e;do{if((t=o._$AM)===void 0)break;e=t._$AN,e.delete(o),o=t}while(e?.size===0)},fe=o=>{for(let t;t=o._$AM;o=t){let e=t._$AN;if(e===void 0)t._$AN=e=new Set;else if(e.has(o))break;e.add(o),qe(t)}};function We(o){this._$AN!==void 0?(ht(this),this._$AM=o,fe(this)):this._$AM=o}function Fe(o,t=!1,e=0){let s=this._$AH,r=this._$AN;if(r!==void 0&&r.size!==0)if(t)if(Array.isArray(s))for(let n=e;n<s.length;n++)K(s[n],!1),ht(s[n]);else s!=null&&(K(s,!1),ht(s));else K(this,o)}var qe=o=>{o.type==y.CHILD&&(o._$AP??=Fe,o._$AQ??=We)},dt=class extends g{constructor(){super(...arguments),this._$AN=void 0}_$AT(t,e,s){super._$AT(t,e,s),fe(this),this.isConnected=t._$AU}_$AO(t,e=!0){t!==this.isConnected&&(this.isConnected=t,t?this.reconnected?.():this.disconnected?.()),e&&(K(this,t),ht(this))}setValue(t){if(lt(this._$Ct))this._$Ct._$AI(t,this);else{let e=[...this._$Ct._$AH];e[this._$Ci]=t,this._$Ct._$AI(e,this,0)}}disconnected(){}reconnected(){}};var Xs=()=>new Pt,Pt=class{},St=new WeakMap,Nt=$(class extends dt{render(o){return d}update(o,[t]){let e=t!==this.G;return e&&this.G!==void 0&&this.rt(void 0),(e||this.lt!==this.ct)&&(this.G=t,this.ht=o.options?.host,this.rt(this.ct=o.element)),d}rt(o){if(this.isConnected||(o=void 0),typeof this.G=="function"){let t=this.ht??globalThis,e=St.get(t);e===void 0&&(e=new WeakMap,St.set(t,e)),e.get(this.G)!==void 0&&this.G.call(this.ht,void 0),e.set(this.G,o),o!==void 0&&this.G.call(this.ht,o)}else this.G.value=o}get lt(){return typeof this.G=="function"?St.get(this.ht??globalThis)?.get(this.G):this.G?.value}disconnected(){this.lt===this.ct&&this.rt(void 0)}reconnected(){this.rt(this.ct)}});var pt=o=>o.replace(Ke,(t,e)=>`${e===0?"":"-"}${t.toLowerCase()}`),Ke=/[A-Z]+(?![a-z])|[A-Z]/gu;var uo="randomUUID"in crypto;var xt=o=>{let t=o;for(;t=t.parentNode??t.host;)if(t?.constructor?.lumina){let e=t;return e.manager?.loadedCalled||(e.J??e._offspring).push(o),(e.I??e._postLoad).promise}return!1},Lt={};function Ut(){}function Rt(o){for(let t of["Associated","Disabled","Reset","StateRestore"]){let e=`orm${t}Callback`;o.prototype["f"+e]=async function(...s){await this.componentOnReady(),(this.el??this).dispatchEvent(new CustomEvent(`luminaF${e}`,{detail:s}))}}}var Qe=(o,t)=>function(s,r){if(!globalThis.customElements)return;let i=(r??s??{}).resourcesUrl;i&&o.setAssetPath(i);for(let[a,[c,h="",u=0]]of Object.entries(t)){if(customElements.get(a))continue;let[l,m,v]=h.split(";"),C=l?l?.split(",").map(Je):void 0,yt=C?.map(([x])=>x),J=class extends Dt{static{this.formAssociated=u===1}static{this.observedAttributes=C?.map(([,x])=>x).filter(x=>x!=="")}static{this.C=yt}static{this.E=m?m?.split(","):void 0}static{this.D=v?.split(",")}static{this.L=a}static{this.K=o}constructor(){!J.B&&(J.B=c(),J.F()),super()}};customElements.define(a,J)}},ut=Object.defineProperty,Je=o=>{let t=o.split(":");return t.length===1?[t[0],pt(t[0])]:t},Ye=globalThis.HTMLElement??Ut,Dt=class extends Ye{constructor(){super(),this.#e={},this.#s=[],this.I=new b,this.H=new b,this.J=[];let t=this,e=t.constructor;t._offspring=t.J,t._postLoad=t.I,e.C?.forEach(s=>{Object.hasOwn(t,s)&&(t.#e[s]=t[s],delete t[s])}),e.A?t.#r({a:e.A}):e.B.then(async s=>{await e.K.p,t.#r(await(s.default?.then(r=>typeof r=="function"?{a:r}:r)??s))}).catch(s=>{t.H.reject(s),setTimeout(()=>{throw s})})}static{this.lumina=!0}static F(){for(let t of this.C??[])ut(this.prototype,t,{configurable:!0,enumerable:!0,get(){return this.#e[t]},set(e){this.#e[t]=e}});for(let t of this.E??[])ut(this.prototype,t,{async value(...e){return this.#t||await this.H.promise,await this.#t[t](...e)},configurable:!0});for(let t of this.D??[])ut(this.prototype,t,{value(...e){return this.#t[t](...e)},configurable:!0})}static{Rt(this)}#t;#e;#s;get manager(){return this.#t?.manager}attributeChangedCallback(t,e,s){this.#t?.attributeChangedCallback(t,e,s),this.#t||this.#s.push(t)}connectedCallback(){this.#t?this.#t.connectedCallback?.():queueMicrotask(()=>this.G=xt(this))}disconnectedCallback(){this.#t?.disconnectedCallback?.()}async componentOnReady(){return await this.H.promise,this}#r(t){let e=this.constructor,s=e.L,r=this.#e,n=Object.values(t).find(l=>l.L===s),i=`${s}--lazy`,a=n;for(;a&&!Object.hasOwn(a,"lumina");)a=Object.getPrototypeOf(a);Xe(a),!e.A&&(e.A=n,customElements.define(i,n)),n.N=this;let h=document.createElement(i);n.N=void 0,this.#t=h,this.#e=h,this.#s.forEach(l=>h.attributeChangedCallback(l,null,this.getAttribute(l))),Object.entries(r).forEach(Ze,h);let u=this.isConnected;(u||this.G)&&(h.connectedCallback?.(),u||h.disconnectedCallback())}addController(){}requestUpdate(){this.#t?.requestUpdate()}};function Ze([o,t]){this[o]=t}var Xe=o=>{let t=o.prototype,e=Element.prototype;Object.hasOwn(t,"isConnected")||(t.setAttribute=function(r,n){e.setAttribute.call(this.el,r,n)},t.removeAttribute=function(r){e.removeAttribute.call(this.el,r)},t.hasAttribute=function(r){return e.hasAttribute.call(this.el,r)},ut(t,"isConnected",{get(){return Reflect.get(e,"isConnected",this.el)}}))};var ft=class extends pe{constructor(t){super(t),this.destroyed=!1,this.R=!1,this.V=d,this.T=[],this.#s=new WeakMap,this.#e=t,this.exports=void 0,this.hasDestroy=mt in t&&typeof t.destroy=="function",E.prototype.addController.call(t,{hostConnected:()=>{if(this.destroyed){let e=t.el.localName;throw t.el.remove(),new Error(`The ${e} component has already been destroyed. It cannot be used again. If you meant to disconnect and reconnect a component without automatic destroy, set the ${mt} prop.`)}this.#t!==void 0&&clearTimeout(this.#t),I();for(let e of t.M)"triggerConnected"in e?e.triggerConnected():p(e.hostConnected,e)},hostDisconnected:()=>{for(let e of t.M)"triggerDisconnected"in e?e.triggerDisconnected():p(e.hostDisconnected,e);this.hasDestroy&&!this.destroyed&&this.U()},hostUpdate:()=>{for(let e of t.M)"triggerUpdate"in e?e.triggerUpdate(this.Q):p(e.hostUpdate,e,this.Q)},hostUpdated:()=>{for(let e of t.M)"triggerUpdated"in e?e.triggerUpdated(this.Q):p(e.hostUpdated,e,this.Q);this.Q=void 0}}),queueMicrotask(()=>this.R=!0),D(t)}#t;#e;async destroy(){if(!this.destroyed){this.#e.el.isConnected&&(this.hasDestroy=!1,this.#e.el.remove()),this.#t=void 0,this.destroyed=!0;for(let t of this.#e.M)"triggerDestroy"in t?t.triggerDestroy():p(t.hostDestroy,t);this.#e.M.splice(0)}}U(){if(this.#t!==void 0&&clearTimeout(this.#t),!this.#e.el.isConnected&&!this.#e.autoDestroyDisabled){let t=()=>void this.#e.destroy();this.#t=ce(t,ts)}}S(t,e){let s=this.T;this.V=d,this.T=[],s.forEach(r=>r(t,e))}#s;W(t,e){(typeof e=="object"&&e!==null||typeof e=="function")&&this.#s.set(e,t)}X(t){if(typeof t=="object"&&t!==null||typeof t=="function")return this.#s.get(t)}},ts=1e3,mt="autoDestroyDisabled";var ye=$(class extends g{constructor(o){if(super(o),o.type!==y.ATTRIBUTE||o.name!=="class"||o.strings?.length>2)throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.")}render(o){return" "+Object.keys(o).filter(t=>o[t]).join(" ")+" "}update(o,[t]){if(this.st===void 0){this.st=new Set,o.strings!==void 0&&(this.nt=new Set(o.strings.join(" ").split(/\s/).filter(s=>s!=="")));for(let s in t)t[s]&&!this.nt?.has(s)&&this.st.add(s);return this.render(t)}let e=o.element.classList;for(let s of this.st)s in t||(e.remove(s),this.st.delete(s));for(let s in t){let r=!!t[s];r===this.st.has(s)||this.nt?.has(s)||(r?(e.add(s),this.st.add(s)):(e.remove(s),this.st.delete(s)))}return f}});var ge="important",es=" !"+ge,ss=$(class extends g{constructor(o){if(super(o),o.type!==y.ATTRIBUTE||o.name!=="style"||o.strings?.length>2)throw Error("The `styleMap` directive must be used in the `style` attribute and must be the only part in the attribute.")}render(o){return Object.keys(o).reduce((t,e)=>{let s=o[e];return s==null?t:t+`${e=e.includes("-")?e:e.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g,"-$&").toLowerCase()}:${s};`},"")}update(o,[t]){let{style:e}=o.element;if(this.ft===void 0)return this.ft=new Set(Object.keys(t)),this.render(t);for(let s of this.ft)t[s]==null&&(this.ft.delete(s),s.includes("-")?e.removeProperty(s):e[s]=null);for(let s in t){let r=t[s];if(r!=null){this.ft.add(s);let n=typeof r=="string"&&r.endsWith(es);s.includes("-")||n?e.setProperty(s,n?r.slice(0,-11):r,n?ge:""):e[s]=r}}return f}});var os=$(class extends g{constructor(o){if(super(o),o.type!==y.PROPERTY&&o.type!==y.ATTRIBUTE&&o.type!==y.BOOLEAN_ATTRIBUTE)throw Error("The `live` directive is not allowed on child or event bindings");if(!lt(o))throw Error("`live` bindings can only contain a single expression")}render(o){return o}update(o,[t]){if(t===f||t===d)return t;let e=o.element,s=o.name;if(o.type===y.PROPERTY){if(t===e[s])return f}else if(o.type===y.BOOLEAN_ATTRIBUTE){if(!!t===e.hasAttribute(s))return f}else if(o.type===y.ATTRIBUTE&&e.getAttribute(s)===t+"")return f;return ue(o),t}});var ve=class o extends E{constructor(){super(),this.M=[],this.manager=new ft(this);let t=this,e=t.constructor,s=e.N,r=e.K.o,n=o.prototype.shouldUpdate;t.#r=s?.H??new b,t.I=s?.I??new b,t.J=s?.J??[],t._offspring=t.J,t._postLoad=t.I,t.el=s??t,t.#s=t.enableUpdating,t.enableUpdating=Ut,t.shouldUpdate!==n&&(t.#e=t.shouldUpdate,t.shouldUpdate=n),r&&(t.#t=new Map,e.elementProperties.forEach((i,a)=>t.#t.set(a,r()))),!1}static finalizeStyles(t){let e=super.finalizeStyles(t),s=this.shadowRootOptions===Lt;return this.K?.commonStyles===void 0||s?e:[this.K.commonStyles,...e]}static createProperty(t,e){let s=typeof e=="number"?e:Array.isArray(e)?e[0]:0,r=Array.isArray(e)?e[1]:void 0,n=r?.hasChanged??j,i={attribute:s&1&&typeof t=="string"?pt(t):!1,reflect:!!(s&2),type:s&4?Boolean:s&8?Number:void 0,state:!!(s&16),readOnly:!!(s&32),noAccessor:!!(s&64),c:!1,...r,hasChanged(a,c){let h=n(a,c);return i.c=h,h}};super.createProperty(t,i)}static getPropertyDescriptor(t,e,s){let r=this.K,n=super.getPropertyDescriptor(t,e,s);return s.d=n,{...n,get(){return r.t?.(this.#t.get(t)),n.get?.call(this)},set(i){let a=this.manager;if(s.readOnly&&!at&&(a.R||a.connectedCalled))throw Error(`Cannot assign to read-only property "${t}" of ${this.el.localName}. Trying to assign "${i}"`);n.set.call(this,i??void 0),s.c&&this.#t?.get(t)?.notify(),a.T.length>0&&(I(),a?.S(t,i))}}}static{this.lumina=!0}static{Rt(this)}#t;#e;#s;#r;#n;#c;get elementInternals(){return this.#c??=this.el.attachInternals(),this.#c}connectedCallback(){this.hasAttribute("defer-hydration")||this.#l(!0)}#l(t){let e=this.constructor.K.c?.(()=>this.requestUpdate());this.#n=e;let s=!this.manager.connectedCalled;t&&super.connectedCallback(),s?queueMicrotask(()=>this.#i().catch(r=>{this.#r.reject(r),setTimeout(()=>{throw r})})):e&&this.requestUpdate()}#d(t){try{this.#n.clear(),this.constructor.K.r(this.#n,()=>super.update(t))}catch(e){throw this.#n.clear(),e}}disconnectedCallback(){super.disconnectedCallback(),this.#n?.destroy(),this.#n=void 0}createRenderRoot(){let t=this.el.shadowRoot,e=this.constructor,s=e.shadowRootOptions,n=t??(s===Lt?this.el:this.el.attachShadow(s));if(t)return this.manager.connectedCalled||this.#l(!1),E.prototype.createRenderRoot.call(this),t;if(this.isConnected){let i=n.getRootNode();i.adoptedStyleSheets=[...i.adoptedStyleSheets,...e.elementStyles.map(a=>"styleSheet"in a?a.styleSheet:a)]}return n}async#i(){let t=this.el.G??xt(this.el);t&&await t;let e=[];for(let r of this.M)"triggerLoad"in r?e.push(r.triggerLoad()):e.push(W(r.hostLoad,r));await Promise.all(e),await this.load?.(),this.manager.hasDestroy&&this.manager.onUpdate(r=>r.has(mt)&&this.manager.U()),this.#s(!0),this.performUpdate(),this.I.resolve(),await 0;let s=this.J.filter(r=>!r.manager?.loadedCalled);s.length&&await Promise.allSettled(s.map(async r=>await r.componentOnReady())),this.J.length=0,this.el.setAttribute(this.constructor.K.hydratedAttribute,"");for(let r of this.M)"triggerLoaded"in r?r.triggerLoaded():p(r.hostLoaded,r);this.loaded?.(),this.#r.resolve()}shouldUpdate(t){return this.manager.Q=t,this.#e?.(t)??!0}update(t){this.#n?this.#d(t):super.update(t)}listen(t,e,s){let r=e?.bind(this)??e;this.manager.onLifecycle(()=>(this.el.addEventListener(t,r,s),()=>this.el.removeEventListener(t,r,s)))}listenOn(t,e,s,r){let n=s?.bind(this)??s;this.manager.onLifecycle(()=>(t.addEventListener(e,n,r),()=>t.removeEventListener(e,n,r)))}async componentOnReady(){return await this.#r.promise,this}addController(t){this.M.push(t),!(q in t)&&this.renderRoot&&this.el.isConnected&&t.hostConnected?.()}removeController(t){this.M.splice(this.M.indexOf(t),1),t.controllerRemoved?.()}};var $e=o=>{let t,e=r=>{t=new URL(r,globalThis.location?.href||void 0).href},s={...o,getAssetPath(r){let n=new URL(r,t);return n.origin!==globalThis.location?.origin?n.href:n.pathname},setAssetPath:e,customElement(r,n){n.K=s,n.L=r,customElements.get(r)||customElements.define(r,n)}};return e(o.defaultAssetPath),s};var _r=o=>typeof o=="object"&&o!=null?ye(o):o;var It=class extends g{#t;#e;constructor(t){super(t);let e=this;this.#e=function(r){return e.#t.call(this,r)}}render(t){return typeof t=="function"?(this.#t=t,Nt(this.#e)):Nt(t)}},Ar=$(It);var Cr=d;var Q=$e({defaultAssetPath:"https://jsdev.arcgis.com/5.1.0-next/ai-components/",hydratedAttribute:"hydrated"}),{customElement:Pr,getAssetPath:Nr,setAssetPath:Dr}=Q;Q.t=void 0;Q.o=void 0;Q.c=void 0;Q.r=void 0;export{Ns as a,D as b,re as c,ne as d,Ds as e,xs as f,be as g,ps as h,f as i,d as j,Ts as k,oe as l,He as m,Ve as n,Tt as o,Qe as p,y as q,$ as r,g as s,Xs as t,Nt as u,ve as v,_r as w,Cr as x,Q as y,Pr as z,Nr as A};
|
|
4
|
+
\f\r"'\`<>=]|("|')|))|$)`,"g"),qt=/'/g,Gt=/"/g,Jt=/^(?:script|style|textarea|title)$/i,Ct=o=>(t,...e)=>({_$litType$:o,strings:t,values:e}),ps=Ct(1),us=Ct(2),fs=Ct(3),f=Symbol.for("lit-noChange"),d=Symbol.for("lit-nothing"),Kt=new WeakMap,O=T.createTreeWalker(T,129);function Yt(o,t){if(!At(o)||!o.hasOwnProperty("raw"))throw Error("invalid template strings array");return Bt!==void 0?Bt.createHTML(t):t}var Zt=(o,t)=>{let e=o.length-1,s=[],r,n=t===2?"<svg>":t===3?"<math>":"",i=H;for(let a=0;a<e;a++){let c=o[a],h,u,l=-1,m=0;for(;m<c.length&&(i.lastIndex=m,u=i.exec(c),u!==null);)m=i.lastIndex,i===H?u[1]==="!--"?i=Wt:u[1]!==void 0?i=Ft:u[2]!==void 0?(Jt.test(u[2])&&(r=RegExp("</"+u[2],"g")),i=w):u[3]!==void 0&&(i=w):i===w?u[0]===">"?(i=r??H,l=-1):u[1]===void 0?l=-2:(l=i.lastIndex-u[2].length,h=u[1],i=u[3]===void 0?w:u[3]==='"'?Gt:qt):i===Gt||i===qt?i=w:i===Wt||i===Ft?i=H:(i=w,r=void 0);let v=i===w&&o[a+1].startsWith("/>")?" ":"";n+=i===H?c+Ne:l>=0?(s.push(h),c.slice(0,l)+bt+c.slice(l)+A+v):c+A+(l===-2?a:v)}return[Yt(o,n+(o[e]||"<?>")+(t===2?"</svg>":t===3?"</math>":"")),s]},B=class o{constructor({strings:t,_$litType$:e},s){let r;this.parts=[];let n=0,i=0,a=t.length-1,c=this.parts,[h,u]=Zt(t,e);if(this.el=o.createElement(h,s),O.currentNode=this.el.content,e===2||e===3){let l=this.el.content.firstChild;l.replaceWith(...l.childNodes)}for(;(r=O.nextNode())!==null&&c.length<a;){if(r.nodeType===1){if(r.hasAttributes())for(let l of r.getAttributeNames())if(l.endsWith(bt)){let m=u[i++],v=r.getAttribute(l).split(A),C=/([.?@])?(.*)/.exec(m);c.push({type:1,index:n,name:C[2],strings:v,ctor:C[1]==="."?ot:C[1]==="?"?rt:C[1]==="@"?nt:P}),r.removeAttribute(l)}else l.startsWith(A)&&(c.push({type:6,index:n}),r.removeAttribute(l));if(Jt.test(r.tagName)){let l=r.textContent.split(A),m=l.length-1;if(m>0){r.textContent=et?et.emptyScript:"";for(let v=0;v<m;v++)r.append(l[v],z()),O.nextNode(),c.push({type:2,index:++n});r.append(l[m],z())}}}else if(r.nodeType===8)if(r.data===_t)c.push({type:2,index:n});else{let l=-1;for(;(l=r.data.indexOf(A,l+1))!==-1;)c.push({type:7,index:n}),l+=A.length-1}n++}}static createElement(t,e){let s=T.createElement("template");return s.innerHTML=t,s}};function S(o,t,e=o,s){if(t===f)return t;let r=s!==void 0?e._$Co?.[s]:e._$Cl,n=V(t)?void 0:t._$litDirective$;return r?.constructor!==n&&(r?._$AO?.(!1),n===void 0?r=void 0:(r=new n(o),r._$AT(o,e,s)),s!==void 0?(e._$Co??=[])[s]=r:e._$Cl=r),r!==void 0&&(t=S(o,r._$AS(o,t.values),r,s)),t}var st=class{constructor(t,e){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=e}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){let{el:{content:e},parts:s}=this._$AD,r=(t?.creationScope??T).importNode(e,!0);O.currentNode=r;let n=O.nextNode(),i=0,a=0,c=s[0];for(;c!==void 0;){if(i===c.index){let h;c.type===2?h=new L(n,n.nextSibling,this,t):c.type===1?h=new c.ctor(n,c.name,c.strings,this,t):c.type===6&&(h=new it(n,this,t)),this._$AV.push(h),c=s[++a]}i!==c?.index&&(n=O.nextNode(),i++)}return O.currentNode=T,r}p(t){let e=0;for(let s of this._$AV)s!==void 0&&(s.strings!==void 0?(s._$AI(t,s,e),e+=s.strings.length-2):s._$AI(t[e])),e++}},L=class o{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(t,e,s,r){this.type=2,this._$AH=d,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=s,this.options=r,this._$Cv=r?.isConnected??!0}get parentNode(){let t=this._$AA.parentNode,e=this._$AM;return e!==void 0&&t?.nodeType===11&&(t=e.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,e=this){t=S(this,t,e),V(t)?t===d||t==null||t===""?(this._$AH!==d&&this._$AR(),this._$AH=d):t!==this._$AH&&t!==f&&this._(t):t._$litType$!==void 0?this.$(t):t.nodeType!==void 0?this.T(t):Qt(t)?this.k(t):this._(t)}O(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.O(t))}_(t){this._$AH!==d&&V(this._$AH)?this._$AA.nextSibling.data=t:this.T(T.createTextNode(t)),this._$AH=t}$(t){let{values:e,_$litType$:s}=t,r=typeof s=="number"?this._$AC(t):(s.el===void 0&&(s.el=B.createElement(Yt(s.h,s.h[0]),this.options)),s);if(this._$AH?._$AD===r)this._$AH.p(e);else{let n=new st(r,this),i=n.u(this.options);n.p(e),this.T(i),this._$AH=n}}_$AC(t){let e=Kt.get(t.strings);return e===void 0&&Kt.set(t.strings,e=new B(t)),e}k(t){At(this._$AH)||(this._$AH=[],this._$AR());let e=this._$AH,s,r=0;for(let n of t)r===e.length?e.push(s=new o(this.O(z()),this.O(z()),this,this.options)):s=e[r],s._$AI(n),r++;r<e.length&&(this._$AR(s&&s._$AB.nextSibling,r),e.length=r)}_$AR(t=this._$AA.nextSibling,e){for(this._$AP?.(!1,!0,e);t!==this._$AB;){let s=Vt(t).nextSibling;Vt(t).remove(),t=s}}setConnected(t){this._$AM===void 0&&(this._$Cv=t,this._$AP?.(t))}},P=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,e,s,r,n){this.type=1,this._$AH=d,this._$AN=void 0,this.element=t,this.name=e,this._$AM=r,this.options=n,s.length>2||s[0]!==""||s[1]!==""?(this._$AH=Array(s.length-1).fill(new String),this.strings=s):this._$AH=d}_$AI(t,e=this,s,r){let n=this.strings,i=!1;if(n===void 0)t=S(this,t,e,0),i=!V(t)||t!==this._$AH&&t!==f,i&&(this._$AH=t);else{let a=t,c,h;for(t=n[0],c=0;c<n.length-1;c++)h=S(this,a[s+c],e,c),h===f&&(h=this._$AH[c]),i||=!V(h)||h!==this._$AH[c],h===d?t=d:t!==d&&(t+=(h??"")+n[c+1]),this._$AH[c]=h}i&&!r&&this.j(t)}j(t){t===d?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"")}},ot=class extends P{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===d?void 0:t}},rt=class extends P{constructor(){super(...arguments),this.type=4}j(t){this.element.toggleAttribute(this.name,!!t&&t!==d)}},nt=class extends P{constructor(t,e,s,r,n){super(t,e,s,r,n),this.type=5}_$AI(t,e=this){if((t=S(this,t,e,0)??d)===f)return;let s=this._$AH,r=t===d&&s!==d||t.capture!==s.capture||t.once!==s.once||t.passive!==s.passive,n=t!==d&&(s===d||r);r&&this.element.removeEventListener(this.name,this,s),n&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){typeof this._$AH=="function"?this._$AH.call(this.options?.host??this.element,t):this._$AH.handleEvent(t)}},it=class{constructor(t,e,s){this.element=t,this.type=6,this._$AN=void 0,this._$AM=e,this.options=s}get _$AU(){return this._$AM._$AU}_$AI(t){S(this,t)}},Xt={M:bt,P:A,A:_t,C:1,L:Zt,R:st,D:Qt,V:S,I:L,H:P,N:rt,U:nt,B:ot,F:it},De=$t.litHtmlPolyfillSupport;De?.(B,L),($t.litHtmlVersions??=[]).push("3.3.2");var wt=(o,t,e)=>{let s=e?.renderBefore??t,r=s._$litPart$;if(r===void 0){let n=e?.renderBefore??null;s._$litPart$=r=new L(t.insertBefore(z(),n),n,void 0,e??{})}return r._$AI(o),r};var Ot=globalThis,E=class extends _{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){let t=super.createRenderRoot();return this.renderOptions.renderBefore??=t.firstChild,t}update(t){let e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=wt(e,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return f}};E._$litElement$=!0,E.finalized=!0,Ot.litElementHydrateSupport?.({LitElement:E});var xe=Ot.litElementPolyfillSupport;xe?.({LitElement:E});(Ot.litElementVersions??=[]).push("4.2.2");var te=new Set,ee;var se=o=>typeof o=="string"?o:"el"in o?o.el.localName:"localName"in o?o.localName:o.declaredClass,Ts=(o,t,e,s)=>{let r=se(t);if(s?.once){let i=`${o}${r}${e}`;if(te.has(i))return;te.add(i)}let n;if(s?.detail){n={};for(let[i,a]of Object.entries(s.detail))if((typeof a=="object"||typeof a=="function")&&a!==null){let c=new WeakRef(a);Object.defineProperty(n,i,{get(){return c.deref()}})}else n[i]=a;ee?.log.interceptors?.forEach(i=>i(o,r,e,n)),console[o](`[${r}]: ${e}`,n)}else ee?.log.interceptors?.forEach(i=>i(o,r,e)),console[o](`[${r}]: ${e}`)},oe=o=>{let t=`[${se(o)}] `;return e=>{let s=e instanceof Error&&e.message?e:new Error(String(e));s.message=`${t}${s.message}`,setTimeout(()=>{throw e})}};var p=(o,t,...e)=>{try{return o?.call(t,...e)}catch(s){console.error(s,o)}},W=async(o,t,...e)=>{try{return await o?.call(t,...e)}catch(s){console.error(s,o)}};var q=Symbol.for("controller"),Le=o=>typeof o=="object"&&o!==null&&(q in o||"hostConnected"in o||"hostDisconnected"in o||"hostUpdate"in o||"hostUpdated"in o),Ns=o=>typeof o?.then=="function";var F,D=o=>{F!==o&&(F=o,queueMicrotask(()=>F===o?F=void 0:0))},G=o=>F,N=[],re=o=>{if(o===void 0){N=[];return}let t=N.indexOf(o);N=t===-1?[...N,o]:N.slice(0,t+1),queueMicrotask(()=>N=[])},ne=()=>N,U,Ds=o=>{U!==o&&(U=o,queueMicrotask(()=>U===o?U=void 0:0))},Ue=()=>{let o=U;return U=void 0,o},ie=async(o,t)=>{let e=ct(o);if(e===void 0)return o;if(await e.ready,typeof t=="function"){let s=e.watchExports(r=>t(r,s))}return e.exports},ae=async o=>{let t=ct(o);return await t.ready,t},ct=o=>{let e=G().manager.X(o);if(e!==void 0)return e;if(Le(o))return o;let s=Ue();if(s!==void 0)return s},at=!1,xs=o=>{at=!0;try{return o()}finally{at=!1}};var b=class{constructor(){this.promise=new Promise((t,e)=>{this.resolve=t,this.reject=e})}},ce=(o,t)=>{let e=t>Re?Ie:t/Me,s=0,r=setInterval(()=>{s+=e,s>=t&&(clearInterval(r),o())},e);return r},Re=4e3,Ie=2e3,Me=4;var ke=(o,t,e)=>{let s=Object.keys(o),r=s.length;R===void 0&&queueMicrotask(I),R??=new Map;let n=R.get(o);return n===void 0&&(n={callbacks:[],keyCount:r},R.set(o,n)),n.keyCount!==r&&(n.callbacks.forEach(i=>i(s)),n.callbacks=[],n.keyCount=r),n.callbacks.push(i=>{let a=h=>p(t,null,h),c=i[r];c===void 0?a(void 0):o[c]===e?a(c):a(void 0)}),e},R,I=()=>{R?.forEach(({callbacks:o},t)=>{let e=Object.keys(t);o.forEach(s=>s(e))}),R=void 0},je=(o,t,e)=>{let s=o.manager;return s.V!==d&&s.V!==e&&s.S(void 0,void 0),s.T.length===0&&queueMicrotask(()=>s.S(void 0,void 0)),s.V=e,s.T.push((r,n)=>p(t,void 0,e===n?r:void 0)),e},He=(o=[G(),...ne()],t,e)=>{let s=Array.isArray(o)?o:[o],r=s.length+1,n=i=>{r-=1,i!==void 0&&(r=Math.min(r,0)),r===0&&t(i)};s.forEach(i=>ke(i,a=>n(a===void 0?void 0:{key:a,host:i,isReactive:!1}),e));for(let i of s)if("manager"in i&&i.manager.component===i){je(i,a=>n(a===void 0?void 0:{key:a,host:i,isReactive:!0}),e);break}return e},ze=(o="",t={},e=G())=>{let s={emit:r=>{o===""&&I();let n=new CustomEvent(o,{detail:r,cancelable:!0,bubbles:!0,composed:!0,...t});return e.el.dispatchEvent(n),n}};return o===""&&He(void 0,r=>o=r.key,s),s},Ve=ze.bind(null,""),de;de=q;var Tt=class{constructor(t){this.#t=[],this.#e=[],this.#s=[],this.#r=[],this.#n=[],this.#c=[],this.#l=[],this.#d=[],this.#i=[],this.#p=!1,this.P=new b,this.connectedCalled=!1,this.loadedCalled=!1,this[de]=!0,this.#h=[];let e=this,s=t??G(new.target.name);e.#o=s,e.ready=e.P.promise,e.#a=he(e),e.component=s,e.#o.addController(e),e.#o.manager===void 0||(re(e),queueMicrotask(()=>e.catchUpLifecycle()))}#t;#e;#s;#r;#n;#c;#l;#d;#i;#p;#o;catchUpLifecycle(){let{manager:t}=this.#o;t.connectedCalled&&!this.connectedCalled&&this.triggerConnected(),t.#p&&this.triggerLoad().then(()=>t.loadedCalled&&this.triggerLoaded()).catch(oe(this.#o))}#a;get exports(){return this.#a}set exports(t){let e=this.#a;e!==t&&(this.#a=t,this.#h.forEach(p),this.connectedCalled&&this.O!==!1&&this.#o.requestUpdate(this.O,e)),this.P.resolve(t)}setProvisionalExports(t,e=!0){this.#a=e?he(t):t,this.#h.forEach(p)}#h;watchExports(t){let e=()=>t(this.#a);return this.#h.push(e),()=>{this.#h.splice(this.#h.indexOf(e),1)}}get use(){return D(this.#o),ie}get useRef(){return D(this.#o),ae}get useRefSync(){return D(this.#o),ct}controllerRemoved(){this.#o.el.isConnected&&this.triggerDisconnected(),this.triggerDestroy()}onConnected(t){this.#t.push(t)}onDisconnected(t){this.#e.push(t)}onLoad(t){this.#s.push(t)}onLoaded(t){this.#r.push(t)}onUpdate(t){this.#n.push(t)}onUpdated(t){this.#c.push(t)}onDestroy(t){this.#l.push(t)}onLifecycle(t){this.#d.push(t),this.connectedCalled&&this.#o.el.isConnected&&this.#u(t)}triggerConnected(){let t=this;t.hostConnected&&p(t.hostConnected,t),t.#t.forEach(p),t.triggerLifecycle(),t.connectedCalled=!0}triggerDisconnected(){let t=this;t.hostDisconnected&&p(t.hostDisconnected,t),t.#e.forEach(p),t.#i.forEach(p),t.#i=[]}async triggerLoad(){if(this.#p)return;this.#p=!0;let t=this;t.hostLoad&&await W(t.hostLoad,t),this.#s.length>0&&await Promise.allSettled(this.#s.map(W)),this.P.resolve(this.#a)}triggerLoaded(){this.loadedCalled||(this.hostLoaded&&p(this.hostLoaded,this),this.#r.forEach(p),this.loadedCalled=!0)}triggerUpdate(t){this.hostUpdate&&p(this.hostUpdate,this,t),this.#n.forEach(le,t)}triggerUpdated(t){this.hostUpdated&&p(this.hostUpdated,this,t),this.#c.forEach(le,t)}triggerDestroy(){this.hostDestroy&&p(this.hostDestroy,this),this.#l.forEach(p)}triggerLifecycle(){this.hostLifecycle&&this.#u(()=>this.hostLifecycle()),this.#d.forEach(this.#u,this)}#u(t){D(this.#o);let e=p(t);(Array.isArray(e)?e:[e]).forEach(r=>{typeof r=="function"?this.#i.push(r):typeof r=="object"&&typeof r.remove=="function"&&this.#i.push(r.remove)})}};function le(o){p(o,void 0,this)}var pe=Tt,he=o=>{if(typeof o!="object"&&typeof o!="function"||o===null)return o;let t={get(s,r,n){if(!((r==="exports"||r==="_exports")&&r in s&&s[r]===e)&&(r in s||r in Promise.prototype||typeof r=="symbol"))return typeof s=="function"?s[r]:Reflect.get(s,r,n)}},e=new Proxy(o,t);return e};var{I:Bs}=Xt;var lt=o=>o.strings===void 0;var Be={},ue=(o,t=Be)=>o._$AH=t;var y={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},$=o=>(...t)=>({_$litDirective$:o,values:t}),g=class{constructor(t){}get _$AU(){return this._$AM._$AU}_$AT(t,e,s){this._$Ct=t,this._$AM=e,this._$Ci=s}_$AS(t,e){return this.update(t,e)}update(t,e){return this.render(...e)}};var K=(o,t)=>{let e=o._$AN;if(e===void 0)return!1;for(let s of e)s._$AO?.(t,!1),K(s,t);return!0},ht=o=>{let t,e;do{if((t=o._$AM)===void 0)break;e=t._$AN,e.delete(o),o=t}while(e?.size===0)},fe=o=>{for(let t;t=o._$AM;o=t){let e=t._$AN;if(e===void 0)t._$AN=e=new Set;else if(e.has(o))break;e.add(o),qe(t)}};function We(o){this._$AN!==void 0?(ht(this),this._$AM=o,fe(this)):this._$AM=o}function Fe(o,t=!1,e=0){let s=this._$AH,r=this._$AN;if(r!==void 0&&r.size!==0)if(t)if(Array.isArray(s))for(let n=e;n<s.length;n++)K(s[n],!1),ht(s[n]);else s!=null&&(K(s,!1),ht(s));else K(this,o)}var qe=o=>{o.type==y.CHILD&&(o._$AP??=Fe,o._$AQ??=We)},dt=class extends g{constructor(){super(...arguments),this._$AN=void 0}_$AT(t,e,s){super._$AT(t,e,s),fe(this),this.isConnected=t._$AU}_$AO(t,e=!0){t!==this.isConnected&&(this.isConnected=t,t?this.reconnected?.():this.disconnected?.()),e&&(K(this,t),ht(this))}setValue(t){if(lt(this._$Ct))this._$Ct._$AI(t,this);else{let e=[...this._$Ct._$AH];e[this._$Ci]=t,this._$Ct._$AI(e,this,0)}}disconnected(){}reconnected(){}};var Xs=()=>new Pt,Pt=class{},St=new WeakMap,Nt=$(class extends dt{render(o){return d}update(o,[t]){let e=t!==this.G;return e&&this.G!==void 0&&this.rt(void 0),(e||this.lt!==this.ct)&&(this.G=t,this.ht=o.options?.host,this.rt(this.ct=o.element)),d}rt(o){if(this.isConnected||(o=void 0),typeof this.G=="function"){let t=this.ht??globalThis,e=St.get(t);e===void 0&&(e=new WeakMap,St.set(t,e)),e.get(this.G)!==void 0&&this.G.call(this.ht,void 0),e.set(this.G,o),o!==void 0&&this.G.call(this.ht,o)}else this.G.value=o}get lt(){return typeof this.G=="function"?St.get(this.ht??globalThis)?.get(this.G):this.G?.value}disconnected(){this.lt===this.ct&&this.rt(void 0)}reconnected(){this.rt(this.ct)}});var pt=o=>o.replace(Ke,(t,e)=>`${e===0?"":"-"}${t.toLowerCase()}`),Ke=/[A-Z]+(?![a-z])|[A-Z]/gu;var uo="randomUUID"in crypto;var xt=o=>{let t=o;for(;t=t.parentNode??t.host;)if(t?.constructor?.lumina){let e=t;return e.manager?.loadedCalled||(e.J??e._offspring).push(o),(e.I??e._postLoad).promise}return!1},Lt={};function Ut(){}function Rt(o){for(let t of["Associated","Disabled","Reset","StateRestore"]){let e=`orm${t}Callback`;o.prototype["f"+e]=async function(...s){await this.componentOnReady(),(this.el??this).dispatchEvent(new CustomEvent(`luminaF${e}`,{detail:s}))}}}var Qe=(o,t)=>function(s,r){if(!globalThis.customElements)return;let i=(r??s??{}).resourcesUrl;i&&o.setAssetPath(i);for(let[a,[c,h="",u=0]]of Object.entries(t)){if(customElements.get(a))continue;let[l,m,v]=h.split(";"),C=l?l?.split(",").map(Je):void 0,yt=C?.map(([x])=>x),J=class extends Dt{static{this.formAssociated=u===1}static{this.observedAttributes=C?.map(([,x])=>x).filter(x=>x!=="")}static{this.C=yt}static{this.E=m?m?.split(","):void 0}static{this.D=v?.split(",")}static{this.L=a}static{this.K=o}constructor(){!J.B&&(J.B=c(),J.F()),super()}};customElements.define(a,J)}},ut=Object.defineProperty,Je=o=>{let t=o.split(":");return t.length===1?[t[0],pt(t[0])]:t},Ye=globalThis.HTMLElement??Ut,Dt=class extends Ye{constructor(){super(),this.#e={},this.#s=[],this.I=new b,this.H=new b,this.J=[];let t=this,e=t.constructor;t._offspring=t.J,t._postLoad=t.I,e.C?.forEach(s=>{Object.hasOwn(t,s)&&(t.#e[s]=t[s],delete t[s])}),e.A?t.#r({a:e.A}):e.B.then(async s=>{await e.K.p,t.#r(await(s.default?.then(r=>typeof r=="function"?{a:r}:r)??s))}).catch(s=>{t.H.reject(s),setTimeout(()=>{throw s})})}static{this.lumina=!0}static F(){for(let t of this.C??[])ut(this.prototype,t,{configurable:!0,enumerable:!0,get(){return this.#e[t]},set(e){this.#e[t]=e}});for(let t of this.E??[])ut(this.prototype,t,{async value(...e){return this.#t||await this.H.promise,await this.#t[t](...e)},configurable:!0});for(let t of this.D??[])ut(this.prototype,t,{value(...e){return this.#t[t](...e)},configurable:!0})}static{Rt(this)}#t;#e;#s;get manager(){return this.#t?.manager}attributeChangedCallback(t,e,s){this.#t?.attributeChangedCallback(t,e,s),this.#t||this.#s.push(t)}connectedCallback(){this.#t?this.#t.connectedCallback?.():queueMicrotask(()=>this.G=xt(this))}disconnectedCallback(){this.#t?.disconnectedCallback?.()}async componentOnReady(){return await this.H.promise,this}#r(t){let e=this.constructor,s=e.L,r=this.#e,n=Object.values(t).find(l=>l.L===s),i=`${s}--lazy`,a=n;for(;a&&!Object.hasOwn(a,"lumina");)a=Object.getPrototypeOf(a);Xe(a),!e.A&&(e.A=n,customElements.define(i,n)),n.N=this;let h=document.createElement(i);n.N=void 0,this.#t=h,this.#e=h,this.#s.forEach(l=>h.attributeChangedCallback(l,null,this.getAttribute(l))),Object.entries(r).forEach(Ze,h);let u=this.isConnected;(u||this.G)&&(h.connectedCallback?.(),u||h.disconnectedCallback())}addController(){}requestUpdate(){this.#t?.requestUpdate()}};function Ze([o,t]){this[o]=t}var Xe=o=>{let t=o.prototype,e=Element.prototype;Object.hasOwn(t,"isConnected")||(t.setAttribute=function(r,n){e.setAttribute.call(this.el,r,n)},t.removeAttribute=function(r){e.removeAttribute.call(this.el,r)},t.hasAttribute=function(r){return e.hasAttribute.call(this.el,r)},ut(t,"isConnected",{get(){return Reflect.get(e,"isConnected",this.el)}}))};var ft=class extends pe{constructor(t){super(t),this.destroyed=!1,this.R=!1,this.V=d,this.T=[],this.#s=new WeakMap,this.#e=t,this.exports=void 0,this.hasDestroy=mt in t&&typeof t.destroy=="function",E.prototype.addController.call(t,{hostConnected:()=>{if(this.destroyed){let e=t.el.localName;throw t.el.remove(),new Error(`The ${e} component has already been destroyed. It cannot be used again. If you meant to disconnect and reconnect a component without automatic destroy, set the ${mt} prop.`)}this.#t!==void 0&&clearTimeout(this.#t),I();for(let e of t.M)"triggerConnected"in e?e.triggerConnected():p(e.hostConnected,e)},hostDisconnected:()=>{for(let e of t.M)"triggerDisconnected"in e?e.triggerDisconnected():p(e.hostDisconnected,e);this.hasDestroy&&!this.destroyed&&this.U()},hostUpdate:()=>{for(let e of t.M)"triggerUpdate"in e?e.triggerUpdate(this.Q):p(e.hostUpdate,e,this.Q)},hostUpdated:()=>{for(let e of t.M)"triggerUpdated"in e?e.triggerUpdated(this.Q):p(e.hostUpdated,e,this.Q);this.Q=void 0}}),queueMicrotask(()=>this.R=!0),D(t)}#t;#e;async destroy(){if(!this.destroyed){this.#e.el.isConnected&&(this.hasDestroy=!1,this.#e.el.remove()),this.#t=void 0,this.destroyed=!0;for(let t of this.#e.M)"triggerDestroy"in t?t.triggerDestroy():p(t.hostDestroy,t);this.#e.M.splice(0)}}U(){if(this.#t!==void 0&&clearTimeout(this.#t),!this.#e.el.isConnected&&!this.#e.autoDestroyDisabled){let t=()=>{this.#e.destroy()};this.#t=ce(t,ts)}}S(t,e){let s=this.T;this.V=d,this.T=[],s.forEach(r=>r(t,e))}#s;W(t,e){(typeof e=="object"&&e!==null||typeof e=="function")&&this.#s.set(e,t)}X(t){if(typeof t=="object"&&t!==null||typeof t=="function")return this.#s.get(t)}},ts=1e3,mt="autoDestroyDisabled";var ye=$(class extends g{constructor(o){if(super(o),o.type!==y.ATTRIBUTE||o.name!=="class"||o.strings?.length>2)throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.")}render(o){return" "+Object.keys(o).filter(t=>o[t]).join(" ")+" "}update(o,[t]){if(this.st===void 0){this.st=new Set,o.strings!==void 0&&(this.nt=new Set(o.strings.join(" ").split(/\s/).filter(s=>s!=="")));for(let s in t)t[s]&&!this.nt?.has(s)&&this.st.add(s);return this.render(t)}let e=o.element.classList;for(let s of this.st)s in t||(e.remove(s),this.st.delete(s));for(let s in t){let r=!!t[s];r===this.st.has(s)||this.nt?.has(s)||(r?(e.add(s),this.st.add(s)):(e.remove(s),this.st.delete(s)))}return f}});var ge="important",es=" !"+ge,ss=$(class extends g{constructor(o){if(super(o),o.type!==y.ATTRIBUTE||o.name!=="style"||o.strings?.length>2)throw Error("The `styleMap` directive must be used in the `style` attribute and must be the only part in the attribute.")}render(o){return Object.keys(o).reduce((t,e)=>{let s=o[e];return s==null?t:t+`${e=e.includes("-")?e:e.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g,"-$&").toLowerCase()}:${s};`},"")}update(o,[t]){let{style:e}=o.element;if(this.ft===void 0)return this.ft=new Set(Object.keys(t)),this.render(t);for(let s of this.ft)t[s]==null&&(this.ft.delete(s),s.includes("-")?e.removeProperty(s):e[s]=null);for(let s in t){let r=t[s];if(r!=null){this.ft.add(s);let n=typeof r=="string"&&r.endsWith(es);s.includes("-")||n?e.setProperty(s,n?r.slice(0,-11):r,n?ge:""):e[s]=r}}return f}});var os=$(class extends g{constructor(o){if(super(o),o.type!==y.PROPERTY&&o.type!==y.ATTRIBUTE&&o.type!==y.BOOLEAN_ATTRIBUTE)throw Error("The `live` directive is not allowed on child or event bindings");if(!lt(o))throw Error("`live` bindings can only contain a single expression")}render(o){return o}update(o,[t]){if(t===f||t===d)return t;let e=o.element,s=o.name;if(o.type===y.PROPERTY){if(t===e[s])return f}else if(o.type===y.BOOLEAN_ATTRIBUTE){if(!!t===e.hasAttribute(s))return f}else if(o.type===y.ATTRIBUTE&&e.getAttribute(s)===t+"")return f;return ue(o),t}});var ve=class o extends E{constructor(){super(),this.M=[],this.manager=new ft(this);let t=this,e=t.constructor,s=e.N,r=e.K.o,n=o.prototype.shouldUpdate;t.#r=s?.H??new b,t.I=s?.I??new b,t.J=s?.J??[],t._offspring=t.J,t._postLoad=t.I,t.el=s??t,t.#s=t.enableUpdating,t.enableUpdating=Ut,t.shouldUpdate!==n&&(t.#e=t.shouldUpdate,t.shouldUpdate=n),r&&(t.#t=new Map,e.elementProperties.forEach((i,a)=>t.#t.set(a,r()))),!1}static finalizeStyles(t){let e=super.finalizeStyles(t),s=this.shadowRootOptions===Lt;return this.K?.commonStyles===void 0||s?e:[this.K.commonStyles,...e]}static createProperty(t,e){let s=typeof e=="number"?e:Array.isArray(e)?e[0]:0,r=Array.isArray(e)?e[1]:void 0,n=r?.hasChanged??j,i={attribute:s&1&&typeof t=="string"?pt(t):!1,reflect:!!(s&2),type:s&4?Boolean:s&8?Number:void 0,state:!!(s&16),readOnly:!!(s&32),noAccessor:!!(s&64),c:!1,...r,hasChanged(a,c){let h=n(a,c);return i.c=h,h}};super.createProperty(t,i)}static getPropertyDescriptor(t,e,s){let r=this.K,n=super.getPropertyDescriptor(t,e,s);return s.d=n,{...n,get(){return r.t?.(this.#t.get(t)),n.get?.call(this)},set(i){let a=this.manager;if(s.readOnly&&!at&&(a.R||a.connectedCalled))throw Error(`Cannot assign to read-only property "${t}" of ${this.el.localName}. Trying to assign "${i}"`);n.set.call(this,i??void 0),s.c&&this.#t?.get(t)?.notify(),a.T.length>0&&(I(),a?.S(t,i))}}}static{this.lumina=!0}static{Rt(this)}#t;#e;#s;#r;#n;#c;get elementInternals(){return this.#c??=this.el.attachInternals(),this.#c}connectedCallback(){this.hasAttribute("defer-hydration")||this.#l(!0)}#l(t){let e=this.constructor.K.c?.(()=>this.requestUpdate());this.#n=e;let s=!this.manager.connectedCalled;t&&super.connectedCallback(),s?queueMicrotask(()=>this.#i().catch(r=>{this.#r.reject(r),setTimeout(()=>{throw r})})):e&&this.requestUpdate()}#d(t){try{this.#n.clear(),this.constructor.K.r(this.#n,()=>super.update(t))}catch(e){throw this.#n.clear(),e}}disconnectedCallback(){super.disconnectedCallback(),this.#n?.destroy(),this.#n=void 0}createRenderRoot(){let t=this.el.shadowRoot,e=this.constructor,s=e.shadowRootOptions,n=t??(s===Lt?this.el:this.el.attachShadow(s));if(t)return this.manager.connectedCalled||this.#l(!1),E.prototype.createRenderRoot.call(this),t;if(this.isConnected){let i=n.getRootNode();i.adoptedStyleSheets=[...i.adoptedStyleSheets,...e.elementStyles.map(a=>"styleSheet"in a?a.styleSheet:a)]}return n}async#i(){let t=this.el.G??xt(this.el);t&&await t;let e=[];for(let r of this.M)"triggerLoad"in r?e.push(r.triggerLoad()):e.push(W(r.hostLoad,r));await Promise.all(e),await this.load?.(),this.manager.hasDestroy&&this.manager.onUpdate(r=>r.has(mt)&&this.manager.U()),this.#s(!0),this.performUpdate(),this.I.resolve(),await 0;let s=this.J.filter(r=>!r.manager?.loadedCalled);s.length&&await Promise.allSettled(s.map(async r=>await r.componentOnReady())),this.J.length=0,this.el.setAttribute(this.constructor.K.hydratedAttribute,"");for(let r of this.M)"triggerLoaded"in r?r.triggerLoaded():p(r.hostLoaded,r);this.loaded?.(),this.#r.resolve()}shouldUpdate(t){return this.manager.Q=t,this.#e?.(t)??!0}update(t){this.#n?this.#d(t):super.update(t)}listen(t,e,s){let r=e?.bind(this)??e;this.manager.onLifecycle(()=>(this.el.addEventListener(t,r,s),()=>this.el.removeEventListener(t,r,s)))}listenOn(t,e,s,r){let n=s?.bind(this)??s;this.manager.onLifecycle(()=>(t.addEventListener(e,n,r),()=>t.removeEventListener(e,n,r)))}async componentOnReady(){return await this.#r.promise,this}addController(t){this.M.push(t),!(q in t)&&this.renderRoot&&this.el.isConnected&&t.hostConnected?.()}removeController(t){this.M.splice(this.M.indexOf(t),1),t.controllerRemoved?.()}};var $e=o=>{let t,e=r=>{t=new URL(r,globalThis.location?.href||void 0).href},s={...o,getAssetPath(r){let n=new URL(r,t);return n.origin!==globalThis.location?.origin?n.href:n.pathname},setAssetPath:e,customElement(r,n){n.K=s,n.L=r,customElements.get(r)||customElements.define(r,n)}};return e(o.defaultAssetPath),s};var _r=o=>typeof o=="object"&&o!=null?ye(o):o;var It=class extends g{#t;#e;constructor(t){super(t);let e=this;this.#e=function(r){return e.#t.call(this,r)}}render(t){return typeof t=="function"?(this.#t=t,Nt(this.#e)):Nt(t)}},Ar=$(It);var Cr=d;var Q=$e({defaultAssetPath:"https://jsdev.arcgis.com/5.1.0-next/ai-components/",hydratedAttribute:"hydrated"}),{customElement:Pr,getAssetPath:Nr,setAssetPath:Dr}=Q;Q.t=void 0;Q.o=void 0;Q.c=void 0;Q.r=void 0;export{Ns as a,D as b,re as c,ne as d,Ds as e,xs as f,be as g,ps as h,f as i,d as j,Ts as k,oe as l,He as m,Ve as n,Tt as o,Qe as p,y as q,$ as r,g as s,Xs as t,Nt as u,ve as v,_r as w,Cr as x,Q as y,Pr as z,Nr as A};
|
|
@@ -3,7 +3,19 @@ import"./CFDTXKJ6.js";var e=`# Navigation Tool Instructions
|
|
|
3
3
|
|
|
4
4
|
CRITICAL: You are FORBIDDEN from making multiple tool calls. You MUST make exactly ONE tool call.
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
Assigned task:
|
|
7
|
+
{assignedTask}
|
|
8
|
+
|
|
9
|
+
Latest user request:
|
|
10
|
+
{userRequest}
|
|
11
|
+
|
|
12
|
+
Prior steps:
|
|
13
|
+
{priorSteps}
|
|
14
|
+
|
|
15
|
+
Use the assigned task as the primary instruction for the current query. The question will **not** be restated again here.
|
|
16
|
+
Use the latest user request as supporting context when needed.
|
|
17
|
+
Use prior steps only when the assigned task clearly depends on earlier results.
|
|
18
|
+
Use chat history only when necessary to understand conversational references, and do not override the assigned task.
|
|
7
19
|
|
|
8
20
|
Detected intent:
|
|
9
21
|
{intent}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{a as o,b as l}from"./
|
|
2
|
+
import{a as o,b as l}from"./NPL674O3.js";import{g as i,h as t,v as c,w as a,z as r}from"./6TDOQJ45.js";import"./CFDTXKJ6.js";var d=i`.assistant-chat-card-content__skeleton-block{display:flex;flex-direction:column;gap:var(--calcite-spacing-sm);width:100%}.assistant-chat-card-content__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-chat-card-content-shimmer 1.2s ease-in-out infinite;width:85%}.assistant-chat-card-content__skeleton-text:last-child{width:70%}@keyframes assistant-chat-card-content-shimmer{0%{background-position:-150% 0}to{background-position:150% 0}}@media(prefers-reduced-motion){.assistant-chat-card-content__skeleton-text{animation:none}}.assistant-chat-card-content__text-container{padding:0 var(--calcite-spacing-sm);display:flex;flex-direction:column;gap:var(--calcite-spacing-sm);color:var(--calcite-color-text-1)}.assistant-chat-card-content__text-container 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}.assistant-chat-card-content__text-container pre code{display:block;white-space:pre;font-family:var(--calcite-code-family)}.assistant-chat-card-content__loading-container{display:flex;flex-direction:column;gap:var(--calcite-spacing-sm)}.assistant-chat-card-content__loading{display:flex;align-items:center;gap:var(--calcite-spacing-sm)}.assistant-chat-card-content__text-loading{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}.assistant-chat-card-content__error-notice{padding:var(--calcite-spacing-sm)}`,n="assistant-chat-card-content",e={textLoading:`${n}__text-loading`,skeletonBlock:`${n}__skeleton-block`,skeletonText:`${n}__skeleton-text`},s=class extends c{constructor(){super(...arguments),this.loading=!1,this.type="text"}static{this.properties={loading:5,type:1,content:1,loadingMessage:1}}static{this.styles=d}_renderText(){return t`<div class="assistant-chat-card-content__text-container">${this.loading?t`<div class="assistant-chat-card-content__loading-container"><div class="assistant-chat-card-content__loading"><calcite-loader label=loading inline></calcite-loader><div class=${a(e.textLoading)}>${this.loadingMessage}</div></div><div class=${a(e.skeletonBlock)}><span class=${a(e.skeletonText)}></span><span class=${a(e.skeletonText)}></span></div></div>`:t`<div>${o(l(this.content))}</div>`}</div>`}_renderError(){return t`<calcite-notice class="assistant-chat-card-content__error-notice" open icon kind=warning width=auto><div slot=message>${this.content}</div></calcite-notice>`}render(){switch(this.type){case"text":return this._renderText();case"error":return this._renderError();default:return t`<p>Unsupported content type</p>`}}};r("arcgis-assistant-chat-card-content",s);export{s as ArcgisAssistantChatCardContent};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
+
import a from"./L7YTPHKQ.js";import{a as k}from"./H3PQFXNE.js";import{a as C}from"./KVH3PDVW.js";import"./YGW7TUNX.js";import{g as _,h,l as v,n as o,t as u,u as m,v as f,z as E}from"./6TDOQJ45.js";import"./CFDTXKJ6.js";export default $arcgis.t(([I,{whenOnce:S,watch:L,when:P},O,A,{property:p,subclass:M},{x:w}])=>{var x=_`:host{display:block;width:var(--arcgis-internal-panel-width, 100%);height:var(--arcgis-internal-expand-max-height, 100%)}`,R=Object.defineProperty,z=Object.getOwnPropertyDescriptor,l=(c,t,e,i)=>{for(var s=i>1?void 0:i?z(t,e):t,r=c.length-1,n;r>=0;r--)(n=c[r])&&(s=(i?n(t,e,s):n(s))||s);return i&&s&&R(t,e,s),s},a=class extends A{constructor(c){super(c),this.view=null,this.loading=!1,this.processing=!1,this.processingStep=""}async load(){this._set("loading",!0);try{await this._initialize()}finally{this._set("loading",!1)}}destroy(){this.orchestrator?.dispose(),super.destroy()}async _initialize(){this.removeHandles(),await Promise.all([this.portal.load(),this.view?.when()]),this.view&&await S(()=>!this.view.updating),this._set("orchestrator",await w.init({agents:[...this.agents],view:this.view??void 0})),this.addHandles([L(()=>[this.view,this.agents],()=>{this._initialize()})])}clearChatHistory(){this.orchestrator?.newConversation()}async*ask(c,t){if(!this.orchestrator)throw new Error("Orchestrator not initialized yet.");this._set("processing",!0),this._set("processingStep","");let e=[];try{let i=this.orchestrator.ask(c);for await(let s of i){let r=s.runId;if(t?.aborted){yield{type:"cancelled",runId:r};break}switch(s.type){case"trace":{this._set("processingStep",s.data.text),e.push(s.data.text);break}case"completed":{if(!s.result.content.length){yield{type:"completed",error:"Could not process the request.",log:e,runId:r};return}let n=s.result.content;this._set("processingStep",""),yield{type:"completed",response:n,log:e,runId:r};return}case"interrupt":{let{kind:n,message:d,metadata:b}=s.interrupt,g=Array.isArray(b)?[...b]:[],$=(()=>{switch(n){case"booleanChoice":return{type:"boolean-choice",message:d,options:g};case"singleSelection":return{type:"single-select",message:d,options:g};case"multipleSelection":return{type:"multi-select",message:d,options:g};case"textInput":return{type:"text-input",message:d};default:return{type:n,message:d,options:g}}})();this._set("processingStep","Waiting for user input..."),yield{type:"interrupt",payload:$,runId:r};break}case"cancelled":{yield{type:"cancelled",runId:r};return}case"error":{yield{type:"completed",error:s.error.message,log:e,runId:r};return}default:{console.warn("Unknown event type:",s);break}}}}catch(i){console.warn("Error during message processing:",i),yield{type:"completed",error:"An error occurred during message processing.",log:e,runId:"error"};return}finally{this._set("processing",!1)}}};l([p({readOnly:!0})],a.prototype,"orchestrator",2);l([p()],a.prototype,"agents",2);l([p()],a.prototype,"portal",2);l([p()],a.prototype,"view",2);l([p({readOnly:!0})],a.prototype,"loading",2);l([p({readOnly:!0})],a.prototype,"processing",2);l([p({readOnly:!0})],a.prototype,"processingStep",2);a=l([M("OrchestratorController")],a);var H="Embeddings resource 'embeddings-v01.json' not found in the webmap portal item.",j="Embeddings not found for this web map.",F="https://developers.arcgis.com/javascript/latest/agentic-apps/ai-webmap-setup/#embeddings",y=class extends f{constructor(){super(...arguments),this._messages=k({blocking:!0}),this.#t=u(),this.#e=u(),this.#s=null,this.#o=new Map,this.#r=O.getDefault(),this.#i=t=>{t.stopPropagation(),this.arcgisInterruptCancel.emit(),this.orchestrator?.cancelInterrupt(),this._interrupt=null},this.#a=t=>{t.stopPropagation();let e=t.detail;this.arcgisInterruptSubmit.emit(e),this.orchestrator?.resumeInterrupt(e),this._interrupt=null},this.#n=t=>{t.stopPropagation(),this.keepSuggestedPrompts||(this.suggestedPrompts=[]);let e=t.detail;this.arcgisSubmit.emit(e),this.submitMessage(e)},this.#l=t=>{if(t.stopPropagation(),this.arcgisCancel.emit(),this._interrupt){this.orchestrator?.cancelInterrupt(),this._interrupt=null;return}this.#s?.abort()},this.#c=t=>{t.stopPropagation();let e=t.detail;this.arcgisFeedback.emit(e)},this._orchestratorController=null,this._interrupt=null,this._error=null,this.messages=new I([]),this.referenceElement=null,this.suggestedPrompts=[],this.feedbackEnabled=!1,this.keepSuggestedPrompts=!1,this.logEnabled=!1,this.copyEnabled=!1,this.voiceInputEnabled=!1,this.readAloudEnabled=!1,this.arcgisCancel=o(),this.arcgisError=o(),this.arcgisFeedback=o(),this.arcgisInterrupt=o(),this.arcgisInterruptCancel=o(),this.arcgisInterruptSubmit=o(),this.arcgisReady=o(),this.arcgisSubmit=o()}static{this.properties={_orchestratorController:16,_interrupt:16,_error:16,_user:16,messages:0,orchestrator:32,entryMessage:1,heading:1,description:1,referenceElement:1,suggestedPrompts:0,feedbackEnabled:5,keepSuggestedPrompts:5,logEnabled:5,copyEnabled:5,voiceInputEnabled:5,readAloudEnabled:5}}static{this.styles=x}#t;#e;#s;#o;#r;#i;#a;#n;#l;#c;async#h(){try{let t=C(this.el,this.referenceElement);await t?.componentOnReady();let e=[...this.#o.values()];return e.length?(this._orchestratorController=new a({agents:e,portal:this.#r,view:t?.view}),await this._orchestratorController.load(),!0):(this._error="No agents found.",!1)}catch(t){return this._error=t?.message??"Error initializing orchestrator.",v(this)(t),!1}}get _user(){return this.#r?.user?.fullName||this.#r?.user?.username}get orchestrator(){return this._orchestratorController?.orchestrator}async clearChatHistory(){this._reset(),this._orchestratorController?.clearChatHistory()}register(t){this.#o.set(t.agent.id,t)}async submitMessage(t){let e=t.trim();if(!e||(this.messages.push({id:Date.now().toString(),role:"user",content:e}),!this._orchestratorController))return;let i=this._orchestratorController.ask(e,this.#s?.signal);for await(let s of i){let r=s.runId;switch(s.type){case"completed":this.messages.push({role:"assistant",content:s.response,log:s.log,error:s.error,id:r});break;case"interrupt":this._interrupt={...s.payload,id:r};break;case"cancelled":this.messages.push({role:"assistant",error:"Request cancelled.",id:r});break}}}load(){this.manager.onLifecycle(this._reset.bind(this))}loaded(){this.manager.onLifecycle(()=>{this.#t.value?.addEventListener("arcgisSubmit",this.#n),this.#t.value?.addEventListener("arcgisCancel",this.#l),this.#t.value?.addEventListener("arcgisFeedback",this.#c);let t=P(()=>!!this._interrupt&&!!this.#e.value,()=>{let e=this.#e.value;e.removeEventListener("arcgisSubmit",this.#a),e.removeEventListener("arcgisCancel",this.#i),e.addEventListener("arcgisSubmit",this.#a,{once:!0}),e.addEventListener("arcgisCancel",this.#i,{once:!0}),this._interrupt&&this.arcgisInterrupt.emit(this._interrupt)});return queueMicrotask(()=>{this.#h().then(e=>{e?this.arcgisReady.emit():this._error&&this.arcgisError.emit(new Error(this._error))})}),()=>{t.remove(),this.#e.value?.removeEventListener("arcgisSubmit",this.#a),this.#e.value?.removeEventListener("arcgisCancel",this.#i),this.#t.value?.removeEventListener("arcgisSubmit",this.#n),this.#t.value?.removeEventListener("arcgisCancel",this.#l),this.#t.value?.removeEventListener("arcgisFeedback",this.#c),this._orchestratorController?.destroy(),this._orchestratorController=null}})}_reset(){this.#s?.abort(),this._interrupt=null,this.messages.removeAll(),this._error=null}_renderErrorNotice(){return this._error?h`<calcite-notice closable slot=entry-message open kind=danger icon width=full>${this._error===H?h`<div slot=message>${j}</div><calcite-link slot=link .href=${F} target=_blank title="Learn about web map embeddings">Read more</calcite-link>`:h`<div slot=message>${this._error}</div>`}</calcite-notice>`:null}render(){return h`<arcgis-assistant-shell .loading=${!this._orchestratorController&&!this._error||this._orchestratorController?.loading} .heading=${this.heading??this._messages.assistantLabel} .description=${this.description} .entryMessage=${this.entryMessage} .entryMessageClosed=${this.messages.length>0} .awaitingResponse=${this._orchestratorController?.processing} .suggestedPrompts=${this.suggestedPrompts} .messages=${this.messages} .voiceInputEnabled=${this.voiceInputEnabled} ${m(this.#t)}>${this._renderErrorNotice()}${this._interrupt?h`<arcgis-assistant-interrupt slot=entry-message .type=${this._interrupt.type} .message=${this._interrupt.message} .options=${this._interrupt.options} ${m(this.#e)}></arcgis-assistant-interrupt>`:null}<arcgis-assistant-chat .loading=${this._orchestratorController?.processing} .loadingMessage=${this._orchestratorController?.processingStep||""} .messages=${this.messages} .user=${this._user} .feedbackEnabled=${this.feedbackEnabled} .logEnabled=${this.logEnabled} .copyEnabled=${this.copyEnabled} .readAloudEnabled=${this.readAloudEnabled}><slot></slot></arcgis-assistant-chat><slot name=header-actions-end slot=header-actions-end></slot>${this.entryMessage?null:h`<slot name=entry-message slot=entry-message></slot>`}<slot name=entry-actions-start slot=entry-actions-start></slot><slot name=footer-content slot=footer-content></slot></arcgis-assistant-shell>`}};E("arcgis-assistant",y);return y},"core/Collection","core/reactiveUtils","portal/Portal","core/Accessor","core/accessorSupport/decorators",a)
|
|
@@ -1,7 +1,20 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
2
|
import"./CFDTXKJ6.js";var e=`## Map Query Gate
|
|
3
3
|
|
|
4
|
-
|
|
4
|
+
### Input
|
|
5
|
+
|
|
6
|
+
Assigned task:
|
|
7
|
+
{assignedTask}
|
|
8
|
+
|
|
9
|
+
Latest user request:
|
|
10
|
+
{userRequest}
|
|
11
|
+
|
|
12
|
+
Prior steps:
|
|
13
|
+
{priorSteps}
|
|
14
|
+
|
|
15
|
+
Use the assigned task as the primary instruction for the current query. The question will **not** be restated again here.
|
|
16
|
+
Use the latest user request as supporting context when needed.
|
|
17
|
+
Use prior steps only when needed to explain a previous result, failure, or likely next action.
|
|
5
18
|
|
|
6
19
|
### Map Context
|
|
7
20
|
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{a as o}from"./
|
|
2
|
+
import{a as o}from"./H3PQFXNE.js";import"./YGW7TUNX.js";import{g as a,h as s,n as e,v as n,z as l}from"./6TDOQJ45.js";import"./CFDTXKJ6.js";export default $arcgis.t(([r])=>{var c=a`.assistant-shell__footer-container{display:flex;flex-direction:column;flex:1 1 0;gap:var(--calcite-spacing-md)}.assistant-shell__content-container{display:flex;flex-direction:column;flex:1 1 0;min-height:0;position:relative;overflow:auto}.assistant-shell__suggested-prompts-container{display:flex;justify-content:center;width:100%}.assistant-shell__suggested-prompts{padding:var(--calcite-spacing-md);max-width:100%;box-sizing:border-box}calcite-chip{max-width:100%}.assistant-shell__suggested-prompt{max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-style:normal;cursor:pointer}`,i=class extends n{constructor(){super(...arguments),this._messages=o({blocking:!0}),this.description="",this.loading=!1,this.entryMessageClosed=!1,this.awaitingResponse=!1,this.suggestedPrompts=[],this.inputValue="",this.messages=new r([]),this.voiceInputEnabled=!1,this.arcgisCancel=e(),this.arcgisSubmit=e()}static{this.properties={heading:1,description:1,loading:5,entryMessage:1,entryMessageClosed:5,awaitingResponse:5,suggestedPrompts:0,inputValue:1,status:1,messages:0,voiceInputEnabled:5}}static{this.styles=c}_renderSuggestedPrompts(){return this.suggestedPrompts?.length?s`<div class="assistant-shell__suggested-prompts-container"><calcite-chip-group class="assistant-shell__suggested-prompts" .label=${this._messages.suggestedPromptsLabel??"suggested prompts"}>${this.suggestedPrompts.map(t=>s`<calcite-chip .value=${t} .label=${t} appearance=outline-fill kind=brand @calciteChipSelect=${()=>this.inputValue=t}><div class="assistant-shell__suggested-prompt">${t}</div></calcite-chip>`)}</calcite-chip-group></div>`:null}render(){return s`<calcite-panel .loading=${this.loading} .heading=${this.heading??this._messages.shellHeading} .description=${this.description}><slot slot=header-actions-end name=header-actions-end></slot><div class="assistant-shell__content-container"><slot></slot></div>${this._renderSuggestedPrompts()}<div class="assistant-shell__footer-container" slot=footer><slot name=entry-message>${this.entryMessageClosed?null:s`<calcite-notice slot=entry-message .open=${!this.entryMessageClosed} kind=info closable icon width=full><div slot=message>${this.entryMessage??this._messages.shellEntryMessage}</div></calcite-notice>`}</slot><arcgis-assistant-chat-entry .awaitingResponse=${this.awaitingResponse} .arcgisSubmit=${this.arcgisSubmit} .arcgisCancel=${this.arcgisCancel} .inputValue=${this.inputValue} .status=${this.status} .messages=${this.messages} .voiceInputEnabled=${this.voiceInputEnabled}><slot name=entry-actions-start slot=entry-actions-start></slot></arcgis-assistant-chat-entry><slot name=footer-content></slot></div></calcite-panel>`}};l("arcgis-assistant-shell",i);return i},"core/Collection")
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{a as _}from"./
|
|
2
|
+
import{a as _}from"./H3PQFXNE.js";import"./YGW7TUNX.js";import{g as d,h as c,n as o,t as v,u as g,v as f,x as y,z as m}from"./6TDOQJ45.js";import"./CFDTXKJ6.js";export default $arcgis.t(([{watch:b},w])=>{var V=d`.assistant-chat-entry__input-container{display:flex;flex-direction:column}.assistant-chat-entry__footer-start{display:flex;gap:var(--calcite-spacing-md);flex-wrap:wrap;align-items:center}.assistant-chat-entry__footer-end{display:flex;gap:var(--calcite-spacing-md);align-items:center}.assistant-chat-entry__status-indicator{width:9px;height:9px;border-radius:100%;background-color:var(--calcite-color-status-success)}.assistant-chat-entry__status-indicator[data-status=working]{background-color:var(--calcite-color-status-warning)}.assistant-chat-entry__status-indicator[data-status=error]{background-color:var(--calcite-color-status-danger)}.assistant-chat-entry__status-text{text-transform:capitalize}`;function l(u){let{baseValue:t,transcript:s}=u;if(!s)return t;let e=t.trim();return e?`${e} ${s}`:s}var h=class extends f{constructor(){super(...arguments),this.#t=v(),this.#s=-1,this.#a="",this.#e=null,this.#i=t=>{let s=t.detail;this._applyVoiceInputTranscript(s?.transcript)},this.#n=()=>{this._startVoiceInputSession()},this.#r=()=>{this._finishVoiceInputSession()},this.#c=t=>{let s=t.detail;this._applyVoiceInputTranscript(s?.transcript,{final:!0})},this.#o=t=>{},this._messages=_({blocking:!0}),this.keyboardShortcutsDisabled=!1,this.awaitingResponse=!1,this.inputValue="",this.voiceInputEnabled=!1,this.messages=new w([]),this.arcgisCancel=o(),this.arcgisSubmit=o()}static{this.properties={_userMessages:16,keyboardShortcutsDisabled:5,entryPlaceholder:1,awaitingResponse:5,inputValue:1,status:1,voiceInputEnabled:5,messages:0}}static{this.styles=V}#t;#s;#a;#e;#i;#n;#r;#c;#o;get _userMessages(){return this.messages.toArray().filter(t=>t.role==="user").map(({content:t})=>t)}loaded(){this.manager.onLifecycle(()=>{let t=[{eventType:"arcgisVoiceInputInterimTranscription",callback:this.#i},{eventType:"arcgisVoiceInputStart",callback:this.#n},{eventType:"arcgisVoiceInputStop",callback:this.#r},{eventType:"arcgisVoiceInputTranscription",callback:this.#c},{eventType:"arcgisVoiceInputTranscriptionStreamChunk",callback:this.#o}];for(let{eventType:s,callback:e}of t)this.el.addEventListener(s,e);return[b(()=>this.inputValue,s=>{this.#t.value&&(this.#t.value.value=s)},{initial:!0}),{remove:()=>{for(let{eventType:s,callback:e}of t)this.el.removeEventListener(s,e)}}]})}async _submitMessage(){if(this.awaitingResponse){this.arcgisCancel.emit();return}let t=this.#t.value?.value.trim();t&&(this.arcgisSubmit.emit(t),this.#s=-1,this.#a="",this._clearVoiceInputSession(),this.#t.value&&(this.#t.value.value="",await this.#t.value.setFocus()))}async _navigateHistory(t,s){let e=this.#t.value;if(!e)return;let a=this._userMessages;if(a.length===0)return;let i=e.value??"",r=e.shadowRoot?.querySelector("textarea"),n=r?.selectionStart,p=r?.selectionEnd;if(!(n==null||p==null)&&!(n!==p||t==="up"&&n!==0||t==="down"&&n!==i.length)){if(t==="up"){this.#s===-1?(this.#a=i,this.#s=a.length-1):this.#s=Math.max(0,this.#s-1),e.value=a[this.#s]??"",s.preventDefault();return}this.#s!==-1&&(this.#s<a.length-1?(this.#s+=1,e.value=a[this.#s]??""):(this.#s=-1,e.value=this.#a),s.preventDefault())}}_startVoiceInputSession(){this.#e={baseValue:this.#t.value?.value?.trim()??"",phase:"listening",transcript:""}}_finishVoiceInputSession(){let t=this.#t.value,s=this.#e;if(!t){this._clearVoiceInputSession();return}if(!s){this._setDraftValue(t.value?.trim()??"");return}let e={...s,phase:"stopped"},a=l(e);this.#e=e,this._setDraftValue(a)}async _applyVoiceInputTranscript(t,s){let e=this.#t.value,a=this.#e;if(!e||!t||!a)return;if(a.phase==="stopped"){let n=l(a);if((e.value?.trim()??"")!==n){this._clearVoiceInputSession();return}}let i={...a,transcript:t},r=l(i);this.#e=i,this._setDraftValue(r),s?.final&&i.phase==="stopped"&&await e.setFocus()}_setDraftValue(t){this.#t.value&&(this.#t.value.value=t),this.#s=-1,this.#a=t}_clearVoiceInputSession(){this.#e=null}render(){return c`<div class="assistant-chat-entry__input-container"><calcite-text-area .value=${this.#t.value?.value} .placeholder=${this.entryPlaceholder??this._messages.entryPlaceholder} resize=vertical @keydown=${async t=>{t.altKey||t.ctrlKey||t.metaKey||t.shiftKey||this.keyboardShortcutsDisabled||(t.key==="Enter"?(t.preventDefault(),await this._submitMessage()):t.key==="ArrowUp"?await this._navigateHistory("up",t):t.key==="ArrowDown"&&await this._navigateHistory("down",t))}} ${g(this.#t)}><div slot=footer-start class="assistant-chat-entry__footer-start"><slot name=entry-actions-start></slot></div><div slot=footer-end class="assistant-chat-entry__footer-end">${this.status?c`<div id=tooltip-status class="assistant-chat-entry__status-indicator" data-status=${this.status??y}></div><calcite-tooltip reference-element=tooltip-status offset-distance=12><span class="assistant-chat-entry__status-text">${this.status}</span></calcite-tooltip>`:null}${this.voiceInputEnabled?c`<arcgis-assistant-chat-entry-speech-input .awaitingResponse=${this.awaitingResponse}></arcgis-assistant-chat-entry-speech-input>`:null}<calcite-button .iconStart=${this.awaitingResponse?"circle-stop":"send"} slot=footer-end round @click=${()=>{this._submitMessage()}}>${this.awaitingResponse?this._messages.stopButtonLabel:this._messages.askButtonLabel}</calcite-button></div></calcite-text-area></div>`}};m("arcgis-assistant-chat-entry",h);return h},"core/reactiveUtils","core/Collection")
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{a as $,c as k}from"./YGW7TUNX.js";import{A as N,a as C,b as L,c as m,d as f,e as P,f as O,k as g,m as v,o as w}from"./
|
|
2
|
+
import{a as $,c as k}from"./YGW7TUNX.js";import{A as N,a as C,b as L,c as m,d as f,e as P,f as O,k as g,m as v,o as w}from"./6TDOQJ45.js";var _=t=>(...s)=>{let o=f(),e=new t(...s),r=e.exports;m(o.at(-1));let n=e.component.manager;n.W(e,r),e.watchExports(n.W.bind(n,e)),P(e);let a=[e.component,...o].reverse();return v(a,i=>i===void 0?void 0:j(e,i,r),r)},j=(t,{host:s,key:o,isReactive:e},r)=>{let n=s,a=n[o]!==t.exports,i=n[o]!==r,c=r!==t.exports;if(a&&!i&&c&&(n[o]=t.exports),s===t.component){if(e){let l=t.component.manager;i&&l.W(t,n[o]),t.onUpdate(u=>{if(u.has(o)){let x=n[o];x!==t.exports&&l.W(t,x)}})}t.O=e?void 0:o}let d=t.component.constructor.elementProperties.get(o)?.readOnly;t.watchExports(()=>{n[o]!==t.exports&&(d?O(()=>{n[o]=t.exports}):n[o]=t.exports)})};var z="ar,bg,bs,ca,cs,da,de,el,en,es,et,fi,fr,he,hr,hu,id,it,ja,ko,lt,lv,nl,nb,no,pl,pt-BR,pt-PT,ro,ru,sk,sl,sr,sv,th,tr,uk,vi,zh-CN,zh-HK,zh-TW".split(","),M=new Set(z),h="en",U={pt:"pt-BR",nb:"no",nn:"no",zh:"zh-CN"},F=async(t,s,o="")=>{let e=`${s}/${o}`,r=`${e}${t}.json`;return b[r]??(b[r]=A(t,e)),await b[r]},b={},A=async(t,s)=>{let o=`${s}${t}.json`;try{let e=await fetch(o);if(e.ok)return await e.json()}catch(e){return g("error","intl",`An unknown error occurred while fetching localization strings at ${o}`,{detail:{error:e}}),{}}return t===h?{}:await A(h,s)},y=t=>{let s=k(t,"lang",globalThis.navigator?.language||h);return{lang:s,t9nLocale:D(s)}},D=t=>{let[s,o]=t.split("-"),e=s.toLowerCase(),r=e;return o&&(r=`${e}-${o.toUpperCase()}`),r=U[r]??r,M.has(r)?r:o?D(e):h},T=(t,s,o,e)=>{let r,n=()=>K(t,s(),e).then(a=>{(r?.lang!==a.lang||r.t9nLocale!==a.t9nLocale||r.t9nStrings!==a.t9nStrings)&&o(a),r=a}).catch(a=>{g("error","intl","Error updating component locale state",{detail:{error:a}})});return queueMicrotask(n),$(t,["lang"],n)},K=async(t,s,o=t.localName.split("-").slice(1).join("-"))=>{let{lang:e,t9nLocale:r}=y(t),n=`${s}/${o}/t9n`,i=o===null?{}:await F(r,n,"messages.");return{lang:e,t9nLocale:r,t9nStrings:i}};var W=t=>I(void 0,t);var E=class extends w{constructor(s,o){super(s);let e=this.exports;try{L(this.component);let r=o(this.component,this),n=this.exports!==e;if(C(r)){n||this.setProvisionalExports(r);let a=r.then(i=>{this.exports=i,super.catchUpLifecycle()}).catch(i=>{this.P.reject(i)});this.onLoad(async()=>await a)}else(!n||r!==void 0)&&(this.exports=r),queueMicrotask(()=>super.catchUpLifecycle())}catch(r){this.P.reject(r)}}catchUpLifecycle(){}},I=_(E);var S=t=>(s={})=>W((o,e)=>{let r=y(o.el),n={_lang:r.lang,_t9nLocale:r.t9nLocale,_loading:!0},a=o;e.onLifecycle(()=>T(o.el,()=>t("./assets"),({t9nLocale:c,t9nStrings:p,lang:d})=>{let l={...p,_lang:d,_t9nLocale:c,_loading:!1};e.exports=l;let u=p.componentLabel;typeof u=="string"&&"label"in o&&o.label==null&&(o.label??=u),i(a.messageOverrides)},s.name));let i=c=>{let p=e.exports,d=p._original??p,l=V(d,c);c&&(l._original=d),e.exports=l};return"messageOverrides"in a&&e.onUpdate(c=>{c.has("messageOverrides")&&i(a.messageOverrides)}),s.blocking?(e.setProvisionalExports(n,!1),e.ready):n}),V=(t,s)=>{if(!s)return t;let o={...t};return Object.entries(s).forEach(([e,r])=>{t[e]!==void 0&&(typeof r=="object"?o[e]=V(t[e],r):o[e]=r??t[e])}),o};var ct=S(N);export{ct as a};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{g as C,h as S,n as l,v as f,x as m,z as y}from"./WRENCTR3.js";import"./CFDTXKJ6.js";export default $arcgis.t(([{when:w,watch:u},k,{property:d,subclass:v}])=>{var T=C`.assistant-chat-entry-speech-input__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}.assistant-chat-entry-speech-input__button[data-state=disabled]{--calcite-button-icon-color: var(--calcite-color-text-3);opacity:var(--calcite-opacity-disabled)}.assistant-chat-entry-speech-input__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)}.assistant-chat-entry-speech-input__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) )}.assistant-chat-entry-speech-input__button[data-state=listening]:active{--calcite-button-background-color: color-mix( in srgb, var(--calcite-color-brand) 24%, var(--calcite-color-foreground-1) )}.assistant-chat-entry-speech-input__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)}.assistant-chat-entry-speech-input__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)}.assistant-chat-entry-speech-input__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-chat-entry-speech-input-recording-pulse 1.8s ease-out infinite}@keyframes assistant-chat-entry-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){.assistant-chat-entry-speech-input__button[data-state=listening]:after{animation:none;opacity:1;transform:none}}`,I=Object.defineProperty,x=Object.getOwnPropertyDescriptor,p=(t,e,s,r)=>{for(var i=r>1?void 0:r?x(e,s):e,n=t.length-1,o;n>=0;n--)(o=t[n])&&(i=(r?o(e,s,i):o(i))||i);return r&&i&&I(e,s,i),i},a=class extends k{constructor(t){super(t),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([v("SpeechController")],a);var O=["audio/webm;codecs=opus","audio/webm","audio/mp4","audio/ogg;codecs=opus","audio/ogg"];function h(t){return t.replace(/\s+/gu," ").trim()}var M=Object.defineProperty,E=Object.getOwnPropertyDescriptor,g=(t,e,s,r)=>{for(var i=r>1?void 0:r?E(e,s):e,n=t.length-1,o;n>=0;n--)(o=t[n])&&(i=(r?o(e,s,i):o(i))||i);return r&&i&&M(e,s,i),i},c=class extends a{constructor(t){super(t),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"?"":O.find(t=>window.MediaRecorder.isTypeSupported(t))??""}initialize(){c.isSupported()&&this.addHandles(w(()=>!!this.errorCode,()=>{this._set("state","error")}))}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(t){this._pendingChunkOperations.add(t),t.finally(()=>{this._pendingChunkOperations.delete(t)})}async _awaitPendingChunkOperations(){this._pendingChunkOperations.size&&await Promise.allSettled(Array.from(this._pendingChunkOperations))}_onDataAvailable(t){let e=this._activeSessionId;e!=null&&this._queuePendingChunkOperation(this._processDataAvailable(t,e))}async _processDataAvailable(t,e){let s=t.data;if(!s.size||e!==this._activeSessionId)return;this._recordedChunks.push(s);let r=s.type||this._mediaRecorder?.mimeType||this._mimeType,i=this._mediaRecorderStopReason==="toggle"&&this._mediaRecorder?.state==="inactive";try{if(!this.handleRecording)return;let n=h(await this.handleRecording(s,r,this._mediaRecorderChunkIndex,i)??"");if(e!==this._activeSessionId)return;n&&this._set("liveTranscript",h(`${this.liveTranscript} ${n}`))}catch(n){if(e!==this._activeSessionId)return;this._failSession(n instanceof Error&&n.message==="transcription-unavailable"?"transcription-unavailable":"transcription-failed");return}!i&&e===this._activeSessionId&&(this._mediaRecorderChunkIndex+=1)}_failSession(t){let e=this._mediaRecorder;if(e){e.onstart=null,e.ondataavailable=null,e.onerror=null,e.onstop=null;try{e.state!=="inactive"&&e.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("errorCode",t)}_onError(){this._failSession("recording-failed")}_onStart(){this._set("state","listening")}_onStop(){this._handleStop()}_releaseMediaStream(){this._mediaStream?.getTracks().forEach(t=>t.stop()),this._mediaStream=null}async _handleStop(){let t=this._mediaRecorder,e=this._activeSessionId,s=this._mediaRecorderStopReason,r=t?.mimeType||this._recordedChunks.find(n=>!!n.type)?.type||"",i=[...this._recordedChunks];if(this._mediaRecorder=null,this._mediaRecorderChunkIndex=0,this._releaseMediaStream(),s==="cancel"){this._activeSessionId===e&&(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(e==null){this._mediaRecorderStopReason=null,this._pendingChunkOperations.clear(),this._recordedChunks=[],this._set("state","idle"),this._set("errorCode",void 0);return}if(await this._awaitPendingChunkOperations(),e===this._activeSessionId){if(!(r?new Blob(i,{type:r}):new Blob(i)).size){this._activeSessionId===e&&(this._activeSessionId=null),this._mediaRecorderStopReason=null,this._recordedChunks=[],this._set("errorCode","recording-failed");return}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=[]}}start(){if(!c.isSupported()){this._set("errorCode","not-supported");return}let t=Date.now();this._activeSessionId=t,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(e=>{if(t!==this._activeSessionId){e.getTracks().forEach(i=>i.stop());return}let s=this._mimeType,r=s?new window.MediaRecorder(e,{mimeType:s}):new window.MediaRecorder(e);this._mediaStream=e,this._mediaRecorder=r,this._mediaRecorderChunkIndex=0,this._mediaRecorderStopReason=null,this._recordedChunks=[],r.ondataavailable=this._onDataAvailable.bind(this),r.onerror=this._onError.bind(this),r.onstart=this._onStart.bind(this),r.onstop=this._onStop.bind(this),this._mediaRecorder.start(this.chunkTimeSlice)}).catch(e=>{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"))})}stop(){if(this._mediaRecorder){this._mediaRecorderStopReason="toggle";try{this._mediaRecorder.state!=="inactive"?this._mediaRecorder.stop():this._handleStop()}catch{}}}cancel(){let t=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),!t){this._releaseMediaStream();return}try{if(t.state!=="inactive"){t.stop();return}}catch{}this._mediaRecorder=null,this._releaseMediaStream()}static isSupported(){return typeof window<"u"&&!!(window.MediaRecorder&&navigator.mediaDevices?.getUserMedia)}};g([d()],c.prototype,"_mimeType",1);g([d()],c.prototype,"handleRecording",2);g([d()],c.prototype,"chunkTimeSlice",2);c=g([v("MediaRecorderController")],c);var $=Object.getOwnPropertyDescriptor,D=(t,e,s,r)=>{for(var i=r>1?void 0:r?$(e,s):e,n=t.length-1,o;n>=0;n--)(o=t[n])&&(i=o(i)||i);return i};function R(){if(typeof window>"u")return null;let t=window;return t.SpeechRecognition??t.webkitSpeechRecognition??null}var _=class extends a{constructor(t){super(t),this._isCancelled=!1,this._recognition=null}initialize(){let t=R();if(!t)return;let e=new t;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,this.addHandles(w(()=>!!this.errorCode,()=>{this._set("state","error")}))}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(t){let{finalTranscript:e,liveTranscript:s}=Array.from(t.results).reduce((r,i)=>(i.isFinal?r.finalTranscript+=i[0].transcript:r.liveTranscript+=i[0].transcript,r),{finalTranscript:"",liveTranscript:""});this._set("transcript",h(e)),this._set("liveTranscript",h(s))}_onError(t){if(t.error==="aborted"&&this._isCancelled){this._set("state","idle");return}let e="unhandled";switch(t.error){case"no-speech":e="no-speech";break;case"service-not-allowed":case"not-allowed":e="not-allowed";break;default:e="unhandled"}this._set("errorCode",e)}_onEnd(){let t=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",t),this._set("state","idle")),this._set("errorCode",void 0)}_onSpeechEnd(){this._set("state","processing")}_reset(t=!1){this._isCancelled=t,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("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!!R()}};_=D([v("WebSpeechController")],_);var b=class extends f{constructor(){super(...arguments),this._resolvedMode="disabled",this.awaitingResponse=!1,this.mode="web-speech",this.arcgisVoiceInputError=l(),this.arcgisVoiceInputStart=l(),this.arcgisVoiceInputStop=l(),this.arcgisVoiceInputInterimTranscription=l(),this.arcgisVoiceInputTranscription=l(),this.arcgisVoiceInputTranscriptionStreamChunk=l()}static{this.properties={_resolvedMode:16,_state:16,_errorCode:16,_liveTranscript:16,_transcript:16,_isButtonDisabled:16,_buttonLabel:16,awaitingResponse:5,language:1,mode:1}}static{this.styles=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"}}loaded(){this.manager.onLifecycle(()=>[u(()=>[this.mode,this.language],()=>{this._configureController()},{initial:!0}),u(()=>this.awaitingResponse,e=>{e&&this._cancelActiveSession()},{initial:!0}),u(()=>this._liveTranscript,e=>{if(e){let s=h(`${this._transcript} ${e}`);this.arcgisVoiceInputInterimTranscription.emit({transcript:s})}}),u(()=>this._transcript,e=>{e&&this.arcgisVoiceInputTranscription.emit({transcript:e})}),u(()=>this._state,e=>{e==="error"&&this._errorCode&&this.arcgisVoiceInputError.emit({errorCode:this._errorCode})})])}disconnectedCallback(){super.disconnectedCallback(),this._destroySpeechController()}_configureController(){let e=this._resolveMode();this._destroySpeechController(),this._resolvedMode=e,e!=="disabled"&&(this._speechController=e==="web-speech"?new _({language:this.language}):new c({language:this.language,handleRecording:this._handleRecording.bind(this)}))}_destroySpeechController(){this._speechController?.cancel(),this._speechController?.destroy(),this._speechController=void 0}async _handleToggle(){if(!(this._isButtonDisabled||!this._speechController)){if(this._state==="listening"){this._speechController.stop(),this.arcgisVoiceInputStop.emit();return}this._speechController.start(),this.arcgisVoiceInputStart.emit()}}async _handleRecording(e,s,r,i){let n;return this.arcgisVoiceInputTranscriptionStreamChunk.emit({blob:e,chunkIndex:r,isFinal:i,mimeType:s,respondWithTranscript:o=>{n=o}}),n}_resolveMode(){return this.mode==="disabled"?"disabled":this.mode==="web-speech"&&_.isSupported()?"web-speech":c.isSupported()?"media-recorder":"disabled"}async _cancelActiveSession(){this._speechController&&this._resolvedMode!=="disabled"&&this._speechController.cancel()}render(){return S`<calcite-button appearance=transparent class="assistant-chat-entry-speech-input__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=${()=>void this._handleToggle()}></calcite-button>`}};y("arcgis-assistant-chat-entry-speech-input",b);return b},"core/reactiveUtils","core/Accessor","core/accessorSupport/decorators")
|
|
2
|
+
import{g as C,h as S,n as l,v as f,x as m,z as y}from"./6TDOQJ45.js";import"./CFDTXKJ6.js";export default $arcgis.t(([{when:w,watch:u},k,{property:d,subclass:v}])=>{var T=C`.assistant-chat-entry-speech-input__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}.assistant-chat-entry-speech-input__button[data-state=disabled]{--calcite-button-icon-color: var(--calcite-color-text-3);opacity:var(--calcite-opacity-disabled)}.assistant-chat-entry-speech-input__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)}.assistant-chat-entry-speech-input__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) )}.assistant-chat-entry-speech-input__button[data-state=listening]:active{--calcite-button-background-color: color-mix( in srgb, var(--calcite-color-brand) 24%, var(--calcite-color-foreground-1) )}.assistant-chat-entry-speech-input__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)}.assistant-chat-entry-speech-input__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)}.assistant-chat-entry-speech-input__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-chat-entry-speech-input-recording-pulse 1.8s ease-out infinite}@keyframes assistant-chat-entry-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){.assistant-chat-entry-speech-input__button[data-state=listening]:after{animation:none;opacity:1;transform:none}}`,I=Object.defineProperty,x=Object.getOwnPropertyDescriptor,p=(t,e,s,r)=>{for(var i=r>1?void 0:r?x(e,s):e,n=t.length-1,o;n>=0;n--)(o=t[n])&&(i=(r?o(e,s,i):o(i))||i);return r&&i&&I(e,s,i),i},a=class extends k{constructor(t){super(t),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([v("SpeechController")],a);var O=["audio/webm;codecs=opus","audio/webm","audio/mp4","audio/ogg;codecs=opus","audio/ogg"];function h(t){return t.replace(/\s+/gu," ").trim()}var M=Object.defineProperty,E=Object.getOwnPropertyDescriptor,g=(t,e,s,r)=>{for(var i=r>1?void 0:r?E(e,s):e,n=t.length-1,o;n>=0;n--)(o=t[n])&&(i=(r?o(e,s,i):o(i))||i);return r&&i&&M(e,s,i),i},c=class extends a{constructor(t){super(t),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"?"":O.find(t=>window.MediaRecorder.isTypeSupported(t))??""}initialize(){c.isSupported()&&this.addHandles(w(()=>!!this.errorCode,()=>{this._set("state","error")}))}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(t){this._pendingChunkOperations.add(t),t.finally(()=>{this._pendingChunkOperations.delete(t)})}async _awaitPendingChunkOperations(){this._pendingChunkOperations.size&&await Promise.allSettled(Array.from(this._pendingChunkOperations))}_onDataAvailable(t){let e=this._activeSessionId;e!=null&&this._queuePendingChunkOperation(this._processDataAvailable(t,e))}async _processDataAvailable(t,e){let s=t.data;if(!s.size||e!==this._activeSessionId)return;this._recordedChunks.push(s);let r=s.type||this._mediaRecorder?.mimeType||this._mimeType,i=this._mediaRecorderStopReason==="toggle"&&this._mediaRecorder?.state==="inactive";try{if(!this.handleRecording)return;let n=h(await this.handleRecording(s,r,this._mediaRecorderChunkIndex,i)??"");if(e!==this._activeSessionId)return;n&&this._set("liveTranscript",h(`${this.liveTranscript} ${n}`))}catch(n){if(e!==this._activeSessionId)return;this._failSession(n instanceof Error&&n.message==="transcription-unavailable"?"transcription-unavailable":"transcription-failed");return}!i&&e===this._activeSessionId&&(this._mediaRecorderChunkIndex+=1)}_failSession(t){let e=this._mediaRecorder;if(e){e.onstart=null,e.ondataavailable=null,e.onerror=null,e.onstop=null;try{e.state!=="inactive"&&e.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("errorCode",t)}_onError(){this._failSession("recording-failed")}_onStart(){this._set("state","listening")}_onStop(){this._handleStop()}_releaseMediaStream(){this._mediaStream?.getTracks().forEach(t=>t.stop()),this._mediaStream=null}async _handleStop(){let t=this._mediaRecorder,e=this._activeSessionId,s=this._mediaRecorderStopReason,r=t?.mimeType||this._recordedChunks.find(n=>!!n.type)?.type||"",i=[...this._recordedChunks];if(this._mediaRecorder=null,this._mediaRecorderChunkIndex=0,this._releaseMediaStream(),s==="cancel"){this._activeSessionId===e&&(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(e==null){this._mediaRecorderStopReason=null,this._pendingChunkOperations.clear(),this._recordedChunks=[],this._set("state","idle"),this._set("errorCode",void 0);return}if(await this._awaitPendingChunkOperations(),e===this._activeSessionId){if(!(r?new Blob(i,{type:r}):new Blob(i)).size){this._activeSessionId===e&&(this._activeSessionId=null),this._mediaRecorderStopReason=null,this._recordedChunks=[],this._set("errorCode","recording-failed");return}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=[]}}start(){if(!c.isSupported()){this._set("errorCode","not-supported");return}let t=Date.now();this._activeSessionId=t,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(e=>{if(t!==this._activeSessionId){e.getTracks().forEach(i=>i.stop());return}let s=this._mimeType,r=s?new window.MediaRecorder(e,{mimeType:s}):new window.MediaRecorder(e);this._mediaStream=e,this._mediaRecorder=r,this._mediaRecorderChunkIndex=0,this._mediaRecorderStopReason=null,this._recordedChunks=[],r.ondataavailable=this._onDataAvailable.bind(this),r.onerror=this._onError.bind(this),r.onstart=this._onStart.bind(this),r.onstop=this._onStop.bind(this),this._mediaRecorder.start(this.chunkTimeSlice)}).catch(e=>{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"))})}stop(){if(this._mediaRecorder){this._mediaRecorderStopReason="toggle";try{this._mediaRecorder.state!=="inactive"?this._mediaRecorder.stop():this._handleStop()}catch{}}}cancel(){let t=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),!t){this._releaseMediaStream();return}try{if(t.state!=="inactive"){t.stop();return}}catch{}this._mediaRecorder=null,this._releaseMediaStream()}static isSupported(){return typeof window<"u"&&!!(window.MediaRecorder&&navigator.mediaDevices?.getUserMedia)}};g([d()],c.prototype,"_mimeType",1);g([d()],c.prototype,"handleRecording",2);g([d()],c.prototype,"chunkTimeSlice",2);c=g([v("MediaRecorderController")],c);var $=Object.getOwnPropertyDescriptor,D=(t,e,s,r)=>{for(var i=r>1?void 0:r?$(e,s):e,n=t.length-1,o;n>=0;n--)(o=t[n])&&(i=o(i)||i);return i};function R(){if(typeof window>"u")return null;let t=window;return t.SpeechRecognition??t.webkitSpeechRecognition??null}var _=class extends a{constructor(t){super(t),this._isCancelled=!1,this._recognition=null}initialize(){let t=R();if(!t)return;let e=new t;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,this.addHandles(w(()=>!!this.errorCode,()=>{this._set("state","error")}))}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(t){let{finalTranscript:e,liveTranscript:s}=Array.from(t.results).reduce((r,i)=>(i.isFinal?r.finalTranscript+=i[0].transcript:r.liveTranscript+=i[0].transcript,r),{finalTranscript:"",liveTranscript:""});this._set("transcript",h(e)),this._set("liveTranscript",h(s))}_onError(t){if(t.error==="aborted"&&this._isCancelled){this._set("state","idle");return}let e="unhandled";switch(t.error){case"no-speech":e="no-speech";break;case"service-not-allowed":case"not-allowed":e="not-allowed";break;default:e="unhandled"}this._set("errorCode",e)}_onEnd(){let t=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",t),this._set("state","idle")),this._set("errorCode",void 0)}_onSpeechEnd(){this._set("state","processing")}_reset(t=!1){this._isCancelled=t,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("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!!R()}};_=D([v("WebSpeechController")],_);var b=class extends f{constructor(){super(...arguments),this._resolvedMode="disabled",this.awaitingResponse=!1,this.mode="web-speech",this.arcgisVoiceInputError=l(),this.arcgisVoiceInputStart=l(),this.arcgisVoiceInputStop=l(),this.arcgisVoiceInputInterimTranscription=l(),this.arcgisVoiceInputTranscription=l(),this.arcgisVoiceInputTranscriptionStreamChunk=l()}static{this.properties={_resolvedMode:16,_state:16,_errorCode:16,_liveTranscript:16,_transcript:16,_isButtonDisabled:16,_buttonLabel:16,awaitingResponse:5,language:1,mode:1}}static{this.styles=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"}}loaded(){this.manager.onLifecycle(()=>[u(()=>[this.mode,this.language],()=>{this._configureController()},{initial:!0}),u(()=>this.awaitingResponse,e=>{e&&this._cancelActiveSession()},{initial:!0}),u(()=>this._liveTranscript,e=>{if(e){let s=h(`${this._transcript} ${e}`);this.arcgisVoiceInputInterimTranscription.emit({transcript:s})}}),u(()=>this._transcript,e=>{e&&this.arcgisVoiceInputTranscription.emit({transcript:e})}),u(()=>this._state,e=>{e==="error"&&this._errorCode&&this.arcgisVoiceInputError.emit({errorCode:this._errorCode})})])}disconnectedCallback(){super.disconnectedCallback(),this._destroySpeechController()}_configureController(){let e=this._resolveMode();this._destroySpeechController(),this._resolvedMode=e,e!=="disabled"&&(this._speechController=e==="web-speech"?new _({language:this.language}):new c({language:this.language,handleRecording:this._handleRecording.bind(this)}))}_destroySpeechController(){this._speechController?.cancel(),this._speechController?.destroy(),this._speechController=void 0}async _handleToggle(){if(!(this._isButtonDisabled||!this._speechController)){if(this._state==="listening"){this._speechController.stop(),this.arcgisVoiceInputStop.emit();return}this._speechController.start(),this.arcgisVoiceInputStart.emit()}}async _handleRecording(e,s,r,i){let n;return this.arcgisVoiceInputTranscriptionStreamChunk.emit({blob:e,chunkIndex:r,isFinal:i,mimeType:s,respondWithTranscript:o=>{n=o}}),n}_resolveMode(){return this.mode==="disabled"?"disabled":this.mode==="web-speech"&&_.isSupported()?"web-speech":c.isSupported()?"media-recorder":"disabled"}async _cancelActiveSession(){this._speechController&&this._resolvedMode!=="disabled"&&this._speechController.cancel()}render(){return S`<calcite-button appearance=transparent class="assistant-chat-entry-speech-input__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-chat-entry-speech-input",b);return b},"core/reactiveUtils","core/Accessor","core/accessorSupport/decorators")
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import c from"./
|
|
2
|
+
import c from"./Y4RSINW4.js";import b from"./L7YTPHKQ.js";import{a as e,c as a}from"./B4DEC7PH.js";import"./KVH3PDVW.js";import"./YGW7TUNX.js";import{v as s,z as r}from"./6TDOQJ45.js";import"./CFDTXKJ6.js";export default $arcgis.t(([,{c:i}])=>{var t=class extends s{constructor(){super(...arguments),this.agent=i}static{this.properties={referenceElement:1}}#t;getContext(){if(!this.#t)throw new Error("arcgis-assistant-layer-styling-agent requires a mapView");return{mapView:this.#t}}load(){this.#t=e(this,"arcgis-assistant-layer-styling-agent"),a(this)}};r("arcgis-assistant-layer-styling-agent",t);return t},b,c)
|
|
@@ -4,11 +4,25 @@ import"./CFDTXKJ6.js";var e=`## Task: Summarize Geographic Features
|
|
|
4
4
|
You are given features from ArcGIS Feature layer for multiple layers:
|
|
5
5
|
{queryResponse}
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
## Input
|
|
8
|
+
|
|
9
|
+
Assigned task:
|
|
10
|
+
{assignedTask}
|
|
11
|
+
|
|
12
|
+
Latest user request:
|
|
13
|
+
{userRequest}
|
|
14
|
+
|
|
15
|
+
Prior steps:
|
|
16
|
+
{priorSteps}
|
|
17
|
+
|
|
18
|
+
Use the assigned task as the primary instruction for the current query.
|
|
19
|
+
Use the latest user request as supporting context when needed.
|
|
20
|
+
Use prior steps only when the assigned task clearly depends on earlier results.
|
|
21
|
+
Use chat history only when necessary to understand conversational references, and do not override the assigned task.
|
|
8
22
|
|
|
9
23
|
### Your goal:
|
|
10
24
|
|
|
11
|
-
1. If the
|
|
25
|
+
1. If the assigned task is about a **specific calculation** (e.g., average, total, count, min, max), return only the **direct numeric answer** \u2014 short and clear.
|
|
12
26
|
- Example: \u201CThe average price is $4.00.\u201D
|
|
13
27
|
|
|
14
28
|
2. If the question is more general or there are **multiple features with varying attributes**, write a **brief summary** (2\u20133 sentences max) that highlights key patterns or insights.
|
|
@@ -43,5 +57,5 @@ In all cases:
|
|
|
43
57
|
- Do NOT add any text beyond the requested summary or numeric answer.
|
|
44
58
|
- End the response immediately after the summary.
|
|
45
59
|
- Do NOT include introductory phrases (e.g., "Found", "Here are", "The results show").
|
|
46
|
-
- Do NOT restate the user\u2019s question.
|
|
60
|
+
- Do NOT restate the assigned task or user\u2019s question.
|
|
47
61
|
`;export{e as default};
|