@glifox/gnosis 0.0.7 → 0.0.8

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/gnosis.mjs CHANGED
@@ -1,87 +1,88 @@
1
- var Z = Object.defineProperty;
2
- var J = (t, r, a) => r in t ? Z(t, r, { enumerable: !0, configurable: !0, writable: !0, value: a }) : t[r] = a;
3
- var L = (t, r, a) => J(t, typeof r != "symbol" ? r + "" : r, a);
4
- import { languages as ee } from "@codemirror/language-data";
5
- import { markdown as re } from "@codemirror/lang-markdown";
6
- import { GFM as te } from "@lezer/markdown";
7
- import { Tag as ae, styleTags as oe, tags as e } from "@lezer/highlight";
8
- import { ViewPlugin as ne, Decoration as h, WidgetType as M, EditorView as q } from "@codemirror/view";
9
- import { syntaxTree as $, HighlightStyle as le, syntaxHighlighting as ce } from "@codemirror/language";
10
- import { EditorView as w } from "codemirror";
11
- import { Compartment as se, StateEffect as ie, StateField as ge } from "@codemirror/state";
12
- const m = ae.define("none"), he = oe({
13
- "Blockquote/...": m,
14
- HorizontalRule: m,
15
- "ATXHeading1/... SetextHeading1/...": m,
16
- "ATXHeading2/... SetextHeading2/...": m,
17
- "ATXHeading3/...": m,
18
- "ATXHeading4/...": m,
19
- "ATXHeading5/...": m,
20
- "ATXHeading6/...": m,
21
- "Comment CommentBlock": m,
22
- Escape: m,
23
- Entity: m,
24
- "Emphasis/...": m,
25
- "StrongEmphasis/...": m,
26
- "Strikethrough/...": m,
27
- "TableHeader/...": m,
28
- "Link/... Image/...": m,
29
- "OrderedList/... BulletList/...": m,
30
- "BlockQuote/...": m,
31
- "InlineCode CodeText": m,
32
- "URL Autolink": m,
33
- "HeaderMark HardBreak QuoteMark ListMark LinkMark EmphasisMark CodeMark StrikethroughMark": m,
34
- "CodeInfo LinkLabel TaskMarker TableDelimiter": m,
35
- LinkTitle: m,
36
- Paragraph: m
37
- }), de = { props: [he] }, C = (t, r, a = {}) => {
38
- const n = class {
1
+ var U = Object.defineProperty;
2
+ var X = (t, r, a) => r in t ? U(t, r, { enumerable: !0, configurable: !0, writable: !0, value: a }) : t[r] = a;
3
+ var q = (t, r, a) => X(t, typeof r != "symbol" ? r + "" : r, a);
4
+ import { languages as J } from "@codemirror/language-data";
5
+ import { markdown as ee } from "@codemirror/lang-markdown";
6
+ import { GFM as re } from "@lezer/markdown";
7
+ import { Tag as te, styleTags as ae, tags as e } from "@lezer/highlight";
8
+ import { ViewPlugin as oe, Decoration as h, WidgetType as E, EditorView as A } from "@codemirror/view";
9
+ import { syntaxTree as $, HighlightStyle as ne, syntaxHighlighting as le } from "@codemirror/language";
10
+ import { EditorView as B } from "codemirror";
11
+ import { Compartment as ce, StateEffect as se, StateField as ie } from "@codemirror/state";
12
+ const f = te.define("none"), ge = ae({
13
+ "Blockquote/...": f,
14
+ HorizontalRule: f,
15
+ "ATXHeading1/... SetextHeading1/...": f,
16
+ "ATXHeading2/... SetextHeading2/...": f,
17
+ "ATXHeading3/...": f,
18
+ "ATXHeading4/...": f,
19
+ "ATXHeading5/...": f,
20
+ "ATXHeading6/...": f,
21
+ "Comment CommentBlock": f,
22
+ Escape: f,
23
+ Entity: f,
24
+ "Emphasis/...": f,
25
+ "StrongEmphasis/...": f,
26
+ "Strikethrough/...": f,
27
+ "TableHeader/...": f,
28
+ "Link/... Image/...": f,
29
+ "OrderedList/... BulletList/...": f,
30
+ "BlockQuote/...": f,
31
+ "InlineCode CodeText": f,
32
+ "URL Autolink": f,
33
+ "HeaderMark HardBreak QuoteMark ListMark LinkMark EmphasisMark CodeMark StrikethroughMark": f,
34
+ "CodeInfo LinkLabel TaskMarker TableDelimiter": f,
35
+ LinkTitle: f,
36
+ Paragraph: f,
37
+ "QuoteType/.. QuoteTypeMark QuoteTypeText": f
38
+ }), he = { props: [ge] }, v = (t, r, a = {}) => {
39
+ const o = class {
39
40
  constructor(i) {
40
- L(this, "decorations");
41
- L(this, "conf");
41
+ q(this, "decorations");
42
+ q(this, "conf");
42
43
  this.conf = r, this.decorations = t(i, this.conf);
43
44
  }
44
45
  update(i) {
45
46
  (i.docChanged || i.viewportChanged || i.selectionSet) && (this.decorations = t(i.view, this.conf));
46
47
  }
47
48
  };
48
- return ne.fromClass(n, { decorations: (c) => c.decorations, ...a });
49
+ return oe.fromClass(o, { decorations: (c) => c.decorations, ...a });
49
50
  }, N = (t, r, a) => {
50
- const n = t.state.selection.ranges;
51
- for (let c of n)
51
+ const o = t.state.selection.ranges;
52
+ for (let c of o)
52
53
  if (c.from >= r && c.from <= a || c.to >= r && c.to <= a || c.from <= r && c.to >= a)
53
54
  return !0;
54
55
  return !1;
55
- }, v = (t, r) => {
56
- for (const { from: a, to: n } of t.visibleRanges)
57
- $(t.state).iterate({ ...r, from: a, to: n });
56
+ }, L = (t, r) => {
57
+ for (const { from: a, to: o } of t.visibleRanges)
58
+ $(t.state).iterate({ ...r, from: a, to: o });
58
59
  };
59
- function be(t, r, a, n = 1) {
60
+ function de(t, r, a, o = 1) {
60
61
  const c = (g) => [
61
62
  (t[0] - (1 - g) * r[0]) / g,
62
63
  (t[1] - (1 - g) * r[1]) / g,
63
64
  (t[2] - (1 - g) * r[2]) / g
64
65
  ];
65
66
  let i = a, l = c(i);
66
- const o = l.map((g, d) => g < 0 && r[d] > 0 ? 1 - l[d] / r[d] : a), s = Math.max(...o);
67
- return s > i && (i = Math.min(s, n), t = c(i)), l = l.map((g) => Math.round(g < 0 ? 0 : g)), l.push(i), l;
67
+ const n = l.map((g, d) => g < 0 && r[d] > 0 ? 1 - l[d] / r[d] : a), s = Math.max(...n);
68
+ return s > i && (i = Math.min(s, o), t = c(i)), l = l.map((g) => Math.round(g < 0 ? 0 : g)), l.push(i), l;
68
69
  }
69
- function me(t, r) {
70
- const a = ["Document"], n = {}, c = {
71
- HorizontalRule: (l, o, s = !0) => [
70
+ function be(t, r) {
71
+ const a = ["Document"], o = {}, c = {
72
+ HorizontalRule: (l, n, s = !0) => [
72
73
  h.line({ class: "hr " + (s ? "sw" : "") }).range(l),
73
- h.mark({ class: "mk" }).range(l, o)
74
+ h.mark({ class: "mk" }).range(l, n)
74
75
  ]
75
76
  }, i = [];
76
- return v(t, {
77
- enter: ({ type: l, from: o, to: s }) => (l.name in c && i.push(...c[l.name](o, s, N(t, o, s))), a.includes(l.name) || l.name in n)
77
+ return L(t, {
78
+ enter: ({ type: l, from: n, to: s }) => (l.name in c && i.push(...c[l.name](n, s, N(t, n, s))), a.includes(l.name) || l.name in o)
78
79
  }), h.set(i, !1);
79
80
  }
80
- const ue = (t) => {
81
+ const me = (t) => {
81
82
  const {
82
83
  color: r = "black"
83
84
  } = t || {};
84
- return w.baseTheme({
85
+ return B.baseTheme({
85
86
  ".hr": { position: "relative" },
86
87
  ".hr > .mk": { fontSize: "0" },
87
88
  ".hr.sw > .mk": { fontSize: "inherit" },
@@ -94,29 +95,29 @@ const ue = (t) => {
94
95
  },
95
96
  "&.cm-focused .hr.sw::before": { width: "0", height: "0" }
96
97
  });
97
- }, G = (t = {}) => [
98
- C(me, {}),
99
- ue(t == null ? void 0 : t.color)
98
+ }, z = (t = {}) => [
99
+ v(be, {}),
100
+ me(t == null ? void 0 : t.color)
100
101
  ];
101
- function fe(t, r) {
102
- const a = ["FencedCode"], n = {
103
- StrongEmphasis: (l = !0, o, s) => h.mark({ class: "il st " + (l ? "sw" : "") }).range(o, s),
104
- Strikethrough: (l = !0, o, s) => h.mark({ class: "il sk " + (l ? "sw" : "") }).range(o, s),
105
- InlineCode: (l = !0, o, s) => h.mark({ class: "il ic " + (l ? "sw" : "") }).range(o, s),
106
- Emphasis: (l = !0, o, s) => h.mark({ class: "il it " + (l ? "sw" : "") }).range(o, s),
107
- Mark: (l, o) => h.mark({ class: "mkl" }).range(l, o)
102
+ function ue(t, r) {
103
+ const a = ["FencedCode"], o = {
104
+ StrongEmphasis: (l = !0, n, s) => h.mark({ class: "il st " + (l ? "sw" : "") }).range(n, s),
105
+ Strikethrough: (l = !0, n, s) => h.mark({ class: "il sk " + (l ? "sw" : "") }).range(n, s),
106
+ InlineCode: (l = !0, n, s) => h.mark({ class: "il ic " + (l ? "sw" : "") }).range(n, s),
107
+ Emphasis: (l = !0, n, s) => h.mark({ class: "il it " + (l ? "sw" : "") }).range(n, s),
108
+ Mark: (l, n) => h.mark({ class: "mkl" }).range(l, n)
108
109
  }, c = ["EmphasisMark", "CodeMark", "StrikethroughMark"], i = [];
109
- return v(t, {
110
- enter: ({ type: { name: l }, from: o, to: s }) => c.includes(l) ? (i.push(n.Mark(o, s)), !1) : (l in n && i.push(
111
- n[l](
112
- N(t, o, s),
113
- o,
110
+ return L(t, {
111
+ enter: ({ type: { name: l }, from: n, to: s }) => c.includes(l) ? (i.push(o.Mark(n, s)), !1) : (l in o && i.push(
112
+ o[l](
113
+ N(t, n, s),
114
+ n,
114
115
  s
115
116
  )
116
117
  ), !a.includes(l))
117
118
  }), h.set(i, !1);
118
119
  }
119
- const pe = w.baseTheme({
120
+ const fe = B.baseTheme({
120
121
  ".it ": { fontStyle: "italic" },
121
122
  ".st ": { fontWeight: "bold" },
122
123
  ".sk ": { textDecoration: "line-through" },
@@ -125,7 +126,7 @@ const pe = w.baseTheme({
125
126
  paddingInline: ".6ch",
126
127
  borderRadius: ".6ch"
127
128
  }
128
- }), ke = w.baseTheme({
129
+ }), pe = B.baseTheme({
129
130
  ".il .mkl": { fontSize: "0" },
130
131
  "&.cm-focused .il.sw .mkl": { fontSize: "inherit" }
131
132
  }), Q = (t = {}) => {
@@ -133,81 +134,103 @@ const pe = w.baseTheme({
133
134
  hideMarks: r = !0
134
135
  } = t;
135
136
  return [
136
- C(fe, {}),
137
- pe,
138
- r ? ke : []
137
+ v(ue, {}),
138
+ fe,
139
+ r ? pe : []
139
140
  ];
140
141
  };
141
- class xe extends M {
142
+ class ke extends E {
142
143
  constructor(a) {
143
144
  super();
144
- L(this, "checked", !1);
145
+ q(this, "checked", !1);
145
146
  this.checked = a;
146
147
  }
147
148
  // eq(other) { return other.checked == this.checked }
148
149
  toDOM() {
149
150
  let a = document.createElement("span");
150
151
  a.setAttribute("aria-hidden", "true"), a.className = "TaskMark";
151
- let n = a.appendChild(document.createElement("input"));
152
- return n.type = "checkbox", n.checked = this.checked, a;
152
+ let o = a.appendChild(document.createElement("input"));
153
+ return o.type = "checkbox", o.checked = this.checked, a;
153
154
  }
154
155
  ignoreEvent() {
155
156
  return !1;
156
157
  }
157
158
  }
158
- function ye(t, r) {
159
+ function xe(t, r) {
159
160
  const a = [
160
161
  "Document",
161
162
  "ListItem",
162
- "Task"
163
- ], n = {
164
- BulletList: "bl",
165
- OrderedList: "ol"
163
+ "Task",
164
+ "Blockquote"
165
+ ], o = {
166
+ BulletList: {
167
+ class: "bl",
168
+ offset: 2
169
+ },
170
+ OrderedList: {
171
+ class: "ol",
172
+ offset: 3
173
+ }
166
174
  }, c = {
167
- ListMark: (o, s, g, d = !0) => h.mark({ class: `${g} lm ${d ? "sw" : ""}` }).range(o, s),
168
- TaskMarker: (o, s, g, d = !0) => {
169
- const b = t.state.doc.sliceString(o + 1, s - 1) === "x";
170
- return d ? h.mark({ class: `tm ${b ? "ck" : ""}` }).range(o, s) : h.replace({
171
- widget: new xe(b)
172
- }).range(o, s);
175
+ ListMark: (s, g, d, b = !0) => h.mark({ class: `${d.class} lm ${b ? "sw" : ""}` }).range(s, g),
176
+ TaskMarker: (s, g, d, b = !0) => {
177
+ const k = t.state.doc.sliceString(s + 1, g - 1) === "x";
178
+ return b ? h.mark({ class: `tm ${k ? "ck" : ""}` }).range(s, g) : h.replace({
179
+ widget: new ke(k)
180
+ }).range(s, g);
181
+ }
182
+ }, i = {
183
+ ListItem: (s, g, d, b) => {
184
+ const k = d.offset + (b ? 4 : 0), u = s + k, m = `calc(100% - ${Math.max(0, k) + 4}ch)`;
185
+ return u >= g ? [] : [
186
+ h.mark({
187
+ class: "ls-text-line",
188
+ attributes: { style: `width: ${m}` }
189
+ }).range(u, g)
190
+ ];
173
191
  }
174
- }, i = [], l = [];
175
- return v(t, {
176
- enter: ({ type: o, from: s, to: g }) => o.name in n ? (l.push({ name: o.name, from: s, to: g }), !0) : (o.name in c && i.push(c[o.name](
177
- s,
192
+ }, l = [], n = [];
193
+ return L(t, {
194
+ enter: ({ name: s, from: g, to: d, node: b }) => s in o ? (n.push({ name: s, from: g, to: d }), !0) : (s in c && l.push(c[s](
195
+ g,
196
+ d,
197
+ o[n.slice(-1)[0].name],
198
+ N(t, g, d)
199
+ )), s in i && (console.log({ node: b, name: s }), l.push(...i[s](
178
200
  g,
179
- n[l.slice(-1)[0].name],
180
- N(t, s, g)
181
- )), a.includes(o.name)),
182
- leave: ({ type: { name: o }, from: s, to: g }) => {
183
- const d = l.slice(-1)[0];
184
- d && d.name === o && d.from === s && d.to === g && l.pop();
201
+ d,
202
+ o[n.slice(-1)[0].name],
203
+ b.getChild("Task") !== null
204
+ ))), a.includes(s)),
205
+ leave: ({ name: s, from: g, to: d }) => {
206
+ const b = n.slice(-1)[0];
207
+ b && b.name === s && b.from === g && b.to === d && n.pop();
185
208
  }
186
- }), h.set(i, !1);
209
+ }), h.set(l, !0);
187
210
  }
188
- const Fe = (t, r) => {
189
- var n;
211
+ const Ce = (t, r) => {
212
+ var o;
190
213
  let a = t.target;
191
- if (a.nodeName === "INPUT" && ((n = a.parentElement) != null && n.classList.contains("TaskMark"))) return we(r, r.posAtDOM(a));
192
- }, we = (t, r) => {
193
- const a = r - 2, n = r - 1;
194
- let c = t.state.doc.sliceString(Math.max(0, a), n), i;
195
- if (c === "x") i = { from: a, to: n, insert: " " };
196
- else if (c === " ") i = { from: a, to: n, insert: "x" };
214
+ if (a.nodeName === "INPUT" && ((o = a.parentElement) != null && o.classList.contains("TaskMark"))) return ye(r, r.posAtDOM(a));
215
+ }, ye = (t, r) => {
216
+ const a = r - 2, o = r - 1;
217
+ let c = t.state.doc.sliceString(Math.max(0, a), o), i;
218
+ if (c === "x") i = { from: a, to: o, insert: " " };
219
+ else if (c === " ") i = { from: a, to: o, insert: "x" };
197
220
  else return !1;
198
221
  return t.dispatch({ changes: i }), !0;
199
- }, Be = (t) => {
222
+ }, we = (t) => {
200
223
  const {
201
224
  color: r = "black"
202
225
  } = t || {};
203
- return w.baseTheme({
226
+ return B.baseTheme({
204
227
  /* Bullet list Point */
205
- ".lm.bl": {
228
+ "& .lm.bl": {
206
229
  position: "relative",
207
230
  paddingInlineStart: "1ch",
208
231
  color: "transparent"
209
232
  },
210
- ".lm.bl::before": {
233
+ "& .lm.bl::before": {
211
234
  content: '""',
212
235
  display: "inline",
213
236
  position: "absolute",
@@ -224,19 +247,28 @@ const Fe = (t, r) => {
224
247
  "&.cm-focused .lm.bl.sw, &.cm-focused .lm.bl.sw::before": {
225
248
  backgroundColor: "transparent",
226
249
  color: "inherit"
250
+ },
251
+ /* list text line */
252
+ "& .ls-text-line": {
253
+ display: "inline-block",
254
+ ariaHidden: "true"
255
+ // border: "red 1px solid"
256
+ },
257
+ "& .cm-line .lm, & .cm-line .TaskMark, & .cm-line .tm, & .cm-line .ls-text-line": {
258
+ verticalAlign: "top"
227
259
  }
228
260
  });
229
- }, _ = (t = {}) => [
230
- C(ye, {}, { eventHandlers: { mousedown: Fe } }),
231
- Be(t == null ? void 0 : t.color)
232
- ], Ce = (t, r) => {
233
- var n;
261
+ }, K = (t = {}) => [
262
+ v(xe, {}, { eventHandlers: { mousedown: Ce } }),
263
+ we(t == null ? void 0 : t.color)
264
+ ], Fe = (t, r) => {
265
+ var o;
234
266
  let a = t.target;
235
- if (a.nodeName === "BUTTON" && ((n = a.parentElement) != null && n.classList.contains("wg-codeblock"))) {
267
+ if (a.nodeName === "BUTTON" && ((o = a.parentElement) != null && o.classList.contains("wg-codeblock"))) {
236
268
  const c = ["FencedCode", "CodeBlock"];
237
269
  let i = "";
238
270
  const l = {
239
- enter: ({ type: { name: o }, from: s, to: g, node: d }) => (c.includes(o) && (i = Ne(r, d.toTree(), s, g)), !c.includes(o))
271
+ enter: ({ type: { name: n }, from: s, to: g, node: d }) => (c.includes(n) && (i = Be(r, d.toTree(), s, g)), !c.includes(n))
240
272
  };
241
273
  return $(r.state).iterate({
242
274
  ...l,
@@ -244,26 +276,26 @@ const Fe = (t, r) => {
244
276
  to: r.posAtDOM(a) + 2
245
277
  }), navigator.clipboard.writeText(i), !0;
246
278
  }
247
- }, Ne = (t, r, a, n) => {
279
+ }, Be = (t, r, a, o) => {
248
280
  const c = ["CodeMark", "CodeInfo"];
249
- let i = t.state.doc.sliceString(a, n), l = /* @__PURE__ */ new Set();
281
+ let i = t.state.doc.sliceString(a, o), l = /* @__PURE__ */ new Set();
250
282
  r.iterate({
251
- enter({ type: { name: d }, from: b, node: y }) {
283
+ enter({ type: { name: d }, from: b, node: k }) {
252
284
  c.includes(d) && l.add(t.state.doc.lineAt(b + a).number);
253
285
  }
254
286
  });
255
- const o = t.state.doc.lineAt(a), s = a - o.from, g = [];
287
+ const n = t.state.doc.lineAt(a), s = a - n.from, g = [];
256
288
  return i.split(`
257
289
  `).forEach((d, b) => {
258
- l.has(b + o.number) || g.push(d.slice(s));
290
+ l.has(b + n.number) || g.push(d.slice(s));
259
291
  }), g.join(`
260
292
  `);
261
293
  };
262
- class I extends M {
263
- constructor(a, n, c) {
294
+ class R extends E {
295
+ constructor(a, o, c) {
264
296
  super();
265
- L(this, "classes", "");
266
- this.classes = a, this.width = n, this.marginLeft = c;
297
+ q(this, "classes", "");
298
+ this.classes = a, this.width = o, this.marginLeft = c;
267
299
  }
268
300
  toDOM() {
269
301
  let a = document.createElement("span");
@@ -277,7 +309,7 @@ const ve = (t) => `<svg class="cb-icon" viewBox="0 0 18 18" fill="none" xmlns="h
277
309
  <path class="cb-icon-path cb.i1" fill-rule="evenodd" clip-rule="evenodd" d="M15 0C15.5304 0 16.0391 0.210714 16.4142 0.585786C16.7893 0.960859 17 1.46957 17 2V12C17 12.5304 16.7893 13.0391 16.4142 13.4142C16.0391 13.7893 15.5304 14 15 14H14V6C14 4.93913 13.5786 3.92172 12.8284 3.17157C12.0783 2.42143 11.0609 2 10 2H7C6.64895 1.99924 6.30395 2.09135 6 2.267V2C6 1.46957 6.21071 0.960859 6.58579 0.585786C6.96086 0.210714 7.46957 0 8 0H15Z"/>
278
310
  <path class="cb-icon-path cb.i1" fill-rule="evenodd" clip-rule="evenodd" d="M5 4.054V8H1.2C1.27464 7.84448 1.3691 7.69928 1.481 7.568L3.941 4.698C4.2169 4.37661 4.58771 4.15111 5 4.054ZM7 4V8C7 8.53043 6.78929 9.03914 6.41421 9.41421C6.03914 9.78929 5.53043 10 5 10H1V16C1 16.5304 1.21071 17.0391 1.58579 17.4142C1.96086 17.7893 2.46957 18 3 18H10C10.5304 18 11.0391 17.7893 11.4142 17.4142C11.7893 17.0391 12 16.5304 12 16V6C12 5.46957 11.7893 4.96086 11.4142 4.58579C11.0391 4.21071 10.5304 4 10 4H7Z"/>
279
311
  </svg>`;
280
- class Ee extends M {
312
+ class Ne extends E {
281
313
  constructor(r, a) {
282
314
  super(), this.type = r, this.code = a;
283
315
  }
@@ -291,74 +323,74 @@ class Ee extends M {
291
323
  return !1;
292
324
  }
293
325
  }
294
- const S = [];
295
- function P(t, r) {
326
+ const T = [];
327
+ function W(t, r) {
296
328
  const {
297
329
  mode: a
298
330
  /* type, mark */
299
- } = r, n = ["Document", "Blockquote", "ListItem", "BulletList", "OrderedList"], c = {
300
- FencedCode: K,
301
- CodeBlock: K
331
+ } = r, o = ["Document", "Blockquote", "ListItem", "BulletList", "OrderedList"], c = {
332
+ FencedCode: I,
333
+ CodeBlock: I
302
334
  }, i = {
303
- CodeMark: (o, s, g) => [h.mark({ class: "cb-mk" }).range(s, g)],
304
- CodeInfo: (o, s, g) => [h.mark({ class: "cb-mi" }).range(s, g)]
335
+ CodeMark: (n, s, g) => [h.mark({ class: "cb-mk" }).range(s, g)],
336
+ CodeInfo: (n, s, g) => [h.mark({ class: "cb-mi" }).range(s, g)]
305
337
  }, l = [];
306
- return v(t, {
307
- enter: ({ type: { name: o }, from: s, to: g }) => (a === "type" && o in c && l.push(...c[o](t, s, g)), a === "mark" && o in i && l.push(...i[o](t, s, g)), n.includes(o) || o in c ? (S.push({ name: o, from: s, to: g }), !0) : !1),
308
- Leave: ({ type: { name: o }, from: s, to: g }) => n.includes(o) || o in c ? (S.pop(), !0) : !1
338
+ return L(t, {
339
+ enter: ({ type: { name: n }, from: s, to: g }) => (a === "type" && n in c && l.push(...c[n](t, s, g)), a === "mark" && n in i && l.push(...i[n](t, s, g)), o.includes(n) || n in c ? (T.push({ name: n, from: s, to: g }), !0) : !1),
340
+ Leave: ({ type: { name: n }, from: s, to: g }) => o.includes(n) || n in c ? (T.pop(), !0) : !1
309
341
  }), {
310
342
  type: h.set(l, !0),
311
343
  mark: h.set(l, !0)
312
344
  }[a];
313
345
  }
314
- const K = (t, r, a) => {
315
- const n = [], c = S[S.length - 1], i = ["BulletList", "OrderedList", "ListItem"].some((f) => f === c.name), l = ["Blockquote"].some((f) => f === c.name), o = t.state.doc.lineAt(r), s = r - o.from, g = s > 0, d = N(t, o.from, a);
316
- d || n.push(
317
- h.widget({ widget: new Ee("view.state.sliceDoc(from, to)", "code"), side: 0 }).range(r + 1)
346
+ const I = (t, r, a) => {
347
+ const o = [], c = T[T.length - 1], i = ["BulletList", "OrderedList", "ListItem"].some((u) => u === c.name), l = ["Blockquote"].some((u) => u === c.name), n = t.state.doc.lineAt(r), s = r - n.from, g = s > 0, d = N(t, n.from, a);
348
+ d || o.push(
349
+ h.widget({ widget: new Ne("view.state.sliceDoc(from, to)", "code"), side: 0 }).range(r + 1)
318
350
  );
319
- const b = o.number, y = t.state.doc.sliceString(r, a).split(`
351
+ const b = n.number, k = t.state.doc.sliceString(r, a).split(`
320
352
  `).length;
321
- for (let f = b; f < y + b; f++) {
322
- const { from: u, to: F } = t.state.doc.line(f), B = "100% - 1.2ch", x = ["cb-content"];
323
- d && x.push("sw"), f === b && x.push("cb-start"), f === y + b - 1 && x.push("cb-end");
324
- const p = Math.max(u + s, 0);
325
- if (F < p)
326
- x.push("free"), n.push(
353
+ for (let u = b; u < k + b; u++) {
354
+ const { from: m, to: x } = t.state.doc.line(u), F = "100% - 1.2ch", y = ["cb-content"];
355
+ d && y.push("sw"), u === b && y.push("cb-start"), u === k + b - 1 && y.push("cb-end");
356
+ const p = Math.max(m + s, 0);
357
+ if (x < p)
358
+ y.push("free"), o.push(
327
359
  h.widget({
328
- widget: new I(
329
- x.join(" "),
330
- `calc(${B} - ${p - u}ch)`,
331
- `calc(${p - F}ch + 2px)`
360
+ widget: new R(
361
+ y.join(" "),
362
+ `calc(${F} - ${p - m}ch)`,
363
+ `calc(${p - x}ch + 2px)`
332
364
  ),
333
365
  side: 1
334
- }).range(F)
366
+ }).range(x)
335
367
  ), console.log("Hello World");
336
- else if (p === F)
337
- x.push("wg"), n.push(
368
+ else if (p === x)
369
+ y.push("wg"), o.push(
338
370
  h.widget({
339
- widget: new I(
340
- x.join(" "),
341
- `calc(${B} - ${p - u}ch)`
371
+ widget: new R(
372
+ y.join(" "),
373
+ `calc(${F} - ${p - m}ch)`
342
374
  ),
343
375
  side: 1
344
376
  }).range(p)
345
377
  );
346
378
  else if (i || l || g) {
347
- const E = { style: `width: calc(${B} - ${p - u}ch)` };
348
- F > p && n.push(h.mark({ class: x.join(" "), attributes: E }).range(p, F)), u !== p && i && n.push(h.mark({ class: "cb-listsp" }).range(u, p)), u !== p && g && n.push(h.mark({ class: "cb-spacer" }).range(u, p)), u !== p && l && n.push(h.mark({ class: "cb-quote bq" }).range(u, p));
349
- } else if (u !== F) {
350
- const E = { style: `width: calc(${B})` };
351
- n.push(h.mark({ class: x.join(" "), attributes: E }).range(u, F));
379
+ const w = { style: `width: calc(${F} - ${p - m}ch)` };
380
+ x > p && o.push(h.mark({ class: y.join(" "), attributes: w }).range(p, x)), m !== p && i && o.push(h.mark({ class: "cb-listsp" }).range(m, p)), m !== p && g && o.push(h.mark({ class: "cb-spacer" }).range(m, p)), m !== p && l && o.push(h.mark({ class: "cb-quote bq" }).range(m, p));
381
+ } else if (m !== x) {
382
+ const w = { style: `width: calc(${F})` };
383
+ o.push(h.mark({ class: y.join(" "), attributes: w }).range(m, x));
352
384
  }
353
- n.push(h.line({ class: "cb-line" }).range(u));
385
+ o.push(h.line({ class: "cb-line" }).range(m));
354
386
  }
355
- return n;
356
- }, Te = () => {
357
- const n = "4px", c = "1lh";
358
- return w.baseTheme({
359
- ".cb-start": { borderRadius: `${n} ${n} 0 0` },
360
- ".cb-end ": { borderRadius: `0 0 ${n} ${n}` },
361
- ".cb-start.cb-end": { borderRadius: `${n}` },
387
+ return o;
388
+ }, Le = () => {
389
+ const o = "4px", c = "1lh";
390
+ return B.baseTheme({
391
+ ".cb-start": { borderRadius: `${o} ${o} 0 0` },
392
+ ".cb-end ": { borderRadius: `0 0 ${o} ${o}` },
393
+ ".cb-start.cb-end": { borderRadius: `${o}` },
362
394
  ".cb-content": {
363
395
  display: "inline-block",
364
396
  marginLeft: "2px",
@@ -423,41 +455,41 @@ const K = (t, r, a) => {
423
455
  width: "5ch"
424
456
  }
425
457
  });
426
- }, Y = (t) => [
427
- C(P, { mode: "mark" }),
428
- C(P, { mode: "type" }, { eventHandlers: { mousedown: Ce } }),
429
- Te()
458
+ }, G = (t) => [
459
+ v(W, { mode: "mark" }),
460
+ v(W, { mode: "type" }, { eventHandlers: { mousedown: Fe } }),
461
+ Le()
430
462
  ];
431
- function Ae(t, r) {
432
- const a = ["Document"], n = {
433
- ATXHeading1: (l, o = !0) => h.line({ class: "h1 hg " + (o ? "sw" : "") }).range(l),
434
- ATXHeading2: (l, o = !0) => h.line({ class: "h2 hg " + (o ? "sw" : "") }).range(l),
435
- ATXHeading3: (l, o = !0) => h.line({ class: "h3 hg " + (o ? "sw" : "") }).range(l),
436
- ATXHeading4: (l, o = !0) => h.line({ class: "h4 hg " + (o ? "sw" : "") }).range(l),
437
- ATXHeading5: (l, o = !0) => h.line({ class: "h5 hg " + (o ? "sw" : "") }).range(l),
438
- ATXHeading6: (l, o = !0) => h.line({ class: "h6 hg " + (o ? "sw" : "") }).range(l)
463
+ function Ee(t, r) {
464
+ const a = ["Document"], o = {
465
+ ATXHeading1: (l, n = !0) => h.line({ class: "h1 hg " + (n ? "sw" : "") }).range(l),
466
+ ATXHeading2: (l, n = !0) => h.line({ class: "h2 hg " + (n ? "sw" : "") }).range(l),
467
+ ATXHeading3: (l, n = !0) => h.line({ class: "h3 hg " + (n ? "sw" : "") }).range(l),
468
+ ATXHeading4: (l, n = !0) => h.line({ class: "h4 hg " + (n ? "sw" : "") }).range(l),
469
+ ATXHeading5: (l, n = !0) => h.line({ class: "h5 hg " + (n ? "sw" : "") }).range(l),
470
+ ATXHeading6: (l, n = !0) => h.line({ class: "h6 hg " + (n ? "sw" : "") }).range(l)
439
471
  }, c = {
440
- HeaderMark: (l, o) => h.mark({ class: "mk" }).range(l, o)
472
+ HeaderMark: (l, n) => h.mark({ class: "mk" }).range(l, n)
441
473
  }, i = [];
442
- return v(t, {
443
- enter: ({ type: l, from: o, to: s }) => (l.name in n && i.push(n[l.name](o, N(t, o, s))), l.name in c && i.push(c[l.name](o, s + 1)), a.includes(l.name) || l.name in n)
474
+ return L(t, {
475
+ enter: ({ type: l, from: n, to: s }) => (l.name in o && i.push(o[l.name](n, N(t, n, s))), l.name in c && i.push(c[l.name](n, s + 1)), a.includes(l.name) || l.name in o)
444
476
  }), h.set(i, !1);
445
477
  }
446
- const Le = w.baseTheme({
478
+ const qe = B.baseTheme({
447
479
  ".h1 ": { fontSize: "2.6rem" },
448
480
  ".h2 ": { fontSize: "2.0rem" },
449
481
  ".h3 ": { fontSize: "1.8rem" },
450
482
  ".h4 ": { fontSize: "1.6rem" },
451
483
  ".h5 ": { fontSize: "1.4rem" },
452
484
  ".h6 ": { fontSize: "1.2rem" }
453
- }), Me = w.baseTheme({
485
+ }), Me = B.baseTheme({
454
486
  ".hg .mk": { fontSize: "0" },
455
487
  "&.cm-focused .hg.sw .mk": { fontSize: "inherit" }
456
- }), j = (t = {}) => [
457
- C(Ae, {}),
458
- Le,
488
+ }), _ = (t = {}) => [
489
+ v(Ee, {}),
490
+ qe,
459
491
  Me
460
- ], De = {
492
+ ], Te = {
461
493
  version: "1.7.1",
462
494
  latte: {
463
495
  name: "Latte",
@@ -3251,14 +3283,14 @@ const Le = w.baseTheme({
3251
3283
  }
3252
3284
  }
3253
3285
  }
3254
- }, D = (t) => Object.entries(t), { version: pr, ...Se } = De, U = D(Se).reduce((t, [r, a]) => (t[r] = {
3286
+ }, M = (t) => Object.entries(t), { version: wr, ...Ae } = Te, Y = M(Ae).reduce((t, [r, a]) => (t[r] = {
3255
3287
  ...a,
3256
- colorEntries: D(a.colors),
3257
- ansiColorEntries: D(a.ansiColors)
3288
+ colorEntries: M(a.colors),
3289
+ ansiColorEntries: M(a.ansiColors)
3258
3290
  }, t), {});
3259
- D(U);
3260
- const k = ({ variant: t, settings: r, styles: a }) => {
3261
- const n = q.theme({
3291
+ M(Y);
3292
+ const C = ({ variant: t, settings: r, styles: a }) => {
3293
+ const o = A.theme({
3262
3294
  // eslint-disable-next-line @typescript-eslint/naming-convention
3263
3295
  "&": {
3264
3296
  backgroundColor: r.background,
@@ -3285,10 +3317,10 @@ const k = ({ variant: t, settings: r, styles: a }) => {
3285
3317
  }
3286
3318
  }, {
3287
3319
  dark: t === "dark"
3288
- }), c = le.define(a);
3289
- return [n, ce(c)];
3320
+ }), c = ne.define(a);
3321
+ return [o, le(c)];
3290
3322
  };
3291
- k({
3323
+ C({
3292
3324
  variant: "dark",
3293
3325
  settings: {
3294
3326
  background: "#200020",
@@ -3370,7 +3402,7 @@ k({
3370
3402
  }
3371
3403
  ]
3372
3404
  });
3373
- k({
3405
+ C({
3374
3406
  variant: "light",
3375
3407
  settings: {
3376
3408
  background: "#fcfcfc",
@@ -3444,7 +3476,7 @@ k({
3444
3476
  }
3445
3477
  ]
3446
3478
  });
3447
- k({
3479
+ C({
3448
3480
  variant: "dark",
3449
3481
  settings: {
3450
3482
  background: "#15191EFA",
@@ -3500,7 +3532,7 @@ k({
3500
3532
  }
3501
3533
  ]
3502
3534
  });
3503
- k({
3535
+ C({
3504
3536
  variant: "dark",
3505
3537
  settings: {
3506
3538
  background: "#2e241d",
@@ -3550,7 +3582,7 @@ k({
3550
3582
  }
3551
3583
  ]
3552
3584
  });
3553
- k({
3585
+ C({
3554
3586
  variant: "dark",
3555
3587
  settings: {
3556
3588
  background: "#3b2627",
@@ -3612,7 +3644,7 @@ k({
3612
3644
  }
3613
3645
  ]
3614
3646
  });
3615
- k({
3647
+ C({
3616
3648
  variant: "dark",
3617
3649
  settings: {
3618
3650
  background: "#000205",
@@ -3648,7 +3680,7 @@ k({
3648
3680
  }
3649
3681
  ]
3650
3682
  });
3651
- k({
3683
+ C({
3652
3684
  variant: "light",
3653
3685
  settings: {
3654
3686
  background: "#fff",
@@ -3690,7 +3722,7 @@ k({
3690
3722
  }
3691
3723
  ]
3692
3724
  });
3693
- k({
3725
+ C({
3694
3726
  variant: "dark",
3695
3727
  settings: {
3696
3728
  background: "#00254b",
@@ -3762,7 +3794,7 @@ k({
3762
3794
  }
3763
3795
  ]
3764
3796
  });
3765
- k({
3797
+ C({
3766
3798
  variant: "dark",
3767
3799
  settings: {
3768
3800
  background: "#060521",
@@ -3822,7 +3854,7 @@ k({
3822
3854
  }
3823
3855
  ]
3824
3856
  });
3825
- k({
3857
+ C({
3826
3858
  variant: "dark",
3827
3859
  settings: {
3828
3860
  background: "#2d2f3f",
@@ -3869,7 +3901,7 @@ k({
3869
3901
  }
3870
3902
  ]
3871
3903
  });
3872
- k({
3904
+ C({
3873
3905
  variant: "light",
3874
3906
  settings: {
3875
3907
  background: "#FFFFFF",
@@ -3909,7 +3941,7 @@ k({
3909
3941
  }
3910
3942
  ]
3911
3943
  });
3912
- k({
3944
+ C({
3913
3945
  variant: "light",
3914
3946
  settings: {
3915
3947
  background: "#f2f1f8",
@@ -3984,7 +4016,7 @@ k({
3984
4016
  }
3985
4017
  ]
3986
4018
  });
3987
- k({
4019
+ C({
3988
4020
  variant: "light",
3989
4021
  settings: {
3990
4022
  background: "#faf4ed",
@@ -4038,7 +4070,7 @@ k({
4038
4070
  }
4039
4071
  ]
4040
4072
  });
4041
- k({
4073
+ C({
4042
4074
  variant: "light",
4043
4075
  settings: {
4044
4076
  background: "#FFFFFF",
@@ -4116,7 +4148,7 @@ k({
4116
4148
  }
4117
4149
  ]
4118
4150
  });
4119
- k({
4151
+ C({
4120
4152
  variant: "light",
4121
4153
  settings: {
4122
4154
  background: "#fef7e5",
@@ -4188,7 +4220,7 @@ k({
4188
4220
  }
4189
4221
  ]
4190
4222
  });
4191
- k({
4223
+ C({
4192
4224
  variant: "light",
4193
4225
  settings: {
4194
4226
  background: "#FFFFFF",
@@ -4238,19 +4270,19 @@ k({
4238
4270
  }
4239
4271
  ]
4240
4272
  });
4241
- const qe = new se(), He = (t = "latte") => {
4242
- const r = U[t].colors, a = r.base, n = t === "latte" ? "#484b64" : r.text.hex, c = $e(r.crust.rgb, a.rgb, 0.1);
4243
- return [
4244
- k({
4273
+ const De = new ce(), Se = (t = "latte") => {
4274
+ const r = Y[t].colors, a = r.base, o = t === "latte" ? "#484b64" : r.text.hex, c = He(r.crust.rgb, a.rgb, 0.1);
4275
+ return document.querySelector(":root").style.setProperty("--editor-background", a.hex), [
4276
+ C({
4245
4277
  variant: t === "latte" ? "light" : "dark",
4246
4278
  settings: {
4247
4279
  background: a.hex,
4248
- foreground: n,
4280
+ foreground: o,
4249
4281
  caret: r.rosewater.hex,
4250
4282
  // selection: selection,
4251
4283
  lineHighlight: H(r.overlay1.rgb, 0.1),
4252
4284
  gutterBackground: a.hex,
4253
- gutterForeground: n
4285
+ gutterForeground: o
4254
4286
  },
4255
4287
  styles: [
4256
4288
  // python
@@ -4293,7 +4325,7 @@ const qe = new se(), He = (t = "latte") => {
4293
4325
  // no necesary good
4294
4326
  { tag: e.labelName, color: r.teal.hex },
4295
4327
  // no necesary good
4296
- { tag: e.variableName, color: n },
4328
+ { tag: e.variableName, color: o },
4297
4329
  // no necesary good
4298
4330
  { tag: e.operator, color: r.sky.hex },
4299
4331
  { tag: e.logicOperator, color: r.sky.hex },
@@ -4321,20 +4353,28 @@ const qe = new se(), He = (t = "latte") => {
4321
4353
  { tag: e.macroName, color: r.peach.hex }
4322
4354
  ]
4323
4355
  }),
4324
- q.theme({
4356
+ A.theme({
4325
4357
  // Editor
4326
4358
  "& .cm-selectionBackground, ::selection": { background: `${H(r.overlay2.rgb, 0.3)} !important` },
4327
4359
  // Code
4328
4360
  "& .cb-content, & .ic": { backgroundColor: c },
4329
- ".cb-icon": { fill: n },
4361
+ ".cb-icon": { fill: o },
4330
4362
  ".wg-codeblock-btn:hover": { backgroundColor: H(r.overlay1.rgb, 0.2) },
4331
4363
  // Blockquote
4332
- ".bq-none-mark": { "--bq-none-mark": n },
4364
+ ".bq-none-mark": { "--bq-none-mark": o },
4333
4365
  ".bq-note-mark": { "--bq-note-mark": r.blue.hex },
4334
4366
  ".bq-tip-mark": { "--bq-tip-mark": r.green.hex },
4335
4367
  ".bq-warning-mark": { "--bq-warning-mark": r.peach.hex },
4336
4368
  ".bq-important-mark": { "--bq-important-mark": r.mauve.hex },
4337
4369
  ".bq-caution-mark": { "--bq-caution-mark": r.red.hex },
4370
+ ".wg-qt-icon": {
4371
+ "--bq-none-mark": o,
4372
+ "--bq-note-mark": r.blue.hex,
4373
+ "--bq-tip-mark": r.green.hex,
4374
+ "--bq-warning-mark": r.peach.hex,
4375
+ "--bq-important-mark": r.mauve.hex,
4376
+ "--bq-caution-mark": r.red.hex
4377
+ },
4338
4378
  // Links
4339
4379
  "& a.url": { color: r.blue.hex },
4340
4380
  "& a.url:visited": { color: r.mauve.hex },
@@ -4348,12 +4388,37 @@ const qe = new se(), He = (t = "latte") => {
4348
4388
  }
4349
4389
  }, { dark: t !== "latte" })
4350
4390
  ];
4351
- }, $e = (t, r, a) => {
4352
- const n = [t.r, t.g, t.b], c = [r.r, r.g, r.b];
4353
- return `rgba(${be(n, c, a, 0.3).join(", ")})`;
4354
- }, H = (t, r) => `rgba(${t.r}, ${t.g}, ${t.b}, ${r})`;
4355
- function Oe(t, r) {
4356
- const a = ["Document", "ListItem", "BulletList", "OrderedList"], n = {
4391
+ }, He = (t, r, a) => {
4392
+ const o = [t.r, t.g, t.b], c = [r.r, r.g, r.b];
4393
+ return `rgba(${de(o, c, a, 0.3).join(", ")})`;
4394
+ }, H = (t, r) => `rgba(${t.r}, ${t.g}, ${t.b}, ${r})`, $e = (t) => `<svg class="qt-icon qt-caution" width="400" height="400" viewBox="0 0 400 400" fill="none" xmlns="http://www.w3.org/2000/svg">
4395
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M196.094 54.176C191.229 54.988 188.782 56.222 167.834 68.423C158.562 73.823 147.197 80.435 142.578 83.117C137.959 85.799 129.961 90.458 124.805 93.47C119.648 96.482 111.211 101.406 106.055 104.413C84.503 116.982 82.78 118.066 79.627 121.029C76.043 124.397 73.548 127.986 71.861 132.199C69.426 138.28 69.543 135.024 69.435 199.872L69.336 259.18L70.21 263.086C72.901 275.106 75.333 277.456 99.826 291.697C130.626 309.606 166.896 330.685 175.781 335.841C190.902 344.615 195.154 346.196 201.915 345.563C208.158 344.978 210.107 344.123 225.391 335.264C255.218 317.977 294.844 294.867 311.417 285.093C322.591 278.504 327.153 273.047 329.413 263.569L330.273 259.961V199.609V139.258L329.396 135.938C327.721 129.594 324.327 124.148 319.504 120.066C316.509 117.531 317.424 118.075 248.047 77.651C205.151 52.657 205.162 52.662 196.094 54.176ZM206.746 110.34C212.104 111.475 216.464 114.838 218.945 119.75C220.313 122.457 220.428 126.187 219.575 140.039C219.323 144.121 218.592 157.129 217.95 168.945C214.743 227.944 214.663 228.952 212.917 232.683C208.369 242.403 195.202 244.021 188.814 235.646C185.935 231.872 185.59 229.751 184.375 208.398C183.935 200.664 182.688 180.01 181.605 162.5C178.965 119.84 178.966 119.825 183.963 114.828C188.541 110.25 197.755 108.434 206.746 110.34ZM205.105 254.139C220.433 258.641 225.321 277.899 213.857 288.623C198.306 303.17 174.003 287.211 181.04 267.073C184.452 257.309 195.564 251.336 205.105 254.139Z"/>
4396
+ </svg>`, Oe = (t) => `<svg class="qt-icon qt-warning" width="400" height="400" viewBox="0 0 400 400" fill="none" xmlns="http://www.w3.org/2000/svg">
4397
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M195.982 53.527C185.35 55.195 178.527 60.217 172.381 70.898C165.461 82.925 148.022 114.138 122.184 160.742C115.633 172.559 100.427 199.98 88.394 221.68C57.505 277.38 55.934 280.238 54.25 283.76C45.588 301.882 55.075 322.592 74.884 328.805L78.32 329.883L198.438 329.99C278.577 330.062 319.42 329.965 321.154 329.699C337.809 327.15 349.594 312.698 348.718 295.898C348.297 287.827 348.329 287.895 328.438 252.148C310.272 219.501 297.79 196.996 280.665 166.016C235.38 84.092 225.675 66.998 222.278 63.175C216.156 56.285 204.847 52.136 195.982 53.527ZM209.263 116.46C218.176 119.751 220.681 125.503 219.95 141.003C219.711 146.059 219.256 155.732 218.938 162.5C218.62 169.268 218.011 180.43 217.584 187.305C216.759 200.593 216.366 207.385 215.42 224.66C215.058 231.282 214.609 236.196 214.259 237.373C210.281 250.771 189.551 250.542 185.792 237.058C185.226 235.025 184.802 229.702 183.979 214.258C183.761 210.176 183.323 202.881 183.006 198.047C182.213 185.991 181.756 178.028 181.054 164.063C180.724 157.51 180.287 149.424 180.081 146.094C178.833 125.858 181.444 119.151 191.797 115.99C194.231 115.247 206.901 115.588 209.263 116.46ZM205.893 260.709C224.265 266.28 227.749 290.936 211.55 300.733C192.458 312.28 170.521 292.287 180.334 272.284C184.884 263.009 196.351 257.816 205.893 260.709Z"/>
4398
+ </svg>`, Re = (t) => `<svg class="qt-icon qt-important" width="400" height="400" viewBox="0 0 400 400" fill="none" xmlns="http://www.w3.org/2000/svg">
4399
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M190.234 64.334C153.518 67.16 117.751 87.08 95.346 117.181C46.258 183.13 68.9 277.91 142.564 314.837C228.927 358.129 330.405 294.361 330.594 196.68C330.742 119.807 265.747 58.523 190.234 64.334ZM219.531 126.465C220.494 126.947 221.218 127.78 221.98 129.284L223.062 131.421L222.957 139.621L222.852 147.822L221.875 148.263C213.74 151.931 214.67 145.87 214.532 196.094C214.395 245.634 214.025 242.228 219.783 244.354C223.193 245.613 223.047 245.172 223.047 254.214C223.047 263.28 222.791 264.649 220.681 266.868L219.262 268.359H200.09H180.919L179.769 267.392C177.295 265.31 176.926 263.501 177.043 254.054C177.131 246.999 177.246 245.543 177.734 245.295C178.057 245.131 179.5 244.445 180.943 243.77C182.568 243.01 183.905 242.067 184.459 241.291L185.352 240.039L185.456 197.305C185.559 155.268 185.548 154.545 184.78 152.959C183.999 151.347 181.2 149.279 178.906 148.622C176.957 148.063 176.953 148.047 176.953 139.659C176.953 129.986 177.595 127.658 180.624 126.34C182.693 125.439 217.703 125.552 219.531 126.465Z"/>
4400
+ </svg>`, We = (t) => `<svg class="qt-icon qt-note" width="400" height="400" viewBox="0 0 400 400" fill="none" xmlns="http://www.w3.org/2000/svg">
4401
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M107.227 63.8769C101.558 65.1289 95.375 67.9369 91.406 71.0639C90.01 72.1639 88.215 73.5439 87.417 74.1299C86.62 74.7159 85.96 75.3819 85.952 75.6099C85.944 75.8379 85.612 76.3739 85.214 76.8009C81.982 80.2699 78.079 87.8199 76.776 93.1259L75.781 97.1769V198.907C75.781 262.894 75.922 301.425 76.16 302.76C76.368 303.928 76.623 305.38 76.726 305.987C78.4 315.889 87.879 327.367 98.558 332.423C107.578 336.694 98.739 336.366 201.563 336.242L291.602 336.133L294.27 335.228C309.157 330.183 318.557 320.61 322.536 306.445L323.633 302.539V228.516C323.633 144.681 323.906 151.756 320.402 144.774L318.615 141.211L286.943 109.57C269.523 92.1679 253.932 76.5229 252.297 74.8049C246.111 68.3049 241.836 65.3209 236.902 64.0589C233.006 63.0629 111.686 62.8929 107.227 63.8769ZM233.77 78.3359C236.715 80.5619 300.292 144.132 300.799 145.356C301.574 147.227 300.841 149.245 299.01 150.282L297.461 151.159L274.127 151.165C258.248 151.17 250.198 151.032 248.931 150.734C240.06 148.649 234.561 144.527 231.043 137.327C228.119 131.344 228.085 130.936 228.21 104.035L228.32 80.5309L229.275 79.5149C229.801 78.9559 230.767 78.3419 231.424 78.1519C233.014 77.6899 232.904 77.6809 233.77 78.3359ZM192.354 175.195C194.09 176.288 194.73 177.166 196.549 180.952C197.924 183.813 194.551 189.489 190.695 190.803C187.744 191.808 132.089 191.686 129.883 190.669C122.396 187.22 123.011 176.607 130.837 174.194C131.386 174.024 145.033 173.917 161.164 173.954L190.492 174.023L192.354 175.195ZM269.587 217.641C271.831 218.313 276.709 223.047 275.158 223.047C275.018 223.047 275.115 223.301 275.373 223.611C277.4 226.054 274.593 231.969 270.523 233.832L268.466 234.774L199.37 234.672L130.273 234.57L128.645 233.465C122.49 229.288 123.57 220.238 130.522 217.722C132.38 217.05 267.351 216.971 269.587 217.641ZM247.509 261.237C249.631 262.341 252.9 266.371 252.223 267.048C252.125 267.146 252.179 267.824 252.344 268.555C252.508 269.285 252.542 269.985 252.417 270.109C252.293 270.233 252.148 270.627 252.096 270.984C251.721 273.539 250.106 275.678 247.498 277.074L245.898 277.93L189.258 278.036C138.155 278.132 132.426 278.082 130.664 277.516C122.018 274.742 123.019 262.33 132.031 260.562C132.783 260.414 158.711 260.317 189.648 260.347L245.898 260.4L247.509 261.237Z"/>
4402
+ </svg>`, Ie = (t) => `<svg class="qt-icon qt-tip" width="400" height="400" viewBox="0 0 400 400" fill="none" xmlns="http://www.w3.org/2000/svg">
4403
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M197.813 54.2439C196.932 54.6529 195.79 55.5789 195.274 56.3019L194.336 57.6169L194.219 70.8359L194.102 84.0549L195.076 85.3319C197.802 88.9059 203.271 88.5369 205.364 84.6369C206.151 83.1699 206.872 60.7239 206.215 58.1479C205.842 56.6839 203.21 53.9059 202.196 53.9059C201.901 53.9059 201.155 53.8149 200.537 53.7039C199.864 53.5829 198.772 53.7989 197.813 54.2439ZM116.233 86.0419C113.323 87.6899 112.27 91.6249 113.92 94.6849C115.402 97.4339 131.364 113.194 132.973 113.496C138.573 114.546 142.477 110.343 140.971 104.883C140.465 103.049 125.118 87.2169 122.574 85.9039C120.632 84.9019 118.15 84.9559 116.233 86.0419ZM277.93 85.7559C276.466 86.4829 260.132 103.191 259.49 104.618C257.281 109.529 261.871 114.699 267.084 113.171C268.604 112.726 283.491 98.5359 285.985 95.1559C289.892 89.8619 283.853 82.8139 277.93 85.7559ZM192.578 105.326C174.207 107.647 159.188 115.505 147.608 128.855C123.664 156.459 124.119 191.541 148.828 223.047C160.759 238.26 165.383 249.444 166.996 266.992C167.829 276.054 168.682 277.986 172.825 280.204C174.652 281.182 221.998 281.773 225.389 280.86C229.012 279.884 232.583 275.584 232.967 271.735C233.077 270.63 233.363 267.529 233.603 264.844C234.904 250.229 238.454 241.734 249.573 226.622C261.236 210.772 265.303 202.299 269.01 186.133C271.624 174.731 269.08 156.872 263.028 144.145C251.295 119.471 219.462 101.931 192.578 105.326ZM88.992 165.981C83.602 166.183 82.734 166.309 81.765 167.028C77.932 169.873 77.932 174.66 81.766 177.503C83.099 178.491 104.15 178.988 108.11 178.124C114.214 176.794 115.972 170.208 111.179 166.626C109.976 165.727 101.966 165.494 88.992 165.981ZM289.847 166.481C285.102 168.919 285.171 174.882 289.974 177.45C292.2 178.64 314.187 179.022 317.07 177.921C322.542 175.831 321.886 167.919 316.118 166.457C312.336 165.498 291.723 165.517 289.847 166.481ZM132.14 230.477C129.964 231.352 113.316 248.951 113.059 250.648C112.263 255.894 117.791 260.112 122.389 257.768C124.057 256.918 139.906 240.858 140.656 239.258C143.226 233.779 137.81 228.195 132.14 230.477ZM262.386 230.871C259.487 232.447 258.349 236.857 260.122 239.648C261.348 241.579 276.261 256.486 277.701 257.219C282.933 259.885 288.816 254.457 286.416 249.179C285.559 247.294 271.67 232.693 269.4 231.29C267.429 230.071 264.211 229.879 262.386 230.871ZM174.576 292.561C170.753 293.719 169.922 295.59 169.922 303.033C169.922 310.255 170.618 312.154 173.969 314.076L175.977 315.227L200.113 315.231C223.446 315.234 224.301 315.208 225.774 314.457C229.279 312.669 230.367 309.882 230.446 302.493L230.504 297.04L229.29 295.365C226.903 292.07 228.123 292.201 200.195 292.23C186.66 292.243 175.131 292.392 174.576 292.561ZM180.946 325.217C179.882 325.963 179.759 328.554 180.683 330.774C185.032 341.224 208.831 343.084 217.528 333.654C220.185 330.773 221.108 326.967 219.531 325.391C218.456 324.315 182.465 324.154 180.946 325.217Z"/>
4404
+ </svg>`, P = { tip: Ie, note: We, important: Re, warning: Oe, caution: $e, none: () => "" };
4405
+ class Pe extends E {
4406
+ constructor(r) {
4407
+ super(), this.type = r;
4408
+ }
4409
+ toDOM() {
4410
+ let r = document.createElement("span");
4411
+ return r.setAttribute("aria-hidden", "true"), r.className = "wg-qt-icon", r.innerHTML = this.type in P ? P[this.type]() : "", r;
4412
+ }
4413
+ ignoreEvent() {
4414
+ return !1;
4415
+ }
4416
+ eq(r) {
4417
+ return this.type === r.type;
4418
+ }
4419
+ }
4420
+ function Ze(t, r) {
4421
+ const a = ["Document", "ListItem", "BulletList", "OrderedList"], o = {
4357
4422
  none: "bq-none-mark",
4358
4423
  note: "bq-note-mark",
4359
4424
  tip: "bq-tip-mark",
@@ -4361,56 +4426,61 @@ function Oe(t, r) {
4361
4426
  important: "bq-important-mark",
4362
4427
  caution: "bq-caution-mark"
4363
4428
  }, c = {
4364
- QuoteMark: (o, s, g) => {
4429
+ QuoteMark: (n, s, g) => {
4365
4430
  const d = ["qt-mk"];
4366
- return g in n ? d.push(n[g]) : d.push(n.none), h.mark({
4431
+ return g in o ? d.push(o[g]) : d.push(o.none), h.mark({
4367
4432
  class: d.join(" ")
4368
- }).range(o, s);
4369
- },
4370
- BlockquoteLine: (o, s) => h.line({ class: "bq-line " + (s ? "sw" : "") }).range(o),
4371
- quoteLine: (o, s, g) => {
4433
+ }).range(n, s);
4434
+ },
4435
+ QuoteType: (n, s, g) => h.widget({
4436
+ widget: new Pe(g),
4437
+ side: 1
4438
+ }).range(n),
4439
+ BlockquoteLine: (n, s) => h.line({ class: "bq-line " + (s ? "sw" : "") }).range(n),
4440
+ quoteLine: (n, s, g) => {
4372
4441
  const d = `calc(100% - ${Math.max(0, g) + 1.2}ch)`;
4373
4442
  return h.mark({
4374
4443
  class: "bq-text-line",
4375
4444
  attributes: { style: `width: ${d}` }
4376
- }).range(o, s);
4445
+ }).range(n, s);
4377
4446
  }
4378
- }, i = (o, s, g, d) => {
4379
- const b = [], { from: y, to: f } = s, u = g.number, F = (B, x) => {
4447
+ }, i = (n, s, g, d) => {
4448
+ const b = [], k = g.number, u = (m, x) => {
4449
+ let F = 0;
4450
+ const y = [];
4380
4451
  let p = 0;
4381
- const E = [];
4382
- let A = 0;
4383
4452
  return {
4384
- enter({ name: T, node: O, from: R, to: W }) {
4385
- T === "Blockquote" && E.push(Re(o, O)), T === "QuoteMark" && (b.push(c[T](R, W, E[p])), A = W, p++);
4453
+ enter({ name: w, node: O, from: D, to: S }) {
4454
+ w === "Blockquote" && y.push(ze(n, O)), w === "QuoteMark" && (b.push(c[w](D, S, y[F])), p = S, F++), w === "QuoteType" && b.push(c[w](D, S, y[F - 1]));
4386
4455
  },
4387
- leave({ name: T, from: O, to: R }) {
4388
- T === "Paragraph" && A < x && b.push(c.quoteLine(A, x, A - B));
4456
+ leave({ name: w, from: O, to: D }) {
4457
+ w === "Paragraph" && p < x && b.push(c.quoteLine(p, x, p - m));
4389
4458
  }
4390
4459
  };
4391
4460
  };
4392
- for (let B = u; B < d + u; B++) {
4393
- const { from: x, to: p } = o.state.doc.line(B), { from: E, to: A } = s, T = N(o, E, A);
4394
- b.push(c.BlockquoteLine(x, T)), $(o.state).iterate({ from: x, to: p, ...F(x, p) });
4461
+ for (let m = k; m < d + k; m++) {
4462
+ const { from: x, to: F } = n.state.doc.line(m), { from: y, to: p } = s, w = N(n, y, p);
4463
+ b.push(c.BlockquoteLine(x, w)), $(n.state).iterate({ from: x, to: F, ...u(x, F) });
4395
4464
  }
4396
4465
  return b;
4397
4466
  }, l = [];
4398
- return v(t, {
4399
- enter: ({ name: o }) => !(o in a),
4400
- leave: ({ name: o, from: s, to: g, node: d }) => {
4401
- if (o !== "Blockquote") return;
4402
- const b = t.state.sliceDoc(s, g).split(`
4403
- `), y = t.state.doc.lineAt(s);
4404
- l.push(...i(t, d, y, b.length));
4467
+ return L(t, {
4468
+ enter: ({ name: n, from: s, to: g, node: d }) => {
4469
+ if (n === "Blockquote") {
4470
+ const b = t.state.sliceDoc(s, g).split(`
4471
+ `), k = t.state.doc.lineAt(s);
4472
+ l.push(...i(t, d, k, b.length));
4473
+ }
4474
+ return a.includes(n);
4405
4475
  }
4406
4476
  }), h.set(l, !0);
4407
4477
  }
4408
- const Re = (t, r) => {
4478
+ const ze = (t, r) => {
4409
4479
  const a = r.getChild("QuoteType");
4410
4480
  if (!a) return "none";
4411
- const n = a.getChild("QuoteTypeText");
4412
- return n ? t.state.sliceDoc(n.from, n.to).toLowerCase() : "none";
4413
- }, We = () => w.baseTheme({
4481
+ const o = a.getChild("QuoteTypeText");
4482
+ return o ? t.state.sliceDoc(o.from, o.to).toLowerCase() : "none";
4483
+ }, Qe = () => B.baseTheme({
4414
4484
  "& .qt-mk": {
4415
4485
  // outline: "1px red solid",
4416
4486
  position: "relative",
@@ -4443,106 +4513,122 @@ const Re = (t, r) => {
4443
4513
  paddingLeft: "6px",
4444
4514
  textIndent: "-7px",
4445
4515
  ariaHidden: "true"
4446
- }
4447
- }), Ie = (t) => [
4448
- C(Oe, t),
4449
- We()
4450
- ], Pe = {
4516
+ },
4517
+ "& .bq-text-line *": {
4518
+ verticalAlign: "middle"
4519
+ },
4520
+ "& .wg-qt-icon": {
4521
+ display: "inline-block"
4522
+ },
4523
+ "& .wg-qt-icon > .qt-icon": {
4524
+ paddingLeft: "1ch",
4525
+ width: "2em",
4526
+ height: "2em"
4527
+ },
4528
+ "& .wg-qt-icon > .qt-tip": { fill: "var(--bq-tip-mark)" },
4529
+ "& .wg-qt-icon > .qt-note": { fill: "var(--bq-note-mark)" },
4530
+ "& .wg-qt-icon > .qt-important": { fill: "var(--bq-important-mark)" },
4531
+ "& .wg-qt-icon > .qt-warning": { fill: "var(--bq-warning-mark)" },
4532
+ "& .wg-qt-icon > .qt-caution": { fill: "var(--bq-caution-mark)" }
4533
+ }), Ke = (t) => [
4534
+ v(Ze, t),
4535
+ Qe()
4536
+ ], Ge = {
4451
4537
  name: "QuoteTypeParser",
4452
4538
  parse(t, r) {
4453
4539
  if ((() => {
4454
- for (let n = 0; n < t.depth; n++)
4455
- if (t.parentType(n).name === "Blockquote") return !0;
4540
+ for (let o = 0; o < t.depth; o++)
4541
+ if (t.parentType(o).name === "Blockquote") return !0;
4456
4542
  return !1;
4457
4543
  })()) {
4458
- const n = r.text.match(/^(\s*>\s*)+(\[!\w+\])\s*$/);
4459
- if (n && n[2]) {
4460
- const c = n[2], i = r.text.indexOf(c), l = i + c.length, o = t.elt("QuoteType", t.lineStart + i, t.lineStart + l);
4461
- o.children = [
4544
+ const o = r.text.match(/^(\s*>\s*)+(\[!\w+\])\s*$/);
4545
+ if (o && o[2]) {
4546
+ const c = o[2], i = r.text.indexOf(c), l = i + c.length, n = t.elt("QuoteType", t.lineStart + i, t.lineStart + l);
4547
+ n.children = [
4462
4548
  t.elt("QuoteTypeMark", t.lineStart + i, t.lineStart + i + 2),
4463
4549
  t.elt("QuoteTypeText", t.lineStart + i + 2, t.lineStart + l - 1),
4464
4550
  t.elt("QuoteTypeMark", t.lineStart + l - 1, t.lineStart + l)
4465
- ], t.addElement(o);
4551
+ ], t.addElement(n);
4466
4552
  }
4467
4553
  }
4468
4554
  return !1;
4469
4555
  }
4470
- }, Ke = {
4556
+ }, _e = {
4471
4557
  defineNodes: [
4472
4558
  { name: "QuoteType", style: { "QuoteType/...": e.content } },
4473
4559
  { name: "QuoteTypeMark", style: e.processingInstruction },
4474
4560
  { name: "QuoteTypeText", style: e.bool }
4475
4561
  ],
4476
- parseBlock: [Pe]
4477
- }, V = (t, r, a) => {
4478
- const n = t.state.sliceDoc(r, a), c = n.match(/\[(.*)\]/);
4562
+ parseBlock: [Ge]
4563
+ }, j = (t, r, a) => {
4564
+ const o = t.state.sliceDoc(r, a), c = o.match(/\[(.*)\]/);
4479
4565
  return c !== null && c.length > 1 ? {
4480
4566
  text: c[1],
4481
- from: r + n.indexOf(c[1]),
4567
+ from: r + o.indexOf(c[1]),
4482
4568
  to: r + 1 + c[1].length
4483
4569
  } : { text: null };
4484
4570
  };
4485
- function ze(t, r) {
4486
- const a = ["FencedCode", "Image", "Link"], n = {
4571
+ function Ye(t, r) {
4572
+ const a = ["FencedCode", "Image", "Link"], o = {
4487
4573
  Link: {
4488
4574
  marks: ["LinkMark"],
4489
4575
  url: "URL"
4490
4576
  }
4491
4577
  }, c = {
4492
- Link: (l, o, s) => h.mark({ class: "link " + (s ? "sw" : "") }).range(l, o),
4493
- LinkMark: (l, o) => h.mark({ class: "lk-mk" }).range(l, o),
4494
- TextDec: (l, o, s) => h.mark({
4578
+ Link: (l, n, s) => h.mark({ class: "link " + (s ? "sw" : "") }).range(l, n),
4579
+ LinkMark: (l, n) => h.mark({ class: "lk-mk" }).range(l, n),
4580
+ TextDec: (l, n, s) => h.mark({
4495
4581
  class: "lk-text url",
4496
4582
  tagName: "a",
4497
4583
  attributes: { href: s, target: "_blank" }
4498
- }).range(l, o),
4499
- URL: (l, o, s) => h.mark({
4584
+ }).range(l, n),
4585
+ URL: (l, n, s) => h.mark({
4500
4586
  class: "lk-url url",
4501
4587
  tagName: "a",
4502
4588
  attributes: { href: s, target: "_blank" }
4503
- }).range(l, o)
4589
+ }).range(l, n)
4504
4590
  }, i = [];
4505
- return v(t, {
4506
- enter: ({ type: { name: l }, from: o, to: s, node: g }) => {
4507
- if (l === "URL" && i.push(c.URL(o, s, t.state.sliceDoc(o, s))), !(l in n)) return !a.includes(l);
4508
- i.push(c.Link(o, s, N(t, o, s)));
4509
- const d = n[l].marks.flatMap((f) => g.getChildren(f));
4510
- i.push(...d.map(({ from: f, to: u }) => c.LinkMark(f, u)));
4511
- const b = g.getChild(n[l].url);
4512
- let y = null;
4591
+ return L(t, {
4592
+ enter: ({ type: { name: l }, from: n, to: s, node: g }) => {
4593
+ if (l === "URL" && i.push(c.URL(n, s, t.state.sliceDoc(n, s))), !(l in o)) return !a.includes(l);
4594
+ i.push(c.Link(n, s, N(t, n, s)));
4595
+ const d = o[l].marks.flatMap((u) => g.getChildren(u));
4596
+ i.push(...d.map(({ from: u, to: m }) => c.LinkMark(u, m)));
4597
+ const b = g.getChild(o[l].url);
4598
+ let k = null;
4513
4599
  if (b !== null) {
4514
- const { from: f, to: u } = b;
4515
- y = t.state.sliceDoc(f, u), i.push(c.URL(f, u, y));
4600
+ const { from: u, to: m } = b;
4601
+ k = t.state.sliceDoc(u, m), i.push(c.URL(u, m, k));
4516
4602
  }
4517
4603
  if (g.getChild("Image") === null) {
4518
- const { text: f, from: u, to: F } = V(t, o, s);
4519
- f !== null && y !== null && i.push(c.TextDec(u, F, y));
4604
+ const { text: u, from: m, to: x } = j(t, n, s);
4605
+ u !== null && k !== null && i.push(c.TextDec(m, x, k));
4520
4606
  }
4521
4607
  return !1;
4522
4608
  }
4523
4609
  }), h.set(i, !0);
4524
4610
  }
4525
- const Ge = (t, r) => t.ctrlKey ? Qe(
4611
+ const je = (t, r) => t.ctrlKey ? Ve(
4526
4612
  t.target
4527
4613
  /* as HTMLElement */
4528
- ) : !1, Qe = (t) => {
4614
+ ) : !1, Ve = (t) => {
4529
4615
  if (t.nodeName === "A" && t.href && t.classList.contains("url"))
4530
4616
  return window.open(t.href, t.target), !0;
4531
- }, _e = w.baseTheme({
4617
+ }, Ue = B.baseTheme({
4532
4618
  ".lk-mk, .link > .lk-url": { display: "none" },
4533
4619
  "&.cm-focused .link.sw .lk-mk, &.cm-focused .link.sw .lk-url": { display: "inherit" }
4534
- }), Ye = (t = {}) => {
4620
+ }), Xe = (t = {}) => {
4535
4621
  const {
4536
4622
  hideMarks: r = !0
4537
4623
  } = t;
4538
4624
  return [
4539
- C(ze, {}, { eventHandlers: { mousedown: Ge } }),
4540
- _e
4625
+ v(Ye, {}, { eventHandlers: { mousedown: je } }),
4626
+ Ue
4541
4627
  ];
4542
4628
  };
4543
- class je extends M {
4544
- constructor(r, a = null, n = "[image]") {
4545
- super(), this.img = r, this.url = a, this.alt = n;
4629
+ class Je extends E {
4630
+ constructor(r, a = null, o = "[image]") {
4631
+ super(), this.img = r, this.url = a, this.alt = o;
4546
4632
  }
4547
4633
  toDOM() {
4548
4634
  let r = document.createElement("img");
@@ -4559,46 +4645,46 @@ class je extends M {
4559
4645
  return !1;
4560
4646
  }
4561
4647
  }
4562
- function Ue(t, r) {
4563
- const a = ["FencedCode", "Image"], n = [];
4564
- return v(t, {
4565
- enter: ({ type: { name: c }, from: i, to: l, node: o }) => {
4648
+ function er(t, r) {
4649
+ const a = ["FencedCode", "Image"], o = [];
4650
+ return L(t, {
4651
+ enter: ({ type: { name: c }, from: i, to: l, node: n }) => {
4566
4652
  if (c === "Image" && !N(t, i, l)) {
4567
- const { from: s, to: g } = o.getChild("URL"), d = t.state.sliceDoc(s, g), { text: b } = V(t, i, l);
4568
- n.push(
4653
+ const { from: s, to: g } = n.getChild("URL"), d = t.state.sliceDoc(s, g), { text: b } = j(t, i, l);
4654
+ o.push(
4569
4655
  h.replace({
4570
- widget: new je(d, Ve(t, o), b)
4656
+ widget: new Je(d, rr(t, n), b)
4571
4657
  }).range(i, l)
4572
4658
  );
4573
4659
  }
4574
4660
  return !a.includes(c);
4575
4661
  }
4576
- }), h.set(n, !1);
4662
+ }), h.set(o, !1);
4577
4663
  }
4578
- const Ve = (t, r) => {
4579
- const n = r.parent.getChild("URL");
4580
- if (n !== null) {
4581
- const { from: c, to: i } = n;
4664
+ const rr = (t, r) => {
4665
+ const o = r.parent.getChild("URL");
4666
+ if (o !== null) {
4667
+ const { from: c, to: i } = o;
4582
4668
  return t.state.sliceDoc(c, i);
4583
4669
  }
4584
4670
  return null;
4585
- }, Xe = (t, r) => t.ctrlKey ? Ze(
4671
+ }, tr = (t, r) => t.ctrlKey ? ar(
4586
4672
  t.target
4587
4673
  /* as HTMLElement */
4588
- ) : !1, Ze = (t) => {
4674
+ ) : !1, ar = (t) => {
4589
4675
  const r = t.parentElement ?? !1;
4590
4676
  if (t.nodeName === "IMG" && r && r.nodeName === "A" && r.classList.contains("url"))
4591
4677
  return !0;
4592
- }, Je = w.baseTheme({}), er = (t = {}) => {
4678
+ }, or = B.baseTheme({}), nr = (t = {}) => {
4593
4679
  const {
4594
4680
  hideMarks: r = !0
4595
4681
  } = t;
4596
4682
  return [
4597
- C(Ue, {}, { eventHandlers: { mousedown: Xe } }),
4598
- Je
4683
+ v(er, {}, { eventHandlers: { mousedown: tr } }),
4684
+ or
4599
4685
  ];
4600
4686
  };
4601
- class z extends M {
4687
+ class Z extends E {
4602
4688
  constructor(r, a = !1) {
4603
4689
  super(), this.content = r, this.tag = a;
4604
4690
  }
@@ -4606,8 +4692,8 @@ class z extends M {
4606
4692
  const r = document.createElement("div");
4607
4693
  r.className = "cm-html-widget", r.setAttribute("aria-hidden", "true");
4608
4694
  const a = this.content.replace(/^```html\n?/, "").replace(/```$/, "").trim();
4609
- return r.innerHTML = (this.tag ? '<span class="cm-rendered-tag">RTAG</span>' : "") + a, r.querySelectorAll("script").forEach((n) => {
4610
- n.parentNode.removeChild(n);
4695
+ return r.innerHTML = (this.tag ? '<span class="cm-rendered-tag">RTAG</span>' : "") + a, r.querySelectorAll("script").forEach((o) => {
4696
+ o.parentNode.removeChild(o);
4611
4697
  }), r;
4612
4698
  }
4613
4699
  ignoreEvent(r) {
@@ -4617,20 +4703,20 @@ class z extends M {
4617
4703
  return r.content === this.content;
4618
4704
  }
4619
4705
  }
4620
- const X = ie.define(), rr = ge.define({
4706
+ const V = se.define(), lr = ie.define({
4621
4707
  create(t) {
4622
4708
  return h.none;
4623
4709
  },
4624
4710
  update(t, r) {
4625
4711
  t = t.map(r.changes);
4626
4712
  for (let a of r.effects)
4627
- if (a.is(X))
4713
+ if (a.is(V))
4628
4714
  return a.value;
4629
4715
  return t;
4630
4716
  },
4631
- provide: (t) => q.decorations.from(t)
4717
+ provide: (t) => A.decorations.from(t)
4632
4718
  });
4633
- function tr(t) {
4719
+ function cr(t) {
4634
4720
  const r = [
4635
4721
  /<br>/,
4636
4722
  /<img .*\/>/
@@ -4638,27 +4724,27 @@ function tr(t) {
4638
4724
  HTMLBlock: (c, i) => {
4639
4725
  const l = t.state.doc.sliceString(c, i);
4640
4726
  return [h.replace({
4641
- widget: new z(l),
4727
+ widget: new Z(l),
4642
4728
  inclusive: !1
4643
4729
  }).range(c, i)];
4644
4730
  },
4645
4731
  HTMLTag: (c, i) => {
4646
4732
  const l = t.state.doc.sliceString(c, i);
4647
- return console.log(l), r.some((o) => o.test(l)) ? (console.log(l), [
4733
+ return console.log(l), r.some((n) => n.test(l)) ? (console.log(l), [
4648
4734
  h.replace({
4649
- widget: new z(l, !0),
4735
+ widget: new Z(l, !0),
4650
4736
  inclusive: !1
4651
4737
  }).range(c, i)
4652
4738
  ]) : [];
4653
4739
  }
4654
- }, n = [];
4655
- return v(t, {
4656
- enter: ({ type: c, from: i, to: l, node: o }) => {
4657
- c.name in a && (!N(t, i, l) || !t.hasFocus) && n.push(...a[c.name](i, l));
4740
+ }, o = [];
4741
+ return L(t, {
4742
+ enter: ({ type: c, from: i, to: l, node: n }) => {
4743
+ c.name in a && (!N(t, i, l) || !t.hasFocus) && o.push(...a[c.name](i, l));
4658
4744
  }
4659
- }), h.set(n);
4745
+ }), h.set(o);
4660
4746
  }
4661
- const ar = w.baseTheme({
4747
+ const sr = B.baseTheme({
4662
4748
  "& .cm-html-widget": {
4663
4749
  all: "unset"
4664
4750
  // outline: "red solid 2px",
@@ -4670,62 +4756,62 @@ const ar = w.baseTheme({
4670
4756
  marginTop: "0"
4671
4757
  },
4672
4758
  "& .cm-widgetBuffer": { display: "none" }
4673
- }), or = q.updateListener.of((t) => {
4759
+ }), ir = A.updateListener.of((t) => {
4674
4760
  if (t.selectionSet || t.docChanged || t.focusChanged || t.geometryChanged) {
4675
- const r = tr(t.view);
4676
- t.view.dispatch({ effects: X.of(r) });
4761
+ const r = cr(t.view);
4762
+ t.view.dispatch({ effects: V.of(r) });
4677
4763
  }
4678
- }), nr = (t = {}) => [
4679
- rr,
4680
- or,
4681
- ar
4682
- ], lr = (t = { markdown: {} }) => {
4764
+ }), gr = (t = {}) => [
4765
+ lr,
4766
+ ir,
4767
+ sr
4768
+ ], hr = (t = { markdown: {} }) => {
4683
4769
  const {
4684
4770
  markdown: {
4685
4771
  defaultCodeLanguage: r,
4686
4772
  codeLanguages: a,
4687
- addKeymap: n,
4773
+ addKeymap: o,
4688
4774
  base: c,
4689
4775
  completeHTMLTags: i,
4690
4776
  htmlTagLanguage: l,
4691
- extensions: o = []
4777
+ extensions: n = []
4692
4778
  },
4693
4779
  inline: s,
4694
4780
  Heading: g,
4695
4781
  Hr: d,
4696
4782
  List: b,
4697
- Code: y
4698
- } = t, f = {
4783
+ Code: k
4784
+ } = t, u = {
4699
4785
  defaultCodeLanguage: r,
4700
- codeLanguages: a || ee,
4701
- addKeymap: n,
4786
+ codeLanguages: a || J,
4787
+ addKeymap: o,
4702
4788
  base: c,
4703
4789
  completeHTMLTags: i,
4704
4790
  htmlTagLanguage: l,
4705
- extensions: [...o, te, de, Ke]
4791
+ extensions: [...n, re, he, _e]
4706
4792
  };
4707
4793
  return [
4708
- re(f),
4709
- qe.of(He()),
4794
+ ee(u),
4795
+ De.of(Se()),
4710
4796
  Q(s),
4711
- j(g),
4712
- _(b),
4713
- G(d),
4714
- Y(),
4715
- Ye(),
4716
- er(),
4717
- Ie(),
4718
- nr()
4797
+ _(g),
4798
+ K(b),
4799
+ z(d),
4800
+ G(),
4801
+ Xe(),
4802
+ nr(),
4803
+ Ke(),
4804
+ gr()
4719
4805
  ];
4720
4806
  };
4721
- typeof window < "u" && (window.gnosis = lr, window.HrPlugin = G, window.ListPlugin = _, window.CodePlugin = Y, window.InlinePlugin = Q, window.HeadingPlugin = j);
4807
+ typeof window < "u" && (window.gnosis = hr, window.HrPlugin = z, window.ListPlugin = K, window.CodePlugin = G, window.InlinePlugin = Q, window.HeadingPlugin = _);
4722
4808
  export {
4723
- Y as CodePlugin,
4724
- j as HeadingPlugin,
4725
- G as HrPlugin,
4809
+ G as CodePlugin,
4810
+ _ as HeadingPlugin,
4811
+ z as HrPlugin,
4726
4812
  Q as InlinePlugin,
4727
- _ as ListPlugin,
4728
- He as catppuccin,
4729
- lr as gnosis,
4730
- qe as themeVariant
4813
+ K as ListPlugin,
4814
+ Se as catppuccin,
4815
+ hr as gnosis,
4816
+ De as themeVariant
4731
4817
  };