@opengis/form 0.0.190 → 0.0.192

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,9 +1,9 @@
1
- import { ref as C, getCurrentInstance as lt, resolveComponent as G, createElementBlock as k, openBlock as v, normalizeClass as E, createVNode as F, createElementVNode as d, unref as L, createBlock as K, Teleport as Ke, createCommentVNode as V, Transition as We, withCtx as R, toDisplayString as W, renderSlot as be, defineComponent as at, withDirectives as ce, mergeProps as nt, vModelDynamic as st, Fragment as re, vModelCheckbox as it, nextTick as ge, watch as we, onMounted as he, onBeforeUnmount as Xe, normalizeStyle as le, vShow as ke, computed as H, renderList as ne, onUnmounted as Ae, resolveDynamicComponent as Te, vModelText as ct, withModifiers as dt, createStaticVNode as ut, mergeModels as ft, useModel as pt, shallowRef as gt, markRaw as ht } from "vue";
2
- import { r as He, _ as X, a as vt, b as mt } from "./index-CiyWLGmN.js";
3
- import { Quote as bt, List as yt, ListOrdered as xt, CodeXml as wt, Bold as kt, Italic as _t, Underline as $t, Strikethrough as Ct, X as Be, Mail as At, Search as Ft, Link2 as St, ExternalLink as Tt, Trash2 as Lt, Table2 as Bt, AlignJustify as Et, AlignRight as It, AlignCenter as Pt, AlignLeft as jt, Check as ye, Eraser as Mt, PaintBucket as Ht, Highlighter as Nt, ChevronDown as Ee, ALargeSmall as zt, Superscript as Dt, Subscript as Ot, RemoveFormatting as Vt, Image as Rt, Undo2 as Ut, Redo2 as qt, CircleHelp as Kt, Minus as Wt, Maximize as Xt } from "lucide-vue-next";
4
- import { notify as Ce } from "@opengis/core";
5
- function Gt() {
6
- const t = C(!1);
1
+ import { ref as $, getCurrentInstance as st, resolveComponent as Z, createElementBlock as w, openBlock as v, normalizeClass as E, createVNode as C, createElementVNode as d, unref as L, createBlock as W, Teleport as Ge, createCommentVNode as U, Transition as Ye, withCtx as q, toDisplayString as Y, renderSlot as we, defineComponent as it, withDirectives as de, mergeProps as ct, vModelDynamic as dt, Fragment as ae, vModelCheckbox as ut, nextTick as ue, watch as me, onMounted as be, onBeforeUnmount as Qe, normalizeStyle as se, vShow as $e, computed as N, renderList as ie, onUnmounted as Le, resolveDynamicComponent as Ee, vModelText as ft, withModifiers as pt, createStaticVNode as gt, mergeModels as ht, useModel as vt, shallowRef as mt, markRaw as bt } from "vue";
2
+ import { r as De, _ as Q, a as yt, b as xt } from "./index-DqCGQjZs.js";
3
+ import { Quote as wt, List as kt, ListOrdered as _t, CodeXml as $t, Bold as Ct, Italic as At, Underline as Ft, Strikethrough as St, X as Pe, Mail as Tt, Search as Lt, Link2 as Bt, ExternalLink as Et, Trash2 as It, Table2 as Pt, AlignJustify as jt, AlignRight as Mt, AlignCenter as Ht, AlignLeft as Nt, Check as ke, Eraser as zt, PaintBucket as Dt, Highlighter as Vt, ChevronDown as je, ALargeSmall as Ot, Superscript as Rt, Subscript as Ut, RemoveFormatting as qt, Image as Kt, Undo2 as Wt, Redo2 as Xt, CircleHelp as Gt, Minus as Yt, Maximize as Qt } from "lucide-vue-next";
4
+ import { notify as Se } from "@opengis/core";
5
+ function Zt() {
6
+ const t = $(!1);
7
7
  return {
8
8
  isFullscreen: t,
9
9
  toggleFullscreen: () => {
@@ -11,32 +11,32 @@ function Gt() {
11
11
  }
12
12
  };
13
13
  }
14
- const Yt = "https://esm.sh", te = "3.7.2", Ge = "3.7.2", Qt = `?deps=@tiptap/core@${te},@tiptap/pm@${Ge}`, Z = (t) => `${Yt}/${t}${Qt}`, J = {
15
- core: Z(`@tiptap/core@${te}`),
16
- starterKit: Z(`@tiptap/starter-kit@${te}`),
17
- textStyle: Z(`@tiptap/extension-text-style@${te}`),
18
- table: Z(`@tiptap/extension-table@${te}`),
19
- highlight: Z(`@tiptap/extension-highlight@${te}`),
20
- subscript: Z(`@tiptap/extension-subscript@${te}`),
21
- superscript: Z(`@tiptap/extension-superscript@${te}`),
22
- link: Z(`@tiptap/extension-link@${te}`),
23
- image: Z(`@tiptap/extension-image@${te}`),
24
- textAlign: Z(`@tiptap/extension-text-align@${te}`),
25
- heading: Z(`@tiptap/extension-heading@${te}`),
26
- paragraph: Z(`@tiptap/extension-paragraph@${te}`),
27
- pmModel: Z(`@tiptap/pm@${Ge}/model`)
28
- }, ve = "__vs_form_tiptap_loader__", ee = (t) => import(
14
+ const Jt = "https://esm.sh", le = "3.7.2", Ze = "3.7.2", er = `?deps=@tiptap/core@${le},@tiptap/pm@${Ze}`, te = (t) => `${Jt}/${t}${er}`, re = {
15
+ core: te(`@tiptap/core@${le}`),
16
+ starterKit: te(`@tiptap/starter-kit@${le}`),
17
+ textStyle: te(`@tiptap/extension-text-style@${le}`),
18
+ table: te(`@tiptap/extension-table@${le}`),
19
+ highlight: te(`@tiptap/extension-highlight@${le}`),
20
+ subscript: te(`@tiptap/extension-subscript@${le}`),
21
+ superscript: te(`@tiptap/extension-superscript@${le}`),
22
+ link: te(`@tiptap/extension-link@${le}`),
23
+ image: te(`@tiptap/extension-image@${le}`),
24
+ textAlign: te(`@tiptap/extension-text-align@${le}`),
25
+ heading: te(`@tiptap/extension-heading@${le}`),
26
+ paragraph: te(`@tiptap/extension-paragraph@${le}`),
27
+ pmModel: te(`@tiptap/pm@${Ze}/model`)
28
+ }, ye = "__vs_form_tiptap_loader__", oe = (t) => import(
29
29
  /* @vite-ignore */
30
30
  t
31
- ), q = (t, e) => t?.[e] || t?.default?.[e] || t?.default?.default?.[e] || t?.default || t, Zt = (t) => t.extend({
31
+ ), K = (t, e) => t?.[e] || t?.default?.[e] || t?.default?.default?.[e] || t?.default || t, tr = (t) => t.extend({
32
32
  addOptions() {
33
33
  return {
34
34
  ...this.parent?.(),
35
35
  levels: [1, 2, 3, 4, 5, 6]
36
36
  };
37
37
  }
38
- }), Jt = (t, e, a, s, n) => {
39
- const r = e.extend({
38
+ }), rr = (t, e, a, s, n) => {
39
+ const o = e.extend({
40
40
  addAttributes() {
41
41
  return {
42
42
  ...this.parent?.(),
@@ -82,7 +82,7 @@ const Yt = "https://esm.sh", te = "3.7.2", Ge = "3.7.2", Qt = `?deps=@tiptap/cor
82
82
  return t.extend({
83
83
  addExtensions() {
84
84
  return [
85
- r.configure({
85
+ o.configure({
86
86
  resizable: !0
87
87
  }),
88
88
  a,
@@ -91,7 +91,7 @@ const Yt = "https://esm.sh", te = "3.7.2", Ge = "3.7.2", Qt = `?deps=@tiptap/cor
91
91
  ];
92
92
  }
93
93
  });
94
- }, er = (t) => t.extend({
94
+ }, or = (t) => t.extend({
95
95
  addAttributes() {
96
96
  return {
97
97
  ...this.parent?.(),
@@ -137,7 +137,7 @@ const Yt = "https://esm.sh", te = "3.7.2", Ge = "3.7.2", Qt = `?deps=@tiptap/cor
137
137
  unsetBackgroundColor: () => ({ chain: e }) => e().setMark("textStyle", { backgroundColor: null }).removeEmptyTextStyle().run()
138
138
  };
139
139
  }
140
- }), tr = (t) => t.create({
140
+ }), lr = (t) => t.create({
141
141
  name: "iframe",
142
142
  group: "block",
143
143
  inline: !1,
@@ -165,195 +165,195 @@ const Yt = "https://esm.sh", te = "3.7.2", Ge = "3.7.2", Qt = `?deps=@tiptap/cor
165
165
  return ["iframe", e];
166
166
  }
167
167
  });
168
- async function rr() {
168
+ async function ar() {
169
169
  if (typeof window > "u") return null;
170
170
  const t = window;
171
- return t[ve] || (t[ve] = Promise.all([
172
- ee(J.core),
173
- ee(J.starterKit),
174
- ee(J.textStyle),
175
- ee(J.table),
176
- ee(J.highlight),
177
- ee(J.subscript),
178
- ee(J.superscript),
179
- ee(J.link),
180
- ee(J.image),
181
- ee(J.textAlign),
182
- ee(J.heading),
183
- ee(J.paragraph),
184
- ee(J.pmModel)
171
+ return t[ye] || (t[ye] = Promise.all([
172
+ oe(re.core),
173
+ oe(re.starterKit),
174
+ oe(re.textStyle),
175
+ oe(re.table),
176
+ oe(re.highlight),
177
+ oe(re.subscript),
178
+ oe(re.superscript),
179
+ oe(re.link),
180
+ oe(re.image),
181
+ oe(re.textAlign),
182
+ oe(re.heading),
183
+ oe(re.paragraph),
184
+ oe(re.pmModel)
185
185
  ]).then(([
186
186
  e,
187
187
  a,
188
188
  s,
189
189
  n,
190
- r,
190
+ o,
191
191
  l,
192
192
  c,
193
- o,
193
+ r,
194
194
  i,
195
- w,
195
+ x,
196
196
  b,
197
- p,
198
- g
197
+ f,
198
+ p
199
199
  ]) => {
200
- const P = q(e, "Editor"), O = q(e, "Node"), z = q(a, "StarterKit"), U = q(s, "TextStyle"), Y = q(n, "TableKit"), I = q(n, "Table"), Q = q(n, "TableRow"), oe = q(n, "TableCell"), ue = q(n, "TableHeader"), fe = q(r, "Highlight"), m = q(l, "Subscript"), _ = q(c, "Superscript"), f = q(o, "Link"), $ = q(i, "Image"), y = q(w, "TextAlign"), B = q(b, "Heading"), h = q(p, "Paragraph"), S = q(g, "DOMParser");
201
- if (!P || !O || !z || !U || !Y || !I || !Q || !oe || !ue || !fe || !m || !_ || !f || !$ || !y || !B || !h || !S)
200
+ const I = K(e, "Editor"), V = K(e, "Node"), O = K(a, "StarterKit"), R = K(s, "TextStyle"), J = K(n, "TableKit"), P = K(n, "Table"), ee = K(n, "TableRow"), ne = K(n, "TableCell"), pe = K(n, "TableHeader"), ge = K(o, "Highlight"), m = K(l, "Subscript"), k = K(c, "Superscript"), u = K(r, "Link"), _ = K(i, "Image"), y = K(x, "TextAlign"), T = K(b, "Heading"), h = K(f, "Paragraph"), S = K(p, "DOMParser");
201
+ if (!I || !V || !O || !R || !J || !P || !ee || !ne || !pe || !ge || !m || !k || !u || !_ || !y || !T || !h || !S)
202
202
  throw new Error("Failed to resolve one or more Tiptap modules");
203
203
  return {
204
- Editor: P,
204
+ Editor: I,
205
205
  ProseMirrorDOMParser: S,
206
- StarterKit: z,
207
- ExtendedTextStyle: er(U),
208
- Highlight: fe,
206
+ StarterKit: O,
207
+ ExtendedTextStyle: or(R),
208
+ Highlight: ge,
209
209
  Subscript: m,
210
- Superscript: _,
211
- Link: f,
212
- Image: $,
210
+ Superscript: k,
211
+ Link: u,
212
+ Image: _,
213
213
  TextAlign: y,
214
- CustomHeading: Zt(B),
214
+ CustomHeading: tr(T),
215
215
  CustomParagraph: h,
216
- CustomTableKit: Jt(Y, I, Q, oe, ue),
217
- Iframe: tr(O)
216
+ CustomTableKit: rr(J, P, ee, ne, pe),
217
+ Iframe: lr(V)
218
218
  };
219
219
  }).catch((e) => {
220
- throw delete t[ve], e;
221
- })), t[ve];
220
+ throw delete t[ye], e;
221
+ })), t[ye];
222
222
  }
223
- const ie = (t) => t.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;").replace(/'/g, "&#39;"), _e = (t) => {
224
- let e = ie(t || "");
225
- return e = e.replace(/!\[([^\]]*)]\(([^)\s]+)(?:\s+"([^"]+)")?\)/g, (a, s, n, r) => {
226
- const l = r ? ` title="${ie(r)}"` : "";
227
- return `<img src="${ie(n)}" alt="${ie(s)}"${l}>`;
228
- }), e = e.replace(/\[([^\]]+)]\(([^)\s]+)(?:\s+"([^"]+)")?\)/g, (a, s, n, r) => {
229
- const l = r ? ` title="${ie(r)}"` : "";
230
- return `<a href="${ie(n)}"${l} target="_blank" rel="noopener noreferrer">${s}</a>`;
223
+ const ce = (t) => t.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;").replace(/'/g, "&#39;"), Ce = (t) => {
224
+ let e = ce(t || "");
225
+ return e = e.replace(/!\[([^\]]*)]\(([^)\s]+)(?:\s+"([^"]+)")?\)/g, (a, s, n, o) => {
226
+ const l = o ? ` title="${ce(o)}"` : "";
227
+ return `<img src="${ce(n)}" alt="${ce(s)}"${l}>`;
228
+ }), e = e.replace(/\[([^\]]+)]\(([^)\s]+)(?:\s+"([^"]+)")?\)/g, (a, s, n, o) => {
229
+ const l = o ? ` title="${ce(o)}"` : "";
230
+ return `<a href="${ce(n)}"${l} target="_blank" rel="noopener noreferrer">${s}</a>`;
231
231
  }), e = e.replace(/`([^`]+)`/g, "<code>$1</code>"), e = e.replace(/\*\*([^*]+)\*\*/g, "<strong>$1</strong>"), e = e.replace(/__([^_]+)__/g, "<strong>$1</strong>"), e = e.replace(/~~([^~]+)~~/g, "<del>$1</del>"), e = e.replace(/\*([^*\n]+)\*/g, "<em>$1</em>"), e = e.replace(/_([^_\n]+)_/g, "<em>$1</em>"), e;
232
- }, xe = (t) => /^\s*\d+\.\s+/.test(t), Ie = (t) => /^\s*[-*+]\s+/.test(t), Ye = (t) => /^\s*[-*+]\s+\[[ xX]\]\s+/.test(t), Le = (t) => /^\s*>\s?/.test(t), Pe = (t) => /^\s*\|?(?:\s*:?-{3,}:?\s*\|)+\s*:?-{3,}:?\s*\|?\s*$/.test(t), Ne = (t) => t.trim().replace(/^\|/, "").replace(/\|$/, "").split("|").map((e) => _e(e.trim())), or = (t, e) => {
232
+ }, _e = (t) => /^\s*\d+\.\s+/.test(t), Me = (t) => /^\s*[-*+]\s+/.test(t), Je = (t) => /^\s*[-*+]\s+\[[ xX]\]\s+/.test(t), Ie = (t) => /^\s*>\s?/.test(t), He = (t) => /^\s*\|?(?:\s*:?-{3,}:?\s*\|)+\s*:?-{3,}:?\s*\|?\s*$/.test(t), Ve = (t) => t.trim().replace(/^\|/, "").replace(/\|$/, "").split("|").map((e) => Ce(e.trim())), nr = (t, e) => {
233
233
  const a = t[e], s = t[e + 1];
234
- if (!a || !s || !a.includes("|") || !Pe(s))
234
+ if (!a || !s || !a.includes("|") || !He(s))
235
235
  return null;
236
- const n = Ne(a), r = [];
236
+ const n = Ve(a), o = [];
237
237
  let l = e + 2;
238
238
  for (; l < t.length && t[l].includes("|") && t[l].trim() !== ""; ) {
239
- const i = Ne(t[l]);
240
- r.push(`<tr>${i.map((w) => `<td>${w}</td>`).join("")}</tr>`), l += 1;
239
+ const i = Ve(t[l]);
240
+ o.push(`<tr>${i.map((x) => `<td>${x}</td>`).join("")}</tr>`), l += 1;
241
241
  }
242
- const c = `<thead><tr>${n.map((i) => `<th>${i}</th>`).join("")}</tr></thead>`, o = r.length ? `<tbody>${r.join("")}</tbody>` : "";
242
+ const c = `<thead><tr>${n.map((i) => `<th>${i}</th>`).join("")}</tr></thead>`, r = o.length ? `<tbody>${o.join("")}</tbody>` : "";
243
243
  return {
244
- html: `<table>${c}${o}</table>`,
244
+ html: `<table>${c}${r}</table>`,
245
245
  nextIndex: l
246
246
  };
247
- }, lr = (t, e) => {
248
- const a = xe(t[e]), s = a ? "ol" : "ul", n = [];
249
- let r = e;
250
- for (; r < t.length; ) {
251
- const l = t[r];
252
- if (l.trim() === "" || !(a ? xe(l) : (Ie(l) || Ye(l)) && !xe(l))) break;
253
- const o = l.match(/^\s*[-*+]\s+\[([ xX])\]\s+(.*)$/);
254
- if (o) {
255
- const i = o[1].toLowerCase() === "x";
256
- n.push(`<li><input type="checkbox" disabled${i ? " checked" : ""}> ${_e(o[2])}</li>`);
247
+ }, sr = (t, e) => {
248
+ const a = _e(t[e]), s = a ? "ol" : "ul", n = [];
249
+ let o = e;
250
+ for (; o < t.length; ) {
251
+ const l = t[o];
252
+ if (l.trim() === "" || !(a ? _e(l) : (Me(l) || Je(l)) && !_e(l))) break;
253
+ const r = l.match(/^\s*[-*+]\s+\[([ xX])\]\s+(.*)$/);
254
+ if (r) {
255
+ const i = r[1].toLowerCase() === "x";
256
+ n.push(`<li><input type="checkbox" disabled${i ? " checked" : ""}> ${Ce(r[2])}</li>`);
257
257
  } else {
258
258
  const i = l.replace(/^\s*(?:[-*+]|\d+\.)\s+/, "");
259
- n.push(`<li>${_e(i)}</li>`);
259
+ n.push(`<li>${Ce(i)}</li>`);
260
260
  }
261
- r += 1;
261
+ o += 1;
262
262
  }
263
263
  return {
264
264
  html: `<${s}>${n.join("")}</${s}>`,
265
- nextIndex: r
265
+ nextIndex: o
266
266
  };
267
- }, ar = (t, e) => {
267
+ }, ir = (t, e) => {
268
268
  const s = t[e].replace(/^```/, "").trim(), n = [];
269
- let r = e + 1;
270
- for (; r < t.length && !t[r].startsWith("```"); )
271
- n.push(t[r]), r += 1;
269
+ let o = e + 1;
270
+ for (; o < t.length && !t[o].startsWith("```"); )
271
+ n.push(t[o]), o += 1;
272
272
  return {
273
- html: `<pre><code${s ? ` class="language-${ie(s)}"` : ""}>${ie(n.join(`
273
+ html: `<pre><code${s ? ` class="language-${ce(s)}"` : ""}>${ce(n.join(`
274
274
  `))}</code></pre>`,
275
- nextIndex: r < t.length ? r + 1 : r
275
+ nextIndex: o < t.length ? o + 1 : o
276
276
  };
277
- }, nr = (t, e) => {
277
+ }, cr = (t, e) => {
278
278
  const a = [];
279
279
  let s = e;
280
280
  for (; s < t.length; ) {
281
281
  const n = t[s];
282
- if (n.trim() === "" || n.startsWith("```") || /^#{1,6}\s+/.test(n) || /^---+$/.test(n.trim()) || /^\*\*\*+$/.test(n.trim()) || Le(n) || xe(n) || Ie(n) || s + 1 < t.length && n.includes("|") && Pe(t[s + 1]))
282
+ if (n.trim() === "" || n.startsWith("```") || /^#{1,6}\s+/.test(n) || /^---+$/.test(n.trim()) || /^\*\*\*+$/.test(n.trim()) || Ie(n) || _e(n) || Me(n) || s + 1 < t.length && n.includes("|") && He(t[s + 1]))
283
283
  break;
284
284
  a.push(n.trim()), s += 1;
285
285
  }
286
286
  return {
287
- html: `<p>${_e(a.join(" "))}</p>`,
287
+ html: `<p>${Ce(a.join(" "))}</p>`,
288
288
  nextIndex: s
289
289
  };
290
- }, Qe = (t) => {
290
+ }, et = (t) => {
291
291
  const a = (t || "").replace(/\r\n/g, `
292
292
  `).split(`
293
293
  `), s = [];
294
294
  let n = 0;
295
295
  for (; n < a.length; ) {
296
- const r = a[n], l = r.trim();
296
+ const o = a[n], l = o.trim();
297
297
  if (!l) {
298
298
  n += 1;
299
299
  continue;
300
300
  }
301
- if (r.startsWith("```")) {
302
- const i = ar(a, n);
301
+ if (o.startsWith("```")) {
302
+ const i = ir(a, n);
303
303
  s.push(i.html), n = i.nextIndex;
304
304
  continue;
305
305
  }
306
- const c = r.match(/^(#{1,6})\s+(.*)$/);
306
+ const c = o.match(/^(#{1,6})\s+(.*)$/);
307
307
  if (c) {
308
308
  const i = c[1].length;
309
- s.push(`<h${i}>${_e(c[2])}</h${i}>`), n += 1;
309
+ s.push(`<h${i}>${Ce(c[2])}</h${i}>`), n += 1;
310
310
  continue;
311
311
  }
312
312
  if (/^---+$/.test(l) || /^\*\*\*+$/.test(l)) {
313
313
  s.push("<hr>"), n += 1;
314
314
  continue;
315
315
  }
316
- if (r.includes("|") && n + 1 < a.length && Pe(a[n + 1])) {
317
- const i = or(a, n);
316
+ if (o.includes("|") && n + 1 < a.length && He(a[n + 1])) {
317
+ const i = nr(a, n);
318
318
  if (i) {
319
319
  s.push(i.html), n = i.nextIndex;
320
320
  continue;
321
321
  }
322
322
  }
323
- if (Le(r)) {
323
+ if (Ie(o)) {
324
324
  const i = [];
325
- for (; n < a.length && Le(a[n]); )
325
+ for (; n < a.length && Ie(a[n]); )
326
326
  i.push(a[n].replace(/^\s*>\s?/, "")), n += 1;
327
- s.push(`<blockquote>${Qe(i.join(`
327
+ s.push(`<blockquote>${et(i.join(`
328
328
  `))}</blockquote>`);
329
329
  continue;
330
330
  }
331
- if (xe(r) || Ie(r) || Ye(r)) {
332
- const i = lr(a, n);
331
+ if (_e(o) || Me(o) || Je(o)) {
332
+ const i = sr(a, n);
333
333
  s.push(i.html), n = i.nextIndex;
334
334
  continue;
335
335
  }
336
- const o = nr(a, n);
337
- s.push(o.html), n = o.nextIndex;
336
+ const r = cr(a, n);
337
+ s.push(r.html), n = r.nextIndex;
338
338
  }
339
339
  return s.join("");
340
- }, Fe = (t) => (t.textContent || "").replace(/\u00a0/g, " "), Ze = (t) => Array.from(t.childNodes).map((e) => je(e)).join(""), sr = (t) => {
340
+ }, Be = (t) => (t.textContent || "").replace(/\u00a0/g, " "), tt = (t) => Array.from(t.childNodes).map((e) => Ne(e)).join(""), dr = (t) => {
341
341
  const e = Array.from(t.querySelectorAll("tr"));
342
342
  if (!e.length) return "";
343
- const a = (c) => `| ${Array.from(c.children).map((i) => Ze(i).trim()).join(" | ")} |`, s = e[0], n = s ? Array.from(s.children).length : 0, r = `| ${Array(Math.max(n, 1)).fill("---").join(" | ")} |`, l = e.slice(1).map((c) => a(c));
344
- return [a(s), r, ...l].join(`
343
+ const a = (c) => `| ${Array.from(c.children).map((i) => tt(i).trim()).join(" | ")} |`, s = e[0], n = s ? Array.from(s.children).length : 0, o = `| ${Array(Math.max(n, 1)).fill("---").join(" | ")} |`, l = e.slice(1).map((c) => a(c));
344
+ return [a(s), o, ...l].join(`
345
345
  `);
346
- }, ze = (t, e = !1) => Array.from(t.children).filter((a) => a.nodeType === Node.ELEMENT_NODE).map((a, s) => {
347
- const n = a, r = n.querySelector('input[type="checkbox"]'), l = Array.from(n.childNodes).filter((c) => !(c instanceof HTMLInputElement)).map((c) => je(c)).join("").trim();
348
- return r ? `- [${r.checked ? "x" : " "}] ${l}` : e ? `${s + 1}. ${l}` : `- ${l}`;
346
+ }, Oe = (t, e = !1) => Array.from(t.children).filter((a) => a.nodeType === Node.ELEMENT_NODE).map((a, s) => {
347
+ const n = a, o = n.querySelector('input[type="checkbox"]'), l = Array.from(n.childNodes).filter((c) => !(c instanceof HTMLInputElement)).map((c) => Ne(c)).join("").trim();
348
+ return o ? `- [${o.checked ? "x" : " "}] ${l}` : e ? `${s + 1}. ${l}` : `- ${l}`;
349
349
  }).join(`
350
350
  `);
351
- function je(t) {
351
+ function Ne(t) {
352
352
  if (t.nodeType === Node.TEXT_NODE)
353
- return Fe(t);
353
+ return Be(t);
354
354
  if (t.nodeType !== Node.ELEMENT_NODE)
355
355
  return "";
356
- const e = t, a = e.tagName.toLowerCase(), s = Ze(e);
356
+ const e = t, a = e.tagName.toLowerCase(), s = tt(e);
357
357
  switch (a) {
358
358
  case "br":
359
359
  return `
@@ -374,9 +374,9 @@ function je(t) {
374
374
  case "code":
375
375
  return e.parentElement?.tagName.toLowerCase() === "pre" ? s : `\`${s}\``;
376
376
  case "pre": {
377
- const n = e.querySelector("code"), c = (n?.className || "").match(/language-([a-z0-9_-]+)/i)?.[1] || "", o = Fe(n || e);
377
+ const n = e.querySelector("code"), c = (n?.className || "").match(/language-([a-z0-9_-]+)/i)?.[1] || "", r = Be(n || e);
378
378
  return `\`\`\`${c}
379
- ${o}
379
+ ${r}
380
380
  \`\`\`
381
381
 
382
382
  `;
@@ -399,11 +399,11 @@ ${o}
399
399
  `;
400
400
  }
401
401
  case "ul":
402
- return `${ze(e, !1)}
402
+ return `${Oe(e, !1)}
403
403
 
404
404
  `;
405
405
  case "ol":
406
- return `${ze(e, !0)}
406
+ return `${Oe(e, !0)}
407
407
 
408
408
  `;
409
409
  case "a": {
@@ -411,30 +411,30 @@ ${o}
411
411
  return `[${s || n}](${n})`;
412
412
  }
413
413
  case "img": {
414
- const n = e.getAttribute("alt") || "", r = e.getAttribute("src") || "";
415
- return r ? `![${n}](${r})` : "";
414
+ const n = e.getAttribute("alt") || "", o = e.getAttribute("src") || "";
415
+ return o ? `![${n}](${o})` : "";
416
416
  }
417
417
  case "hr":
418
418
  return `---
419
419
 
420
420
  `;
421
421
  case "table":
422
- return `${sr(e)}
422
+ return `${dr(e)}
423
423
 
424
424
  `;
425
425
  default:
426
426
  return s;
427
427
  }
428
428
  }
429
- const Je = (t) => {
429
+ const rt = (t) => {
430
430
  if (!t) return "";
431
431
  if (typeof window > "u" || typeof DOMParser > "u")
432
432
  return t;
433
433
  const a = new DOMParser().parseFromString(t, "text/html");
434
- return Array.from(a.body.childNodes).map((s) => je(s)).join("").replace(/\n{3,}/g, `
434
+ return Array.from(a.body.childNodes).map((s) => Ne(s)).join("").replace(/\n{3,}/g, `
435
435
 
436
436
  `).trim();
437
- }, ir = /* @__PURE__ */ new Set([
437
+ }, ur = /* @__PURE__ */ new Set([
438
438
  "area",
439
439
  "base",
440
440
  "br",
@@ -449,42 +449,42 @@ const Je = (t) => {
449
449
  "source",
450
450
  "track",
451
451
  "wbr"
452
- ]), cr = (t) => {
452
+ ]), fr = (t) => {
453
453
  if (!t) return "";
454
454
  if (typeof window > "u" || typeof DOMParser > "u")
455
455
  return t;
456
- const a = new DOMParser().parseFromString(t, "text/html"), s = " ", n = (r, l) => {
457
- if (r.nodeType === Node.TEXT_NODE) {
458
- const g = (r.textContent || "").replace(/\s+/g, " ").trim();
459
- return g ? [`${s.repeat(l)}${g}`] : [];
456
+ const a = new DOMParser().parseFromString(t, "text/html"), s = " ", n = (o, l) => {
457
+ if (o.nodeType === Node.TEXT_NODE) {
458
+ const p = (o.textContent || "").replace(/\s+/g, " ").trim();
459
+ return p ? [`${s.repeat(l)}${p}`] : [];
460
460
  }
461
- if (r.nodeType !== Node.ELEMENT_NODE)
461
+ if (o.nodeType !== Node.ELEMENT_NODE)
462
462
  return [];
463
- const c = r, o = c.tagName.toLowerCase(), i = Array.from(c.attributes).map((g) => `${g.name}="${g.value}"`).join(" "), w = i ? `<${o} ${i}>` : `<${o}>`, b = `</${o}>`;
464
- if (ir.has(o))
465
- return [`${s.repeat(l)}${w}`];
466
- const p = Array.from(c.childNodes).flatMap((g) => n(g, l + 1));
467
- if (!p.length)
468
- return [`${s.repeat(l)}${w}${b}`];
469
- if (c.childNodes.length === 1 && c.firstChild?.nodeType === Node.TEXT_NODE && p.length === 1) {
470
- const g = p[0].trim();
471
- return [`${s.repeat(l)}${w}${g}${b}`];
463
+ const c = o, r = c.tagName.toLowerCase(), i = Array.from(c.attributes).map((p) => `${p.name}="${p.value}"`).join(" "), x = i ? `<${r} ${i}>` : `<${r}>`, b = `</${r}>`;
464
+ if (ur.has(r))
465
+ return [`${s.repeat(l)}${x}`];
466
+ const f = Array.from(c.childNodes).flatMap((p) => n(p, l + 1));
467
+ if (!f.length)
468
+ return [`${s.repeat(l)}${x}${b}`];
469
+ if (c.childNodes.length === 1 && c.firstChild?.nodeType === Node.TEXT_NODE && f.length === 1) {
470
+ const p = f[0].trim();
471
+ return [`${s.repeat(l)}${x}${p}${b}`];
472
472
  }
473
473
  return [
474
- `${s.repeat(l)}${w}`,
475
- ...p,
474
+ `${s.repeat(l)}${x}`,
475
+ ...f,
476
476
  `${s.repeat(l)}${b}`
477
477
  ];
478
478
  };
479
- return Array.from(a.body.childNodes).flatMap((r) => n(r, 0)).join(`
479
+ return Array.from(a.body.childNodes).flatMap((o) => n(o, 0)).join(`
480
480
  `);
481
- }, dr = (t) => t.replace(/&/g, "&amp;").replace(/"/g, "&quot;").replace(/</g, "&lt;").replace(/>/g, "&gt;"), Se = (t) => {
481
+ }, pr = (t) => t.replace(/&/g, "&amp;").replace(/"/g, "&quot;").replace(/</g, "&lt;").replace(/>/g, "&gt;"), Te = (t) => {
482
482
  if (!t) return "";
483
483
  if (typeof window > "u" || typeof DOMParser > "u")
484
484
  return t.replace(/<script\b[^>]*>[\s\S]*?<\/script>/gi, "");
485
485
  const a = new DOMParser().parseFromString(t, "text/html");
486
486
  return a.querySelectorAll("script").forEach((s) => s.remove()), a.body.innerHTML;
487
- }, De = (t) => {
487
+ }, Re = (t) => {
488
488
  if (!t)
489
489
  return { wrapper: null, bodyHtml: "" };
490
490
  if (typeof window > "u" || typeof DOMParser > "u")
@@ -496,18 +496,18 @@ const Je = (t) => {
496
496
  return !n || n.tagName.toLowerCase() !== "div" ? { wrapper: null, bodyHtml: t } : {
497
497
  wrapper: {
498
498
  tag: n.tagName.toLowerCase(),
499
- attributes: Array.from(n.attributes).map((r) => ({
500
- name: r.name,
501
- value: r.value
499
+ attributes: Array.from(n.attributes).map((o) => ({
500
+ name: o.name,
501
+ value: o.value
502
502
  }))
503
503
  },
504
504
  bodyHtml: n.innerHTML
505
505
  };
506
- }, Oe = (t, e) => {
506
+ }, Ue = (t, e) => {
507
507
  if (!e) return t || "";
508
- const a = (e.attributes || []).map(({ name: n, value: r }) => `${n}="${dr(r)}"`).join(" ");
508
+ const a = (e.attributes || []).map(({ name: n, value: o }) => `${n}="${pr(o)}"`).join(" ");
509
509
  return `${a ? `<${e.tag} ${a}>` : `<${e.tag}>`}${t || ""}</${e.tag}>`;
510
- }, Ve = async (t, e) => e !== "md" ? t || "" : Qe(t || ""), Re = async (t, e) => e !== "md" ? cr(t || "") : Je(t || ""), ur = async (t, e) => e !== "md" ? t || "" : Je(t || ""), fr = async (t) => {
510
+ }, qe = async (t, e) => e !== "md" ? t || "" : et(t || ""), Ke = async (t, e) => e !== "md" ? fr(t || "") : rt(t || ""), gr = async (t, e) => e !== "md" ? t || "" : rt(t || ""), hr = async (t) => {
511
511
  try {
512
512
  const e = new FormData();
513
513
  return e.append("unique", "true"), e.append("file", t), (await (await fetch("/file/upload/uploads?id=&form=&table=", {
@@ -517,55 +517,55 @@ const Je = (t) => {
517
517
  } catch (e) {
518
518
  console.error(e);
519
519
  }
520
- }, pr = async (t, e, a) => {
520
+ }, vr = async (t, e, a) => {
521
521
  const s = e.clipboardData?.items;
522
522
  if (s) {
523
- const n = e.clipboardData?.getData("text/html"), r = e.clipboardData?.getData("text/plain");
523
+ const n = e.clipboardData?.getData("text/html"), o = e.clipboardData?.getData("text/plain");
524
524
  if (n) {
525
- const { state: l, dispatch: c } = t, { tr: o } = l, i = a.fromSchema(t.state.schema), w = new DOMParser().parseFromString(n, "text/html").body, b = i.parse(w), p = o.replaceSelectionWith(b);
526
- return c(p), e.preventDefault(), !0;
525
+ const { state: l, dispatch: c } = t, { tr: r } = l, i = a.fromSchema(t.state.schema), x = new DOMParser().parseFromString(n, "text/html").body, b = i.parse(x), f = r.replaceSelectionWith(b);
526
+ return c(f), e.preventDefault(), !0;
527
527
  }
528
- if (r) {
529
- const { state: l, dispatch: c } = t, { tr: o } = l, i = o.insertText(r, l.selection.from, l.selection.to);
528
+ if (o) {
529
+ const { state: l, dispatch: c } = t, { tr: r } = l, i = r.insertText(o, l.selection.from, l.selection.to);
530
530
  return c(i), e.preventDefault(), !0;
531
531
  }
532
532
  for (let l = 0; l < s.length; l++) {
533
533
  const c = s[l];
534
534
  if (c.type.startsWith("image/")) {
535
- const o = c.getAsFile();
536
- if (o) {
537
- const i = await fr(o), { schema: w } = t.state, b = w.nodes.image.create({
535
+ const r = c.getAsFile();
536
+ if (r) {
537
+ const i = await hr(r), { schema: x } = t.state, b = x.nodes.image.create({
538
538
  src: i?.file_path
539
- }), p = t.state.tr.replaceSelectionWith(b);
540
- return t.dispatch(p), e.preventDefault(), !0;
539
+ }), f = t.state.tr.replaceSelectionWith(b);
540
+ return t.dispatch(f), e.preventDefault(), !0;
541
541
  }
542
542
  }
543
543
  }
544
544
  }
545
545
  return !1;
546
- }, gr = (t) => String(t).trim().toLowerCase().split("-")[0], hr = () => typeof window > "u" ? "uk" : gr(
546
+ }, mr = (t) => String(t).trim().toLowerCase().split("-")[0], br = () => typeof window > "u" ? "uk" : mr(
547
547
  localStorage.getItem("language") || localStorage.getItem("locale") || navigator.language || "uk"
548
- ), vr = (t, e) => {
548
+ ), yr = (t, e) => {
549
549
  const a = e.replace(/^form\.richtext\./, "");
550
- return He?.[t]?.form?.richtext?.[a] || He?.uk?.form?.richtext?.[a] || e;
551
- }, Ue = (t) => t.startsWith("form.richtext.") ? t : `form.richtext.${t}`;
552
- function Me() {
553
- const e = lt()?.appContext?.config?.globalProperties, a = e?.$i18n;
550
+ return De?.[t]?.form?.richtext?.[a] || De?.uk?.form?.richtext?.[a] || e;
551
+ }, We = (t) => t.startsWith("form.richtext.") ? t : `form.richtext.${t}`;
552
+ function ze() {
553
+ const e = st()?.appContext?.config?.globalProperties, a = e?.$i18n;
554
554
  return { t: (n) => {
555
- const r = e?.$t, l = e?.$te, c = typeof a?.te == "function" ? a.te.bind(a) : null;
556
- if (typeof r == "function") {
557
- const o = Ue(n);
558
- if ((typeof l == "function" ? l(o) : typeof c == "function" ? c(o) : null) !== !1) {
559
- const w = r(o);
560
- if (w && w !== o)
561
- return w;
555
+ const o = e?.$t, l = e?.$te, c = typeof a?.te == "function" ? a.te.bind(a) : null;
556
+ if (typeof o == "function") {
557
+ const r = We(n);
558
+ if ((typeof l == "function" ? l(r) : typeof c == "function" ? c(r) : null) !== !1) {
559
+ const x = o(r);
560
+ if (x && x !== r)
561
+ return x;
562
562
  }
563
563
  }
564
- return vr(hr(), Ue(n));
564
+ return yr(br(), We(n));
565
565
  } };
566
566
  }
567
- const mr = {
568
- components: { Quote: bt },
567
+ const xr = {
568
+ components: { Quote: wt },
569
569
  props: { editor: Object },
570
570
  methods: {
571
571
  toggleBlockquote() {
@@ -573,18 +573,18 @@ const mr = {
573
573
  }
574
574
  }
575
575
  };
576
- function br(t, e, a, s, n, r) {
577
- const l = G("Quote");
578
- return v(), k("button", {
576
+ function wr(t, e, a, s, n, o) {
577
+ const l = Z("Quote");
578
+ return v(), w("button", {
579
579
  title: "Blockquote",
580
- onClick: e[0] || (e[0] = (...c) => r.toggleBlockquote && r.toggleBlockquote(...c)),
580
+ onClick: e[0] || (e[0] = (...c) => o.toggleBlockquote && o.toggleBlockquote(...c)),
581
581
  class: E(["text-gray-500 w-[30px] h-[30px] flex items-center justify-center rounded-full hover:text-gray-900 hover:bg-gray-100 focus:outline-none", { "bg-gray-100 text-gray-900": a.editor?.isActive("blockquote") }])
582
582
  }, [
583
- F(l, { class: "h-4 w-4" })
583
+ C(l, { class: "h-4 w-4" })
584
584
  ], 2);
585
585
  }
586
- const yr = /* @__PURE__ */ X(mr, [["render", br]]), xr = {
587
- components: { List: yt },
586
+ const kr = /* @__PURE__ */ Q(xr, [["render", wr]]), _r = {
587
+ components: { List: kt },
588
588
  props: { editor: Object },
589
589
  methods: {
590
590
  toggleBulletList() {
@@ -592,18 +592,18 @@ const yr = /* @__PURE__ */ X(mr, [["render", br]]), xr = {
592
592
  }
593
593
  }
594
594
  };
595
- function wr(t, e, a, s, n, r) {
596
- const l = G("List");
597
- return v(), k("button", {
595
+ function $r(t, e, a, s, n, o) {
596
+ const l = Z("List");
597
+ return v(), w("button", {
598
598
  title: "Bullet List",
599
- onClick: e[0] || (e[0] = (...c) => r.toggleBulletList && r.toggleBulletList(...c)),
599
+ onClick: e[0] || (e[0] = (...c) => o.toggleBulletList && o.toggleBulletList(...c)),
600
600
  class: E(["text-gray-500 w-[30px] h-[30px] flex items-center justify-center rounded-full hover:text-gray-900 hover:bg-gray-100", { "bg-gray-100 text-gray-900": a.editor?.isActive("bulletList") }])
601
601
  }, [
602
- F(l, { class: "h-4 w-4" })
602
+ C(l, { class: "h-4 w-4" })
603
603
  ], 2);
604
604
  }
605
- const kr = /* @__PURE__ */ X(xr, [["render", wr]]), _r = {
606
- components: { ListOrdered: xt },
605
+ const Cr = /* @__PURE__ */ Q(_r, [["render", $r]]), Ar = {
606
+ components: { ListOrdered: _t },
607
607
  props: { editor: Object },
608
608
  methods: {
609
609
  toggleOrderedList() {
@@ -611,18 +611,18 @@ const kr = /* @__PURE__ */ X(xr, [["render", wr]]), _r = {
611
611
  }
612
612
  }
613
613
  };
614
- function $r(t, e, a, s, n, r) {
615
- const l = G("ListOrdered");
616
- return v(), k("button", {
614
+ function Fr(t, e, a, s, n, o) {
615
+ const l = Z("ListOrdered");
616
+ return v(), w("button", {
617
617
  title: "Ordered List",
618
- onClick: e[0] || (e[0] = (...c) => r.toggleOrderedList && r.toggleOrderedList(...c)),
618
+ onClick: e[0] || (e[0] = (...c) => o.toggleOrderedList && o.toggleOrderedList(...c)),
619
619
  class: E(["text-gray-500 w-[30px] h-[30px] flex items-center justify-center rounded-full hover:text-gray-900 hover:bg-gray-100", { "bg-gray-100 text-gray-900": a.editor?.isActive("orderedList") }])
620
620
  }, [
621
- F(l, { class: "h-4 w-4" })
621
+ C(l, { class: "h-4 w-4" })
622
622
  ], 2);
623
623
  }
624
- const Cr = /* @__PURE__ */ X(_r, [["render", $r]]), Ar = {
625
- components: { CodeXml: wt },
624
+ const Sr = /* @__PURE__ */ Q(Ar, [["render", Fr]]), Tr = {
625
+ components: { CodeXml: $t },
626
626
  props: { editor: Object },
627
627
  methods: {
628
628
  toggleCodeBlock() {
@@ -630,18 +630,18 @@ const Cr = /* @__PURE__ */ X(_r, [["render", $r]]), Ar = {
630
630
  }
631
631
  }
632
632
  };
633
- function Fr(t, e, a, s, n, r) {
634
- const l = G("CodeXml");
635
- return v(), k("button", {
633
+ function Lr(t, e, a, s, n, o) {
634
+ const l = Z("CodeXml");
635
+ return v(), w("button", {
636
636
  title: "Code Block",
637
- onClick: e[0] || (e[0] = (...c) => r.toggleCodeBlock && r.toggleCodeBlock(...c)),
637
+ onClick: e[0] || (e[0] = (...c) => o.toggleCodeBlock && o.toggleCodeBlock(...c)),
638
638
  class: E(["text-gray-500 w-[30px] h-[30px] flex items-center justify-center rounded-full hover:text-gray-900 hover:bg-gray-100", { "bg-gray-100 text-gray-900": a.editor?.isActive("codeBlock") }])
639
639
  }, [
640
- F(l, { class: "h-4 w-4" })
640
+ C(l, { class: "h-4 w-4" })
641
641
  ], 2);
642
642
  }
643
- const Sr = /* @__PURE__ */ X(Ar, [["render", Fr]]), Tr = {
644
- components: { Bold: kt },
643
+ const Br = /* @__PURE__ */ Q(Tr, [["render", Lr]]), Er = {
644
+ components: { Bold: Ct },
645
645
  props: {
646
646
  editor: Object
647
647
  },
@@ -651,19 +651,19 @@ const Sr = /* @__PURE__ */ X(Ar, [["render", Fr]]), Tr = {
651
651
  }
652
652
  }
653
653
  };
654
- function Lr(t, e, a, s, n, r) {
655
- const l = G("Bold");
656
- return v(), k("button", {
654
+ function Ir(t, e, a, s, n, o) {
655
+ const l = Z("Bold");
656
+ return v(), w("button", {
657
657
  title: "Bold Text",
658
- onClick: e[0] || (e[0] = (...c) => r.toggleBold && r.toggleBold(...c)),
658
+ onClick: e[0] || (e[0] = (...c) => o.toggleBold && o.toggleBold(...c)),
659
659
  class: E(["h-[30px] w-[30px] flex items-center justify-center text-gray-500 rounded-full cursor-pointer hover:text-gray-900 hover:bg-gray-100", { "bg-gray-100 text-gray-900": a.editor?.isActive("bold") }])
660
660
  }, [
661
- F(l, { class: "h-4 w-4" }),
661
+ C(l, { class: "h-4 w-4" }),
662
662
  e[1] || (e[1] = d("span", { class: "sr-only" }, "Bold", -1))
663
663
  ], 2);
664
664
  }
665
- const Br = /* @__PURE__ */ X(Tr, [["render", Lr]]), Er = {
666
- components: { Italic: _t },
665
+ const Pr = /* @__PURE__ */ Q(Er, [["render", Ir]]), jr = {
666
+ components: { Italic: At },
667
667
  props: {
668
668
  editor: Object
669
669
  },
@@ -673,53 +673,53 @@ const Br = /* @__PURE__ */ X(Tr, [["render", Lr]]), Er = {
673
673
  }
674
674
  }
675
675
  };
676
- function Ir(t, e, a, s, n, r) {
677
- const l = G("Italic");
678
- return v(), k("button", {
676
+ function Mr(t, e, a, s, n, o) {
677
+ const l = Z("Italic");
678
+ return v(), w("button", {
679
679
  title: "Italic Text",
680
- onClick: e[0] || (e[0] = (...c) => r.toggleItalic && r.toggleItalic(...c)),
680
+ onClick: e[0] || (e[0] = (...c) => o.toggleItalic && o.toggleItalic(...c)),
681
681
  class: E(["h-[30px] w-[30px] flex items-center justify-center text-gray-500 rounded-full cursor-pointer hover:text-gray-900 hover:bg-gray-100", { "bg-gray-100 text-gray-900": a.editor?.isActive("italic") }])
682
682
  }, [
683
- F(l, { class: "h-4 w-4" }),
683
+ C(l, { class: "h-4 w-4" }),
684
684
  e[1] || (e[1] = d("span", { class: "sr-only" }, "Italic", -1))
685
685
  ], 2);
686
686
  }
687
- const Pr = /* @__PURE__ */ X(Er, [["render", Ir]]), jr = {
687
+ const Hr = /* @__PURE__ */ Q(jr, [["render", Mr]]), Nr = {
688
688
  __name: "vs-editor-underline",
689
689
  props: { editor: Object },
690
690
  setup(t) {
691
691
  const e = t, a = () => {
692
692
  e.editor && e.editor.chain().focus().toggleUnderline().run();
693
693
  };
694
- return (s, n) => (v(), k("button", {
694
+ return (s, n) => (v(), w("button", {
695
695
  title: "Underline",
696
696
  onClick: a,
697
697
  class: E(["w-[30px] h-[30px] flex items-center justify-center rounded-full hover:text-gray-900 hover:bg-gray-100", [
698
698
  t.editor?.isActive("underline") ? "bg-gray-100 text-gray-900" : "text-gray-500"
699
699
  ]])
700
700
  }, [
701
- F(L($t), { class: "h-4 w-4" })
701
+ C(L(Ft), { class: "h-4 w-4" })
702
702
  ], 2));
703
703
  }
704
- }, Mr = {
704
+ }, zr = {
705
705
  __name: "vs-editor-strike",
706
706
  props: { editor: Object },
707
707
  setup(t) {
708
708
  const e = t, a = () => {
709
709
  e.editor && e.editor.chain().focus().toggleStrike().run();
710
710
  };
711
- return (s, n) => (v(), k("button", {
711
+ return (s, n) => (v(), w("button", {
712
712
  title: "Strikethrough",
713
713
  onClick: a,
714
714
  class: E(["w-[30px] h-[30px] flex items-center justify-center rounded-full hover:text-gray-900 hover:bg-gray-100", [
715
715
  t.editor?.isActive("strike") ? "bg-gray-100 text-gray-900" : "text-gray-500"
716
716
  ]])
717
717
  }, [
718
- F(L(Ct), { class: "h-4 w-4" })
718
+ C(L(St), { class: "h-4 w-4" })
719
719
  ], 2));
720
720
  }
721
- }, Hr = {
722
- components: { X: Be },
721
+ }, Dr = {
722
+ components: { X: Pe },
723
723
  props: {
724
724
  visible: { type: Boolean, default: () => !1 },
725
725
  modelValue: { type: Boolean, default: () => !1 },
@@ -761,63 +761,63 @@ const Pr = /* @__PURE__ */ X(Er, [["render", Ir]]), jr = {
761
761
  e && t.target.classList.contains("vs-dialog-overlay") && this.handleClose();
762
762
  }
763
763
  }
764
- }, Nr = {
764
+ }, Vr = {
765
765
  key: 0,
766
766
  class: "vsTailwind ui-dialog__wrapper"
767
- }, zr = { class: "py-2.5 px-4 flex justify-between items-center border-0 border-b border-solid border-gray-200 dark:border-b-[#454545]" }, Dr = { class: "font-medium text-gray-800 dark:text-[#ffffff]" }, Or = { class: "ui-dialog__content p-4" }, Vr = {
767
+ }, Or = { class: "py-2.5 px-4 flex justify-between items-center border-0 border-b border-solid border-gray-200 dark:border-b-[#454545]" }, Rr = { class: "font-medium text-gray-800 dark:text-[#ffffff]" }, Ur = { class: "ui-dialog__content p-4" }, qr = {
768
768
  key: 0,
769
769
  class: "flex justify-end gap-x-2"
770
770
  };
771
- function Rr(t, e, a, s, n, r) {
772
- const l = G("X");
773
- return v(), K(Ke, { to: "body" }, [
774
- a.visible || a.modelValue ? (v(), k("div", Nr, [
771
+ function Kr(t, e, a, s, n, o) {
772
+ const l = Z("X");
773
+ return v(), W(Ge, { to: "body" }, [
774
+ a.visible || a.modelValue ? (v(), w("div", Vr, [
775
775
  d("div", {
776
- onMousedown: e[1] || (e[1] = (c) => r.closeByClickBack(c, a.closeClickBack)),
776
+ onMousedown: e[1] || (e[1] = (c) => o.closeByClickBack(c, a.closeClickBack)),
777
777
  class: "vs-dialog-overlay vs-dialog w-full h-full fixed top-0 start-0 z-[100001] bg-black bg-opacity-50"
778
778
  }, [
779
- F(We, {
779
+ C(Ye, {
780
780
  name: "content",
781
781
  appear: ""
782
782
  }, {
783
- default: R(() => [
783
+ default: q(() => [
784
784
  d("div", {
785
- class: E(["ui-dialog__modal opacity-1 flex flex-col bg-white dark:bg-[#1A1A1A] border dark:border-[#454545] pointer-events-auto shadow-[0_10px_40px_10px_rgba(0,0,0,0.08)] rounded-xl", [r.checkSize]])
785
+ class: E(["ui-dialog__modal opacity-1 flex flex-col bg-white dark:bg-[#1A1A1A] border dark:border-[#454545] pointer-events-auto shadow-[0_10px_40px_10px_rgba(0,0,0,0.08)] rounded-xl", [o.checkSize]])
786
786
  }, [
787
- d("div", zr, [
788
- d("h3", Dr, W(a.title), 1),
787
+ d("div", Or, [
788
+ d("h3", Rr, Y(a.title), 1),
789
789
  d("button", {
790
790
  type: "button",
791
791
  class: "size-8 inline-flex justify-center items-center gap-x-2 rounded-full border border-transparent bg-gray-100 text-gray-800 hover:bg-gray-200 focus:outline-none focus:bg-gray-200 disabled:opacity-50 disabled:pointer-events-none dark:bg-neutral-700 dark:hover:bg-neutral-600 dark:text-neutral-400 dark:focus:bg-neutral-600",
792
- onClick: e[0] || (e[0] = (...c) => r.handleClose && r.handleClose(...c))
792
+ onClick: e[0] || (e[0] = (...c) => o.handleClose && o.handleClose(...c))
793
793
  }, [
794
794
  e[2] || (e[2] = d("span", { class: "sr-only" }, "Close", -1)),
795
- F(l, { class: "h-4 w-4 flex-shrink-0" })
795
+ C(l, { class: "h-4 w-4 flex-shrink-0" })
796
796
  ])
797
797
  ]),
798
- d("div", Or, [
799
- be(t.$slots, "default", {}, void 0, !0)
798
+ d("div", Ur, [
799
+ we(t.$slots, "default", {}, void 0, !0)
800
800
  ]),
801
- r.hasSlot ? (v(), k("div", Vr, [
802
- be(t.$slots, "footer", {
803
- handleClose: r.handleClose,
804
- handleConfirm: r.handleConfirm,
805
- handleCancel: r.handleCancel
801
+ o.hasSlot ? (v(), w("div", qr, [
802
+ we(t.$slots, "footer", {
803
+ handleClose: o.handleClose,
804
+ handleConfirm: o.handleConfirm,
805
+ handleCancel: o.handleCancel
806
806
  }, void 0, !0)
807
- ])) : V("", !0)
807
+ ])) : U("", !0)
808
808
  ], 2)
809
809
  ]),
810
810
  _: 3
811
811
  })
812
812
  ], 32)
813
- ])) : V("", !0)
813
+ ])) : U("", !0)
814
814
  ]);
815
815
  }
816
- const et = /* @__PURE__ */ X(Hr, [["render", Rr], ["__scopeId", "data-v-56ad9010"]]), Ur = at({
816
+ const ot = /* @__PURE__ */ Q(Dr, [["render", Kr], ["__scopeId", "data-v-56ad9010"]]), Wr = it({
817
817
  components: {
818
- IconClose: Be,
819
- IconSearch: Ft,
820
- IconEmail: At
818
+ IconClose: Pe,
819
+ IconSearch: Lt,
820
+ IconEmail: Tt
821
821
  },
822
822
  inheritAttrs: !1,
823
823
  props: {
@@ -896,39 +896,39 @@ const et = /* @__PURE__ */ X(Hr, [["render", Rr], ["__scopeId", "data-v-56ad9010
896
896
  await this.$refs.vsText?.focus();
897
897
  }
898
898
  }
899
- }), qr = { class: "vs-form-text relative bg-white rounded-lg" }, Kr = {
899
+ }), Xr = { class: "vs-form-text relative bg-white rounded-lg" }, Gr = {
900
900
  key: 2,
901
901
  class: "absolute bottom-2/4 translate-y-2/4 left-[10px] cursor-pointer"
902
- }, Wr = ["disabled", "type", "placeholder"];
903
- function Xr(t, e, a, s, n, r) {
904
- const l = G("IconClose"), c = G("IconSearch"), o = G("IconEmail");
905
- return v(), k("div", qr, [
906
- t.clearable && t.value ? (v(), k("div", {
902
+ }, Yr = ["disabled", "type", "placeholder"];
903
+ function Qr(t, e, a, s, n, o) {
904
+ const l = Z("IconClose"), c = Z("IconSearch"), r = Z("IconEmail");
905
+ return v(), w("div", Xr, [
906
+ t.clearable && t.value ? (v(), w("div", {
907
907
  key: 0,
908
908
  class: "absolute bottom-2/4 translate-y-2/4 right-3 cursor-pointer",
909
909
  onClick: e[0] || (e[0] = (...i) => t.clearInput && t.clearInput(...i))
910
910
  }, [
911
- F(l, { class: "h-4 w-4 stroke-gray-500 transition-all hover:stroke-red-500" })
912
- ])) : V("", !0),
913
- t.icon && t.icon === "search" ? (v(), k("div", {
911
+ C(l, { class: "h-4 w-4 stroke-gray-500 transition-all hover:stroke-red-500" })
912
+ ])) : U("", !0),
913
+ t.icon && t.icon === "search" ? (v(), w("div", {
914
914
  key: 1,
915
915
  class: E(["absolute bottom-2/4 translate-y-2/4 cursor-pointer", t.iconStylePosition])
916
916
  }, [
917
- F(c, { class: "h-4 w-4 stroke-gray-500 transition-all" })
918
- ], 2)) : t.icon && t.icon === "email" ? (v(), k("div", Kr, [
919
- F(o, { class: "h-4 w-4 stroke-gray-500 transition-all" })
920
- ])) : (v(), k("i", {
917
+ C(c, { class: "h-4 w-4 stroke-gray-500 transition-all" })
918
+ ], 2)) : t.icon && t.icon === "email" ? (v(), w("div", Gr, [
919
+ C(r, { class: "h-4 w-4 stroke-gray-500 transition-all" })
920
+ ])) : (v(), w("i", {
921
921
  key: 3,
922
922
  class: E(["absolute bottom-2/4 translate-y-2/4 text-gray-500 cursor-pointer", ["ti " + t.icon, t.iconStylePosition]])
923
923
  }, null, 2)),
924
- t.clearable && t.value ? (v(), k("div", {
924
+ t.clearable && t.value ? (v(), w("div", {
925
925
  key: 4,
926
926
  class: "absolute bottom-2/4 translate-y-2/4 right-3 cursor-pointer",
927
927
  onClick: e[1] || (e[1] = (...i) => t.clearInput && t.clearInput(...i))
928
928
  }, [
929
- F(l, { class: "h-4 w-4 stroke-gray-500 transition-all hover:stroke-red-500" })
930
- ])) : V("", !0),
931
- ce(d("input", nt({
929
+ C(l, { class: "h-4 w-4 stroke-gray-500 transition-all hover:stroke-red-500" })
930
+ ])) : U("", !0),
931
+ de(d("input", ct({
932
932
  ref: "vsText",
933
933
  disabled: t.disabled,
934
934
  type: t.type,
@@ -939,109 +939,109 @@ function Xr(t, e, a, s, n, r) {
939
939
  onFocus: e[4] || (e[4] = (...i) => t.handleFocus && t.handleFocus(...i)),
940
940
  onBlur: e[5] || (e[5] = (...i) => t.handleBlur && t.handleBlur(...i)),
941
941
  class: [[t.inputStyle, t.checkSize], "py-2 px-3 block w-full border border-solid placeholder:text-nowrap border-stone-200 rounded-lg text-sm text-stone-800 placeholder:text-stone-400 focus:outline focus:z-10 focus:border-blue-500 focus:ring-blue-500 focus:outline-blue-500"]
942
- }), null, 16, Wr), [
943
- [st, t.value]
942
+ }), null, 16, Yr), [
943
+ [dt, t.value]
944
944
  ])
945
945
  ]);
946
946
  }
947
- const tt = /* @__PURE__ */ X(Ur, [["render", Xr], ["__scopeId", "data-v-eb21a54f"]]), Gr = ["title"], Yr = { class: "flex flex-col gap-3 p-[20px]" }, Qr = { class: "relative flex items-center gap-2" }, Zr = { class: "flex-1" }, Jr = {
947
+ const lt = /* @__PURE__ */ Q(Wr, [["render", Qr], ["__scopeId", "data-v-eb21a54f"]]), Zr = ["title"], Jr = { class: "flex flex-col gap-3 p-[20px]" }, eo = { class: "relative flex items-center gap-2" }, to = { class: "flex-1" }, ro = {
948
948
  key: 0,
949
949
  class: "flex items-center gap-2 flex-shrink-0"
950
- }, eo = ["title"], to = ["title"], ro = { class: "flex items-center gap-2" }, oo = {
950
+ }, oo = ["title"], lo = ["title"], ao = { class: "flex items-center gap-2" }, no = {
951
951
  for: "openInNewTab",
952
952
  class: "text-sm text-gray-700 cursor-pointer"
953
- }, lo = { class: "flex justify-end p-[20px] gap-[10px] border-t w-full" }, ao = /* @__PURE__ */ Object.assign({
953
+ }, so = { class: "flex justify-end p-[20px] gap-[10px] border-t w-full" }, io = /* @__PURE__ */ Object.assign({
954
954
  inheritAttrs: !1
955
955
  }, {
956
956
  __name: "vs-editor-link",
957
957
  props: { editor: Object },
958
958
  setup(t) {
959
- const { t: e } = Me(), a = t, s = C(!1), n = C(""), r = C(!1), l = C(!1), c = () => {
959
+ const { t: e } = ze(), a = t, s = $(!1), n = $(""), o = $(!1), l = $(!1), c = () => {
960
960
  if (!a.editor) return;
961
961
  a.editor.chain().focus().extendMarkRange("link").run();
962
- const p = a.editor.getAttributes("link");
963
- p.href ? (r.value = !0, n.value = p.href, l.value = p.target === "_blank") : (r.value = !1, n.value = "", l.value = !1), s.value = !0;
964
- }, o = () => {
965
- s.value = !1, n.value = "", r.value = !1, l.value = !1;
962
+ const f = a.editor.getAttributes("link");
963
+ f.href ? (o.value = !0, n.value = f.href, l.value = f.target === "_blank") : (o.value = !1, n.value = "", l.value = !1), s.value = !0;
964
+ }, r = () => {
965
+ s.value = !1, n.value = "", o.value = !1, l.value = !1;
966
966
  }, i = () => {
967
967
  if (!a.editor || !n.value.trim()) return;
968
- let p = n.value.trim();
969
- p.match(/^https?:\/\//i) || (p = "https://" + p), a.editor.chain().focus().setLink({
970
- href: p,
968
+ let f = n.value.trim();
969
+ f.match(/^https?:\/\//i) || (f = "https://" + f), a.editor.chain().focus().setLink({
970
+ href: f,
971
971
  target: l.value ? "_blank" : null
972
- }).run(), o();
973
- }, w = () => {
974
- a.editor && (a.editor.chain().focus().unsetLink().run(), o());
972
+ }).run(), r();
973
+ }, x = () => {
974
+ a.editor && (a.editor.chain().focus().unsetLink().run(), r());
975
975
  }, b = () => {
976
976
  if (!n.value) return;
977
- let p = n.value.trim();
978
- p.match(/^https?:\/\//i) || (p = "https://" + p), window.open(p, "_blank", "noopener,noreferrer");
977
+ let f = n.value.trim();
978
+ f.match(/^https?:\/\//i) || (f = "https://" + f), window.open(f, "_blank", "noopener,noreferrer");
979
979
  };
980
- return (p, g) => (v(), k(re, null, [
980
+ return (f, p) => (v(), w(ae, null, [
981
981
  d("button", {
982
982
  title: L(e)("form.richtext.link") || "Посилання",
983
983
  onClick: c,
984
984
  class: E(["text-gray-500 w-[30px] h-[30px] flex items-center justify-center rounded-full hover:text-gray-900 hover:bg-gray-100 focus:outline-none", { "bg-gray-100 text-gray-900": t.editor?.isActive("link") }])
985
985
  }, [
986
- F(L(St), { class: "h-4 w-4" })
987
- ], 10, Gr),
988
- F(et, {
989
- title: r.value ? L(e)("form.richtext.editLink") || "Редагувати посилання" : L(e)("form.richtext.linkTitle") || "Додати посилання",
986
+ C(L(Bt), { class: "h-4 w-4" })
987
+ ], 10, Zr),
988
+ C(ot, {
989
+ title: o.value ? L(e)("form.richtext.editLink") || "Редагувати посилання" : L(e)("form.richtext.linkTitle") || "Додати посилання",
990
990
  visible: s.value,
991
- "onUpdate:visible": g[2] || (g[2] = (P) => s.value = P),
991
+ "onUpdate:visible": p[2] || (p[2] = (I) => s.value = I),
992
992
  size: "small"
993
993
  }, {
994
- footer: R(() => [
995
- d("div", lo, [
994
+ footer: q(() => [
995
+ d("div", so, [
996
996
  d("button", {
997
997
  style: { border: "1px solid #000" },
998
- onClick: o,
998
+ onClick: r,
999
999
  class: "py-2 px-3 inline-flex items-center gap-x-2 text-sm whitespace-nowrap text-black border-gray-200 rounded-lg !border-gray-200 hover:bg-gray-100 duration-300"
1000
- }, W(L(e)("form.richtext.cancel") || "Скасувати"), 1),
1000
+ }, Y(L(e)("form.richtext.cancel") || "Скасувати"), 1),
1001
1001
  d("button", {
1002
1002
  onClick: i,
1003
1003
  class: "py-2 px-3 inline-flex items-center gap-x-2 text-[14px] font-[400] whitespace-nowrap text-white bg-blue-500 rounded-lg !border-gray-200 hover:bg-blue-700 duration-300"
1004
- }, W(r.value ? L(e)("form.richtext.update") || "Оновити" : L(e)("form.richtext.create") || "Створити"), 1)
1004
+ }, Y(o.value ? L(e)("form.richtext.update") || "Оновити" : L(e)("form.richtext.create") || "Створити"), 1)
1005
1005
  ])
1006
1006
  ]),
1007
- default: R(() => [
1008
- d("div", Yr, [
1009
- d("div", Qr, [
1010
- d("div", Zr, [
1011
- F(tt, {
1007
+ default: q(() => [
1008
+ d("div", Jr, [
1009
+ d("div", eo, [
1010
+ d("div", to, [
1011
+ C(lt, {
1012
1012
  modelValue: n.value,
1013
- "onUpdate:modelValue": g[0] || (g[0] = (P) => n.value = P),
1013
+ "onUpdate:modelValue": p[0] || (p[0] = (I) => n.value = I),
1014
1014
  placeholder: L(e)("form.richtext.linkUrl") || "Введіть URL",
1015
1015
  class: "w-full"
1016
1016
  }, null, 8, ["modelValue", "placeholder"])
1017
1017
  ]),
1018
- r.value ? (v(), k("div", Jr, [
1018
+ o.value ? (v(), w("div", ro, [
1019
1019
  d("button", {
1020
1020
  onClick: b,
1021
1021
  class: "text-gray-500 w-[30px] h-[30px] flex items-center justify-center rounded-full hover:text-gray-900 hover:bg-gray-100 focus:outline-none transition-colors",
1022
1022
  title: L(e)("form.richtext.openLink") || "Відкрити посилання"
1023
1023
  }, [
1024
- F(L(Tt), { class: "h-4 w-4" })
1025
- ], 8, eo),
1024
+ C(L(Et), { class: "h-4 w-4" })
1025
+ ], 8, oo),
1026
1026
  d("button", {
1027
- onClick: w,
1027
+ onClick: x,
1028
1028
  class: "text-gray-500 w-[30px] h-[30px] flex items-center justify-center rounded-full hover:text-red-600 hover:bg-red-50 focus:outline-none transition-colors",
1029
1029
  title: L(e)("form.richtext.removeLink") || "Видалити посилання"
1030
1030
  }, [
1031
- F(L(Lt), { class: "h-4 w-4" })
1032
- ], 8, to)
1033
- ])) : V("", !0)
1031
+ C(L(It), { class: "h-4 w-4" })
1032
+ ], 8, lo)
1033
+ ])) : U("", !0)
1034
1034
  ]),
1035
- d("div", ro, [
1036
- ce(d("input", {
1035
+ d("div", ao, [
1036
+ de(d("input", {
1037
1037
  type: "checkbox",
1038
1038
  id: "openInNewTab",
1039
- "onUpdate:modelValue": g[1] || (g[1] = (P) => l.value = P),
1039
+ "onUpdate:modelValue": p[1] || (p[1] = (I) => l.value = I),
1040
1040
  class: "w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 rounded focus:ring-blue-500"
1041
1041
  }, null, 512), [
1042
- [it, l.value]
1042
+ [ut, l.value]
1043
1043
  ]),
1044
- d("label", oo, W(L(e)("form.richtext.openInNewTab") || "Відкривати в новій вкладці"), 1)
1044
+ d("label", no, Y(L(e)("form.richtext.openInNewTab") || "Відкривати в новій вкладці"), 1)
1045
1045
  ])
1046
1046
  ])
1047
1047
  ]),
@@ -1049,48 +1049,48 @@ const tt = /* @__PURE__ */ X(Ur, [["render", Xr], ["__scopeId", "data-v-eb21a54f
1049
1049
  }, 8, ["title", "visible"])
1050
1050
  ], 64));
1051
1051
  }
1052
- }), me = async (t, e, a, s = 10) => {
1052
+ }), xe = async (t, e, a, s = 10) => {
1053
1053
  if (!e || !a) return;
1054
- await ge();
1055
- const n = await a?.getBoundingClientRect(), r = await e?.getBoundingClientRect();
1056
- if (!r || !n) return;
1057
- const l = await parseInt(e?.getBoundingClientRect()?.height), c = await parseInt(e?.getBoundingClientRect()?.width), o = await parseInt(a?.getBoundingClientRect()?.height), i = await parseInt(a?.getBoundingClientRect()?.width), w = await window.innerHeight, b = await window.innerWidth;
1058
- let p = 0, g = 0;
1059
- const P = r.bottom + s + o;
1054
+ await ue();
1055
+ const n = await a?.getBoundingClientRect(), o = await e?.getBoundingClientRect();
1056
+ if (!o || !n) return;
1057
+ const l = await parseInt(e?.getBoundingClientRect()?.height), c = await parseInt(e?.getBoundingClientRect()?.width), r = await parseInt(a?.getBoundingClientRect()?.height), i = await parseInt(a?.getBoundingClientRect()?.width), x = await window.innerHeight, b = await window.innerWidth;
1058
+ let f = 0, p = 0;
1059
+ const I = o.bottom + s + r;
1060
1060
  switch (t) {
1061
1061
  case "top":
1062
- r.top - n.height - s < 0 ? p = r.top - n.height + s + o + l : p = r.top - n.height - s, b > i + r.right + 30 ? g = r.left - n.width / 2 + r.width / 2 : g = b - 30 - i;
1062
+ o.top - n.height - s < 0 ? f = o.top - n.height + s + r + l : f = o.top - n.height - s, b > i + o.right + 30 ? p = o.left - n.width / 2 + o.width / 2 : p = b - 30 - i;
1063
1063
  break;
1064
1064
  case "bottom":
1065
- w > P ? p = r.bottom + s : p = r.bottom - s - o - l, g = r.left - n.width / 2 + r.width / 2;
1065
+ x > I ? f = o.bottom + s : f = o.bottom - s - r - l, p = o.left - n.width / 2 + o.width / 2;
1066
1066
  break;
1067
1067
  case "left":
1068
- p = r.top - n.height / 2 + r.height / 2, r.left - n.width - s > 0 ? g = r.left - n.width - s : g = 10;
1068
+ f = o.top - n.height / 2 + o.height / 2, o.left - n.width - s > 0 ? p = o.left - n.width - s : p = 10;
1069
1069
  break;
1070
1070
  case "right":
1071
- p = r.top - n.height / 2 + r.height / 2, b - c > i ? g = r.right + s : g = b - 30 - i;
1071
+ f = o.top - n.height / 2 + o.height / 2, b - c > i ? p = o.right + s : p = b - 30 - i;
1072
1072
  break;
1073
1073
  case "top-right":
1074
- r.top - n.height - s < 0 ? p = r.top - n.height + s + o + l : p = r.top - n.height - s, b - c > i ? g = r.right + s : g = b - 30 - i;
1074
+ o.top - n.height - s < 0 ? f = o.top - n.height + s + r + l : f = o.top - n.height - s, b - c > i ? p = o.right + s : p = b - 30 - i;
1075
1075
  break;
1076
1076
  case "top-left":
1077
- r.top - n.height - s < 0 ? p = r.top - n.height + s + o + l : p = r.top - n.height - s, r.left - n.width - s > 0 ? g = r.left - n.width - s : g = 10;
1077
+ o.top - n.height - s < 0 ? f = o.top - n.height + s + r + l : f = o.top - n.height - s, o.left - n.width - s > 0 ? p = o.left - n.width - s : p = 10;
1078
1078
  break;
1079
1079
  case "top-start":
1080
- r.top - n.height - s < 0 ? p = r.top - n.height + s + o + l : p = r.top - n.height - s, r.left > 0 ? g = r.left : g = 10;
1080
+ o.top - n.height - s < 0 ? f = o.top - n.height + s + r + l : f = o.top - n.height - s, o.left > 0 ? p = o.left : p = 10;
1081
1081
  break;
1082
1082
  case "bottom-right":
1083
- w > P ? p = r.bottom + s : p = r.bottom - s - o - l, b - c > i ? g = r.left : g = b - 30 - i;
1083
+ x > I ? f = o.bottom + s : f = o.bottom - s - r - l, b - c > i ? p = o.left : p = b - 30 - i;
1084
1084
  break;
1085
1085
  case "bottom-left":
1086
- w > P ? p = r.bottom + s : p = r.bottom - s - o - l, r.left > 0 ? g = r.right - i : g = 10;
1086
+ x > I ? f = o.bottom + s : f = o.bottom - s - r - l, o.left > 0 ? p = o.right - i : p = 10;
1087
1087
  break;
1088
1088
  case "bottom-start":
1089
- w > P ? p = r.bottom + s : p = r.bottom - s - o - l, r.left > 0 ? g = r.left : g = 10;
1089
+ x > I ? f = o.bottom + s : f = o.bottom - s - r - l, o.left > 0 ? p = o.left : p = 10;
1090
1090
  break;
1091
1091
  }
1092
- p + o > w ? p = w - o - s : p < 0 && (p = s), g + i > b ? g = b - i - s : g < 0 && (g = s), a instanceof HTMLElement && (a.style.top = `${p}px`, a.style.left = `${g}px`, a.style.position = "fixed");
1093
- }, no = { class: "text-center" }, so = { class: "py-2 px-4 w-full text-sm text-stone-800 bg-white shadow-[0_10px_40px_10px_rgba(0,0,0,0.08)] rounded-lg focus:outline-none focus:bg-stone-100 dark:bg-neutral-900 dark:text-neutral-200 dark:focus:bg-neutral-800 after:h-4 after:absolute after:-bottom-4 after:start-0 after:w-full before:h-4 before:absolute before:-top-4 before:start-0 before:w-full" }, de = /* @__PURE__ */ Object.assign({
1092
+ f + r > x ? f = x - r - s : f < 0 && (f = s), p + i > b ? p = b - i - s : p < 0 && (p = s), a instanceof HTMLElement && (a.style.top = `${f}px`, a.style.left = `${p}px`, a.style.position = "fixed");
1093
+ }, co = { class: "text-center" }, uo = { class: "py-2 px-4 w-full text-sm text-stone-800 bg-white shadow-[0_10px_40px_10px_rgba(0,0,0,0.08)] rounded-lg focus:outline-none focus:bg-stone-100 dark:bg-neutral-900 dark:text-neutral-200 dark:focus:bg-neutral-800 after:h-4 after:absolute after:-bottom-4 after:start-0 after:w-full before:h-4 before:absolute before:-top-4 before:start-0 before:w-full" }, fe = /* @__PURE__ */ Object.assign({
1094
1094
  inheritAttrs: !1
1095
1095
  }, {
1096
1096
  __name: "vs-popover",
@@ -1105,98 +1105,98 @@ const tt = /* @__PURE__ */ X(Ur, [["render", Xr], ["__scopeId", "data-v-eb21a54f
1105
1105
  },
1106
1106
  emits: ["isvisible"],
1107
1107
  setup(t, { expose: e, emit: a }) {
1108
- const s = t, n = a, r = C(!1), l = C([]), c = C(null), o = C(null), i = C(null);
1109
- we(r, (I) => {
1110
- I ? (w(), window.addEventListener(
1108
+ const s = t, n = a, o = $(!1), l = $([]), c = $(null), r = $(null), i = $(null);
1109
+ me(o, (P) => {
1110
+ P ? (x(), window.addEventListener(
1111
1111
  "resize",
1112
- () => me(s.placement, o.value, i.value)
1113
- ), me(s.placement, o.value, i.value)) : window.removeEventListener(
1112
+ () => xe(s.placement, r.value, i.value)
1113
+ ), xe(s.placement, r.value, i.value)) : window.removeEventListener(
1114
1114
  "resize",
1115
- () => me(s.placement, o.value, i.value)
1116
- ), n("isvisible", I);
1117
- }), he(() => {
1118
- window.addEventListener("click", z), window.addEventListener("popstate", U), window.addEventListener("scroll", Y, !0), w();
1119
- }), Xe(() => {
1120
- window.removeEventListener("click", z), window.removeEventListener("popstate", U), b();
1115
+ () => xe(s.placement, r.value, i.value)
1116
+ ), n("isvisible", P);
1117
+ }), be(() => {
1118
+ window.addEventListener("click", O), window.addEventListener("popstate", R), window.addEventListener("scroll", J, !0), x();
1119
+ }), Qe(() => {
1120
+ window.removeEventListener("click", O), window.removeEventListener("popstate", R), b();
1121
1121
  });
1122
- const w = () => {
1123
- let I = c.value;
1124
- for (; I && I !== document.body; )
1125
- (I.scrollHeight > I.clientHeight || I.scrollWidth > I.clientWidth) && (I.addEventListener("scroll", O), l.value.push(I)), I = I.parentElement;
1126
- document.body && (document.body.addEventListener("scroll", O), l.value.push(document.body));
1122
+ const x = () => {
1123
+ let P = c.value;
1124
+ for (; P && P !== document.body; )
1125
+ (P.scrollHeight > P.clientHeight || P.scrollWidth > P.clientWidth) && (P.addEventListener("scroll", V), l.value.push(P)), P = P.parentElement;
1126
+ document.body && (document.body.addEventListener("scroll", V), l.value.push(document.body));
1127
1127
  }, b = () => {
1128
- l.value.forEach((I) => {
1129
- I.removeEventListener("scroll", O);
1128
+ l.value.forEach((P) => {
1129
+ P.removeEventListener("scroll", V);
1130
1130
  }), l.value = [];
1131
+ }, f = () => {
1132
+ o.value = !0, xe(s.placement, r.value, i.value);
1131
1133
  }, p = () => {
1132
- r.value = !0, me(s.placement, o.value, i.value);
1133
- }, g = () => {
1134
- r.value = !1;
1135
- }, P = async () => {
1136
- await me(s.placement, o.value, i.value), r.value = !r.value;
1137
- }, O = () => {
1138
- r.value = !1;
1139
- }, z = (I) => {
1140
- if (!I) {
1141
- r.value = !1;
1134
+ o.value = !1;
1135
+ }, I = async () => {
1136
+ await xe(s.placement, r.value, i.value), o.value = !o.value;
1137
+ }, V = () => {
1138
+ o.value = !1;
1139
+ }, O = (P) => {
1140
+ if (!P) {
1141
+ o.value = !1;
1142
1142
  return;
1143
1143
  }
1144
- o.value?.contains(I.target) || i.value?.contains(I.target) || (r.value = !1);
1145
- }, U = () => {
1146
- r.value && (r.value = !1);
1147
- }, Y = (I) => {
1148
- r.value && i.value && !i.value.contains(I.target) && (r.value = !1);
1144
+ r.value?.contains(P.target) || i.value?.contains(P.target) || (o.value = !1);
1145
+ }, R = () => {
1146
+ o.value && (o.value = !1);
1147
+ }, J = (P) => {
1148
+ o.value && i.value && !i.value.contains(P.target) && (o.value = !1);
1149
1149
  };
1150
1150
  return e({
1151
- togglePopover: P
1152
- }), (I, Q) => (v(), k("div", {
1151
+ togglePopover: I
1152
+ }), (P, ee) => (v(), w("div", {
1153
1153
  ref_key: "popover",
1154
1154
  ref: c,
1155
1155
  class: "vs-popover inline-block"
1156
1156
  }, [
1157
- d("div", no, [
1158
- t.trigger === "click" ? (v(), k("div", {
1157
+ d("div", co, [
1158
+ t.trigger === "click" ? (v(), w("div", {
1159
1159
  key: 0,
1160
1160
  ref_key: "popoverRef",
1161
- ref: o,
1162
- onClick: P,
1161
+ ref: r,
1162
+ onClick: I,
1163
1163
  class: E({ "pointer-events-none": t.disabled })
1164
1164
  }, [
1165
- be(I.$slots, "reference", {}, () => [
1166
- Q[0] || (Q[0] = d("button", null, "Click me!", -1))
1165
+ we(P.$slots, "reference", {}, () => [
1166
+ ee[0] || (ee[0] = d("button", null, "Click me!", -1))
1167
1167
  ])
1168
- ], 2)) : V("", !0),
1169
- t.trigger === "hover" ? (v(), k("div", {
1168
+ ], 2)) : U("", !0),
1169
+ t.trigger === "hover" ? (v(), w("div", {
1170
1170
  key: 1,
1171
1171
  ref_key: "popoverRef",
1172
- ref: o,
1173
- onMouseover: p,
1174
- onMouseleave: g,
1172
+ ref: r,
1173
+ onMouseover: f,
1174
+ onMouseleave: p,
1175
1175
  class: E({ "pointer-events-none": t.disabled })
1176
1176
  }, [
1177
- be(I.$slots, "reference", {}, () => [
1178
- Q[1] || (Q[1] = d("button", null, "Click me!", -1))
1177
+ we(P.$slots, "reference", {}, () => [
1178
+ ee[1] || (ee[1] = d("button", null, "Click me!", -1))
1179
1179
  ])
1180
- ], 34)) : V("", !0),
1181
- (v(), K(Ke, { to: t.teleport }, [
1182
- F(We, { name: "fade" }, {
1183
- default: R(() => [
1184
- ce(d("div", {
1180
+ ], 34)) : U("", !0),
1181
+ (v(), W(Ge, { to: t.teleport }, [
1182
+ C(Ye, { name: "fade" }, {
1183
+ default: q(() => [
1184
+ de(d("div", {
1185
1185
  class: E(["vsTailwind vs-popover__content", t.placement]),
1186
1186
  ref_key: "contentPop",
1187
1187
  ref: i,
1188
- style: le({
1188
+ style: se({
1189
1189
  width: t.width ? t.width + "px" : "fit-content",
1190
1190
  zIndex: 100001
1191
1191
  })
1192
1192
  }, [
1193
- d("div", so, [
1194
- be(I.$slots, "default", {}, () => [
1195
- Q[2] || (Q[2] = d("span", null, "Popover content", -1))
1193
+ d("div", uo, [
1194
+ we(P.$slots, "default", {}, () => [
1195
+ ee[2] || (ee[2] = d("span", null, "Popover content", -1))
1196
1196
  ])
1197
1197
  ])
1198
1198
  ], 6), [
1199
- [ke, r.value]
1199
+ [$e, o.value]
1200
1200
  ])
1201
1201
  ]),
1202
1202
  _: 3
@@ -1205,126 +1205,126 @@ const tt = /* @__PURE__ */ X(Ur, [["render", Xr], ["__scopeId", "data-v-eb21a54f
1205
1205
  ])
1206
1206
  ], 512));
1207
1207
  }
1208
- }), io = { class: "flex flex-col gap-[2px] p-[2px]" }, co = ["onClick"], uo = {
1208
+ }), fo = { class: "flex flex-col gap-[2px] p-[2px]" }, po = ["onClick"], go = {
1209
1209
  __name: "vs-editor-table",
1210
1210
  props: { editor: Object },
1211
1211
  setup(t) {
1212
- const { t: e } = Me(), a = t, s = C(!1), n = C("popover"), r = () => {
1212
+ const { t: e } = ze(), a = t, s = $(!1), n = $("popover"), o = () => {
1213
1213
  a.editor && (a.editor.chain().focus().insertTable({ rows: 3, cols: 3, withHeaderRow: !0 }).run(), n.value.togglePopover());
1214
1214
  }, l = () => {
1215
1215
  a.editor && (a.editor.chain().focus().addColumnAfter().run(), n.value.togglePopover());
1216
1216
  }, c = () => {
1217
1217
  a.editor && (a.editor.chain().focus().addRowAfter().run(), n.value.togglePopover());
1218
- }, o = () => {
1218
+ }, r = () => {
1219
1219
  a.editor && (a.editor.chain().focus().deleteColumn().run(), n.value.togglePopover());
1220
1220
  }, i = () => {
1221
1221
  a.editor && (a.editor.chain().focus().deleteRow().run(), n.value.togglePopover());
1222
- }, w = () => {
1222
+ }, x = () => {
1223
1223
  a.editor && (a.editor.chain().focus().deleteTable().run(), n.value.togglePopover());
1224
1224
  }, b = () => {
1225
1225
  a.editor && (a.editor.chain().focus().mergeCells().run(), n.value.togglePopover());
1226
- }, p = () => {
1226
+ }, f = () => {
1227
1227
  a.editor && (a.editor.chain().focus().splitCell().run(), n.value.togglePopover());
1228
- }, g = H(() => [
1229
- { text: e("form.richtext.createTable"), function: r },
1228
+ }, p = N(() => [
1229
+ { text: e("form.richtext.createTable"), function: o },
1230
1230
  { text: e("form.richtext.addColumn"), function: l },
1231
1231
  { text: e("form.richtext.addRow"), function: c },
1232
- { text: e("form.richtext.deleteColumn"), function: o },
1232
+ { text: e("form.richtext.deleteColumn"), function: r },
1233
1233
  { text: e("form.richtext.deleteRow"), function: i },
1234
- { text: e("form.richtext.deleteTable"), function: w },
1234
+ { text: e("form.richtext.deleteTable"), function: x },
1235
1235
  { text: e("form.richtext.mergeCells"), function: b },
1236
- { text: e("form.richtext.splitCells"), function: p }
1236
+ { text: e("form.richtext.splitCells"), function: f }
1237
1237
  ]);
1238
- return (P, O) => (v(), K(de, {
1238
+ return (I, V) => (v(), W(fe, {
1239
1239
  ref_key: "popover",
1240
1240
  ref: n,
1241
1241
  placement: "bottom",
1242
- onIsvisible: O[0] || (O[0] = (z) => s.value = z)
1242
+ onIsvisible: V[0] || (V[0] = (O) => s.value = O)
1243
1243
  }, {
1244
- reference: R(() => [
1244
+ reference: q(() => [
1245
1245
  d("button", {
1246
1246
  title: "Table",
1247
1247
  class: E(["w-[30px] h-[30px] flex items-center justify-center text-gray-500 rounded-full hover:text-gray-900 hover:bg-gray-100", [s.value ? "bg-gray-100 text-gray-900" : "text-gray-500"]])
1248
1248
  }, [
1249
- F(L(Bt), { class: "h-4 w-4" })
1249
+ C(L(Pt), { class: "h-4 w-4" })
1250
1250
  ], 2)
1251
1251
  ]),
1252
- default: R(() => [
1253
- d("div", io, [
1254
- (v(!0), k(re, null, ne(g.value, (z, U) => (v(), k("button", {
1255
- key: U,
1256
- onClick: z?.function,
1252
+ default: q(() => [
1253
+ d("div", fo, [
1254
+ (v(!0), w(ae, null, ie(p.value, (O, R) => (v(), w("button", {
1255
+ key: R,
1256
+ onClick: O?.function,
1257
1257
  class: "px-2 py-1 text-gray-500 text-start hover:text-gray-900 hover:bg-gray-100 rounded"
1258
- }, W(z.text), 9, co))), 128))
1258
+ }, Y(O.text), 9, po))), 128))
1259
1259
  ])
1260
1260
  ]),
1261
1261
  _: 1
1262
1262
  }, 512));
1263
1263
  }
1264
- }, fo = { class: "flex gap-[4px] p-1" }, po = ["title", "onClick"], go = {
1264
+ }, ho = { class: "flex gap-[4px] p-1" }, vo = ["title", "onClick"], mo = {
1265
1265
  __name: "vs-editor-align",
1266
1266
  props: { editor: Object },
1267
1267
  setup(t) {
1268
1268
  const e = t, a = {
1269
- left: jt,
1270
- center: Pt,
1271
- right: It,
1272
- justify: Et
1273
- }, s = C(!1), n = C("popover"), r = C("left"), l = H(() => e.editor ? e.editor.isActive("paragraph", { textAlign: "left" }) || e.editor.isActive("heading", { textAlign: "left" }) : !1), c = H(() => e.editor ? e.editor.isActive("paragraph", { textAlign: "right" }) || e.editor.isActive("heading", { textAlign: "right" }) : !1), o = H(() => e.editor ? e.editor.isActive("paragraph", { textAlign: "center" }) || e.editor.isActive("heading", { textAlign: "center" }) : !1), i = H(() => e.editor ? e.editor.isActive("paragraph", { textAlign: "justify" }) || e.editor.isActive("heading", { textAlign: "justify" }) : !1), w = H(() => l.value || c.value || o.value || i.value), b = () => {
1274
- c.value ? r.value = "right" : o.value ? r.value = "center" : i.value ? r.value = "justify" : r.value = "left";
1269
+ left: Nt,
1270
+ center: Ht,
1271
+ right: Mt,
1272
+ justify: jt
1273
+ }, s = $(!1), n = $("popover"), o = $("left"), l = N(() => e.editor ? e.editor.isActive("paragraph", { textAlign: "left" }) || e.editor.isActive("heading", { textAlign: "left" }) : !1), c = N(() => e.editor ? e.editor.isActive("paragraph", { textAlign: "right" }) || e.editor.isActive("heading", { textAlign: "right" }) : !1), r = N(() => e.editor ? e.editor.isActive("paragraph", { textAlign: "center" }) || e.editor.isActive("heading", { textAlign: "center" }) : !1), i = N(() => e.editor ? e.editor.isActive("paragraph", { textAlign: "justify" }) || e.editor.isActive("heading", { textAlign: "justify" }) : !1), x = N(() => l.value || c.value || r.value || i.value), b = () => {
1274
+ c.value ? o.value = "right" : r.value ? o.value = "center" : i.value ? o.value = "justify" : o.value = "left";
1275
1275
  };
1276
- we([l, c, o, i], () => {
1276
+ me([l, c, r, i], () => {
1277
1277
  b();
1278
- }, { immediate: !0 }), he(() => {
1278
+ }, { immediate: !0 }), be(() => {
1279
1279
  e.editor && (e.editor.on("selectionUpdate", b), e.editor.on("update", b));
1280
- }), Ae(() => {
1280
+ }), Le(() => {
1281
1281
  e.editor && (e.editor.off("selectionUpdate", b), e.editor.off("update", b));
1282
1282
  });
1283
- const p = (P) => {
1284
- e.editor && (e.editor.chain().focus().setTextAlign(P).run(), r.value = P);
1285
- }, g = C([
1283
+ const f = (I) => {
1284
+ e.editor && (e.editor.chain().focus().setTextAlign(I).run(), o.value = I);
1285
+ }, p = $([
1286
1286
  { id: "left", isActive: l },
1287
- { id: "center", isActive: o },
1287
+ { id: "center", isActive: r },
1288
1288
  { id: "right", isActive: c },
1289
1289
  { id: "justify", isActive: i }
1290
1290
  ]);
1291
- return (P, O) => (v(), K(de, {
1291
+ return (I, V) => (v(), W(fe, {
1292
1292
  ref_key: "popover",
1293
1293
  ref: n,
1294
1294
  placement: "bottom",
1295
- onIsvisible: O[0] || (O[0] = (z) => s.value = z)
1295
+ onIsvisible: V[0] || (V[0] = (O) => s.value = O)
1296
1296
  }, {
1297
- reference: R(() => [
1297
+ reference: q(() => [
1298
1298
  d("button", {
1299
1299
  title: "Text Align",
1300
- class: E(["w-[30px] h-[30px] flex items-center justify-center text-gray-500 rounded-full hover:text-gray-900 hover:bg-gray-100", [w.value ? "bg-gray-100 text-gray-900" : "text-gray-500"]])
1300
+ class: E(["w-[30px] h-[30px] flex items-center justify-center text-gray-500 rounded-full hover:text-gray-900 hover:bg-gray-100", [x.value ? "bg-gray-100 text-gray-900" : "text-gray-500"]])
1301
1301
  }, [
1302
- (v(), K(Te(a[r.value]), {
1302
+ (v(), W(Ee(a[o.value]), {
1303
1303
  height: "16",
1304
1304
  width: "16"
1305
1305
  }))
1306
1306
  ], 2)
1307
1307
  ]),
1308
- default: R(() => [
1309
- d("div", fo, [
1310
- (v(!0), k(re, null, ne(g.value, (z) => (v(), k("button", {
1311
- title: "Text align " + z?.id,
1312
- class: E(["w-[30px] h-[30px] flex items-center justify-center text-gray-500 rounded hover:text-gray-900 hover:bg-gray-100", { "bg-gray-100 text-gray-900": z?.isActive }]),
1313
- key: z?.id,
1314
- onClick: (U) => p(z?.id)
1308
+ default: q(() => [
1309
+ d("div", ho, [
1310
+ (v(!0), w(ae, null, ie(p.value, (O) => (v(), w("button", {
1311
+ title: "Text align " + O?.id,
1312
+ class: E(["w-[30px] h-[30px] flex items-center justify-center text-gray-500 rounded hover:text-gray-900 hover:bg-gray-100", { "bg-gray-100 text-gray-900": O?.isActive }]),
1313
+ key: O?.id,
1314
+ onClick: (R) => f(O?.id)
1315
1315
  }, [
1316
- (v(), K(Te(a[z?.id]), {
1316
+ (v(), W(Ee(a[O?.id]), {
1317
1317
  height: "16",
1318
1318
  width: "16"
1319
1319
  }))
1320
- ], 10, po))), 128))
1320
+ ], 10, vo))), 128))
1321
1321
  ])
1322
1322
  ]),
1323
1323
  _: 1
1324
1324
  }, 512));
1325
1325
  }
1326
- }, ho = {
1327
- components: { VsText: tt },
1326
+ }, bo = {
1327
+ components: { VsText: lt },
1328
1328
  inheritAttrs: !1,
1329
1329
  events: ["update:modelValue"],
1330
1330
  props: {
@@ -1343,43 +1343,43 @@ const tt = /* @__PURE__ */ X(Ur, [["render", Xr], ["__scopeId", "data-v-eb21a54f
1343
1343
  }
1344
1344
  }
1345
1345
  }
1346
- }, vo = { class: "flex items-center w-full max-w-[182px]" }, mo = ["disabled"];
1347
- function bo(t, e, a, s, n, r) {
1348
- const l = G("vs-text");
1349
- return v(), k("div", vo, [
1350
- ce(d("input", {
1351
- "onUpdate:modelValue": e[0] || (e[0] = (c) => r.value = c),
1346
+ }, yo = { class: "flex items-center w-full max-w-[182px]" }, xo = ["disabled"];
1347
+ function wo(t, e, a, s, n, o) {
1348
+ const l = Z("vs-text");
1349
+ return v(), w("div", yo, [
1350
+ de(d("input", {
1351
+ "onUpdate:modelValue": e[0] || (e[0] = (c) => o.value = c),
1352
1352
  type: "color",
1353
1353
  class: E(["w-[38px] h-[38px] min-h-[38px] min-w-[38px] py-[2px] px-[3px] -ml-1 dark:bg-neutral-800 border dark:border-neutral-700 border-stone-200 rounded-lg", a.disabled ? "cursor-not-allowed" : "cursor-pointer"]),
1354
1354
  disabled: a.disabled
1355
- }, null, 10, mo), [
1356
- [ct, r.value]
1355
+ }, null, 10, xo), [
1356
+ [ft, o.value]
1357
1357
  ]),
1358
- a.isTextInputShown ? (v(), K(l, {
1358
+ a.isTextInputShown ? (v(), W(l, {
1359
1359
  key: 0,
1360
- modelValue: r.value,
1361
- "onUpdate:modelValue": e[1] || (e[1] = (c) => r.value = c),
1360
+ modelValue: o.value,
1361
+ "onUpdate:modelValue": e[1] || (e[1] = (c) => o.value = c),
1362
1362
  class: "ml-2 w-full",
1363
1363
  disabled: a.disabled,
1364
1364
  clearable: a.clearable
1365
- }, null, 8, ["modelValue", "disabled", "clearable"])) : V("", !0)
1365
+ }, null, 8, ["modelValue", "disabled", "clearable"])) : U("", !0)
1366
1366
  ]);
1367
1367
  }
1368
- const rt = /* @__PURE__ */ X(ho, [["render", bo]]), yo = { class: "flex gap-[4px] mb-[8px]" }, xo = { class: "grid grid-rows-3 grid-cols-7" }, wo = { class: "w-full h-full rounded border border-gray-300 overflow-hidden" }, ko = ["onClick", "title"], _o = {
1368
+ const at = /* @__PURE__ */ Q(bo, [["render", wo]]), ko = { class: "flex gap-[4px] mb-[8px]" }, _o = { class: "grid grid-rows-3 grid-cols-7" }, $o = { class: "w-full h-full rounded border border-gray-300 overflow-hidden" }, Co = ["onClick", "title"], Ao = {
1369
1369
  __name: "vs-editor-color",
1370
1370
  props: {
1371
1371
  editor: Object
1372
1372
  },
1373
1373
  setup(t) {
1374
- const e = t, a = C(null), s = C("#000000"), n = H(() => e.editor && e.editor.getAttributes("textStyle").color || "#000000"), r = H(() => n.value !== "#000000"), l = () => {
1374
+ const e = t, a = $(null), s = $("#000000"), n = N(() => e.editor && e.editor.getAttributes("textStyle").color || "#000000"), o = N(() => n.value !== "#000000"), l = () => {
1375
1375
  e.editor && (s.value = n.value);
1376
1376
  };
1377
- he(() => {
1377
+ be(() => {
1378
1378
  e.editor && (e.editor.on("selectionUpdate", l), e.editor.on("update", l), l());
1379
- }), Ae(() => {
1379
+ }), Le(() => {
1380
1380
  e.editor && (e.editor.off("selectionUpdate", l), e.editor.off("update", l));
1381
1381
  });
1382
- const c = C([
1382
+ const c = $([
1383
1383
  "#172B4D",
1384
1384
  "#0747A6",
1385
1385
  "#008DA6",
@@ -1401,11 +1401,11 @@ const rt = /* @__PURE__ */ X(ho, [["render", bo]]), yo = { class: "flex gap-[4px
1401
1401
  "#FFF0B3",
1402
1402
  "#FFBDAD",
1403
1403
  "#EAE6FF"
1404
- ]), o = (b) => {
1404
+ ]), r = (b) => {
1405
1405
  e.editor && (e.editor.chain().focus().setColor(b).run(), s.value = b, a.value && a.value.togglePopover());
1406
1406
  }, i = () => {
1407
- o(s.value);
1408
- }, w = (b) => ({
1407
+ r(s.value);
1408
+ }, x = (b) => ({
1409
1409
  "#172B4D": "Default",
1410
1410
  "#0747A6": "Bright blue",
1411
1411
  "#008DA6": "Bright blue-green",
@@ -1428,54 +1428,54 @@ const rt = /* @__PURE__ */ X(ho, [["render", bo]]), yo = { class: "flex gap-[4px
1428
1428
  "#FFBDAD": "Bright red",
1429
1429
  "#EAE6FF": "Bright purple"
1430
1430
  })[b] || b;
1431
- return (b, p) => (v(), K(de, {
1431
+ return (b, f) => (v(), W(fe, {
1432
1432
  ref_key: "popover",
1433
1433
  ref: a,
1434
1434
  placement: "bottom"
1435
1435
  }, {
1436
- reference: R(() => [
1436
+ reference: q(() => [
1437
1437
  d("button", {
1438
1438
  title: "Text Color",
1439
- class: E(["flex flex-col h-[30px] min-w-[30px] px-1 rounded-full hover:bg-gray-100 justify-center items-center relative flex", { "bg-gray-100": r.value }])
1439
+ class: E(["flex flex-col h-[30px] min-w-[30px] px-1 rounded-full hover:bg-gray-100 justify-center items-center relative flex", { "bg-gray-100": o.value }])
1440
1440
  }, [
1441
- p[1] || (p[1] = d("span", { class: "leading-none" }, "A", -1)),
1441
+ f[1] || (f[1] = d("span", { class: "leading-none" }, "A", -1)),
1442
1442
  d("span", {
1443
1443
  class: "block h-1 w-5",
1444
- style: le({ backgroundColor: s.value })
1444
+ style: se({ backgroundColor: s.value })
1445
1445
  }, null, 4)
1446
1446
  ], 2)
1447
1447
  ]),
1448
- default: R(() => [
1448
+ default: q(() => [
1449
1449
  d("div", null, [
1450
- d("div", yo, [
1451
- F(rt, {
1450
+ d("div", ko, [
1451
+ C(at, {
1452
1452
  modelValue: s.value,
1453
- "onUpdate:modelValue": p[0] || (p[0] = (g) => s.value = g)
1453
+ "onUpdate:modelValue": f[0] || (f[0] = (p) => s.value = p)
1454
1454
  }, null, 8, ["modelValue"]),
1455
1455
  d("button", {
1456
1456
  onClick: i,
1457
1457
  class: "h-[38px] w-[38px] bg-blue-500 shrink-0 border rounded-md flex items-center justify-center hover:bg-blue-700 duration-300"
1458
1458
  }, [
1459
- F(L(ye), { class: "h-4 w-4 text-white" })
1459
+ C(L(ke), { class: "h-4 w-4 text-white" })
1460
1460
  ])
1461
1461
  ]),
1462
- d("div", xo, [
1463
- (v(!0), k(re, null, ne(c.value, (g) => (v(), k("div", {
1464
- key: g,
1462
+ d("div", _o, [
1463
+ (v(!0), w(ae, null, ie(c.value, (p) => (v(), w("div", {
1464
+ key: p,
1465
1465
  class: "h-8 w-8 p-0.5 rounded border border-transparent hover:border-gray-200 transition-transform cursor-pointer"
1466
1466
  }, [
1467
- d("div", wo, [
1467
+ d("div", $o, [
1468
1468
  d("button", {
1469
1469
  class: "flex items-center justify-center w-full h-full",
1470
- style: le({ backgroundColor: g }),
1471
- onClick: (P) => o(g),
1472
- title: w(g)
1470
+ style: se({ backgroundColor: p }),
1471
+ onClick: (I) => r(p),
1472
+ title: x(p)
1473
1473
  }, [
1474
- s.value === g ? (v(), K(L(ye), {
1474
+ s.value === p ? (v(), W(L(ke), {
1475
1475
  key: 0,
1476
1476
  class: "h-4 w-4 text-gray-500"
1477
- })) : V("", !0)
1478
- ], 12, ko)
1477
+ })) : U("", !0)
1478
+ ], 12, Co)
1479
1479
  ])
1480
1480
  ]))), 128))
1481
1481
  ])
@@ -1484,21 +1484,21 @@ const rt = /* @__PURE__ */ X(ho, [["render", bo]]), yo = { class: "flex gap-[4px
1484
1484
  _: 1
1485
1485
  }, 512));
1486
1486
  }
1487
- }, $o = { class: "flex gap-[4px] mb-[8px]" }, Co = { class: "grid grid-rows-3 grid-cols-7" }, Ao = { class: "w-full h-full rounded border border-gray-300 overflow-hidden" }, Fo = ["onClick", "title"], So = ["onClick", "title"], To = {
1487
+ }, Fo = { class: "flex gap-[4px] mb-[8px]" }, So = { class: "grid grid-rows-3 grid-cols-7" }, To = { class: "w-full h-full rounded border border-gray-300 overflow-hidden" }, Lo = ["onClick", "title"], Bo = ["onClick", "title"], Eo = {
1488
1488
  __name: "vs-editor-background-color",
1489
1489
  props: {
1490
1490
  editor: Object
1491
1491
  },
1492
1492
  setup(t) {
1493
- const e = t, a = C(null), s = C("transparent"), n = H(() => e.editor && e.editor.getAttributes("textStyle").backgroundColor || "transparent"), r = H(() => n.value !== "transparent" && n.value !== ""), l = () => {
1493
+ const e = t, a = $(null), s = $("transparent"), n = N(() => e.editor && e.editor.getAttributes("textStyle").backgroundColor || "transparent"), o = N(() => n.value !== "transparent" && n.value !== ""), l = () => {
1494
1494
  e.editor && (s.value = n.value);
1495
1495
  };
1496
- he(() => {
1496
+ be(() => {
1497
1497
  e.editor && (e.editor.on("selectionUpdate", l), e.editor.on("update", l), l());
1498
- }), Ae(() => {
1498
+ }), Le(() => {
1499
1499
  e.editor && (e.editor.off("selectionUpdate", l), e.editor.off("update", l));
1500
1500
  });
1501
- const c = C([
1501
+ const c = $([
1502
1502
  "#172B4D",
1503
1503
  "#0747A6",
1504
1504
  "#008DA6",
@@ -1520,11 +1520,11 @@ const rt = /* @__PURE__ */ X(ho, [["render", bo]]), yo = { class: "flex gap-[4px
1520
1520
  "#FFF0B3",
1521
1521
  "#FFBDAD",
1522
1522
  "#EAE6FF"
1523
- ]), o = (b) => {
1523
+ ]), r = (b) => {
1524
1524
  e.editor && (e.editor.chain().focus().setBackgroundColor(b).run(), s.value = b, a.value && a.value.togglePopover());
1525
1525
  }, i = () => {
1526
- o(s.value);
1527
- }, w = (b) => ({
1526
+ r(s.value);
1527
+ }, x = (b) => ({
1528
1528
  "#172B4D": "Default",
1529
1529
  "#0747A6": "Bright blue",
1530
1530
  "#008DA6": "Bright blue-green",
@@ -1547,73 +1547,73 @@ const rt = /* @__PURE__ */ X(ho, [["render", bo]]), yo = { class: "flex gap-[4px
1547
1547
  "#FFBDAD": "Bright red",
1548
1548
  "#EAE6FF": "Bright purple"
1549
1549
  })[b] || b;
1550
- return (b, p) => (v(), K(de, {
1550
+ return (b, f) => (v(), W(fe, {
1551
1551
  ref_key: "popover",
1552
1552
  ref: a,
1553
1553
  placement: "bottom"
1554
1554
  }, {
1555
- reference: R(() => [
1555
+ reference: q(() => [
1556
1556
  d("button", {
1557
1557
  title: "Background Color",
1558
- class: E(["flex flex-col h-[30px] px-1 rounded-full hover:bg-gray-100 justify-center items-center relative flex", { "bg-gray-100": r.value }])
1558
+ class: E(["flex flex-col h-[30px] px-1 rounded-full hover:bg-gray-100 justify-center items-center relative flex", { "bg-gray-100": o.value }])
1559
1559
  }, [
1560
- F(L(Ht), { class: "h-4 w-4" }),
1560
+ C(L(Dt), { class: "h-4 w-4" }),
1561
1561
  d("span", {
1562
1562
  class: "block h-1 w-5",
1563
- style: le({ backgroundColor: s.value })
1563
+ style: se({ backgroundColor: s.value })
1564
1564
  }, null, 4)
1565
1565
  ], 2)
1566
1566
  ]),
1567
- default: R(() => [
1567
+ default: q(() => [
1568
1568
  d("div", null, [
1569
- d("div", $o, [
1570
- F(rt, {
1569
+ d("div", Fo, [
1570
+ C(at, {
1571
1571
  modelValue: s.value,
1572
- "onUpdate:modelValue": p[0] || (p[0] = (g) => s.value = g)
1572
+ "onUpdate:modelValue": f[0] || (f[0] = (p) => s.value = p)
1573
1573
  }, null, 8, ["modelValue"]),
1574
1574
  d("button", {
1575
1575
  onClick: i,
1576
1576
  class: "h-[38px] w-[38px] bg-blue-500 shrink-0 border rounded-md flex items-center justify-center hover:bg-blue-700 duration-300"
1577
1577
  }, [
1578
- F(L(ye), { class: "h-4 w-4 text-white" })
1578
+ C(L(ke), { class: "h-4 w-4 text-white" })
1579
1579
  ])
1580
1580
  ]),
1581
- d("div", Co, [
1581
+ d("div", So, [
1582
1582
  d("button", {
1583
- onClick: p[1] || (p[1] = (g) => o("transparent")),
1583
+ onClick: f[1] || (f[1] = (p) => r("transparent")),
1584
1584
  class: "col-span-7 flex items-center justify-center gap-2 bg-gray-100 rounded-md py-1 mb-2 hover:bg-gray-200"
1585
1585
  }, [
1586
- F(L(Mt), { class: "h-4 w-4" }),
1587
- p[2] || (p[2] = d("p", null, "no color", -1))
1586
+ C(L(zt), { class: "h-4 w-4" }),
1587
+ f[2] || (f[2] = d("p", null, "no color", -1))
1588
1588
  ]),
1589
- (v(!0), k(re, null, ne(c.value, (g) => (v(), k("div", {
1590
- key: g,
1589
+ (v(!0), w(ae, null, ie(c.value, (p) => (v(), w("div", {
1590
+ key: p,
1591
1591
  class: "h-8 w-8 p-0.5 rounded border border-transparent hover:border-gray-200 transition-transform cursor-pointer"
1592
1592
  }, [
1593
- d("div", Ao, [
1594
- g !== "transparent" ? (v(), k("button", {
1593
+ d("div", To, [
1594
+ p !== "transparent" ? (v(), w("button", {
1595
1595
  key: 0,
1596
1596
  class: "flex items-center justify-center w-full h-full",
1597
- style: le({ backgroundColor: g }),
1598
- onClick: (P) => o(g),
1599
- title: w(g)
1597
+ style: se({ backgroundColor: p }),
1598
+ onClick: (I) => r(p),
1599
+ title: x(p)
1600
1600
  }, [
1601
- s.value === g ? (v(), K(L(ye), {
1601
+ s.value === p ? (v(), W(L(ke), {
1602
1602
  key: 0,
1603
1603
  class: "h-4 w-4 text-gray-500"
1604
- })) : V("", !0)
1605
- ], 12, Fo)) : V("", !0),
1606
- g === "transparent" ? (v(), k("button", {
1604
+ })) : U("", !0)
1605
+ ], 12, Lo)) : U("", !0),
1606
+ p === "transparent" ? (v(), w("button", {
1607
1607
  key: 1,
1608
1608
  class: "flex items-center justify-center w-full h-full",
1609
- onClick: (P) => o(g),
1610
- title: w(g)
1609
+ onClick: (I) => r(p),
1610
+ title: x(p)
1611
1611
  }, [
1612
- s.value === g ? (v(), K(L(ye), {
1612
+ s.value === p ? (v(), W(L(ke), {
1613
1613
  key: 0,
1614
1614
  class: "h-4 w-4 text-gray-500"
1615
- })) : V("", !0)
1616
- ], 8, So)) : V("", !0)
1615
+ })) : U("", !0)
1616
+ ], 8, Bo)) : U("", !0)
1617
1617
  ])
1618
1618
  ]))), 128))
1619
1619
  ])
@@ -1622,30 +1622,30 @@ const rt = /* @__PURE__ */ X(ho, [["render", bo]]), yo = { class: "flex gap-[4px
1622
1622
  _: 1
1623
1623
  }, 512));
1624
1624
  }
1625
- }, Lo = {
1625
+ }, Io = {
1626
1626
  __name: "vs-editor-highlight",
1627
1627
  props: {
1628
1628
  editor: Object
1629
1629
  },
1630
1630
  setup(t) {
1631
- const e = t, a = H(() => e.editor?.isActive("highlight")), s = () => {
1631
+ const e = t, a = N(() => e.editor?.isActive("highlight")), s = () => {
1632
1632
  e.editor && e.editor.chain().focus().toggleHighlight().run();
1633
1633
  };
1634
- return (n, r) => (v(), k("button", {
1634
+ return (n, o) => (v(), w("button", {
1635
1635
  title: "Highlight",
1636
1636
  onClick: s,
1637
1637
  class: E(["flex flex-col h-[30px] px-1 rounded-full hover:bg-gray-100 justify-center items-center relative flex", { "bg-gray-200": a.value }])
1638
1638
  }, [
1639
- F(L(Nt), { class: "h-4 w-4" })
1639
+ C(L(Vt), { class: "h-4 w-4" })
1640
1640
  ], 2));
1641
1641
  }
1642
- }, Bo = { class: "truncate" }, Eo = { class: "w-[200px]" }, Io = { class: "max-h-[200px] overflow-y-auto" }, Po = ["onClick"], jo = {
1642
+ }, Po = { class: "truncate" }, jo = { class: "w-[200px]" }, Mo = { class: "max-h-[200px] overflow-y-auto" }, Ho = ["onClick"], No = {
1643
1643
  __name: "vs-editor-font-family",
1644
1644
  props: {
1645
1645
  editor: Object
1646
1646
  },
1647
1647
  setup(t) {
1648
- const e = t, a = C("popover"), s = C(!1), n = C([
1648
+ const e = t, a = $("popover"), s = $(!1), n = $([
1649
1649
  { label: "Arial", value: "Arial, sans-serif" },
1650
1650
  { label: "Helvetica", value: "Helvetica, sans-serif" },
1651
1651
  { label: "Times New Roman", value: "Times New Roman, serif" },
@@ -1656,61 +1656,61 @@ const rt = /* @__PURE__ */ X(ho, [["render", bo]]), yo = { class: "flex gap-[4px
1656
1656
  { label: "Impact", value: "Impact, sans-serif" },
1657
1657
  { label: "Trebuchet MS", value: "Trebuchet MS, sans-serif" },
1658
1658
  { label: "Palatino", value: "Palatino, serif" }
1659
- ]), r = H(() => {
1659
+ ]), o = N(() => {
1660
1660
  if (!e.editor) return "Arial, sans-serif";
1661
1661
  for (const i of n.value)
1662
1662
  if (e.editor.isActive("textStyle", { fontFamily: i.value }))
1663
1663
  return i.value;
1664
1664
  return "Arial, sans-serif";
1665
- }), l = H(() => n.value.find((w) => w.value === r.value)?.label || "Arial"), c = (i) => e.editor ? e.editor.isActive("textStyle", { fontFamily: i }) : !1, o = (i) => {
1665
+ }), l = N(() => n.value.find((x) => x.value === o.value)?.label || "Arial"), c = (i) => e.editor ? e.editor.isActive("textStyle", { fontFamily: i }) : !1, r = (i) => {
1666
1666
  e.editor && (e.editor.chain().focus().setFontFamily(i).run(), a.value && a.value.togglePopover());
1667
1667
  };
1668
- return (i, w) => (v(), K(de, {
1668
+ return (i, x) => (v(), W(fe, {
1669
1669
  ref_key: "popover",
1670
1670
  ref: a,
1671
1671
  placement: "bottom",
1672
- onIsvisible: w[0] || (w[0] = (b) => s.value = b)
1672
+ onIsvisible: x[0] || (x[0] = (b) => s.value = b)
1673
1673
  }, {
1674
- reference: R(() => [
1674
+ reference: q(() => [
1675
1675
  d("button", {
1676
1676
  title: "Font Family",
1677
1677
  class: E(["h-[30px] px-2 rounded-full hover:bg-gray-100 justify-center items-center flex text-sm", [s.value ? "bg-gray-100 text-gray-900" : "text-gray-700"]]),
1678
- style: le({ fontFamily: r.value })
1678
+ style: se({ fontFamily: o.value })
1679
1679
  }, [
1680
- d("span", Bo, W(l.value), 1),
1681
- F(L(Ee), { class: "ml-1 h-3 w-3 text-gray-400" })
1680
+ d("span", Po, Y(l.value), 1),
1681
+ C(L(je), { class: "ml-1 h-3 w-3 text-gray-400" })
1682
1682
  ], 6)
1683
1683
  ]),
1684
- default: R(() => [
1685
- d("div", Eo, [
1686
- d("ul", Io, [
1687
- (v(!0), k(re, null, ne(n.value, (b) => (v(), k("li", {
1684
+ default: q(() => [
1685
+ d("div", jo, [
1686
+ d("ul", Mo, [
1687
+ (v(!0), w(ae, null, ie(n.value, (b) => (v(), w("li", {
1688
1688
  key: b.value,
1689
1689
  class: E(["px-3 py-2 hover:bg-gray-100 cursor-pointer text-sm", { "bg-gray-100": c(b.value) }]),
1690
- style: le({ fontFamily: b.value }),
1691
- onClick: (p) => o(b.value)
1692
- }, W(b.label), 15, Po))), 128))
1690
+ style: se({ fontFamily: b.value }),
1691
+ onClick: (f) => r(b.value)
1692
+ }, Y(b.label), 15, Ho))), 128))
1693
1693
  ])
1694
1694
  ])
1695
1695
  ]),
1696
1696
  _: 1
1697
1697
  }, 512));
1698
1698
  }
1699
- }, Mo = { class: "w-[120px]" }, Ho = { class: "max-h-[200px] overflow-y-auto" }, No = ["onClick"], zo = {
1699
+ }, zo = { class: "w-[120px]" }, Do = { class: "max-h-[200px] overflow-y-auto" }, Vo = ["onClick"], Oo = {
1700
1700
  __name: "vs-editor-font-size",
1701
1701
  props: {
1702
1702
  editor: Object
1703
1703
  },
1704
1704
  setup(t) {
1705
- const e = t, a = C("popover"), s = C("14px"), n = H(() => e.editor && e.editor.getAttributes("textStyle").fontSize || "14px"), r = H(() => n.value !== "14px"), l = () => {
1705
+ const e = t, a = $("popover"), s = $("14px"), n = N(() => e.editor && e.editor.getAttributes("textStyle").fontSize || "14px"), o = N(() => n.value !== "14px"), l = () => {
1706
1706
  e.editor && (s.value = n.value);
1707
1707
  };
1708
- he(() => {
1708
+ be(() => {
1709
1709
  e.editor && (e.editor.on("selectionUpdate", l), e.editor.on("update", l), l());
1710
- }), Ae(() => {
1710
+ }), Le(() => {
1711
1711
  e.editor && (e.editor.off("selectionUpdate", l), e.editor.off("update", l));
1712
1712
  });
1713
- const c = C([
1713
+ const c = $([
1714
1714
  { label: "8px", value: "8px" },
1715
1715
  { label: "9px", value: "9px" },
1716
1716
  { label: "10px", value: "10px" },
@@ -1726,39 +1726,39 @@ const rt = /* @__PURE__ */ X(ho, [["render", bo]]), yo = { class: "flex gap-[4px
1726
1726
  { label: "36px", value: "36px" },
1727
1727
  { label: "48px", value: "48px" },
1728
1728
  { label: "72px", value: "72px" }
1729
- ]), o = (i) => {
1729
+ ]), r = (i) => {
1730
1730
  e.editor && (e.editor.chain().focus().setFontSize(i).run(), s.value = i, a.value && a.value.togglePopover());
1731
1731
  };
1732
- return (i, w) => (v(), K(de, {
1732
+ return (i, x) => (v(), W(fe, {
1733
1733
  ref_key: "popover",
1734
1734
  ref: a,
1735
1735
  placement: "bottom"
1736
1736
  }, {
1737
- reference: R(() => [
1737
+ reference: q(() => [
1738
1738
  d("button", {
1739
1739
  title: "Font Size",
1740
- class: E(["h-[30px] px-2 min-w-[30px] rounded-full hover:bg-gray-100 justify-center items-center flex text-sm text-gray-700 space-x-1", { "bg-gray-100 text-gray-900": r.value }])
1740
+ class: E(["h-[30px] px-2 min-w-[30px] rounded-full hover:bg-gray-100 justify-center items-center flex text-sm text-gray-700 space-x-1", { "bg-gray-100 text-gray-900": o.value }])
1741
1741
  }, [
1742
- F(L(zt), { class: "h-4 w-4" }),
1743
- F(L(Ee), { class: "h-3 w-3 text-gray-400" })
1742
+ C(L(Ot), { class: "h-4 w-4" }),
1743
+ C(L(je), { class: "h-3 w-3 text-gray-400" })
1744
1744
  ], 2)
1745
1745
  ]),
1746
- default: R(() => [
1747
- d("div", Mo, [
1748
- d("ul", Ho, [
1749
- (v(!0), k(re, null, ne(c.value, (b) => (v(), k("li", {
1746
+ default: q(() => [
1747
+ d("div", zo, [
1748
+ d("ul", Do, [
1749
+ (v(!0), w(ae, null, ie(c.value, (b) => (v(), w("li", {
1750
1750
  key: b.value,
1751
1751
  class: "px-3 py-2 hover:bg-gray-100 cursor-pointer",
1752
- onClick: (p) => o(b.value)
1753
- }, W(b.label), 9, No))), 128))
1752
+ onClick: (f) => r(b.value)
1753
+ }, Y(b.label), 9, Vo))), 128))
1754
1754
  ])
1755
1755
  ])
1756
1756
  ]),
1757
1757
  _: 1
1758
1758
  }, 512));
1759
1759
  }
1760
- }, Do = {
1761
- components: { Superscript: Dt },
1760
+ }, Ro = {
1761
+ components: { Superscript: Rt },
1762
1762
  props: {
1763
1763
  editor: Object
1764
1764
  },
@@ -1768,19 +1768,19 @@ const rt = /* @__PURE__ */ X(ho, [["render", bo]]), yo = { class: "flex gap-[4px
1768
1768
  }
1769
1769
  }
1770
1770
  };
1771
- function Oo(t, e, a, s, n, r) {
1772
- const l = G("Superscript");
1773
- return v(), k("button", {
1771
+ function Uo(t, e, a, s, n, o) {
1772
+ const l = Z("Superscript");
1773
+ return v(), w("button", {
1774
1774
  title: "Superscript",
1775
- onClick: e[0] || (e[0] = (...c) => r.toggleSuperscript && r.toggleSuperscript(...c)),
1775
+ onClick: e[0] || (e[0] = (...c) => o.toggleSuperscript && o.toggleSuperscript(...c)),
1776
1776
  class: E(["h-[30px] w-[30px] flex items-center justify-center text-gray-500 rounded-full cursor-pointer hover:text-gray-900 hover:bg-gray-100", { "bg-gray-100 text-gray-900": a.editor?.isActive("superscript") }])
1777
1777
  }, [
1778
- F(l, { class: "h-4 w-4" }),
1778
+ C(l, { class: "h-4 w-4" }),
1779
1779
  e[1] || (e[1] = d("span", { class: "sr-only" }, "Superscript", -1))
1780
1780
  ], 2);
1781
1781
  }
1782
- const Vo = /* @__PURE__ */ X(Do, [["render", Oo]]), Ro = {
1783
- components: { Subscript: Ot },
1782
+ const qo = /* @__PURE__ */ Q(Ro, [["render", Uo]]), Ko = {
1783
+ components: { Subscript: Ut },
1784
1784
  props: {
1785
1785
  editor: Object
1786
1786
  },
@@ -1790,71 +1790,71 @@ const Vo = /* @__PURE__ */ X(Do, [["render", Oo]]), Ro = {
1790
1790
  }
1791
1791
  }
1792
1792
  };
1793
- function Uo(t, e, a, s, n, r) {
1794
- const l = G("Subscript");
1795
- return v(), k("button", {
1793
+ function Wo(t, e, a, s, n, o) {
1794
+ const l = Z("Subscript");
1795
+ return v(), w("button", {
1796
1796
  title: "Subscript",
1797
- onClick: e[0] || (e[0] = (...c) => r.toggleSubscript && r.toggleSubscript(...c)),
1797
+ onClick: e[0] || (e[0] = (...c) => o.toggleSubscript && o.toggleSubscript(...c)),
1798
1798
  class: E(["h-[30px] w-[30px] flex items-center justify-center text-gray-500 rounded-full cursor-pointer hover:text-gray-900 hover:bg-gray-100", { "bg-gray-100 text-gray-900": a.editor?.isActive("subscript") }])
1799
1799
  }, [
1800
- F(l, { class: "h-4 w-4" }),
1800
+ C(l, { class: "h-4 w-4" }),
1801
1801
  e[1] || (e[1] = d("span", { class: "sr-only" }, "Subscript", -1))
1802
1802
  ], 2);
1803
1803
  }
1804
- const qo = /* @__PURE__ */ X(Ro, [["render", Uo]]), Ko = {
1804
+ const Xo = /* @__PURE__ */ Q(Ko, [["render", Wo]]), Go = {
1805
1805
  title: "Heading",
1806
1806
  class: "h-[30px] px-2 rounded-full hover:bg-gray-100 justify-center items-center flex text-sm text-gray-700"
1807
- }, Wo = { class: "truncate" }, Xo = { class: "max-h-[200px] overflow-y-auto" }, Go = ["onClick"], Yo = {
1807
+ }, Yo = { class: "truncate" }, Qo = { class: "max-h-[200px] overflow-y-auto" }, Zo = ["onClick"], Jo = {
1808
1808
  __name: "vs-editor-heading",
1809
1809
  props: {
1810
1810
  editor: Object
1811
1811
  },
1812
1812
  setup(t) {
1813
- const e = t, a = C("popover"), s = C([
1813
+ const e = t, a = $("popover"), s = $([
1814
1814
  { label: "Heading 1", value: 1 },
1815
1815
  { label: "Heading 2", value: 2 },
1816
1816
  { label: "Heading 3", value: 3 },
1817
1817
  { label: "Heading 4", value: 4 },
1818
1818
  { label: "Heading 5", value: 5 },
1819
1819
  { label: "Heading 6", value: 6 }
1820
- ]), n = H(() => {
1820
+ ]), n = N(() => {
1821
1821
  if (!e.editor) return "Paragraph";
1822
- for (let o = 1; o <= 6; o++)
1823
- if (e.editor.isActive("heading", { level: o }))
1824
- return `H ${o}`;
1822
+ for (let r = 1; r <= 6; r++)
1823
+ if (e.editor.isActive("heading", { level: r }))
1824
+ return `H ${r}`;
1825
1825
  return "P";
1826
- }), r = (o) => ({
1826
+ }), o = (r) => ({
1827
1827
  1: "font-weight:700; font-size:30px;",
1828
1828
  2: "font-weight:700; font-size:26px;",
1829
1829
  3: "font-weight:700; font-size:22px;",
1830
1830
  4: "font-weight:700; font-size:18px;",
1831
1831
  5: "font-weight:500; font-size:16px;",
1832
1832
  6: "font-weight:400; font-size:14px;"
1833
- })[o] || "", l = (o) => {
1834
- e.editor && (e.editor.chain().focus().setHeading({ level: o }).run(), a.value && a.value.togglePopover());
1833
+ })[r] || "", l = (r) => {
1834
+ e.editor && (e.editor.chain().focus().setHeading({ level: r }).run(), a.value && a.value.togglePopover());
1835
1835
  }, c = () => {
1836
1836
  e.editor && (e.editor.chain().focus().setParagraph().run(), a.value && a.value.togglePopover());
1837
1837
  };
1838
- return (o, i) => (v(), K(de, {
1838
+ return (r, i) => (v(), W(fe, {
1839
1839
  ref_key: "popover",
1840
1840
  ref: a,
1841
1841
  placement: "bottom"
1842
1842
  }, {
1843
- reference: R(() => [
1844
- d("button", Ko, [
1845
- d("span", Wo, W(n.value), 1),
1846
- F(L(Ee), { class: "ml-1 h-3 w-3 text-gray-400" })
1843
+ reference: q(() => [
1844
+ d("button", Go, [
1845
+ d("span", Yo, Y(n.value), 1),
1846
+ C(L(je), { class: "ml-1 h-3 w-3 text-gray-400" })
1847
1847
  ])
1848
1848
  ]),
1849
- default: R(() => [
1849
+ default: q(() => [
1850
1850
  d("div", null, [
1851
- d("ul", Xo, [
1852
- (v(!0), k(re, null, ne(s.value, (w) => (v(), k("li", {
1853
- key: w.value,
1854
- class: E(["px-3 py-2 hover:bg-gray-100 cursor-pointer text-sm", `heading-level-${w.value}`]),
1855
- style: le(r(w.value)),
1856
- onClick: (b) => l(w.value)
1857
- }, W(w.label), 15, Go))), 128)),
1851
+ d("ul", Qo, [
1852
+ (v(!0), w(ae, null, ie(s.value, (x) => (v(), w("li", {
1853
+ key: x.value,
1854
+ class: E(["px-3 py-2 hover:bg-gray-100 cursor-pointer text-sm", `heading-level-${x.value}`]),
1855
+ style: se(o(x.value)),
1856
+ onClick: (b) => l(x.value)
1857
+ }, Y(x.label), 15, Zo))), 128)),
1858
1858
  d("li", {
1859
1859
  class: "px-3 py-2 hover:bg-gray-100 cursor-pointer text-sm border-t border-gray-200 mt-1 pt-2",
1860
1860
  onClick: c
@@ -1865,8 +1865,8 @@ const qo = /* @__PURE__ */ X(Ro, [["render", Uo]]), Ko = {
1865
1865
  _: 1
1866
1866
  }, 512));
1867
1867
  }
1868
- }, Qo = /* @__PURE__ */ X(Yo, [["__scopeId", "data-v-96f02f2a"]]), Zo = {
1869
- components: { RemoveFormatting: Vt },
1868
+ }, el = /* @__PURE__ */ Q(Jo, [["__scopeId", "data-v-96f02f2a"]]), tl = {
1869
+ components: { RemoveFormatting: qt },
1870
1870
  props: {
1871
1871
  editor: Object
1872
1872
  },
@@ -1876,27 +1876,27 @@ const qo = /* @__PURE__ */ X(Ro, [["render", Uo]]), Ko = {
1876
1876
  }
1877
1877
  }
1878
1878
  };
1879
- function Jo(t, e, a, s, n, r) {
1880
- const l = G("RemoveFormatting");
1881
- return v(), k("button", {
1879
+ function rl(t, e, a, s, n, o) {
1880
+ const l = Z("RemoveFormatting");
1881
+ return v(), w("button", {
1882
1882
  title: "Clear Formatting",
1883
- onClick: e[0] || (e[0] = (...c) => r.clearFormatting && r.clearFormatting(...c)),
1883
+ onClick: e[0] || (e[0] = (...c) => o.clearFormatting && o.clearFormatting(...c)),
1884
1884
  class: "h-[30px] w-[30px] flex items-center justify-center text-gray-500 rounded-full cursor-pointer hover:text-gray-900 hover:bg-gray-100"
1885
1885
  }, [
1886
- F(l, { class: "h-4 w-4" }),
1886
+ C(l, { class: "h-4 w-4" }),
1887
1887
  e[1] || (e[1] = d("span", { class: "sr-only" }, "Clear Formatting", -1))
1888
1888
  ]);
1889
1889
  }
1890
- const el = /* @__PURE__ */ X(Zo, [["render", Jo]]), tl = { class: "relative" }, rl = {
1890
+ const ol = /* @__PURE__ */ Q(tl, [["render", rl]]), ll = { class: "relative" }, al = {
1891
1891
  key: 0,
1892
1892
  class: "mt-4"
1893
- }, ol = ["src", "alt", "title"], ll = {
1893
+ }, nl = ["src", "alt", "title"], sl = {
1894
1894
  key: 0,
1895
1895
  class: "text-sm text-red-500"
1896
- }, al = {
1896
+ }, il = {
1897
1897
  key: 1,
1898
1898
  class: "mt-4"
1899
- }, nl = { class: "text-sm text-gray-600 mb-2" }, sl = { class: "flex flex-wrap gap-2" }, il = ["src", "alt", "onError"], cl = ["onClick"], dl = { class: "flex justify-end gap-x-2 p-[20px]" }, ul = /* @__PURE__ */ Object.assign({
1899
+ }, cl = { class: "text-sm text-gray-600 mb-2" }, dl = { class: "flex flex-wrap gap-2" }, ul = ["src", "alt", "onError"], fl = ["onClick"], pl = { class: "flex justify-end gap-x-2 p-[20px]" }, gl = /* @__PURE__ */ Object.assign({
1900
1900
  inheritAttrs: !1
1901
1901
  }, {
1902
1902
  __name: "vs-editor-image",
@@ -1907,7 +1907,7 @@ const el = /* @__PURE__ */ X(Zo, [["render", Jo]]), tl = { class: "relative" },
1907
1907
  }
1908
1908
  },
1909
1909
  setup(t) {
1910
- const e = t, a = C(!1), s = C(!1), n = C({}), r = C(!1), l = C([]), c = C(null), o = C({
1910
+ const e = t, a = $(!1), s = $(!1), n = $({}), o = $(!1), l = $([]), c = $(null), r = $({
1911
1911
  src: "",
1912
1912
  file: [],
1913
1913
  // Завжди масив
@@ -1917,27 +1917,27 @@ const el = /* @__PURE__ */ X(Zo, [["render", Jo]]), tl = { class: "relative" },
1917
1917
  height: "",
1918
1918
  link: "",
1919
1919
  openInNewTab: !1
1920
- }), i = H(() => {
1921
- if (Array.isArray(o.value.file)) {
1922
- const m = o.value.file.filter(($) => $ instanceof File), _ = o.value.file.filter(($) => typeof $ == "string" && $.trim() !== "");
1923
- return m.length + _.length > 1;
1920
+ }), i = N(() => {
1921
+ if (Array.isArray(r.value.file)) {
1922
+ const m = r.value.file.filter((_) => _ instanceof File), k = r.value.file.filter((_) => typeof _ == "string" && _.trim() !== "");
1923
+ return m.length + k.length > 1;
1924
1924
  }
1925
- return o.value.file instanceof FileList ? o.value.file.length > 1 : !1;
1926
- }), w = H(() => Array.isArray(o.value.file) ? o.value.file.filter((m) => m instanceof File).length === 1 : o.value.file instanceof FileList ? o.value.file.length === 1 : o.value.file instanceof File), b = H(() => {
1925
+ return r.value.file instanceof FileList ? r.value.file.length > 1 : !1;
1926
+ }), x = N(() => Array.isArray(r.value.file) ? r.value.file.filter((m) => m instanceof File).length === 1 : r.value.file instanceof FileList ? r.value.file.length === 1 : r.value.file instanceof File), b = N(() => {
1927
1927
  if (i.value)
1928
1928
  return "";
1929
- if (o.value.src)
1930
- return o.value.src;
1931
- if (w.value) {
1929
+ if (r.value.src)
1930
+ return r.value.src;
1931
+ if (x.value) {
1932
1932
  let m = null;
1933
- if (Array.isArray(o.value.file) || o.value.file instanceof FileList ? m = o.value.file[0] : o.value.file instanceof File && (m = o.value.file), m instanceof File) {
1934
- const _ = l.value.find((f) => f.file === m);
1935
- return _ ? _.preview : "";
1933
+ if (Array.isArray(r.value.file) || r.value.file instanceof FileList ? m = r.value.file[0] : r.value.file instanceof File && (m = r.value.file), m instanceof File) {
1934
+ const k = l.value.find((u) => u.file === m);
1935
+ return k ? k.preview : "";
1936
1936
  } else if (typeof m == "string")
1937
1937
  return m;
1938
1938
  }
1939
1939
  return "";
1940
- }), p = H(() => [
1940
+ }), f = N(() => [
1941
1941
  {
1942
1942
  name: "src",
1943
1943
  label: "URL зображення",
@@ -1999,24 +1999,24 @@ const el = /* @__PURE__ */ X(Zo, [["render", Jo]]), tl = { class: "relative" },
1999
1999
  type: "switcher",
2000
2000
  required: !1
2001
2001
  }
2002
- ]), g = () => {
2002
+ ]), p = () => {
2003
2003
  if (!e.editor) return;
2004
2004
  if (e.editor.isActive("image")) {
2005
- const { state: _ } = e.editor, { selection: f } = _, { $from: $ } = f;
2006
- let y = null, B = null;
2007
- if ($.parent.type.name === "image")
2008
- y = $.before($.depth), B = $.parent;
2005
+ const { state: k } = e.editor, { selection: u } = k, { $from: _ } = u;
2006
+ let y = null, T = null;
2007
+ if (_.parent.type.name === "image")
2008
+ y = _.before(_.depth), T = _.parent;
2009
2009
  else
2010
- for (let x = $.depth; x > 0; x--) {
2011
- const A = $.node(x), T = $.before(x);
2012
- A.type.name === "paragraph" && A.forEach((D, se) => {
2013
- if (D.type.name === "image") {
2014
- const ae = T + se + 1;
2015
- (y === null || Math.abs(ae - f.$from.pos) < Math.abs(y - f.$from.pos)) && (y = ae, B = D);
2010
+ for (let H = _.depth; H > 0; H--) {
2011
+ const X = _.node(H), g = _.before(H);
2012
+ X.type.name === "paragraph" && X.forEach((A, B) => {
2013
+ if (A.type.name === "image") {
2014
+ const D = g + B + 1;
2015
+ (y === null || Math.abs(D - u.$from.pos) < Math.abs(y - u.$from.pos)) && (y = D, T = A);
2016
2016
  }
2017
2017
  });
2018
2018
  }
2019
- if (y !== null && B) {
2019
+ if (y !== null && T) {
2020
2020
  try {
2021
2021
  e.editor.chain().focus().setNodeSelection(y).run();
2022
2022
  } catch {
@@ -2025,18 +2025,18 @@ const el = /* @__PURE__ */ X(Zo, [["render", Jo]]), tl = { class: "relative" },
2025
2025
  c.value = y;
2026
2026
  } else {
2027
2027
  e.editor.chain().focus().selectParentNode().run();
2028
- const { state: x } = e.editor;
2029
- c.value = x.selection.$from.pos;
2028
+ const { state: H } = e.editor;
2029
+ c.value = H.selection.$from.pos;
2030
2030
  }
2031
- const h = B ? B.attrs : e.editor.getAttributes("image");
2032
- r.value = !0;
2031
+ const h = T ? T.attrs : e.editor.getAttributes("image");
2032
+ o.value = !0;
2033
2033
  let S = "", M = !1;
2034
- const N = e.editor.getAttributes("link");
2035
- N && N.href && (S = N.href, M = N.target === "_blank");
2036
- const j = h.src || "", u = j ? [j] : [];
2037
- o.value = {
2034
+ const z = e.editor.getAttributes("link");
2035
+ z && z.href && (S = z.href, M = z.target === "_blank");
2036
+ const j = h.src || "", F = j ? [j] : [];
2037
+ r.value = {
2038
2038
  src: j,
2039
- file: u,
2039
+ file: F,
2040
2040
  // Масив з поточним зображенням
2041
2041
  alt: h.alt || "",
2042
2042
  title: h.title || "",
@@ -2046,7 +2046,7 @@ const el = /* @__PURE__ */ X(Zo, [["render", Jo]]), tl = { class: "relative" },
2046
2046
  openInNewTab: M
2047
2047
  };
2048
2048
  } else
2049
- r.value = !1, o.value = {
2049
+ o.value = !1, r.value = {
2050
2050
  src: "",
2051
2051
  file: [],
2052
2052
  // Завжди масив
@@ -2058,8 +2058,8 @@ const el = /* @__PURE__ */ X(Zo, [["render", Jo]]), tl = { class: "relative" },
2058
2058
  openInNewTab: !1
2059
2059
  };
2060
2060
  s.value = !1, a.value = !0;
2061
- }, P = () => {
2062
- a.value = !1, s.value = !1, r.value = !1, l.value = [], c.value = null, o.value = {
2061
+ }, I = () => {
2062
+ a.value = !1, s.value = !1, o.value = !1, l.value = [], c.value = null, r.value = {
2063
2063
  src: "",
2064
2064
  file: [],
2065
2065
  // Завжди масив
@@ -2070,40 +2070,40 @@ const el = /* @__PURE__ */ X(Zo, [["render", Jo]]), tl = { class: "relative" },
2070
2070
  link: "",
2071
2071
  openInNewTab: !1
2072
2072
  };
2073
- }, O = async (m) => {
2073
+ }, V = async (m) => {
2074
2074
  if (!m || m.length === 0)
2075
2075
  return;
2076
- const _ = [];
2077
- for (const f of m)
2078
- if (f && f.type && f.type.startsWith("image/") && !l.value.some((y) => y.file === f)) {
2079
- const y = new Promise((B, h) => {
2076
+ const k = [];
2077
+ for (const u of m)
2078
+ if (u && u.type && u.type.startsWith("image/") && !l.value.some((y) => y.file === u)) {
2079
+ const y = new Promise((T, h) => {
2080
2080
  const S = new FileReader();
2081
2081
  S.onload = (M) => {
2082
2082
  l.value.push({
2083
- file: f,
2083
+ file: u,
2084
2084
  preview: M.target.result,
2085
2085
  error: !1
2086
- }), B();
2087
- }, S.onerror = h, S.readAsDataURL(f);
2086
+ }), T();
2087
+ }, S.onerror = h, S.readAsDataURL(u);
2088
2088
  });
2089
- _.push(y);
2089
+ k.push(y);
2090
2090
  }
2091
- await Promise.all(_);
2092
- }, z = (m) => {
2093
- l.value.splice(m, 1), Array.isArray(o.value.file) && o.value.file.splice(m, 1);
2094
- }, U = () => {
2095
- const m = o.value.width !== null && o.value.width !== void 0 && o.value.width !== "" && String(o.value.width).trim() !== "" ? String(o.value.width).trim() : "", _ = o.value.height !== null && o.value.height !== void 0 && o.value.height !== "" && String(o.value.height).trim() !== "" ? String(o.value.height).trim() : "", f = {};
2096
- return m && _ ? (f.width = m, f.height = _, f.style = `width: ${m}px; height: ${_}px; object-fit: fill;`) : m ? (f.width = m, f.height = void 0) : _ ? (f.height = _, f.width = void 0) : (f.width = void 0, f.height = void 0), f;
2097
- }, Y = (m, _ = null, f = 50) => {
2098
- const $ = () => {
2091
+ await Promise.all(k);
2092
+ }, O = (m) => {
2093
+ l.value.splice(m, 1), Array.isArray(r.value.file) && r.value.file.splice(m, 1);
2094
+ }, R = () => {
2095
+ const m = r.value.width !== null && r.value.width !== void 0 && r.value.width !== "" && String(r.value.width).trim() !== "" ? String(r.value.width).trim() : "", k = r.value.height !== null && r.value.height !== void 0 && r.value.height !== "" && String(r.value.height).trim() !== "" ? String(r.value.height).trim() : "", u = {};
2096
+ return m && k ? (u.width = m, u.height = k, u.style = `width: ${m}px; height: ${k}px; object-fit: fill;`) : m ? (u.width = m, u.height = void 0) : k ? (u.height = k, u.width = void 0) : (u.width = void 0, u.height = void 0), u;
2097
+ }, J = (m, k = null, u = 50) => {
2098
+ const _ = () => {
2099
2099
  const { view: h } = m;
2100
2100
  if (!h || !h.dom) return;
2101
- h.dom.querySelectorAll("img.editor-image[width][height]").forEach((N) => {
2102
- if (N instanceof HTMLImageElement) {
2103
- const j = N.getAttribute("width"), u = N.getAttribute("height");
2104
- j && u && j !== "auto" && u !== "auto" && j !== "" && u !== "" && !isNaN(Number(j)) && !isNaN(Number(u)) && (N.style.cssText = `
2101
+ h.dom.querySelectorAll("img.editor-image[width][height]").forEach((z) => {
2102
+ if (z instanceof HTMLImageElement) {
2103
+ const j = z.getAttribute("width"), F = z.getAttribute("height");
2104
+ j && F && j !== "auto" && F !== "auto" && j !== "" && F !== "" && !isNaN(Number(j)) && !isNaN(Number(F)) && (z.style.cssText = `
2105
2105
  width: ${j}px !important;
2106
- height: ${u}px !important;
2106
+ height: ${F}px !important;
2107
2107
  max-width: none !important;
2108
2108
  max-height: none !important;
2109
2109
  min-width: auto !important;
@@ -2112,89 +2112,89 @@ const el = /* @__PURE__ */ X(Zo, [["render", Jo]]), tl = { class: "relative" },
2112
2112
  `.replace(/\s+/g, " ").trim());
2113
2113
  }
2114
2114
  });
2115
- }, y = o.value.width, B = o.value.height;
2116
- y && B && y !== "" && B !== "" ? [0, f, f * 2, f * 3, f * 4].forEach((S) => {
2117
- setTimeout($, S);
2118
- }) : ($(), setTimeout($, f));
2119
- }, I = async () => {
2120
- let m = [], _ = [];
2121
- if (Array.isArray(o.value.file) ? (m = o.value.file.filter((h) => h instanceof File), _ = o.value.file.filter((h) => typeof h == "string" && h.trim() !== "")) : o.value.file instanceof FileList ? m = Array.from(o.value.file) : o.value.file instanceof File ? m = [o.value.file] : typeof o.value.file == "string" && o.value.file.trim() !== "" && (_ = [o.value.file]), m.length === 0 && _.length === 0 && n.value && n.value.file) {
2115
+ }, y = r.value.width, T = r.value.height;
2116
+ y && T && y !== "" && T !== "" ? [0, u, u * 2, u * 3, u * 4].forEach((S) => {
2117
+ setTimeout(_, S);
2118
+ }) : (_(), setTimeout(_, u));
2119
+ }, P = async () => {
2120
+ let m = [], k = [];
2121
+ if (Array.isArray(r.value.file) ? (m = r.value.file.filter((h) => h instanceof File), k = r.value.file.filter((h) => typeof h == "string" && h.trim() !== "")) : r.value.file instanceof FileList ? m = Array.from(r.value.file) : r.value.file instanceof File ? m = [r.value.file] : typeof r.value.file == "string" && r.value.file.trim() !== "" && (k = [r.value.file]), m.length === 0 && k.length === 0 && n.value && n.value.file) {
2122
2122
  const h = n.value.file;
2123
- Array.isArray(h) ? (m = h.filter((S) => S instanceof File), _ = h.filter((S) => typeof S == "string" && S.trim() !== "")) : h instanceof FileList ? m = Array.from(h) : h instanceof File ? m = [h] : typeof h == "string" && h.trim() !== "" && (_ = [h]);
2123
+ Array.isArray(h) ? (m = h.filter((S) => S instanceof File), k = h.filter((S) => typeof S == "string" && S.trim() !== "")) : h instanceof FileList ? m = Array.from(h) : h instanceof File ? m = [h] : typeof h == "string" && h.trim() !== "" && (k = [h]);
2124
2124
  }
2125
- if (_.length > 0 && !r.value) {
2126
- for (const h of _)
2125
+ if (k.length > 0 && !o.value) {
2126
+ for (const h of k)
2127
2127
  l.value.some((S) => S.url === h) || l.value.push({
2128
2128
  url: h,
2129
2129
  preview: h,
2130
2130
  error: !1
2131
2131
  });
2132
2132
  if (m.length === 0 && l.value.length > 0) {
2133
- await oe();
2133
+ await ne();
2134
2134
  return;
2135
2135
  }
2136
2136
  }
2137
- const f = m.length, $ = f + _.length;
2138
- if (!(r.value && f <= 1)) {
2139
- if (f > 0) {
2137
+ const u = m.length, _ = u + k.length;
2138
+ if (!(o.value && u <= 1)) {
2139
+ if (u > 0) {
2140
2140
  const h = m.filter(
2141
2141
  (S) => !l.value.some((M) => M.file === S)
2142
2142
  );
2143
- h.length > 0 && await O(h);
2143
+ h.length > 0 && await V(h);
2144
2144
  }
2145
2145
  }
2146
- if (!r.value) {
2147
- if ($ > 1 || i.value || l.value.length > 1) {
2146
+ if (!o.value) {
2147
+ if (_ > 1 || i.value || l.value.length > 1) {
2148
2148
  if (l.value.length > 0) {
2149
- await oe();
2149
+ await ne();
2150
2150
  return;
2151
- } else if (f > 0) {
2152
- if (await O(m), l.value.length > 0) {
2153
- await oe();
2151
+ } else if (u > 0) {
2152
+ if (await V(m), l.value.length > 0) {
2153
+ await ne();
2154
2154
  return;
2155
2155
  }
2156
- } else if (_.length > 0) {
2157
- await oe();
2156
+ } else if (k.length > 0) {
2157
+ await ne();
2158
2158
  return;
2159
2159
  }
2160
2160
  } else if (l.value.length > 1) {
2161
- await oe();
2161
+ await ne();
2162
2162
  return;
2163
2163
  }
2164
2164
  }
2165
- let y = o.value.src;
2166
- if (w.value) {
2165
+ let y = r.value.src;
2166
+ if (x.value) {
2167
2167
  let h = null;
2168
- if (Array.isArray(o.value.file) || o.value.file instanceof FileList ? h = o.value.file[0] : (o.value.file instanceof File || typeof o.value.file == "string") && (h = o.value.file), h instanceof File)
2168
+ if (Array.isArray(r.value.file) || r.value.file instanceof FileList ? h = r.value.file[0] : (r.value.file instanceof File || typeof r.value.file == "string") && (h = r.value.file), h instanceof File)
2169
2169
  try {
2170
- const S = new FileReader(), M = await new Promise((N, j) => {
2171
- S.onload = (u) => N(u.target.result), S.onerror = j, S.readAsDataURL(h);
2170
+ const S = new FileReader(), M = await new Promise((z, j) => {
2171
+ S.onload = (F) => z(F.target.result), S.onerror = j, S.readAsDataURL(h);
2172
2172
  });
2173
- y = M, r.value && (o.value.src = M);
2173
+ y = M, o.value && (r.value.src = M);
2174
2174
  } catch (S) {
2175
- console.error("Помилка при читанні файлу:", S), Ce({
2175
+ console.error("Помилка при читанні файлу:", S), Se({
2176
2176
  type: "error",
2177
2177
  title: "Помилка",
2178
2178
  message: "Не вдалося прочитати файл"
2179
2179
  });
2180
2180
  return;
2181
2181
  }
2182
- else typeof h == "string" && h.trim() !== "" && (y = h.trim(), r.value && h.trim() !== o.value.src && (o.value.src = h.trim(), y = h.trim()));
2183
- } else if (Array.isArray(o.value.file) && o.value.file.length === 1) {
2184
- const h = o.value.file[0];
2185
- typeof h == "string" && h.trim() !== "" && (y = h.trim(), (!o.value.src || o.value.src !== h.trim()) && (o.value.src = h.trim()));
2186
- } else typeof o.value.file == "string" && o.value.file.trim() !== "" && (y = o.value.file.trim(), (!o.value.src || o.value.src !== o.value.file.trim()) && (o.value.src = o.value.file.trim()));
2187
- const B = y || Array.isArray(o.value.file) && o.value.file.length > 0 && (o.value.file.some((h) => h instanceof File) || o.value.file.some((h) => typeof h == "string" && h.trim() !== "")) || o.value.file instanceof FileList && o.value.file.length > 0 || typeof o.value.file == "string" && o.value.file.trim() !== "";
2188
- if (!y && !B) {
2189
- Ce({
2182
+ else typeof h == "string" && h.trim() !== "" && (y = h.trim(), o.value && h.trim() !== r.value.src && (r.value.src = h.trim(), y = h.trim()));
2183
+ } else if (Array.isArray(r.value.file) && r.value.file.length === 1) {
2184
+ const h = r.value.file[0];
2185
+ typeof h == "string" && h.trim() !== "" && (y = h.trim(), (!r.value.src || r.value.src !== h.trim()) && (r.value.src = h.trim()));
2186
+ } else typeof r.value.file == "string" && r.value.file.trim() !== "" && (y = r.value.file.trim(), (!r.value.src || r.value.src !== r.value.file.trim()) && (r.value.src = r.value.file.trim()));
2187
+ const T = y || Array.isArray(r.value.file) && r.value.file.length > 0 && (r.value.file.some((h) => h instanceof File) || r.value.file.some((h) => typeof h == "string" && h.trim() !== "")) || r.value.file instanceof FileList && r.value.file.length > 0 || typeof r.value.file == "string" && r.value.file.trim() !== "";
2188
+ if (!y && !T) {
2189
+ Se({
2190
2190
  type: "warning",
2191
2191
  title: "Попередження",
2192
2192
  message: "Будь ласка, введіть URL зображення або виберіть файл"
2193
2193
  });
2194
2194
  return;
2195
2195
  }
2196
- if (!i.value && !B && await n.value.validate()) {
2197
- Ce({
2196
+ if (!i.value && !T && await n.value.validate()) {
2197
+ Se({
2198
2198
  type: "warning",
2199
2199
  title: "Попередження",
2200
2200
  message: "Будь ласка, заповніть всі обов'язкові поля"
@@ -2202,301 +2202,301 @@ const el = /* @__PURE__ */ X(Zo, [["render", Jo]]), tl = { class: "relative" },
2202
2202
  return;
2203
2203
  }
2204
2204
  if (e.editor && y)
2205
- if (r.value && c.value !== null) {
2205
+ if (o.value && c.value !== null) {
2206
2206
  const { state: h } = e.editor;
2207
2207
  try {
2208
2208
  e.editor.chain().focus().setNodeSelection(c.value).run();
2209
2209
  } catch {
2210
2210
  e.editor.chain().focus().setTextSelection(c.value).run();
2211
2211
  }
2212
- const S = e.editor.getAttributes("link"), M = S && S.href, N = U(), j = {
2212
+ const S = e.editor.getAttributes("link"), M = S && S.href, z = R(), j = {
2213
2213
  src: y,
2214
- alt: o.value.alt || "",
2215
- title: o.value.title || "",
2216
- ...N
2214
+ alt: r.value.alt || "",
2215
+ title: r.value.title || "",
2216
+ ...z
2217
2217
  };
2218
- if ((!o.value.width || o.value.width === "") && (j.width = void 0), (!o.value.height || o.value.height === "") && (j.height = void 0), e.editor.chain().focus().updateAttributes("image", j).run(), setTimeout(() => {
2219
- const { view: u } = e.editor;
2220
- if (!u || !u.dom) return;
2221
- u.dom.querySelectorAll("img.editor-image").forEach((T) => {
2222
- if (T instanceof HTMLImageElement) {
2223
- const D = T.getAttribute("src") || T.src;
2224
- (D === y || D.includes(y.split("/").pop())) && (o.value.width && o.value.height ? (T.style.setProperty("width", `${o.value.width}px`, "important"), T.style.setProperty("height", `${o.value.height}px`, "important"), T.style.setProperty("object-fit", "fill", "important"), T.style.setProperty("max-width", "none", "important"), T.style.setProperty("max-height", "none", "important")) : (T.style.removeProperty("width"), T.style.removeProperty("height"), T.style.removeProperty("object-fit"), T.style.removeProperty("max-width"), T.style.removeProperty("max-height")));
2218
+ if ((!r.value.width || r.value.width === "") && (j.width = void 0), (!r.value.height || r.value.height === "") && (j.height = void 0), e.editor.chain().focus().updateAttributes("image", j).run(), setTimeout(() => {
2219
+ const { view: F } = e.editor;
2220
+ if (!F || !F.dom) return;
2221
+ F.dom.querySelectorAll("img.editor-image").forEach((g) => {
2222
+ if (g instanceof HTMLImageElement) {
2223
+ const A = g.getAttribute("src") || g.src;
2224
+ (A === y || A.includes(y.split("/").pop())) && (r.value.width && r.value.height ? (g.style.setProperty("width", `${r.value.width}px`, "important"), g.style.setProperty("height", `${r.value.height}px`, "important"), g.style.setProperty("object-fit", "fill", "important"), g.style.setProperty("max-width", "none", "important"), g.style.setProperty("max-height", "none", "important")) : (g.style.removeProperty("width"), g.style.removeProperty("height"), g.style.removeProperty("object-fit"), g.style.removeProperty("max-width"), g.style.removeProperty("max-height")));
2225
2225
  }
2226
2226
  });
2227
- }, 20), o.value.link && o.value.link.trim() !== "") {
2228
- let u = o.value.link.trim();
2229
- u.match(/^https?:\/\//i) || (u = "https://" + u), M ? e.editor.chain().focus().extendMarkRange("link").setLink({
2230
- href: u,
2231
- target: o.value.openInNewTab ? "_blank" : null
2227
+ }, 20), r.value.link && r.value.link.trim() !== "") {
2228
+ let F = r.value.link.trim();
2229
+ F.match(/^https?:\/\//i) || (F = "https://" + F), M ? e.editor.chain().focus().extendMarkRange("link").setLink({
2230
+ href: F,
2231
+ target: r.value.openInNewTab ? "_blank" : null
2232
2232
  }).run() : e.editor.chain().focus().selectParentNode().setLink({
2233
- href: u,
2234
- target: o.value.openInNewTab ? "_blank" : null
2233
+ href: F,
2234
+ target: r.value.openInNewTab ? "_blank" : null
2235
2235
  }).run();
2236
2236
  } else M && e.editor.chain().focus().extendMarkRange("link").unsetLink().run();
2237
2237
  } else {
2238
2238
  const { state: h } = e.editor, { selection: S } = h, { $anchor: M } = S;
2239
- let N = null;
2240
- for (let u = M.depth; u > 0; u--) {
2241
- const x = M.node(u);
2242
- if (x && x.type.name === "paragraph") {
2243
- N = x;
2239
+ let z = null;
2240
+ for (let F = M.depth; F > 0; F--) {
2241
+ const H = M.node(F);
2242
+ if (H && H.type.name === "paragraph") {
2243
+ z = H;
2244
2244
  break;
2245
2245
  }
2246
2246
  }
2247
- if (N && N.content.content.some(
2248
- (u) => u.type.name === "image"
2247
+ if (z && z.content.content.some(
2248
+ (F) => F.type.name === "image"
2249
2249
  )) {
2250
- const u = Q(N, M.before(M.depth));
2251
- if (u !== null) {
2252
- const x = U(), A = h.schema.nodes.image.create({
2250
+ const F = ee(z, M.before(M.depth));
2251
+ if (F !== null) {
2252
+ const H = R(), X = h.schema.nodes.image.create({
2253
2253
  src: y,
2254
- alt: o.value.alt || "",
2255
- title: o.value.title || "",
2256
- ...x
2254
+ alt: r.value.alt || "",
2255
+ title: r.value.title || "",
2256
+ ...H
2257
2257
  });
2258
- if (o.value.link && o.value.link.trim() !== "") {
2259
- let T = o.value.link.trim();
2260
- T.match(/^https?:\/\//i) || (T = "https://" + T);
2261
- const D = h.schema.marks.link.create({
2262
- href: T,
2263
- target: o.value.openInNewTab ? "_blank" : null
2264
- }), se = A.type.create(A.attrs, A.content, [D]);
2265
- e.editor.chain().focus().insertContentAt(u + 1, se).run(), Y(e.editor, y);
2258
+ if (r.value.link && r.value.link.trim() !== "") {
2259
+ let g = r.value.link.trim();
2260
+ g.match(/^https?:\/\//i) || (g = "https://" + g);
2261
+ const A = h.schema.marks.link.create({
2262
+ href: g,
2263
+ target: r.value.openInNewTab ? "_blank" : null
2264
+ }), B = X.type.create(X.attrs, X.content, [A]);
2265
+ e.editor.chain().focus().insertContentAt(F + 1, B).run(), J(e.editor, y);
2266
2266
  } else
2267
- e.editor.chain().focus().insertContentAt(u + 1, A).run(), Y(e.editor, y);
2268
- } else if (o.value.link && o.value.link.trim() !== "") {
2269
- const x = U();
2267
+ e.editor.chain().focus().insertContentAt(F + 1, X).run(), J(e.editor, y);
2268
+ } else if (r.value.link && r.value.link.trim() !== "") {
2269
+ const H = R();
2270
2270
  e.editor.chain().focus().setImage({
2271
2271
  src: y,
2272
- alt: o.value.alt || "",
2273
- title: o.value.title || "",
2274
- ...x
2272
+ alt: r.value.alt || "",
2273
+ title: r.value.title || "",
2274
+ ...H
2275
2275
  }).run(), setTimeout(() => {
2276
- let A = o.value.link.trim();
2277
- A.match(/^https?:\/\//i) || (A = "https://" + A), e.editor.chain().focus().selectParentNode().setLink({
2278
- href: A,
2279
- target: o.value.openInNewTab ? "_blank" : null
2280
- }).run(), Y(e.editor, y, 20);
2276
+ let X = r.value.link.trim();
2277
+ X.match(/^https?:\/\//i) || (X = "https://" + X), e.editor.chain().focus().selectParentNode().setLink({
2278
+ href: X,
2279
+ target: r.value.openInNewTab ? "_blank" : null
2280
+ }).run(), J(e.editor, y, 20);
2281
2281
  }, 10);
2282
2282
  } else {
2283
- const x = U();
2283
+ const H = R();
2284
2284
  e.editor.chain().focus().setImage({
2285
2285
  src: y,
2286
- alt: o.value.alt || "",
2287
- title: o.value.title || "",
2288
- ...x
2289
- }).run(), Y(e.editor, y);
2286
+ alt: r.value.alt || "",
2287
+ title: r.value.title || "",
2288
+ ...H
2289
+ }).run(), J(e.editor, y);
2290
2290
  }
2291
- } else if (o.value.link && o.value.link.trim() !== "") {
2292
- const u = U();
2291
+ } else if (r.value.link && r.value.link.trim() !== "") {
2292
+ const F = R();
2293
2293
  e.editor.chain().focus().setImage({
2294
2294
  src: y,
2295
- alt: o.value.alt || "",
2296
- title: o.value.title || "",
2297
- ...u
2295
+ alt: r.value.alt || "",
2296
+ title: r.value.title || "",
2297
+ ...F
2298
2298
  }).run(), setTimeout(() => {
2299
- let x = o.value.link.trim();
2300
- x.match(/^https?:\/\//i) || (x = "https://" + x), e.editor.chain().focus().selectParentNode().setLink({
2301
- href: x,
2302
- target: o.value.openInNewTab ? "_blank" : null
2303
- }).run(), Y(e.editor, y, 20);
2299
+ let H = r.value.link.trim();
2300
+ H.match(/^https?:\/\//i) || (H = "https://" + H), e.editor.chain().focus().selectParentNode().setLink({
2301
+ href: H,
2302
+ target: r.value.openInNewTab ? "_blank" : null
2303
+ }).run(), J(e.editor, y, 20);
2304
2304
  }, 10);
2305
2305
  } else {
2306
- const u = U();
2306
+ const F = R();
2307
2307
  e.editor.chain().focus().setImage({
2308
2308
  src: y,
2309
- alt: o.value.alt || "",
2310
- title: o.value.title || "",
2311
- ...u
2312
- }).run(), Y(e.editor, y);
2309
+ alt: r.value.alt || "",
2310
+ title: r.value.title || "",
2311
+ ...F
2312
+ }).run(), J(e.editor, y);
2313
2313
  }
2314
2314
  }
2315
- P();
2316
- }, Q = (m, _) => {
2317
- let f = null;
2318
- return m.forEach(($, y) => {
2319
- $.type.name === "image" && (f = _ + y + 1);
2320
- }), f;
2321
- }, oe = async () => {
2315
+ I();
2316
+ }, ee = (m, k) => {
2317
+ let u = null;
2318
+ return m.forEach((_, y) => {
2319
+ _.type.name === "image" && (u = k + y + 1);
2320
+ }), u;
2321
+ }, ne = async () => {
2322
2322
  if (e.editor) {
2323
2323
  if (l.value.length === 0)
2324
- if (Array.isArray(o.value.file) && o.value.file.length > 0) {
2325
- const m = o.value.file.filter((f) => typeof f == "string" && f.trim() !== ""), _ = o.value.file.filter((f) => f instanceof File);
2326
- for (const f of m)
2327
- l.value.some(($) => $.url === f || $.preview === f) || l.value.push({
2328
- url: f,
2329
- preview: f,
2324
+ if (Array.isArray(r.value.file) && r.value.file.length > 0) {
2325
+ const m = r.value.file.filter((u) => typeof u == "string" && u.trim() !== ""), k = r.value.file.filter((u) => u instanceof File);
2326
+ for (const u of m)
2327
+ l.value.some((_) => _.url === u || _.preview === u) || l.value.push({
2328
+ url: u,
2329
+ preview: u,
2330
2330
  error: !1
2331
2331
  });
2332
- _.length > 0 && await O(_);
2333
- } else i.value && await O(o.value.file);
2332
+ k.length > 0 && await V(k);
2333
+ } else i.value && await V(r.value.file);
2334
2334
  if (l.value.length !== 0)
2335
2335
  try {
2336
- const m = [], _ = U();
2337
- for (const f of l.value) {
2338
- const $ = f.url || f.preview || "";
2339
- if (!$) continue;
2336
+ const m = [], k = R();
2337
+ for (const u of l.value) {
2338
+ const _ = u.url || u.preview || "";
2339
+ if (!_) continue;
2340
2340
  const y = e.editor.schema.nodes.image.create({
2341
- src: $,
2342
- alt: o.value.alt || "",
2343
- title: o.value.title || "",
2344
- ..._
2341
+ src: _,
2342
+ alt: r.value.alt || "",
2343
+ title: r.value.title || "",
2344
+ ...k
2345
2345
  });
2346
2346
  m.push(y);
2347
2347
  }
2348
- m.length > 0 && (e.editor.chain().focus().command(({ tr: f, dispatch: $ }) => {
2349
- if ($) {
2350
- const { selection: y } = f, { $anchor: B } = y;
2348
+ m.length > 0 && (e.editor.chain().focus().command(({ tr: u, dispatch: _ }) => {
2349
+ if (_) {
2350
+ const { selection: y } = u, { $anchor: T } = y;
2351
2351
  let h = y.$anchor.pos, S = null, M = null;
2352
- for (let j = B.depth; j > 0; j--) {
2353
- const u = B.node(j);
2354
- if (u && u.type.name === "paragraph") {
2355
- S = u, M = B.start(j);
2352
+ for (let j = T.depth; j > 0; j--) {
2353
+ const F = T.node(j);
2354
+ if (F && F.type.name === "paragraph") {
2355
+ S = F, M = T.start(j);
2356
2356
  break;
2357
2357
  }
2358
2358
  }
2359
2359
  if (S) {
2360
2360
  let j = null;
2361
- S.forEach((u, x) => {
2362
- u.type.name === "image" && (j = M + x + 1);
2361
+ S.forEach((F, H) => {
2362
+ F.type.name === "image" && (j = M + H + 1);
2363
2363
  }), j !== null ? h = j + 1 : h = M + S.content.size;
2364
2364
  }
2365
- let N = h;
2365
+ let z = h;
2366
2366
  return m.forEach((j) => {
2367
- f.insert(N, j), N += j.nodeSize;
2367
+ u.insert(z, j), z += j.nodeSize;
2368
2368
  }), !0;
2369
2369
  }
2370
2370
  return !1;
2371
- }).run(), o.value.width && o.value.height && setTimeout(() => {
2372
- const { view: f } = e.editor;
2373
- f && f.dom && f.dom.querySelectorAll("img.editor-image").forEach((B) => {
2374
- B instanceof HTMLImageElement && Array.from(l.value).some((S) => {
2375
- const M = S.url || S.preview || "", N = B.src || B.getAttribute("src") || "";
2376
- return N === M || N.includes(M.split("/").pop());
2377
- }) && (B.style.setProperty("width", `${o.value.width}px`, "important"), B.style.setProperty("height", `${o.value.height}px`, "important"), B.style.setProperty("object-fit", "fill", "important"), B.style.setProperty("max-width", "none", "important"), B.style.setProperty("max-height", "none", "important"));
2371
+ }).run(), r.value.width && r.value.height && setTimeout(() => {
2372
+ const { view: u } = e.editor;
2373
+ u && u.dom && u.dom.querySelectorAll("img.editor-image").forEach((T) => {
2374
+ T instanceof HTMLImageElement && Array.from(l.value).some((S) => {
2375
+ const M = S.url || S.preview || "", z = T.src || T.getAttribute("src") || "";
2376
+ return z === M || z.includes(M.split("/").pop());
2377
+ }) && (T.style.setProperty("width", `${r.value.width}px`, "important"), T.style.setProperty("height", `${r.value.height}px`, "important"), T.style.setProperty("object-fit", "fill", "important"), T.style.setProperty("max-width", "none", "important"), T.style.setProperty("max-height", "none", "important"));
2378
2378
  });
2379
- }, 50)), P();
2379
+ }, 50)), I();
2380
2380
  } catch (m) {
2381
- console.error("Помилка при додаванні зображень:", m), Ce({
2381
+ console.error("Помилка при додаванні зображень:", m), Se({
2382
2382
  type: "error",
2383
2383
  title: "Помилка",
2384
2384
  message: "Не вдалося додати зображення"
2385
2385
  });
2386
2386
  }
2387
2387
  }
2388
- }, ue = async () => {
2389
- await I();
2390
- }, fe = () => {
2391
- P();
2388
+ }, pe = async () => {
2389
+ await P();
2390
+ }, ge = () => {
2391
+ I();
2392
2392
  };
2393
- return we(() => o.value.file, async (m, _) => {
2394
- if (s.value = !1, !(r.value && Array.isArray(m) && m.length === 1 && typeof m[0] == "string" && !m.some(($) => $ instanceof File)))
2393
+ return me(() => r.value.file, async (m, k) => {
2394
+ if (s.value = !1, !(o.value && Array.isArray(m) && m.length === 1 && typeof m[0] == "string" && !m.some((_) => _ instanceof File)))
2395
2395
  if (Array.isArray(m) && m.length > 0) {
2396
- const f = m.filter((y) => y instanceof File), $ = m.filter((y) => typeof y == "string" && y.trim() !== "");
2397
- if (f.length > 0 && (r.value ? r.value && f.length === 1 && $.length === 0 && (l.value = []) : l.value = [], (!r.value || f.length > 1 || $.length > 0) && await O(f), r.value && f.length === 1 && $.length === 0)) {
2396
+ const u = m.filter((y) => y instanceof File), _ = m.filter((y) => typeof y == "string" && y.trim() !== "");
2397
+ if (u.length > 0 && (o.value ? o.value && u.length === 1 && _.length === 0 && (l.value = []) : l.value = [], (!o.value || u.length > 1 || _.length > 0) && await V(u), o.value && u.length === 1 && _.length === 0)) {
2398
2398
  const y = new FileReader();
2399
- y.onload = (B) => {
2400
- o.value.src = B.target.result;
2401
- }, y.readAsDataURL(f[0]);
2399
+ y.onload = (T) => {
2400
+ r.value.src = T.target.result;
2401
+ }, y.readAsDataURL(u[0]);
2402
2402
  }
2403
- if ($.length > 0)
2404
- if (r.value)
2405
- r.value && $.length === 1 && f.length === 0 && (o.value.src = $[0]);
2403
+ if (_.length > 0)
2404
+ if (o.value)
2405
+ o.value && _.length === 1 && u.length === 0 && (r.value.src = _[0]);
2406
2406
  else {
2407
- f.length === 0 && (l.value = []);
2408
- for (const y of $)
2409
- l.value.some((B) => B.url === y || B.preview === y) || l.value.push({
2407
+ u.length === 0 && (l.value = []);
2408
+ for (const y of _)
2409
+ l.value.some((T) => T.url === y || T.preview === y) || l.value.push({
2410
2410
  url: y,
2411
2411
  preview: y,
2412
2412
  error: !1
2413
2413
  });
2414
2414
  }
2415
- } else m && typeof m == "object" && m instanceof FileList ? (r.value || (l.value = []), await O(Array.from(m))) : m && typeof m == "object" && !Array.isArray(m) && m instanceof File ? (r.value || (l.value = []), await O([m])) : r.value || (l.value = []);
2416
- }, { immediate: !1 }), we(() => o.value.src, () => {
2415
+ } else m && typeof m == "object" && m instanceof FileList ? (o.value || (l.value = []), await V(Array.from(m))) : m && typeof m == "object" && !Array.isArray(m) && m instanceof File ? (o.value || (l.value = []), await V([m])) : o.value || (l.value = []);
2416
+ }, { immediate: !1 }), me(() => r.value.src, () => {
2417
2417
  s.value = !1;
2418
- }), (m, _) => (v(), k("div", tl, [
2418
+ }), (m, k) => (v(), w("div", ll, [
2419
2419
  d("button", {
2420
- onClick: g,
2420
+ onClick: p,
2421
2421
  class: E([
2422
2422
  "h-[30px] w-[30px] flex items-center justify-center text-gray-500 rounded-full cursor-pointer hover:text-gray-900 hover:bg-gray-100",
2423
2423
  t.editor?.isActive("image") ? "bg-gray-200 text-gray-900" : ""
2424
2424
  ]),
2425
2425
  title: "Додати зображення"
2426
2426
  }, [
2427
- F(L(Rt), { class: "h-4 w-4" }),
2428
- _[4] || (_[4] = d("span", { class: "sr-only" }, "Додати зображення", -1))
2427
+ C(L(Kt), { class: "h-4 w-4" }),
2428
+ k[4] || (k[4] = d("span", { class: "sr-only" }, "Додати зображення", -1))
2429
2429
  ], 2),
2430
- F(et, {
2430
+ C(ot, {
2431
2431
  modelValue: a.value,
2432
- "onUpdate:modelValue": _[3] || (_[3] = (f) => a.value = f),
2433
- title: r.value ? "Редагувати зображення" : "Додати зображення"
2432
+ "onUpdate:modelValue": k[3] || (k[3] = (u) => a.value = u),
2433
+ title: o.value ? "Редагувати зображення" : "Додати зображення"
2434
2434
  }, {
2435
- footer: R(() => [
2436
- d("div", dl, [
2435
+ footer: q(() => [
2436
+ d("div", pl, [
2437
2437
  d("button", {
2438
- onClick: fe,
2438
+ onClick: ge,
2439
2439
  type: "button",
2440
2440
  class: "px-4 py-2 text-sm font-medium text-gray-700 bg-white border border-gray-300 rounded-md hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-blue-500"
2441
2441
  }, " Скасувати "),
2442
2442
  d("button", {
2443
- onClick: ue,
2443
+ onClick: pe,
2444
2444
  type: "button",
2445
2445
  class: "px-4 py-2 text-sm font-medium text-white bg-blue-600 border border-transparent rounded-md hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-blue-500"
2446
- }, W(r.value ? "Оновити зображення" : "Додати зображення"), 1)
2446
+ }, Y(o.value ? "Оновити зображення" : "Додати зображення"), 1)
2447
2447
  ])
2448
2448
  ]),
2449
- default: R(() => [
2450
- F(vt, {
2451
- modelValue: o.value,
2452
- "onUpdate:modelValue": _[0] || (_[0] = (f) => o.value = f),
2453
- schema: p.value,
2449
+ default: q(() => [
2450
+ C(yt, {
2451
+ modelValue: r.value,
2452
+ "onUpdate:modelValue": k[0] || (k[0] = (u) => r.value = u),
2453
+ schema: f.value,
2454
2454
  form: n.value,
2455
- "onUpdate:form": _[1] || (_[1] = (f) => n.value = f)
2455
+ "onUpdate:form": k[1] || (k[1] = (u) => n.value = u)
2456
2456
  }, null, 8, ["modelValue", "schema", "form"]),
2457
- b.value && !i.value ? (v(), k("div", rl, [
2458
- _[5] || (_[5] = d("p", { class: "text-sm text-gray-600 mb-2" }, "Попередній перегляд:", -1)),
2459
- ce(d("img", {
2457
+ b.value && !i.value ? (v(), w("div", al, [
2458
+ k[5] || (k[5] = d("p", { class: "text-sm text-gray-600 mb-2" }, "Попередній перегляд:", -1)),
2459
+ de(d("img", {
2460
2460
  src: b.value,
2461
- alt: o.value.alt || "Попередній перегляд зображення",
2462
- title: o.value.title,
2461
+ alt: r.value.alt || "Попередній перегляд зображення",
2462
+ title: r.value.title,
2463
2463
  class: "max-w-full h-auto max-h-32 rounded border",
2464
- onError: _[2] || (_[2] = (f) => s.value = !0)
2465
- }, null, 40, ol), [
2466
- [ke, !s.value]
2464
+ onError: k[2] || (k[2] = (u) => s.value = !0)
2465
+ }, null, 40, nl), [
2466
+ [$e, !s.value]
2467
2467
  ]),
2468
- s.value ? (v(), k("p", ll, " Не вдалося завантажити попередній перегляд зображення ")) : V("", !0)
2469
- ])) : V("", !0),
2470
- l.value.length > 0 ? (v(), k("div", al, [
2471
- d("p", nl, "Попередній перегляд (" + W(l.value.length) + " зображень):", 1),
2472
- _[6] || (_[6] = d("p", { class: "text-xs text-gray-500 mb-2" }, " Зображення будуть розміщені в ряд, якщо вони помістяться по ширині ", -1)),
2473
- d("div", sl, [
2474
- (v(!0), k(re, null, ne(l.value, (f, $) => (v(), k("div", {
2475
- key: $,
2468
+ s.value ? (v(), w("p", sl, " Не вдалося завантажити попередній перегляд зображення ")) : U("", !0)
2469
+ ])) : U("", !0),
2470
+ l.value.length > 0 ? (v(), w("div", il, [
2471
+ d("p", cl, "Попередній перегляд (" + Y(l.value.length) + " зображень):", 1),
2472
+ k[6] || (k[6] = d("p", { class: "text-xs text-gray-500 mb-2" }, " Зображення будуть розміщені в ряд, якщо вони помістяться по ширині ", -1)),
2473
+ d("div", dl, [
2474
+ (v(!0), w(ae, null, ie(l.value, (u, _) => (v(), w("div", {
2475
+ key: _,
2476
2476
  class: "relative"
2477
2477
  }, [
2478
- ce(d("img", {
2479
- src: f.preview,
2480
- alt: `Попередній перегляд ${$ + 1}`,
2478
+ de(d("img", {
2479
+ src: u.preview,
2480
+ alt: `Попередній перегляд ${_ + 1}`,
2481
2481
  class: "max-w-[100px] max-h-[100px] rounded border object-contain",
2482
- onError: (y) => f.error = !0
2483
- }, null, 40, il), [
2484
- [ke, !f.error]
2482
+ onError: (y) => u.error = !0
2483
+ }, null, 40, ul), [
2484
+ [$e, !u.error]
2485
2485
  ]),
2486
2486
  d("button", {
2487
- onClick: (y) => z($),
2487
+ onClick: (y) => O(_),
2488
2488
  class: "absolute -top-2 -right-2 bg-red-500 text-white rounded-full w-5 h-5 flex items-center justify-center text-xs hover:bg-red-600",
2489
2489
  type: "button"
2490
- }, " × ", 8, cl)
2490
+ }, " × ", 8, fl)
2491
2491
  ]))), 128))
2492
2492
  ])
2493
- ])) : V("", !0)
2493
+ ])) : U("", !0)
2494
2494
  ]),
2495
2495
  _: 1
2496
2496
  }, 8, ["modelValue", "title"])
2497
2497
  ]));
2498
2498
  }
2499
- }), fl = { class: "flex items-center" }, pl = ["disabled"], gl = ["disabled"], hl = /* @__PURE__ */ Object.assign({
2499
+ }), hl = { class: "flex items-center" }, vl = ["disabled"], ml = ["disabled"], bl = /* @__PURE__ */ Object.assign({
2500
2500
  inheritAttrs: !1
2501
2501
  }, {
2502
2502
  __name: "vs-editor-history",
@@ -2507,7 +2507,7 @@ const el = /* @__PURE__ */ X(Zo, [["render", Jo]]), tl = { class: "relative" },
2507
2507
  }, s = () => {
2508
2508
  e.editor?.can().redo() && e.editor.chain().focus().redo().run();
2509
2509
  };
2510
- return (n, r) => (v(), k("div", fl, [
2510
+ return (n, o) => (v(), w("div", hl, [
2511
2511
  d("button", {
2512
2512
  onClick: a,
2513
2513
  class: E(["w-[30px] h-[30px] flex items-center justify-center rounded-l-full hover:text-gray-900 hover:bg-gray-100 border-r border-gray-200", [
@@ -2516,8 +2516,8 @@ const el = /* @__PURE__ */ X(Zo, [["render", Jo]]), tl = { class: "relative" },
2516
2516
  disabled: !t.editor?.can().undo(),
2517
2517
  title: "Undo (Ctrl+Z)"
2518
2518
  }, [
2519
- F(L(Ut), { class: "h-4 w-4" })
2520
- ], 10, pl),
2519
+ C(L(Wt), { class: "h-4 w-4" })
2520
+ ], 10, vl),
2521
2521
  d("button", {
2522
2522
  onClick: s,
2523
2523
  class: E(["w-[30px] h-[30px] flex items-center justify-center rounded-r-full hover:text-gray-900 hover:bg-gray-100", [
@@ -2526,22 +2526,22 @@ const el = /* @__PURE__ */ X(Zo, [["render", Jo]]), tl = { class: "relative" },
2526
2526
  disabled: !t.editor?.can().redo(),
2527
2527
  title: "Redo (Ctrl+Y)"
2528
2528
  }, [
2529
- F(L(qt), { class: "h-4 w-4" })
2530
- ], 10, gl)
2529
+ C(L(Xt), { class: "h-4 w-4" })
2530
+ ], 10, ml)
2531
2531
  ]));
2532
2532
  }
2533
- }), vl = /* @__PURE__ */ X(hl, [["__scopeId", "data-v-6a87fc55"]]), ml = { class: "relative" }, bl = { class: "p-6" }, yl = { class: "flex justify-between items-center mb-4" }, xl = /* @__PURE__ */ Object.assign({
2533
+ }), yl = /* @__PURE__ */ Q(bl, [["__scopeId", "data-v-6a87fc55"]]), xl = { class: "relative" }, wl = { class: "p-6" }, kl = { class: "flex justify-between items-center mb-4" }, _l = /* @__PURE__ */ Object.assign({
2534
2534
  inheritAttrs: !1
2535
2535
  }, {
2536
2536
  __name: "vs-editor-help",
2537
2537
  props: { editor: Object },
2538
2538
  setup(t) {
2539
- const e = C(!1), a = C(null), s = () => {
2539
+ const e = $(!1), a = $(null), s = () => {
2540
2540
  e.value = !e.value;
2541
2541
  }, n = () => {
2542
2542
  e.value = !1;
2543
2543
  };
2544
- return (r, l) => (v(), k("div", ml, [
2544
+ return (o, l) => (v(), w("div", xl, [
2545
2545
  d("button", {
2546
2546
  ref_key: "helpButton",
2547
2547
  ref: a,
@@ -2549,35 +2549,35 @@ const el = /* @__PURE__ */ X(Zo, [["render", Jo]]), tl = { class: "relative" },
2549
2549
  class: E(["w-[30px] h-[30px] flex items-center justify-center rounded-full hover:text-gray-900 hover:bg-gray-100 text-gray-500", [e.value ? "bg-gray-100 text-gray-900" : "text-gray-500"]]),
2550
2550
  title: "Markdown Shortcuts Help"
2551
2551
  }, [
2552
- F(L(Kt), { class: "h-4 w-4" })
2552
+ C(L(Gt), { class: "h-4 w-4" })
2553
2553
  ], 2),
2554
- e.value ? (v(), k("div", {
2554
+ e.value ? (v(), w("div", {
2555
2555
  key: 0,
2556
2556
  class: "fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-[100001]",
2557
2557
  onClick: n
2558
2558
  }, [
2559
2559
  d("div", {
2560
2560
  class: "bg-white rounded-lg shadow-xl max-w-2xl w-full mx-4 max-h-[80vh] overflow-y-auto",
2561
- onClick: l[0] || (l[0] = dt(() => {
2561
+ onClick: l[0] || (l[0] = pt(() => {
2562
2562
  }, ["stop"]))
2563
2563
  }, [
2564
- d("div", bl, [
2565
- d("div", yl, [
2564
+ d("div", wl, [
2565
+ d("div", kl, [
2566
2566
  l[1] || (l[1] = d("h2", { class: "text-xl font-semibold text-gray-900" }, "Common Markdown Syntax & Shortcuts", -1)),
2567
2567
  d("button", {
2568
2568
  onClick: n,
2569
2569
  class: "text-gray-400 hover:text-gray-600 transition-colors"
2570
2570
  }, [
2571
- F(L(Be), { class: "h-6 w-6" })
2571
+ C(L(Pe), { class: "h-6 w-6" })
2572
2572
  ])
2573
2573
  ]),
2574
- l[2] || (l[2] = ut('<div class="space-y-6" data-v-92c21275><div data-v-92c21275><h3 class="text-lg font-medium text-gray-800 mb-3" data-v-92c21275>Markdown Syntax</h3><div class="overflow-x-auto" data-v-92c21275><table class="w-full border-collapse" data-v-92c21275><thead data-v-92c21275><tr class="bg-gray-50" data-v-92c21275><th class="border border-gray-200 px-3 py-2 text-left font-medium text-gray-700" data-v-92c21275>Element</th><th class="border border-gray-200 px-3 py-2 text-left font-medium text-gray-700" data-v-92c21275>Example</th></tr></thead><tbody class="text-sm" data-v-92c21275><tr data-v-92c21275><td class="border border-gray-200 px-3 py-2 font-medium" data-v-92c21275>Bold</td><td class="border border-gray-200 px-3 py-2" data-v-92c21275><code class="bg-gray-100 px-2 py-1 rounded" data-v-92c21275>**bold text**</code> or <code class="bg-gray-100 px-2 py-1 rounded" data-v-92c21275>__bold text__</code></td></tr><tr class="bg-gray-25" data-v-92c21275><td class="border border-gray-200 px-3 py-2 font-medium" data-v-92c21275>Italics</td><td class="border border-gray-200 px-3 py-2" data-v-92c21275><code class="bg-gray-100 px-2 py-1 rounded" data-v-92c21275>*italic text*</code> or <code class="bg-gray-100 px-2 py-1 rounded" data-v-92c21275>_italic text_</code></td></tr><tr data-v-92c21275><td class="border border-gray-200 px-3 py-2 font-medium" data-v-92c21275>Strikethrough</td><td class="border border-gray-200 px-3 py-2" data-v-92c21275><code class="bg-gray-100 px-2 py-1 rounded" data-v-92c21275>~strikethrough text~</code></td></tr><tr class="bg-gray-25" data-v-92c21275><td class="border border-gray-200 px-3 py-2 font-medium" data-v-92c21275>Headings</td><td class="border border-gray-200 px-3 py-2" data-v-92c21275><code class="bg-gray-100 px-2 py-1 rounded" data-v-92c21275># Heading 1</code>, <code class="bg-gray-100 px-2 py-1 rounded" data-v-92c21275>## Heading 2</code>, etc., up to <code class="bg-gray-100 px-2 py-1 rounded" data-v-92c21275>###### Heading 6</code></td></tr><tr data-v-92c21275><td class="border border-gray-200 px-3 py-2 font-medium" data-v-92c21275>Unordered Lists</td><td class="border border-gray-200 px-3 py-2" data-v-92c21275> Use an asterisk (*), dash (-), or plus sign (+) followed by a space. </td></tr><tr class="bg-gray-25" data-v-92c21275><td class="border border-gray-200 px-3 py-2 font-medium" data-v-92c21275>Ordered Lists</td><td class="border border-gray-200 px-3 py-2" data-v-92c21275> Use a number followed by a period and a space (e.g., <code class="bg-gray-100 px-2 py-1 rounded" data-v-92c21275>1. First item</code>). </td></tr><tr data-v-92c21275><td class="border border-gray-200 px-3 py-2 font-medium" data-v-92c21275>Blockquotes</td><td class="border border-gray-200 px-3 py-2" data-v-92c21275> Start with a greater-than sign (&gt;) followed by a space. </td></tr><tr class="bg-gray-25" data-v-92c21275><td class="border border-gray-200 px-3 py-2 font-medium" data-v-92c21275>Inline Code</td><td class="border border-gray-200 px-3 py-2" data-v-92c21275> Surround with backticks (<code class="bg-gray-100 px-2 py-1 rounded" data-v-92c21275>`</code>). </td></tr><tr data-v-92c21275><td class="border border-gray-200 px-3 py-2 font-medium" data-v-92c21275>Code Blocks</td><td class="border border-gray-200 px-3 py-2" data-v-92c21275> Enclose with three backticks (<code class="bg-gray-100 px-2 py-1 rounded" data-v-92c21275>```</code>) before and after the code. </td></tr><tr class="bg-gray-25" data-v-92c21275><td class="border border-gray-200 px-3 py-2 font-medium" data-v-92c21275>Images</td><td class="border border-gray-200 px-3 py-2" data-v-92c21275> Use <code class="bg-gray-100 px-2 py-1 rounded" data-v-92c21275>![alt text](url)</code> syntax. </td></tr><tr data-v-92c21275><td class="border border-gray-200 px-3 py-2 font-medium" data-v-92c21275>Links</td><td class="border border-gray-200 px-3 py-2" data-v-92c21275> Use <code class="bg-gray-100 px-2 py-1 rounded" data-v-92c21275>[Link Text](url)</code> syntax. </td></tr><tr class="bg-gray-25" data-v-92c21275><td class="border border-gray-200 px-3 py-2 font-medium" data-v-92c21275>Checklists</td><td class="border border-gray-200 px-3 py-2" data-v-92c21275> Create a list item with <code class="bg-gray-100 px-2 py-1 rounded" data-v-92c21275>- [ ]</code> for an incomplete task or <code class="bg-gray-100 px-2 py-1 rounded" data-v-92c21275>- [x]</code> for a completed one. </td></tr></tbody></table></div></div><div data-v-92c21275><h3 class="text-lg font-medium text-gray-800 mb-3" data-v-92c21275>Common Editing Shortcuts</h3><div class="overflow-x-auto" data-v-92c21275><table class="w-full border-collapse" data-v-92c21275><thead data-v-92c21275><tr class="bg-gray-50" data-v-92c21275><th class="border border-gray-200 px-3 py-2 text-left font-medium text-gray-700" data-v-92c21275>Shortcut</th><th class="border border-gray-200 px-3 py-2 text-left font-medium text-gray-700" data-v-92c21275>Action</th></tr></thead><tbody class="text-sm" data-v-92c21275><tr data-v-92c21275><td class="border border-gray-200 px-3 py-2 font-medium" data-v-92c21275><code class="bg-gray-100 px-2 py-1 rounded" data-v-92c21275>Ctrl+A</code></td><td class="border border-gray-200 px-3 py-2" data-v-92c21275>Select all text</td></tr><tr class="bg-gray-25" data-v-92c21275><td class="border border-gray-200 px-3 py-2 font-medium" data-v-92c21275><code class="bg-gray-100 px-2 py-1 rounded" data-v-92c21275>Ctrl+B</code></td><td class="border border-gray-200 px-3 py-2" data-v-92c21275>Apply bold formatting</td></tr><tr data-v-92c21275><td class="border border-gray-200 px-3 py-2 font-medium" data-v-92c21275><code class="bg-gray-100 px-2 py-1 rounded" data-v-92c21275>Ctrl+C</code></td><td class="border border-gray-200 px-3 py-2" data-v-92c21275>Copy selected text</td></tr><tr class="bg-gray-25" data-v-92c21275><td class="border border-gray-200 px-3 py-2 font-medium" data-v-92c21275><code class="bg-gray-100 px-2 py-1 rounded" data-v-92c21275>Ctrl+I</code></td><td class="border border-gray-200 px-3 py-2" data-v-92c21275>Apply italic formatting</td></tr><tr data-v-92c21275><td class="border border-gray-200 px-3 py-2 font-medium" data-v-92c21275><code class="bg-gray-100 px-2 py-1 rounded" data-v-92c21275>Ctrl+K</code></td><td class="border border-gray-200 px-3 py-2" data-v-92c21275>Open the insert link dialog</td></tr><tr class="bg-gray-25" data-v-92c21275><td class="border border-gray-200 px-3 py-2 font-medium" data-v-92c21275><code class="bg-gray-100 px-2 py-1 rounded" data-v-92c21275>Ctrl+S</code></td><td class="border border-gray-200 px-3 py-2" data-v-92c21275>Save the current document</td></tr><tr data-v-92c21275><td class="border border-gray-200 px-3 py-2 font-medium" data-v-92c21275><code class="bg-gray-100 px-2 py-1 rounded" data-v-92c21275>Ctrl+V</code></td><td class="border border-gray-200 px-3 py-2" data-v-92c21275>Paste copied text</td></tr><tr class="bg-gray-25" data-v-92c21275><td class="border border-gray-200 px-3 py-2 font-medium" data-v-92c21275><code class="bg-gray-100 px-2 py-1 rounded" data-v-92c21275>Ctrl+X</code></td><td class="border border-gray-200 px-3 py-2" data-v-92c21275>Cut selected text</td></tr><tr data-v-92c21275><td class="border border-gray-200 px-3 py-2 font-medium" data-v-92c21275><code class="bg-gray-100 px-2 py-1 rounded" data-v-92c21275>Ctrl+Y</code></td><td class="border border-gray-200 px-3 py-2" data-v-92c21275>Redo the last action</td></tr><tr class="bg-gray-25" data-v-92c21275><td class="border border-gray-200 px-3 py-2 font-medium" data-v-92c21275><code class="bg-gray-100 px-2 py-1 rounded" data-v-92c21275>Alt+Shift+Backspace</code></td><td class="border border-gray-200 px-3 py-2" data-v-92c21275>Redo the last action</td></tr><tr data-v-92c21275><td class="border border-gray-200 px-3 py-2 font-medium" data-v-92c21275><code class="bg-gray-100 px-2 py-1 rounded" data-v-92c21275>Ctrl+Z</code></td><td class="border border-gray-200 px-3 py-2" data-v-92c21275>Undo the last action</td></tr><tr class="bg-gray-25" data-v-92c21275><td class="border border-gray-200 px-3 py-2 font-medium" data-v-92c21275><code class="bg-gray-100 px-2 py-1 rounded" data-v-92c21275>Alt+Backspace</code></td><td class="border border-gray-200 px-3 py-2" data-v-92c21275>Undo the last action</td></tr></tbody></table></div></div></div>', 1))
2574
+ l[2] || (l[2] = gt('<div class="space-y-6" data-v-92c21275><div data-v-92c21275><h3 class="text-lg font-medium text-gray-800 mb-3" data-v-92c21275>Markdown Syntax</h3><div class="overflow-x-auto" data-v-92c21275><table class="w-full border-collapse" data-v-92c21275><thead data-v-92c21275><tr class="bg-gray-50" data-v-92c21275><th class="border border-gray-200 px-3 py-2 text-left font-medium text-gray-700" data-v-92c21275>Element</th><th class="border border-gray-200 px-3 py-2 text-left font-medium text-gray-700" data-v-92c21275>Example</th></tr></thead><tbody class="text-sm" data-v-92c21275><tr data-v-92c21275><td class="border border-gray-200 px-3 py-2 font-medium" data-v-92c21275>Bold</td><td class="border border-gray-200 px-3 py-2" data-v-92c21275><code class="bg-gray-100 px-2 py-1 rounded" data-v-92c21275>**bold text**</code> or <code class="bg-gray-100 px-2 py-1 rounded" data-v-92c21275>__bold text__</code></td></tr><tr class="bg-gray-25" data-v-92c21275><td class="border border-gray-200 px-3 py-2 font-medium" data-v-92c21275>Italics</td><td class="border border-gray-200 px-3 py-2" data-v-92c21275><code class="bg-gray-100 px-2 py-1 rounded" data-v-92c21275>*italic text*</code> or <code class="bg-gray-100 px-2 py-1 rounded" data-v-92c21275>_italic text_</code></td></tr><tr data-v-92c21275><td class="border border-gray-200 px-3 py-2 font-medium" data-v-92c21275>Strikethrough</td><td class="border border-gray-200 px-3 py-2" data-v-92c21275><code class="bg-gray-100 px-2 py-1 rounded" data-v-92c21275>~strikethrough text~</code></td></tr><tr class="bg-gray-25" data-v-92c21275><td class="border border-gray-200 px-3 py-2 font-medium" data-v-92c21275>Headings</td><td class="border border-gray-200 px-3 py-2" data-v-92c21275><code class="bg-gray-100 px-2 py-1 rounded" data-v-92c21275># Heading 1</code>, <code class="bg-gray-100 px-2 py-1 rounded" data-v-92c21275>## Heading 2</code>, etc., up to <code class="bg-gray-100 px-2 py-1 rounded" data-v-92c21275>###### Heading 6</code></td></tr><tr data-v-92c21275><td class="border border-gray-200 px-3 py-2 font-medium" data-v-92c21275>Unordered Lists</td><td class="border border-gray-200 px-3 py-2" data-v-92c21275> Use an asterisk (*), dash (-), or plus sign (+) followed by a space. </td></tr><tr class="bg-gray-25" data-v-92c21275><td class="border border-gray-200 px-3 py-2 font-medium" data-v-92c21275>Ordered Lists</td><td class="border border-gray-200 px-3 py-2" data-v-92c21275> Use a number followed by a period and a space (e.g., <code class="bg-gray-100 px-2 py-1 rounded" data-v-92c21275>1. First item</code>). </td></tr><tr data-v-92c21275><td class="border border-gray-200 px-3 py-2 font-medium" data-v-92c21275>Blockquotes</td><td class="border border-gray-200 px-3 py-2" data-v-92c21275> Start with a greater-than sign (&gt;) followed by a space. </td></tr><tr class="bg-gray-25" data-v-92c21275><td class="border border-gray-200 px-3 py-2 font-medium" data-v-92c21275>Inline Code</td><td class="border border-gray-200 px-3 py-2" data-v-92c21275> Surround with backticks (<code class="bg-gray-100 px-2 py-1 rounded" data-v-92c21275>`</code>). </td></tr><tr data-v-92c21275><td class="border border-gray-200 px-3 py-2 font-medium" data-v-92c21275>Code Blocks</td><td class="border border-gray-200 px-3 py-2" data-v-92c21275> Enclose with three backticks (<code class="bg-gray-100 px-2 py-1 rounded" data-v-92c21275>```</code>) before and after the code. </td></tr><tr class="bg-gray-25" data-v-92c21275><td class="border border-gray-200 px-3 py-2 font-medium" data-v-92c21275>Images</td><td class="border border-gray-200 px-3 py-2" data-v-92c21275> Use <code class="bg-gray-100 px-2 py-1 rounded" data-v-92c21275>![alt text](url)</code> syntax. </td></tr><tr data-v-92c21275><td class="border border-gray-200 px-3 py-2 font-medium" data-v-92c21275>Links</td><td class="border border-gray-200 px-3 py-2" data-v-92c21275> Use <code class="bg-gray-100 px-2 py-1 rounded" data-v-92c21275>[Link Text](url)</code> syntax. </td></tr><tr class="bg-gray-25" data-v-92c21275><td class="border border-gray-200 px-3 py-2 font-medium" data-v-92c21275>Checklists</td><td class="border border-gray-200 px-3 py-2" data-v-92c21275> Create a list item with <code class="bg-gray-100 px-2 py-1 rounded" data-v-92c21275>- [ ]</code> for an incomplete task or <code class="bg-gray-100 px-2 py-1 rounded" data-v-92c21275>- [x]</code> for a completed one. </td></tr></tbody></table></div></div><div data-v-92c21275><h3 class="text-lg font-medium text-gray-800 mb-3" data-v-92c21275>Common Editing Shortcuts</h3><div class="overflow-x-auto" data-v-92c21275><table class="w-full border-collapse" data-v-92c21275><thead data-v-92c21275><tr class="bg-gray-50" data-v-92c21275><th class="border border-gray-200 px-3 py-2 text-left font-medium text-gray-700" data-v-92c21275>Shortcut</th><th class="border border-gray-200 px-3 py-2 text-left font-medium text-gray-700" data-v-92c21275>Action</th></tr></thead><tbody class="text-sm" data-v-92c21275><tr data-v-92c21275><td class="border border-gray-200 px-3 py-2 font-medium" data-v-92c21275><code class="bg-gray-100 px-2 py-1 rounded" data-v-92c21275>Ctrl+A</code></td><td class="border border-gray-200 px-3 py-2" data-v-92c21275>Select all text</td></tr><tr class="bg-gray-25" data-v-92c21275><td class="border border-gray-200 px-3 py-2 font-medium" data-v-92c21275><code class="bg-gray-100 px-2 py-1 rounded" data-v-92c21275>Ctrl+B</code></td><td class="border border-gray-200 px-3 py-2" data-v-92c21275>Apply bold formatting</td></tr><tr data-v-92c21275><td class="border border-gray-200 px-3 py-2 font-medium" data-v-92c21275><code class="bg-gray-100 px-2 py-1 rounded" data-v-92c21275>Ctrl+C</code></td><td class="border border-gray-200 px-3 py-2" data-v-92c21275>Copy selected text</td></tr><tr class="bg-gray-25" data-v-92c21275><td class="border border-gray-200 px-3 py-2 font-medium" data-v-92c21275><code class="bg-gray-100 px-2 py-1 rounded" data-v-92c21275>Ctrl+I</code></td><td class="border border-gray-200 px-3 py-2" data-v-92c21275>Apply italic formatting</td></tr><tr data-v-92c21275><td class="border border-gray-200 px-3 py-2 font-medium" data-v-92c21275><code class="bg-gray-100 px-2 py-1 rounded" data-v-92c21275>Ctrl+K</code></td><td class="border border-gray-200 px-3 py-2" data-v-92c21275>Open the insert link dialog</td></tr><tr class="bg-gray-25" data-v-92c21275><td class="border border-gray-200 px-3 py-2 font-medium" data-v-92c21275><code class="bg-gray-100 px-2 py-1 rounded" data-v-92c21275>Ctrl+S</code></td><td class="border border-gray-200 px-3 py-2" data-v-92c21275>Save the current document</td></tr><tr data-v-92c21275><td class="border border-gray-200 px-3 py-2 font-medium" data-v-92c21275><code class="bg-gray-100 px-2 py-1 rounded" data-v-92c21275>Ctrl+V</code></td><td class="border border-gray-200 px-3 py-2" data-v-92c21275>Paste copied text</td></tr><tr class="bg-gray-25" data-v-92c21275><td class="border border-gray-200 px-3 py-2 font-medium" data-v-92c21275><code class="bg-gray-100 px-2 py-1 rounded" data-v-92c21275>Ctrl+X</code></td><td class="border border-gray-200 px-3 py-2" data-v-92c21275>Cut selected text</td></tr><tr data-v-92c21275><td class="border border-gray-200 px-3 py-2 font-medium" data-v-92c21275><code class="bg-gray-100 px-2 py-1 rounded" data-v-92c21275>Ctrl+Y</code></td><td class="border border-gray-200 px-3 py-2" data-v-92c21275>Redo the last action</td></tr><tr class="bg-gray-25" data-v-92c21275><td class="border border-gray-200 px-3 py-2 font-medium" data-v-92c21275><code class="bg-gray-100 px-2 py-1 rounded" data-v-92c21275>Alt+Shift+Backspace</code></td><td class="border border-gray-200 px-3 py-2" data-v-92c21275>Redo the last action</td></tr><tr data-v-92c21275><td class="border border-gray-200 px-3 py-2 font-medium" data-v-92c21275><code class="bg-gray-100 px-2 py-1 rounded" data-v-92c21275>Ctrl+Z</code></td><td class="border border-gray-200 px-3 py-2" data-v-92c21275>Undo the last action</td></tr><tr class="bg-gray-25" data-v-92c21275><td class="border border-gray-200 px-3 py-2 font-medium" data-v-92c21275><code class="bg-gray-100 px-2 py-1 rounded" data-v-92c21275>Alt+Backspace</code></td><td class="border border-gray-200 px-3 py-2" data-v-92c21275>Undo the last action</td></tr></tbody></table></div></div></div>', 1))
2575
2575
  ])
2576
2576
  ])
2577
- ])) : V("", !0)
2577
+ ])) : U("", !0)
2578
2578
  ]));
2579
2579
  }
2580
- }), wl = /* @__PURE__ */ X(xl, [["__scopeId", "data-v-92c21275"]]), kl = {
2580
+ }), $l = /* @__PURE__ */ Q(_l, [["__scopeId", "data-v-92c21275"]]), Cl = {
2581
2581
  __name: "vs-editor-horizontal-rule",
2582
2582
  props: {
2583
2583
  editor: Object
@@ -2586,15 +2586,15 @@ const el = /* @__PURE__ */ X(Zo, [["render", Jo]]), tl = { class: "relative" },
2586
2586
  const e = t, a = () => {
2587
2587
  e.editor && e.editor.chain().focus().setHorizontalRule().run();
2588
2588
  };
2589
- return (s, n) => (v(), k("button", {
2589
+ return (s, n) => (v(), w("button", {
2590
2590
  title: "Horizontal Rule",
2591
2591
  onClick: a,
2592
2592
  class: "flex flex-col h-[30px] px-1 rounded-full hover:bg-gray-100 justify-center items-center relative flex"
2593
2593
  }, [
2594
- F(L(Wt), { class: "h-4 w-4" })
2594
+ C(L(Yt), { class: "h-4 w-4" })
2595
2595
  ]));
2596
2596
  }
2597
- }, _l = {
2597
+ }, Al = {
2598
2598
  __name: "vs-editor-fullscreen",
2599
2599
  props: {
2600
2600
  editor: Object
@@ -2604,41 +2604,41 @@ const el = /* @__PURE__ */ X(Zo, [["render", Jo]]), tl = { class: "relative" },
2604
2604
  const a = e, s = () => {
2605
2605
  a("toggle-fullscreen");
2606
2606
  };
2607
- return (n, r) => (v(), k("button", {
2607
+ return (n, o) => (v(), w("button", {
2608
2608
  title: "Fullscreen",
2609
2609
  onClick: s,
2610
2610
  class: "w-[30px] h-[30px] flex items-center justify-center text-gray-500 rounded-full hover:text-gray-900 hover:bg-gray-100"
2611
2611
  }, [
2612
- F(L(Xt), { class: "h-4 w-4" })
2612
+ C(L(Qt), { class: "h-4 w-4" })
2613
2613
  ]));
2614
2614
  }
2615
- }, $l = {
2616
- bold: Br,
2617
- italic: Pr,
2618
- color: _o,
2619
- background_color: To,
2620
- highlight: Lo,
2621
- bullet_list: kr,
2622
- ordered_list: Cr,
2623
- blockquote: yr,
2624
- codeblock: Sr,
2625
- underline: jr,
2626
- strike: Mr,
2627
- link: ao,
2628
- table: uo,
2629
- text_align: go,
2630
- font_family: jo,
2631
- font_size: zo,
2632
- superscript: Vo,
2633
- subscript: qo,
2634
- heading: Qo,
2635
- clear_formatting: el,
2636
- image: ul,
2637
- history: vl,
2638
- help: wl,
2639
- horizontal_rule: kl,
2640
- fullscreen: _l
2641
- }, qe = {
2615
+ }, Fl = {
2616
+ bold: Pr,
2617
+ italic: Hr,
2618
+ color: Ao,
2619
+ background_color: Eo,
2620
+ highlight: Io,
2621
+ bullet_list: Cr,
2622
+ ordered_list: Sr,
2623
+ blockquote: kr,
2624
+ codeblock: Br,
2625
+ underline: Nr,
2626
+ strike: zr,
2627
+ link: io,
2628
+ table: go,
2629
+ text_align: mo,
2630
+ font_family: No,
2631
+ font_size: Oo,
2632
+ superscript: qo,
2633
+ subscript: Xo,
2634
+ heading: el,
2635
+ clear_formatting: ol,
2636
+ image: gl,
2637
+ history: yl,
2638
+ help: $l,
2639
+ horizontal_rule: Cl,
2640
+ fullscreen: Al
2641
+ }, Xe = {
2642
2642
  // Базовий набір - мінімальний функціонал
2643
2643
  basic: [
2644
2644
  "history",
@@ -2712,17 +2712,17 @@ const el = /* @__PURE__ */ X(Zo, [["render", Jo]]), tl = { class: "relative" },
2712
2712
  "fullscreen",
2713
2713
  "help"
2714
2714
  ]
2715
- }, Cl = { class: "flex align-middle gap-x-0.5 border-b flex-wrap border-b-gray-200 px-[10px] py-[6px] border-solid border-transparent" }, Al = { class: "editor-body" }, Fl = {
2715
+ }, Sl = { class: "flex align-middle gap-x-0.5 border-b flex-wrap border-b-gray-200 px-[10px] py-[6px] border-solid border-transparent" }, Tl = { class: "editor-body" }, Ll = {
2716
2716
  key: 0,
2717
2717
  class: "richtext-loading text-sm text-gray-500"
2718
- }, Sl = {
2718
+ }, Bl = {
2719
2719
  key: 1,
2720
2720
  class: "richtext-error text-sm text-red-600"
2721
- }, Tl = { class: "html-source-editor" }, Ll = { class: "flex justify-end border-t border-[#e5e7eb] bg-[#f8fafc] px-4 min-h-[38px] items-start overflow-visible" }, Bl = { class: "inline-flex items-stretch -mt-px" }, Ml = /* @__PURE__ */ Object.assign({
2721
+ }, El = { class: "html-source-editor" }, Il = { class: "flex justify-end border-t border-[#e5e7eb] bg-[#f8fafc] px-4 min-h-[38px] items-start overflow-visible" }, Pl = { class: "inline-flex items-stretch -mt-px" }, zl = /* @__PURE__ */ Object.assign({
2722
2722
  inheritAttrs: !1
2723
2723
  }, {
2724
2724
  __name: "vs-richtext",
2725
- props: /* @__PURE__ */ ft({
2725
+ props: /* @__PURE__ */ ht({
2726
2726
  modelValue: { type: String, default: () => "" },
2727
2727
  height: { type: String, default: () => "300px" },
2728
2728
  format: { type: String, default: () => "html" },
@@ -2736,28 +2736,28 @@ const el = /* @__PURE__ */ X(Zo, [["render", Jo]]), tl = { class: "relative" },
2736
2736
  }),
2737
2737
  emits: ["update:modelValue"],
2738
2738
  setup(t) {
2739
- const e = t, a = pt(t, "modelValue"), s = C(null), n = C(null), r = gt(null), l = C(!1), c = C(""), o = C(!1), i = C(null), w = C(""), b = C(""), p = C(null), g = C(!1), { isFullscreen: P, toggleFullscreen: O } = Gt(), { t: z } = Me(), U = H(() => e.format === "md" ? "markdown" : "html"), Y = H(
2740
- () => e.format === "md" ? z("form.richtext.markdown") : z("form.richtext.html")
2741
- ), I = H(() => r.value || null), Q = H(() => typeof e.toolbar == "string" ? qe[e.toolbar] || qe.default : e.toolbar), oe = H(() => Q.value.map((u) => $l[u]).filter(Boolean)), ue = H(() => (i.value?.attributes || []).find((x) => x.name === "class")?.value || ""), fe = H(() => {
2742
- const x = (i.value?.attributes || []).find((T) => T.name === "style")?.value || "", A = {};
2743
- return x.split(";").forEach((T) => {
2744
- const [D, ...se] = T.split(":"), ae = D?.trim(), pe = se.join(":").trim();
2745
- !ae || !pe || ae !== "height" && (A[ae.replace(/-([a-z])/g, ($e, ot) => ot.toUpperCase())] = pe);
2746
- }), A;
2747
- }), m = (u) => {
2748
- const x = (u || "").trim();
2749
- return x ? /^<p(?:\s+[^>]*)?>(?:\s|<br[^>]*>)*<\/p>$/i.test(x) : !0;
2750
- }, _ = (u) => m(u) ? "" : u || "", f = (u) => {
2751
- const x = u || "";
2752
- p.value = x, a.value = x;
2753
- }, $ = (u) => {
2754
- if (!u || !u.view || !u.view.dom) return;
2755
- u.view.dom.querySelectorAll("img.editor-image[width][height]").forEach((A) => {
2756
- if (A instanceof HTMLImageElement) {
2757
- const T = A.getAttribute("width"), D = A.getAttribute("height");
2758
- T && D && T !== "auto" && D !== "auto" && T !== "" && D !== "" && !isNaN(Number(T)) && !isNaN(Number(D)) && (A.style.cssText = `
2759
- width: ${T}px !important;
2760
- height: ${D}px !important;
2739
+ const e = t, a = vt(t, "modelValue"), s = $(null), n = $(null), o = mt(null), l = $(!1), c = $(""), r = $(!1), i = $(null), x = $(""), b = $(""), f = $(null), p = $(!1), I = $(!1), { isFullscreen: V, toggleFullscreen: O } = Zt(), { t: R } = ze(), J = N(() => e.format === "md" ? "markdown" : "html"), P = N(
2740
+ () => e.format === "md" ? R("form.richtext.markdown") : R("form.richtext.html")
2741
+ ), ee = N(() => o.value || null), ne = N(() => typeof e.toolbar == "string" ? Xe[e.toolbar] || Xe.default : e.toolbar), pe = N(() => ne.value.map((g) => Fl[g]).filter(Boolean)), ge = N(() => (i.value?.attributes || []).find((A) => A.name === "class")?.value || ""), m = N(() => {
2742
+ const A = (i.value?.attributes || []).find((D) => D.name === "style")?.value || "", B = {};
2743
+ return A.split(";").forEach((D) => {
2744
+ const [G, ...Ae] = D.split(":"), he = G?.trim(), ve = Ae.join(":").trim();
2745
+ !he || !ve || he !== "height" && (B[he.replace(/-([a-z])/g, (Fe, nt) => nt.toUpperCase())] = ve);
2746
+ }), B;
2747
+ }), k = (g) => {
2748
+ const A = (g || "").trim();
2749
+ return A ? /^<p(?:\s+[^>]*)?>(?:\s|<br[^>]*>)*<\/p>$/i.test(A) : !0;
2750
+ }, u = (g) => k(g) ? "" : g || "", _ = (g) => {
2751
+ const A = g || "";
2752
+ f.value = A, a.value = A;
2753
+ }, y = (g) => {
2754
+ if (!g || !g.view || !g.view.dom) return;
2755
+ g.view.dom.querySelectorAll("img.editor-image[width][height]").forEach((B) => {
2756
+ if (B instanceof HTMLImageElement) {
2757
+ const D = B.getAttribute("width"), G = B.getAttribute("height");
2758
+ D && G && D !== "auto" && G !== "auto" && D !== "" && G !== "" && !isNaN(Number(D)) && !isNaN(Number(G)) && (B.style.cssText = `
2759
+ width: ${D}px !important;
2760
+ height: ${G}px !important;
2761
2761
  max-width: none !important;
2762
2762
  max-height: none !important;
2763
2763
  min-width: auto !important;
@@ -2766,64 +2766,67 @@ const el = /* @__PURE__ */ X(Zo, [["render", Jo]]), tl = { class: "relative" },
2766
2766
  `.replace(/\s+/g, " ").trim());
2767
2767
  }
2768
2768
  });
2769
- }, y = async (u, { force: x = !1 } = {}) => {
2770
- if (w.value = u || "", !r.value || o.value && !x) return;
2771
- _(r.value.getHTML()) !== (u || "") && (r.value.commands.setContent(u || "", !1), ge(() => {
2772
- $(r.value);
2769
+ }, T = async (g, { force: A = !1 } = {}) => {
2770
+ if (x.value = g || "", !o.value || r.value && !A) return;
2771
+ u(o.value.getHTML()) !== (g || "") && (o.value.commands.setContent(g || "", !1), ue(() => {
2772
+ y(o.value);
2773
2773
  }));
2774
- }, B = async (u) => {
2775
- b.value = u || "";
2776
- }, h = async (u) => {
2777
- const x = u || "";
2774
+ }, h = async (g) => {
2775
+ I.value = !0, b.value = g || "", await ue(), I.value = !1;
2776
+ }, S = async (g) => e.format === "html" ? Te(g || "") : g || "", M = async () => {
2777
+ const g = await S(b.value);
2778
+ g !== (a.value || "") ? _(g) : f.value = g;
2779
+ }, z = async (g) => {
2780
+ const A = g || "";
2778
2781
  if (e.format === "html") {
2779
- const A = Se(x), T = De(A);
2780
- i.value = T.wrapper, await y(T.bodyHtml || ""), p.value = A;
2782
+ const B = Te(A), D = Re(B);
2783
+ i.value = D.wrapper, await T(D.bodyHtml || ""), f.value = B;
2781
2784
  return;
2782
2785
  } else {
2783
2786
  i.value = null;
2784
- const A = await Ve(x, e.format);
2785
- await y(A || ""), o.value && await B(x);
2787
+ const B = await qe(A, e.format);
2788
+ await T(B || ""), r.value && await h(A);
2786
2789
  }
2787
- p.value = x;
2788
- }, S = async () => {
2790
+ f.value = A;
2791
+ }, j = async () => {
2789
2792
  if (e.format === "html") {
2790
- const x = _(r.value?.getHTML() || w.value || ""), A = Oe(x, i.value);
2791
- return Re(Se(A), "html");
2793
+ const A = u(o.value?.getHTML() || x.value || ""), B = Ue(A, i.value);
2794
+ return Ke(Te(B), "html");
2792
2795
  }
2793
- const u = _(r.value?.getHTML() || w.value || "");
2794
- return Re(u, e.format);
2795
- }, M = async (u) => {
2796
- if (o.value !== u) {
2797
- if (u) {
2798
- g.value = !0, o.value = !0, await B(await S()), ge(() => {
2796
+ const g = u(o.value?.getHTML() || x.value || "");
2797
+ return Ke(g, e.format);
2798
+ }, F = async (g) => {
2799
+ if (r.value !== g) {
2800
+ if (g) {
2801
+ p.value = !0, r.value = !0, await h(await j()), ue(() => {
2799
2802
  n.value?.focus?.();
2800
2803
  });
2801
2804
  return;
2802
2805
  }
2803
- if (e.format === "html") {
2804
- const x = Se(b.value || ""), A = De(x);
2805
- i.value = A.wrapper, await y(A.bodyHtml || "", { force: !0 });
2806
+ if (await M(), e.format === "html") {
2807
+ const A = Te(b.value || ""), B = Re(A);
2808
+ i.value = B.wrapper, await T(B.bodyHtml || "", { force: !0 });
2806
2809
  } else {
2807
- const x = await Ve(b.value || "", e.format);
2808
- await y(x || "", { force: !0 });
2810
+ const A = await qe(b.value || "", e.format);
2811
+ await T(A || "", { force: !0 });
2809
2812
  }
2810
- o.value = !1, g.value = !1, ge(() => {
2811
- r.value?.commands?.focus?.();
2813
+ r.value = !1, p.value = !1, ue(() => {
2814
+ o.value?.commands?.focus?.();
2812
2815
  });
2813
2816
  }
2814
- }, N = () => {
2815
- o.value || r.value?.commands?.focus?.();
2816
- }, j = async () => {
2817
+ }, H = () => {
2818
+ r.value || o.value?.commands?.focus?.();
2819
+ }, X = async () => {
2817
2820
  if (!s.value) return null;
2818
2821
  l.value = !0, c.value = "";
2819
2822
  try {
2820
- const u = await rr();
2821
- if (!u) return null;
2822
- const x = new u.Editor({
2823
+ const g = await ar();
2824
+ if (!g) return null;
2825
+ const A = new g.Editor({
2823
2826
  element: s.value,
2824
- content: w.value || "",
2827
+ content: x.value || "",
2825
2828
  extensions: [
2826
- u.StarterKit.configure({
2829
+ g.StarterKit.configure({
2827
2830
  history: {
2828
2831
  depth: 100,
2829
2832
  newGroupDelay: 500
@@ -2842,159 +2845,161 @@ const el = /* @__PURE__ */ X(Zo, [["render", Jo]]), tl = { class: "relative" },
2842
2845
  heading: !1,
2843
2846
  link: !1
2844
2847
  }),
2845
- u.Superscript,
2846
- u.Subscript,
2847
- u.ExtendedTextStyle,
2848
- u.CustomParagraph,
2849
- u.CustomHeading,
2850
- u.Highlight,
2851
- u.Image.configure({
2848
+ g.Superscript,
2849
+ g.Subscript,
2850
+ g.ExtendedTextStyle,
2851
+ g.CustomParagraph,
2852
+ g.CustomHeading,
2853
+ g.Highlight,
2854
+ g.Image.configure({
2852
2855
  inline: !0,
2853
2856
  allowBase64: !0,
2854
2857
  HTMLAttributes: {
2855
2858
  class: "editor-image"
2856
2859
  }
2857
2860
  }),
2858
- u.TextAlign.configure({
2861
+ g.TextAlign.configure({
2859
2862
  types: ["heading", "paragraph"]
2860
2863
  }),
2861
- u.Link.configure({
2864
+ g.Link.configure({
2862
2865
  HTMLAttributes: {
2863
2866
  class: "editor-link"
2864
2867
  },
2865
2868
  openOnClick: !1,
2866
2869
  autolink: !0
2867
2870
  }),
2868
- u.CustomTableKit,
2869
- u.Iframe
2871
+ g.CustomTableKit,
2872
+ g.Iframe
2870
2873
  ],
2871
2874
  editorProps: {
2872
- handlePaste: (A, T) => pr(A, T, u.ProseMirrorDOMParser),
2873
- handleKeyDown: (A, T) => {
2874
- if (T.key === "Tab") {
2875
- const D = A.state, { $anchor: se } = D.selection;
2876
- let ae = !1;
2877
- for (let pe = se.depth; pe > 0; pe--) {
2878
- const $e = se.node(pe);
2879
- if ($e && ($e.type.name === "bulletList" || $e.type.name === "orderedList")) {
2880
- ae = !0;
2875
+ handlePaste: (B, D) => vr(B, D, g.ProseMirrorDOMParser),
2876
+ handleKeyDown: (B, D) => {
2877
+ if (D.key === "Tab") {
2878
+ const G = B.state, { $anchor: Ae } = G.selection;
2879
+ let he = !1;
2880
+ for (let ve = Ae.depth; ve > 0; ve--) {
2881
+ const Fe = Ae.node(ve);
2882
+ if (Fe && (Fe.type.name === "bulletList" || Fe.type.name === "orderedList")) {
2883
+ he = !0;
2881
2884
  break;
2882
2885
  }
2883
2886
  }
2884
- return ae ? !1 : (T.preventDefault(), !0);
2887
+ return he ? !1 : (D.preventDefault(), !0);
2885
2888
  }
2886
2889
  return !1;
2887
2890
  }
2888
2891
  }
2889
2892
  });
2890
- return r.value = ht(x), r.value.on("update", async ({ editor: A }) => {
2891
- if (o.value) return;
2892
- const T = _(A.getHTML());
2893
- if (w.value = T, e.format === "html") {
2894
- const D = Oe(T, i.value);
2895
- D !== a.value && f(D);
2893
+ return o.value = bt(A), o.value.on("update", async ({ editor: B }) => {
2894
+ if (r.value) return;
2895
+ const D = u(B.getHTML());
2896
+ if (x.value = D, e.format === "html") {
2897
+ const G = Ue(D, i.value);
2898
+ G !== a.value && _(G);
2896
2899
  } else {
2897
- const D = await ur(T, e.format);
2898
- D !== a.value && f(D);
2900
+ const G = await gr(D, e.format);
2901
+ G !== a.value && _(G);
2899
2902
  }
2900
2903
  setTimeout(() => {
2901
- $(A);
2904
+ y(B);
2902
2905
  }, 10);
2903
- }), ge(() => {
2904
- $(r.value);
2905
- }), x;
2906
- } catch (u) {
2907
- return c.value = "Failed to load rich text editor dependencies.", console.error("Failed to initialize rich text editor", u), null;
2906
+ }), ue(() => {
2907
+ y(o.value);
2908
+ }), A;
2909
+ } catch (g) {
2910
+ return c.value = "Failed to load rich text editor dependencies.", console.error("Failed to initialize rich text editor", g), null;
2908
2911
  } finally {
2909
2912
  l.value = !1;
2910
2913
  }
2911
2914
  };
2912
- return we(
2915
+ return me(
2913
2916
  () => e.modelValue,
2914
- async (u) => {
2915
- if (g.value) return;
2916
- const x = u || "";
2917
- x !== p.value && await h(x);
2917
+ async (g) => {
2918
+ if (p.value) return;
2919
+ const A = g || "";
2920
+ A !== f.value && await z(A);
2918
2921
  },
2919
2922
  { immediate: !0 }
2920
- ), he(async () => {
2921
- await j(), ge(() => {
2922
- r.value && setTimeout(() => {
2923
- $(r.value);
2923
+ ), me(b, async () => {
2924
+ !r.value || !p.value || I.value || await M();
2925
+ }), be(async () => {
2926
+ await X(), ue(() => {
2927
+ o.value && setTimeout(() => {
2928
+ y(o.value);
2924
2929
  }, 100);
2925
2930
  });
2926
- }), Xe(() => {
2927
- r.value?.destroy?.(), r.value = null;
2928
- }), (u, x) => (v(), k("div", {
2929
- class: E(["bg-white rounded-md w-full", { "fixed left-0 right-0 top-0 bottom-0 z-[100000]": L(P) }])
2931
+ }), Qe(async () => {
2932
+ r.value && p.value && await M(), o.value?.destroy?.(), o.value = null;
2933
+ }), (g, A) => (v(), w("div", {
2934
+ class: E(["bg-white rounded-md w-full", { "fixed left-0 right-0 top-0 bottom-0 z-[100000]": L(V) }])
2930
2935
  }, [
2931
- d("div", Cl, [
2932
- (v(!0), k(re, null, ne(oe.value, (A) => (v(), k(re, { key: A }, [
2933
- r.value ? (v(), K(Te(A), {
2936
+ d("div", Sl, [
2937
+ (v(!0), w(ae, null, ie(pe.value, (B) => (v(), w(ae, { key: B }, [
2938
+ o.value ? (v(), W(Ee(B), {
2934
2939
  key: 0,
2935
- editor: I.value,
2940
+ editor: ee.value,
2936
2941
  onToggleFullscreen: L(O)
2937
- }, null, 40, ["editor", "onToggleFullscreen"])) : V("", !0)
2942
+ }, null, 40, ["editor", "onToggleFullscreen"])) : U("", !0)
2938
2943
  ], 64))), 128))
2939
2944
  ]),
2940
2945
  d("div", {
2941
- onClick: N,
2946
+ onClick: H,
2942
2947
  class: "relative w-full px-4 py-2 bg-white rounded-b-lg editor-content",
2943
- style: le({ height: L(P) ? "calc(95vh - 44px)" : t.height })
2948
+ style: se({ height: L(V) ? "calc(95vh - 44px)" : t.height })
2944
2949
  }, [
2945
- d("div", Al, [
2946
- ce(d("div", {
2947
- class: E(["rich-text-scroll-wrapper", ue.value]),
2948
- style: le(fe.value)
2950
+ d("div", Tl, [
2951
+ de(d("div", {
2952
+ class: E(["rich-text-scroll-wrapper", ge.value]),
2953
+ style: se(m.value)
2949
2954
  }, [
2950
2955
  d("div", {
2951
2956
  ref_key: "editorElement",
2952
2957
  ref: s,
2953
2958
  class: "relative w-full"
2954
2959
  }, null, 512),
2955
- l.value ? (v(), k("div", Fl, "Loading editor...")) : V("", !0),
2956
- c.value ? (v(), k("div", Sl, W(c.value), 1)) : V("", !0)
2960
+ l.value ? (v(), w("div", Ll, "Loading editor...")) : U("", !0),
2961
+ c.value ? (v(), w("div", Bl, Y(c.value), 1)) : U("", !0)
2957
2962
  ], 6), [
2958
- [ke, !o.value]
2963
+ [$e, !r.value]
2959
2964
  ]),
2960
- ce(d("div", Tl, [
2961
- F(mt, {
2965
+ de(d("div", El, [
2966
+ C(xt, {
2962
2967
  ref_key: "htmlTextarea",
2963
2968
  ref: n,
2964
2969
  modelValue: b.value,
2965
- "onUpdate:modelValue": x[0] || (x[0] = (A) => b.value = A),
2970
+ "onUpdate:modelValue": A[0] || (A[0] = (B) => b.value = B),
2966
2971
  height: "100%",
2967
- syntax: U.value,
2972
+ syntax: J.value,
2968
2973
  theme: "vs-light"
2969
2974
  }, null, 8, ["modelValue", "syntax"])
2970
2975
  ], 512), [
2971
- [ke, o.value]
2976
+ [$e, r.value]
2972
2977
  ])
2973
2978
  ])
2974
2979
  ], 4),
2975
- d("div", Ll, [
2976
- d("div", Bl, [
2980
+ d("div", Il, [
2981
+ d("div", Pl, [
2977
2982
  d("button", {
2978
2983
  type: "button",
2979
2984
  class: E([
2980
2985
  "min-w-[96px] h-[30px] px-[14px] border border-[#cfd6e0] bg-[#f3f5f8] text-[8px] font-bold uppercase tracking-[0.06em] leading-none cursor-pointer transition-colors duration-200 border-b-[1px] border-b-[#cfd6e0] rounded-none rounded-bl-[8px] hover:bg-[#eef1f5] hover:text-[#667284]",
2981
- o.value ? "text-[#8f99aa]" : "!bg-white text-[#49556a] border-[#cfd6e0] border-t-transparent relative z-[1]"
2986
+ r.value ? "text-[#8f99aa]" : "!bg-white text-[#49556a] border-[#cfd6e0] border-t-transparent relative z-[1]"
2982
2987
  ]),
2983
- onClick: x[1] || (x[1] = (A) => M(!1))
2984
- }, W(L(z)("form.richtext.editor")), 3),
2988
+ onClick: A[1] || (A[1] = (B) => F(!1))
2989
+ }, Y(L(R)("form.richtext.editor")), 3),
2985
2990
  d("button", {
2986
2991
  type: "button",
2987
2992
  class: E([
2988
2993
  "min-w-[96px] h-[30px] px-[14px] border border-[#cfd6e0] border-l-0 bg-[#f3f5f8] text-[8px] font-bold uppercase tracking-[0.06em] leading-none cursor-pointer transition-colors duration-200 border-b-[1px] border-b-[#cfd6e0] rounded-none rounded-br-[8px] hover:bg-[#eef1f5] hover:text-[#667284]",
2989
- o.value ? "!bg-white text-[#49556a] border-[#cfd6e0] border-t-transparent relative z-[1]" : "text-[#8f99aa]"
2994
+ r.value ? "!bg-white text-[#49556a] border-[#cfd6e0] border-t-transparent relative z-[1]" : "text-[#8f99aa]"
2990
2995
  ]),
2991
- onClick: x[2] || (x[2] = (A) => M(!0))
2992
- }, W(Y.value), 3)
2996
+ onClick: A[2] || (A[2] = (B) => F(!0))
2997
+ }, Y(P.value), 3)
2993
2998
  ])
2994
2999
  ])
2995
3000
  ], 2));
2996
3001
  }
2997
3002
  });
2998
3003
  export {
2999
- Ml as default
3004
+ zl as default
3000
3005
  };