@arcgis/lumina-compiler 5.1.0-next.21 → 5.1.0-next.22

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/index.js CHANGED
@@ -1,28 +1,28 @@
1
- import { externalizeDependencies as as, path as u, retrievePackageJson as D, fetchPackageLocation as Vt, asyncRetrievePackageJson as Gt, existsAsync as _, toPosixPathSeparators as be, isPosix as Xt, toSystemPathSeparators as Ae, getCwd as Yt } from "@arcgis/components-build-utils";
1
+ import { externalizeDependencies as cs, path as u, retrievePackageJson as O, fetchPackageLocation as Gt, asyncRetrievePackageJson as Xt, existsAsync as _, toPosixPathSeparators as be, isPosix as Yt, toSystemPathSeparators as Ae, getCwd as Qt } from "@arcgis/components-build-utils";
2
2
  import { isNotUndefined as F } from "@arcgis/toolkit/predicate";
3
3
  import { f as b, l as E } from "./logger-63CXuX6h.js";
4
4
  import o from "typescript";
5
- import { camelToKebab as Qt, getPreamble as ls, uncapitalize as gt, capitalize as cs } from "@arcgis/toolkit/string";
6
- import { lazyMetaSubItemJoiner as ds, lazyMetaItemJoiner as Re, lazyMetaGroupJoiner as ps, propertyFlagAttribute as ht, propertyFlagReflect as us, propertyFlagBoolean as ms, propertyFlagNumber as fs, propertyFlagState as gs, propertyFlagReadOnly as hs, propertyFlagNoAccessor as ys } from "@arcgis/lumina/config";
7
- import { isApiMethodAsync as vs, globalPackageIdentifier as bs, isApiMethod as ws, isApiProperty as Ss } from "@arcgis/api-extractor/utils/apiHelpers";
8
- import { readFile as q, readdir as tt, rm as Es, mkdir as Z, cp as Cs, writeFile as U, copyFile as Ts } from "node:fs/promises";
9
- import { build as $s } from "esbuild";
10
- import { glob as Ps } from "glob";
5
+ import { camelToKebab as Zt, getPreamble as ds, uncapitalize as gt, capitalize as ps } from "@arcgis/toolkit/string";
6
+ import { lazyMetaSubItemJoiner as ms, lazyMetaItemJoiner as De, lazyMetaGroupJoiner as us, propertyFlagAttribute as ht, propertyFlagReflect as fs, propertyFlagBoolean as gs, propertyFlagNumber as hs, propertyFlagState as ys, propertyFlagReadOnly as vs, propertyFlagNoAccessor as bs } from "@arcgis/lumina/config";
7
+ import { isApiMethodAsync as ws, globalPackageIdentifier as Ss, isApiMethod as Es, isApiProperty as Cs } from "@arcgis/api-extractor/utils/apiHelpers";
8
+ import { readFile as H, readdir as tt, rm as Ts, mkdir as G, cp as $s, writeFile as U, copyFile as Ps } from "node:fs/promises";
9
+ import { build as Is } from "esbuild";
10
+ import { glob as ks } from "glob";
11
11
  import { renameComponentFolder as We } from "@arcgis/api-extractor/extractor/webComponent/pathMapping";
12
- import { useApiExtractor as Is } from "@arcgis/api-extractor/vite/plugin";
13
- import ks from "mime-types";
14
- import { writeFileSync as Zt } from "node:fs";
15
- import xs from "chalk";
16
- import { unsafeGetUndocumentedPrinter as As, unsafeUndocumentedTs as yt } from "@arcgis/api-extractor/utils/internalTypeScriptApis";
12
+ import { useApiExtractor as xs } from "@arcgis/api-extractor/vite/plugin";
13
+ import As from "mime-types";
14
+ import { writeFileSync as ei } from "node:fs";
15
+ import Ns from "chalk";
16
+ import { unsafeGetUndocumentedPrinter as Ls, unsafeUndocumentedTs as yt } from "@arcgis/api-extractor/utils/internalTypeScriptApis";
17
17
  import { pathIsComponentEntrypoint as Ce } from "@arcgis/api-extractor/extractor/webComponent/findComponents";
18
- import { loadApiExtractorConfig as Ns, mergeApiExtractorConfigs as vt } from "@arcgis/api-extractor/extractor/config";
19
- import { loadTypeScriptConfig as Ls } from "@arcgis/api-extractor/vite/typeScript";
20
- import { mappedFind as He } from "@arcgis/toolkit/array";
21
- import { isPropertyEscapeNeeded as ei, maybeEscapePropertyName as js } from "@arcgis/api-extractor/utils/partPrinter";
22
- import { getPackageNameFromExternalSpecifier as Fs, getMemberName as ti } from "@arcgis/api-extractor/utils/astHelpers";
23
- import { identity as ii } from "@arcgis/toolkit/function";
24
- function Rs(e) {
25
- const t = e.options?.build?.dependencies ?? {}, i = as({
18
+ import { loadApiExtractorConfig as js, mergeApiExtractorConfigs as vt } from "@arcgis/api-extractor/extractor/config";
19
+ import { loadTypeScriptConfig as Fs } from "@arcgis/api-extractor/vite/typeScript";
20
+ import { mappedFind as ze } from "@arcgis/toolkit/array";
21
+ import { isPropertyEscapeNeeded as ti, maybeEscapePropertyName as Ds } from "@arcgis/api-extractor/utils/partPrinter";
22
+ import { getPackageNameFromExternalSpecifier as Rs, getMemberName as ii } from "@arcgis/api-extractor/utils/astHelpers";
23
+ import { identity as si } from "@arcgis/toolkit/function";
24
+ function Os(e) {
25
+ const t = e.options?.build?.dependencies ?? {}, i = cs({
26
26
  bundleIn: t.bundleIn,
27
27
  externalize: [
28
28
  // TODO: remove these once Lit is declared as a peer dependency
@@ -38,7 +38,7 @@ function Rs(e) {
38
38
  e.isInStorybook && (i.resolveId = void 0);
39
39
  }, i;
40
40
  }
41
- const Ds = "Fragment", De = "DynamicHtmlTag", Oe = "DynamicSvgTag", Te = Symbol("dynamic html tag name"), qe = Symbol("dynamic svg tag name"), si = /* @__PURE__ */ new Set([
41
+ const Ms = "Fragment", Re = "DynamicHtmlTag", Oe = "DynamicSvgTag", Te = Symbol("dynamic html tag name"), He = Symbol("dynamic svg tag name"), ri = /* @__PURE__ */ new Set([
42
42
  /**
43
43
  * There is a "className" property. However, in JSX typings we use "class"
44
44
  * instead to keep name shorter and to match Stencil's name. Thus, it should
@@ -68,7 +68,7 @@ const Ds = "Fragment", De = "DynamicHtmlTag", Oe = "DynamicSvgTag", Te = Symbol(
68
68
  "resource",
69
69
  "typeof",
70
70
  "vocab"
71
- ]), ri = /* @__PURE__ */ new Set([
71
+ ]), ni = /* @__PURE__ */ new Set([
72
72
  /*
73
73
  * From https://github.com/preactjs/preact/blob/f3edc902447dae7393de7fccaff3b722dee79467/src/diff/props.js#L107-L118
74
74
  * See also https://github.com/facebook/react/blob/8fd963a1e5ec89459cac27fb1d9ad193a0604110/packages/react-dom-bindings/src/client/ReactDOMComponent.js#L389
@@ -87,7 +87,7 @@ const Ds = "Fragment", De = "DynamicHtmlTag", Oe = "DynamicSvgTag", Te = Symbol(
87
87
  "exportParts",
88
88
  "hreflang",
89
89
  "media"
90
- ]), ze = {
90
+ ]), qe = {
91
91
  button: /* @__PURE__ */ new Set(["popoverTarget"]),
92
92
  input: /* @__PURE__ */ new Set(["list", "capture"]),
93
93
  iframe: /* @__PURE__ */ new Set(["sandbox"]),
@@ -908,9 +908,9 @@ const Ds = "Fragment", De = "DynamicHtmlTag", Oe = "DynamicSvgTag", Te = Symbol(
908
908
  }
909
909
  }
910
910
  };
911
- ni(W.common);
912
- Object.values(W.perElement).forEach(ni);
913
- function ni(e) {
911
+ oi(W.common);
912
+ Object.values(W.perElement).forEach(oi);
913
+ function oi(e) {
914
914
  e?.reflected !== void 0 && (e.reflected = Object.assign(/* @__PURE__ */ Object.create(null), e.reflected)), e?.stringifiedReflected !== void 0 && (e.stringifiedReflected = Object.assign(
915
915
  /* @__PURE__ */ Object.create(null),
916
916
  e.stringifiedReflected
@@ -919,7 +919,7 @@ function ni(e) {
919
919
  e.stringifiedNonReflected
920
920
  ));
921
921
  }
922
- const bt = /* @__PURE__ */ new Set(["itemScope"]), oi = /* @__PURE__ */ new Set([
922
+ const bt = /* @__PURE__ */ new Set(["itemScope"]), ai = /* @__PURE__ */ new Set([
923
923
  "abort",
924
924
  "animationCancel",
925
925
  "animationEnd",
@@ -1018,7 +1018,7 @@ const bt = /* @__PURE__ */ new Set(["itemScope"]), oi = /* @__PURE__ */ new Set(
1018
1018
  "volumeChange",
1019
1019
  "waiting",
1020
1020
  "wheel"
1021
- ]), Os = /* @__PURE__ */ new Set([
1021
+ ]), Js = /* @__PURE__ */ new Set([
1022
1022
  "area",
1023
1023
  "base",
1024
1024
  "br",
@@ -1094,7 +1094,7 @@ const bt = /* @__PURE__ */ new Set(["itemScope"]), oi = /* @__PURE__ */ new Set(
1094
1094
  "tspan",
1095
1095
  "use",
1096
1096
  "view"
1097
- ]), Ms = /* @__PURE__ */ new Set(["title", "svg", "a", "script", "style"]), st = /* @__PURE__ */ new Set([
1097
+ ]), Bs = /* @__PURE__ */ new Set(["title", "svg", "a", "script", "style"]), st = /* @__PURE__ */ new Set([
1098
1098
  "annotation-xml",
1099
1099
  "annotation",
1100
1100
  "maction",
@@ -1126,7 +1126,7 @@ const bt = /* @__PURE__ */ new Set(["itemScope"]), oi = /* @__PURE__ */ new Set(
1126
1126
  "munder",
1127
1127
  "munderover",
1128
1128
  "semantics"
1129
- ]), Js = /* @__PURE__ */ new Set([
1129
+ ]), Ks = /* @__PURE__ */ new Set([
1130
1130
  "annotation-xml",
1131
1131
  "color-profile",
1132
1132
  "font-face",
@@ -1136,7 +1136,7 @@ const bt = /* @__PURE__ */ new Set(["itemScope"]), oi = /* @__PURE__ */ new Set(
1136
1136
  "font-face-name",
1137
1137
  "missing-glyph"
1138
1138
  ]);
1139
- function Bs(e) {
1139
+ function _s(e) {
1140
1140
  if (e.length === 0)
1141
1141
  return "";
1142
1142
  const t = e[0];
@@ -1149,11 +1149,11 @@ function Bs(e) {
1149
1149
  }
1150
1150
  return e.trim().length === 0 ? t : e;
1151
1151
  }
1152
- const Ks = (e) => e.replaceAll("\\", "\\\\").replace(_s, "\\${").replaceAll("`", "\\`"), _s = /\$\{/gu, Us = (e) => !Ws.test(e), Ws = /^[^\s"'=<>`]+$/u, Hs = /[&<>]/gu, qs = {
1152
+ const Us = (e) => e.replaceAll("\\", "\\\\").replace(Ws, "\\${").replaceAll("`", "\\`"), Ws = /\$\{/gu, zs = (e) => !Hs.test(e), Hs = /^[^\s"'=<>`]+$/u, qs = /[&<>]/gu, Vs = {
1153
1153
  "&": "&amp;",
1154
1154
  "<": "&lt;",
1155
1155
  ">": "&gt;"
1156
- }, ai = (e) => e.replace(Hs, (t) => qs[t]), rt = (e) => typeof e == "string" && e.includes("-") && !Js.has(e), zs = ["keyed", "ref", "repeat", "live"], se = "staticHtml", G = "staticSvg", re = "html", ee = "svg", li = Symbol("maybe HTML namespace or maybe SVG"), ci = "css", di = "mathml", pi = [ci, re, di, se, G, ee], Vs = new Set(pi), Gs = ["safeClassMap", "safeStyleMap", "deferLoad", "stabilizedRef"], Xs = "nothing", Ys = [...zs, ...pi, ...Gs, Xs], Qs = (e) => o.isArrayLiteralExpression(e) && e.elements.every((t) => de(t)), de = (e) => o.isJsxElement(e) || o.isJsxSelfClosingElement(e) || o.isJsxFragment(e), te = {
1156
+ }, li = (e) => e.replace(qs, (t) => Vs[t]), rt = (e) => typeof e == "string" && e.includes("-") && !Ks.has(e), Gs = ["keyed", "ref", "repeat", "live"], se = "staticHtml", X = "staticSvg", re = "html", ee = "svg", ci = Symbol("maybe HTML namespace or maybe SVG"), di = "css", pi = "mathml", mi = [di, re, pi, se, X, ee], Xs = new Set(mi), Ys = ["safeClassMap", "safeStyleMap", "deferLoad", "stabilizedRef"], Qs = "nothing", Zs = [...Gs, ...mi, ...Ys, Qs], er = (e) => o.isArrayLiteralExpression(e) && e.elements.every((t) => de(t)), de = (e) => o.isJsxElement(e) || o.isJsxSelfClosingElement(e) || o.isJsxFragment(e), te = {
1157
1157
  [re]: ["lit", "lit/html.js", "lit-html"],
1158
1158
  /**
1159
1159
  * Sadly, Lit called these "html" and "svg", rather than "staticHtml" and
@@ -1163,9 +1163,9 @@ const Ks = (e) => e.replaceAll("\\", "\\\\").replace(_s, "\\${").replaceAll("`",
1163
1163
  */
1164
1164
  [se]: ["lit/static-html.js", "lit-html/static.js"],
1165
1165
  [ee]: ["lit", "lit-html", "lit/html.js"],
1166
- [G]: ["lit/static-html.js", "lit-html/static.js"],
1167
- [di]: ["lit", "lit-html", "lit/html.js"],
1168
- [ci]: ["lit", "@lit/reactive-element/css-tag.js", "@lit/reactive-element"],
1166
+ [X]: ["lit/static-html.js", "lit-html/static.js"],
1167
+ [pi]: ["lit", "lit-html", "lit/html.js"],
1168
+ [di]: ["lit", "@lit/reactive-element/css-tag.js", "@lit/reactive-element"],
1169
1169
  safeClassMap: ["@arcgis/lumina"],
1170
1170
  safeStyleMap: ["@arcgis/lumina"],
1171
1171
  deferLoad: ["@arcgis/lumina"],
@@ -1175,7 +1175,7 @@ const Ks = (e) => e.replaceAll("\\", "\\\\").replace(_s, "\\${").replaceAll("`",
1175
1175
  repeat: ["lit/directives/repeat.js", "lit-html/directives/repeat.js"],
1176
1176
  ref: ["lit/directives/ref.js", "lit-html/directives/ref.js"],
1177
1177
  nothing: ["lit", "@arcgis/lumina", "lit/html.js", "lit-html", "lit-element/lit-element.js"]
1178
- }, Zs = /* @__PURE__ */ new Set([
1178
+ }, tr = /* @__PURE__ */ new Set([
1179
1179
  "h",
1180
1180
  "Fragment",
1181
1181
  "state",
@@ -1185,7 +1185,7 @@ const Ks = (e) => e.replaceAll("\\", "\\\\").replace(_s, "\\${").replaceAll("`",
1185
1185
  "bindProperty",
1186
1186
  "bindEvent",
1187
1187
  "bindAttribute"
1188
- ]), er = /\.(?:css|s[ac]ss|less|styl(?:us)?|postcss|pcss|sss)(\\?|$)/u, oe = "@arcgis/lumina:loadLitCss", $e = "?litCss", X = "?layeredLitCss", Ve = "?globalFileLitCss", tr = (e) => ({
1188
+ ]), ir = /\.(?:css|s[ac]ss|less|styl(?:us)?|postcss|pcss|sss)(\\?|$)/u, oe = "@arcgis/lumina:loadLitCss", $e = "?litCss", Y = "?layeredLitCss", Ve = "?globalFileLitCss", sr = (e) => ({
1189
1189
  name: oe,
1190
1190
  enforce: "pre",
1191
1191
  configResolved(t) {
@@ -1219,20 +1219,20 @@ const Ks = (e) => e.replaceAll("\\", "\\\\").replace(_s, "\\${").replaceAll("`",
1219
1219
  async handler(n, a) {
1220
1220
  const c = a.endsWith($e);
1221
1221
  c && (a = a.slice(0, -$e.length));
1222
- const p = a.endsWith(X);
1223
- p && (a = a.slice(0, -X.length));
1222
+ const p = a.endsWith(Y);
1223
+ p && (a = a.slice(0, -Y.length));
1224
1224
  const l = a.endsWith(Ve);
1225
1225
  if (l && (a = a.slice(0, -Ve.length)), !c && !p && !l)
1226
1226
  return await s.handler.call(this, n, a);
1227
- const d = `${a}?inline`, f = await s.handler.call(this, n, d), { code: m, ...g } = typeof f == "string" ? { code: f } : f ?? {};
1228
- return typeof m != "string" || !m.startsWith(ui) || !m.endsWith(ir) ? (E.warn(
1227
+ const d = `${a}?inline`, m = await s.handler.call(this, n, d), { code: f, ...g } = typeof m == "string" ? { code: m } : m ?? {};
1228
+ return typeof f != "string" || !f.startsWith(ui) || !f.endsWith(rr) ? (E.warn(
1229
1229
  oe,
1230
1230
  `Expected vite:css-post to return a JS module with a string literal. Received: ${JSON.stringify(
1231
- m
1231
+ f
1232
1232
  )}`
1233
- ), f) : l ? (e._globalCssString = mi(m), { code: "", map: { mappings: "" } }) : {
1233
+ ), m) : l ? (e._globalCssString = fi(f), { code: "", map: { mappings: "" } }) : {
1234
1234
  ...g,
1235
- code: or(m, e.hmrEnabled, e.shouldMinify, p),
1235
+ code: lr(f, e.hmrEnabled, e.shouldMinify, p),
1236
1236
  /**
1237
1237
  * Vite's original transform does not generate source maps for inlined
1238
1238
  * css, thus we can't either
@@ -1242,8 +1242,8 @@ const Ks = (e) => e.replaceAll("\\", "\\\\").replace(_s, "\\${").replaceAll("`",
1242
1242
  }
1243
1243
  };
1244
1244
  }
1245
- }), ui = 'export default "', ir = '"', sr = `import { css } from '${te.css[0]}';
1246
- export const styles = css\``, rr = "`;\nexport default styles;", nr = `
1245
+ }), ui = 'export default "', rr = '"', nr = `import { css } from '${te.css[0]}';
1246
+ export const styles = css\``, or = "`;\nexport default styles;", ar = `
1247
1247
 
1248
1248
  if(import.meta.hot) {
1249
1249
  import.meta.hot.data.styles ??= styles;
@@ -1254,46 +1254,46 @@ if(import.meta.hot) {
1254
1254
  }
1255
1255
  import.meta.hot.data.styles.styleSheet.replaceSync(nextExports.styles.cssText);
1256
1256
  });
1257
- }`, mi = (e) => e.slice(ui.length - 1);
1258
- function or(e, t, i, s) {
1259
- const r = mi(e), n = JSON.parse(r), a = Ks(n), c = s ? `@layer{${i ? "" : `
1257
+ }`, fi = (e) => e.slice(ui.length - 1);
1258
+ function lr(e, t, i, s) {
1259
+ const r = fi(e), n = JSON.parse(r), a = Us(n), c = s ? `@layer{${i ? "" : `
1260
1260
  `}${a}${i ? "" : `
1261
1261
  `}}` : a;
1262
- return `${sr}${c}${rr}${t ? nr : ""}`;
1262
+ return `${nr}${c}${or}${t ? ar : ""}`;
1263
1263
  }
1264
- function ar(e) {
1265
- return `import("${lr}").then(({ setCustomElementsManifest }) => {
1266
- setCustomElementsManifest(${cr(e)});
1264
+ function cr(e) {
1265
+ return `import("${dr}").then(({ setCustomElementsManifest }) => {
1266
+ setCustomElementsManifest(${pr(e)});
1267
1267
  });`;
1268
1268
  }
1269
- const lr = "@storybook/web-components", cr = (e) => `JSON.parse(\`${dr(JSON.stringify(JSON.stringify(e)).slice(1, -1))}\`)`;
1270
- function dr(e) {
1269
+ const dr = "@storybook/web-components", pr = (e) => `JSON.parse(\`${mr(JSON.stringify(JSON.stringify(e)).slice(1, -1))}\`)`;
1270
+ function mr(e) {
1271
1271
  return e.replaceAll('\\"', '"').replaceAll("`", "\\`").replaceAll("${", "\\${");
1272
1272
  }
1273
- function pr(e) {
1274
- ur(e);
1273
+ function ur(e) {
1274
+ fr(e);
1275
1275
  const t = e.options.css?.globalStylesPath;
1276
1276
  if (t === void 0)
1277
1277
  return "";
1278
1278
  const i = u.join(e.dir.root, t);
1279
1279
  return e.viteCommand === "serve" || e.isInStorybook ? [
1280
- `import globalStyles from "${i}${X}";`,
1280
+ `import globalStyles from "${i}${Y}";`,
1281
1281
  "document.adoptedStyleSheets = [...document.adoptedStyleSheets, globalStyles.styleSheet!];",
1282
- gi("", e)
1282
+ hi("", e)
1283
1283
  ].join(`
1284
1284
  `) : `import "${i}${Ve}";`;
1285
1285
  }
1286
- const fi = "hydrated";
1287
- function ur(e) {
1286
+ const gi = "hydrated";
1287
+ function fr(e) {
1288
1288
  e._globalHydratedCssString = [
1289
1289
  ":not([",
1290
- e.options.css?.hydratedAttribute ?? fi,
1290
+ e.options.css?.hydratedAttribute ?? gi,
1291
1291
  "]):is(",
1292
1292
  e.apiJsonComponents.map((t) => t.tagName).join(","),
1293
1293
  "){visibility:hidden}"
1294
1294
  ].join("");
1295
1295
  }
1296
- function gi(e, t) {
1296
+ function hi(e, t) {
1297
1297
  return [
1298
1298
  "const globalCss = new CSSStyleSheet;",
1299
1299
  `globalCss.replaceSync("@layer{${`${t._globalHydratedCssString}${t.shouldMinify ? "" : "\\n\\n"}${e ? e.slice(1, -1) : ""}`}}");`,
@@ -1301,70 +1301,71 @@ function gi(e, t) {
1301
1301
  ].join(`
1302
1302
  `);
1303
1303
  }
1304
- const mr = (e) => `@layer{${e.shouldMinify ? "" : `
1304
+ const gr = (e) => `@layer{${e.shouldMinify ? "" : `
1305
1305
  `}${e._globalHydratedCssString}${e.shouldMinify ? "" : `
1306
1306
 
1307
1307
  `}${e._globalCssString ? JSON.parse(e._globalCssString) : ""}${e.shouldMinify ? "" : `
1308
1308
  `}}`;
1309
- function fr(e) {
1309
+ function hr(e) {
1310
1310
  const t = [], i = [];
1311
1311
  for (const s of e.privateApiJson.modules)
1312
1312
  for (const r of s.declarations)
1313
- r.customElement === !0 && (i.push(gr(r, e, s.sourcePath)), t.push(s.sourcePath));
1313
+ r.customElement === !0 && (i.push(yr(r, e, s.sourcePath)), t.push(s.sourcePath));
1314
1314
  return [
1315
1315
  'import { runtime } from "./runtime.ts";',
1316
1316
  'import { makeDefineCustomElements } from "@arcgis/lumina";',
1317
- pr(e),
1318
- e.hmrEnabled ? yr : "",
1317
+ ur(e),
1318
+ e.hmrEnabled ? br : "",
1319
1319
  "",
1320
- e.isInStorybook ? ar(e.apiJson) : "",
1320
+ e.isInStorybook ? cr(e.apiJson) : "",
1321
1321
  "",
1322
1322
  "export const defineCustomElements = makeDefineCustomElements(runtime, {",
1323
1323
  i.join(`,
1324
1324
  `),
1325
1325
  "});",
1326
- e.hmrEnabled ? vr(t) : ""
1326
+ e.hmrEnabled ? wr(t) : ""
1327
1327
  ].join(`
1328
1328
  `);
1329
1329
  }
1330
- const gr = (e, t, i) => [
1330
+ const yr = (e, t, i) => [
1331
1331
  ` "${e.tagName}": [`,
1332
1332
  `()=>import("${u.join(t.dir.root, i)}"),`,
1333
- hr(e),
1333
+ vr(e),
1334
1334
  "]"
1335
1335
  ].join("");
1336
- function hr(e) {
1337
- const { properties: t, asyncMethods: i, syncMethods: s } = hi(e), r = t.map((d) => d.join(ds)).join(Re), n = i.join(Re), a = s.join(Re), c = [r, n, a], p = c.findLastIndex((d) => d.length > 0), l = c.slice(0, p + 1);
1338
- return l.length > 0 ? `"${l.join(ps)}"` : "";
1336
+ function vr(e) {
1337
+ const { properties: t, asyncMethods: i, syncMethods: s, formAssociated: r } = yi(e), n = t.map((g) => g.join(ms)).join(De), a = i.join(De), c = s.join(De), p = [n, a, c], l = p.findLastIndex((g) => g.length > 0), d = p.slice(0, l + 1);
1338
+ return `${d.length > 0 || r ? `"${d.join(us)}"` : ""}${r ? ",1" : ""}`;
1339
1339
  }
1340
- function hi(e) {
1340
+ function yi(e) {
1341
1341
  const t = [], i = [], s = [];
1342
- for (let r = 0; r < e.members.length; ++r) {
1343
- const n = e.members[r];
1344
- if (n.kind === "field") {
1345
- const a = typeof n.attribute == "string", c = a && n.attribute !== Qt(n.name);
1342
+ for (let n = 0; n < e.members.length; ++n) {
1343
+ const a = e.members[n];
1344
+ if (a.kind === "field") {
1345
+ const c = typeof a.attribute == "string", p = c && a.attribute !== Zt(a.name);
1346
1346
  t.push(
1347
- a && !c ? [n.name] : [n.name, c ? String(n.attribute) : ""]
1347
+ c && !p ? [a.name] : [a.name, p ? String(a.attribute) : ""]
1348
1348
  );
1349
- } else n.kind === "method" && n.name !== "componentOnReady" && (vs(n) ? i.push(n.name) : s.push(n.name));
1349
+ } else a.kind === "method" && a.name !== "componentOnReady" && (ws(a) ? i.push(a.name) : s.push(a.name));
1350
1350
  }
1351
- return { tagName: e.tagName, properties: t, asyncMethods: i, syncMethods: s };
1351
+ const r = e.formAssociated === !0;
1352
+ return { tagName: e.tagName, properties: t, asyncMethods: i, syncMethods: s, formAssociated: r };
1352
1353
  }
1353
- const yr = `import { handleHmrUpdate, handleComponentMetaUpdate } from "@arcgis/lumina/hmrSupport";
1354
- `, vr = (e) => `
1354
+ const br = `import { handleHmrUpdate, handleComponentMetaUpdate } from "@arcgis/lumina/hmrSupport";
1355
+ `, wr = (e) => `
1355
1356
  if(import.meta.hot) {
1356
1357
  import.meta.hot.on("component-meta-update", handleComponentMetaUpdate);
1357
1358
  import.meta.hot.accept([
1358
1359
  ${e.map((t) => ` "/${t}",`).join(`
1359
1360
  `)}
1360
1361
  ], handleHmrUpdate);
1361
- }`, br = "@arcgis/lumina-compiler", yi = {
1362
- name: br
1362
+ }`, Sr = "@arcgis/lumina-compiler", vi = {
1363
+ name: Sr
1363
1364
  };
1364
- async function vi(e, t) {
1365
- return ie ??= Sr(e, t), await ie;
1365
+ async function bi(e, t) {
1366
+ return ie ??= Cr(e, t), await ie;
1366
1367
  }
1367
- function wr() {
1368
+ function Er() {
1368
1369
  if (Pe === void 0)
1369
1370
  throw Error(
1370
1371
  b(
@@ -1374,7 +1375,7 @@ function wr() {
1374
1375
  );
1375
1376
  return Pe;
1376
1377
  }
1377
- function bi() {
1378
+ function wi() {
1378
1379
  if (Ge === void 0)
1379
1380
  throw Error(
1380
1381
  b(
@@ -1384,9 +1385,9 @@ function bi() {
1384
1385
  );
1385
1386
  return Ge;
1386
1387
  }
1387
- async function Sr(e, t) {
1388
- const i = D(e), s = i.dependencies ?? {}, r = i.peerDependencies ?? {}, a = (await Promise.all(
1389
- [...Object.keys(s), ...Object.keys(r)].filter((l) => !Er.has(l)).flatMap(async (l) => await wi(l, e))
1388
+ async function Cr(e, t) {
1389
+ const i = O(e), s = i.dependencies ?? {}, r = i.peerDependencies ?? {}, a = (await Promise.all(
1390
+ [...Object.keys(s), ...Object.keys(r)].filter((l) => !Tr.has(l)).flatMap(async (l) => await Si(l, e))
1390
1391
  )).filter(F);
1391
1392
  Pe ??= a, Ge = Object.fromEntries(a.flatMap((l) => Object.entries(l.components)));
1392
1393
  const c = t?.serve?.extraDependencies?.map(
@@ -1394,7 +1395,7 @@ async function Sr(e, t) {
1394
1395
  ), p = c === void 0 ? a : a.filter((l) => !c.includes(l.packageName));
1395
1396
  return Pe ??= p, p;
1396
1397
  }
1397
- const Er = /* @__PURE__ */ new Set([
1398
+ const Tr = /* @__PURE__ */ new Set([
1398
1399
  "@arcgis/arcade-languageservice",
1399
1400
  "@arcgis/components-build-utils",
1400
1401
  "@arcgis/toolkit",
@@ -1431,12 +1432,12 @@ const Er = /* @__PURE__ */ new Set([
1431
1432
  "vscode-languageserver-types"
1432
1433
  ]);
1433
1434
  let Pe, Ge, ie;
1434
- async function wi(e, t) {
1435
- const i = await Vt(e, t), s = await Gt(i), r = "exports" in s, n = jr.bind(void 0, r), a = "@stencil/core" in (s.dependencies ?? {}) || "@stencil/core" in (s.devDependencies ?? {}), c = u.join(i, "dist/esm/loader.js");
1435
+ async function Si(e, t) {
1436
+ const i = await Gt(e, t), s = await Xt(i), r = "exports" in s, n = Dr.bind(void 0, r), a = "@stencil/core" in (s.dependencies ?? {}) || "@stencil/core" in (s.devDependencies ?? {}), c = u.join(i, "dist/esm/loader.js");
1436
1437
  if (a ? await _(c) : !1) {
1437
- const g = await q(c, "utf8"), h = Cr(g, "bootstrapLazy("), y = g.indexOf(", options", h), v = g.slice(h, y), C = v.startsWith('JSON.parse("') ? v.slice(12, -2).replaceAll('\\"', '"') : v;
1438
+ const g = await H(c, "utf8"), h = $r(g, "bootstrapLazy("), y = g.indexOf(", options", h), v = g.slice(h, y), C = v.startsWith('JSON.parse("') ? v.slice(12, -2).replaceAll('\\"', '"') : v;
1438
1439
  try {
1439
- const S = JSON.parse(C), k = Nr(S, { packageName: e, getImportPath: n });
1440
+ const S = JSON.parse(C), k = jr(S, { packageName: e, getImportPath: n });
1440
1441
  return { packageName: e, type: "stencil", components: k, packageLocation: i, packageJson: s };
1441
1442
  } catch (S) {
1442
1443
  E.warn("@arcgis/lumina", `Failed to parse dist/esm/loader.js for ${e}.
@@ -1445,7 +1446,7 @@ Error: ${String(S)}`);
1445
1446
  }
1446
1447
  const l = wt(s.customElements);
1447
1448
  if (l != null) {
1448
- const g = u.join(i, l), h = JSON.parse(await q(g, "utf-8")), y = Tr(h), v = Si(h, {
1449
+ const g = u.join(i, l), h = JSON.parse(await H(g, "utf-8")), y = Pr(h), v = Ei(h, {
1449
1450
  packageName: e,
1450
1451
  getImportPath: n
1451
1452
  });
@@ -1453,15 +1454,15 @@ Error: ${String(S)}`);
1453
1454
  }
1454
1455
  const d = wt(s["web-types"]);
1455
1456
  if (d != null) {
1456
- const g = u.join(i, d), h = JSON.parse(await q(g, "utf-8")), y = $r(h, {
1457
+ const g = u.join(i, d), h = JSON.parse(await H(g, "utf-8")), y = Ir(h, {
1457
1458
  packageName: e,
1458
1459
  getImportPath: n
1459
1460
  });
1460
1461
  return { type: "unknown", packageName: e, components: y, packageLocation: i, packageJson: s };
1461
1462
  }
1462
- const f = u.join(i, "dist/components");
1463
- if (await _(f)) {
1464
- const g = await Lr(f, {
1463
+ const m = u.join(i, "dist/components");
1464
+ if (await _(m)) {
1465
+ const g = await Fr(m, {
1465
1466
  packageName: e,
1466
1467
  getImportPath: n
1467
1468
  });
@@ -1469,11 +1470,11 @@ Error: ${String(S)}`);
1469
1470
  }
1470
1471
  }
1471
1472
  const wt = (e) => Array.isArray(e) ? e[0] : e;
1472
- function Cr(e, t) {
1473
+ function $r(e, t) {
1473
1474
  const i = e.indexOf(t);
1474
1475
  return i === -1 ? -1 : i + t.length;
1475
1476
  }
1476
- function Si(e, t, i = !1) {
1477
+ function Ei(e, t, i = !1) {
1477
1478
  const s = /* @__PURE__ */ Object.create(null);
1478
1479
  if (e.modules === void 0)
1479
1480
  return s;
@@ -1490,31 +1491,31 @@ function Si(e, t, i = !1) {
1490
1491
  // Older api.json
1491
1492
  "importPath" in p && typeof p.importPath == "string" ? p.importPath : void 0
1492
1493
  )
1493
- ), d = p.tagName, f = {
1494
+ ), d = p.tagName, m = {
1494
1495
  packageName: t.packageName,
1495
1496
  modulePath: l ?? t.getImportPath(d),
1496
1497
  propToAttribute: Object.fromEntries(
1497
- (p.attributes ?? []).map((m) => [m.fieldName ?? m.name, m.name])
1498
+ (p.attributes ?? []).map((f) => [f.fieldName ?? f.name, f.name])
1498
1499
  ),
1499
1500
  requiredProperties: void 0
1500
1501
  };
1501
- if (s[d] = f, i && p.members !== void 0) {
1502
- const m = /* @__PURE__ */ new Set();
1502
+ if (s[d] = m, i && p.members !== void 0) {
1503
+ const f = /* @__PURE__ */ new Set();
1503
1504
  for (let g = 0; g < p.members.length; ++g) {
1504
1505
  const h = p.members[g];
1505
- h.kind === "field" && h.docsTags?.some((y) => y.name === "required") === !0 && m.add(h.name);
1506
+ h.kind === "field" && h.docsTags?.some((y) => y.name === "required") === !0 && f.add(h.name);
1506
1507
  }
1507
- m.size > 0 && (f.requiredProperties = m);
1508
+ f.size > 0 && (m.requiredProperties = f);
1508
1509
  }
1509
1510
  }
1510
1511
  }
1511
1512
  return s;
1512
1513
  }
1513
- const Tr = (e) => (
1514
+ const Pr = (e) => (
1514
1515
  // Since 5.0
1515
1516
  e.compiler?.name === "@arcgis/api-extractor" || // Before 5.0
1516
- e.compiler?.name === yi.name
1517
- ), $r = (e, t) => Object.fromEntries(
1517
+ e.compiler?.name === vi.name
1518
+ ), Ir = (e, t) => Object.fromEntries(
1518
1519
  (e.contributions?.html?.elements ?? e.contributions?.html?.tags)?.map(
1519
1520
  (i) => [
1520
1521
  i.name,
@@ -1525,7 +1526,7 @@ const Tr = (e) => (
1525
1526
  }
1526
1527
  ]
1527
1528
  ) ?? []
1528
- ), Pr = 1, Ir = 2, kr = 4, xr = 8, Ar = Pr | Ir | kr | xr, Nr = (e, t) => Object.fromEntries(
1529
+ ), kr = 1, xr = 2, Ar = 4, Nr = 8, Lr = kr | xr | Ar | Nr, jr = (e, t) => Object.fromEntries(
1529
1530
  e.flatMap(
1530
1531
  ([i, s]) => s.map(
1531
1532
  ([r, n, a]) => [
@@ -1534,13 +1535,13 @@ const Tr = (e) => (
1534
1535
  packageName: t.packageName,
1535
1536
  modulePath: t.getImportPath(n),
1536
1537
  propToAttribute: Object.fromEntries(
1537
- Object.entries(a ?? {}).filter(([c, [p]]) => p & Ar).map(([c, [p, l = c]]) => [c, l])
1538
+ Object.entries(a ?? {}).filter(([c, [p]]) => p & Lr).map(([c, [p, l = c]]) => [c, l])
1538
1539
  )
1539
1540
  }
1540
1541
  ]
1541
1542
  )
1542
1543
  )
1543
- ), Lr = async (e, t) => Object.fromEntries(
1544
+ ), Fr = async (e, t) => Object.fromEntries(
1544
1545
  (await tt(e)).filter((i) => i.endsWith(".d.ts")).map((i) => {
1545
1546
  const s = i.slice(0, -5);
1546
1547
  return [
@@ -1552,19 +1553,19 @@ const Tr = (e) => (
1552
1553
  }
1553
1554
  ];
1554
1555
  })
1555
- ), jr = (e, t) => e ? `components/${t}` : `dist/components/${t}.js`, Fr = (e) => e.startsWith("/") ? e : `/${e}`, nt = (e, t) => `${e}@fs${Fr(t)}`;
1556
- function Ei(e) {
1556
+ ), Dr = (e, t) => e ? `components/${t}` : `dist/components/${t}.js`, Rr = (e) => e.startsWith("/") ? e : `/${e}`, nt = (e, t) => `${e}@fs${Rr(t)}`;
1557
+ function Ci(e) {
1557
1558
  const t = e?.apiExtractorPluginConfig.unsafeConfigOverride?.types?.typeScriptConfig?.config.options.target ?? o.ScriptTarget.ESNext, i = o.ScriptTarget[t].toLowerCase();
1558
1559
  return i === "latest" ? "esnext" : i;
1559
1560
  }
1560
- const Xe = "@arcgis/core", Me = D(), me = Xe in (Me.dependencies ?? {}) || Xe in (Me.peerDependencies ?? {}) || // Does not depend on `@arcgis/core` to avoid cycle, but uses core in Lumina tests
1561
+ const Xe = "@arcgis/core", Me = O(), ue = Xe in (Me.dependencies ?? {}) || Xe in (Me.peerDependencies ?? {}) || // Does not depend on `@arcgis/core` to avoid cycle, but uses core in Lumina tests
1561
1562
  Me.name === "@arcgis/lumina";
1562
- async function Rr(e, t, i) {
1563
- if (!me)
1563
+ async function Or(e, t, i) {
1564
+ if (!ue)
1564
1565
  return [];
1565
- const s = await Vt(Xe);
1566
+ const s = await Gt(Xe);
1566
1567
  if (t === "cdn") {
1567
- const r = await Gt(s), n = Ne({ name: "", version: r.version }, i);
1568
+ const r = await Xt(s), n = Ne({ name: "", version: r.version }, i);
1568
1569
  return [
1569
1570
  // Use the ESM CDN
1570
1571
  // <script src="https://jsdev.arcgis.com/VERSION/"><\/script>
@@ -1591,17 +1592,17 @@ const St = (e) => ({
1591
1592
  // This is used be the theme switcher in `@arcgis/storybook-utils`
1592
1593
  id: "arcgisCoreStylesheet"
1593
1594
  }), ot = "customElement.js";
1594
- function Dr(e, t) {
1595
+ function Mr(e, t) {
1595
1596
  if (!t.startsWith(e))
1596
1597
  return t;
1597
1598
  const s = t.split(u.sep);
1598
- return s.at(Or) !== s.at(Mr) ? t : u.join(s.slice(0, -1).join(u.sep), ot);
1599
+ return s.at(Jr) !== s.at(Br) ? t : u.join(s.slice(0, -1).join(u.sep), ot);
1599
1600
  }
1600
- const Or = -1, Mr = -2, Jr = /["']\.\.?\/[^'"]+/gu, Br = (e, t, i, s) => e.replaceAll(Jr, (r) => {
1601
+ const Jr = -1, Br = -2, Kr = /["']\.\.?\/[^'"]+/gu, _r = (e, t, i, s) => e.replaceAll(Kr, (r) => {
1601
1602
  const n = r.slice(1);
1602
1603
  if (!n.startsWith("./") && !n.startsWith("../"))
1603
1604
  return r;
1604
- const a = u.join(s, n), c = !n.endsWith(".js") && !n.split("/").at(-1).includes(".") ? Dr(t.dir.distComponents, a) : a, p = c.startsWith(t.dir.distComponents) ? t.dir.dist + We(c.slice(t.dir.dist.length), t.apiExtractor) : c;
1605
+ const a = u.join(s, n), c = !n.endsWith(".js") && !n.split("/").at(-1).includes(".") ? Mr(t.dir.distComponents, a) : a, p = c.startsWith(t.dir.distComponents) ? t.dir.dist + We(c.slice(t.dir.dist.length), t.apiExtractor) : c;
1605
1606
  if (i === s && a === p)
1606
1607
  return r;
1607
1608
  const l = fe(i, p), d = r.endsWith("/") ? `${l}/` : l;
@@ -1610,12 +1611,12 @@ const Or = -1, Mr = -2, Jr = /["']\.\.?\/[^'"]+/gu, Br = (e, t, i, s) => e.repla
1610
1611
  const i = u.relative(e, t);
1611
1612
  return i.startsWith(".") ? i : `.${u.sep}${i}`;
1612
1613
  };
1613
- async function Kr(e, t, i) {
1614
+ async function Ur(e, t, i) {
1614
1615
  const s = u.resolve(e.dir.root, t);
1615
- e.viteConfig.build.emptyOutDir !== !1 && await _(s) && await Es(s, { recursive: !0, force: !0 }), await Z(s, { recursive: !0 }), await Cs(e.dir.distCdn, u.join(s, "build"), { recursive: !0 });
1616
+ e.viteConfig.build.emptyOutDir !== !1 && await _(s) && await Ts(s, { recursive: !0, force: !0 }), await G(s, { recursive: !0 }), await $s(e.dir.distCdn, u.join(s, "build"), { recursive: !0 });
1616
1617
  const r = [
1617
1618
  "index.html",
1618
- ...await Ps("**/*.html", {
1619
+ ...await ks("**/*.html", {
1619
1620
  cwd: e.dir.src,
1620
1621
  nodir: !0,
1621
1622
  posix: !0
@@ -1628,16 +1629,16 @@ async function Kr(e, t, i) {
1628
1629
  if ("tag" in l) {
1629
1630
  const d = l.children ?? "";
1630
1631
  if (typeof d == "string")
1631
- return `<${l.tag} ${Object.entries(l.attrs ?? {}).map(([f, m]) => `${f}="${m}"`).join(" ")}>${d}</${l.tag}>`;
1632
+ return `<${l.tag} ${Object.entries(l.attrs ?? {}).map(([m, f]) => `${m}="${f}"`).join(" ")}>${d}</${l.tag}>`;
1632
1633
  }
1633
1634
  throw Error(b("@arcgis/lumina:buildWebApp", `Unsupported loader type: ${JSON.stringify(l)}`));
1634
1635
  }).join(`
1635
1636
  `);
1636
1637
  await Promise.all(
1637
1638
  r.map(async (l, d) => {
1638
- const m = d === 0 ? l : u.join(n, l), g = u.join(e.dir.root, m), h = u.join(s, m);
1639
- await Z(u.dirname(h), { recursive: !0 });
1640
- const y = await q(g, "utf-8"), v = fe(u.dirname(m), `build/${i}`), C = `${p}<script type="module" src="${v}"><\/script>
1639
+ const f = d === 0 ? l : u.join(n, l), g = u.join(e.dir.root, f), h = u.join(s, f);
1640
+ await G(u.dirname(h), { recursive: !0 });
1641
+ const y = await H(g, "utf-8"), v = fe(u.dirname(f), `build/${i}`), C = `${p}<script type="module" src="${v}"><\/script>
1641
1642
  `, S = Math.min(
1642
1643
  ...[y.indexOf("<style>"), y.indexOf("<script"), y.indexOf("</head>")].filter(
1643
1644
  (x) => x !== -1
@@ -1650,7 +1651,7 @@ async function Kr(e, t, i) {
1650
1651
  })
1651
1652
  ), await e.options.build?.webApp?.afterBuildEnd?.(e);
1652
1653
  }
1653
- const Ci = /* @__PURE__ */ new Set([
1654
+ const Ti = /* @__PURE__ */ new Set([
1654
1655
  "chunks",
1655
1656
  "components",
1656
1657
  "docs",
@@ -1663,13 +1664,13 @@ const Ci = /* @__PURE__ */ new Set([
1663
1664
  "collection",
1664
1665
  "extras",
1665
1666
  "support"
1666
- ]), B = "@arcgis/lumina:buildCdn", ne = "cdn", Ti = "index", Y = "main";
1667
- function _r(e) {
1667
+ ]), R = "@arcgis/lumina:buildCdn", ne = "cdn", $i = "index", Q = "main";
1668
+ function Wr(e) {
1668
1669
  const { skip: t = !1, namespace: i, esbuildOptions: s = {}, entrypointTransformer: r } = e.options.build?.cdn ?? {}, n = e.options.build?.webApp?.destination, a = i !== void 0;
1669
1670
  if (a) {
1670
1671
  if (i.toLowerCase() !== i)
1671
1672
  throw new Error(`Expected CDN namespace to be all lowercase. Received: ${i}`);
1672
- if (Ci.has(i))
1673
+ if (Ti.has(i))
1673
1674
  throw new Error(
1674
1675
  `Namespace name "${i}" is restricted as it collides with a well-known Lumina dist/ folder name or Stencil dist/ folder name.`
1675
1676
  );
@@ -1677,27 +1678,27 @@ function _r(e) {
1677
1678
  'The "namespace" option in the "build.cdn" is deprecated and will be removed in the next major version.'
1678
1679
  );
1679
1680
  }
1680
- const c = i ?? Ti;
1681
+ const c = i ?? $i;
1681
1682
  if (e.provideAssets([
1682
1683
  {
1683
1684
  type: "dynamic",
1684
- source: () => mr(e),
1685
- destination: `../${a ? c : Y}.css`
1685
+ source: () => gr(e),
1686
+ destination: `../${a ? c : Q}.css`
1686
1687
  }
1687
1688
  ]), !t)
1688
1689
  return {
1689
- name: B,
1690
+ name: R,
1690
1691
  async writeBundle() {
1691
1692
  if (e.isInStorybook)
1692
1693
  return;
1693
1694
  if ((e.apiJsonComponents ?? []).length === 0) {
1694
1695
  E.warn(
1695
- B,
1696
+ R,
1696
1697
  "Skipping CDN build as no public custom elements were found in this package. Double check that your component files follow the required naming convention: https://webgis.esri.com/references/lumina/component."
1697
1698
  );
1698
1699
  return;
1699
1700
  }
1700
- const p = me && D().name !== "@arcgis/embeddable-components", l = Date.now(), d = Array.isArray(s.entryPoints) ? s.entryPoints.map((g) => typeof g == "string" ? { in: g, out: "" } : g) : typeof s.entryPoints == "object" ? Object.entries(s.entryPoints).map(([g, h]) => ({ in: h, out: g })) : [], f = await Ur(
1701
+ const p = ue && O().name !== "@arcgis/embeddable-components", l = Date.now(), d = Array.isArray(s.entryPoints) ? s.entryPoints.map((g) => typeof g == "string" ? { in: g, out: "" } : g) : typeof s.entryPoints == "object" ? Object.entries(s.entryPoints).map(([g, h]) => ({ in: h, out: g })) : [], m = await zr(
1701
1702
  e,
1702
1703
  c,
1703
1704
  s,
@@ -1705,31 +1706,31 @@ function _r(e) {
1705
1706
  r,
1706
1707
  p
1707
1708
  );
1708
- await Wr(
1709
- f,
1709
+ await Hr(
1710
+ m,
1710
1711
  e,
1711
1712
  a ? `${c}.esm` : c,
1712
1713
  d,
1713
1714
  p
1714
1715
  );
1715
- const m = Date.now();
1716
- E.info(B, `CDN was built in ${m - l}ms`), n && await Kr(e, n, `${a ? `${c}.esm` : c}.js`);
1716
+ const f = Date.now();
1717
+ E.info(R, `CDN was built in ${f - l}ms`), n && await Ur(e, n, `${a ? `${c}.esm` : c}.js`);
1717
1718
  }
1718
1719
  };
1719
1720
  }
1720
- async function Ur(e, t, i, s, r, n) {
1721
+ async function zr(e, t, i, s, r, n) {
1721
1722
  const a = e.environment;
1722
1723
  if (i.minify && n)
1723
1724
  throw Error(
1724
1725
  b(
1725
- B,
1726
+ R,
1726
1727
  "Unminified CDN build is not yet supported - open a feature request with Lumina maintainers if it is needed"
1727
1728
  )
1728
1729
  );
1729
1730
  if (i.sourcemap && n)
1730
1731
  throw Error(
1731
1732
  b(
1732
- B,
1733
+ R,
1733
1734
  "Source maps in the CDN build are not yet supported - open a feature request with Lumina maintainers if it is needed"
1734
1735
  )
1735
1736
  );
@@ -1740,8 +1741,8 @@ async function Ur(e, t, i, s, r, n) {
1740
1741
  * The script's file name will be stripped inside defineCustomElements.
1741
1742
  **/
1742
1743
  defineCustomElements({resourcesUrl: import.meta.url});
1743
- ${gi(e._globalCssString, e)}`, p = r?.(c, e) ?? c;
1744
- return await $s({
1744
+ ${hi(e._globalCssString, e)}`, p = r?.(c, e) ?? c;
1745
+ return await Is({
1745
1746
  bundle: !0,
1746
1747
  minify: n ? !0 : a === "production",
1747
1748
  treeShaking: !0,
@@ -1766,7 +1767,7 @@ ${gi(e._globalCssString, e)}`, p = r?.(c, e) ?? c;
1766
1767
  chunkNames: "[hash]",
1767
1768
  resolveExtensions: [".js", ".json"],
1768
1769
  banner: { js: e.banner },
1769
- target: Ei(e),
1770
+ target: Ci(e),
1770
1771
  ...i,
1771
1772
  write: !1,
1772
1773
  plugins: [
@@ -1793,13 +1794,13 @@ ${gi(e._globalCssString, e)}`, p = r?.(c, e) ?? c;
1793
1794
  setup(l) {
1794
1795
  const d = e.options.build?.cdn?.namespace === void 0 ? (
1795
1796
  // eslint-disable-next-line require-unicode-regexp
1796
- new RegExp(`\\/${ne}\\/${Y}\\.css$`)
1797
+ new RegExp(`\\/${ne}\\/${Q}\\.css$`)
1797
1798
  ) : (
1798
1799
  // eslint-disable-next-line require-unicode-regexp
1799
1800
  new RegExp(`\\/${e.options.build.cdn.namespace}\\/${e.options.build.cdn.namespace}\\.css$`)
1800
1801
  );
1801
- l.onResolve({ filter: d }, ({ path: f }) => ({
1802
- path: f,
1802
+ l.onResolve({ filter: d }, ({ path: m }) => ({
1803
+ path: m,
1803
1804
  namespace: "build-cdn:global-css"
1804
1805
  })), l.onLoad({ filter: /.*/, namespace: "build-cdn:global-css" }, () => ({
1805
1806
  contents: "",
@@ -1825,36 +1826,59 @@ ${gi(e._globalCssString, e)}`, p = r?.(c, e) ?? c;
1825
1826
  }
1826
1827
  });
1827
1828
  }
1828
- async function Wr(e, t, i, s, r) {
1829
- const n = t.dir.distCdn, a = `${i}.js`, c = new Map(
1830
- e.outputFiles.map((p) => {
1831
- const l = {
1832
- code: p.text,
1829
+ const Et = "stdin.js";
1830
+ async function Hr(e, t, i, s, r) {
1831
+ const n = t.dir.distCdn, a = `${i}.js`;
1832
+ let c;
1833
+ r && (c = new Set(s.map((d) => `${d.out}.js`)), c.add(a));
1834
+ const p = new Map(
1835
+ e.outputFiles.map((d) => {
1836
+ const m = {
1837
+ code: d.text,
1833
1838
  isProcessing: !1,
1834
1839
  isAsync: void 0,
1835
1840
  oldSingleExportName: void 0
1836
- }, d = p.path.slice(n.length);
1837
- if (d === "stdin.js") {
1841
+ }, f = d.path.slice(n.length);
1842
+ if (f === Et) {
1838
1843
  if (r) {
1839
- const m = p.text.match(Hr)?.[0];
1840
- if (m === void 0)
1844
+ const h = d.text.match(qr)?.[0];
1845
+ if (h === void 0)
1841
1846
  throw Error(
1842
- `Failed to find the runtime variable name in the CDN entrypoint file. This likely indicates a bug in Lumina. stdin.js contents:
1843
- ${p.text}`
1847
+ `Failed to find the runtime variable name in the CDN entrypoint file. This likely indicates a bug in Lumina. ${Et} contents:
1848
+ ${d.text}`
1844
1849
  );
1845
- l.code = `${l.code.trimEnd()}${qr(m, s)}`, l.isAsync = !1;
1850
+ m.code = `${m.code.trimEnd()}${Vr(h, s)}`, m.isAsync = !1;
1846
1851
  }
1847
- return [a, l];
1852
+ return [a, m];
1848
1853
  }
1849
- return [d, l];
1854
+ return [f, m];
1850
1855
  })
1851
1856
  );
1852
- r && c.forEach((p, l) => {
1853
- p.isAsync === void 0 && (l.endsWith(".js") ? $i(p, c) : p.isAsync = !1);
1854
- }), t.options.build?.cdn?.transformer?.(c, t), await Promise.all(Array.from(c.entries(), async ([p, { code: l }]) => await U(n + p, l)));
1857
+ r && p.forEach((d, m) => {
1858
+ if (d.isAsync === void 0)
1859
+ if (m.endsWith(".js")) {
1860
+ if (Pi(d, p), c?.has(m) === !0 && d.code.includes(Ii))
1861
+ throw Error(
1862
+ b(
1863
+ R,
1864
+ "CDN entrypoints cannot directly or indirectly import from @arcgis/core at the top level. @arcgis/core, or modules that import @arcgis/core may only be imported dynamically using import(). This is necessary to be compatible with AMD CDN, ESM CDN, and Safari's lack of top-level await support."
1865
+ )
1866
+ );
1867
+ } else
1868
+ d.isAsync = !1;
1869
+ }), t.options.build?.cdn?.transformer?.(p, t);
1870
+ const l = /* @__PURE__ */ new Map();
1871
+ for (const d of p.keys()) {
1872
+ const m = d.lastIndexOf("/");
1873
+ if (m !== -1) {
1874
+ const f = d.slice(0, m);
1875
+ l.set(f, G(n + f, { recursive: !0 }));
1876
+ }
1877
+ }
1878
+ await Promise.all(l.values()), await Promise.all(Array.from(p.entries(), async ([d, { code: m }]) => await U(n + d, m)));
1855
1879
  }
1856
- const Hr = /(?<=;var [a-zA-Z$_]=[a-zA-Z$_]\()[a-zA-Z$_](?=,\{")/u;
1857
- function qr(e, t) {
1880
+ const qr = /(?<=;var [a-zA-Z$_]=[a-zA-Z$_]\()[a-zA-Z$_](?=,\{")/u;
1881
+ function Vr(e, t) {
1858
1882
  let i = [
1859
1883
  "window.$arcgis",
1860
1884
  "||",
@@ -1866,11 +1890,11 @@ function qr(e, t) {
1866
1890
  const r = [];
1867
1891
  for (const n of t) {
1868
1892
  if (n.in.includes("*")) {
1869
- E.warn(B, `$arcgis.import does not support wildcard imports, so ${n.in} will be ignored.`);
1893
+ E.warn(R, `$arcgis.import does not support wildcard imports, so ${n.in} will be ignored.`);
1870
1894
  continue;
1871
1895
  }
1872
1896
  if (n.out.startsWith(".") || n.out.startsWith("/"))
1873
- throw Error(b(B, `CDN entrypoint path must not start with '.' or '/'. Found: ${n.out}`));
1897
+ throw Error(b(R, `CDN entrypoint path must not start with '.' or '/'. Found: ${n.out}`));
1874
1898
  r.push(n.out);
1875
1899
  }
1876
1900
  i += `"${r.join(",")}".split(",").map(e=>i[p+e+j]=i[p+e]=import.meta.resolve("./"+e+j));`;
@@ -1890,80 +1914,81 @@ function qr(e, t) {
1890
1914
  // minified to a variable name that is already used inside the closure).
1891
1915
  `)($arcgis,${e}`
1892
1916
  ].join(""), s) {
1893
- const n = D().name;
1917
+ const n = O().name;
1894
1918
  i += `,"${n}/",".js"`;
1895
1919
  }
1896
1920
  return i += ")", i;
1897
1921
  }
1898
- function $i(e, t) {
1922
+ function Pi(e, t) {
1899
1923
  if (e.isProcessing) {
1900
- e.isAsync = !0, Et(e);
1924
+ e.isAsync = !0, Ct(e);
1901
1925
  return;
1902
1926
  }
1903
1927
  e.isProcessing = !0;
1904
1928
  const i = [], s = [], r = [], n = /* @__PURE__ */ new Set(), a = [];
1905
1929
  let c = 0;
1906
- const p = e.code.matchAll(zr);
1930
+ const p = e.code.matchAll(Gr);
1907
1931
  for (const w of p) {
1908
- const [L, A, H, j, N] = w, K = N.startsWith(Ie);
1932
+ const [L, A, z, j, N] = w, K = N.startsWith(Ie);
1909
1933
  if (c !== 0 && c !== w.index) {
1910
- const R = e.code.slice(c, w.index);
1911
- r.push(R), a.push([c, R.length, 0, ""]);
1934
+ const D = e.code.slice(c, w.index);
1935
+ r.push(D), a.push([c, D.length, 0, ""]);
1912
1936
  }
1913
1937
  if (c = w.index + L.length, K)
1914
- a.push([w.index, L.length, 0, ""]), s.push(`"${Ii(N.slice(Ie.length))}"`), i.push(A?.replaceAll(" as ", ":") ?? H ?? j ?? "");
1938
+ a.push([w.index, L.length, 0, ""]), s.push(`"${xi(N.slice(Ie.length))}"`), i.push(A?.replaceAll(" as ", ":") ?? z ?? j ?? "");
1915
1939
  else {
1916
- const R = Pi(N, t), O = R?.isAsync === !0;
1940
+ const D = ki(N, t), M = D?.isAsync === !0;
1917
1941
  if (A !== void 0) {
1918
1942
  const ye = [];
1919
1943
  for (const Fe of A.slice(1, -1).split(",")) {
1920
- const [mt, ft = mt] = Fe.split(" as ");
1921
- O || n.add(ft), ye.push(`${mt}:${ft}`);
1944
+ const [ut, ft = ut] = Fe.split(" as ");
1945
+ M || n.add(ft), ye.push(`${ut}:${ft}`);
1922
1946
  }
1923
- if (O) {
1924
- const Fe = R.oldSingleExportName === void 0 ? `{${ye.join(",")}}` : ye[0].split(":")[1];
1947
+ if (M) {
1948
+ const Fe = D.oldSingleExportName === void 0 ? `{${ye.join(",")}}` : ye[0].split(":")[1];
1925
1949
  a.push([w.index + 6, 0, A.length, Fe]);
1926
1950
  }
1927
- } else if (H === void 0 && j === void 0)
1928
- O && a.push([w.index + 6, 0, 0, ""]);
1951
+ } else if (z === void 0 && j === void 0)
1952
+ M && a.push([w.index + 6, 0, 0, ""]);
1929
1953
  else {
1930
- if (O)
1954
+ if (M)
1931
1955
  throw Error(
1932
1956
  b(
1933
- B,
1957
+ R,
1934
1958
  `Expected local import specifiers to use only named or side-effect import syntax. Found ${L} in a chunk:
1935
- ${R.code}`
1959
+ ${D.code}`
1936
1960
  )
1937
1961
  );
1938
- n.add(j ?? H);
1962
+ n.add(j ?? z);
1939
1963
  }
1940
1964
  }
1941
1965
  }
1942
1966
  e.isProcessing = !1;
1943
1967
  const l = e.isAsync === !0;
1944
1968
  if (e.isAsync = l || a.length > 0, !e.isAsync) {
1945
- e.code = Ct(e.code, t);
1969
+ e.code = Tt(e.code, t);
1946
1970
  return;
1947
1971
  }
1948
- const d = Xr(n);
1949
- let f = e.code.slice(0, c);
1972
+ const d = Qr(n);
1973
+ let m = e.code.slice(0, c);
1950
1974
  for (let w = a.length - 1; w >= 0; w--) {
1951
- const [L, A, H, j] = a[w];
1975
+ const [L, A, z, j] = a[w];
1952
1976
  let N = A, K = "";
1953
1977
  if (A === 0) {
1954
- const O = d();
1955
- s.push(O), K = ` ${O} from`, j !== "" ? (N = H + 4, i.push(j)) : i.push("");
1978
+ const M = d();
1979
+ s.push(M), K = ` ${M} from`, j !== "" ? (N = z + 4, i.push(j)) : i.push("");
1956
1980
  }
1957
- f = f.slice(0, L) + K + f.slice(L + N);
1981
+ m = m.slice(0, L) + K + m.slice(L + N);
1958
1982
  }
1959
- const [m, g] = Et(e), h = i.findLastIndex((w) => w.length > 0), y = i.slice(0, h + 1).join(","), C = `export default $arcgis.t(${i.length === 0 ? "_" : `([${y}])`}=>{`, S = s.join(","), k = `${g}},${S})`;
1960
- let T = e.code.slice(c, m);
1961
- T = `${r.join("")}${T}`, T = Ct(T, t);
1962
- const x = `${f}${C}${T}${k}`;
1983
+ const [f, g] = Ct(e), h = i.findLastIndex((w) => w.length > 0), y = i.slice(0, h + 1).join(","), v = i.length === 0 ? "_" : `([${y}])`, C = `${Ii}${v}=>{`, S = s.join(","), k = `${g}},${S})`;
1984
+ let T = e.code.slice(c, f);
1985
+ T = `${r.join("")}${T}`, T = Tt(T, t);
1986
+ const x = `${m}${C}${T}${k}`;
1963
1987
  e.code = x;
1964
1988
  }
1965
- function Et(e) {
1966
- const t = Vr.exec(e.code), i = t?.index ?? e.code.length;
1989
+ const Ii = "export default $arcgis.t(";
1990
+ function Ct(e) {
1991
+ const t = Xr.exec(e.code), i = t?.index ?? e.code.length;
1967
1992
  let s = "";
1968
1993
  if (t !== null) {
1969
1994
  const r = t[1].split(",");
@@ -1979,51 +2004,51 @@ function Et(e) {
1979
2004
  }
1980
2005
  return [i, s];
1981
2006
  }
1982
- const zr = /import(?:(\{[^}]+\})from|\*as ([\w$]+) from| ([\w$]+) from)?"([^"]+)";/gu, Vr = /export\{([^}]+)\};\n$/u, Ie = "@arcgis/core/";
1983
- function Pi(e, t) {
2007
+ const Gr = /import(?:(\{[^}]+\})from|\*as ([\w$]+) from| ([\w$]+) from)?"([^"]+)";/gu, Xr = /export\{([^}]+)\};\n$/u, Ie = "@arcgis/core/";
2008
+ function ki(e, t) {
1984
2009
  if (!e.startsWith("./"))
1985
2010
  return;
1986
2011
  const i = e.slice(2), s = t.get(i);
1987
2012
  if (s === void 0)
1988
- throw Error(b(B, `Failed to find the ${e} module`));
1989
- if (s.isAsync === void 0 && $i(s, t), s.isAsync === void 0)
1990
- throw Error(b(B, `Failed to infer whether the ${e} module has top-level await`));
2013
+ throw Error(b(R, `Failed to find the ${e} module`));
2014
+ if (s.isAsync === void 0 && Pi(s, t), s.isAsync === void 0)
2015
+ throw Error(b(R, `Failed to infer whether the ${e} module has top-level await`));
1991
2016
  return s;
1992
2017
  }
1993
- function Ct(e, t) {
1994
- return e.replaceAll(Gr, (i, s) => {
2018
+ function Tt(e, t) {
2019
+ return e.replaceAll(Yr, (i, s) => {
1995
2020
  if (s.startsWith(Ie))
1996
- return `$arcgis.t(m=>m[0],"${Ii(s.slice(Ie.length))}")`;
2021
+ return `$arcgis.t(m=>m[0],"${xi(s.slice(Ie.length))}")`;
1997
2022
  if (s.startsWith("./")) {
1998
- const r = Pi(s, t);
2023
+ const r = ki(s, t);
1999
2024
  if (r?.isAsync === !0)
2000
2025
  return `${i}.then(m=>m.default${r.oldSingleExportName === void 0 ? "" : `.then(e=>({${r.oldSingleExportName}:e}))`})`;
2001
2026
  }
2002
2027
  return i;
2003
2028
  });
2004
2029
  }
2005
- const Gr = /(?<![.\w\d])import\("([^"]+)"\)/gu, Ii = (e) => e.endsWith(".js") ? e.slice(0, -3) : e;
2006
- function Xr(e) {
2030
+ const Yr = /(?<![.\w\d])import\("([^"]+)"\)/gu, xi = (e) => e.endsWith(".js") ? e.slice(0, -3) : e;
2031
+ function Qr(e) {
2007
2032
  const t = [Ye];
2008
2033
  return () => {
2009
2034
  for (; ; ) {
2010
- const i = Zr(t);
2011
- if (en(t), !e.has(i))
2035
+ const i = tn(t);
2036
+ if (sn(t), !e.has(i))
2012
2037
  return e.add(i), i;
2013
2038
  }
2014
2039
  };
2015
2040
  }
2016
- const Ye = 0, at = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ$_", ki = `${at}0123456789`, Yr = at.length, Qr = ki.length;
2017
- function Zr(e) {
2041
+ const Ye = 0, at = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ$_", Ai = `${at}0123456789`, Zr = at.length, en = Ai.length;
2042
+ function tn(e) {
2018
2043
  let t = at[e[0]];
2019
2044
  for (let i = 1; i < e.length; ++i)
2020
- t += ki[e[i]];
2045
+ t += Ai[e[i]];
2021
2046
  return t;
2022
2047
  }
2023
- function en(e) {
2048
+ function sn(e) {
2024
2049
  let t = e.length - 1;
2025
2050
  for (; t >= 0; ) {
2026
- const i = t === 0 ? Yr : Qr;
2051
+ const i = t === 0 ? Zr : en;
2027
2052
  if (e[t] += 1, e[t] >= i)
2028
2053
  e[t] = Ye, t--;
2029
2054
  else
@@ -2031,11 +2056,11 @@ function en(e) {
2031
2056
  }
2032
2057
  e.push(Ye);
2033
2058
  }
2034
- function Ne(e = D(), t = !1) {
2059
+ function Ne(e = O(), t = !1) {
2035
2060
  const i = e.version.includes("next"), s = e.name === "@esri/calcite-components";
2036
2061
  if (s && i)
2037
2062
  return `https://cdn.jsdelivr.net/npm/@esri/calcite-components@${e.version}/dist/${ne}/`;
2038
- const r = t || i ? "jsdev.arcgis.com" : "js.arcgis.com", n = tn(e.name), a = sn(e.version);
2063
+ const r = t || i ? "jsdev.arcgis.com" : "js.arcgis.com", n = rn(e.name), a = nn(e.version);
2039
2064
  if (a === void 0)
2040
2065
  throw Error(
2041
2066
  b(
@@ -2045,25 +2070,25 @@ function Ne(e = D(), t = !1) {
2045
2070
  );
2046
2071
  return n.length === 0 ? `https://${r}/${a}/` : s ? `https://${r}/${n}/${a}/` : `https://${r}/${a}/${n}/`;
2047
2072
  }
2048
- const tn = (e) => e.split("/").pop() ?? e;
2049
- function sn(e) {
2073
+ const rn = (e) => e.split("/").pop() ?? e;
2074
+ function nn(e) {
2050
2075
  const t = /^(?<major>\d+)\.(?<minor>\d+)\.(?<patch>\d+)(?<prerelease>-.*)?$/u, i = e.match(t);
2051
2076
  if (i?.groups === void 0)
2052
2077
  return;
2053
2078
  const { major: s, minor: r, patch: n, prerelease: a } = i.groups, c = `${s}.${r}.${n}`;
2054
2079
  return a?.startsWith("-next") ? `${c}-next` : c;
2055
2080
  }
2056
- async function rn(e, t, i, s, r) {
2057
- const n = t.packageName, { hasCss: a, cdnName: c } = await xi(t.packageLocation) ?? {};
2081
+ async function on(e, t, i, s, r) {
2082
+ const n = t.packageName, { hasCss: a, cdnName: c } = await Ni(t.packageLocation) ?? {};
2058
2083
  if (i === "cdn") {
2059
- const f = t.cdnUrl ?? Ne(t.packageJson, r);
2084
+ const m = t.cdnUrl ?? Ne(t.packageJson, r);
2060
2085
  return [
2061
2086
  ...a ? [
2062
2087
  {
2063
2088
  tag: "link",
2064
2089
  attrs: {
2065
2090
  rel: "stylesheet",
2066
- src: `${f}${c}.css`
2091
+ src: `${m}${c}.css`
2067
2092
  }
2068
2093
  }
2069
2094
  ] : [],
@@ -2071,12 +2096,12 @@ async function rn(e, t, i, s, r) {
2071
2096
  tag: "script",
2072
2097
  attrs: {
2073
2098
  type: "module",
2074
- src: `${f}${c}.esm.js`
2099
+ src: `${m}${c}.esm.js`
2075
2100
  }
2076
2101
  }
2077
2102
  ];
2078
2103
  }
2079
- const p = `${n}/dist/${c}/${c}.css${X}`, l = a ? [
2104
+ const p = `${n}/dist/${c}/${c}.css${Y}`, l = a ? [
2080
2105
  `import styles$${s} from "${p}";`,
2081
2106
  `document.adoptedStyleSheets = [...document.adoptedStyleSheets, styles$${s}.styleSheet];`
2082
2107
  ] : [], d = `${n}/dist/esm/loader.js`;
@@ -2097,18 +2122,18 @@ async function rn(e, t, i, s, r) {
2097
2122
  }
2098
2123
  ];
2099
2124
  }
2100
- async function xi(e) {
2125
+ async function Ni(e) {
2101
2126
  const t = u.join(e, "dist"), i = u.basename(e), r = (await tt(t)).filter(
2102
- (a) => !Ci.has(a) && !a.includes(".")
2127
+ (a) => !Ti.has(a) && !a.includes(".")
2103
2128
  ), n = r.find(
2104
2129
  (a) => a.startsWith("arcgis-") || // This is the case for template-components and field-apps-custom-elements
2105
2130
  a === i
2106
2131
  );
2107
2132
  return n === void 0 ? await Promise.all(
2108
- r.map(async (a) => await Tt(t, a))
2109
- ).then((a) => a.find(F)) : await Tt(t, n);
2133
+ r.map(async (a) => await $t(t, a))
2134
+ ).then((a) => a.find(F)) : await $t(t, n);
2110
2135
  }
2111
- async function Tt(e, t) {
2136
+ async function $t(e, t) {
2112
2137
  const i = u.join(e, t, `${t}.css`), s = u.join(e, t, "assets"), r = u.join(e, t, `${t}.esm.js`), [n, a, c] = await Promise.all([
2113
2138
  _(i),
2114
2139
  _(s),
@@ -2119,8 +2144,8 @@ async function Tt(e, t) {
2119
2144
  cdnName: t
2120
2145
  } : void 0;
2121
2146
  }
2122
- async function nn(e, t, i, s, r) {
2123
- const a = t.packageJson.exports?.[`./${Y}.css`] === void 0 ? await xi(t.packageLocation) : void 0, c = a?.cdnName ?? ne, p = a === void 0 ? `${Ti}.js` : `${a.cdnName}.esm.js`;
2147
+ async function an(e, t, i, s, r) {
2148
+ const a = t.packageJson.exports?.[`./${Q}.css`] === void 0 ? await Ni(t.packageLocation) : void 0, c = a?.cdnName ?? ne, p = a === void 0 ? `${$i}.js` : `${a.cdnName}.esm.js`;
2124
2149
  if (i === "cdn")
2125
2150
  return {
2126
2151
  tag: "script",
@@ -2129,50 +2154,50 @@ async function nn(e, t, i, s, r) {
2129
2154
  src: `${t.cdnUrl ?? Ne(t.packageJson, r)}${p}`
2130
2155
  }
2131
2156
  };
2132
- const l = on(t.packageJson), d = `${t.packageName}/${u.normalize(l)}${X}`, f = [
2157
+ const l = ln(t.packageJson), d = `${t.packageName}/${u.normalize(l)}${Y}`, m = [
2133
2158
  `import styles$${s} from "${d}";`,
2134
2159
  `document.adoptedStyleSheets = [...document.adoptedStyleSheets, styles$${s}.styleSheet];`
2135
- ], m = `${t.packageName}/loader`;
2160
+ ], f = `${t.packageName}/loader`;
2136
2161
  return {
2137
2162
  /*
2138
2163
  * Do not pre-bundle CSS bundle as dep-optimizer ESBuild instance
2139
2164
  * doesn't know how to load our CSS (without a plugin)
2140
2165
  */
2141
- optimizableImports: [m],
2166
+ optimizableImports: [f],
2142
2167
  javascriptCode: [
2143
- ...f,
2144
- `import { defineCustomElements as defineCustomElements$${s} } from "${m}";`,
2168
+ ...m,
2169
+ `import { defineCustomElements as defineCustomElements$${s} } from "${f}";`,
2145
2170
  `defineCustomElements$${s}({`,
2146
2171
  ` resourcesUrl: "${nt(e, t.packageLocation)}/dist/${c}/",`,
2147
2172
  "});"
2148
2173
  ]
2149
2174
  };
2150
2175
  }
2151
- function on(e) {
2176
+ function ln(e) {
2152
2177
  const { exports: t } = e;
2153
2178
  if (t === void 0)
2154
2179
  throw new Error(
2155
2180
  `Package "${e.name}" does not have an "exports" field. All Lumina packages must include an "exports" field.`
2156
2181
  );
2157
- const i = Object.entries(t).filter(([r]) => u.extname(r) === ".css"), s = i.find(([, r]) => r === `./${Y}.css`);
2158
- return s ? s[0] : i.length > 0 ? i[0][0] : `./${Y}.css`;
2182
+ const i = Object.entries(t).filter(([r]) => u.extname(r) === ".css"), s = i.find(([, r]) => r === `./${Q}.css`);
2183
+ return s ? s[0] : i.length > 0 ? i[0][0] : `./${Q}.css`;
2159
2184
  }
2160
2185
  async function pe(e) {
2161
- return e._loadersCache ??= an(e), await e._loadersCache;
2186
+ return e._loadersCache ??= cn(e), await e._loadersCache;
2162
2187
  }
2163
- async function an(e) {
2188
+ async function cn(e) {
2164
2189
  const t = e.viteCommand === "build" ? "cdn" : "lazyNpm", i = e.environment === "development", s = e.viteConfig.base;
2165
2190
  let r = 0;
2166
2191
  const n = async (l) => (await Promise.all(
2167
2192
  l.map(async (d) => {
2168
- const f = r++;
2169
- return d.type === "stencil" ? await rn(s, d, t, f, i) : d.type === "@arcgis/lumina" ? await nn(s, d, t, f, i) : void 0;
2193
+ const m = r++;
2194
+ return d.type === "stencil" ? await on(s, d, t, m, i) : d.type === "@arcgis/lumina" ? await an(s, d, t, m, i) : void 0;
2170
2195
  })
2171
2196
  )).filter(F).flat(), a = await Promise.all([
2172
2197
  // This may contain an import map so must be first
2173
- Rr(s, t, i),
2198
+ Or(s, t, i),
2174
2199
  ie.then(n),
2175
- Ai(e).then(n)
2200
+ Li(e).then(n)
2176
2201
  ]), c = u.join(e.dir.src, "loader.ts");
2177
2202
  return [
2178
2203
  ...a.flat(),
@@ -2191,11 +2216,11 @@ async function an(e) {
2191
2216
  }
2192
2217
  ];
2193
2218
  }
2194
- async function Ai(e) {
2219
+ async function Li(e) {
2195
2220
  const t = e.options?.serve?.extraDependencies ?? [];
2196
2221
  return t.length === 0 ? [] : (e._serveOnlyDependencies ??= Promise.all(
2197
2222
  t.map(async (i) => {
2198
- const s = typeof i == "string" ? void 0 : i, r = typeof i == "string" ? i : i.name, n = await wi(r);
2223
+ const s = typeof i == "string" ? void 0 : i, r = typeof i == "string" ? i : i.name, n = await Si(r);
2199
2224
  if (n === void 0)
2200
2225
  throw Error(
2201
2226
  b(
@@ -2210,8 +2235,8 @@ async function Ai(e) {
2210
2235
  })
2211
2236
  ).then((i) => i.filter(F)), await e._serveOnlyDependencies);
2212
2237
  }
2213
- const ln = "/@arcgis/lumina-compiler/testSetupFile", cn = /^\/@arcgis\/lumina-compiler\/testSetupFile/u, Je = [ln];
2214
- async function dn(e) {
2238
+ const dn = "/@arcgis/lumina-compiler/testSetupFile", pn = /^\/@arcgis\/lumina-compiler\/testSetupFile/u, Je = [dn];
2239
+ async function mn(e) {
2215
2240
  if (
2216
2241
  /**
2217
2242
  * Only import custom element dependencies if we are running in Vitest browser mode.
@@ -2223,7 +2248,7 @@ async function dn(e) {
2223
2248
  */
2224
2249
  !e.apiJsonEnabled
2225
2250
  )
2226
- return $t(e);
2251
+ return Pt(e);
2227
2252
  const i = (await pe(e)).map((s, r) => {
2228
2253
  if ("javascriptCode" in s)
2229
2254
  return s.javascriptCode.join(`
@@ -2234,7 +2259,7 @@ async function dn(e) {
2234
2259
  * The $index naming is already used by makeLoaders(), so we use the
2235
2260
  * $t prefix to avoid collisions.
2236
2261
  */
2237
- `import styles$t${r} from "${s.cssHref}${X}";`,
2262
+ `import styles$t${r} from "${s.cssHref}${Y}";`,
2238
2263
  `document.adoptedStyleSheets = [...document.adoptedStyleSheets, styles$t${r}.styleSheet];`
2239
2264
  ].join(`
2240
2265
  `);
@@ -2247,18 +2272,18 @@ async function dn(e) {
2247
2272
  }).join(`
2248
2273
 
2249
2274
  `);
2250
- return [$t(e), i].join("");
2275
+ return [Pt(e), i].join("");
2251
2276
  }
2252
- const $t = (e) => [e.isInPuppeteerTestBackEnd ? pn : "", un].join(""), pn = `import { setupPuppeteerTest } from "@arcgis/lumina-compiler/puppeteerTesting";
2277
+ const Pt = (e) => [e.isInPuppeteerTestBackEnd ? un : "", fn].join(""), un = `import { setupPuppeteerTest } from "@arcgis/lumina-compiler/puppeteerTesting";
2253
2278
  setupPuppeteerTest();
2254
- `, un = `import { setupLuminaTest } from "@arcgis/lumina-compiler/testing";
2279
+ `, fn = `import { setupLuminaTest } from "@arcgis/lumina-compiler/testing";
2255
2280
  setupLuminaTest();
2256
- `, mn = "@arcgis/lumina:generateLoaderTs";
2281
+ `, gn = "@arcgis/lumina:generateLoaderTs";
2257
2282
  let ke;
2258
- function fn(e) {
2283
+ function hn(e) {
2259
2284
  const t = /[\\\/]src[\\\/]loader\.ts$/u;
2260
- return [Is(e.apiExtractorPluginConfig), {
2261
- name: mn,
2285
+ return [xs(e.apiExtractorPluginConfig), {
2286
+ name: gn,
2262
2287
  configResolved() {
2263
2288
  ke = `${e.dir.root}src/loader.ts`;
2264
2289
  },
@@ -2273,7 +2298,7 @@ function fn(e) {
2273
2298
  id: t
2274
2299
  },
2275
2300
  async handler() {
2276
- return e.apiJsonDeferred !== void 0 && await e.apiJsonDeferred.promise, fr(e);
2301
+ return e.apiJsonDeferred !== void 0 && await e.apiJsonDeferred.promise, hr(e);
2277
2302
  }
2278
2303
  },
2279
2304
  async handleHotUpdate() {
@@ -2283,17 +2308,17 @@ function fn(e) {
2283
2308
  name: "@arcgis/lumina:generateTestSetupVirtualFile",
2284
2309
  load: {
2285
2310
  filter: {
2286
- id: cn
2311
+ id: pn
2287
2312
  },
2288
- handler: async () => await dn(e)
2313
+ handler: async () => await mn(e)
2289
2314
  }
2290
2315
  }];
2291
2316
  }
2292
- function Pt(e) {
2317
+ function It(e) {
2293
2318
  const t = e.server.moduleGraph.getModuleById(ke);
2294
2319
  t !== void 0 && e.server.moduleGraph.invalidateModule(t);
2295
2320
  }
2296
- const It = (e) => {
2321
+ const kt = (e) => {
2297
2322
  e.server.ws.send({
2298
2323
  type: "full-reload",
2299
2324
  path: u.join("/", u.relative(e.dir.root, ke))
@@ -2304,17 +2329,17 @@ function ce(e, t, i = lt) {
2304
2329
  throw Error(b(Qe, "serveAssets() is only available when Vite is running in serve mode"));
2305
2330
  const s = e._serverConfigured, r = e.server.middlewares.stack.length;
2306
2331
  if (t.forEach((n) => {
2307
- const a = Li(n), c = Fi(e.dir, ji(a)), p = hn(e.viteConfig.base, c, e.dir.distCdn);
2308
- e.server.middlewares.use(p, (l, d, f) => {
2309
- const m = yn(l.url), g = a.type === "directory" ? u.resolve(a.source, m.slice(1)) : a.source, h = u.join(c, m), y = i.find((v) => v.match(h, e));
2310
- return (typeof g == "function" ? Promise.resolve(g()) : q(g)).then((v) => {
2332
+ const a = Fi(n), c = Ri(e.dir, Di(a)), p = vn(e.viteConfig.base, c, e.dir.distCdn);
2333
+ e.server.middlewares.use(p, (l, d, m) => {
2334
+ const f = bn(l.url), g = a.type === "directory" ? u.resolve(a.source, f.slice(1)) : a.source, h = u.join(c, f), y = i.find((v) => v.match(h, e));
2335
+ return (typeof g == "function" ? Promise.resolve(g()) : H(g)).then((v) => {
2311
2336
  const C = (typeof g == "function" ? void 0 : y?.transform(v.toString("utf8"), h, e)) ?? v;
2312
- d.setHeader("Cache-Control", "max-age=31536000, immutable"), d.setHeader("Content-Type", ks.lookup(m) || "application/octet-stream"), d.write(C), d.end();
2337
+ d.setHeader("Cache-Control", "max-age=31536000, immutable"), d.setHeader("Content-Type", As.lookup(f) || "application/octet-stream"), d.write(C), d.end();
2313
2338
  }).catch((v) => {
2314
2339
  (a.type !== "directory" || process.env.DEBUG) && E.warn(
2315
2340
  Qe,
2316
- `Error occurred when trying to serve a file in response to request for "${l.originalUrl ?? m}":${String(v)}`
2317
- ), f();
2341
+ `Error occurred when trying to serve a file in response to request for "${l.originalUrl ?? f}":${String(v)}`
2342
+ ), m();
2318
2343
  }), !0;
2319
2344
  });
2320
2345
  }), s) {
@@ -2322,31 +2347,31 @@ function ce(e, t, i = lt) {
2322
2347
  e.server.middlewares.stack.splice(0, 0, ...n);
2323
2348
  }
2324
2349
  }
2325
- async function Ni(e, t, i = lt) {
2350
+ async function ji(e, t, i = lt) {
2326
2351
  await Promise.all(
2327
2352
  t.map(async (s) => {
2328
- const r = Li(s), n = Fi(e.dir, ji(r));
2353
+ const r = Fi(s), n = Ri(e.dir, Di(r));
2329
2354
  if (r.type === "directory") {
2330
2355
  const a = u.resolve(r.source), p = (await tt(a, { recursive: !0, withFileTypes: !0 })).filter((l) => l.isFile()).map((l) => {
2331
- const d = u.resolve(l.parentPath, l.name), f = u.relative(a, d), m = u.join(n, f);
2332
- return [d, m];
2356
+ const d = u.resolve(l.parentPath, l.name), m = u.relative(a, d), f = u.join(n, m);
2357
+ return [d, f];
2333
2358
  });
2334
- await Di(p.map(([l, d]) => d)), await Promise.all(
2359
+ await Mi(p.map(([l, d]) => d)), await Promise.all(
2335
2360
  p.map(
2336
- async ([l, d]) => await kt(l, d, i, e)
2361
+ async ([l, d]) => await xt(l, d, i, e)
2337
2362
  )
2338
2363
  );
2339
2364
  } else if (r.type === "file")
2340
- await Z(u.dirname(n), { recursive: !0 }), await kt(r.source, n, i, e);
2365
+ await G(u.dirname(n), { recursive: !0 }), await xt(r.source, n, i, e);
2341
2366
  else if (r.type === "dynamic") {
2342
- await Z(u.dirname(n), { recursive: !0 });
2367
+ await G(u.dirname(n), { recursive: !0 });
2343
2368
  const a = await Promise.resolve(r.source());
2344
2369
  await U(n, a);
2345
2370
  }
2346
2371
  })
2347
2372
  );
2348
2373
  }
2349
- const Li = Xt ? (e) => e : (e) => e.type === "dynamic" ? {
2374
+ const Fi = Yt ? (e) => e : (e) => e.type === "dynamic" ? {
2350
2375
  ...e,
2351
2376
  destination: be(e.destination)
2352
2377
  } : {
@@ -2354,16 +2379,16 @@ const Li = Xt ? (e) => e : (e) => e.type === "dynamic" ? {
2354
2379
  source: be(e.source),
2355
2380
  destination: be(e.destination)
2356
2381
  };
2357
- async function kt(e, t, i, s) {
2382
+ async function xt(e, t, i, s) {
2358
2383
  const r = i.find((n) => n.match(t, s));
2359
2384
  if (r === void 0)
2360
- await Ts(e, t);
2385
+ await Ps(e, t);
2361
2386
  else {
2362
- const n = await q(e, "utf8"), a = r.transform(n, t, s);
2387
+ const n = await H(e, "utf8"), a = r.transform(n, t, s);
2363
2388
  await U(t, a);
2364
2389
  }
2365
2390
  }
2366
- function ji(e) {
2391
+ function Di(e) {
2367
2392
  if (e.type === "dynamic")
2368
2393
  return e.destination;
2369
2394
  if (e.source.endsWith(u.sep)) {
@@ -2378,34 +2403,34 @@ function ji(e) {
2378
2403
  }
2379
2404
  return e.destination === "" ? u.basename(e.source) : e.destination.endsWith(u.sep) ? e.type === "directory" && e.destination === u.sep ? e.destination : u.join(e.destination, u.basename(e.source)) : e.destination;
2380
2405
  }
2381
- function Fi({ dist: e, distCdnAssets: t }, i) {
2382
- const s = gn(i), r = u.join(
2406
+ function Ri({ dist: e, distCdnAssets: t }, i) {
2407
+ const s = yn(i), r = u.join(
2383
2408
  t,
2384
2409
  s ? u.relative(t, i) : i
2385
- ), n = u.relative(e, r), a = Ri(n);
2410
+ ), n = u.relative(e, r), a = Oi(n);
2386
2411
  return u.join(e, a);
2387
2412
  }
2388
- function gn(e) {
2413
+ function yn(e) {
2389
2414
  if (e.startsWith(u.sep)) {
2390
- const t = Yt(), i = t.startsWith(u.sep) ? t.split(u.sep)[1] ?? "" : "";
2415
+ const t = Qt(), i = t.startsWith(u.sep) ? t.split(u.sep)[1] ?? "" : "";
2391
2416
  return e.startsWith(`/${i}/`) || e.startsWith("/Users/");
2392
2417
  } else
2393
- return !!(!Xt && u.isAbsolute(e));
2418
+ return !!(!Yt && u.isAbsolute(e));
2394
2419
  }
2395
- function hn(e, t, i) {
2396
- const s = Ri(u.relative(i, t)), r = s.startsWith("/") ? s.slice(1) : s;
2420
+ function vn(e, t, i) {
2421
+ const s = Oi(u.relative(i, t)), r = s.startsWith("/") ? s.slice(1) : s;
2397
2422
  return `${e}${r}`;
2398
2423
  }
2399
- const Ri = (e) => e.replaceAll("../", ""), yn = (e = "") => e.split("?")[0].split("#")[0];
2400
- async function Di(e) {
2424
+ const Oi = (e) => e.replaceAll("../", ""), bn = (e = "") => e.split("?")[0].split("#")[0];
2425
+ async function Mi(e) {
2401
2426
  const t = new Set(e.map(u.dirname));
2402
- await Promise.all(Array.from(t, async (i) => await Z(i, { recursive: !0 })));
2427
+ await Promise.all(Array.from(t, async (i) => await G(i, { recursive: !0 })));
2403
2428
  }
2404
- const vn = {
2429
+ const wn = {
2405
2430
  match: (e, t) => t.environment === "production" && e.endsWith(".json"),
2406
2431
  transform: (e) => JSON.stringify(JSON.parse(e))
2407
- }, lt = [vn];
2408
- function bn(e) {
2432
+ }, lt = [wn];
2433
+ function Sn(e) {
2409
2434
  let t;
2410
2435
  const i = () => [
2411
2436
  ...e.options.assets?.transformers ?? [],
@@ -2428,38 +2453,38 @@ function bn(e) {
2428
2453
  * `configureServer`.
2429
2454
  */
2430
2455
  configResolved() {
2431
- e.viteCommand === "serve" && (t = xt(e));
2456
+ e.viteCommand === "serve" && (t = At(e));
2432
2457
  },
2433
2458
  options() {
2434
- e.viteCommand === "build" && (t = xt(e));
2459
+ e.viteCommand === "build" && (t = At(e));
2435
2460
  },
2436
2461
  async configureServer(s) {
2437
2462
  e.server = s, ce(e, await t, i()), s.watcher.on("addDir", (r) => {
2438
2463
  if (r.endsWith("assets")) {
2439
2464
  const n = u.dirname(r);
2440
- u.join(n, "/") === e.dir.root ? ce(e, [Mi], i()) : r.startsWith(e.dir.srcComponents) && ce(e, [Oi(r, n)], i());
2465
+ u.join(n, "/") === e.dir.root ? ce(e, [Bi], i()) : r.startsWith(e.dir.srcComponents) && ce(e, [Ji(r, n)], i());
2441
2466
  }
2442
2467
  });
2443
2468
  },
2444
2469
  async writeBundle() {
2445
- await Ni(e, await t, i());
2470
+ await ji(e, await t, i());
2446
2471
  }
2447
2472
  };
2448
2473
  }
2449
- async function xt(e) {
2474
+ async function At(e) {
2450
2475
  const t = _("assets"), i = await e.componentFilesPromise, s = await Promise.all(
2451
2476
  i.map(async (r) => {
2452
2477
  const n = u.dirname(r), a = u.join(n, "assets");
2453
- return await _(a) ? Oi(a, n) : void 0;
2478
+ return await _(a) ? Ji(a, n) : void 0;
2454
2479
  })
2455
2480
  );
2456
- return await t && s.push(Mi), s.filter(F);
2481
+ return await t && s.push(Bi), s.filter(F);
2457
2482
  }
2458
- const Oi = (e, t) => ({
2483
+ const Ji = (e, t) => ({
2459
2484
  type: "directory",
2460
2485
  source: e,
2461
2486
  destination: u.basename(t)
2462
- }), Mi = { type: "directory", source: "assets/", destination: "" }, Be = "@arcgis/lumina:printTotalBuildSize", wn = (e) => ({
2487
+ }), Bi = { type: "directory", source: "assets/", destination: "" }, Be = "@arcgis/lumina:printTotalBuildSize", En = (e) => ({
2463
2488
  name: Be,
2464
2489
  apply: () => e.viteCommand === "build",
2465
2490
  configResolved(t) {
@@ -2475,13 +2500,13 @@ const Oi = (e, t) => ({
2475
2500
  throw Error(b(Be, "Expected vite:reporter to declare a writeBundle() function"));
2476
2501
  i.writeBundle = async function(n, a) {
2477
2502
  let c = 0, p = 0, l = 0, d = 0;
2478
- const f = console.log;
2503
+ const m = console.log;
2479
2504
  console.log = function(...g) {
2480
- if (f.apply(console, g), g.length === 1 && typeof g[0] == "string") {
2481
- const [h, y] = g[0].match(En) ?? [];
2505
+ if (m.apply(console, g), g.length === 1 && typeof g[0] == "string") {
2506
+ const [h, y] = g[0].match(Tn) ?? [];
2482
2507
  if (!h)
2483
2508
  return;
2484
- d || (d = g[0].slice(0, g[0].indexOf(h) + h.length).replaceAll(Cn, "").length);
2509
+ d || (d = g[0].slice(0, g[0].indexOf(h) + h.length).replaceAll($n, "").length);
2485
2510
  const v = Number.parseFloat(h.replace(" kB", "").replaceAll(",", ""));
2486
2511
  y ? (l += Number.parseFloat(y.replace(" kB", "").replaceAll(",", "")), p += v) : c += v;
2487
2512
  }
@@ -2489,37 +2514,37 @@ const Oi = (e, t) => ({
2489
2514
  try {
2490
2515
  await s.call(this, n, a);
2491
2516
  } finally {
2492
- console.log = f;
2517
+ console.log = m;
2493
2518
  }
2494
2519
  if (p > 0) {
2495
- const g = l > 0 ? p : c, h = Lt(g), y = e.dir.relativeDist;
2520
+ const g = l > 0 ? p : c, h = jt(g), y = e.dir.relativeDist;
2496
2521
  console.log(
2497
2522
  [
2498
- Nt,
2523
+ Lt,
2499
2524
  y,
2500
- Sn,
2525
+ Cn,
2501
2526
  "*",
2502
2527
  " ".repeat(d - `${y}*`.length - h.length),
2503
2528
  h,
2504
- At,
2505
- l > 0 ? ` ${Nt}│ gzip: ${Lt(l)}${At}` : ""
2529
+ Nt,
2530
+ l > 0 ? ` ${Lt}│ gzip: ${jt(l)}${Nt}` : ""
2506
2531
  ].join("")
2507
2532
  );
2508
2533
  }
2509
2534
  };
2510
2535
  }
2511
- }), At = "\x1B[22m\x1B[1m\x1B[22m", Nt = "\x1B[2m", Sn = "\x1B[22m\x1B[36m", En = /\d+(?:,\d+)?\.\d{2} kB/gu, Cn = /\x1B\[\d+m/gu, Tn = new Intl.NumberFormat("en", {
2536
+ }), Nt = "\x1B[22m\x1B[1m\x1B[22m", Lt = "\x1B[2m", Cn = "\x1B[22m\x1B[36m", Tn = /\d+(?:,\d+)?\.\d{2} kB/gu, $n = /\x1B\[\d+m/gu, Pn = new Intl.NumberFormat("en", {
2512
2537
  maximumFractionDigits: 2,
2513
2538
  minimumFractionDigits: 2
2514
- }), Lt = (e) => `${Tn.format(e)} kB`, $n = (e, t = u.resolve("src")) => u.relative(t, u.join(e, "..", ot.slice(0, -3))), jt = "@arcgis/lumina:configureVite", Pn = (e) => ({
2515
- name: jt,
2539
+ }), jt = (e) => `${Pn.format(e)} kB`, In = (e, t = u.resolve("src")) => u.relative(t, u.join(e, "..", ot.slice(0, -3))), Ft = "@arcgis/lumina:configureVite", kn = (e) => ({
2540
+ name: Ft,
2516
2541
  async config({
2517
2542
  server: t,
2518
2543
  publicDir: i,
2519
2544
  build: { cssMinify: s, target: r, sourcemap: n, lib: a, rollupOptions: { output: c = [] } = {}, watch: p, emptyOutDir: l } = {},
2520
2545
  test: d = {}
2521
2546
  }) {
2522
- const f = p != null, { include: m, browser: g, environment: h, forceRerunTriggers: y } = d, v = {
2547
+ const m = p != null, { include: f, browser: g, environment: h, forceRerunTriggers: y } = d, v = {
2523
2548
  // Public utilities exposed by the package
2524
2549
  index: "src/index.ts",
2525
2550
  /**
@@ -2573,7 +2598,7 @@ const Oi = (e, t) => ({
2573
2598
  include: [
2574
2599
  // Used by controllers. Need to add manually because @arcgis/lumina is
2575
2600
  // excluded per comment below, so Vite will discover these usages too late.
2576
- ...me ? ["@arcgis/core/applications/Components/reactiveUtils.js", "@arcgis/core/core/reactiveUtils.js"] : []
2601
+ ...ue ? ["@arcgis/core/applications/Components/reactiveUtils.js", "@arcgis/core/core/reactiveUtils.js"] : []
2577
2602
  ],
2578
2603
  /**
2579
2604
  * Workaround for https://github.com/vitejs/vite/issues/18947. Affects all
@@ -2620,7 +2645,7 @@ const Oi = (e, t) => ({
2620
2645
  if (typeof d.setupFiles == "string" ? d.setupFiles = [...Je, d.setupFiles] : Array.isArray(d.setupFiles) ? d.setupFiles = [...Je, ...d.setupFiles] : d.setupFiles = [...Je], e.isInPuppeteerTestBackEnd) {
2621
2646
  if (g?.enabled === !0)
2622
2647
  throw Error(
2623
- b(jt, "Can't enable both Vitest browser mode and Puppeteer testing at the same time")
2648
+ b(Ft, "Can't enable both Vitest browser mode and Puppeteer testing at the same time")
2624
2649
  );
2625
2650
  return {
2626
2651
  test: {
@@ -2629,7 +2654,7 @@ const Oi = (e, t) => ({
2629
2654
  globalSetup: ["@arcgis/lumina-compiler/puppeteerTesting/globalSetup"],
2630
2655
  runner: "@arcgis/lumina-compiler/puppeteerTesting/runner",
2631
2656
  // Run all test files that include *.e2e.* in the name.
2632
- include: m ? void 0 : ["**/*.{e2e,spec}.?(c|m)[jt]s?(x)"],
2657
+ include: f ? void 0 : ["**/*.{e2e,spec}.?(c|m)[jt]s?(x)"],
2633
2658
  /**
2634
2659
  * Using happy-dom because:
2635
2660
  * - faster than js-dom
@@ -2654,7 +2679,7 @@ const Oi = (e, t) => ({
2654
2679
  publicDir: i ?? !1,
2655
2680
  build: {
2656
2681
  cssMinify: s ?? (e.environment === "production" ? !0 : void 0),
2657
- target: r ?? Ei(e),
2682
+ target: r ?? Ci(e),
2658
2683
  sourcemap: n ?? (e.environment === "development" ? "inline" : e.options.build?.enableSourceMapsInProduction ?? !1),
2659
2684
  lib: {
2660
2685
  entry: v,
@@ -2684,7 +2709,7 @@ const Oi = (e, t) => ({
2684
2709
  * - in API Extractor we can avoid writing unchanged files to disk if
2685
2710
  * the out dir is not emptied between watch rebuilds.
2686
2711
  */
2687
- emptyOutDir: l ?? !f
2712
+ emptyOutDir: l ?? !m
2688
2713
  },
2689
2714
  optimizeDeps: x,
2690
2715
  define: k,
@@ -2693,7 +2718,7 @@ const Oi = (e, t) => ({
2693
2718
  * If in browser, run all test files that include *.e2e.* in the name.
2694
2719
  * Otherwise, run all files including *.test.* or *.spec.* in the name.
2695
2720
  */
2696
- include: m ? void 0 : [g?.enabled ?? !0 ? "**/*.e2e.?(c|m)[jt]s?(x)" : "**/*.{test,spec}.?(c|m)[jt]s?(x)"],
2721
+ include: f ? void 0 : [g?.enabled ?? !0 ? "**/*.e2e.?(c|m)[jt]s?(x)" : "**/*.{test,spec}.?(c|m)[jt]s?(x)"],
2697
2722
  browser: {
2698
2723
  enabled: e.isInPuppeteerTestFrontEnd ? !1 : g?.enabled ?? !0,
2699
2724
  instances: g?.instances === void 0 ? [{ browser: "chromium" }] : void 0
@@ -2719,22 +2744,22 @@ const Oi = (e, t) => ({
2719
2744
  e._originalRollupInputOptions ??= t.input;
2720
2745
  const s = { ...e._originalRollupInputOptions };
2721
2746
  i.forEach((r) => {
2722
- const n = $n(r);
2747
+ const n = In(r);
2723
2748
  s[n] = r;
2724
2749
  }), t.input = s;
2725
2750
  }
2726
- }), In = (e) => ({
2751
+ }), xn = (e) => ({
2727
2752
  name: "@arcgis/lumina:setAssetPath",
2728
2753
  apply: () => e.viteCommand === "build",
2729
2754
  config: (t) => ({
2730
2755
  base: t.base ?? e.options.assets?.defaultPath ?? Ne()
2731
2756
  })
2732
2757
  });
2733
- function kn(e = D()) {
2758
+ function An(e = O()) {
2734
2759
  const t = e.version ?? "0.0.1";
2735
- return ls(t);
2760
+ return ds(t);
2736
2761
  }
2737
- const xn = (e) => `/* ${e} */`, P = (e) => (t, i) => {
2762
+ const Nn = (e) => `/* ${e} */`, P = (e) => (t, i) => {
2738
2763
  Object.defineProperty(t, i, {
2739
2764
  get() {
2740
2765
  throw Error(
@@ -2773,8 +2798,8 @@ const le = {
2773
2798
  apiJson: "docs/api.json",
2774
2799
  stencilLikeDocsJson: "docs/docs.json"
2775
2800
  }, Ze = (e) => e.viteConfig.root.includes("/test-packages/") ? 2 : void 0;
2776
- async function Ji(e, t, i, s, r = D()) {
2777
- const n = An(e, i, r), a = u.join(t, "lumina.ts"), p = await _(a) ? await q(a, "utf8") : "";
2801
+ async function Ki(e, t, i, s, r = O()) {
2802
+ const n = Ln(e, i, r), a = u.join(t, "lumina.ts"), p = await _(a) ? await H(a, "utf8") : "";
2778
2803
  if (p.trim().replaceAll(`\r
2779
2804
  `, `
2780
2805
  `) === n.trim())
@@ -2792,9 +2817,9 @@ Current content:
2792
2817
  ${p}`
2793
2818
  )
2794
2819
  );
2795
- return Zt(a, n), !0;
2820
+ return ei(a, n), !0;
2796
2821
  }
2797
- function An(e, t, i = D()) {
2822
+ function Ln(e, t, i = O()) {
2798
2823
  const s = e.filter((l) => l.type === "@arcgis/lumina").map((l) => `
2799
2824
  /// <reference types="${l.packageName}/types/lumina" />`), r = e.filter((l) => l.type === "stencil"), n = r.map(
2800
2825
  (l, d) => `
@@ -2805,8 +2830,8 @@ declare module "@arcgis/lumina" {
2805
2830
  interface ImportStencilElements extends ${r.map((l, d) => `JSX$${d}.IntrinsicElements`).join(", ")} {}
2806
2831
  }`, c = i.devDependencies ?? {};
2807
2832
  return [
2808
- Nn,
2809
- t ? Ln : "",
2833
+ jn,
2834
+ t ? Fn : "",
2810
2835
  c.vitest ? `
2811
2836
  /// <reference types="vitest/config" />
2812
2837
  /// <reference types="vitest/browser" />` : "",
@@ -2817,7 +2842,7 @@ declare module "@arcgis/lumina" {
2817
2842
  `
2818
2843
  ].join("");
2819
2844
  }
2820
- const Nn = `/**
2845
+ const jn = `/**
2821
2846
  * This file is autogenerated by \`@arcgis/lumina-compiler\` - do not edit it manually.
2822
2847
  * Manual edits will be overwritten.
2823
2848
  *
@@ -2826,8 +2851,8 @@ const Nn = `/**
2826
2851
  *
2827
2852
  * If you need to provide additional typings, create a separate file.
2828
2853
  */
2829
- /// <reference types="@arcgis/lumina/typings" />`, Ln = `
2830
- /// <reference types="@arcgis/core/interfaces" />`, we = "@arcgis/lumina:dependencySupport", Bi = (e, t) => e.viteCommand === "serve" && /**
2854
+ /// <reference types="@arcgis/lumina/typings" />`, Fn = `
2855
+ /// <reference types="@arcgis/core/interfaces" />`, we = "@arcgis/lumina:dependencySupport", _i = (e, t) => e.viteCommand === "serve" && /**
2831
2856
  * Vitest started calling transformIndexHtml in browser mode versions ^2.1.4
2832
2857
  * However, it is a bit buggy (see
2833
2858
  * https://github.com/vitejs/vite/issues/19213). Instead, we are using test
@@ -2838,10 +2863,10 @@ const Nn = `/**
2838
2863
  * is doing:
2839
2864
  * https://github.com/storybookjs/storybook/blob/a5c2cf1712f70b4e3ecf38d3c98e7db8e8d67849/code/builders/builder-vite/src/plugins/code-generator-plugin.ts#L110
2840
2865
  */
2841
- e.isInStorybook && (t === void 0 || t.path === "/iframe.html") || e.viteCommand === "build" && !e.options.build?.cdn?.skip && e.options.build?.webApp?.destination !== void 0, jn = (e) => ({
2866
+ e.isInStorybook && (t === void 0 || t.path === "/iframe.html") || e.viteCommand === "build" && !e.options.build?.cdn?.skip && e.options.build?.webApp?.destination !== void 0, Dn = (e) => ({
2842
2867
  name: we,
2843
2868
  configResolved() {
2844
- !e.isInTest && !e.isInStorybook && (e._updateLuminaTsPromise = Fn(e).catch(
2869
+ !e.isInTest && !e.isInStorybook && (e._updateLuminaTsPromise = Rn(e).catch(
2845
2870
  (t) => E.error(we, `Failed to update package's src/lumina.ts: ${String(t)}`)
2846
2871
  ));
2847
2872
  },
@@ -2849,7 +2874,7 @@ e.isInStorybook && (t === void 0 || t.path === "/iframe.html") || e.viteCommand
2849
2874
  // Add imports to index.html before Vite starts resolving imports
2850
2875
  order: "pre",
2851
2876
  async handler(t, i) {
2852
- return Bi(e, i) ? (await pe(e)).map(
2877
+ return _i(e, i) ? (await pe(e)).map(
2853
2878
  (r) => "javascriptCode" in r ? {
2854
2879
  tag: "script",
2855
2880
  attrs: {
@@ -2891,27 +2916,27 @@ e.isInStorybook && (t === void 0 || t.path === "/iframe.html") || e.viteCommand
2891
2916
  await e._updateLuminaTsPromise;
2892
2917
  }
2893
2918
  });
2894
- async function Fn(e) {
2895
- const i = (await Promise.all([ie, Ai(e)])).flat();
2896
- if (!await Ji(i, e.dir.src, me))
2919
+ async function Rn(e) {
2920
+ const i = (await Promise.all([ie, Li(e)])).flat();
2921
+ if (!await Ki(i, e.dir.src, ue))
2897
2922
  return;
2898
2923
  let r = !1;
2899
2924
  function n() {
2900
- r || E.warn(we, Rn), r = !0;
2925
+ r || E.warn(we, On), r = !0;
2901
2926
  }
2902
2927
  process.on("exit", () => {
2903
2928
  n(), clearTimeout(c);
2904
2929
  });
2905
2930
  const c = setTimeout(n, 2e3);
2906
2931
  }
2907
- const Rn = xs.greenBright(
2932
+ const On = Ns.greenBright(
2908
2933
  `lumina.ts has been updated (potentially because your dependencies changed). Please commit the updated file.
2909
2934
  If build failed with TypeScript errors, try running the build again to check whether new lumina.ts resolves the errors.`
2910
- ), Dn = { node: "^24.11" }, V = {
2911
- engines: Dn
2935
+ ), Mn = { node: "^24.11" }, V = {
2936
+ engines: Mn
2912
2937
  };
2913
- async function On(e) {
2914
- const t = e.options.apiExtractor?.configFilePath === "" ? void 0 : await Ns(process.cwd()), i = e.apiExtractorPluginConfig.unsafeConfigOverride === void 0 || t === void 0 ? t ?? e.apiExtractorPluginConfig.unsafeConfigOverride : vt(t, e.apiExtractorPluginConfig.unsafeConfigOverride);
2938
+ async function Jn(e) {
2939
+ const t = e.options.apiExtractor?.configFilePath === "" ? void 0 : await js(process.cwd()), i = e.apiExtractorPluginConfig.unsafeConfigOverride === void 0 || t === void 0 ? t ?? e.apiExtractorPluginConfig.unsafeConfigOverride : vt(t, e.apiExtractorPluginConfig.unsafeConfigOverride);
2915
2940
  e._documentationFileNames.apiJson = i?.context?.apiJsonEmitPath === void 0 ? e.options.documentation?.apiJsonFileName === !1 ? void 0 : e.options.documentation?.apiJsonFileName ? ae(e.options.documentation.apiJsonFileName) : le.apiJson : i.context.apiJsonEmitPath || void 0, e._documentationFileNames.apiJson !== void 0 && e.provideAssets([
2916
2941
  {
2917
2942
  type: "dynamic",
@@ -2919,7 +2944,7 @@ async function On(e) {
2919
2944
  destination: u.join("../..", e._documentationFileNames.apiJson)
2920
2945
  }
2921
2946
  ]);
2922
- const s = i?.types?.typeScriptConfig ?? Ls(
2947
+ const s = i?.types?.typeScriptConfig ?? Fs(
2923
2948
  process.cwd(),
2924
2949
  e.options.types?.tsconfigPath ?? i?.types?.typeScriptConfigPath,
2925
2950
  !0
@@ -2963,35 +2988,35 @@ async function On(e) {
2963
2988
  if (e.apiJsonDeferred.resolve(), e.apiJsonDeferred = void 0, d !== void 0) {
2964
2989
  if (e.viteCommand === "serve")
2965
2990
  if ([...d.addedModules, ...d.removedModules].some(
2966
- (m) => Ce(m.sourcePath, "src/components/")
2991
+ (f) => Ce(f.sourcePath, "src/components/")
2967
2992
  ))
2968
- Pt(e), It(e);
2993
+ It(e), kt(e);
2969
2994
  else {
2970
- for (const m of d.changedModules) {
2971
- if (!Ce(m.new.sourcePath, "src/components/"))
2995
+ for (const f of d.changedModules) {
2996
+ if (!Ce(f.new.sourcePath, "src/components/"))
2972
2997
  continue;
2973
- const g = m.old.declarations.find(
2998
+ const g = f.old.declarations.find(
2974
2999
  (v) => v.customElement === !0
2975
- ), h = m.new.declarations.find(
3000
+ ), h = f.new.declarations.find(
2976
3001
  (v) => v.customElement === !0
2977
3002
  );
2978
3003
  if (g === void 0 && h === void 0)
2979
3004
  continue;
2980
- if (g !== void 0 && h === void 0 || g === void 0 && h !== void 0 || g.tagName !== h.tagName) {
2981
- It(e);
3005
+ if (g !== void 0 && h === void 0 || g === void 0 && h !== void 0 || g.tagName !== h.tagName || g.formAssociated !== h.formAssociated) {
3006
+ kt(e);
2982
3007
  break;
2983
3008
  }
2984
- const y = hi(h);
3009
+ const y = yi(h);
2985
3010
  e.server.ws.send({ type: "custom", event: "component-meta-update", data: y });
2986
3011
  }
2987
- Pt(e);
3012
+ It(e);
2988
3013
  }
2989
- Ft(e, d.apiJson);
3014
+ Dt(e, d.apiJson);
2990
3015
  }
2991
3016
  }
2992
3017
  },
2993
3018
  afterApiJsonCreate: (l) => {
2994
- e.options.apiJson?.afterCreate?.(l.apiJson, !n), n = !0, (e.viteCommand === "build" ? e.viteConfig.build.watch : e.viteConfig.server.watch) === null && (e.apiJsonDeferred.resolve(), Ft(e, l.apiJson));
3019
+ e.options.apiJson?.afterCreate?.(l.apiJson, !n), n = !0, (e.viteCommand === "build" ? e.viteConfig.build.watch : e.viteConfig.server.watch) === null && (e.apiJsonDeferred.resolve(), Dt(e, l.apiJson));
2995
3020
  }
2996
3021
  }, c = i === void 0 ? a : vt(i, a);
2997
3022
  e.apiExtractorPluginConfig.configFilePath = "", e.apiExtractorPluginConfig.unsafeConfigOverride = c;
@@ -3000,7 +3025,7 @@ async function On(e) {
3000
3025
  e.apiExtractor = l, p?.(l);
3001
3026
  };
3002
3027
  }
3003
- function Ft(e, t) {
3028
+ function Dt(e, t) {
3004
3029
  const i = { ...t, modules: [] }, s = [], r = e.viteCommand === "build" ? [] : void 0;
3005
3030
  for (const n of t.modules) {
3006
3031
  const a = { ...n, declarations: [] };
@@ -3017,7 +3042,7 @@ function Ft(e, t) {
3017
3042
  }
3018
3043
  const d = {
3019
3044
  ...l,
3020
- members: l.members.filter((f) => f.privacy === void 0)
3045
+ members: l.members.filter((m) => m.privacy === void 0)
3021
3046
  };
3022
3047
  a.declarations.push(d), s.push(d);
3023
3048
  }
@@ -3025,28 +3050,28 @@ function Ft(e, t) {
3025
3050
  }
3026
3051
  e._localDefinedComponents = void 0, e.privateApiJson = t, e.apiJsonComponents = s, e.apiJson = i, r !== void 0 && (e.componentFilesPromise = Promise.resolve(r));
3027
3052
  }
3028
- var Mn = Object.defineProperty, I = (e, t, i, s) => {
3053
+ var Bn = Object.defineProperty, I = (e, t, i, s) => {
3029
3054
  for (var r = void 0, n = e.length - 1, a; n >= 0; n--)
3030
3055
  (a = e[n]) && (r = a(t, i, r) || r);
3031
- return r && Mn(t, i, r), r;
3056
+ return r && Bn(t, i, r), r;
3032
3057
  };
3033
- const M = "@arcgis/lumina:context";
3058
+ const J = "@arcgis/lumina:context";
3034
3059
  class $ {
3035
3060
  constructor(t) {
3036
3061
  this._typeScriptSourceFiles = /* @__PURE__ */ new Map(), this._plugin = {
3037
- name: M,
3062
+ name: J,
3038
3063
  // Make sure these globals are available to all plugins as soon as possible
3039
3064
  enforce: "pre",
3040
- apply: (d, f) => (this._inferBuildSetup(f, d.define), !0),
3065
+ apply: (d, m) => (this._inferBuildSetup(m, d.define), !0),
3041
3066
  configResolved: {
3042
3067
  order: "pre",
3043
3068
  handler: (d) => {
3044
3069
  this.viteConfig = d;
3045
- const f = d.build.minify !== !1;
3046
- this.shouldMinify = f && this.viteCommand !== "serve", Object.hasOwn(this, "shouldMinifyJsx") || (this.shouldMinifyJsx = this.viteCommand !== "serve" || this.isInTest);
3047
- const m = u.join(d.root, u.sep), g = u.join(m, "src", u.sep), h = u.join(g, "components", u.sep), y = u.join(u.resolve(m, d.build.outDir), u.sep), v = u.join(u.relative(m, y), u.sep), C = u.join(y, "components", u.sep), S = u.join(y, this.options.build?.cdn?.namespace ?? ne, u.sep), k = u.join(S, "assets", u.sep);
3070
+ const m = d.build.minify !== !1;
3071
+ this.shouldMinify = m && this.viteCommand !== "serve", Object.hasOwn(this, "shouldMinifyJsx") || (this.shouldMinifyJsx = this.viteCommand !== "serve" || this.isInTest);
3072
+ const f = u.join(d.root, u.sep), g = u.join(f, "src", u.sep), h = u.join(g, "components", u.sep), y = u.join(u.resolve(f, d.build.outDir), u.sep), v = u.join(u.relative(f, y), u.sep), C = u.join(y, "components", u.sep), S = u.join(y, this.options.build?.cdn?.namespace ?? ne, u.sep), k = u.join(S, "assets", u.sep);
3048
3073
  if (this.dir = {
3049
- root: m,
3074
+ root: f,
3050
3075
  src: g,
3051
3076
  srcComponents: h,
3052
3077
  relativeDist: v,
@@ -3054,18 +3079,18 @@ class $ {
3054
3079
  distComponents: C,
3055
3080
  distCdn: S,
3056
3081
  distCdnAssets: k
3057
- }, E.initialize(d.logger, m), d.root !== Yt())
3082
+ }, E.initialize(d.logger, f), d.root !== Qt())
3058
3083
  throw Error(
3059
3084
  b(
3060
- M,
3085
+ J,
3061
3086
  "Vite's config.root is not equal process.cwd(). This is not officially supported by Lumina and may lead to unexpected behavior. If you need this to be supported, comment on https://devtopia.esri.com/WebGIS/arcgis-web-components/issues/2126 or contact Lumina maintainers."
3062
3087
  )
3063
3088
  );
3064
- y === m ? E.warn(
3065
- M,
3089
+ y === f ? E.warn(
3090
+ J,
3066
3091
  "Vite output directory is set to the root directory. This can produce unexpected behavior. Please set the output directory to a subdirectory of the root directory (i.e dist/)"
3067
3092
  ) : v.startsWith("..") && E.warn(
3068
- M,
3093
+ J,
3069
3094
  "Vite output directory is outside the root directory. This is not officially supported by Lumina and may lead to unexpected behavior. Contact Lumina maintainers if you need this to be supported."
3070
3095
  ), this.isInStorybook = d.resolve.conditions.includes("storybook"), this.isFullApiExtraction = this.viteCommand === "build" || this.isInStorybook, this.hmrEnabled = this.viteCommand === "serve" && !this.isInTest && !!(d.server?.hmr ?? !0), this.isInBuildWatch = d.command === "build" && d.build.watch != null;
3071
3096
  const T = this.isInTest && d.test?.browser?.enabled === !0 && d.resolve.conditions.includes("node"), x = this.isInTest && d.test?.browser?.enabled !== !0 && d.resolve.conditions.includes("node"), w = this.viteCommand === "serve" && process.argv[1].includes("vite-node");
@@ -3073,11 +3098,11 @@ class $ {
3073
3098
  extract: !0
3074
3099
  }, (this.viteCommand === "build" ? d.build.watch : d.server.watch) === null && (this.apiJsonDeferred = Promise.withResolvers())) : (this._localDefinedComponents = {}, this.options.build ??= {}, this.options.build.dependencies ??= {}, this.apiExtractorPluginConfig.serve = void 0, this.options.build.dependencies.silenceUnknownJsxElementUsage = () => !0);
3075
3100
  const L = this.viteCommand === "serve" && !this.isInStorybook, A = this.apiExtractorPluginConfig.unsafeConfigOverride;
3076
- L && (A.context.isLuminaMinimalExtraction = !0, A.types.typeCheckedExtraction = !1, A.types.fullTypeCheck = !1), this.isInStorybook && (A.context.dtsEmitPath = ""), this._typeScriptPrinter = As({
3101
+ L && (A.context.isLuminaMinimalExtraction = !0, A.types.typeCheckedExtraction = !1, A.types.fullTypeCheck = !1), this.isInStorybook && (A.context.dtsEmitPath = ""), this._typeScriptPrinter = Ls({
3077
3102
  // Do not downlevel. ESBuild will do that if needed.
3078
3103
  target: o.ScriptTarget.ESNext,
3079
3104
  sourceMap: d.build.sourcemap !== !1
3080
- }), Bi(this) && pe(this);
3105
+ }), _i(this) && pe(this);
3081
3106
  }
3082
3107
  },
3083
3108
  configureServer: {
@@ -3099,15 +3124,15 @@ class $ {
3099
3124
  }, this.apiExtractor = void 0, this.apiJsonDeferred = void 0, this._localDefinedComponents = void 0, this.isInCi = !!process.env.CI, this._serverConfigured = !1, this.assetsToProvide = [], this._globalCssString = void 0, this._loadersCache = void 0, this._serveOnlyDependencies = void 0, this._customElementDependencies = /* @__PURE__ */ Object.create(null), this._silencedRules = void 0, this._updateLuminaTsPromise = void 0, this._originalRollupInputOptions = void 0, this.options = t;
3100
3125
  const i = 3;
3101
3126
  (!V.engines.node.startsWith("^") || V.engines.node[i] !== ".") && E.error(
3102
- M,
3127
+ J,
3103
3128
  `Unsupported Node.js version syntax used in monorepo's package.json. Expected "^NN.NN", got "${V.engines.node}". Update @arcgis/lumina-compiler to support this syntax.`
3104
3129
  );
3105
3130
  const s = Number.parseInt(V.engines.node.slice(1, i)), r = Number.parseInt(V.engines.node.slice(i + 1)), n = Number.parseInt(process.version.slice(1, i)), a = Number.parseInt(process.version.slice(i + 1));
3106
3131
  n < s || n === s && a < r ? E.warn(
3107
- M,
3132
+ J,
3108
3133
  `Lumina requires Node.js version ${V.engines.node}. Current version is ${process.version}. Some features may not work as expected.`
3109
3134
  ) : n > s && E.info(
3110
- M,
3135
+ J,
3111
3136
  `Lumina was tested with Node.js version ${V.engines.node}. Current version is ${process.version}. Some features may not work as expected.`
3112
3137
  );
3113
3138
  const c = t.documentation ?? {};
@@ -3118,21 +3143,21 @@ class $ {
3118
3143
  webTypes: c.jetBrains === !1 ? void 0 : c.jetBrains?.webTypesFileName ? ae(c.jetBrains.webTypesFileName) : le.webTypes,
3119
3144
  vsCodeHtml: c.vsCode === !1 ? void 0 : c.vsCode?.htmlFileName ? ae(c.vsCode.htmlFileName) : le.vsCodeHtml,
3120
3145
  vsCodeCss: c.vsCode === !1 ? void 0 : c.vsCode?.cssFileName ? ae(c.vsCode.cssFileName) : le.vsCodeCss
3121
- }, this.apiExtractorPluginConfig = this.options.apiExtractor ?? {}, this.configsPromise = On(this);
3146
+ }, this.apiExtractorPluginConfig = this.options.apiExtractor ?? {}, this.configsPromise = Jn(this);
3122
3147
  const p = process.cwd().length + 1;
3123
3148
  this.componentFilesPromise = this.configsPromise.then(() => {
3124
- const d = this.apiExtractorPluginConfig.unsafeConfigOverride.types.typeScriptConfig.config.fileNames, f = [];
3125
- for (let m = 0; m < d.length; ++m) {
3126
- const h = d[m].slice(p);
3127
- Ce(h, "src/components") && f.push(h);
3149
+ const d = this.apiExtractorPluginConfig.unsafeConfigOverride.types.typeScriptConfig.config.fileNames, m = [];
3150
+ for (let f = 0; f < d.length; ++f) {
3151
+ const h = d[f].slice(p);
3152
+ Ce(h, "src/components") && m.push(h);
3128
3153
  }
3129
- return f;
3130
- }), vi(void 0, t);
3131
- const l = t.build?.preamble ?? kn();
3132
- this.banner = xn(l);
3154
+ return m;
3155
+ }), bi(void 0, t);
3156
+ const l = t.build?.preamble ?? An();
3157
+ this.banner = Nn(l);
3133
3158
  }
3134
3159
  _inferBuildSetup({ command: t, mode: i }, s) {
3135
- this.isInTest = process.env.NODE_ENV === "test", i === "production" || i === "development" ? this.environment = i : i === "test" || i === "benchmark" ? (this.environment = "development", this.isInTest = !0) : (E.warn(yi.name, `Vite is running in unknown mode "${i}". Assuming development`), this.environment = "development"), this.viteCommand = t;
3160
+ this.isInTest = process.env.NODE_ENV === "test", i === "production" || i === "development" ? this.environment = i : i === "test" || i === "benchmark" ? (this.environment = "development", this.isInTest = !0) : (E.warn(vi.name, `Vite is running in unknown mode "${i}". Assuming development`), this.environment = "development"), this.viteCommand = t;
3136
3161
  const r = s?.__IS_IN_PUPPETEER__ === !0, n = this.viteCommand === "serve" && this.isInTest && this.options.puppeteerTesting?.enabled === !0;
3137
3162
  this.isInPuppeteerTestBackEnd = n && !r, this.isInPuppeteerTestFrontEnd = n && r;
3138
3163
  }
@@ -3147,7 +3172,7 @@ class $ {
3147
3172
  if (s !== void 0 && (n = s.getSourceFile(t), n === void 0 && r))
3148
3173
  throw Error(
3149
3174
  b(
3150
- M,
3175
+ J,
3151
3176
  t,
3152
3177
  "Unable to find the TypeScript source file. Expected all files that are part of Vite's transform to also be part of TypeScript program."
3153
3178
  )
@@ -3158,7 +3183,7 @@ class $ {
3158
3183
  return c;
3159
3184
  }
3160
3185
  return i !== n?.text && ((this.viteCommand !== "serve" || this.isInStorybook) && E.warn(
3161
- M,
3186
+ J,
3162
3187
  "The Vite's transform() content didn't match TypeScript's content. This may happen if some plugin transformed a file before Lumina or Vite got out of sync with TypeScript. This may lead to false errors. Debug your build configuration or report it as a bug",
3163
3188
  t
3164
3189
  ), n = o.createSourceFile(
@@ -3204,7 +3229,7 @@ class $ {
3204
3229
  else
3205
3230
  throw Error(
3206
3231
  b(
3207
- M,
3232
+ J,
3208
3233
  "It is too late to call provideAssets() as Vite already wrote the bundle to disk. Please call provideAssets() before Vite's writeBundle()"
3209
3234
  )
3210
3235
  );
@@ -3276,8 +3301,8 @@ I([
3276
3301
  I([
3277
3302
  P("configResolved()")
3278
3303
  ], $.prototype, "_typeScriptPrinter");
3279
- function Jn(e, t, i) {
3280
- const s = bi()[t] ?? Ki(e)[t];
3304
+ function Kn(e, t, i) {
3305
+ const s = wi()[t] ?? Ui(e)[t];
3281
3306
  if (s === void 0) {
3282
3307
  if (e.options?.build?.dependencies?.silenceUnknownJsxElementUsage?.(t, i, e) === !0)
3283
3308
  return;
@@ -3291,11 +3316,11 @@ function Jn(e, t, i) {
3291
3316
  }
3292
3317
  return s;
3293
3318
  }
3294
- function Bn(e, t) {
3319
+ function _n(e, t) {
3295
3320
  return e.packageName === void 0 ? fe(t, e.modulePath) : u.join(e.packageName, e.modulePath);
3296
3321
  }
3297
- function Ki(e) {
3298
- return e._localDefinedComponents ??= Si(
3322
+ function Ui(e) {
3323
+ return e._localDefinedComponents ??= Ei(
3299
3324
  e.privateApiJson,
3300
3325
  {
3301
3326
  packageName: void 0,
@@ -3306,8 +3331,8 @@ function Ki(e) {
3306
3331
  e.viteCommand === "build"
3307
3332
  ), e._localDefinedComponents;
3308
3333
  }
3309
- const Rt = "makeRuntime(", Kn = "@arcgis/core", _n = "@arcgis/lumina:injectRuntimeOptions", Un = (e) => ({
3310
- name: _n,
3334
+ const Rt = "makeRuntime(", Un = "@arcgis/core", Wn = "@arcgis/lumina:injectRuntimeOptions", zn = (e) => ({
3335
+ name: Wn,
3311
3336
  transform: {
3312
3337
  filter: {
3313
3338
  id: /\/src\/runtime\.ts$/u
@@ -3326,13 +3351,13 @@ const Rt = "makeRuntime(", Kn = "@arcgis/core", _n = "@arcgis/lumina:injectRunti
3326
3351
  "{",
3327
3352
  "defaultAssetPath:import.meta.env.BASE_URL,",
3328
3353
  'hydratedAttribute:"',
3329
- e.options.css?.hydratedAttribute ?? fi,
3354
+ e.options.css?.hydratedAttribute ?? gi,
3330
3355
  '",',
3331
3356
  n === void 0 ? "" : "commonStyles",
3332
3357
  "}",
3333
3358
  t.slice(r),
3334
- me ? `
3335
- import {createObservable,trackAccess,createTrackingTarget,runTracked} from "${Kn}/applications/Components/reactiveUtils.js";
3359
+ ue ? `
3360
+ import {createObservable,trackAccess,createTrackingTarget,runTracked} from "${Un}/applications/Components/reactiveUtils.js";
3336
3361
  createObservable,
3337
3362
  runtime.t = trackAccess;
3338
3363
  runtime.o = createObservable;
@@ -3344,24 +3369,25 @@ runtime.r = runTracked;` : ""
3344
3369
  }
3345
3370
  }
3346
3371
  });
3347
- function Wn(e) {
3348
- return `import "../${e.options.build?.cdn?.namespace === void 0 ? `${ne}/${Y}.css` : `${e.options.build.cdn.namespace}/${e.options.build.cdn.namespace}.css`}";
3372
+ function Hn(e) {
3373
+ return `import "../${e.options.build?.cdn?.namespace === void 0 ? `${ne}/${Q}.css` : `${e.options.build.cdn.namespace}/${e.options.build.cdn.namespace}.css`}";
3349
3374
  `;
3350
3375
  }
3351
- const ve = "@arcgis/lumina:addNonLazyImports", Hn = (e) => ({
3376
+ const ve = "@arcgis/lumina:addNonLazyImports", qn = (e) => ({
3352
3377
  name: ve,
3353
3378
  apply: () => e.viteCommand === "build",
3354
3379
  generateBundle(t, i) {
3355
- let s = !1;
3356
- if (Object.entries(i).forEach(([r, n]) => {
3357
- const a = We(r, e.apiExtractor);
3358
- if (a !== r && (n.fileName = a), n.type === "chunk") {
3359
- const c = u.dirname(u.join(e.dir.dist, r)), p = a === r ? c : u.dirname(u.join(e.dir.dist, a));
3360
- let l = n.code;
3361
- l = Br(l, e, p, c), !e.isInStorybook && a === "chunks/runtime.js" && (s = !0, l = Wn(e) + l), l = `${e.banner}
3362
- ${l}`, n.code = l;
3380
+ const r = e.viteConfig.build.sourcemap !== !1 ? " " : `
3381
+ `;
3382
+ let n = !1;
3383
+ if (Object.entries(i).forEach(([a, c]) => {
3384
+ const p = We(a, e.apiExtractor);
3385
+ if (p !== a && (c.fileName = p), c.type === "chunk") {
3386
+ const l = u.dirname(u.join(e.dir.dist, a)), d = p === a ? l : u.dirname(u.join(e.dir.dist, p));
3387
+ let m = c.code;
3388
+ m = _r(m, e, d, l), !e.isInStorybook && p === "chunks/runtime.js" && (n = !0, m = Hn(e) + m), m = `${e.banner}${r}${m}`, c.code = m;
3363
3389
  }
3364
- }), !s && !e.isInStorybook)
3390
+ }), !n && !e.isInStorybook)
3365
3391
  throw Error(b(ve, "Expected to find a chunks/runtime.js file in the Vite's build output."));
3366
3392
  },
3367
3393
  async writeBundle() {
@@ -3373,7 +3399,7 @@ ${l}`, n.code = l;
3373
3399
  i.forEach(([n, { referencedTagNames: a, referencedDeferredTagNames: c, referencedBy: p }]) => {
3374
3400
  if (s.has(n) || a.length === 0 && c.length === 0)
3375
3401
  return;
3376
- const l = _i(t, p, s);
3402
+ const l = Wi(t, p, s);
3377
3403
  if (l.forEach((d) => {
3378
3404
  t[d].referencedTagNames.splice(0, 0, ...a), t[d].referencedDeferredTagNames.splice(0, 0, ...c);
3379
3405
  }), (a.length > 0 || c.length > 0) && l.length === 0) {
@@ -3395,19 +3421,19 @@ Possible causes:
3395
3421
  if (!s.has(n))
3396
3422
  return [];
3397
3423
  const p = u.dirname(n), l = e.dir.src + We(p.slice(e.dir.src.length), e.apiExtractor), d = u.relative(e.dir.src, l);
3398
- function f(T) {
3399
- const x = Jn(e, T, n);
3424
+ function m(T) {
3425
+ const x = Kn(e, T, n);
3400
3426
  if (x === void 0)
3401
3427
  return;
3402
- const w = Bn(x, d);
3428
+ const w = _n(x, d);
3403
3429
  if (w !== `./${d}`)
3404
- return w.startsWith(".") ? `${w}/${Dt}` : w;
3430
+ return w.startsWith(".") ? `${w}/${Ot}` : w;
3405
3431
  }
3406
- const m = new Set(a), g = new Set(c), h = Array.from(m, f).filter(F), y = (T) => `import "${T}";
3432
+ const f = new Set(a), g = new Set(c), h = Array.from(f, m).filter(F), y = (T) => `import "${T}";
3407
3433
  `, v = h.map(y).join(""), C = Array.from(g, (T) => {
3408
- const x = f(T);
3434
+ const x = m(T);
3409
3435
  if (x !== void 0) {
3410
- if (m.has(T)) {
3436
+ if (f.has(T)) {
3411
3437
  E.warn(
3412
3438
  ve,
3413
3439
  `"${T}" is used both with and without deferLoad in ${n} (either directly in ${n} or via a functional component). deferLoad will be ignored in this case.`
@@ -3420,13 +3446,13 @@ Possible causes:
3420
3446
  }).filter(F), S = `${v}export * from "./${ot}";`, k = C.length > 0 ? `import { deferredLoaders } from "@arcgis/lumina";
3421
3447
  ${S}
3422
3448
  deferredLoaders${C.join("")};` : S;
3423
- return await U(u.join(e.dir.dist, d, Dt), k);
3449
+ return await U(u.join(e.dir.dist, d, Ot), k);
3424
3450
  });
3425
3451
  await Promise.all(r);
3426
3452
  }
3427
- }), Dt = "index.js", _i = (e, t, i, s = /* @__PURE__ */ new Set()) => t.flatMap((r) => i.has(r) ? [r] : s.has(r) ? [] : (s.add(r), _i(e, e[r].referencedBy, i, s)));
3428
- function Ot(e, t, i) {
3429
- if (Q(e))
3453
+ }), Ot = "index.js", Wi = (e, t, i, s = /* @__PURE__ */ new Set()) => t.flatMap((r) => i.has(r) ? [r] : s.has(r) ? [] : (s.add(r), Wi(e, e[r].referencedBy, i, s)));
3454
+ function Mt(e, t, i) {
3455
+ if (Z(e))
3430
3456
  return e;
3431
3457
  {
3432
3458
  i === void 0 && t.neededImports.add("nothing");
@@ -3440,18 +3466,18 @@ function Ot(e, t, i) {
3440
3466
  );
3441
3467
  }
3442
3468
  }
3443
- function Q(e) {
3469
+ function Z(e) {
3444
3470
  return (
3445
3471
  // Inlined string literal
3446
3472
  typeof e == "string" || // Syntax kinds that are never undefined
3447
- qn.has(e.kind) || // Ternary with both branches never undefined
3448
- o.isConditionalExpression(e) && Q(e.whenTrue) && Q(e.whenFalse) || // Binary expression with operator that never results in undefined Or both sides are definitely not undefined
3449
- o.isBinaryExpression(e) && (zn.has(e.operatorToken.kind) || Q(e.left) && Q(e.right)) || // `as`, `satisfies`, `()` with definitely not undefined expression
3450
- (o.isParenthesizedExpression(e) || o.isSatisfiesExpression(e) || o.isAsExpression(e)) && Q(e.expression) || // JSX that got converted to html`<p>Something</p>`
3451
- o.isTaggedTemplateExpression(e) && o.isIdentifier(e.tag) && Vs.has(e.tag.text)
3473
+ Vn.has(e.kind) || // Ternary with both branches never undefined
3474
+ o.isConditionalExpression(e) && Z(e.whenTrue) && Z(e.whenFalse) || // Binary expression with operator that never results in undefined Or both sides are definitely not undefined
3475
+ o.isBinaryExpression(e) && (Gn.has(e.operatorToken.kind) || Z(e.left) && Z(e.right)) || // `as`, `satisfies`, `()` with definitely not undefined expression
3476
+ (o.isParenthesizedExpression(e) || o.isSatisfiesExpression(e) || o.isAsExpression(e)) && Z(e.expression) || // JSX that got converted to html`<p>Something</p>`
3477
+ o.isTaggedTemplateExpression(e) && o.isIdentifier(e.tag) && Xs.has(e.tag.text)
3452
3478
  );
3453
3479
  }
3454
- const qn = /* @__PURE__ */ new Set([
3480
+ const Vn = /* @__PURE__ */ new Set([
3455
3481
  o.SyntaxKind.NumericLiteral,
3456
3482
  o.SyntaxKind.BigIntLiteral,
3457
3483
  o.SyntaxKind.StringLiteral,
@@ -3470,7 +3496,7 @@ const qn = /* @__PURE__ */ new Set([
3470
3496
  o.SyntaxKind.ClassExpression,
3471
3497
  // Trust? Trust.
3472
3498
  o.SyntaxKind.NonNullExpression
3473
- ]), zn = /* @__PURE__ */ new Set([
3499
+ ]), Gn = /* @__PURE__ */ new Set([
3474
3500
  o.SyntaxKind.PlusEqualsToken,
3475
3501
  o.SyntaxKind.MinusEqualsToken,
3476
3502
  o.SyntaxKind.AsteriskAsteriskEqualsToken,
@@ -3505,28 +3531,28 @@ const qn = /* @__PURE__ */ new Set([
3505
3531
  o.SyntaxKind.SlashToken,
3506
3532
  o.SyntaxKind.PercentToken,
3507
3533
  o.SyntaxKind.AsteriskAsteriskToken
3508
- ]), Vn = {
3534
+ ]), Xn = {
3509
3535
  property(e, t, i, s) {
3510
- const r = Gn(s, i, e), n = r?.type === "stringifiedReflected", a = r?.type === "reflected" || n;
3536
+ const r = Yn(s, i, e), n = r?.type === "stringifiedReflected", a = r?.type === "reflected" || n;
3511
3537
  if (a) {
3512
- const m = _e(t);
3513
- if (m === !0)
3538
+ const f = _e(t);
3539
+ if (f === !0)
3514
3540
  return [r.name];
3515
- if (m === !1)
3541
+ if (f === !1)
3516
3542
  return [];
3517
3543
  }
3518
3544
  const c = t === void 0 ? ["=", o.factory.createToken(o.SyntaxKind.TrueKeyword)] : Se(e, t, a), p = c[0] !== "=";
3519
3545
  if (a && p)
3520
3546
  return [r.name, ...c];
3521
- const [l, d] = c, f = r?.type === "stringifiedNonReflected";
3522
- if (n || f) {
3523
- const m = Ot(
3547
+ const [l, d] = c, m = r?.type === "stringifiedNonReflected";
3548
+ if (n || m) {
3549
+ const f = Mt(
3524
3550
  d,
3525
3551
  e,
3526
- f ? "" : void 0
3527
- ), h = i === "value" && (s === "input" || s === "textarea" || s === Te) ? Yn(m, e) : m;
3552
+ m ? "" : void 0
3553
+ ), h = i === "value" && (s === "input" || s === "textarea" || s === Te) ? Zn(f, e) : f;
3528
3554
  if (h !== d)
3529
- return [f ? `.${i}` : r.name, l, h];
3555
+ return [m ? `.${i}` : r.name, l, h];
3530
3556
  }
3531
3557
  return [`.${i}`, ...c];
3532
3558
  },
@@ -3536,7 +3562,7 @@ const qn = /* @__PURE__ */ new Set([
3536
3562
  return [i];
3537
3563
  if (s === !1)
3538
3564
  return [];
3539
- const r = Se(e, t, !0), a = r[0] !== "=" ? r : [r[0], Ot(r[1], e)];
3565
+ const r = Se(e, t, !0), a = r[0] !== "=" ? r : [r[0], Mt(r[1], e)];
3540
3566
  return [i, ...a];
3541
3567
  },
3542
3568
  booleanAttribute(e, t, i) {
@@ -3549,7 +3575,7 @@ const qn = /* @__PURE__ */ new Set([
3549
3575
  `Event prop value must be an expression. Found ${String(t?.getText(e.sourceFile))}`
3550
3576
  );
3551
3577
  const s = i.slice(2), r = gt(s);
3552
- return [`@${oi.has(r) ? s.toLowerCase() : gt(s)}=`, ...pt(e, t, void 0)];
3578
+ return [`@${ai.has(r) ? s.toLowerCase() : gt(s)}=`, ...pt(e, t, void 0)];
3553
3579
  },
3554
3580
  directives(e, t) {
3555
3581
  if (t === void 0 || !o.isJsxExpression(t))
@@ -3565,7 +3591,7 @@ const qn = /* @__PURE__ */ new Set([
3565
3591
  throw new Error(
3566
3592
  `Directives prop cannot contain a spread argument - it needs to be statically analyzable. Still, the following are allowed: directives={[directiveA, condition ? a : b, c()]}. Found ${String(t.expression?.getText(e.sourceFile))}`
3567
3593
  );
3568
- return z(e, void 0, r);
3594
+ return q(e, void 0, r);
3569
3595
  });
3570
3596
  },
3571
3597
  ref(e, t) {
@@ -3580,12 +3606,12 @@ const qn = /* @__PURE__ */ new Set([
3580
3606
  const r = s ? e.importRenames.stabilizedRef : e.importRenames.ref;
3581
3607
  return [
3582
3608
  o.factory.createCallExpression(o.factory.createIdentifier(r), void 0, [
3583
- z(e, void 0, t.expression)
3609
+ q(e, void 0, t.expression)
3584
3610
  ])
3585
3611
  ];
3586
3612
  },
3587
- class: Jt,
3588
- style: Jt,
3613
+ class: Bt,
3614
+ style: Bt,
3589
3615
  key: (e, t) => [ct(t, e.sourceFile)],
3590
3616
  deferLoad(e, t, i, s) {
3591
3617
  if (typeof s != "string")
@@ -3597,7 +3623,7 @@ const qn = /* @__PURE__ */ new Set([
3597
3623
  return [o.factory.createIdentifier(r)];
3598
3624
  }
3599
3625
  };
3600
- function Gn(e, t, i) {
3626
+ function Yn(e, t, i) {
3601
3627
  if (typeof e == "string") {
3602
3628
  const n = (i.externalComponents[e] ?? i.localComponents[e])?.propToAttribute?.[t];
3603
3629
  if (n !== void 0)
@@ -3613,7 +3639,7 @@ function Gn(e, t, i) {
3613
3639
  } else {
3614
3640
  const r = Object.values(W.perElement).map(
3615
3641
  (a) => Ke(a, t)
3616
- ), n = He(r, (a) => a?.type === "stringifiedNonReflected" ? a : void 0) ?? He(r, (a) => a?.type === "stringifiedReflected" ? a : void 0);
3642
+ ), n = ze(r, (a) => a?.type === "stringifiedNonReflected" ? a : void 0) ?? ze(r, (a) => a?.type === "stringifiedReflected" ? a : void 0);
3617
3643
  if (n !== void 0)
3618
3644
  return n;
3619
3645
  }
@@ -3652,10 +3678,10 @@ function Se(e, t, i = !1) {
3652
3678
  `Invalid JSX syntax detected or there is a bug in Lumina. Found ${t.getText(e.sourceFile)}. Expected JSX attribute value to be wrapped in { }`
3653
3679
  );
3654
3680
  if (o.isStringLiteral(t))
3655
- return Mt(t, i);
3681
+ return Jt(t, i);
3656
3682
  if (o.isJsxExpression(t) && t.expression) {
3657
3683
  if (o.isStringLiteral(t.expression))
3658
- return Mt(t.expression, i);
3684
+ return Jt(t.expression, i);
3659
3685
  if (i) {
3660
3686
  if (o.isNumericLiteral(t.expression))
3661
3687
  return [`=${t.expression.text}`];
@@ -3665,14 +3691,14 @@ function Se(e, t, i = !1) {
3665
3691
  }
3666
3692
  return ["=", ...pt(e, t, void 0)];
3667
3693
  }
3668
- function Mt(e, t) {
3694
+ function Jt(e, t) {
3669
3695
  if (!t)
3670
3696
  return ["=", e];
3671
3697
  const i = e.text;
3672
3698
  if (i.length === 0)
3673
3699
  return [];
3674
- const s = ai(i);
3675
- if (Us(s)) {
3700
+ const s = li(i);
3701
+ if (zs(s)) {
3676
3702
  const r = s.replaceAll('"', "&#34;");
3677
3703
  if (r.length > s.length) {
3678
3704
  const n = s.replaceAll("'", "&#39;");
@@ -3683,7 +3709,7 @@ function Mt(e, t) {
3683
3709
  } else
3684
3710
  return [`=${s}`];
3685
3711
  }
3686
- function Jt(e, t, i) {
3712
+ function Bt(e, t, i) {
3687
3713
  if (t !== void 0 && o.isStringLiteral(t))
3688
3714
  return [`${i}="${t.text}"`];
3689
3715
  if (t === void 0 || !o.isJsxExpression(t) || t.expression === void 0)
@@ -3691,28 +3717,28 @@ function Jt(e, t, i) {
3691
3717
  `${i} prop value must be an expression. Found ${String(t?.getText(e.sourceFile))}`
3692
3718
  );
3693
3719
  const s = t.expression;
3694
- if (Xn(s)) {
3720
+ if (Qn(s)) {
3695
3721
  const n = i === "class" ? "safeClassMap" : "safeStyleMap";
3696
3722
  e.neededImports.add(n);
3697
3723
  const a = e.importRenames[n], c = o.factory.createCallExpression(o.factory.createIdentifier(a), void 0, [
3698
- z(e, void 0, s)
3724
+ q(e, void 0, s)
3699
3725
  ]);
3700
3726
  return [`${i}=`, c];
3701
3727
  } else
3702
3728
  return [i, ...Se(e, t, !0)];
3703
3729
  }
3704
- const Xn = (e) => o.isObjectLiteralExpression(e) || o.isPropertyAccessExpression(e) || o.isIdentifier(e) || o.isCallExpression(e) || o.isBinaryExpression(e) || o.isConditionalExpression(e);
3705
- function Yn(e, t) {
3730
+ const Qn = (e) => o.isObjectLiteralExpression(e) || o.isPropertyAccessExpression(e) || o.isIdentifier(e) || o.isCallExpression(e) || o.isBinaryExpression(e) || o.isConditionalExpression(e);
3731
+ function Zn(e, t) {
3706
3732
  t.neededImports.add("live");
3707
3733
  const i = t.importRenames.live;
3708
3734
  return o.factory.createCallExpression(o.factory.createIdentifier(i), void 0, [
3709
3735
  typeof e == "string" ? o.factory.createStringLiteral(e) : e
3710
3736
  ]);
3711
3737
  }
3712
- function Qn(e) {
3713
- if (e && o.isJsxExpression(e) && e.expression && o.isCallExpression(e.expression) && o.isIdentifier(e.expression.expression) && e.expression.expression.text in Bt && e.expression.arguments.length <= 1)
3738
+ function eo(e) {
3739
+ if (e && o.isJsxExpression(e) && e.expression && o.isCallExpression(e.expression) && o.isIdentifier(e.expression.expression) && e.expression.expression.text in Kt && e.expression.arguments.length <= 1)
3714
3740
  return {
3715
- propType: Bt[e.expression.expression.text],
3741
+ propType: Kt[e.expression.expression.text],
3716
3742
  // To simplify checking logic in convertProps, wrap expression in JSX expression
3717
3743
  initializer: o.factory.createJsxExpression(
3718
3744
  void 0,
@@ -3721,21 +3747,21 @@ function Qn(e) {
3721
3747
  )
3722
3748
  };
3723
3749
  }
3724
- const Bt = {
3750
+ const Kt = {
3725
3751
  bindProperty: "property",
3726
3752
  bindAttribute: "attribute",
3727
3753
  bindBooleanAttribute: "booleanAttribute",
3728
3754
  bindEvent: "event"
3729
3755
  };
3730
- function Zn(e, t, i) {
3731
- return to.has(e) ? e : e.startsWith("on") && t !== void 0 && o.isJsxExpression(t) && t.expression !== void 0 ? "event" : si.has(e) || e.includes("-") ? "attribute" : !rt(i) && (ri.has(e) || (i === qe ? !1 : i === Te ? (
3756
+ function to(e, t, i) {
3757
+ return so.has(e) ? e : e.startsWith("on") && t !== void 0 && o.isJsxExpression(t) && t.expression !== void 0 ? "event" : ri.has(e) || e.includes("-") ? "attribute" : !rt(i) && (ni.has(e) || (i === He ? !1 : i === Te ? (
3732
3758
  // When tag name is dynamic, we can't help but check if the prop name matches an "always attribute" in any html element
3733
- Object.values(ze).some((n) => n.has(e))
3734
- ) : ze[i]?.has(e) === !0)) ? bt.has(e) ? "booleanAttribute" : "attribute" : i === "svg" || i === "math" || i === qe || i !== Te && (it.has(i) || st.has(i)) ? e in W.common.reflected || e in W.common.stringifiedReflected || e in W.common.stringifiedNonReflected ? "property" : bt.has(e) ? "booleanAttribute" : "attribute" : "property";
3759
+ Object.values(qe).some((n) => n.has(e))
3760
+ ) : qe[i]?.has(e) === !0)) ? bt.has(e) ? "booleanAttribute" : "attribute" : i === "svg" || i === "math" || i === He || i !== Te && (it.has(i) || st.has(i)) ? e in W.common.reflected || e in W.common.stringifiedReflected || e in W.common.stringifiedNonReflected ? "property" : bt.has(e) ? "booleanAttribute" : "attribute" : "property";
3735
3761
  }
3736
- const eo = ["class", "style", "ref", "directives", "key", "deferLoad"], to = new Set(eo), io = (e) => typeof e != "string" || e.trim().length > 0;
3762
+ const io = ["class", "style", "ref", "directives", "key", "deferLoad"], so = new Set(io), ro = (e) => typeof e != "string" || e.trim().length > 0;
3737
3763
  function Le({ key: e, parts: t, litTag: i }, s) {
3738
- const r = so(t);
3764
+ const r = no(t);
3739
3765
  if (r.length % 2 === 0)
3740
3766
  throw new Error("Normalized template parts array length must be odd");
3741
3767
  const [n, ...a] = r;
@@ -3756,11 +3782,11 @@ function Le({ key: e, parts: t, litTag: i }, s) {
3756
3782
  const p = s.importRenames[c], l = o.factory.createTaggedTemplateExpression(
3757
3783
  o.factory.createIdentifier(p),
3758
3784
  void 0,
3759
- a.length === 0 ? o.factory.createNoSubstitutionTemplateLiteral(n) : o.factory.createTemplateExpression(o.factory.createTemplateHead(n), ro(a))
3785
+ a.length === 0 ? o.factory.createNoSubstitutionTemplateLiteral(n) : o.factory.createTemplateExpression(o.factory.createTemplateHead(n), oo(a))
3760
3786
  );
3761
3787
  return Ue(s, e, l);
3762
3788
  }
3763
- const so = (e) => e.reduce(
3789
+ const no = (e) => e.reduce(
3764
3790
  (t, i, s) => {
3765
3791
  const r = t.at(-1), n = typeof r == "string", a = typeof i == "string";
3766
3792
  if (n && a)
@@ -3770,7 +3796,7 @@ const so = (e) => e.reduce(
3770
3796
  },
3771
3797
  [""]
3772
3798
  );
3773
- function ro(e) {
3799
+ function oo(e) {
3774
3800
  if (!(e.length % 2 === 0))
3775
3801
  throw new Error("templatePartsToSpans should be called with normalized parts array without the first item");
3776
3802
  const i = e.length / 2;
@@ -3795,8 +3821,8 @@ function Ue(e, t, i) {
3795
3821
  const s = e.importRenames.keyed;
3796
3822
  return o.factory.createCallExpression(o.factory.createIdentifier(s), void 0, [t, i]);
3797
3823
  }
3798
- const Ui = (e, t) => e.getFullText(t.sourceFile).slice(0, e.getLeadingTriviaWidth(t.sourceFile));
3799
- function Wi(e, t) {
3824
+ const zi = (e, t) => e.getFullText(t.sourceFile).slice(0, e.getLeadingTriviaWidth(t.sourceFile));
3825
+ function Hi(e, t) {
3800
3826
  const i = dt(e);
3801
3827
  return i.length === 0 ? t : o.setSyntheticLeadingComments(
3802
3828
  t,
@@ -3804,18 +3830,18 @@ function Wi(e, t) {
3804
3830
  ...s,
3805
3831
  pos: -1,
3806
3832
  end: -1,
3807
- text: Hi(e.slice(s.pos, s.end))
3833
+ text: qi(e.slice(s.pos, s.end))
3808
3834
  }))
3809
3835
  );
3810
3836
  }
3811
3837
  const dt = (e) => e.trim().length === 0 ? [] : o.getLeadingCommentRanges(e, 0) ?? [];
3812
- function no(e) {
3838
+ function ao(e) {
3813
3839
  const t = dt(e);
3814
3840
  if (t.length === 0)
3815
3841
  return [e || " "];
3816
3842
  const i = t.reduceRight(
3817
3843
  ([r, ...n], a) => {
3818
- const c = oo(r), p = Hi(c.slice(a.pos, a.end));
3844
+ const c = lo(r), p = qi(c.slice(a.pos, a.end));
3819
3845
  return [
3820
3846
  c.slice(0, a.pos),
3821
3847
  /**
@@ -3833,13 +3859,13 @@ function no(e) {
3833
3859
  const s = i.at(-1);
3834
3860
  return (typeof s != "string" || s.trim() !== "") && i.push(" "), i;
3835
3861
  }
3836
- const Hi = (e) => e.startsWith("//") ? e.slice(2) : e.slice(2, -2);
3837
- function oo(e) {
3862
+ const qi = (e) => e.startsWith("//") ? e.slice(2) : e.slice(2, -2);
3863
+ function lo(e) {
3838
3864
  if (typeof e == "string")
3839
3865
  return e;
3840
3866
  throw new Error(`Expected string, got ${typeof e}: ${String(e)}`);
3841
3867
  }
3842
- function ao(e, t) {
3868
+ function co(e, t) {
3843
3869
  if (!(o.isPropertyAccessExpression(t.expression) && t.expression.name.text === "map"))
3844
3870
  return t;
3845
3871
  const s = t.arguments[0];
@@ -3849,9 +3875,9 @@ function ao(e, t) {
3849
3875
  if (!(typeof n == "object" && // If .map() callback has 3rd argument, it's not supported
3850
3876
  s.parameters.length <= 2))
3851
3877
  return t;
3852
- const c = ue(s.body);
3878
+ const c = me(s.body);
3853
3879
  let p = !0, l;
3854
- if (Kt(c))
3880
+ if (_t(c))
3855
3881
  l = c;
3856
3882
  else {
3857
3883
  if (!o.isBlock(c))
@@ -3859,24 +3885,24 @@ function ao(e, t) {
3859
3885
  const v = c.statements.at(-1);
3860
3886
  if (!(v && o.isReturnStatement(v) && v.expression))
3861
3887
  return t;
3862
- const S = ue(v.expression);
3863
- if (!Kt(S))
3888
+ const S = me(v.expression);
3889
+ if (!_t(S))
3864
3890
  return t;
3865
3891
  const k = c.statements.slice(0, -1);
3866
- if (k.some(qi))
3892
+ if (k.some(Vi))
3867
3893
  return t;
3868
3894
  p = k.length === 0, l = S;
3869
3895
  }
3870
- const d = o.isJsxElement(l) ? l.openingElement : l, f = Yi(d);
3871
- if (f === -1)
3896
+ const d = o.isJsxElement(l) ? l.openingElement : l, m = Zi(d);
3897
+ if (m === -1)
3872
3898
  return t;
3873
- const m = d.attributes.properties[f];
3874
- if (m === void 0 || !o.isJsxAttribute(m))
3899
+ const f = d.attributes.properties[m];
3900
+ if (f === void 0 || !o.isJsxAttribute(f))
3875
3901
  return t;
3876
- const g = ct(m.initializer, e.sourceFile), h = lo(n, s, g, p, e);
3902
+ const g = ct(f.initializer, e.sourceFile), h = po(n, s, g, p, e);
3877
3903
  if (h === void 0)
3878
3904
  return t;
3879
- e.liftedKeys.add(m.name), e.neededImports.add("repeat");
3905
+ e.liftedKeys.add(f.name), e.neededImports.add("repeat");
3880
3906
  const y = e.importRenames.repeat;
3881
3907
  return o.factory.updateCallExpression(t, o.factory.createIdentifier(y), t.typeArguments, [
3882
3908
  // From `items.map()` get `items`
@@ -3895,22 +3921,22 @@ function ao(e, t) {
3895
3921
  )
3896
3922
  ]);
3897
3923
  }
3898
- const Kt = (e) => o.isJsxElement(e) || o.isJsxSelfClosingElement(e);
3899
- function qi(e) {
3924
+ const _t = (e) => o.isJsxElement(e) || o.isJsxSelfClosingElement(e);
3925
+ function Vi(e) {
3900
3926
  if (o.isReturnStatement(e))
3901
3927
  return !0;
3902
3928
  let t = !1;
3903
3929
  return o.visitEachChild(
3904
3930
  e,
3905
- (i) => (t ||= qi(i), i),
3931
+ (i) => (t ||= Vi(i), i),
3906
3932
  void 0
3907
3933
  ), t;
3908
3934
  }
3909
- function lo(e, t, i, s, r) {
3910
- const n = J(i);
3935
+ function po(e, t, i, s, r) {
3936
+ const n = B(i);
3911
3937
  if (n === void 0)
3912
3938
  return;
3913
- let a = zi(e.name, n);
3939
+ let a = Gi(e.name, n);
3914
3940
  const c = t.parameters.at(1);
3915
3941
  if (c !== void 0 && o.isIdentifier(c.name) && // A more basic check is also provided in lumina/no-unnecessary-key rule
3916
3942
  n.every(xe, c.name)) {
@@ -3922,7 +3948,7 @@ function lo(e, t, i, s, r) {
3922
3948
  return;
3923
3949
  }
3924
3950
  if (!s) {
3925
- const p = po(n, a, t);
3951
+ const p = uo(n, a, t);
3926
3952
  if (p === void 0)
3927
3953
  return;
3928
3954
  a = p;
@@ -3938,38 +3964,38 @@ function lo(e, t, i, s, r) {
3938
3964
  e.initializer
3939
3965
  );
3940
3966
  }
3941
- function J(e) {
3967
+ function B(e) {
3942
3968
  if (o.isIdentifier(e))
3943
3969
  return [e.text];
3944
3970
  if (o.isPropertyAccessExpression(e))
3945
- return J(e.expression);
3971
+ return B(e.expression);
3946
3972
  if (o.isElementAccessExpression(e))
3947
- return J(e.argumentExpression);
3973
+ return B(e.argumentExpression);
3948
3974
  if (o.isConditionalExpression(e)) {
3949
- const t = J(e.condition), i = J(e.whenTrue), s = J(e.whenFalse);
3975
+ const t = B(e.condition), i = B(e.whenTrue), s = B(e.whenFalse);
3950
3976
  return t === void 0 || i === void 0 || s === void 0 ? void 0 : [...t, ...i, ...s];
3951
3977
  } else if (o.isBinaryExpression(e)) {
3952
- const t = J(e.left), i = J(e.right);
3978
+ const t = B(e.left), i = B(e.right);
3953
3979
  return t === void 0 || i === void 0 ? void 0 : [...t, ...i];
3954
3980
  } else if (o.isTemplateExpression(e)) {
3955
3981
  const t = [];
3956
3982
  for (const i of e.templateSpans) {
3957
- const s = J(i.expression);
3983
+ const s = B(i.expression);
3958
3984
  if (s === void 0)
3959
3985
  return;
3960
3986
  t.push(...s);
3961
3987
  }
3962
3988
  return t;
3963
3989
  } else {
3964
- if (co.has(e.kind))
3990
+ if (mo.has(e.kind))
3965
3991
  return [];
3966
3992
  {
3967
- const t = ue(e);
3968
- return t !== e ? J(t) : void 0;
3993
+ const t = me(e);
3994
+ return t !== e ? B(t) : void 0;
3969
3995
  }
3970
3996
  }
3971
3997
  }
3972
- const co = /* @__PURE__ */ new Set([
3998
+ const mo = /* @__PURE__ */ new Set([
3973
3999
  o.SyntaxKind.NumericLiteral,
3974
4000
  o.SyntaxKind.BigIntLiteral,
3975
4001
  o.SyntaxKind.StringLiteral,
@@ -3978,20 +4004,20 @@ const co = /* @__PURE__ */ new Set([
3978
4004
  o.SyntaxKind.FalseKeyword,
3979
4005
  o.SyntaxKind.NullKeyword,
3980
4006
  o.SyntaxKind.TrueKeyword
3981
- ]), ue = (e) => o.isAsExpression(e) || o.isNonNullExpression(e) || o.isSatisfiesExpression(e) || o.isParenthesizedExpression(e) ? ue(e.expression) : e, zi = (e, t) => o.isObjectBindingPattern(e) ? fo(e, t) : e;
3982
- function po(e, t, i) {
4007
+ ]), me = (e) => o.isAsExpression(e) || o.isNonNullExpression(e) || o.isSatisfiesExpression(e) || o.isParenthesizedExpression(e) ? me(e.expression) : e, Gi = (e, t) => o.isObjectBindingPattern(e) ? ho(e, t) : e;
4008
+ function uo(e, t, i) {
3983
4009
  if (e.every(xe, t))
3984
4010
  return t;
3985
4011
  if (o.isIdentifier(t)) {
3986
- const s = o.isBlock(i.body) ? He(i.body.statements, (n) => uo(n, t)) : void 0;
4012
+ const s = o.isBlock(i.body) ? ze(i.body.statements, (n) => fo(n, t)) : void 0;
3987
4013
  if (s === void 0)
3988
4014
  return;
3989
- const r = zi(s, e);
4015
+ const r = Gi(s, e);
3990
4016
  if (e.every(xe, r))
3991
4017
  return r;
3992
4018
  }
3993
4019
  }
3994
- function uo(e, t) {
4020
+ function fo(e, t) {
3995
4021
  if (!o.isVariableStatement(e) || !(e.declarationList.flags & o.NodeFlags.Const))
3996
4022
  return;
3997
4023
  const i = e.declarationList.declarations[0];
@@ -3999,53 +4025,53 @@ function uo(e, t) {
3999
4025
  }
4000
4026
  function xe(e) {
4001
4027
  const t = this;
4002
- return o.isIdentifier(t) ? t.text === e : t.elements.some(mo, e);
4028
+ return o.isIdentifier(t) ? t.text === e : t.elements.some(go, e);
4003
4029
  }
4004
- function mo(e) {
4030
+ function go(e) {
4005
4031
  const t = this;
4006
4032
  return o.isOmittedExpression(e) ? !1 : xe.call(e.name, t);
4007
4033
  }
4008
- function fo(e, t) {
4034
+ function ho(e, t) {
4009
4035
  let i = !1;
4010
4036
  const s = e.elements.filter((r) => o.isIdentifier(r.name) ? t.includes(r.name.text) : (i = !0, !0));
4011
4037
  return i || s.length === 0 ? e : o.factory.updateObjectBindingPattern(e, s);
4012
4038
  }
4013
- const Vi = (e, t) => t.liftedKeys.has(e);
4014
- function z(e, t, i) {
4039
+ const Xi = (e, t) => t.liftedKeys.has(e);
4040
+ function q(e, t, i) {
4015
4041
  if (de(i))
4016
- return Gi(e, i);
4017
- const s = o.isCallExpression(i) ? ao(e, i) : i, r = o.visitEachChild(
4042
+ return Yi(e, i);
4043
+ const s = o.isCallExpression(i) ? co(e, i) : i, r = o.visitEachChild(
4018
4044
  s,
4019
4045
  // Do not add "" if parent is binary expression to not turn {(a && <b />) || c} into {(a && <b />) || "" || c}
4020
- z.bind(null, e, t !== void 0 && o.isBinaryExpression(t) ? void 0 : i),
4046
+ q.bind(null, e, t !== void 0 && o.isBinaryExpression(t) ? void 0 : i),
4021
4047
  e.transformationContext
4022
4048
  );
4023
- return t !== void 0 && o.isBinaryExpression(i) && (o.isJsxExpression(t) || de(ue(i.right)) || Qs(i.right)) ? yo(r) : r;
4049
+ return t !== void 0 && o.isBinaryExpression(i) && (o.isJsxExpression(t) || de(me(i.right)) || er(i.right)) ? bo(r) : r;
4024
4050
  }
4025
- function Gi(e, t) {
4026
- const i = Xi(e, t);
4051
+ function Yi(e, t) {
4052
+ const i = Qi(e, t);
4027
4053
  return Le(i, e);
4028
4054
  }
4029
- function Xi(e, t) {
4055
+ function Qi(e, t) {
4030
4056
  const i = "children" in t ? t.children : [];
4031
4057
  if (o.isJsxFragment(t))
4032
4058
  return { key: void 0, ...Ee(i, e) };
4033
4059
  const r = o.isJsxElement(t) ? t.openingElement : t, n = r.tagName;
4034
4060
  if (o.isJsxNamespacedName(n))
4035
4061
  throw Error(`JSX namespaced elements are not supported. Found ${n.getText(e.sourceFile)} `);
4036
- if (!o.isIdentifier(n) || !n.text.startsWith(n.text[0].toLowerCase()) && n.text !== De && n.text !== Oe) {
4037
- const w = o.isIdentifier(n) && n.text === Ds ? Ee(i, e) : {
4062
+ if (!o.isIdentifier(n) || !n.text.startsWith(n.text[0].toLowerCase()) && n.text !== Re && n.text !== Oe) {
4063
+ const w = o.isIdentifier(n) && n.text === Ms ? Ee(i, e) : {
4038
4064
  // No need to wrap the function call in a lit-html tag
4039
4065
  litTag: void 0,
4040
- parts: [ho(e, t, n, i)]
4066
+ parts: [vo(e, t, n, i)]
4041
4067
  };
4042
4068
  return {
4043
- key: go(r, e),
4069
+ key: yo(r, e),
4044
4070
  ...w
4045
4071
  };
4046
4072
  }
4047
- const c = n.text === De ? Te : n.text === Oe ? qe : n.text, p = n.text === De ? se : n.text === Oe ? G : Ms.has(c) ? li : it.has(c) ? ee : re, l = rt(c), d = l ? e.localComponents[c]?.requiredProperties : void 0, f = d === void 0 ? void 0 : new Set(d);
4048
- let m;
4073
+ const c = n.text === Re ? Te : n.text === Oe ? He : n.text, p = n.text === Re ? se : n.text === Oe ? X : Bs.has(c) ? ci : it.has(c) ? ee : re, l = rt(c), d = l ? e.localComponents[c]?.requiredProperties : void 0, m = d === void 0 ? void 0 : new Set(d);
4074
+ let f;
4049
4075
  const g = [];
4050
4076
  let h = !1;
4051
4077
  const y = r.attributes.properties.flatMap((x) => {
@@ -4057,34 +4083,34 @@ Found ${x.getText(e.sourceFile)}`
4057
4083
  const { name: w, initializer: L } = x;
4058
4084
  if (o.isJsxNamespacedName(w))
4059
4085
  throw Error(`JSX namespaced attributes are not supported. Found ${w.getText(e.sourceFile)}`);
4060
- const A = w.text, H = Qn(L), j = H?.propType ?? Zn(A, L, c);
4061
- f?.delete(A);
4062
- const N = Vn[j](e, H?.initializer ?? L, A, c);
4086
+ const A = w.text, z = eo(L), j = z?.propType ?? to(A, L, c);
4087
+ m?.delete(A);
4088
+ const N = Xn[j](e, z?.initializer ?? L, A, c);
4063
4089
  if (N.length === 0)
4064
4090
  return [];
4065
- const K = e.compiler.shouldMinifyJsx ? [" "] : no(Ui(w, e));
4066
- return j === "key" ? (m = typeof N[0] == "object" && !Vi(w, e) ? N[0] : void 0, K.some(io) ? K : []) : j === "directives" || j === "ref" || A === "deferLoad" ? (h ||= j === "deferLoad", g.push(
4091
+ const K = e.compiler.shouldMinifyJsx ? [" "] : ao(zi(w, e));
4092
+ return j === "key" ? (f = typeof N[0] == "object" && !Xi(w, e) ? N[0] : void 0, K.some(ro) ? K : []) : j === "directives" || j === "ref" || A === "deferLoad" ? (h ||= j === "deferLoad", g.push(
4067
4093
  ...K,
4068
4094
  ...N.flatMap(
4069
- (R, O) => typeof R == "string" || O === 0 || typeof N[O - 1] == "string" ? R : [" ", R]
4095
+ (D, M) => typeof D == "string" || M === 0 || typeof N[M - 1] == "string" ? D : [" ", D]
4070
4096
  )
4071
4097
  ), []) : [...K, ...N];
4072
4098
  });
4073
- if (f !== void 0 && f.size > 0 && e.compiler.logLintError(
4099
+ if (m !== void 0 && m.size > 0 && e.compiler.logLintError(
4074
4100
  "mustIncludeAllRequiredProperties",
4075
4101
  e.sourceFile.fileName,
4076
- `Missing required properties for <${c}> }: ${Array.from(f).join(", ")}`
4102
+ `Missing required properties for <${c}> }: ${Array.from(m).join(", ")}`
4077
4103
  ), g.length > 0 && y.push(...g), typeof c == "string" && st.has(c))
4078
4104
  throw Error(
4079
4105
  `JSX syntax for MathML elements is not yet supported. If you need it, please request it. Otherwise, use the \`math\` function from Lit directly. Tried to use the "${c}" element`
4080
4106
  );
4081
4107
  l && (h ? e.customElementsToImportDeferred.add(c) : e.customElementsToImport.add(c));
4082
- const v = typeof c == "string" && Os.has(c), C = Ee(i, e);
4108
+ const v = typeof c == "string" && Js.has(c), C = Ee(i, e);
4083
4109
  if (v && C.parts.length > 0)
4084
4110
  throw Error(
4085
4111
  `Void HTML elements like <${c}> cannot have children. Found ${t.getText(e.sourceFile)}`
4086
4112
  );
4087
- const S = (p === ee || p === G) && C.parts.length === 0, k = [
4113
+ const S = (p === ee || p === X) && C.parts.length === 0, k = [
4088
4114
  "<",
4089
4115
  typeof c == "string" ? c : n,
4090
4116
  ...y,
@@ -4101,24 +4127,24 @@ Found ${x.getText(e.sourceFile)}`
4101
4127
  typeof c == "string" ? c : n,
4102
4128
  ">"
4103
4129
  ];
4104
- return { key: m, parts: T, litTag: p };
4130
+ return { key: f, parts: T, litTag: p };
4105
4131
  }
4106
- function go(e, t) {
4107
- const i = e.attributes.properties[Yi(e)];
4108
- return i && o.isJsxAttribute(i) && !Vi(i.name, t) ? ct(i.initializer, t.sourceFile) : void 0;
4132
+ function yo(e, t) {
4133
+ const i = e.attributes.properties[Zi(e)];
4134
+ return i && o.isJsxAttribute(i) && !Xi(i.name, t) ? ct(i.initializer, t.sourceFile) : void 0;
4109
4135
  }
4110
- const Yi = (e) => e.attributes.properties.findIndex(({ name: t }) => t && o.isIdentifier(t) && t.text === "key");
4111
- function ho(e, t, i, s) {
4136
+ const Zi = (e) => e.attributes.properties.findIndex(({ name: t }) => t && o.isIdentifier(t) && t.text === "key");
4137
+ function vo(e, t, i, s) {
4112
4138
  const n = (o.isJsxElement(t) ? t.openingElement : t).attributes.properties.map((p) => {
4113
4139
  if (o.isJsxSpreadAttribute(p))
4114
- return Wi(Ui(p, e), o.factory.createSpreadAssignment(p.expression));
4140
+ return Hi(zi(p, e), o.factory.createSpreadAssignment(p.expression));
4115
4141
  const { name: l, initializer: d } = p;
4116
4142
  if (o.isJsxNamespacedName(l))
4117
4143
  throw Error(`JSX namespaced attributes are not supported. Found ${l.getText(e.sourceFile)}`);
4118
4144
  if (l.text === "key")
4119
4145
  return;
4120
- const f = d === void 0 ? o.factory.createTrue() : o.isStringLiteral(d) ? d : de(d) ? Gi(e, d) : z(e, void 0, d.expression ?? o.factory.createIdentifier("undefined")), m = ei(l.text) ? o.factory.createStringLiteral(l.text) : l;
4121
- return o.factory.createPropertyAssignment(m, f);
4146
+ const m = d === void 0 ? o.factory.createTrue() : o.isStringLiteral(d) ? d : de(d) ? Yi(e, d) : q(e, void 0, d.expression ?? o.factory.createIdentifier("undefined")), f = ti(l.text) ? o.factory.createStringLiteral(l.text) : l;
4147
+ return o.factory.createPropertyAssignment(f, m);
4122
4148
  }), { parts: a, litTag: c } = Ee(s, e);
4123
4149
  return a.length > 0 && n.push(
4124
4150
  o.factory.createPropertyAssignment(
@@ -4133,13 +4159,13 @@ function Ee(e, t) {
4133
4159
  let i;
4134
4160
  const s = e.flatMap((r) => {
4135
4161
  if (o.isJsxText(r))
4136
- return [t.compiler.shouldMinifyJsx ? Bs(r.text) : r.text];
4162
+ return [t.compiler.shouldMinifyJsx ? _s(r.text) : r.text];
4137
4163
  if (o.isJsxExpression(r))
4138
4164
  return pt(t, r, r);
4139
4165
  {
4140
- const n = Xi(t, r);
4141
- if (n.key === void 0 && n.litTag !== se && n.litTag !== G) {
4142
- if (n.litTag === li)
4166
+ const n = Qi(t, r);
4167
+ if (n.key === void 0 && n.litTag !== se && n.litTag !== X) {
4168
+ if (n.litTag === ci)
4143
4169
  return n.parts;
4144
4170
  if (i !== void 0 && n.litTag !== void 0 && i !== n.litTag)
4145
4171
  throw new Error(
@@ -4152,7 +4178,7 @@ function Ee(e, t) {
4152
4178
  });
4153
4179
  return { litTag: i, parts: s };
4154
4180
  }
4155
- function yo(e) {
4181
+ function bo(e) {
4156
4182
  return e.operatorToken.kind === o.SyntaxKind.AmpersandAmpersandToken ? o.factory.createBinaryExpression(
4157
4183
  e,
4158
4184
  o.factory.createToken(o.SyntaxKind.BarBarToken),
@@ -4164,9 +4190,9 @@ function pt(e, t, i) {
4164
4190
  if (e.compiler.shouldMinifyJsx)
4165
4191
  return [];
4166
4192
  const s = t.getText(e.sourceFile).slice(1, -1);
4167
- return dt(s).length === 0 ? [] : [Wi(s, o.factory.createIdentifier("undefined"))];
4193
+ return dt(s).length === 0 ? [] : [Hi(s, o.factory.createIdentifier("undefined"))];
4168
4194
  }
4169
- return o.isStringLiteral(t.expression) ? [ai(t.expression.text)] : (
4195
+ return o.isStringLiteral(t.expression) ? [li(t.expression.text)] : (
4170
4196
  /**
4171
4197
  * There is a bug in Chrome DevTools, where it won't let you set a
4172
4198
  * breakpoint inside a tagged template literal. It seems like they did
@@ -4187,7 +4213,7 @@ function pt(e, t, i) {
4187
4213
  * making this change useless.
4188
4214
  */
4189
4215
  e.compiler.viteCommand === "serve" && e.compiler.viteConfig.build.sourcemap !== !1 && !e.compiler.shouldMinifyJsx && o.isArrowFunction(t.expression) && !o.isBlock(t.expression.body) ? [
4190
- z(
4216
+ q(
4191
4217
  e,
4192
4218
  i,
4193
4219
  o.factory.updateArrowFunction(
@@ -4200,29 +4226,29 @@ function pt(e, t, i) {
4200
4226
  o.factory.createBlock([o.factory.createReturnStatement(t.expression.body)], !0)
4201
4227
  )
4202
4228
  )
4203
- ] : [z(e, i, t.expression)]
4229
+ ] : [q(e, i, t.expression)]
4204
4230
  );
4205
4231
  }
4206
- const Qi = (e) => e.reduce((t, [i, s]) => (t[i] ??= [], t[i].push(s), t), {}), Zi = Qi(
4232
+ const es = (e) => e.reduce((t, [i, s]) => (t[i] ??= [], t[i].push(s), t), {}), ts = es(
4207
4233
  Object.entries(te).flatMap(
4208
4234
  ([e, t]) => t.map((i) => [i, e])
4209
4235
  )
4210
- ), es = new Set(Object.keys(Zi));
4211
- function vo(e, t) {
4236
+ ), is = new Set(Object.keys(ts));
4237
+ function wo(e, t) {
4212
4238
  const i = t.importClause, s = i === void 0, r = t.moduleSpecifier;
4213
4239
  if (!o.isStringLiteral(r))
4214
4240
  return t;
4215
- const n = bo(e.sourceFile.fileName, r.text, ""), a = !i?.isTypeOnly;
4216
- if (a && e.existingImportedModules.add(n), er.test(r.text) && // If id already includes ?, bypass our custom behavior
4241
+ const n = So(e.sourceFile.fileName, r.text, ""), a = !i?.isTypeOnly;
4242
+ if (a && e.existingImportedModules.add(n), ir.test(r.text) && // If id already includes ?, bypass our custom behavior
4217
4243
  !r.text.includes("?")) {
4218
4244
  if (s) {
4219
4245
  if (e.compiler.viteCommand !== "build" || e.compiler.isInStorybook || e.compiler.isInTest)
4220
4246
  return t;
4221
- const l = e.sourceFile.fileName, d = l.includes("/node_modules/") || l.includes("/dist/"), f = `import "${r.text}"`;
4247
+ const l = e.sourceFile.fileName, d = l.includes("/node_modules/") || l.includes("/dist/"), m = `import "${r.text}"`;
4222
4248
  throw Error(
4223
- d ? `Unexpected case: during build, all node_modules runtime dependencies should be externalized (unless explicitly configured otherwise). ${l} is not externalized, and it contains a side-effect CSS import \`${f}\`. How should such CSS import be handled? Options:
4249
+ d ? `Unexpected case: during build, all node_modules runtime dependencies should be externalized (unless explicitly configured otherwise). ${l} is not externalized, and it contains a side-effect CSS import \`${m}\`. How should such CSS import be handled? Options:
4224
4250
  1. (suggested) Externalize ${l}, which will make end-user's bundler treat this CSS import as global CSS.
4225
- 2. Write a transform() plugin to drop the CSS import from ${l}, and then manually import the CSS as needed inside your shadow root or your library's global CSS file.` : `${l}: Found a side-effect CSS import \`${f}\`. Such import is not allowed as it won't work with shadow DOM. Please use \`import { styles } from "${r.text}";\` instead and then add \`static override styles = styles;\` to your component. If this needs to be global CSS, @import it inside your global CSS file`
4251
+ 2. Write a transform() plugin to drop the CSS import from ${l}, and then manually import the CSS as needed inside your shadow root or your library's global CSS file.` : `${l}: Found a side-effect CSS import \`${m}\`. Such import is not allowed as it won't work with shadow DOM. Please use \`import { styles } from "${r.text}";\` instead and then add \`static override styles = styles;\` to your component. If this needs to be global CSS, @import it inside your global CSS file`
4226
4252
  );
4227
4253
  }
4228
4254
  return o.factory.updateImportDeclaration(
@@ -4233,40 +4259,40 @@ function vo(e, t) {
4233
4259
  // runs for .tsx files, so .css imports in .ts files won't work. However,
4234
4260
  // that is unlikely for web component libraries. A workaround is to
4235
4261
  // rename the file or explicitly add (undocumented) ?litCss flag
4236
- o.factory.createStringLiteral(r.text + (e.isInLightDomComponent ? X : $e)),
4262
+ o.factory.createStringLiteral(r.text + (e.isInLightDomComponent ? Y : $e)),
4237
4263
  t.attributes
4238
4264
  );
4239
4265
  }
4240
4266
  if (s)
4241
4267
  return t;
4242
4268
  if (i.name !== void 0) {
4243
- const l = i.name.text, d = i.name.text.startsWith(l[0].toUpperCase()), f = u.isAbsolute(n);
4244
- a && !i.isTypeOnly && d && f && e.importedFunctionComponentsFromModules.add(n);
4269
+ const l = i.name.text, d = i.name.text.startsWith(l[0].toUpperCase()), m = u.isAbsolute(n);
4270
+ a && !i.isTypeOnly && d && m && e.importedFunctionComponentsFromModules.add(n);
4245
4271
  }
4246
4272
  const c = i.namedBindings;
4247
4273
  if (c === void 0 || !o.isNamedImports(c))
4248
4274
  return t;
4249
- const p = es.has(r.text);
4275
+ const p = is.has(r.text);
4250
4276
  if (c.elements.forEach((l) => {
4251
- const d = (l.propertyName ?? l.name).text, f = te[d];
4277
+ const d = (l.propertyName ?? l.name).text, m = te[d];
4252
4278
  if (p) {
4253
- if (f?.some((h) => h === r.text)) {
4254
- const h = ts(d, n);
4279
+ if (m?.some((h) => h === r.text)) {
4280
+ const h = ss(d, n);
4255
4281
  e.existingLitImports.add(h), e.importRenames[h] = l.name?.text ?? h;
4256
4282
  }
4257
- } else (l.name.text === "h" || l.name.text === "createElement") && D().name !== "@arcgis/lumina" && (e.hasNonLuminaJsxImport = !0);
4258
- const m = d.startsWith(d[0].toUpperCase()), g = u.isAbsolute(n);
4259
- a && !l.isTypeOnly && m && g && e.importedFunctionComponentsFromModules.add(n);
4283
+ } else (l.name.text === "h" || l.name.text === "createElement") && O().name !== "@arcgis/lumina" && (e.hasNonLuminaJsxImport = !0);
4284
+ const f = d.startsWith(d[0].toUpperCase()), g = u.isAbsolute(n);
4285
+ a && !l.isTypeOnly && f && g && e.importedFunctionComponentsFromModules.add(n);
4260
4286
  }), r.text === "@arcgis/lumina") {
4261
4287
  let l = !1;
4262
- const d = c.elements.filter((m) => {
4263
- const g = (m.propertyName ?? m.name).text;
4264
- return Zs.has(g) ? !1 : (l ||= !m.isTypeOnly, !0);
4288
+ const d = c.elements.filter((f) => {
4289
+ const g = (f.propertyName ?? f.name).text;
4290
+ return tr.has(g) ? !1 : (l ||= !f.isTypeOnly, !0);
4265
4291
  });
4266
4292
  if (d.length === 0)
4267
4293
  return;
4268
4294
  if (d.length !== c.elements.length) {
4269
- const m = i.isTypeOnly || !l, g = l ? d : d.map(
4295
+ const f = i.isTypeOnly || !l, g = l ? d : d.map(
4270
4296
  (h) => o.factory.updateImportSpecifier(
4271
4297
  h,
4272
4298
  !1,
@@ -4279,7 +4305,7 @@ function vo(e, t) {
4279
4305
  t.modifiers,
4280
4306
  o.factory.updateImportClause(
4281
4307
  i,
4282
- m,
4308
+ f,
4283
4309
  i.name,
4284
4310
  o.factory.updateNamedImports(c, g)
4285
4311
  ),
@@ -4290,22 +4316,22 @@ function vo(e, t) {
4290
4316
  }
4291
4317
  return t;
4292
4318
  }
4293
- const ts = (e, t) => e === re && te.staticHtml.includes(t) ? se : e === ee && te.staticSvg.includes(t) ? G : e, bo = (e, t, i) => t.startsWith(".") ? u.resolve(e, "..", `${t}${i}`) : t;
4294
- function wo(e) {
4295
- return o.isImportDeclaration(e) ? So(this, e) : e;
4319
+ const ss = (e, t) => e === re && te.staticHtml.includes(t) ? se : e === ee && te.staticSvg.includes(t) ? X : e, So = (e, t, i) => t.startsWith(".") ? u.resolve(e, "..", `${t}${i}`) : t;
4320
+ function Eo(e) {
4321
+ return o.isImportDeclaration(e) ? Co(this, e) : e;
4296
4322
  }
4297
- function So(e, t) {
4323
+ function Co(e, t) {
4298
4324
  const i = t.importClause, s = i?.namedBindings, r = t.moduleSpecifier;
4299
- if (!o.isStringLiteral(r) || !s || !o.isNamedImports(s) || !es.has(r.text))
4325
+ if (!o.isStringLiteral(r) || !s || !o.isNamedImports(s) || !is.has(r.text))
4300
4326
  return t;
4301
4327
  const n = i.isTypeOnly;
4302
4328
  let a = !1;
4303
4329
  const c = s.elements.map((p) => {
4304
- const l = (p.propertyName ?? p.name).text, d = ts(l, r.text);
4330
+ const l = (p.propertyName ?? p.name).text, d = ss(l, r.text);
4305
4331
  return e.existingLitImports.delete(d), e.neededImports.has(d) ? (e.neededImports.delete(d), a = !0, o.factory.updateImportSpecifier(p, !1, p.propertyName, p.name)) : n ? o.factory.updateImportSpecifier(p, !0, p.propertyName, p.name) : p;
4306
4332
  });
4307
- return Zi[r.text]?.forEach((p) => {
4308
- !e.neededImports.has(p) || e.existingLitImports.has(p) || (e.neededImports.delete(p), a = !0, c.push(is(p, e)));
4333
+ return ts[r.text]?.forEach((p) => {
4334
+ !e.neededImports.has(p) || e.existingLitImports.has(p) || (e.neededImports.delete(p), a = !0, c.push(rs(p, e)));
4309
4335
  }), a ? o.factory.updateImportDeclaration(
4310
4336
  t,
4311
4337
  t.modifiers,
@@ -4319,8 +4345,8 @@ function So(e, t) {
4319
4345
  t.attributes
4320
4346
  ) : t;
4321
4347
  }
4322
- function Eo(e) {
4323
- const t = Qi(
4348
+ function To(e) {
4349
+ const t = es(
4324
4350
  Array.from(e.neededImports, (i) => [te[i][0], i])
4325
4351
  );
4326
4352
  return Object.entries(t).map(
@@ -4330,27 +4356,27 @@ function Eo(e) {
4330
4356
  !1,
4331
4357
  void 0,
4332
4358
  o.factory.createNamedImports(
4333
- s.map((r) => (e.neededImports.delete(r), is(r, e)))
4359
+ s.map((r) => (e.neededImports.delete(r), rs(r, e)))
4334
4360
  )
4335
4361
  ),
4336
4362
  o.factory.createStringLiteral(i)
4337
4363
  )
4338
4364
  );
4339
4365
  }
4340
- function is(e, t) {
4341
- const i = e === se ? re : e === G ? ee : e, s = t.importRenames[e];
4366
+ function rs(e, t) {
4367
+ const i = e === se ? re : e === X ? ee : e, s = t.importRenames[e];
4342
4368
  return s === i ? o.factory.createImportSpecifier(!1, void 0, o.factory.createIdentifier(i)) : o.factory.createImportSpecifier(
4343
4369
  !1,
4344
4370
  o.factory.createIdentifier(i),
4345
4371
  o.factory.createIdentifier(s)
4346
4372
  );
4347
4373
  }
4348
- function Co(e) {
4349
- const t = wr().map(({ packageName: i }) => i);
4374
+ function $o(e) {
4375
+ const t = Er().map(({ packageName: i }) => i);
4350
4376
  return e.existingImportedModules.forEach((i) => {
4351
4377
  if (u.isAbsolute(i))
4352
4378
  return;
4353
- const s = Fs(i), r = i.slice(s.length + 1);
4379
+ const s = Rs(i), r = i.slice(s.length + 1);
4354
4380
  if (t.includes(s ?? "") && (r.startsWith("dist/components") || r.startsWith("components"))) {
4355
4381
  const n = Ae(e.sourceFile.fileName);
4356
4382
  throw new Error(
@@ -4359,7 +4385,7 @@ function Co(e) {
4359
4385
  }
4360
4386
  }), [];
4361
4387
  }
4362
- function To(e) {
4388
+ function Po(e) {
4363
4389
  if (e.compiler.viteCommand === "serve")
4364
4390
  return e.customElementsToImport.clear(), e.customElementsToImportDeferred.clear(), [];
4365
4391
  const t = e.compiler._customElementDependencies;
@@ -4374,17 +4400,17 @@ function To(e) {
4374
4400
  t[s] ??= { referencedBy: [], referencedTagNames: [], referencedDeferredTagNames: [] }, t[s].referencedBy.push(e.sourceFile.fileName);
4375
4401
  }), [];
4376
4402
  }
4377
- const $o = (e, t) => {
4403
+ const Io = (e, t) => {
4378
4404
  const i = e.pragmas;
4379
4405
  if (i?.has("jsx") === !0 || i?.has("jsxImportSource") === !0)
4380
4406
  return e.statements;
4381
4407
  const s = {
4382
4408
  compiler: t.compiler,
4383
- externalComponents: bi(),
4384
- localComponents: Ki(t.compiler),
4409
+ externalComponents: wi(),
4410
+ localComponents: Ui(t.compiler),
4385
4411
  sourceFile: e,
4386
4412
  transformationContext: t.transformation,
4387
- importRenames: Po(e),
4413
+ importRenames: ko(e),
4388
4414
  existingImportedModules: /* @__PURE__ */ new Set(),
4389
4415
  importedFunctionComponentsFromModules: /* @__PURE__ */ new Set(),
4390
4416
  existingLitImports: /* @__PURE__ */ new Set(),
@@ -4400,21 +4426,21 @@ const $o = (e, t) => {
4400
4426
  let r = [];
4401
4427
  if (e.statements.every((a) => {
4402
4428
  if (o.isImportDeclaration(a)) {
4403
- const c = vo(s, a);
4429
+ const c = wo(s, a);
4404
4430
  if (c === void 0)
4405
4431
  return !0;
4406
4432
  if (r.push(c), s.hasNonLuminaJsxImport)
4407
4433
  return !1;
4408
4434
  } else
4409
- r.push(z(s, void 0, a));
4435
+ r.push(q(s, void 0, a));
4410
4436
  return !0;
4411
4437
  }), s.hasNonLuminaJsxImport)
4412
4438
  return e.statements;
4413
- if (s.neededImports.size > 0 && (r = r.map(wo, s), s.existingLitImports.size > 0))
4439
+ if (s.neededImports.size > 0 && (r = r.map(Eo, s), s.existingLitImports.size > 0))
4414
4440
  throw new Error(
4415
4441
  `Expected context.existingLitImports to be empty by now. Found: ${Array.from(s.existingLitImports).join(", ")}`
4416
4442
  );
4417
- const n = [Eo, Co, To].flatMap(
4443
+ const n = [To, $o, Po].flatMap(
4418
4444
  (a) => a(s)
4419
4445
  );
4420
4446
  if (s.neededImports.size > 0)
@@ -4423,24 +4449,24 @@ const $o = (e, t) => {
4423
4449
  );
4424
4450
  return [...n, ...r];
4425
4451
  };
4426
- function Po(e) {
4427
- return Io(e), Object.fromEntries(
4428
- Ys.map((t) => [t, e.identifiers.has(t) ? `${t}$jsx` : t])
4452
+ function ko(e) {
4453
+ return xo(e), Object.fromEntries(
4454
+ Zs.map((t) => [t, e.identifiers.has(t) ? `${t}$jsx` : t])
4429
4455
  );
4430
4456
  }
4431
- function Io(e) {
4457
+ function xo(e) {
4432
4458
  if (!("identifiers" in e))
4433
4459
  throw new Error(
4434
4460
  "Expected sourceFile to have an undocumented identifiers property that is a Map<string,string>. If this error is thrown, it may mean Lumina Compiler needs to be updated to support the version of TypeScript being used."
4435
4461
  );
4436
4462
  }
4437
- const _t = "customElement", ko = (e, t) => {
4463
+ const Ut = "customElement", Ao = (e, t) => {
4438
4464
  const i = [];
4439
4465
  if (t.apiModule?.declarations.forEach((n) => {
4440
4466
  const a = n;
4441
4467
  a.customElement !== void 0 && i.push(
4442
4468
  o.factory.createExpressionStatement(
4443
- o.factory.createCallExpression(o.factory.createIdentifier(_t), void 0, [
4469
+ o.factory.createCallExpression(o.factory.createIdentifier(Ut), void 0, [
4444
4470
  o.factory.createStringLiteral(a.tagName ?? ""),
4445
4471
  o.factory.createIdentifier(a.name)
4446
4472
  ])
@@ -4458,13 +4484,13 @@ const _t = "customElement", ko = (e, t) => {
4458
4484
  !1,
4459
4485
  void 0,
4460
4486
  o.factory.createNamedImports([
4461
- o.factory.createImportSpecifier(!1, void 0, o.factory.createIdentifier(_t))
4487
+ o.factory.createImportSpecifier(!1, void 0, o.factory.createIdentifier(Ut))
4462
4488
  ])
4463
4489
  ),
4464
4490
  o.factory.createStringLiteral(s)
4465
4491
  ), ...e.statements, ...i];
4466
4492
  };
4467
- function xo(e, t, i) {
4493
+ function No(e, t, i) {
4468
4494
  return t.size === 0 ? e : [
4469
4495
  o.factory.createPropertyDeclaration(
4470
4496
  [
@@ -4478,8 +4504,8 @@ function xo(e, t, i) {
4478
4504
  Array.from(
4479
4505
  t.entries(),
4480
4506
  ([s, r]) => o.factory.createPropertyAssignment(
4481
- ei(s) ? o.factory.createStringLiteral(s) : s,
4482
- Ao(r, i)
4507
+ ti(s) ? o.factory.createStringLiteral(s) : s,
4508
+ Lo(r, i)
4483
4509
  )
4484
4510
  )
4485
4511
  )
@@ -4487,7 +4513,7 @@ function xo(e, t, i) {
4487
4513
  ...e
4488
4514
  ];
4489
4515
  }
4490
- function Ao(e, t) {
4516
+ function Lo(e, t) {
4491
4517
  let i = 0, s = !0;
4492
4518
  const r = [], n = [];
4493
4519
  for (const p of e.properties)
@@ -4495,22 +4521,22 @@ function Ao(e, t) {
4495
4521
  function a(p) {
4496
4522
  if (!o.isPropertyAssignment(p) || !o.isIdentifier(p.name))
4497
4523
  return !0;
4498
- const l = p.name.text, d = p.initializer, f = d.kind === o.SyntaxKind.TrueKeyword, m = d.kind === o.SyntaxKind.FalseKeyword;
4524
+ const l = p.name.text, d = p.initializer, m = d.kind === o.SyntaxKind.TrueKeyword, f = d.kind === o.SyntaxKind.FalseKeyword;
4499
4525
  if (l === "attribute")
4500
- return s = !1, i |= f ? ht : 0, !f && !m;
4526
+ return s = !1, i |= m ? ht : 0, !m && !f;
4501
4527
  if (l === "reflect")
4502
- return i |= f ? us : 0, !1;
4528
+ return i |= m ? fs : 0, !1;
4503
4529
  if (l === "type" && o.isIdentifier(d)) {
4504
4530
  if (d.text === "Boolean")
4505
- return i |= ms, !1;
4531
+ return i |= gs, !1;
4506
4532
  if (d.text === "Number")
4507
- return i |= fs, !1;
4533
+ return i |= hs, !1;
4508
4534
  } else {
4509
4535
  if (l === "state")
4510
- return s = !1, i |= f ? gs : 0, !1;
4536
+ return s = !1, i |= m ? ys : 0, !1;
4511
4537
  if (l === "readOnly")
4512
- return i |= f ? hs : 0, !1;
4513
- l === "noAccessor" && (i |= f ? ys : 0);
4538
+ return i |= m ? vs : 0, !1;
4539
+ l === "noAccessor" && (i |= m ? bs : 0);
4514
4540
  }
4515
4541
  return !0;
4516
4542
  }
@@ -4529,35 +4555,35 @@ function Ao(e, t) {
4529
4555
  ...t ? [] : [o.factory.createObjectLiteralExpression(n)]
4530
4556
  ]);
4531
4557
  }
4532
- function No(e, t, i) {
4558
+ function jo(e, t, i) {
4533
4559
  let s = -1, r = -1, n = -1;
4534
- e.options?.properties.forEach((d, f) => {
4560
+ e.options?.properties.forEach((d, m) => {
4535
4561
  if (o.isSpreadAssignment(d))
4536
4562
  throw new Error(
4537
4563
  `Spread property assignment is not allowed in @property() as that is not statically analyzable. Found ${d.getText(t)}`
4538
4564
  );
4539
4565
  if (o.isIdentifier(d.name)) {
4540
- const m = d.name.escapedText;
4541
- m === "type" ? s = f : m === "attribute" ? r = f : m === "readOnly" && (n = f);
4566
+ const f = d.name.escapedText;
4567
+ f === "type" ? s = m : f === "attribute" ? r = m : f === "readOnly" && (n = m);
4542
4568
  }
4543
4569
  });
4544
- const a = i.attribute === void 0 && r === -1, c = i.readonly === !0 && i.docsOnlyReadonly !== !0 && n === -1, p = Lo(e, i, s), l = [
4570
+ const a = i.attribute === void 0 && r === -1, c = i.readonly === !0 && i.docsOnlyReadonly !== !0 && n === -1, p = Fo(e, i, s), l = [
4545
4571
  ...a ? [o.factory.createPropertyAssignment("attribute", o.factory.createFalse())] : [],
4546
4572
  ...c ? [o.factory.createPropertyAssignment("readOnly", o.factory.createTrue())] : [],
4547
4573
  ...p !== void 0 ? [p] : []
4548
4574
  ];
4549
4575
  return l.length > 0 ? e.options === void 0 ? o.factory.createObjectLiteralExpression(l, !1) : o.factory.updateObjectLiteralExpression(e.options, [...e.options.properties, ...l]) : e.options;
4550
4576
  }
4551
- function Lo(e, t, i) {
4577
+ function Fo(e, t, i) {
4552
4578
  if (t.attribute === void 0)
4553
4579
  return;
4554
- const s = jo(t.type.values);
4580
+ const s = Do(t.type.values);
4555
4581
  return s === "Other" || t.readonly === !0 && (s !== "Boolean" || t.reflects === void 0) || e.options?.properties[i] !== void 0 ? void 0 : o.factory.createPropertyAssignment(
4556
4582
  o.factory.createIdentifier("type"),
4557
4583
  o.factory.createIdentifier(s)
4558
4584
  );
4559
4585
  }
4560
- function jo(e) {
4586
+ function Do(e) {
4561
4587
  let t = !1, i = !1, s = !1;
4562
4588
  if (e?.forEach((r) => {
4563
4589
  t ||= r.type === "number", i ||= r.type === "boolean", s ||= r.type === "string" || r.type === "any" || r.type === "unknown";
@@ -4569,7 +4595,7 @@ function jo(e) {
4569
4595
  }
4570
4596
  return "Other";
4571
4597
  }
4572
- function Fo(e, t, i, s, r, n) {
4598
+ function Ro(e, t, i, s, r, n) {
4573
4599
  if (i.modifiers === void 0)
4574
4600
  return i;
4575
4601
  let a = -1, c = -1;
@@ -4579,23 +4605,23 @@ function Fo(e, t, i, s, r, n) {
4579
4605
  d === "property" && (a = l), d === "state" && (c = l);
4580
4606
  }
4581
4607
  }), a !== -1) {
4582
- const p = Ro(e, t, i, s, r), l = Ut(i, a, r), d = No(l, r, p);
4583
- return n.set(p.name, d ?? o.factory.createObjectLiteralExpression()), l.options = d, Wt(i, a);
4608
+ const p = Oo(e, t, i, s, r), l = Wt(i, a, r), d = jo(l, r, p);
4609
+ return n.set(p.name, d ?? o.factory.createObjectLiteralExpression()), l.options = d, zt(i, a);
4584
4610
  } else if (c !== -1) {
4585
- const p = Ut(i, c, r), l = o.factory.createPropertyAssignment("state", o.factory.createTrue()), d = p.options === void 0 ? o.factory.createObjectLiteralExpression([l]) : o.factory.updateObjectLiteralExpression(p.options, [...p.options.properties, l]), f = ti(i.name);
4586
- if (f === void 0)
4611
+ const p = Wt(i, c, r), l = o.factory.createPropertyAssignment("state", o.factory.createTrue()), d = p.options === void 0 ? o.factory.createObjectLiteralExpression([l]) : o.factory.updateObjectLiteralExpression(p.options, [...p.options.properties, l]), m = ii(i.name);
4612
+ if (m === void 0)
4587
4613
  throw new Error("Failed to statically determine the state property name");
4588
- return n.set(f, d), Wt(i, c);
4614
+ return n.set(m, d), zt(i, c);
4589
4615
  } else
4590
4616
  return i;
4591
4617
  }
4592
- function Ro(e, t, i, s, r) {
4618
+ function Oo(e, t, i, s, r) {
4593
4619
  const n = t ?? (e.compiler.isInTest ? {
4594
4620
  members: []
4595
4621
  } : void 0);
4596
4622
  if (n === void 0)
4597
4623
  throw Error(`Failed to find API component for ${s} in ${r.fileName}`);
4598
- const a = ti(i.name);
4624
+ const a = ii(i.name);
4599
4625
  let c;
4600
4626
  for (let p = 0; p < n.members.length; ++p) {
4601
4627
  const l = n.members[p];
@@ -4610,11 +4636,11 @@ function Ro(e, t, i, s, r) {
4610
4636
  throw Error(
4611
4637
  `Failed to statically determine the property name: ${i.getText(r)} in ${s} in ${r.fileName}`
4612
4638
  );
4613
- c.name = a, c.attribute ??= Qt(a);
4639
+ c.name = a, c.attribute ??= Zt(a);
4614
4640
  }
4615
4641
  return c;
4616
4642
  }
4617
- function Ut(e, t, i) {
4643
+ function Wt(e, t, i) {
4618
4644
  const s = e.modifiers[t], r = s.expression, n = r.arguments.at(0);
4619
4645
  if (n && !o.isObjectLiteralExpression(n))
4620
4646
  throw new Error(
@@ -4622,7 +4648,7 @@ function Ut(e, t, i) {
4622
4648
  );
4623
4649
  return { decorator: s, callExpression: r, options: n };
4624
4650
  }
4625
- function Wt(e, t) {
4651
+ function zt(e, t) {
4626
4652
  const i = [
4627
4653
  ...e.modifiers.slice(0, t),
4628
4654
  ...e.modifiers.slice(t + 1)
@@ -4649,7 +4675,7 @@ function Wt(e, t) {
4649
4675
  e.initializer
4650
4676
  );
4651
4677
  }
4652
- function Do(e, t, i, s) {
4678
+ function Mo(e, t, i, s) {
4653
4679
  let r;
4654
4680
  if (e.apiJsonEnabled)
4655
4681
  for (let p = 0; p < e.privateApiJson.modules.length; ++p) {
@@ -4672,9 +4698,9 @@ function Do(e, t, i, s) {
4672
4698
  } finally {
4673
4699
  c = i.statements, i.statements = a;
4674
4700
  }
4675
- return Oo(i, c);
4701
+ return Jo(i, c);
4676
4702
  }
4677
- const Oo = (e, t) => o.factory.updateSourceFile(
4703
+ const Jo = (e, t) => o.factory.updateSourceFile(
4678
4704
  e,
4679
4705
  t,
4680
4706
  /*
@@ -4689,10 +4715,10 @@ const Oo = (e, t) => o.factory.updateSourceFile(
4689
4715
  e.hasNoDefaultLib,
4690
4716
  e.libReferenceDirectives
4691
4717
  );
4692
- function Mo(e, t) {
4718
+ function Bo(e, t) {
4693
4719
  t.compiler.viteCommand === "build" && ("emitNode" in e && (e.emitNode ??= {}), o.setEmitFlags(e, o.EmitFlags.NoComments));
4694
4720
  }
4695
- const Jo = (e, t) => {
4721
+ const Ko = (e, t) => {
4696
4722
  let i;
4697
4723
  if (t.apiModule !== void 0)
4698
4724
  for (let p = 0; p < t.apiModule.declarations.length; ++p) {
@@ -4708,16 +4734,16 @@ const Jo = (e, t) => {
4708
4734
  function r() {
4709
4735
  s = /* @__PURE__ */ new Map();
4710
4736
  }
4711
- const n = (p) => xo(p, s, t.compiler.shouldMinify);
4737
+ const n = (p) => No(p, s, t.compiler.shouldMinify);
4712
4738
  function a(p, l) {
4713
- const d = Ko(t, i, p, l, e, s);
4714
- return Mo(d, t), d;
4739
+ const d = Uo(t, i, p, l, e, s);
4740
+ return Bo(d, t), d;
4715
4741
  }
4716
4742
  return e.statements.map(
4717
- (p) => ss(a, p, t, r, n)
4743
+ (p) => ns(a, p, t, r, n)
4718
4744
  );
4719
4745
  };
4720
- function ss(e, t, i, s, r = ii) {
4746
+ function ns(e, t, i, s, r = si) {
4721
4747
  if (o.isClassDeclaration(t) && // Ignore classes that don't extend anything - those are definitely not components
4722
4748
  t.heritageClauses?.some((n) => n.token === o.SyntaxKind.ExtendsKeyword)) {
4723
4749
  let n = !1;
@@ -4740,15 +4766,15 @@ function ss(e, t, i, s, r = ii) {
4740
4766
  } else
4741
4767
  return i.compiler.isInTest ? o.visitEachChild(
4742
4768
  t,
4743
- (a) => ss(e, a, i, s, r),
4769
+ (a) => ns(e, a, i, s, r),
4744
4770
  i.transformation
4745
4771
  ) : t;
4746
4772
  }
4747
- const Bo = /* @__PURE__ */ new Set(["connectedCallback", "disconnectedCallback"]);
4748
- function Ko(e, t, i, s, r, n) {
4773
+ const _o = /* @__PURE__ */ new Set(["connectedCallback", "disconnectedCallback"]);
4774
+ function Uo(e, t, i, s, r, n) {
4749
4775
  if (o.isMethodDeclaration(i)) {
4750
4776
  const a = i.modifiers?.filter(
4751
- (c) => !o.isDecorator(c) || !_o(c)
4777
+ (c) => !o.isDecorator(c) || !Wo(c)
4752
4778
  );
4753
4779
  if (a?.length !== i.modifiers?.length)
4754
4780
  return o.factory.updateMethodDeclaration(
@@ -4762,7 +4788,7 @@ function Ko(e, t, i, s, r, n) {
4762
4788
  i.type,
4763
4789
  i.body
4764
4790
  );
4765
- if ("text" in i.name && Bo.has(i.name.text) && i.body) {
4791
+ if ("text" in i.name && _o.has(i.name.text) && i.body) {
4766
4792
  const c = i.name.text;
4767
4793
  return i.body.statements.some(
4768
4794
  (l) => o.isExpressionStatement(l) && o.isCallExpression(l.expression) && o.isPropertyAccessExpression(l.expression.expression) && l.expression.expression.expression.kind === o.SyntaxKind.SuperKeyword && l.expression.expression.name.text === c
@@ -4788,14 +4814,14 @@ function Ko(e, t, i, s, r, n) {
4788
4814
  );
4789
4815
  }
4790
4816
  }
4791
- return o.isPropertyDeclaration(i) || o.isAccessor(i) ? Fo(e, t, i, s, r, n) : i;
4792
- }
4793
- const _o = (e) => o.isCallExpression(e.expression) && o.isIdentifier(e.expression.expression) && e.expression.expression.text === "method", Uo = [
4794
- $o,
4795
- ko,
4796
- Jo
4797
- ], Wo = "@arcgis/lumina:transformComponents", Ho = (e) => ({
4798
- name: Wo,
4817
+ return o.isPropertyDeclaration(i) || o.isAccessor(i) ? Ro(e, t, i, s, r, n) : i;
4818
+ }
4819
+ const Wo = (e) => o.isCallExpression(e.expression) && o.isIdentifier(e.expression.expression) && e.expression.expression.text === "method", zo = [
4820
+ Io,
4821
+ Ao,
4822
+ Ko
4823
+ ], Ho = "@arcgis/lumina:transformComponents", qo = (e) => ({
4824
+ name: Ho,
4799
4825
  transform: {
4800
4826
  // Transform JSX to lit-html first so that vite:esbuild doesn't transform JSX to h().
4801
4827
  // Also, we need to run on the original fs file, before other transforms so
@@ -4812,11 +4838,11 @@ const _o = (e) => o.isCallExpression(e.expression) && o.isIdentifier(e.expressio
4812
4838
  e.apiJsonDeferred === void 0 ? [ie] : [ie, e.apiJsonDeferred.promise]
4813
4839
  );
4814
4840
  const s = e.getSourceFile(i, t), n = o.transform(s, [
4815
- (f) => () => Do(e, f, s, [
4841
+ (m) => () => Mo(e, m, s, [
4816
4842
  ...e.options.types?.sourceFileTransformers ?? [],
4817
- ...Uo
4843
+ ...zo
4818
4844
  ])
4819
- ]).transformed[0], a = e._typeScriptPrinter, c = e.viteConfig.build.sourcemap === !1 ? void 0 : yt.createSourceMapGenerator(qo, u.basename(i), "", u.dirname(i), {}), p = yt.createTextWriter(`
4845
+ ]).transformed[0], a = e._typeScriptPrinter, c = e.viteConfig.build.sourcemap === !1 ? void 0 : yt.createSourceMapGenerator(Vo, u.basename(i), "", u.dirname(i), {}), p = yt.createTextWriter(`
4820
4846
  `);
4821
4847
  a.writeFile(n, p, c);
4822
4848
  const l = p.getText(), d = c?.toJSON();
@@ -4826,10 +4852,10 @@ const _o = (e) => o.isCallExpression(e.expression) && o.isIdentifier(e.expressio
4826
4852
  };
4827
4853
  }
4828
4854
  }
4829
- }), qo = {
4855
+ }), Vo = {
4830
4856
  getCurrentDirectory: o.sys.getCurrentDirectory,
4831
- getCanonicalFileName: o.sys.useCaseSensitiveFileNames ? ii : (e) => e.toLowerCase()
4832
- }, zo = (e) => ({
4857
+ getCanonicalFileName: o.sys.useCaseSensitiveFileNames ? si : (e) => e.toLowerCase()
4858
+ }, Go = (e) => ({
4833
4859
  name: "@arcgis/lumina:handleDynamicAssets",
4834
4860
  configureServer(t) {
4835
4861
  e.server = t, Ht(e).forEach(({ assets: i, transformers: s }) => ce(e, i, s));
@@ -4837,7 +4863,7 @@ const _o = (e) => o.isCallExpression(e.expression) && o.isIdentifier(e.expressio
4837
4863
  async writeBundle() {
4838
4864
  await Promise.all(
4839
4865
  Ht(e).map(
4840
- async ({ assets: t, transformers: i }) => await Ni(e, t, i)
4866
+ async ({ assets: t, transformers: i }) => await ji(e, t, i)
4841
4867
  )
4842
4868
  );
4843
4869
  }
@@ -4848,20 +4874,20 @@ function Ht(e) {
4848
4874
  "type" in s ? t.push(s) : "assets" in s && t.push(...s.assets);
4849
4875
  }), t.length > 0 && i.push({ assets: t }), e.isInBuildWatch || (e.assetsToProvide = void 0), i;
4850
4876
  }
4851
- const et = "@arcgis/lumina:updatePackageJson", Vo = (e) => ({
4877
+ const et = "@arcgis/lumina:updatePackageJson", Xo = (e) => ({
4852
4878
  name: et,
4853
4879
  apply: () => e.viteCommand === "serve" && e.environment === "development" && !e.isInTest && !e.isInCi,
4854
4880
  configResolved() {
4855
- Go(e).catch(
4881
+ Yo(e).catch(
4856
4882
  (t) => E.error(et, `Failed to update package's package.json:${String(t)}`)
4857
4883
  );
4858
4884
  }
4859
4885
  });
4860
- async function Go(e) {
4861
- const t = u.join(e.dir.root, "package.json"), i = JSON.parse(await q(t, "utf-8")), s = Xo(i, e);
4862
- s && Zt(t, JSON.stringify(s, null, 2));
4886
+ async function Yo(e) {
4887
+ const t = u.join(e.dir.root, "package.json"), i = JSON.parse(await H(t, "utf-8")), s = Qo(i, e);
4888
+ s && ei(t, JSON.stringify(s, null, 2));
4863
4889
  }
4864
- function Xo(e, t) {
4890
+ function Qo(e, t) {
4865
4891
  const i = e?.devDependencies ?? {};
4866
4892
  Object.keys(e?.peerDependencies ?? {}).forEach((l) => {
4867
4893
  l in i || E.warn(
@@ -4887,7 +4913,7 @@ function Xo(e, t) {
4887
4913
  const l = r(n.webTypes);
4888
4914
  e["web-types"] !== l && (s = !0, e["web-types"] = l);
4889
4915
  }
4890
- const a = `./${Y}.css`, c = t.options.build?.cdn?.namespace !== void 0, p = fe(
4916
+ const a = `./${Q}.css`, c = t.options.build?.cdn?.namespace !== void 0, p = fe(
4891
4917
  t.dir.root,
4892
4918
  u.join(t.dir.distCdn, a)
4893
4919
  );
@@ -4900,20 +4926,20 @@ function Xo(e, t) {
4900
4926
  if (s)
4901
4927
  return e;
4902
4928
  }
4903
- const Yo = (e) => ({
4929
+ const Zo = (e) => ({
4904
4930
  timestamp: e.apiJson.timestamp,
4905
4931
  compiler: e.apiJson.compiler,
4906
- components: Qo(e),
4932
+ components: ea(e),
4907
4933
  typeLibrary: {}
4908
4934
  });
4909
- function Qo(e) {
4935
+ function ea(e) {
4910
4936
  const t = [];
4911
4937
  for (const i of e.apiJson.modules)
4912
4938
  for (const s of i.declarations)
4913
- s.customElement === !0 && t.push(Zo(s, i.sourcePath));
4939
+ s.customElement === !0 && t.push(ta(s, i.sourcePath));
4914
4940
  return t;
4915
4941
  }
4916
- function Zo(e, t) {
4942
+ function ta(e, t) {
4917
4943
  const i = e.superclass ? [{ name: "superclass", text: JSON.stringify(e.superclass) }] : [];
4918
4944
  return {
4919
4945
  filePath: t,
@@ -4928,9 +4954,9 @@ function Zo(e, t) {
4928
4954
  dependencies: [],
4929
4955
  dependencyGraph: {},
4930
4956
  deprecation: typeof e.deprecated == "boolean" ? e.deprecated ? "" : void 0 : e.deprecated,
4931
- props: e.members.map(ea).filter(F),
4932
- methods: e.members.map(ta).filter(F),
4933
- events: e.events?.map(ia) ?? [],
4957
+ props: e.members.map(ia).filter(F),
4958
+ methods: e.members.map(sa).filter(F),
4959
+ events: e.events?.map(ra) ?? [],
4934
4960
  styles: e.cssProperties?.map((s) => ({
4935
4961
  name: s.name,
4936
4962
  annotation: "prop",
@@ -4942,7 +4968,7 @@ function Zo(e, t) {
4942
4968
  listeners: []
4943
4969
  };
4944
4970
  }
4945
- function ea(e) {
4971
+ function ia(e) {
4946
4972
  if (e.kind !== "field")
4947
4973
  return;
4948
4974
  const t = e, i = t.inheritedFrom ? [{ name: "inheritedFrom", text: JSON.stringify(t.inheritedFrom) }] : [], s = t.readonly ? [{ name: "readonly", text: "" }] : [], r = t.docsTags?.some((n) => n.name === "required") ?? !1;
@@ -4952,7 +4978,7 @@ function ea(e) {
4952
4978
  complexType: t.type === void 0 ? void 0 : {
4953
4979
  original: t.type.text,
4954
4980
  resolved: t.type.text,
4955
- references: ut(t.type.references)
4981
+ references: mt(t.type.references)
4956
4982
  },
4957
4983
  mutable: !0,
4958
4984
  attr: "attribute" in t && typeof t.attribute == "string" ? t.attribute : void 0,
@@ -4971,19 +4997,19 @@ function ea(e) {
4971
4997
  required: r
4972
4998
  };
4973
4999
  }
4974
- const ut = (e) => Object.fromEntries(
5000
+ const mt = (e) => Object.fromEntries(
4975
5001
  e?.map(
4976
5002
  (t) => [
4977
5003
  t.name,
4978
5004
  {
4979
- location: t.package === bs ? "global" : t.package === void 0 ? "local" : "import",
5005
+ location: t.package === Ss ? "global" : t.package === void 0 ? "local" : "import",
4980
5006
  path: typeof t.module == "string" && typeof t.package == "string" ? u.join(t.package, t.module) : t.module ?? t.package,
4981
5007
  id: "notImplemented"
4982
5008
  }
4983
5009
  ]
4984
5010
  ) ?? []
4985
5011
  );
4986
- function ta(e) {
5012
+ function sa(e) {
4987
5013
  if (e.kind !== "method")
4988
5014
  return;
4989
5015
  const t = e, i = e.inheritedFrom ? [{ name: "inheritedFrom", text: JSON.stringify(e.inheritedFrom) }] : [], s = t.parameters?.map(({ name: r, type: n, description: a }) => ({
@@ -5002,7 +5028,7 @@ function ta(e) {
5002
5028
  signature: t.signature ?? "()=>unknown",
5003
5029
  parameters: s,
5004
5030
  return: t.return?.type?.text ?? "void",
5005
- references: ut([
5031
+ references: mt([
5006
5032
  ...t.return?.type?.references ?? [],
5007
5033
  ...t.parameters?.flatMap((r) => r.type.references ?? []) ?? []
5008
5034
  ])
@@ -5014,7 +5040,7 @@ function ta(e) {
5014
5040
  deprecation: typeof t.deprecated == "boolean" ? t.deprecated ? "" : void 0 : t.deprecated
5015
5041
  };
5016
5042
  }
5017
- function ia(e) {
5043
+ function ra(e) {
5018
5044
  const t = e.inheritedFrom ? [{ name: "inheritedFrom", text: JSON.stringify(e.inheritedFrom) }] : [];
5019
5045
  return {
5020
5046
  event: e.name,
@@ -5023,7 +5049,7 @@ function ia(e) {
5023
5049
  complexType: {
5024
5050
  original: e.type.text,
5025
5051
  resolved: e.type.text,
5026
- references: ut(e.type.references)
5052
+ references: mt(e.type.references)
5027
5053
  },
5028
5054
  cancelable: e.cancelable ?? !0,
5029
5055
  composed: e.composed ?? !0,
@@ -5032,18 +5058,18 @@ function ia(e) {
5032
5058
  deprecation: typeof e.deprecated == "boolean" ? e.deprecated ? "" : void 0 : e.deprecated
5033
5059
  };
5034
5060
  }
5035
- const rs = (e) => e.flatMap(
5061
+ const os = (e) => e.flatMap(
5036
5062
  (t) => t.cssProperties?.map((i) => ({
5037
5063
  name: i.name,
5038
5064
  description: i.description || void 0
5039
5065
  })) ?? []
5040
- ), ns = (e) => e.flatMap(
5066
+ ), as = (e) => e.flatMap(
5041
5067
  (t) => t.cssParts?.map((i) => ({
5042
5068
  name: `::part(${i.name})`,
5043
5069
  description: i.description || void 0
5044
5070
  })) ?? []
5045
5071
  );
5046
- function sa(e) {
5072
+ function na(e) {
5047
5073
  if (e.attributes === void 0)
5048
5074
  return [];
5049
5075
  const t = [];
@@ -5054,7 +5080,7 @@ function sa(e) {
5054
5080
  description: je(s.description, s.deprecated) || void 0,
5055
5081
  default: s.default,
5056
5082
  value: {
5057
- type: ra(
5083
+ type: oa(
5058
5084
  s.type.values?.map(
5059
5085
  (r) => r.type === "string" && r.value !== void 0 ? `"${r.value}"` : r.value ?? r.type
5060
5086
  )
@@ -5064,15 +5090,15 @@ function sa(e) {
5064
5090
  }
5065
5091
  return t;
5066
5092
  }
5067
- const ra = (e) => e?.length === 1 ? e[0] : e, je = (e = "", t = !1) => t === !1 ? e : `**Deprecated**${typeof t == "string" ? `: ${t}` : ""}. ${e}`, ge = {
5093
+ const oa = (e) => e?.length === 1 ? e[0] : e, je = (e = "", t = !1) => t === !1 ? e : `**Deprecated**${typeof t == "string" ? `: ${t}` : ""}. ${e}`, ge = {
5068
5094
  slots: "Slots",
5069
5095
  events: "Events",
5070
5096
  cssProperties: "CSS Properties",
5071
5097
  cssParts: "CSS Parts",
5072
5098
  methods: "Methods"
5073
5099
  };
5074
- function os(e) {
5075
- const t = na(e.slots), i = oa(e.events), s = aa(e.cssProperties), r = la(e.cssParts), n = ca(e.members), a = je(e.description, e.deprecated).trim();
5100
+ function ls(e) {
5101
+ const t = aa(e.slots), i = la(e.events), s = ca(e.cssProperties), r = da(e.cssParts), n = pa(e.members), a = je(e.description, e.deprecated).trim();
5076
5102
  return [...a ? [`${a}
5077
5103
  --`] : [], i, n, t, s, r].filter(Boolean).join(`
5078
5104
 
@@ -5080,28 +5106,28 @@ function os(e) {
5080
5106
  }
5081
5107
  const he = (e, t) => t === void 0 || t.length === 0 ? "" : `### ${e}
5082
5108
  ${t.join(`
5083
- `)}`, na = (e) => he(
5109
+ `)}`, aa = (e) => he(
5084
5110
  ge.slots,
5085
5111
  e?.map((t) => `- ${t.name ? `**${t.name}**` : "_default_"} - ${t.description}`)
5086
- ), oa = (e) => he(
5112
+ ), la = (e) => he(
5087
5113
  ge.events,
5088
5114
  e?.filter((t) => t.name !== null && t.name !== void 0).map((t) => `- **${t.name}**${t.description ? ` - ${t.description}` : ""}`)
5089
- ), aa = (e = []) => he(
5115
+ ), ca = (e = []) => he(
5090
5116
  ge.cssProperties,
5091
5117
  e?.map(
5092
5118
  (t) => `- **${t.name}** - ${t.description} ${t.default ? `_(default: ${t.default})_}` : ""}`
5093
5119
  )
5094
- ), la = (e) => he(
5120
+ ), da = (e) => he(
5095
5121
  ge.cssParts,
5096
5122
  e?.map((t) => `- **${t.name}** - ${t.description}`)
5097
- ), ca = (e) => he(
5123
+ ), pa = (e) => he(
5098
5124
  ge.methods,
5099
- e.filter(ws).map(
5125
+ e.filter(Es).map(
5100
5126
  (t) => [`- \`${t.name}${t.signature}\``, je(t.description, t.deprecated)].filter(Boolean).join(" - ")
5101
5127
  )
5102
5128
  );
5103
- function da(e, t) {
5104
- const i = pa(e), s = rs(e), r = ns(e), n = D();
5129
+ function ma(e, t) {
5130
+ const i = ua(e), s = os(e), r = as(e), n = O();
5105
5131
  return {
5106
5132
  $schema: "https://raw.githubusercontent.com/JetBrains/web-types/master/schema/web-types.json",
5107
5133
  name: n.name,
@@ -5119,11 +5145,11 @@ function da(e, t) {
5119
5145
  }
5120
5146
  };
5121
5147
  }
5122
- const pa = (e) => e.map((t) => ({
5148
+ const ua = (e) => e.map((t) => ({
5123
5149
  name: t.tagName,
5124
- description: os(t),
5150
+ description: ls(t),
5125
5151
  "doc-url": t.demos?.[0]?.url,
5126
- attributes: sa(t),
5152
+ attributes: na(t),
5127
5153
  slots: t.slots?.map((i) => ({
5128
5154
  name: i.name,
5129
5155
  description: i.description
@@ -5131,10 +5157,10 @@ const pa = (e) => e.map((t) => ({
5131
5157
  // REFACTOR: this was deprecated in the spec: https://github.com/JetBrains/web-types/blob/11e46e47cb65edc1930dc1fae854005ad45ac08f/schema/web-types.json#L866
5132
5158
  events: qt(t),
5133
5159
  js: {
5134
- properties: ua(t),
5160
+ properties: fa(t),
5135
5161
  events: qt(t)
5136
5162
  }
5137
- })), ua = (e) => e.members.filter(Ss).map((t) => ({
5163
+ })), fa = (e) => e.members.filter(Cs).map((t) => ({
5138
5164
  name: t.name,
5139
5165
  description: t.description,
5140
5166
  type: t.type?.text
@@ -5142,90 +5168,90 @@ const pa = (e) => e.map((t) => ({
5142
5168
  name: t.name,
5143
5169
  type: t.type?.text,
5144
5170
  description: t.description
5145
- })) ?? [], ma = (e) => e.map((t) => ({
5171
+ })) ?? [], ga = (e) => e.map((t) => ({
5146
5172
  name: t.tagName,
5147
- description: os(t),
5148
- attributes: fa(t),
5173
+ description: ls(t),
5174
+ attributes: ha(t),
5149
5175
  references: t.demos?.map((i) => ({ name: i.description, url: i.url })) ?? []
5150
- })), fa = (e) => e.attributes?.map((t) => ({
5176
+ })), ha = (e) => e.attributes?.map((t) => ({
5151
5177
  name: t.name,
5152
5178
  description: je(t.description, t.deprecated) || void 0,
5153
- values: ga(t)
5154
- })) ?? [], ga = (e) => e.type.values?.map((t) => t.value ?? "").filter(Boolean).map((t) => ({ name: t })) ?? [], ha = (e) => ({
5179
+ values: ya(t)
5180
+ })) ?? [], ya = (e) => e.type.values?.map((t) => t.value ?? "").filter(Boolean).map((t) => ({ name: t })) ?? [], va = (e) => ({
5155
5181
  $schema: "https://raw.githubusercontent.com/microsoft/vscode-html-languageservice/main/docs/customData.schema.json",
5156
5182
  version: 1.1,
5157
- tags: ma(e)
5158
- }), ya = (e) => ({
5183
+ tags: ga(e)
5184
+ }), ba = (e) => ({
5159
5185
  $schema: "https://raw.githubusercontent.com/microsoft/vscode-css-languageservice/main/docs/customData.schema.json",
5160
5186
  version: 1.1,
5161
- properties: rs(e),
5162
- pseudoElements: ns(e)
5163
- }), va = "@arcgis/lumina:generateDocs";
5164
- function ba(e) {
5187
+ properties: os(e),
5188
+ pseudoElements: as(e)
5189
+ }), wa = "@arcgis/lumina:generateDocs";
5190
+ function Sa(e) {
5165
5191
  return e._documentationFileNames.stencilLikeDocsJson !== void 0 && e.provideAssets([
5166
5192
  {
5167
5193
  type: "dynamic",
5168
- source: () => JSON.stringify(Yo(e), null, Ze(e)),
5194
+ source: () => JSON.stringify(Zo(e), null, Ze(e)),
5169
5195
  destination: u.join("../..", e._documentationFileNames.stencilLikeDocsJson)
5170
5196
  }
5171
5197
  ]), {
5172
- name: va,
5198
+ name: wa,
5173
5199
  async writeBundle() {
5174
5200
  if (e.isInStorybook)
5175
5201
  return;
5176
5202
  const t = Ze(e), { jetBrains: i } = e.options.documentation ?? {}, s = e._documentationFileNames, r = s.vsCodeHtml === void 0 ? void 0 : u.join(e.dir.dist, s.vsCodeHtml), n = s.vsCodeCss === void 0 ? void 0 : u.join(e.dir.dist, s.vsCodeCss), a = s.webTypes === void 0 ? void 0 : u.join(e.dir.dist, s.webTypes), c = [r, n, a].filter(F);
5177
5203
  if (c.length === 0)
5178
5204
  return;
5179
- await Di(c);
5205
+ await Mi(c);
5180
5206
  const p = [];
5181
5207
  if (r !== void 0) {
5182
- const l = JSON.stringify(ha(e.apiJsonComponents), null, t);
5208
+ const l = JSON.stringify(va(e.apiJsonComponents), null, t);
5183
5209
  p.push(U(r, l));
5184
5210
  }
5185
5211
  if (n !== void 0) {
5186
- const l = JSON.stringify(ya(e.apiJsonComponents), null, t);
5212
+ const l = JSON.stringify(ba(e.apiJsonComponents), null, t);
5187
5213
  p.push(U(n, l));
5188
5214
  }
5189
5215
  if (a !== void 0) {
5190
- const l = da(e.apiJsonComponents, typeof i == "object" ? i : {});
5216
+ const l = ma(e.apiJsonComponents, typeof i == "object" ? i : {});
5191
5217
  p.push(U(a, JSON.stringify(l, null, t)));
5192
5218
  }
5193
5219
  await Promise.all(p);
5194
5220
  }
5195
5221
  };
5196
5222
  }
5197
- function wa(e) {
5223
+ function Ea(e) {
5198
5224
  return {
5199
5225
  name: "@arcgis/lumina:buildWrappers",
5200
5226
  apply: () => e.viteCommand === "build" && !!e.options.build?.wrappers?.length,
5201
5227
  async writeBundle() {
5202
5228
  e.isInStorybook || await Promise.all(
5203
5229
  e.options.build?.wrappers?.map(async (t) => {
5204
- t.type === "react18" && await Ca(e, t);
5230
+ t.type === "react18" && await $a(e, t);
5205
5231
  }) ?? []
5206
5232
  );
5207
5233
  }
5208
5234
  };
5209
5235
  }
5210
- const Sa = "react", zt = "@lit/react", Ea = `
5211
- import React from "${Sa}";
5212
- import { createComponent } from "${zt}";
5213
- import type { EventName } from "${zt}";
5236
+ const Ca = "react", Vt = "@lit/react", Ta = `
5237
+ import React from "${Ca}";
5238
+ import { createComponent } from "${Vt}";
5239
+ import type { EventName } from "${Vt}";
5214
5240
  import { makeReactWrapperFactory, getReactWrapperOptions } from "@arcgis/lumina";
5215
5241
 
5216
5242
  const createWrapper = /*@__PURE__*/ makeReactWrapperFactory(React, createComponent) as typeof createComponent;
5217
5243
  `;
5218
- async function Ca(e, t) {
5219
- const { name: i } = D(), s = [];
5244
+ async function $a(e, t) {
5245
+ const { name: i } = O(), s = [];
5220
5246
  for (const a of e.apiJson.modules)
5221
5247
  for (const c of a.declarations)
5222
- c.customElement === !0 && s.push(Ta(c));
5223
- const r = [`/// <reference types="${i}" preserve="true" />`, Ea, ...s].join(""), n = u.resolve(t.proxiesFile);
5224
- await Z(u.dirname(n), { recursive: !0 }), await U(n, r);
5248
+ c.customElement === !0 && s.push(Pa(c));
5249
+ const r = [`/// <reference types="${i}" preserve="true" />`, Ta, ...s].join(""), n = u.resolve(t.proxiesFile);
5250
+ await G(u.dirname(n), { recursive: !0 }), await U(n, r);
5225
5251
  }
5226
- function Ta(e) {
5252
+ function Pa(e) {
5227
5253
  const t = e.events?.map(
5228
- (i) => ` ${js(`on${cs(i.name)}`)}: "${i.name}" as EventName<HTML${e.pascalCaseName}Element["${i.name}"]>,`
5254
+ (i) => ` ${Ds(`on${ps(i.name)}`)}: "${i.name}" as EventName<HTML${e.pascalCaseName}Element["${i.name}"]>,`
5229
5255
  ).join(`
5230
5256
  `);
5231
5257
  return `
@@ -5240,41 +5266,41 @@ ${t}
5240
5266
  );
5241
5267
  `;
5242
5268
  }
5243
- function Va(e = {}) {
5269
+ function Xa(e = {}) {
5244
5270
  const t = new $(e), s = [
5245
5271
  t._plugin,
5246
- Pn(t),
5247
- In(t),
5248
- Vo(t),
5249
- fn(t),
5250
- ba(t),
5251
- Ho(t),
5252
- Un(t),
5253
- tr(t),
5254
- bn(t),
5255
- zo(t),
5256
- Hn(t),
5257
- jn(t),
5258
- Rs(t),
5259
- _r(t),
5260
- wa(t),
5261
- wn(t)
5272
+ kn(t),
5273
+ xn(t),
5274
+ Xo(t),
5275
+ hn(t),
5276
+ Sa(t),
5277
+ qo(t),
5278
+ zn(t),
5279
+ sr(t),
5280
+ Sn(t),
5281
+ Go(t),
5282
+ qn(t),
5283
+ Dn(t),
5284
+ Os(t),
5285
+ Wr(t),
5286
+ Ea(t),
5287
+ En(t)
5262
5288
  ].filter(F);
5263
5289
  return s.context = t, s;
5264
5290
  }
5265
- const Ga = {
5266
- initializeComponentDependencies: vi,
5267
- updateLuminaTs: Ji,
5291
+ const Ya = {
5292
+ initializeComponentDependencies: bi,
5293
+ updateLuminaTs: Ki,
5268
5294
  propertyToAttributeMappings: W,
5269
- nativeEvents: oi,
5295
+ nativeEvents: ai,
5270
5296
  svgElements: it,
5271
5297
  mathMlElements: st,
5272
- alwaysAttributes: si,
5273
- nativeAlwaysAttributes: ri,
5274
- htmlAlwaysAttributes: ze
5298
+ alwaysAttributes: ri,
5299
+ nativeAlwaysAttributes: ni,
5300
+ htmlAlwaysAttributes: qe
5275
5301
  };
5276
5302
  export {
5277
- Ga as exportsForCodemod,
5303
+ Ya as exportsForCodemod,
5278
5304
  Ne as inferCdnUrl,
5279
- Va as useLumina
5305
+ Xa as useLumina
5280
5306
  };