@arcgis/ai-components 5.2.0-next.76 → 5.2.0-next.78
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/agents/tools/filter/clearFilters/adapter.d.ts +8 -0
- package/dist/{chunks/adapter12.js → agents/tools/filter/clearFilters/adapter.js} +1 -1
- package/dist/agents/tools/filter/resetMap/adapter.d.ts +8 -0
- package/dist/{chunks/adapter13.js → agents/tools/filter/resetMap/adapter.js} +1 -1
- package/dist/agents/tools/filter/setFeatureEffect/adapter.d.ts +8 -0
- package/dist/{chunks/adapter14.js → agents/tools/filter/setFeatureEffect/adapter.js} +2 -2
- package/dist/agents/tools/help/listFields/adapter.d.ts +11 -0
- package/dist/{chunks/adapter11.js → agents/tools/help/listFields/adapter.js} +1 -1
- package/dist/agents/tools/navigation/goToAddress/adapter.d.ts +10 -0
- package/dist/{chunks/adapter2.js → agents/tools/navigation/goToAddress/adapter.js} +1 -1
- package/dist/agents/tools/navigation/goToBookmark/adapter.d.ts +8 -0
- package/dist/{chunks/adapter3.js → agents/tools/navigation/goToBookmark/adapter.js} +1 -1
- package/dist/agents/tools/navigation/goToFeatures/adapter.d.ts +8 -0
- package/dist/{chunks/adapter4.js → agents/tools/navigation/goToFeatures/adapter.js} +1 -1
- package/dist/agents/tools/navigation/goToFullExtent/adapter.d.ts +8 -0
- package/dist/{chunks/adapter5.js → agents/tools/navigation/goToFullExtent/adapter.js} +1 -1
- package/dist/agents/tools/navigation/goToHomeExtent/adapter.d.ts +8 -0
- package/dist/{chunks/adapter6.js → agents/tools/navigation/goToHomeExtent/adapter.js} +1 -1
- package/dist/agents/tools/navigation/goToLayer/adapter.d.ts +8 -0
- package/dist/{chunks/adapter7.js → agents/tools/navigation/goToLayer/adapter.js} +1 -1
- package/dist/agents/tools/navigation/goToScale/adapter.d.ts +8 -0
- package/dist/{chunks/adapter8.js → agents/tools/navigation/goToScale/adapter.js} +1 -1
- package/dist/agents/tools/navigation/goToViewpoint/adapter.d.ts +8 -0
- package/dist/{chunks/adapter9.js → agents/tools/navigation/goToViewpoint/adapter.js} +1 -1
- package/dist/agents/tools/navigation/goToZoom/adapter.d.ts +8 -0
- package/dist/{chunks/adapter10.js → agents/tools/navigation/goToZoom/adapter.js} +1 -1
- package/dist/agents/tools/query/getAttribute/adapter.d.ts +8 -0
- package/dist/{chunks/adapter15.js → agents/tools/query/getAttribute/adapter.js} +2 -2
- package/dist/agents/tools/query/getStatistics/adapter.d.ts +8 -0
- package/dist/{chunks/adapter16.js → agents/tools/query/getStatistics/adapter.js} +4 -4
- package/dist/agents/tools/query/getTopFeatures/adapter.d.ts +8 -0
- package/dist/{chunks/adapter17.js → agents/tools/query/getTopFeatures/adapter.js} +4 -4
- package/dist/agents/tools/query/queryFeatures/adapter.d.ts +8 -0
- package/dist/{chunks/adapter18.js → agents/tools/query/queryFeatures/adapter.js} +4 -4
- package/dist/cdn/{GRHIFCQX.js → 2EY3BQQX.js} +1 -1
- package/dist/cdn/3LILAJUD.js +2 -0
- package/dist/cdn/{S6OYR4VI.js → 3ORURUNE.js} +7 -7
- package/dist/cdn/4F7Y4RNW.js +2 -0
- package/dist/cdn/{MM33KJPF.js → 4OGR5QKS.js} +1 -1
- package/dist/cdn/{66SKMECC.js → 4WIDLQUH.js} +1 -1
- package/dist/cdn/{WMZ24LWS.js → 5X7EG7D2.js} +1 -1
- package/dist/cdn/{B6CJG5UH.js → 6U4GTCLJ.js} +14 -14
- package/dist/cdn/{7E2QMWK6.js → 7V6OSTFC.js} +1 -1
- package/dist/cdn/{5WLNL4HZ.js → 7ZFAFKJT.js} +1 -1
- package/dist/cdn/ADJ63EDN.js +3 -0
- package/dist/cdn/ATFNWFKG.js +2 -0
- package/dist/cdn/{VYTYVWR6.js → BGD2CCRJ.js} +1 -1
- package/dist/cdn/{253R5CBD.js → BS3HNSXX.js} +1 -1
- package/dist/cdn/{QZ3NQTNQ.js → BWLXDT75.js} +1 -1
- package/dist/cdn/{I6PD2HSL.js → CJMUJXPL.js} +1 -1
- package/dist/cdn/CZLLPKMS.js +2 -0
- package/dist/cdn/{CWD37QFT.js → CZM4URK7.js} +1 -1
- package/dist/cdn/EBNVLMUU.js +2 -0
- package/dist/cdn/{UPWAOZXQ.js → ERNYKCUJ.js} +1 -1
- package/dist/cdn/G5XE5D36.js +2 -0
- package/dist/cdn/{5RVELJU4.js → GAPKW32H.js} +1 -1
- package/dist/cdn/{HZ5ARNAM.js → GFEOVHJK.js} +1 -1
- package/dist/cdn/{U3XIDLHO.js → HPU6K67Y.js} +1 -1
- package/dist/cdn/{2VBPA27M.js → I7KCB7KE.js} +1 -1
- package/dist/cdn/{323DHVYA.js → IIIUSDQR.js} +1 -1
- package/dist/cdn/{TQXLSW4A.js → J7OJABFU.js} +1 -1
- package/dist/cdn/{TKYI5QRL.js → JO5ETMPS.js} +1 -1
- package/dist/cdn/LXQFE5PJ.js +2 -0
- package/dist/cdn/NLEBWLVV.js +2 -0
- package/dist/cdn/ORRMONGJ.js +2 -0
- package/dist/cdn/{MDM2K3U7.js → PBMQI4MV.js} +1 -1
- package/dist/cdn/{6CLF7KIK.js → PKJY7FBV.js} +1 -1
- package/dist/cdn/{K33MZ726.js → PUHRBGKB.js} +1 -1
- package/dist/cdn/{5DVRVY4L.js → Q57QWN5W.js} +1 -1
- package/dist/cdn/QUMNJVKX.js +2 -0
- package/dist/cdn/{QRHZXLZN.js → RBE55SWR.js} +1 -1
- package/dist/cdn/{RADWN4ZP.js → T4RIGOXB.js} +1 -1
- package/dist/cdn/{5R6QUF5B.js → UHZG7SKO.js} +1 -1
- package/dist/cdn/{DUSILSNJ.js → XHGVCL22.js} +3 -3
- package/dist/cdn/XLHTQ7CF.js +2 -0
- package/dist/cdn/{V6HOUZPZ.js → YLGKKWZK.js} +1 -1
- package/dist/cdn/YLVJA4ZE.js +2 -0
- package/dist/cdn/{NIY32GK2.js → YWULKUQV.js} +1 -1
- package/dist/cdn/{IRNSIUBT.js → YYSRYOHL.js} +1 -1
- package/dist/cdn/ZOEMBHRF.js +2 -0
- package/dist/cdn/ZWBFTKHF.js +2 -0
- package/dist/cdn/agent-utils/index.js +1 -1
- package/dist/cdn/assets/assistant/t9n/messages.en.json +1 -1
- package/dist/cdn/assets/assistant-interrupt/t9n/messages.en.json +1 -1
- package/dist/cdn/assets/assistant-interrupt-preview/t9n/messages.en.json +1 -0
- package/dist/cdn/assets/assistant-message/t9n/messages.en.json +1 -0
- package/dist/cdn/assets/assistant-message-loading/t9n/messages.en.json +1 -0
- package/dist/cdn/index.js +1 -1
- package/dist/chunks/adapter.js +57 -60
- package/dist/chunks/converterUtils.js +66 -48
- package/dist/chunks/helpGraph.js +1 -1
- package/dist/chunks/navigationGraph.js +9 -9
- package/dist/chunks/utils2.js +10 -41
- package/dist/chunks/utils3.js +41 -10
- package/dist/components/arcgis-assistant/customElement.d.ts +30 -1
- package/dist/components/arcgis-assistant/customElement.js +133 -135
- package/dist/components/arcgis-assistant-agent/customElement.js +18 -18
- package/dist/components/arcgis-assistant-data-exploration-agent/customElement.js +11 -11
- package/dist/components/arcgis-assistant-help-agent/customElement.js +17 -17
- package/dist/components/arcgis-assistant-interrupt/customElement.d.ts +4 -0
- package/dist/components/arcgis-assistant-interrupt/customElement.js +10 -11
- package/dist/components/arcgis-assistant-interrupt-preview/customElement.js +12 -8
- package/dist/components/arcgis-assistant-knowledge-agent/customElement.js +18 -18
- package/dist/components/arcgis-assistant-layer-styling-agent/customElement.js +18 -18
- package/dist/components/arcgis-assistant-message/customElement.d.ts +3 -0
- package/dist/components/arcgis-assistant-message/customElement.js +9 -8
- package/dist/components/arcgis-assistant-message-loading/customElement.d.ts +3 -0
- package/dist/components/arcgis-assistant-message-loading/customElement.js +11 -10
- package/dist/components/arcgis-assistant-message-text/customElement.js +4 -4
- package/dist/components/arcgis-assistant-navigation-agent/customElement.js +9 -9
- package/dist/components/arcgis-assistant-user-message/customElement.d.ts +2 -0
- package/dist/components/arcgis-assistant-user-message/customElement.js +13 -10
- package/dist/docs/api.json +1 -1
- package/dist/docs/docs.json +1 -1
- package/dist/docs/vscode.html-custom-data.json +1 -1
- package/dist/docs/web-types.json +1 -1
- package/dist/loader.js +4 -4
- package/dist/types/lumina.d.ts +2 -2
- package/dist/types/preact.d.ts +2 -2
- package/dist/types/react.d.ts +2 -2
- package/dist/types/stencil.d.ts +2 -2
- package/package.json +22 -5
- package/dist/cdn/2GH3K5JP.js +0 -2
- package/dist/cdn/2Y4DTOGT.js +0 -2
- package/dist/cdn/3S5G5SIX.js +0 -2
- package/dist/cdn/5TI2F5XX.js +0 -2
- package/dist/cdn/DCSZPL7R.js +0 -2
- package/dist/cdn/FSGIG7UN.js +0 -2
- package/dist/cdn/GLBE7OW2.js +0 -2
- package/dist/cdn/IDUC4CPV.js +0 -2
- package/dist/cdn/K335IAIE.js +0 -2
- package/dist/cdn/KKLAQF3Z.js +0 -2
- package/dist/cdn/KLYNL2ZT.js +0 -2
- package/dist/cdn/OKMZQXBQ.js +0 -2
- package/dist/cdn/T4ECSHM7.js +0 -2
- package/dist/cdn/U6FBRUM4.js +0 -3
- package/dist/cdn/WSHWQDO2.js +0 -2
- package/dist/cdn/XRE5USHA.js +0 -2
- /package/dist/cdn/{BS2PFNU4.js → 5WYRJMBW.js} +0 -0
- /package/dist/cdn/{RU2T7GUX.js → 5ZFUGNRN.js} +0 -0
- /package/dist/cdn/{4YXYLX4H.js → 6HF36IKA.js} +0 -0
- /package/dist/cdn/{77QFSIWW.js → 7SRLZQVC.js} +0 -0
- /package/dist/cdn/{KA3FF3ZO.js → JKIESH74.js} +0 -0
- /package/dist/cdn/{CGXQAB3A.js → K2R6XVK3.js} +0 -0
- /package/dist/cdn/{LCFIADOZ.js → KITIP6J2.js} +0 -0
- /package/dist/cdn/{T2GJLEYV.js → KWD2ECTM.js} +0 -0
- /package/dist/cdn/{DYASSC7Z.js → LLUGJKAQ.js} +0 -0
- /package/dist/cdn/{3UEKINYC.js → MMHDT4KV.js} +0 -0
- /package/dist/cdn/{WS3T73IY.js → OAKRPM7D.js} +0 -0
- /package/dist/cdn/{Q4IQUEZN.js → U2D53TAX.js} +0 -0
- /package/dist/cdn/{4MFEKBKL.js → V52XWEGV.js} +0 -0
- /package/dist/cdn/{EAEQONP7.js → VLLZ2FFU.js} +0 -0
- /package/dist/cdn/{DY36ATOA.js → WKTQVBFJ.js} +0 -0
- /package/dist/cdn/{5PJXNTLZ.js → Y7XD7ZRD.js} +0 -0
- /package/dist/cdn/{UIXX3XEN.js → YEZ3AMNX.js} +0 -0
- /package/dist/cdn/{QVOMX3R6.js → Z5W4V7RC.js} +0 -0
package/dist/chunks/adapter.js
CHANGED
|
@@ -34,13 +34,13 @@ import { createAgeRenderer as Ce, createContinuousRenderer as $e } from "@arcgis
|
|
|
34
34
|
import { createRenderer as Pe } from "@arcgis/core/smartMapping/renderers/type.js";
|
|
35
35
|
import { getSchemesByTag as Ee } from "@arcgis/core/smartMapping/symbology/type.js";
|
|
36
36
|
import { ToolNode as ze } from "@langchain/langgraph/prebuilt";
|
|
37
|
-
import { clearFiltersTool as ke } from "
|
|
38
|
-
import { resetMapTool as Ae } from "
|
|
39
|
-
import { setFeatureEffectTool as qe } from "
|
|
40
|
-
import { getAttributeTool as
|
|
41
|
-
import { getStatisticsTool as
|
|
42
|
-
import { getTopFeaturesTool as De } from "
|
|
43
|
-
import { queryFeaturesTool as Le } from "
|
|
37
|
+
import { clearFiltersTool as ke } from "../agents/tools/filter/clearFilters/adapter.js";
|
|
38
|
+
import { resetMapTool as Ae } from "../agents/tools/filter/resetMap/adapter.js";
|
|
39
|
+
import { setFeatureEffectTool as qe } from "../agents/tools/filter/setFeatureEffect/adapter.js";
|
|
40
|
+
import { getAttributeTool as Ne } from "../agents/tools/query/getAttribute/adapter.js";
|
|
41
|
+
import { getStatisticsTool as Me } from "../agents/tools/query/getStatistics/adapter.js";
|
|
42
|
+
import { getTopFeaturesTool as De } from "../agents/tools/query/getTopFeatures/adapter.js";
|
|
43
|
+
import { queryFeaturesTool as Le } from "../agents/tools/query/queryFeatures/adapter.js";
|
|
44
44
|
import Ge from "@arcgis/core/WebLinkChart.js";
|
|
45
45
|
import re from "@arcgis/core/rest/knowledgeGraph/GraphQueryStreaming.js";
|
|
46
46
|
import "@arcgis/core/views/LinkChartView.js";
|
|
@@ -779,7 +779,7 @@ async function qr({
|
|
|
779
779
|
return `Error applying size-age renderer: ${p instanceof Error ? p.message : String(p)}`;
|
|
780
780
|
}
|
|
781
781
|
}
|
|
782
|
-
async function
|
|
782
|
+
async function Nr({
|
|
783
783
|
layerId: e,
|
|
784
784
|
fields: t,
|
|
785
785
|
colorSchemes: r,
|
|
@@ -795,19 +795,19 @@ async function Mr({
|
|
|
795
795
|
theme: a
|
|
796
796
|
});
|
|
797
797
|
}
|
|
798
|
-
const
|
|
798
|
+
const Mr = c.object({
|
|
799
799
|
layerId: c.string().describe("The id of the layer to apply the size-age renderer to"),
|
|
800
800
|
fields: c.array(c.string()).describe("The field(s) to use for the size-age renderer (temporal data with size)"),
|
|
801
801
|
colorSchemes: c.array(c.string()).optional().describe("Optional color scheme tags to use"),
|
|
802
802
|
theme: c.enum(["above-and-below", "above", "below", "centered-on", "extremes", "high-to-low"]).optional().describe("Optional theme for the size ramp")
|
|
803
|
-
}), qa = g(
|
|
803
|
+
}), qa = g(Nr, {
|
|
804
804
|
name: "size-age",
|
|
805
805
|
description: `Label: Age (size)
|
|
806
806
|
Description: Vary symbol sizes along a continuous ramp to represent the age of features. Age reflects the length of time from a start date to an end date.
|
|
807
807
|
Keywords: since, age, how old, how long
|
|
808
808
|
Example: Change the size of features so older features are larger than new features.
|
|
809
809
|
Fields: This style requires at least one field with a date type.`,
|
|
810
|
-
schema:
|
|
810
|
+
schema: Mr
|
|
811
811
|
});
|
|
812
812
|
function Dr(e) {
|
|
813
813
|
const { fields: t, layer: r, view: a } = e;
|
|
@@ -873,7 +873,7 @@ const Fr = c.object({
|
|
|
873
873
|
fields: c.array(c.string()).describe("The field(s) to use for the size renderer (numeric data)"),
|
|
874
874
|
colorSchemes: c.array(c.string()).optional().describe("Optional color scheme tags to use"),
|
|
875
875
|
theme: c.enum(["above-and-below", "above", "below", "centered-on", "extremes", "high-to-low"]).optional().describe("Optional theme for the size ramp")
|
|
876
|
-
}),
|
|
876
|
+
}), Na = g(jr, {
|
|
877
877
|
name: "size",
|
|
878
878
|
description: `Label: Counts and Amounts (size)
|
|
879
879
|
Description: Vary symbol sizes along a continuous ramp to represent numeric or ranked data.
|
|
@@ -955,7 +955,7 @@ const Kr = c.object({
|
|
|
955
955
|
fields: c.array(c.string()).describe("The field(s) to use for the type renderer (categorical data)"),
|
|
956
956
|
colorSchemes: c.array(c.string()).optional().describe("Optional color scheme tags to use"),
|
|
957
957
|
theme: c.enum(["above-and-below", "above", "below", "centered-on", "extremes", "high-to-low"]).optional().describe("Optional theme for the color scheme")
|
|
958
|
-
}),
|
|
958
|
+
}), Ma = g(Or, {
|
|
959
959
|
name: "type",
|
|
960
960
|
description: `Label: Types (unique symbols)
|
|
961
961
|
Description: Represent features as categories with different symbol colors or shapes. Examples include type of tree, road class, or province name.
|
|
@@ -979,7 +979,7 @@ Fields: This style requires a single field which may be a string, number, or dat
|
|
|
979
979
|
reducer: ee,
|
|
980
980
|
default: () => []
|
|
981
981
|
})
|
|
982
|
-
}), Vr = [
|
|
982
|
+
}), Vr = [Ne, Me, De, Le], Ga = [qe, Ae, ke], Wr = new ze(Vr, { handleToolErrors: !1 });
|
|
983
983
|
async function ja(e, t) {
|
|
984
984
|
const { messages: r } = await Wr.invoke({ messages: e.dataExplorationMessages }, t), a = [], o = [];
|
|
985
985
|
for (const i of r) {
|
|
@@ -1046,10 +1046,10 @@ function W(e) {
|
|
|
1046
1046
|
throw new Error("The Knowledge Agent currently only supports maps with exactly one Knowledge Graph Layer.");
|
|
1047
1047
|
}
|
|
1048
1048
|
function x(e) {
|
|
1049
|
-
return !!e?.map &&
|
|
1049
|
+
return !!e?.map && "activeLinkChartLayer" in e.map;
|
|
1050
1050
|
}
|
|
1051
1051
|
async function j(e) {
|
|
1052
|
-
!
|
|
1052
|
+
!x(e) || !e.map.diagramNodesExtent || await e.goTo(e.map.diagramNodesExtent);
|
|
1053
1053
|
}
|
|
1054
1054
|
function q(e) {
|
|
1055
1055
|
const r = e?.configurable?.context;
|
|
@@ -1067,9 +1067,9 @@ function Qa(e) {
|
|
|
1067
1067
|
if (te(e) === "knowledgeGraph")
|
|
1068
1068
|
return "knowledgeGraph";
|
|
1069
1069
|
const o = r.view;
|
|
1070
|
-
return x(o) ? (W(o), "map")
|
|
1070
|
+
return x(o) ? "linkChart" : (W(o), "map");
|
|
1071
1071
|
}
|
|
1072
|
-
async function
|
|
1072
|
+
async function N(e) {
|
|
1073
1073
|
const r = e?.configurable?.context;
|
|
1074
1074
|
if (te(e) === "knowledgeGraph")
|
|
1075
1075
|
return r;
|
|
@@ -1591,7 +1591,7 @@ async function ie({
|
|
|
1591
1591
|
includeReturnEntityAndRelationshipContext: a = !1
|
|
1592
1592
|
}) {
|
|
1593
1593
|
const o = [e];
|
|
1594
|
-
if (a && o.push(ne),
|
|
1594
|
+
if (a && o.push(ne), x(t)) {
|
|
1595
1595
|
const d = await L("arcgis_knowledge_current_lc_context"), u = ot(t.map, r);
|
|
1596
1596
|
return o.push(d), {
|
|
1597
1597
|
enhancedPrompt: o.join(`
|
|
@@ -1653,16 +1653,16 @@ async function ct(e, t, r, a, o, i) {
|
|
|
1653
1653
|
text: `Query Results parsed into ${u.length} unique relationships and entities. Atempting to add to link chart...`
|
|
1654
1654
|
},
|
|
1655
1655
|
i
|
|
1656
|
-
),
|
|
1656
|
+
), x(s) ? (await s.map.addRecords(u), await j(s), { generatedQuery: l, explanation: p, addedIdTypePairs: u }) : (await s?.map?.allLayers.find(
|
|
1657
1657
|
(f) => f.type === "knowledge-graph"
|
|
1658
1658
|
)?.addRecords(u), { generatedQuery: l, explanation: p, addedIdTypePairs: u });
|
|
1659
1659
|
}
|
|
1660
|
-
const
|
|
1660
|
+
const M = "addRecords", pt = c.object({
|
|
1661
1661
|
prompt: c.string().describe(
|
|
1662
1662
|
"The user's inquiry and context required in order to generate a cypher query that will be used to add records to the link chart."
|
|
1663
1663
|
)
|
|
1664
1664
|
}), dt = async ({ prompt: e }, t) => {
|
|
1665
|
-
const { knowledgeGraph: r } = await
|
|
1665
|
+
const { knowledgeGraph: r } = await N(t), a = q(t), { view: o } = a, s = P.getDefault().helperServices, {
|
|
1666
1666
|
enhancedPrompt: n,
|
|
1667
1667
|
bindParameters: l,
|
|
1668
1668
|
allNamedTypesFullyDynamic: p
|
|
@@ -1674,7 +1674,7 @@ const N = "addRecords", pt = c.object({
|
|
|
1674
1674
|
});
|
|
1675
1675
|
if (p)
|
|
1676
1676
|
return {
|
|
1677
|
-
toolName:
|
|
1677
|
+
toolName: M,
|
|
1678
1678
|
status: "success",
|
|
1679
1679
|
summary: "No records have been added to the map because all data in the knowledge graph is contained in the map.",
|
|
1680
1680
|
details: {
|
|
@@ -1693,7 +1693,7 @@ const N = "addRecords", pt = c.object({
|
|
|
1693
1693
|
t
|
|
1694
1694
|
);
|
|
1695
1695
|
return {
|
|
1696
|
-
toolName:
|
|
1696
|
+
toolName: M,
|
|
1697
1697
|
status: "success",
|
|
1698
1698
|
summary: `Records added successfully. Cypher Query used: ${d}
|
|
1699
1699
|
|
|
@@ -1707,14 +1707,14 @@ Number of records added: ${h.length}`,
|
|
|
1707
1707
|
} catch (d) {
|
|
1708
1708
|
const u = E(d);
|
|
1709
1709
|
return {
|
|
1710
|
-
toolName:
|
|
1710
|
+
toolName: M,
|
|
1711
1711
|
status: "error",
|
|
1712
1712
|
errorMessage: `Failed to add records to the link chart. ${u}`,
|
|
1713
1713
|
error: d
|
|
1714
1714
|
};
|
|
1715
1715
|
}
|
|
1716
1716
|
}, Ia = g(dt, {
|
|
1717
|
-
name:
|
|
1717
|
+
name: M,
|
|
1718
1718
|
description: `Adds records (entities or relationships) to the current link chart visualization from an inquiry into the knowledge graph data. The inquiry will retrieve data from the graph database that will serve as the basis for the records to be added to the link chart. The user should have explicitly requested to add records to the current link chart from their prompt. "add to new link chart" is not a valid prompt for this tool.
|
|
1719
1719
|
|
|
1720
1720
|
example prompts:
|
|
@@ -1747,14 +1747,7 @@ const _ = "applyLayout", ht = c.object({
|
|
|
1747
1747
|
)
|
|
1748
1748
|
}), yt = async ({ layout: e }, t) => {
|
|
1749
1749
|
const { view: r } = q(t);
|
|
1750
|
-
if (x(r))
|
|
1751
|
-
return {
|
|
1752
|
-
toolName: _,
|
|
1753
|
-
status: "error",
|
|
1754
|
-
errorMessage: "The applyLayout tool can only be used with a LinkChartView.",
|
|
1755
|
-
error: new Error()
|
|
1756
|
-
};
|
|
1757
|
-
{
|
|
1750
|
+
if (x(r)) {
|
|
1758
1751
|
const { appliedLayout: a } = await ut(e, r);
|
|
1759
1752
|
return {
|
|
1760
1753
|
toolName: _,
|
|
@@ -1764,7 +1757,13 @@ const _ = "applyLayout", ht = c.object({
|
|
|
1764
1757
|
appliedLayout: a
|
|
1765
1758
|
}
|
|
1766
1759
|
};
|
|
1767
|
-
}
|
|
1760
|
+
} else
|
|
1761
|
+
return {
|
|
1762
|
+
toolName: _,
|
|
1763
|
+
status: "error",
|
|
1764
|
+
errorMessage: "The applyLayout tool can only be used with a LinkChartView.",
|
|
1765
|
+
error: new Error()
|
|
1766
|
+
};
|
|
1768
1767
|
}, Oa = g(yt, {
|
|
1769
1768
|
name: _,
|
|
1770
1769
|
description: "Apply a diagram layout to the link chart",
|
|
@@ -1777,14 +1776,7 @@ const Q = "changeNonspatialVisibility", gt = c.object({
|
|
|
1777
1776
|
setting: c.enum(["hidden", "visible"]).describe("The setting of nonspatial visibility")
|
|
1778
1777
|
}), ft = async ({ setting: e }, t) => {
|
|
1779
1778
|
const { view: r } = q(t);
|
|
1780
|
-
if (x(r))
|
|
1781
|
-
return {
|
|
1782
|
-
toolName: Q,
|
|
1783
|
-
status: "error",
|
|
1784
|
-
errorMessage: "The changeNonspatialVisibility tool can only be used with a LinkChartView.",
|
|
1785
|
-
error: new Error()
|
|
1786
|
-
};
|
|
1787
|
-
{
|
|
1779
|
+
if (x(r)) {
|
|
1788
1780
|
const { appliedNonspatialDataDisplayMode: a } = await mt(e, r);
|
|
1789
1781
|
return {
|
|
1790
1782
|
toolName: Q,
|
|
@@ -1794,7 +1786,13 @@ const Q = "changeNonspatialVisibility", gt = c.object({
|
|
|
1794
1786
|
appliedNonspatialDataDisplayMode: a
|
|
1795
1787
|
}
|
|
1796
1788
|
};
|
|
1797
|
-
}
|
|
1789
|
+
} else
|
|
1790
|
+
return {
|
|
1791
|
+
toolName: Q,
|
|
1792
|
+
status: "error",
|
|
1793
|
+
errorMessage: "The changeNonspatialVisibility tool can only be used with a LinkChartView.",
|
|
1794
|
+
error: new Error()
|
|
1795
|
+
};
|
|
1798
1796
|
}, Ka = g(ft, {
|
|
1799
1797
|
name: Q,
|
|
1800
1798
|
description: "Change whether or not nonspatial data is visible in the link chart. The value must be either 'hidden' or 'visible'.",
|
|
@@ -1857,15 +1855,8 @@ const D = "createLinkChart", bt = c.object({
|
|
|
1857
1855
|
"The user's inquiry and context required in order to generate a cypher query that will be used to create a link chart visualization. Only include information relevant to generating a cypher query. Do not suggest entity types, relationship types or properties. Do not include limits or formatting instructions for the query results unless specifically requested by the user. The prompt should be focused on the data the user wants to see in the link chart, not how to generate it."
|
|
1858
1856
|
)
|
|
1859
1857
|
}), Tt = async ({ prompt: e }, t) => {
|
|
1860
|
-
const { knowledgeGraph: r } = await
|
|
1861
|
-
if (x(a))
|
|
1862
|
-
return {
|
|
1863
|
-
toolName: D,
|
|
1864
|
-
status: "error",
|
|
1865
|
-
errorMessage: "The createLinkChart tool can only be used with a LinkChartView.",
|
|
1866
|
-
error: new Error()
|
|
1867
|
-
};
|
|
1868
|
-
{
|
|
1858
|
+
const { knowledgeGraph: r } = await N(t), { view: a } = q(t);
|
|
1859
|
+
if (x(a)) {
|
|
1869
1860
|
const i = P.getDefault().helperServices, s = await wt(
|
|
1870
1861
|
`${e}
|
|
1871
1862
|
|
|
@@ -1895,7 +1886,13 @@ Explanation: ${l}`,
|
|
|
1895
1886
|
explanation: l
|
|
1896
1887
|
}
|
|
1897
1888
|
};
|
|
1898
|
-
}
|
|
1889
|
+
} else
|
|
1890
|
+
return {
|
|
1891
|
+
toolName: D,
|
|
1892
|
+
status: "error",
|
|
1893
|
+
errorMessage: "The createLinkChart tool can only be used with a LinkChartView.",
|
|
1894
|
+
error: new Error()
|
|
1895
|
+
};
|
|
1899
1896
|
}, Va = g(Tt, {
|
|
1900
1897
|
name: D,
|
|
1901
1898
|
description: "Creates a new link chart visualization from an inquiry into the knowledge graph data. The inquiry will retrieve data from the graph database that will serve as the basis for the new link chart. The user should have explicitly requested the creation of a new link chart from their prompt using language like 'create new link chart' or 'add to new link chart'.",
|
|
@@ -1905,7 +1902,7 @@ Explanation: ${l}`,
|
|
|
1905
1902
|
"The user's inquiry into the knowledge graph, from which a cypher query will be generated and executed to answer the inquiry. Only include entity types, relationship types or properties if they are provided in the user prompt or prior steps. Do not suggest entity types, relationship types or properties. Do not include limits, information on what to return, instructions on how to write the query, or formatting instructions for the query results unless specifically requested by the user."
|
|
1906
1903
|
)
|
|
1907
1904
|
}), vt = async ({ prompt: e }, t) => {
|
|
1908
|
-
const { knowledgeGraph: r } = await
|
|
1905
|
+
const { knowledgeGraph: r } = await N(t), o = P.getDefault().helperServices;
|
|
1909
1906
|
let i = e, s = null, n = null;
|
|
1910
1907
|
try {
|
|
1911
1908
|
({ view: n } = q(t));
|
|
@@ -1982,7 +1979,7 @@ ${w.length > y ? `Showing top ${y} results:
|
|
|
1982
1979
|
}), O = "generateCypher", Rt = c.object({
|
|
1983
1980
|
prompt: c.string().describe("The user's inquiry into the knowledge graph that needs to be translated into a cypher query.")
|
|
1984
1981
|
}), xt = async ({ prompt: e }, t) => {
|
|
1985
|
-
const { knowledgeGraph: r } = await
|
|
1982
|
+
const { knowledgeGraph: r } = await N(t), o = P.getDefault().helperServices;
|
|
1986
1983
|
try {
|
|
1987
1984
|
const { graphQuery: i, explanation: s } = await Xr(
|
|
1988
1985
|
e,
|
|
@@ -2062,7 +2059,7 @@ const K = "searchGraphData", Pt = c.object({
|
|
|
2062
2059
|
"The user's inquiry into the knowledge graph, from which a lucene search query will be generated and executed against the graph to return relevant results."
|
|
2063
2060
|
)
|
|
2064
2061
|
}), Et = async ({ prompt: e }, t) => {
|
|
2065
|
-
const { knowledgeGraph: r } = await
|
|
2062
|
+
const { knowledgeGraph: r } = await N(t);
|
|
2066
2063
|
await T({ text: "Generating search query for the user inquiry" }, t);
|
|
2067
2064
|
const a = await $t(e, r, t);
|
|
2068
2065
|
await T({ text: "Executing graph search with generated search query" }, t);
|
|
@@ -2138,7 +2135,7 @@ export {
|
|
|
2138
2135
|
Ia as e,
|
|
2139
2136
|
Qa as f,
|
|
2140
2137
|
L as g,
|
|
2141
|
-
|
|
2138
|
+
N as h,
|
|
2142
2139
|
_a as i,
|
|
2143
2140
|
xa as j,
|
|
2144
2141
|
Ca as k,
|
|
@@ -2153,8 +2150,8 @@ export {
|
|
|
2153
2150
|
Ie as t,
|
|
2154
2151
|
Aa as u,
|
|
2155
2152
|
qa as v,
|
|
2156
|
-
|
|
2157
|
-
|
|
2153
|
+
Na as w,
|
|
2154
|
+
Ma as x,
|
|
2158
2155
|
Ga as y,
|
|
2159
2156
|
Vr as z
|
|
2160
2157
|
};
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import
|
|
2
|
+
import w from "@esri/arcgis-html-sanitizer";
|
|
3
3
|
import { marked as S } from "marked";
|
|
4
4
|
S.use({
|
|
5
5
|
gfm: !0,
|
|
6
6
|
breaks: !0,
|
|
7
7
|
async: !1
|
|
8
8
|
});
|
|
9
|
-
const C = new
|
|
9
|
+
const C = new w(
|
|
10
10
|
{
|
|
11
11
|
whiteList: {
|
|
12
12
|
// LLMs sometimes return lists like "- 2) Foo". `marked` parses that into a nested ordered list
|
|
@@ -17,6 +17,7 @@ const C = new g(
|
|
|
17
17
|
"calcite-table-row": ["slot", "class"],
|
|
18
18
|
"calcite-table-header": ["heading", "alignment", "description", "class"],
|
|
19
19
|
"calcite-table-cell": ["alignment", "colspan", "rowspan", "class"],
|
|
20
|
+
"calcite-link": ["href", "target", "rel", "title"],
|
|
20
21
|
// Allow markdown code blocks to render as <pre><code>…</code></pre>.
|
|
21
22
|
pre: ["class"],
|
|
22
23
|
code: ["class"]
|
|
@@ -27,98 +28,115 @@ const C = new g(
|
|
|
27
28
|
function T(e) {
|
|
28
29
|
return C.sanitize(e);
|
|
29
30
|
}
|
|
31
|
+
function k(e) {
|
|
32
|
+
if (!e || typeof DOMParser > "u")
|
|
33
|
+
return e;
|
|
34
|
+
try {
|
|
35
|
+
const t = new DOMParser().parseFromString(e, "text/html");
|
|
36
|
+
return t.querySelectorAll("a").forEach((r) => {
|
|
37
|
+
const n = t.createElement("calcite-link");
|
|
38
|
+
for (const l of ["href", "target", "rel", "title"]) {
|
|
39
|
+
const a = r.getAttribute(l);
|
|
40
|
+
a !== null && n.setAttribute(l, a);
|
|
41
|
+
}
|
|
42
|
+
n.append(...r.childNodes), r.replaceWith(n);
|
|
43
|
+
}), t.body.innerHTML;
|
|
44
|
+
} catch {
|
|
45
|
+
return e;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
30
48
|
function A(e, t) {
|
|
31
|
-
const r = e.indexOf("{", t),
|
|
32
|
-
return r === -1 ?
|
|
49
|
+
const r = e.indexOf("{", t), n = e.indexOf("[", t);
|
|
50
|
+
return r === -1 ? n : n === -1 ? r : Math.min(r, n);
|
|
33
51
|
}
|
|
34
52
|
function x(e) {
|
|
35
53
|
if (e.trimStart().startsWith("```"))
|
|
36
54
|
return null;
|
|
37
55
|
for (let r = A(e, 0); r !== -1; r = A(e, r + 1)) {
|
|
38
|
-
let
|
|
39
|
-
for (let
|
|
40
|
-
const
|
|
41
|
-
if (
|
|
56
|
+
let n = 0, l = 0;
|
|
57
|
+
for (let a = r; a < e.length; a++) {
|
|
58
|
+
const c = e[a];
|
|
59
|
+
if (c === "{" ? n++ : c === "}" ? n-- : c === "[" ? l++ : c === "]" && l--, n < 0 || l < 0)
|
|
42
60
|
break;
|
|
43
|
-
if (
|
|
44
|
-
return e.slice(r,
|
|
61
|
+
if (n === 0 && l === 0 && a > r)
|
|
62
|
+
return e.slice(r, a + 1);
|
|
45
63
|
}
|
|
46
64
|
}
|
|
47
65
|
return null;
|
|
48
66
|
}
|
|
49
|
-
function
|
|
67
|
+
function z(e) {
|
|
50
68
|
if (!e)
|
|
51
69
|
return "";
|
|
52
70
|
let t = e;
|
|
53
71
|
const r = x(e);
|
|
54
72
|
if (r)
|
|
55
73
|
try {
|
|
56
|
-
const
|
|
74
|
+
const l = JSON.parse(r), c = `
|
|
57
75
|
|
|
58
76
|
\`\`\`json
|
|
59
|
-
${JSON.stringify(
|
|
77
|
+
${JSON.stringify(l, null, 2)}
|
|
60
78
|
\`\`\`
|
|
61
79
|
|
|
62
80
|
`;
|
|
63
|
-
t = e.replace(r,
|
|
81
|
+
t = e.replace(r, c);
|
|
64
82
|
} catch {
|
|
65
83
|
}
|
|
66
|
-
const
|
|
67
|
-
return
|
|
84
|
+
const n = q(t);
|
|
85
|
+
return M(n);
|
|
68
86
|
}
|
|
69
|
-
function
|
|
87
|
+
function M(e) {
|
|
70
88
|
if (!e)
|
|
71
89
|
return "";
|
|
72
|
-
const t =
|
|
73
|
-
return T(
|
|
90
|
+
const t = E(e), r = k(t);
|
|
91
|
+
return T(r);
|
|
74
92
|
}
|
|
75
|
-
function
|
|
93
|
+
function q(e) {
|
|
76
94
|
return e ? S.parse(e, { async: !1 }) : "";
|
|
77
95
|
}
|
|
78
|
-
function
|
|
96
|
+
function E(e) {
|
|
79
97
|
if (!e || typeof DOMParser > "u")
|
|
80
98
|
return e;
|
|
81
99
|
try {
|
|
82
100
|
const t = new DOMParser().parseFromString(e, "text/html");
|
|
83
|
-
return Array.from(t.querySelectorAll("table")).forEach((
|
|
84
|
-
const
|
|
85
|
-
|
|
86
|
-
const
|
|
87
|
-
if (
|
|
88
|
-
const
|
|
89
|
-
for (const u of
|
|
101
|
+
return Array.from(t.querySelectorAll("table")).forEach((n, l) => {
|
|
102
|
+
const a = t.createElement("calcite-table");
|
|
103
|
+
a.setAttribute("caption", `Table ${l + 1}`), a.setAttribute("striped", "true");
|
|
104
|
+
const c = n.querySelector("thead");
|
|
105
|
+
if (c) {
|
|
106
|
+
const f = Array.from(c.querySelectorAll("tr"));
|
|
107
|
+
for (const u of f) {
|
|
90
108
|
const o = t.createElement("calcite-table-row");
|
|
91
109
|
o.setAttribute("slot", "table-header");
|
|
92
|
-
const
|
|
93
|
-
for (const h of
|
|
94
|
-
const
|
|
95
|
-
|
|
110
|
+
const d = Array.from(u.querySelectorAll("th, td"));
|
|
111
|
+
for (const h of d) {
|
|
112
|
+
const i = (h.textContent ?? "").trim(), s = t.createElement("calcite-table-header");
|
|
113
|
+
s.setAttribute("heading", i), o.appendChild(s);
|
|
96
114
|
}
|
|
97
|
-
|
|
115
|
+
a.appendChild(o);
|
|
98
116
|
}
|
|
99
117
|
}
|
|
100
|
-
const b =
|
|
101
|
-
(b ? Array.from(b.querySelectorAll("tr")) : Array.from(
|
|
102
|
-
const o = t.createElement("calcite-table-row"),
|
|
103
|
-
|
|
104
|
-
const h = Array.from(
|
|
105
|
-
for (const
|
|
106
|
-
if (
|
|
107
|
-
const
|
|
108
|
-
y.setAttribute("heading",
|
|
118
|
+
const b = n.querySelector("tbody");
|
|
119
|
+
(b ? Array.from(b.querySelectorAll("tr")) : Array.from(n.querySelectorAll("tr")).filter((f) => !c?.contains(f))).forEach((f, u) => {
|
|
120
|
+
const o = t.createElement("calcite-table-row"), d = !c && u === 0 && f.querySelectorAll("th").length > 0;
|
|
121
|
+
d && o.setAttribute("slot", "table-header");
|
|
122
|
+
const h = Array.from(f.querySelectorAll("th, td"));
|
|
123
|
+
for (const i of h) {
|
|
124
|
+
if (d && i.localName === "th") {
|
|
125
|
+
const g = (i.textContent ?? "").trim(), y = t.createElement("calcite-table-header");
|
|
126
|
+
y.setAttribute("heading", g), o.appendChild(y);
|
|
109
127
|
return;
|
|
110
128
|
}
|
|
111
|
-
const
|
|
112
|
-
p &&
|
|
129
|
+
const s = t.createElement("calcite-table-cell"), p = i.getAttribute("colspan"), m = i.getAttribute("rowspan");
|
|
130
|
+
p && s.setAttribute("colspan", p), m && s.setAttribute("rowspan", m), s.innerHTML = i.innerHTML, o.appendChild(s);
|
|
113
131
|
}
|
|
114
|
-
|
|
115
|
-
}),
|
|
132
|
+
a.appendChild(o);
|
|
133
|
+
}), n.replaceWith(a);
|
|
116
134
|
}), t.body.innerHTML;
|
|
117
135
|
} catch {
|
|
118
136
|
return e;
|
|
119
137
|
}
|
|
120
138
|
}
|
|
121
139
|
export {
|
|
122
|
-
|
|
123
|
-
|
|
140
|
+
M as a,
|
|
141
|
+
z as p
|
|
124
142
|
};
|
package/dist/chunks/helpGraph.js
CHANGED
|
@@ -13,7 +13,7 @@ import "@arcgis/core/config.js";
|
|
|
13
13
|
import "@arcgis/core/core/reactiveUtils.js";
|
|
14
14
|
import "@arcgis/core/layers/FeatureLayer.js";
|
|
15
15
|
import { f as p } from "./fetchService.js";
|
|
16
|
-
import { listLayerFieldsTool as S } from "
|
|
16
|
+
import { listLayerFieldsTool as S } from "../agents/tools/help/listFields/adapter.js";
|
|
17
17
|
import { h as E } from "./toolCallResponse.js";
|
|
18
18
|
import { ToolNode as T } from "@langchain/langgraph/prebuilt";
|
|
19
19
|
import { s as m } from "./index.js";
|
|
@@ -12,15 +12,15 @@ import "@langchain/openai";
|
|
|
12
12
|
import "@arcgis/core/config.js";
|
|
13
13
|
import "@arcgis/core/core/reactiveUtils.js";
|
|
14
14
|
import "@arcgis/core/layers/FeatureLayer.js";
|
|
15
|
-
import { goToAddressTool as A } from "
|
|
16
|
-
import { goToBookmarkTool as _ } from "
|
|
17
|
-
import { goToFeaturesTool as I } from "
|
|
18
|
-
import { goToFullExtentTool as q } from "
|
|
19
|
-
import { goToHomeExtentTool as Z } from "
|
|
20
|
-
import { goToLayerTool as V } from "
|
|
21
|
-
import { goToScaleTool as j } from "
|
|
22
|
-
import { goToViewpointTool as P } from "
|
|
23
|
-
import { goToZoomTool as z } from "
|
|
15
|
+
import { goToAddressTool as A } from "../agents/tools/navigation/goToAddress/adapter.js";
|
|
16
|
+
import { goToBookmarkTool as _ } from "../agents/tools/navigation/goToBookmark/adapter.js";
|
|
17
|
+
import { goToFeaturesTool as I } from "../agents/tools/navigation/goToFeatures/adapter.js";
|
|
18
|
+
import { goToFullExtentTool as q } from "../agents/tools/navigation/goToFullExtent/adapter.js";
|
|
19
|
+
import { goToHomeExtentTool as Z } from "../agents/tools/navigation/goToHomeExtent/adapter.js";
|
|
20
|
+
import { goToLayerTool as V } from "../agents/tools/navigation/goToLayer/adapter.js";
|
|
21
|
+
import { goToScaleTool as j } from "../agents/tools/navigation/goToScale/adapter.js";
|
|
22
|
+
import { goToViewpointTool as P } from "../agents/tools/navigation/goToViewpoint/adapter.js";
|
|
23
|
+
import { goToZoomTool as z } from "../agents/tools/navigation/goToZoom/adapter.js";
|
|
24
24
|
import { f as w } from "./fetchAgentContext.js";
|
|
25
25
|
import { h as G } from "./toolCallResponse.js";
|
|
26
26
|
import { s as p } from "./index.js";
|
package/dist/chunks/utils2.js
CHANGED
|
@@ -1,47 +1,16 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import { getClosestElement as
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
const r = s(e.el, e.referenceElement);
|
|
6
|
-
if (r)
|
|
7
|
-
return r;
|
|
8
|
-
const n = i(e.el, "arcgis-assistant"), a = s(e.el, n?.referenceElement);
|
|
9
|
-
if (a)
|
|
10
|
-
return a;
|
|
11
|
-
throw new Error(`${t}: Reference element not found`);
|
|
2
|
+
import { getClosestElement as s } from "@arcgis/toolkit/dom";
|
|
3
|
+
function l(t, o) {
|
|
4
|
+
return o ? typeof o == "string" ? u(t, o) ?? null : o : s(t, "arcgis-map") ?? null;
|
|
12
5
|
}
|
|
13
|
-
function
|
|
14
|
-
|
|
15
|
-
if (!n)
|
|
16
|
-
throw new Error(`${t}: Reference element does not have a view`);
|
|
17
|
-
return n;
|
|
6
|
+
function n(t, o) {
|
|
7
|
+
return o ? typeof o == "string" ? u(t, o) ?? null : o : s(t, "arcgis-link-chart") ?? s(t, "arcgis-map") ?? null;
|
|
18
8
|
}
|
|
19
|
-
function
|
|
20
|
-
|
|
21
|
-
}
|
|
22
|
-
function g(e) {
|
|
23
|
-
const t = i(e.el, "arcgis-assistant");
|
|
24
|
-
if (t === void 0)
|
|
25
|
-
throw new Error("arcgis-assistant-agent must be used within an arcgis-assistant element");
|
|
26
|
-
return t.register({
|
|
27
|
-
agent: e.agent,
|
|
28
|
-
getContext: async () => await e.getContext?.() ?? e.context ?? {}
|
|
29
|
-
}), t;
|
|
30
|
-
}
|
|
31
|
-
function l(e) {
|
|
32
|
-
const t = o(e.el, e.referenceElement);
|
|
33
|
-
if (t)
|
|
34
|
-
return t;
|
|
35
|
-
const r = i(e.el, "arcgis-assistant"), n = s(e.el, r?.referenceElement);
|
|
36
|
-
return n || null;
|
|
37
|
-
}
|
|
38
|
-
function v(e) {
|
|
39
|
-
const t = l(e);
|
|
40
|
-
return t ? t.view : null;
|
|
9
|
+
function u(t, o) {
|
|
10
|
+
const r = o.includes("#") || o.includes(".") || o.includes("["), i = t.getRootNode();
|
|
11
|
+
return (r ? void 0 : i.querySelector(`#${o}`)) ?? i.querySelector(o) ?? void 0;
|
|
41
12
|
}
|
|
42
13
|
export {
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
g as i,
|
|
46
|
-
m as r
|
|
14
|
+
n as a,
|
|
15
|
+
l as g
|
|
47
16
|
};
|
package/dist/chunks/utils3.js
CHANGED
|
@@ -1,16 +1,47 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import { getClosestElement as
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
import { getClosestElement as i } from "@arcgis/toolkit/dom";
|
|
3
|
+
import { g as s, a as o } from "./utils2.js";
|
|
4
|
+
function c(e, t) {
|
|
5
|
+
const r = s(e.el, e.referenceElement);
|
|
6
|
+
if (r)
|
|
7
|
+
return r;
|
|
8
|
+
const n = i(e.el, "arcgis-assistant"), a = s(e.el, n?.referenceElement);
|
|
9
|
+
if (a)
|
|
10
|
+
return a;
|
|
11
|
+
throw new Error(`${t}: Reference element not found`);
|
|
5
12
|
}
|
|
6
|
-
function
|
|
7
|
-
|
|
13
|
+
function m(e, t) {
|
|
14
|
+
const n = c(e, t).view;
|
|
15
|
+
if (!n)
|
|
16
|
+
throw new Error(`${t}: Reference element does not have a view`);
|
|
17
|
+
return n;
|
|
8
18
|
}
|
|
9
|
-
function
|
|
10
|
-
|
|
11
|
-
|
|
19
|
+
function w(e) {
|
|
20
|
+
return typeof e == "function";
|
|
21
|
+
}
|
|
22
|
+
function g(e) {
|
|
23
|
+
const t = i(e.el, "arcgis-assistant");
|
|
24
|
+
if (t === void 0)
|
|
25
|
+
throw new Error("arcgis-assistant-agent must be used within an arcgis-assistant element");
|
|
26
|
+
return t.register({
|
|
27
|
+
agent: e.agent,
|
|
28
|
+
getContext: async () => await e.getContext?.() ?? e.context ?? {}
|
|
29
|
+
}), t;
|
|
30
|
+
}
|
|
31
|
+
function l(e) {
|
|
32
|
+
const t = o(e.el, e.referenceElement);
|
|
33
|
+
if (t)
|
|
34
|
+
return t;
|
|
35
|
+
const r = i(e.el, "arcgis-assistant"), n = s(e.el, r?.referenceElement);
|
|
36
|
+
return n || null;
|
|
37
|
+
}
|
|
38
|
+
function v(e) {
|
|
39
|
+
const t = l(e);
|
|
40
|
+
return t ? t.view : null;
|
|
12
41
|
}
|
|
13
42
|
export {
|
|
14
|
-
|
|
15
|
-
|
|
43
|
+
v as a,
|
|
44
|
+
w as b,
|
|
45
|
+
g as i,
|
|
46
|
+
m as r
|
|
16
47
|
};
|