@ai-ecoverse/slicc-spectrum 1.95.0 → 1.96.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/slicc-ui.js CHANGED
@@ -8743,40 +8743,40 @@ function schemeOf(media2) {
8743
8743
  if (!query.startsWith("not")) return scheme;
8744
8744
  return scheme === "dark" ? "light" : "dark";
8745
8745
  }
8746
- function apply(doc, paint, color2) {
8746
+ function apply(doc, paint2, color2) {
8747
8747
  doc.documentElement.style.colorScheme = color2;
8748
8748
  const metas = [...doc.head.querySelectorAll('meta[name="theme-color"]')];
8749
- for (const meta of metas) if (!paint.tones.has(meta)) paint.tones.set(meta, meta.content);
8749
+ for (const meta of metas) if (!paint2.tones.has(meta)) paint2.tones.set(meta, meta.content);
8750
8750
  const own5 = metas.find((meta) => schemeOf(meta.media ?? "") === color2);
8751
8751
  if (!own5) return;
8752
- const tone = paint.tones.get(own5);
8752
+ const tone = paint2.tones.get(own5);
8753
8753
  for (const meta of metas) meta.content = tone;
8754
8754
  }
8755
8755
  function holdDocument(doc) {
8756
- const paint = paints.get(doc) ?? {
8756
+ const paint2 = paints.get(doc) ?? {
8757
8757
  scheme: doc.documentElement.style.colorScheme,
8758
8758
  priority: doc.documentElement.style.getPropertyPriority("color-scheme"),
8759
8759
  tones: /* @__PURE__ */ new Map(),
8760
8760
  holds: /* @__PURE__ */ new Map()
8761
8761
  };
8762
- paints.set(doc, paint);
8762
+ paints.set(doc, paint2);
8763
8763
  const key2 = {};
8764
- paint.holds.set(key2, null);
8764
+ paint2.holds.set(key2, null);
8765
8765
  return {
8766
8766
  paint(color2) {
8767
- if (!paint.holds.has(key2)) return;
8768
- paint.holds.delete(key2);
8769
- paint.holds.set(key2, color2);
8770
- apply(doc, paint, color2);
8767
+ if (!paint2.holds.has(key2)) return;
8768
+ paint2.holds.delete(key2);
8769
+ paint2.holds.set(key2, color2);
8770
+ apply(doc, paint2, color2);
8771
8771
  },
8772
8772
  release() {
8773
- if (!paint.holds.delete(key2)) return;
8774
- const left = [...paint.holds.values()].filter((color2) => color2 !== null);
8775
- if (left.length) return apply(doc, paint, left[left.length - 1]);
8776
- if (paint.holds.size) return;
8773
+ if (!paint2.holds.delete(key2)) return;
8774
+ const left = [...paint2.holds.values()].filter((color2) => color2 !== null);
8775
+ if (left.length) return apply(doc, paint2, left[left.length - 1]);
8776
+ if (paint2.holds.size) return;
8777
8777
  paints.delete(doc);
8778
- doc.documentElement.style.setProperty("color-scheme", paint.scheme, paint.priority);
8779
- for (const [meta, tone] of paint.tones) meta.content = tone;
8778
+ doc.documentElement.style.setProperty("color-scheme", paint2.scheme, paint2.priority);
8779
+ for (const [meta, tone] of paint2.tones) meta.content = tone;
8780
8780
  }
8781
8781
  };
8782
8782
  }
@@ -12303,9 +12303,9 @@ function factoryTitle(effects, ok4, nok, type, markerType, stringType) {
12303
12303
  return atBreak(code3);
12304
12304
  }
12305
12305
  effects.consume(code3);
12306
- return code3 === 92 ? escape2 : inside;
12306
+ return code3 === 92 ? escape3 : inside;
12307
12307
  }
12308
- function escape2(code3) {
12308
+ function escape3(code3) {
12309
12309
  if (code3 === marker || code3 === 92) {
12310
12310
  effects.consume(code3);
12311
12311
  return inside;
@@ -21041,8 +21041,8 @@ var PATH_STORE_NODE_FLAGS_MASK = 7;
21041
21041
  var PATH_STORE_NODE_KIND_SHIFT = 3;
21042
21042
  var PATH_STORE_NODE_KIND_MASK = 1 << PATH_STORE_NODE_KIND_SHIFT;
21043
21043
  var PATH_STORE_NODE_DEPTH_SHIFT = 4;
21044
- function createNodeDepthAndFlags(depth, flags, kind = 0) {
21045
- return depth << PATH_STORE_NODE_DEPTH_SHIFT | kind << PATH_STORE_NODE_KIND_SHIFT | flags;
21044
+ function createNodeDepthAndFlags(depth, flags2, kind = 0) {
21045
+ return depth << PATH_STORE_NODE_DEPTH_SHIFT | kind << PATH_STORE_NODE_KIND_SHIFT | flags2;
21046
21046
  }
21047
21047
  function getNodeDepth(node2) {
21048
21048
  return node2.depthAndFlags >>> PATH_STORE_NODE_DEPTH_SHIFT;
@@ -29392,6 +29392,229 @@ var FileTree = class {
29392
29392
  }
29393
29393
  };
29394
29394
 
29395
+ // src/app/ansi.ts
29396
+ var lightPalette = [
29397
+ "gray-800",
29398
+ "negative-color-900",
29399
+ "positive-color-900",
29400
+ "notice-color-1000",
29401
+ "informative-color-900",
29402
+ "purple-900",
29403
+ "cyan-1000",
29404
+ "gray-600",
29405
+ "gray-700",
29406
+ "negative-color-1000",
29407
+ "positive-color-1000",
29408
+ "notice-color-1100",
29409
+ "informative-color-1000",
29410
+ "purple-1000",
29411
+ "cyan-1100",
29412
+ "gray-800"
29413
+ ];
29414
+ var terminalPalette = r(
29415
+ lightPalette.map((token2, n37) => `--slicc-terminal-color-${n37}: var(--swc-${token2});`).join("\n")
29416
+ );
29417
+ var tints = [
29418
+ "gray-800",
29419
+ "negative-subtle-background-color-default",
29420
+ "positive-subtle-background-color-default",
29421
+ "notice-subtle-background-color-default",
29422
+ "informative-subtle-background-color-default",
29423
+ "purple-subtle-background-color-default",
29424
+ "cyan-subtle-background-color-default",
29425
+ "gray-subtle-background-color-default"
29426
+ ];
29427
+ var plain = {
29428
+ bold: false,
29429
+ dim: false,
29430
+ italic: false,
29431
+ underline: false,
29432
+ inverse: false,
29433
+ fg: null,
29434
+ bg: null
29435
+ };
29436
+ var levels = [0, 95, 135, 175, 215, 255];
29437
+ function indexed(n37) {
29438
+ if (!Number.isInteger(n37) || n37 < 0 || n37 > 255) return null;
29439
+ if (n37 < 16) return n37;
29440
+ if (n37 >= 232) {
29441
+ const grey = 8 + (n37 - 232) * 10;
29442
+ return `rgb(${grey}, ${grey}, ${grey})`;
29443
+ }
29444
+ const cube = n37 - 16;
29445
+ const [r40, g7, b13] = [Math.floor(cube / 36), Math.floor(cube / 6) % 6, cube % 6].map(
29446
+ (level) => levels[level]
29447
+ );
29448
+ return `rgb(${r40}, ${g7}, ${b13})`;
29449
+ }
29450
+ function channel(value) {
29451
+ return Number.isInteger(value) && value >= 0 && value <= 255 ? value : null;
29452
+ }
29453
+ function extended(params, at) {
29454
+ const mode2 = params[at + 1];
29455
+ if (mode2 === 5) return { color: indexed(params[at + 2]), used: 2 };
29456
+ if (mode2 === 2) {
29457
+ const rgb = params.slice(at + 2, at + 5).map(channel);
29458
+ const ok4 = rgb.length === 3 && rgb.every((value) => value !== null);
29459
+ return { color: ok4 ? `rgb(${rgb.join(", ")})` : null, used: 4 };
29460
+ }
29461
+ return { color: null, used: 0 };
29462
+ }
29463
+ function numbers(text5) {
29464
+ return text5.split(":").map((part2) => part2 === "" ? 0 : Number(part2));
29465
+ }
29466
+ var flags = {
29467
+ 0: plain,
29468
+ 1: { bold: true },
29469
+ 2: { dim: true },
29470
+ 3: { italic: true },
29471
+ 4: { underline: true },
29472
+ 7: { inverse: true },
29473
+ 22: { bold: false, dim: false },
29474
+ 23: { italic: false },
29475
+ 24: { underline: false },
29476
+ 27: { inverse: false },
29477
+ 39: { fg: null },
29478
+ 49: { bg: null }
29479
+ };
29480
+ var ranges = [
29481
+ [30, "fg", 0],
29482
+ [40, "bg", 0],
29483
+ [90, "fg", 8],
29484
+ [100, "bg", 8]
29485
+ ];
29486
+ function simple(code3) {
29487
+ const flag = flags[code3];
29488
+ if (flag) return flag;
29489
+ const range3 = ranges.find(([start2]) => code3 >= start2 && code3 < start2 + 8);
29490
+ return range3 ? { [range3[1]]: code3 - range3[0] + range3[2] } : null;
29491
+ }
29492
+ function wide(groups2, i26) {
29493
+ const group = groups2[i26];
29494
+ if (group.length === 1)
29495
+ return extended(
29496
+ groups2.slice(i26).map((entry) => entry[0]),
29497
+ 0
29498
+ );
29499
+ const spaced = group[1] === 2 && group.length > 5;
29500
+ return { color: extended(spaced ? [0, 2, ...group.slice(3)] : group, 0).color, used: 0 };
29501
+ }
29502
+ function sgr(style, body4) {
29503
+ const next = { ...style };
29504
+ const groups2 = body4 === "" ? [[0]] : body4.split(";").map(numbers);
29505
+ for (let i26 = 0; i26 < groups2.length; i26++) {
29506
+ const group = groups2[i26];
29507
+ const code3 = group[0];
29508
+ if (code3 === 38 || code3 === 48) {
29509
+ const { color: color2, used } = wide(groups2, i26);
29510
+ i26 += used;
29511
+ if (color2 !== null) next[code3 === 38 ? "fg" : "bg"] = color2;
29512
+ } else if (code3 === 4 && group.length > 1) next.underline = group[1] !== 0;
29513
+ else Object.assign(next, simple(code3));
29514
+ }
29515
+ return next;
29516
+ }
29517
+ function terminated(text5, from, streaming) {
29518
+ for (let i26 = from; i26 < text5.length; i26++) {
29519
+ if (text5[i26] === "\x07") return i26 + 1;
29520
+ if (text5[i26] === "\x1B" && text5[i26 + 1] === "\\") return i26 + 2;
29521
+ }
29522
+ if (streaming) return -1;
29523
+ const line = text5.indexOf("\n", from);
29524
+ return line === -1 ? text5.length : line;
29525
+ }
29526
+ function csi(text5, from) {
29527
+ for (let i26 = from; i26 < text5.length; i26++) {
29528
+ const code3 = text5.charCodeAt(i26);
29529
+ if (code3 >= 64 && code3 <= 126) {
29530
+ return { end: i26 + 1, body: text5.slice(from, i26), final: text5[i26] };
29531
+ }
29532
+ if (code3 < 32 || code3 > 63) return { end: i26, body: "", final: "" };
29533
+ }
29534
+ return null;
29535
+ }
29536
+ function escape(text5, at, style, streaming) {
29537
+ const kind = text5[at + 1];
29538
+ if (kind === void 0) return { end: -1, style };
29539
+ if (kind === "[") {
29540
+ const found = csi(text5, at + 2);
29541
+ if (!found) return { end: -1, style };
29542
+ const styled = found.final === "m" && /^[\d;:]*$/.test(found.body);
29543
+ return { end: found.end, style: styled ? sgr(style, found.body) : style };
29544
+ }
29545
+ if ("]PX^_".includes(kind)) return { end: terminated(text5, at + 2, streaming), style };
29546
+ let i26 = at + 1;
29547
+ while (i26 < text5.length && text5.charCodeAt(i26) >= 32 && text5.charCodeAt(i26) <= 47) i26++;
29548
+ if (i26 === text5.length) return { end: -1, style };
29549
+ const final = text5.charCodeAt(i26);
29550
+ return { end: final >= 48 && final <= 126 ? i26 + 1 : at + 1, style };
29551
+ }
29552
+ function parseAnsi(text5, streaming = false) {
29553
+ const runs2 = [];
29554
+ let style = plain;
29555
+ let start2 = 0;
29556
+ const push2 = (end) => {
29557
+ if (end <= start2) return;
29558
+ const last = runs2.at(-1);
29559
+ const piece = text5.slice(start2, end);
29560
+ if (last?.style === style) last.text += piece;
29561
+ else runs2.push({ text: piece, style });
29562
+ };
29563
+ let i26 = text5.indexOf("\x1B");
29564
+ while (i26 !== -1) {
29565
+ push2(i26);
29566
+ const found = escape(text5, i26, style, streaming);
29567
+ if (found.end === -1) return runs2;
29568
+ style = found.style;
29569
+ start2 = found.end;
29570
+ i26 = text5.indexOf("\x1B", start2);
29571
+ }
29572
+ push2(text5.length);
29573
+ return runs2;
29574
+ }
29575
+ function swatch(color2) {
29576
+ if (color2 === null) return null;
29577
+ return typeof color2 === "number" ? `var(--slicc-terminal-color-${color2}, var(--swc-${lightPalette[color2]}))` : color2;
29578
+ }
29579
+ function on(rgb) {
29580
+ const [r40, g7, b13] = rgb.match(/\d+/g).map((value) => {
29581
+ const v13 = Number(value) / 255;
29582
+ return v13 <= 0.03928 ? v13 / 12.92 : ((v13 + 0.055) / 1.055) ** 2.4;
29583
+ });
29584
+ return 0.2126 * r40 + 0.7152 * g7 + 0.0722 * b13 > 0.179 ? "var(--swc-black)" : "var(--swc-white)";
29585
+ }
29586
+ function paint(style) {
29587
+ let { fg, bg } = style;
29588
+ if (style.inverse && fg === null && bg === null) {
29589
+ return ["var(--swc-background-layer-1-color)", "var(--swc-neutral-content-color-default)"];
29590
+ }
29591
+ if (style.inverse) [fg, bg] = [bg, fg];
29592
+ if (style.dim && typeof fg === "number" && fg >= 8) fg -= 8;
29593
+ if (style.dim && fg === null && bg === null) {
29594
+ return ["var(--swc-neutral-subdued-content-color-default)", null];
29595
+ }
29596
+ if (bg === null) return [swatch(fg), null];
29597
+ if (typeof bg === "string") return [typeof fg === "string" ? fg : on(bg), bg];
29598
+ const tint = `var(--swc-${bg === 8 ? "gray-700" : tints[bg % 8]})`;
29599
+ return [bg % 8 === 0 ? "var(--swc-gray-25)" : null, tint];
29600
+ }
29601
+ function inline3(style) {
29602
+ const [fg, bg] = paint(style);
29603
+ return [
29604
+ fg ? `color: ${fg}` : "",
29605
+ bg ? `background: ${bg}` : "",
29606
+ style.bold ? "font-weight: var(--swc-bold-font-weight)" : "",
29607
+ style.italic ? "font-style: italic" : "",
29608
+ style.underline ? "text-decoration: underline" : ""
29609
+ ].filter(Boolean).join("; ");
29610
+ }
29611
+ function ansi(text5, streaming = false) {
29612
+ return parseAnsi(text5, streaming).map((run) => {
29613
+ const style = inline3(run.style);
29614
+ return style ? b`<span style=${style}>${run.text}</span>` : run.text;
29615
+ });
29616
+ }
29617
+
29395
29618
  // src/app/sign-in.ts
29396
29619
  var continuing = "Continue in the sign-in window that opened.";
29397
29620
  var closed = "Closed the sign-in window? Cancel, then Log in again.";
@@ -29711,7 +29934,7 @@ function tool(call, color2 = "light", options2 = {}) {
29711
29934
  const label = `${call.title}, ${statusLabel2(call.status)}`;
29712
29935
  const content3 = b`<div class="call">
29713
29936
  ${body(call, color2)}
29714
- ${call.output ? b`<pre class="output">${call.output}</pre>` : A}
29937
+ ${call.output ? b`<pre class="output">${ansi(call.output, call.status === "running")}</pre>` : A}
29715
29938
  ${call.notes?.length ? notes(call.notes) : A}
29716
29939
  ${call.image ? b`<img class="shot" src=${call.image} alt=${call.title} />` : A}
29717
29940
  ${call.meta ? b`<span class="tool-meta">${call.meta}</span>` : A}
@@ -30183,28 +30406,56 @@ function decision(message, handlers, pile) {
30183
30406
  </div>
30184
30407
  </swc-conversation-turn>`;
30185
30408
  }
30409
+ var scoopWords = {
30410
+ completed: "finished",
30411
+ failed: "failed",
30412
+ stopped: "stopped"
30413
+ };
30414
+ var scoopBracket = /^\[(?:scoop |@)[^\]\n]* (completed|failed|stopped)\][^\S\n]*(?:\n|$)/;
30415
+ function scoopLine(message) {
30416
+ const icon = lickIcons[message.channel];
30417
+ const [label] = lickLabels[message.channel];
30418
+ const bracket = message.channel === "scoop-notify" && scoopBracket.exec(message.text);
30419
+ if (!bracket) return [message.text, false, icon, label];
30420
+ const name = message.title.replace(/\s*\([^)]*\)$/, "");
30421
+ const word = scoopWords[bracket[1]];
30422
+ if (bracket[1] === "completed") return [`Scoop ${name} ${word}`, false, icon, label];
30423
+ return [`Scoop ${name} ${word}`, true, "\u274C", `Scoop ${word}`];
30424
+ }
30425
+ function lickBody(message) {
30426
+ return message.channel === "scoop-notify" ? (message.body ?? "").replace(scoopBracket, "").trim() : message.body;
30427
+ }
30428
+ function lickContent(message, body4, handlers) {
30429
+ const scoop = message.channel === "scoop-notify";
30430
+ const report = message.report;
30431
+ if (!scoop && !report) return b`<pre class="output">${body4}</pre>`;
30432
+ const shown4 = !body4 ? A : scoop ? b`<div class="text">${markdown(body4)}</div>` : b`<pre class="output">${body4}</pre>`;
30433
+ return b`<div class="report">${shown4}${report ? b`<swc-button size="s" variant="secondary" fill-style="outline" data-action="open-report" @click=${() => handlers.open(report)}>Open the report</swc-button>` : A}</div>`;
30434
+ }
30186
30435
  function lick(message, handlers, stamp = true, pile = flatPile) {
30187
30436
  if (pendingApproval(message)) return decision(message, handlers, pile);
30188
- const [label] = lickLabels[message.channel];
30437
+ const [line, failed2, icon, label] = scoopLine(message);
30438
+ const severity = message.severity ?? (failed2 ? "error" : void 0);
30189
30439
  const outcome = message.state === "confirmed" ? "Allowed" : message.state === "dismissed" ? "Denied" : "";
30190
- const head2 = b`${message.severity ? b`<span class="sr">${severities[message.severity].prefix}</span>` : A}
30440
+ const head2 = b`${severity ? b`<span class="sr">${severities[severity].prefix}</span>` : A}
30191
30441
  ${outcome ? b`<span class="sr">${outcome}. </span>` : A}
30192
- <span class="text">${message.text}</span>
30442
+ <span class="text" data-summary=${message.summary ? "" : A}>${message.summary || line}</span>
30193
30443
  ${message.count && message.count > 1 ? b`<span class="times" title="Coalesced events">×${message.count}</span>` : A}`;
30194
30444
  const outcomeIcon = message.state === "confirmed" ? "\u{1F44D}" : message.state === "dismissed" ? "\u{1F44E}" : "";
30195
- const reaction = b`<span class="reactions"><span class="reaction" title=${label} aria-hidden="true">${lickIcons[message.channel]}</span>${outcomeIcon ? b`<span class="reaction" title=${outcome} aria-hidden="true">${outcomeIcon}</span>` : A}</span>`;
30196
- const name = `${message.severity ? severities[message.severity].prefix : ""}${label} event`;
30197
- const byline2 = b`<div class="meta">${message.severity ? b`<span class="severity-icon">${severities[message.severity].icon}</span>` : A}<span class="who">${message.title}</span>${stamp ? when(message.createdAt) : unseen(message.createdAt)}</div>`;
30198
- if (!message.body) {
30445
+ const reaction = b`<span class="reactions"><span class="reaction" title=${label} aria-hidden="true">${icon}</span>${outcomeIcon ? b`<span class="reaction" title=${outcome} aria-hidden="true">${outcomeIcon}</span>` : A}</span>`;
30446
+ const name = `${severity ? severities[severity].prefix : ""}${label} event`;
30447
+ const byline2 = b`<div class="meta">${severity ? b`<span class="severity-icon">${severities[severity].icon}</span>` : A}<span class="who">${message.title}</span>${stamp ? when(message.createdAt) : unseen(message.createdAt)}</div>`;
30448
+ const body4 = lickBody(message);
30449
+ if (!body4 && !message.report) {
30199
30450
  return outside(
30200
30451
  name,
30201
30452
  byline2,
30202
- b`<div class="lick-frame"><div class="lick" data-id=${message.id} data-channel=${message.channel} data-severity=${message.severity ?? A}><div class="lick-head">${head2}</div></div>${reaction}</div>`
30453
+ b`<div class="lick-frame"><div class="lick" data-id=${message.id} data-channel=${message.channel} data-severity=${severity ?? A}><div class="lick-head">${head2}</div></div>${reaction}</div>`
30203
30454
  );
30204
30455
  }
30205
- const details = b`<details class="lick" data-id=${message.id} data-channel=${message.channel} data-severity=${message.severity ?? A} ?open=${handlers.licks?.has(message.id) ?? false} @toggle=${handlers.licks?.details(message.id) ?? A}>
30456
+ const details = b`<details class="lick" data-id=${message.id} data-channel=${message.channel} data-severity=${severity ?? A} ?open=${handlers.licks?.has(message.id) ?? false} @toggle=${handlers.licks?.details(message.id) ?? A}>
30206
30457
  <summary class="lick-head">${head2}<swc-icon-chevron-right class="chevron" size="s" aria-hidden="true"></swc-icon-chevron-right></summary>
30207
- <pre class="output">${message.body}</pre>
30458
+ ${lickContent(message, body4, handlers)}
30208
30459
  </details>`;
30209
30460
  return outside(name, byline2, b`<div class="lick-frame">${details}${reaction}</div>`);
30210
30461
  }
@@ -30395,16 +30646,35 @@ var messageCss = i`
30395
30646
  details[open] > summary .chevron {
30396
30647
  transform: rotate(90deg);
30397
30648
  }
30398
- .lick .text,
30649
+ .lick-head .text,
30399
30650
  .runs .label {
30400
30651
  min-inline-size: 0;
30401
30652
  overflow: hidden;
30402
30653
  text-overflow: ellipsis;
30403
30654
  white-space: nowrap;
30404
30655
  }
30405
- .lick .text {
30656
+ .lick-head .text {
30406
30657
  flex: 1;
30407
30658
  }
30659
+ .lick-head .text[data-summary] {
30660
+ white-space: normal;
30661
+ }
30662
+ .lick .report {
30663
+ display: flex;
30664
+ flex-direction: column;
30665
+ align-items: flex-start;
30666
+ gap: var(--swc-spacing-200);
30667
+ padding: var(--swc-spacing-75) var(--swc-spacing-200) var(--swc-spacing-200);
30668
+ overflow-wrap: anywhere;
30669
+ }
30670
+ .lick .report .heading {
30671
+ font-size: inherit;
30672
+ }
30673
+ .lick .report > .text {
30674
+ align-self: stretch;
30675
+ max-block-size: calc(var(--swc-spacing-1000) * 4);
30676
+ overflow: auto;
30677
+ }
30408
30678
  swc-system-message > slicc-tool-runs + slicc-tool-runs {
30409
30679
  margin-block-start: var(--swc-spacing-75);
30410
30680
  }
@@ -32453,13 +32723,13 @@ var SliccFiles = class extends ModelElement {
32453
32723
  item2?.select();
32454
32724
  tree.reveal(path2, false);
32455
32725
  }
32456
- #busy(at, on) {
32726
+ #busy(at, on2) {
32457
32727
  if (at === void 0) {
32458
- this.mounting = on;
32728
+ this.mounting = on2;
32459
32729
  return;
32460
32730
  }
32461
32731
  const inserting = new Set(this.inserting);
32462
- if (on) inserting.add(at);
32732
+ if (on2) inserting.add(at);
32463
32733
  else inserting.delete(at);
32464
32734
  this.inserting = inserting;
32465
32735
  }
@@ -38598,22 +38868,7 @@ var SliccTerminalPanel = class extends ThemedElement {
38598
38868
  --slicc-terminal-font-size: var(--swc-font-size-100);
38599
38869
  }
38600
38870
  :host([color='light']) {
38601
- --slicc-terminal-color-0: var(--swc-gray-800);
38602
- --slicc-terminal-color-1: var(--swc-negative-color-900);
38603
- --slicc-terminal-color-2: var(--swc-positive-color-900);
38604
- --slicc-terminal-color-3: var(--swc-notice-color-1000);
38605
- --slicc-terminal-color-4: var(--swc-informative-color-900);
38606
- --slicc-terminal-color-5: var(--swc-purple-900);
38607
- --slicc-terminal-color-6: var(--swc-cyan-1000);
38608
- --slicc-terminal-color-7: var(--swc-gray-600);
38609
- --slicc-terminal-color-8: var(--swc-gray-700);
38610
- --slicc-terminal-color-9: var(--swc-negative-color-1000);
38611
- --slicc-terminal-color-10: var(--swc-positive-color-1000);
38612
- --slicc-terminal-color-11: var(--swc-notice-color-1100);
38613
- --slicc-terminal-color-12: var(--swc-informative-color-1000);
38614
- --slicc-terminal-color-13: var(--swc-purple-1000);
38615
- --slicc-terminal-color-14: var(--swc-cyan-1100);
38616
- --slicc-terminal-color-15: var(--swc-gray-800);
38871
+ ${terminalPalette}
38617
38872
  }
38618
38873
  `
38619
38874
  ];
@@ -43190,13 +43445,13 @@ function touched2(cwds, word, whole) {
43190
43445
  }
43191
43446
  return null;
43192
43447
  }
43193
- function ansi(command3) {
43194
- const escape2 = /\\(?:x([0-9a-fA-F]{1,2})|u([0-9a-fA-F]{1,4})|U([0-9a-fA-F]{1,8})|([0-7]{1,3})|([\s\S]))/g;
43448
+ function ansi2(command3) {
43449
+ const escape3 = /\\(?:x([0-9a-fA-F]{1,2})|u([0-9a-fA-F]{1,4})|U([0-9a-fA-F]{1,8})|([0-7]{1,3})|([\s\S]))/g;
43195
43450
  return command3.replace(
43196
43451
  /\$'((?:[^'\\]|\\[\s\S])*)'/g,
43197
- (_9, body4) => `'${body4.replace(escape2, (_match, hex, short2, long, octal, plain) => {
43452
+ (_9, body4) => `'${body4.replace(escape3, (_match, hex, short2, long, octal, plain2) => {
43198
43453
  if (octal) return String.fromCharCode(Number.parseInt(octal, 8));
43199
- if (plain) return plain;
43454
+ if (plain2) return plain2;
43200
43455
  return String.fromCodePoint(
43201
43456
  Math.min(Number.parseInt(hex ?? short2 ?? long, 16), 1114111)
43202
43457
  );
@@ -43292,10 +43547,10 @@ function reach2(command3, cwd) {
43292
43547
  const start2 = absolute("/", cwd ?? "/");
43293
43548
  if (protects(start2, false)) return start2;
43294
43549
  const cwds = /* @__PURE__ */ new Set([start2]);
43295
- const text5 = unglob(ansi(command3.replace(/\\\n/g, "")));
43296
- const plain = text5.split(separators).map((segment2) => commas(segment2.split(/[\s<>=]+/).map((word) => word.replace(/['"\\]/g, ""))));
43550
+ const text5 = unglob(ansi2(command3.replace(/\\\n/g, "")));
43551
+ const plain2 = text5.split(separators).map((segment2) => commas(segment2.split(/[\s<>=]+/).map((word) => word.replace(/['"\\]/g, ""))));
43297
43552
  const aware = shield(text5).split(separators).map((segment2) => commas(quoted(unshield(segment2))));
43298
- const segments = JSON.stringify(aware) === JSON.stringify(plain) ? plain : [...plain, ...aware];
43553
+ const segments = JSON.stringify(aware) === JSON.stringify(plain2) ? plain2 : [...plain2, ...aware];
43299
43554
  const whole = segments.some((words) => words.length > 0 && !trusted(words[0]));
43300
43555
  for (const words of segments) {
43301
43556
  const hit = scan2(words, cwds, whole);
@@ -43502,9 +43757,9 @@ var SliccApprovals = class extends ModelElement {
43502
43757
  clearTimeout(this.#arming);
43503
43758
  this.#showing = null;
43504
43759
  }
43505
- #tick(on) {
43506
- if (on && !this.#timer) this.#timer = setInterval(() => this.now = Date.now(), 1e3);
43507
- if (!on && this.#timer) {
43760
+ #tick(on2) {
43761
+ if (on2 && !this.#timer) this.#timer = setInterval(() => this.now = Date.now(), 1e3);
43762
+ if (!on2 && this.#timer) {
43508
43763
  clearInterval(this.#timer);
43509
43764
  this.#timer = null;
43510
43765
  }
@@ -44885,10 +45140,10 @@ var SliccBrowser = class extends ModelElement {
44885
45140
  }
44886
45141
  #detail(tabs, tab) {
44887
45142
  const narrow = this.#width < narrowWidth;
44888
- const wide = this.#width >= wideWidth;
45143
+ const wide2 = this.#width >= wideWidth;
44889
45144
  const copy = this.#copied === "url" ? "Copied" : this.#copied === "failed" ? "Couldn\u2019t copy" : "Copy";
44890
- return b`<div class=${`focused${wide ? " wide" : ""}${narrow ? " narrow" : ""}`}>
44891
- ${wide ? this.#list(tabs, tab) : A}
45145
+ return b`<div class=${`focused${wide2 ? " wide" : ""}${narrow ? " narrow" : ""}`}>
45146
+ ${wide2 ? this.#list(tabs, tab) : A}
44892
45147
  <section class="detail" aria-label=${tab.title}>
44893
45148
  <div class="bar">
44894
45149
  <swc-action-button size="s" quiet data-action="all-tabs" @click=${(event2) => {
@@ -44897,7 +45152,7 @@ var SliccBrowser = class extends ModelElement {
44897
45152
  () => this.focusWith({ focusVisible: event2.detail === 0 }, ".window")
44898
45153
  );
44899
45154
  }}><swc-icon-chevron-left slot="icon"></swc-icon-chevron-left>All tabs (${tabs.length})</swc-action-button>
44900
- ${wide ? A : this.#picker(tabs, tab)}
45155
+ ${wide2 ? A : this.#picker(tabs, tab)}
44901
45156
  </div>
44902
45157
  <div class="address">
44903
45158
  <span class="url" title=${tab.url}>${narrow ? place2(tab.url) : tab.url}</span>
@@ -47840,7 +48095,7 @@ function load() {
47840
48095
  function pascal(name) {
47841
48096
  return name.replace(/(^|-)([a-z0-9])/g, (_9, _dash, char) => char.toUpperCase());
47842
48097
  }
47843
- var escape = (value) => String(value).replace(/&/g, "&amp;").replace(/"/g, "&quot;").replace(/</g, "&lt;");
48098
+ var escape2 = (value) => String(value).replace(/&/g, "&amp;").replace(/"/g, "&quot;").replace(/</g, "&lt;");
47844
48099
  function svg(name, node2) {
47845
48100
  const attributes = {
47846
48101
  xmlns: "http://www.w3.org/2000/svg",
@@ -47854,7 +48109,7 @@ function svg(name, node2) {
47854
48109
  "stroke-linejoin": "round",
47855
48110
  class: `lucide lucide-${name}`
47856
48111
  };
47857
- const attrs = (entries) => Object.entries(entries).map(([key2, value]) => ` ${key2}="${escape(value)}"`).join("");
48112
+ const attrs = (entries) => Object.entries(entries).map(([key2, value]) => ` ${key2}="${escape2(value)}"`).join("");
47858
48113
  const children = node2.map(([tag3, child]) => `<${tag3}${attrs(child)}/>`).join("");
47859
48114
  return `<svg${attrs(attributes)}>${children}</svg>`;
47860
48115
  }
@@ -48495,17 +48750,17 @@ function byName(a23, b13) {
48495
48750
  return a23.name < b13.name ? -1 : a23.name > b13.name ? 1 : 0;
48496
48751
  }
48497
48752
  function sourceLine(secret, devices) {
48498
- const on = secret.sourceDevice ? ` on ${deviceName2(secret.sourceDevice, devices)}` : "";
48753
+ const on2 = secret.sourceDevice ? ` on ${deviceName2(secret.sourceDevice, devices)}` : "";
48499
48754
  const [kind, detail = ""] = secret.source.split(/:(.*)/s);
48500
- if (kind === "settings") return `Entered in SLICC${on}`;
48501
- if (kind === "popup") return `Entered in the vault${on}`;
48502
- if (kind === "process") return `Saved by a program${on}`;
48755
+ if (kind === "settings") return `Entered in SLICC${on2}`;
48756
+ if (kind === "popup") return `Entered in the vault${on2}`;
48757
+ if (kind === "process") return `Saved by a program${on2}`;
48503
48758
  if (kind === "import") return `Imported from ${detail}`;
48504
48759
  if (kind === "oauth") {
48505
48760
  const as = secret.account ? ` as ${secret.account}` : "";
48506
48761
  return `Signed in to ${secret.provider ?? detail}${as}`;
48507
48762
  }
48508
- return `A jerk lease for ${detail.split("@")[0]}${on}`;
48763
+ return `A jerk lease for ${detail.split("@")[0]}${on2}`;
48509
48764
  }
48510
48765
  function startOfDay(now) {
48511
48766
  const date = new Date(now);
@@ -49234,9 +49489,9 @@ var SliccSecrets = class extends ThemedElement {
49234
49489
  }
49235
49490
  }
49236
49491
  #pick(name, event2) {
49237
- const on = event2.currentTarget.checked;
49492
+ const on2 = event2.currentTarget.checked;
49238
49493
  this.picked = new Set(
49239
- on ? [...this.picked, name] : [...this.picked].filter((item2) => item2 !== name)
49494
+ on2 ? [...this.picked, name] : [...this.picked].filter((item2) => item2 !== name)
49240
49495
  );
49241
49496
  }
49242
49497
  async exportAll(vault, trigger2 = null) {
@@ -49689,6 +49944,23 @@ function matchProviders(options2, query) {
49689
49944
  return words.every((word) => text5.includes(word));
49690
49945
  });
49691
49946
  }
49947
+ var mcpRegistrations = "slicc-spectrum.mcp-endpoints";
49948
+ function registrations2() {
49949
+ try {
49950
+ return JSON.parse(globalThis.localStorage.getItem(mcpRegistrations) ?? "{}") ?? {};
49951
+ } catch {
49952
+ return {};
49953
+ }
49954
+ }
49955
+ function register(server, url) {
49956
+ const all3 = registrations2();
49957
+ if (url) all3[server] = url;
49958
+ else delete all3[server];
49959
+ try {
49960
+ globalThis.localStorage.setItem(mcpRegistrations, JSON.stringify(all3));
49961
+ } catch {
49962
+ }
49963
+ }
49692
49964
  var popup = (account) => account.group === "mcp" && account.auth === "oauth";
49693
49965
  var start = (options2, value) => options2.some((option2) => option2.value === value) ? value : options2[0]?.value ?? "";
49694
49966
  var nothingToChoose = "Nothing to choose from yet. You can connect without it.";
@@ -50059,7 +50331,7 @@ var SliccSettings = class extends ThemedElement {
50059
50331
  model.settings.on("settings", settle2),
50060
50332
  model.settings.on("accounts", settle2),
50061
50333
  model.settings.on("providers", update),
50062
- ...model.vault ? [model.vault.on("status", update)] : []
50334
+ ...model.vault ? [model.vault.on("status", update), model.vault.on("list", update)] : []
50063
50335
  ];
50064
50336
  }
50065
50337
  focus() {
@@ -50093,9 +50365,9 @@ var SliccSettings = class extends ThemedElement {
50093
50365
  return event2.target.checked;
50094
50366
  }
50095
50367
  #cancelled = /* @__PURE__ */ new Set();
50096
- #busy(id, on) {
50368
+ #busy(id, on2) {
50097
50369
  const rest = [...this.pending].filter((candidate) => candidate !== id);
50098
- this.pending = new Set(on ? [...rest, id] : rest);
50370
+ this.pending = new Set(on2 ? [...rest, id] : rest);
50099
50371
  }
50100
50372
  async connect(id, secret, fields) {
50101
50373
  this.#busy(id, true);
@@ -50130,8 +50402,18 @@ var SliccSettings = class extends ThemedElement {
50130
50402
  const options2 = account.group === "mcp" ? { kind: "mcp", server: serverOf(account) } : { kind: "model", provider: account.id };
50131
50403
  this.#busy(id, true);
50132
50404
  this.failure = null;
50405
+ const url = this.#mcpUrl(account);
50133
50406
  try {
50134
50407
  await vault.put?.(recordName(account), value, void 0, options2);
50408
+ if (url) {
50409
+ const server = serverOf(account);
50410
+ const old = registrations2()[server];
50411
+ await vault.endpoints?.({
50412
+ ...old && old !== url ? { remove: { mcp: [{ server, url: old }] } } : {},
50413
+ add: { mcp: [{ server, url }] }
50414
+ });
50415
+ register(server, url);
50416
+ }
50135
50417
  } catch (error) {
50136
50418
  this.#busy(id, false);
50137
50419
  if (this.model === model) this.#refuse(id, "value", failureText(error));
@@ -50272,6 +50554,11 @@ var SliccSettings = class extends ThemedElement {
50272
50554
  const form = event2.currentTarget;
50273
50555
  this.problem = null;
50274
50556
  this.filled = new Set([...this.filled].filter((name) => name !== "value"));
50557
+ const url = this.#mcpUrl(account);
50558
+ if (this.#vault(account) && url) {
50559
+ void this.#confirmSubmit(form, account, url);
50560
+ return;
50561
+ }
50275
50562
  if (this.#vault(account)) {
50276
50563
  const value = take(form.querySelector("input[data-field=value]"));
50277
50564
  const fields2 = this.#fields(form, account);
@@ -50284,6 +50571,67 @@ var SliccSettings = class extends ThemedElement {
50284
50571
  const fields = this.#fields(form, account);
50285
50572
  if (secret && fields !== null) void this.#connectBases(account, secret, fields);
50286
50573
  }
50574
+ async #confirmSubmit(form, account, url) {
50575
+ const input = form.querySelector("input[data-field=value]");
50576
+ const problem = valueProblem(input.value);
50577
+ if (problem) return this.#refuse(account.id, "value", problem);
50578
+ const fields = this.#fields(form, account);
50579
+ if (fields === null || this.pending.has(account.id)) return;
50580
+ const model = this.model;
50581
+ if (!await this.#confirmUrl(url)) return;
50582
+ if (!input.isConnected || this.model !== model) return;
50583
+ await this.keep(account, take(input), fields);
50584
+ }
50585
+ #confirmUrl(url) {
50586
+ return confirm({
50587
+ title: `Connect to ${url}?`,
50588
+ body: `SLICC sends this token only to ${url}.`,
50589
+ action: "Connect",
50590
+ variant: "confirmation"
50591
+ });
50592
+ }
50593
+ #mcpUrl(account) {
50594
+ if (account.group !== "mcp" || !this.model?.vault?.endpoints) return null;
50595
+ return this.#baseOf(account.url) ?? null;
50596
+ }
50597
+ #pinned(account) {
50598
+ const server = serverOf(account);
50599
+ return this.model?.vault?.list()?.secrets.find(
50600
+ (secret) => secret.kind === "mcp" && secret.server === server && secret.state !== "removed" && secret.pinned
50601
+ )?.url;
50602
+ }
50603
+ #moved(account) {
50604
+ const url = this.#mcpUrl(account);
50605
+ const old = registrations2()[serverOf(account)] ?? this.#pinned(account);
50606
+ return url && old && old !== url ? url : null;
50607
+ }
50608
+ async #reconnectMcp(account, url) {
50609
+ const model = this.model;
50610
+ const server = serverOf(account);
50611
+ const old = registrations2()[server];
50612
+ if (!await this.#confirmUrl(url)) return;
50613
+ if (this.model !== model) return;
50614
+ this.#busy(account.id, true);
50615
+ this.failure = null;
50616
+ try {
50617
+ await model.vault?.endpoints?.({
50618
+ ...old ? { remove: { mcp: [{ server, url: old }] } } : {},
50619
+ add: { mcp: [{ server, url }] }
50620
+ });
50621
+ register(server, url);
50622
+ } catch (error) {
50623
+ if (this.model === model) this.failure = { id: account.id, message: failureText(error) };
50624
+ return;
50625
+ } finally {
50626
+ this.#busy(account.id, false);
50627
+ }
50628
+ if (this.model === model) await this.connect(account.id);
50629
+ }
50630
+ #movedNote(account) {
50631
+ const url = this.#moved(account);
50632
+ if (!url) return A;
50633
+ return b`<div class="notes"><p class="notice" data-notice="moved"><swc-icon-alert-triangle size="s" aria-hidden="true"></swc-icon-alert-triangle><span>The server moved to ${url}. Reconnect to send the token there.</span></p></div>`;
50634
+ }
50287
50635
  #submitOnEnter(event2) {
50288
50636
  const target2 = event2.target;
50289
50637
  if (event2.key !== "Enter" || target2.localName !== "input") return;
@@ -50483,8 +50831,16 @@ var SliccSettings = class extends ThemedElement {
50483
50831
  if (!await confirm({ title, body: body4, action: "Disconnect", variant: "confirmation" })) return;
50484
50832
  clearValues(this.renderRoot);
50485
50833
  if (this.model !== model) return;
50834
+ const server = serverOf(account);
50835
+ const pinned = !!this.#pinned(account);
50836
+ const url = account.group === "mcp" ? registrations2()[server] ?? (pinned ? null : this.#mcpUrl(account)) : null;
50486
50837
  if (stored && !await this.#forget(account, stored)) return;
50487
- if (this.model === model) model?.settings.disconnect(account.id);
50838
+ if (this.model !== model) return;
50839
+ model?.settings.disconnect(account.id);
50840
+ if (!url || !stored?.endpoints) return;
50841
+ await stored.endpoints({ remove: { mcp: [{ server, url }] } }).then(() => register(server, void 0)).catch((error) => {
50842
+ if (this.model === model) this.failure = { id: account.id, message: failureText(error) };
50843
+ });
50488
50844
  }
50489
50845
  async #forget(account, vault) {
50490
50846
  this.#busy(account.id, true);
@@ -50566,11 +50922,27 @@ var SliccSettings = class extends ThemedElement {
50566
50922
  <span class="provider">${account.provider}</span>
50567
50923
  <span class="identity">${account.identity}${this.#inVault(account) ? b`<span class="kept" data-store="vault">${account.identity ? " \xB7 " : ""}${kept2(account)}</span>` : A}</span>
50568
50924
  <swc-status-light class="state" variant=${variant}>${label}</swc-status-light>
50569
- ${this.#removable(account) ? b`<div class="actions">${this.#action(account)}${this.#removeButton(account)}</div>` : this.#action(account)}
50925
+ ${this.#actions(account)}
50570
50926
  </div>
50571
50927
  ${this.#offered() ? this.#rowNotes(account) : A}
50928
+ ${this.#movedNote(account)}
50572
50929
  ${this.adding?.id === account.id ? A : b`${this.#key(account)}${failure2}`}`;
50573
50930
  }
50931
+ #actions(account) {
50932
+ const moved2 = account.status === "connected" ? this.#moved(account) : null;
50933
+ if (moved2)
50934
+ return b`<div class="actions"><swc-button
50935
+ size="m"
50936
+ variant="accent"
50937
+ data-action="reconnect-mcp"
50938
+ accessible-label=${`Reconnect ${account.provider}`}
50939
+ ?pending=${this.pending.has(account.id)}
50940
+ @click=${() => this.#reconnectMcp(account, moved2)}
50941
+ >Reconnect</swc-button>${this.#action(account)}</div>`;
50942
+ if (this.#removable(account))
50943
+ return b`<div class="actions">${this.#action(account)}${this.#removeButton(account)}</div>`;
50944
+ return this.#action(account);
50945
+ }
50574
50946
  #removable(account) {
50575
50947
  return !!this.#offered() && !!this.model?.settings.remove && account.group !== "mcp";
50576
50948
  }
@@ -51689,9 +52061,9 @@ var SliccValueRequest = class extends ThemedElement {
51689
52061
  #current(queue) {
51690
52062
  return queue.find(({ id }) => id === this.#front) ?? queue.find(({ id }) => !this.#later.has(id)) ?? null;
51691
52063
  }
51692
- #tick(on) {
51693
- if (on && !this.#timer) this.#timer = setInterval(() => this.now = Date.now(), 1e3);
51694
- if (!on && this.#timer) {
52064
+ #tick(on2) {
52065
+ if (on2 && !this.#timer) this.#timer = setInterval(() => this.now = Date.now(), 1e3);
52066
+ if (!on2 && this.#timer) {
51695
52067
  clearInterval(this.#timer);
51696
52068
  this.#timer = null;
51697
52069
  }
@@ -60741,7 +61113,7 @@ function createColorPalette(namedColorsMap = defaultNamedColorsMap) {
60741
61113
  if (colorTable) return colorTable;
60742
61114
  colorTable = [];
60743
61115
  for (let i26 = 0; i26 < namedColors.length; i26++) colorTable.push(namedColor(namedColors[i26]));
60744
- let levels = [
61116
+ let levels2 = [
60745
61117
  0,
60746
61118
  95,
60747
61119
  135,
@@ -60750,9 +61122,9 @@ function createColorPalette(namedColorsMap = defaultNamedColorsMap) {
60750
61122
  255
60751
61123
  ];
60752
61124
  for (let r40 = 0; r40 < 6; r40++) for (let g7 = 0; g7 < 6; g7++) for (let b13 = 0; b13 < 6; b13++) colorTable.push(rgbColor([
60753
- levels[r40],
60754
- levels[g7],
60755
- levels[b13]
61125
+ levels2[r40],
61126
+ levels2[g7],
61127
+ levels2[b13]
60756
61128
  ]));
60757
61129
  let level = 8;
60758
61130
  for (let i26 = 0; i26 < 24; i26++, level += 10) colorTable.push(rgbColor([
@@ -63082,9 +63454,9 @@ var FirstPassVisitor = {
63082
63454
  },
63083
63455
  exit({ node: node2 }, { flagDirectivesByAlt }) {
63084
63456
  if (flagDirectivesByAlt.get(node2)?.length) {
63085
- const flags = getCombinedFlagModsFromFlagNodes(flagDirectivesByAlt.get(node2));
63086
- if (flags) {
63087
- const flagGroup = A8({ flags });
63457
+ const flags2 = getCombinedFlagModsFromFlagNodes(flagDirectivesByAlt.get(node2));
63458
+ if (flags2) {
63459
+ const flagGroup = A8({ flags: flags2 });
63088
63460
  flagGroup.body[0].body = node2.body;
63089
63461
  node2.body = [setParentDeep(flagGroup, node2)];
63090
63462
  }
@@ -63220,12 +63592,12 @@ var FirstPassVisitor = {
63220
63592
  }
63221
63593
  },
63222
63594
  Directive({ node: node2, parent, root: root2, remove: remove2, replaceWith, removeAllPrevSiblings, removeAllNextSiblings }) {
63223
- const { kind, flags } = node2;
63595
+ const { kind, flags: flags2 } = node2;
63224
63596
  if (kind === "flags") {
63225
- if (!flags.enable && !flags.disable) {
63597
+ if (!flags2.enable && !flags2.disable) {
63226
63598
  remove2();
63227
63599
  } else {
63228
- const flagGroup = A8({ flags });
63600
+ const flagGroup = A8({ flags: flags2 });
63229
63601
  flagGroup.body[0].body = removeAllNextSiblings();
63230
63602
  replaceWith(setParentDeep(flagGroup, parent), { traverse: true });
63231
63603
  }
@@ -63605,13 +63977,13 @@ function getAndStoreJsGroupName(name, map) {
63605
63977
  function getCombinedFlagModsFromFlagNodes(flagNodes) {
63606
63978
  const flagProps = ["dotAll", "ignoreCase"];
63607
63979
  const combinedFlags = { enable: {}, disable: {} };
63608
- flagNodes.forEach(({ flags }) => {
63980
+ flagNodes.forEach(({ flags: flags2 }) => {
63609
63981
  flagProps.forEach((prop) => {
63610
- if (flags.enable?.[prop]) {
63982
+ if (flags2.enable?.[prop]) {
63611
63983
  delete combinedFlags.disable[prop];
63612
63984
  combinedFlags.enable[prop] = true;
63613
63985
  }
63614
- if (flags.disable?.[prop]) {
63986
+ if (flags2.disable?.[prop]) {
63615
63987
  combinedFlags.disable[prop] = true;
63616
63988
  }
63617
63989
  });
@@ -63998,8 +64370,8 @@ var generator = {
63998
64370
  const extraChars = /* @__PURE__ */ new Set();
63999
64371
  if (state2.useAppliedIgnoreCase && state2.currentFlags.ignoreCase) {
64000
64372
  const charsOutsideRange = getCasesOutsideCharClassRange(node2);
64001
- const ranges = getCodePointRangesFromChars(charsOutsideRange);
64002
- ranges.forEach((value) => {
64373
+ const ranges2 = getCodePointRangesFromChars(charsOutsideRange);
64374
+ ranges2.forEach((value) => {
64003
64375
  extraChars.add(
64004
64376
  Array.isArray(value) ? `${getCharEscape(value[0], escOpts)}-${getCharEscape(value[1], escOpts)}` : getCharEscape(value, escOpts)
64005
64377
  );
@@ -64047,14 +64419,14 @@ var generator = {
64047
64419
  /**
64048
64420
  @param {GroupNode} node
64049
64421
  */
64050
- Group({ atomic: atomic2, body: body4, flags, parent }, state2, gen) {
64422
+ Group({ atomic: atomic2, body: body4, flags: flags2, parent }, state2, gen) {
64051
64423
  const currentFlags = state2.currentFlags;
64052
- if (flags) {
64053
- state2.currentFlags = getNewCurrentFlags(currentFlags, flags);
64424
+ if (flags2) {
64425
+ state2.currentFlags = getNewCurrentFlags(currentFlags, flags2);
64054
64426
  }
64055
64427
  const contents = body4.map(gen).join("|");
64056
64428
  const result = !state2.verbose && body4.length === 1 && // Single alt
64057
- parent.type !== "Quantifier" && !atomic2 && (!state2.useFlagMods || !flags) ? contents : `(?${getGroupPrefix(atomic2, flags, state2.useFlagMods)}${contents})`;
64429
+ parent.type !== "Quantifier" && !atomic2 && (!state2.useFlagMods || !flags2) ? contents : `(?${getGroupPrefix(atomic2, flags2, state2.useFlagMods)}${contents})`;
64058
64430
  state2.currentFlags = currentFlags;
64059
64431
  return result;
64060
64432
  },
@@ -64302,14 +64674,14 @@ var EmulatedRegExp = class _EmulatedRegExp extends RegExp {
64302
64674
  @param {EmulatedRegExp} pattern
64303
64675
  @param {string} [flags]
64304
64676
  */
64305
- constructor(pattern2, flags, options2) {
64677
+ constructor(pattern2, flags2, options2) {
64306
64678
  const lazyCompile = !!options2?.lazyCompile;
64307
64679
  if (pattern2 instanceof RegExp) {
64308
64680
  if (options2) {
64309
64681
  throw new Error("Cannot provide options when copying a regexp");
64310
64682
  }
64311
64683
  const re3 = pattern2;
64312
- super(re3, flags);
64684
+ super(re3, flags2);
64313
64685
  this.#pattern = re3.source;
64314
64686
  if (re3 instanceof _EmulatedRegExp) {
64315
64687
  this.#captureMap = re3.#captureMap;
@@ -64324,7 +64696,7 @@ var EmulatedRegExp = class _EmulatedRegExp extends RegExp {
64324
64696
  transfers: [],
64325
64697
  ...options2
64326
64698
  };
64327
- super(lazyCompile ? "" : pattern2, flags);
64699
+ super(lazyCompile ? "" : pattern2, flags2);
64328
64700
  this.#pattern = pattern2;
64329
64701
  this.#captureMap = createCaptureMap(opts.hiddenCaptures, opts.transfers);
64330
64702
  this.#strategy = opts.strategy;
@@ -67619,8 +67991,8 @@ function relativeLuminance(color2) {
67619
67991
  const r40 = rgba[0] / 255;
67620
67992
  const g7 = rgba[1] / 255;
67621
67993
  const b13 = rgba[2] / 255;
67622
- const channel = (v13) => v13 <= 0.03928 ? v13 / 12.92 : ((v13 + 0.055) / 1.055) ** 2.4;
67623
- return 0.2126 * channel(r40) + 0.7152 * channel(g7) + 0.0722 * channel(b13);
67994
+ const channel2 = (v13) => v13 <= 0.03928 ? v13 / 12.92 : ((v13 + 0.055) / 1.055) ** 2.4;
67995
+ return 0.2126 * channel2(r40) + 0.7152 * channel2(g7) + 0.0722 * channel2(b13);
67624
67996
  }
67625
67997
  function isFullyTransparent(color2) {
67626
67998
  if (color2 == null) return false;
@@ -71957,7 +72329,7 @@ function isAdditionLineRenderable({ fileDiff, lineNumber, expandedHunks, collaps
71957
72329
  }
71958
72330
  function getNearestRenderableAdditionLine({ fileDiff, lineNumber, direction, expandedHunks, collapsedContextThreshold }) {
71959
72331
  if (expandedHunks === true || fileDiff.isPartial) return lineNumber;
71960
- const ranges = [];
72332
+ const ranges2 = [];
71961
72333
  let modeledEnd = 1;
71962
72334
  for (const [hunkIndex, hunk] of fileDiff.hunks.entries()) {
71963
72335
  const [hunkStart, hunkEnd] = getHunkAdditionLineRange(hunk);
@@ -71969,12 +72341,12 @@ function getNearestRenderableAdditionLine({ fileDiff, lineNumber, direction, exp
71969
72341
  collapsedContextThreshold
71970
72342
  });
71971
72343
  const gapStart = hunkStart - region.rangeSize;
71972
- if (region.renderAll) ranges.push([gapStart, hunkStart]);
72344
+ if (region.renderAll) ranges2.push([gapStart, hunkStart]);
71973
72345
  else {
71974
- if (region.fromStart > 0) ranges.push([gapStart, gapStart + region.fromStart]);
71975
- if (region.fromEnd > 0) ranges.push([hunkStart - region.fromEnd, hunkStart]);
72346
+ if (region.fromStart > 0) ranges2.push([gapStart, gapStart + region.fromStart]);
72347
+ if (region.fromEnd > 0) ranges2.push([hunkStart - region.fromEnd, hunkStart]);
71976
72348
  }
71977
- ranges.push([hunkStart, hunkEnd]);
72349
+ ranges2.push([hunkStart, hunkEnd]);
71978
72350
  modeledEnd = hunkEnd;
71979
72351
  }
71980
72352
  const trailingRegion = getTrailingExpandedRegion({
@@ -71987,16 +72359,16 @@ function getNearestRenderableAdditionLine({ fileDiff, lineNumber, direction, exp
71987
72359
  if (trailingRegion != null) {
71988
72360
  const trailingStart = modeledEnd;
71989
72361
  modeledEnd = trailingStart + trailingRegion.rangeSize;
71990
- if (trailingRegion.renderAll) ranges.push([trailingStart, modeledEnd]);
71991
- else if (trailingRegion.fromStart > 0) ranges.push([trailingStart, trailingStart + trailingRegion.fromStart]);
72362
+ if (trailingRegion.renderAll) ranges2.push([trailingStart, modeledEnd]);
72363
+ else if (trailingRegion.fromStart > 0) ranges2.push([trailingStart, trailingStart + trailingRegion.fromStart]);
71992
72364
  }
71993
72365
  if (lineNumber >= modeledEnd) return lineNumber;
71994
72366
  if (direction === "down") {
71995
- for (const [start2, end] of ranges) if (end > lineNumber) return Math.max(start2, lineNumber);
72367
+ for (const [start2, end] of ranges2) if (end > lineNumber) return Math.max(start2, lineNumber);
71996
72368
  return;
71997
72369
  }
71998
- for (let index2 = ranges.length - 1; index2 >= 0; index2--) {
71999
- const [start2, end] = ranges[index2];
72370
+ for (let index2 = ranges2.length - 1; index2 >= 0; index2--) {
72371
+ const [start2, end] = ranges2[index2];
72000
72372
  if (start2 <= lineNumber) return Math.min(end - 1, lineNumber);
72001
72373
  }
72002
72374
  }
@@ -72358,19 +72730,19 @@ function getHunkPrefixCounts({ diff, expandedHunks, collapsedContextThreshold })
72358
72730
  }
72359
72731
  function getContextLineIterationBounds(state2, count2, diffStyle) {
72360
72732
  if (!state2.isWindowedHighlight || count2 <= 0) return [0, count2];
72361
- const ranges = [];
72733
+ const ranges2 = [];
72362
72734
  function pushRange(currentCount) {
72363
72735
  const start3 = Math.max(0, state2.viewportStart - currentCount);
72364
72736
  const end2 = Math.min(count2, state2.viewportEnd - currentCount);
72365
- if (end2 > start3) ranges.push([start3, end2]);
72737
+ if (end2 > start3) ranges2.push([start3, end2]);
72366
72738
  }
72367
72739
  if (diffStyle !== "split") pushRange(state2.unifiedCount);
72368
72740
  if (diffStyle !== "unified") pushRange(state2.splitCount);
72369
- if (ranges.length === 0) return [0, 0];
72370
- let start2 = ranges[0][0];
72371
- let end = ranges[0][1];
72372
- for (let index2 = 1; index2 < ranges.length; index2++) {
72373
- const range3 = ranges[index2];
72741
+ if (ranges2.length === 0) return [0, 0];
72742
+ let start2 = ranges2[0][0];
72743
+ let end = ranges2[0][1];
72744
+ for (let index2 = 1; index2 < ranges2.length; index2++) {
72745
+ const range3 = ranges2[index2];
72374
72746
  start2 = Math.min(start2, range3[0]);
72375
72747
  end = Math.max(end, range3[1]);
72376
72748
  }
@@ -89323,15 +89695,15 @@ function buildColorPicker(tabGroup, palette) {
89323
89695
  wrapper.className = "dv-context-menu-color-picker";
89324
89696
  if (!palette.enabled) return wrapper;
89325
89697
  for (const entry of palette.entries()) {
89326
- const swatch = document.createElement("div");
89327
- swatch.className = "dv-context-menu-color-swatch";
89328
- swatch.style.setProperty("--dv-tab-group-color", entry.value);
89329
- if (entry.label) swatch.title = entry.label;
89330
- if (tabGroup.color === entry.id) swatch.classList.add("dv-context-menu-color-swatch--selected");
89331
- swatch.addEventListener("click", () => {
89698
+ const swatch2 = document.createElement("div");
89699
+ swatch2.className = "dv-context-menu-color-swatch";
89700
+ swatch2.style.setProperty("--dv-tab-group-color", entry.value);
89701
+ if (entry.label) swatch2.title = entry.label;
89702
+ if (tabGroup.color === entry.id) swatch2.classList.add("dv-context-menu-color-swatch--selected");
89703
+ swatch2.addEventListener("click", () => {
89332
89704
  tabGroup.setColor(entry.id);
89333
89705
  });
89334
- wrapper.appendChild(swatch);
89706
+ wrapper.appendChild(swatch2);
89335
89707
  }
89336
89708
  return wrapper;
89337
89709
  }
@@ -89854,7 +90226,7 @@ function createDismissableLayer(options2) {
89854
90226
  var _options$window, _options$capture, _options$escape, _options$keys, _options$outsidePoint, _options$pointerDownG, _options$now;
89855
90227
  const win = (_options$window = options2.window) !== null && _options$window !== void 0 ? _options$window : window;
89856
90228
  const capture = (_options$capture = options2.capture) !== null && _options$capture !== void 0 ? _options$capture : false;
89857
- const escape2 = (_options$escape = options2.escape) !== null && _options$escape !== void 0 ? _options$escape : true;
90229
+ const escape3 = (_options$escape = options2.escape) !== null && _options$escape !== void 0 ? _options$escape : true;
89858
90230
  const keys = (_options$keys = options2.keys) !== null && _options$keys !== void 0 ? _options$keys : [];
89859
90231
  const outside2 = (_options$outsidePoint = options2.outsidePointerDown) !== null && _options$outsidePoint !== void 0 ? _options$outsidePoint : true;
89860
90232
  const grace = (_options$pointerDownG = options2.pointerDownGraceMs) !== null && _options$pointerDownG !== void 0 ? _options$pointerDownG : 0;
@@ -89866,8 +90238,8 @@ function createDismissableLayer(options2) {
89866
90238
  if (options2.isInside) return options2.isInside(event2);
89867
90239
  return isEventWithin(event2, (_options$elements = (_options$elements2 = options2.elements) === null || _options$elements2 === void 0 ? void 0 : _options$elements2.call(options2)) !== null && _options$elements !== void 0 ? _options$elements : []);
89868
90240
  };
89869
- if (escape2 || keys.length > 0) disposables.addDisposables(addDisposableListener(win, "keydown", (event2) => {
89870
- if (escape2 && event2.key === "Escape" || keys.includes(event2.key)) options2.onDismiss();
90241
+ if (escape3 || keys.length > 0) disposables.addDisposables(addDisposableListener(win, "keydown", (event2) => {
90242
+ if (escape3 && event2.key === "Escape" || keys.includes(event2.key)) options2.onDismiss();
89871
90243
  }, capture));
89872
90244
  if (outside2 || options2.onInsidePointerDown) disposables.addDisposables(addDisposableListener(win, "pointerdown", (event2) => {
89873
90245
  if (isInside(event2)) {