kindy-editor 3.2.6 → 3.2.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (31) hide show
  1. package/dist-lib/assets/{worker-B7ALyZOw.js → worker-DjZBUOhB.js} +1009 -997
  2. package/dist-lib/assets/{worker-z-dyEi8F.js → worker-Du8hmveE.js} +2234 -2222
  3. package/dist-lib/builder.js +4 -4
  4. package/dist-lib/events.js +9 -120
  5. package/dist-lib/export.js +9 -11
  6. package/dist-lib/generate-toc.js +3 -3
  7. package/dist-lib/import.js +2 -2
  8. package/dist-lib/index-D5dkvB0x.js +490 -0
  9. package/dist-lib/{editorApp-Bu3dbUIU.js → kindy-editor-T1YCQdwF.js} +13483 -11185
  10. package/dist-lib/kindy-editor.js +4 -4
  11. package/dist-lib/measure.js +3 -4
  12. package/dist-lib/{measureHost-CpqJsipA.js → measureHost-BG9FPivu.js} +17 -18
  13. package/dist-lib/{paintStyle-Cb7IGKPW.js → metrics-D7Ma2xlj.js} +175 -148
  14. package/dist-lib/{parse-CKw-ZDr9.js → parse-BsUkqk-n.js} +3 -3
  15. package/dist-lib/{pipeline-BkC7G8gU.js → pipeline-CX_Hc5BD.js} +850 -837
  16. package/dist-lib/{qrcode-oNwKusWD.js → qrcode--5MhVNEZ.js} +1 -1
  17. package/dist-lib/{qrcode-efBlPzzh.js → qrcode-CR8i1-w0.js} +11 -11
  18. package/dist-lib/recalc-docx.js +1 -1
  19. package/dist-lib/{recalcToc-Bc8V9Ecn.js → recalcToc-zAFS4S6S.js} +755 -742
  20. package/dist-lib/{stylesheet-BT1DGhnx.js → stylesheet-BfxJTGA5.js} +1 -1
  21. package/dist-lib/{webmcp-ClHEa6Gq.js → webmcp-Ds469lXP.js} +2 -2
  22. package/docs/find-and-replace.md +224 -0
  23. package/docs/security-review.md +26 -0
  24. package/docs/table-editing.md +17 -2
  25. package/docs/table-form-integration.md +53 -1
  26. package/package.json +6 -6
  27. package/types/import.d.ts +7 -0
  28. package/types/kindy-editor.d.ts +30 -0
  29. package/dist-lib/changeAggregator-ZI959nPP.js +0 -376
  30. package/dist-lib/kindy-editor-CToKn_gP.js +0 -2171
  31. package/dist-lib/metrics-CdfHD-8y.js +0 -31
@@ -1,11 +1,11 @@
1
- import { K as e, d as o, m as r } from "./kindy-editor-CToKn_gP.js";
2
- import { C as i, a as m, E as n, c as g } from "./changeAggregator-ZI959nPP.js";
1
+ import { K as t, d as o, m as r } from "./kindy-editor-T1YCQdwF.js";
2
+ import { C as i, d as m, b as n, e as d } from "./index-D5dkvB0x.js";
3
3
  export {
4
4
  i as ChangeAggregator,
5
5
  m as CommitPolicy,
6
6
  n as EditorEvents,
7
- e as KindyEditor,
8
- g as createHttpEventSink,
7
+ t as KindyEditor,
8
+ d as createHttpEventSink,
9
9
  o as darkCanvasTheme,
10
10
  r as makeFloatingDialog
11
11
  };
@@ -1,7 +1,6 @@
1
1
  import "./TimesNewRoman-Regular-C7tOI8JO.js";
2
- import "./metrics-CdfHD-8y.js";
3
- import { i as p } from "./measureHost-CpqJsipA.js";
4
- import "./paintStyle-Cb7IGKPW.js";
2
+ import "./metrics-D7Ma2xlj.js";
3
+ import { i as s } from "./measureHost-BG9FPivu.js";
5
4
  export {
6
- p as installMeasureHost
5
+ s as installMeasureHost
7
6
  };
@@ -1,12 +1,11 @@
1
1
  import { _ as Gn, a as Vn, b as zn, c as qn, d as Wn, e as Hn, f as $n, g as Xn, h as jn, i as Yn, j as Kn, k as Zn, l as Jn, m as _n, n as Qn, o as ei, p as ti, q as ri, r as si, s as ai, t as ni, u as ii, v as oi, w as li, x as ui, y as ci, z as fi, A as di, B as hi } from "./TimesNewRoman-Regular-C7tOI8JO.js";
2
- import { s as pi } from "./metrics-CdfHD-8y.js";
2
+ import { d as Wa, c as pi, e as bi, g as gi, M as vi, F as xi, h as dr, C as hr, A as pr, H as br, i as mi } from "./metrics-D7Ma2xlj.js";
3
3
  import { B as At } from "./index-6mKfgpcs.js";
4
- import { a as Wa, c as bi, h as gi, i as vi, M as xi, j as mi, k as dr, l as hr, n as pr, o as br } from "./paintStyle-Cb7IGKPW.js";
5
- var c2 = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
4
+ var u2 = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
6
5
  function Pt(i) {
7
6
  return i && i.__esModule && Object.prototype.hasOwnProperty.call(i, "default") ? i.default : i;
8
7
  }
9
- function f2(i) {
8
+ function c2(i) {
10
9
  if (Object.prototype.hasOwnProperty.call(i, "__esModule")) return i;
11
10
  var e = i.default;
12
11
  if (typeof e == "function") {
@@ -14514,11 +14513,11 @@ function e2(i) {
14514
14513
  function Rt(i, e, t = !1) {
14515
14514
  Ve.has(i) && !t || Ve.set(i, { bytes: e, font: _a(e2(e)) });
14516
14515
  }
14517
- function d2(i) {
14516
+ function f2(i) {
14518
14517
  const e = Wa();
14519
14518
  for (const t of i) Rt(e.faceKey(t.family, t.style), t.bytes, !0);
14520
14519
  }
14521
- function h2(i) {
14520
+ function d2(i) {
14522
14521
  if (!i.faceKeyPrefix) return;
14523
14522
  const e = `__custom__${i.faceKeyPrefix}`;
14524
14523
  for (const t of [...Ve.keys()]) t.startsWith(e) && Ve.delete(t);
@@ -14527,8 +14526,8 @@ function t2() {
14527
14526
  return Ve.has("Arimo-Regular.ttf");
14528
14527
  }
14529
14528
  function Mn(i, e, t) {
14530
- const { clone: r, substituted: s } = bi(i), n = e && t ? "BoldItalic" : e ? "Bold" : t ? "Italic" : "Regular";
14531
- if (gi(r)) {
14529
+ const { clone: r, substituted: s } = pi(i), n = e && t ? "BoldItalic" : e ? "Bold" : t ? "Italic" : "Regular";
14530
+ if (bi(r)) {
14532
14531
  const c = Wa(), d = c.faceKey(r, n), f = c.faceKey(r, "Regular"), p = Ve.get(d) ?? Ve.get(f);
14533
14532
  if (p)
14534
14533
  return { file: Ve.has(d) ? d : f, font: p.font, bytes: p.bytes, substituted: !1 };
@@ -14536,14 +14535,14 @@ function Mn(i, e, t) {
14536
14535
  if (!m) throw new Error("fontRegistry: no fonts loaded — call installMeasureHost() before measuring/exporting");
14537
14536
  return { file: "Arimo-Regular.ttf", font: m.font, bytes: m.bytes, substituted: !0 };
14538
14537
  }
14539
- const a = vi[r] ?? `${r}-${n}.ttf`, l = Ve.get(a);
14538
+ const a = gi[r] ?? `${r}-${n}.ttf`, l = Ve.get(a);
14540
14539
  if (l) return { file: a, font: l.font, bytes: l.bytes, substituted: s };
14541
14540
  const u = Ve.get("Arimo-Regular.ttf");
14542
14541
  if (!u)
14543
14542
  throw new Error("fontRegistry: no fonts loaded — call installMeasureHost() before measuring/exporting");
14544
14543
  return { file: "Arimo-Regular.ttf", font: u.font, bytes: u.bytes, substituted: !0 };
14545
14544
  }
14546
- const r2 = [xi];
14545
+ const r2 = [vi];
14547
14546
  function s2(i, e) {
14548
14547
  if (e.font.hasGlyphForCodePoint(i)) return e;
14549
14548
  for (const t of r2) {
@@ -14628,10 +14627,10 @@ async function Qt(i) {
14628
14627
  return new Uint8Array(await t.arrayBuffer());
14629
14628
  }
14630
14629
  let E0 = null;
14631
- function p2() {
14630
+ function h2() {
14632
14631
  return E0 || (E0 = (async () => {
14633
14632
  if (!t2()) {
14634
- await Promise.all(mi.map(async (e) => Rt(e, await Qt(e))));
14633
+ await Promise.all(xi.map(async (e) => Rt(e, await Qt(e))));
14635
14634
  try {
14636
14635
  Rt(dr, await Qt(dr));
14637
14636
  } catch (e) {
@@ -14660,18 +14659,18 @@ function p2() {
14660
14659
  getContext() {
14661
14660
  return new Gr();
14662
14661
  }
14663
- }, i.document = { createElement: () => ({ getContext: () => new Gr() }), body: null }, pi(new Gr());
14662
+ }, i.document = { createElement: () => ({ getContext: () => new Gr() }), body: null }, mi(new Gr());
14664
14663
  })(), E0);
14665
14664
  }
14666
14665
  export {
14667
14666
  H0 as $,
14668
- f2 as a,
14667
+ c2 as a,
14669
14668
  _a as b,
14670
- c2 as c,
14671
- h2 as d,
14669
+ u2 as c,
14670
+ d2 as d,
14672
14671
  Mn as e,
14673
14672
  Pt as g,
14674
- p2 as i,
14675
- d2 as r,
14673
+ h2 as i,
14674
+ f2 as r,
14676
14675
  a2 as s
14677
14676
  };
@@ -1,8 +1,8 @@
1
- const dt = ["Regular", "Bold", "Italic", "BoldItalic"];
1
+ const Rt = ["Regular", "Bold", "Italic", "BoldItalic"];
2
2
  function m(t) {
3
3
  return t.trim().toLowerCase().replace(/^["']|["']$/g, "");
4
4
  }
5
- function ht(t, e) {
5
+ function At(t, e) {
6
6
  switch (e) {
7
7
  case "Bold":
8
8
  return t.bold ?? t.regular;
@@ -14,18 +14,18 @@ function ht(t, e) {
14
14
  return t.regular;
15
15
  }
16
16
  }
17
- function L(t) {
17
+ function A(t) {
18
18
  return /\.woff2?(\?|#|$)/i.test(t);
19
19
  }
20
- function M(t, e) {
20
+ function k(t, e) {
21
21
  return t.faces.regular === e.faces.regular && t.faces.bold === e.faces.bold && t.faces.italic === e.faces.italic && t.faces.boldItalic === e.faces.boldItalic && t.sizing.ascent === e.sizing.ascent && t.sizing.descent === e.sizing.descent;
22
22
  }
23
- function w(t, e = !1) {
23
+ function N(t, e = !1) {
24
24
  if (!m(t.family)) return !1;
25
25
  const { ascent: s, descent: a } = t.sizing ?? {};
26
- return typeof s == "number" && s > 0 && typeof a == "number" && a >= 0 ? t.faces?.regular ? L(t.faces.regular) || t.faces.bold && L(t.faces.bold) || t.faces.italic && L(t.faces.italic) || t.faces.boldItalic && L(t.faces.boldItalic) ? (e && console.warn(`[kindy-editor] custom font "${t.family}": WOFF/WOFF2 is not supported — use TTF/OTF; skipped`), !1) : !0 : (e && console.warn(`[kindy-editor] custom font "${t.family}" is missing the required regular face; skipped`), !1) : (e && console.warn(`[kindy-editor] custom font "${t.family}" has invalid sizing (need ascent > 0, descent >= 0); skipped`), !1);
26
+ return typeof s == "number" && s > 0 && typeof a == "number" && a >= 0 ? t.faces?.regular ? A(t.faces.regular) || t.faces.bold && A(t.faces.bold) || t.faces.italic && A(t.faces.italic) || t.faces.boldItalic && A(t.faces.boldItalic) ? (e && console.warn(`[kindy-editor] custom font "${t.family}": WOFF/WOFF2 is not supported — use TTF/OTF; skipped`), !1) : !0 : (e && console.warn(`[kindy-editor] custom font "${t.family}" is missing the required regular face; skipped`), !1) : (e && console.warn(`[kindy-editor] custom font "${t.family}" has invalid sizing (need ascent > 0, descent >= 0); skipped`), !1);
27
27
  }
28
- class N {
28
+ class b {
29
29
  /** Disambiguates this instance's synthetic face keys in the export-side fontkit
30
30
  * `loaded` map, so two concurrent jobs registering the same family with
31
31
  * different bytes don't collide. Empty for the default registry so its keys
@@ -47,9 +47,9 @@ class N {
47
47
  register(e) {
48
48
  if (e?.fonts)
49
49
  for (const s of e.fonts) {
50
- if (!w(s, !0)) continue;
50
+ if (!N(s, !0)) continue;
51
51
  const a = m(s.family), n = this.fonts.get(a);
52
- n && !M(n, s) && (console.warn(`[kindy-editor] custom font "${s.family}" redefined with different faces/sizing; using the latest`), this.metricsCache.clear()), this.fonts.set(a, s);
52
+ n && !k(n, s) && (console.warn(`[kindy-editor] custom font "${s.family}" redefined with different faces/sizing; using the latest`), this.metricsCache.clear()), this.fonts.set(a, s);
53
53
  }
54
54
  }
55
55
  fontFor(e) {
@@ -70,27 +70,27 @@ class N {
70
70
  this.fonts.clear(), this.metricsCache.clear();
71
71
  }
72
72
  }
73
- const b = new N("");
74
- let T = b, k = 0;
75
- function mt() {
76
- return new N(`r${++k}__`);
73
+ const p = new b("");
74
+ let L = p, B = 0;
75
+ function Lt() {
76
+ return new b(`r${++B}__`);
77
77
  }
78
- function _t() {
79
- return T;
78
+ function y() {
79
+ return L;
80
80
  }
81
- function Ct(t) {
82
- T = t;
81
+ function Ft(t) {
82
+ L = t;
83
83
  }
84
- function Et() {
85
- return b;
84
+ function St() {
85
+ return p;
86
86
  }
87
- function v(t) {
88
- return T.fontFor(t);
87
+ function D(t) {
88
+ return L.fontFor(t);
89
89
  }
90
- function B(t) {
91
- return T.metricsFor(t);
90
+ function U(t) {
91
+ return L.metricsFor(t);
92
92
  }
93
- const x = ["Carlito", "Caladea", "Gelasio", "Arimo", "TimesNewRoman", "Cousine"], y = "Arimo", D = {
93
+ const P = ["Carlito", "Caladea", "Gelasio", "Arimo", "TimesNewRoman", "Cousine"], G = "Arimo", $ = {
94
94
  // metric clones of common Office/Windows fonts
95
95
  calibri: "Carlito",
96
96
  cambria: "Caladea",
@@ -138,12 +138,12 @@ const x = ["Carlito", "Caladea", "Gelasio", "Arimo", "TimesNewRoman", "Cousine"]
138
138
  notosansarabic: "NotoSansArabic",
139
139
  // Noto Sans Hebrew — the bundled Hebrew fallback (single Regular face); identity.
140
140
  notosanshebrew: "NotoSansHebrew"
141
- }, U = "StixTwoMath", P = "StixTwoMath-Regular.ttf", G = "NotoSansSC", H = "NotoSansSC-Regular.ttf", $ = "NotoSansArabic", K = "NotoSansArabic-Regular.ttf", W = "NotoSansHebrew", Y = "NotoSansHebrew-Regular.ttf", Rt = {
142
- [U]: P,
143
- [G]: H,
144
- [$]: K,
145
- [W]: Y
146
- }, z = {
141
+ }, H = "StixTwoMath", z = "StixTwoMath-Regular.ttf", K = "NotoSansSC", W = "NotoSansSC-Regular.ttf", Y = "NotoSansArabic", X = "NotoSansArabic-Regular.ttf", q = "NotoSansHebrew", V = "NotoSansHebrew-Regular.ttf", wt = {
142
+ [H]: z,
143
+ [K]: W,
144
+ [Y]: X,
145
+ [q]: V
146
+ }, J = {
147
147
  Carlito: { ascent: 0.9375, descent: 0.25 },
148
148
  Caladea: { ascent: 0.9375, descent: 0.25 },
149
149
  Gelasio: { ascent: 0.9375, descent: 0.3125 },
@@ -165,18 +165,18 @@ const x = ["Carlito", "Caladea", "Gelasio", "Arimo", "TimesNewRoman", "Cousine"]
165
165
  // ratios keep editor + export pagination in lock-step, like the other fallbacks.
166
166
  NotoSansHebrew: { ascent: 1.068, descent: 0.292 }
167
167
  };
168
- function At(t) {
169
- const e = v(t);
168
+ function M(t) {
169
+ const e = D(t);
170
170
  if (e) return { clone: e.family, substituted: !1 };
171
- const s = t.trim().toLowerCase().replace(/^["']|["']$/g, ""), a = D[s];
172
- return a ? { clone: a, substituted: !1 } : { clone: y, substituted: !0 };
171
+ const s = t.trim().toLowerCase().replace(/^["']|["']$/g, ""), a = $[s];
172
+ return a ? { clone: a, substituted: !1 } : { clone: G, substituted: !0 };
173
173
  }
174
- function Lt(t) {
175
- return B(t) ?? z[t] ?? { ascent: 0.9, descent: 0.25 };
174
+ function Q(t) {
175
+ return U(t) ?? J[t] ?? { ascent: 0.9, descent: 0.25 };
176
176
  }
177
- const S = (t) => (t.split(",")[0] ?? "").trim(), X = ["Regular", "Bold", "Italic", "BoldItalic"], Tt = x.flatMap(
178
- (t) => X.map((e) => `${t}-${e}.ttf`)
179
- ), q = [
177
+ const O = (t) => (t.split(",")[0] ?? "").trim(), j = ["Regular", "Bold", "Italic", "BoldItalic"], Ot = P.flatMap(
178
+ (t) => j.map((e) => `${t}-${e}.ttf`)
179
+ ), Z = [
180
180
  { value: "Calibri, sans-serif", label: "Calibri (Carlito)" },
181
181
  { value: "Cambria, serif", label: "Cambria (Caladea)" },
182
182
  { value: "Georgia, serif", label: "Georgia (Gelasio)" },
@@ -186,37 +186,37 @@ const S = (t) => (t.split(",")[0] ?? "").trim(), X = ["Regular", "Bold", "Italic
186
186
  { value: "Consolas, monospace", label: "Consolas (Cousine)" },
187
187
  { value: "Courier New, monospace", label: "Courier New (Cousine)" }
188
188
  ];
189
- function Ft(t) {
190
- const e = new Set((t?.disableBuiltin ?? []).map((n) => S(n).trim().toLowerCase())), s = q.filter((n) => !e.has(S(n.value).trim().toLowerCase())), a = (t?.fonts ?? []).filter((n) => w(n)).map((n) => ({ value: n.family, label: n.label ?? n.family }));
189
+ function gt(t) {
190
+ const e = new Set((t?.disableBuiltin ?? []).map((n) => O(n).trim().toLowerCase())), s = Z.filter((n) => !e.has(O(n.value).trim().toLowerCase())), a = (t?.fonts ?? []).filter((n) => N(n)).map((n) => ({ value: n.family, label: n.label ?? n.family }));
191
191
  return [...s, ...a];
192
192
  }
193
- const Ot = "#c0c4c9", V = "#0b57d0", St = "#1a73e8", g = "#202124", wt = "#80868b", Nt = "#7a8aa0", bt = "#9aa0a6", gt = "#f1f3f4", p = /* @__PURE__ */ new Set([
193
+ const Nt = "#c0c4c9", tt = "#0b57d0", bt = "#1a73e8", I = "#202124", pt = "#80868b", Mt = "#7a8aa0", It = "#9aa0a6", xt = "#f1f3f4", x = /* @__PURE__ */ new Set([
194
194
  "#0563c1",
195
195
  "#0000ff",
196
196
  "#0000ee",
197
197
  "#0b57d0",
198
198
  "#0066cc",
199
199
  "#1155cc"
200
- ]), pt = (t) => p.has(t.toLowerCase()) ? g : t, It = 0.65, J = -0.38, Q = 0.16;
201
- function Z(t, e) {
202
- return t === "super" ? J * e : t === "sub" ? Q * e : 0;
203
- }
204
- function Mt(t) {
205
- return Z(t.verticalAlign, t.fontSizePx) - (t.positionPx ?? 0);
200
+ ]), vt = (t) => x.has(t.toLowerCase()) ? I : t, et = 0.65, st = -0.38, at = 0.16;
201
+ function nt(t, e) {
202
+ return t === "super" ? st * e : t === "sub" ? at * e : 0;
206
203
  }
207
204
  function kt(t) {
205
+ return nt(t.verticalAlign, t.fontSizePx) - (t.positionPx ?? 0);
206
+ }
207
+ function Bt(t) {
208
208
  const e = t.widthScalePct;
209
209
  return e !== void 0 && e > 0 ? e / 100 : 1;
210
210
  }
211
- function vt(t) {
212
- const e = tt(t), s = Math.max(1.5, t / 11);
211
+ function yt(t) {
212
+ const e = it(t), s = Math.max(1.5, t / 11);
213
213
  return [e - s / 2, e + s / 2];
214
214
  }
215
- const Bt = 0.78, j = (t) => Math.max(1, t / 14), xt = 1.5, tt = (t) => -0.28 * t;
216
- function yt(t, e = V) {
215
+ const Dt = 0.78, ot = (t) => Math.max(1, t / 14), Ut = 1.5, it = (t) => -0.28 * t;
216
+ function Pt(t, e = tt) {
217
217
  const s = t.link !== void 0 && t.link.startsWith("#"), a = t.link !== void 0 && !s;
218
218
  let n = t.color;
219
- a ? n = e : s && p.has(t.color.toLowerCase()) && (n = g);
219
+ a ? n = e : s && x.has(t.color.toLowerCase()) && (n = I);
220
220
  const o = a || !!t.underline && !s;
221
221
  return {
222
222
  color: n,
@@ -227,24 +227,24 @@ function yt(t, e = V) {
227
227
  externalLink: a
228
228
  };
229
229
  }
230
- const et = "•", st = "◦", at = "▪", nt = 0.22, ot = 0.31, it = 0.135, ct = 0.13, rt = 0.05, lt = 0.22;
231
- function Dt(t, e, s, a) {
232
- const n = s + e * nt, o = a - e * ot;
230
+ const ct = "•", rt = "◦", lt = "▪", ut = 0.22, ft = 0.31, dt = 0.135, ht = 0.13, mt = 0.05, Ct = 0.22;
231
+ function Gt(t, e, s, a) {
232
+ const n = s + e * ut, o = a - e * ft;
233
233
  switch (t) {
234
- case et:
235
- return { kind: "disc", cx: n, cy: o, r: e * it };
236
- case st:
237
- return { kind: "ring", cx: n, cy: o, r: e * ct, lineWidth: e * rt };
238
- case at: {
239
- const c = e * lt;
240
- return { kind: "square", x: n - c / 2, y: o - c / 2, size: c };
234
+ case ct:
235
+ return { kind: "disc", cx: n, cy: o, r: e * dt };
236
+ case rt:
237
+ return { kind: "ring", cx: n, cy: o, r: e * ht, lineWidth: e * mt };
238
+ case lt: {
239
+ const i = e * Ct;
240
+ return { kind: "square", x: n - i / 2, y: o - i / 2, size: i };
241
241
  }
242
242
  default:
243
243
  return;
244
244
  }
245
245
  }
246
- function Ut(t, e) {
247
- const s = j(e);
246
+ function $t(t, e) {
247
+ const s = ot(e);
248
248
  switch (t) {
249
249
  case "double":
250
250
  return { dash: [], double: !0, wave: !1, thickness: s };
@@ -264,104 +264,131 @@ function Ut(t, e) {
264
264
  return { dash: [], double: !1, wave: !1, thickness: s };
265
265
  }
266
266
  }
267
- const Pt = (t) => t + 1;
268
- function Gt(t, e, s, a) {
269
- const n = Math.max(0.75, a / 18), o = Math.max(4, a / 3), c = Math.max(2, Math.ceil(s / o * 4)), u = [];
270
- for (let r = 0; r <= c; r++) {
271
- const f = t + s * r / c;
267
+ const Ht = (t) => t + 1;
268
+ function zt(t, e, s, a) {
269
+ const n = Math.max(0.75, a / 18), o = Math.max(4, a / 3), i = Math.max(2, Math.ceil(s / o * 4)), u = [];
270
+ for (let r = 0; r <= i; r++) {
271
+ const f = t + s * r / i;
272
272
  u.push({ x: f, y: e + n * Math.sin(2 * Math.PI * (f - t) / o) });
273
273
  }
274
274
  return u;
275
275
  }
276
- function Ht(t) {
276
+ function Kt(t) {
277
277
  return t === "dot" ? [1, 3] : t === "dash" ? [4, 3] : [];
278
278
  }
279
- const $t = (t) => Math.max(1, t / 14), Kt = [1, 4], Wt = 8, Yt = 1 / 3, zt = "#c0c4c9", Xt = 4;
280
- function qt(t, e, s) {
279
+ const Wt = (t) => Math.max(1, t / 14), Yt = [1, 4], Xt = 8, qt = 1 / 3, Vt = "#c0c4c9", Jt = 4;
280
+ function Qt(t, e, s) {
281
281
  const a = s.pad ?? 0;
282
282
  return { x: t - a, y: e - a, width: s.width + 2 * a, height: s.height + 2 * a };
283
283
  }
284
- const ut = 24;
285
- function Vt(t, e, s, a) {
286
- const n = t.offsetFrom === "text", o = (i) => i?.spacePx ?? ut, c = n ? a.left - o(t.left) : o(t.left), u = n ? e - a.right + o(t.right) : e - o(t.right), r = n ? a.top - o(t.top) : o(t.top), f = n ? s - a.bottom + o(t.bottom) : s - o(t.bottom), _ = [], C = (i, E, d, F, R) => {
287
- if (!i || i.style === "none") return;
288
- const l = i.style === "thick" ? Math.max(2, i.widthPx) : Math.max(0.5, i.widthPx), O = i.color === "auto" ? "#000000" : i.color, I = i.style === "dashed" ? [l * 3, l * 2] : i.style === "dotted" ? [l, l * 1.5] : [];
289
- if (_.push({ x1: E, y1: d, x2: F, y2: R, widthPx: l, color: O, dash: I }), i.style === "double") {
290
- const A = l + 1;
291
- if (d === R) {
292
- const h = d < s / 2 ? A : -A;
293
- _.push({ x1: E, y1: d + h, x2: F, y2: R + h, widthPx: l, color: O, dash: [] });
284
+ const _t = 24;
285
+ function jt(t, e, s, a) {
286
+ const n = t.offsetFrom === "text", o = (c) => c?.spacePx ?? _t, i = n ? a.left - o(t.left) : o(t.left), u = n ? e - a.right + o(t.right) : e - o(t.right), r = n ? a.top - o(t.top) : o(t.top), f = n ? s - a.bottom + o(t.bottom) : s - o(t.bottom), C = [], _ = (c, E, d, F, T) => {
287
+ if (!c || c.style === "none") return;
288
+ const l = c.style === "thick" ? Math.max(2, c.widthPx) : Math.max(0.5, c.widthPx), S = c.color === "auto" ? "#000000" : c.color, v = c.style === "dashed" ? [l * 3, l * 2] : c.style === "dotted" ? [l, l * 1.5] : [];
289
+ if (C.push({ x1: E, y1: d, x2: F, y2: T, widthPx: l, color: S, dash: v }), c.style === "double") {
290
+ const R = l + 1;
291
+ if (d === T) {
292
+ const h = d < s / 2 ? R : -R;
293
+ C.push({ x1: E, y1: d + h, x2: F, y2: T + h, widthPx: l, color: S, dash: [] });
294
294
  } else {
295
- const h = E < e / 2 ? A : -A;
296
- _.push({ x1: E + h, y1: d, x2: F + h, y2: R, widthPx: l, color: O, dash: [] });
295
+ const h = E < e / 2 ? R : -R;
296
+ C.push({ x1: E + h, y1: d, x2: F + h, y2: T, widthPx: l, color: S, dash: [] });
297
297
  }
298
298
  }
299
299
  };
300
- return C(t.top, c, r, u, r), C(t.bottom, c, f, u, f), C(t.left, c, r, c, f), C(t.right, u, r, u, f), _;
300
+ return _(t.top, i, r, u, r), _(t.bottom, i, f, u, f), _(t.left, i, r, i, f), _(t.right, u, r, u, f), C;
301
301
  }
302
- const Jt = (t) => Math.max(0.5, t);
303
- function Qt(t, e) {
302
+ const Zt = (t) => Math.max(0.5, t);
303
+ function te(t, e) {
304
304
  return t === "dashed" ? [e * 3, e * 2] : t === "dotted" ? [e, e * 1.5] : [];
305
305
  }
306
- const Zt = (t) => t + 1;
306
+ const ee = (t) => t + 1;
307
+ let g = null, w = null;
308
+ function se(t) {
309
+ g = t;
310
+ }
311
+ function Et() {
312
+ return g || (w || (w = document.createElement("canvas").getContext("2d")), w);
313
+ }
314
+ function ae(t) {
315
+ const e = t.italic ? "italic " : "", s = t.bold ? "700" : "400", a = t.verticalAlign ? Math.round(t.fontSizePx * et) : t.fontSizePx, n = M(O(t.fontFamily)).clone;
316
+ return `${e}${s} ${a}px ${n}`;
317
+ }
318
+ function ne(t, e) {
319
+ const s = Et();
320
+ return s.font = e, s.measureText(t).width;
321
+ }
322
+ function oe(t) {
323
+ const e = y().metricsCache;
324
+ let s = e.get(t);
325
+ if (!s) {
326
+ const a = /(\d+(?:\.\d+)?)px/.exec(t), n = a ? parseFloat(a[1]) : 16, o = t.slice(t.indexOf("px ") + 3).trim(), i = Q(M(o).clone);
327
+ s = { ascent: Math.round(i.ascent * n), descent: Math.round(i.descent * n) }, e.set(t, s);
328
+ }
329
+ return s;
330
+ }
307
331
  export {
308
- ht as $,
309
- $ as A,
310
- yt as B,
311
- G as C,
312
- Ot as D,
313
- V as E,
314
- Nt as F,
315
- j as G,
316
- W as H,
317
- gt as I,
318
- tt as J,
319
- vt as K,
320
- Vt as L,
321
- U as M,
322
- Pt as N,
323
- Jt as O,
324
- Xt as P,
325
- Qt as Q,
326
- Ut as R,
327
- It as S,
328
- bt as T,
329
- xt as U,
330
- Gt as V,
331
- Zt as W,
332
- q as X,
333
- w as Y,
334
- m as Z,
335
- dt as _,
336
- _t as a,
337
- x as a0,
338
- X as a1,
339
- Ft as a2,
340
- mt as a3,
341
- Et as a4,
342
- zt as b,
343
- At as c,
344
- wt as d,
345
- St as e,
346
- S as f,
347
- Bt as g,
348
- v as h,
349
- Rt as i,
350
- Tt as j,
351
- P as k,
352
- H as l,
353
- Lt as m,
354
- K as n,
355
- Y as o,
356
- Yt as p,
357
- qt as q,
358
- Dt as r,
359
- Ct as s,
360
- pt as t,
361
- Wt as u,
362
- Kt as v,
363
- kt as w,
364
- $t as x,
365
- Ht as y,
366
- Mt as z
332
+ m as $,
333
+ X as A,
334
+ Wt as B,
335
+ W as C,
336
+ Nt as D,
337
+ tt as E,
338
+ Ot as F,
339
+ Kt as G,
340
+ V as H,
341
+ xt as I,
342
+ kt as J,
343
+ Pt as K,
344
+ ot as L,
345
+ H as M,
346
+ it as N,
347
+ yt as O,
348
+ Jt as P,
349
+ zt as Q,
350
+ Ht as R,
351
+ Dt as S,
352
+ It as T,
353
+ Ut as U,
354
+ Zt as V,
355
+ te as W,
356
+ $t as X,
357
+ ee as Y,
358
+ Z,
359
+ N as _,
360
+ oe as a,
361
+ Rt as a0,
362
+ At as a1,
363
+ P as a2,
364
+ j as a3,
365
+ gt as a4,
366
+ Lt as a5,
367
+ et as a6,
368
+ St as a7,
369
+ ae as b,
370
+ M as c,
371
+ y as d,
372
+ D as e,
373
+ O as f,
374
+ wt as g,
375
+ z as h,
376
+ se as i,
377
+ q as j,
378
+ Y as k,
379
+ K as l,
380
+ ne as m,
381
+ Vt as n,
382
+ Mt as o,
383
+ pt as p,
384
+ bt as q,
385
+ qt as r,
386
+ Ft as s,
387
+ jt as t,
388
+ Qt as u,
389
+ Gt as v,
390
+ Bt as w,
391
+ vt as x,
392
+ Xt as y,
393
+ Yt as z
367
394
  };
@@ -1,6 +1,6 @@
1
- import { g as V, f as H, D as W, h as $ } from "./qrcode-efBlPzzh.js";
2
- import { r as C, s as G } from "./stylesheet-BT1DGhnx.js";
3
- import { e as m, a as f, c as g, l as y, t as x } from "./pipeline-BkC7G8gU.js";
1
+ import { g as V, f as H, D as W, h as $ } from "./qrcode-CR8i1-w0.js";
2
+ import { r as C, s as G } from "./stylesheet-BfxJTGA5.js";
3
+ import { e as m, a as f, c as g, l as y, t as x } from "./pipeline-CX_Hc5BD.js";
4
4
  import { a as U, h as j } from "./contentTypes-ChqPfcVI.js";
5
5
  function K(r) {
6
6
  const t = V(r), e = r.rows.length, s = Array.from(