@nine-lab/nine-mu 0.1.176 → 0.1.177

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/nine-mu.js CHANGED
@@ -1056,12 +1056,12 @@ const $ZodType = /* @__PURE__ */ $constructor("$ZodType", (inst, def) => {
1056
1056
  validate: (value) => {
1057
1057
  var _a4;
1058
1058
  try {
1059
- const r2 = safeParse$2(inst, value);
1060
- return r2.success ? { value: r2.data } : { issues: (_a4 = r2.error) == null ? void 0 : _a4.issues };
1059
+ const r = safeParse$2(inst, value);
1060
+ return r.success ? { value: r.data } : { issues: (_a4 = r.error) == null ? void 0 : _a4.issues };
1061
1061
  } catch (_) {
1062
- return safeParseAsync$1(inst, value).then((r2) => {
1062
+ return safeParseAsync$1(inst, value).then((r) => {
1063
1063
  var _a5;
1064
- return r2.success ? { value: r2.data } : { issues: (_a5 = r2.error) == null ? void 0 : _a5.issues };
1064
+ return r.success ? { value: r.data } : { issues: (_a5 = r.error) == null ? void 0 : _a5.issues };
1065
1065
  });
1066
1066
  }
1067
1067
  },
@@ -1629,14 +1629,14 @@ const $ZodObject = /* @__PURE__ */ $constructor("$ZodObject", (inst, def) => {
1629
1629
  const shape = value.shape;
1630
1630
  for (const key of value.keys) {
1631
1631
  const el = shape[key];
1632
- const r2 = el._zod.run({ value: input[key], issues: [] }, ctx);
1632
+ const r = el._zod.run({ value: input[key], issues: [] }, ctx);
1633
1633
  const isOptional = el._zod.optin === "optional" && el._zod.optout === "optional";
1634
- if (r2 instanceof Promise) {
1635
- proms.push(r2.then((r3) => isOptional ? handleOptionalObjectResult(r3, payload, key, input) : handleObjectResult(r3, payload, key)));
1634
+ if (r instanceof Promise) {
1635
+ proms.push(r.then((r2) => isOptional ? handleOptionalObjectResult(r2, payload, key, input) : handleObjectResult(r2, payload, key)));
1636
1636
  } else if (isOptional) {
1637
- handleOptionalObjectResult(r2, payload, key, input);
1637
+ handleOptionalObjectResult(r, payload, key, input);
1638
1638
  } else {
1639
- handleObjectResult(r2, payload, key);
1639
+ handleObjectResult(r, payload, key);
1640
1640
  }
1641
1641
  }
1642
1642
  }
@@ -1654,11 +1654,11 @@ const $ZodObject = /* @__PURE__ */ $constructor("$ZodObject", (inst, def) => {
1654
1654
  unrecognized.push(key);
1655
1655
  continue;
1656
1656
  }
1657
- const r2 = _catchall.run({ value: input[key], issues: [] }, ctx);
1658
- if (r2 instanceof Promise) {
1659
- proms.push(r2.then((r3) => handleObjectResult(r3, payload, key)));
1657
+ const r = _catchall.run({ value: input[key], issues: [] }, ctx);
1658
+ if (r instanceof Promise) {
1659
+ proms.push(r.then((r2) => handleObjectResult(r2, payload, key)));
1660
1660
  } else {
1661
- handleObjectResult(r2, payload, key);
1661
+ handleObjectResult(r, payload, key);
1662
1662
  }
1663
1663
  }
1664
1664
  if (unrecognized.length) {
@@ -2197,11 +2197,11 @@ const $ZodCustom = /* @__PURE__ */ $constructor("$ZodCustom", (inst, def) => {
2197
2197
  };
2198
2198
  inst._zod.check = (payload) => {
2199
2199
  const input = payload.value;
2200
- const r2 = def.fn(input);
2201
- if (r2 instanceof Promise) {
2202
- return r2.then((r3) => handleRefineResult(r3, payload, input, inst));
2200
+ const r = def.fn(input);
2201
+ if (r instanceof Promise) {
2202
+ return r.then((r2) => handleRefineResult(r2, payload, input, inst));
2203
2203
  }
2204
- handleRefineResult(r2, payload, input, inst);
2204
+ handleRefineResult(r, payload, input, inst);
2205
2205
  return;
2206
2206
  };
2207
2207
  });
@@ -5265,7 +5265,7 @@ class Protocol {
5265
5265
  }
5266
5266
  await this.notification(notification, notificationOptions);
5267
5267
  },
5268
- sendRequest: async (r2, resultSchema, options) => {
5268
+ sendRequest: async (r, resultSchema, options) => {
5269
5269
  var _a3;
5270
5270
  if (abortController.signal.aborted) {
5271
5271
  throw new McpError(ErrorCode.ConnectionClosed, "Request was cancelled");
@@ -5278,7 +5278,7 @@ class Protocol {
5278
5278
  if (effectiveTaskId && taskStore) {
5279
5279
  await taskStore.updateTaskStatus(effectiveTaskId, "input_required");
5280
5280
  }
5281
- return await this.request(r2, resultSchema, requestOptions);
5281
+ return await this.request(r, resultSchema, requestOptions);
5282
5282
  },
5283
5283
  authInfo: extra == null ? void 0 : extra.authInfo,
5284
5284
  requestId: request.id,
@@ -13514,6 +13514,7 @@ class NineChatManager {
13514
13514
  __privateAdd(this, _routeUrl);
13515
13515
  __publicField(this, "handleChatSubmit", async (el) => {
13516
13516
  const routes = __privateMethod(this, _NineChatManager_instances, getRoutes_fn).call(this);
13517
+ trace.log(routes);
13517
13518
  return await __privateMethod(this, _NineChatManager_instances, callTool_fn).call(this, "system-brain", {
13518
13519
  user_input: el.value.trim(),
13519
13520
  routes,
@@ -13593,8 +13594,8 @@ connect_fn = async function() {
13593
13594
  });
13594
13595
  };
13595
13596
  fetchRoutes_fn = async function() {
13596
- const r2 = await fetch("/admin/prompts/data/routes.json");
13597
- return r2.ok ? await r2.json() : [];
13597
+ const r = await fetch("/admin/prompts/data/routes.json");
13598
+ return r.ok ? await r.json() : [];
13598
13599
  };
13599
13600
  pushMessage_fn = function(role, content2, result = null) {
13600
13601
  var _a2;
@@ -13616,10 +13617,9 @@ callTool_fn = async function(toolName, args = {}) {
13616
13617
  return __privateGet(this, _mcpClient).callTool({ name: toolName, arguments: args });
13617
13618
  };
13618
13619
  getRoutes_fn = async function(toolName, args = {}) {
13619
- console.log(__privateGet(this, _routeUrl));
13620
13620
  const res = await fetch(__privateGet(this, _routeUrl));
13621
13621
  if (!res.ok) {
13622
- throw new Error(`HTTP error! status: ${r.status}`);
13622
+ throw new Error(`HTTP error! status: ${res.status}`);
13623
13623
  }
13624
13624
  return await res.json();
13625
13625
  };
@@ -13830,7 +13830,7 @@ render_fn = function() {
13830
13830
  const customImport = this.getAttribute("css-path") ? `@import "${this.getAttribute("css-path")}";` : "";
13831
13831
  this.shadowRoot.innerHTML = `
13832
13832
  <style>
13833
- @import "https://cdn.jsdelivr.net/npm/@nine-lab/nine-mu@${"0.1.175"}/dist/css/nine-mu.css";
13833
+ @import "https://cdn.jsdelivr.net/npm/@nine-lab/nine-mu@${"0.1.176"}/dist/css/nine-mu.css";
13834
13834
  ${customImport}
13835
13835
  </style>
13836
13836
  <div class="wrapper">
@@ -15231,7 +15231,7 @@ class EditorSelection {
15231
15231
  map(change, assoc = -1) {
15232
15232
  if (change.empty)
15233
15233
  return this;
15234
- return EditorSelection.create(this.ranges.map((r2) => r2.map(change, assoc)), this.mainIndex);
15234
+ return EditorSelection.create(this.ranges.map((r) => r.map(change, assoc)), this.mainIndex);
15235
15235
  }
15236
15236
  /**
15237
15237
  Compare this selection to another selection. By default, ranges
@@ -15282,7 +15282,7 @@ class EditorSelection {
15282
15282
  JSON.
15283
15283
  */
15284
15284
  toJSON() {
15285
- return { ranges: this.ranges.map((r2) => r2.toJSON()), main: this.mainIndex };
15285
+ return { ranges: this.ranges.map((r) => r.toJSON()), main: this.mainIndex };
15286
15286
  }
15287
15287
  /**
15288
15288
  Create a selection from a JSON representation.
@@ -15290,7 +15290,7 @@ class EditorSelection {
15290
15290
  static fromJSON(json) {
15291
15291
  if (!json || !Array.isArray(json.ranges) || typeof json.main != "number" || json.main >= json.ranges.length)
15292
15292
  throw new RangeError("Invalid JSON representation for EditorSelection");
15293
- return new EditorSelection(json.ranges.map((r2) => SelectionRange.fromJSON(r2)), json.main);
15293
+ return new EditorSelection(json.ranges.map((r) => SelectionRange.fromJSON(r)), json.main);
15294
15294
  }
15295
15295
  /**
15296
15296
  Create a selection holding a single range.
@@ -18305,9 +18305,9 @@ const LowTypes = /* @__PURE__ */ dec("888888888888888888888888888888888886668888
18305
18305
  const ArabicTypes = /* @__PURE__ */ dec("4444448826627288999999999992222222222222222222222222222222222222222222222229999999999999999999994444444444644222822222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222999999949999999229989999223333333333");
18306
18306
  const Brackets = /* @__PURE__ */ Object.create(null), BracketStack = [];
18307
18307
  for (let p of ["()", "[]", "{}"]) {
18308
- let l = /* @__PURE__ */ p.charCodeAt(0), r2 = /* @__PURE__ */ p.charCodeAt(1);
18309
- Brackets[l] = r2;
18310
- Brackets[r2] = -l;
18308
+ let l = /* @__PURE__ */ p.charCodeAt(0), r = /* @__PURE__ */ p.charCodeAt(1);
18309
+ Brackets[l] = r;
18310
+ Brackets[r] = -l;
18311
18311
  }
18312
18312
  function charType(ch) {
18313
18313
  return ch <= 247 ? LowTypes[ch] : 1424 <= ch && ch <= 1524 ? 2 : 1536 <= ch && ch <= 1785 ? ArabicTypes[ch - 1536] : 1774 <= ch && ch <= 2220 ? 4 : 8192 <= ch && ch <= 8204 ? 256 : 64336 <= ch && ch <= 65023 ? 4 : 1;
@@ -19392,7 +19392,7 @@ class TextTile extends Tile {
19392
19392
  return null;
19393
19393
  let rect = rects[(flatten2 ? flatten2 < 0 : side >= 0) ? 0 : rects.length - 1];
19394
19394
  if (browser.safari && !flatten2 && rect.width == 0)
19395
- rect = Array.prototype.find.call(rects, (r2) => r2.width) || rect;
19395
+ rect = Array.prototype.find.call(rects, (r) => r.width) || rect;
19396
19396
  return flatten2 ? flattenRect(rect, flatten2 < 0) : rect || null;
19397
19397
  }
19398
19398
  static of(text, dom) {
@@ -20252,7 +20252,7 @@ class DocView {
20252
20252
  let blockDiff = findChangedWrappers(prevWrappers, this.blockWrappers, update.changes);
20253
20253
  if (blockDiff.length)
20254
20254
  changedRanges = ChangedRange.extendWithRanges(changedRanges, blockDiff);
20255
- if (composition && !changedRanges.some((r2) => r2.fromA <= composition.range.fromA && r2.toA >= composition.range.toA))
20255
+ if (composition && !changedRanges.some((r) => r.fromA <= composition.range.fromA && r.toA >= composition.range.toA))
20256
20256
  changedRanges = composition.range.addToSet(changedRanges.slice());
20257
20257
  if (this.tile.flags & 2 && changedRanges.length == 0) {
20258
20258
  return false;
@@ -20720,9 +20720,9 @@ class DocView {
20720
20720
  }
20721
20721
  }
20722
20722
  function destroyDropped(tile, reused) {
20723
- let r2 = reused === null || reused === void 0 ? void 0 : reused.get(tile);
20724
- if (r2 != 1) {
20725
- if (r2 == null)
20723
+ let r = reused === null || reused === void 0 ? void 0 : reused.get(tile);
20724
+ if (r != 1) {
20725
+ if (r == null)
20726
20726
  tile.destroy();
20727
20727
  for (let ch of tile.children)
20728
20728
  destroyDropped(ch, reused);
@@ -21969,7 +21969,7 @@ function doPaste(view, input) {
21969
21969
  input = textFilter(view.state, clipboardInputFilter, input);
21970
21970
  let { state } = view, changes, i = 1, text = state.toText(input);
21971
21971
  let byLine = text.lines == state.selection.ranges.length;
21972
- let linewise = lastLinewiseCopy != null && state.selection.ranges.every((r2) => r2.empty) && lastLinewiseCopy == text.toString();
21972
+ let linewise = lastLinewiseCopy != null && state.selection.ranges.every((r) => r.empty) && lastLinewiseCopy == text.toString();
21973
21973
  if (linewise) {
21974
21974
  let lastLine = -1;
21975
21975
  changes = state.changeByRange((range) => {
@@ -22336,8 +22336,8 @@ handlers.beforeinput = (view, event) => {
22336
22336
  if (event.inputType == "insertReplacementText" && view.observer.editContext) {
22337
22337
  let text = (_a2 = event.dataTransfer) === null || _a2 === void 0 ? void 0 : _a2.getData("text/plain"), ranges = event.getTargetRanges();
22338
22338
  if (text && ranges.length) {
22339
- let r2 = ranges[0];
22340
- let from = view.posAtDOM(r2.startContainer, r2.startOffset), to = view.posAtDOM(r2.endContainer, r2.endOffset);
22339
+ let r = ranges[0];
22340
+ let from = view.posAtDOM(r.startContainer, r.startOffset), to = view.posAtDOM(r.endContainer, r.endOffset);
22341
22341
  applyDOMChangeInner(view, { from, to, insert: view.state.toText(text) }, null);
22342
22342
  return true;
22343
22343
  }
@@ -23468,7 +23468,7 @@ class ViewState {
23468
23468
  }
23469
23469
  let gap = find(current, (gap2) => gap2.from >= line.from && gap2.to <= line.to && Math.abs(gap2.from - from) < halfMargin && Math.abs(gap2.to - to) < halfMargin && !avoid.some((pos) => gap2.from < pos && gap2.to > pos));
23470
23470
  if (!gap) {
23471
- if (to < line.to && mayMeasure && wrapping && mayMeasure.visibleRanges.some((r2) => r2.from <= to && r2.to >= to)) {
23471
+ if (to < line.to && mayMeasure && wrapping && mayMeasure.visibleRanges.some((r) => r.from <= to && r.to >= to)) {
23472
23472
  let lineStart = mayMeasure.moveToLineBoundary(EditorSelection.cursor(to), false, true).head;
23473
23473
  if (lineStart > from)
23474
23474
  to = lineStart;
@@ -25983,9 +25983,9 @@ function rectanglesForRange(view, className, range) {
25983
25983
  horizontal.push(!ltr && toOpen ? leftSide : toCoords.left, !ltr && fromOpen ? rightSide : fromCoords.right);
25984
25984
  }
25985
25985
  let start = from2 !== null && from2 !== void 0 ? from2 : line.from, end = to2 !== null && to2 !== void 0 ? to2 : line.to;
25986
- for (let r2 of view.visibleRanges)
25987
- if (r2.to > start && r2.from < end) {
25988
- for (let pos = Math.max(r2.from, start), endPos = Math.min(r2.to, end); ; ) {
25986
+ for (let r of view.visibleRanges)
25987
+ if (r.to > start && r.from < end) {
25988
+ for (let pos = Math.max(r.from, start), endPos = Math.min(r.to, end); ; ) {
25989
25989
  let docLine = view.state.doc.lineAt(pos);
25990
25990
  for (let span of view.bidiSpans(docLine)) {
25991
25991
  let spanFrom = span.from + docLine.from, spanTo = span.to + docLine.from;
@@ -26124,11 +26124,11 @@ const cursorLayer = /* @__PURE__ */ layer({
26124
26124
  markers(view) {
26125
26125
  let { state } = view, conf = state.facet(selectionConfig);
26126
26126
  let cursors = [];
26127
- for (let r2 of state.selection.ranges) {
26128
- let prim = r2 == state.selection.main;
26129
- if (r2.empty || conf.drawRangeCursor && !(prim && browser.ios && conf.iosSelectionHandles)) {
26127
+ for (let r of state.selection.ranges) {
26128
+ let prim = r == state.selection.main;
26129
+ if (r.empty || conf.drawRangeCursor && !(prim && browser.ios && conf.iosSelectionHandles)) {
26130
26130
  let className = prim ? "cm-cursor cm-cursor-primary" : "cm-cursor cm-cursor-secondary";
26131
- let cursor = r2.empty ? r2 : EditorSelection.cursor(r2.head, r2.assoc);
26131
+ let cursor = r.empty ? r : EditorSelection.cursor(r.head, r.assoc);
26132
26132
  for (let piece of RectangleMarker.forRange(view, className, cursor))
26133
26133
  cursors.push(piece);
26134
26134
  }
@@ -26155,9 +26155,9 @@ const selectionLayer = /* @__PURE__ */ layer({
26155
26155
  above: false,
26156
26156
  markers(view) {
26157
26157
  let markers = [], { main, ranges } = view.state.selection;
26158
- for (let r2 of ranges)
26159
- if (!r2.empty) {
26160
- for (let marker of RectangleMarker.forRange(view, "cm-selectionBackground", r2))
26158
+ for (let r of ranges)
26159
+ if (!r.empty) {
26160
+ for (let marker of RectangleMarker.forRange(view, "cm-selectionBackground", r))
26161
26161
  markers.push(marker);
26162
26162
  }
26163
26163
  if (browser.ios && !main.empty && view.state.facet(selectionConfig).iosSelectionHandles) {
@@ -26359,11 +26359,11 @@ class MatchDecorator {
26359
26359
  return deco;
26360
26360
  }
26361
26361
  updateRange(view, deco, updateFrom, updateTo) {
26362
- for (let r2 of view.visibleRanges) {
26363
- let from = Math.max(r2.from, updateFrom), to = Math.min(r2.to, updateTo);
26362
+ for (let r of view.visibleRanges) {
26363
+ let from = Math.max(r.from, updateFrom), to = Math.min(r.to, updateTo);
26364
26364
  if (to >= from) {
26365
26365
  let fromLine = view.state.doc.lineAt(from), toLine = fromLine.to < to ? view.state.doc.lineAt(to) : fromLine;
26366
- let start = Math.max(r2.from, fromLine.from), end = Math.min(r2.to, toLine.to);
26366
+ let start = Math.max(r.from, fromLine.from), end = Math.min(r.to, toLine.to);
26367
26367
  if (this.boundary) {
26368
26368
  for (; from > fromLine.from; from--)
26369
26369
  if (this.boundary.test(fromLine.text[from - 1 - fromLine.from])) {
@@ -26550,8 +26550,8 @@ const activeLineHighlighter = /* @__PURE__ */ ViewPlugin.fromClass(class {
26550
26550
  }
26551
26551
  getDeco(view) {
26552
26552
  let lastLineStart = -1, deco = [];
26553
- for (let r2 of view.state.selection.ranges) {
26554
- let line = view.lineBlockAt(r2.head);
26553
+ for (let r of view.state.selection.ranges) {
26554
+ let line = view.lineBlockAt(r.head);
26555
26555
  if (line.from > lastLineStart) {
26556
26556
  deco.push(lineDeco.range(line.from));
26557
26557
  lastLineStart = line.from;
@@ -26829,9 +26829,9 @@ const tooltipPlugin = /* @__PURE__ */ ViewPlugin.fromClass(class {
26829
26829
  let top2 = above ? pos.top - height - arrowHeight - offset.y : pos.bottom + arrowHeight + offset.y;
26830
26830
  let right = left + width;
26831
26831
  if (tView.overlap !== true) {
26832
- for (let r2 of others)
26833
- if (r2.left < right && r2.right > left && r2.top < top2 + height && r2.bottom > top2)
26834
- top2 = above ? r2.top - height - 2 - arrowHeight : r2.bottom + arrowHeight + 2;
26832
+ for (let r of others)
26833
+ if (r.left < right && r.right > left && r.top < top2 + height && r.bottom > top2)
26834
+ top2 = above ? r.top - height - 2 - arrowHeight : r.bottom + arrowHeight + 2;
26835
26835
  }
26836
26836
  if (this.position == "absolute") {
26837
26837
  dom.style.top = (top2 - measured.parent.top) / scaleY + "px";
@@ -27411,7 +27411,7 @@ const showPanel = /* @__PURE__ */ Facet.define({
27411
27411
  });
27412
27412
  function showDialog(view, config2) {
27413
27413
  let resolve2;
27414
- let promise = new Promise((r2) => resolve2 = r2);
27414
+ let promise = new Promise((r) => resolve2 = r);
27415
27415
  let panelCtor = (view2) => createDialog(view2, config2, resolve2);
27416
27416
  if (view.state.field(dialogField, false)) {
27417
27417
  view.dispatch({ effects: openDialogEffect.of(panelCtor) });
@@ -28488,8 +28488,8 @@ class BaseNode {
28488
28488
  return new TreeCursor(this, mode);
28489
28489
  }
28490
28490
  getChild(type2, before = null, after = null) {
28491
- let r2 = getChildren(this, type2, before, after);
28492
- return r2.length ? r2[0] : null;
28491
+ let r = getChildren(this, type2, before, after);
28492
+ return r.length ? r[0] : null;
28493
28493
  }
28494
28494
  getChildren(type2, before = null, after = null) {
28495
28495
  return getChildren(this, type2, before, after);
@@ -29602,7 +29602,7 @@ class Parser {
29602
29602
  startParse(input, fragments, ranges) {
29603
29603
  if (typeof input == "string")
29604
29604
  input = new StringInput(input);
29605
- ranges = !ranges ? [new Range2(0, input.length)] : ranges.length ? ranges.map((r2) => new Range2(r2.from, r2.to)) : [new Range2(0, 0)];
29605
+ ranges = !ranges ? [new Range2(0, input.length)] : ranges.length ? ranges.map((r) => new Range2(r.from, r.to)) : [new Range2(0, 0)];
29606
29606
  return this.createParse(input, fragments || [], ranges);
29607
29607
  }
29608
29608
  /**
@@ -30414,8 +30414,8 @@ class Language {
30414
30414
  if (mount) {
30415
30415
  if (mount.tree.prop(languageDataProp) == this.data) {
30416
30416
  if (mount.overlay)
30417
- for (let r2 of mount.overlay)
30418
- result.push({ from: r2.from + from, to: r2.to + from });
30417
+ for (let r of mount.overlay)
30418
+ result.push({ from: r.from + from, to: r.to + from });
30419
30419
  else
30420
30420
  result.push({ from, to: from + tree.length });
30421
30421
  return;
@@ -30603,8 +30603,8 @@ class ParseContext {
30603
30603
  }
30604
30604
  }
30605
30605
  withoutTempSkipped(fragments) {
30606
- for (let r2; r2 = this.tempSkipped.pop(); )
30607
- fragments = cutFragments(fragments, r2.from, r2.to);
30606
+ for (let r; r = this.tempSkipped.pop(); )
30607
+ fragments = cutFragments(fragments, r.from, r.to);
30608
30608
  return fragments;
30609
30609
  }
30610
30610
  /**
@@ -30622,8 +30622,8 @@ class ParseContext {
30622
30622
  viewport = { from: changes.mapPos(viewport.from, -1), to: changes.mapPos(viewport.to, 1) };
30623
30623
  if (this.skipped.length) {
30624
30624
  skipped = [];
30625
- for (let r2 of this.skipped) {
30626
- let from = changes.mapPos(r2.from, 1), to = changes.mapPos(r2.to, -1);
30625
+ for (let r of this.skipped) {
30626
+ let from = changes.mapPos(r.from, 1), to = changes.mapPos(r.to, -1);
30627
30627
  if (from < to)
30628
30628
  skipped.push({ from, to });
30629
30629
  }
@@ -30686,8 +30686,8 @@ class ParseContext {
30686
30686
  advance() {
30687
30687
  let cx = currentContext;
30688
30688
  if (cx) {
30689
- for (let r2 of ranges)
30690
- cx.tempSkipped.push(r2);
30689
+ for (let r of ranges)
30690
+ cx.tempSkipped.push(r);
30691
30691
  if (until)
30692
30692
  cx.scheduleOn = cx.scheduleOn ? Promise.all([cx.scheduleOn, until]) : until;
30693
30693
  }
@@ -31151,7 +31151,7 @@ function indentOnInput() {
31151
31151
  if (head > line.from + DontIndentBeyond)
31152
31152
  return tr;
31153
31153
  let lineStart = doc2.sliceString(line.from, head);
31154
- if (!rules2.some((r2) => r2.test(lineStart)))
31154
+ if (!rules2.some((r) => r.test(lineStart)))
31155
31155
  return tr;
31156
31156
  let { state } = tr, last = -1, changes = [];
31157
31157
  for (let { head: head2 } of state.selection.ranges) {
@@ -31640,11 +31640,11 @@ function findBlockComment(state, { open, close }, from, to) {
31640
31640
  }
31641
31641
  function selectedLineRanges(state) {
31642
31642
  let ranges = [];
31643
- for (let r2 of state.selection.ranges) {
31644
- let fromLine = state.doc.lineAt(r2.from);
31645
- let toLine = r2.to <= fromLine.to ? fromLine : state.doc.lineAt(r2.to);
31646
- if (toLine.from > fromLine.from && toLine.from == r2.to)
31647
- toLine = r2.to == fromLine.to + 1 ? fromLine : state.doc.lineAt(r2.to - 1);
31643
+ for (let r of state.selection.ranges) {
31644
+ let fromLine = state.doc.lineAt(r.from);
31645
+ let toLine = r.to <= fromLine.to ? fromLine : state.doc.lineAt(r.to);
31646
+ if (toLine.from > fromLine.from && toLine.from == r.to)
31647
+ toLine = r.to == fromLine.to + 1 ? fromLine : state.doc.lineAt(r.to - 1);
31648
31648
  let last = ranges.length - 1;
31649
31649
  if (last >= 0 && ranges[last].to > fromLine.from)
31650
31650
  ranges[last].to = toLine.to;
@@ -31654,10 +31654,10 @@ function selectedLineRanges(state) {
31654
31654
  return ranges;
31655
31655
  }
31656
31656
  function changeBlockComment(option, state, ranges = state.selection.ranges) {
31657
- let tokens = ranges.map((r2) => getConfig(state, r2.from).block);
31657
+ let tokens = ranges.map((r) => getConfig(state, r.from).block);
31658
31658
  if (!tokens.every((c) => c))
31659
31659
  return null;
31660
- let comments = ranges.map((r2, i) => findBlockComment(state, tokens[i], r2.from, r2.to));
31660
+ let comments = ranges.map((r, i) => findBlockComment(state, tokens[i], r.from, r.to));
31661
31661
  if (option != 2 && !comments.every((c) => c)) {
31662
31662
  return { changes: state.changes(ranges.map((range, i) => {
31663
31663
  if (comments[i])
@@ -31873,7 +31873,7 @@ function isAdjacent(a, b) {
31873
31873
  return isAdjacent2;
31874
31874
  }
31875
31875
  function eqSelectionShape(a, b) {
31876
- return a.ranges.length == b.ranges.length && a.ranges.filter((r2, i) => r2.empty != b.ranges[i].empty).length === 0;
31876
+ return a.ranges.length == b.ranges.length && a.ranges.filter((r, i) => r.empty != b.ranges[i].empty).length === 0;
31877
31877
  }
31878
31878
  function conc(a, b) {
31879
31879
  return !a.length ? b : !b.length ? a : a.concat(b);
@@ -32223,7 +32223,7 @@ function addCursorVertically(view, forward) {
32223
32223
  for (let cur2 = range; ; ) {
32224
32224
  let next = view.moveVertically(cur2, forward);
32225
32225
  if (next.head < line.from || next.head > line.to) {
32226
- if (!ranges.some((r2) => r2.head == next.head))
32226
+ if (!ranges.some((r) => r.head == next.head))
32227
32227
  ranges.push(next);
32228
32228
  break;
32229
32229
  } else if (next.head == cur2.head) {
@@ -32405,12 +32405,12 @@ function moveLine(state, dispatch, forward) {
32405
32405
  let size = nextLine.length + 1;
32406
32406
  if (forward) {
32407
32407
  changes.push({ from: block.to, to: nextLine.to }, { from: block.from, insert: nextLine.text + state.lineBreak });
32408
- for (let r2 of block.ranges)
32409
- ranges.push(EditorSelection.range(Math.min(state.doc.length, r2.anchor + size), Math.min(state.doc.length, r2.head + size)));
32408
+ for (let r of block.ranges)
32409
+ ranges.push(EditorSelection.range(Math.min(state.doc.length, r.anchor + size), Math.min(state.doc.length, r.head + size)));
32410
32410
  } else {
32411
32411
  changes.push({ from: nextLine.from, to: block.from }, { from: block.to, insert: state.lineBreak + nextLine.text });
32412
- for (let r2 of block.ranges)
32413
- ranges.push(EditorSelection.range(r2.anchor - size, r2.head - size));
32412
+ for (let r of block.ranges)
32413
+ ranges.push(EditorSelection.range(r.anchor - size, r.head - size));
32414
32414
  }
32415
32415
  }
32416
32416
  if (!changes.length)
@@ -33063,7 +33063,7 @@ function findNextOccurrence(state, query) {
33063
33063
  cursor = new SearchCursor(state.doc, query, 0, Math.max(0, ranges[ranges.length - 1].from - 1));
33064
33064
  cycled = true;
33065
33065
  } else {
33066
- if (cycled && ranges.some((r2) => r2.from == cursor.value.from))
33066
+ if (cycled && ranges.some((r) => r.from == cursor.value.from))
33067
33067
  continue;
33068
33068
  if (fullWord) {
33069
33069
  let word2 = state.wordAt(cursor.value.from);
@@ -33079,7 +33079,7 @@ const selectNextOccurrence = ({ state, dispatch }) => {
33079
33079
  if (ranges.some((sel) => sel.from === sel.to))
33080
33080
  return selectWord({ state, dispatch });
33081
33081
  let searchedText = state.sliceDoc(ranges[0].from, ranges[0].to);
33082
- if (state.selection.ranges.some((r2) => state.sliceDoc(r2.from, r2.to) != searchedText))
33082
+ if (state.selection.ranges.some((r) => state.sliceDoc(r.from, r.to) != searchedText))
33083
33083
  return false;
33084
33084
  let range = findNextOccurrence(state, searchedText);
33085
33085
  if (!range)
@@ -33353,7 +33353,7 @@ const searchHighlighter = /* @__PURE__ */ ViewPlugin.fromClass(class {
33353
33353
  while (i < l - 1 && to > ranges[i + 1].from - 2 * 250)
33354
33354
  to = ranges[++i].to;
33355
33355
  query.highlight(view.state, from, to, (from2, to2) => {
33356
- let selected = view.state.selection.ranges.some((r2) => r2.from == from2 && r2.to == to2);
33356
+ let selected = view.state.selection.ranges.some((r) => r.from == from2 && r.to == to2);
33357
33357
  builder.add(from2, to2, selected ? selectedMatchMark : matchMark);
33358
33358
  });
33359
33359
  }
@@ -33403,7 +33403,7 @@ const selectMatches = /* @__PURE__ */ searchCommand((view, { query }) => {
33403
33403
  if (!ranges || !ranges.length)
33404
33404
  return false;
33405
33405
  view.dispatch({
33406
- selection: EditorSelection.create(ranges.map((r2) => EditorSelection.range(r2.from, r2.to))),
33406
+ selection: EditorSelection.create(ranges.map((r) => EditorSelection.range(r.from, r.to))),
33407
33407
  userEvent: "select.search.matches"
33408
33408
  });
33409
33409
  return true;
@@ -34517,11 +34517,11 @@ class InputStream {
34517
34517
  if (from >= this.range.from && to <= this.range.to)
34518
34518
  return this.input.read(from, to);
34519
34519
  let result = "";
34520
- for (let r2 of this.ranges) {
34521
- if (r2.from >= to)
34520
+ for (let r of this.ranges) {
34521
+ if (r.from >= to)
34522
34522
  break;
34523
- if (r2.to > from)
34524
- result += this.input.read(Math.max(r2.from, from), Math.min(r2.to, to));
34523
+ if (r.to > from)
34524
+ result += this.input.read(Math.max(r.from, from), Math.min(r.to, to));
34525
34525
  }
34526
34526
  return result;
34527
34527
  }
@@ -35175,7 +35175,7 @@ class LRParser extends Parser {
35175
35175
  this.minRepeatTerm = nodeNames.length;
35176
35176
  for (let i = 0; i < spec.repeatNodeCount; i++)
35177
35177
  nodeNames.push("");
35178
- let topTerms = Object.keys(spec.topRules).map((r2) => spec.topRules[r2][1]);
35178
+ let topTerms = Object.keys(spec.topRules).map((r) => spec.topRules[r][1]);
35179
35179
  let nodeProps = [];
35180
35180
  for (let i = 0; i < nodeNames.length; i++)
35181
35181
  nodeProps.push([]);
@@ -35371,13 +35371,13 @@ class LRParser extends Parser {
35371
35371
  }
35372
35372
  if (config2.tokenizers)
35373
35373
  copy.tokenizers = this.tokenizers.map((t2) => {
35374
- let found = config2.tokenizers.find((r2) => r2.from == t2);
35374
+ let found = config2.tokenizers.find((r) => r.from == t2);
35375
35375
  return found ? found.to : t2;
35376
35376
  });
35377
35377
  if (config2.specializers) {
35378
35378
  copy.specializers = this.specializers.slice();
35379
35379
  copy.specializerSpecs = this.specializerSpecs.map((s, i) => {
35380
- let found = config2.specializers.find((r2) => r2.from == s.external);
35380
+ let found = config2.specializers.find((r) => r.from == s.external);
35381
35381
  if (!found)
35382
35382
  return s;
35383
35383
  let spec = Object.assign(Object.assign({}, s), { external: found.to });
@@ -36784,7 +36784,7 @@ const completionPlugin = /* @__PURE__ */ ViewPlugin.fromClass(class {
36784
36784
  this.pendingStart = false;
36785
36785
  let { state } = this.view, cState = state.field(completionState);
36786
36786
  for (let active of cState.active) {
36787
- if (active.isPending && !this.running.some((r2) => r2.active.source == active.source))
36787
+ if (active.isPending && !this.running.some((r) => r.active.source == active.source))
36788
36788
  this.startQuery(active);
36789
36789
  }
36790
36790
  if (this.running.length && cState.open && cState.open.disabled)
@@ -37116,12 +37116,12 @@ class ActiveSnippet {
37116
37116
  constructor(ranges, active) {
37117
37117
  this.ranges = ranges;
37118
37118
  this.active = active;
37119
- this.deco = Decoration.set(ranges.map((r2) => (r2.from == r2.to ? fieldMarker : fieldRange).range(r2.from, r2.to)), true);
37119
+ this.deco = Decoration.set(ranges.map((r) => (r.from == r.to ? fieldMarker : fieldRange).range(r.from, r.to)), true);
37120
37120
  }
37121
37121
  map(changes) {
37122
37122
  let ranges = [];
37123
- for (let r2 of this.ranges) {
37124
- let mapped = r2.map(changes);
37123
+ for (let r of this.ranges) {
37124
+ let mapped = r.map(changes);
37125
37125
  if (!mapped)
37126
37126
  return null;
37127
37127
  ranges.push(mapped);
@@ -37129,7 +37129,7 @@ class ActiveSnippet {
37129
37129
  return new ActiveSnippet(ranges, this.active);
37130
37130
  }
37131
37131
  selectionInsideField(sel) {
37132
- return sel.ranges.every((range) => this.ranges.some((r2) => r2.field == this.active && r2.from <= range.from && r2.to >= range.to));
37132
+ return sel.ranges.every((range) => this.ranges.some((r) => r.field == this.active && r.from <= range.from && r.to >= range.to));
37133
37133
  }
37134
37134
  }
37135
37135
  const setActive = /* @__PURE__ */ StateEffect.define({
@@ -37158,7 +37158,7 @@ const snippetState = /* @__PURE__ */ StateField.define({
37158
37158
  provide: (f) => EditorView.decorations.from(f, (val) => val ? val.deco : Decoration.none)
37159
37159
  });
37160
37160
  function fieldSelection(ranges, field) {
37161
- return EditorSelection.create(ranges.filter((r2) => r2.field == field).map((r2) => EditorSelection.range(r2.from, r2.to)));
37161
+ return EditorSelection.create(ranges.filter((r) => r.field == field).map((r) => EditorSelection.range(r.from, r.to)));
37162
37162
  }
37163
37163
  function snippet(template) {
37164
37164
  let snippet2 = Snippet.parse(template);
@@ -37172,7 +37172,7 @@ function snippet(template) {
37172
37172
  };
37173
37173
  if (ranges.length)
37174
37174
  spec.selection = fieldSelection(ranges, 0);
37175
- if (ranges.some((r2) => r2.field > 0)) {
37175
+ if (ranges.some((r) => r.field > 0)) {
37176
37176
  let active = new ActiveSnippet(ranges, 0);
37177
37177
  let effects = spec.effects = [setActive.of(active)];
37178
37178
  if (editor.state.field(snippetState, false) === void 0)
@@ -37186,7 +37186,7 @@ function moveField(dir) {
37186
37186
  let active = state.field(snippetState, false);
37187
37187
  if (!active || dir < 0 && active.active == 0)
37188
37188
  return false;
37189
- let next = active.active + dir, last = dir > 0 && !active.ranges.some((r2) => r2.field == next + dir);
37189
+ let next = active.active + dir, last = dir > 0 && !active.ranges.some((r) => r.field == next + dir);
37190
37190
  dispatch(state.update({
37191
37191
  selection: fieldSelection(active.ranges, next),
37192
37192
  effects: setActive.of(last ? null : new ActiveSnippet(active.ranges, next)),
@@ -37222,12 +37222,12 @@ const snippetPointerHandler = /* @__PURE__ */ EditorView.domEventHandlers({
37222
37222
  let active = view.state.field(snippetState, false), pos;
37223
37223
  if (!active || (pos = view.posAtCoords({ x: event.clientX, y: event.clientY })) == null)
37224
37224
  return false;
37225
- let match = active.ranges.find((r2) => r2.from <= pos && r2.to >= pos);
37225
+ let match = active.ranges.find((r) => r.from <= pos && r.to >= pos);
37226
37226
  if (!match || match.field == active.active)
37227
37227
  return false;
37228
37228
  view.dispatch({
37229
37229
  selection: fieldSelection(active.ranges, match.field),
37230
- effects: setActive.of(active.ranges.some((r2) => r2.field > match.field) ? new ActiveSnippet(active.ranges, match.field) : null),
37230
+ effects: setActive.of(active.ranges.some((r) => r.field > match.field) ? new ActiveSnippet(active.ranges, match.field) : null),
37231
37231
  scrollIntoView: true
37232
37232
  });
37233
37233
  return true;
@@ -40049,7 +40049,7 @@ class NineDiff extends HTMLElement {
40049
40049
  const customImport = this.getAttribute("css-path") ? `@import "${this.getAttribute("css-path")}";` : "";
40050
40050
  this.shadowRoot.innerHTML = `
40051
40051
  <style>
40052
- @import "https://cdn.jsdelivr.net/npm/@nine-lab/nine-mu@${"0.1.175"}/dist/css/nine-mu.css";
40052
+ @import "https://cdn.jsdelivr.net/npm/@nine-lab/nine-mu@${"0.1.176"}/dist/css/nine-mu.css";
40053
40053
  ${customImport}
40054
40054
  </style>
40055
40055
 
@@ -40159,7 +40159,7 @@ render_fn2 = function() {
40159
40159
  const customImport = this.getAttribute("css-path") ? `@import "${this.getAttribute("css-path")}";` : "";
40160
40160
  this.shadowRoot.innerHTML = `
40161
40161
  <style>
40162
- @import "https://cdn.jsdelivr.net/npm/@nine-lab/nine-mu@${"0.1.175"}/dist/css/nine-mu.css";
40162
+ @import "https://cdn.jsdelivr.net/npm/@nine-lab/nine-mu@${"0.1.176"}/dist/css/nine-mu.css";
40163
40163
  ${customImport}
40164
40164
  </style>
40165
40165
 
@@ -40486,7 +40486,7 @@ class ChatMessageBody extends HTMLElement {
40486
40486
  const customImport = this.getAttribute("css-path") ? `@import "${this.getAttribute("css-path")}";` : "";
40487
40487
  this.shadowRoot.innerHTML = `
40488
40488
  <style>
40489
- @import "https://cdn.jsdelivr.net/npm/@nine-lab/nine-mu@${"0.1.175"}/dist/css/nine-mu.css";
40489
+ @import "https://cdn.jsdelivr.net/npm/@nine-lab/nine-mu@${"0.1.176"}/dist/css/nine-mu.css";
40490
40490
  ${customImport}
40491
40491
  </style>
40492
40492
 
@@ -40580,7 +40580,7 @@ if (!customElements.get("nine-chat-progress")) {
40580
40580
  customElements.define("nine-chat-progress", ProgressMessage);
40581
40581
  }
40582
40582
  const NineMu = {
40583
- version: "0.1.175",
40583
+ version: "0.1.176",
40584
40584
  init: (config2) => {
40585
40585
  trace$1.log("🛠️ Nine-Mu Engine initialized", config2);
40586
40586
  }