@arcgis/codemod 6.0.0-next.43 → 6.0.0-next.45

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.
@@ -1,218 +1,220 @@
1
- var ne = (s, n) => (n = Symbol[s]) ? n : /* @__PURE__ */ Symbol.for("Symbol." + s), se = (s) => {
1
+ var re = (s, n) => (n = Symbol[s]) ? n : /* @__PURE__ */ Symbol.for("Symbol." + s), oe = (s) => {
2
2
  throw TypeError(s);
3
3
  };
4
- var ie = (s, n, e) => {
4
+ var ie = (s, n, t) => {
5
5
  if (n != null) {
6
- typeof n != "object" && typeof n != "function" && se("Object expected");
7
- var t, i;
8
- e && (t = n[ne("asyncDispose")]), t === void 0 && (t = n[ne("dispose")], e && (i = t)), typeof t != "function" && se("Object not disposable"), i && (t = function() {
6
+ typeof n != "object" && typeof n != "function" && oe("Object expected");
7
+ var e, r;
8
+ t && (e = n[re("asyncDispose")]), e === void 0 && (e = n[re("dispose")], t && (r = e)), typeof e != "function" && oe("Object not disposable"), r && (e = function() {
9
9
  try {
10
- i.call(this);
10
+ r.call(this);
11
11
  } catch (a) {
12
12
  return Promise.reject(a);
13
13
  }
14
- }), s.push([e, t, n]);
15
- } else e && s.push([e]);
14
+ }), s.push([t, e, n]);
15
+ } else t && s.push([t]);
16
16
  return n;
17
- }, re = (s, n, e) => {
18
- var t = typeof SuppressedError == "function" ? SuppressedError : function(r, p, l, c) {
19
- return c = Error(l), c.name = "SuppressedError", c.error = r, c.suppressed = p, c;
20
- }, i = (r) => n = e ? new t(r, n, "An error was suppressed during disposal") : (e = !0, r), a = (r) => {
21
- for (; r = s.pop(); )
17
+ }, ae = (s, n, t) => {
18
+ var e = typeof SuppressedError == "function" ? SuppressedError : function(o, p, l, c) {
19
+ return c = Error(l), c.name = "SuppressedError", c.error = o, c.suppressed = p, c;
20
+ }, r = (o) => n = t ? new e(o, n, "An error was suppressed during disposal") : (t = !0, o), a = (o) => {
21
+ for (; o = s.pop(); )
22
22
  try {
23
- var p = r[1] && r[1].call(r[2]);
24
- if (r[0]) return Promise.resolve(p).then(a, (l) => (i(l), a()));
23
+ var p = o[1] && o[1].call(o[2]);
24
+ if (o[0]) return Promise.resolve(p).then(a, (l) => (r(l), a()));
25
25
  } catch (l) {
26
- i(l);
26
+ r(l);
27
27
  }
28
- if (e) throw n;
28
+ if (t) throw n;
29
29
  };
30
30
  return a();
31
31
  };
32
- import { c as De } from "./useProjectInstance.js";
33
- import { d as V, r as Ee, a as Le, b as Te, s as oe, i as Fe, c as Ie, e as We } from "./cli.js";
34
- import { f as R, r as Oe } from "./log.js";
35
- import { log as J } from "@arcgis/toolkit/log";
36
- import { path as P, toPosixPathSeparators as Me } from "@arcgis/node-toolkit/path";
37
- import { forEachWithConcurrency as ve } from "@arcgis/toolkit/promise";
38
- import o from "typescript";
39
- import { g as ye, s as je, a as M, b as Re, c as B, d as xe, e as Je, f as Ue, h as ze, i as we, p as Ve, j as G, k as ae, l as Ge } from "./classification.js";
40
- import { loadCodeowners as Se } from "@arcgis/node-toolkit/codeowners";
41
- import { s as qe, c as ce, g as Be, l as Ke, a as ke, b as He, d as Qe, e as _e } from "./componentAudit.js";
42
- import { styleText as K } from "node:util";
43
- import { f as Ne } from "./format.js";
44
- import { realpath as j, readFile as U } from "node:fs/promises";
45
- import F from "semver";
46
- import { asyncFindPath as q } from "@arcgis/node-toolkit/file";
47
- import { asyncRetrievePackageJson as Xe } from "@arcgis/node-toolkit/packageJson";
48
- import { LineCounter as Ye, parseDocument as Ze, isMap as et, isScalar as le } from "yaml";
49
- function tt(s, n, e) {
32
+ import { c as Le } from "./useProjectInstance.js";
33
+ import { d as q, r as Te, a as Fe, b as Ie, s as ce, i as We, c as Oe, e as Me } from "./cli.js";
34
+ import { f as U, r as je } from "./log.js";
35
+ import { log as z } from "@arcgis/toolkit/log";
36
+ import { path as $, getCwd as Re, toPosixPathSeparators as Je } from "@arcgis/node-toolkit/path";
37
+ import { forEachWithConcurrency as xe } from "@arcgis/toolkit/promise";
38
+ import i from "typescript";
39
+ import { g as we, s as Ue, a as R, c as ze, b as Ve, d as Ge, e as Se, p as qe, f as B, h as le } from "./apiName.js";
40
+ import { loadCodeowners as ke } from "@arcgis/node-toolkit/codeowners";
41
+ import { g as Be, a as Ne, b as Ke, c as He } from "./hardcodedBehavior.js";
42
+ import { styleText as H } from "node:util";
43
+ import { f as be } from "./format.js";
44
+ import { g as Qe, a as Q, c as Ae, b as _e } from "./classification.js";
45
+ import { realpath as J, readFile as V } from "node:fs/promises";
46
+ import { s as Xe, a as pe, l as Ye, c as Ze } from "./componentAudit.js";
47
+ import W from "semver";
48
+ import { asyncFindPath as K } from "@arcgis/node-toolkit/file";
49
+ import { asyncRetrievePackageJson as et } from "@arcgis/node-toolkit/packageJson";
50
+ import { LineCounter as tt, parseDocument as nt, isMap as st, isScalar as de } from "yaml";
51
+ function rt(s, n, t) {
50
52
  if (n === "json") {
51
- if (e !== void 0) {
52
- process.stdout.write(`${JSON.stringify(e, void 0, 2)}
53
+ if (t !== void 0) {
54
+ process.stdout.write(`${JSON.stringify(t, void 0, 2)}
53
55
  `);
54
56
  return;
55
57
  }
56
- const t = M();
57
- process.stdout.write(`${ot(s, Se(), t)}
58
+ const e = R();
59
+ process.stdout.write(`${lt(s, ke(), e)}
58
60
  `);
59
61
  return;
60
62
  }
61
63
  if (n === "md") {
62
64
  process.stdout.write(
63
- `${e === void 0 ? at(s) : Ne(e)}
65
+ `${t === void 0 ? pt(s) : be(t)}
64
66
  `
65
67
  );
66
68
  return;
67
69
  }
68
- process.stdout.write(`${nt(s)}
70
+ process.stdout.write(`${ot(s)}
69
71
  `);
70
72
  }
71
- function nt(s) {
72
- const n = be(s), e = n.reduce((i, a) => i + a.count, 0), t = [pe("Deprecation summary", e)];
73
- for (const { categoryName: i, count: a, packages: r } of n) {
74
- t.push(`${V[i].label} (${a})`);
75
- for (const { displayName: p, count: l } of r)
76
- t.push(` ${de(p)} (${l})`);
73
+ function ot(s) {
74
+ const n = Pe(s), t = n.reduce((r, a) => r + a.count, 0), e = [me("Deprecation summary", t)];
75
+ for (const { categoryName: r, count: a, packages: o } of n) {
76
+ e.push(`${q[r].label} (${a})`);
77
+ for (const { displayName: p, count: l } of o)
78
+ e.push(` ${ue(p)} (${l})`);
77
79
  }
78
- t.push("", "", pe("Deprecation details", e));
79
- for (const { categoryName: i, count: a, packages: r } of n) {
80
- const p = V[i];
81
- t.push("", `${p.label} (${a})`), "description" in p && t.push(` ${p.description}`);
82
- for (const { displayName: l, count: c, apis: m } of r) {
83
- t.push("", ` ${de(l)} (${c})`);
84
- for (const { name: g, reasons: y, items: v } of m) {
85
- const d = v[0].usage, u = Ue({ name: g, memberOf: d.memberOf, kind: d.kind });
86
- t.push(` ${st(u)}${ze(d.kind)} (${v.length})`);
87
- for (const x of y)
88
- t.push(it(x, 6));
89
- for (const { sourceFileName: x, usage: w } of rt(v))
90
- t.push(` ${R(x)}:${w.line}:${w.column}`);
80
+ e.push("", "", me("Deprecation details", t));
81
+ for (const { categoryName: r, count: a, packages: o } of n) {
82
+ const p = q[r];
83
+ e.push("", `${p.label} (${a})`), "description" in p && e.push(` ${p.description}`);
84
+ for (const { displayName: l, count: c, apis: m } of o) {
85
+ e.push("", ` ${ue(l)} (${c})`);
86
+ for (const { name: g, reasons: y, items: h } of m) {
87
+ const d = h[0].usage, u = Ve({ name: g, memberOf: d.memberOf, kind: d.kind });
88
+ e.push(` ${it(u)}${Ge(d.kind)} (${h.length})`);
89
+ for (const v of y)
90
+ e.push(at(v, 6));
91
+ for (const { sourceFileName: v, usage: x } of ct(h))
92
+ e.push(` ${U(v)}:${x.line}:${x.column}`);
91
93
  }
92
94
  }
93
95
  }
94
- return t.join(`
96
+ return e.join(`
95
97
  `);
96
98
  }
97
- function be(s) {
99
+ function Pe(s) {
98
100
  const n = [...s].flatMap(
99
- ([e, t]) => t.map((i) => ({ ...i, packageName: e }))
101
+ ([t, e]) => e.map((r) => ({ ...r, packageName: t }))
100
102
  );
101
- return Re(n, ({ packageName: e, usage: t }) => ({
102
- package: e,
103
- name: t.name,
104
- kind: t.kind,
105
- category: t.category,
106
- memberOf: t.memberOf,
107
- module: t.module ?? B(t.originFileNames, e),
108
- deprecated: t.reason ?? !0
103
+ return Qe(n, ({ packageName: t, usage: e }) => ({
104
+ package: t,
105
+ name: e.name,
106
+ kind: e.kind,
107
+ category: e.category,
108
+ memberOf: e.memberOf,
109
+ module: e.module ?? Q(e.originFileNames, t),
110
+ deprecated: e.reason ?? !0
109
111
  }));
110
112
  }
111
- function pe(s, n) {
112
- return K(["bold", "yellow"], `${s} (${n})`);
113
+ function me(s, n) {
114
+ return H(["bold", "yellow"], `${s} (${n})`);
113
115
  }
114
- function de(s) {
115
- return K("blue", s);
116
+ function ue(s) {
117
+ return H("blue", s);
116
118
  }
117
- function st(s) {
118
- return K(["bold", "white"], s);
119
+ function it(s) {
120
+ return H(["bold", "white"], s);
119
121
  }
120
- function it(s, n) {
121
- const e = " ".repeat(n);
122
- return s.split(/\r?\n/u).map((t) => `${e}${t}`).join(`
122
+ function at(s, n) {
123
+ const t = " ".repeat(n);
124
+ return s.split(/\r?\n/u).map((e) => `${t}${e}`).join(`
123
125
  `);
124
126
  }
125
- function rt(s) {
127
+ function ct(s) {
126
128
  return s.toSorted(
127
- (n, e) => n.sourceFileName.localeCompare(e.sourceFileName) || n.usage.line - e.usage.line || n.usage.column - e.usage.column
129
+ (n, t) => n.sourceFileName.localeCompare(t.sourceFileName) || n.usage.line - t.usage.line || n.usage.column - t.usage.column
128
130
  );
129
131
  }
130
- function ot(s, n, e = M()) {
131
- return JSON.stringify(H(s, n, e), void 0, 2);
132
+ function lt(s, n, t = R()) {
133
+ return JSON.stringify(_(s, n, t), void 0, 2);
132
134
  }
133
- function at(s, n = M()) {
134
- return Ne(H(s, void 0, n));
135
+ function pt(s, n = R()) {
136
+ return be(_(s, void 0, n));
135
137
  }
136
- function H(s, n, e, t, i = []) {
137
- const a = be(s), r = ye(process.cwd(), e.repositoryRoot);
138
+ function _(s, n, t, e, r = []) {
139
+ const a = Pe(s), o = we(process.cwd(), t.repositoryRoot);
138
140
  return {
139
141
  auditKind: "usages",
140
- repository: e.repository,
141
- ref: e.ref,
142
- branch: e.branch,
143
- scannerVersion: je,
142
+ repository: t.repository,
143
+ ref: t.ref,
144
+ branch: t.branch,
145
+ scannerVersion: Ue,
144
146
  scanDate: Date.now(),
145
- ...t === void 0 ? {} : { complete: t },
146
- ...r === "" ? {} : { cwd: r },
147
- ...i.length === 0 ? {} : { excludedPaths: i },
147
+ ...e === void 0 ? {} : { complete: e },
148
+ ...o === "" ? {} : { cwd: o },
149
+ ...r.length === 0 ? {} : { excludedPaths: r },
148
150
  summary: {
149
151
  total: a.reduce((l, { count: c }) => l + c, 0),
150
152
  categories: a.map(({ categoryName: l, count: c, packages: m }) => ({
151
153
  category: l,
152
- label: V[l].label,
154
+ label: q[l].label,
153
155
  count: c,
154
- packages: m.map(({ packageName: g, displayName: y, count: v }) => ({
156
+ packages: m.map(({ packageName: g, displayName: y, count: h }) => ({
155
157
  package: g,
156
158
  ...y === g ? {} : { displayName: y },
157
- count: v
159
+ count: h
158
160
  }))
159
161
  }))
160
162
  },
161
- findings: ct(s, n, e)
163
+ findings: dt(s, n, t)
162
164
  };
163
165
  }
164
- function ct(s, n, e) {
166
+ function dt(s, n, t) {
165
167
  return [...s].flatMap(
166
- ([t, i]) => i.map((a) => {
167
- const r = a.usage.module ?? B(a.usage.originFileNames, t), p = {
168
- package: t,
168
+ ([e, r]) => r.map((a) => {
169
+ const o = a.usage.module ?? Q(a.usage.originFileNames, e), p = {
170
+ package: e,
169
171
  name: a.usage.name,
170
172
  category: a.usage.category,
171
173
  memberOf: a.usage.memberOf,
172
- module: r,
174
+ module: o,
173
175
  deprecated: a.usage.reason ?? !0
174
176
  };
175
177
  return {
176
178
  ...p,
177
- category: xe(p),
179
+ category: Ae(p),
178
180
  kind: a.usage.kind,
179
181
  memberOf: a.usage.memberOf,
180
- file: ye(a.sourceFileName, e.repositoryRoot),
182
+ file: we(a.sourceFileName, t.repositoryRoot),
181
183
  line: a.usage.line,
182
184
  column: a.usage.column,
183
185
  codeowners: n?.getOwners(a.sourceFileName) ?? []
184
186
  };
185
187
  })
186
- ).sort(Je);
188
+ ).sort(ze);
187
189
  }
188
- function lt(s, n, e) {
189
- return { scanNode: t, scanCss: i, scanHtmlAttributes: a };
190
- function t(p, l, c) {
191
- if (!o.isStringLiteralLike(p))
190
+ function mt(s, n, t) {
191
+ return { scanNode: e, scanCss: r, scanHtmlAttributes: a };
192
+ function e(p, l, c) {
193
+ if (!i.isStringLiteralLike(p))
192
194
  return;
193
195
  const m = p.getStart(l) + 1, g = l.text.slice(m, p.end - 1);
194
- /(?:^|,)\s*(["']?)CalciteWebCoreIcons\1\s*(?=,|$)/iu.test(g) && me(g, c + m, r), z(g, c + m, r), i(g, c + m);
196
+ /(?:^|,)\s*(["']?)CalciteWebCoreIcons\1\s*(?=,|$)/iu.test(g) && ge(g, c + m, o), G(g, c + m, o), r(g, c + m);
195
197
  }
196
- function i(p, l, c = !1) {
198
+ function r(p, l, c = !1) {
197
199
  const m = c ? /\/\*[\s\S]*?(?:\*\/|$)|"(?:\\[\s\S]|[^"\\])*"|'(?:\\[\s\S]|[^'\\])*'|\/\/[^\r\n]*/gu : /\/\*[\s\S]*?(?:\*\/|$)|"(?:\\[\s\S]|[^"\\])*"|'(?:\\[\s\S]|[^'\\])*'/gu, g = p.replace(
198
200
  m,
199
- (v) => v.startsWith("/") ? v.replace(/[^\r\n]/gu, " ") : v
200
- ), y = g.replace(m, (v) => v.replace(/[^\r\n]/gu, " "));
201
- z(y, l, r);
202
- for (const v of y.matchAll(
201
+ (h) => h.startsWith("/") ? h.replace(/[^\r\n]/gu, " ") : h
202
+ ), y = g.replace(m, (h) => h.replace(/[^\r\n]/gu, " "));
203
+ G(y, l, o);
204
+ for (const h of y.matchAll(
203
205
  /(?:^|[;{}\r\n])\s*(?:font(?:-family)?|--[-\w]+|\$[-\w]+)\s*:([^;{}]*?)(?=;|\}|$|[\r\n][\t ]*[-\w$]+\s*:)/giu
204
206
  )) {
205
- const d = v.index + v[0].length - v[1].length;
206
- me(g.slice(d, d + v[1].length), l + d, r);
207
+ const d = h.index + h[0].length - h[1].length;
208
+ ge(g.slice(d, d + h[1].length), l + d, o);
207
209
  }
208
210
  }
209
211
  function a(p) {
210
212
  for (const { name: l, value: c, valueStart: m } of p)
211
- c !== void 0 && (l === "class" ? z(c, m, r) : l === "style" && i(c, m));
213
+ c !== void 0 && (l === "class" ? G(c, m, o) : l === "style" && r(c, m));
212
214
  }
213
- function r(p, l) {
215
+ function o(p, l) {
214
216
  const { line: c, character: m } = n(p);
215
- e({
217
+ t({
216
218
  packageName: "@arcgis/core",
217
219
  sourceFileName: s,
218
220
  usage: {
@@ -228,83 +230,83 @@ function lt(s, n, e) {
228
230
  });
229
231
  }
230
232
  }
231
- function me(s, n, e) {
232
- for (const t of s.matchAll(/"[^"\r\n]*"|'[^'\r\n]*'|[-\w]+/gu)) {
233
- const i = t[0].startsWith('"') || t[0].startsWith("'"), a = i ? t[0].slice(1, -1) : t[0];
234
- a.toLowerCase() === "calcitewebcoreicons" && e(n + t.index + (i ? 1 : 0), a.length);
233
+ function ge(s, n, t) {
234
+ for (const e of s.matchAll(/"[^"\r\n]*"|'[^'\r\n]*'|[-\w]+/gu)) {
235
+ const r = e[0].startsWith('"') || e[0].startsWith("'"), a = r ? e[0].slice(1, -1) : e[0];
236
+ a.toLowerCase() === "calcitewebcoreicons" && t(n + e.index + (r ? 1 : 0), a.length);
235
237
  }
236
238
  }
237
- function z(s, n, e) {
238
- for (const t of s.matchAll(/(?<![-\w])esri-icon-[a-z][\w-]*/gu))
239
- t[0] !== "esri-icon-font-fallback-text" && e(n + t.index, t[0].length);
239
+ function G(s, n, t) {
240
+ for (const e of s.matchAll(/(?<![-\w])esri-icon-[a-z][\w-]*/gu))
241
+ e[0] !== "esri-icon-font-fallback-text" && t(n + e.index, e[0].length);
240
242
  }
241
- function pt(s, n, e) {
242
- return { scanNode: t };
243
- function t(i, a, r, p) {
244
- if (r === void 0 || !o.isCallExpression(i) || i.arguments.some(o.isSpreadElement) || !dt(i.expression, r))
243
+ function ut(s, n, t) {
244
+ return { scanNode: e };
245
+ function e(r, a, o, p) {
246
+ if (o === void 0 || !i.isCallExpression(r) || r.arguments.some(i.isSpreadElement) || !gt(r.expression, o))
245
247
  return;
246
- const l = i.arguments[0];
247
- if (l === void 0 || !o.isStringLiteralLike(l))
248
+ const l = r.arguments[0];
249
+ if (l === void 0 || !i.isStringLiteralLike(l))
248
250
  return;
249
- const c = i.arguments[1], m = ge(c, "strategy");
250
- if (m !== "missing" && m !== "unknown" && o.isStringLiteralLike(m) && m.text === "local" && y(
251
+ const c = r.arguments[1], m = he(c, "strategy");
252
+ if (m !== "missing" && m !== "unknown" && i.isStringLiteralLike(m) && m.text === "local" && y(
251
253
  "strategy",
252
254
  m,
253
255
  'The workers.open() strategy "local" is deprecated since 5.2. Use "distributed" or "dedicated" to run the module in a worker instead of on the main thread.'
254
- ), mt.has(l.text))
256
+ ), ft.has(l.text))
255
257
  return;
256
- const g = ge(c, "isESM");
257
- if (g === "missing" || g !== "unknown" && g.kind === o.SyntaxKind.FalseKeyword) {
258
- const v = i.expression;
258
+ const g = he(c, "isESM");
259
+ if (g === "missing" || g !== "unknown" && g.kind === i.SyntaxKind.FalseKeyword) {
260
+ const h = r.expression;
259
261
  y(
260
262
  "isESM",
261
- o.isPropertyAccessExpression(v) ? v.name : v,
263
+ i.isPropertyAccessExpression(h) ? h.name : h,
262
264
  "Loading custom workers with isESM: false (the default) is deprecated since 5.2. Author the worker as an ES module and pass isESM: true. See https://developers.arcgis.com/javascript/latest/references/core/core/workers/#open"
263
265
  );
264
266
  }
265
- function y(v, d, u) {
266
- const x = p + d.getStart(a), { line: w, character: f } = n(x);
267
- e({
267
+ function y(h, d, u) {
268
+ const v = p + d.getStart(a), { line: x, character: f } = n(v);
269
+ t({
268
270
  packageName: "@arcgis/core",
269
271
  sourceFileName: s,
270
272
  usage: {
271
- name: `open.${v}`,
273
+ name: `open.${h}`,
272
274
  kind: "function",
273
275
  module: "core/workers",
274
276
  reason: u,
275
277
  originFileNames: [],
276
- start: x,
278
+ start: v,
277
279
  length: d.getWidth(a),
278
- line: w + 1,
280
+ line: x + 1,
279
281
  column: f + 1
280
282
  }
281
283
  });
282
284
  }
283
285
  }
284
286
  }
285
- function dt(s, n) {
286
- const e = o.isPropertyAccessExpression(s) && s.name.text === "open", t = e ? s.expression : s;
287
- if (!o.isIdentifier(t))
287
+ function gt(s, n) {
288
+ const t = i.isPropertyAccessExpression(s) && s.name.text === "open", e = t ? s.expression : s;
289
+ if (!i.isIdentifier(e))
288
290
  return !1;
289
- const i = n.getSymbolAtLocation(t)?.declarations?.[0];
290
- return i === void 0 ? !1 : e ? o.isNamespaceImport(i) && !i.parent.isTypeOnly && ue(i.parent.parent.moduleSpecifier) : o.isImportSpecifier(i) && !i.isTypeOnly && !i.parent.parent.isTypeOnly && (i.propertyName ?? i.name).text === "open" && ue(i.parent.parent.parent.moduleSpecifier);
291
+ const r = n.getSymbolAtLocation(e)?.declarations?.[0];
292
+ return r === void 0 ? !1 : t ? i.isNamespaceImport(r) && !r.parent.isTypeOnly && fe(r.parent.parent.moduleSpecifier) : i.isImportSpecifier(r) && !r.isTypeOnly && !r.parent.parent.isTypeOnly && (r.propertyName ?? r.name).text === "open" && fe(r.parent.parent.parent.moduleSpecifier);
291
293
  }
292
- function ue(s) {
293
- return o.isStringLiteralLike(s) && /^(?:@arcgis\/core|esri)\/core\/workers(?:\.js)?$/u.test(s.text);
294
+ function fe(s) {
295
+ return i.isStringLiteralLike(s) && /^(?:@arcgis\/core|esri)\/core\/workers(?:\.js)?$/u.test(s.text);
294
296
  }
295
- function ge(s, n) {
297
+ function he(s, n) {
296
298
  if (s === void 0)
297
299
  return "missing";
298
- if (!o.isObjectLiteralExpression(s) || s.properties.some(
299
- (e) => !o.isPropertyAssignment(e) || o.isComputedPropertyName(e.name)
300
+ if (!i.isObjectLiteralExpression(s) || s.properties.some(
301
+ (t) => !i.isPropertyAssignment(t) || i.isComputedPropertyName(t.name)
300
302
  ))
301
303
  return "unknown";
302
- for (const e of s.properties.toReversed())
303
- if (o.isPropertyAssignment(e) && !o.isComputedPropertyName(e.name) && e.name.text === n)
304
- return e.initializer;
304
+ for (const t of s.properties.toReversed())
305
+ if (i.isPropertyAssignment(t) && !i.isComputedPropertyName(t.name) && t.name.text === n)
306
+ return t.initializer;
305
307
  return "missing";
306
308
  }
307
- const mt = /* @__PURE__ */ new Set([
309
+ const ft = /* @__PURE__ */ new Set([
308
310
  "CSVSourceWorker",
309
311
  "EdgeProcessingWorker",
310
312
  "ElevationSamplerWorker",
@@ -335,33 +337,33 @@ const mt = /* @__PURE__ */ new Set([
335
337
  "statsWorker",
336
338
  "ImageMeasurementWorker"
337
339
  ]);
338
- function fe(s, n, e) {
339
- const t = P.extname(s.fileName).slice(1).toLowerCase(), i = "getLineAndCharacterOfPosition" in s ? (d) => s.getLineAndCharacterOfPosition(d) : ft(s.text), a = /* @__PURE__ */ new Map(), r = lt(s.fileName, i, (d) => {
340
+ function ve(s, n, t) {
341
+ const e = $.extname(s.fileName).slice(1).toLowerCase(), r = "getLineAndCharacterOfPosition" in s ? (d) => s.getLineAndCharacterOfPosition(d) : yt(s.text), a = /* @__PURE__ */ new Map(), o = mt(s.fileName, r, (d) => {
340
342
  a.set(`iconFont:${d.usage.start}`, d);
341
- }), p = pt(s.fileName, i, (d) => {
343
+ }), p = ut(s.fileName, r, (d) => {
342
344
  a.set(`workers:${d.usage.name}:${d.usage.start}`, d);
343
345
  }), l = /\bdefine\s*(?:\.\s*amd\b|\[\s*(?:"amd"|'amd')\s*\])/u.test(s.text);
344
346
  for (const d of s.text.matchAll(/(?<![-\w\u0080-\uFFFF])--[-\w\u0080-\uFFFF]+/gu)) {
345
347
  const u = n.cssVariables.get(d[0]);
346
348
  u !== void 0 && c(u, d.index, d[0].length);
347
349
  }
348
- if (t === "html") {
350
+ if (e === "html") {
349
351
  const d = /* @__PURE__ */ new Map();
350
- if (yt({
352
+ if (St({
351
353
  contents: s.text,
352
- scanElement: (u, x, w) => {
354
+ scanElement: (u, v, x) => {
353
355
  g(
354
356
  u,
355
- x,
356
- w.map(({ name: f, start: k }) => ({ name: f, start: k }))
357
- ), r.scanHtmlAttributes(w);
357
+ v,
358
+ x.map(({ name: f, start: S }) => ({ name: f, start: S }))
359
+ ), o.scanHtmlAttributes(x);
358
360
  },
359
- scanStyle: (u, x) => {
360
- he(u, x, y), r.scanCss(u, x);
361
+ scanStyle: (u, v) => {
362
+ ye(u, v, y), o.scanCss(u, v);
361
363
  },
362
- scanScript: (u, x, w) => {
363
- const f = w.find(({ name: N }) => N === "type")?.value?.trim().toLowerCase() ?? "";
364
- if (w.some(({ name: N }) => N === "src") || ![
364
+ scanScript: (u, v, x) => {
365
+ const f = x.find(({ name: N }) => N === "type")?.value?.trim().toLowerCase() ?? "";
366
+ if (x.some(({ name: N }) => N === "src") || ![
365
367
  "",
366
368
  "module",
367
369
  "text/javascript",
@@ -370,17 +372,17 @@ function fe(s, n, e) {
370
372
  "application/ecmascript"
371
373
  ].includes(f.split(";")[0]))
372
374
  return;
373
- const k = `${s.fileName}.script-${d.size}.js`;
374
- d.set(k, {
375
- source: o.createSourceFile(
376
- k,
375
+ const S = `${s.fileName}.script-${d.size}.js`;
376
+ d.set(S, {
377
+ source: i.createSourceFile(
378
+ S,
377
379
  f === "module" ? `${u}
378
380
  export {};` : u,
379
- o.ScriptTarget.Latest,
381
+ i.ScriptTarget.Latest,
380
382
  !0,
381
- o.ScriptKind.JS
383
+ i.ScriptKind.JS
382
384
  ),
383
- offset: x
385
+ offset: v
384
386
  });
385
387
  }
386
388
  }), d.size > 0) {
@@ -389,18 +391,18 @@ export {};` : u,
389
391
  noLib: !0,
390
392
  noResolve: !0,
391
393
  types: [],
392
- target: o.ScriptTarget.Latest
393
- }, w = o.createProgram([...d.keys()], u, {
394
- ...o.createCompilerHost(u),
394
+ target: i.ScriptTarget.Latest
395
+ }, x = i.createProgram([...d.keys()], u, {
396
+ ...i.createCompilerHost(u),
395
397
  getSourceFile: (f) => d.get(f)?.source
396
398
  }).getTypeChecker();
397
- for (const { source: f, offset: k } of d.values())
398
- v({ node: f, jsxSourceFile: f, typeChecker: w, offset: k });
399
+ for (const { source: f, offset: S } of d.values())
400
+ h({ node: f, jsxSourceFile: f, typeChecker: x, offset: S });
399
401
  }
400
- } else t === "css" || t === "scss" || t === "sass" ? (he(s.text, 0, y, t !== "css"), r.scanCss(s.text, 0, t !== "css")) : "kind" in s && v({ node: s, jsxSourceFile: s, typeChecker: e });
402
+ } else e === "css" || e === "scss" || e === "sass" ? (ye(s.text, 0, y, e !== "css"), o.scanCss(s.text, 0, e !== "css")) : "kind" in s && h({ node: s, jsxSourceFile: s, typeChecker: t });
401
403
  return [...a.values()].sort((d, u) => d.usage.start - u.usage.start);
402
- function c(d, u, x) {
403
- const { line: w, character: f } = i(u);
404
+ function c(d, u, v) {
405
+ const { line: x, character: f } = r(u);
404
406
  a.set(JSON.stringify([d.package, d.kind, d.memberOf, d.name, u]), {
405
407
  packageName: d.package,
406
408
  sourceFileName: s.fileName,
@@ -412,40 +414,40 @@ export {};` : u,
412
414
  reason: d.reason,
413
415
  originFileNames: [d.sourceFileName],
414
416
  start: u,
415
- length: x,
416
- line: w + 1,
417
+ length: v,
418
+ line: x + 1,
417
419
  column: f + 1
418
420
  }
419
421
  });
420
422
  }
421
- function m(d, u, x) {
422
- const w = n.components.get(d);
423
- if (w?.length === 1)
424
- return w[0].definitions.find((f) => ut({ entry: f, tag: d, kind: u, name: x }));
423
+ function m(d, u, v) {
424
+ const x = n.components.get(d);
425
+ if (x?.length === 1)
426
+ return x[0].definitions.find((f) => ht({ entry: f, tag: d, kind: u, name: v }));
425
427
  }
426
- function g(d, u, x) {
427
- const w = m(d, "element", d);
428
- w !== void 0 && c(w, u, d.length);
429
- for (const f of x) {
430
- const k = m(d, "attribute", f.name);
431
- k !== void 0 && c(k, f.start, f.name.length);
428
+ function g(d, u, v) {
429
+ const x = m(d, "element", d);
430
+ x !== void 0 && c(x, u, d.length);
431
+ for (const f of v) {
432
+ const S = m(d, "attribute", f.name);
433
+ S !== void 0 && c(S, f.start, f.name.length);
432
434
  }
433
435
  }
434
- function y(d, u, x, w) {
435
- const f = m(d, u, x);
436
- f !== void 0 && c(f, w, x.length);
436
+ function y(d, u, v, x) {
437
+ const f = m(d, u, v);
438
+ f !== void 0 && c(f, x, v.length);
437
439
  }
438
- function v({
440
+ function h({
439
441
  node: d,
440
442
  jsxSourceFile: u,
441
- typeChecker: x,
442
- offset: w = 0
443
+ typeChecker: v,
444
+ offset: x = 0
443
445
  }) {
444
- r.scanNode(d, u, w), p.scanNode(d, u, x, w);
445
- const f = gt({ node: d, checker: x });
446
+ o.scanNode(d, u, x), p.scanNode(d, u, v, x);
447
+ const f = vt({ node: d, checker: v });
446
448
  if (f !== void 0 && (f.text !== "define" || !l)) {
447
- const k = w + f.getStart(u), { line: N, character: A } = i(k);
448
- a.set(`amd:${k}`, {
449
+ const S = x + f.getStart(u), { line: N, character: A } = r(S);
450
+ a.set(`amd:${S}`, {
449
451
  packageName: "@arcgis/core",
450
452
  sourceFileName: s.fileName,
451
453
  usage: {
@@ -454,113 +456,113 @@ export {};` : u,
454
456
  module: "amd",
455
457
  reason: "require/define is deprecated. Use $arcgis.import() or ESM instead. See https://developers.arcgis.com/javascript/latest/get-started/",
456
458
  originFileNames: [],
457
- start: k,
459
+ start: S,
458
460
  length: f.getWidth(u),
459
461
  line: N + 1,
460
462
  column: A + 1
461
463
  }
462
464
  });
463
465
  }
464
- if (o.isJsxOpeningElement(d) || o.isJsxSelfClosingElement(d)) {
465
- const k = d.tagName.getText(u), N = d.attributes.properties.filter(o.isJsxAttribute);
466
+ if (i.isJsxOpeningElement(d) || i.isJsxSelfClosingElement(d)) {
467
+ const S = d.tagName.getText(u), N = d.attributes.properties.filter(i.isJsxAttribute);
466
468
  if (g(
467
- k,
469
+ S,
468
470
  d.tagName.getStart(u),
469
471
  N.map((A) => ({
470
472
  name: A.name.getText(u),
471
473
  start: A.name.getStart(u)
472
474
  }))
473
- ), qe(d, u, n, c), /^[a-z][\w-]*$/u.test(k)) {
474
- const A = N.find(($) => $.name.getText(u) === "slot"), h = A?.initializer, S = h !== void 0 && o.isJsxExpression(h) ? h.expression : h, b = A === void 0 ? -1 : d.attributes.properties.indexOf(A), L = d.attributes.properties.slice(b + 1).some(o.isJsxSpreadAttribute);
475
- if (S !== void 0 && (o.isStringLiteral(S) || o.isNoSubstitutionTemplateLiteral(S)) && !L) {
476
- const $ = ht(o.isJsxOpeningElement(d) ? d.parent : d, x), T = $ === void 0 ? void 0 : m($, "slot", S.text);
477
- T !== void 0 && c(T, S.getStart(u) + 1, S.getWidth(u) - 2);
475
+ ), Xe(d, u, n, c), /^[a-z][\w-]*$/u.test(S)) {
476
+ const A = N.find((k) => k.name.getText(u) === "slot"), P = A?.initializer, C = P !== void 0 && i.isJsxExpression(P) ? P.expression : P, w = A === void 0 ? -1 : d.attributes.properties.indexOf(A), b = d.attributes.properties.slice(w + 1).some(i.isJsxSpreadAttribute);
477
+ if (C !== void 0 && (i.isStringLiteral(C) || i.isNoSubstitutionTemplateLiteral(C)) && !b) {
478
+ const k = xt(i.isJsxOpeningElement(d) ? d.parent : d, v), L = k === void 0 ? void 0 : m(k, "slot", C.text);
479
+ L !== void 0 && c(L, C.getStart(u) + 1, C.getWidth(u) - 2);
478
480
  }
479
481
  }
480
482
  }
481
- o.forEachChild(d, (k) => v({ node: k, jsxSourceFile: u, typeChecker: x, offset: w }));
483
+ i.forEachChild(d, (S) => h({ node: S, jsxSourceFile: u, typeChecker: v, offset: x }));
482
484
  }
483
485
  }
484
- function ut({
486
+ function ht({
485
487
  entry: s,
486
488
  tag: n,
487
- kind: e,
488
- name: t
489
+ kind: t,
490
+ name: e
489
491
  }) {
490
- const i = s.attribute;
491
- if (e === "attribute" && i !== void 0) {
492
- const a = i.tagName === n, r = i.name === t;
493
- return a && r;
492
+ const r = s.attribute;
493
+ if (t === "attribute" && r !== void 0) {
494
+ const a = r.tagName === n, o = r.name === e;
495
+ return a && o;
494
496
  }
495
- return s.kind !== e || s.name !== t ? !1 : e === "element" ? !0 : s.memberOf === n;
497
+ return s.kind !== t || s.name !== e ? !1 : t === "element" ? !0 : s.memberOf === n;
496
498
  }
497
- function gt({
499
+ function vt({
498
500
  node: s,
499
501
  checker: n
500
502
  }) {
501
- if (n === void 0 || !o.isCallExpression(s))
503
+ if (n === void 0 || !i.isCallExpression(s))
502
504
  return;
503
- const e = s.expression;
504
- let t, i;
505
- if (o.isIdentifier(e))
506
- t = e, i = e;
507
- else if (o.isPropertyAccessExpression(e) && o.isIdentifier(e.name) && o.isIdentifier(e.expression) && ["window", "opener", "globalThis"].includes(e.expression.text))
508
- t = e.name, i = e.expression;
505
+ const t = s.expression;
506
+ let e, r;
507
+ if (i.isIdentifier(t))
508
+ e = t, r = t;
509
+ else if (i.isPropertyAccessExpression(t) && i.isIdentifier(t.name) && i.isIdentifier(t.expression) && ["window", "opener", "globalThis"].includes(t.expression.text))
510
+ e = t.name, r = t.expression;
509
511
  else
510
512
  return;
511
- if (t.text !== "define" && t.text !== "require")
513
+ if (e.text !== "define" && e.text !== "require")
512
514
  return;
513
- if (t.text === "require") {
514
- const r = s.arguments[0];
515
- if (!(r !== void 0 && o.isArrayLiteralExpression(r)) && s.getSourceFile().fileName.toLowerCase().endsWith(".cjs") || r !== void 0 && o.isStringLiteralLike(r) && !r.text.startsWith("esri/"))
515
+ if (e.text === "require") {
516
+ const o = s.arguments[0];
517
+ if (!(o !== void 0 && i.isArrayLiteralExpression(o)) && s.getSourceFile().fileName.toLowerCase().endsWith(".cjs") || o !== void 0 && i.isStringLiteralLike(o) && !o.text.startsWith("esri/"))
516
518
  return;
517
519
  }
518
- return (n.getSymbolAtLocation(i)?.declarations ?? []).every(
519
- (r) => o.isPropertyAccessExpression(e) && r.getSourceFile().isDeclarationFile
520
- ) ? t : void 0;
520
+ return (n.getSymbolAtLocation(r)?.declarations ?? []).every(
521
+ (o) => i.isPropertyAccessExpression(t) && o.getSourceFile().isDeclarationFile
522
+ ) ? e : void 0;
521
523
  }
522
- function ft(s) {
524
+ function yt(s) {
523
525
  const n = [
524
526
  0,
525
- ...Array.from(s.matchAll(/\r\n|[\r\n\u2028\u2029]/gu), (e) => e.index + e[0].length)
527
+ ...Array.from(s.matchAll(/\r\n|[\r\n\u2028\u2029]/gu), (t) => t.index + t[0].length)
526
528
  ];
527
- return (e) => {
528
- let t = 0, i = n.length;
529
- for (; t + 1 < i; ) {
530
- const a = Math.floor((t + i) / 2);
531
- n[a] <= e ? t = a : i = a;
529
+ return (t) => {
530
+ let e = 0, r = n.length;
531
+ for (; e + 1 < r; ) {
532
+ const a = Math.floor((e + r) / 2);
533
+ n[a] <= t ? e = a : r = a;
532
534
  }
533
- return { line: t, character: e - n[t] };
535
+ return { line: e, character: t - n[e] };
534
536
  };
535
537
  }
536
- function ht(s, n) {
537
- let e = s;
538
- for (let t = e.parent; t !== void 0; e = t, t = t.parent) {
539
- if (o.isJsxElement(t))
540
- return t.openingElement.tagName.getText();
541
- if (!(o.isJsxFragment(t) || o.isJsxExpression(t) || o.isParenthesizedExpression(t)) && !(o.isConditionalExpression(t) && e !== t.condition) && !(o.isBinaryExpression(t) && (t.operatorToken.kind === o.SyntaxKind.AmpersandAmpersandToken && e === t.right || t.operatorToken.kind === o.SyntaxKind.BarBarToken || t.operatorToken.kind === o.SyntaxKind.QuestionQuestionToken))) {
542
- if (o.isReturnStatement(t)) {
543
- const i = o.findAncestor(t, o.isFunctionLike);
544
- if (i === void 0 || !o.isArrowFunction(i) && !o.isFunctionExpression(i))
538
+ function xt(s, n) {
539
+ let t = s;
540
+ for (let e = t.parent; e !== void 0; t = e, e = e.parent) {
541
+ if (i.isJsxElement(e))
542
+ return e.openingElement.tagName.getText();
543
+ if (!(i.isJsxFragment(e) || i.isJsxExpression(e) || i.isParenthesizedExpression(e)) && !(i.isConditionalExpression(e) && t !== e.condition) && !(i.isBinaryExpression(e) && (e.operatorToken.kind === i.SyntaxKind.AmpersandAmpersandToken && t === e.right || e.operatorToken.kind === i.SyntaxKind.BarBarToken || e.operatorToken.kind === i.SyntaxKind.QuestionQuestionToken))) {
544
+ if (i.isReturnStatement(e)) {
545
+ const r = i.findAncestor(e, i.isFunctionLike);
546
+ if (r === void 0 || !i.isArrowFunction(r) && !i.isFunctionExpression(r))
545
547
  return;
546
- e = i.body, t = i;
548
+ t = r.body, e = r;
547
549
  }
548
- if ((o.isArrowFunction(t) || o.isFunctionExpression(t)) && e === t.body) {
549
- const i = t.parent;
550
- if (!o.isCallExpression(i) || i.arguments[0] !== t || !o.isPropertyAccessExpression(i.expression) || i.expression.name.text !== "map")
550
+ if ((i.isArrowFunction(e) || i.isFunctionExpression(e)) && t === e.body) {
551
+ const r = e.parent;
552
+ if (!i.isCallExpression(r) || r.arguments[0] !== e || !i.isPropertyAccessExpression(r.expression) || r.expression.name.text !== "map")
551
553
  return;
552
- const a = i.expression.expression, r = n?.getTypeAtLocation(a);
553
- if (!o.isArrayLiteralExpression(a) && (r === void 0 || !n.isArrayType(r) && !n.isTupleType(r)))
554
+ const a = r.expression.expression, o = n?.getTypeAtLocation(a);
555
+ if (!i.isArrayLiteralExpression(a) && (o === void 0 || !n.isArrayType(o) && !n.isTupleType(o)))
554
556
  return;
555
- e = t, t = i;
557
+ t = e, e = r;
556
558
  continue;
557
559
  }
558
560
  return;
559
561
  }
560
562
  }
561
563
  }
562
- function he(s, n, e, t = !1) {
563
- const i = t ? /\/\*[\s\S]*?(?:\*\/|$)|"(?:\\[\s\S]|[^"\\])*"|'(?:\\[\s\S]|[^'\\])*'|\/\/[^\r\n]*/gu : /\/\*[\s\S]*?(?:\*\/|$)|"(?:\\[\s\S]|[^"\\])*"|'(?:\\[\s\S]|[^'\\])*'/gu, a = s.replace(i, (c) => c.replace(/[^\r\n]/gu, " ")), r = [];
564
+ function ye(s, n, t, e = !1) {
565
+ const r = e ? /\/\*[\s\S]*?(?:\*\/|$)|"(?:\\[\s\S]|[^"\\])*"|'(?:\\[\s\S]|[^'\\])*'|\/\/[^\r\n]*/gu : /\/\*[\s\S]*?(?:\*\/|$)|"(?:\\[\s\S]|[^"\\])*"|'(?:\\[\s\S]|[^'\\])*'/gu, a = s.replace(r, (c) => c.replace(/[^\r\n]/gu, " ")), o = [];
564
566
  let p = 0, l = 0;
565
567
  for (const c of a.matchAll(/[{};]/gu)) {
566
568
  const m = c.index;
@@ -569,50 +571,50 @@ function he(s, n, e, t = !1) {
569
571
  continue;
570
572
  }
571
573
  if (c[0] === "}")
572
- r.pop();
574
+ o.pop();
573
575
  else if (c[0] === "{") {
574
- const g = a.slice(p, m), y = r.at(-1) ?? [];
576
+ const g = a.slice(p, m), y = o.at(-1) ?? [];
575
577
  if (/^\s*--[\w-]+\s*:/u.test(g))
576
578
  l = 1;
577
579
  else if (g.trimStart().startsWith("@"))
578
- r.push(y);
580
+ o.push(y);
579
581
  else {
580
582
  const d = g.split(",").map((u) => u.trim()).flatMap(
581
583
  (u) => y.length === 0 ? [u] : y.map(
582
- (x) => u.includes("&") ? u.replaceAll("&", x) : `${x} ${u}`
584
+ (v) => u.includes("&") ? u.replaceAll("&", v) : `${v} ${u}`
583
585
  )
584
586
  );
585
587
  for (const u of g.matchAll(/::part\(\s*([\w\s-]+?)\s*\)|:state\(\s*([\w-]+)\s*\)/gu)) {
586
- const x = g.lastIndexOf(",", u.index) + 1, w = g.slice(x, u.index), k = (y.length === 0 ? [w] : y.map(
587
- (S) => w.includes("&") ? w.replaceAll("&", S) : `${S} ${w}`
588
- )).map(vt);
589
- if (k.includes(void 0) || new Set(k).size !== 1)
588
+ const v = g.lastIndexOf(",", u.index) + 1, x = g.slice(v, u.index), S = (y.length === 0 ? [x] : y.map(
589
+ (C) => x.includes("&") ? x.replaceAll("&", C) : `${C} ${x}`
590
+ )).map(wt);
591
+ if (S.includes(void 0) || new Set(S).size !== 1)
590
592
  continue;
591
- const N = u[1] === void 0 ? "css-state" : "css-part", A = u[1] ?? u[2], h = u.index + u[0].indexOf(A);
592
- for (const S of A.matchAll(/[\w-]+/gu))
593
- e(k[0], N, S[0], n + p + h + S.index);
593
+ const N = u[1] === void 0 ? "css-state" : "css-part", A = u[1] ?? u[2], P = u.index + u[0].indexOf(A);
594
+ for (const C of A.matchAll(/[\w-]+/gu))
595
+ t(S[0], N, C[0], n + p + P + C.index);
594
596
  }
595
- r.push(d);
597
+ o.push(d);
596
598
  }
597
599
  }
598
600
  p = m + 1;
599
601
  }
600
602
  }
601
- function vt(s) {
603
+ function wt(s) {
602
604
  const n = s.replace(/:state\([\w-]+\)/gu, "").trimStart();
603
605
  return /(?:^|[\s>+~])([a-z][\w-]*)(?:[.#:][\w-]+|\[[^\]]*\])*$/iu.exec(n)?.[1]?.toLowerCase();
604
606
  }
605
- function yt({
607
+ function St({
606
608
  contents: s,
607
609
  scanElement: n,
608
- scanStyle: e,
609
- scanScript: t
610
+ scanStyle: t,
611
+ scanScript: e
610
612
  }) {
611
- const i = /<!--[\s\S]*?(?:-->|$)|<![^>]*>|<\/?([a-z][\w:-]*)\b((?:"[^"]*"|'[^']*'|[^'">])*)>/giu;
612
- for (let a = i.exec(s); a !== null; a = i.exec(s)) {
613
+ const r = /<!--[\s\S]*?(?:-->|$)|<![^>]*>|<\/?([a-z][\w:-]*)\b((?:"[^"]*"|'[^']*'|[^'">])*)>/giu;
614
+ for (let a = r.exec(s); a !== null; a = r.exec(s)) {
613
615
  if (a[1] === void 0 || a[0].startsWith("</"))
614
616
  continue;
615
- const r = a[1].toLowerCase(), p = a.index + 1 + a[1].length, l = [...a[2].matchAll(/([^\s"'<>/=]+)(?:\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s"'=<>`]+)))?/gu)].map(
617
+ const o = a[1].toLowerCase(), p = a.index + 1 + a[1].length, l = [...a[2].matchAll(/([^\s"'<>/=]+)(?:\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s"'=<>`]+)))?/gu)].map(
616
618
  (c) => {
617
619
  const m = c[2] ?? c[3] ?? c[4], g = c[2] !== void 0 || c[3] !== void 0;
618
620
  return {
@@ -623,137 +625,137 @@ function yt({
623
625
  };
624
626
  }
625
627
  );
626
- if (n(r, a.index + 1, l), r === "plaintext")
628
+ if (n(o, a.index + 1, l), o === "plaintext")
627
629
  break;
628
- if (["script", "style", "textarea", "title", "xmp", "iframe", "noembed", "noframes"].includes(r)) {
629
- const c = new RegExp(`</${r}\\s*>`, "giu");
630
- c.lastIndex = i.lastIndex;
630
+ if (["script", "style", "textarea", "title", "xmp", "iframe", "noembed", "noframes"].includes(o)) {
631
+ const c = new RegExp(`</${o}\\s*>`, "giu");
632
+ c.lastIndex = r.lastIndex;
631
633
  const m = c.exec(s);
632
- r === "style" ? e(s.slice(i.lastIndex, m?.index ?? s.length), i.lastIndex) : r === "script" && t?.(s.slice(i.lastIndex, m?.index ?? s.length), i.lastIndex, l), i.lastIndex = m === null ? s.length : c.lastIndex;
634
+ o === "style" ? t(s.slice(r.lastIndex, m?.index ?? s.length), r.lastIndex) : o === "script" && e?.(s.slice(r.lastIndex, m?.index ?? s.length), r.lastIndex, l), r.lastIndex = m === null ? s.length : c.lastIndex;
633
635
  }
634
636
  }
635
637
  }
636
- const xt = /[:/@\\]|^\.{1,2}$|\.(?:tgz|tar(?:\.gz)?)$/iu;
637
- async function wt(s, n, e) {
638
- const t = JSON.parse('["@arcgis/ai-components","@arcgis/api-extractor","@arcgis/arcade-parser","@arcgis/arcade-languageservice","@arcgis/charts-components","@arcgis/codemod","@arcgis/coding-components","@arcgis/common-components","@arcgis/core","@arcgis/lumina-toolkit","@arcgis/create","@arcgis/eslint-config","@arcgis/languages-api-utils","@arcgis/languages-sdk-spec","@arcgis/lumina","@arcgis/lumina-compiler","@arcgis/map-components","@arcgis/node-toolkit","@arcgis/portal-components","@arcgis/toolkit"]'), i = new Set(t), a = /* @__PURE__ */ new Set([...t, "@esri/calcite-components"]), r = [...new Map(s.map((g) => [g.filePath, g])).values()], p = new Set(
638
+ const kt = /[:/@\\]|^\.{1,2}$|\.(?:tgz|tar(?:\.gz)?)$/iu;
639
+ async function Nt(s, n, t) {
640
+ const e = JSON.parse('["@arcgis/ai-components","@arcgis/api-extractor","@arcgis/arcade-parser","@arcgis/arcade-languageservice","@arcgis/charts-components","@arcgis/codemod","@arcgis/coding-components","@arcgis/common-components","@arcgis/core","@arcgis/lumina-toolkit","@arcgis/create","@arcgis/eslint-config","@arcgis/languages-api-utils","@arcgis/languages-sdk-spec","@arcgis/lumina","@arcgis/lumina-compiler","@arcgis/map-components","@arcgis/node-toolkit","@arcgis/portal-components","@arcgis/toolkit"]'), r = new Set(e), a = /* @__PURE__ */ new Set([...e, "@esri/calcite-components"]), o = [...new Map(s.map((g) => [g.filePath, g])).values()], p = new Set(
639
641
  (await Promise.all(
640
- r.map(async ({ filePath: g, contents: y }) => {
641
- const v = [await j(g)], d = y.publishConfig?.directory;
642
+ o.map(async ({ filePath: g, contents: y }) => {
643
+ const h = [await J(g)], d = y.publishConfig?.directory;
642
644
  if (typeof d == "string") {
643
- const u = P.resolve(P.dirname(g), d, "package.json");
644
- o.sys.fileExists(u) && v.push(await j(u));
645
+ const u = $.resolve($.dirname(g), d, "package.json");
646
+ i.sys.fileExists(u) && h.push(await J(u));
645
647
  }
646
- return v;
648
+ return h;
647
649
  })
648
650
  )).flat()
649
651
  ), l = /* @__PURE__ */ new Map(), c = /* @__PURE__ */ new Map(), m = [];
650
- await ve(r, 4, async (g) => {
652
+ await xe(o, 4, async (g) => {
651
653
  let y;
652
- const v = [], d = {
654
+ const h = [], d = {
653
655
  ...g.contents.peerDependencies,
654
656
  ...g.contents.optionalDependencies,
655
657
  ...g.contents.devDependencies,
656
658
  ...g.contents.dependencies
657
659
  };
658
- for (const [f, k] of Object.entries(d)) {
659
- const N = k.replace(/^npm:/u, "");
660
- if (!a.has(f) || !k.startsWith("catalog:") && xt.test(N))
660
+ for (const [f, S] of Object.entries(d)) {
661
+ const N = S.replace(/^npm:/u, "");
662
+ if (!a.has(f) || !S.startsWith("catalog:") && kt.test(N))
661
663
  continue;
662
- const A = await q(
663
- P.join("node_modules", f, "package.json"),
664
- P.dirname(g.filePath)
664
+ const A = await K(
665
+ $.join("node_modules", f, "package.json"),
666
+ $.dirname(g.filePath)
665
667
  );
666
668
  if (A === void 0) {
667
669
  (n === void 0 || f === n) && m.push(`${f} (${g.contents.name ?? g.filePath})`);
668
670
  continue;
669
671
  }
670
- if (p.has(await j(A)))
672
+ if (p.has(await J(A)))
671
673
  continue;
672
- const h = await Xe(P.dirname(A));
673
- !h.name || !h.version || !a.has(h.name) || v.push({ declared: k, location: A, name: h.name, version: h.version });
674
+ const P = await et($.dirname(A));
675
+ !P.name || !P.version || !a.has(P.name) || h.push({ declared: S, location: A, name: P.name, version: P.version });
674
676
  }
675
677
  const u = Map.groupBy(
676
- v.filter(({ name: f }) => i.has(f)),
678
+ h.filter(({ name: f }) => r.has(f)),
677
679
  ({ version: f }) => f
678
- ), x = F.maxSatisfying([...u.keys()], "*", {
680
+ ), v = W.maxSatisfying([...u.keys()], "*", {
679
681
  includePrerelease: !0
680
- }), w = [...u].sort(([f], [k]) => f.localeCompare(k)).map(
681
- ([f, k]) => `${f}: ${k.map(({ name: N }) => `\`${N}\``).sort().join(", ")}`
682
+ }), x = [...u].sort(([f], [S]) => f.localeCompare(S)).map(
683
+ ([f, S]) => `${f}: ${S.map(({ name: N }) => `\`${N}\``).sort().join(", ")}`
682
684
  ).join("; ");
683
- for (const { declared: f, location: k, name: N, version: A } of v) {
685
+ for (const { declared: f, location: S, name: N, version: A } of h) {
684
686
  if (n !== void 0 && N !== n)
685
687
  continue;
686
- let h = l.get(N);
687
- h === void 0 && (h = kt(N), l.set(N, h));
688
- const S = await h;
689
- S === void 0 && e?.();
690
- const b = S === void 0 ? void 0 : bt(A, S), L = [];
691
- b !== void 0 && L.push({
688
+ let P = l.get(N);
689
+ P === void 0 && (P = At(N), l.set(N, P));
690
+ const C = await P;
691
+ C === void 0 && t?.();
692
+ const w = C === void 0 ? void 0 : Ct(A, C), b = [];
693
+ w !== void 0 && b.push({
692
694
  category: "outdatedDependencies",
693
- targetVersion: b.expected,
694
- reason: `Update to ${b.expected} (declared ${f}). ${b.reason}`
695
- }), i.has(N) && x !== null && F.lt(A, x) && L.push({
695
+ targetVersion: w.expected,
696
+ reason: `Update to ${w.expected} (declared ${f}). ${w.reason}`
697
+ }), r.has(N) && v !== null && W.lt(A, v) && b.push({
696
698
  category: "mismatchedDependencies",
697
- targetVersion: x,
698
- reason: `Web GIS SDK packages within the same package.json must use the same exact version (found ${w}).`
699
+ targetVersion: v,
700
+ reason: `Web GIS SDK packages within the same package.json must use the same exact version (found ${x}).`
699
701
  });
700
- for (const { category: $, targetVersion: T, reason: I } of L) {
701
- let C;
702
- if ($ === "outdatedDependencies" && f.startsWith("catalog:"))
702
+ for (const { category: k, targetVersion: L, reason: F } of b) {
703
+ let E;
704
+ if (k === "outdatedDependencies" && f.startsWith("catalog:"))
703
705
  try {
704
- C = await St(g.filePath, N, f);
706
+ E = await bt(g.filePath, N, f);
705
707
  } catch (D) {
706
- e?.(), J(
708
+ t?.(), z(
707
709
  "warn",
708
- R(g.filePath),
710
+ U(g.filePath),
709
711
  `Unable to locate dependency catalog: ${String(D)}`
710
712
  );
711
713
  }
712
- C === void 0 && (y ??= o.parseJsonText(g.filePath, await U(g.filePath, "utf8")));
713
- const E = c.get(N) ?? [];
714
- C !== void 0 && E.some(
715
- (D) => D.sourceFileName === C.sourceFileName && D.usage.start === C.location.start && D.usage.category === $
716
- ) || (E.push({
717
- sourceFileName: C?.sourceFileName ?? g.filePath,
714
+ E === void 0 && (y ??= i.parseJsonText(g.filePath, await V(g.filePath, "utf8")));
715
+ const T = c.get(N) ?? [];
716
+ E !== void 0 && T.some(
717
+ (D) => D.sourceFileName === E.sourceFileName && D.usage.start === E.location.start && D.usage.category === k
718
+ ) || (T.push({
719
+ sourceFileName: E?.sourceFileName ?? g.filePath,
718
720
  usage: {
719
- name: `${A} => ${T}`,
720
- category: $,
721
- module: C === void 0 ? "package.json" : P.basename(C.sourceFileName),
722
- originFileNames: [k],
723
- reason: I,
724
- ...C?.location ?? Nt(y, N, f)
721
+ name: `${A} => ${L}`,
722
+ category: k,
723
+ module: E === void 0 ? "package.json" : $.basename(E.sourceFileName),
724
+ originFileNames: [S],
725
+ reason: F,
726
+ ...E?.location ?? Pt(y, N, f)
725
727
  }
726
- }), c.set(N, E));
728
+ }), c.set(N, T));
727
729
  }
728
730
  }
729
731
  });
730
732
  for (const g of c.values())
731
733
  g.sort(
732
- (y, v) => y.sourceFileName.localeCompare(v.sourceFileName) || y.usage.start - v.usage.start
734
+ (y, h) => y.sourceFileName.localeCompare(h.sourceFileName) || y.usage.start - h.usage.start
733
735
  );
734
- return m.length > 0 && (e?.(), m.sort(), J(
736
+ return m.length > 0 && (t?.(), m.sort(), z(
735
737
  "warn",
736
738
  "dependency-versions",
737
739
  `Failed to find installed locations for ${m.length} dependencies: ${m.slice(0, 15).join(", ")}${m.length > 15 ? `, and ${m.length - 15} more` : ""}.`
738
740
  )), c;
739
741
  }
740
- async function St(s, n, e) {
741
- const t = await q("pnpm-workspace.yaml", P.dirname(s)) ?? await q(".yarnrc.yml", P.dirname(s));
742
- if (t === void 0)
743
- throw new Error(`Missing pnpm-workspace.yaml or .yarnrc.yml for ${e}`);
744
- const i = await j(t), a = new Ye(), r = Ze(await U(i, "utf8"), { lineCounter: a });
745
- if (r.errors.length > 0)
746
- throw r.errors[0];
747
- const p = e.slice(8), l = r.getIn(
742
+ async function bt(s, n, t) {
743
+ const e = await K("pnpm-workspace.yaml", $.dirname(s)) ?? await K(".yarnrc.yml", $.dirname(s));
744
+ if (e === void 0)
745
+ throw new Error(`Missing pnpm-workspace.yaml or .yarnrc.yml for ${t}`);
746
+ const r = await J(e), a = new tt(), o = nt(await V(r, "utf8"), { lineCounter: a });
747
+ if (o.errors.length > 0)
748
+ throw o.errors[0];
749
+ const p = t.slice(8), l = o.getIn(
748
750
  p === "" || p === "default" ? ["catalog"] : ["catalogs", p],
749
751
  !0
750
- ), c = et(l) ? l.items.find(({ key: d }) => le(d) && d.value === n)?.key : void 0;
751
- if (!le(c) || c.range === void 0)
752
- throw new Error(`Missing ${n} in ${e} in ${i}`);
753
- const [m, g] = c.range, { line: y, col: v } = a.linePos(m);
754
- return { sourceFileName: i, location: { start: m, length: g - m, line: y, column: v } };
752
+ ), c = st(l) ? l.items.find(({ key: d }) => de(d) && d.value === n)?.key : void 0;
753
+ if (!de(c) || c.range === void 0)
754
+ throw new Error(`Missing ${n} in ${t} in ${r}`);
755
+ const [m, g] = c.range, { line: y, col: h } = a.linePos(m);
756
+ return { sourceFileName: r, location: { start: m, length: g - m, line: y, column: h } };
755
757
  }
756
- async function kt(s) {
758
+ async function At(s) {
757
759
  try {
758
760
  const n = await fetch(`https://registry.npmjs.org/-/package/${encodeURIComponent(s)}/dist-tags`, {
759
761
  signal: AbortSignal.timeout(5e3),
@@ -761,103 +763,103 @@ async function kt(s) {
761
763
  });
762
764
  if (!n.ok)
763
765
  throw new Error(`Registry returned HTTP ${n.status}`);
764
- const e = await n.json();
765
- if (typeof e != "object" || e === null || Array.isArray(e))
766
+ const t = await n.json();
767
+ if (typeof t != "object" || t === null || Array.isArray(t))
766
768
  throw new Error("Invalid registry dist-tags response");
767
- const t = {};
768
- for (const [i, a] of Object.entries(e))
769
- ["latest", "rc", "next"].includes(i) && typeof a == "string" && F.valid(a) !== null && (t[i] = a);
770
- if (Object.keys(t).length === 0)
769
+ const e = {};
770
+ for (const [r, a] of Object.entries(t))
771
+ ["latest", "rc", "next"].includes(r) && typeof a == "string" && W.valid(a) !== null && (e[r] = a);
772
+ if (Object.keys(e).length === 0)
771
773
  throw new Error("Registry returned no supported release tags");
772
- return t;
774
+ return e;
773
775
  } catch (n) {
774
- J("warn", s, `Dependency freshness unavailable: ${String(n)}`);
776
+ z("warn", s, `Dependency freshness unavailable: ${String(n)}`);
775
777
  return;
776
778
  }
777
779
  }
778
- function Nt(s, n, e) {
779
- const t = o.forEachChild(s, p), i = t.getStart(s), { line: a, character: r } = s.getLineAndCharacterOfPosition(i);
780
- return { start: i, length: t.getWidth(s), line: a + 1, column: r + 1 };
780
+ function Pt(s, n, t) {
781
+ const e = i.forEachChild(s, p), r = e.getStart(s), { line: a, character: o } = s.getLineAndCharacterOfPosition(r);
782
+ return { start: r, length: e.getWidth(s), line: a + 1, column: o + 1 };
781
783
  function p(l) {
782
- return o.isPropertyAssignment(l) && o.isStringLiteral(l.name) && ["dependencies", "devDependencies", "optionalDependencies", "peerDependencies"].includes(l.name.text) && o.isObjectLiteralExpression(l.initializer) ? l.initializer.properties.find(
783
- (c) => o.isPropertyAssignment(c) && o.isStringLiteral(c.name) && c.name.text === n && o.isStringLiteral(c.initializer) && c.initializer.text === e
784
- )?.name : o.forEachChild(l, p);
784
+ return i.isPropertyAssignment(l) && i.isStringLiteral(l.name) && ["dependencies", "devDependencies", "optionalDependencies", "peerDependencies"].includes(l.name.text) && i.isObjectLiteralExpression(l.initializer) ? l.initializer.properties.find(
785
+ (c) => i.isPropertyAssignment(c) && i.isStringLiteral(c.name) && c.name.text === n && i.isStringLiteral(c.initializer) && c.initializer.text === t
786
+ )?.name : i.forEachChild(l, p);
785
787
  }
786
788
  }
787
- function bt(s, n) {
788
- const e = F.parse(s), t = F.parse(n.latest ?? "");
789
- if (e === null)
789
+ function Ct(s, n) {
790
+ const t = W.parse(s), e = W.parse(n.latest ?? "");
791
+ if (t === null)
790
792
  return;
791
793
  if (
792
794
  // Permit packages without latest dist-tag
793
- t !== null && // Permit installed to be newer than latest
794
- F.lt(e, t) && // Require using stable over prerelease
795
- (e.prerelease.length > 0 || // Forbid major being behind stable
796
- e.major !== t.major || // Forbid minor being behind stable
797
- e.minor !== t.minor)
795
+ e !== null && // Permit installed to be newer than latest
796
+ W.lt(t, e) && // Require using stable over prerelease
797
+ (t.prerelease.length > 0 || // Forbid major being behind stable
798
+ t.major !== e.major || // Forbid minor being behind stable
799
+ t.minor !== e.minor)
798
800
  )
799
801
  return {
800
- expected: t.version,
802
+ expected: e.version,
801
803
  reason: "A newer stable release is available. Prerelease versions are deprecated."
802
804
  };
803
805
  if (
804
806
  // Enforce policy only for next.N prereleases
805
- e.prerelease.length !== 2 || // Only enforce policy for -next
806
- e.prerelease[0] !== "next"
807
+ t.prerelease.length !== 2 || // Only enforce policy for -next
808
+ t.prerelease[0] !== "next"
807
809
  )
808
810
  return;
809
- const i = e.prerelease[1];
810
- if (typeof i != "number")
811
+ const r = t.prerelease[1];
812
+ if (typeof r != "number")
811
813
  return;
812
- const r = [n.next, n.rc].flatMap((p) => {
813
- const l = F.parse(p ?? "");
814
+ const o = [n.next, n.rc].flatMap((p) => {
815
+ const l = W.parse(p ?? "");
814
816
  return l !== null && // Support packages without latest dist-tag
815
- (t === null || // Ignore rc dist-tag if it is behind latest
816
- F.gt(l, t)) && // Require same major.minor.patch for -next version comparison
817
- l.major === e.major && l.minor === e.minor && l.patch === e.patch && // Require next.N format for comparison
817
+ (e === null || // Ignore rc dist-tag if it is behind latest
818
+ W.gt(l, e)) && // Require same major.minor.patch for -next version comparison
819
+ l.major === t.major && l.minor === t.minor && l.patch === t.patch && // Require next.N format for comparison
818
820
  l.prerelease.length === 2 && l.prerelease[0] === "next" && typeof l.prerelease[1] == "number" ? [l] : [];
819
- }).sort(F.rcompare).at(0);
820
- if (r !== void 0 && Number(r.prerelease[1]) - i >= 30)
821
+ }).sort(W.rcompare).at(0);
822
+ if (o !== void 0 && Number(o.prerelease[1]) - r >= 30)
821
823
  return {
822
- expected: r.version,
824
+ expected: o.version,
823
825
  reason: "Installed -next is significantly behind the most recent -next build."
824
826
  };
825
827
  }
826
- const At = /* @__PURE__ */ new Set(["none", "amd", "umd", "system", "systemjs", "node", "node10", "legacy"]), Pt = /* @__PURE__ */ new Set(["node", "node10", "classic"]);
827
- async function Ct(s) {
828
- const n = "es2024", e = [];
829
- for (const t of [...new Set(s)].sort()) {
830
- const i = o.parseJsonText(t, await U(t, "utf8"));
831
- e.push(...$t(i, n));
828
+ const $t = /* @__PURE__ */ new Set(["none", "amd", "umd", "system", "systemjs", "node", "node10", "legacy"]), Et = /* @__PURE__ */ new Set(["node", "node10", "classic"]);
829
+ async function Dt(s) {
830
+ const n = "es2024", t = [];
831
+ for (const e of [...new Set(s)].sort()) {
832
+ const r = i.parseJsonText(e, await V(e, "utf8"));
833
+ t.push(...Lt(r, n));
832
834
  }
833
- return e;
835
+ return t;
834
836
  }
835
- function $t(s, n) {
836
- const e = s.statements[0];
837
- if (e === void 0 || !o.isExpressionStatement(e) || !o.isObjectLiteralExpression(e.expression))
837
+ function Lt(s, n) {
838
+ const t = s.statements[0];
839
+ if (t === void 0 || !i.isExpressionStatement(t) || !i.isObjectLiteralExpression(t.expression))
838
840
  return [];
839
- const t = e.expression.properties.find(
840
- (r) => o.isPropertyAssignment(r) && o.isStringLiteral(r.name) && r.name.text === "compilerOptions"
841
+ const e = t.expression.properties.find(
842
+ (o) => i.isPropertyAssignment(o) && i.isStringLiteral(o.name) && o.name.text === "compilerOptions"
841
843
  );
842
- if (t === void 0 || !o.isObjectLiteralExpression(t.initializer))
844
+ if (e === void 0 || !i.isObjectLiteralExpression(e.initializer))
843
845
  return [];
844
- const i = o.convertCompilerOptionsFromJson({ target: n }, ".").options.target, a = [];
845
- for (const r of t.initializer.properties) {
846
- if (!o.isPropertyAssignment(r) || !o.isStringLiteral(r.name))
846
+ const r = i.convertCompilerOptionsFromJson({ target: n }, ".").options.target, a = [];
847
+ for (const o of e.initializer.properties) {
848
+ if (!i.isPropertyAssignment(o) || !i.isStringLiteral(o.name))
847
849
  continue;
848
- const p = r.name.text, l = o.isStringLiteral(r.initializer) ? r.initializer.text.toLowerCase() : void 0;
850
+ const p = o.name.text, l = i.isStringLiteral(o.initializer) ? o.initializer.text.toLowerCase() : void 0;
849
851
  let c;
850
- if (p === "module" && l !== void 0 && At.has(l))
852
+ if (p === "module" && l !== void 0 && $t.has(l))
851
853
  c = `The ${l} module setting is legacy or unsupported. Update to newer module setting. See https://webgis.esri.com/references/support-packages/typescript.`;
852
- else if (p === "moduleResolution" && l !== void 0 && Pt.has(l))
854
+ else if (p === "moduleResolution" && l !== void 0 && Et.has(l))
853
855
  c = `The ${l} module resolution setting is deprecated or unsupported. Update to newer module setting. See https://webgis.esri.com/references/support-packages/typescript.`;
854
856
  else if (p === "target" && l !== void 0) {
855
- const v = o.convertCompilerOptionsFromJson({ target: l }, ".").options.target;
856
- v !== void 0 && v < i && (c = `Targets below ${n} are older than Maps SDK's for JavaScript supported targets. See https://next.gha.afd.arcgis.com/javascript/latest/system-requirements/.`);
857
+ const h = i.convertCompilerOptionsFromJson({ target: l }, ".").options.target;
858
+ h !== void 0 && h < r && (c = `Targets below ${n} are older than Maps SDK's for JavaScript supported targets. See https://next.gha.afd.arcgis.com/javascript/latest/system-requirements/.`);
857
859
  } else p === "ignoreDeprecations" && (c = "Address deprecations that were suppressed by ignoreDeprecations.");
858
860
  if (c === void 0)
859
861
  continue;
860
- const m = r.name.getStart(s), { line: g, character: y } = s.getLineAndCharacterOfPosition(m);
862
+ const m = o.name.getStart(s), { line: g, character: y } = s.getLineAndCharacterOfPosition(m);
861
863
  a.push({
862
864
  sourceFileName: s.fileName,
863
865
  usage: {
@@ -867,7 +869,7 @@ function $t(s, n) {
867
869
  originFileNames: [],
868
870
  reason: c,
869
871
  start: m,
870
- length: r.name.getWidth(s),
872
+ length: o.name.getWidth(s),
871
873
  line: g + 1,
872
874
  column: y + 1
873
875
  }
@@ -875,30 +877,30 @@ function $t(s, n) {
875
877
  }
876
878
  return a;
877
879
  }
878
- async function rn(s, n) {
880
+ async function pn(s, n) {
879
881
  if (n.json && n.md) {
880
- J("error", "@arcgis/codemod", "The --json and --md options cannot be used together."), process.exitCode = 1;
882
+ z("error", "@arcgis/codemod", "The --json and --md options cannot be used together."), process.exitCode = 1;
881
883
  return;
882
884
  }
883
- const e = await Ee(s), t = {
885
+ const t = await Te(s), e = {
884
886
  esriOnly: n.esriOnly,
885
887
  outputFormat: n.md ? "md" : n.json ? "json" : "text",
886
888
  category: n.category,
887
889
  packageName: n.package,
888
890
  exclude: n.exclude,
889
- reportingUrl: n.report === !0 ? Le : n.report || void 0
891
+ reportingUrl: n.report === !0 ? Fe : n.report || void 0
890
892
  };
891
- if (t.reportingUrl && (e || t.esriOnly || t.category || t.packageName))
893
+ if (e.reportingUrl && (t || e.esriOnly || e.category || e.packageName))
892
894
  throw new Error(
893
895
  "Reporting requires complete, unfiltered repository scan. The only supported filter is the --exclude flag."
894
896
  );
895
- const i = t.outputFormat === "json" || t.reportingUrl ? process.cwd() === M().repositoryRoot : !1;
896
- if (t.reportingUrl && !i)
897
+ const r = e.outputFormat === "json" || e.reportingUrl ? Re() === R().repositoryRoot : !1;
898
+ if (e.reportingUrl && !r)
897
899
  throw new Error(
898
900
  "Reporting requires scanning from the Git repository root. If some folders must be excluded, use the --exclude flag."
899
901
  );
900
- let a = !e && !t.esriOnly && !t.category && !t.packageName && !t.exclude?.length;
901
- (t.outputFormat === "json" || t.reportingUrl) && (a &&= i), await Te(
902
+ let a = !t && !e.esriOnly && !e.category && !e.packageName && !e.exclude?.length;
903
+ (e.outputFormat === "json" || e.reportingUrl) && (a &&= r), await Ie(
902
904
  {
903
905
  meta: {
904
906
  needsTypeInformation: !0,
@@ -906,202 +908,202 @@ async function rn(s, n) {
906
908
  includeComponentFiles: !0,
907
909
  includeTsConfigFiles: !0
908
910
  },
909
- async run(r) {
910
- Oe(await Dt(r, t, a, e));
911
+ async run(o) {
912
+ je(await Tt(o, e, a, t));
911
913
  }
912
914
  },
913
915
  "deprecations audit-usages",
914
- e
916
+ t
915
917
  );
916
918
  }
917
- async function Dt(s, n, e, t) {
918
- const i = /* @__PURE__ */ new Map(), a = we(n.exclude ?? []), r = _e("warn", () => {
919
- e = !1;
920
- }), p = /* @__PURE__ */ new Map(), l = ce([]), c = /* @__PURE__ */ new Set(), m = [
919
+ async function Tt(s, n, t, e) {
920
+ const r = /* @__PURE__ */ new Map(), a = Se(n.exclude ?? []);
921
+ let o = !0;
922
+ const p = () => {
923
+ t = !1, o = !1;
924
+ }, l = Ze("warn", p), c = /* @__PURE__ */ new Map(), m = pe([]), g = /* @__PURE__ */ new Set(), y = [
921
925
  ...new Map(
922
- s.flatMap(({ packageJson: h }) => {
923
- const S = h === void 0 ? void 0 : P.dirname(h.filePath), b = h?.contents.name;
924
- return S !== void 0 && b !== void 0 && O(S, process.cwd()) ? [[S, { root: S, name: b }]] : [];
926
+ s.flatMap(({ packageJson: w }) => {
927
+ const b = w === void 0 ? void 0 : $.dirname(w.filePath), k = w?.contents.name;
928
+ return b !== void 0 && k !== void 0 && j(b, process.cwd()) ? [[b, { root: b, name: k }]] : [];
925
929
  })
926
930
  ).values()
927
- ].toSorted((h, S) => S.root.length - h.root.length);
928
- for (const h of s) {
929
- var f = [];
931
+ ].toSorted((w, b) => b.root.length - w.root.length);
932
+ for (const w of s) {
933
+ var N = [];
930
934
  try {
931
- const S = h.filePaths.filter((E) => a(E) && !oe(E));
932
- if (S.length === 0)
935
+ const b = w.filePaths.filter((I) => a(I) && !ce(I));
936
+ if (b.length === 0)
933
937
  continue;
934
- const b = Be(h.packageJson);
935
- const L = await x(h.packageJson, b.packages);
936
- const $ = h.packageJson === void 0 ? void 0 : P.dirname(h.packageJson.filePath);
937
- const T = ie(f, S.some(Fe) ? De(h, !1, {
938
- paths: { ...h.typeScriptConfig?.compilerOptions.paths, ...b.paths }
938
+ const k = Be(w.packageJson);
939
+ const L = await f(w.packageJson, k.packages);
940
+ const F = w.packageJson === void 0 ? void 0 : $.dirname(w.packageJson.filePath);
941
+ const E = ie(N, b.some(We) ? Le(w, !1, {
942
+ paths: { ...w.typeScriptConfig?.compilerOptions.paths, ...k.paths }
939
943
  }) : void 0);
940
- const I = T?.tsMorph.getLanguageService().compilerObject;
941
- const C = I?.getProgram()?.getTypeChecker();
942
- for (const E of T?.getCodemodFiles() ?? []) {
943
- const D = E.compilerNode;
944
- if (!(!a(D.fileName) || oe(D.fileName))) {
945
- if (I !== void 0 && C !== void 0) {
946
- const $e = Lt(
944
+ const T = E?.tsMorph.getLanguageService().compilerObject;
945
+ const D = T?.getProgram()?.getTypeChecker();
946
+ for (const I of E?.getCodemodFiles() ?? []) {
947
+ const O = I.compilerNode;
948
+ if (!(!a(O.fileName) || ce(O.fileName))) {
949
+ if (T !== void 0 && D !== void 0) {
950
+ const De = It(
951
+ O,
952
+ T,
947
953
  D,
948
- I,
949
- C,
950
- $,
954
+ F,
951
955
  n.esriOnly
952
956
  );
953
- for (const Z of $e) {
954
- const ee = Rt(Z.originFileNames, m, $), te = i.get(ee) ?? [];
955
- te.push({ sourceFileName: D.fileName, usage: Z }), i.set(ee, te);
957
+ for (const te of De) {
958
+ const ne = zt(te.originFileNames, y, F), se = r.get(ne) ?? [];
959
+ se.push({ sourceFileName: O.fileName, usage: te }), r.set(ne, se);
956
960
  }
957
961
  }
958
- w(fe(D, L, C)), c.add(D.fileName);
962
+ S(ve(O, L, D)), g.add(O.fileName);
959
963
  }
960
964
  }
961
- await ve(S, 8, async (E) => {
962
- if (c.has(E))
965
+ await xe(b, 8, async (I) => {
966
+ if (g.has(I))
963
967
  return;
964
- const D = await U(E, "utf8");
965
- w(fe({ fileName: E, text: D }, L)), c.add(E);
968
+ const O = await V(I, "utf8");
969
+ S(ve({ fileName: I, text: O }, L)), g.add(I);
966
970
  });
967
- } catch (k) {
968
- var N = k, A = !0;
971
+ } catch (A) {
972
+ var P = A, C = !0;
969
973
  } finally {
970
- re(f, N, A);
974
+ ae(N, P, C);
971
975
  }
972
976
  }
973
- const g = await wt(
974
- s.flatMap(({ packageJson: h }) => h === void 0 ? [] : [h]),
977
+ const h = await Nt(
978
+ s.flatMap(({ packageJson: w }) => w === void 0 ? [] : [w]),
975
979
  n.packageName,
976
- () => {
977
- e = !1;
978
- }
980
+ p
979
981
  );
980
- for (const [h, S] of g)
981
- i.set(h, [...i.get(h) ?? [], ...S]);
982
+ for (const [w, b] of h)
983
+ r.set(w, [...r.get(w) ?? [], ...b]);
982
984
  if (!n.esriOnly && (n.packageName === void 0 || n.packageName === "typescript") && (n.category === void 0 || n.category === "outdatedTypeScriptConfig")) {
983
- const h = s.flatMap(
984
- ({ typeScriptConfig: b }) => b !== void 0 && O(b.filePath, process.cwd()) && a(b.filePath) && (t === void 0 || t === b.filePath) ? [b.filePath] : []
985
- ), S = await Ct(h);
986
- S.length > 0 && i.set("typescript", [...i.get("typescript") ?? [], ...S]);
985
+ const w = s.flatMap(
986
+ ({ typeScriptConfig: k }) => k !== void 0 && j(k.filePath, process.cwd()) && a(k.filePath) && (e === void 0 || e === k.filePath) ? [k.filePath] : []
987
+ ), b = await Dt(w);
988
+ b.length > 0 && r.set("typescript", [...r.get("typescript") ?? [], ...b]);
987
989
  }
988
- const y = n.reportingUrl || n.outputFormat === "json" ? M() : void 0, v = Et(i, n), d = y !== void 0 && (n.reportingUrl || n.outputFormat === "json") ? H(v, Se(), y, e, n.exclude) : void 0;
989
- tt(v, n.outputFormat, d);
990
- const u = [...v.values()].flat();
991
- return Ve(
990
+ const d = n.reportingUrl || n.outputFormat === "json" ? R() : void 0, u = Ft(r, n), v = d !== void 0 && (n.reportingUrl || n.outputFormat === "json") ? _(u, ke(), d, t, n.exclude) : void 0;
991
+ rt(u, n.outputFormat, v);
992
+ const x = [...u.values()].flat();
993
+ return qe(
992
994
  "usages",
993
- u.length,
994
- new Set(u.map(({ sourceFileName: h }) => h)).size,
995
- v.size
996
- ), n.reportingUrl && d !== void 0 && await Ie(d, n.reportingUrl), e;
997
- async function x(h, S) {
998
- if (h === void 0)
999
- return l;
1000
- let b = p.get(h.filePath);
1001
- return b === void 0 && (b = ce(
1002
- await Ke(h, r, n.esriOnly, S)
1003
- ), p.set(h.filePath, b)), b;
995
+ x.length,
996
+ new Set(x.map(({ sourceFileName: w }) => w)).size,
997
+ u.size
998
+ ), n.reportingUrl && v !== void 0 && await Oe(v, n.reportingUrl), o;
999
+ async function f(w, b) {
1000
+ if (w === void 0)
1001
+ return m;
1002
+ let k = c.get(w.filePath);
1003
+ return k === void 0 && (k = pe(
1004
+ await Ye(w, l, n.esriOnly, b)
1005
+ ), c.set(w.filePath, k)), k;
1004
1006
  }
1005
- function w(h) {
1006
- for (const { packageName: S, sourceFileName: b, usage: L } of h) {
1007
- const $ = i.get(S) ?? [], T = $.findIndex(
1008
- (C) => C.sourceFileName === b && C.usage.start === L.start && C.usage.length === L.length
1009
- ), I = { sourceFileName: b, usage: L };
1010
- T === -1 ? $.push(I) : $[T] = I, i.set(S, $);
1007
+ function S(w) {
1008
+ for (const { packageName: b, sourceFileName: k, usage: L } of w) {
1009
+ const F = r.get(b) ?? [], E = F.findIndex(
1010
+ (D) => D.sourceFileName === k && D.usage.start === L.start && D.usage.length === L.length
1011
+ ), T = { sourceFileName: k, usage: L };
1012
+ E === -1 ? F.push(T) : F[E] = T, r.set(b, F);
1011
1013
  }
1012
1014
  }
1013
1015
  }
1014
- function Et(s, n, e) {
1015
- const t = we(n.exclude ?? [], e), i = /* @__PURE__ */ new Map();
1016
- for (const [a, r] of s) {
1016
+ function Ft(s, n, t) {
1017
+ const e = Se(n.exclude ?? [], t), r = /* @__PURE__ */ new Map();
1018
+ for (const [a, o] of s) {
1017
1019
  if (n.packageName !== void 0 && a !== n.packageName)
1018
1020
  continue;
1019
- const p = r.filter(
1020
- ({ usage: l, sourceFileName: c }) => t(c) && (n.category === void 0 || xe({
1021
+ const p = o.filter(
1022
+ ({ usage: l, sourceFileName: c }) => e(c) && (n.category === void 0 || Ae({
1021
1023
  package: a,
1022
1024
  name: l.name,
1023
1025
  category: l.category,
1024
1026
  memberOf: l.memberOf,
1025
- module: l.module ?? B(l.originFileNames, a),
1027
+ module: l.module ?? Q(l.originFileNames, a),
1026
1028
  deprecated: l.reason ?? !0
1027
1029
  }) === n.category)
1028
1030
  );
1029
- p.length > 0 && i.set(a, p);
1031
+ p.length > 0 && r.set(a, p);
1030
1032
  }
1031
- return i;
1033
+ return r;
1032
1034
  }
1033
- function Lt(s, n, e, t, i = !1) {
1035
+ function It(s, n, t, e, r = !1) {
1034
1036
  const a = /* @__PURE__ */ new Map();
1035
- for (const r of n.getSuggestionDiagnostics(s.fileName)) {
1036
- if (r.reportsDeprecated === void 0)
1037
+ for (const o of n.getSuggestionDiagnostics(s.fileName)) {
1038
+ if (o.reportsDeprecated === void 0)
1037
1039
  continue;
1038
- const p = Ae(s, r.start, r.start + r.length);
1040
+ const p = Ce(s, o.start, o.start + o.length);
1039
1041
  if (
1040
1042
  // Don't report for imports, only for usages
1041
- o.findAncestor(p, o.isImportDeclaration) !== void 0 || // Don't report closing JSX - only for opening
1042
- o.findAncestor(p, o.isJsxClosingElement) !== void 0
1043
+ i.findAncestor(p, i.isImportDeclaration) !== void 0 || // Don't report closing JSX - only for opening
1044
+ i.findAncestor(p, i.isJsxClosingElement) !== void 0
1043
1045
  )
1044
1046
  continue;
1045
- const l = Wt(p, e), c = l.reason === void 0 ? [] : Q(l.symbol), m = c.length > 0 ? void 0 : n.getDefinitionAtPosition(s.fileName, r.start), g = c.length > 0 ? c : [...new Set(m?.map(({ fileName: y }) => y))];
1046
- X(g, i, t) && _(a, s, {
1047
- start: r.start,
1048
- length: r.length,
1049
- ...Ot(p, l, e, n, m?.[0]),
1047
+ const l = jt(p, t), c = l.reason === void 0 ? [] : X(l.symbol), m = c.length > 0 ? void 0 : n.getDefinitionAtPosition(s.fileName, o.start), g = c.length > 0 ? c : [...new Set(m?.map(({ fileName: y }) => y))];
1048
+ Z(g, r, e) && Y(a, s, {
1049
+ start: o.start,
1050
+ length: o.length,
1051
+ ...Rt(p, l, t, n, m?.[0]),
1050
1052
  originFileNames: g,
1051
- reason: jt(n, s.fileName, r.start) ?? l.reason
1053
+ reason: Ut(n, s.fileName, o.start) ?? l.reason
1052
1054
  });
1053
1055
  }
1054
- return Tt(s, e, a, t, i), [...a.values()].toSorted((r, p) => r.start - p.start);
1056
+ return Wt(s, t, a, e, r), [...a.values()].toSorted((o, p) => o.start - p.start);
1055
1057
  }
1056
- function Tt(s, n, e, t, i) {
1057
- function a(r) {
1058
- o.isNewExpression(r) && Ft(r, n, e, t, i);
1058
+ function Wt(s, n, t, e, r) {
1059
+ function a(o) {
1060
+ i.isNewExpression(o) && Ot(o, n, t, e, r);
1059
1061
  let p, l;
1060
- if (o.isCallExpression(r))
1061
- l = It(r, n), p = r.arguments[0];
1062
- else if (o.isJsxAttribute(r) && o.isIdentifier(r.name)) {
1063
- const c = r.parent.parent;
1064
- (o.isJsxOpeningElement(c) || o.isJsxSelfClosingElement(c)) && (l = n.getContextualType(c.tagName)?.getProperty(r.name.text), p = r.name);
1065
- } else if ((o.isPropertyAssignment(r) || o.isShorthandPropertyAssignment(r) || o.isMethodDeclaration(r)) && o.isObjectLiteralExpression(r.parent)) {
1066
- const c = o.isComputedPropertyName(r.name) ? W(r.name.expression, n) : r.name.text, m = n.getContextualType(r.parent);
1067
- l = c === void 0 || m === void 0 ? void 0 : n.getNonNullableType(m).getProperty(c), p = r.name;
1068
- } else if (o.isPropertyAccessExpression(r))
1069
- l = n.getSymbolAtLocation(r.name), p = r.name;
1070
- else if (o.isElementAccessExpression(r)) {
1071
- const c = W(r.argumentExpression, n);
1072
- l = c === void 0 ? void 0 : n.getTypeAtLocation(r.expression).getProperty(c), p = r.argumentExpression;
1073
- } else if (o.isBindingElement(r) && o.isObjectBindingPattern(r.parent) && r.dotDotDotToken === void 0) {
1074
- const c = r.propertyName ?? (o.isIdentifier(r.name) ? r.name : void 0), m = c === void 0 ? void 0 : o.isComputedPropertyName(c) ? W(c.expression, n) : c.text;
1075
- l = m === void 0 ? void 0 : n.getTypeAtLocation(r.parent).getProperty(m), p = c;
1062
+ if (i.isCallExpression(o))
1063
+ l = Mt(o, n), p = o.arguments[0];
1064
+ else if (i.isJsxAttribute(o) && i.isIdentifier(o.name)) {
1065
+ const c = o.parent.parent;
1066
+ (i.isJsxOpeningElement(c) || i.isJsxSelfClosingElement(c)) && (l = n.getContextualType(c.tagName)?.getProperty(o.name.text), p = o.name);
1067
+ } else if ((i.isPropertyAssignment(o) || i.isShorthandPropertyAssignment(o) || i.isMethodDeclaration(o)) && i.isObjectLiteralExpression(o.parent)) {
1068
+ const c = i.isComputedPropertyName(o.name) ? M(o.name.expression, n) : o.name.text, m = n.getContextualType(o.parent);
1069
+ l = c === void 0 || m === void 0 ? void 0 : n.getNonNullableType(m).getProperty(c), p = o.name;
1070
+ } else if (i.isPropertyAccessExpression(o))
1071
+ l = n.getSymbolAtLocation(o.name), p = o.name;
1072
+ else if (i.isElementAccessExpression(o)) {
1073
+ const c = M(o.argumentExpression, n);
1074
+ l = c === void 0 ? void 0 : n.getTypeAtLocation(o.expression).getProperty(c), p = o.argumentExpression;
1075
+ } else if (i.isBindingElement(o) && i.isObjectBindingPattern(o.parent) && o.dotDotDotToken === void 0) {
1076
+ const c = o.propertyName ?? (i.isIdentifier(o.name) ? o.name : void 0), m = c === void 0 ? void 0 : i.isComputedPropertyName(c) ? M(c.expression, n) : c.text;
1077
+ l = m === void 0 ? void 0 : n.getTypeAtLocation(o.parent).getProperty(m), p = c;
1076
1078
  }
1077
- if ((o.isPropertyAccessExpression(r) || o.isElementAccessExpression(r) || o.isBindingElement(r)) && !l?.declarations?.some(
1078
- (c) => o.isGetAccessorDeclaration(c) || o.isSetAccessorDeclaration(c)
1079
+ if ((i.isPropertyAccessExpression(o) || i.isElementAccessExpression(o) || i.isBindingElement(o)) && !l?.declarations?.some(
1080
+ (c) => i.isGetAccessorDeclaration(c) || i.isSetAccessorDeclaration(c)
1079
1081
  ) && (l = void 0), l !== void 0 && p !== void 0) {
1080
- const c = Ce(l, n), m = Q(l);
1081
- c !== void 0 && X(m, i, t) && _(e, s, {
1082
+ const c = Ee(l, n), m = X(l);
1083
+ c !== void 0 && Z(m, r, e) && Y(t, s, {
1082
1084
  start: p.getStart(s),
1083
1085
  length: p.getWidth(s),
1084
1086
  name: l.getName(),
1085
- ...G(l.declarations?.[0]),
1087
+ ...B(l.declarations?.[0]),
1086
1088
  originFileNames: m,
1087
1089
  reason: c
1088
1090
  });
1089
1091
  }
1090
- o.forEachChild(r, a);
1092
+ i.forEachChild(o, a);
1091
1093
  }
1092
1094
  a(s);
1093
1095
  }
1094
- function Ft(s, n, e, t, i) {
1095
- const a = n.getTypeAtLocation(s).getSymbol(), r = a?.declarations?.[0], p = r !== void 0 && (o.isClassDeclaration(r) || o.isInterfaceDeclaration(r)) ? r.name?.text : void 0, l = p === void 0 ? void 0 : Ge.get(p);
1096
+ function Ot(s, n, t, e, r) {
1097
+ const a = n.getTypeAtLocation(s).getSymbol(), o = a?.declarations?.[0], p = o !== void 0 && (i.isClassDeclaration(o) || i.isInterfaceDeclaration(o)) ? o.name?.text : void 0, l = p === void 0 ? void 0 : _e.get(p);
1096
1098
  if (l === void 0 || p === void 0)
1097
1099
  return;
1098
- const c = Q(a);
1100
+ const c = X(a);
1099
1101
  if (!c.some(
1100
- (y) => (Y(y) ?? ke(P.dirname(y), "")) === "@arcgis/core"
1101
- ) || !X(c, i, t))
1102
+ (y) => (ee(y) ?? Ne($.dirname(y), "")) === "@arcgis/core"
1103
+ ) || !Z(c, r, e))
1102
1104
  return;
1103
- const m = o.isPropertyAccessExpression(s.expression) ? s.expression.name : s.expression, g = s.getSourceFile();
1104
- _(e, g, {
1105
+ const m = i.isPropertyAccessExpression(s.expression) ? s.expression.name : s.expression, g = s.getSourceFile();
1106
+ Y(t, g, {
1105
1107
  start: m.getStart(g),
1106
1108
  length: m.getWidth(g),
1107
1109
  name: p,
@@ -1111,136 +1113,136 @@ function Ft(s, n, e, t, i) {
1111
1113
  reason: `Direct construction with new ${p}() is discouraged. Use \`<${l}>\` instead. In 6.0, directly constructed views will no longer include .ui; use component slots for UI.`
1112
1114
  });
1113
1115
  }
1114
- function It(s, n) {
1115
- const e = s.expression;
1116
- if (!o.isPropertyAccessExpression(e) && !o.isElementAccessExpression(e) || s.arguments[0] === void 0)
1116
+ function Mt(s, n) {
1117
+ const t = s.expression;
1118
+ if (!i.isPropertyAccessExpression(t) && !i.isElementAccessExpression(t) || s.arguments[0] === void 0)
1117
1119
  return;
1118
- const t = o.isPropertyAccessExpression(e) ? e.name.text : W(e.argumentExpression, n);
1119
- if (t !== "addEventListener" && t !== "removeEventListener")
1120
+ const e = i.isPropertyAccessExpression(t) ? t.name.text : M(t.argumentExpression, n);
1121
+ if (e !== "addEventListener" && e !== "removeEventListener")
1120
1122
  return;
1121
- const i = W(s.arguments[0], n);
1122
- if (i === void 0)
1123
+ const r = M(s.arguments[0], n);
1124
+ if (r === void 0)
1123
1125
  return;
1124
- const a = n.getNonNullableType(n.getTypeAtLocation(e.expression)), r = a.getProperty("@eventTypes");
1125
- if (!(r === void 0 || n.getTypeOfSymbolAtLocation(r, s).getProperty(i) === void 0))
1126
- return a.getProperty(i);
1126
+ const a = n.getNonNullableType(n.getTypeAtLocation(t.expression)), o = a.getProperty("@eventTypes");
1127
+ if (!(o === void 0 || n.getTypeOfSymbolAtLocation(o, s).getProperty(r) === void 0))
1128
+ return a.getProperty(r);
1127
1129
  }
1128
- function W(s, n) {
1129
- const e = n.getTypeAtLocation(s);
1130
- return e.isStringLiteral() || e.isNumberLiteral() ? String(e.value) : void 0;
1130
+ function M(s, n) {
1131
+ const t = n.getTypeAtLocation(s);
1132
+ return t.isStringLiteral() || t.isNumberLiteral() ? String(t.value) : void 0;
1131
1133
  }
1132
- function Wt(s, n) {
1133
- let e = n.getSymbolAtLocation(s);
1134
- for (; e !== void 0 && (e.flags & o.SymbolFlags.Alias) !== 0; ) {
1135
- const t = Ce(e, n);
1136
- if (t !== void 0)
1137
- return { symbol: e, reason: t };
1138
- e = e.declarations === void 0 ? void 0 : n.getImmediateAliasedSymbol(e);
1134
+ function jt(s, n) {
1135
+ let t = n.getSymbolAtLocation(s);
1136
+ for (; t !== void 0 && (t.flags & i.SymbolFlags.Alias) !== 0; ) {
1137
+ const e = Ee(t, n);
1138
+ if (e !== void 0)
1139
+ return { symbol: t, reason: e };
1140
+ t = t.declarations === void 0 ? void 0 : n.getImmediateAliasedSymbol(t);
1139
1141
  }
1140
- return { symbol: e, reason: void 0 };
1142
+ return { symbol: t, reason: void 0 };
1141
1143
  }
1142
- function Q(s) {
1144
+ function X(s) {
1143
1145
  return [...new Set(s?.declarations?.map((n) => n.getSourceFile().fileName))];
1144
1146
  }
1145
- function Ot(s, n, e, t, i) {
1147
+ function Rt(s, n, t, e, r) {
1146
1148
  if (n.reason !== void 0)
1147
1149
  return {
1148
- name: ae(n.symbol.declarations?.[0], n.symbol.getName()),
1149
- ...G(n.symbol.declarations?.[0])
1150
+ name: le(n.symbol.declarations?.[0], n.symbol.getName()),
1151
+ ...B(n.symbol.declarations?.[0])
1150
1152
  };
1151
- const a = i === void 0 ? void 0 : t.getProgram()?.getSourceFile(i.fileName), r = i === void 0 || a === void 0 ? void 0 : Ae(
1153
+ const a = r === void 0 ? void 0 : e.getProgram()?.getSourceFile(r.fileName), o = r === void 0 || a === void 0 ? void 0 : Ce(
1152
1154
  a,
1153
- i.textSpan.start,
1154
- i.textSpan.start + i.textSpan.length
1155
- ), p = (r === void 0 ? void 0 : e.getSymbolAtLocation(r)?.declarations?.[0]) ?? n.symbol?.declarations?.[0], l = i?.name;
1155
+ r.textSpan.start,
1156
+ r.textSpan.start + r.textSpan.length
1157
+ ), p = (o === void 0 ? void 0 : t.getSymbolAtLocation(o)?.declarations?.[0]) ?? n.symbol?.declarations?.[0], l = r?.name;
1156
1158
  return {
1157
- name: l === void 0 ? Mt(s) : ae(p, l),
1158
- ...G(p)
1159
+ name: l === void 0 ? Jt(s) : le(p, l),
1160
+ ...B(p)
1159
1161
  };
1160
1162
  }
1161
- function O(s, n) {
1162
- const e = P.relative(n, s);
1163
- return e !== "" && !e.startsWith("../") && !P.isAbsolute(e) && e !== "node_modules" && !e.startsWith("node_modules/");
1163
+ function j(s, n) {
1164
+ const t = $.relative(n, s);
1165
+ return t !== "" && !t.startsWith("../") && !$.isAbsolute(t) && t !== "node_modules" && !t.startsWith("node_modules/");
1164
1166
  }
1165
- function Ae(s, n, e) {
1166
- let t = s;
1167
+ function Ce(s, n, t) {
1168
+ let e = s;
1167
1169
  for (; ; ) {
1168
- let i;
1169
- if (o.forEachChild(t, (a) => {
1170
- i === void 0 && a.getStart(s) <= n && a.getEnd() >= e && (i = a);
1171
- }), i === void 0)
1172
- return t;
1173
- t = i;
1170
+ let r;
1171
+ if (i.forEachChild(e, (a) => {
1172
+ r === void 0 && a.getStart(s) <= n && a.getEnd() >= t && (r = a);
1173
+ }), r === void 0)
1174
+ return e;
1175
+ e = r;
1174
1176
  }
1175
1177
  }
1176
- function Mt(s) {
1177
- return o.isIdentifier(s) || o.isPrivateIdentifier(s) || o.isStringLiteralLike(s) || o.isNumericLiteral(s) ? s.text : s.getText();
1178
+ function Jt(s) {
1179
+ return i.isIdentifier(s) || i.isPrivateIdentifier(s) || i.isStringLiteralLike(s) || i.isNumericLiteral(s) ? s.text : s.getText();
1178
1180
  }
1179
- function Pe(s) {
1180
- const n = s?.find(({ name: e }) => e === "deprecated");
1181
- return n === void 0 ? void 0 : Qe(n.text) ?? "";
1181
+ function $e(s) {
1182
+ const n = s?.find(({ name: t }) => t === "deprecated");
1183
+ return n === void 0 ? void 0 : He(n.text) ?? "";
1182
1184
  }
1183
- function jt(s, n, e) {
1185
+ function Ut(s, n, t) {
1184
1186
  try {
1185
- return Pe(s.getQuickInfoAtPosition(n, e)?.tags);
1187
+ return $e(s.getQuickInfoAtPosition(n, t)?.tags);
1186
1188
  } catch {
1187
1189
  return;
1188
1190
  }
1189
1191
  }
1190
- function Ce(s, n) {
1192
+ function Ee(s, n) {
1191
1193
  try {
1192
- const e = Pe(s?.getJsDocTags(n));
1193
- if (e !== void 0)
1194
- return e;
1195
- const t = s?.declarations?.filter((i) => o.isGetAccessorDeclaration(i) || o.isSetAccessorDeclaration(i)).map((i) => o.getJSDocDeprecatedTag(i)).find((i) => i !== void 0);
1196
- return t === void 0 ? void 0 : t.comment === void 0 ? "" : He(t.comment);
1194
+ const t = $e(s?.getJsDocTags(n));
1195
+ if (t !== void 0)
1196
+ return t;
1197
+ const e = s?.declarations?.filter((r) => i.isGetAccessorDeclaration(r) || i.isSetAccessorDeclaration(r)).map((r) => i.getJSDocDeprecatedTag(r)).find((r) => r !== void 0);
1198
+ return e === void 0 ? void 0 : e.comment === void 0 ? "" : Ke(e.comment);
1197
1199
  } catch {
1198
1200
  return;
1199
1201
  }
1200
1202
  }
1201
- function _(s, n, e) {
1202
- const { line: t, character: i } = n.getLineAndCharacterOfPosition(e.start);
1203
- s.set(`${e.start}:${e.length}`, {
1204
- ...e,
1205
- line: t + 1,
1206
- column: i + 1
1203
+ function Y(s, n, t) {
1204
+ const { line: e, character: r } = n.getLineAndCharacterOfPosition(t.start);
1205
+ s.set(`${t.start}:${t.length}`, {
1206
+ ...t,
1207
+ line: e + 1,
1208
+ column: r + 1
1207
1209
  });
1208
1210
  }
1209
- function X(s, n, e) {
1210
- return s.some((t) => e !== void 0 && O(t, e)) ? !1 : !n || s.some((t) => {
1211
- const i = Y(t);
1212
- return i === void 0 ? e === void 0 || !O(t, e) : We(i);
1211
+ function Z(s, n, t) {
1212
+ return s.some((e) => t !== void 0 && j(e, t)) ? !1 : !n || s.some((e) => {
1213
+ const r = ee(e);
1214
+ return r === void 0 ? t === void 0 || !j(e, t) : Me(r);
1213
1215
  });
1214
1216
  }
1215
- function Y(s) {
1216
- const n = Me(s), e = "/node_modules/", t = n.lastIndexOf(e);
1217
- if (t === -1)
1217
+ function ee(s) {
1218
+ const n = Je(s), t = "/node_modules/", e = n.lastIndexOf(t);
1219
+ if (e === -1)
1218
1220
  return;
1219
- const [i, a] = n.slice(t + e.length).split("/");
1220
- return i.startsWith("@") ? `${i}/${a}` : i;
1221
+ const [r, a] = n.slice(e + t.length).split("/");
1222
+ return r.startsWith("@") ? `${r}/${a}` : r;
1221
1223
  }
1222
- function Rt(s, n = [], e) {
1223
- const t = s[0];
1224
- if (t === void 0)
1224
+ function zt(s, n = [], t) {
1225
+ const e = s[0];
1226
+ if (e === void 0)
1225
1227
  return "unknown package";
1226
- const i = Y(t);
1227
- if (i !== void 0)
1228
- return i;
1229
- const a = n.find(({ root: g }) => O(t, g));
1228
+ const r = ee(e);
1229
+ if (r !== void 0)
1230
+ return r;
1231
+ const a = n.find(({ root: g }) => j(e, g));
1230
1232
  if (a !== void 0)
1231
1233
  return a.name;
1232
- const r = P.dirname(R(t)), p = ke(P.dirname(t), r);
1233
- if (p !== r)
1234
+ const o = $.dirname(U(e)), p = Ne($.dirname(e), o);
1235
+ if (p !== o)
1234
1236
  return p;
1235
- if (e === void 0)
1236
- return r;
1237
- const c = P.relative(e, t).split("/"), m = c.findIndex((g) => g !== "..");
1238
- return m < 1 ? P.dirname(R(t)) : c.slice(0, m * 2).join("/");
1237
+ if (t === void 0)
1238
+ return o;
1239
+ const c = $.relative(t, e).split("/"), m = c.findIndex((g) => g !== "..");
1240
+ return m < 1 ? $.dirname(U(e)) : c.slice(0, m * 2).join("/");
1239
1241
  }
1240
1242
  export {
1241
- rn as auditDeprecatedUsages,
1242
- Lt as collectDeprecatedApiUsages,
1243
- Rt as getDeprecationOriginLabel,
1244
- Y as getNodeModulesPackageName,
1245
- X as shouldIncludeDeprecation
1243
+ pn as auditDeprecatedUsages,
1244
+ It as collectDeprecatedApiUsages,
1245
+ zt as getDeprecationOriginLabel,
1246
+ ee as getNodeModulesPackageName,
1247
+ Z as shouldIncludeDeprecation
1246
1248
  };