erl-mathtextx-editor 0.1.2

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.
Files changed (62) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +251 -0
  3. package/dist/CellPropertiesDialogImpl-CgWcr4bD.js +101 -0
  4. package/dist/ContentViewer-DcvxXP9t.js +43 -0
  5. package/dist/ImageInsertDialog-Di0MXcC2.js +222 -0
  6. package/dist/InsertTableDialogImpl-CKirXRqE.js +100 -0
  7. package/dist/LinkDialogImpl-BSz0F-xG.js +136 -0
  8. package/dist/MathTextXEditor.d.ts +8 -0
  9. package/dist/TableTemplatesDialogImpl-DrdqLQLH.js +64 -0
  10. package/dist/TemplatePanel-BE_UfzYM.js +710 -0
  11. package/dist/assets/erl-mathtextx-editor.css +1 -0
  12. package/dist/assets/viewer.css +1 -0
  13. package/dist/components/CellPropertiesDialog.d.ts +4 -0
  14. package/dist/components/CellPropertiesDialogImpl.d.ts +14 -0
  15. package/dist/components/GraphComponent.d.ts +3 -0
  16. package/dist/components/ImageContextMenu.d.ts +18 -0
  17. package/dist/components/ImageEditDialog.d.ts +25 -0
  18. package/dist/components/ImageInsertDialog.d.ts +14 -0
  19. package/dist/components/ImageNodeView.d.ts +3 -0
  20. package/dist/components/InsertTableDialog.d.ts +4 -0
  21. package/dist/components/InsertTableDialogImpl.d.ts +7 -0
  22. package/dist/components/LinkDialog.d.ts +4 -0
  23. package/dist/components/LinkDialogImpl.d.ts +18 -0
  24. package/dist/components/TableMenu.d.ts +21 -0
  25. package/dist/components/TableTemplatesDialog.d.ts +4 -0
  26. package/dist/components/TableTemplatesDialogImpl.d.ts +15 -0
  27. package/dist/components/WordCount.d.ts +6 -0
  28. package/dist/components/__tests__/WordCount.test.d.ts +1 -0
  29. package/dist/components/tableTemplateStyles.d.ts +2 -0
  30. package/dist/components/useDialogA11y.d.ts +6 -0
  31. package/dist/components/wordCountUtils.d.ts +3 -0
  32. package/dist/core/__tests__/serializer.test.d.ts +1 -0
  33. package/dist/core/extensions.d.ts +9 -0
  34. package/dist/core/serializer.d.ts +24 -0
  35. package/dist/erl-mathtextx-editor.js +30 -0
  36. package/dist/erl-mathtextx-editor.umd.cjs +3508 -0
  37. package/dist/extensions/GraphExtension.d.ts +9 -0
  38. package/dist/index-CLGg8QXp.js +8700 -0
  39. package/dist/index-DYxMVo98.js +4599 -0
  40. package/dist/index.d.ts +33 -0
  41. package/dist/math/MathNodes.d.ts +11 -0
  42. package/dist/math/MathTypeDialog.d.ts +8 -0
  43. package/dist/math/MatrixGridSelector.d.ts +5 -0
  44. package/dist/math/SymbolPalette.d.ts +5 -0
  45. package/dist/math/TemplatePanel.d.ts +5 -0
  46. package/dist/mathlive-BwNIIOwE.js +14488 -0
  47. package/dist/templates/index.d.ts +17 -0
  48. package/dist/tiptap-BhJ7Fu9S.js +17927 -0
  49. package/dist/toolbar/MainToolbar.d.ts +14 -0
  50. package/dist/toolbar/MathToolbar.d.ts +7 -0
  51. package/dist/types/index.d.ts +73 -0
  52. package/dist/utils/exportUtils.d.ts +19 -0
  53. package/dist/utils/pasteHandler.d.ts +17 -0
  54. package/dist/viewer/ContentViewer.d.ts +29 -0
  55. package/dist/viewer/index.d.ts +2 -0
  56. package/dist/viewer/styles.d.ts +0 -0
  57. package/dist/viewer-deps-xNPNdmbe.js +12141 -0
  58. package/dist/viewer-styles.d.ts +1 -0
  59. package/dist/viewer-styles.js +1 -0
  60. package/dist/viewer.d.ts +2 -0
  61. package/dist/viewer.js +4 -0
  62. package/package.json +132 -0
@@ -0,0 +1,4599 @@
1
+ import { jsx as e, jsxs as a, Fragment as Z } from "react/jsx-runtime";
2
+ import oe, { useRef as R, useState as H, useEffect as X, useCallback as b, useMemo as Ce, lazy as le, Suspense as te, useId as Lt } from "react";
3
+ import { N as je, a as Ue, R as Ie, m as Te, E as Ye, T as _t, A as zt, b as St, c as Dt, d as Bt, U as Pt, S as Vt, e as Rt, f as It, C as Et, g as Kt, h as $t, i as Ot, j as Ft, k as Wt, F as qt, l as Gt, H as Xt, L as jt, I as Ut, P as Yt, n as Jt, u as Zt, o as Qt } from "./tiptap-BhJ7Fu9S.js";
4
+ import "./ContentViewer-DcvxXP9t.js";
5
+ function Ze(n) {
6
+ const t = n.closest(".mtx-content");
7
+ if (!t)
8
+ return "left";
9
+ const l = n.getBoundingClientRect(), i = t.getBoundingClientRect(), r = (l.left + l.width / 2 - i.left) / Math.max(i.width, 1), s = 0.38, o = 0.62;
10
+ return r <= s ? "left" : r >= o ? "right" : "center";
11
+ }
12
+ function Qe(n, t) {
13
+ if (n == null || n === "")
14
+ return t;
15
+ if (typeof n == "number")
16
+ return `${Math.round(n)}px`;
17
+ const l = n.trim();
18
+ return l ? l === "auto" || l.endsWith("%") || l.endsWith("px") ? l : /^\d+(\.\d+)?$/.test(l) ? `${Math.round(Number(l))}px` : l : t;
19
+ }
20
+ function ea(n) {
21
+ const { node: t, updateAttributes: l, selected: i, getPos: c, editor: r } = n, s = t.attrs, o = R(null), N = R(!1), y = R(null), u = R({ x: 0, y: 0, width: 0, height: 0 }), h = R(s), m = R(() => {
22
+ }), k = R(!1), f = R({ x: 0, y: 0, offsetX: 0, offsetY: 0 }), P = R(() => {
23
+ }), p = R(null), g = R(null), w = R({ x: Number(s.offsetX || 0), y: Number(s.offsetY || 0) }), B = R(s.align === "full" ? "center" : s.align || "center"), _ = R({ width: 0, height: 0 }), W = R(null), q = R(null), ie = R(null), [fe, ae] = H(!1), [me, Ae] = H(!1), [C, j] = H(null), [de, Ne] = H(!1), [, ne] = H(0);
24
+ X(() => {
25
+ h.current = s, w.current = {
26
+ x: Number(s.offsetX || 0),
27
+ y: Number(s.offsetY || 0)
28
+ }, B.current = s.align === "full" ? "center" : s.align || "center";
29
+ }, [s]), X(() => {
30
+ if (!de) return;
31
+ const x = window.setTimeout(() => {
32
+ Ne(!1);
33
+ }, 180);
34
+ return () => window.clearTimeout(x);
35
+ }, [de]);
36
+ const pe = b(() => {
37
+ var x, V;
38
+ (x = q.current) == null || x.remove(), (V = ie.current) == null || V.remove(), q.current = null, ie.current = null;
39
+ }, []), ye = b(() => {
40
+ const x = o.current;
41
+ if (!x) return null;
42
+ const V = x.closest(".mtx-content");
43
+ if (!V) return null;
44
+ const O = V.closest(".mtx-editor") || V;
45
+ if (W.current = O, !ie.current) {
46
+ const E = document.createElement("div");
47
+ E.className = "mtx-image-drag-zone", E.setAttribute("aria-hidden", "true"), O.appendChild(E), ie.current = E;
48
+ }
49
+ if (!q.current) {
50
+ const E = document.createElement("div");
51
+ E.className = "mtx-image-drag-guide", E.setAttribute("aria-hidden", "true"), O.appendChild(E), q.current = E;
52
+ }
53
+ return { wrapper: x, editorContent: V, host: O };
54
+ }, []), ge = b((x) => {
55
+ const V = ye();
56
+ if (!V) return;
57
+ const { editorContent: K, host: O } = V, E = O.getBoundingClientRect(), Y = K.getBoundingClientRect(), J = Y.left - E.left, xe = Y.top - E.top, ke = Y.width, De = Y.height, be = ie.current, se = q.current;
58
+ if (!be || !se) return;
59
+ be.className = "mtx-image-drag-zone", se.className = "mtx-image-drag-guide", be.style.left = `${Math.round(J)}px`, be.style.top = `${Math.round(xe)}px`, be.style.width = `${Math.round(ke)}px`, be.style.height = `${Math.round(De)}px`, se.style.left = `${Math.round(J)}px`, se.style.top = `${Math.round(xe)}px`, se.style.width = `${Math.round(ke)}px`, se.style.height = `${Math.round(De)}px`, se.style.borderLeft = "2px dashed rgba(37, 99, 235, 0.5)", se.style.transform = "translateX(-50%)";
60
+ const Ee = x === "left" ? J + ke * 0.33 : x === "right" ? J + ke * 0.66 : J + ke * 0.5;
61
+ se.style.left = `${Math.round(Ee)}px`;
62
+ }, [ye]);
63
+ X(() => () => {
64
+ pe();
65
+ }, [pe]);
66
+ const G = b((x) => {
67
+ const V = o.current, K = y.current;
68
+ if (!N.current || !V || !K)
69
+ return;
70
+ const O = x.clientX - u.current.x, E = x.clientY - u.current.y;
71
+ let Y = u.current.width, J = u.current.height;
72
+ K.includes("e") ? Y = Math.max(50, u.current.width + O) : K.includes("w") && (Y = Math.max(50, u.current.width - O)), K.includes("s") ? J = Math.max(50, u.current.height + E) : K.includes("n") && (J = Math.max(50, u.current.height - E)), g.current = {
73
+ width: Math.round(Y),
74
+ height: Math.round(J)
75
+ }, p.current === null && (p.current = window.requestAnimationFrame(() => {
76
+ const xe = g.current;
77
+ if (!V || !xe) {
78
+ p.current = null;
79
+ return;
80
+ }
81
+ V.style.width = `${xe.width}px`, h.current.height && h.current.height !== "auto" && (V.style.height = `${xe.height}px`), p.current = null;
82
+ }));
83
+ }, []), Me = b(() => {
84
+ const x = o.current;
85
+ if (!N.current || !x)
86
+ return;
87
+ const V = x.offsetWidth, K = x.offsetHeight;
88
+ l({
89
+ width: Math.round(V),
90
+ height: h.current.height === "auto" ? "auto" : Math.round(K)
91
+ }), N.current = !1, y.current = null, ae(!1), g.current = null, window.removeEventListener("mousemove", G), window.removeEventListener("mouseup", m.current);
92
+ }, [G, l]);
93
+ X(() => {
94
+ m.current = Me;
95
+ }, [Me]);
96
+ const he = b((x) => {
97
+ const V = o.current;
98
+ if (!k.current || !V)
99
+ return;
100
+ const K = f.current.offsetX + (x.clientX - f.current.x), O = f.current.offsetY + (x.clientY - f.current.y);
101
+ w.current = {
102
+ x: Math.round(K),
103
+ y: Math.round(O)
104
+ }, p.current === null && (p.current = window.requestAnimationFrame(() => {
105
+ const E = o.current;
106
+ if (E) {
107
+ E.style.transform = `translate3d(${w.current.x}px, ${w.current.y}px, 0)`;
108
+ const Y = Ze(E);
109
+ Y !== B.current && (B.current = Y, j(Y), ne((J) => J + 1)), ge(B.current);
110
+ }
111
+ p.current = null;
112
+ }));
113
+ }, [ge]), ve = b(() => {
114
+ const x = o.current;
115
+ if (!k.current || !x)
116
+ return;
117
+ const V = B.current || Ze(x);
118
+ k.current = !1, Ae(!1), j(null), Ne(!0), pe(), l({
119
+ align: V,
120
+ offsetX: 0,
121
+ offsetY: 0
122
+ }), x.style.transform = "translate3d(0px, 0px, 0)", w.current = { x: 0, y: 0 }, window.removeEventListener("mousemove", he), window.removeEventListener("mouseup", P.current);
123
+ }, [he, pe, l]);
124
+ X(() => {
125
+ P.current = ve;
126
+ }, [ve]);
127
+ const Q = b((x, V) => {
128
+ x.preventDefault(), x.stopPropagation();
129
+ const K = o.current;
130
+ if (!K)
131
+ return;
132
+ const O = K.getBoundingClientRect();
133
+ u.current = {
134
+ x: x.clientX,
135
+ y: x.clientY,
136
+ width: O.width,
137
+ height: O.height
138
+ }, N.current = !0, y.current = V, ae(!0), window.addEventListener("mousemove", G), window.addEventListener("mouseup", m.current);
139
+ }, [G]), v = b((x) => {
140
+ if (x.button !== 0 || N.current || x.target.closest(".mtx-image-resize-handles"))
141
+ return;
142
+ if (x.preventDefault(), x.stopPropagation(), typeof c == "function") {
143
+ const O = c();
144
+ typeof O == "number" && r.commands.setNodeSelection(O);
145
+ }
146
+ (h.current.align === "center" || h.current.align === "full") && (l({
147
+ align: "left",
148
+ offsetX: 0,
149
+ offsetY: 0
150
+ }), h.current = {
151
+ ...h.current,
152
+ align: "left",
153
+ offsetX: 0,
154
+ offsetY: 0
155
+ }), B.current = h.current.align === "full" ? "center" : h.current.align || "center", j(B.current), ge(B.current), f.current = {
156
+ x: x.clientX,
157
+ y: x.clientY,
158
+ offsetX: Number(h.current.offsetX || 0),
159
+ offsetY: Number(h.current.offsetY || 0)
160
+ };
161
+ const K = o.current;
162
+ K && (_.current = {
163
+ width: K.offsetWidth,
164
+ height: K.offsetHeight
165
+ }), w.current = {
166
+ x: f.current.offsetX,
167
+ y: f.current.offsetY
168
+ }, k.current = !0, Ae(!0), window.addEventListener("mousemove", he), window.addEventListener("mouseup", P.current);
169
+ }, [r.commands, c, he, l, ge]);
170
+ X(() => () => {
171
+ p.current !== null && window.cancelAnimationFrame(p.current), window.removeEventListener("mousemove", G), window.removeEventListener("mouseup", m.current), window.removeEventListener("mousemove", he), window.removeEventListener("mouseup", P.current);
172
+ }, [he, G]);
173
+ const T = `mtx-image--${s.align || "center"}`, D = Qe(s.width, "auto"), $ = Qe(s.height, "auto"), F = C ? `mtx-image-snap-preview--${C}` : "";
174
+ return /* @__PURE__ */ e(
175
+ je,
176
+ {
177
+ as: "figure",
178
+ className: `mtx-image-figure ${T} ${i ? "mtx-image--selected" : ""} ${me ? "mtx-image--dragging" : ""} ${de ? "mtx-image--snap-animating" : ""} ${F}`,
179
+ contentEditable: !1,
180
+ children: /* @__PURE__ */ a(
181
+ "div",
182
+ {
183
+ ref: o,
184
+ className: `mtx-image-wrapper ${me ? "is-dragging" : ""}`,
185
+ style: {
186
+ width: D,
187
+ height: $,
188
+ position: "relative",
189
+ display: "inline-block",
190
+ maxWidth: "100%",
191
+ verticalAlign: "top",
192
+ transform: `translate3d(${Number(s.offsetX || 0)}px, ${Number(s.offsetY || 0)}px, 0)`,
193
+ cursor: i ? me ? "grabbing" : "grab" : "default",
194
+ willChange: me ? "transform" : fe ? "width, height" : "auto",
195
+ contain: fe ? "layout style" : "none"
196
+ },
197
+ onMouseDown: v,
198
+ children: [
199
+ /* @__PURE__ */ e(
200
+ "img",
201
+ {
202
+ src: s.src,
203
+ alt: s.alt || "",
204
+ title: s.title || "",
205
+ style: {
206
+ width: "100%",
207
+ height: $ === "auto" ? "auto" : "100%",
208
+ display: "block",
209
+ maxWidth: "100%",
210
+ userSelect: "none"
211
+ },
212
+ draggable: !1
213
+ }
214
+ ),
215
+ i && /* @__PURE__ */ a("div", { className: "mtx-image-resize-handles", children: [
216
+ /* @__PURE__ */ e("button", { type: "button", className: "mtx-resize-handle mtx-resize-handle--nw", onMouseDown: (x) => Q(x, "nw") }),
217
+ /* @__PURE__ */ e("button", { type: "button", className: "mtx-resize-handle mtx-resize-handle--ne", onMouseDown: (x) => Q(x, "ne") }),
218
+ /* @__PURE__ */ e("button", { type: "button", className: "mtx-resize-handle mtx-resize-handle--sw", onMouseDown: (x) => Q(x, "sw") }),
219
+ /* @__PURE__ */ e("button", { type: "button", className: "mtx-resize-handle mtx-resize-handle--se", onMouseDown: (x) => Q(x, "se") }),
220
+ /* @__PURE__ */ e("button", { type: "button", className: "mtx-resize-handle mtx-resize-handle--n", onMouseDown: (x) => Q(x, "n") }),
221
+ /* @__PURE__ */ e("button", { type: "button", className: "mtx-resize-handle mtx-resize-handle--e", onMouseDown: (x) => Q(x, "e") }),
222
+ /* @__PURE__ */ e("button", { type: "button", className: "mtx-resize-handle mtx-resize-handle--s", onMouseDown: (x) => Q(x, "s") }),
223
+ /* @__PURE__ */ e("button", { type: "button", className: "mtx-resize-handle mtx-resize-handle--w", onMouseDown: (x) => Q(x, "w") })
224
+ ] }),
225
+ fe && /* @__PURE__ */ e("div", { className: "mtx-image-resize-overlay" })
226
+ ]
227
+ }
228
+ )
229
+ }
230
+ );
231
+ }
232
+ const ta = ({ node: n, updateAttributes: t }) => {
233
+ const l = R(null), [i, c] = H(n.attrs.formula || "sin(x)"), [r, s] = H(n.attrs.xDomain || [-10, 10]), [o, N] = H(n.attrs.yDomain || [-5, 5]);
234
+ X(() => {
235
+ let h = !0;
236
+ return l.current && import("./index-CLGg8QXp.js").then((m) => m.i).then((m) => {
237
+ if (!h) return;
238
+ const k = m.default;
239
+ try {
240
+ k({
241
+ target: l.current,
242
+ // Use non-null assertion as we checked graphRef.current
243
+ width: 500,
244
+ height: 300,
245
+ yAxis: { domain: o },
246
+ xAxis: { domain: r },
247
+ grid: !0,
248
+ data: [
249
+ {
250
+ fn: i,
251
+ graphType: "polyline"
252
+ }
253
+ ],
254
+ disableZoom: !1
255
+ });
256
+ } catch (f) {
257
+ console.error("Graph rendering error:", f);
258
+ }
259
+ }).catch((m) => console.error("Failed to load function-plot", m)), () => {
260
+ h = !1;
261
+ };
262
+ }, [i, r, o]);
263
+ const y = (h) => {
264
+ c(h.target.value);
265
+ }, u = () => {
266
+ t({ formula: i, xDomain: r, yDomain: o });
267
+ };
268
+ return /* @__PURE__ */ a(je, { className: "mtx-graph-component", children: [
269
+ /* @__PURE__ */ a("div", { className: "mtx-graph-controls", children: [
270
+ /* @__PURE__ */ e(
271
+ "input",
272
+ {
273
+ type: "text",
274
+ value: i,
275
+ onChange: y,
276
+ placeholder: "f(x) = ...",
277
+ onBlur: u,
278
+ className: "mtx-graph-input"
279
+ }
280
+ ),
281
+ /* @__PURE__ */ a("div", { className: "mtx-graph-domains", children: [
282
+ /* @__PURE__ */ a("div", { className: "mtx-graph-domain-group", children: [
283
+ /* @__PURE__ */ e("span", { className: "mtx-graph-domain-label", children: "X Axis" }),
284
+ /* @__PURE__ */ e("input", { className: "mtx-graph-domain-input", type: "number", value: r[0], onChange: (h) => s([Number(h.target.value), r[1]]), onBlur: u }),
285
+ /* @__PURE__ */ e("span", { className: "mtx-graph-domain-separator", children: "to" }),
286
+ /* @__PURE__ */ e("input", { className: "mtx-graph-domain-input", type: "number", value: r[1], onChange: (h) => s([r[0], Number(h.target.value)]), onBlur: u })
287
+ ] }),
288
+ /* @__PURE__ */ a("div", { className: "mtx-graph-domain-group", children: [
289
+ /* @__PURE__ */ e("span", { className: "mtx-graph-domain-label", children: "Y Axis" }),
290
+ /* @__PURE__ */ e("input", { className: "mtx-graph-domain-input", type: "number", value: o[0], onChange: (h) => N([Number(h.target.value), o[1]]), onBlur: u }),
291
+ /* @__PURE__ */ e("span", { className: "mtx-graph-domain-separator", children: "to" }),
292
+ /* @__PURE__ */ e("input", { className: "mtx-graph-domain-input", type: "number", value: o[1], onChange: (h) => N([o[0], Number(h.target.value)]), onBlur: u })
293
+ ] })
294
+ ] })
295
+ ] }),
296
+ /* @__PURE__ */ e("div", { ref: l, className: "mtx-graph-render" })
297
+ ] });
298
+ }, aa = Ue.create({
299
+ name: "graph",
300
+ group: "block",
301
+ atom: !0,
302
+ addAttributes() {
303
+ return {
304
+ formula: {
305
+ default: "sin(x)"
306
+ },
307
+ xDomain: {
308
+ default: [-10, 10]
309
+ },
310
+ yDomain: {
311
+ default: [-5, 5]
312
+ }
313
+ };
314
+ },
315
+ parseHTML() {
316
+ return [
317
+ {
318
+ tag: 'div[data-type="graph"]'
319
+ }
320
+ ];
321
+ },
322
+ renderHTML({ HTMLAttributes: n }) {
323
+ return ["div", Te(n, { "data-type": "graph" })];
324
+ },
325
+ addNodeView() {
326
+ return Ie(ta);
327
+ },
328
+ addCommands() {
329
+ return {
330
+ insertGraph: () => ({ commands: n }) => n.insertContent({
331
+ type: this.name,
332
+ attrs: {
333
+ formula: "sin(x)"
334
+ }
335
+ })
336
+ };
337
+ }
338
+ }), $e = "tt-indent-", na = Ye.create({
339
+ name: "indent",
340
+ addOptions() {
341
+ return {
342
+ types: ["heading", "listItem", "taskItem", "paragraph"],
343
+ minLevel: 0,
344
+ maxLevel: 8
345
+ };
346
+ },
347
+ addGlobalAttributes() {
348
+ return [
349
+ {
350
+ types: this.options.types,
351
+ attributes: {
352
+ indent: {
353
+ default: null,
354
+ renderHTML: (n) => n.indent ? n.indent > this.options.minLevel ? {
355
+ class: `${$e}${n.indent}`
356
+ } : {} : {},
357
+ parseHTML: (n) => {
358
+ let t = "";
359
+ if (n.classList.forEach((l) => {
360
+ l.indexOf($e) === 0 && (t = l);
361
+ }), t) {
362
+ const l = parseInt(t.slice($e.length), 10);
363
+ return l && l > this.options.minLevel ? l : null;
364
+ }
365
+ return null;
366
+ }
367
+ }
368
+ }
369
+ }
370
+ ];
371
+ },
372
+ addCommands() {
373
+ const n = (i, c, r) => {
374
+ var s;
375
+ const o = (s = i == null ? void 0 : i.doc) === null || s === void 0 ? void 0 : s.nodeAt(c);
376
+ if (o) {
377
+ const N = (o.attrs.indent || 0) + r, { minLevel: y, maxLevel: u } = this.options;
378
+ let h = N;
379
+ if (N < y ? h = y : N > u && (h = u), h !== o.attrs.indent) {
380
+ const { indent: m, ...k } = o.attrs, f = h > y ? { ...k, indent: h } : k;
381
+ return i.setNodeMarkup(c, o.type, f, o.marks);
382
+ }
383
+ }
384
+ return i;
385
+ }, t = (i, c) => {
386
+ const { doc: r, selection: s } = i;
387
+ if (r && s && (s instanceof _t || s instanceof zt)) {
388
+ const { from: o, to: N } = s;
389
+ r.nodesBetween(o, N, (y, u) => this.options.types.includes(y.type.name) ? (i = n(i, u, c), !1) : !0);
390
+ }
391
+ return i;
392
+ }, l = (i) => () => ({ tr: c, state: r, dispatch: s }) => {
393
+ const { selection: o } = r;
394
+ return c = c.setSelection(o), c = t(c, i), c.docChanged ? (s == null || s(c), !0) : !1;
395
+ };
396
+ return {
397
+ indent: l(1),
398
+ outdent: l(-1)
399
+ };
400
+ },
401
+ addKeyboardShortcuts() {
402
+ return {
403
+ Tab: () => this.editor.commands.indent(),
404
+ "Shift-Tab": () => this.editor.commands.outdent()
405
+ };
406
+ }
407
+ }), la = ["plain", "light", "dark", "blue", "striped", "minimal"], Oe = ["paragraph", "listItem", "taskItem"], ia = Ye.create({
408
+ name: "indentBackspace",
409
+ addKeyboardShortcuts() {
410
+ return {
411
+ Backspace: () => {
412
+ const { editor: n } = this, { empty: t, $from: l } = n.state.selection;
413
+ if (!t || l.parentOffset !== 0)
414
+ return !1;
415
+ const i = l.parent.type.name;
416
+ return !Oe.includes(i) || !n.can().outdent() ? !1 : n.commands.outdent();
417
+ },
418
+ Tab: () => {
419
+ const { editor: n } = this, { empty: t, $from: l } = n.state.selection;
420
+ if (!t)
421
+ return !1;
422
+ const i = l.parent.type.name;
423
+ return !Oe.includes(i) || !n.can().indent() ? !1 : n.commands.indent();
424
+ },
425
+ "Shift-Tab": () => {
426
+ const { editor: n } = this, { empty: t, $from: l } = n.state.selection;
427
+ if (!t)
428
+ return !1;
429
+ const i = l.parent.type.name;
430
+ return !Oe.includes(i) || !n.can().outdent() ? !1 : n.commands.outdent();
431
+ }
432
+ };
433
+ }
434
+ });
435
+ function ut(n) {
436
+ const t = [];
437
+ if (n.backgroundColor && t.push(`background-color: ${String(n.backgroundColor)}`), n.textAlign && t.push(`text-align: ${String(n.textAlign)}`), n.verticalAlign) {
438
+ const l = n.verticalAlign === "middle" ? "middle" : String(n.verticalAlign);
439
+ t.push(`vertical-align: ${l}`);
440
+ }
441
+ return n.width && t.push(`width: ${String(n.width)}`), t.join("; ");
442
+ }
443
+ function et(n) {
444
+ if (n == null || n === "")
445
+ return null;
446
+ if (typeof n == "number")
447
+ return `${Math.round(n)}px`;
448
+ const t = String(n).trim();
449
+ return t ? t === "auto" || t.endsWith("%") || t.endsWith("px") ? t : /^\d+(\.\d+)?$/.test(t) ? `${Math.round(Number(t))}px` : t : null;
450
+ }
451
+ const sa = St.extend({
452
+ addAttributes() {
453
+ return {
454
+ theme: {
455
+ default: "plain",
456
+ parseHTML: (n) => {
457
+ const t = n;
458
+ return la.find((l) => t.classList.contains(`mtx-table--${l}`)) || "plain";
459
+ },
460
+ renderHTML: () => ({})
461
+ }
462
+ };
463
+ },
464
+ renderHTML({ HTMLAttributes: n }) {
465
+ const t = typeof n.theme == "string" ? n.theme : "plain", { theme: l, class: i, ...c } = n;
466
+ return [
467
+ "table",
468
+ Te(c, {
469
+ class: ["mtx-table", i, `mtx-table--${t}`].filter(Boolean).join(" ")
470
+ }),
471
+ ["tbody", 0]
472
+ ];
473
+ }
474
+ }), ra = Dt.extend({
475
+ addAttributes() {
476
+ var n;
477
+ return {
478
+ ...(n = this.parent) == null ? void 0 : n.call(this),
479
+ backgroundColor: {
480
+ default: null,
481
+ parseHTML: (t) => t.style.backgroundColor || null,
482
+ renderHTML: () => ({})
483
+ },
484
+ textAlign: {
485
+ default: null,
486
+ parseHTML: (t) => t.style.textAlign || null,
487
+ renderHTML: () => ({})
488
+ },
489
+ verticalAlign: {
490
+ default: null,
491
+ parseHTML: (t) => t.style.verticalAlign || null,
492
+ renderHTML: () => ({})
493
+ },
494
+ width: {
495
+ default: null,
496
+ parseHTML: (t) => t.style.width || null,
497
+ renderHTML: () => ({})
498
+ }
499
+ };
500
+ },
501
+ renderHTML({ HTMLAttributes: n }) {
502
+ const t = ut(n), { backgroundColor: l, textAlign: i, verticalAlign: c, width: r, ...s } = n;
503
+ return ["td", Te(s, t ? { style: t } : {}), 0];
504
+ }
505
+ }), ca = Bt.extend({
506
+ addAttributes() {
507
+ var n;
508
+ return {
509
+ ...(n = this.parent) == null ? void 0 : n.call(this),
510
+ backgroundColor: {
511
+ default: null,
512
+ parseHTML: (t) => t.style.backgroundColor || null,
513
+ renderHTML: () => ({})
514
+ },
515
+ textAlign: {
516
+ default: null,
517
+ parseHTML: (t) => t.style.textAlign || null,
518
+ renderHTML: () => ({})
519
+ },
520
+ verticalAlign: {
521
+ default: null,
522
+ parseHTML: (t) => t.style.verticalAlign || null,
523
+ renderHTML: () => ({})
524
+ },
525
+ width: {
526
+ default: null,
527
+ parseHTML: (t) => t.style.width || null,
528
+ renderHTML: () => ({})
529
+ }
530
+ };
531
+ },
532
+ renderHTML({ HTMLAttributes: n }) {
533
+ const t = ut(n), { backgroundColor: l, textAlign: i, verticalAlign: c, width: r, ...s } = n;
534
+ return ["th", Te(s, t ? { style: t } : {}), 0];
535
+ }
536
+ });
537
+ function oa(n = {}) {
538
+ return [
539
+ Ot.configure({
540
+ heading: {
541
+ levels: [1, 2, 3, 4]
542
+ },
543
+ codeBlock: {
544
+ HTMLAttributes: {
545
+ class: "mtx-code-block"
546
+ }
547
+ },
548
+ blockquote: {
549
+ HTMLAttributes: {
550
+ class: "mtx-blockquote"
551
+ }
552
+ }
553
+ }),
554
+ Pt,
555
+ Vt,
556
+ Rt,
557
+ Ft.configure({
558
+ HTMLAttributes: {
559
+ class: "mtx-task-list"
560
+ }
561
+ }),
562
+ Wt.configure({
563
+ nested: !0,
564
+ HTMLAttributes: {
565
+ class: "mtx-task-item"
566
+ }
567
+ }),
568
+ It,
569
+ Et,
570
+ qt.configure({
571
+ types: ["textStyle"]
572
+ }),
573
+ Gt.configure({
574
+ types: ["heading", "paragraph"],
575
+ alignments: ["left", "center", "right", "justify"],
576
+ defaultAlignment: "left"
577
+ }),
578
+ Xt.configure({
579
+ multicolor: !0,
580
+ HTMLAttributes: {
581
+ class: "mtx-highlight"
582
+ }
583
+ }),
584
+ Kt,
585
+ ia,
586
+ na.configure({
587
+ types: ["paragraph", "listItem", "taskItem"],
588
+ minLevel: 0,
589
+ maxLevel: 7
590
+ }),
591
+ jt.configure({
592
+ openOnClick: !1,
593
+ autolink: !0,
594
+ HTMLAttributes: {
595
+ class: "mtx-link",
596
+ rel: "noopener noreferrer",
597
+ target: "_blank"
598
+ }
599
+ }),
600
+ Ut.extend({
601
+ parseHTML() {
602
+ return [
603
+ {
604
+ tag: "figure.mtx-image-figure",
605
+ getAttrs: (t) => {
606
+ const l = t, i = l.querySelector("img");
607
+ if (!i)
608
+ return !1;
609
+ const c = ["left", "center", "right", "full"].find(
610
+ (r) => l.classList.contains(`mtx-image--${r}`)
611
+ ) || "center";
612
+ return {
613
+ src: i.getAttribute("src"),
614
+ alt: i.getAttribute("alt"),
615
+ title: i.getAttribute("title"),
616
+ width: l.style.width || i.style.width || i.getAttribute("width") || null,
617
+ height: l.style.height || i.style.height || i.getAttribute("height") || null,
618
+ align: c,
619
+ offsetX: Number(l.getAttribute("data-offset-x") || 0),
620
+ offsetY: Number(l.getAttribute("data-offset-y") || 0)
621
+ };
622
+ }
623
+ },
624
+ {
625
+ tag: "img[src]",
626
+ getAttrs: (t) => {
627
+ const l = t;
628
+ return {
629
+ src: l.getAttribute("src"),
630
+ alt: l.getAttribute("alt"),
631
+ title: l.getAttribute("title"),
632
+ width: l.style.width || l.getAttribute("width") || null,
633
+ height: l.style.height || l.getAttribute("height") || null,
634
+ align: l.getAttribute("align") || "center",
635
+ offsetX: Number(l.getAttribute("data-offset-x") || 0),
636
+ offsetY: Number(l.getAttribute("data-offset-y") || 0)
637
+ };
638
+ }
639
+ }
640
+ ];
641
+ },
642
+ addNodeView() {
643
+ return Ie(ea);
644
+ },
645
+ addAttributes() {
646
+ return {
647
+ src: {
648
+ default: null
649
+ },
650
+ alt: {
651
+ default: null
652
+ },
653
+ title: {
654
+ default: null
655
+ },
656
+ width: {
657
+ default: null
658
+ },
659
+ height: {
660
+ default: null
661
+ },
662
+ align: {
663
+ default: "center"
664
+ },
665
+ offsetX: {
666
+ default: 0
667
+ },
668
+ offsetY: {
669
+ default: 0
670
+ }
671
+ };
672
+ },
673
+ renderHTML({ HTMLAttributes: t }) {
674
+ const {
675
+ src: l,
676
+ alt: i,
677
+ title: c,
678
+ width: r,
679
+ height: s,
680
+ align: o = "center",
681
+ offsetX: N = 0,
682
+ offsetY: y = 0,
683
+ ...u
684
+ } = t, h = et(r), m = et(s), k = Te(u, {
685
+ src: l,
686
+ alt: i,
687
+ title: c,
688
+ style: ["display: block", "max-width: 100%", m && m !== "auto" ? `height: ${m}` : "height: auto"].filter(Boolean).join("; ")
689
+ }), f = Number(N) !== 0 || Number(y) !== 0, P = [h ? `width: ${h}` : null, m && m !== "auto" ? `height: ${m}` : null, f ? `transform: translate3d(${Number(N)}px, ${Number(y)}px, 0)` : null].filter(Boolean).join("; ");
690
+ return [
691
+ "figure",
692
+ {
693
+ class: `mtx-image-figure mtx-image--${o}`,
694
+ "data-type": "image",
695
+ "data-offset-x": String(N),
696
+ "data-offset-y": String(y),
697
+ style: P || null
698
+ },
699
+ ["img", k]
700
+ ];
701
+ }
702
+ }).configure({
703
+ inline: !1,
704
+ allowBase64: !0,
705
+ HTMLAttributes: {
706
+ class: "mtx-image"
707
+ }
708
+ }),
709
+ sa.configure({
710
+ resizable: !0,
711
+ HTMLAttributes: {
712
+ class: "mtx-table"
713
+ }
714
+ }),
715
+ $t,
716
+ ra,
717
+ ca,
718
+ Yt.configure({
719
+ placeholder: n.placeholder || "Tulis soal di sini...",
720
+ emptyEditorClass: "mtx-placeholder"
721
+ }),
722
+ aa,
723
+ Ye.create({
724
+ name: "slash-graph",
725
+ addInputRules() {
726
+ return [
727
+ new Jt({
728
+ find: /^\/graph\s$/,
729
+ handler: ({ range: t, chain: l }) => {
730
+ l().deleteRange(t).insertContent({ type: "graph", attrs: { formula: "sin(x)" } }).run();
731
+ }
732
+ })
733
+ ];
734
+ }
735
+ })
736
+ ];
737
+ }
738
+ function ma({ onInsert: n }) {
739
+ const [t, l] = H(0), [i, c] = H(0), r = 10, s = 10, o = (u, h) => {
740
+ l(u), c(h);
741
+ }, N = () => {
742
+ l(0), c(0);
743
+ }, y = () => {
744
+ if (t > 0 && i > 0) {
745
+ let u = `\\begin{pmatrix}
746
+ `;
747
+ for (let h = 0; h < t; h++) {
748
+ const m = Array(i).fill("#?").join(" & ");
749
+ u += " " + m + (h < t - 1 ? " \\\\" : "") + `
750
+ `;
751
+ }
752
+ u += "\\end{pmatrix}", n(u);
753
+ }
754
+ };
755
+ return /* @__PURE__ */ a("div", { className: "mtx-matrix-grid-selector", onMouseLeave: N, children: [
756
+ /* @__PURE__ */ e("div", { className: "mtx-matrix-grid-label", children: t > 0 ? `${t}×${i}` : "Pilih Ukuran Matriks" }),
757
+ /* @__PURE__ */ e("div", { className: "mtx-matrix-grid-squares", children: Array.from({ length: r }).map((u, h) => /* @__PURE__ */ e("div", { className: "mtx-matrix-grid-row", children: Array.from({ length: s }).map((m, k) => {
758
+ const f = h < t && k < i;
759
+ return /* @__PURE__ */ e(
760
+ "div",
761
+ {
762
+ className: `mtx-matrix-grid-cell ${f ? "is-active" : ""}`,
763
+ onMouseEnter: () => o(h + 1, k + 1),
764
+ onClick: y
765
+ },
766
+ k
767
+ );
768
+ }) }, h)) })
769
+ ] });
770
+ }
771
+ function tt() {
772
+ return window.mathVirtualKeyboard;
773
+ }
774
+ const S = () => /* @__PURE__ */ e("span", { className: "mt-ph" }), d = () => /* @__PURE__ */ e("span", { className: "mt-ph mt-ph--sm" }), L = ({ t: n }) => /* @__PURE__ */ e("span", { className: "mt-txt-icon", children: n }), Fe = [
775
+ // ---- Tab 1: Fractions & Roots ----
776
+ {
777
+ id: "frac",
778
+ icon: "√▫·▫",
779
+ tip: "Pecahan & Akar",
780
+ rows: [
781
+ [
782
+ {
783
+ icon: /* @__PURE__ */ a("span", { className: "mt-icon-stack", children: [
784
+ /* @__PURE__ */ e("span", { className: "mt-icon-num", children: /* @__PURE__ */ e(S, {}) }),
785
+ /* @__PURE__ */ e("span", { className: "mt-icon-bar" }),
786
+ /* @__PURE__ */ e("span", { className: "mt-icon-den", children: /* @__PURE__ */ e(S, {}) })
787
+ ] }),
788
+ latex: "\\frac{#?}{#?}",
789
+ tip: "Pecahan"
790
+ },
791
+ {
792
+ icon: /* @__PURE__ */ a("span", { className: "mt-icon-row", children: [
793
+ /* @__PURE__ */ e(S, {}),
794
+ /* @__PURE__ */ a("span", { className: "mt-icon-stack", children: [
795
+ /* @__PURE__ */ e("span", { className: "mt-icon-num", children: /* @__PURE__ */ e(d, {}) }),
796
+ /* @__PURE__ */ e("span", { className: "mt-icon-bar" }),
797
+ /* @__PURE__ */ e("span", { className: "mt-icon-den", children: /* @__PURE__ */ e(d, {}) })
798
+ ] })
799
+ ] }),
800
+ latex: "#?\\frac{#?}{#?}",
801
+ tip: "Pecahan campuran"
802
+ },
803
+ {
804
+ icon: /* @__PURE__ */ a("span", { className: "mt-icon-stack mt-icon-stack--lg", children: [
805
+ /* @__PURE__ */ e("span", { className: "mt-icon-num", children: /* @__PURE__ */ e(S, {}) }),
806
+ /* @__PURE__ */ e("span", { className: "mt-icon-bar" }),
807
+ /* @__PURE__ */ e("span", { className: "mt-icon-den", children: /* @__PURE__ */ e(S, {}) })
808
+ ] }),
809
+ latex: "\\dfrac{#?}{#?}",
810
+ tip: "Pecahan besar (display)"
811
+ },
812
+ {
813
+ icon: /* @__PURE__ */ a("span", { className: "mt-icon-stack", children: [
814
+ /* @__PURE__ */ e("span", { className: "mt-icon-num", children: /* @__PURE__ */ e(S, {}) }),
815
+ /* @__PURE__ */ e("span", { className: "mt-icon-bar" }),
816
+ /* @__PURE__ */ e("span", { className: "mt-icon-den", children: /* @__PURE__ */ a("span", { className: "mt-icon-stack mt-icon-stack--sm", children: [
817
+ /* @__PURE__ */ e("span", { className: "mt-icon-num", children: /* @__PURE__ */ e(d, {}) }),
818
+ /* @__PURE__ */ e("span", { className: "mt-icon-bar" }),
819
+ /* @__PURE__ */ e("span", { className: "mt-icon-den", children: /* @__PURE__ */ e(d, {}) })
820
+ ] }) })
821
+ ] }),
822
+ latex: "\\cfrac{#?}{\\cfrac{#?}{#?}}",
823
+ tip: "Pecahan kontinu"
824
+ },
825
+ {
826
+ icon: /* @__PURE__ */ a("span", { className: "mt-icon-row", children: [
827
+ /* @__PURE__ */ e("span", { className: "mt-icon-sqrt", children: "√" }),
828
+ /* @__PURE__ */ e("span", { className: "mt-icon-sqrt-bar", children: /* @__PURE__ */ e(S, {}) })
829
+ ] }),
830
+ latex: "\\sqrt{#?}",
831
+ tip: "Akar kuadrat"
832
+ },
833
+ {
834
+ icon: /* @__PURE__ */ a("span", { className: "mt-icon-row", children: [
835
+ /* @__PURE__ */ e("sup", { className: "mt-icon-idx", children: "3" }),
836
+ /* @__PURE__ */ e("span", { className: "mt-icon-sqrt", children: "√" }),
837
+ /* @__PURE__ */ e("span", { className: "mt-icon-sqrt-bar", children: /* @__PURE__ */ e(S, {}) })
838
+ ] }),
839
+ latex: "\\sqrt[3]{#?}",
840
+ tip: "Akar pangkat 3"
841
+ },
842
+ {
843
+ icon: /* @__PURE__ */ a("span", { className: "mt-icon-row", children: [
844
+ /* @__PURE__ */ e("sup", { className: "mt-icon-idx", children: /* @__PURE__ */ e(d, {}) }),
845
+ /* @__PURE__ */ e("span", { className: "mt-icon-sqrt", children: "√" }),
846
+ /* @__PURE__ */ e("span", { className: "mt-icon-sqrt-bar", children: /* @__PURE__ */ e(S, {}) })
847
+ ] }),
848
+ latex: "\\sqrt[#?]{#?}",
849
+ tip: "Akar pangkat n"
850
+ }
851
+ ],
852
+ [
853
+ {
854
+ icon: /* @__PURE__ */ a("span", { className: "mt-icon-row", children: [
855
+ /* @__PURE__ */ e("span", { className: "mt-sym", children: "x" }),
856
+ /* @__PURE__ */ e("sup", { children: /* @__PURE__ */ e(d, {}) })
857
+ ] }),
858
+ latex: "#?^{#?}",
859
+ tip: "Pangkat / Superscript"
860
+ },
861
+ {
862
+ icon: /* @__PURE__ */ a("span", { className: "mt-icon-row", children: [
863
+ /* @__PURE__ */ e("span", { className: "mt-sym", children: "x" }),
864
+ /* @__PURE__ */ e("sub", { children: /* @__PURE__ */ e(d, {}) })
865
+ ] }),
866
+ latex: "#?_{#?}",
867
+ tip: "Subskrip"
868
+ },
869
+ {
870
+ icon: /* @__PURE__ */ a("span", { className: "mt-icon-row", children: [
871
+ /* @__PURE__ */ e("span", { className: "mt-sym", children: "x" }),
872
+ /* @__PURE__ */ e("sub", { children: /* @__PURE__ */ e(d, {}) }),
873
+ /* @__PURE__ */ e("sup", { children: /* @__PURE__ */ e(d, {}) })
874
+ ] }),
875
+ latex: "#?_{#?}^{#?}",
876
+ tip: "Pangkat + subskrip"
877
+ },
878
+ {
879
+ icon: /* @__PURE__ */ a("span", { className: "mt-icon-row", children: [
880
+ /* @__PURE__ */ e("span", { className: "mt-sym", children: "e" }),
881
+ /* @__PURE__ */ e("sup", { children: /* @__PURE__ */ e(d, {}) })
882
+ ] }),
883
+ latex: "e^{#?}",
884
+ tip: "Eksponen e"
885
+ },
886
+ {
887
+ icon: /* @__PURE__ */ a("span", { className: "mt-icon-row", children: [
888
+ /* @__PURE__ */ e("span", { className: "mt-sym", children: "10" }),
889
+ /* @__PURE__ */ e("sup", { children: /* @__PURE__ */ e(d, {}) })
890
+ ] }),
891
+ latex: "10^{#?}",
892
+ tip: "Pangkat 10"
893
+ },
894
+ {
895
+ icon: /* @__PURE__ */ a("span", { className: "mt-icon-row", children: [
896
+ /* @__PURE__ */ e("span", { className: "mt-sym", children: "x" }),
897
+ /* @__PURE__ */ e("sup", { children: "-1" })
898
+ ] }),
899
+ latex: "#?^{-1}",
900
+ tip: "Invers"
901
+ },
902
+ {
903
+ icon: /* @__PURE__ */ a("span", { className: "mt-icon-stack", children: [
904
+ /* @__PURE__ */ e("span", { className: "mt-icon-num", children: /* @__PURE__ */ e(d, {}) }),
905
+ /* @__PURE__ */ e("span", { className: "mt-icon-bar" }),
906
+ /* @__PURE__ */ e("span", { className: "mt-icon-den", children: /* @__PURE__ */ e(d, {}) })
907
+ ] }),
908
+ latex: "\\tfrac{#?}{#?}",
909
+ tip: "Pecahan kecil (text)"
910
+ }
911
+ ],
912
+ [
913
+ // Additional Fractions
914
+ {
915
+ icon: /* @__PURE__ */ a("span", { className: "mt-icon-stack", children: [
916
+ /* @__PURE__ */ e("span", { className: "mt-icon-num", children: "n" }),
917
+ /* @__PURE__ */ e("span", { className: "mt-icon-bar" }),
918
+ /* @__PURE__ */ e("span", { className: "mt-icon-den", children: "k" })
919
+ ] }),
920
+ latex: "\\binom{#?}{#?}",
921
+ tip: "Kombinasi (n choose k)"
922
+ },
923
+ {
924
+ icon: /* @__PURE__ */ a("span", { className: "mt-icon-stack", children: [
925
+ /* @__PURE__ */ e("span", { className: "mt-icon-num", children: "1" }),
926
+ /* @__PURE__ */ e("span", { className: "mt-icon-bar" }),
927
+ /* @__PURE__ */ e("span", { className: "mt-icon-den", children: /* @__PURE__ */ e(S, {}) })
928
+ ] }),
929
+ latex: "\\frac{1}{#?}",
930
+ tip: "Pecahan Unit"
931
+ },
932
+ {
933
+ icon: /* @__PURE__ */ a("span", { className: "mt-icon-row", children: [
934
+ /* @__PURE__ */ e("span", { className: "mt-icon-sqrt", children: "√" }),
935
+ /* @__PURE__ */ e("span", { className: "mt-icon-sqrt-bar", children: /* @__PURE__ */ a("span", { className: "mt-icon-stack", children: [
936
+ /* @__PURE__ */ e("span", { className: "mt-icon-num", children: /* @__PURE__ */ e(d, {}) }),
937
+ /* @__PURE__ */ e("span", { className: "mt-icon-bar" }),
938
+ /* @__PURE__ */ e("span", { className: "mt-icon-den", children: /* @__PURE__ */ e(d, {}) })
939
+ ] }) })
940
+ ] }),
941
+ latex: "\\sqrt{\\frac{#?}{#?}}",
942
+ tip: "Akar dari pecahan"
943
+ },
944
+ {
945
+ icon: /* @__PURE__ */ a("span", { className: "mt-icon-row", children: [
946
+ /* @__PURE__ */ e(S, {}),
947
+ /* @__PURE__ */ e("span", { className: "mt-icon-sqrt", children: "√" }),
948
+ /* @__PURE__ */ e("span", { className: "mt-icon-sqrt-bar", children: /* @__PURE__ */ e(S, {}) })
949
+ ] }),
950
+ latex: "#?\\sqrt{#?}",
951
+ tip: "Akar dengan koefisien"
952
+ }
953
+ ],
954
+ [
955
+ // Additional Powers & Roots
956
+ {
957
+ icon: /* @__PURE__ */ a("span", { className: "mt-icon-row", children: [
958
+ /* @__PURE__ */ e("span", { className: "mt-sym", children: "x" }),
959
+ /* @__PURE__ */ e("sup", { children: /* @__PURE__ */ a("span", { className: "mt-icon-stack", children: [
960
+ /* @__PURE__ */ e("span", { className: "mt-icon-num", children: "1" }),
961
+ /* @__PURE__ */ e("span", { className: "mt-icon-bar" }),
962
+ /* @__PURE__ */ e("span", { className: "mt-icon-den", children: "2" })
963
+ ] }) })
964
+ ] }),
965
+ latex: "#?^{\\frac{1}{2}}",
966
+ tip: "Pangkat 1/2 (√)"
967
+ },
968
+ {
969
+ icon: /* @__PURE__ */ a("span", { className: "mt-icon-row", children: [
970
+ /* @__PURE__ */ e("span", { className: "mt-sym", children: "x" }),
971
+ /* @__PURE__ */ e("sup", { children: /* @__PURE__ */ a("span", { className: "mt-icon-stack", children: [
972
+ /* @__PURE__ */ e("span", { className: "mt-icon-num", children: "1" }),
973
+ /* @__PURE__ */ e("span", { className: "mt-icon-bar" }),
974
+ /* @__PURE__ */ e("span", { className: "mt-icon-den", children: "3" })
975
+ ] }) })
976
+ ] }),
977
+ latex: "#?^{\\frac{1}{3}}",
978
+ tip: "Pangkat 1/3 (³√)"
979
+ },
980
+ {
981
+ icon: /* @__PURE__ */ a("span", { className: "mt-icon-stack", children: [
982
+ /* @__PURE__ */ e("span", { className: "mt-icon-num", children: "1" }),
983
+ /* @__PURE__ */ e("span", { className: "mt-icon-bar" }),
984
+ /* @__PURE__ */ e("span", { className: "mt-icon-den", children: /* @__PURE__ */ a("span", { className: "mt-icon-row", children: [
985
+ /* @__PURE__ */ e("span", { className: "mt-icon-sqrt", children: "√" }),
986
+ /* @__PURE__ */ e("span", { className: "mt-icon-sqrt-bar", children: /* @__PURE__ */ e(S, {}) })
987
+ ] }) })
988
+ ] }),
989
+ latex: "\\frac{1}{\\sqrt{#?}}",
990
+ tip: "Akar di penyebut"
991
+ },
992
+ {
993
+ icon: /* @__PURE__ */ a("span", { className: "mt-icon-row", children: [
994
+ /* @__PURE__ */ e("span", { className: "mt-icon-sqrt", children: "√" }),
995
+ /* @__PURE__ */ e("span", { className: "mt-icon-sqrt-bar", children: /* @__PURE__ */ e(S, {}) }),
996
+ /* @__PURE__ */ e("span", { className: "mt-sym", children: "±" }),
997
+ /* @__PURE__ */ e("span", { className: "mt-icon-sqrt", children: "√" }),
998
+ /* @__PURE__ */ e("span", { className: "mt-icon-sqrt-bar", children: /* @__PURE__ */ e(S, {}) })
999
+ ] }),
1000
+ latex: "\\sqrt{#?} \\pm \\sqrt{#?}",
1001
+ tip: "Operasi akar"
1002
+ }
1003
+ ],
1004
+ [
1005
+ // Common Formulas - Algebra
1006
+ { icon: /* @__PURE__ */ e(L, { t: "Rumus ABC" }), latex: "x = \\frac{-b \\pm \\sqrt{b^2 - 4ac}}{2a}", tip: "Rumus Kuadrat (ABC)", command: "formula" },
1007
+ { icon: /* @__PURE__ */ e(L, { t: "Pythagoras" }), latex: "a^2 + b^2 = c^2", tip: "Teorema Pythagoras", command: "formula" },
1008
+ { icon: /* @__PURE__ */ e(L, { t: "Diskriminan" }), latex: "D = b^2 - 4ac", tip: "Diskriminan", command: "formula" },
1009
+ { icon: /* @__PURE__ */ e(L, { t: "(a+b)²" }), latex: "(a+b)^2 = a^2 + 2ab + b^2", tip: "Kuadrat Sempurna", command: "formula" },
1010
+ { icon: /* @__PURE__ */ e(L, { t: "a²-b²" }), latex: "a^2 - b^2 = (a+b)(a-b)", tip: "Selisih Kuadrat", command: "formula" }
1011
+ ]
1012
+ ]
1013
+ },
1014
+ // ---- Tab 2: Spaces/Constants ----
1015
+ {
1016
+ id: "const",
1017
+ icon: "€ ∞",
1018
+ tip: "Konstanta & Spasi",
1019
+ rows: [
1020
+ [
1021
+ { icon: /* @__PURE__ */ e("span", { className: "mt-sym-lg", children: "∞" }), latex: "\\infty", tip: "Tak hingga" },
1022
+ { icon: /* @__PURE__ */ e("span", { className: "mt-sym-lg", children: "π" }), latex: "\\pi", tip: "Pi" },
1023
+ { icon: /* @__PURE__ */ e("span", { className: "mt-sym-lg", children: "e" }), latex: "e", tip: "Euler number" },
1024
+ { icon: /* @__PURE__ */ e("span", { className: "mt-sym-lg", children: "i" }), latex: "i", tip: "Unit imajiner" },
1025
+ { icon: /* @__PURE__ */ e("span", { className: "mt-sym-lg", children: "°" }), latex: "^{\\circ}", tip: "Derajat" },
1026
+ { icon: /* @__PURE__ */ e("span", { className: "mt-sym-lg", children: "%" }), latex: "\\%", tip: "Persen" },
1027
+ { icon: /* @__PURE__ */ e("span", { className: "mt-sym-lg", children: "ℏ" }), latex: "\\hbar", tip: "H-bar (Planck)" },
1028
+ { icon: /* @__PURE__ */ e("span", { className: "mt-sym-lg", children: "∂" }), latex: "\\partial", tip: "Parsial" }
1029
+ ],
1030
+ [
1031
+ { icon: /* @__PURE__ */ e("span", { className: "mt-sym-lg", children: "ℝ" }), latex: "\\mathbb{R}", tip: "Bilangan real" },
1032
+ { icon: /* @__PURE__ */ e("span", { className: "mt-sym-lg", children: "ℕ" }), latex: "\\mathbb{N}", tip: "Bilangan asli" },
1033
+ { icon: /* @__PURE__ */ e("span", { className: "mt-sym-lg", children: "ℤ" }), latex: "\\mathbb{Z}", tip: "Bilangan bulat" },
1034
+ { icon: /* @__PURE__ */ e("span", { className: "mt-sym-lg", children: "ℚ" }), latex: "\\mathbb{Q}", tip: "Bilangan rasional" },
1035
+ { icon: /* @__PURE__ */ e("span", { className: "mt-sym-lg", children: "ℂ" }), latex: "\\mathbb{C}", tip: "Bilangan kompleks" },
1036
+ { icon: /* @__PURE__ */ e("span", { className: "mt-sym-lg", children: "∇" }), latex: "\\nabla", tip: "Nabla" },
1037
+ { icon: /* @__PURE__ */ e("span", { className: "mt-sym-lg", children: "ℓ" }), latex: "\\ell", tip: "Script ℓ" },
1038
+ { icon: /* @__PURE__ */ e("span", { className: "mt-sym-lg", children: "‰" }), latex: "\\permil", tip: "Per mil" }
1039
+ ],
1040
+ [
1041
+ { icon: /* @__PURE__ */ e(L, { t: "E=mc²" }), latex: "E = mc^2", tip: "Relativitas (Einstein)" },
1042
+ { icon: /* @__PURE__ */ e(L, { t: "F=ma" }), latex: "F = m a", tip: "Hukum Newton II" },
1043
+ { icon: /* @__PURE__ */ e(L, { t: "Induksi" }), latex: "B = \\frac{\\mu_0 I}{2\\pi r}", tip: "Medan Magnet" }
1044
+ ]
1045
+ ]
1046
+ },
1047
+ // ---- Tab 3: Arrows ----
1048
+ {
1049
+ id: "arrow",
1050
+ icon: "→ ·",
1051
+ tip: "Panah",
1052
+ rows: [
1053
+ [
1054
+ { icon: /* @__PURE__ */ e("span", { className: "mt-sym-lg", children: "→" }), latex: "\\rightarrow", tip: "Panah kanan" },
1055
+ { icon: /* @__PURE__ */ e("span", { className: "mt-sym-lg", children: "←" }), latex: "\\leftarrow", tip: "Panah kiri" },
1056
+ { icon: /* @__PURE__ */ e("span", { className: "mt-sym-lg", children: "↑" }), latex: "\\uparrow", tip: "Panah atas" },
1057
+ { icon: /* @__PURE__ */ e("span", { className: "mt-sym-lg", children: "↓" }), latex: "\\downarrow", tip: "Panah bawah" },
1058
+ { icon: /* @__PURE__ */ e("span", { className: "mt-sym-lg", children: "↔" }), latex: "\\leftrightarrow", tip: "Panah dua arah" },
1059
+ { icon: /* @__PURE__ */ e("span", { className: "mt-sym-lg", children: "⇒" }), latex: "\\Rightarrow", tip: "Implikasi" },
1060
+ { icon: /* @__PURE__ */ e("span", { className: "mt-sym-lg", children: "⇐" }), latex: "\\Leftarrow", tip: "Implikasi kiri" },
1061
+ { icon: /* @__PURE__ */ e("span", { className: "mt-sym-lg", children: "⇔" }), latex: "\\Leftrightarrow", tip: "Bi-implikasi" }
1062
+ ],
1063
+ [
1064
+ { icon: /* @__PURE__ */ e("span", { className: "mt-sym-lg", children: "↦" }), latex: "\\mapsto", tip: "Maps to" },
1065
+ { icon: /* @__PURE__ */ e("span", { className: "mt-sym-lg", children: "⟶" }), latex: "\\longrightarrow", tip: "Panah panjang" },
1066
+ { icon: /* @__PURE__ */ e("span", { className: "mt-sym-lg", children: "⟵" }), latex: "\\longleftarrow", tip: "Panah panjang kiri" },
1067
+ { icon: /* @__PURE__ */ e("span", { className: "mt-sym-lg", children: "⟹" }), latex: "\\Longrightarrow", tip: "Implikasi panjang" },
1068
+ { icon: /* @__PURE__ */ e("span", { className: "mt-sym-lg", children: "⟺" }), latex: "\\Longleftrightarrow", tip: "Bi-implikasi panjang" },
1069
+ { icon: /* @__PURE__ */ e("span", { className: "mt-sym-lg", children: "↗" }), latex: "\\nearrow", tip: "Kanan atas" },
1070
+ { icon: /* @__PURE__ */ e("span", { className: "mt-sym-lg", children: "↘" }), latex: "\\searrow", tip: "Kanan bawah" },
1071
+ { icon: /* @__PURE__ */ e("span", { className: "mt-sym-lg", children: "↙" }), latex: "\\swarrow", tip: "Kiri bawah" },
1072
+ { icon: /* @__PURE__ */ e("span", { className: "mt-sym-lg", children: "↖" }), latex: "\\nwarrow", tip: "Kiri atas" }
1073
+ ],
1074
+ [
1075
+ { icon: /* @__PURE__ */ a("span", { className: "mt-icon-stack", children: [
1076
+ /* @__PURE__ */ e("span", { style: { fontSize: "8px", marginBottom: -2 }, children: "□" }),
1077
+ /* @__PURE__ */ e("span", { className: "mt-sym-lg", style: { lineHeight: 0.8 }, children: "→" })
1078
+ ] }), latex: "\\xrightarrow{#?}", tip: "Panah Kanan (Atas)" },
1079
+ { icon: /* @__PURE__ */ a("span", { className: "mt-icon-stack", children: [
1080
+ /* @__PURE__ */ e("span", { style: { fontSize: "8px", marginBottom: -2 }, children: "□" }),
1081
+ /* @__PURE__ */ e("span", { className: "mt-sym-lg", style: { lineHeight: 0.8 }, children: "←" })
1082
+ ] }), latex: "\\xleftarrow{#?}", tip: "Panah Kiri (Atas)" },
1083
+ { icon: /* @__PURE__ */ a("span", { className: "mt-icon-stack", children: [
1084
+ /* @__PURE__ */ e("span", { style: { fontSize: "8px", marginBottom: -2 }, children: "□" }),
1085
+ /* @__PURE__ */ e("span", { className: "mt-sym-lg", style: { lineHeight: 0.8 }, children: "→" }),
1086
+ /* @__PURE__ */ e("span", { style: { fontSize: "8px", marginTop: -2 }, children: "□" })
1087
+ ] }), latex: "\\xrightarrow[#?]{#?}", tip: "Panah Kanan (Atas+Bawah)" },
1088
+ { icon: /* @__PURE__ */ e("span", { className: "mt-sym-lg", children: "⇀" }), latex: "\\rightharpoonup", tip: "Harpoon kanan" },
1089
+ { icon: /* @__PURE__ */ e("span", { className: "mt-sym-lg", children: "⇁" }), latex: "\\rightharpoondown", tip: "Harpoon kanan bawah" },
1090
+ { icon: /* @__PURE__ */ e("span", { className: "mt-sym-lg", children: "↼" }), latex: "\\leftharpoonup", tip: "Harpoon kiri" },
1091
+ { icon: /* @__PURE__ */ e("span", { className: "mt-sym-lg", children: "↽" }), latex: "\\leftharpoondown", tip: "Harpoon kiri bawah" },
1092
+ { icon: /* @__PURE__ */ e("span", { className: "mt-sym-lg", children: "⇌" }), latex: "\\rightleftharpoons", tip: "Kesetimbangan" }
1093
+ ],
1094
+ [
1095
+ { icon: /* @__PURE__ */ e(L, { t: "f: A→B" }), latex: "f: A \\to B", tip: "Definisi Fungsi" },
1096
+ { icon: /* @__PURE__ */ e(L, { t: "x ↦ y" }), latex: "x \\mapsto f(x)", tip: "Pemetaan" },
1097
+ { icon: /* @__PURE__ */ e(L, { t: "v = u + at" }), latex: "v = u + at", tip: "GLBB 1" }
1098
+ ]
1099
+ ]
1100
+ },
1101
+ // ---- Tab 4: Greek Letters ----
1102
+ {
1103
+ id: "greek",
1104
+ icon: "α Ω",
1105
+ tip: "Huruf Yunani",
1106
+ rows: [
1107
+ [
1108
+ { icon: /* @__PURE__ */ e("span", { className: "mt-sym-lg", children: "α" }), latex: "\\alpha", tip: "Alpha" },
1109
+ { icon: /* @__PURE__ */ e("span", { className: "mt-sym-lg", children: "β" }), latex: "\\beta", tip: "Beta" },
1110
+ { icon: /* @__PURE__ */ e("span", { className: "mt-sym-lg", children: "γ" }), latex: "\\gamma", tip: "Gamma" },
1111
+ { icon: /* @__PURE__ */ e("span", { className: "mt-sym-lg", children: "δ" }), latex: "\\delta", tip: "Delta" },
1112
+ { icon: /* @__PURE__ */ e("span", { className: "mt-sym-lg", children: "ε" }), latex: "\\epsilon", tip: "Epsilon" },
1113
+ { icon: /* @__PURE__ */ e("span", { className: "mt-sym-lg", children: "ζ" }), latex: "\\zeta", tip: "Zeta" },
1114
+ { icon: /* @__PURE__ */ e("span", { className: "mt-sym-lg", children: "η" }), latex: "\\eta", tip: "Eta" },
1115
+ { icon: /* @__PURE__ */ e("span", { className: "mt-sym-lg", children: "θ" }), latex: "\\theta", tip: "Theta" },
1116
+ { icon: /* @__PURE__ */ e("span", { className: "mt-sym-lg", children: "ι" }), latex: "\\iota", tip: "Iota" },
1117
+ { icon: /* @__PURE__ */ e("span", { className: "mt-sym-lg", children: "κ" }), latex: "\\kappa", tip: "Kappa" },
1118
+ { icon: /* @__PURE__ */ e("span", { className: "mt-sym-lg", children: "λ" }), latex: "\\lambda", tip: "Lambda" },
1119
+ { icon: /* @__PURE__ */ e("span", { className: "mt-sym-lg", children: "μ" }), latex: "\\mu", tip: "Mu" }
1120
+ ],
1121
+ [
1122
+ { icon: /* @__PURE__ */ e("span", { className: "mt-sym-lg", children: "ν" }), latex: "\\nu", tip: "Nu" },
1123
+ { icon: /* @__PURE__ */ e("span", { className: "mt-sym-lg", children: "ξ" }), latex: "\\xi", tip: "Xi" },
1124
+ { icon: /* @__PURE__ */ e("span", { className: "mt-sym-lg", children: "π" }), latex: "\\pi", tip: "Pi" },
1125
+ { icon: /* @__PURE__ */ e("span", { className: "mt-sym-lg", children: "ρ" }), latex: "\\rho", tip: "Rho" },
1126
+ { icon: /* @__PURE__ */ e("span", { className: "mt-sym-lg", children: "σ" }), latex: "\\sigma", tip: "Sigma" },
1127
+ { icon: /* @__PURE__ */ e("span", { className: "mt-sym-lg", children: "τ" }), latex: "\\tau", tip: "Tau" },
1128
+ { icon: /* @__PURE__ */ e("span", { className: "mt-sym-lg", children: "φ" }), latex: "\\phi", tip: "Phi" },
1129
+ { icon: /* @__PURE__ */ e("span", { className: "mt-sym-lg", children: "χ" }), latex: "\\chi", tip: "Chi" },
1130
+ { icon: /* @__PURE__ */ e("span", { className: "mt-sym-lg", children: "ψ" }), latex: "\\psi", tip: "Psi" },
1131
+ { icon: /* @__PURE__ */ e("span", { className: "mt-sym-lg", children: "ω" }), latex: "\\omega", tip: "Omega" },
1132
+ { icon: /* @__PURE__ */ e("span", { className: "mt-sym-lg", children: "ϑ" }), latex: "\\vartheta", tip: "Vartheta" },
1133
+ { icon: /* @__PURE__ */ e("span", { className: "mt-sym-lg", children: "ϕ" }), latex: "\\varphi", tip: "Varphi" }
1134
+ ],
1135
+ [
1136
+ { icon: /* @__PURE__ */ e("span", { className: "mt-sym-lg", children: "Γ" }), latex: "\\Gamma", tip: "Gamma besar" },
1137
+ { icon: /* @__PURE__ */ e("span", { className: "mt-sym-lg", children: "Δ" }), latex: "\\Delta", tip: "Delta besar" },
1138
+ { icon: /* @__PURE__ */ e("span", { className: "mt-sym-lg", children: "Θ" }), latex: "\\Theta", tip: "Theta besar" },
1139
+ { icon: /* @__PURE__ */ e("span", { className: "mt-sym-lg", children: "Λ" }), latex: "\\Lambda", tip: "Lambda besar" },
1140
+ { icon: /* @__PURE__ */ e("span", { className: "mt-sym-lg", children: "Ξ" }), latex: "\\Xi", tip: "Xi besar" },
1141
+ { icon: /* @__PURE__ */ e("span", { className: "mt-sym-lg", children: "Π" }), latex: "\\Pi", tip: "Pi besar" },
1142
+ { icon: /* @__PURE__ */ e("span", { className: "mt-sym-lg", children: "Σ" }), latex: "\\Sigma", tip: "Sigma besar" },
1143
+ { icon: /* @__PURE__ */ e("span", { className: "mt-sym-lg", children: "Υ" }), latex: "\\Upsilon", tip: "Upsilon besar" },
1144
+ { icon: /* @__PURE__ */ e("span", { className: "mt-sym-lg", children: "Φ" }), latex: "\\Phi", tip: "Phi besar" },
1145
+ { icon: /* @__PURE__ */ e("span", { className: "mt-sym-lg", children: "Ψ" }), latex: "\\Psi", tip: "Psi besar" },
1146
+ { icon: /* @__PURE__ */ e("span", { className: "mt-sym-lg", children: "Ω" }), latex: "\\Omega", tip: "Omega besar" },
1147
+ { icon: /* @__PURE__ */ e("span", { className: "mt-sym-lg", children: "υ" }), latex: "\\upsilon", tip: "Upsilon" }
1148
+ ],
1149
+ [
1150
+ { icon: /* @__PURE__ */ e(L, { t: "Area O" }), latex: "A = \\pi r^2", tip: "Luas Lingkaran" },
1151
+ { icon: /* @__PURE__ */ e(L, { t: "2πr" }), latex: "K = 2 \\pi r", tip: "Keliling Lingkaran" },
1152
+ { icon: /* @__PURE__ */ e(L, { t: "Vol Bola" }), latex: "V = \\frac{4}{3} \\pi r^3", tip: "Volume Bola" }
1153
+ ]
1154
+ ]
1155
+ },
1156
+ // ---- Tab 5: Matrices ----
1157
+ {
1158
+ id: "matrix",
1159
+ icon: "[▫▫]",
1160
+ tip: "Matriks",
1161
+ rows: [
1162
+ [
1163
+ {
1164
+ icon: /* @__PURE__ */ a("span", { className: "mt-icon-row", children: [
1165
+ /* @__PURE__ */ e("span", { className: "mt-brak", children: "(" }),
1166
+ /* @__PURE__ */ a("span", { className: "mt-icon-grid", children: [
1167
+ /* @__PURE__ */ a("span", { className: "mt-icon-grid-row", children: [
1168
+ /* @__PURE__ */ e(d, {}),
1169
+ /* @__PURE__ */ e(d, {})
1170
+ ] }),
1171
+ /* @__PURE__ */ a("span", { className: "mt-icon-grid-row", children: [
1172
+ /* @__PURE__ */ e(d, {}),
1173
+ /* @__PURE__ */ e(d, {})
1174
+ ] })
1175
+ ] }),
1176
+ /* @__PURE__ */ e("span", { className: "mt-brak", children: ")" })
1177
+ ] }),
1178
+ latex: "\\begin{pmatrix} #? & #? \\\\ #? & #? \\end{pmatrix}",
1179
+ tip: "Matriks 2×2"
1180
+ },
1181
+ {
1182
+ icon: /* @__PURE__ */ a("span", { className: "mt-icon-row", children: [
1183
+ /* @__PURE__ */ e("span", { className: "mt-brak", children: "(" }),
1184
+ /* @__PURE__ */ a("span", { className: "mt-icon-grid", children: [
1185
+ /* @__PURE__ */ a("span", { className: "mt-icon-grid-row", children: [
1186
+ /* @__PURE__ */ e(d, {}),
1187
+ /* @__PURE__ */ e(d, {}),
1188
+ /* @__PURE__ */ e(d, {})
1189
+ ] }),
1190
+ /* @__PURE__ */ a("span", { className: "mt-icon-grid-row", children: [
1191
+ /* @__PURE__ */ e(d, {}),
1192
+ /* @__PURE__ */ e(d, {}),
1193
+ /* @__PURE__ */ e(d, {})
1194
+ ] }),
1195
+ /* @__PURE__ */ a("span", { className: "mt-icon-grid-row", children: [
1196
+ /* @__PURE__ */ e(d, {}),
1197
+ /* @__PURE__ */ e(d, {}),
1198
+ /* @__PURE__ */ e(d, {})
1199
+ ] })
1200
+ ] }),
1201
+ /* @__PURE__ */ e("span", { className: "mt-brak", children: ")" })
1202
+ ] }),
1203
+ latex: "\\begin{pmatrix} #? & #? & #? \\\\ #? & #? & #? \\\\ #? & #? & #? \\end{pmatrix}",
1204
+ tip: "Matriks 3×3"
1205
+ },
1206
+ {
1207
+ icon: /* @__PURE__ */ a("span", { className: "mt-icon-row", children: [
1208
+ /* @__PURE__ */ e("span", { className: "mt-brak", children: "[" }),
1209
+ /* @__PURE__ */ a("span", { className: "mt-icon-grid", children: [
1210
+ /* @__PURE__ */ a("span", { className: "mt-icon-grid-row", children: [
1211
+ /* @__PURE__ */ e(d, {}),
1212
+ /* @__PURE__ */ e(d, {})
1213
+ ] }),
1214
+ /* @__PURE__ */ a("span", { className: "mt-icon-grid-row", children: [
1215
+ /* @__PURE__ */ e(d, {}),
1216
+ /* @__PURE__ */ e(d, {})
1217
+ ] })
1218
+ ] }),
1219
+ /* @__PURE__ */ e("span", { className: "mt-brak", children: "]" })
1220
+ ] }),
1221
+ latex: "\\begin{bmatrix} #? & #? \\\\ #? & #? \\end{bmatrix}",
1222
+ tip: "Bracket matrix 2×2"
1223
+ },
1224
+ {
1225
+ icon: /* @__PURE__ */ a("span", { className: "mt-icon-row", children: [
1226
+ /* @__PURE__ */ e("span", { className: "mt-brak", children: "[" }),
1227
+ /* @__PURE__ */ a("span", { className: "mt-icon-grid", children: [
1228
+ /* @__PURE__ */ a("span", { className: "mt-icon-grid-row", children: [
1229
+ /* @__PURE__ */ e(d, {}),
1230
+ /* @__PURE__ */ e(d, {}),
1231
+ /* @__PURE__ */ e(d, {})
1232
+ ] }),
1233
+ /* @__PURE__ */ a("span", { className: "mt-icon-grid-row", children: [
1234
+ /* @__PURE__ */ e(d, {}),
1235
+ /* @__PURE__ */ e(d, {}),
1236
+ /* @__PURE__ */ e(d, {})
1237
+ ] }),
1238
+ /* @__PURE__ */ a("span", { className: "mt-icon-grid-row", children: [
1239
+ /* @__PURE__ */ e(d, {}),
1240
+ /* @__PURE__ */ e(d, {}),
1241
+ /* @__PURE__ */ e(d, {})
1242
+ ] })
1243
+ ] }),
1244
+ /* @__PURE__ */ e("span", { className: "mt-brak", children: "]" })
1245
+ ] }),
1246
+ latex: "\\begin{bmatrix} #? & #? & #? \\\\ #? & #? & #? \\\\ #? & #? & #? \\end{bmatrix}",
1247
+ tip: "Bracket matrix 3×3"
1248
+ },
1249
+ {
1250
+ icon: /* @__PURE__ */ a("span", { className: "mt-icon-row", children: [
1251
+ /* @__PURE__ */ e("span", { className: "mt-brak", children: "|" }),
1252
+ /* @__PURE__ */ a("span", { className: "mt-icon-grid", children: [
1253
+ /* @__PURE__ */ a("span", { className: "mt-icon-grid-row", children: [
1254
+ /* @__PURE__ */ e(d, {}),
1255
+ /* @__PURE__ */ e(d, {})
1256
+ ] }),
1257
+ /* @__PURE__ */ a("span", { className: "mt-icon-grid-row", children: [
1258
+ /* @__PURE__ */ e(d, {}),
1259
+ /* @__PURE__ */ e(d, {})
1260
+ ] })
1261
+ ] }),
1262
+ /* @__PURE__ */ e("span", { className: "mt-brak", children: "|" })
1263
+ ] }),
1264
+ latex: "\\begin{vmatrix} #? & #? \\\\ #? & #? \\end{vmatrix}",
1265
+ tip: "Determinan 2×2"
1266
+ },
1267
+ {
1268
+ icon: /* @__PURE__ */ a("span", { className: "mt-icon-row", children: [
1269
+ /* @__PURE__ */ e("span", { className: "mt-brak", children: "‖" }),
1270
+ /* @__PURE__ */ a("span", { className: "mt-icon-grid", children: [
1271
+ /* @__PURE__ */ a("span", { className: "mt-icon-grid-row", children: [
1272
+ /* @__PURE__ */ e(d, {}),
1273
+ /* @__PURE__ */ e(d, {})
1274
+ ] }),
1275
+ /* @__PURE__ */ a("span", { className: "mt-icon-grid-row", children: [
1276
+ /* @__PURE__ */ e(d, {}),
1277
+ /* @__PURE__ */ e(d, {})
1278
+ ] })
1279
+ ] }),
1280
+ /* @__PURE__ */ e("span", { className: "mt-brak", children: "‖" })
1281
+ ] }),
1282
+ latex: "\\begin{Vmatrix} #? & #? \\\\ #? & #? \\end{Vmatrix}",
1283
+ tip: "Norm matrix 2×2"
1284
+ }
1285
+ ],
1286
+ [
1287
+ {
1288
+ icon: /* @__PURE__ */ a("span", { className: "mt-icon-row", children: [
1289
+ /* @__PURE__ */ e("span", { className: "mt-brak", children: "(" }),
1290
+ /* @__PURE__ */ a("span", { className: "mt-icon-grid", children: [
1291
+ /* @__PURE__ */ e("span", { className: "mt-icon-grid-row", children: /* @__PURE__ */ e(d, {}) }),
1292
+ /* @__PURE__ */ e("span", { className: "mt-icon-grid-row", children: /* @__PURE__ */ e(d, {}) })
1293
+ ] }),
1294
+ /* @__PURE__ */ e("span", { className: "mt-brak", children: ")" })
1295
+ ] }),
1296
+ latex: "\\begin{pmatrix} #? \\\\ #? \\end{pmatrix}",
1297
+ tip: "Vektor kolom 2"
1298
+ },
1299
+ {
1300
+ icon: /* @__PURE__ */ a("span", { className: "mt-icon-row", children: [
1301
+ /* @__PURE__ */ e("span", { className: "mt-brak", children: "(" }),
1302
+ /* @__PURE__ */ a("span", { className: "mt-icon-grid", children: [
1303
+ /* @__PURE__ */ e("span", { className: "mt-icon-grid-row", children: /* @__PURE__ */ e(d, {}) }),
1304
+ /* @__PURE__ */ e("span", { className: "mt-icon-grid-row", children: /* @__PURE__ */ e(d, {}) }),
1305
+ /* @__PURE__ */ e("span", { className: "mt-icon-grid-row", children: /* @__PURE__ */ e(d, {}) })
1306
+ ] }),
1307
+ /* @__PURE__ */ e("span", { className: "mt-brak", children: ")" })
1308
+ ] }),
1309
+ latex: "\\begin{pmatrix} #? \\\\ #? \\\\ #? \\end{pmatrix}",
1310
+ tip: "Vektor kolom 3"
1311
+ },
1312
+ {
1313
+ icon: /* @__PURE__ */ a("span", { className: "mt-icon-row", children: [
1314
+ /* @__PURE__ */ e("span", { className: "mt-brak", children: "(" }),
1315
+ /* @__PURE__ */ e("span", { className: "mt-icon-grid", children: /* @__PURE__ */ a("span", { className: "mt-icon-grid-row", children: [
1316
+ /* @__PURE__ */ e(d, {}),
1317
+ /* @__PURE__ */ e(d, {})
1318
+ ] }) }),
1319
+ /* @__PURE__ */ e("span", { className: "mt-brak", children: ")" })
1320
+ ] }),
1321
+ latex: "\\begin{pmatrix} #? & #? \\end{pmatrix}",
1322
+ tip: "Vektor baris 2"
1323
+ },
1324
+ {
1325
+ icon: /* @__PURE__ */ a("span", { className: "mt-icon-row", children: [
1326
+ /* @__PURE__ */ e("span", { className: "mt-brak", children: "{" }),
1327
+ /* @__PURE__ */ a("span", { className: "mt-icon-grid", children: [
1328
+ /* @__PURE__ */ a("span", { className: "mt-icon-grid-row", children: [
1329
+ /* @__PURE__ */ e(d, {}),
1330
+ /* @__PURE__ */ e(d, {})
1331
+ ] }),
1332
+ /* @__PURE__ */ a("span", { className: "mt-icon-grid-row", children: [
1333
+ /* @__PURE__ */ e(d, {}),
1334
+ /* @__PURE__ */ e(d, {})
1335
+ ] })
1336
+ ] })
1337
+ ] }),
1338
+ latex: "\\begin{cases} #? & #? \\\\ #? & #? \\end{cases}",
1339
+ tip: "Kasus (2 baris)"
1340
+ },
1341
+ {
1342
+ icon: /* @__PURE__ */ a("span", { className: "mt-icon-row", children: [
1343
+ /* @__PURE__ */ e("span", { className: "mt-brak", children: "{" }),
1344
+ /* @__PURE__ */ a("span", { className: "mt-icon-grid", children: [
1345
+ /* @__PURE__ */ a("span", { className: "mt-icon-grid-row", children: [
1346
+ /* @__PURE__ */ e(d, {}),
1347
+ /* @__PURE__ */ e(d, {})
1348
+ ] }),
1349
+ /* @__PURE__ */ a("span", { className: "mt-icon-grid-row", children: [
1350
+ /* @__PURE__ */ e(d, {}),
1351
+ /* @__PURE__ */ e(d, {})
1352
+ ] }),
1353
+ /* @__PURE__ */ a("span", { className: "mt-icon-grid-row", children: [
1354
+ /* @__PURE__ */ e(d, {}),
1355
+ /* @__PURE__ */ e(d, {})
1356
+ ] })
1357
+ ] })
1358
+ ] }),
1359
+ latex: "\\begin{cases} #? & #? \\\\ #? & #? \\\\ #? & #? \\end{cases}",
1360
+ tip: "Kasus (3 baris)"
1361
+ },
1362
+ {
1363
+ icon: /* @__PURE__ */ e("span", { className: "mt-sym-lg", children: "⋯ ⋮ ⋱" }),
1364
+ latex: "\\cdots \\quad \\vdots \\quad \\ddots",
1365
+ tip: "Dots (titik-titik)"
1366
+ }
1367
+ ],
1368
+ [
1369
+ // Matrix Manipulation Tools
1370
+ { icon: /* @__PURE__ */ e("span", { className: "mt-txt-icon", children: "+R" }), command: "addRowAfter", tip: "Tambah Baris (Bawah)" },
1371
+ { icon: /* @__PURE__ */ e("span", { className: "mt-txt-icon", children: "+C" }), command: "addColumnAfter", tip: "Tambah Kolom (Kanan)" },
1372
+ { icon: /* @__PURE__ */ e("span", { className: "mt-txt-icon", children: "-R" }), command: "removeRow", tip: "Hapus Baris" },
1373
+ { icon: /* @__PURE__ */ e("span", { className: "mt-txt-icon", children: "-C" }), command: "removeColumn", tip: "Hapus Kolom" }
1374
+ ],
1375
+ [
1376
+ { icon: /* @__PURE__ */ e(L, { t: "Identitas" }), latex: "I = \\begin{pmatrix} 1 & 0 \\\\ 0 & 1 \\end{pmatrix}", tip: "Matriks Identitas 2x2" },
1377
+ { icon: /* @__PURE__ */ e(L, { t: "Determinan" }), latex: "\\det(A) = ad - bc", tip: "Determinan 2x2" }
1378
+ ]
1379
+ ]
1380
+ },
1381
+ // ---- Tab 6: Brackets ----
1382
+ {
1383
+ id: "bracket",
1384
+ icon: "(▫) {▫}",
1385
+ tip: "Tanda Kurung",
1386
+ rows: [
1387
+ [
1388
+ {
1389
+ icon: /* @__PURE__ */ a("span", { className: "mt-icon-row", children: [
1390
+ /* @__PURE__ */ e("span", { className: "mt-brak mt-brak--lg", children: "(" }),
1391
+ /* @__PURE__ */ e(S, {}),
1392
+ /* @__PURE__ */ e("span", { className: "mt-brak mt-brak--lg", children: ")" })
1393
+ ] }),
1394
+ latex: "\\left( #? \\right)",
1395
+ tip: "Kurung biasa"
1396
+ },
1397
+ {
1398
+ icon: /* @__PURE__ */ a("span", { className: "mt-icon-row", children: [
1399
+ /* @__PURE__ */ e("span", { className: "mt-brak mt-brak--lg", children: "[" }),
1400
+ /* @__PURE__ */ e(S, {}),
1401
+ /* @__PURE__ */ e("span", { className: "mt-brak mt-brak--lg", children: "]" })
1402
+ ] }),
1403
+ latex: "\\left[ #? \\right]",
1404
+ tip: "Kurung siku"
1405
+ },
1406
+ {
1407
+ icon: /* @__PURE__ */ a("span", { className: "mt-icon-row", children: [
1408
+ /* @__PURE__ */ e("span", { className: "mt-brak mt-brak--lg", children: "{" }),
1409
+ /* @__PURE__ */ e(S, {}),
1410
+ /* @__PURE__ */ e("span", { className: "mt-brak mt-brak--lg", children: "}" })
1411
+ ] }),
1412
+ latex: "\\left\\{ #? \\right\\}",
1413
+ tip: "Kurung kurawal"
1414
+ },
1415
+ {
1416
+ icon: /* @__PURE__ */ a("span", { className: "mt-icon-row", children: [
1417
+ /* @__PURE__ */ e("span", { className: "mt-brak mt-brak--lg", children: "|" }),
1418
+ /* @__PURE__ */ e(S, {}),
1419
+ /* @__PURE__ */ e("span", { className: "mt-brak mt-brak--lg", children: "|" })
1420
+ ] }),
1421
+ latex: "\\left| #? \\right|",
1422
+ tip: "Nilai mutlak"
1423
+ },
1424
+ {
1425
+ icon: /* @__PURE__ */ a("span", { className: "mt-icon-row", children: [
1426
+ /* @__PURE__ */ e("span", { className: "mt-brak mt-brak--lg", children: "‖" }),
1427
+ /* @__PURE__ */ e(S, {}),
1428
+ /* @__PURE__ */ e("span", { className: "mt-brak mt-brak--lg", children: "‖" })
1429
+ ] }),
1430
+ latex: "\\left\\| #? \\right\\|",
1431
+ tip: "Norm"
1432
+ },
1433
+ {
1434
+ icon: /* @__PURE__ */ a("span", { className: "mt-icon-row", children: [
1435
+ /* @__PURE__ */ e("span", { className: "mt-brak mt-brak--lg", children: "⟨" }),
1436
+ /* @__PURE__ */ e(S, {}),
1437
+ /* @__PURE__ */ e("span", { className: "mt-brak mt-brak--lg", children: "⟩" })
1438
+ ] }),
1439
+ latex: "\\langle #? \\rangle",
1440
+ tip: "Kurung sudut"
1441
+ },
1442
+ {
1443
+ icon: /* @__PURE__ */ a("span", { className: "mt-icon-row", children: [
1444
+ /* @__PURE__ */ e("span", { className: "mt-brak mt-brak--lg", children: "⌊" }),
1445
+ /* @__PURE__ */ e(S, {}),
1446
+ /* @__PURE__ */ e("span", { className: "mt-brak mt-brak--lg", children: "⌋" })
1447
+ ] }),
1448
+ latex: "\\lfloor #? \\rfloor",
1449
+ tip: "Floor"
1450
+ },
1451
+ {
1452
+ icon: /* @__PURE__ */ a("span", { className: "mt-icon-row", children: [
1453
+ /* @__PURE__ */ e("span", { className: "mt-brak mt-brak--lg", children: "⌈" }),
1454
+ /* @__PURE__ */ e(S, {}),
1455
+ /* @__PURE__ */ e("span", { className: "mt-brak mt-brak--lg", children: "⌉" })
1456
+ ] }),
1457
+ latex: "\\lceil #? \\rceil",
1458
+ tip: "Ceiling"
1459
+ }
1460
+ ],
1461
+ [
1462
+ {
1463
+ icon: /* @__PURE__ */ a("span", { className: "mt-icon-row", children: [
1464
+ /* @__PURE__ */ e("span", { className: "mt-brak mt-brak--lg", children: "(" }),
1465
+ /* @__PURE__ */ e(S, {}),
1466
+ /* @__PURE__ */ e("span", { className: "mt-brak mt-brak--lg", children: "]" })
1467
+ ] }),
1468
+ latex: "\\left( #? \\right]",
1469
+ tip: "Setengah terbuka kiri"
1470
+ },
1471
+ {
1472
+ icon: /* @__PURE__ */ a("span", { className: "mt-icon-row", children: [
1473
+ /* @__PURE__ */ e("span", { className: "mt-brak mt-brak--lg", children: "[" }),
1474
+ /* @__PURE__ */ e(S, {}),
1475
+ /* @__PURE__ */ e("span", { className: "mt-brak mt-brak--lg", children: ")" })
1476
+ ] }),
1477
+ latex: "\\left[ #? \\right)",
1478
+ tip: "Setengah terbuka kanan"
1479
+ },
1480
+ {
1481
+ icon: /* @__PURE__ */ a("span", { className: "mt-icon-row", children: [
1482
+ /* @__PURE__ */ e("span", { className: "mt-brak mt-brak--lg", children: "(" }),
1483
+ /* @__PURE__ */ e(S, {})
1484
+ ] }),
1485
+ latex: "\\left( #? \\right.",
1486
+ tip: "Kurung kiri saja"
1487
+ },
1488
+ {
1489
+ icon: /* @__PURE__ */ a("span", { className: "mt-icon-row", children: [
1490
+ /* @__PURE__ */ e(S, {}),
1491
+ /* @__PURE__ */ e("span", { className: "mt-brak mt-brak--lg", children: ")" })
1492
+ ] }),
1493
+ latex: "\\left. #? \\right)",
1494
+ tip: "Kurung kanan saja"
1495
+ },
1496
+ {
1497
+ icon: /* @__PURE__ */ a("span", { className: "mt-icon-row", children: [
1498
+ /* @__PURE__ */ e("span", { className: "mt-brak mt-brak--lg", children: "{" }),
1499
+ /* @__PURE__ */ e(S, {})
1500
+ ] }),
1501
+ latex: "\\left\\{ #? \\right.",
1502
+ tip: "Kurawal kiri saja"
1503
+ },
1504
+ {
1505
+ icon: /* @__PURE__ */ a("span", { className: "mt-icon-row", children: [
1506
+ /* @__PURE__ */ e("span", { className: "mt-sym", children: "x" }),
1507
+ /* @__PURE__ */ e("span", { className: "mt-over", children: "‾" })
1508
+ ] }),
1509
+ latex: "\\bar{#?}",
1510
+ tip: "Bar (rata-rata)"
1511
+ },
1512
+ {
1513
+ icon: /* @__PURE__ */ a("span", { className: "mt-icon-row", children: [
1514
+ /* @__PURE__ */ e("span", { className: "mt-sym", children: "x" }),
1515
+ /* @__PURE__ */ e("span", { className: "mt-over", children: "^" })
1516
+ ] }),
1517
+ latex: "\\hat{#?}",
1518
+ tip: "Hat"
1519
+ },
1520
+ {
1521
+ icon: /* @__PURE__ */ a("span", { className: "mt-icon-row", children: [
1522
+ /* @__PURE__ */ e("span", { className: "mt-sym", children: "x" }),
1523
+ /* @__PURE__ */ e("span", { className: "mt-over", children: "→" })
1524
+ ] }),
1525
+ latex: "\\vec{#?}",
1526
+ tip: "Vektor"
1527
+ }
1528
+ ],
1529
+ [
1530
+ { icon: /* @__PURE__ */ e(L, { t: "{ x | ... }" }), latex: "\\{ x \\in \\mathbb{R} \\mid x > 0 \\}", tip: "Notasi Pembentuk Himpunan" },
1531
+ { icon: /* @__PURE__ */ e(L, { t: "[ a, b ]" }), latex: "[ a, b ] = \\{ x \\mid a \\le x \\le b \\}", tip: "Interval Tertutup" },
1532
+ { icon: /* @__PURE__ */ e(L, { t: "Binomial" }), latex: "\\binom{n}{k}", tip: "Koefisien Binomial" }
1533
+ ]
1534
+ ]
1535
+ },
1536
+ // ---- Tab 7: Decorations & Accents ----
1537
+ {
1538
+ id: "deco",
1539
+ icon: "x̄ x⃗",
1540
+ tip: "Aksen & Dekorasi",
1541
+ rows: [
1542
+ [
1543
+ { icon: /* @__PURE__ */ a("span", { className: "mt-icon-row", children: [
1544
+ /* @__PURE__ */ e("span", { className: "mt-sym", children: "x" }),
1545
+ /* @__PURE__ */ e("span", { className: "mt-over", children: "‾" })
1546
+ ] }), latex: "\\bar{#?}", tip: "Bar" },
1547
+ { icon: /* @__PURE__ */ a("span", { className: "mt-icon-row", children: [
1548
+ /* @__PURE__ */ e("span", { className: "mt-sym", children: "x" }),
1549
+ /* @__PURE__ */ e("span", { className: "mt-over", children: "^" })
1550
+ ] }), latex: "\\hat{#?}", tip: "Hat" },
1551
+ { icon: /* @__PURE__ */ a("span", { className: "mt-icon-row", children: [
1552
+ /* @__PURE__ */ e("span", { className: "mt-sym", children: "x" }),
1553
+ /* @__PURE__ */ e("span", { className: "mt-over", children: "→" })
1554
+ ] }), latex: "\\vec{#?}", tip: "Vektor" },
1555
+ { icon: /* @__PURE__ */ a("span", { className: "mt-icon-row", children: [
1556
+ /* @__PURE__ */ e("span", { className: "mt-sym", children: "x" }),
1557
+ /* @__PURE__ */ e("span", { className: "mt-over", children: "~" })
1558
+ ] }), latex: "\\tilde{#?}", tip: "Tilde" },
1559
+ { icon: /* @__PURE__ */ a("span", { className: "mt-icon-row", children: [
1560
+ /* @__PURE__ */ e("span", { className: "mt-sym", children: "x" }),
1561
+ /* @__PURE__ */ e("span", { className: "mt-over", children: "·" })
1562
+ ] }), latex: "\\dot{#?}", tip: "Dot" },
1563
+ { icon: /* @__PURE__ */ a("span", { className: "mt-icon-row", children: [
1564
+ /* @__PURE__ */ e("span", { className: "mt-sym", children: "x" }),
1565
+ /* @__PURE__ */ e("span", { className: "mt-over", children: "··" })
1566
+ ] }), latex: "\\ddot{#?}", tip: "Double dot" },
1567
+ { icon: /* @__PURE__ */ a("span", { className: "mt-icon-row", children: [
1568
+ /* @__PURE__ */ e("span", { className: "mt-sym", children: "x" }),
1569
+ /* @__PURE__ */ e("span", { className: "mt-over", children: "↔" })
1570
+ ] }), latex: "\\overleftrightarrow{#?}", tip: "Panah dua arah di atas" },
1571
+ { icon: /* @__PURE__ */ a("span", { className: "mt-icon-row", children: [
1572
+ /* @__PURE__ */ e("span", { className: "mt-sym", children: "x" }),
1573
+ /* @__PURE__ */ e("span", { className: "mt-under", children: "_" })
1574
+ ] }), latex: "\\underline{#?}", tip: "Underline" }
1575
+ ],
1576
+ [
1577
+ { icon: /* @__PURE__ */ a("span", { className: "mt-icon-row", children: [
1578
+ /* @__PURE__ */ e("span", { className: "mt-sym", children: /* @__PURE__ */ e(S, {}) }),
1579
+ /* @__PURE__ */ e("span", { className: "mt-over", children: "‾‾" })
1580
+ ] }), latex: "\\overline{#?}", tip: "Overline" },
1581
+ { icon: /* @__PURE__ */ a("span", { className: "mt-icon-row", children: [
1582
+ /* @__PURE__ */ e("span", { className: "mt-sym", children: "x" }),
1583
+ /* @__PURE__ */ e("span", { className: "mt-over", children: "˘" })
1584
+ ] }), latex: "\\breve{#?}", tip: "Breve" },
1585
+ { icon: /* @__PURE__ */ a("span", { className: "mt-icon-row", children: [
1586
+ /* @__PURE__ */ e("span", { className: "mt-sym", children: "x" }),
1587
+ /* @__PURE__ */ e("span", { className: "mt-over", children: "ˇ" })
1588
+ ] }), latex: "\\check{#?}", tip: "Check" },
1589
+ { icon: /* @__PURE__ */ a("span", { className: "mt-icon-row", children: [
1590
+ /* @__PURE__ */ e("span", { className: "mt-sym", children: /* @__PURE__ */ e(S, {}) }),
1591
+ /* @__PURE__ */ e("span", { className: "mt-over", children: "→" })
1592
+ ] }), latex: "\\overrightarrow{#?}", tip: "Panah kanan di atas" },
1593
+ { icon: /* @__PURE__ */ a("span", { className: "mt-icon-row", children: [
1594
+ /* @__PURE__ */ e("span", { className: "mt-sym", children: /* @__PURE__ */ e(S, {}) }),
1595
+ /* @__PURE__ */ e("span", { className: "mt-over", children: "⌢" })
1596
+ ] }), latex: "\\widehat{#?}", tip: "Wide hat" },
1597
+ { icon: /* @__PURE__ */ a("span", { className: "mt-icon-row", children: [
1598
+ /* @__PURE__ */ e("span", { className: "mt-sym", children: /* @__PURE__ */ e(S, {}) }),
1599
+ /* @__PURE__ */ e("span", { className: "mt-over", children: "~" })
1600
+ ] }), latex: "\\widetilde{#?}", tip: "Wide tilde" },
1601
+ { icon: /* @__PURE__ */ a("span", { className: "mt-icon-row", children: [
1602
+ /* @__PURE__ */ e("span", { className: "mt-over", children: "⏞" }),
1603
+ /* @__PURE__ */ e("span", { className: "mt-sym", children: /* @__PURE__ */ e(S, {}) })
1604
+ ] }), latex: "\\overbrace{#?}", tip: "Overbrace" },
1605
+ { icon: /* @__PURE__ */ a("span", { className: "mt-icon-row", children: [
1606
+ /* @__PURE__ */ e("span", { className: "mt-sym", children: /* @__PURE__ */ e(S, {}) }),
1607
+ /* @__PURE__ */ e("span", { className: "mt-under", children: "⏟" })
1608
+ ] }), latex: "\\underbrace{#?}", tip: "Underbrace" }
1609
+ ],
1610
+ [
1611
+ { icon: /* @__PURE__ */ e(L, { t: "Vektor Sum" }), latex: "\\vec{a} + \\vec{b} = \\vec{c}", tip: "Penjumlahan Vektor" },
1612
+ { icon: /* @__PURE__ */ e(L, { t: "Rata-rata" }), latex: "\\bar{x} = \\frac{1}{n} \\sum_{i=1}^n x_i", tip: "Rata-rata (Mean)" },
1613
+ { icon: /* @__PURE__ */ e(L, { t: "Estimasi" }), latex: "\\hat{y} = b_0 + b_1 x", tip: "Estimasi Regresi" }
1614
+ ]
1615
+ ]
1616
+ },
1617
+ // ---- Tab 8: Sums, Products, Sets ----
1618
+ {
1619
+ id: "sum",
1620
+ icon: "Σ ∪",
1621
+ tip: "Sigma, Produk, Himpunan",
1622
+ rows: [
1623
+ [
1624
+ {
1625
+ icon: /* @__PURE__ */ e("span", { className: "mt-sym-xl", children: "Σ" }),
1626
+ latex: "\\sum #?",
1627
+ tip: "Sigma"
1628
+ },
1629
+ {
1630
+ icon: /* @__PURE__ */ e("span", { className: "mt-icon-row", children: /* @__PURE__ */ a("span", { className: "mt-icon-stack", children: [
1631
+ /* @__PURE__ */ e("sup", { className: "mt-icon-idx", children: /* @__PURE__ */ e(d, {}) }),
1632
+ /* @__PURE__ */ e("span", { className: "mt-sym-xl", children: "Σ" }),
1633
+ /* @__PURE__ */ e("sub", { className: "mt-icon-idx", children: /* @__PURE__ */ e(d, {}) })
1634
+ ] }) }),
1635
+ latex: "\\sum_{#?}^{#?} #?",
1636
+ tip: "Sigma (batas)"
1637
+ },
1638
+ {
1639
+ icon: /* @__PURE__ */ e("span", { className: "mt-sym-xl", children: "∏" }),
1640
+ latex: "\\prod #?",
1641
+ tip: "Produk"
1642
+ },
1643
+ {
1644
+ icon: /* @__PURE__ */ e("span", { className: "mt-icon-row", children: /* @__PURE__ */ a("span", { className: "mt-icon-stack", children: [
1645
+ /* @__PURE__ */ e("sup", { className: "mt-icon-idx", children: /* @__PURE__ */ e(d, {}) }),
1646
+ /* @__PURE__ */ e("span", { className: "mt-sym-xl", children: "∏" }),
1647
+ /* @__PURE__ */ e("sub", { className: "mt-icon-idx", children: /* @__PURE__ */ e(d, {}) })
1648
+ ] }) }),
1649
+ latex: "\\prod_{#?}^{#?} #?",
1650
+ tip: "Produk (batas)"
1651
+ },
1652
+ {
1653
+ icon: /* @__PURE__ */ e("span", { className: "mt-sym-xl", children: "∐" }),
1654
+ latex: "\\coprod_{#?}^{#?} #?",
1655
+ tip: "Koproduk"
1656
+ },
1657
+ {
1658
+ icon: /* @__PURE__ */ e("span", { className: "mt-sym-xl", children: "⋂" }),
1659
+ latex: "\\bigcap_{#?}^{#?} #?",
1660
+ tip: "Irisan besar"
1661
+ }
1662
+ ],
1663
+ [
1664
+ { icon: /* @__PURE__ */ e("span", { className: "mt-sym-xl", children: "⋃" }), latex: "\\bigcup_{#?}^{#?} #?", tip: "Gabungan besar" },
1665
+ { icon: /* @__PURE__ */ e("span", { className: "mt-sym-xl", children: "⋁" }), latex: "\\bigvee_{#?}^{#?} #?", tip: "Or besar" },
1666
+ { icon: /* @__PURE__ */ e("span", { className: "mt-sym-xl", children: "⋀" }), latex: "\\bigwedge_{#?}^{#?} #?", tip: "And besar" },
1667
+ { icon: /* @__PURE__ */ e("span", { className: "mt-sym-xl", children: "⨁" }), latex: "\\bigoplus_{#?}^{#?} #?", tip: "Plus langsung" },
1668
+ { icon: /* @__PURE__ */ e("span", { className: "mt-sym-xl", children: "⨂" }), latex: "\\bigotimes_{#?}^{#?} #?", tip: "Tensor besar" },
1669
+ { icon: /* @__PURE__ */ e("span", { className: "mt-sym-xl", children: "⨆" }), latex: "\\bigsqcup_{#?}^{#?} #?", tip: "Union persegi besar" }
1670
+ ],
1671
+ [
1672
+ { icon: /* @__PURE__ */ e(L, { t: "Deret Ari" }), latex: "S_n = \\frac{n}{2}(a + U_n)", tip: "Deret Aritmatika" },
1673
+ { icon: /* @__PURE__ */ e(L, { t: "Deret Geo" }), latex: "S_\\infty = \\frac{a}{1-r}", tip: "Deret Geometri Tak Hingga" },
1674
+ { icon: /* @__PURE__ */ e(L, { t: "Sigma n" }), latex: "\\sum_{i=1}^n i = \\frac{n(n+1)}{2}", tip: "Jumlah n bilangan asli" }
1675
+ ]
1676
+ ]
1677
+ },
1678
+ // ---- Tab 9: Integrals & Calculus ----
1679
+ {
1680
+ id: "calc",
1681
+ icon: "∫ lim",
1682
+ tip: "Integral & Kalkulus",
1683
+ rows: [
1684
+ [
1685
+ {
1686
+ icon: /* @__PURE__ */ e("span", { className: "mt-sym-xl", children: "∫" }),
1687
+ latex: "\\int #?\\, d#?",
1688
+ tip: "Integral"
1689
+ },
1690
+ {
1691
+ icon: /* @__PURE__ */ e("span", { className: "mt-icon-row", children: /* @__PURE__ */ a("span", { className: "mt-icon-stack", children: [
1692
+ /* @__PURE__ */ e("sup", { className: "mt-icon-idx", children: /* @__PURE__ */ e(d, {}) }),
1693
+ /* @__PURE__ */ e("span", { className: "mt-sym-xl", children: "∫" }),
1694
+ /* @__PURE__ */ e("sub", { className: "mt-icon-idx", children: /* @__PURE__ */ e(d, {}) })
1695
+ ] }) }),
1696
+ latex: "\\int_{#?}^{#?} #?\\, d#?",
1697
+ tip: "Integral tentu"
1698
+ },
1699
+ {
1700
+ icon: /* @__PURE__ */ e("span", { className: "mt-sym-xl", children: "∬" }),
1701
+ latex: "\\iint_{#?} #?\\, dA",
1702
+ tip: "Integral ganda"
1703
+ },
1704
+ {
1705
+ icon: /* @__PURE__ */ e("span", { className: "mt-sym-xl", children: "∭" }),
1706
+ latex: "\\iiint_{#?} #?\\, dV",
1707
+ tip: "Integral triple"
1708
+ },
1709
+ {
1710
+ icon: /* @__PURE__ */ e("span", { className: "mt-sym-xl", children: "∮" }),
1711
+ latex: "\\oint_{#?} #?",
1712
+ tip: "Integral kontur"
1713
+ },
1714
+ {
1715
+ icon: /* @__PURE__ */ e("span", { className: "mt-sym-fn", children: "lim" }),
1716
+ latex: "\\lim_{#? \\to #?} #?",
1717
+ tip: "Limit"
1718
+ }
1719
+ ],
1720
+ [
1721
+ {
1722
+ icon: /* @__PURE__ */ a("span", { className: "mt-icon-stack", children: [
1723
+ /* @__PURE__ */ e("span", { className: "mt-icon-num", children: /* @__PURE__ */ e("span", { className: "mt-sym-sm", children: "d" }) }),
1724
+ /* @__PURE__ */ e("span", { className: "mt-icon-bar" }),
1725
+ /* @__PURE__ */ e("span", { className: "mt-icon-den", children: /* @__PURE__ */ e("span", { className: "mt-sym-sm", children: "dx" }) })
1726
+ ] }),
1727
+ latex: "\\frac{d}{dx}",
1728
+ tip: "Turunan"
1729
+ },
1730
+ {
1731
+ icon: /* @__PURE__ */ a("span", { className: "mt-icon-stack", children: [
1732
+ /* @__PURE__ */ e("span", { className: "mt-icon-num", children: /* @__PURE__ */ e("span", { className: "mt-sym-sm", children: "d²" }) }),
1733
+ /* @__PURE__ */ e("span", { className: "mt-icon-bar" }),
1734
+ /* @__PURE__ */ e("span", { className: "mt-icon-den", children: /* @__PURE__ */ e("span", { className: "mt-sym-sm", children: "dx²" }) })
1735
+ ] }),
1736
+ latex: "\\frac{d^2}{dx^2}",
1737
+ tip: "Turunan kedua"
1738
+ },
1739
+ {
1740
+ icon: /* @__PURE__ */ a("span", { className: "mt-icon-stack", children: [
1741
+ /* @__PURE__ */ e("span", { className: "mt-icon-num", children: /* @__PURE__ */ e("span", { className: "mt-sym-sm", children: "∂" }) }),
1742
+ /* @__PURE__ */ e("span", { className: "mt-icon-bar" }),
1743
+ /* @__PURE__ */ e("span", { className: "mt-icon-den", children: /* @__PURE__ */ e("span", { className: "mt-sym-sm", children: "∂x" }) })
1744
+ ] }),
1745
+ latex: "\\frac{\\partial}{\\partial x}",
1746
+ tip: "Turunan parsial"
1747
+ },
1748
+ {
1749
+ icon: /* @__PURE__ */ a("span", { className: "mt-icon-stack", children: [
1750
+ /* @__PURE__ */ e("span", { className: "mt-icon-num", children: /* @__PURE__ */ e("span", { className: "mt-sym-sm", children: "∂²" }) }),
1751
+ /* @__PURE__ */ e("span", { className: "mt-icon-bar" }),
1752
+ /* @__PURE__ */ e("span", { className: "mt-icon-den", children: /* @__PURE__ */ e("span", { className: "mt-sym-sm", children: "∂x²" }) })
1753
+ ] }),
1754
+ latex: "\\frac{\\partial^2}{\\partial x^2}",
1755
+ tip: "Turunan parsial kedua"
1756
+ },
1757
+ {
1758
+ icon: /* @__PURE__ */ a("span", { className: "mt-icon-stack", children: [
1759
+ /* @__PURE__ */ e("span", { className: "mt-icon-num", children: /* @__PURE__ */ e("span", { className: "mt-sym-sm", children: "dy" }) }),
1760
+ /* @__PURE__ */ e("span", { className: "mt-icon-bar" }),
1761
+ /* @__PURE__ */ e("span", { className: "mt-icon-den", children: /* @__PURE__ */ e("span", { className: "mt-sym-sm", children: "dx" }) })
1762
+ ] }),
1763
+ latex: "\\frac{dy}{dx}",
1764
+ tip: "dy/dx"
1765
+ },
1766
+ {
1767
+ icon: /* @__PURE__ */ a("span", { className: "mt-sym-fn", children: [
1768
+ "f'(",
1769
+ /* @__PURE__ */ e(S, {}),
1770
+ ")"
1771
+ ] }),
1772
+ latex: "f'(#?)",
1773
+ tip: "f prime"
1774
+ }
1775
+ ],
1776
+ [
1777
+ { icon: /* @__PURE__ */ e(L, { t: "Int Tentu" }), latex: "\\int_a^b f(x) \\, dx", tip: "Integral Tentu" },
1778
+ { icon: /* @__PURE__ */ e(L, { t: "Limit Inf" }), latex: "\\lim_{x \\to \\infty} f(x)", tip: "Limit Tak Hingga" },
1779
+ { icon: /* @__PURE__ */ e(L, { t: "Turunan" }), latex: "\\frac{df}{dx} = \\lim_{h \\to 0} \\frac{f(x+h)-f(x)}{h}", tip: "Definisi Turunan" }
1780
+ ]
1781
+ ]
1782
+ },
1783
+ // ---- Tab 10: Operators & Relations ----
1784
+ {
1785
+ id: "oper",
1786
+ icon: "= ≠ ≤",
1787
+ tip: "Operator & Relasi",
1788
+ rows: [
1789
+ [
1790
+ { icon: /* @__PURE__ */ e("span", { className: "mt-sym-lg", children: "+" }), latex: "+", tip: "Tambah" },
1791
+ { icon: /* @__PURE__ */ e("span", { className: "mt-sym-lg", children: "−" }), latex: "-", tip: "Kurang" },
1792
+ { icon: /* @__PURE__ */ e("span", { className: "mt-sym-lg", children: "×" }), latex: "\\times", tip: "Kali" },
1793
+ { icon: /* @__PURE__ */ e("span", { className: "mt-sym-lg", children: "÷" }), latex: "\\div", tip: "Bagi" },
1794
+ { icon: /* @__PURE__ */ e("span", { className: "mt-sym-lg", children: "±" }), latex: "\\pm", tip: "Plus-minus" },
1795
+ { icon: /* @__PURE__ */ e("span", { className: "mt-sym-lg", children: "∓" }), latex: "\\mp", tip: "Minus-plus" },
1796
+ { icon: /* @__PURE__ */ e("span", { className: "mt-sym-lg", children: "·" }), latex: "\\cdot", tip: "Dot" },
1797
+ { icon: /* @__PURE__ */ e("span", { className: "mt-sym-lg", children: "∘" }), latex: "\\circ", tip: "Komposisi" },
1798
+ { icon: /* @__PURE__ */ e("span", { className: "mt-sym-lg", children: "=" }), latex: "=", tip: "Sama dengan" },
1799
+ { icon: /* @__PURE__ */ e("span", { className: "mt-sym-lg", children: "≠" }), latex: "\\neq", tip: "Tidak sama" }
1800
+ ],
1801
+ [
1802
+ { icon: /* @__PURE__ */ e("span", { className: "mt-sym-lg", children: "<" }), latex: "<", tip: "Kurang dari" },
1803
+ { icon: /* @__PURE__ */ e("span", { className: "mt-sym-lg", children: ">" }), latex: ">", tip: "Lebih dari" },
1804
+ { icon: /* @__PURE__ */ e("span", { className: "mt-sym-lg", children: "≤" }), latex: "\\leq", tip: "Kurang/sama" },
1805
+ { icon: /* @__PURE__ */ e("span", { className: "mt-sym-lg", children: "≥" }), latex: "\\geq", tip: "Lebih/sama" },
1806
+ { icon: /* @__PURE__ */ e("span", { className: "mt-sym-lg", children: "≈" }), latex: "\\approx", tip: "Hampir sama" },
1807
+ { icon: /* @__PURE__ */ e("span", { className: "mt-sym-lg", children: "≡" }), latex: "\\equiv", tip: "Identik" },
1808
+ { icon: /* @__PURE__ */ e("span", { className: "mt-sym-lg", children: "∈" }), latex: "\\in", tip: "Elemen dari" },
1809
+ { icon: /* @__PURE__ */ e("span", { className: "mt-sym-lg", children: "∉" }), latex: "\\notin", tip: "Bukan elemen" },
1810
+ { icon: /* @__PURE__ */ e("span", { className: "mt-sym-lg", children: "⊂" }), latex: "\\subset", tip: "Subset" },
1811
+ { icon: /* @__PURE__ */ e("span", { className: "mt-sym-lg", children: "⊃" }), latex: "\\supset", tip: "Superset" }
1812
+ ],
1813
+ [
1814
+ { icon: /* @__PURE__ */ e("span", { className: "mt-sym-lg", children: "∪" }), latex: "\\cup", tip: "Gabungan" },
1815
+ { icon: /* @__PURE__ */ e("span", { className: "mt-sym-lg", children: "∩" }), latex: "\\cap", tip: "Irisan" },
1816
+ { icon: /* @__PURE__ */ e("span", { className: "mt-sym-lg", children: "∅" }), latex: "\\emptyset", tip: "Himpunan kosong" },
1817
+ { icon: /* @__PURE__ */ e("span", { className: "mt-sym-lg", children: "∀" }), latex: "\\forall", tip: "Untuk semua" },
1818
+ { icon: /* @__PURE__ */ e("span", { className: "mt-sym-lg", children: "∃" }), latex: "\\exists", tip: "Eksistensi" },
1819
+ { icon: /* @__PURE__ */ e("span", { className: "mt-sym-lg", children: "¬" }), latex: "\\neg", tip: "Negasi" },
1820
+ { icon: /* @__PURE__ */ e("span", { className: "mt-sym-lg", children: "∧" }), latex: "\\wedge", tip: "AND" },
1821
+ { icon: /* @__PURE__ */ e("span", { className: "mt-sym-lg", children: "∨" }), latex: "\\vee", tip: "OR" },
1822
+ { icon: /* @__PURE__ */ e("span", { className: "mt-sym-lg", children: "∴" }), latex: "\\therefore", tip: "Maka" },
1823
+ { icon: /* @__PURE__ */ e("span", { className: "mt-sym-lg", children: "∵" }), latex: "\\because", tip: "Karena" }
1824
+ ],
1825
+ [
1826
+ { icon: /* @__PURE__ */ e(L, { t: "Mod" }), latex: "a \\equiv b \\pmod{n}", tip: "Modulo" },
1827
+ { icon: /* @__PURE__ */ e(L, { t: "For All" }), latex: "\\forall x \\in \\mathbb{R}", tip: "Untuk semua bilangan real" },
1828
+ { icon: /* @__PURE__ */ e(L, { t: "Exists" }), latex: "\\exists y \\text{ s.t. } y > x", tip: "Terdapat y sedemikian..." }
1829
+ ]
1830
+ ]
1831
+ },
1832
+ // ---- Tab 11: Geometry & Trig ----
1833
+ {
1834
+ id: "geom",
1835
+ icon: "∠ △",
1836
+ tip: "Geometri & Trigonometri",
1837
+ rows: [
1838
+ [
1839
+ { icon: /* @__PURE__ */ e("span", { className: "mt-sym-lg", children: "∠" }), latex: "\\angle", tip: "Sudut" },
1840
+ { icon: /* @__PURE__ */ e("span", { className: "mt-sym-lg", children: "△" }), latex: "\\triangle", tip: "Segitiga" },
1841
+ { icon: /* @__PURE__ */ e("span", { className: "mt-sym-lg", children: "⊥" }), latex: "\\perp", tip: "Tegak lurus" },
1842
+ { icon: /* @__PURE__ */ e("span", { className: "mt-sym-lg", children: "∥" }), latex: "\\parallel", tip: "Sejajar" },
1843
+ { icon: /* @__PURE__ */ e("span", { className: "mt-sym-lg", children: "≅" }), latex: "\\cong", tip: "Kongruen" },
1844
+ { icon: /* @__PURE__ */ e("span", { className: "mt-sym-lg", children: "∼" }), latex: "\\sim", tip: "Sebangun" },
1845
+ { icon: /* @__PURE__ */ e("span", { className: "mt-sym-lg", children: "□" }), latex: "\\square", tip: "Persegi" },
1846
+ { icon: /* @__PURE__ */ e("span", { className: "mt-sym-lg", children: "⊙" }), latex: "\\odot", tip: "Titik pusat lingkaran" }
1847
+ ],
1848
+ [
1849
+ { icon: /* @__PURE__ */ e("span", { className: "mt-sym-fn", children: "sin" }), latex: "\\sin", tip: "Sinus" },
1850
+ { icon: /* @__PURE__ */ e("span", { className: "mt-sym-fn", children: "cos" }), latex: "\\cos", tip: "Kosinus" },
1851
+ { icon: /* @__PURE__ */ e("span", { className: "mt-sym-fn", children: "tan" }), latex: "\\tan", tip: "Tangen" },
1852
+ { icon: /* @__PURE__ */ a("span", { className: "mt-icon-row", children: [
1853
+ /* @__PURE__ */ e("span", { className: "mt-sym-fn", children: "sin" }),
1854
+ /* @__PURE__ */ e("sup", { children: "-1" })
1855
+ ] }), latex: "\\sin^{-1}", tip: "Arcsin" },
1856
+ { icon: /* @__PURE__ */ a("span", { className: "mt-icon-row", children: [
1857
+ /* @__PURE__ */ e("span", { className: "mt-sym-fn", children: "cos" }),
1858
+ /* @__PURE__ */ e("sup", { children: "-1" })
1859
+ ] }), latex: "\\cos^{-1}", tip: "Arccos" },
1860
+ { icon: /* @__PURE__ */ a("span", { className: "mt-icon-row", children: [
1861
+ /* @__PURE__ */ e("span", { className: "mt-sym-fn", children: "tan" }),
1862
+ /* @__PURE__ */ e("sup", { children: "-1" })
1863
+ ] }), latex: "\\tan^{-1}", tip: "Arctan" },
1864
+ { icon: /* @__PURE__ */ e("span", { className: "mt-sym-fn", children: "log" }), latex: "\\log", tip: "Logaritma" },
1865
+ { icon: /* @__PURE__ */ e("span", { className: "mt-sym-fn", children: "ln" }), latex: "\\ln", tip: "Log natural" }
1866
+ ],
1867
+ [
1868
+ { icon: /* @__PURE__ */ e(L, { t: "Identitas" }), latex: "\\sin^2 \\theta + \\cos^2 \\theta = 1", tip: "Identitas Trigonometri" },
1869
+ { icon: /* @__PURE__ */ e(L, { t: "Sin Rule" }), latex: "\\frac{a}{\\sin A} = \\frac{b}{\\sin B} = \\frac{c}{\\sin C}", tip: "Aturan Sinus" },
1870
+ { icon: /* @__PURE__ */ e(L, { t: "Cos Rule" }), latex: "c^2 = a^2 + b^2 - 2ab \\cos C", tip: "Aturan Cosinus" }
1871
+ ]
1872
+ ]
1873
+ },
1874
+ // ---- Tab 11: Chemistry (mhchem) ----
1875
+ {
1876
+ id: "chem",
1877
+ icon: "🧪",
1878
+ tip: "Kimia (mhchem)",
1879
+ rows: [
1880
+ [
1881
+ { icon: /* @__PURE__ */ e(L, { t: "Insert ce" }), latex: "\\ce{#?}", tip: "Sisipkan Rumus Kimia (ce)" },
1882
+ { icon: /* @__PURE__ */ e(L, { t: "Reaksi" }), latex: "\\ce{#? -> #?}", tip: "Persamaan Reaksi" },
1883
+ { icon: /* @__PURE__ */ e(L, { t: "Keseimbangan" }), latex: "\\ce{#? <=> #?}", tip: "Kesetimbangan" },
1884
+ { icon: /* @__PURE__ */ e(L, { t: "Katalis" }), latex: "\\ce{#? ->[#?][#?] #?}", tip: "Reaksi dengan katalis" },
1885
+ { icon: /* @__PURE__ */ e("span", { className: "mt-sym-lg", children: "→" }), latex: "\\ce{->}", tip: "Panah Reaksi" },
1886
+ { icon: /* @__PURE__ */ e("span", { className: "mt-sym-lg", children: "⇌" }), latex: "\\ce{<=>}", tip: "Panah Kesetimbangan" },
1887
+ { icon: /* @__PURE__ */ e("span", { className: "mt-sym", children: "Δ" }), latex: "\\ce{^\\Delta}", tip: "Panah Panas" }
1888
+ ],
1889
+ [
1890
+ { icon: /* @__PURE__ */ e("span", { className: "mt-sym", children: "n" }), latex: "n", tip: "Jumlah mol (n)" },
1891
+ { icon: /* @__PURE__ */ e("span", { className: "mt-sym", children: "M" }), latex: "M", tip: "Molaritas (M)" },
1892
+ { icon: /* @__PURE__ */ e("span", { className: "mt-sym", children: "m" }), latex: "m", tip: "Molalitas (m)" },
1893
+ { icon: /* @__PURE__ */ e("span", { className: "mt-sym", children: "V" }), latex: "V", tip: "Volume (V)" },
1894
+ { icon: /* @__PURE__ */ e("span", { className: "mt-sym", children: "P" }), latex: "P", tip: "Tekanan (P)" },
1895
+ { icon: /* @__PURE__ */ e("span", { className: "mt-sym", children: "R" }), latex: "R", tip: "Tetapan Gas (R)" },
1896
+ { icon: /* @__PURE__ */ e("span", { className: "mt-sym", children: "ΔH" }), latex: "\\Delta H", tip: "Perubahan Entalpi" },
1897
+ { icon: /* @__PURE__ */ e("span", { className: "mt-sym", children: "ΔG" }), latex: "\\Delta G", tip: "Energi Bebas Gibbs" },
1898
+ { icon: /* @__PURE__ */ e("span", { className: "mt-sym", children: "S" }), latex: "\\Delta S", tip: "Entropi" }
1899
+ ],
1900
+ [
1901
+ { icon: /* @__PURE__ */ a("span", { className: "mt-sym", children: [
1902
+ "[H",
1903
+ /* @__PURE__ */ e("sup", { children: "+" }),
1904
+ "]"
1905
+ ] }), latex: "[\\ce{H+}]", tip: "Konsentrasi H+" },
1906
+ { icon: /* @__PURE__ */ a("span", { className: "mt-sym", children: [
1907
+ "[OH",
1908
+ /* @__PURE__ */ e("sup", { children: "-" }),
1909
+ "]"
1910
+ ] }), latex: "[\\ce{OH-}]", tip: "Konsentrasi OH-" },
1911
+ { icon: /* @__PURE__ */ a("span", { className: "mt-sym", children: [
1912
+ "K",
1913
+ /* @__PURE__ */ e("sub", { children: "a" })
1914
+ ] }), latex: "K_a", tip: "Tetapan Asam" },
1915
+ { icon: /* @__PURE__ */ a("span", { className: "mt-sym", children: [
1916
+ "K",
1917
+ /* @__PURE__ */ e("sub", { children: "b" })
1918
+ ] }), latex: "K_b", tip: "Tetapan Basa" },
1919
+ { icon: /* @__PURE__ */ a("span", { className: "mt-sym", children: [
1920
+ "K",
1921
+ /* @__PURE__ */ e("sub", { children: "sp" })
1922
+ ] }), latex: "K_{sp}", tip: "Hasil Kali Kelarutan" },
1923
+ { icon: /* @__PURE__ */ a("span", { className: "mt-sym", children: [
1924
+ "SO",
1925
+ /* @__PURE__ */ e("sub", { children: "4" }),
1926
+ /* @__PURE__ */ e("sup", { children: "2-" })
1927
+ ] }), latex: "\\ce{SO4^{2-}}", tip: "Sulfat" },
1928
+ { icon: /* @__PURE__ */ a("span", { className: "mt-sym", children: [
1929
+ "NO",
1930
+ /* @__PURE__ */ e("sub", { children: "3" }),
1931
+ /* @__PURE__ */ e("sup", { children: "-" })
1932
+ ] }), latex: "\\ce{NO3-}", tip: "Nitrat" },
1933
+ { icon: /* @__PURE__ */ a("span", { className: "mt-sym", children: [
1934
+ "PO",
1935
+ /* @__PURE__ */ e("sub", { children: "4" }),
1936
+ /* @__PURE__ */ e("sup", { children: "3-" })
1937
+ ] }), latex: "\\ce{PO4^{3-}}", tip: "Fosfat" },
1938
+ { icon: /* @__PURE__ */ e("span", { className: "mt-sym", children: "+" }), latex: " + ", tip: "Tambah" }
1939
+ ],
1940
+ [
1941
+ { icon: /* @__PURE__ */ e("span", { className: "mt-sym", children: "H" }), latex: "\\ce{H}", tip: "Hidrogen" },
1942
+ { icon: /* @__PURE__ */ e("span", { className: "mt-sym", children: "C" }), latex: "\\ce{C}", tip: "Karbon" },
1943
+ { icon: /* @__PURE__ */ e("span", { className: "mt-sym", children: "O" }), latex: "\\ce{O}", tip: "Oksigen" },
1944
+ { icon: /* @__PURE__ */ e("span", { className: "mt-sym", children: "N" }), latex: "\\ce{N}", tip: "Nitrogen" },
1945
+ { icon: /* @__PURE__ */ e("span", { className: "mt-sym", children: "P" }), latex: "\\ce{P}", tip: "Fosfor" },
1946
+ { icon: /* @__PURE__ */ e("span", { className: "mt-sym", children: "S" }), latex: "\\ce{S}", tip: "Sulfur" },
1947
+ { icon: /* @__PURE__ */ e("span", { className: "mt-sym", children: "Cl" }), latex: "\\ce{Cl}", tip: "Klorin" },
1948
+ { icon: /* @__PURE__ */ e("span", { className: "mt-sym", children: "Na" }), latex: "\\ce{Na}", tip: "Natrium" },
1949
+ { icon: /* @__PURE__ */ e("span", { className: "mt-sym", children: "Mg" }), latex: "\\ce{Mg}", tip: "Magnesium" },
1950
+ { icon: /* @__PURE__ */ e("span", { className: "mt-sym", children: "Al" }), latex: "\\ce{Al}", tip: "Aluminium" }
1951
+ ],
1952
+ [
1953
+ { icon: /* @__PURE__ */ e("span", { className: "mt-sym", children: "K" }), latex: "\\ce{K}", tip: "Kalium" },
1954
+ { icon: /* @__PURE__ */ e("span", { className: "mt-sym", children: "Ca" }), latex: "\\ce{Ca}", tip: "Kalsium" },
1955
+ { icon: /* @__PURE__ */ e("span", { className: "mt-sym", children: "Fe" }), latex: "\\ce{Fe}", tip: "Besi (Ferrum)" },
1956
+ { icon: /* @__PURE__ */ e("span", { className: "mt-sym", children: "Cu" }), latex: "\\ce{Cu}", tip: "Tembaga (Cuprum)" },
1957
+ { icon: /* @__PURE__ */ e("span", { className: "mt-sym", children: "Zn" }), latex: "\\ce{Zn}", tip: "Seng (Zincum)" },
1958
+ { icon: /* @__PURE__ */ e("span", { className: "mt-sym", children: "Ag" }), latex: "\\ce{Ag}", tip: "Perak (Argentum)" },
1959
+ { icon: /* @__PURE__ */ e("span", { className: "mt-sym", children: "Au" }), latex: "\\ce{Au}", tip: "Emas (Aurum)" },
1960
+ { icon: /* @__PURE__ */ e("span", { className: "mt-sym", children: "Pb" }), latex: "\\ce{Pb}", tip: "Timbal (Plumbum)" },
1961
+ { icon: /* @__PURE__ */ e("span", { className: "mt-sym", children: "I" }), latex: "\\ce{I}", tip: "Iodin" },
1962
+ { icon: /* @__PURE__ */ e("span", { className: "mt-sym", children: "Br" }), latex: "\\ce{Br}", tip: "Bromin" }
1963
+ ],
1964
+ [
1965
+ { icon: /* @__PURE__ */ e("span", { className: "mt-sym", children: "COOH" }), latex: "COOH", tip: "Asam Karboksilat" },
1966
+ { icon: /* @__PURE__ */ e("span", { className: "mt-sym", children: "OH" }), latex: "OH", tip: "Hidroksil / Alkohol" },
1967
+ { icon: /* @__PURE__ */ a("span", { className: "mt-sym", children: [
1968
+ "NH",
1969
+ /* @__PURE__ */ e("sub", { children: "2" })
1970
+ ] }), latex: "NH2", tip: "Amida / Amina" },
1971
+ { icon: /* @__PURE__ */ a("span", { className: "mt-sym", children: [
1972
+ "CH",
1973
+ /* @__PURE__ */ e("sub", { children: "3" })
1974
+ ] }), latex: "CH3", tip: "Metil" },
1975
+ { icon: /* @__PURE__ */ e("span", { className: "mt-sym", children: "CHO" }), latex: "CHO", tip: "Aldehid" },
1976
+ { icon: /* @__PURE__ */ e("span", { className: "mt-sym", children: "CO" }), latex: "CO", tip: "Keton" },
1977
+ { icon: /* @__PURE__ */ a("span", { className: "mt-sym", children: [
1978
+ "C",
1979
+ /* @__PURE__ */ e("sub", { children: "6" }),
1980
+ "H",
1981
+ /* @__PURE__ */ e("sub", { children: "5" })
1982
+ ] }), latex: "C6H5", tip: "Fenil (Benzena)" },
1983
+ { icon: /* @__PURE__ */ e("span", { className: "mt-sym", children: "R-" }), latex: "R-", tip: "Gugus Alkil" }
1984
+ ]
1985
+ ]
1986
+ }
1987
+ ];
1988
+ function pt({ isOpen: n, onInsert: t, onClose: l, initialLatex: i = "", initialTab: c = "frac" }) {
1989
+ const [r, s] = H(i), [o, N] = H(c), y = R(null), u = R(null);
1990
+ X(() => {
1991
+ if (!n || !u.current) return;
1992
+ import("./mathlive-BwNIIOwE.js").then((w) => {
1993
+ if (!u.current) return;
1994
+ const B = w;
1995
+ B.MathfieldElement && (B.MathfieldElement.mathVirtualKeyboardPolicy = "manual");
1996
+ try {
1997
+ const W = tt();
1998
+ W && (W.visible = !1);
1999
+ } catch {
2000
+ }
2001
+ const _ = document.createElement("math-field");
2002
+ _.setAttribute("virtual-keyboard-mode", "off"), _.setAttribute("math-virtual-keyboard-policy", "manual"), _.mathVirtualKeyboardPolicy = "manual", _.setAttribute("smart-mode", "true"), _.setAttribute("smart-fence", "true"), _.setAttribute("smart-superscript", "true"), _.style.width = "100%", _.style.minHeight = "120px", _.style.fontSize = "24px", _.style.padding = "12px 16px", _.style.border = "none", _.style.outline = "none", _.style.background = "transparent", _.style.caretColor = "#2563eb", _.style.fontFamily = "'KaTeX_Main', 'KaTeX_Math', 'Times New Roman', serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji', 'Amiri', 'Malgun Gothic', 'SimSun'", _.style.setProperty("--keyboard-zindex", "-1"), _.style.setProperty("--virtual-keyboard-toggle-display", "none"), i && _.setAttribute("value", i), _.addEventListener("input", (W) => {
2003
+ const q = W.target;
2004
+ s(q.value);
2005
+ }), _.addEventListener("focus", () => {
2006
+ var W, q;
2007
+ try {
2008
+ (q = (W = tt()) == null ? void 0 : W.hide) == null || q.call(W);
2009
+ } catch {
2010
+ }
2011
+ }), u.current.innerHTML = "", u.current.appendChild(_), y.current = _, setTimeout(() => _.focus(), 100);
2012
+ });
2013
+ const g = u.current;
2014
+ return () => {
2015
+ g && (g.innerHTML = ""), y.current = null;
2016
+ };
2017
+ }, [n]);
2018
+ const h = b((g) => {
2019
+ var B;
2020
+ if (!y.current) return;
2021
+ const w = y.current;
2022
+ g.command ? (B = w.executeCommand) == null || B.call(w, g.command) : g.latex && (w.executeCommand ? w.executeCommand(["insert", g.latex, { focus: !0 }]) : w.value = (w.value || "") + g.latex), s(w.value || ""), w.focus();
2023
+ }, []), m = b((g) => {
2024
+ var _;
2025
+ if (!y.current) return;
2026
+ const w = y.current, B = `\\text{\\class{mt-font-${g}}{#@}}`;
2027
+ (_ = w.executeCommand) == null || _.call(w, ["insert", B, { focus: !0 }]), s(w.value || ""), w.focus();
2028
+ }, []), k = b((g) => {
2029
+ var B;
2030
+ if (!y.current) return;
2031
+ const w = y.current;
2032
+ (B = w.executeCommand) == null || B.call(w, ["applyStyle", g]), s(w.value || ""), w.focus();
2033
+ }, []), f = b(() => {
2034
+ r.trim() && t(r), l();
2035
+ }, [r, t, l]), P = b((g) => {
2036
+ g.key === "Escape" && l(), g.key === "Enter" && (g.ctrlKey || g.metaKey) && f();
2037
+ }, [l, f]);
2038
+ if (X(() => {
2039
+ n || (s(""), N(c));
2040
+ }, [n, c]), !n) return null;
2041
+ const p = Fe.find((g) => g.id === o) || Fe[0];
2042
+ return /* @__PURE__ */ e("div", { className: "mt-overlay", onClick: l, onKeyDown: P, children: /* @__PURE__ */ a("div", { className: "mt-dialog", onClick: (g) => g.stopPropagation(), children: [
2043
+ /* @__PURE__ */ a("div", { className: "mt-titlebar", children: [
2044
+ /* @__PURE__ */ a("div", { className: "mt-titlebar__left", children: [
2045
+ /* @__PURE__ */ e("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "currentColor", style: { opacity: 0.9 }, children: /* @__PURE__ */ e("path", { d: "M2 2l3 6-3 6h2.5l2-4 2 4H11l-3-6 3-6H8.5l-2 4-2-4H2zm9 0v2h4V2h-4zm0 5v2h4V7h-4zm0 5v2h4v-2h-4z" }) }),
2046
+ /* @__PURE__ */ e("span", { className: "mt-titlebar__title", children: "MathTextX — Equation Editor" })
2047
+ ] }),
2048
+ /* @__PURE__ */ e("button", { className: "mt-titlebar__close", onClick: l, title: "Tutup (Esc)", children: /* @__PURE__ */ e("svg", { width: "10", height: "10", viewBox: "0 0 10 10", fill: "currentColor", children: /* @__PURE__ */ e("path", { d: "M1 0L0 1l4 4-4 4 1 1 4-4 4 4 1-1-4-4 4-4-1-1-4 4z" }) }) })
2049
+ ] }),
2050
+ /* @__PURE__ */ a("div", { className: "mt-format-bar", children: [
2051
+ /* @__PURE__ */ a(
2052
+ "select",
2053
+ {
2054
+ className: "mt-font-select",
2055
+ onChange: (g) => {
2056
+ g.target.value && m(g.target.value), g.target.value = "";
2057
+ },
2058
+ defaultValue: "",
2059
+ children: [
2060
+ /* @__PURE__ */ e("option", { value: "", disabled: !0, children: "Pilih Font..." }),
2061
+ /* @__PURE__ */ e("option", { value: "serif", children: "Roman (Serif)" }),
2062
+ /* @__PURE__ */ e("option", { value: "sans", children: "Sans Serif (Arial)" }),
2063
+ /* @__PURE__ */ e("option", { value: "mono", children: "Monospace (Courier)" }),
2064
+ /* @__PURE__ */ e("option", { value: "arabic", children: "Arabic (Amiri)" }),
2065
+ /* @__PURE__ */ e("option", { value: "cjk", children: "Chinese (SimSun)" }),
2066
+ /* @__PURE__ */ e("option", { value: "korean", children: "Korean (Malgun)" })
2067
+ ]
2068
+ }
2069
+ ),
2070
+ /* @__PURE__ */ e("div", { style: { fontSize: "11px", color: "#666", borderLeft: "1px solid #ccc", paddingLeft: "8px", marginRight: "8px" }, children: "Font" }),
2071
+ /* @__PURE__ */ a("div", { className: "mt-format-group", children: [
2072
+ /* @__PURE__ */ e("button", { className: "mt-format-btn", onClick: () => k({ fontWeight: "bold" }), title: "Bold", children: /* @__PURE__ */ e("b", { children: "B" }) }),
2073
+ /* @__PURE__ */ e("button", { className: "mt-format-btn", onClick: () => k({ fontStyle: "italic" }), title: "Italic", children: /* @__PURE__ */ e("i", { children: "I" }) }),
2074
+ /* @__PURE__ */ e("button", { className: "mt-format-btn", onClick: () => {
2075
+ var w;
2076
+ const g = y.current;
2077
+ (w = g == null ? void 0 : g.executeCommand) == null || w.call(g, ["insert", "\\underline{#@}", { focus: !0 }]);
2078
+ }, title: "Underline", children: /* @__PURE__ */ e("u", { children: "U" }) })
2079
+ ] }),
2080
+ /* @__PURE__ */ e("div", { className: "mt-format-group", children: /* @__PURE__ */ e(
2081
+ "input",
2082
+ {
2083
+ type: "color",
2084
+ className: "mt-color-picker",
2085
+ onChange: (g) => k({ color: g.target.value }),
2086
+ title: "Text Color"
2087
+ }
2088
+ ) })
2089
+ ] }),
2090
+ /* @__PURE__ */ e("div", { className: "mt-tab-bar", children: Fe.map((g) => /* @__PURE__ */ e(
2091
+ "button",
2092
+ {
2093
+ className: `mt-tab ${o === g.id ? "is-active" : ""}`,
2094
+ onClick: () => N(g.id),
2095
+ title: g.tip,
2096
+ children: /* @__PURE__ */ e("span", { className: "mt-tab__icon", children: g.icon })
2097
+ },
2098
+ g.id
2099
+ )) }),
2100
+ o === "matrix" && /* @__PURE__ */ e(ma, { onInsert: (g) => {
2101
+ var B;
2102
+ if (!y.current) return;
2103
+ const w = y.current;
2104
+ (B = w.executeCommand) == null || B.call(w, ["insert", g, { focus: !0 }]), s(w.value || ""), w.focus();
2105
+ } }),
2106
+ /* @__PURE__ */ e("div", { className: "mt-grid", children: p.rows.map((g, w) => /* @__PURE__ */ e("div", { className: "mt-grid__row", children: g.map((B, _) => /* @__PURE__ */ e(
2107
+ "button",
2108
+ {
2109
+ className: `mt-grid__btn${B.command === "formula" ? " mt-grid__btn--formula" : ""}`,
2110
+ onClick: () => h(B),
2111
+ title: B.tip,
2112
+ children: B.icon
2113
+ },
2114
+ _
2115
+ )) }, w)) }),
2116
+ /* @__PURE__ */ e("div", { className: "mt-editor", children: /* @__PURE__ */ e("div", { className: "mt-editor__field", ref: u }) }),
2117
+ /* @__PURE__ */ a("div", { className: "mt-latex-bar", children: [
2118
+ /* @__PURE__ */ e("span", { className: "mt-latex-bar__label", children: "LaTeX:" }),
2119
+ /* @__PURE__ */ e("code", { className: "mt-latex-bar__code", children: r || "(ketik atau klik tombol di atas)" })
2120
+ ] }),
2121
+ /* @__PURE__ */ a("div", { className: "mt-actions", children: [
2122
+ /* @__PURE__ */ a("div", { className: "mt-actions__hint", children: [
2123
+ /* @__PURE__ */ e("kbd", { children: "Ctrl+Enter" }),
2124
+ " sisipkan  ·  ",
2125
+ /* @__PURE__ */ e("kbd", { children: "Esc" }),
2126
+ " tutup"
2127
+ ] }),
2128
+ /* @__PURE__ */ a("div", { className: "mt-actions__buttons", children: [
2129
+ /* @__PURE__ */ e("button", { className: "mt-actions__cancel", onClick: l, children: "Batal" }),
2130
+ /* @__PURE__ */ e("button", { className: "mt-actions__insert", onClick: f, disabled: !r.trim(), children: "✓ Sisipkan" })
2131
+ ] })
2132
+ ] })
2133
+ ] }) });
2134
+ }
2135
+ const da = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2136
+ __proto__: null,
2137
+ MathTypeDialog: pt
2138
+ }, Symbol.toStringTag, { value: "Module" }));
2139
+ let We = null, at = !1;
2140
+ function gt() {
2141
+ return We || (We = import("./mathlive-BwNIIOwE.js").then((n) => {
2142
+ const t = window.MATHLIVE_FONTS_PATH || "/fonts";
2143
+ return n.MathfieldElement && (n.MathfieldElement.fontsDirectory = t), n;
2144
+ })), We;
2145
+ }
2146
+ async function ha() {
2147
+ if (!at)
2148
+ try {
2149
+ const n = await gt(), t = window.MATHLIVE_FONTS_PATH || "/fonts";
2150
+ n.loadFonts && (await n.loadFonts({ fontsDirectory: t }), at = !0);
2151
+ } catch (n) {
2152
+ console.warn("MathLive fonts could not be loaded:", n);
2153
+ }
2154
+ }
2155
+ function nt() {
2156
+ return window.mathVirtualKeyboard;
2157
+ }
2158
+ function xt(n) {
2159
+ const t = R(null), l = R(null), [i, c] = H(!1), [r, s] = H(!1), o = n.node.attrs.display === "block", N = b(() => {
2160
+ c(!0);
2161
+ }, []), y = b(() => {
2162
+ c(!1), s(!1);
2163
+ }, []), u = b((h) => {
2164
+ n.updateAttributes({ latex: h }), c(!1), s(!1);
2165
+ }, [n]);
2166
+ return X(() => {
2167
+ async function h() {
2168
+ await ha();
2169
+ const k = await gt();
2170
+ if (!t.current) return;
2171
+ k.MathfieldElement && (k.MathfieldElement.keypressVibration = !1, k.MathfieldElement.mathVirtualKeyboardPolicy = "manual");
2172
+ try {
2173
+ const P = nt();
2174
+ P && (P.visible = !1);
2175
+ } catch {
2176
+ }
2177
+ const f = document.createElement("math-field");
2178
+ f.setAttribute("virtual-keyboard-mode", "off"), f.setAttribute("math-virtual-keyboard-policy", "manual"), f.mathVirtualKeyboardPolicy = "manual", f.setAttribute("smart-mode", "true"), f.setAttribute("smart-fence", "true"), f.setAttribute("smart-superscript", "true"), f.style.setProperty("--keyboard-zindex", "-1"), f.style.setProperty("--virtual-keyboard-toggle-display", "none"), n.node.attrs.latex && f.setAttribute("value", n.node.attrs.latex), f.addEventListener("input", (P) => {
2179
+ const p = P.target;
2180
+ n.updateAttributes({ latex: p.value });
2181
+ }), f.addEventListener("focus", () => {
2182
+ var P, p;
2183
+ s(!0);
2184
+ try {
2185
+ (p = (P = nt()) == null ? void 0 : P.hide) == null || p.call(P);
2186
+ } catch {
2187
+ }
2188
+ }), f.addEventListener("blur", () => {
2189
+ setTimeout(() => s(!1), 200);
2190
+ }), t.current && (t.current.innerHTML = "", t.current.appendChild(f)), l.current = f, n.node.attrs.latex || setTimeout(() => {
2191
+ f.focus();
2192
+ }, 50);
2193
+ }
2194
+ h().catch(console.error);
2195
+ const m = t.current;
2196
+ return () => {
2197
+ m && (m.innerHTML = "");
2198
+ };
2199
+ }, []), /* @__PURE__ */ a(Z, { children: [
2200
+ /* @__PURE__ */ a(
2201
+ je,
2202
+ {
2203
+ className: o ? "mtx-math-block" : "mtx-math-inline",
2204
+ "data-latex": n.node.attrs.latex,
2205
+ style: n.selected ? { outline: "2px solid #2563eb", outlineOffset: "2px" } : void 0,
2206
+ children: [
2207
+ /* @__PURE__ */ e("div", { ref: t, style: { position: "relative", display: o ? "block" : "inline-block" } }),
2208
+ r && /* @__PURE__ */ a(
2209
+ "button",
2210
+ {
2211
+ type: "button",
2212
+ onClick: N,
2213
+ className: "mtx-math-edit-btn",
2214
+ title: "Edit rumus dengan Equation Editor",
2215
+ children: [
2216
+ /* @__PURE__ */ e("span", { children: "✏️" }),
2217
+ /* @__PURE__ */ e("span", { children: "Edit" })
2218
+ ]
2219
+ }
2220
+ )
2221
+ ]
2222
+ }
2223
+ ),
2224
+ i && /* @__PURE__ */ e(
2225
+ pt,
2226
+ {
2227
+ isOpen: i,
2228
+ initialLatex: n.node.attrs.latex,
2229
+ onInsert: u,
2230
+ onClose: y
2231
+ }
2232
+ )
2233
+ ] });
2234
+ }
2235
+ const ua = Ue.create({
2236
+ name: "mathInline",
2237
+ group: "inline",
2238
+ inline: !0,
2239
+ atom: !0,
2240
+ addAttributes() {
2241
+ return {
2242
+ latex: {
2243
+ default: ""
2244
+ },
2245
+ display: {
2246
+ default: "inline"
2247
+ }
2248
+ };
2249
+ },
2250
+ parseHTML() {
2251
+ return [
2252
+ {
2253
+ tag: 'span[data-type="math-inline"]'
2254
+ },
2255
+ {
2256
+ tag: "span.mtx-math-inline"
2257
+ }
2258
+ ];
2259
+ },
2260
+ renderHTML({ HTMLAttributes: n }) {
2261
+ return ["span", Te(n, { "data-type": "math-inline", class: "mtx-math-inline" })];
2262
+ },
2263
+ addNodeView() {
2264
+ return Ie(xt);
2265
+ }
2266
+ }), pa = Ue.create({
2267
+ name: "mathBlock",
2268
+ group: "block",
2269
+ atom: !0,
2270
+ addAttributes() {
2271
+ return {
2272
+ latex: {
2273
+ default: ""
2274
+ },
2275
+ display: {
2276
+ default: "block"
2277
+ }
2278
+ };
2279
+ },
2280
+ parseHTML() {
2281
+ return [
2282
+ {
2283
+ tag: 'div[data-type="math-block"]'
2284
+ },
2285
+ {
2286
+ tag: "div.mtx-math-block"
2287
+ }
2288
+ ];
2289
+ },
2290
+ renderHTML({ HTMLAttributes: n }) {
2291
+ return ["div", Te(n, { "data-type": "math-block", class: "mtx-math-block" })];
2292
+ },
2293
+ addNodeView() {
2294
+ return Ie(xt);
2295
+ }
2296
+ }), bt = oe.memo(({
2297
+ isOpen: n,
2298
+ position: t,
2299
+ onClose: l,
2300
+ onAddRowBefore: i,
2301
+ onAddRowAfter: c,
2302
+ onDeleteRow: r,
2303
+ onAddColumnBefore: s,
2304
+ onAddColumnAfter: o,
2305
+ onDeleteColumn: N,
2306
+ onDeleteTable: y,
2307
+ onMergeCells: u,
2308
+ onSplitCell: h,
2309
+ onCellProperties: m,
2310
+ onTableProperties: k
2311
+ }) => {
2312
+ const f = b((p) => {
2313
+ p && p(), l();
2314
+ }, [l]), P = Ce(() => {
2315
+ if (!t)
2316
+ return { x: 0, y: 0 };
2317
+ const p = typeof window < "u" ? window.innerWidth : 1280, g = typeof window < "u" ? window.innerHeight : 720;
2318
+ return {
2319
+ x: Math.min(t.x, p - 260),
2320
+ y: Math.min(t.y, g - 360)
2321
+ };
2322
+ }, [t]);
2323
+ return !n || !t ? null : /* @__PURE__ */ a(Z, { children: [
2324
+ /* @__PURE__ */ e("button", { type: "button", className: "mtx-table-menu-overlay", onClick: l, "aria-label": "Close table menu" }),
2325
+ /* @__PURE__ */ e(
2326
+ "div",
2327
+ {
2328
+ className: "mtx-table-menu-dropdown",
2329
+ style: { left: P.x, top: P.y },
2330
+ children: /* @__PURE__ */ a("div", { className: "mtx-table-menu", onClick: (p) => p.stopPropagation(), children: [
2331
+ /* @__PURE__ */ a("div", { className: "mtx-table-menu-group", children: [
2332
+ /* @__PURE__ */ e("div", { className: "mtx-table-menu-label", children: "Rows" }),
2333
+ /* @__PURE__ */ a(
2334
+ "button",
2335
+ {
2336
+ className: "mtx-table-menu-item",
2337
+ onClick: () => f(i),
2338
+ children: [
2339
+ /* @__PURE__ */ e("span", { className: "mtx-table-menu-icon", children: "⬆" }),
2340
+ /* @__PURE__ */ e("span", { children: "Insert Row Above" })
2341
+ ]
2342
+ }
2343
+ ),
2344
+ /* @__PURE__ */ a(
2345
+ "button",
2346
+ {
2347
+ className: "mtx-table-menu-item",
2348
+ onClick: () => f(c),
2349
+ children: [
2350
+ /* @__PURE__ */ e("span", { className: "mtx-table-menu-icon", children: "⬇" }),
2351
+ /* @__PURE__ */ e("span", { children: "Insert Row Below" })
2352
+ ]
2353
+ }
2354
+ ),
2355
+ /* @__PURE__ */ a(
2356
+ "button",
2357
+ {
2358
+ className: "mtx-table-menu-item mtx-table-menu-item--danger",
2359
+ onClick: () => f(r),
2360
+ children: [
2361
+ /* @__PURE__ */ e("span", { className: "mtx-table-menu-icon", children: "🗑" }),
2362
+ /* @__PURE__ */ e("span", { children: "Delete Row" })
2363
+ ]
2364
+ }
2365
+ )
2366
+ ] }),
2367
+ /* @__PURE__ */ a("div", { className: "mtx-table-menu-group", children: [
2368
+ /* @__PURE__ */ e("div", { className: "mtx-table-menu-label", children: "Columns" }),
2369
+ /* @__PURE__ */ a(
2370
+ "button",
2371
+ {
2372
+ className: "mtx-table-menu-item",
2373
+ onClick: () => f(s),
2374
+ children: [
2375
+ /* @__PURE__ */ e("span", { className: "mtx-table-menu-icon", children: "⬅" }),
2376
+ /* @__PURE__ */ e("span", { children: "Insert Column Left" })
2377
+ ]
2378
+ }
2379
+ ),
2380
+ /* @__PURE__ */ a(
2381
+ "button",
2382
+ {
2383
+ className: "mtx-table-menu-item",
2384
+ onClick: () => f(o),
2385
+ children: [
2386
+ /* @__PURE__ */ e("span", { className: "mtx-table-menu-icon", children: "➡" }),
2387
+ /* @__PURE__ */ e("span", { children: "Insert Column Right" })
2388
+ ]
2389
+ }
2390
+ ),
2391
+ /* @__PURE__ */ a(
2392
+ "button",
2393
+ {
2394
+ className: "mtx-table-menu-item mtx-table-menu-item--danger",
2395
+ onClick: () => f(N),
2396
+ children: [
2397
+ /* @__PURE__ */ e("span", { className: "mtx-table-menu-icon", children: "🗑" }),
2398
+ /* @__PURE__ */ e("span", { children: "Delete Column" })
2399
+ ]
2400
+ }
2401
+ )
2402
+ ] }),
2403
+ (u || h) && /* @__PURE__ */ a("div", { className: "mtx-table-menu-group", children: [
2404
+ /* @__PURE__ */ e("div", { className: "mtx-table-menu-label", children: "Cells" }),
2405
+ u && /* @__PURE__ */ a(
2406
+ "button",
2407
+ {
2408
+ className: "mtx-table-menu-item",
2409
+ onClick: () => f(u),
2410
+ children: [
2411
+ /* @__PURE__ */ e("span", { className: "mtx-table-menu-icon", children: "⊞" }),
2412
+ /* @__PURE__ */ e("span", { children: "Merge Cells" })
2413
+ ]
2414
+ }
2415
+ ),
2416
+ h && /* @__PURE__ */ a(
2417
+ "button",
2418
+ {
2419
+ className: "mtx-table-menu-item",
2420
+ onClick: () => f(h),
2421
+ children: [
2422
+ /* @__PURE__ */ e("span", { className: "mtx-table-menu-icon", children: "⊟" }),
2423
+ /* @__PURE__ */ e("span", { children: "Split Cell" })
2424
+ ]
2425
+ }
2426
+ )
2427
+ ] }),
2428
+ (m || k) && /* @__PURE__ */ a("div", { className: "mtx-table-menu-group", children: [
2429
+ /* @__PURE__ */ e("div", { className: "mtx-table-menu-label", children: "Properties" }),
2430
+ m && /* @__PURE__ */ a(
2431
+ "button",
2432
+ {
2433
+ className: "mtx-table-menu-item",
2434
+ onClick: () => f(m),
2435
+ children: [
2436
+ /* @__PURE__ */ e("span", { className: "mtx-table-menu-icon", children: "⚙" }),
2437
+ /* @__PURE__ */ e("span", { children: "Cell Properties" })
2438
+ ]
2439
+ }
2440
+ ),
2441
+ k && /* @__PURE__ */ a(
2442
+ "button",
2443
+ {
2444
+ className: "mtx-table-menu-item",
2445
+ onClick: () => f(k),
2446
+ children: [
2447
+ /* @__PURE__ */ e("span", { className: "mtx-table-menu-icon", children: "⚙" }),
2448
+ /* @__PURE__ */ e("span", { children: "Table Properties" })
2449
+ ]
2450
+ }
2451
+ )
2452
+ ] }),
2453
+ /* @__PURE__ */ a("div", { className: "mtx-table-menu-group", children: [
2454
+ /* @__PURE__ */ e("div", { className: "mtx-table-menu-label", children: "Danger Zone" }),
2455
+ /* @__PURE__ */ a(
2456
+ "button",
2457
+ {
2458
+ className: "mtx-table-menu-item mtx-table-menu-item--danger",
2459
+ onClick: () => f(y),
2460
+ children: [
2461
+ /* @__PURE__ */ e("span", { className: "mtx-table-menu-icon", children: "🗑" }),
2462
+ /* @__PURE__ */ e("span", { children: "Delete Table" })
2463
+ ]
2464
+ }
2465
+ )
2466
+ ] })
2467
+ ] })
2468
+ }
2469
+ )
2470
+ ] });
2471
+ });
2472
+ bt.displayName = "TableMenu";
2473
+ const ga = oe.memo(function({
2474
+ isOpen: t,
2475
+ position: l,
2476
+ currentAlign: i,
2477
+ hasCustomPosition: c = !1,
2478
+ onClose: r,
2479
+ onSetAlign: s,
2480
+ onResetPosition: o,
2481
+ onCenterImage: N,
2482
+ onEditImage: y
2483
+ }) {
2484
+ const u = b((m) => {
2485
+ m == null || m(), r();
2486
+ }, [r]), h = Ce(() => {
2487
+ if (!l)
2488
+ return { x: 0, y: 0 };
2489
+ const m = typeof window < "u" ? window.innerWidth : 1280, k = typeof window < "u" ? window.innerHeight : 720;
2490
+ return {
2491
+ x: Math.min(l.x, m - 240),
2492
+ y: Math.min(l.y, k - 280)
2493
+ };
2494
+ }, [l]);
2495
+ return !t || !l ? null : /* @__PURE__ */ a(Z, { children: [
2496
+ /* @__PURE__ */ e("button", { type: "button", className: "mtx-table-menu-overlay", onClick: r, "aria-label": "Close image menu" }),
2497
+ /* @__PURE__ */ e("div", { className: "mtx-table-menu-dropdown", style: { left: h.x, top: h.y }, children: /* @__PURE__ */ a("div", { className: "mtx-table-menu", onClick: (m) => m.stopPropagation(), children: [
2498
+ /* @__PURE__ */ a("div", { className: "mtx-table-menu-group", children: [
2499
+ /* @__PURE__ */ e("div", { className: "mtx-table-menu-label", children: "Text Wrapping" }),
2500
+ /* @__PURE__ */ a("button", { className: `mtx-table-menu-item ${i === "left" ? "is-active" : ""}`, onClick: () => u(() => s("left")), children: [
2501
+ /* @__PURE__ */ e("span", { className: "mtx-table-menu-icon", children: "◧" }),
2502
+ /* @__PURE__ */ e("span", { children: "Wrap Left" })
2503
+ ] }),
2504
+ /* @__PURE__ */ a("button", { className: `mtx-table-menu-item ${i === "center" ? "is-active" : ""}`, onClick: () => u(() => s("center")), children: [
2505
+ /* @__PURE__ */ e("span", { className: "mtx-table-menu-icon", children: "▣" }),
2506
+ /* @__PURE__ */ e("span", { children: "Wrap Center" })
2507
+ ] }),
2508
+ /* @__PURE__ */ a("button", { className: `mtx-table-menu-item ${i === "right" ? "is-active" : ""}`, onClick: () => u(() => s("right")), children: [
2509
+ /* @__PURE__ */ e("span", { className: "mtx-table-menu-icon", children: "◨" }),
2510
+ /* @__PURE__ */ e("span", { children: "Wrap Right" })
2511
+ ] }),
2512
+ /* @__PURE__ */ a("button", { className: `mtx-table-menu-item ${i === "full" ? "is-active" : ""}`, onClick: () => u(() => s("full")), children: [
2513
+ /* @__PURE__ */ e("span", { className: "mtx-table-menu-icon", children: "▤" }),
2514
+ /* @__PURE__ */ e("span", { children: "Full Width" })
2515
+ ] })
2516
+ ] }),
2517
+ y && /* @__PURE__ */ a("div", { className: "mtx-table-menu-group", children: [
2518
+ /* @__PURE__ */ e("div", { className: "mtx-table-menu-label", children: "Image" }),
2519
+ o && /* @__PURE__ */ a("button", { className: "mtx-table-menu-item", onClick: () => u(o), disabled: !c, children: [
2520
+ /* @__PURE__ */ e("span", { className: "mtx-table-menu-icon", children: "↺" }),
2521
+ /* @__PURE__ */ e("span", { children: "Reset Position" })
2522
+ ] }),
2523
+ N && /* @__PURE__ */ a("button", { className: "mtx-table-menu-item", onClick: () => u(N), children: [
2524
+ /* @__PURE__ */ e("span", { className: "mtx-table-menu-icon", children: "◎" }),
2525
+ /* @__PURE__ */ e("span", { children: "Center & Reset" })
2526
+ ] }),
2527
+ /* @__PURE__ */ a("button", { className: "mtx-table-menu-item", onClick: () => u(y), children: [
2528
+ /* @__PURE__ */ e("span", { className: "mtx-table-menu-icon", children: "✎" }),
2529
+ /* @__PURE__ */ e("span", { children: "Edit Image" })
2530
+ ] })
2531
+ ] })
2532
+ ] }) })
2533
+ ] });
2534
+ }), xa = le(() => import("./LinkDialogImpl-BSz0F-xG.js").then((n) => ({ default: n.LinkDialogImpl }))), ba = le(() => import("./InsertTableDialogImpl-CKirXRqE.js").then((n) => ({ default: n.InsertTableDialogImpl }))), fa = le(() => import("./CellPropertiesDialogImpl-CgWcr4bD.js").then((n) => ({ default: n.CellPropertiesDialogImpl }))), Na = le(() => import("./TableTemplatesDialogImpl-DrdqLQLH.js").then((n) => ({ default: n.TableTemplatesDialogImpl }))), ya = le(() => import("./ImageInsertDialog-Di0MXcC2.js").then((n) => ({ default: n.ImageInsertDialog }))), A = oe.memo(function({ icon: t, label: l, onClick: i, isActive: c, isDisabled: r, className: s }) {
2535
+ return /* @__PURE__ */ e(
2536
+ "button",
2537
+ {
2538
+ type: "button",
2539
+ className: `mtx-toolbar-btn ${c ? "is-active" : ""} ${s || ""}`,
2540
+ onClick: i,
2541
+ disabled: r,
2542
+ title: l,
2543
+ "aria-label": l,
2544
+ children: t
2545
+ }
2546
+ );
2547
+ });
2548
+ function ce() {
2549
+ return /* @__PURE__ */ e("div", { className: "mtx-toolbar-divider" });
2550
+ }
2551
+ function va(n) {
2552
+ var l;
2553
+ if (!n) return null;
2554
+ const t = n.state.selection.node;
2555
+ return ((l = t == null ? void 0 : t.type) == null ? void 0 : l.name) === "image" ? t.attrs || {} : n.state.selection.$from.parent.type.name === "image" ? n.state.selection.$from.parent.attrs : null;
2556
+ }
2557
+ const ka = oe.memo(({ value: n, onChange: t, options: l, label: i, className: c }) => /* @__PURE__ */ e(
2558
+ "select",
2559
+ {
2560
+ className: `mtx-toolbar-select ${c || ""}`,
2561
+ value: n,
2562
+ onChange: (r) => t(r.target.value),
2563
+ title: i,
2564
+ "aria-label": i,
2565
+ children: l.map((r) => /* @__PURE__ */ e("option", { value: r.value, children: r.label }, r.value))
2566
+ }
2567
+ )), lt = oe.memo(({ color: n, onChange: t, label: l, icon: i }) => {
2568
+ const c = R(null);
2569
+ return /* @__PURE__ */ a(Z, { children: [
2570
+ /* @__PURE__ */ e(
2571
+ "button",
2572
+ {
2573
+ type: "button",
2574
+ className: "mtx-toolbar-btn mtx-color-btn",
2575
+ onClick: () => {
2576
+ var r;
2577
+ return (r = c.current) == null ? void 0 : r.click();
2578
+ },
2579
+ title: l,
2580
+ "aria-label": l,
2581
+ children: i
2582
+ }
2583
+ ),
2584
+ /* @__PURE__ */ e(
2585
+ "input",
2586
+ {
2587
+ ref: c,
2588
+ type: "color",
2589
+ value: n,
2590
+ onChange: (r) => t(r.target.value),
2591
+ className: "mtx-color-picker",
2592
+ style: { display: "none" }
2593
+ }
2594
+ )
2595
+ ] });
2596
+ }), M = {
2597
+ bold: /* @__PURE__ */ e("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "currentColor", children: /* @__PURE__ */ e("path", { d: "M4 2h5a3 3 0 0 1 2.1 5.15A3.5 3.5 0 0 1 9.5 14H4V2zm2 5h3a1 1 0 1 0 0-2H6v2zm0 2v3h3.5a1.5 1.5 0 0 0 0-3H6z" }) }),
2598
+ italic: /* @__PURE__ */ e("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "currentColor", children: /* @__PURE__ */ e("path", { d: "M6 2h6v2h-2.2l-2.6 8H9v2H3v-2h2.2l2.6-8H6V2z" }) }),
2599
+ underline: /* @__PURE__ */ e("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "currentColor", children: /* @__PURE__ */ e("path", { d: "M3 13h10v1.5H3V13zM4 2v6a4 4 0 0 0 8 0V2h-2v6a2 2 0 0 1-4 0V2H4z" }) }),
2600
+ strike: /* @__PURE__ */ e("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "currentColor", children: /* @__PURE__ */ e("path", { d: "M2 7h12v1.5H2V7zm3.5-4.5h5c1.1 0 2 .9 2 2s-.9 2-2 2h-2V5h2a.5.5 0 0 0 0-1h-5a.5.5 0 0 0 0 1h1v1.5h-1c-1.1 0-2-.9-2-2s.9-2 2-2zm2 7V11h-1a.5.5.0 0 0 0 1h5a.5.5 0 0 0 0-1h-2V9.5h-2z" }) }),
2601
+ h1: /* @__PURE__ */ e("svg", { width: "20", height: "16", viewBox: "0 0 20 16", fill: "currentColor", children: /* @__PURE__ */ e("path", { d: "M2 3v10h2V9h4v4h2V3H8v4H4V3H2zm12 0v10h2V5.5l2 1V4.3l-3-1.8h-1z" }) }),
2602
+ h2: /* @__PURE__ */ e("svg", { width: "20", height: "16", viewBox: "0 0 20 16", fill: "currentColor", children: /* @__PURE__ */ e("path", { d: "M2 3v10h2V9h4v4h2V3H8v4H4V3H2zm10 10v-2c0-1.5 1.2-2.5 2.4-3.3L15.8 7C16.6 6.4 17 5.8 17 5c0-.8-.5-1.5-1.5-1.5S14 4.2 14 5h-2c0-1.9 1.3-3.5 3.5-3.5S19 3.1 19 5c0 1.3-.7 2.2-1.8 3l-1.5 1H19v2h-7z" }) }),
2603
+ h3: /* @__PURE__ */ e("svg", { width: "20", height: "16", viewBox: "0 0 20 16", fill: "currentColor", children: /* @__PURE__ */ e("path", { d: "M2 3v10h2V9h4v4h2V3H8v4H4V3H2zm10 3.5h2c.8 0 1.5-.3 1.5-1s-.7-1-1.5-1-1.5.3-1.5 1h-2c0-1.7 1.3-3 3.5-3s3.5 1.1 3.5 2.5c0 .9-.5 1.5-1.2 1.8.9.4 1.5 1.2 1.5 2.2 0 1.6-1.4 3-3.8 3S12 10.4 12 8.5h2c0 .8.7 1.5 1.5 1.5s1.5-.5 1.5-1.3-.6-1.2-1.5-1.2H14V6.5z" }) }),
2604
+ paragraph: /* @__PURE__ */ a("svg", { width: "18", height: "16", viewBox: "0 0 18 16", fill: "currentColor", children: [
2605
+ /* @__PURE__ */ e("path", { d: "M3 2h7a4 4 0 0 1 0 8H8v4H6V4H3V2zm5 2v4h2a2 2 0 1 0 0-4H8z" }),
2606
+ /* @__PURE__ */ e("path", { d: "M12 2h2v12h-2z" })
2607
+ ] }),
2608
+ bulletList: /* @__PURE__ */ a("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "currentColor", children: [
2609
+ /* @__PURE__ */ e("circle", { cx: "2.5", cy: "4", r: "1.5" }),
2610
+ /* @__PURE__ */ e("rect", { x: "6", y: "3", width: "9", height: "2", rx: "0.5" }),
2611
+ /* @__PURE__ */ e("circle", { cx: "2.5", cy: "8", r: "1.5" }),
2612
+ /* @__PURE__ */ e("rect", { x: "6", y: "7", width: "9", height: "2", rx: "0.5" }),
2613
+ /* @__PURE__ */ e("circle", { cx: "2.5", cy: "12", r: "1.5" }),
2614
+ /* @__PURE__ */ e("rect", { x: "6", y: "11", width: "9", height: "2", rx: "0.5" })
2615
+ ] }),
2616
+ orderedList: /* @__PURE__ */ a("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "currentColor", children: [
2617
+ /* @__PURE__ */ e("text", { x: "1", y: "5", fontSize: "5.5", fontWeight: "600", fontFamily: "sans-serif", children: "1." }),
2618
+ /* @__PURE__ */ e("text", { x: "1", y: "9", fontSize: "5.5", fontWeight: "600", fontFamily: "sans-serif", children: "2." }),
2619
+ /* @__PURE__ */ e("text", { x: "1", y: "13", fontSize: "5.5", fontWeight: "600", fontFamily: "sans-serif", children: "3." }),
2620
+ /* @__PURE__ */ e("rect", { x: "6", y: "3", width: "9", height: "2", rx: "0.5" }),
2621
+ /* @__PURE__ */ e("rect", { x: "6", y: "7", width: "9", height: "2", rx: "0.5" }),
2622
+ /* @__PURE__ */ e("rect", { x: "6", y: "11", width: "9", height: "2", rx: "0.5" })
2623
+ ] }),
2624
+ taskList: /* @__PURE__ */ a("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "currentColor", children: [
2625
+ /* @__PURE__ */ e("rect", { x: "1.5", y: "2.5", width: "3", height: "3", rx: "0.5", stroke: "currentColor", fill: "none", strokeWidth: "1.2" }),
2626
+ /* @__PURE__ */ e("path", { d: "M2.2 4l.7.7 1.3-1.5", stroke: "currentColor", fill: "none", strokeWidth: "1.2", strokeLinecap: "round", strokeLinejoin: "round" }),
2627
+ /* @__PURE__ */ e("rect", { x: "6", y: "3", width: "9", height: "1.5", rx: "0.5" }),
2628
+ /* @__PURE__ */ e("rect", { x: "1.5", y: "10.5", width: "3", height: "3", rx: "0.5", stroke: "currentColor", fill: "none", strokeWidth: "1.2" }),
2629
+ /* @__PURE__ */ e("rect", { x: "6", y: "11", width: "9", height: "1.5", rx: "0.5" })
2630
+ ] }),
2631
+ superscript: /* @__PURE__ */ e("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "currentColor", children: /* @__PURE__ */ e("path", { d: "M1 13l4-5.5L1.5 3H4l2.3 3.2L8.5 3H11L7.5 6.5 12 13H9.2L6.5 9.2 3.8 13H1zm10-9V2.5c0-.6.5-1 1.2-1.2l.8-.3c.3-.1.5-.3.5-.5 0-.3-.3-.5-.7-.5-.5 0-.8.3-.8.7h-1.2c0-1 .8-1.7 2-1.7s2 .7 2 1.6c0 .6-.4 1-1 1.3l-.7.3c-.3.1-.5.2-.6.4H15V4h-4z" }) }),
2632
+ subscript: /* @__PURE__ */ e("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "currentColor", children: /* @__PURE__ */ e("path", { d: "M1 12l4-5.5L1.5 2H4l2.3 3.2L8.5 2H11L7.5 6.5 12 12H9.2L6.5 8.2 3.8 12H1zm10 3v-1.5c0-.6.5-1 1.2-1.2l.8-.3c.3-.1.5-.3.5-.5 0-.3-.3-.5-.7-.5-.5 0-.8.3-.8.7h-1.2c0-1 .8-1.7 2-1.7s2 .7 2 1.6c0 .6-.4 1-1 1.3l-.7.3c-.3.1-.5.2-.6.4H15V15h-4z" }) }),
2633
+ link: /* @__PURE__ */ e("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "currentColor", children: /* @__PURE__ */ e("path", { d: "M6.9 11.1l-1.4 1.4a2 2 0 0 1-2.8-2.8l2.8-2.8a2 2 0 0 1 2.8 0l.7-.7a3 3 0 0 0-4.2 0L2.2 9a3 3 0 0 0 4.2 4.2l1.4-1.4-.7-.7zm2.2-6.2l1.4-1.4a2 2 0 0 1 2.8 2.8l-2.8 2.8a2 2 0 0 1-2.8 0l-.7.7a3 3 0 0 0 4.2 0l2.8-2.8a3 3 0 0 0-4.2-4.2L8.4 4.2l.7.7z" }) }),
2634
+ image: /* @__PURE__ */ e("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "currentColor", children: /* @__PURE__ */ e("path", { d: "M2 3a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v10a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V3zm1.5 8.5l2.5-3 2 2.5 3-4 3 4.5H3.5zm2-5a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3z" }) }),
2635
+ editImage: /* @__PURE__ */ e("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "currentColor", children: /* @__PURE__ */ e("path", { d: "M12.854 1.646a.5.5 0 0 1 .708 0l1.79 1.79a.5.5 0 0 1 0 .708l-8.5 8.5a.5.5 0 0 1-.224.128l-4 1a.5.5 0 0 1-.604-.604l1-4a.5.5 0 0 1 .128-.224l8.5-8.5zM13.5 2.707L5.707 10.5 5 13.293l2.793-.707 7.793-7.793-2.086-2.086zM3 14a1 1 0 1 1 2 0 1 1 0 0 1-2 0z" }) }),
2636
+ table: /* @__PURE__ */ e("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "currentColor", children: /* @__PURE__ */ e("path", { d: "M1 2.5A1.5 1.5 0 0 1 2.5 1h11A1.5 1.5 0 0 1 15 2.5v11a1.5 1.5 0 0 1-1.5 1.5h-11A1.5 1.5 0 0 1 1 13.5v-11zM2.5 2a.5.5 0 0 0-.5.5V5h5V2H2.5zM9 2v3h5V2.5a.5.5 0 0 0-.5-.5H9zM14 6H9v3h5V6zM14 10.5H9v3h4.5a.5.5 0 0 0 .5-.5V10.5zM7 13.5v-3H2v2.5a.5.5 0 0 0 .5.5H7zM2 9h5V6H2v3z" }) }),
2637
+ rowAbove: /* @__PURE__ */ e("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "currentColor", children: /* @__PURE__ */ e("path", { d: "M2 3h12v2H2V3zm0 4h12v6H2V7zm6-6 2.5 2.5h-1.5V6h-2V3.5H5.5L8 1z" }) }),
2638
+ rowBelow: /* @__PURE__ */ e("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "currentColor", children: /* @__PURE__ */ e("path", { d: "M2 3h12v6H2V3zm0 8h12v2H2v-2zm6 4-2.5-2.5h1.5V10h2v2.5h1.5L8 15z" }) }),
2639
+ columnLeft: /* @__PURE__ */ e("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "currentColor", children: /* @__PURE__ */ e("path", { d: "M3 2h2v12H3V2zm4 0h7v12H7V2zM1 8l2.5-2.5V7H6v2H3.5v1.5L1 8z" }) }),
2640
+ columnRight: /* @__PURE__ */ e("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "currentColor", children: /* @__PURE__ */ e("path", { d: "M11 2h2v12h-2V2zM2 2h7v12H2V2zm13 6-2.5 2.5V9H10V7h2.5V5.5L15 8z" }) }),
2641
+ cellProperties: /* @__PURE__ */ e("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "currentColor", children: /* @__PURE__ */ e("path", { d: "M2 2h12v12H2V2zm1 1v3h3V3H3zm4 0v3h6V3H7zM3 7v6h3V7H3zm4 0v6h6V7H7zm1 2h4v1H8V9zm0 2h3v1H8v-1z" }) }),
2642
+ deleteRow: /* @__PURE__ */ a("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "currentColor", children: [
2643
+ /* @__PURE__ */ e("path", { d: "M2 3h12v2H2V3zm0 4h12v6H2V7zm3 1h6v1.5H5V8.5z" }),
2644
+ /* @__PURE__ */ e("path", { d: "M4.5 10.5h7", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round" })
2645
+ ] }),
2646
+ deleteColumn: /* @__PURE__ */ e("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "currentColor", children: /* @__PURE__ */ e("path", { d: "M2 2h4v12H2V2zm5 0h7v12H7V2zm1.5 5.5h4", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round" }) }),
2647
+ mergeCells: /* @__PURE__ */ a("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "currentColor", children: [
2648
+ /* @__PURE__ */ e("path", { d: "M2 2h5v5H2V2zm7 0h5v5H9V2zM2 9h12v5H2V9z" }),
2649
+ /* @__PURE__ */ e("path", { d: "M6 4.5h4", stroke: "#fff", strokeWidth: "1.5", strokeLinecap: "round" })
2650
+ ] }),
2651
+ splitCell: /* @__PURE__ */ a("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "currentColor", children: [
2652
+ /* @__PURE__ */ e("path", { d: "M2 2h12v12H2V2zm5 0v12" }),
2653
+ /* @__PURE__ */ e("path", { d: "M8 2v12", stroke: "#fff", strokeWidth: "1.5" })
2654
+ ] }),
2655
+ graph: /* @__PURE__ */ e("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "currentColor", children: /* @__PURE__ */ e("path", { d: "M2 2h1.5v10.5H14V14H2V2zm2 8.5 2.2-2.8 2 1.8 3.3-4.2 1.2.9-4.2 5.3-2-1.8-1.7 2.1L4 10.5z" }) }),
2656
+ horizontalRule: /* @__PURE__ */ e("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "currentColor", children: /* @__PURE__ */ e("rect", { x: "1", y: "7", width: "14", height: "2", rx: "1" }) }),
2657
+ blockquote: /* @__PURE__ */ e("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "currentColor", children: /* @__PURE__ */ e("path", { d: "M3 3h4v4l-2 5H3l2-5H3V3zm6 0h4v4l-2 5H9l2-5H9V3z" }) }),
2658
+ codeBlock: /* @__PURE__ */ e("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "currentColor", children: /* @__PURE__ */ e("path", { d: "M5.7 11.3l-1.4 1.4L0 8l4.3-4.7 1.4 1.4L2.8 8l2.9 3.3zm4.6 0l1.4 1.4L16 8l-4.3-4.7-1.4 1.4L13.2 8l-2.9 3.3z" }) }),
2659
+ math: /* @__PURE__ */ e("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "currentColor", children: /* @__PURE__ */ e("path", { d: "M2 2l3 6-3 6h2.5l2-4 2 4H11l-3-6 3-6H8.5l-2 4-2-4H2zm9 0v2h4V2h-4zm0 5v2h4V7h-4zm0 5v2h4v-2h-4z" }) }),
2660
+ undo: /* @__PURE__ */ e("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "currentColor", children: /* @__PURE__ */ e("path", { d: "M4 5h6a3 3 0 0 1 0 6H7v2h3a5 5 0 0 0 0-10H4V1L0 4.5 4 8V5z" }) }),
2661
+ redo: /* @__PURE__ */ e("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "currentColor", children: /* @__PURE__ */ e("path", { d: "M12 5H6a3 3 0 0 0 0 6h3v2H6a5 5 0 0 1 0-10h6V1l4 3.5L12 8V5z" }) }),
2662
+ chemistry: /* @__PURE__ */ e("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "currentColor", children: /* @__PURE__ */ e("path", { d: "M11 2h-1V1c0-.6-.4-1-1-1H7C6.4 0 6 .4 6 1v1H5c-.6 0-1 .4-1 1v1c0 .2.1.4.2.6L7 9.5v3.5c0 .6.4 1 1 1s1-.4 1-1V9.5l2.8-4.9c.1-.2.2-.4.2-.6V3c0-.6-.4-1-1-1zm-4 0V1h2v1H7zm1.5 6.5l-.5-.9-.5.9V13h1V8.5z" }) }),
2663
+ alignLeft: /* @__PURE__ */ e("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "currentColor", children: /* @__PURE__ */ e("path", { d: "M2 3h12v1.5H2V3zm0 4h8v1.5H2V7zm0 4h12v1.5H2v-1.5zM2 11h6v1.5H2V11z" }) }),
2664
+ alignCenter: /* @__PURE__ */ e("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "currentColor", children: /* @__PURE__ */ e("path", { d: "M2 3h12v1.5H2V3zm3 4h6v1.5H5V7zm-3 4h12v1.5H2v-1.5zM5 11h6v1.5H5V11z" }) }),
2665
+ alignRight: /* @__PURE__ */ e("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "currentColor", children: /* @__PURE__ */ e("path", { d: "M2 3h12v1.5H2V3zm6 4h6v1.5H8V7zM2 11h12v1.5H2v-1.5zm6-4h6v1.5H8V7z" }) }),
2666
+ alignJustify: /* @__PURE__ */ e("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "currentColor", children: /* @__PURE__ */ e("path", { d: "M2 3h12v1.5H2V3zm0 4h12v1.5H2V7zm0 4h12v1.5H2v-1.5zm0 4h12v1.5H2v-1.5z" }) }),
2667
+ indent: /* @__PURE__ */ e("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "currentColor", children: /* @__PURE__ */ e("path", { d: "M2 3h12v1.5H2V3zm3 4h9v1.5H5V7zm3 4h6v1.5H8v-1.5zM2 11h12v1.5H2v-1.5zM2 7l3 2-3 2V7z" }) }),
2668
+ outdent: /* @__PURE__ */ e("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "currentColor", children: /* @__PURE__ */ e("path", { d: "M2 3h12v1.5H2V3zm3 4h9v1.5H5V7zm3 4h6v1.5H8v-1.5zM2 11h12v1.5H2v-1.5zM5 7l-3 2 3 2V7z" }) }),
2669
+ highlight: /* @__PURE__ */ e("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "currentColor", children: /* @__PURE__ */ e("path", { d: "M3 2h4l4 4-4 4H3a1 1 0 0 1-1-1V3a1 1 0 0 1 1-1zm6 0l2 2 2-2-2-2-2 2zm-2 2l2 2 2-2-2-2-2 2z" }) }),
2670
+ removeFormat: /* @__PURE__ */ a("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "currentColor", children: [
2671
+ /* @__PURE__ */ e("path", { d: "M2 2h12v1.5H2V2zm2 3h8v1.5H4V5zm2 3h4v1.5H6V8zm-4 3h12v1.5H2v-1.5zm2 3h8v1.5H4v-1.5z" }),
2672
+ /* @__PURE__ */ e("path", { d: "M1 1l14 14", stroke: "currentColor", strokeWidth: "1.5" })
2673
+ ] })
2674
+ }, wa = [
2675
+ { value: "Arial", label: "Arial" },
2676
+ { value: "Times New Roman", label: "Times New Roman" },
2677
+ { value: "Georgia", label: "Georgia" },
2678
+ { value: "Verdana", label: "Verdana" },
2679
+ { value: "Courier New", label: "Courier New" }
2680
+ ], Ca = oe.memo(function({ editor: t, toolbarMode: l, onInsertMath: i, onInsertImage: c, onEditImage: r, onSetImageAlign: s, onResetImagePosition: o }) {
2681
+ const [N, y] = H("#000000"), [u, h] = H("#fef08a"), [m, k] = H("basic"), [f, P] = H(!1), [p, g] = H(!1), [w, B] = H(!1), [_, W] = H(!1), [q, ie] = H(!1), [fe, ae] = H({}), me = b(() => {
2682
+ P(!0);
2683
+ }, []), Ae = b((z) => {
2684
+ if (!t) return;
2685
+ const { url: I, text: ee, target: U } = z;
2686
+ ee ? t.chain().focus().deleteSelection().insertContent(ee).setLink({
2687
+ href: I,
2688
+ target: U || "_self",
2689
+ rel: U === "_blank" ? "noopener noreferrer" : void 0
2690
+ }).run() : t.chain().focus().setLink({
2691
+ href: I,
2692
+ target: U || "_self",
2693
+ rel: U === "_blank" ? "noopener noreferrer" : void 0
2694
+ }).run(), P(!1);
2695
+ }, [t]), C = b(() => {
2696
+ t && (t.chain().focus().unsetLink().run(), P(!1));
2697
+ }, [t]), j = b(() => t ? {
2698
+ url: t.getAttributes("link").href || "",
2699
+ text: t.state.selection.empty ? "" : t.state.doc.textBetween(t.state.selection.from, t.state.selection.to),
2700
+ title: t.getAttributes("link").title || "",
2701
+ target: t.getAttributes("link").target || "_blank"
2702
+ } : {}, [t]), de = b((z, I, ee) => {
2703
+ t && t.chain().focus().insertTable({ rows: z, cols: I, withHeaderRow: ee }).run();
2704
+ }, [t]), [Ne, ne] = H(!1), [pe, ye] = H(null), [ge, G] = H(!1), [Me, he] = H(null);
2705
+ X(() => {
2706
+ if (!t) return;
2707
+ const z = (ee) => {
2708
+ const U = ee, Be = U.target, He = Be.closest("figure.mtx-image-figure, .mtx-image-wrapper, img"), Ke = Be.closest("td, th");
2709
+ if (He) {
2710
+ U.preventDefault(), U.stopPropagation();
2711
+ try {
2712
+ const Le = He.tagName === "IMG" ? He : He.querySelector("img") || He, Ht = t.view.posAtDOM(Le, 0);
2713
+ t.chain().focus().setNodeSelection(Ht).run();
2714
+ } catch (Le) {
2715
+ console.warn("Cannot select image from context menu:", Le);
2716
+ }
2717
+ ne(!1), he({ x: U.clientX, y: U.clientY }), G(!0);
2718
+ return;
2719
+ }
2720
+ Ke && t.isActive("table") && (U.preventDefault(), U.stopPropagation(), G(!1), ye({ x: U.clientX, y: U.clientY }), ne(!0));
2721
+ }, I = document.querySelector(".mtx-content");
2722
+ return I && I.addEventListener("contextmenu", z), () => {
2723
+ I && I.removeEventListener("contextmenu", z);
2724
+ };
2725
+ }, [t]);
2726
+ const ve = b(() => {
2727
+ t && t.chain().focus().addRowBefore().run();
2728
+ }, [t]), Q = b(() => {
2729
+ t && t.chain().focus().addRowAfter().run();
2730
+ }, [t]), v = b(() => {
2731
+ t && t.chain().focus().deleteRow().run();
2732
+ }, [t]), T = b(() => {
2733
+ t && t.chain().focus().addColumnBefore().run();
2734
+ }, [t]), D = b(() => {
2735
+ t && t.chain().focus().addColumnAfter().run();
2736
+ }, [t]), $ = b(() => {
2737
+ t && t.chain().focus().deleteColumn().run();
2738
+ }, [t]), F = b(() => {
2739
+ t && (t.chain().focus().deleteTable().run(), ne(!1));
2740
+ }, [t]), x = b((z) => {
2741
+ s == null || s(z), G(!1);
2742
+ }, [s]), V = b(() => {
2743
+ r == null || r(), G(!1);
2744
+ }, [r]), K = b(() => {
2745
+ o == null || o(), G(!1);
2746
+ }, [o]), O = b(() => {
2747
+ s == null || s("center"), G(!1);
2748
+ }, [s]), E = b(() => {
2749
+ if (!t) return;
2750
+ const z = t.state.selection.$from.parent;
2751
+ if (z.type.name !== "tableCell" && z.type.name !== "tableHeader")
2752
+ return;
2753
+ const I = Array.isArray(z.attrs.colwidth) ? z.attrs.colwidth[0] : null, ee = z.attrs.width || (typeof I == "number" ? `${I}px` : "");
2754
+ ae({
2755
+ width: typeof ee == "string" ? ee : ee ? String(ee) : "",
2756
+ backgroundColor: z.attrs.backgroundColor || "",
2757
+ horizontalAlign: z.attrs.textAlign || "left",
2758
+ verticalAlign: z.attrs.verticalAlign || "top"
2759
+ }), ne(!1), B(!0);
2760
+ }, [t]), Y = b(() => {
2761
+ if (t)
2762
+ try {
2763
+ t.chain().focus().mergeCells().run(), ne(!1);
2764
+ } catch (z) {
2765
+ console.warn("Cannot merge cells:", z);
2766
+ }
2767
+ }, [t]), J = b(() => {
2768
+ if (t)
2769
+ try {
2770
+ t.chain().focus().splitCell().run(), ne(!1);
2771
+ } catch (z) {
2772
+ console.warn("Cannot split cell:", z);
2773
+ }
2774
+ }, [t]), xe = b((z) => {
2775
+ if (!t) return;
2776
+ const { width: I, backgroundColor: ee, horizontalAlign: U, verticalAlign: Be } = z, Ke = t.state.selection.$from.parent.type.name === "tableHeader" ? "tableHeader" : "tableCell", Le = I ? parseInt(I, 10) : null;
2777
+ t.chain().focus().updateAttributes(Ke, {
2778
+ colwidth: Number.isFinite(Le) && (I != null && I.endsWith("px")) ? [Le] : null,
2779
+ width: I || null,
2780
+ backgroundColor: ee || null,
2781
+ textAlign: U || null,
2782
+ verticalAlign: Be || null
2783
+ }).run();
2784
+ }, [t]), ke = b((z) => {
2785
+ t && t.isActive("table") && t.chain().focus().updateAttributes("table", { theme: z.id }).run();
2786
+ }, [t]), De = b(() => {
2787
+ if (c) {
2788
+ c();
2789
+ return;
2790
+ }
2791
+ ie(!0);
2792
+ }, [c]), be = b(() => {
2793
+ t && t.chain().focus().insertContent({ type: "graph", attrs: { formula: "sin(x)" } }).run();
2794
+ }, [t]), se = b(
2795
+ (z, I) => {
2796
+ t && (t.chain().focus().setImage({ src: z, alt: I }).run(), ie(!1));
2797
+ },
2798
+ [t]
2799
+ ), Ee = b(() => {
2800
+ g(!0);
2801
+ }, []), we = va(t), ue = !!we, _e = (we == null ? void 0 : we.align) || "center", ft = we ? Number(we.offsetX || 0) !== 0 || Number(we.offsetY || 0) !== 0 : !1, ze = !!t && t.isActive("table"), Nt = !!t && ["tableCell", "tableHeader"].includes(t.state.selection.$from.parent.type.name), yt = !!t && t.can().deleteRow(), vt = !!t && t.can().deleteColumn(), kt = !!t && t.can().mergeCells(), wt = !!t && t.can().splitCell(), re = (l || m) === "advanced", Ct = !l, Tt = b(() => {
2802
+ t && t.chain().focus().unsetBold().unsetItalic().unsetUnderline().unsetStrike().unsetSubscript().unsetSuperscript().unsetLink().unsetColor().unsetFontFamily().unsetHighlight().run();
2803
+ }, [t]), At = b((z) => {
2804
+ y(z), t && t.chain().focus().setColor(z).run();
2805
+ }, [t]), Mt = b((z) => {
2806
+ h(z), t && t.chain().focus().toggleHighlight({ color: z }).run();
2807
+ }, [t]);
2808
+ return t ? /* @__PURE__ */ a("div", { className: "mtx-toolbar", role: "toolbar", "aria-label": "Editor toolbar", children: [
2809
+ Ct && /* @__PURE__ */ a(Z, { children: [
2810
+ /* @__PURE__ */ a("div", { className: "mtx-toolbar-mode-switch", role: "group", "aria-label": "Toolbar density", children: [
2811
+ /* @__PURE__ */ e(
2812
+ "button",
2813
+ {
2814
+ type: "button",
2815
+ className: `mtx-toolbar-mode-btn ${re ? "" : "is-active"}`,
2816
+ onClick: () => k("basic"),
2817
+ "aria-pressed": !re,
2818
+ children: "Basic"
2819
+ }
2820
+ ),
2821
+ /* @__PURE__ */ e(
2822
+ "button",
2823
+ {
2824
+ type: "button",
2825
+ className: `mtx-toolbar-mode-btn ${re ? "is-active" : ""}`,
2826
+ onClick: () => k("advanced"),
2827
+ "aria-pressed": re,
2828
+ children: "Advanced"
2829
+ }
2830
+ )
2831
+ ] }),
2832
+ /* @__PURE__ */ e(ce, {})
2833
+ ] }),
2834
+ /* @__PURE__ */ a("div", { className: "mtx-toolbar-group", children: [
2835
+ /* @__PURE__ */ e(
2836
+ A,
2837
+ {
2838
+ icon: M.undo,
2839
+ label: "Undo (Ctrl+Z)",
2840
+ onClick: () => t.chain().focus().undo().run(),
2841
+ isDisabled: !t.can().undo()
2842
+ }
2843
+ ),
2844
+ /* @__PURE__ */ e(
2845
+ A,
2846
+ {
2847
+ icon: M.redo,
2848
+ label: "Redo (Ctrl+Y)",
2849
+ onClick: () => t.chain().focus().redo().run(),
2850
+ isDisabled: !t.can().redo()
2851
+ }
2852
+ )
2853
+ ] }),
2854
+ /* @__PURE__ */ e(ce, {}),
2855
+ re && /* @__PURE__ */ a(Z, { children: [
2856
+ /* @__PURE__ */ e("div", { className: "mtx-toolbar-group", children: /* @__PURE__ */ e(
2857
+ ka,
2858
+ {
2859
+ value: t.getAttributes("textStyle").fontFamily || "Arial",
2860
+ onChange: (z) => t.chain().focus().setFontFamily(z).run(),
2861
+ options: wa,
2862
+ label: "Font Family",
2863
+ className: "mtx-font-select"
2864
+ }
2865
+ ) }),
2866
+ /* @__PURE__ */ e(ce, {})
2867
+ ] }),
2868
+ /* @__PURE__ */ a("div", { className: "mtx-toolbar-group", children: [
2869
+ /* @__PURE__ */ e(
2870
+ A,
2871
+ {
2872
+ icon: M.bold,
2873
+ label: "Bold (Ctrl+B)",
2874
+ onClick: () => t.chain().focus().toggleBold().run(),
2875
+ isActive: t.isActive("bold")
2876
+ }
2877
+ ),
2878
+ /* @__PURE__ */ e(
2879
+ A,
2880
+ {
2881
+ icon: M.italic,
2882
+ label: "Italic (Ctrl+I)",
2883
+ onClick: () => t.chain().focus().toggleItalic().run(),
2884
+ isActive: t.isActive("italic")
2885
+ }
2886
+ ),
2887
+ /* @__PURE__ */ e(
2888
+ A,
2889
+ {
2890
+ icon: M.underline,
2891
+ label: "Underline (Ctrl+U)",
2892
+ onClick: () => t.chain().focus().toggleUnderline().run(),
2893
+ isActive: t.isActive("underline")
2894
+ }
2895
+ ),
2896
+ /* @__PURE__ */ e(
2897
+ A,
2898
+ {
2899
+ icon: M.strike,
2900
+ label: "Strikethrough",
2901
+ onClick: () => t.chain().focus().toggleStrike().run(),
2902
+ isActive: t.isActive("strike")
2903
+ }
2904
+ ),
2905
+ /* @__PURE__ */ e(
2906
+ A,
2907
+ {
2908
+ icon: M.highlight,
2909
+ label: "Highlight",
2910
+ onClick: () => t.chain().focus().toggleHighlight().run(),
2911
+ isActive: t.isActive("highlight")
2912
+ }
2913
+ ),
2914
+ /* @__PURE__ */ e(
2915
+ lt,
2916
+ {
2917
+ color: u,
2918
+ onChange: Mt,
2919
+ label: "Highlight Color",
2920
+ icon: /* @__PURE__ */ e("span", { style: { width: "12px", height: "12px", background: u, borderRadius: "2px", display: "inline-block" } })
2921
+ }
2922
+ )
2923
+ ] }),
2924
+ /* @__PURE__ */ e(ce, {}),
2925
+ re && /* @__PURE__ */ a(Z, { children: [
2926
+ /* @__PURE__ */ e("div", { className: "mtx-toolbar-group", children: /* @__PURE__ */ e(
2927
+ lt,
2928
+ {
2929
+ color: N,
2930
+ onChange: At,
2931
+ label: "Text Color",
2932
+ icon: /* @__PURE__ */ e("span", { style: { width: "16px", height: "3px", background: N, display: "inline-block", borderRadius: "1px" } })
2933
+ }
2934
+ ) }),
2935
+ /* @__PURE__ */ e(ce, {})
2936
+ ] }),
2937
+ /* @__PURE__ */ a("div", { className: "mtx-toolbar-group", children: [
2938
+ /* @__PURE__ */ e(
2939
+ A,
2940
+ {
2941
+ icon: M.paragraph,
2942
+ label: "Paragraph",
2943
+ onClick: () => t.chain().focus().setParagraph().run(),
2944
+ isActive: t.isActive("paragraph")
2945
+ }
2946
+ ),
2947
+ /* @__PURE__ */ e(
2948
+ A,
2949
+ {
2950
+ icon: M.h1,
2951
+ label: "Heading 1",
2952
+ onClick: () => t.chain().focus().toggleHeading({ level: 1 }).run(),
2953
+ isActive: t.isActive("heading", { level: 1 })
2954
+ }
2955
+ ),
2956
+ /* @__PURE__ */ e(
2957
+ A,
2958
+ {
2959
+ icon: M.h2,
2960
+ label: "Heading 2",
2961
+ onClick: () => t.chain().focus().toggleHeading({ level: 2 }).run(),
2962
+ isActive: t.isActive("heading", { level: 2 })
2963
+ }
2964
+ ),
2965
+ /* @__PURE__ */ e(
2966
+ A,
2967
+ {
2968
+ icon: M.h3,
2969
+ label: "Heading 3",
2970
+ onClick: () => t.chain().focus().toggleHeading({ level: 3 }).run(),
2971
+ isActive: t.isActive("heading", { level: 3 })
2972
+ }
2973
+ )
2974
+ ] }),
2975
+ /* @__PURE__ */ e(ce, {}),
2976
+ /* @__PURE__ */ a("div", { className: "mtx-toolbar-group", children: [
2977
+ /* @__PURE__ */ e(
2978
+ A,
2979
+ {
2980
+ icon: M.bulletList,
2981
+ label: "Bullet List",
2982
+ onClick: () => t.chain().focus().toggleBulletList().run(),
2983
+ isActive: t.isActive("bulletList")
2984
+ }
2985
+ ),
2986
+ /* @__PURE__ */ e(
2987
+ A,
2988
+ {
2989
+ icon: M.orderedList,
2990
+ label: "Ordered List",
2991
+ onClick: () => t.chain().focus().toggleOrderedList().run(),
2992
+ isActive: t.isActive("orderedList")
2993
+ }
2994
+ ),
2995
+ /* @__PURE__ */ e(
2996
+ A,
2997
+ {
2998
+ icon: M.taskList,
2999
+ label: "Checklist",
3000
+ onClick: () => t.chain().focus().toggleTaskList().run(),
3001
+ isActive: t.isActive("taskList")
3002
+ }
3003
+ ),
3004
+ /* @__PURE__ */ e(
3005
+ A,
3006
+ {
3007
+ icon: M.outdent,
3008
+ label: "Outdent",
3009
+ onClick: () => t.chain().focus().outdent().run(),
3010
+ isDisabled: !t.can().outdent()
3011
+ }
3012
+ ),
3013
+ /* @__PURE__ */ e(
3014
+ A,
3015
+ {
3016
+ icon: M.indent,
3017
+ label: "Indent",
3018
+ onClick: () => t.chain().focus().indent().run(),
3019
+ isDisabled: !t.can().indent()
3020
+ }
3021
+ )
3022
+ ] }),
3023
+ /* @__PURE__ */ e(ce, {}),
3024
+ re && /* @__PURE__ */ a(Z, { children: [
3025
+ /* @__PURE__ */ a("div", { className: "mtx-toolbar-group", children: [
3026
+ /* @__PURE__ */ e(
3027
+ A,
3028
+ {
3029
+ icon: M.alignLeft,
3030
+ label: "Align Left",
3031
+ onClick: () => t.chain().focus().setTextAlign("left").run(),
3032
+ isActive: t.isActive({ textAlign: "left" })
3033
+ }
3034
+ ),
3035
+ /* @__PURE__ */ e(
3036
+ A,
3037
+ {
3038
+ icon: M.alignCenter,
3039
+ label: "Align Center",
3040
+ onClick: () => t.chain().focus().setTextAlign("center").run(),
3041
+ isActive: t.isActive({ textAlign: "center" })
3042
+ }
3043
+ ),
3044
+ /* @__PURE__ */ e(
3045
+ A,
3046
+ {
3047
+ icon: M.alignRight,
3048
+ label: "Align Right",
3049
+ onClick: () => t.chain().focus().setTextAlign("right").run(),
3050
+ isActive: t.isActive({ textAlign: "right" })
3051
+ }
3052
+ ),
3053
+ /* @__PURE__ */ e(
3054
+ A,
3055
+ {
3056
+ icon: M.alignJustify,
3057
+ label: "Justify",
3058
+ onClick: () => t.chain().focus().setTextAlign("justify").run(),
3059
+ isActive: t.isActive({ textAlign: "justify" })
3060
+ }
3061
+ )
3062
+ ] }),
3063
+ /* @__PURE__ */ e(ce, {})
3064
+ ] }),
3065
+ /* @__PURE__ */ a("div", { className: "mtx-toolbar-group", children: [
3066
+ /* @__PURE__ */ e(
3067
+ A,
3068
+ {
3069
+ icon: M.link,
3070
+ label: "Link",
3071
+ onClick: me,
3072
+ isActive: t.isActive("link")
3073
+ }
3074
+ ),
3075
+ /* @__PURE__ */ e(
3076
+ A,
3077
+ {
3078
+ icon: M.image,
3079
+ label: "Image",
3080
+ onClick: De
3081
+ }
3082
+ ),
3083
+ re && /* @__PURE__ */ a(Z, { children: [
3084
+ /* @__PURE__ */ e(
3085
+ A,
3086
+ {
3087
+ icon: M.editImage,
3088
+ label: "Edit Image",
3089
+ onClick: () => r && r(),
3090
+ isDisabled: !ue
3091
+ }
3092
+ ),
3093
+ /* @__PURE__ */ e(
3094
+ A,
3095
+ {
3096
+ icon: M.alignLeft,
3097
+ label: "Wrap Image Left",
3098
+ onClick: () => s == null ? void 0 : s("left"),
3099
+ isActive: ue && _e === "left",
3100
+ isDisabled: !ue
3101
+ }
3102
+ ),
3103
+ /* @__PURE__ */ e(
3104
+ A,
3105
+ {
3106
+ icon: M.alignCenter,
3107
+ label: "Wrap Image Center",
3108
+ onClick: () => s == null ? void 0 : s("center"),
3109
+ isActive: ue && _e === "center",
3110
+ isDisabled: !ue
3111
+ }
3112
+ ),
3113
+ /* @__PURE__ */ e(
3114
+ A,
3115
+ {
3116
+ icon: M.alignRight,
3117
+ label: "Wrap Image Right",
3118
+ onClick: () => s == null ? void 0 : s("right"),
3119
+ isActive: ue && _e === "right",
3120
+ isDisabled: !ue
3121
+ }
3122
+ ),
3123
+ /* @__PURE__ */ e(
3124
+ A,
3125
+ {
3126
+ icon: M.alignJustify,
3127
+ label: "Wrap Image Full",
3128
+ onClick: () => s == null ? void 0 : s("full"),
3129
+ isActive: ue && _e === "full",
3130
+ isDisabled: !ue
3131
+ }
3132
+ )
3133
+ ] }),
3134
+ /* @__PURE__ */ e(
3135
+ A,
3136
+ {
3137
+ icon: M.table,
3138
+ label: "Table",
3139
+ onClick: Ee
3140
+ }
3141
+ ),
3142
+ /* @__PURE__ */ e(
3143
+ A,
3144
+ {
3145
+ icon: M.graph,
3146
+ label: "Graph",
3147
+ onClick: be
3148
+ }
3149
+ ),
3150
+ ze && /* @__PURE__ */ a(Z, { children: [
3151
+ /* @__PURE__ */ e(
3152
+ A,
3153
+ {
3154
+ icon: M.rowAbove,
3155
+ label: "Insert Row Above",
3156
+ onClick: ve
3157
+ }
3158
+ ),
3159
+ /* @__PURE__ */ e(
3160
+ A,
3161
+ {
3162
+ icon: M.rowBelow,
3163
+ label: "Insert Row Below",
3164
+ onClick: Q
3165
+ }
3166
+ ),
3167
+ /* @__PURE__ */ e(
3168
+ A,
3169
+ {
3170
+ icon: M.columnLeft,
3171
+ label: "Insert Column Left",
3172
+ onClick: T
3173
+ }
3174
+ ),
3175
+ /* @__PURE__ */ e(
3176
+ A,
3177
+ {
3178
+ icon: M.columnRight,
3179
+ label: "Insert Column Right",
3180
+ onClick: D
3181
+ }
3182
+ ),
3183
+ /* @__PURE__ */ e(
3184
+ A,
3185
+ {
3186
+ icon: M.cellProperties,
3187
+ label: "Cell Properties",
3188
+ onClick: E,
3189
+ isDisabled: !Nt
3190
+ }
3191
+ ),
3192
+ /* @__PURE__ */ e(
3193
+ A,
3194
+ {
3195
+ icon: M.deleteRow,
3196
+ label: "Delete Row",
3197
+ onClick: v,
3198
+ isDisabled: !yt
3199
+ }
3200
+ ),
3201
+ /* @__PURE__ */ e(
3202
+ A,
3203
+ {
3204
+ icon: M.deleteColumn,
3205
+ label: "Delete Column",
3206
+ onClick: $,
3207
+ isDisabled: !vt
3208
+ }
3209
+ ),
3210
+ /* @__PURE__ */ e(
3211
+ A,
3212
+ {
3213
+ icon: M.mergeCells,
3214
+ label: "Merge Cells",
3215
+ onClick: Y,
3216
+ isDisabled: !kt
3217
+ }
3218
+ ),
3219
+ /* @__PURE__ */ e(
3220
+ A,
3221
+ {
3222
+ icon: M.splitCell,
3223
+ label: "Split Cell",
3224
+ onClick: J,
3225
+ isDisabled: !wt
3226
+ }
3227
+ )
3228
+ ] }),
3229
+ re && /* @__PURE__ */ a(Z, { children: [
3230
+ /* @__PURE__ */ e(
3231
+ "button",
3232
+ {
3233
+ className: "mtx-toolbar-btn mtx-toolbar-btn--dropdown",
3234
+ onClick: (z) => {
3235
+ if (!ze) return;
3236
+ const I = z.currentTarget.getBoundingClientRect();
3237
+ ye({ x: I.left, y: I.bottom + 5 }), ne(!Ne);
3238
+ },
3239
+ title: "Table Operations",
3240
+ "aria-label": "Table Operations",
3241
+ disabled: !ze,
3242
+ children: /* @__PURE__ */ e("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "currentColor", children: /* @__PURE__ */ e("path", { d: "M8 11l-4-4h8l-4 4z" }) })
3243
+ }
3244
+ ),
3245
+ /* @__PURE__ */ e(
3246
+ "button",
3247
+ {
3248
+ className: "mtx-toolbar-btn",
3249
+ onClick: () => ze && W(!0),
3250
+ title: "Table Templates",
3251
+ "aria-label": "Table Templates",
3252
+ disabled: !ze,
3253
+ children: /* @__PURE__ */ e("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "currentColor", children: /* @__PURE__ */ e("path", { d: "M2 2h5v5H2V2zm7 0h5v5H9V2zM2 9h5v5H2V9zm7 0h5v5H9V9z" }) })
3254
+ }
3255
+ ),
3256
+ /* @__PURE__ */ e(
3257
+ A,
3258
+ {
3259
+ icon: M.horizontalRule,
3260
+ label: "Horizontal Rule",
3261
+ onClick: () => t.chain().focus().setHorizontalRule().run()
3262
+ }
3263
+ ),
3264
+ /* @__PURE__ */ e(
3265
+ A,
3266
+ {
3267
+ icon: M.blockquote,
3268
+ label: "Blockquote",
3269
+ onClick: () => t.chain().focus().toggleBlockquote().run(),
3270
+ isActive: t.isActive("blockquote")
3271
+ }
3272
+ ),
3273
+ /* @__PURE__ */ e(
3274
+ A,
3275
+ {
3276
+ icon: M.codeBlock,
3277
+ label: "Code Block",
3278
+ onClick: () => t.chain().focus().toggleCodeBlock().run(),
3279
+ isActive: t.isActive("codeBlock")
3280
+ }
3281
+ )
3282
+ ] })
3283
+ ] }),
3284
+ re && /* @__PURE__ */ a(Z, { children: [
3285
+ /* @__PURE__ */ e(ce, {}),
3286
+ /* @__PURE__ */ a("div", { className: "mtx-toolbar-group", children: [
3287
+ /* @__PURE__ */ e(
3288
+ A,
3289
+ {
3290
+ icon: M.superscript,
3291
+ label: "Superscript",
3292
+ onClick: () => t.chain().focus().toggleSuperscript().run(),
3293
+ isActive: t.isActive("superscript")
3294
+ }
3295
+ ),
3296
+ /* @__PURE__ */ e(
3297
+ A,
3298
+ {
3299
+ icon: M.subscript,
3300
+ label: "Subscript",
3301
+ onClick: () => t.chain().focus().toggleSubscript().run(),
3302
+ isActive: t.isActive("subscript")
3303
+ }
3304
+ )
3305
+ ] }),
3306
+ /* @__PURE__ */ e(ce, {})
3307
+ ] }),
3308
+ /* @__PURE__ */ a("div", { className: "mtx-toolbar-group", children: [
3309
+ /* @__PURE__ */ e(
3310
+ A,
3311
+ {
3312
+ icon: M.math,
3313
+ label: "Math Formula",
3314
+ onClick: () => i == null ? void 0 : i(),
3315
+ className: "mtx-toolbar-btn--accent"
3316
+ }
3317
+ ),
3318
+ re && /* @__PURE__ */ e(
3319
+ A,
3320
+ {
3321
+ icon: M.chemistry,
3322
+ label: "Chemistry Formula",
3323
+ onClick: () => i == null ? void 0 : i("chem"),
3324
+ className: "mtx-toolbar-btn--accent-secondary"
3325
+ }
3326
+ )
3327
+ ] }),
3328
+ /* @__PURE__ */ e(ce, {}),
3329
+ /* @__PURE__ */ e("div", { className: "mtx-toolbar-group", children: /* @__PURE__ */ e(
3330
+ A,
3331
+ {
3332
+ icon: M.removeFormat,
3333
+ label: "Remove Format",
3334
+ onClick: Tt
3335
+ }
3336
+ ) }),
3337
+ f && /* @__PURE__ */ e(te, { fallback: null, children: /* @__PURE__ */ e(
3338
+ xa,
3339
+ {
3340
+ isOpen: f,
3341
+ currentUrl: j().url,
3342
+ currentText: j().text,
3343
+ currentTarget: j().target,
3344
+ onInsert: Ae,
3345
+ onRemove: t != null && t.isActive("link") ? C : void 0,
3346
+ onClose: () => P(!1)
3347
+ }
3348
+ ) }),
3349
+ p && /* @__PURE__ */ e(te, { fallback: null, children: /* @__PURE__ */ e(
3350
+ ba,
3351
+ {
3352
+ isOpen: p,
3353
+ onInsert: de,
3354
+ onClose: () => g(!1)
3355
+ }
3356
+ ) }),
3357
+ /* @__PURE__ */ e(
3358
+ bt,
3359
+ {
3360
+ isOpen: Ne,
3361
+ position: pe || { x: 200, y: 300 },
3362
+ onClose: () => ne(!1),
3363
+ onAddRowBefore: ve,
3364
+ onAddRowAfter: Q,
3365
+ onDeleteRow: v,
3366
+ onAddColumnBefore: T,
3367
+ onAddColumnAfter: D,
3368
+ onDeleteColumn: $,
3369
+ onDeleteTable: F,
3370
+ onCellProperties: E,
3371
+ onMergeCells: Y,
3372
+ onSplitCell: J
3373
+ }
3374
+ ),
3375
+ /* @__PURE__ */ e(
3376
+ ga,
3377
+ {
3378
+ isOpen: ge,
3379
+ position: Me || { x: 200, y: 300 },
3380
+ currentAlign: _e,
3381
+ hasCustomPosition: ft,
3382
+ onClose: () => G(!1),
3383
+ onSetAlign: x,
3384
+ onResetPosition: o ? K : void 0,
3385
+ onCenterImage: s ? O : void 0,
3386
+ onEditImage: r ? V : void 0
3387
+ }
3388
+ ),
3389
+ w && /* @__PURE__ */ e(te, { fallback: null, children: /* @__PURE__ */ e(
3390
+ fa,
3391
+ {
3392
+ isOpen: w,
3393
+ initialData: fe,
3394
+ onSave: xe,
3395
+ onClose: () => {
3396
+ B(!1), ae({});
3397
+ }
3398
+ }
3399
+ ) }),
3400
+ _ && /* @__PURE__ */ e(te, { fallback: null, children: /* @__PURE__ */ e(
3401
+ Na,
3402
+ {
3403
+ isOpen: _,
3404
+ onSelect: ke,
3405
+ onClose: () => W(!1)
3406
+ }
3407
+ ) }),
3408
+ q && /* @__PURE__ */ e(te, { fallback: null, children: /* @__PURE__ */ e(
3409
+ ya,
3410
+ {
3411
+ isOpen: q,
3412
+ onClose: () => ie(!1),
3413
+ onInsert: se
3414
+ }
3415
+ ) })
3416
+ ] }) : null;
3417
+ }), it = "mtx-math-toolbar-expanded-section";
3418
+ function st({ label: n, latex: t, onClick: l, title: i, variant: c = "default" }) {
3419
+ return /* @__PURE__ */ e(
3420
+ "button",
3421
+ {
3422
+ type: "button",
3423
+ className: `mtx-math-btn ${c === "recent" ? "mtx-math-btn--recent" : ""}`,
3424
+ onClick: () => l(t),
3425
+ title: i,
3426
+ "aria-label": i,
3427
+ children: /* @__PURE__ */ e("span", { className: "mtx-math-btn__label", children: n })
3428
+ }
3429
+ );
3430
+ }
3431
+ const qe = [
3432
+ {
3433
+ label: "Basic",
3434
+ buttons: [
3435
+ { label: "x²", latex: "x^{2}", title: "Pangkat (Superscript)" },
3436
+ { label: "x₂", latex: "x_{2}", title: "Subscript / Index" },
3437
+ { label: "½", latex: "\\frac{a}{b}", title: "Pecahan (Fraction)" },
3438
+ { label: "√", latex: "\\sqrt{x}", title: "Akar kuadrat (Square Root)" },
3439
+ { label: "∛", latex: "\\sqrt[3]{x}", title: "Akar pangkat tiga" },
3440
+ { label: "π", latex: "\\pi", title: "Pi" },
3441
+ { label: "±", latex: "\\pm", title: "Plus minus" },
3442
+ { label: "×", latex: "\\times", title: "Perkalian" },
3443
+ { label: "÷", latex: "\\div", title: "Pembagian" }
3444
+ ]
3445
+ },
3446
+ {
3447
+ label: "Relation",
3448
+ buttons: [
3449
+ { label: "=", latex: "=", title: "Sama dengan" },
3450
+ { label: "<", latex: "<", title: "Kurang dari" },
3451
+ { label: ">", latex: ">", title: "Lebih dari" },
3452
+ { label: "≠", latex: "\\neq", title: "Tidak sama dengan" },
3453
+ { label: "≤", latex: "\\leq", title: "Kurang dari atau sama dengan" },
3454
+ { label: "≥", latex: "\\geq", title: "Lebih dari atau sama dengan" },
3455
+ { label: "≈", latex: "\\approx", title: "Hampir sama dengan" },
3456
+ { label: "∞", latex: "\\infty", title: "Tak hingga (Infinity)" }
3457
+ ]
3458
+ },
3459
+ {
3460
+ label: "Set",
3461
+ buttons: [
3462
+ { label: "∈", latex: "\\in", title: "Anggota himpunan" },
3463
+ { label: "∉", latex: "\\notin", title: "Bukan anggota himpunan" },
3464
+ { label: "∪", latex: "\\cup", title: "Union / Gabungan" },
3465
+ { label: "∩", latex: "\\cap", title: "Intersection / Irisan" }
3466
+ ]
3467
+ },
3468
+ {
3469
+ label: "Calc",
3470
+ buttons: [
3471
+ { label: "Σ", latex: "\\sum_{i=1}^{n}", title: "Sigma / Penjumlahan" },
3472
+ { label: "∫", latex: "\\int_{a}^{b}", title: "Integral" },
3473
+ { label: "d/dx", latex: "\\frac{d}{dx}", title: "Turunan terhadap x" },
3474
+ { label: "lim", latex: "\\lim_{x \\to \\infty}", title: "Limit" },
3475
+ { label: "log", latex: "\\log_{b}(x)", title: "Logaritma" },
3476
+ { label: "sin", latex: "\\sin(x)", title: "Sinus" },
3477
+ { label: "cos", latex: "\\cos(x)", title: "Cosinus" },
3478
+ { label: "tan", latex: "\\tan(x)", title: "Tangen" }
3479
+ ]
3480
+ },
3481
+ {
3482
+ label: "Structure",
3483
+ buttons: [
3484
+ { label: "vec", latex: "\\vec{v}", title: "Vektor" },
3485
+ { label: "hat", latex: "\\hat{x}", title: "Topi / Hat" },
3486
+ { label: "( )", latex: "\\left( \\right)", title: "Tanda kurung" },
3487
+ { label: "[ ]", latex: "\\left[ \\right]", title: "Kurung siku" },
3488
+ { label: "{ }", latex: "\\left\\{ \\right\\}", title: "Kurung kurawal" },
3489
+ { label: "|x|", latex: "\\left| x \\right|", title: "Nilai mutlak" },
3490
+ { label: "2x2", latex: "\\begin{bmatrix} a & b \\\\ c & d \\end{bmatrix}", title: "Matriks 2x2" },
3491
+ { label: "{x}", latex: "\\begin{cases} x_1 \\\\ x_2 \\end{cases}", title: "Piecewise / Cases" },
3492
+ { label: "Kimia", latex: "\\ce{#?}", title: "Rumus Kimia (ce)" }
3493
+ ]
3494
+ }
3495
+ ], Ta = 6;
3496
+ function Aa({ onInsertLatex: n, onToggleSymbols: t, onToggleTemplates: l }) {
3497
+ const [i, c] = H([]), [r, s] = H("Basic"), [o, N] = H(""), y = Ce(() => qe.flatMap((p) => p.buttons), []), u = Ce(() => new Map(y.map((p) => [p.latex, p])), [y]), h = b((p) => {
3498
+ n(p), c((g) => [p, ...g.filter((w) => w !== p)].slice(0, Ta));
3499
+ }, [n]), m = Ce(
3500
+ () => i.map((p) => u.get(p)).filter((p) => !!p),
3501
+ [u, i]
3502
+ ), k = o.trim().toLowerCase(), f = Ce(() => k ? qe.map((p) => ({
3503
+ ...p,
3504
+ buttons: p.buttons.filter((g) => `${g.label} ${g.title} ${g.latex}`.toLowerCase().includes(k))
3505
+ })).filter((p) => p.buttons.length > 0) : qe, [k]);
3506
+ X(() => {
3507
+ if (typeof window > "u") return;
3508
+ const p = window.localStorage.getItem(it);
3509
+ p && s(p);
3510
+ }, []), X(() => {
3511
+ typeof window > "u" || !r || window.localStorage.setItem(it, r);
3512
+ }, [r]), X(() => {
3513
+ k && f.length > 0 && s(f[0].label);
3514
+ }, [f, k]);
3515
+ const P = b((p) => {
3516
+ s((g) => g === p ? "" : p);
3517
+ }, []);
3518
+ return /* @__PURE__ */ a("div", { className: "mtx-math-toolbar", role: "toolbar", "aria-label": "Math toolbar", children: [
3519
+ /* @__PURE__ */ a("div", { className: "mtx-math-toolbar__label", children: [
3520
+ /* @__PURE__ */ e("svg", { width: "14", height: "14", viewBox: "0 0 16 16", fill: "currentColor", children: /* @__PURE__ */ e("path", { d: "M2 2l3 6-3 6h2.5l2-4 2 4H11l-3-6 3-6H8.5l-2 4-2-4H2zm9 0v2h4V2h-4zm0 5v2h4V7h-4zm0 5v2h4v-2h-4z" }) }),
3521
+ /* @__PURE__ */ e("span", { children: "Math" })
3522
+ ] }),
3523
+ /* @__PURE__ */ e("div", { className: "mtx-math-toolbar__search-wrap", children: /* @__PURE__ */ e(
3524
+ "input",
3525
+ {
3526
+ type: "search",
3527
+ className: "mtx-math-toolbar__search",
3528
+ value: o,
3529
+ onChange: (p) => N(p.target.value),
3530
+ placeholder: "Cari rumus...",
3531
+ "aria-label": "Search math formulas"
3532
+ }
3533
+ ) }),
3534
+ /* @__PURE__ */ a("div", { className: "mtx-math-toolbar__buttons", children: [
3535
+ m.length > 0 && /* @__PURE__ */ a(Z, { children: [
3536
+ /* @__PURE__ */ e("div", { className: "mtx-math-toolbar__section-label", children: "Recent" }),
3537
+ m.map((p) => /* @__PURE__ */ e(
3538
+ st,
3539
+ {
3540
+ label: p.label,
3541
+ latex: p.latex,
3542
+ onClick: h,
3543
+ title: `Terakhir dipakai: ${p.title}`,
3544
+ variant: "recent"
3545
+ },
3546
+ `recent-${p.latex}`
3547
+ )),
3548
+ /* @__PURE__ */ e("div", { className: "mtx-math-toolbar__section-divider" })
3549
+ ] }),
3550
+ f.map((p) => /* @__PURE__ */ a("div", { className: "mtx-math-toolbar__section", children: [
3551
+ /* @__PURE__ */ a(
3552
+ "button",
3553
+ {
3554
+ type: "button",
3555
+ className: `mtx-math-toolbar__section-toggle ${r === p.label ? "is-active" : ""}`,
3556
+ onClick: () => P(p.label),
3557
+ "aria-expanded": r === p.label,
3558
+ "aria-label": `${p.label} group`,
3559
+ children: [
3560
+ /* @__PURE__ */ e("span", { children: p.label }),
3561
+ /* @__PURE__ */ e("svg", { width: "12", height: "12", viewBox: "0 0 12 12", fill: "none", "aria-hidden": "true", children: /* @__PURE__ */ e("path", { d: "M3 4.5 6 7.5 9 4.5", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }) })
3562
+ ]
3563
+ }
3564
+ ),
3565
+ r === p.label && p.buttons.map((g) => /* @__PURE__ */ e(
3566
+ st,
3567
+ {
3568
+ label: g.label,
3569
+ latex: g.latex,
3570
+ onClick: h,
3571
+ title: g.title
3572
+ },
3573
+ g.latex
3574
+ ))
3575
+ ] }, p.label)),
3576
+ k && f.length === 0 && /* @__PURE__ */ e("div", { className: "mtx-math-toolbar__empty", children: "No formula matches your search." })
3577
+ ] }),
3578
+ /* @__PURE__ */ a("div", { className: "mtx-math-toolbar__actions", children: [
3579
+ /* @__PURE__ */ a(
3580
+ "button",
3581
+ {
3582
+ type: "button",
3583
+ className: "mtx-math-toolbar__action-btn",
3584
+ onClick: t,
3585
+ title: "Panel Simbol (α β γ)",
3586
+ children: [
3587
+ /* @__PURE__ */ e("svg", { width: "14", height: "14", viewBox: "0 0 16 16", fill: "currentColor", children: /* @__PURE__ */ e("path", { d: "M6.2 2C4.2 2 3 3.8 3 5.5S4.2 9 6.2 9c.8 0 1.5-.3 2-.7L6.7 13h2.1l1.1-3.2C10.7 11 12 12 13 12v-2c-.8 0-1.8-.7-2.2-1.7L12 4H9.9l-.7 2.3C8.7 4.4 7.7 2 6.2 2zm0 2c.9 0 1.5 1.1 1.5 1.5S7 7 6.2 7 4.8 6.2 4.8 5.5 5.3 4 6.2 4z" }) }),
3588
+ /* @__PURE__ */ e("span", { children: "Simbol" })
3589
+ ]
3590
+ }
3591
+ ),
3592
+ l && /* @__PURE__ */ a(
3593
+ "button",
3594
+ {
3595
+ type: "button",
3596
+ className: "mtx-math-toolbar__action-btn",
3597
+ onClick: l,
3598
+ title: "Template Rumus",
3599
+ children: [
3600
+ /* @__PURE__ */ e("svg", { width: "14", height: "14", viewBox: "0 0 16 16", fill: "currentColor", children: /* @__PURE__ */ e("path", { d: "M2 2h5v5H2V2zm7 0h5v5H9V2zM2 9h5v5H2V9zm7 0h5v5H9V9zM3 3v3h3V3H3zm7 0v3h3V3h-3zM3 10v3h3v-3H3zm7 0v3h3v-3h-3z" }) }),
3601
+ /* @__PURE__ */ e("span", { children: "Template" })
3602
+ ]
3603
+ }
3604
+ )
3605
+ ] })
3606
+ ] });
3607
+ }
3608
+ const rt = [
3609
+ {
3610
+ name: "Huruf Yunani",
3611
+ symbols: [
3612
+ { char: "α", latex: "\\alpha", name: "alpha" },
3613
+ { char: "β", latex: "\\beta", name: "beta" },
3614
+ { char: "γ", latex: "\\gamma", name: "gamma" },
3615
+ { char: "δ", latex: "\\delta", name: "delta" },
3616
+ { char: "ε", latex: "\\epsilon", name: "epsilon" },
3617
+ { char: "ζ", latex: "\\zeta", name: "zeta" },
3618
+ { char: "η", latex: "\\eta", name: "eta" },
3619
+ { char: "θ", latex: "\\theta", name: "theta" },
3620
+ { char: "λ", latex: "\\lambda", name: "lambda" },
3621
+ { char: "μ", latex: "\\mu", name: "mu" },
3622
+ { char: "π", latex: "\\pi", name: "pi" },
3623
+ { char: "σ", latex: "\\sigma", name: "sigma" },
3624
+ { char: "τ", latex: "\\tau", name: "tau" },
3625
+ { char: "φ", latex: "\\phi", name: "phi" },
3626
+ { char: "ω", latex: "\\omega", name: "omega" },
3627
+ { char: "Δ", latex: "\\Delta", name: "Delta" },
3628
+ { char: "Σ", latex: "\\Sigma", name: "Sigma" },
3629
+ { char: "Ω", latex: "\\Omega", name: "Omega" },
3630
+ { char: "Π", latex: "\\Pi", name: "Pi" },
3631
+ { char: "Φ", latex: "\\Phi", name: "Phi" }
3632
+ ]
3633
+ },
3634
+ {
3635
+ name: "Operator",
3636
+ symbols: [
3637
+ { char: "±", latex: "\\pm", name: "plus minus" },
3638
+ { char: "∓", latex: "\\mp", name: "minus plus" },
3639
+ { char: "×", latex: "\\times", name: "kali" },
3640
+ { char: "÷", latex: "\\div", name: "bagi" },
3641
+ { char: "·", latex: "\\cdot", name: "dot" },
3642
+ { char: "∘", latex: "\\circ", name: "komposisi" },
3643
+ { char: "≠", latex: "\\neq", name: "tidak sama" },
3644
+ { char: "≈", latex: "\\approx", name: "kira-kira" },
3645
+ { char: "≡", latex: "\\equiv", name: "identik" },
3646
+ { char: "≤", latex: "\\leq", name: "kurang sama" },
3647
+ { char: "≥", latex: "\\geq", name: "lebih sama" },
3648
+ { char: "≪", latex: "\\ll", name: "jauh kurang" },
3649
+ { char: "≫", latex: "\\gg", name: "jauh lebih" },
3650
+ { char: "∝", latex: "\\propto", name: "sebanding" },
3651
+ { char: "∞", latex: "\\infty", name: "tak hingga" }
3652
+ ]
3653
+ },
3654
+ {
3655
+ name: "Himpunan",
3656
+ symbols: [
3657
+ { char: "∈", latex: "\\in", name: "anggota" },
3658
+ { char: "∉", latex: "\\notin", name: "bukan anggota" },
3659
+ { char: "⊂", latex: "\\subset", name: "subset" },
3660
+ { char: "⊃", latex: "\\supset", name: "superset" },
3661
+ { char: "⊆", latex: "\\subseteq", name: "subset sama" },
3662
+ { char: "∪", latex: "\\cup", name: "gabungan" },
3663
+ { char: "∩", latex: "\\cap", name: "irisan" },
3664
+ { char: "∅", latex: "\\emptyset", name: "himpunan kosong" },
3665
+ { char: "ℕ", latex: "\\mathbb{N}", name: "bilangan asli" },
3666
+ { char: "ℤ", latex: "\\mathbb{Z}", name: "bilangan bulat" },
3667
+ { char: "ℝ", latex: "\\mathbb{R}", name: "bilangan real" },
3668
+ { char: "ℚ", latex: "\\mathbb{Q}", name: "bilangan rasional" }
3669
+ ]
3670
+ },
3671
+ {
3672
+ name: "Panah",
3673
+ symbols: [
3674
+ { char: "→", latex: "\\to", name: "panah kanan" },
3675
+ { char: "←", latex: "\\leftarrow", name: "panah kiri" },
3676
+ { char: "↔", latex: "\\leftrightarrow", name: "panah dua arah" },
3677
+ { char: "⇒", latex: "\\Rightarrow", name: "implikasi" },
3678
+ { char: "⇐", latex: "\\Leftarrow", name: "implikasi balik" },
3679
+ { char: "⇔", latex: "\\Leftrightarrow", name: "biimplikasi" },
3680
+ { char: "↑", latex: "\\uparrow", name: "panah atas" },
3681
+ { char: "↓", latex: "\\downarrow", name: "panah bawah" }
3682
+ ]
3683
+ },
3684
+ {
3685
+ name: "Logika & Kalkulus",
3686
+ symbols: [
3687
+ { char: "∀", latex: "\\forall", name: "untuk semua" },
3688
+ { char: "∃", latex: "\\exists", name: "ada" },
3689
+ { char: "¬", latex: "\\neg", name: "negasi" },
3690
+ { char: "∧", latex: "\\land", name: "konjungsi (dan)" },
3691
+ { char: "∨", latex: "\\lor", name: "disjungsi (atau)" },
3692
+ { char: "∂", latex: "\\partial", name: "parsial" },
3693
+ { char: "∇", latex: "\\nabla", name: "nabla" },
3694
+ { char: "∑", latex: "\\sum", name: "sigma" },
3695
+ { char: "∏", latex: "\\prod", name: "produk" },
3696
+ { char: "∫", latex: "\\int", name: "integral" },
3697
+ { char: "∬", latex: "\\iint", name: "integral ganda" }
3698
+ ]
3699
+ }
3700
+ ];
3701
+ function Ma({ onInsert: n, onClose: t }) {
3702
+ const [l, i] = H(""), c = Ce(() => {
3703
+ if (!l.trim()) return rt;
3704
+ const r = l.toLowerCase();
3705
+ return rt.map((s) => ({
3706
+ ...s,
3707
+ symbols: s.symbols.filter(
3708
+ (o) => o.name.toLowerCase().includes(r) || o.char.includes(r) || o.latex.toLowerCase().includes(r)
3709
+ )
3710
+ })).filter((s) => s.symbols.length > 0);
3711
+ }, [l]);
3712
+ return /* @__PURE__ */ a("div", { className: "mtx-symbol-palette", role: "dialog", "aria-label": "Symbol Palette", children: [
3713
+ /* @__PURE__ */ a("div", { className: "mtx-symbol-palette__header", children: [
3714
+ /* @__PURE__ */ e("span", { className: "mtx-symbol-palette__title", children: "Simbol Matematika" }),
3715
+ /* @__PURE__ */ e(
3716
+ "button",
3717
+ {
3718
+ className: "mtx-symbol-palette__close",
3719
+ onClick: t,
3720
+ title: "Tutup",
3721
+ "aria-label": "Tutup panel simbol",
3722
+ children: "×"
3723
+ }
3724
+ )
3725
+ ] }),
3726
+ /* @__PURE__ */ e(
3727
+ "input",
3728
+ {
3729
+ className: "mtx-symbol-palette__search",
3730
+ type: "text",
3731
+ placeholder: "Cari simbol... (cth: alpha, pi, integral)",
3732
+ value: l,
3733
+ onChange: (r) => i(r.target.value),
3734
+ autoFocus: !0
3735
+ }
3736
+ ),
3737
+ /* @__PURE__ */ a("div", { className: "mtx-symbol-palette__body", children: [
3738
+ c.length === 0 && /* @__PURE__ */ a("div", { style: { padding: "20px", textAlign: "center", color: "#94a3b8", fontSize: "13px" }, children: [
3739
+ 'Tidak ditemukan simbol untuk "',
3740
+ l,
3741
+ '"'
3742
+ ] }),
3743
+ c.map((r) => /* @__PURE__ */ a("div", { className: "mtx-symbol-palette__category", children: [
3744
+ /* @__PURE__ */ e("div", { className: "mtx-symbol-palette__category-title", children: r.name }),
3745
+ /* @__PURE__ */ e("div", { className: "mtx-symbol-palette__grid", children: r.symbols.map((s) => /* @__PURE__ */ e(
3746
+ "button",
3747
+ {
3748
+ className: "mtx-symbol-palette__item",
3749
+ onClick: () => {
3750
+ n(s.latex), t();
3751
+ },
3752
+ title: `${s.name} (${s.latex})`,
3753
+ "aria-label": s.name,
3754
+ children: s.char
3755
+ },
3756
+ s.latex
3757
+ )) })
3758
+ ] }, r.name))
3759
+ ] })
3760
+ ] });
3761
+ }
3762
+ const Ha = /<(p|h[1-4]|li)\b([^>]*)>/gi;
3763
+ function ct(n, t, l) {
3764
+ const i = new RegExp(`\\s${t}=(['"]).*?\\1`, "i");
3765
+ return i.test(n) ? n.replace(i, ` ${t}="${l}"`) : `${n} ${t}="${l}"`;
3766
+ }
3767
+ function Je(n) {
3768
+ return n.replace(Ha, (t, l, i = "") => {
3769
+ var u;
3770
+ const c = i.match(/\sclass=(['"])(.*?)\1/i), r = i.match(/\sdata-indent=(['"])(\d+)\1/i), o = ((u = c == null ? void 0 : c[2].match(/(?:^|\s)tt-indent-(\d+)(?:\s|$)/)) == null ? void 0 : u[1]) || (r == null ? void 0 : r[2]);
3771
+ if (!o)
3772
+ return t;
3773
+ const N = new Set(((c == null ? void 0 : c[2]) || "").split(/\s+/).filter(Boolean));
3774
+ N.add("tt-indent"), N.add(`tt-indent-${o}`);
3775
+ let y = i;
3776
+ return y = ct(y, "class", Array.from(N).join(" ")), y = ct(y, "data-indent", o), `<${l}${y}>`;
3777
+ });
3778
+ }
3779
+ function ot(n) {
3780
+ return Je(n.getHTML());
3781
+ }
3782
+ function mn(n) {
3783
+ return n.getJSON();
3784
+ }
3785
+ function La(n) {
3786
+ if (!n) return "";
3787
+ let t = n;
3788
+ return t = t.replace(/\s*data-cke-[a-z-]*="[^"]*"/gi, ""), t = t.replace(/\s*contenteditable="[^"]*"/gi, ""), t = t.replace(/<span[^>]*class="[^"]*cke_widget[^"]*"[^>]*>/gi, ""), t = t.replace(/<\/span>/gi, (l) => l), t = t.replace(
3789
+ /<img[^>]*class="[^"]*Wirisformula[^"]*"[^>]*data-mathml="([^"]*)"[^>]*\/?>/gi,
3790
+ (l, i) => {
3791
+ const c = decodeURIComponent(i);
3792
+ return `<span class="mtx-math-inline" data-mathml="${encodeURIComponent(c)}">${c}</span>`;
3793
+ }
3794
+ ), Je(t);
3795
+ }
3796
+ function dn(n) {
3797
+ if (!n) return "";
3798
+ let t = n;
3799
+ return t = t.replace(
3800
+ /<span[^>]*class="mtx-math[^"]*"[^>]*data-latex="([^"]*)"[^>]*>.*?<\/span>/gi,
3801
+ (l, i) => `<span class="mtx-math-inline" data-latex="${i}">\\(${i}\\)</span>`
3802
+ ), Je(t);
3803
+ }
3804
+ function _a(n) {
3805
+ return n.replace(/class="MsoNormal"/g, "").replace(/class="MsoListParagraph"/g, "").replace(/style="[^"]*mso-[^"]*"/g, "").replace(/<!--\[if[\s\S]*?<!\[endif\]-->/g, "").replace(/<o:p>.*?<\/o:p>/g, "").replace(/<w:.*?>.*?<\/w:.*?>/g, "").replace(/<style[\s\S]*?<\/style>/g, "").replace(/<meta[\s\S]*?>/g, "").replace(/\n/g, "<br>");
3806
+ }
3807
+ function za(n) {
3808
+ return n.replace(/class="[^"]*kix-[^"]*"/g, "").replace(/style="[^"]*direction:[^"]*"/g, "").replace(/<b style="font-weight:normal"/g, "<span").replace(/<span style="font-weight:normal"/g, "<span");
3809
+ }
3810
+ function Sa(n, t) {
3811
+ var c, r;
3812
+ const l = (c = t.clipboardData) == null ? void 0 : c.getData("text/html"), i = (r = t.clipboardData) == null ? void 0 : r.getData("text/plain");
3813
+ if (!l && i)
3814
+ return !1;
3815
+ if (l) {
3816
+ if (l.includes("mso-") || l.includes("MsoNormal") || l.includes("<o:p>")) {
3817
+ t.preventDefault();
3818
+ const s = _a(l);
3819
+ return n.chain().focus().insertContent(s).run(), !0;
3820
+ }
3821
+ if (l.includes("kix-") || l.includes("docs-internal-guide")) {
3822
+ t.preventDefault();
3823
+ const s = za(l);
3824
+ return n.chain().focus().insertContent(s).run(), !0;
3825
+ }
3826
+ }
3827
+ return !1;
3828
+ }
3829
+ function Da(n, t) {
3830
+ var i;
3831
+ const l = t;
3832
+ if (l.shiftKey && (l.ctrlKey || l.metaKey)) {
3833
+ t.preventDefault();
3834
+ const c = (i = t.clipboardData) == null ? void 0 : i.getData("text/plain");
3835
+ if (c)
3836
+ return n.chain().focus().insertContent(c).run(), !0;
3837
+ }
3838
+ return !1;
3839
+ }
3840
+ function mt(n) {
3841
+ let t = 0;
3842
+ return n.descendants((l) => {
3843
+ var i;
3844
+ l.isText && (t += ((i = l.text) == null ? void 0 : i.split(/\s+/).filter((c) => c.length > 0).length) || 0);
3845
+ }), t;
3846
+ }
3847
+ function dt(n, t = !0) {
3848
+ var i;
3849
+ let l = 0;
3850
+ return n.descendants((c) => {
3851
+ var r;
3852
+ c.isText && (l += ((r = c.text) == null ? void 0 : r.length) || 0);
3853
+ }), t ? l : l - (((i = n.textContent) == null ? void 0 : i.split(" ").length) - 1 || 0);
3854
+ }
3855
+ const Ba = 120, Pa = oe.memo(({ editor: n }) => {
3856
+ const [t, l] = H({ words: 0, chars: 0 }), i = R(null);
3857
+ return X(() => {
3858
+ if (!n) return;
3859
+ const c = () => {
3860
+ i.current && clearTimeout(i.current), i.current = setTimeout(() => {
3861
+ l({
3862
+ words: mt(n.state.doc),
3863
+ chars: dt(n.state.doc, !0)
3864
+ });
3865
+ }, Ba);
3866
+ };
3867
+ return l({
3868
+ words: mt(n.state.doc),
3869
+ chars: dt(n.state.doc, !0)
3870
+ }), n.on("transaction", c), () => {
3871
+ n.off("transaction", c), i.current && clearTimeout(i.current);
3872
+ };
3873
+ }, [n]), /* @__PURE__ */ a("div", { className: "mtx-word-count", children: [
3874
+ /* @__PURE__ */ a("span", { children: [
3875
+ t.words,
3876
+ " ",
3877
+ t.words === 1 ? "word" : "words"
3878
+ ] }),
3879
+ /* @__PURE__ */ a("span", { children: [
3880
+ t.chars,
3881
+ " ",
3882
+ t.chars === 1 ? "character" : "characters"
3883
+ ] })
3884
+ ] });
3885
+ }), Va = [
3886
+ "button:not([disabled])",
3887
+ "[href]",
3888
+ "input:not([disabled])",
3889
+ "select:not([disabled])",
3890
+ "textarea:not([disabled])",
3891
+ '[tabindex]:not([tabindex="-1"])'
3892
+ ].join(", ");
3893
+ function ht(n) {
3894
+ return Array.from(n.querySelectorAll(Va)).filter(
3895
+ (t) => !t.hasAttribute("disabled") && t.getAttribute("aria-hidden") !== "true"
3896
+ );
3897
+ }
3898
+ function Ra({
3899
+ isOpen: n,
3900
+ dialogRef: t,
3901
+ onClose: l
3902
+ }) {
3903
+ X(() => {
3904
+ if (!n || !t.current) return;
3905
+ const i = t.current, c = document.activeElement instanceof HTMLElement ? document.activeElement : null, r = ht(i);
3906
+ (r.find((N) => N.hasAttribute("autofocus")) || r[0] || i).focus();
3907
+ const o = (N) => {
3908
+ if (N.key === "Escape") {
3909
+ N.preventDefault(), l();
3910
+ return;
3911
+ }
3912
+ if (N.key !== "Tab") return;
3913
+ const y = ht(i);
3914
+ if (y.length === 0) {
3915
+ N.preventDefault(), i.focus();
3916
+ return;
3917
+ }
3918
+ const u = y[0], h = y[y.length - 1], m = document.activeElement;
3919
+ if (N.shiftKey) {
3920
+ (m === u || m === i) && (N.preventDefault(), h.focus());
3921
+ return;
3922
+ }
3923
+ m === h && (N.preventDefault(), u.focus());
3924
+ };
3925
+ return document.addEventListener("keydown", o), () => {
3926
+ document.removeEventListener("keydown", o), c == null || c.focus();
3927
+ };
3928
+ }, [t, n, l]);
3929
+ }
3930
+ const Ge = {
3931
+ width: 720,
3932
+ height: "auto",
3933
+ align: "center",
3934
+ alt: "",
3935
+ title: "",
3936
+ maintainAspectRatio: !0
3937
+ };
3938
+ function Ia({
3939
+ isOpen: n,
3940
+ onClose: t,
3941
+ onApply: l,
3942
+ initialData: i
3943
+ }) {
3944
+ const c = Lt(), r = R(null), [s, o] = H({ ...Ge, ...i });
3945
+ X(() => {
3946
+ i && o({ ...Ge, ...i });
3947
+ }, [i]), Ra({ isOpen: n, dialogRef: r, onClose: t });
3948
+ const N = b((m) => {
3949
+ o((k) => (k.maintainAspectRatio, { ...k, width: m }));
3950
+ }, []), y = b((m) => {
3951
+ o((k) => (k.maintainAspectRatio, { ...k, height: m }));
3952
+ }, []), u = b(() => {
3953
+ l(s), t();
3954
+ }, [s, l, t]), h = b(() => {
3955
+ o({ ...Ge, ...i });
3956
+ }, [i]);
3957
+ return n ? /* @__PURE__ */ a(Z, { children: [
3958
+ /* @__PURE__ */ e("div", { className: "mtx-dialog-overlay", onClick: t }),
3959
+ /* @__PURE__ */ a("div", { className: "mtx-image-edit-dialog", ref: r, role: "dialog", "aria-modal": "true", "aria-labelledby": c, tabIndex: -1, children: [
3960
+ /* @__PURE__ */ a("div", { className: "mtx-image-edit-dialog__header", children: [
3961
+ /* @__PURE__ */ e("h3", { id: c, children: "Edit Gambar" }),
3962
+ /* @__PURE__ */ e(
3963
+ "button",
3964
+ {
3965
+ className: "mtx-image-edit-dialog__close",
3966
+ onClick: t,
3967
+ "aria-label": "Tutup",
3968
+ children: "✕"
3969
+ }
3970
+ )
3971
+ ] }),
3972
+ /* @__PURE__ */ a("div", { className: "mtx-image-edit-dialog__body", children: [
3973
+ /* @__PURE__ */ a("div", { className: "mtx-image-edit-dialog__section", children: [
3974
+ /* @__PURE__ */ e("h4", { children: "Ukuran" }),
3975
+ /* @__PURE__ */ a("div", { className: "mtx-image-edit-dialog__row", children: [
3976
+ /* @__PURE__ */ e("label", { children: "Lebar (px atau %)" }),
3977
+ /* @__PURE__ */ e(
3978
+ "input",
3979
+ {
3980
+ type: "text",
3981
+ value: s.width,
3982
+ onChange: (m) => N(m.target.value),
3983
+ placeholder: "100% atau 300"
3984
+ }
3985
+ )
3986
+ ] }),
3987
+ /* @__PURE__ */ a("div", { className: "mtx-image-edit-dialog__row", children: [
3988
+ /* @__PURE__ */ e("label", { children: "Tinggi (px atau auto)" }),
3989
+ /* @__PURE__ */ e(
3990
+ "input",
3991
+ {
3992
+ type: "text",
3993
+ value: s.height,
3994
+ onChange: (m) => y(m.target.value),
3995
+ placeholder: "auto atau 200"
3996
+ }
3997
+ )
3998
+ ] }),
3999
+ /* @__PURE__ */ a("div", { className: "mtx-image-edit-dialog__checkbox-row", children: [
4000
+ /* @__PURE__ */ e(
4001
+ "input",
4002
+ {
4003
+ type: "checkbox",
4004
+ id: "maintain-aspect",
4005
+ checked: s.maintainAspectRatio,
4006
+ onChange: (m) => o((k) => ({ ...k, maintainAspectRatio: m.target.checked }))
4007
+ }
4008
+ ),
4009
+ /* @__PURE__ */ e("label", { htmlFor: "maintain-aspect", children: "Pertahankan proporsi" })
4010
+ ] }),
4011
+ /* @__PURE__ */ a("div", { className: "mtx-image-edit-dialog__size-presets", children: [
4012
+ /* @__PURE__ */ e("button", { onClick: () => N("25%"), className: "mtx-btn-sm", children: "25%" }),
4013
+ /* @__PURE__ */ e("button", { onClick: () => N("50%"), className: "mtx-btn-sm", children: "50%" }),
4014
+ /* @__PURE__ */ e("button", { onClick: () => N("75%"), className: "mtx-btn-sm", children: "75%" }),
4015
+ /* @__PURE__ */ e("button", { onClick: () => N("100%"), className: "mtx-btn-sm", children: "100%" })
4016
+ ] })
4017
+ ] }),
4018
+ /* @__PURE__ */ a("div", { className: "mtx-image-edit-dialog__section", children: [
4019
+ /* @__PURE__ */ e("h4", { children: "Posisi & Alignment" }),
4020
+ /* @__PURE__ */ a("div", { className: "mtx-image-edit-dialog__alignment-options", children: [
4021
+ /* @__PURE__ */ a(
4022
+ "button",
4023
+ {
4024
+ className: `mtx-align-btn ${s.align === "left" ? "is-active" : ""}`,
4025
+ onClick: () => o((m) => ({ ...m, align: "left" })),
4026
+ title: "Kiri (Text Wrapping)",
4027
+ children: [
4028
+ /* @__PURE__ */ a("svg", { width: "24", height: "24", viewBox: "0 0 24 24", fill: "currentColor", children: [
4029
+ /* @__PURE__ */ e("rect", { x: "3", y: "5", width: "8", height: "14", rx: "1", fill: "currentColor", opacity: "0.5" }),
4030
+ /* @__PURE__ */ e("line", { x1: "13", y1: "7", x2: "21", y2: "7", stroke: "currentColor", strokeWidth: "2" }),
4031
+ /* @__PURE__ */ e("line", { x1: "13", y1: "11", x2: "21", y2: "11", stroke: "currentColor", strokeWidth: "2" }),
4032
+ /* @__PURE__ */ e("line", { x1: "13", y1: "15", x2: "21", y2: "15", stroke: "currentColor", strokeWidth: "2" }),
4033
+ /* @__PURE__ */ e("line", { x1: "13", y1: "19", x2: "18", y2: "19", stroke: "currentColor", strokeWidth: "2" })
4034
+ ] }),
4035
+ /* @__PURE__ */ e("span", { children: "Kiri" })
4036
+ ]
4037
+ }
4038
+ ),
4039
+ /* @__PURE__ */ a(
4040
+ "button",
4041
+ {
4042
+ className: `mtx-align-btn ${s.align === "center" ? "is-active" : ""}`,
4043
+ onClick: () => o((m) => ({ ...m, align: "center" })),
4044
+ title: "Tengah",
4045
+ children: [
4046
+ /* @__PURE__ */ e("svg", { width: "24", height: "24", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ e("rect", { x: "8", y: "5", width: "8", height: "14", rx: "1", fill: "currentColor", opacity: "0.5" }) }),
4047
+ /* @__PURE__ */ e("span", { children: "Tengah" })
4048
+ ]
4049
+ }
4050
+ ),
4051
+ /* @__PURE__ */ a(
4052
+ "button",
4053
+ {
4054
+ className: `mtx-align-btn ${s.align === "right" ? "is-active" : ""}`,
4055
+ onClick: () => o((m) => ({ ...m, align: "right" })),
4056
+ title: "Kanan (Text Wrapping)",
4057
+ children: [
4058
+ /* @__PURE__ */ a("svg", { width: "24", height: "24", viewBox: "0 0 24 24", fill: "currentColor", children: [
4059
+ /* @__PURE__ */ e("rect", { x: "13", y: "5", width: "8", height: "14", rx: "1", fill: "currentColor", opacity: "0.5" }),
4060
+ /* @__PURE__ */ e("line", { x1: "3", y1: "7", x2: "11", y2: "7", stroke: "currentColor", strokeWidth: "2" }),
4061
+ /* @__PURE__ */ e("line", { x1: "3", y1: "11", x2: "11", y2: "11", stroke: "currentColor", strokeWidth: "2" }),
4062
+ /* @__PURE__ */ e("line", { x1: "3", y1: "15", x2: "11", y2: "15", stroke: "currentColor", strokeWidth: "2" }),
4063
+ /* @__PURE__ */ e("line", { x1: "3", y1: "19", x2: "8", y2: "19", stroke: "currentColor", strokeWidth: "2" })
4064
+ ] }),
4065
+ /* @__PURE__ */ e("span", { children: "Kanan" })
4066
+ ]
4067
+ }
4068
+ ),
4069
+ /* @__PURE__ */ a(
4070
+ "button",
4071
+ {
4072
+ className: `mtx-align-btn ${s.align === "full" ? "is-active" : ""}`,
4073
+ onClick: () => o((m) => ({ ...m, align: "full" })),
4074
+ title: "Full Width",
4075
+ children: [
4076
+ /* @__PURE__ */ e("svg", { width: "24", height: "24", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ e("rect", { x: "3", y: "5", width: "18", height: "14", rx: "1", fill: "currentColor", opacity: "0.5" }) }),
4077
+ /* @__PURE__ */ e("span", { children: "Full" })
4078
+ ]
4079
+ }
4080
+ )
4081
+ ] }),
4082
+ /* @__PURE__ */ e("div", { className: "mtx-image-edit-dialog__hint", children: /* @__PURE__ */ a("p", { children: [
4083
+ "💡 ",
4084
+ /* @__PURE__ */ e("strong", { children: "Tip:" }),
4085
+ ' Pilih "Kiri" atau "Kanan" untuk text wrapping'
4086
+ ] }) })
4087
+ ] }),
4088
+ /* @__PURE__ */ a("div", { className: "mtx-image-edit-dialog__section", children: [
4089
+ /* @__PURE__ */ e("h4", { children: "Aksesibilitas" }),
4090
+ /* @__PURE__ */ a("div", { className: "mtx-image-edit-dialog__row", children: [
4091
+ /* @__PURE__ */ e("label", { children: "Alt Text (deskripsi untuk screen readers)" }),
4092
+ /* @__PURE__ */ e(
4093
+ "input",
4094
+ {
4095
+ type: "text",
4096
+ value: s.alt,
4097
+ onChange: (m) => o((k) => ({ ...k, alt: m.target.value })),
4098
+ placeholder: "Deskripsi gambar..."
4099
+ }
4100
+ )
4101
+ ] }),
4102
+ /* @__PURE__ */ a("div", { className: "mtx-image-edit-dialog__row", children: [
4103
+ /* @__PURE__ */ e("label", { children: "Title (tooltip saat hover)" }),
4104
+ /* @__PURE__ */ e(
4105
+ "input",
4106
+ {
4107
+ type: "text",
4108
+ value: s.title,
4109
+ onChange: (m) => o((k) => ({ ...k, title: m.target.value })),
4110
+ placeholder: "Judul gambar..."
4111
+ }
4112
+ )
4113
+ ] })
4114
+ ] })
4115
+ ] }),
4116
+ /* @__PURE__ */ a("div", { className: "mtx-image-edit-dialog__footer", children: [
4117
+ /* @__PURE__ */ e("button", { className: "mtx-image-edit-dialog__btn mtx-image-edit-dialog__btn--reset", onClick: h, children: "Reset" }),
4118
+ /* @__PURE__ */ a("div", { className: "mtx-image-edit-dialog__actions", children: [
4119
+ /* @__PURE__ */ e("button", { className: "mtx-image-edit-dialog__btn mtx-image-edit-dialog__btn--cancel", onClick: t, children: "Batal" }),
4120
+ /* @__PURE__ */ e("button", { className: "mtx-image-edit-dialog__btn mtx-image-edit-dialog__btn--apply", onClick: u, children: "Terapkan" })
4121
+ ] })
4122
+ ] })
4123
+ ] })
4124
+ ] }) : null;
4125
+ }
4126
+ const Ea = le(() => import("./TemplatePanel-BE_UfzYM.js").then((n) => ({ default: n.TemplatePanel }))), Ka = le(() => Promise.resolve().then(() => da).then((n) => ({ default: n.MathTypeDialog }))), $a = le(() => import("./ImageInsertDialog-Di0MXcC2.js").then((n) => ({ default: n.ImageInsertDialog })));
4127
+ async function Xe(n) {
4128
+ return new Promise((t, l) => {
4129
+ const i = new window.Image();
4130
+ i.onload = () => {
4131
+ t({
4132
+ width: i.naturalWidth || i.width,
4133
+ height: i.naturalHeight || i.height
4134
+ });
4135
+ }, i.onerror = () => l(new Error("Image load failed")), i.src = n;
4136
+ });
4137
+ }
4138
+ function Se(n, t) {
4139
+ const l = n && n > 0 ? n : 720, i = Math.max(240, l - 32);
4140
+ return Math.max(120, Math.min(t, i));
4141
+ }
4142
+ function Pe(n, t, l) {
4143
+ return {
4144
+ src: n,
4145
+ alt: t,
4146
+ width: l,
4147
+ height: "auto",
4148
+ offsetX: 0,
4149
+ offsetY: 0,
4150
+ align: "center"
4151
+ };
4152
+ }
4153
+ function Ve(n) {
4154
+ var c;
4155
+ const { selection: t } = n.state, l = t.node;
4156
+ if (((c = l == null ? void 0 : l.type) == null ? void 0 : c.name) === "image")
4157
+ return {
4158
+ node: { attrs: l.attrs || {} },
4159
+ pos: t.from
4160
+ };
4161
+ const i = t.$from.parent;
4162
+ return i.type.name === "image" ? {
4163
+ node: i,
4164
+ pos: t.$from.before()
4165
+ } : null;
4166
+ }
4167
+ const Oa = 150;
4168
+ function hn({
4169
+ content: n = "",
4170
+ onChange: t,
4171
+ onSave: l,
4172
+ editable: i = !0,
4173
+ placeholder: c = "Tulis soal di sini...",
4174
+ toolbarMode: r,
4175
+ className: s,
4176
+ minHeight: o = "200px",
4177
+ maxHeight: N,
4178
+ autoFocus: y = !1,
4179
+ onImageUpload: u
4180
+ }) {
4181
+ const [h, m] = H(!1), [k, f] = H(!1), [P, p] = H(!1), [g, w] = H(!1), [B, _] = H(!1), [W, q] = H(null), [ie, fe] = H("frac"), ae = R(null), me = R(null), Ae = La(n), C = Zt({
4182
+ extensions: [
4183
+ ...oa({ placeholder: c }),
4184
+ ua,
4185
+ pa
4186
+ ],
4187
+ content: Ae,
4188
+ editable: i,
4189
+ autofocus: y ? "end" : !1,
4190
+ immediatelyRender: !1,
4191
+ shouldRerenderOnTransaction: !1,
4192
+ // Debounced onChange — avoids getHTML() serialization on every keystroke
4193
+ onUpdate: ({ editor: v }) => {
4194
+ me.current && clearTimeout(me.current), me.current = setTimeout(() => {
4195
+ const T = ot(v);
4196
+ t == null || t(T);
4197
+ }, Oa);
4198
+ },
4199
+ editorProps: {
4200
+ handleKeyDown: (v, T) => {
4201
+ if ((T.ctrlKey || T.metaKey) && T.key === "s")
4202
+ return T.preventDefault(), C && (l == null || l(ot(C))), !0;
4203
+ if ((T.ctrlKey || T.metaKey) && T.key === "k") {
4204
+ T.preventDefault();
4205
+ const D = document.querySelector('[aria-label="Link"]');
4206
+ return D && D.click(), !0;
4207
+ }
4208
+ if ((T.ctrlKey || T.metaKey) && T.shiftKey && T.key === "T") {
4209
+ T.preventDefault();
4210
+ const D = document.querySelector('[aria-label="Table"]');
4211
+ return D && D.click(), !0;
4212
+ }
4213
+ return !1;
4214
+ },
4215
+ handleDrop: (v, T) => {
4216
+ var $;
4217
+ const D = ($ = T.dataTransfer) == null ? void 0 : $.files;
4218
+ if (D && D.length > 0) {
4219
+ const F = D[0];
4220
+ if (F.type.startsWith("image/"))
4221
+ return T.preventDefault(), G(F), !0;
4222
+ }
4223
+ return !1;
4224
+ },
4225
+ handlePaste: (v, T) => {
4226
+ var $;
4227
+ const D = ($ = T.clipboardData) == null ? void 0 : $.items;
4228
+ if (D) {
4229
+ for (const F of D)
4230
+ if (F.type.startsWith("image/")) {
4231
+ T.preventDefault();
4232
+ const x = F.getAsFile();
4233
+ return x && G(x), !0;
4234
+ }
4235
+ }
4236
+ return !!(C && Da(C, T) || C && Sa(C, T));
4237
+ }
4238
+ }
4239
+ }), j = b(
4240
+ (v = "") => {
4241
+ C && C.chain().focus().insertContent({
4242
+ type: "mathInline",
4243
+ attrs: { latex: v, display: "inline" }
4244
+ }).run();
4245
+ },
4246
+ [C]
4247
+ ), de = b(
4248
+ (v = "") => {
4249
+ C && C.chain().focus().insertContent({
4250
+ type: "mathBlock",
4251
+ attrs: { latex: v, display: "block" }
4252
+ }).run();
4253
+ },
4254
+ [C]
4255
+ ), Ne = b(
4256
+ (v) => {
4257
+ j(v);
4258
+ },
4259
+ [j]
4260
+ ), ne = b(
4261
+ (v) => {
4262
+ j(v);
4263
+ },
4264
+ [j]
4265
+ ), pe = b(
4266
+ (v) => {
4267
+ v.includes("\\begin{") || v.includes("\\frac") || v.length > 30 ? de(v) : j(v);
4268
+ },
4269
+ [j, de]
4270
+ ), ye = b(
4271
+ (v) => {
4272
+ v.includes("\\begin{") || v.length > 40 ? de(v) : j(v);
4273
+ },
4274
+ [j, de]
4275
+ ), ge = b(
4276
+ async (v, T) => {
4277
+ var $, F;
4278
+ if (!C) return;
4279
+ let D;
4280
+ try {
4281
+ const x = await Xe(v);
4282
+ D = Se(($ = ae.current) == null ? void 0 : $.clientWidth, x.width);
4283
+ } catch {
4284
+ D = Se((F = ae.current) == null ? void 0 : F.clientWidth, 720);
4285
+ }
4286
+ C.chain().focus().insertContent({ type: "image", attrs: Pe(v, T || "", D) }).run();
4287
+ },
4288
+ [C]
4289
+ ), G = b(
4290
+ async (v) => {
4291
+ var T;
4292
+ if (C)
4293
+ if (u)
4294
+ try {
4295
+ const D = await u(v), $ = await Xe(D), F = Se((T = ae.current) == null ? void 0 : T.clientWidth, $.width);
4296
+ C.chain().focus().insertContent({ type: "image", attrs: Pe(D, "", F) }).run();
4297
+ } catch {
4298
+ console.error("Image upload failed");
4299
+ }
4300
+ else {
4301
+ const D = new FileReader();
4302
+ D.onload = () => {
4303
+ const $ = D.result;
4304
+ Xe($).then((F) => {
4305
+ var V;
4306
+ const x = Se((V = ae.current) == null ? void 0 : V.clientWidth, F.width);
4307
+ C.chain().focus().insertContent({ type: "image", attrs: Pe($, "", x) }).run();
4308
+ }).catch(() => {
4309
+ var x;
4310
+ const F = Se((x = ae.current) == null ? void 0 : x.clientWidth, 720);
4311
+ C.chain().focus().insertContent({ type: "image", attrs: Pe($, "", F) }).run();
4312
+ });
4313
+ }, D.readAsDataURL(v);
4314
+ }
4315
+ },
4316
+ [C, u]
4317
+ ), Me = b(() => {
4318
+ if (!C) return;
4319
+ const v = Ve(C);
4320
+ if (!v) return;
4321
+ const T = {
4322
+ width: v.node.attrs.width || 720,
4323
+ height: v.node.attrs.height || "auto",
4324
+ align: v.node.attrs.align || "center",
4325
+ alt: String(v.node.attrs.alt || ""),
4326
+ title: String(v.node.attrs.title || ""),
4327
+ maintainAspectRatio: !0
4328
+ };
4329
+ q(T), _(!0);
4330
+ }, [C]), he = b(
4331
+ (v) => {
4332
+ if (!C) return;
4333
+ const T = Ve(C);
4334
+ if (!T) return;
4335
+ const D = C.state.tr;
4336
+ D.setNodeMarkup(T.pos, void 0, {
4337
+ ...T.node.attrs,
4338
+ width: v.width,
4339
+ height: v.height,
4340
+ align: v.align,
4341
+ alt: v.alt,
4342
+ title: v.title
4343
+ }), C.view.dispatch(D), _(!1), q(null);
4344
+ },
4345
+ [C]
4346
+ ), ve = b(
4347
+ (v) => {
4348
+ if (!C) return;
4349
+ const T = Ve(C);
4350
+ if (!T) return;
4351
+ const D = C.state.tr;
4352
+ D.setNodeMarkup(T.pos, void 0, {
4353
+ ...T.node.attrs,
4354
+ align: v,
4355
+ offsetX: 0,
4356
+ offsetY: 0
4357
+ }), C.view.dispatch(D);
4358
+ },
4359
+ [C]
4360
+ ), Q = b(() => {
4361
+ if (!C) return;
4362
+ const v = Ve(C);
4363
+ if (!v) return;
4364
+ const T = C.state.tr;
4365
+ T.setNodeMarkup(v.pos, void 0, {
4366
+ ...v.node.attrs,
4367
+ offsetX: 0,
4368
+ offsetY: 0
4369
+ }), C.view.dispatch(T);
4370
+ }, [C]);
4371
+ return /* @__PURE__ */ a(
4372
+ "div",
4373
+ {
4374
+ className: `mtx-editor ${s || ""}`,
4375
+ ref: ae,
4376
+ style: {
4377
+ "--mtx-min-height": o,
4378
+ "--mtx-max-height": N || "none"
4379
+ },
4380
+ children: [
4381
+ i && /* @__PURE__ */ e(
4382
+ Ca,
4383
+ {
4384
+ editor: C,
4385
+ toolbarMode: r,
4386
+ onInsertMath: (v = "frac") => {
4387
+ fe(v), p(!0);
4388
+ },
4389
+ onInsertImage: () => w(!0),
4390
+ onEditImage: Me,
4391
+ onSetImageAlign: ve,
4392
+ onResetImagePosition: Q
4393
+ }
4394
+ ),
4395
+ i && /* @__PURE__ */ a("div", { style: { position: "relative" }, children: [
4396
+ /* @__PURE__ */ e(
4397
+ Aa,
4398
+ {
4399
+ onInsertLatex: Ne,
4400
+ onToggleSymbols: () => {
4401
+ m(!h), f(!1);
4402
+ },
4403
+ onToggleTemplates: () => {
4404
+ f(!k), m(!1);
4405
+ }
4406
+ }
4407
+ ),
4408
+ h && /* @__PURE__ */ e(
4409
+ Ma,
4410
+ {
4411
+ onInsert: ne,
4412
+ onClose: () => m(!1)
4413
+ }
4414
+ ),
4415
+ k && /* @__PURE__ */ e(te, { fallback: /* @__PURE__ */ e("div", { className: "mtx-lazy-loading", children: "Loading..." }), children: /* @__PURE__ */ e(
4416
+ Ea,
4417
+ {
4418
+ onInsert: pe,
4419
+ onClose: () => f(!1)
4420
+ }
4421
+ ) })
4422
+ ] }),
4423
+ /* @__PURE__ */ e(
4424
+ "div",
4425
+ {
4426
+ id: "mtx-editor-content",
4427
+ className: "mtx-content",
4428
+ style: {
4429
+ minHeight: o,
4430
+ maxHeight: N || void 0,
4431
+ overflowY: N ? "auto" : void 0
4432
+ },
4433
+ children: /* @__PURE__ */ e(Qt, { editor: C })
4434
+ }
4435
+ ),
4436
+ C && /* @__PURE__ */ e(Pa, { editor: C }),
4437
+ P && /* @__PURE__ */ e(te, { fallback: null, children: /* @__PURE__ */ e(
4438
+ Ka,
4439
+ {
4440
+ isOpen: P,
4441
+ initialTab: ie,
4442
+ onInsert: ye,
4443
+ onClose: () => p(!1)
4444
+ }
4445
+ ) }),
4446
+ g && /* @__PURE__ */ e(te, { fallback: null, children: /* @__PURE__ */ e(
4447
+ $a,
4448
+ {
4449
+ isOpen: g,
4450
+ onClose: () => w(!1),
4451
+ onInsert: ge,
4452
+ onImageUpload: u
4453
+ }
4454
+ ) }),
4455
+ B && W && /* @__PURE__ */ e(te, { fallback: null, children: /* @__PURE__ */ e(
4456
+ Ia,
4457
+ {
4458
+ isOpen: B,
4459
+ onClose: () => {
4460
+ _(!1), q(null);
4461
+ },
4462
+ onApply: he,
4463
+ initialData: W
4464
+ }
4465
+ ) })
4466
+ ]
4467
+ }
4468
+ );
4469
+ }
4470
+ const Fa = le(() => import("./LinkDialogImpl-BSz0F-xG.js").then((n) => ({ default: n.LinkDialogImpl }))), Wa = oe.memo(function(t) {
4471
+ return /* @__PURE__ */ e(te, { fallback: null, children: /* @__PURE__ */ e(Fa, { ...t }) });
4472
+ });
4473
+ Wa.displayName = "LinkDialog";
4474
+ const qa = le(() => import("./InsertTableDialogImpl-CKirXRqE.js").then((n) => ({ default: n.InsertTableDialogImpl }))), Ga = oe.memo(function(t) {
4475
+ return /* @__PURE__ */ e(te, { fallback: null, children: /* @__PURE__ */ e(qa, { ...t }) });
4476
+ });
4477
+ Ga.displayName = "InsertTableDialog";
4478
+ const Xa = le(() => import("./CellPropertiesDialogImpl-CgWcr4bD.js").then((n) => ({ default: n.CellPropertiesDialogImpl }))), ja = oe.memo(function(t) {
4479
+ return /* @__PURE__ */ e(te, { fallback: null, children: /* @__PURE__ */ e(Xa, { ...t }) });
4480
+ });
4481
+ ja.displayName = "CellPropertiesDialog";
4482
+ const Ua = le(() => import("./TableTemplatesDialogImpl-DrdqLQLH.js").then((n) => ({ default: n.TableTemplatesDialogImpl }))), Ya = oe.memo(function(t) {
4483
+ return /* @__PURE__ */ e(te, { fallback: null, children: /* @__PURE__ */ e(Ua, { ...t }) });
4484
+ });
4485
+ Ya.displayName = "TableTemplatesDialog";
4486
+ function un(n) {
4487
+ const t = {};
4488
+ return n.headerStyle === "light" ? t.th = "background-color: #f1f5f9; font-weight: 600;" : n.headerStyle === "dark" ? t.th = "background-color: #1e293b; color: white; font-weight: 600;" : n.headerStyle === "blue" && (t.th = "background-color: #3b82f6; color: white; font-weight: 600;"), n.borderStyle === "all" ? t["td, th"] = "border: 1px solid #cbd5e1;" : n.borderStyle === "horizontal" ? t["td, th"] = "border-top: 1px solid #cbd5e1; border-bottom: 1px solid #cbd5e1;" : n.borderStyle === "vertical" && (t["td, th"] = "border-left: 1px solid #cbd5e1; border-right: 1px solid #cbd5e1;"), t;
4489
+ }
4490
+ const Ja = [
4491
+ { id: "quad-formula", label: "Rumus ABC (Kuadrat)", latex: "x = \\frac{-b \\pm \\sqrt{b^2 - 4ac}}{2a}", category: "Algebra", level: "smp" },
4492
+ { id: "quad-eq", label: "Persamaan Kuadrat", latex: "ax^2 + bx + c = 0", category: "Algebra", level: "smp" },
4493
+ { id: "linear-eq", label: "Persamaan Linear", latex: "y = mx + c", category: "Algebra", level: "smp" },
4494
+ { id: "factoring", label: "Pemfaktoran", latex: "a^2 - b^2 = (a+b)(a-b)", category: "Algebra", level: "smp" },
4495
+ { id: "binomial-sq", label: "Kuadrat Binomial", latex: "(a+b)^2 = a^2 + 2ab + b^2", category: "Algebra", level: "smp" },
4496
+ { id: "abs-value", label: "Nilai Mutlak", latex: "|x - a| = b", category: "Algebra", level: "sma" },
4497
+ { id: "log-def", label: "Logaritma", latex: "\\log_a b = c \\iff a^c = b", category: "Algebra", level: "sma" },
4498
+ { id: "exponent-rule", label: "Aturan Eksponen", latex: "a^m \\cdot a^n = a^{m+n}", category: "Algebra", level: "smp" }
4499
+ ], Za = [
4500
+ { id: "pythagoras", label: "Teorema Pythagoras", latex: "a^2 + b^2 = c^2", category: "Geometri", level: "smp" },
4501
+ { id: "circle-area", label: "Luas Lingkaran", latex: "L = \\pi r^2", category: "Geometri", level: "sd" },
4502
+ { id: "circle-circumference", label: "Keliling Lingkaran", latex: "K = 2\\pi r", category: "Geometri", level: "sd" },
4503
+ { id: "triangle-area", label: "Luas Segitiga", latex: "L = \\frac{1}{2} \\times a \\times t", category: "Geometri", level: "sd" },
4504
+ { id: "rect-area", label: "Luas Persegi Panjang", latex: "L = p \\times l", category: "Geometri", level: "sd" },
4505
+ { id: "sphere-volume", label: "Volume Bola", latex: "V = \\frac{4}{3} \\pi r^3", category: "Geometri", level: "smp" },
4506
+ { id: "cylinder-volume", label: "Volume Tabung", latex: "V = \\pi r^2 t", category: "Geometri", level: "smp" },
4507
+ { id: "cone-volume", label: "Volume Kerucut", latex: "V = \\frac{1}{3} \\pi r^2 t", category: "Geometri", level: "smp" },
4508
+ { id: "distance-2d", label: "Jarak Dua Titik", latex: "d = \\sqrt{(x_2-x_1)^2 + (y_2-y_1)^2}", category: "Geometri", level: "sma" }
4509
+ ], Qa = [
4510
+ { id: "sin-def", label: "Sinus", latex: "\\sin \\theta = \\frac{\\text{depan}}{\\text{miring}}", category: "Trigonometri", level: "sma" },
4511
+ { id: "cos-def", label: "Cosinus", latex: "\\cos \\theta = \\frac{\\text{samping}}{\\text{miring}}", category: "Trigonometri", level: "sma" },
4512
+ { id: "tan-def", label: "Tangen", latex: "\\tan \\theta = \\frac{\\sin \\theta}{\\cos \\theta}", category: "Trigonometri", level: "sma" },
4513
+ { id: "pyth-identity", label: "Identitas Pythagoras", latex: "\\sin^2 \\theta + \\cos^2 \\theta = 1", category: "Trigonometri", level: "sma" },
4514
+ { id: "sin-rule", label: "Aturan Sinus", latex: "\\frac{a}{\\sin A} = \\frac{b}{\\sin B} = \\frac{c}{\\sin C}", category: "Trigonometri", level: "sma" },
4515
+ { id: "cos-rule", label: "Aturan Cosinus", latex: "c^2 = a^2 + b^2 - 2ab\\cos C", category: "Trigonometri", level: "sma" },
4516
+ { id: "double-angle-sin", label: "Sudut Ganda (Sin)", latex: "\\sin 2\\theta = 2\\sin \\theta \\cos \\theta", category: "Trigonometri", level: "sma" }
4517
+ ], en = [
4518
+ { id: "derivative-def", label: "Definisi Turunan", latex: "f'(x) = \\lim_{h \\to 0} \\frac{f(x+h) - f(x)}{h}", category: "Kalkulus", level: "sma" },
4519
+ { id: "power-rule", label: "Aturan Pangkat", latex: "\\frac{d}{dx} x^n = nx^{n-1}", category: "Kalkulus", level: "sma" },
4520
+ { id: "chain-rule", label: "Aturan Rantai", latex: "\\frac{dy}{dx} = \\frac{dy}{du} \\cdot \\frac{du}{dx}", category: "Kalkulus", level: "sma" },
4521
+ { id: "definite-integral", label: "Integral Tentu", latex: "\\int_a^b f(x)\\, dx = F(b) - F(a)", category: "Kalkulus", level: "sma" },
4522
+ { id: "indef-integral", label: "Integral Tak Tentu", latex: "\\int x^n\\, dx = \\frac{x^{n+1}}{n+1} + C", category: "Kalkulus", level: "sma" },
4523
+ { id: "limit-def", label: "Limit", latex: "\\lim_{x \\to a} f(x) = L", category: "Kalkulus", level: "sma" }
4524
+ ], tn = [
4525
+ { id: "mean", label: "Rata-rata (Mean)", latex: "\\bar{x} = \\frac{\\sum_{i=1}^{n} x_i}{n}", category: "Statistik", level: "smp" },
4526
+ { id: "median", label: "Median", latex: "Me = x_{\\frac{n+1}{2}}", category: "Statistik", level: "smp" },
4527
+ { id: "std-dev", label: "Simpangan Baku", latex: "s = \\sqrt{\\frac{\\sum_{i=1}^{n}(x_i - \\bar{x})^2}{n-1}}", category: "Statistik", level: "sma" },
4528
+ { id: "variance", label: "Variansi", latex: "s^2 = \\frac{\\sum_{i=1}^{n}(x_i - \\bar{x})^2}{n-1}", category: "Statistik", level: "sma" },
4529
+ { id: "combination", label: "Kombinasi", latex: "C(n, r) = \\binom{n}{r} = \\frac{n!}{r!(n-r)!}", category: "Statistik", level: "sma" },
4530
+ { id: "permutation", label: "Permutasi", latex: "P(n, r) = \\frac{n!}{(n-r)!}", category: "Statistik", level: "sma" },
4531
+ { id: "probability", label: "Peluang", latex: "P(A) = \\frac{n(A)}{n(S)}", category: "Statistik", level: "smp" }
4532
+ ], an = [
4533
+ { id: "velocity", label: "Kecepatan", latex: "v = \\frac{s}{t}", category: "Fisika", level: "smp" },
4534
+ { id: "acceleration", label: "Percepatan", latex: "a = \\frac{\\Delta v}{\\Delta t}", category: "Fisika", level: "smp" },
4535
+ { id: "newton-2", label: "Hukum Newton II", latex: "F = m \\cdot a", category: "Fisika", level: "smp" },
4536
+ { id: "kinetic-energy", label: "Energi Kinetik", latex: "E_k = \\frac{1}{2}mv^2", category: "Fisika", level: "sma" },
4537
+ { id: "potential-energy", label: "Energi Potensial", latex: "E_p = mgh", category: "Fisika", level: "sma" },
4538
+ { id: "work", label: "Usaha", latex: "W = F \\cdot s \\cdot \\cos \\theta", category: "Fisika", level: "sma" },
4539
+ { id: "ohm-law", label: "Hukum Ohm", latex: "V = I \\cdot R", category: "Fisika", level: "sma" },
4540
+ { id: "power-physics", label: "Daya", latex: "P = \\frac{W}{t}", category: "Fisika", level: "sma" },
4541
+ { id: "gravity", label: "Gravitasi Newton", latex: "F = G \\frac{m_1 m_2}{r^2}", category: "Fisika", level: "sma" }
4542
+ ], nn = [
4543
+ { id: "mol", label: "Jumlah Mol", latex: "n = \\frac{m}{M_r}", category: "Kimia", level: "sma" },
4544
+ { id: "molar-conc", label: "Molaritas", latex: "M = \\frac{n}{V}", category: "Kimia", level: "sma" },
4545
+ { id: "ideal-gas", label: "Gas Ideal", latex: "PV = nRT", category: "Kimia", level: "sma" },
4546
+ { id: "ph", label: "pH", latex: "pH = -\\log [H^+]", category: "Kimia", level: "sma" },
4547
+ { id: "dilution", label: "Pengenceran", latex: "M_1 V_1 = M_2 V_2", category: "Kimia", level: "sma" }
4548
+ ], Re = [
4549
+ ...Ja,
4550
+ ...Za,
4551
+ ...Qa,
4552
+ ...en,
4553
+ ...tn,
4554
+ ...an,
4555
+ ...nn
4556
+ ];
4557
+ function pn(n) {
4558
+ if (n === "all") return Re;
4559
+ const l = {
4560
+ sd: ["sd"],
4561
+ smp: ["sd", "smp"],
4562
+ sma: ["sd", "smp", "sma"]
4563
+ }[n] || ["sd", "smp", "sma"];
4564
+ return Re.filter((i) => l.includes(i.level));
4565
+ }
4566
+ function gn(n) {
4567
+ return Re.filter((t) => t.category === n);
4568
+ }
4569
+ function xn() {
4570
+ return [...new Set(Re.map((n) => n.category))];
4571
+ }
4572
+ export {
4573
+ ja as C,
4574
+ Ia as I,
4575
+ Wa as L,
4576
+ Ca as M,
4577
+ Ma as S,
4578
+ bt as T,
4579
+ Pa as W,
4580
+ Ga as a,
4581
+ pa as b,
4582
+ ua as c,
4583
+ hn as d,
4584
+ Aa as e,
4585
+ Ya as f,
4586
+ dt as g,
4587
+ mt as h,
4588
+ oa as i,
4589
+ ot as j,
4590
+ mn as k,
4591
+ xn as l,
4592
+ un as m,
4593
+ gn as n,
4594
+ pn as o,
4595
+ Re as p,
4596
+ La as s,
4597
+ dn as t,
4598
+ Ra as u
4599
+ };