@arcgis/portal-components 5.2.0-next.65 → 5.2.0-next.67

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (120) hide show
  1. package/dist/cdn/2BUE3JLM.js +2 -0
  2. package/dist/cdn/{Y7FCEDRU.js → 2OU5PLGU.js} +1 -1
  3. package/dist/cdn/2WI5FBDF.js +2 -0
  4. package/dist/cdn/3VHBMKYX.js +2 -0
  5. package/dist/cdn/64DIXKV3.js +2 -0
  6. package/dist/cdn/6KVA4AKM.js +2 -0
  7. package/dist/cdn/6TO2BYXU.js +2 -0
  8. package/dist/cdn/AR6YIWRX.js +2 -0
  9. package/dist/cdn/CYCKQHLO.js +2 -0
  10. package/dist/cdn/{ZV4GLQQG.js → D4VYYWA6.js} +1 -1
  11. package/dist/cdn/DEOAKHYN.js +2 -0
  12. package/dist/cdn/FKVT4PNP.js +2 -0
  13. package/dist/cdn/GC6YLNZF.js +2 -0
  14. package/dist/cdn/{VD6VGWCQ.js → JMEXULSL.js} +1 -1
  15. package/dist/cdn/KTBQ26TD.js +2 -0
  16. package/dist/cdn/LRADZ46B.js +2 -0
  17. package/dist/cdn/NWT7EITA.js +2 -0
  18. package/dist/cdn/{EE7XFMJG.js → O5AP2PN5.js} +1 -1
  19. package/dist/cdn/OUNIRHWU.js +2 -0
  20. package/dist/cdn/{XW42SAEJ.js → QFI3ZPNB.js} +1 -1
  21. package/dist/cdn/QMFRNHQJ.js +2 -0
  22. package/dist/cdn/QNA62UMC.js +2 -0
  23. package/dist/cdn/{6RLJVPF6.js → QWMWVF47.js} +1 -1
  24. package/dist/cdn/RWQL7W3X.js +2 -0
  25. package/dist/cdn/T6Z7IFG2.js +2 -0
  26. package/dist/cdn/USQ4RJYL.js +2 -0
  27. package/dist/cdn/{Q7SDLUZ6.js → V257KGGO.js} +1 -1
  28. package/dist/cdn/XSUV6RLR.js +2 -0
  29. package/dist/cdn/XTTOOMCY.js +66 -0
  30. package/dist/cdn/{CG4WYBHN.js → XUIVR4NX.js} +1 -1
  31. package/dist/cdn/{7YQTBSDS.js → YQV3M6JO.js} +109 -84
  32. package/dist/cdn/{SOJU4OFZ.js → ZMTS73PF.js} +1 -1
  33. package/dist/cdn/ZSNLY6QY.js +2 -0
  34. package/dist/cdn/assets/portal-item-badges/t9n/messages.en.json +1 -0
  35. package/dist/cdn/assets/portal-item-card/t9n/messages.en.json +1 -0
  36. package/dist/cdn/assets/portal-item-favorite/t9n/messages.en.json +1 -0
  37. package/dist/cdn/assets/portal-item-type/icons/applicationtheme16.svg +1 -0
  38. package/dist/cdn/assets/portal-item-type/icons/applicationtheme32.svg +1 -0
  39. package/dist/cdn/assets/portal-item-type/icons/layout16.svg +1 -0
  40. package/dist/cdn/assets/portal-item-type/icons/layout32.svg +1 -0
  41. package/dist/cdn/index.js +1 -1
  42. package/dist/cdn/main.css +1 -1
  43. package/dist/chunks/fieldAddDelete.js +1 -1
  44. package/dist/chunks/info.js +179 -0
  45. package/dist/chunks/item.js +8 -8
  46. package/dist/chunks/items.js +16 -0
  47. package/dist/chunks/portal-item-badge.js +346 -0
  48. package/dist/chunks/portal.js +3 -3
  49. package/dist/chunks/portal2.js +3 -3
  50. package/dist/chunks/query.js +4 -4
  51. package/dist/chunks/string.js +2 -2
  52. package/dist/chunks/users.js +7 -0
  53. package/dist/chunks/utils.js +75 -636
  54. package/dist/chunks/utils2.js +653 -0
  55. package/dist/chunks/verified.js +40 -0
  56. package/dist/components/arcgis-portal-account-switcher/customElement.js +58 -72
  57. package/dist/components/arcgis-portal-account-switcher-list/customElement.js +6 -6
  58. package/dist/components/arcgis-portal-ai-assistant/customElement.d.ts +9 -7
  59. package/dist/components/arcgis-portal-ai-assistant/customElement.js +944 -775
  60. package/dist/components/arcgis-portal-field-delete/customElement.js +2 -1
  61. package/dist/components/arcgis-portal-group-browser/customElement.js +3 -3
  62. package/dist/components/arcgis-portal-group-browser/types.d.ts +6 -2
  63. package/dist/components/arcgis-portal-group-browser-preview/customElement.d.ts +9 -9
  64. package/dist/components/arcgis-portal-group-browser-preview/customElement.js +16 -16
  65. package/dist/components/arcgis-portal-group-browser-preview-card/customElement.d.ts +18 -18
  66. package/dist/components/arcgis-portal-group-browser-preview-card/customElement.js +31 -30
  67. package/dist/components/arcgis-portal-group-card/customElement.d.ts +25 -25
  68. package/dist/components/arcgis-portal-group-card/customElement.js +7 -7
  69. package/dist/components/arcgis-portal-item-actions/customElement.d.ts +74 -0
  70. package/dist/components/arcgis-portal-item-actions/customElement.js +89 -0
  71. package/dist/components/arcgis-portal-item-actions/index.d.ts +1 -0
  72. package/dist/components/arcgis-portal-item-actions/index.js +5 -0
  73. package/dist/components/arcgis-portal-item-badge/customElement.d.ts +260 -0
  74. package/dist/components/arcgis-portal-item-badge/customElement.js +9 -0
  75. package/dist/components/arcgis-portal-item-badge/index.d.ts +1 -0
  76. package/dist/components/arcgis-portal-item-badge/index.js +5 -0
  77. package/dist/components/arcgis-portal-item-badges/customElement.d.ts +48 -0
  78. package/dist/components/arcgis-portal-item-badges/customElement.js +35 -0
  79. package/dist/components/arcgis-portal-item-badges/index.d.ts +1 -0
  80. package/dist/components/arcgis-portal-item-badges/index.js +2 -0
  81. package/dist/components/arcgis-portal-item-badges/types.d.ts +1 -0
  82. package/dist/components/arcgis-portal-item-card/customElement.d.ts +215 -0
  83. package/dist/components/arcgis-portal-item-card/customElement.js +190 -0
  84. package/dist/components/arcgis-portal-item-card/index.d.ts +1 -0
  85. package/dist/components/arcgis-portal-item-card/index.js +10 -0
  86. package/dist/components/arcgis-portal-item-favorite/customElement.d.ts +36 -0
  87. package/dist/components/arcgis-portal-item-favorite/customElement.js +66 -0
  88. package/dist/components/arcgis-portal-item-favorite/index.d.ts +1 -0
  89. package/dist/components/arcgis-portal-item-favorite/index.js +3 -0
  90. package/dist/components/arcgis-portal-item-favorite/utils.d.ts +4 -0
  91. package/dist/components/arcgis-portal-item-type/customElement.js +1 -1
  92. package/dist/components/arcgis-portal-navigation/customElement.js +40 -40
  93. package/dist/components/arcgis-portal-replacement-item-redirect/customElement.js +42 -214
  94. package/dist/components/arcgis-portal-user-popup/customElement.js +66 -100
  95. package/dist/components/portal-group-browser-filters/customElement.js +71 -73
  96. package/dist/docs/api.json +1 -1
  97. package/dist/docs/docs.json +1 -1
  98. package/dist/docs/vscode.html-custom-data.json +1 -1
  99. package/dist/docs/web-types.json +1 -1
  100. package/dist/index.d.ts +38 -0
  101. package/dist/loader.js +9 -4
  102. package/dist/types/item.d.ts +5 -1
  103. package/dist/types/lumina.d.ts +38 -4
  104. package/dist/types/preact.d.ts +43 -4
  105. package/dist/types/react.d.ts +48 -4
  106. package/dist/types/stencil.d.ts +38 -4
  107. package/package.json +6 -6
  108. package/dist/cdn/332KSPIN.js +0 -2
  109. package/dist/cdn/7PPA7V23.js +0 -2
  110. package/dist/cdn/DML7662F.js +0 -2
  111. package/dist/cdn/FF24VDOG.js +0 -65
  112. package/dist/cdn/G2NXASJO.js +0 -2
  113. package/dist/cdn/JZTBGLFH.js +0 -2
  114. package/dist/cdn/PP7GTURX.js +0 -2
  115. package/dist/cdn/QQ432AB6.js +0 -2
  116. package/dist/cdn/RKWOBE3M.js +0 -2
  117. package/dist/cdn/V4IAC7WR.js +0 -2
  118. package/dist/cdn/WEJQVIN4.js +0 -2
  119. package/dist/cdn/ZK2VXTNX.js +0 -2
  120. package/dist/components/portal-browser/components/portal-browser-filter-date/portal-browser-filter-date.d.ts +0 -122
@@ -0,0 +1,40 @@
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
+ import { f as w, r as h } from "./request.js";
3
+ import { a as b } from "./dom.js";
4
+ async function U(s, e, a, r, t) {
5
+ const i = s.portal?.portalHostname || r?.portalHostname || r?.restUrl?.replace("/sharing/rest", ""), l = t ? `https://www.arcgis.com/sharing/rest/portals/${e}` : `https://${i}/sharing/rest/portals/${e}`;
6
+ if (!i && !t)
7
+ return null;
8
+ const c = t ? { disableIdentityLookup: !0, addTokenManually: !1 } : {}, o = await h({ url: l, portal: r, options: c }), { urlKey: g, thumbnail: u, customBaseUrl: $ } = o, p = `https://${g}.${$}/`, y = u ? `${p}sharing/rest/portals/self/resources/${u}` : null;
9
+ let m = "", d = "";
10
+ try {
11
+ const n = await h({
12
+ url: `${l}/resources/localizedOrgProperties`,
13
+ portal: r,
14
+ params: { start: 1, num: 100 },
15
+ options: c
16
+ });
17
+ if (n) {
18
+ const f = n[a] || n.default;
19
+ m = f.name, d = f.description;
20
+ }
21
+ } catch {
22
+ }
23
+ return {
24
+ name: m || o.name,
25
+ description: b(d || o.description),
26
+ url: `${p}home/`,
27
+ thumbnail: y
28
+ };
29
+ }
30
+ async function q(s, e, a, r) {
31
+ const t = s.sourceJSON?.orgId ?? s.portal?.id ?? a?.id;
32
+ return await w({
33
+ requester: async () => await U(s, t, e, a, r),
34
+ key: "verified",
35
+ id: t
36
+ });
37
+ }
38
+ export {
39
+ q as f
40
+ };
@@ -1,11 +1,11 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
2
  import { c as L } from "../../chunks/runtime.js";
3
3
  import { LitElement as _, createEvent as y, nothing as O } from "@arcgis/lumina";
4
- import { html as h, svg as x } from "lit";
5
- import { s as I } from "../../chunks/portal-account-switcher.js";
6
- import { g as C, a as v, l as E, u as T } from "../../chunks/user.js";
4
+ import { html as d, svg as I } from "lit";
5
+ import { s as x } from "../../chunks/portal-account-switcher.js";
6
+ import { g as C, a as v, l as T, u as M } from "../../chunks/user.js";
7
7
  import p from "@arcgis/core/identity/IdentityManager.js";
8
- import { t as M } from "../../chunks/functionalities.js";
8
+ import { t as E } from "../../chunks/functionalities.js";
9
9
  import { u as K } from "../../chunks/useT9n.js";
10
10
  import { m as P } from "../../chunks/icons.js";
11
11
  import { substitute as g } from "@arcgis/core/intl.js";
@@ -15,20 +15,16 @@ function S(i, t = "_blank", e = 582, s = 670) {
15
15
  return l?.focus(), l;
16
16
  }
17
17
  function W(i) {
18
- const e = (i || window.location.origin).split(".")[1].replace("maps", "");
19
- return `https://${e ? `${e}${e === "qa" ? "ext" : ""}.` : ""}arcgis.com/sharing/rest/`;
20
- }
21
- function N(i, t) {
22
- const e = p.findOAuthInfo(i.url), {
18
+ const t = p.findOAuthInfo(i.url), {
23
19
  /* appId = "arcgisonline", */
24
- locale: s = "en",
25
- expiration: n = w
26
- } = e ?? {}, r = new URLSearchParams({
27
- locale: s,
20
+ locale: e = "en",
21
+ expiration: s = w
22
+ } = t ?? {}, n = new URLSearchParams({
23
+ locale: e,
28
24
  client_id: "arcgisonline",
29
25
  //appId!,
30
26
  response_type: "token",
31
- expiration: `${n}`,
27
+ expiration: `${s}`,
32
28
  linkUserRequest: "true",
33
29
  showSocialLogins: "true",
34
30
  hideEnterpriseLogins: "false",
@@ -36,10 +32,10 @@ function N(i, t) {
36
32
  parent: window.location.origin,
37
33
  redirect_uri: `https://${i.portalHostname}/home/link_account_callback.html`,
38
34
  state: JSON.stringify({ useMessage: !0 })
39
- }), o = `${W(t)}oauth2/authorize?${r.toString()}`;
40
- S(o);
35
+ }), r = `https://${i.portalHostname}/sharing/oauth2/authorize?${n.toString()}`;
36
+ S(r);
41
37
  }
42
- function R(i) {
38
+ function N(i) {
43
39
  const {
44
40
  config: t,
45
41
  credential: e,
@@ -61,8 +57,8 @@ function R(i) {
61
57
  }), a = `${t.restBaseUrl}oauth2/signout?${o.toString()}`, c = document.createElement("iframe");
62
58
  c.src = a, c.style.display = "none", document.body.appendChild(c);
63
59
  }
64
- function B(i, t) {
65
- const e = d(i.orgUrlKey, t), s = p.findOAuthInfo(e), {
60
+ function H(i, t) {
61
+ const e = h(i.orgUrlKey, t), s = p.findOAuthInfo(e), {
66
62
  /* appId = "arcgisonline", */
67
63
  locale: n = "en",
68
64
  expiration: r = w
@@ -86,7 +82,7 @@ function B(i, t) {
86
82
  }), c = `${A(i, t)}?${a.toString()}`;
87
83
  S(c);
88
84
  }
89
- function H({
85
+ function B({
90
86
  account: i,
91
87
  credential: t,
92
88
  //client_id,
@@ -111,7 +107,7 @@ function J(i) {
111
107
  return ["apple", "facebook", "github", "google"].includes(i);
112
108
  }
113
109
  function A(i, t) {
114
- const e = d(i.orgUrlKey, t).toLowerCase(), s = $(i.provider);
110
+ const e = h(i.orgUrlKey, t).toLowerCase(), s = $(i.provider);
115
111
  let n = "";
116
112
  switch (s) {
117
113
  case "social":
@@ -126,50 +122,47 @@ function A(i, t) {
126
122
  }
127
123
  return `${e}/sharing/rest/oauth2/${n}authorize`;
128
124
  }
129
- function d(i, t) {
125
+ function h(i, t) {
130
126
  return i?.startsWith("https://") ? i : i && t.customBaseUrl ? `https://${i}.${t.customBaseUrl}` : `https://${t.portalHostname}`;
131
127
  }
132
128
  function b(i, t) {
133
- return `${d(i.orgUrlKey, t)}/home/accountswitcher-callback.html`;
129
+ return `${h(i.orgUrlKey, t)}/home/accountswitcher-callback.html`;
134
130
  }
135
- function D({
131
+ function R({
136
132
  origin: i,
137
133
  redirectToClientUri: t,
138
134
  displaySignoutComplete: e
139
135
  }) {
140
136
  console.log("Signout complete", i, t, e);
141
137
  }
142
- function q(i, t) {
143
- return p.findCredential(d(i.orgUrlKey, t), i.username);
138
+ function D(i, t) {
139
+ return p.findCredential(h(i.orgUrlKey, t), i.username);
144
140
  }
145
141
  function j(i, t) {
146
- const e = q(i, t);
142
+ const e = D(i, t);
147
143
  if (e)
148
144
  return e;
149
- const s = d(i.orgUrlKey, t), n = `${s}/home/check_sign_in_status.html#state=${JSON.stringify({
145
+ const s = h(i.orgUrlKey, t), n = `${s}/home/check_sign_in_status.html#state=${JSON.stringify({
150
146
  origin: window.location.origin,
151
147
  server: s,
152
148
  orgKey: s
153
149
  })}`;
154
- z(n, `iframe__for-${s}`);
150
+ q(n, `iframe__for-${s}`);
155
151
  }
156
- function z(i, t) {
152
+ function q(i, t) {
157
153
  const e = document.createElement("iframe");
158
154
  e.src = i, e.id = t, e.style.display = "none", document.body.appendChild(e);
159
155
  }
160
156
  const k = 100;
161
- class F extends _ {
157
+ class z extends _ {
162
158
  constructor() {
163
- super(), this.messages = K({ blocking: !0 }), this.clientId = "arcgisonline", this.targetUser = "", this.targetToken = "", this.baseUrl = "", this.linkedAccounts = [], this.loading = !1, this.signedInStatus = {}, this.showAssociatedAccountsWarning = !1, this.arcgisAccountSwitch = y(), this.arcgisClose = y(), this.listenOn(window, "message", this.handleMessageEvent);
159
+ super(), this.messages = K({ blocking: !0 }), this.clientId = "arcgisonline", this.targetUser = "", this.targetToken = "", this.linkedAccounts = [], this.loading = !1, this.signedInStatus = {}, this.showAssociatedAccountsWarning = !1, this.arcgisAccountSwitch = y(), this.arcgisClose = y(), this.listenOn(window, "message", this.handleMessageEvent);
164
160
  }
165
161
  static {
166
162
  this.properties = { linkedAccounts: 16, userAccounts: 16, user: 16, credential: 16, alertOptions: 16, loading: 16, signedInStatus: 16, showAssociatedAccountsWarning: 16, portal: 0 };
167
163
  }
168
164
  static {
169
- this.styles = I;
170
- }
171
- connectedCallback() {
172
- super.connectedCallback(), this.baseUrl = d(this.portal?.urlKey ?? "", this.portal);
165
+ this.styles = x;
173
166
  }
174
167
  willUpdate(t) {
175
168
  t.has("portal") && (this.user = this.portal?.user), (t.has("portal") || t.has("user")) && this.portal && this.user && this.findLinkedUsers();
@@ -205,15 +198,15 @@ class F extends _ {
205
198
  handleSignoutMessage(t) {
206
199
  const { error: e, signout: s, accountOrigin: n, redirectToClientUri: r, displaySignoutComplete: o } = t.data;
207
200
  if (e && e !== "unknown") {
208
- console.error(e), reportError(this.messages.errors.signout);
201
+ console.error(e), this.showAlert("danger", this.messages.errors.signout);
209
202
  return;
210
203
  }
211
- s && (this.user = void 0, this.credential = void 0, D({ origin: n, redirectToClientUri: r, displaySignoutComplete: o }));
204
+ s && (this.user = void 0, this.credential = void 0, R({ origin: n, redirectToClientUri: r, displaySignoutComplete: o }));
212
205
  }
213
206
  handleSigninMessage(t) {
214
207
  const { messages: e } = this, { error: s, status: n, state: r, access_token: o, ssl: a } = t.data;
215
208
  if (s) {
216
- console.error(s), reportError(e.errors.signin);
209
+ console.error(s), this.showAlert("danger", e.errors.signin);
217
210
  return;
218
211
  }
219
212
  if (n === "success") {
@@ -231,7 +224,7 @@ class F extends _ {
231
224
  ssl: a === void 0 || a !== "false"
232
225
  };
233
226
  p.registerToken(m);
234
- const f = H({
227
+ const f = B({
235
228
  account: l,
236
229
  credential: m,
237
230
  /* client_id: clientId, */
@@ -249,15 +242,15 @@ class F extends _ {
249
242
  if (e) {
250
243
  if (e.toString().toLowerCase().includes("user denied your request"))
251
244
  return;
252
- reportError(c.errors.accessAccount);
245
+ this.showAlert("danger", c.errors.accessAccount);
253
246
  return;
254
247
  }
255
248
  if (s === o?.username) {
256
- reportError(c.errors.selfLink);
249
+ this.showAlert("danger", c.errors.selfLink);
257
250
  return;
258
251
  }
259
252
  if (a.find((l) => l.username === s)) {
260
- reportError(g(c.errors.alreadyLinked, { username: s }));
253
+ this.showAlert("danger", g(c.errors.alreadyLinked, { username: s }));
261
254
  return;
262
255
  }
263
256
  const u = await C(r, s, n);
@@ -276,7 +269,7 @@ class F extends _ {
276
269
  const { portal: s, linkedAccounts: n, targetUser: r, clientId: o } = this, a = n.find((f) => f.username === r);
277
270
  if (!a)
278
271
  return;
279
- const c = b(a, s), u = d(a.orgUrlKey, s), l = new URLSearchParams({
272
+ const c = b(a, s), u = h(a.orgUrlKey, s), l = new URLSearchParams({
280
273
  // eslint-disable-next-line @typescript-eslint/naming-convention
281
274
  response_type: "token",
282
275
  // eslint-disable-next-line @typescript-eslint/naming-convention
@@ -290,52 +283,45 @@ class F extends _ {
290
283
  }
291
284
  }
292
285
  async findLinkedUsers() {
293
- if (!this.portal || !this.user) {
294
- this.linkedAccounts = [];
286
+ if (this.loading = !0, !this.portal || !this.user) {
287
+ this.linkedAccounts = [], this.loading = !1;
295
288
  return;
296
289
  }
297
- this.loading = !0, this.linkedAccounts = await v(this.portal, this.user), this.linkedAccounts.length && (this.signedInStatus = this.linkedAccounts.filter((t) => t.orgUrlKey !== this.portal.urlKey).reduce((t, e) => (t[e.username] = j(e, this.portal) ?? null, t), {})), this.loading = !1;
290
+ this.linkedAccounts = await v(this.portal, this.user), this.linkedAccounts.length && (this.signedInStatus = this.linkedAccounts.filter((t) => t.orgUrlKey !== this.portal.urlKey).reduce((t, e) => (t[e.username] = j(e, this.portal) ?? null, t), {})), this.loading = !1;
298
291
  }
299
292
  async linkAccount(t, e) {
300
293
  const { portal: s, user: n } = this;
301
294
  if (!s || !n)
302
295
  return;
303
- const r = await E({ portal: s, user: n, targetUser: t, targetToken: e }), { messages: o } = this;
296
+ const r = await T({ portal: s, user: n, targetUser: t, targetToken: e }), { messages: o } = this;
304
297
  if (r.error) {
305
- this.reportError(g(o.errors.linkAccount, { username: t })), this.targetUser = "", this.userAccounts = [];
298
+ this.showAlert("danger", g(o.errors.linkAccount, { username: t })), this.targetUser = "", this.userAccounts = [];
306
299
  return;
307
300
  }
308
301
  const a = this.userAccounts?.length ? o.success.linkAccountMultiple : o.success.linkAccount;
309
- this.reportSuccess(g(a, { username: t })), this.targetUser = "", this.userAccounts = [], await M(350), this.findLinkedUsers();
302
+ this.showAlert("success", g(a, { username: t })), this.targetUser = "", this.userAccounts = [], await E(500), this.findLinkedUsers();
310
303
  }
311
304
  async unlinkAccount(t) {
312
305
  if (!this.portal || !this.user)
313
306
  return;
314
- const { messages: e, portal: s, user: n } = this, { success: r } = await T({ portal: s, user: n, linkedUsername: t.username });
315
- r ? this.reportSuccess(g(e.success.unlinkAccount, { username: t.username })) : this.reportError(g(e.errors.unlinkAccount, { username: t.username })), await this.findLinkedUsers();
307
+ const { messages: e, portal: s, user: n } = this, { success: r } = await M({ portal: s, user: n, linkedUsername: t.username });
308
+ r ? this.showAlert("success", g(e.success.unlinkAccount, { username: t.username })) : this.showAlert("danger", g(e.errors.unlinkAccount, { username: t.username })), await this.findLinkedUsers();
316
309
  }
317
310
  startAccountLink() {
318
- N(this.portal, this.baseUrl);
311
+ W(this.portal);
319
312
  }
320
313
  switchAccount(t) {
321
314
  const { portal: e, user: s, clientId: n } = this;
322
315
  if (!e || !s || !t)
323
316
  return;
324
- const r = d(s.sourceJSON.orgUrlKey ?? "", e), o = p.findCredential(r, s.id || s.username);
325
- o && R({ config: { baseUrl: r, restBaseUrl: `${r}/sharing/rest` }, credential: o, clientId: n }), B(t, e);
326
- }
327
- reportError(t, e, s = !1) {
328
- this.alertOptions = {
329
- kind: s ? "warning" : "danger",
330
- title: e,
331
- message: t
332
- };
317
+ const r = h(s.sourceJSON.orgUrlKey ?? "", e), o = p.findCredential(r, s.id || s.username);
318
+ o && N({ config: { baseUrl: r, restBaseUrl: `${r}/sharing/rest` }, credential: o, clientId: n }), H(t, e);
333
319
  }
334
- reportSuccess(t, e) {
320
+ showAlert(t, e, s) {
335
321
  this.alertOptions = {
336
- kind: "success",
337
- title: e,
338
- message: t
322
+ kind: t,
323
+ title: s,
324
+ message: e
339
325
  };
340
326
  }
341
327
  showUnlinkConfirmation(t) {
@@ -358,22 +344,22 @@ class F extends _ {
358
344
  }
359
345
  render() {
360
346
  const { linkedAccounts: t, user: e, portal: s, messages: n } = this;
361
- return !s || !e ? null : h`<calcite-dialog .heading=${n.switchAccounts} scale=m width=s open modal .loading=${this.loading} outside-close-disabled @calciteDialogClose=${() => {
347
+ return !s || !e ? null : d`<calcite-dialog .heading=${n.switchAccounts} scale=m width=s open modal .loading=${this.loading} outside-close-disabled @calciteDialogClose=${() => {
362
348
  this.arcgisClose.emit();
363
- }}><calcite-block .heading=${n.currentAccount} expanded class="current-account-block"><calcite-list .label=${g(n.currentAccountLabel, { username: e.username })} interaction-mode=static selection-mode=none class="current-account-list"><calcite-list-item><arcgis-portal-user-avatar .user=${e} .portal=${s} show-name .heading=${e.username} .description=${s.name || ""} slot=content-start></arcgis-portal-user-avatar></calcite-list-item></calcite-list></calcite-block>${t.length > 0 ? h`<calcite-block .heading=${n.chooseAccount} expanded class="linked-accounts-block"><calcite-button slot=content-end icon-start=plus class="link-account-button" @click=${() => this.startAccountLink()} .disabled=${t.length >= k}>${n.linkAccount}</calcite-button><arcgis-portal-account-switcher-list .portal=${s} .linkedAccounts=${t} .signedInUsers=${Object.keys(this.signedInStatus).filter((r) => this.signedInStatus[r] !== null)} .label=${n.usersList} interactive @arcgisAccountSwitch=${(r) => {
349
+ }}><calcite-block .heading=${n.currentAccount} expanded class="current-account-block"><calcite-list .label=${g(n.currentAccountLabel, { username: e.username })} interaction-mode=static selection-mode=none class="current-account-list"><calcite-list-item><arcgis-portal-user-avatar .user=${e} .portal=${s} show-name .heading=${e.username} .description=${s.name || ""} slot=content-start></arcgis-portal-user-avatar></calcite-list-item></calcite-list></calcite-block>${t.length > 0 ? d`<calcite-block .heading=${n.chooseAccount} expanded class="linked-accounts-block"><calcite-button slot=content-end icon-start=plus class="link-account-button" @click=${() => this.startAccountLink()} .disabled=${t.length >= k}>${n.linkAccount}</calcite-button><arcgis-portal-account-switcher-list .portal=${s} .linkedAccounts=${t} .signedInUsers=${Object.keys(this.signedInStatus).filter((r) => this.signedInStatus[r] !== null)} .label=${n.usersList} interactive @arcgisAccountSwitch=${(r) => {
364
350
  this.switchAccount(r.detail.account);
365
351
  }} @arcgisAccountUnlink=${(r) => {
366
352
  this.showUnlinkConfirmation(r.detail.account);
367
- }}></arcgis-portal-account-switcher-list></calcite-block>` : h`<calcite-block .heading=${n.chooseAccount} expanded class="empty-accounts-block"><div class="empty-accounts-info"><svg class="empty-accounts-icon" width=48 height=48 viewBox="0 0 48 48" fill=none xmlns=http://www.w3.org/2000/svg>${x`<path d=${P.couple ?? O} fill=currentColor />`}</svg><h4>${n.emptyListTitle}</h4><p>${n.emptyList}</p><calcite-button icon-start=plus class="link-account-button" @click=${() => this.startAccountLink()} .disabled=${t.length >= k}>${n.linkAccount}</calcite-button></div></calcite-block>`}<calcite-notice kind=info .open=${t.length >= k}><div slot=message>${n.maxAccounts}</div></calcite-notice><calcite-alert .label=${n.alertLabel} slot=alerts .autoClose=${this.alertOptions?.kind !== "danger"} auto-close-duration=fast placement=bottom .kind=${this.alertOptions?.kind} .icon=${this.alertOptions?.icon} .open=${!!this.alertOptions} @calciteAlertClose=${() => {
353
+ }}></arcgis-portal-account-switcher-list></calcite-block>` : d`<calcite-block .heading=${n.chooseAccount} expanded class="empty-accounts-block"><div class="empty-accounts-info"><svg class="empty-accounts-icon" width=48 height=48 viewBox="0 0 48 48" fill=none xmlns=http://www.w3.org/2000/svg>${I`<path d=${P.couple ?? O} fill=currentColor />`}</svg><h4>${n.emptyListTitle}</h4><p>${n.emptyList}</p><calcite-button icon-start=plus class="link-account-button" @click=${() => this.startAccountLink()} .disabled=${t.length >= k}>${n.linkAccount}</calcite-button></div></calcite-block>`}<calcite-notice kind=info .open=${t.length >= k}><div slot=message>${n.maxAccounts}</div></calcite-notice><calcite-alert .label=${n.alertLabel} slot=alerts .autoClose=${this.alertOptions?.kind !== "danger"} auto-close-duration=fast placement=bottom .kind=${this.alertOptions?.kind} .icon=${this.alertOptions?.icon} .open=${!!this.alertOptions} @calciteAlertClose=${() => {
368
354
  this.alertOptions = void 0;
369
- }}>${this.alertOptions?.title && h`<h4 slot=title class="alert-title">${this.alertOptions.title}</h4>` || ""}${this.alertOptions?.message && h`<p slot=message class="alert-message">${this.alertOptions.message}</p>` || ""}${this.alertOptions?.actions?.map((r) => h`<calcite-button slot=actions-end .kind=${r.kind} .appearance=${r.appearance} @click=${r.clickHandler}>${r.text}</calcite-button>`)}</calcite-alert></calcite-dialog>${this.showAssociatedAccountsWarning && h`<arcgis-portal-account-switcher-accounts .portal=${s} .targetUser=${this.targetUser} .accounts=${this.userAccounts ?? []} @arcgisLinkAll=${() => {
355
+ }}>${this.alertOptions?.title && d`<h4 slot=title class="alert-title">${this.alertOptions.title}</h4>` || ""}${this.alertOptions?.message && d`<p slot=message class="alert-message">${this.alertOptions.message}</p>` || ""}${this.alertOptions?.actions?.map((r) => d`<calcite-button slot=actions-end .kind=${r.kind} .appearance=${r.appearance} @click=${r.clickHandler}>${r.text}</calcite-button>`)}</calcite-alert></calcite-dialog>${this.showAssociatedAccountsWarning && d`<arcgis-portal-account-switcher-accounts .portal=${s} .targetUser=${this.targetUser} .accounts=${this.userAccounts ?? []} @arcgisLinkAll=${() => {
370
356
  this.linkAccount(this.targetUser, this.targetToken);
371
357
  }} @arcgisCloseDialog=${() => {
372
358
  this.showAssociatedAccountsWarning = !1;
373
359
  }}></arcgis-portal-account-switcher-accounts>` || ""}`;
374
360
  }
375
361
  }
376
- L("arcgis-portal-account-switcher", F);
362
+ L("arcgis-portal-account-switcher", z);
377
363
  export {
378
- F as ArcgisPortalAccountSwitcher
364
+ z as ArcgisPortalAccountSwitcher
379
365
  };
@@ -1,9 +1,9 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
2
  import { c as h } from "../../chunks/runtime.js";
3
- import { repeat as v } from "lit/directives/repeat.js";
3
+ import { repeat as m } from "lit/directives/repeat.js";
4
4
  import { html as s } from "lit";
5
- import { LitElement as g, createEvent as n } from "@arcgis/lumina";
6
- import { s as m } from "../../chunks/portal-account-switcher.js";
5
+ import { LitElement as v, createEvent as n } from "@arcgis/lumina";
6
+ import { s as g } from "../../chunks/portal-account-switcher.js";
7
7
  import { u } from "../../chunks/useT9n.js";
8
8
  import { substitute as d } from "@arcgis/core/intl.js";
9
9
  function f({ provider: i }) {
@@ -19,7 +19,7 @@ function f({ provider: i }) {
19
19
  return s`<div .innerHTML=${t ?? ""}></div>`;
20
20
  }
21
21
  const w = ["apple", "facebook", "github", "google"];
22
- class $ extends g {
22
+ class $ extends v {
23
23
  constructor() {
24
24
  super(...arguments), this.messages = u({ blocking: !0, name: "portal-account-switcher" }), this.tipReference = null, this.tooltipText = "", this.linkedAccounts = [], this.interactive = !1, this.signedInUsers = [], this.label = "", this.arcgisAccountSwitch = n(), this.arcgisAccountUnlink = n();
25
25
  }
@@ -27,11 +27,11 @@ class $ extends g {
27
27
  this.properties = { tipReference: 16, tooltipText: 16, portal: 0, linkedAccounts: 0, interactive: 5, signedInUsers: 0, label: 1 };
28
28
  }
29
29
  static {
30
- this.styles = m;
30
+ this.styles = g;
31
31
  }
32
32
  render() {
33
33
  const { linkedAccounts: l, messages: t, signedInUsers: a, label: o, interactive: c, portal: p } = this;
34
- return s`<calcite-list .label=${o} selection-mode=none class="linked-accounts-list" .interactionMode=${c ? "interactive" : "static"}>${v(l, (e) => e.id, (e) => s`<calcite-list-item .label=${e.username} .description=${e.orgName} .value=${e.username} @click=${() => {
34
+ return s`<calcite-list .label=${o} selection-mode=none class="linked-accounts-list" .interactionMode=${c ? "interactive" : "static"}>${m(l, (e) => e.username, (e) => s`<calcite-list-item .label=${e.username} .description=${e.orgName} .value=${e.username} @click=${() => {
35
35
  c && this.arcgisAccountSwitch.emit({ account: e });
36
36
  }}><arcgis-portal-user-avatar .user=${e} .portal=${p} slot=content-start></arcgis-portal-user-avatar>${w.includes(e.provider) && s`<div slot=content-start class="social-icon-chip">${f({ provider: e.provider })}</div>` || ""}${a.includes(e.username) && s`<calcite-chip appearance=outline scale=s .label=${d(t.linkedAccountSignedIn, {
37
37
  username: e.username,
@@ -14,12 +14,8 @@ export abstract class ArcgisPortalAiAssistant extends LitElement {
14
14
  accessor config: Config;
15
15
  /** @default false */
16
16
  accessor defaultClosed: boolean;
17
- /**
18
- * Enables Portal navigation suggestions from the assistant.
19
- *
20
- * @default true
21
- */
22
- accessor navigationAgentEnabled: boolean;
17
+ /** Optional per-agent disabled map. Any missing key defaults to enabled. */
18
+ accessor disabledAgents: PortalAiAssistantDisabledAgents | undefined;
23
19
  accessor navigationCapabilities: CapabilityRegistry | undefined;
24
20
  /** Optional map of navigation target overrides for generating navigation hrefs from portal navigation suggestions. */
25
21
  accessor navigationTargetMap: PartialPortalNavigationTargetMap | undefined;
@@ -172,4 +168,10 @@ export abstract class ArcgisPortalAiAssistant extends LitElement {
172
168
  readonly "@eventTypes": {
173
169
  arcgisPortalNavigationRequest: ArcgisPortalAiAssistant["arcgisPortalNavigationRequest"]["detail"];
174
170
  };
175
- }
171
+ }
172
+
173
+ /** @internal */
174
+ export type PortalAiAssistantDisabledAgents = Partial<Record<PortalAiAssistantAgentKey, boolean>>;
175
+
176
+ /** @internal */
177
+ export type PortalAiAssistantAgentKey = "docAssistant" | "groupAnalytics" | "groupCreation" | "itemAnalytics" | "navigation";