@onerjs/code-input 0.1.9 → 0.2.0

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,5 +1,5 @@
1
- import { defineComponent as Dt, ref as E, computed as q, watch as Ze, nextTick as V, onMounted as jt, onBeforeUnmount as Ft, openBlock as I, createElementBlock as H, normalizeStyle as he, normalizeClass as ie, createElementVNode as A, withModifiers as Ue, Fragment as Ye, renderList as Xe, toDisplayString as Y, createCommentVNode as K, createTextVNode as Pt } from "vue";
2
- const Vt = [
1
+ import { defineComponent as zt, ref as E, computed as K, watch as Ue, nextTick as V, onMounted as Vt, onBeforeUnmount as Kt, openBlock as I, createElementBlock as L, normalizeStyle as be, normalizeClass as le, createElementVNode as A, withModifiers as Ye, Fragment as Ge, renderList as Xe, toDisplayString as Y, createCommentVNode as q, createTextVNode as qt } from "vue";
2
+ const Je = [
3
3
  {
4
4
  label: "Math",
5
5
  kind: "class",
@@ -134,51 +134,122 @@ const Vt = [
134
134
  kind: "function",
135
135
  detail: "(id: number) => void"
136
136
  }
137
- ], qt = /[\w$]/;
138
- function Kt(n, s) {
137
+ ], Zt = [
138
+ { label: "toFixed", kind: "function", detail: "(fractionDigits?: number) => string" },
139
+ { label: "toPrecision", kind: "function", detail: "(precision?: number) => string" },
140
+ { label: "toExponential", kind: "function", detail: "(fractionDigits?: number) => string" },
141
+ { label: "toLocaleString", kind: "function", detail: "(locales?: string) => string" },
142
+ { label: "toString", kind: "function", detail: "(radix?: number) => string" },
143
+ { label: "valueOf", kind: "function", detail: "() => number" }
144
+ ], Ut = [
145
+ { label: "length", kind: "property", detail: "number" },
146
+ { label: "charAt", kind: "function", detail: "(index: number) => string" },
147
+ { label: "charCodeAt", kind: "function", detail: "(index: number) => number" },
148
+ { label: "includes", kind: "function", detail: "(search: string, start?: number) => boolean" },
149
+ { label: "indexOf", kind: "function", detail: "(search: string, from?: number) => number" },
150
+ { label: "lastIndexOf", kind: "function", detail: "(search: string) => number" },
151
+ { label: "slice", kind: "function", detail: "(start?: number, end?: number) => string" },
152
+ { label: "substring", kind: "function", detail: "(start: number, end?: number) => string" },
153
+ { label: "split", kind: "function", detail: "(separator?: string) => string[]" },
154
+ { label: "replace", kind: "function", detail: "(search: string | RegExp, replace: string) => string" },
155
+ { label: "replaceAll", kind: "function", detail: "(search: string, replace: string) => string" },
156
+ { label: "match", kind: "function", detail: "(regexp: RegExp) => RegExpMatchArray | null" },
157
+ { label: "startsWith", kind: "function", detail: "(search: string) => boolean" },
158
+ { label: "endsWith", kind: "function", detail: "(search: string) => boolean" },
159
+ { label: "padStart", kind: "function", detail: "(length: number, pad?: string) => string" },
160
+ { label: "padEnd", kind: "function", detail: "(length: number, pad?: string) => string" },
161
+ { label: "repeat", kind: "function", detail: "(count: number) => string" },
162
+ { label: "trim", kind: "function", detail: "() => string" },
163
+ { label: "trimStart", kind: "function", detail: "() => string" },
164
+ { label: "trimEnd", kind: "function", detail: "() => string" },
165
+ { label: "toUpperCase", kind: "function", detail: "() => string" },
166
+ { label: "toLowerCase", kind: "function", detail: "() => string" },
167
+ { label: "concat", kind: "function", detail: "(...strings: string[]) => string" }
168
+ ], Yt = [
169
+ { label: "toString", kind: "function", detail: "() => string" },
170
+ { label: "valueOf", kind: "function", detail: "() => boolean" }
171
+ ], Gt = [
172
+ { label: "length", kind: "property", detail: "number" },
173
+ { label: "push", kind: "function", detail: "(...items: any[]) => number" },
174
+ { label: "pop", kind: "function", detail: "() => any" },
175
+ { label: "shift", kind: "function", detail: "() => any" },
176
+ { label: "unshift", kind: "function", detail: "(...items: any[]) => number" },
177
+ { label: "slice", kind: "function", detail: "(start?: number, end?: number) => any[]" },
178
+ { label: "splice", kind: "function", detail: "(start: number, deleteCount?: number) => any[]" },
179
+ { label: "concat", kind: "function", detail: "(...items: any[]) => any[]" },
180
+ { label: "join", kind: "function", detail: "(separator?: string) => string" },
181
+ { label: "indexOf", kind: "function", detail: "(search: any, from?: number) => number" },
182
+ { label: "includes", kind: "function", detail: "(search: any, from?: number) => boolean" },
183
+ { label: "find", kind: "function", detail: "(predicate: Function) => any" },
184
+ { label: "findIndex", kind: "function", detail: "(predicate: Function) => number" },
185
+ { label: "filter", kind: "function", detail: "(predicate: Function) => any[]" },
186
+ { label: "map", kind: "function", detail: "(callback: Function) => any[]" },
187
+ { label: "forEach", kind: "function", detail: "(callback: Function) => void" },
188
+ { label: "reduce", kind: "function", detail: "(callback: Function, initial?: any) => any" },
189
+ { label: "some", kind: "function", detail: "(predicate: Function) => boolean" },
190
+ { label: "every", kind: "function", detail: "(predicate: Function) => boolean" },
191
+ { label: "sort", kind: "function", detail: "(compare?: Function) => any[]" },
192
+ { label: "reverse", kind: "function", detail: "() => any[]" },
193
+ { label: "flat", kind: "function", detail: "(depth?: number) => any[]" },
194
+ { label: "fill", kind: "function", detail: "(value: any) => any[]" }
195
+ ], Xt = [
196
+ { label: "hasOwnProperty", kind: "function", detail: "(key: string) => boolean" },
197
+ { label: "isPrototypeOf", kind: "function", detail: "(value: object) => boolean" },
198
+ { label: "propertyIsEnumerable", kind: "function", detail: "(key: string) => boolean" },
199
+ { label: "toString", kind: "function", detail: "() => string" },
200
+ { label: "valueOf", kind: "function", detail: "() => object" },
201
+ { label: "toLocaleString", kind: "function", detail: "() => string" }
202
+ ], Jt = {
203
+ number: Zt,
204
+ string: Ut,
205
+ boolean: Yt,
206
+ array: Gt,
207
+ object: Xt
208
+ }, Qt = /[\w$]/;
209
+ function en(n, a) {
139
210
  const o = [];
140
211
  let e = null;
141
- for (let S = 0; S < s; S++) {
142
- const b = n[S];
212
+ for (let C = 0; C < a; C++) {
213
+ const g = n[C];
143
214
  if (e) {
144
- b === e && n[S - 1] !== "\\" && (e = null);
215
+ g === e && n[C - 1] !== "\\" && (e = null);
145
216
  continue;
146
217
  }
147
- if (b === "'" || b === '"' || b === "`") {
148
- e = b;
218
+ if (g === "'" || g === '"' || g === "`") {
219
+ e = g;
149
220
  continue;
150
221
  }
151
- if (b === "(") {
152
- o.push({ index: S, commas: 0 });
222
+ if (g === "(") {
223
+ o.push({ index: C, commas: 0 });
153
224
  continue;
154
225
  }
155
- if (b === ")") {
226
+ if (g === ")") {
156
227
  o.pop();
157
228
  continue;
158
229
  }
159
- b === "," && o.length && o[o.length - 1].commas++;
230
+ g === "," && o.length && o[o.length - 1].commas++;
160
231
  }
161
- const i = o[o.length - 1];
162
- if (!i) return null;
163
- let r = i.index - 1;
164
- for (; r >= 0 && /\s/.test(n[r]); ) r--;
165
- const f = r;
166
- for (; r >= 0 && qt.test(n[r]); ) r--;
167
- const u = n.slice(r + 1, f + 1);
232
+ const l = o[o.length - 1];
233
+ if (!l) return null;
234
+ let s = l.index - 1;
235
+ for (; s >= 0 && /\s/.test(n[s]); ) s--;
236
+ const d = s;
237
+ for (; s >= 0 && Qt.test(n[s]); ) s--;
238
+ const u = n.slice(s + 1, d + 1);
168
239
  if (!u) return null;
169
- let a = s;
170
- for (; a > 0 && /[\w$'"]/.test(n[a - 1]); ) a--;
171
- const d = n.slice(a, s);
172
- let T = d, D = null;
173
- return d && (d[0] === "'" || d[0] === '"') && (D = d[0], T = d.slice(1)), {
240
+ let r = a;
241
+ for (; r > 0 && /[\w$'"]/.test(n[r - 1]); ) r--;
242
+ const f = n.slice(r, a);
243
+ let T = f, j = null;
244
+ return f && (f[0] === "'" || f[0] === '"') && (j = f[0], T = f.slice(1)), {
174
245
  functionName: u,
175
- paramIndex: i.commas,
246
+ paramIndex: l.commas,
176
247
  prefix: T,
177
- replaceStart: a,
178
- quote: D
248
+ replaceStart: r,
249
+ quote: j
179
250
  };
180
251
  }
181
- const Je = [
252
+ const Qe = [
182
253
  "break",
183
254
  "case",
184
255
  "catch",
@@ -223,7 +294,7 @@ const Je = [
223
294
  "undefined",
224
295
  "NaN",
225
296
  "Infinity"
226
- ], Zt = [
297
+ ], tn = [
227
298
  "abstract",
228
299
  "any",
229
300
  "as",
@@ -253,590 +324,615 @@ const Je = [
253
324
  "type",
254
325
  "unknown"
255
326
  ];
256
- function rt(n) {
257
- return n === "typescript" ? [...Je, ...Zt] : Je;
327
+ function Ie(n) {
328
+ return n === "typescript" ? [...Qe, ...tn] : Qe;
329
+ }
330
+ function et(n) {
331
+ return new Set(Ie(n));
258
332
  }
259
- function Qe(n) {
260
- return new Set(rt(n));
333
+ const dt = "[A-Za-z_$][\\w$]*", nn = `(?:${dt}|\\([^()]*\\)|['"\`][^'"\`]*['"\`])`, ln = new RegExp(`((?:${nn}\\??\\.)*)(${dt})?$`), tt = /\(([^()]*)\)|(['"`][^'"`]*['"`])|([A-Za-z_$][\w$]*)/g, nt = /\b(?:const|let|var|function|class)\s+([A-Za-z_$][\w$]*)/g, on = /^[A-Za-z_$]/;
334
+ function an(n) {
335
+ const a = n.trim();
336
+ return /^-?\d+(\.\d+)?$/.test(a) || /^-?\.\d+$/.test(a) ? "number" : /^(['"`])[\s\S]*\1$/.test(a) ? "string" : a === "true" || a === "false" ? "boolean" : /^\[[\s\S]*\]$/.test(a) ? "array" : /^\{[\s\S]*\}$/.test(a) ? "object" : null;
261
337
  }
262
- const Ut = /((?:[A-Za-z_$][\w$]*\??\.)*)([A-Za-z_$][\w$]*)?$/, Ge = /\b(?:const|let|var|function|class)\s+([A-Za-z_$][\w$]*)/g, Yt = /^[A-Za-z_$]/;
263
- function ct(n, s) {
264
- const o = n.slice(0, s), e = Ut.exec(o);
338
+ function ft(n, a) {
339
+ const o = n.slice(0, a), e = ln.exec(o);
265
340
  if (!e) return { prefix: "", chain: [] };
266
- const i = e[1] ?? "", r = e[2] ?? "", f = i.split(".").filter(Boolean).map((u) => u.replace(/\?$/, ""));
267
- return { prefix: r, chain: f };
341
+ const l = e[1] ?? "", s = e[2] ?? "", d = [];
342
+ tt.lastIndex = 0;
343
+ let u;
344
+ for (; u = tt.exec(l); ) {
345
+ if (u[2]) {
346
+ d.push(u[2]);
347
+ continue;
348
+ }
349
+ const r = u[1] ?? u[3] ?? "";
350
+ for (const f of r.split(".")) {
351
+ const T = f.replace(/\?$/, "");
352
+ T && d.push(T);
353
+ }
354
+ }
355
+ return { prefix: s, chain: d };
268
356
  }
269
- function et(n, s) {
357
+ function it(n, a) {
270
358
  const o = [], e = /* @__PURE__ */ new Set();
271
- let i;
272
- for (Ge.lastIndex = 0; (i = Ge.exec(n)) && !(i.index >= s); ) {
273
- const r = i[1];
274
- if (e.has(r)) continue;
275
- e.add(r);
276
- const f = i[0].slice(0, i[0].indexOf(r)).trim();
359
+ let l;
360
+ for (nt.lastIndex = 0; (l = nt.exec(n)) && !(l.index >= a); ) {
361
+ const s = l[1];
362
+ if (e.has(s)) continue;
363
+ e.add(s);
364
+ const d = l[0].slice(0, l[0].indexOf(s)).trim();
277
365
  o.push({
278
- label: r,
279
- kind: f === "function" ? "function" : f === "class" ? "class" : "variable",
366
+ label: s,
367
+ kind: d === "function" ? "function" : d === "class" ? "class" : "variable",
280
368
  detail: "当前文件"
281
369
  });
282
370
  }
283
371
  return o;
284
372
  }
285
- function ut(n, s) {
286
- let o = s;
373
+ function pt(n, a) {
374
+ let o = a;
287
375
  for (const e of n) {
288
376
  if (!o) return null;
289
- const i = o.find((r) => r.label === e);
290
- if (!i) return null;
291
- o = i.members ?? [];
377
+ const l = o.find((d) => d.label === e);
378
+ if (l) {
379
+ o = l.members ?? [];
380
+ continue;
381
+ }
382
+ const s = an(e);
383
+ if (s) {
384
+ o = Jt[s];
385
+ continue;
386
+ }
387
+ return null;
292
388
  }
293
389
  return o;
294
390
  }
295
- function Xt(n, s) {
296
- const o = n.toLowerCase(), e = s.toLowerCase(), i = o.indexOf(e);
297
- if (i === 0) return 1e3 - o.length;
298
- if (i > 0) return 800 - i;
299
- let r = 0, f = 0, u = -1;
300
- for (let a = 0; a < o.length && r < e.length; a++)
301
- o[a] === e[r] && (u >= 0 && (f += a - u - 1), u = a, r++);
302
- return r !== e.length ? null : 400 - f - o.length;
391
+ function rn(n, a) {
392
+ const o = n.toLowerCase(), e = a.toLowerCase(), l = o.indexOf(e);
393
+ if (l === 0) return 1e3 - o.length;
394
+ if (l > 0) return 800 - l;
395
+ let s = 0, d = 0, u = -1;
396
+ for (let r = 0; r < o.length && s < e.length; r++)
397
+ o[r] === e[s] && (u >= 0 && (d += r - u - 1), u = r, s++);
398
+ return s !== e.length ? null : 400 - d - o.length;
303
399
  }
304
- function dt(n, s) {
305
- if (!s) return n;
400
+ function mt(n, a) {
401
+ if (!a) return n;
306
402
  const o = [];
307
403
  for (const e of n) {
308
- const i = Xt(e.label, s);
309
- i !== null && o.push({ item: e, score: i });
404
+ const l = rn(e.label, a);
405
+ l !== null && o.push({ item: e, score: l });
310
406
  }
311
- return o.sort((e, i) => i.score - e.score || e.item.label.localeCompare(i.item.label)), o.map((e) => e.item);
407
+ return o.sort((e, l) => l.score - e.score || e.item.label.localeCompare(l.item.label)), o.map((e) => e.item);
312
408
  }
313
- function Jt(n) {
314
- const s = /* @__PURE__ */ new Set(), o = [];
409
+ function sn(n) {
410
+ const a = /* @__PURE__ */ new Set(), o = [];
315
411
  for (const e of n)
316
- s.has(e.label) || (s.add(e.label), o.push(e));
412
+ a.has(e.label) || (a.add(e.label), o.push(e));
317
413
  return o;
318
414
  }
319
- function Qt(n, s, o) {
320
- const { prefix: e, chain: i } = ct(n, s);
321
- if (o.auto && (!e && i.length === 0 || e && !Yt.test(e)))
415
+ function cn(n, a, o) {
416
+ const { prefix: e, chain: l } = ft(n, a);
417
+ if (o.auto && (!e && l.length === 0 || e && !on.test(e)))
322
418
  return null;
323
- const r = o.declared ?? [], f = [...r, ...o.completions];
419
+ const s = o.declared ?? [], d = [...s, ...o.completions];
324
420
  let u;
325
- if (i.length > 0) {
326
- const d = ut(i, f);
327
- if (!d || d.length === 0) return null;
328
- u = d;
421
+ if (l.length > 0) {
422
+ const f = pt(l, d);
423
+ if (!f || f.length === 0) return null;
424
+ u = f;
329
425
  } else
330
426
  u = [
331
427
  ...o.completions,
332
- ...r,
333
- ...rt(o.language).map((d) => ({
334
- label: d,
428
+ ...s,
429
+ ...(o.keywords ?? Ie(o.language)).map((f) => ({
430
+ label: f,
335
431
  kind: "keyword"
336
432
  }))
337
433
  ];
338
- const a = dt(Jt(u), e);
339
- return a.length === 0 ? null : {
340
- items: a,
341
- start: s - e.length,
342
- end: s
434
+ const r = mt(sn(u), e);
435
+ return r.length === 0 ? null : {
436
+ items: r,
437
+ start: a - e.length,
438
+ end: a
343
439
  };
344
440
  }
345
- const Gt = /([A-Za-z_$][\w$]*(?:\??\.[A-Za-z_$][\w$]*)*)\??\.\s*$/;
346
- function en(n, s, o, e) {
347
- const i = n.slice(s, o);
348
- if (!i) return null;
349
- const r = [...e.declared ?? [], ...e.completions], f = Gt.exec(n.slice(0, s));
350
- if (f) {
351
- const u = f[1].split(".").filter(Boolean).map((T) => T.replace(/\?$/, "")), a = ut(u, r), d = a == null ? void 0 : a.find((T) => T.label === i);
352
- if (d) return d;
441
+ const un = /([A-Za-z_$][\w$]*(?:\??\.[A-Za-z_$][\w$]*)*)\??\.\s*$/;
442
+ function dn(n, a, o, e) {
443
+ const l = n.slice(a, o);
444
+ if (!l) return null;
445
+ const s = [...e.declared ?? [], ...e.completions], d = un.exec(n.slice(0, a));
446
+ if (d) {
447
+ const u = d[1].split(".").filter(Boolean).map((T) => T.replace(/\?$/, "")), r = pt(u, s), f = r == null ? void 0 : r.find((T) => T.label === l);
448
+ if (f) return f;
353
449
  }
354
- return r.find((u) => u.label === i) ?? null;
450
+ return s.find((u) => u.label === l) ?? null;
355
451
  }
356
- const Z = "[A-Za-z_$][\\w$]*", tt = "(?:readonly\\s+|public\\s+|private\\s+|protected\\s+|static\\s+|abstract\\s+)*";
357
- function nt(n, s) {
358
- let o = 0, e = !1, i = s;
359
- for (let r = s; r < n.length; r++) {
360
- const f = n[r];
361
- for (let u = 0; u < f.length; u++) {
362
- const a = f[u];
363
- a === "{" ? (o++, e = !0) : a === "}" && o--;
452
+ const Z = "[A-Za-z_$][\\w$]*", lt = "(?:readonly\\s+|public\\s+|private\\s+|protected\\s+|static\\s+|abstract\\s+)*";
453
+ function ot(n, a) {
454
+ let o = 0, e = !1, l = a;
455
+ for (let s = a; s < n.length; s++) {
456
+ const d = n[s];
457
+ for (let u = 0; u < d.length; u++) {
458
+ const r = d[u];
459
+ r === "{" ? (o++, e = !0) : r === "}" && o--;
364
460
  }
365
461
  if (e && o <= 0) {
366
- i = r;
462
+ l = s;
367
463
  break;
368
464
  }
369
465
  }
370
- return { end: i, body: n.slice(s + 1, i) };
466
+ return { end: l, body: n.slice(a + 1, l) };
371
467
  }
372
- function lt(n) {
468
+ function at(n) {
373
469
  return n.trim().replace(/[,;]$/, "").trim();
374
470
  }
375
- function tn(n) {
471
+ function fn(n) {
376
472
  return /^(?:export\s+)?(?:declare\s+)?(?:abstract\s+)?(?:interface|class|type|function|const|let|var|namespace|enum)\b/.test(
377
473
  n
378
474
  );
379
475
  }
380
- function oe(n, s) {
381
- const o = n[s];
476
+ function oe(n, a) {
477
+ const o = n[a];
382
478
  let e = o.lastIndexOf("}");
383
- const i = o.lastIndexOf(";");
384
- if (i > e && (e = i), e === -1) return;
385
- const r = o.slice(e + 1).replace(/^[\s;]+/, "").trim();
386
- !r || !tn(r) || (n[s] = o.slice(0, e + 1), n.splice(s + 1, 0, r));
479
+ const l = o.lastIndexOf(";");
480
+ if (l > e && (e = l), e === -1) return;
481
+ const s = o.slice(e + 1).replace(/^[\s;]+/, "").trim();
482
+ !s || !fn(s) || (n[a] = o.slice(0, e + 1), n.splice(a + 1, 0, s));
387
483
  }
388
- function J(n) {
484
+ function X(n) {
389
485
  return n.length ? n.join(`
390
486
  `).replace(/^\s*\/\*\*?/, "").replace(/\*\/\s*$/, "").split(`
391
- `).map((s) => s.replace(/^\s*\*+\s?/, "").replace(/^\s*\/\/\s?/, "")).join(`
487
+ `).map((a) => a.replace(/^\s*\*+\s?/, "").replace(/^\s*\/\/\s?/, "")).join(`
392
488
  `).replace(/\n{3,}/g, `
393
489
 
394
490
  `).trim() : "";
395
491
  }
396
- function it(n) {
492
+ function rt(n) {
397
493
  return n.split(`
398
- `).filter((s) => !/^\s*(\/\/|\/\*|\*)/.test(s)).join(`
494
+ `).filter((a) => !/^\s*(\/\/|\/\*|\*)/.test(a)).join(`
399
495
  `).replace(/\n{2,}/g, `
400
496
  `).trim();
401
497
  }
402
- function ot(n) {
403
- const s = [], o = /* @__PURE__ */ new Set(), e = new RegExp(`^${tt}(${Z})(\\?)?\\s*\\((.*)\\)\\s*:\\s*(.+?);?$`), i = new RegExp(`^${tt}(${Z})(\\?)?\\s*:\\s*(.+?);?$`);
404
- let r = [], f = !1;
498
+ function st(n) {
499
+ const a = [], o = /* @__PURE__ */ new Set(), e = new RegExp(`^${lt}(${Z})(\\?)?\\s*\\((.*)\\)\\s*:\\s*(.+?);?$`), l = new RegExp(`^${lt}(${Z})(\\?)?\\s*:\\s*(.+?);?$`);
500
+ let s = [], d = !1;
405
501
  for (const u of n) {
406
- const a = u.trim();
407
- if (f) {
408
- r.push(a), a.includes("*/") && (f = !1);
502
+ const r = u.trim();
503
+ if (d) {
504
+ s.push(r), r.includes("*/") && (d = !1);
409
505
  continue;
410
506
  }
411
- if (a.startsWith("/*")) {
412
- r.push(a), a.includes("*/") || (f = !0);
507
+ if (r.startsWith("/*")) {
508
+ s.push(r), r.includes("*/") || (d = !0);
413
509
  continue;
414
510
  }
415
- if (a.startsWith("//")) {
416
- r.push(a);
511
+ if (r.startsWith("//")) {
512
+ s.push(r);
417
513
  continue;
418
514
  }
419
- if (!a || a.startsWith("}") || a.startsWith("[")) {
420
- r = [];
515
+ if (!r || r.startsWith("}") || r.startsWith("[")) {
516
+ s = [];
421
517
  continue;
422
518
  }
423
- const d = e.exec(a);
424
- if (d) {
425
- const D = J(r);
426
- r = [];
427
- const S = d[1];
428
- if (o.has(S)) continue;
429
- o.add(S), s.push({
430
- label: S,
519
+ const f = e.exec(r);
520
+ if (f) {
521
+ const j = X(s);
522
+ s = [];
523
+ const C = f[1];
524
+ if (o.has(C)) continue;
525
+ o.add(C), a.push({
526
+ label: C,
431
527
  kind: "function",
432
- detail: `(${d[3].trim()}) => ${lt(d[4])}`,
433
- documentation: D || void 0
528
+ detail: `(${f[3].trim()}) => ${at(f[4])}`,
529
+ documentation: j || void 0
434
530
  });
435
531
  continue;
436
532
  }
437
- const T = i.exec(a);
533
+ const T = l.exec(r);
438
534
  if (T) {
439
- const D = J(r);
440
- r = [];
441
- const S = T[1];
442
- if (o.has(S)) continue;
443
- o.add(S);
444
- const b = lt(T[3]), v = /^\(|=>/.test(b) ? "function" : "property";
445
- s.push({
446
- label: S,
447
- kind: v,
448
- detail: b,
449
- documentation: D || void 0
535
+ const j = X(s);
536
+ s = [];
537
+ const C = T[1];
538
+ if (o.has(C)) continue;
539
+ o.add(C);
540
+ const g = at(T[3]), k = /^\(|=>/.test(g) ? "function" : "property";
541
+ a.push({
542
+ label: C,
543
+ kind: k,
544
+ detail: g,
545
+ documentation: j || void 0
450
546
  });
451
547
  }
452
548
  }
453
- return s;
549
+ return a;
454
550
  }
455
- function ft(n) {
456
- const s = [], o = /(['"])((?:\\.|(?!\1).)*)\1/g;
551
+ function bt(n) {
552
+ const a = [], o = /(['"])((?:\\.|(?!\1).)*)\1/g;
457
553
  let e;
458
554
  for (; e = o.exec(n); )
459
- s.push(e[2]);
460
- return s;
555
+ a.push(e[2]);
556
+ return a;
461
557
  }
462
- function nn(n, s) {
558
+ function pn(n, a) {
463
559
  const o = [];
464
- let e = 0, i = "", r = null;
465
- for (let f = 0; f < n.length; f++) {
466
- const u = n[f];
467
- if (r) {
468
- i += u, u === r && n[f - 1] !== "\\" && (r = null);
560
+ let e = 0, l = "", s = null;
561
+ for (let d = 0; d < n.length; d++) {
562
+ const u = n[d];
563
+ if (s) {
564
+ l += u, u === s && n[d - 1] !== "\\" && (s = null);
469
565
  continue;
470
566
  }
471
567
  if (u === "'" || u === '"' || u === "`") {
472
- r = u, i += u;
568
+ s = u, l += u;
473
569
  continue;
474
570
  }
475
- if (u === "(" || u === "<" || u === "[" || u === "{" ? e++ : (u === ")" || u === ">" || u === "]" || u === "}") && e--, u === s && e === 0) {
476
- o.push(i), i = "";
571
+ if (u === "(" || u === "<" || u === "[" || u === "{" ? e++ : (u === ")" || u === ">" || u === "]" || u === "}") && e--, u === a && e === 0) {
572
+ o.push(l), l = "";
477
573
  continue;
478
574
  }
479
- i += u;
575
+ l += u;
480
576
  }
481
- return o.push(i), o;
577
+ return o.push(l), o;
482
578
  }
483
- function ln(n, s) {
484
- const o = n.trim(), e = ft(o);
579
+ function mn(n, a) {
580
+ const o = n.trim(), e = bt(o);
485
581
  if (e.length) return e;
486
- const i = s.get(o.replace(/\[\]$/, ""));
487
- return (i == null ? void 0 : i.literals) ?? [];
582
+ const l = a.get(o.replace(/\[\]$/, ""));
583
+ return (l == null ? void 0 : l.literals) ?? [];
488
584
  }
489
- function on(n, s) {
585
+ function bn(n, a) {
490
586
  const o = n.trim();
491
- return o ? nn(o, ",").map((e) => {
492
- const i = new RegExp(`^\\s*(${Z})\\s*(\\?)?\\s*:\\s*(.+)$`).exec(e);
493
- if (!i)
587
+ return o ? pn(o, ",").map((e) => {
588
+ const l = new RegExp(`^\\s*(${Z})\\s*(\\?)?\\s*:\\s*(.+)$`).exec(e);
589
+ if (!l)
494
590
  return { name: e.trim(), type: "", optional: !1, literals: [] };
495
- const r = i[3].replace(/\s*=\s*[^=]*$/, "").trim();
591
+ const s = l[3].replace(/\s*=\s*[^=]*$/, "").trim();
496
592
  return {
497
- name: i[1],
498
- optional: !!i[2],
499
- type: r,
500
- literals: ln(r, s)
593
+ name: l[1],
594
+ optional: !!l[2],
595
+ type: s,
596
+ literals: mn(s, a)
501
597
  };
502
598
  }) : [];
503
599
  }
504
- function pt(n) {
505
- const s = n.replace(/\[\]/g, "").replace(/<[^>]*>/g, "").replace(/\s*\|\s*null\s*/g, "").trim(), o = new RegExp(`^(${Z})$`).exec(s);
600
+ function ht(n) {
601
+ const a = n.replace(/\[\]/g, "").replace(/<[^>]*>/g, "").replace(/\s*\|\s*null\s*/g, "").trim(), o = new RegExp(`^(${Z})$`).exec(a);
506
602
  return o ? o[1] : null;
507
603
  }
508
- function an(n) {
509
- const s = n.trim();
510
- if (!s || s.endsWith(";")) return !1;
511
- const o = (s.match(/[(<[{]/g) ?? []).length, e = (s.match(/[)>\]}]/g) ?? []).length;
512
- return /[|&,(<]\s*$/.test(s) || o > e;
604
+ function hn(n) {
605
+ const a = n.trim();
606
+ if (!a || a.endsWith(";")) return !1;
607
+ const o = (a.match(/[(<[{]/g) ?? []).length, e = (a.match(/[)>\]}]/g) ?? []).length;
608
+ return /[|&,(<]\s*$/.test(a) || o > e;
513
609
  }
514
- function mt(n, s, o, e = 0) {
515
- return e > 6 ? n : n.map((i) => {
516
- if (i.kind !== "property" || !i.detail) return i;
517
- const r = pt(i.detail), f = r ? s.get(r) : void 0;
518
- if (!f || o.has(f.label)) return i;
610
+ function gt(n, a, o, e = 0) {
611
+ return e > 6 ? n : n.map((l) => {
612
+ if (l.kind !== "property" || !l.detail) return l;
613
+ const s = ht(l.detail), d = s ? a.get(s) : void 0;
614
+ if (!d || o.has(d.label)) return l;
519
615
  const u = new Set(o);
520
- return u.add(f.label), {
521
- ...i,
522
- type: f.type,
523
- members: mt(f.members, s, u, e + 1)
616
+ return u.add(d.label), {
617
+ ...l,
618
+ type: d.type,
619
+ members: gt(d.members, a, u, e + 1)
524
620
  };
525
621
  });
526
622
  }
527
- const sn = 50, ae = /* @__PURE__ */ new Map(), rn = { items: [], signatures: /* @__PURE__ */ new Map() };
528
- function ht(n) {
529
- if (!n || !n.trim()) return rn;
530
- const s = ae.get(n);
531
- if (s) return s;
532
- const o = dn(n);
533
- if (ae.size >= sn) {
623
+ const gn = 50, ae = /* @__PURE__ */ new Map(), vn = { items: [], signatures: /* @__PURE__ */ new Map() };
624
+ function vt(n) {
625
+ if (!n || !n.trim()) return vn;
626
+ const a = ae.get(n);
627
+ if (a) return a;
628
+ const o = wn(n);
629
+ if (ae.size >= gn) {
534
630
  const e = ae.keys().next().value;
535
631
  e !== void 0 && ae.delete(e);
536
632
  }
537
633
  return ae.set(n, o), o;
538
634
  }
539
- function cn(n) {
540
- return ht(n).items;
635
+ function kn(n) {
636
+ return vt(n).items;
541
637
  }
542
- function un(n) {
543
- return ht(n).signatures;
638
+ function yn(n) {
639
+ return vt(n).signatures;
544
640
  }
545
- function dn(n) {
546
- const s = n.split(`
547
- `), o = /* @__PURE__ */ new Map(), e = /* @__PURE__ */ new Map(), i = new RegExp(`^(?:export\\s+)?(?:declare\\s+)?interface\\s+(${Z})`), r = new RegExp(`^(?:export\\s+)?(?:declare\\s+)?(?:abstract\\s+)?class\\s+(${Z})`), f = new RegExp(`^(?:export\\s+)?(?:declare\\s+)?type\\s+(${Z})\\s*=`);
548
- let u = [], a = !1;
549
- for (let b = 0; b < s.length; b++) {
550
- const v = s[b].trim();
551
- if (a) {
552
- u.push(v), v.includes("*/") && (a = !1);
641
+ function wn(n) {
642
+ const a = n.split(`
643
+ `), o = /* @__PURE__ */ new Map(), e = /* @__PURE__ */ new Map(), l = new RegExp(`^(?:export\\s+)?(?:declare\\s+)?interface\\s+(${Z})`), s = new RegExp(`^(?:export\\s+)?(?:declare\\s+)?(?:abstract\\s+)?class\\s+(${Z})`), d = new RegExp(`^(?:export\\s+)?(?:declare\\s+)?type\\s+(${Z})\\s*=`);
644
+ let u = [], r = !1;
645
+ for (let g = 0; g < a.length; g++) {
646
+ const k = a[g].trim();
647
+ if (r) {
648
+ u.push(k), k.includes("*/") && (r = !1);
553
649
  continue;
554
650
  }
555
- if (v.startsWith("/*")) {
556
- u.push(v), v.includes("*/") || (a = !0);
651
+ if (k.startsWith("/*")) {
652
+ u.push(k), k.includes("*/") || (r = !0);
557
653
  continue;
558
654
  }
559
- if (v.startsWith("//")) {
560
- u.push(v);
655
+ if (k.startsWith("//")) {
656
+ u.push(k);
561
657
  continue;
562
658
  }
563
- if (!v) {
659
+ if (!k) {
564
660
  u = [];
565
661
  continue;
566
662
  }
567
- const W = i.exec(v);
568
- if (W && v.includes("{")) {
569
- const w = J(u);
663
+ const N = l.exec(k);
664
+ if (N && k.includes("{")) {
665
+ const w = X(u);
570
666
  u = [];
571
- const { end: $, body: L } = nt(s, b), g = W[1];
572
- o.set(g, {
573
- label: g,
574
- type: it(
575
- s.slice(b, $ + 1).join(`
667
+ const { end: $, body: H } = ot(a, g), h = N[1];
668
+ o.set(h, {
669
+ label: h,
670
+ type: rt(
671
+ a.slice(g, $ + 1).join(`
576
672
  `).replace(/^\s*export\s+/, "")
577
673
  ),
578
- members: ot(L),
674
+ members: st(H),
579
675
  kind: "interface",
580
676
  documentation: w || void 0
581
- }), oe(s, $), b = $;
677
+ }), oe(a, $), g = $;
582
678
  continue;
583
679
  }
584
- const N = r.exec(v);
585
- if (N && v.includes("{")) {
586
- const w = J(u);
680
+ const F = s.exec(k);
681
+ if (F && k.includes("{")) {
682
+ const w = X(u);
587
683
  u = [];
588
- const { end: $, body: L } = nt(s, b), g = N[1];
589
- o.set(g, {
590
- label: g,
591
- type: it(
592
- s.slice(b, $ + 1).join(`
684
+ const { end: $, body: H } = ot(a, g), h = F[1];
685
+ o.set(h, {
686
+ label: h,
687
+ type: rt(
688
+ a.slice(g, $ + 1).join(`
593
689
  `).replace(/^\s*export\s+/, "")
594
690
  ),
595
- members: ot(L),
691
+ members: st(H),
596
692
  kind: "class",
597
693
  documentation: w || void 0
598
- }), oe(s, $), b = $;
694
+ }), oe(a, $), g = $;
599
695
  continue;
600
696
  }
601
- const R = f.exec(v);
602
- if (R) {
603
- const w = J(u);
697
+ const M = d.exec(k);
698
+ if (M) {
699
+ const w = X(u);
604
700
  u = [];
605
- const $ = [s[b]];
606
- let L = b;
607
- for (; an($.join(`
608
- `)) && L + 1 < s.length; )
609
- L++, $.push(s[L]);
610
- const g = $.join(`
701
+ const $ = [a[g]];
702
+ let H = g;
703
+ for (; hn($.join(`
704
+ `)) && H + 1 < a.length; )
705
+ H++, $.push(a[H]);
706
+ const h = $.join(`
611
707
  `).replace(/^\s*export\s+/, "").replace(/;\s*$/, "").trim();
612
- o.set(R[1], {
613
- label: R[1],
614
- type: g,
708
+ o.set(M[1], {
709
+ label: M[1],
710
+ type: h,
615
711
  members: [],
616
712
  kind: "type",
617
713
  documentation: w || void 0,
618
- literals: ft(g)
619
- }), oe(s, L), b = L;
714
+ literals: bt(h)
715
+ }), oe(a, H), g = H;
620
716
  continue;
621
717
  }
622
718
  u = [];
623
719
  }
624
- const d = [], T = /* @__PURE__ */ new Set(), D = new RegExp(
720
+ const f = [], T = /* @__PURE__ */ new Set(), j = new RegExp(
625
721
  `^(?:export\\s+)?(?:declare\\s+)?function\\s+(${Z})\\s*\\(([^)]*)\\)\\s*:\\s*([^;{]+)`
626
- ), S = new RegExp(
722
+ ), C = new RegExp(
627
723
  `^(?:export\\s+)?(?:declare\\s+)?(?:const|let|var)\\s+(${Z})\\s*:\\s*([^=;]+)`
628
724
  );
629
- u = [], a = !1;
630
- for (let b = 0; b < s.length; b++) {
631
- const v = s[b].trim();
632
- if (a) {
633
- u.push(v), v.includes("*/") && (a = !1);
725
+ u = [], r = !1;
726
+ for (let g = 0; g < a.length; g++) {
727
+ const k = a[g].trim();
728
+ if (r) {
729
+ u.push(k), k.includes("*/") && (r = !1);
634
730
  continue;
635
731
  }
636
- if (v.startsWith("/*")) {
637
- u.push(v), v.includes("*/") || (a = !0);
732
+ if (k.startsWith("/*")) {
733
+ u.push(k), k.includes("*/") || (r = !0);
638
734
  continue;
639
735
  }
640
- if (v.startsWith("//")) {
641
- u.push(v);
736
+ if (k.startsWith("//")) {
737
+ u.push(k);
642
738
  continue;
643
739
  }
644
- if (!v) {
740
+ if (!k) {
645
741
  u = [];
646
742
  continue;
647
743
  }
648
- const W = D.exec(v);
649
- if (W) {
650
- oe(s, b);
651
- const R = J(u);
744
+ const N = j.exec(k);
745
+ if (N) {
746
+ oe(a, g);
747
+ const M = X(u);
652
748
  u = [];
653
- const w = W[1];
654
- T.has(w) || (T.add(w), d.push({
749
+ const w = N[1];
750
+ T.has(w) || (T.add(w), f.push({
655
751
  label: w,
656
752
  kind: "function",
657
- detail: `(${W[2].trim()}) => ${W[3].trim()}`,
658
- documentation: R || void 0
659
- })), e.set(w, { name: w, params: on(W[2], o) });
753
+ detail: `(${N[2].trim()}) => ${N[3].trim()}`,
754
+ documentation: M || void 0
755
+ })), e.set(w, { name: w, params: bn(N[2], o) });
660
756
  continue;
661
757
  }
662
- const N = S.exec(v);
663
- if (N) {
664
- oe(s, b);
665
- const R = J(u);
758
+ const F = C.exec(k);
759
+ if (F) {
760
+ oe(a, g);
761
+ const M = X(u);
666
762
  u = [];
667
- const w = N[1];
763
+ const w = F[1];
668
764
  if (T.has(w)) continue;
669
765
  T.add(w);
670
- const $ = N[2].trim(), L = pt($), g = L ? o.get(L) : void 0, se = (g == null ? void 0 : g.kind) === "class" ? "class" : /^\(|=>/.test($) ? "function" : "variable";
671
- d.push({
766
+ const $ = F[2].trim(), H = ht($), h = H ? o.get(H) : void 0, re = (h == null ? void 0 : h.kind) === "class" ? "class" : /^\(|=>/.test($) ? "function" : "variable";
767
+ f.push({
672
768
  label: w,
673
- kind: se,
769
+ kind: re,
674
770
  detail: $,
675
- type: g == null ? void 0 : g.type,
676
- documentation: R || (g == null ? void 0 : g.documentation) || void 0,
677
- members: g ? mt(g.members, o, /* @__PURE__ */ new Set([g.label])) : void 0
771
+ type: h == null ? void 0 : h.type,
772
+ documentation: M || (h == null ? void 0 : h.documentation) || void 0,
773
+ members: h ? gt(h.members, o, /* @__PURE__ */ new Set([h.label])) : void 0
678
774
  });
679
775
  continue;
680
776
  }
681
777
  u = [];
682
778
  }
683
- return { items: d, signatures: e };
779
+ return { items: f, signatures: e };
684
780
  }
685
- function Me(n, s, o, e) {
781
+ function Re(n, a, o, e) {
686
782
  if (!o || !e) return null;
687
- const i = Math.max(0, s - 1), r = n.lastIndexOf(o, i);
688
- if (r === -1 || n.lastIndexOf(e, i) > r) return null;
689
- const u = n.indexOf(e, r + o.length);
783
+ const l = Math.max(0, a - 1), s = n.lastIndexOf(o, l);
784
+ if (s === -1 || n.lastIndexOf(e, l) > s) return null;
785
+ const u = n.indexOf(e, s + o.length);
690
786
  return {
691
- start: r + o.length,
787
+ start: s + o.length,
692
788
  end: u === -1 ? n.length : u
693
789
  };
694
790
  }
695
- function Bn(n, s, o, e) {
696
- return Me(n, s, o, e) !== null;
791
+ function Kn(n, a, o, e) {
792
+ return Re(n, a, o, e) !== null;
697
793
  }
698
- const at = /[A-Za-z_$]/, fn = /[\w$]/, st = /\s/;
699
- function ge(n, s) {
794
+ const ct = /[A-Za-z_$]/, xn = /[\w$]/, ut = /\s/;
795
+ function he(n, a) {
700
796
  const o = [], e = n.length;
701
- let i = 0;
702
- for (; i < e; ) {
703
- const r = n[i], f = n[i + 1];
704
- if (st.test(r)) {
705
- i++;
797
+ let l = 0;
798
+ for (; l < e; ) {
799
+ const s = n[l], d = n[l + 1];
800
+ if (ut.test(s)) {
801
+ l++;
706
802
  continue;
707
803
  }
708
- if (r === "/" && f === "/") {
709
- let a = n.indexOf(`
710
- `, i);
711
- a === -1 && (a = e), o.push({ start: i, end: a, type: "comment" }), i = a;
804
+ if (s === "/" && d === "/") {
805
+ let r = n.indexOf(`
806
+ `, l);
807
+ r === -1 && (r = e), o.push({ start: l, end: r, type: "comment" }), l = r;
712
808
  continue;
713
809
  }
714
- if (r === "/" && f === "*") {
715
- const a = n.indexOf("*/", i + 2), d = a === -1 ? e : a + 2;
716
- o.push({ start: i, end: d, type: "comment" }), i = d;
810
+ if (s === "/" && d === "*") {
811
+ const r = n.indexOf("*/", l + 2), f = r === -1 ? e : r + 2;
812
+ o.push({ start: l, end: f, type: "comment" }), l = f;
717
813
  continue;
718
814
  }
719
- if (r === '"' || r === "'") {
720
- let a = i + 1;
721
- for (; a < e; ) {
722
- if (n[a] === "\\") {
723
- a += 2;
815
+ if (s === '"' || s === "'") {
816
+ let r = l + 1;
817
+ for (; r < e; ) {
818
+ if (n[r] === "\\") {
819
+ r += 2;
724
820
  continue;
725
821
  }
726
- if (n[a] === `
822
+ if (n[r] === `
727
823
  `) break;
728
- if (n[a] === r) {
729
- a++;
824
+ if (n[r] === s) {
825
+ r++;
730
826
  break;
731
827
  }
732
- a++;
828
+ r++;
733
829
  }
734
- o.push({ start: i, end: a, type: "string" }), i = a;
830
+ o.push({ start: l, end: r, type: "string" }), l = r;
735
831
  continue;
736
832
  }
737
- if (r === "`") {
738
- let a = i + 1;
739
- for (; a < e; ) {
740
- if (n[a] === "\\") {
741
- a += 2;
833
+ if (s === "`") {
834
+ let r = l + 1;
835
+ for (; r < e; ) {
836
+ if (n[r] === "\\") {
837
+ r += 2;
742
838
  continue;
743
839
  }
744
- if (n[a] === "`") {
745
- a++;
840
+ if (n[r] === "`") {
841
+ r++;
746
842
  break;
747
843
  }
748
- a++;
844
+ r++;
749
845
  }
750
- o.push({ start: i, end: a, type: "template" }), i = a;
846
+ o.push({ start: l, end: r, type: "template" }), l = r;
751
847
  continue;
752
848
  }
753
- if (/[0-9]/.test(r) || r === "." && /[0-9]/.test(f ?? "")) {
754
- let a = i + 1;
755
- for (; a < e && /[\w.]/.test(n[a]); ) a++;
756
- o.push({ start: i, end: a, type: "number" }), i = a;
849
+ if (/[0-9]/.test(s) || s === "." && /[0-9]/.test(d ?? "")) {
850
+ let r = l + 1;
851
+ for (; r < e && /[\w.]/.test(n[r]); ) r++;
852
+ o.push({ start: l, end: r, type: "number" }), l = r;
757
853
  continue;
758
854
  }
759
- if (at.test(r)) {
760
- let a = i + 1;
761
- for (; a < e && fn.test(n[a]); ) a++;
762
- const d = n.slice(i, a), T = s.keywords.has(d) ? "keyword" : s.builtins.has(d) ? "builtin" : "identifier";
763
- o.push({ start: i, end: a, type: T }), i = a;
855
+ if (ct.test(s)) {
856
+ let r = l + 1;
857
+ for (; r < e && xn.test(n[r]); ) r++;
858
+ const f = n.slice(l, r), T = a.keywords.has(f) ? "keyword" : a.builtins.has(f) ? "builtin" : "identifier";
859
+ o.push({ start: l, end: r, type: T }), l = r;
764
860
  continue;
765
861
  }
766
- let u = i + 1;
862
+ let u = l + 1;
767
863
  for (; u < e; ) {
768
- const a = n[u];
769
- if (st.test(a) || at.test(a) || /[0-9]/.test(a) || a === '"' || a === "'" || a === "`" || a === "/") break;
864
+ const r = n[u];
865
+ if (ut.test(r) || ct.test(r) || /[0-9]/.test(r) || r === '"' || r === "'" || r === "`" || r === "/") break;
770
866
  u++;
771
867
  }
772
- o.push({ start: i, end: u, type: "punctuation" }), i = u;
868
+ o.push({ start: l, end: u, type: "punctuation" }), l = u;
773
869
  }
774
870
  return o;
775
871
  }
776
- const pn = {
872
+ const Tn = {
777
873
  "&": "&amp;",
778
874
  "<": "&lt;",
779
875
  ">": "&gt;"
780
876
  };
781
- function Q(n) {
782
- return n.replace(/[&<>]/g, (s) => pn[s] ?? s);
877
+ function J(n) {
878
+ return n.replace(/[&<>]/g, (a) => Tn[a] ?? a);
783
879
  }
784
- function be(n, s, o = 0) {
785
- let e = "", i = 0;
786
- for (const r of s) {
787
- r.start > i && (e += Q(n.slice(i, r.start)));
788
- const f = Q(n.slice(r.start, r.end));
789
- e += `<span class="tok-${r.type}" data-start="${r.start + o}" data-end="${r.end + o}">${f}</span>`, i = r.end;
880
+ function ge(n, a, o = 0) {
881
+ let e = "", l = 0;
882
+ for (const s of a) {
883
+ s.start > l && (e += J(n.slice(l, s.start)));
884
+ const d = J(n.slice(s.start, s.end));
885
+ e += `<span class="tok-${s.type}" data-start="${s.start + o}" data-end="${s.end + o}">${d}</span>`, l = s.end;
790
886
  }
791
- return i < n.length && (e += Q(n.slice(i))), e;
887
+ return l < n.length && (e += J(n.slice(l))), e;
792
888
  }
793
- function mn(n, s, o, e) {
794
- if (!o || !e) return be(n, ge(n, s));
795
- let i = "", r = 0;
796
- for (; r < n.length; ) {
797
- const f = n.indexOf(o, r);
798
- if (f === -1) {
799
- i += Q(n.slice(r));
889
+ function $n(n, a, o, e) {
890
+ if (!o || !e) return ge(n, he(n, a));
891
+ let l = "", s = 0;
892
+ for (; s < n.length; ) {
893
+ const d = n.indexOf(o, s);
894
+ if (d === -1) {
895
+ l += J(n.slice(s));
800
896
  break;
801
897
  }
802
- i += Q(n.slice(r, f));
803
- const u = n.indexOf(e, f + o.length), a = u === -1 ? n.length : u, d = n.slice(f + o.length, a);
804
- i += `<span class="tok-brace">${Q(o)}</span>`, i += be(d, ge(d, s), f + o.length), u === -1 ? r = a : (i += `<span class="tok-brace">${Q(e)}</span>`, r = u + e.length);
898
+ l += J(n.slice(s, d));
899
+ const u = n.indexOf(e, d + o.length), r = u === -1 ? n.length : u, f = n.slice(d + o.length, r);
900
+ l += `<span class="tok-brace">${J(o)}</span>`, l += ge(f, he(f, a), d + o.length), u === -1 ? s = r : (l += `<span class="tok-brace">${J(e)}</span>`, s = u + e.length);
805
901
  }
806
- return i;
902
+ return l;
807
903
  }
808
- const hn = {
904
+ const Sn = {
809
905
  key: 0,
810
906
  class: "gutter",
811
907
  "aria-hidden": "true"
812
- }, gn = ["innerHTML"], bn = ["value", "readonly", "placeholder"], vn = ["onMouseenter", "onClick"], yn = { class: "popup-label" }, kn = {
908
+ }, Cn = ["innerHTML"], En = ["value", "readonly", "placeholder"], Mn = ["onMouseenter", "onClick"], Rn = { class: "popup-label" }, In = {
813
909
  key: 0,
814
910
  class: "popup-detail"
815
- }, wn = { class: "hover-head" }, xn = { class: "hover-name" }, Tn = {
911
+ }, Ln = { class: "hover-head" }, Hn = { class: "hover-name" }, _n = {
816
912
  key: 0,
817
913
  class: "hover-colon"
818
- }, $n = {
914
+ }, An = {
819
915
  key: 0,
820
916
  class: "hover-type"
821
- }, Cn = {
917
+ }, Bn = {
822
918
  key: 0,
823
919
  class: "hover-doc"
824
- }, Sn = {
920
+ }, On = {
825
921
  key: 1,
826
922
  class: "hover-def"
827
- }, En = ["innerHTML"], Rn = ["title", "aria-label"], Mn = {
923
+ }, Fn = ["innerHTML"], Nn = ["title", "aria-label"], Wn = {
828
924
  key: 0,
829
925
  viewBox: "0 0 16 16",
830
926
  width: "14",
831
927
  height: "14",
832
928
  "aria-hidden": "true"
833
- }, In = {
929
+ }, jn = {
834
930
  key: 1,
835
931
  viewBox: "0 0 16 16",
836
932
  width: "14",
837
933
  height: "14",
838
934
  "aria-hidden": "true"
839
- }, Hn = /* @__PURE__ */ Dt({
935
+ }, Dn = /* @__PURE__ */ zt({
840
936
  __name: "CodeEditor",
841
937
  props: {
842
938
  modelValue: {},
@@ -845,6 +941,8 @@ const hn = {
845
941
  completions: { default: () => [] },
846
942
  tsTypes: { default: "" },
847
943
  completionFilter: {},
944
+ allowedKeywords: {},
945
+ allowedBuiltins: {},
848
946
  templateCompletions: { default: () => [] },
849
947
  templateOpen: { default: "{{" },
850
948
  templateClose: { default: "}}" },
@@ -863,15 +961,15 @@ const hn = {
863
961
  minHeight: { default: "260px" }
864
962
  },
865
963
  emits: ["update:modelValue", "change", "expand", "collapse"],
866
- setup(n, { expose: s, emit: o }) {
867
- const e = n, i = o, r = {
964
+ setup(n, { expose: a, emit: o }) {
965
+ const e = n, l = o, s = {
868
966
  variable: "变量",
869
967
  function: "函数",
870
968
  property: "属性",
871
969
  class: "对象",
872
970
  keyword: "关键字",
873
971
  value: "值"
874
- }, f = {
972
+ }, d = {
875
973
  "(": ")",
876
974
  "[": "]",
877
975
  "{": "}",
@@ -886,189 +984,185 @@ const hn = {
886
984
  "End",
887
985
  "PageUp",
888
986
  "PageDown"
889
- ]), a = E(e.modelValue), d = E(), T = E(), D = E(), S = E(), b = E(), v = E(), W = E(), N = E([]), R = E(0), w = E(!1), $ = E({ start: 0, end: 0 }), L = E({}), g = E(null), se = E({}), gt = q(
890
- () => e.tsTypes ? cn(e.tsTypes) : []
891
- ), bt = q(
892
- () => e.tsTypes ? un(e.tsTypes) : /* @__PURE__ */ new Map()
893
- ), Ie = q(() => [
894
- ...Vt,
895
- ...gt.value,
896
- ...e.completions
897
- ]), ve = q(
898
- () => e.mode === "template" ? [...e.templateCompletions, ...Ie.value] : Ie.value
899
- ), vt = q(() => {
987
+ ]), r = E(e.modelValue), f = E(), T = E(), j = E(), C = E(), g = E(), k = E(), N = E(), F = E([]), M = E(0), w = E(!1), $ = E({ start: 0, end: 0 }), H = E({}), h = E(null), re = E({}), kt = K(
988
+ () => e.tsTypes ? kn(e.tsTypes) : []
989
+ ), yt = K(
990
+ () => e.tsTypes ? yn(e.tsTypes) : /* @__PURE__ */ new Map()
991
+ ), Le = K(() => [...e.allowedBuiltins ? Je.filter((i) => e.allowedBuiltins.includes(i.label)) : Je, ...kt.value, ...e.completions]), ve = K(
992
+ () => e.mode === "template" ? [...e.templateCompletions, ...Le.value] : Le.value
993
+ ), wt = K(() => {
900
994
  const t = {
901
- keywords: Qe(e.language),
902
- builtins: new Set(ve.value.map((l) => l.label))
995
+ keywords: et(e.language),
996
+ builtins: new Set(ve.value.map((i) => i.label))
903
997
  };
904
- return e.mode === "template" ? `${mn(a.value, t, e.templateOpen, e.templateClose)}
905
- ` : `${be(a.value, ge(a.value, t))}
998
+ return e.mode === "template" ? `${$n(r.value, t, e.templateOpen, e.templateClose)}
999
+ ` : `${ge(r.value, he(r.value, t))}
906
1000
  `;
907
- }), yt = q(() => a.value.split(`
908
- `).length), P = E(e.defaultExpanded), ye = E(!1), re = q(() => e.collapsible && !P.value), kt = q(() => {
1001
+ }), xt = K(() => r.value.split(`
1002
+ `).length), z = E(e.defaultExpanded), ke = E(!1), se = K(() => e.collapsible && !z.value), Tt = K(() => {
909
1003
  const t = {};
910
1004
  return e.collapsible && (t.height = e.collapsedHeight), t;
911
- }), wt = q(() => {
1005
+ }), $t = K(() => {
912
1006
  const t = {
913
1007
  "--ce-radius": e.borderRadius,
914
1008
  "--ce-collapsed-height": e.collapsedHeight
915
1009
  };
916
- return e.background && (t["--ce-bg"] = e.background), e.borderColor && (t["--ce-border"] = e.borderColor), e.collapsible ? { ...t, height: P.value ? e.minHeight : e.collapsedHeight } : { ...t, height: e.minHeight };
1010
+ return e.background && (t["--ce-bg"] = e.background), e.borderColor && (t["--ce-border"] = e.borderColor), e.collapsible ? { ...t, height: z.value ? e.minHeight : e.collapsedHeight } : { ...t, height: e.minHeight };
917
1011
  });
918
1012
  let He = 0;
919
- function Le(t) {
920
- if (P.value === t) return;
921
- const l = d.value;
922
- t && l && (He = l.scrollTop), P.value = t, e.collapsible && (ye.value = !0), i(t ? "expand" : "collapse"), _(), F(), V(() => {
923
- if (ke(), !P.value && l) {
924
- const c = Math.max(0, l.scrollHeight - l.clientHeight);
925
- l.scrollTop = Math.max(0, Math.min(He, c)), j(!0), document.activeElement === l && X();
1013
+ function _e(t) {
1014
+ if (z.value === t) return;
1015
+ const i = f.value;
1016
+ t && i && (He = i.scrollTop), z.value = t, e.collapsible && (ke.value = !0), l(t ? "expand" : "collapse"), _(), P(), V(() => {
1017
+ if (ye(), !z.value && i) {
1018
+ const c = Math.max(0, i.scrollHeight - i.clientHeight);
1019
+ i.scrollTop = Math.max(0, Math.min(He, c)), D(!0), document.activeElement === i && G();
926
1020
  return;
927
1021
  }
928
- j(!0), t && e.collapseOnBlur && l && document.activeElement !== l && l.focus();
1022
+ D(!0), t && e.collapseOnBlur && i && document.activeElement !== i && i.focus();
929
1023
  });
930
1024
  }
931
- function xt() {
932
- ye.value = !1;
1025
+ function St() {
1026
+ ke.value = !1;
933
1027
  }
934
- function Tt() {
935
- Le(!P.value);
1028
+ function Ct() {
1029
+ _e(!z.value);
936
1030
  }
937
- Ze(
1031
+ Ue(
938
1032
  () => e.modelValue,
939
1033
  (t) => {
940
- t !== a.value && (a.value = t, _());
1034
+ t !== r.value && (r.value = t, _());
941
1035
  }
942
- ), Ze(a, () => {
943
- V(() => j(!0));
1036
+ ), Ue(r, () => {
1037
+ V(() => D(!0));
944
1038
  });
945
- function _e(t) {
946
- return r[t];
1039
+ function Ae(t) {
1040
+ return s[t];
947
1041
  }
948
- function $t(t) {
949
- return t ? be(
1042
+ function Et(t) {
1043
+ return t ? ge(
950
1044
  t,
951
- ge(t, { keywords: Qe("typescript"), builtins: /* @__PURE__ */ new Set() })
1045
+ he(t, { keywords: et("typescript"), builtins: /* @__PURE__ */ new Set() })
952
1046
  ) : "";
953
1047
  }
954
- let G = { top: 14, bottom: 14, left: 16, right: 16, lineHeight: 22 };
955
- function ke() {
956
- const t = d.value;
1048
+ let Q = { top: 14, bottom: 14, left: 16, right: 16, lineHeight: 22 };
1049
+ function ye() {
1050
+ const t = f.value;
957
1051
  if (!t) return;
958
- const l = window.getComputedStyle(t);
959
- G = {
960
- top: parseFloat(l.paddingTop) || 0,
961
- bottom: parseFloat(l.paddingBottom) || 0,
962
- left: parseFloat(l.paddingLeft) || 0,
963
- right: parseFloat(l.paddingRight) || 0,
964
- lineHeight: parseFloat(l.lineHeight) || 22
1052
+ const i = window.getComputedStyle(t);
1053
+ Q = {
1054
+ top: parseFloat(i.paddingTop) || 0,
1055
+ bottom: parseFloat(i.paddingBottom) || 0,
1056
+ left: parseFloat(i.paddingLeft) || 0,
1057
+ right: parseFloat(i.paddingRight) || 0,
1058
+ lineHeight: parseFloat(i.lineHeight) || 22
965
1059
  };
966
1060
  }
967
- function j(t = !1) {
968
- const l = d.value;
969
- if (!l) return;
970
- const c = S.value;
971
- if (c && (c.style.transform = `translate(${-l.scrollLeft}px, ${-l.scrollTop}px)`), b.value && (b.value.style.transform = `translateY(${-l.scrollTop}px)`), t) {
972
- const p = `${a.value}|${e.mode}|${l.clientWidth}|${l.clientHeight}`;
973
- p !== Be && (Be = p, Ct());
1061
+ function D(t = !1) {
1062
+ const i = f.value;
1063
+ if (!i) return;
1064
+ const c = C.value;
1065
+ if (c && (c.style.transform = `translate(${-i.scrollLeft}px, ${-i.scrollTop}px)`), g.value && (g.value.style.transform = `translateY(${-i.scrollTop}px)`), t) {
1066
+ const p = `${r.value}|${e.mode}|${i.clientWidth}|${i.clientHeight}`;
1067
+ p !== Oe && (Oe = p, Mt());
974
1068
  }
975
1069
  }
976
- function X() {
977
- const t = d.value;
1070
+ function G() {
1071
+ const t = f.value;
978
1072
  if (!t) return;
979
- const l = Oe();
980
- if (!l) return;
981
- const c = t.getBoundingClientRect(), p = t.offsetWidth ? c.width / t.offsetWidth : 1, h = t.offsetHeight ? c.height / t.offsetHeight : 1, m = t.clientHeight * h, x = G.top * h, k = G.bottom * h, y = l.lineHeight * h, C = t.scrollTop * h, B = Math.max(0, t.scrollHeight * h - m), z = (re.value ? 8 : 14) * h;
982
- let M = t.scrollTop;
983
- if (re.value) {
984
- const me = m - x - k, le = l.top + C - x - Math.max(0, (me - y) / 2);
985
- M = Math.max(0, Math.min(le, B)) / h;
1073
+ const i = Fe();
1074
+ if (!i) return;
1075
+ const c = t.getBoundingClientRect(), p = t.offsetWidth ? c.width / t.offsetWidth : 1, b = t.offsetHeight ? c.height / t.offsetHeight : 1, m = t.clientHeight * b, x = Q.top * b, y = Q.bottom * b, v = i.lineHeight * b, S = t.scrollTop * b, B = Math.max(0, t.scrollHeight * b - m), W = (se.value ? 8 : 14) * b;
1076
+ let R = t.scrollTop;
1077
+ if (se.value) {
1078
+ const me = m - x - y, ie = i.top + S - x - Math.max(0, (me - v) / 2);
1079
+ R = Math.max(0, Math.min(ie, B)) / b;
986
1080
  } else {
987
- const me = x, Ee = m - k, le = l.top, Ke = le + y;
988
- let Re = C;
989
- le < me + z ? Re = C + (le - me - z) : Ke > Ee - z && (Re = C + (Ke - Ee + z)), M = Math.max(0, Math.min(Re, B)) / h;
1081
+ const me = x, Ee = m - y, ie = i.top, Ze = ie + v;
1082
+ let Me = S;
1083
+ ie < me + W ? Me = S + (ie - me - W) : Ze > Ee - W && (Me = S + (Ze - Ee + W)), R = Math.max(0, Math.min(Me, B)) / b;
990
1084
  }
991
- const O = t.clientWidth * p, te = G.left * p, U = G.right * p, Se = t.scrollLeft * p, de = l.left + Se, Wt = Se + te, zt = Se + O - U, fe = 8 * p;
1085
+ const O = t.clientWidth * p, te = Q.left * p, U = Q.right * p, Ce = t.scrollLeft * p, de = i.left + Ce, Dt = Ce + te, Pt = Ce + O - U, fe = 8 * p;
992
1086
  let pe = t.scrollLeft;
993
- de < Wt + fe ? pe = Math.max(0, (de - te - fe) / p) : de > zt - fe && (pe = Math.max(0, (de - te - O + U + fe) / p));
994
- const Ve = Math.abs(M - t.scrollTop) > 0.5, qe = Math.abs(pe - t.scrollLeft) > 0.5;
995
- !Ve && !qe || (Ve && (t.scrollTop = M), qe && (t.scrollLeft = pe), j());
996
- }
997
- let Ae = [], Be = "", ce = 0, we = -1, xe = -1, Te = { x: 0, y: 0 };
998
- function Ct() {
999
- const t = d.value, l = D.value;
1000
- if (!t || !l) return;
1087
+ de < Dt + fe ? pe = Math.max(0, (de - te - fe) / p) : de > Pt - fe && (pe = Math.max(0, (de - te - O + U + fe) / p));
1088
+ const Ke = Math.abs(R - t.scrollTop) > 0.5, qe = Math.abs(pe - t.scrollLeft) > 0.5;
1089
+ !Ke && !qe || (Ke && (t.scrollTop = R), qe && (t.scrollLeft = pe), D());
1090
+ }
1091
+ let Be = [], Oe = "", ce = 0, we = -1, xe = -1, Te = { x: 0, y: 0 };
1092
+ function Mt() {
1093
+ const t = f.value, i = j.value;
1094
+ if (!t || !i) return;
1001
1095
  const c = t.getBoundingClientRect(), p = [];
1002
- l.querySelectorAll("[data-start]").forEach((h) => {
1003
- const m = h.getBoundingClientRect();
1096
+ i.querySelectorAll("[data-start]").forEach((b) => {
1097
+ const m = b.getBoundingClientRect();
1004
1098
  p.push({
1005
- start: Number(h.dataset.start),
1006
- end: Number(h.dataset.end),
1099
+ start: Number(b.dataset.start),
1100
+ end: Number(b.dataset.end),
1007
1101
  left: m.left - c.left + t.scrollLeft,
1008
1102
  right: m.right - c.left + t.scrollLeft,
1009
1103
  top: m.top - c.top + t.scrollTop,
1010
1104
  bottom: m.bottom - c.top + t.scrollTop
1011
1105
  });
1012
- }), Ae = p;
1106
+ }), Be = p;
1013
1107
  }
1014
- function St(t, l) {
1015
- for (const c of Ae)
1016
- if (t >= c.left - 1 && t <= c.right + 1 && l >= c.top && l <= c.bottom)
1108
+ function Rt(t, i) {
1109
+ for (const c of Be)
1110
+ if (t >= c.left - 1 && t <= c.right + 1 && i >= c.top && i <= c.bottom)
1017
1111
  return c;
1018
1112
  return null;
1019
1113
  }
1020
- function F() {
1021
- g.value = null, ce = 0, we = -1, xe = -1;
1114
+ function P() {
1115
+ h.value = null, ce = 0, we = -1, xe = -1;
1022
1116
  }
1023
- function Et(t) {
1024
- const l = W.value, c = d.value;
1025
- if (!l || !c) return;
1026
- const p = c.getBoundingClientRect(), h = p.left + t.left - c.scrollLeft, m = p.left + t.right - c.scrollLeft, x = p.top + t.top - c.scrollTop, k = p.top + t.bottom - c.scrollTop, y = 12, C = 8, B = l.offsetWidth, z = l.offsetHeight;
1027
- let M = h, O = k + C;
1028
- M + B > window.innerWidth - y && (M = m - B), O + z > window.innerHeight - y && (O = x - z - C), M = Math.max(y, Math.min(M, window.innerWidth - y - B)), O = Math.max(y, O), se.value = { left: `${M}px`, top: `${O}px` };
1029
- }
1030
- function Rt(t, l) {
1031
- const c = d.value;
1117
+ function It(t) {
1118
+ const i = N.value, c = f.value;
1119
+ if (!i || !c) return;
1120
+ const p = c.getBoundingClientRect(), b = p.left + t.left - c.scrollLeft, m = p.left + t.right - c.scrollLeft, x = p.top + t.top - c.scrollTop, y = p.top + t.bottom - c.scrollTop, v = 12, S = 8, B = i.offsetWidth, W = i.offsetHeight;
1121
+ let R = b, O = y + S;
1122
+ R + B > window.innerWidth - v && (R = m - B), O + W > window.innerHeight - v && (O = x - W - S), R = Math.max(v, Math.min(R, window.innerWidth - v - B)), O = Math.max(v, O), re.value = { left: `${R}px`, top: `${O}px` };
1123
+ }
1124
+ function Lt(t, i) {
1125
+ const c = f.value;
1032
1126
  if (!c || e.readonly || !e.hover || w.value) {
1033
- F();
1127
+ P();
1034
1128
  return;
1035
1129
  }
1036
1130
  if (c.selectionStart !== c.selectionEnd) {
1037
- F();
1131
+ P();
1038
1132
  return;
1039
1133
  }
1040
- const p = W.value;
1041
- if (g.value && p) {
1042
- const k = p.getBoundingClientRect();
1043
- if (t >= k.left && t <= k.right && l >= k.top && l <= k.bottom)
1134
+ const p = N.value;
1135
+ if (h.value && p) {
1136
+ const y = p.getBoundingClientRect();
1137
+ if (t >= y.left && t <= y.right && i >= y.top && i <= y.bottom)
1044
1138
  return;
1045
1139
  }
1046
- const h = c.getBoundingClientRect(), m = St(t - h.left + c.scrollLeft, l - h.top + c.scrollTop);
1140
+ const b = c.getBoundingClientRect(), m = Rt(t - b.left + c.scrollLeft, i - b.top + c.scrollTop);
1047
1141
  if (!m) {
1048
- F();
1142
+ P();
1049
1143
  return;
1050
1144
  }
1051
- if (g.value && we === m.start && xe === m.end)
1145
+ if (h.value && we === m.start && xe === m.end)
1052
1146
  return;
1053
- const x = en(c.value, m.start, m.end, {
1147
+ const x = dn(c.value, m.start, m.end, {
1054
1148
  completions: ve.value,
1055
- declared: et(c.value, m.start)
1149
+ declared: it(c.value, m.start)
1056
1150
  });
1057
1151
  if (!x) {
1058
- F();
1152
+ P();
1059
1153
  return;
1060
1154
  }
1061
- g.value = x, we = m.start, xe = m.end, V(() => Et(m));
1155
+ h.value = x, we = m.start, xe = m.end, V(() => It(m));
1062
1156
  }
1063
- function Mt(t) {
1157
+ function Ht(t) {
1064
1158
  Te = { x: t.clientX, y: t.clientY }, !ce && (ce = requestAnimationFrame(() => {
1065
- ce = 0, Rt(Te.x, Te.y);
1159
+ ce = 0, Lt(Te.x, Te.y);
1066
1160
  }));
1067
1161
  }
1068
- function Oe() {
1069
- const t = d.value;
1162
+ function Fe() {
1163
+ const t = f.value;
1070
1164
  if (!t) return null;
1071
- const l = window.getComputedStyle(t), c = document.createElement("div"), p = parseFloat(l.paddingLeft) || 0, h = parseFloat(l.paddingRight) || 0, m = t.getBoundingClientRect();
1165
+ const i = window.getComputedStyle(t), c = document.createElement("div"), p = parseFloat(i.paddingLeft) || 0, b = parseFloat(i.paddingRight) || 0, m = t.getBoundingClientRect();
1072
1166
  Object.assign(c.style, {
1073
1167
  position: "fixed",
1074
1168
  left: `${m.left}px`,
@@ -1076,99 +1170,100 @@ const hn = {
1076
1170
  visibility: "hidden",
1077
1171
  pointerEvents: "none",
1078
1172
  zIndex: "-1",
1079
- whiteSpace: l.whiteSpace,
1080
- overflowWrap: l.overflowWrap,
1081
- wordBreak: l.wordBreak,
1173
+ whiteSpace: i.whiteSpace,
1174
+ overflowWrap: i.overflowWrap,
1175
+ wordBreak: i.wordBreak,
1082
1176
  boxSizing: "content-box",
1083
- width: `${t.clientWidth - p - h}px`,
1084
- paddingTop: l.paddingTop,
1085
- paddingRight: l.paddingRight,
1086
- paddingBottom: l.paddingBottom,
1087
- paddingLeft: l.paddingLeft,
1177
+ width: `${t.clientWidth - p - b}px`,
1178
+ paddingTop: i.paddingTop,
1179
+ paddingRight: i.paddingRight,
1180
+ paddingBottom: i.paddingBottom,
1181
+ paddingLeft: i.paddingLeft,
1088
1182
  border: "0",
1089
- fontFamily: l.fontFamily,
1090
- fontSize: l.fontSize,
1091
- fontWeight: l.fontWeight,
1092
- fontStyle: l.fontStyle,
1093
- fontVariant: l.fontVariant,
1094
- letterSpacing: l.letterSpacing,
1095
- lineHeight: l.lineHeight,
1096
- textTransform: l.textTransform,
1097
- tabSize: l.tabSize
1183
+ fontFamily: i.fontFamily,
1184
+ fontSize: i.fontSize,
1185
+ fontWeight: i.fontWeight,
1186
+ fontStyle: i.fontStyle,
1187
+ fontVariant: i.fontVariant,
1188
+ letterSpacing: i.letterSpacing,
1189
+ lineHeight: i.lineHeight,
1190
+ textTransform: i.textTransform,
1191
+ tabSize: i.tabSize
1098
1192
  }), c.textContent = t.value.slice(0, t.selectionStart);
1099
1193
  const x = document.createElement("span");
1100
1194
  x.textContent = "​", c.appendChild(x), document.body.appendChild(c);
1101
- const k = x.getBoundingClientRect();
1195
+ const y = x.getBoundingClientRect();
1102
1196
  document.body.removeChild(c);
1103
- const y = parseFloat(l.lineHeight) || 22, C = k.height, B = C > 0 && C < y ? (y - C) / 2 : 0;
1197
+ const v = parseFloat(i.lineHeight) || 22, S = y.height, B = S > 0 && S < v ? (v - S) / 2 : 0;
1104
1198
  return {
1105
- left: k.left - m.left - t.scrollLeft,
1106
- top: k.top - m.top - t.scrollTop - B,
1107
- lineHeight: y
1199
+ left: y.left - m.left - t.scrollLeft,
1200
+ top: y.top - m.top - t.scrollTop - B,
1201
+ lineHeight: v
1108
1202
  };
1109
1203
  }
1110
1204
  async function Ne() {
1111
1205
  await V();
1112
- const t = T.value, l = v.value, c = Oe();
1113
- if (!t || !l || !c) return;
1114
- const p = 4, h = 8, m = window.innerWidth, x = window.innerHeight, k = t.getBoundingClientRect(), y = l.scrollHeight, C = x - (k.top + c.top + c.lineHeight) - p - h, B = k.top + c.top - p - h, z = C >= Math.min(y, 180) || C >= B, M = Math.min(248, Math.max(z ? C : B, 96)), O = Math.min(y, M), te = l.offsetWidth || 280;
1206
+ const t = T.value, i = k.value, c = Fe();
1207
+ if (!t || !i || !c) return;
1208
+ const p = 4, b = 8, m = window.innerWidth, x = window.innerHeight, y = t.getBoundingClientRect(), v = i.scrollHeight, S = x - (y.top + c.top + c.lineHeight) - p - b, B = y.top + c.top - p - b, W = S >= Math.min(v, 180) || S >= B, R = Math.min(248, Math.max(W ? S : B, 96)), O = Math.min(v, R), te = i.offsetWidth || 280;
1115
1209
  let U = c.left;
1116
- k.left + U + te > m - h && (U = m - h - te - k.left), U = Math.max(U, h - k.left), L.value = {
1210
+ y.left + U + te > m - b && (U = m - b - te - y.left), U = Math.max(U, b - y.left), H.value = {
1117
1211
  left: `${U}px`,
1118
- top: `${z ? c.top + c.lineHeight + p : c.top - p - O}px`,
1119
- maxHeight: `${M}px`
1212
+ top: `${W ? c.top + c.lineHeight + p : c.top - p - O}px`,
1213
+ maxHeight: `${R}px`
1120
1214
  };
1121
1215
  }
1122
1216
  function _() {
1123
- w.value = !1, N.value = [], R.value = 0, F();
1217
+ w.value = !1, F.value = [], M.value = 0, P();
1124
1218
  }
1125
1219
  function ne(t = !1) {
1126
- var k;
1127
- const l = d.value;
1128
- if (!l || e.readonly) return;
1129
- if (l.selectionStart !== l.selectionEnd) {
1220
+ var y;
1221
+ const i = f.value;
1222
+ if (!i || e.readonly) return;
1223
+ if (i.selectionStart !== i.selectionEnd) {
1130
1224
  _();
1131
1225
  return;
1132
1226
  }
1133
- const c = l.selectionStart;
1227
+ const c = i.selectionStart;
1134
1228
  let p = !t;
1135
- const h = Kt(l.value, c);
1136
- if (h) {
1137
- const y = (k = bt.value.get(h.functionName)) == null ? void 0 : k.params[h.paramIndex], C = (y == null ? void 0 : y.literals) ?? [];
1138
- if (C.length) {
1139
- const B = h.quote, z = C.map((O) => ({
1229
+ const b = en(i.value, c);
1230
+ if (b) {
1231
+ const v = (y = yt.value.get(b.functionName)) == null ? void 0 : y.params[b.paramIndex], S = (v == null ? void 0 : v.literals) ?? [];
1232
+ if (S.length) {
1233
+ const B = b.quote, W = S.map((O) => ({
1140
1234
  label: `'${O}'`,
1141
1235
  kind: "value",
1142
- detail: y == null ? void 0 : y.type,
1236
+ detail: v == null ? void 0 : v.type,
1143
1237
  insertText: B ? O : `'${O}'`
1144
- })), M = dt(z, h.prefix);
1145
- if (M.length) {
1146
- N.value = M, $.value = {
1147
- start: B ? h.replaceStart + 1 : h.replaceStart,
1238
+ })), R = mt(W, b.prefix);
1239
+ if (R.length) {
1240
+ F.value = R, $.value = {
1241
+ start: B ? b.replaceStart + 1 : b.replaceStart,
1148
1242
  end: c
1149
- }, R.value = 0, w.value = !0, Ne();
1243
+ }, M.value = 0, w.value = !0, Ne();
1150
1244
  return;
1151
1245
  }
1152
1246
  }
1153
1247
  }
1154
1248
  if (e.mode === "template") {
1155
- const y = Me(
1156
- l.value,
1249
+ const v = Re(
1250
+ i.value,
1157
1251
  c,
1158
1252
  e.templateOpen,
1159
1253
  e.templateClose
1160
1254
  );
1161
- if (!y) {
1255
+ if (!v) {
1162
1256
  _();
1163
1257
  return;
1164
1258
  }
1165
- t && l.value.slice(y.start, c).trim() === "" && (p = !0);
1259
+ t && i.value.slice(v.start, c).trim() === "" && (p = !0);
1166
1260
  }
1167
- const m = Qt(l.value, c, {
1261
+ const m = cn(i.value, c, {
1168
1262
  language: e.language,
1169
1263
  completions: ve.value,
1170
- declared: et(l.value, c),
1171
- auto: !p
1264
+ declared: it(i.value, c),
1265
+ auto: !p,
1266
+ keywords: e.allowedKeywords ? Ie(e.language).filter((v) => e.allowedKeywords.includes(v)) : void 0
1172
1267
  });
1173
1268
  if (!m) {
1174
1269
  _();
@@ -1176,11 +1271,11 @@ const hn = {
1176
1271
  }
1177
1272
  let x = m.items;
1178
1273
  if (e.completionFilter) {
1179
- const y = ct(l.value, c);
1274
+ const v = ft(i.value, c);
1180
1275
  if (x = e.completionFilter(x, {
1181
- prefix: y.prefix,
1182
- chain: y.chain,
1183
- text: l.value,
1276
+ prefix: v.prefix,
1277
+ chain: v.chain,
1278
+ text: i.value,
1184
1279
  position: c,
1185
1280
  mode: e.mode,
1186
1281
  language: e.language
@@ -1189,63 +1284,63 @@ const hn = {
1189
1284
  return;
1190
1285
  }
1191
1286
  }
1192
- N.value = x, $.value = { start: m.start, end: m.end }, R.value = 0, w.value = !0, Ne();
1287
+ F.value = x, $.value = { start: m.start, end: m.end }, M.value = 0, w.value = !0, Ne();
1193
1288
  }
1194
- function It(t) {
1195
- a.value = t, i("update:modelValue", t), i("change", t);
1196
- }
1197
- function ue(t, l, c, p = t + c.length) {
1198
- const h = d.value;
1199
- if (!h) return;
1200
- const m = h.value.slice(0, t) + c + h.value.slice(l);
1201
- It(m), _(), V(() => {
1202
- h.value = m, h.setSelectionRange(p, p), h.focus(), j(!0), X();
1289
+ function _t(t) {
1290
+ r.value = t, l("update:modelValue", t), l("change", t);
1291
+ }
1292
+ function ue(t, i, c, p = t + c.length) {
1293
+ const b = f.value;
1294
+ if (!b) return;
1295
+ const m = b.value.slice(0, t) + c + b.value.slice(i);
1296
+ _t(m), _(), V(() => {
1297
+ b.value = m, b.setSelectionRange(p, p), b.focus(), D(!0), G();
1203
1298
  });
1204
1299
  }
1205
- function We(t = N.value[R.value]) {
1300
+ function We(t = F.value[M.value]) {
1206
1301
  if (!t) return;
1207
- const l = t.insertText ?? t.label;
1208
- ue($.value.start, $.value.end, l), _();
1302
+ const i = t.insertText ?? t.label;
1303
+ ue($.value.start, $.value.end, i), _();
1209
1304
  }
1210
- function ze(t) {
1211
- const l = N.value.length;
1212
- l && (R.value = (R.value + t + l) % l, V(() => {
1305
+ function je(t) {
1306
+ const i = F.value.length;
1307
+ i && (M.value = (M.value + t + i) % i, V(() => {
1213
1308
  var c, p;
1214
- (p = (c = v.value) == null ? void 0 : c.querySelector(".is-active")) == null || p.scrollIntoView({ block: "nearest" });
1309
+ (p = (c = k.value) == null ? void 0 : c.querySelector(".is-active")) == null || p.scrollIntoView({ block: "nearest" });
1215
1310
  }));
1216
1311
  }
1217
- function Ht(t) {
1218
- const l = t.target;
1219
- a.value = l.value, i("update:modelValue", l.value), i("change", l.value), F(), j(), X(), V(X), ne(!0);
1312
+ function At(t) {
1313
+ const i = t.target;
1314
+ r.value = i.value, l("update:modelValue", i.value), l("change", i.value), P(), D(), G(), V(G), ne(!0);
1220
1315
  }
1221
- function Lt(t) {
1222
- if (_(), F(), !e.collapsible || !e.collapseOnBlur || !P.value) return;
1223
- const l = t.relatedTarget;
1224
- l && l.closest(".expand-toggle") || Le(!1);
1316
+ function Bt(t) {
1317
+ if (_(), P(), !e.collapsible || !e.collapseOnBlur || !z.value) return;
1318
+ const i = t.relatedTarget;
1319
+ i && i.closest(".expand-toggle") || _e(!1);
1225
1320
  }
1226
- function _t() {
1227
- De(), X();
1321
+ function Ot() {
1322
+ De(), G();
1228
1323
  }
1229
1324
  function De() {
1230
- const t = d.value;
1325
+ const t = f.value;
1231
1326
  if (!t || e.readonly) return;
1232
1327
  if (t.selectionStart !== t.selectionEnd) {
1233
1328
  _();
1234
1329
  return;
1235
1330
  }
1236
- const l = t.selectionStart;
1237
- if (l > 0 && t.value[l - 1] === ".") {
1331
+ const i = t.selectionStart;
1332
+ if (i > 0 && t.value[i - 1] === ".") {
1238
1333
  ne(!0);
1239
1334
  return;
1240
1335
  }
1241
1336
  if (e.mode === "template") {
1242
- const c = Me(
1337
+ const c = Re(
1243
1338
  t.value,
1244
- l,
1339
+ i,
1245
1340
  e.templateOpen,
1246
1341
  e.templateClose
1247
1342
  );
1248
- if (c && t.value.slice(c.start, l).trim() === "") {
1343
+ if (c && t.value.slice(c.start, i).trim() === "") {
1249
1344
  ne(!0);
1250
1345
  return;
1251
1346
  }
@@ -1253,33 +1348,33 @@ const hn = {
1253
1348
  _();
1254
1349
  }
1255
1350
  let $e = 0;
1256
- function je() {
1351
+ function Pe() {
1257
1352
  window.clearTimeout($e), $e = window.setTimeout(() => {
1258
- $e = 0, De(), X();
1353
+ $e = 0, De(), G();
1259
1354
  }, 0);
1260
1355
  }
1261
- function Fe(t) {
1262
- t.target !== d.value && w.value && _();
1356
+ function ze(t) {
1357
+ t.target !== f.value && w.value && _();
1263
1358
  }
1264
- function At() {
1265
- F(), j(), re.value && Bt();
1359
+ function Ft() {
1360
+ P(), D(), se.value && Nt();
1266
1361
  }
1267
- let Ce = 0;
1268
- function Bt() {
1269
- window.clearTimeout(Ce), Ce = window.setTimeout(() => {
1270
- Ce = 0, Ot();
1362
+ let Se = 0;
1363
+ function Nt() {
1364
+ window.clearTimeout(Se), Se = window.setTimeout(() => {
1365
+ Se = 0, Wt();
1271
1366
  }, 120);
1272
1367
  }
1273
- function Ot() {
1274
- const t = d.value;
1368
+ function Wt() {
1369
+ const t = f.value;
1275
1370
  if (!t) return;
1276
- const l = G.lineHeight, c = t.scrollTop, p = Math.round(c / l) * l;
1277
- Math.abs(p - c) < 0.5 || (t.scrollTop = p, j());
1371
+ const i = Q.lineHeight, c = t.scrollTop, p = Math.round(c / i) * i;
1372
+ Math.abs(p - c) < 0.5 || (t.scrollTop = p, D());
1278
1373
  }
1279
- function Nt(t) {
1280
- var h;
1281
- const l = d.value;
1282
- if (!l) return;
1374
+ function jt(t) {
1375
+ var b;
1376
+ const i = f.value;
1377
+ if (!i) return;
1283
1378
  const c = t.metaKey || t.ctrlKey, p = u.has(t.key);
1284
1379
  if (t.key === " " && c) {
1285
1380
  t.preventDefault(), ne(!1);
@@ -1287,11 +1382,11 @@ const hn = {
1287
1382
  }
1288
1383
  if (w.value) {
1289
1384
  if (t.key === "ArrowDown") {
1290
- t.preventDefault(), ze(1);
1385
+ t.preventDefault(), je(1);
1291
1386
  return;
1292
1387
  }
1293
1388
  if (t.key === "ArrowUp") {
1294
- t.preventDefault(), ze(-1);
1389
+ t.preventDefault(), je(-1);
1295
1390
  return;
1296
1391
  }
1297
1392
  if (t.key === "Enter" || t.key === "Tab") {
@@ -1303,77 +1398,77 @@ const hn = {
1303
1398
  return;
1304
1399
  }
1305
1400
  if (p || c) {
1306
- _(), p && !c && je();
1401
+ _(), p && !c && Pe();
1307
1402
  return;
1308
1403
  }
1309
1404
  }
1310
1405
  if (p && !c) {
1311
- je();
1406
+ Pe();
1312
1407
  return;
1313
1408
  }
1314
1409
  if (t.key === "Enter" && !c && !t.shiftKey) {
1315
- const m = l.selectionStart;
1316
- if (m !== l.selectionEnd) return;
1317
- const x = l.value.lastIndexOf(`
1318
- `, m - 1) + 1, k = l.value.slice(x, m), y = ((h = k.match(/^[ \t]*/)) == null ? void 0 : h[0]) ?? "", C = /[{[(]$/.test(k.trimEnd()) ? " " : "";
1410
+ const m = i.selectionStart;
1411
+ if (m !== i.selectionEnd) return;
1412
+ const x = i.value.lastIndexOf(`
1413
+ `, m - 1) + 1, y = i.value.slice(x, m), v = ((b = y.match(/^[ \t]*/)) == null ? void 0 : b[0]) ?? "", S = /[{[(]$/.test(y.trimEnd()) ? " " : "";
1319
1414
  t.preventDefault(), ue(m, m, `
1320
- ${y}${C}`);
1415
+ ${v}${S}`);
1321
1416
  return;
1322
1417
  }
1323
1418
  if (t.key === "Tab") {
1324
- t.preventDefault(), ue(l.selectionStart, l.selectionEnd, " ");
1419
+ t.preventDefault(), ue(i.selectionStart, i.selectionEnd, " ");
1325
1420
  return;
1326
1421
  }
1327
- if (t.key.length === 1 && !c && !t.altKey && f[t.key]) {
1328
- if (l.selectionStart !== l.selectionEnd) return;
1329
- const m = l.selectionStart, x = l.value[m - 1], k = l.value[m];
1330
- if ((t.key === '"' || t.key === "'") && x && /[\w$]/.test(x) || k !== void 0 && !/[\s)\]},;:]/.test(k)) return;
1331
- t.preventDefault(), ue(m, m, t.key + f[t.key], m + 1), V(() => ne(!0));
1422
+ if (t.key.length === 1 && !c && !t.altKey && d[t.key]) {
1423
+ if (i.selectionStart !== i.selectionEnd) return;
1424
+ const m = i.selectionStart, x = i.value[m - 1], y = i.value[m];
1425
+ if ((t.key === '"' || t.key === "'") && x && /[\w$]/.test(x) || y !== void 0 && !/[\s)\]},;:]/.test(y)) return;
1426
+ t.preventDefault(), ue(m, m, t.key + d[t.key], m + 1), V(() => ne(!0));
1332
1427
  }
1333
1428
  }
1334
- function Pe() {
1335
- w.value && _(), F(), V(() => {
1336
- ke(), j(!0);
1429
+ function Ve() {
1430
+ w.value && _(), P(), V(() => {
1431
+ ye(), D(!0);
1337
1432
  });
1338
1433
  }
1339
1434
  let ee = null;
1340
- return jt(() => {
1341
- window.addEventListener("resize", Pe), window.addEventListener("scroll", Fe, !0), V(() => {
1342
- ke(), j(!0);
1343
- }), typeof ResizeObserver < "u" && d.value && (ee = new ResizeObserver(() => {
1344
- j(!0), X();
1345
- }), ee.observe(d.value));
1346
- }), Ft(() => {
1347
- window.removeEventListener("resize", Pe), window.removeEventListener("scroll", Fe, !0), ee == null || ee.disconnect(), ee = null;
1348
- }), s({ focus: () => {
1435
+ return Vt(() => {
1436
+ window.addEventListener("resize", Ve), window.addEventListener("scroll", ze, !0), V(() => {
1437
+ ye(), D(!0);
1438
+ }), typeof ResizeObserver < "u" && f.value && (ee = new ResizeObserver(() => {
1439
+ D(!0), G();
1440
+ }), ee.observe(f.value));
1441
+ }), Kt(() => {
1442
+ window.removeEventListener("resize", Ve), window.removeEventListener("scroll", ze, !0), ee == null || ee.disconnect(), ee = null;
1443
+ }), a({ focus: () => {
1349
1444
  var t;
1350
- return (t = d.value) == null ? void 0 : t.focus();
1351
- } }), (t, l) => (I(), H("div", {
1352
- class: ie(["code-input", { "is-collapsible": n.collapsible }]),
1353
- style: he(kt.value)
1445
+ return (t = f.value) == null ? void 0 : t.focus();
1446
+ } }), (t, i) => (I(), L("div", {
1447
+ class: le(["code-input", { "is-collapsible": n.collapsible }]),
1448
+ style: be(Tt.value)
1354
1449
  }, [
1355
1450
  A("div", {
1356
- class: ie(["code-editor", {
1451
+ class: le(["code-editor", {
1357
1452
  "is-readonly": n.readonly,
1358
1453
  "is-dark": n.theme === "dark",
1359
- "is-collapsed": re.value,
1360
- "is-expanding": ye.value
1454
+ "is-collapsed": se.value,
1455
+ "is-expanding": ke.value
1361
1456
  }]),
1362
- style: he(wt.value),
1363
- onAnimationend: Ue(xt, ["self"])
1457
+ style: be($t.value),
1458
+ onAnimationend: Ye(St, ["self"])
1364
1459
  }, [
1365
- n.lineNumbers ? (I(), H("div", hn, [
1460
+ n.lineNumbers ? (I(), L("div", Sn, [
1366
1461
  A("div", {
1367
1462
  ref_key: "gutterInner",
1368
- ref: b,
1463
+ ref: g,
1369
1464
  class: "gutter-inner code-font"
1370
1465
  }, [
1371
- (I(!0), H(Ye, null, Xe(yt.value, (c) => (I(), H("div", {
1466
+ (I(!0), L(Ge, null, Xe(xt.value, (c) => (I(), L("div", {
1372
1467
  key: c,
1373
1468
  class: "gutter-line"
1374
1469
  }, Y(c), 1))), 128))
1375
1470
  ], 512)
1376
- ])) : K("", !0),
1471
+ ])) : q("", !0),
1377
1472
  A("div", {
1378
1473
  ref_key: "stage",
1379
1474
  ref: T,
@@ -1381,22 +1476,22 @@ ${y}${C}`);
1381
1476
  }, [
1382
1477
  A("div", {
1383
1478
  ref_key: "highlightLayer",
1384
- ref: D,
1479
+ ref: j,
1385
1480
  class: "highlight code-font"
1386
1481
  }, [
1387
1482
  A("pre", {
1388
1483
  ref_key: "highlightInner",
1389
- ref: S,
1484
+ ref: C,
1390
1485
  class: "code-font"
1391
1486
  }, [
1392
- A("code", { innerHTML: vt.value }, null, 8, gn)
1487
+ A("code", { innerHTML: wt.value }, null, 8, Cn)
1393
1488
  ], 512)
1394
1489
  ], 512),
1395
1490
  A("textarea", {
1396
1491
  ref_key: "textarea",
1397
- ref: d,
1492
+ ref: f,
1398
1493
  class: "code-font input",
1399
- value: a.value,
1494
+ value: r.value,
1400
1495
  readonly: n.readonly,
1401
1496
  placeholder: n.placeholder,
1402
1497
  spellcheck: "false",
@@ -1404,70 +1499,70 @@ ${y}${C}`);
1404
1499
  autocapitalize: "off",
1405
1500
  autocorrect: "off",
1406
1501
  wrap: "off",
1407
- onInput: Ht,
1408
- onKeydown: Nt,
1409
- onScroll: At,
1410
- onClick: _t,
1411
- onMousemove: Mt,
1412
- onMouseleave: F,
1413
- onBlur: Lt
1414
- }, null, 40, bn),
1415
- w.value ? (I(), H("ul", {
1502
+ onInput: At,
1503
+ onKeydown: jt,
1504
+ onScroll: Ft,
1505
+ onClick: Ot,
1506
+ onMousemove: Ht,
1507
+ onMouseleave: P,
1508
+ onBlur: Bt
1509
+ }, null, 40, En),
1510
+ w.value ? (I(), L("ul", {
1416
1511
  key: 0,
1417
1512
  ref_key: "popup",
1418
- ref: v,
1513
+ ref: k,
1419
1514
  class: "popup",
1420
- style: he(L.value),
1421
- onMousedown: l[0] || (l[0] = Ue(() => {
1515
+ style: be(H.value),
1516
+ onMousedown: i[0] || (i[0] = Ye(() => {
1422
1517
  }, ["prevent"]))
1423
1518
  }, [
1424
- (I(!0), H(Ye, null, Xe(N.value, (c, p) => (I(), H("li", {
1519
+ (I(!0), L(Ge, null, Xe(F.value, (c, p) => (I(), L("li", {
1425
1520
  key: `${c.label}-${p}`,
1426
- class: ie(["popup-item", { "is-active": p === R.value }]),
1427
- onMouseenter: (h) => R.value = p,
1428
- onClick: (h) => We(c)
1521
+ class: le(["popup-item", { "is-active": p === M.value }]),
1522
+ onMouseenter: (b) => M.value = p,
1523
+ onClick: (b) => We(c)
1429
1524
  }, [
1430
1525
  A("span", {
1431
- class: ie(["badge", `badge-${c.kind}`])
1432
- }, Y(_e(c.kind)), 3),
1433
- A("span", yn, Y(c.label), 1),
1434
- c.detail ? (I(), H("span", kn, Y(c.detail), 1)) : K("", !0)
1435
- ], 42, vn))), 128))
1436
- ], 36)) : K("", !0),
1437
- g.value ? (I(), H("div", {
1526
+ class: le(["badge", `badge-${c.kind}`])
1527
+ }, Y(Ae(c.kind)), 3),
1528
+ A("span", Rn, Y(c.label), 1),
1529
+ c.detail ? (I(), L("span", In, Y(c.detail), 1)) : q("", !0)
1530
+ ], 42, Mn))), 128))
1531
+ ], 36)) : q("", !0),
1532
+ h.value ? (I(), L("div", {
1438
1533
  key: 1,
1439
1534
  ref_key: "hoverCard",
1440
- ref: W,
1535
+ ref: N,
1441
1536
  class: "hover-card",
1442
- style: he(se.value)
1537
+ style: be(re.value)
1443
1538
  }, [
1444
- A("div", wn, [
1539
+ A("div", Ln, [
1445
1540
  A("span", {
1446
- class: ie(["badge", `badge-${g.value.kind}`])
1447
- }, Y(_e(g.value.kind)), 3),
1448
- A("span", xn, [
1449
- Pt(Y(g.value.label), 1),
1450
- g.value.detail ? (I(), H("span", Tn, ":")) : K("", !0)
1541
+ class: le(["badge", `badge-${h.value.kind}`])
1542
+ }, Y(Ae(h.value.kind)), 3),
1543
+ A("span", Hn, [
1544
+ qt(Y(h.value.label), 1),
1545
+ h.value.detail ? (I(), L("span", _n, ":")) : q("", !0)
1451
1546
  ]),
1452
- g.value.detail ? (I(), H("span", $n, Y(g.value.detail), 1)) : K("", !0)
1547
+ h.value.detail ? (I(), L("span", An, Y(h.value.detail), 1)) : q("", !0)
1453
1548
  ]),
1454
- g.value.documentation ? (I(), H("p", Cn, Y(g.value.documentation), 1)) : K("", !0),
1455
- g.value.type ? (I(), H("pre", Sn, [
1549
+ h.value.documentation ? (I(), L("p", Bn, Y(h.value.documentation), 1)) : q("", !0),
1550
+ h.value.type ? (I(), L("pre", On, [
1456
1551
  A("code", {
1457
- innerHTML: $t(g.value.type)
1458
- }, null, 8, En)
1459
- ])) : K("", !0)
1460
- ], 4)) : K("", !0)
1552
+ innerHTML: Et(h.value.type)
1553
+ }, null, 8, Fn)
1554
+ ])) : q("", !0)
1555
+ ], 4)) : q("", !0)
1461
1556
  ], 512),
1462
- n.collapsible ? (I(), H("button", {
1557
+ n.collapsible ? (I(), L("button", {
1463
1558
  key: 1,
1464
1559
  type: "button",
1465
1560
  class: "expand-toggle",
1466
- title: P.value ? "收起" : "展开",
1467
- "aria-label": P.value ? "收起编辑器" : "展开编辑器",
1468
- onClick: Tt
1561
+ title: z.value ? "收起" : "展开",
1562
+ "aria-label": z.value ? "收起编辑器" : "展开编辑器",
1563
+ onClick: Ct
1469
1564
  }, [
1470
- P.value ? (I(), H("svg", In, [...l[2] || (l[2] = [
1565
+ z.value ? (I(), L("svg", jn, [...i[2] || (i[2] = [
1471
1566
  A("path", {
1472
1567
  d: "M11 2 5 8 11 14",
1473
1568
  fill: "none",
@@ -1476,7 +1571,7 @@ ${y}${C}`);
1476
1571
  "stroke-linecap": "round",
1477
1572
  "stroke-linejoin": "round"
1478
1573
  }, null, -1)
1479
- ])])) : (I(), H("svg", Mn, [...l[1] || (l[1] = [
1574
+ ])])) : (I(), L("svg", Wn, [...i[1] || (i[1] = [
1480
1575
  A("path", {
1481
1576
  d: "M6 2 12 8 6 14",
1482
1577
  fill: "none",
@@ -1486,35 +1581,36 @@ ${y}${C}`);
1486
1581
  "stroke-linejoin": "round"
1487
1582
  }, null, -1)
1488
1583
  ])]))
1489
- ], 8, Rn)) : K("", !0)
1584
+ ], 8, Nn)) : q("", !0)
1490
1585
  ], 38)
1491
1586
  ], 6));
1492
1587
  }
1493
- }), Ln = (n, s) => {
1588
+ }), Pn = (n, a) => {
1494
1589
  const o = n.__vccOpts || n;
1495
- for (const [e, i] of s)
1496
- o[e] = i;
1590
+ for (const [e, l] of a)
1591
+ o[e] = l;
1497
1592
  return o;
1498
- }, _n = /* @__PURE__ */ Ln(Hn, [["__scopeId", "data-v-a01b7c8a"]]), On = {
1593
+ }, zn = /* @__PURE__ */ Pn(Dn, [["__scopeId", "data-v-c6879e2c"]]), qn = {
1499
1594
  install(n) {
1500
- n.component("CodeInput", _n);
1595
+ n.component("CodeInput", zn);
1501
1596
  }
1502
1597
  };
1503
1598
  export {
1504
- _n as CodeEditor,
1505
- Qt as collectCompletions,
1506
- On as default,
1507
- Vt as defaultCompletions,
1508
- Kt as findArgumentContext,
1509
- Me as findTemplateRange,
1510
- Qe as getKeywordSet,
1511
- rt as getKeywords,
1512
- be as highlight,
1513
- mn as highlightTemplate,
1514
- Bn as isInsideTemplate,
1515
- cn as parseTsCompletions,
1516
- un as parseTsSignatures,
1517
- en as resolveHoverItem,
1518
- et as scanDeclarations,
1519
- ge as tokenize
1599
+ zn as CodeEditor,
1600
+ cn as collectCompletions,
1601
+ qn as default,
1602
+ Je as defaultCompletions,
1603
+ en as findArgumentContext,
1604
+ Re as findTemplateRange,
1605
+ et as getKeywordSet,
1606
+ Ie as getKeywords,
1607
+ ge as highlight,
1608
+ $n as highlightTemplate,
1609
+ Kn as isInsideTemplate,
1610
+ Jt as literalMemberSet,
1611
+ kn as parseTsCompletions,
1612
+ yn as parseTsSignatures,
1613
+ dn as resolveHoverItem,
1614
+ it as scanDeclarations,
1615
+ he as tokenize
1520
1616
  };