@arcgis/portal-components 5.2.0-next.57 → 5.2.0-next.59

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 (167) hide show
  1. package/dist/cdn/2H7Y7RJV.js +2 -0
  2. package/dist/cdn/32FQ7WJE.js +2 -0
  3. package/dist/cdn/3Q3EP3BN.js +2 -0
  4. package/dist/cdn/3VDVNPZ7.js +2 -0
  5. package/dist/cdn/3WH3ENZP.js +2 -0
  6. package/dist/cdn/4QA4AYHJ.js +3 -0
  7. package/dist/cdn/{LDCSQHZX.js → 55FL7WQV.js} +1 -1
  8. package/dist/cdn/5CT433EX.js +2 -0
  9. package/dist/cdn/6ROVXNLV.js +2 -0
  10. package/dist/cdn/7JQ6D224.js +2 -0
  11. package/dist/cdn/B36VBHAI.js +2 -0
  12. package/dist/cdn/CFBSBZSS.js +2 -0
  13. package/dist/cdn/CYEC77HO.js +2 -0
  14. package/dist/cdn/E6STCC7O.js +2 -0
  15. package/dist/cdn/EYTAC4Z4.js +2 -0
  16. package/dist/cdn/{NWIIOJEG.js → FGJNEKPQ.js} +1 -1
  17. package/dist/cdn/{TUQSWB7B.js → FPYIRCJO.js} +1 -1
  18. package/dist/cdn/{C4UBEDKI.js → G2NXASJO.js} +1 -1
  19. package/dist/cdn/{DNMB343K.js → GLDJPWRZ.js} +1 -1
  20. package/dist/cdn/HHA5STNZ.js +2 -0
  21. package/dist/cdn/HV3BRK66.js +2 -0
  22. package/dist/cdn/I5GDSNYE.js +2 -0
  23. package/dist/cdn/IRK4UW2F.js +2 -0
  24. package/dist/cdn/IVATGXII.js +2 -0
  25. package/dist/cdn/IXATTQKO.js +2 -0
  26. package/dist/cdn/JCIDQZ6X.js +2 -0
  27. package/dist/cdn/{R3VY2KZV.js → LDRIWXTO.js} +1 -1
  28. package/dist/cdn/{3PWVEX4V.js → ODJRHB2N.js} +1 -1
  29. package/dist/cdn/{EJZ55DVU.js → OK75ZZ2M.js} +1 -1
  30. package/dist/cdn/{DHMH2XFA.js → OTC37DGK.js} +1 -1
  31. package/dist/cdn/OYX64HG5.js +2 -0
  32. package/dist/cdn/QS3GXAIH.js +2 -0
  33. package/dist/cdn/RKT7WCDH.js +2 -0
  34. package/dist/cdn/RL7X3ACG.js +2 -0
  35. package/dist/cdn/RZPKVJMB.js +2 -0
  36. package/dist/cdn/S2JZ5KTI.js +2 -0
  37. package/dist/cdn/SJGVHRK2.js +2 -0
  38. package/dist/cdn/SUBBPVRW.js +2 -0
  39. package/dist/cdn/T7GD53BL.js +2 -0
  40. package/dist/cdn/{2VLAJOZX.js → TFFZ425X.js} +1 -1
  41. package/dist/cdn/UDTQ7U6L.js +2 -0
  42. package/dist/cdn/UPSYDUD6.js +2 -0
  43. package/dist/cdn/UUSJCAH5.js +2 -0
  44. package/dist/cdn/UXLENIDB.js +2 -0
  45. package/dist/cdn/UZCHLKLO.js +2 -0
  46. package/dist/cdn/VMQIDO4Z.js +2 -0
  47. package/dist/cdn/WBNJYBQD.js +2 -0
  48. package/dist/cdn/XSUXR4WJ.js +2 -0
  49. package/dist/cdn/Z2ZW4FY2.js +2 -0
  50. package/dist/cdn/ZP6MVFXR.js +2 -0
  51. package/dist/cdn/{U2QZZSPC.js → ZV4GLQQG.js} +1 -1
  52. package/dist/cdn/assets/portal-group-browser/t9n/messages.en.json +1 -0
  53. package/dist/cdn/assets/portal-group-card/t9n/messages.en.json +1 -1
  54. package/dist/cdn/index.js +1 -1
  55. package/dist/cdn/main.css +1 -1
  56. package/dist/chunks/fieldAddDelete.js +1 -1
  57. package/dist/chunks/groups.js +61 -7
  58. package/dist/chunks/groups2.js +8 -61
  59. package/dist/chunks/item.js +123 -29
  60. package/dist/chunks/item2.js +29 -123
  61. package/dist/chunks/loadClassificationData.js +1 -1
  62. package/dist/chunks/portal-browser.js +223 -0
  63. package/dist/chunks/portal.js +48 -40
  64. package/dist/chunks/portal2.js +50 -24
  65. package/dist/chunks/query.js +159 -0
  66. package/dist/chunks/request.js +87 -0
  67. package/dist/chunks/requests.js +4 -4
  68. package/dist/chunks/store.js +1 -5
  69. package/dist/chunks/string.js +19 -14
  70. package/dist/chunks/thumbnail.js +189 -0
  71. package/dist/chunks/ui.js +2 -3
  72. package/dist/chunks/url.js +17 -0
  73. package/dist/chunks/user.js +96 -13
  74. package/dist/chunks/user2.js +13 -178
  75. package/dist/chunks/utils.js +1 -1
  76. package/dist/components/arcgis-portal-account-switcher/customElement.js +1 -1
  77. package/dist/components/arcgis-portal-ai-assistant/customElement.js +3 -3
  78. package/dist/components/arcgis-portal-browser/customElement.d.ts +15 -7
  79. package/dist/components/arcgis-portal-browser/customElement.js +14 -196
  80. package/dist/components/arcgis-portal-browser/utils/store.d.ts +4 -4
  81. package/dist/components/arcgis-portal-browser/utils/types.d.ts +6 -0
  82. package/dist/components/arcgis-portal-browser-actions/customElement.d.ts +2 -4
  83. package/dist/components/arcgis-portal-browser-actions/customElement.js +12 -9
  84. package/dist/components/arcgis-portal-browser-filter/customElement.js +5 -5
  85. package/dist/components/arcgis-portal-browser-filter-date/customElement.d.ts +5 -5
  86. package/dist/components/arcgis-portal-browser-filter-date/customElement.js +13 -12
  87. package/dist/components/arcgis-portal-browser-filter-status/customElement.js +1 -1
  88. package/dist/components/arcgis-portal-browser-pagination/customElement.js +25 -27
  89. package/dist/components/arcgis-portal-browser-search/customElement.js +1 -4
  90. package/dist/components/arcgis-portal-browser-top-bar/customElement.d.ts +6 -0
  91. package/dist/components/arcgis-portal-browser-top-bar/customElement.js +15 -16
  92. package/dist/components/arcgis-portal-classification-config/customElement.js +1 -1
  93. package/dist/components/arcgis-portal-classification-favorite/customElement.js +1 -1
  94. package/dist/components/arcgis-portal-group-badges/customElement.d.ts +0 -1
  95. package/dist/components/arcgis-portal-group-badges/customElement.js +21 -20
  96. package/dist/components/arcgis-portal-group-browser/customElement.d.ts +301 -0
  97. package/dist/components/arcgis-portal-group-browser/customElement.js +494 -0
  98. package/dist/components/arcgis-portal-group-browser/index.d.ts +1 -0
  99. package/dist/components/arcgis-portal-group-browser/index.js +6 -0
  100. package/dist/components/arcgis-portal-group-browser/types.d.ts +193 -0
  101. package/dist/components/arcgis-portal-group-browser-preview/customElement.d.ts +225 -0
  102. package/dist/components/arcgis-portal-group-browser-preview/customElement.js +150 -0
  103. package/dist/components/arcgis-portal-group-browser-preview/index.d.ts +1 -0
  104. package/dist/components/arcgis-portal-group-browser-preview/index.js +12 -0
  105. package/dist/components/arcgis-portal-group-browser-preview-card/customElement.d.ts +82 -0
  106. package/dist/components/arcgis-portal-group-browser-preview-card/customElement.js +92 -0
  107. package/dist/components/arcgis-portal-group-browser-preview-card/index.d.ts +1 -0
  108. package/dist/components/arcgis-portal-group-browser-preview-card/index.js +6 -0
  109. package/dist/components/arcgis-portal-group-card/customElement.d.ts +3 -1
  110. package/dist/components/arcgis-portal-group-card/customElement.js +71 -91
  111. package/dist/components/arcgis-portal-group-card/index.js +3 -3
  112. package/dist/components/arcgis-portal-mentionable-text-area/customElement.js +40 -39
  113. package/dist/components/arcgis-portal-navigation/customElement.js +418 -411
  114. package/dist/components/arcgis-portal-navigation/index.js +1 -1
  115. package/dist/components/arcgis-portal-replacement-item-redirect/customElement.js +68 -249
  116. package/dist/components/arcgis-portal-user-avatar/customElement.js +2 -2
  117. package/dist/components/arcgis-portal-user-popup/customElement.d.ts +5 -2
  118. package/dist/components/arcgis-portal-user-popup/customElement.js +4 -3
  119. package/dist/components/portal-group-browser-filters/customElement.js +104 -0
  120. package/dist/components/portal-group-browser-filters/index.js +8 -0
  121. package/dist/components/portal-group-browser-pagination/customElement.js +13 -0
  122. package/dist/components/portal-group-browser-pagination/index.js +2 -0
  123. package/dist/components/portal-group-browser-sort/customElement.js +16 -0
  124. package/dist/components/portal-group-browser-sort/index.js +2 -0
  125. package/dist/docs/api.json +1 -1
  126. package/dist/docs/docs.json +1 -1
  127. package/dist/docs/vscode.html-custom-data.json +1 -1
  128. package/dist/docs/web-types.json +1 -1
  129. package/dist/index.d.ts +36 -0
  130. package/dist/loader.js +5 -2
  131. package/dist/types/group.d.ts +6 -8
  132. package/dist/types/item.d.ts +1 -1
  133. package/dist/types/lumina.d.ts +32 -0
  134. package/dist/types/preact.d.ts +35 -0
  135. package/dist/types/react.d.ts +38 -0
  136. package/dist/types/search.d.ts +2 -2
  137. package/dist/types/stencil.d.ts +32 -0
  138. package/dist/types/user.d.ts +2 -2
  139. package/package.json +4 -4
  140. package/dist/cdn/2EJG4DOC.js +0 -2
  141. package/dist/cdn/2JCFEF3J.js +0 -2
  142. package/dist/cdn/2WEWH5G3.js +0 -2
  143. package/dist/cdn/6AGZRMJC.js +0 -2
  144. package/dist/cdn/6D3PU4ZT.js +0 -2
  145. package/dist/cdn/7QXIBQV7.js +0 -2
  146. package/dist/cdn/BJTJP57C.js +0 -2
  147. package/dist/cdn/BZRM2V6V.js +0 -2
  148. package/dist/cdn/C2DREZD4.js +0 -2
  149. package/dist/cdn/CSH3WCYD.js +0 -2
  150. package/dist/cdn/GKBK32VH.js +0 -2
  151. package/dist/cdn/GYFQDPCN.js +0 -2
  152. package/dist/cdn/J46I5HEQ.js +0 -2
  153. package/dist/cdn/JJ7P5JJ3.js +0 -2
  154. package/dist/cdn/JZ2ZI5WO.js +0 -2
  155. package/dist/cdn/LTQA5JRV.js +0 -2
  156. package/dist/cdn/M5MGOBU3.js +0 -2
  157. package/dist/cdn/M6X5KCWL.js +0 -2
  158. package/dist/cdn/OBVMQ64S.js +0 -2
  159. package/dist/cdn/OGC5YU6V.js +0 -2
  160. package/dist/cdn/OUN473QW.js +0 -2
  161. package/dist/cdn/QPFPNUHH.js +0 -2
  162. package/dist/cdn/R6SSAPLB.js +0 -3
  163. package/dist/cdn/SJDQS32I.js +0 -2
  164. package/dist/cdn/UQWELJR5.js +0 -2
  165. package/dist/cdn/Y4YNN6DS.js +0 -2
  166. package/dist/cdn/Y5CRBUVL.js +0 -2
  167. /package/dist/cdn/{AWIVXH7M.js → 5KDFY5KE.js} +0 -0
@@ -0,0 +1,87 @@
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
+ import P from "@arcgis/core/identity/IdentityManager.js";
3
+ import w from "@arcgis/core/request.js";
4
+ import { i as E, a as R, g } from "./portal.js";
5
+ const c = {}, u = {}, f = {};
6
+ async function A({ requester: t, key: e, id: n, cacheOption: i }) {
7
+ const s = f[e]?.[n]?.expireAt, a = !!s && (/* @__PURE__ */ new Date()).getTime() > s;
8
+ if (c[e]?.[n] && !a)
9
+ return c[e][n];
10
+ u[e] || (u[e] = {}), (!u[e][n] || a) && (u[e][n] = t());
11
+ const o = await u[e][n];
12
+ if (c[e] || (c[e] = {}), f[e] || (f[e] = {}), c[e][n] = o, i) {
13
+ const { expireAfter: d, getExpireAfterFromResult: r } = i, p = r || d ? (/* @__PURE__ */ new Date()).getTime() + (r?.(o) ?? d ?? 0) : null;
14
+ f[e][n] = { ...f[e][n], expireAt: p };
15
+ }
16
+ return o;
17
+ }
18
+ async function X({
19
+ url: t,
20
+ portal: e,
21
+ params: n = {},
22
+ options: i = {},
23
+ method: s,
24
+ abortControllerId: a,
25
+ excludeJson: o
26
+ }) {
27
+ const d = b(a)?.signal, { customToken: r, addTokenManually: p, addSSL: x, useProxy: S } = i, m = { ...n };
28
+ if (!t.includes("f=") && !o && (m.f = "json"), r)
29
+ m.token = r;
30
+ else if (p !== !1) {
31
+ const h = await M(e);
32
+ h && (m.token = h);
33
+ }
34
+ const T = x ? U(t, e) : t, q = {
35
+ query: m,
36
+ method: s || "auto",
37
+ ...i,
38
+ timeout: i.timeout || 0,
39
+ useProxy: S,
40
+ ...i?.disableIdentityLookup ? { authMode: "anonymous" } : {}
41
+ }, C = await w(T, { signal: d, ...q });
42
+ return a && (l[a] = void 0), C.data;
43
+ }
44
+ const l = {};
45
+ function b(t) {
46
+ if (t)
47
+ return l[t] && l[t].abort(), l[t] = new AbortController(), l[t];
48
+ }
49
+ async function M(t) {
50
+ const e = E(t);
51
+ if (!t?.isPortal || !e)
52
+ return R(t);
53
+ const n = t?.user;
54
+ if (!n && e)
55
+ return;
56
+ const { token: i } = await A({
57
+ requester: async () => await L(t),
58
+ key: "platformSelf",
59
+ id: n?.id ?? t.id ?? "<unknown>",
60
+ cacheOption: { getExpireAfterFromResult: (s) => s.expires_in }
61
+ });
62
+ return i;
63
+ }
64
+ const L = async (t) => {
65
+ const n = {
66
+ "X-Esri-Auth-Client-Id": await v(t),
67
+ "X-Esri-Auth-Redirect-Uri": window.location.href.replace(/#.*$/u, "")
68
+ };
69
+ return (await w(`${g(t)}/oauth2/platformSelf`, {
70
+ authMode: "no-prompt",
71
+ headers: n,
72
+ withCredentials: !0,
73
+ method: "post"
74
+ })).data;
75
+ }, v = async (t) => (await A({
76
+ requester: async () => await P.getCredential(g(t), { oAuthPopupConfirmation: !1 }),
77
+ key: "credential",
78
+ id: t.user?.id ?? "<unknown>"
79
+ })).oAuthState?.appId ?? "arcgisonline";
80
+ function U(t, e) {
81
+ return window.location.protocol === "https:" || e.allSSL ? t.replace("http:", "https:") : t;
82
+ }
83
+ export {
84
+ A as f,
85
+ M as g,
86
+ X as r
87
+ };
@@ -107,11 +107,11 @@ async function U(r, s, t = "results", c = !1) {
107
107
  }), e;
108
108
  }
109
109
  export {
110
- x as a,
111
- g as b,
112
- C as c,
110
+ h as a,
111
+ x as b,
112
+ g as c,
113
113
  U as f,
114
- h as r,
114
+ C as r,
115
115
  $ as u,
116
116
  j as v
117
117
  };
@@ -1,11 +1,7 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
2
  import { watch as o } from "@arcgis/core/core/reactiveUtils.js";
3
3
  import { createStore as s } from "@arcgis/lumina/controllers/accessor";
4
- const a = ["folder", "group", "contentType"], c = (e) => e.type === "item-browser", m = (e = {}) => s({
5
- filters: {},
6
- hiddenFilters: [],
7
- ...e
8
- });
4
+ const a = ["folder", "group", "contentType"], c = (e) => e.type === "item-browser", m = (e = { filters: {}, hiddenFilters: [] }) => s(e);
9
5
  function l(e, r) {
10
6
  const t = o(() => e.preview, r);
11
7
  return () => t.remove();
@@ -1,31 +1,36 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
2
  import { s as a } from "./dom.js";
3
- function s(e) {
3
+ function c(e) {
4
4
  const r = /(https?:\/\/[^\s]+)/gu;
5
- return e?.replace(r, (n) => `<a href="${n}" target="_blank">${n}</a>`);
5
+ return e?.replace(r, (t) => `<a href="${t}" target="_blank">${t}</a>`);
6
6
  }
7
- function i(e) {
7
+ function s(e) {
8
8
  return e?.replace(/(?:\r)/gu, "&#10;").replace(/(?:\n)/gu, "&#13;");
9
9
  }
10
- function c(e) {
10
+ function i(e) {
11
11
  return e?.replace(/(?:&#10;)/gu, "\r").replace(/(?:&#13;)/gu, `
12
12
  `);
13
13
  }
14
- function u(e) {
14
+ function o(e) {
15
15
  return e?.replace(/&#10;&#13;|&#10;|&#13;|\r\n|\r|\n/gu, "<br>");
16
16
  }
17
- function p(e) {
18
- return u(i(s(c(e))));
17
+ function p(e, r) {
18
+ const t = document.documentElement.dir === "rtl";
19
+ return e.replace("${start}", t ? r.end : r.start).replace("${end}", t ? r.start : r.end).replace("${total}", r.total);
20
+ }
21
+ function d(e = "") {
22
+ const r = a(e);
23
+ return ["id:", "title:", "type:", "typekeywords:", "owner:"].some((n) => e.includes(n)) ? r.replace(/[<>\/\\?]/gu, "\\$&").trim() : r.replace(/[\[\]\{\}\(\)\-+:<>\/\\?]/gu, "\\$&").trim();
19
24
  }
20
25
  function g(e) {
21
- return e?.endsWith("/") ? e.slice(0, e.length - 1) : e;
26
+ return o(s(c(i(e))));
22
27
  }
23
- function m(e = "") {
24
- const r = a(e);
25
- return ["id:", "title:", "type:", "typekeywords:", "owner:"].some((t) => e.includes(t)) ? r.replace(/[<>\/\\?]/gu, "\\$&").trim() : r.replace(/[\[\]\{\}\(\)\-+:<>\/\\?]/gu, "\\$&").trim();
28
+ function m(e) {
29
+ return e?.endsWith("/") ? e.slice(0, e.length - 1) : e;
26
30
  }
27
31
  export {
28
- m as c,
29
- p as g,
30
- g as r
32
+ m as a,
33
+ d as c,
34
+ g,
35
+ p as r
31
36
  };
@@ -0,0 +1,189 @@
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
+ import { g as u } from "./runtime.js";
3
+ function p(e) {
4
+ const a = l(e);
5
+ return u(`assets/portal-item-thumbnail/${a}`);
6
+ }
7
+ function l(e) {
8
+ const a = e.type?.toLowerCase(), r = e.typeKeywords || [];
9
+ switch (a) {
10
+ case "web mapping application":
11
+ return "webapp.avif";
12
+ case "mobile application":
13
+ return "mobileapp.avif";
14
+ case "notebook code snippets":
15
+ case "notebook code snippet library":
16
+ return "notebookcodesnippets.avif";
17
+ case "notebook":
18
+ return "notebook.avif";
19
+ case "style":
20
+ return r.includes("Dictionary") ? "dictionarystyle.avif" : "style.avif";
21
+ case "feature service":
22
+ return r.includes("Location Tracking View") ? "locationtrackingservice.avif" : r.includes("IndoorPositioningDataService") ? "indoor-positioning-data-service.avif" : "default.avif";
23
+ case "pro presentation":
24
+ return "pro-presentation.avif";
25
+ case "reality mapping project":
26
+ return "realitymappingproject.avif";
27
+ case "raster function template":
28
+ return "rasterfunctiontemplate.avif";
29
+ case "workforce project":
30
+ return "workforceproject.avif";
31
+ case "hub initiative":
32
+ return "hubinitiative.avif";
33
+ case "hub page":
34
+ return "hubpage.avif";
35
+ case "hub site application":
36
+ case "site application":
37
+ return "hubsite.avif";
38
+ case "hub event":
39
+ return "hubevent.avif";
40
+ case "hub project":
41
+ return "hubproject.avif";
42
+ case "dashboard":
43
+ return r.includes("ArcGIS Dashboards") ? "dashboards.avif" : "opsdashboard.avif";
44
+ case "geoprocessing service":
45
+ return r.includes("Notebook Web Tool") ? "notebookwebtool.avif" : "webtool.avif";
46
+ case "web scene":
47
+ case "scene service":
48
+ return "scene.avif";
49
+ case "ortho mapping project":
50
+ return "orthomappingproject.avif";
51
+ case "ortho mapping template":
52
+ return "orthomappingtemplate.avif";
53
+ case "insights theme":
54
+ return "insightstheme.avif";
55
+ case "insights workbook package":
56
+ return "insightsworkbookpackage.avif";
57
+ case "solution":
58
+ return "solution.avif";
59
+ case "mobile scene package":
60
+ return "mobilescenepackage.avif";
61
+ case "deep learning package":
62
+ return "deeplearningpackage.avif";
63
+ case "big data analytic":
64
+ return "bigdataanalytic.avif";
65
+ case "real time analytic":
66
+ return "realtimeanalytic.avif";
67
+ case "feed":
68
+ return "feed.avif";
69
+ case "excalibur imagery project":
70
+ return "excaliburimageryproject.avif";
71
+ case "storymap":
72
+ return r?.includes("storymapcollection") ? "storymapcollection.avif" : "storymap.avif";
73
+ case "survey123 add in":
74
+ return "survey123addin.avif";
75
+ case "mission":
76
+ return "mission.avif";
77
+ case "mission template":
78
+ return "missiontemplate.avif";
79
+ case "quickcapture project":
80
+ return "quickcaptureproject.avif";
81
+ case "pro report":
82
+ return "proreport.avif";
83
+ case "pro package":
84
+ return "propackage.avif";
85
+ case "pro report template":
86
+ return "proreporttemplate.avif";
87
+ case "urban model":
88
+ return "urbanmodel.avif";
89
+ case "urban project":
90
+ return "urbanproject.avif";
91
+ case "web experience":
92
+ return "webexperience.avif";
93
+ case "web experience template":
94
+ return "webexperiencetemplate.avif";
95
+ case "experience builder widget":
96
+ return "experiencebuilderwidget.avif";
97
+ case "experience builder widget package":
98
+ return "experiencebuilderwidgetpackage.avif";
99
+ case "workflow":
100
+ return "workflow.avif";
101
+ case "insights script":
102
+ return "insightsscript.avif";
103
+ case "kernel gateway connection":
104
+ return "kernelgatewayconnection.avif";
105
+ case "hub initiative template":
106
+ return "hubinitiativetemplate.avif";
107
+ case "image service":
108
+ return r?.includes("Tile Imagery") ? "tiledimagerylayer.avif" : "imagerylayer.avif";
109
+ case "mission report":
110
+ return "missionreport.avif";
111
+ case "administrative report":
112
+ return "administrativereport.avif";
113
+ case "storymap theme":
114
+ return "storymaptheme.avif";
115
+ case "knowledge graph":
116
+ return "knowledgegraph.avif";
117
+ case "knowledge graph layer":
118
+ return "knowledgegraphlayer.avif";
119
+ case "knowledge studio project":
120
+ return "knowledgestudio.avif";
121
+ case "earth configuration":
122
+ return "earthconfiguration.avif";
123
+ case "link chart":
124
+ return "linkchart.avif";
125
+ case "investigation":
126
+ return "investigation.avif";
127
+ case "apache parquet":
128
+ return "apacheparquet.avif";
129
+ case "curated collection":
130
+ return "curatedcollection.avif";
131
+ case "video service":
132
+ return "mediaservice.avif";
133
+ case "geodata service":
134
+ return "geodataservice.avif";
135
+ case "suitability model":
136
+ return "suitabilitymodel.avif";
137
+ case "esri classifier definition":
138
+ return "classifierdefinition.avif";
139
+ case "esri spectral library":
140
+ return "spectrallibrary.avif";
141
+ case "deep learning studio project":
142
+ return "deeplearningstudioproject.avif";
143
+ case "esri classification schema":
144
+ return "classificationschema.avif";
145
+ case "insights data engineering workbook":
146
+ return "dataengineeringworkbook.avif";
147
+ case "insights data engineering model":
148
+ return "dataengineeringmodel.avif";
149
+ case "discussion":
150
+ return "discussion.avif";
151
+ case "api key":
152
+ return "apikey.avif";
153
+ case "data pipeline":
154
+ return "datapipeline.avif";
155
+ case "analysis model":
156
+ return "analysismodel.avif";
157
+ case "service connection":
158
+ return "serviceconnection.avif";
159
+ case "xr experience":
160
+ return "xrexperience.avif";
161
+ case "3dtiles service":
162
+ return r?.includes("GaussianSplat") ? "gaussiansplatlayer.avif" : "default.avif";
163
+ default:
164
+ return "default.avif";
165
+ }
166
+ }
167
+ function d(e, a, r) {
168
+ const { restUrl: t } = e, i = f(e), n = i ? `token=${i}` : "", s = `${t}/content/items/${a.id}`;
169
+ if (a.thumbnail) {
170
+ const c = a.thumbnailUrl;
171
+ if (c) {
172
+ const o = new URL(c);
173
+ return o.searchParams.append("w", "400"), o.href;
174
+ }
175
+ return `${s}/info/${a.thumbnail}?w=400${i ? "&" : ""}${n}`;
176
+ } else if (a.type === "Image")
177
+ return `${s}/data?${n}`;
178
+ return p(a);
179
+ }
180
+ function f(e) {
181
+ return (
182
+ // @ts-ignore
183
+ e?.credential?.token || e?.token || e?.user?.credential?.token || e?.portalUser?.token || ""
184
+ );
185
+ }
186
+ export {
187
+ p as a,
188
+ d as g
189
+ };
package/dist/chunks/ui.js CHANGED
@@ -1,9 +1,8 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
2
  const s = {
3
- xxs: 320,
4
- xs: 480,
5
3
  sm: 640,
6
- md: 768
4
+ md: 768,
5
+ lg: 1024
7
6
  };
8
7
  export {
9
8
  s as b
@@ -0,0 +1,17 @@
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
+ const l = (o) => o && !o.endsWith("/") ? `${o}/` : o;
3
+ function c({
4
+ portal: o,
5
+ usePortalHostname: s
6
+ }) {
7
+ const { customBaseUrl: n, portalHostname: e, urlKey: t } = o, { protocol: a } = window.location, r = !s && t ? `${t}.${n}` : e;
8
+ return `${a}//${r}`;
9
+ }
10
+ function i({ portal: o }) {
11
+ return `${c({ portal: o, usePortalHostname: !o.user })}/home`;
12
+ }
13
+ export {
14
+ l as a,
15
+ i as b,
16
+ c as g
17
+ };
@@ -1,20 +1,103 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- function s(e, u) {
3
- const { fullName: n, firstName: r, lastName: t, username: a } = e;
4
- return n || (r && t ? u === "ja" ? `${t} ${r}` : `${r} ${t}` : a);
2
+ import { f, r as a } from "./request.js";
3
+ import { g as u, a as y } from "./portal.js";
4
+ import { f as c, r as l, a as d } from "./requests.js";
5
+ async function U(s, r, e) {
6
+ const t = `${e ? "https://www.arcgis.com/sharing/rest/" : u(r)}community/users/${s}`, o = t?.includes("www.arcgis.com") && r.isPortal, m = t?.includes(".arcgis.com") && !r.isPortal && !r.user, p = o || m ? { disableIdentityLookup: !0, addTokenManually: !1 } : {};
7
+ return await f({
8
+ requester: async () => {
9
+ try {
10
+ return await a({ url: t, portal: r, options: p });
11
+ } catch {
12
+ return { username: s };
13
+ }
14
+ },
15
+ key: "user",
16
+ id: t
17
+ });
5
18
  }
6
- function c(e) {
7
- return e && !e.id;
19
+ const $ = async (s) => {
20
+ const r = `${u(s)}/portals/${s.id}/users`;
21
+ return await a({
22
+ url: r,
23
+ portal: s,
24
+ params: {
25
+ // TODO: Add pagination
26
+ num: 100,
27
+ sortField: "lastlogin",
28
+ sortOrder: "desc"
29
+ }
30
+ });
31
+ };
32
+ function i(s, r) {
33
+ return `${s.restUrl}/community/users/${r?.id || s?.user?.id}`;
34
+ }
35
+ async function A(s, r) {
36
+ const e = `${i(s, r)}/properties`;
37
+ return await d(e);
38
+ }
39
+ async function P(s, r, e) {
40
+ const n = `${i(r, e)}/setProperties`, t = y(r), o = new FormData();
41
+ return o.append("properties", JSON.stringify(s)), o.append("token", t), o.append("f", "json"), await d(n, {
42
+ method: "post",
43
+ body: o
44
+ });
45
+ }
46
+ async function q(s, r) {
47
+ const e = `${i(s, r)}/provisionedListings`;
48
+ return await c(
49
+ e,
50
+ { returnAppClientIds: !0, returnAllProvisions: !0 },
51
+ "provisionedListings"
52
+ );
53
+ }
54
+ async function L(s, r) {
55
+ const e = `${i(s, r)}/linkedUsers`;
56
+ try {
57
+ return await c(e, { num: 10 }, "linkedUsers");
58
+ } catch (n) {
59
+ return console.error("Error fetching linked accounts:", n), [];
60
+ }
61
+ }
62
+ async function v(s, r, e) {
63
+ try {
64
+ return await c(
65
+ `https://${s.portalHostname}/sharing/rest/community/users/${r}/linkedUsers`,
66
+ { num: 10, token: e },
67
+ "linkedUsers"
68
+ );
69
+ } catch (n) {
70
+ return console.error(n), [];
71
+ }
8
72
  }
9
- function i(e) {
10
- return e?.sourceJSON?.privileges?.includes("portal:user:createItem");
73
+ async function O({
74
+ portal: s,
75
+ user: r,
76
+ targetUser: e,
77
+ targetToken: n
78
+ }) {
79
+ const t = `${i(s, r)}/linkUser`, o = await l(t, {
80
+ method: "post",
81
+ query: { user: e, userToken: n }
82
+ });
83
+ return o.error && console.error(o.error), o;
11
84
  }
12
- function o(e) {
13
- return e?.sourceJSON?.privileges?.includes("portal:user:createItem");
85
+ async function R({
86
+ portal: s,
87
+ user: r,
88
+ linkedUsername: e
89
+ }) {
90
+ const n = `${i(s, r)}/unlinkUser`, t = await l(n, { method: "post", query: { user: e } });
91
+ return t.error && console.error(t.error), t;
14
92
  }
15
93
  export {
16
- o as a,
17
- i as c,
18
- s as g,
19
- c as i
94
+ L as a,
95
+ $ as b,
96
+ P as c,
97
+ q as d,
98
+ A as e,
99
+ U as f,
100
+ v as g,
101
+ O as l,
102
+ R as u
20
103
  };