@component-hook/pdf-canvas 1.2.2 → 1.3.0-alpha.0

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.
@@ -2081,9 +2081,9 @@ let Te = class Ki extends Oc {
2081
2081
  toObject() {
2082
2082
  const t = (arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : []).concat(Ki.customProperties, this.constructor.customProperties || []);
2083
2083
  let e;
2084
- const s = q.NUM_FRACTION_DIGITS, { clipPath: i, fill: n, stroke: r, shadow: o, strokeDashArray: h, left: l, top: c, originX: u, originY: d, width: f, height: g, strokeWidth: p, strokeLineCap: b, strokeDashOffset: m, strokeLineJoin: v, strokeUniform: y, strokeMiterLimit: _, scaleX: S, scaleY: A, angle: T, flipX: E, flipY: O, opacity: N, visible: D, backgroundColor: R, fillRule: k, paintFirst: P, globalCompositeOperation: j, skewX: M, skewY: L } = this;
2084
+ const s = q.NUM_FRACTION_DIGITS, { clipPath: i, fill: n, stroke: r, shadow: o, strokeDashArray: h, left: l, top: c, originX: u, originY: d, width: f, height: g, strokeWidth: p, strokeLineCap: b, strokeDashOffset: m, strokeLineJoin: v, strokeUniform: y, strokeMiterLimit: _, scaleX: S, scaleY: A, angle: T, flipX: E, flipY: P, opacity: N, visible: D, backgroundColor: R, fillRule: k, paintFirst: O, globalCompositeOperation: j, skewX: M, skewY: L } = this;
2085
2085
  i && !i.excludeFromExport && (e = i.toObject(t.concat("inverted", "absolutePositioned")));
2086
- const G = (at) => Q(at, s), it = w(w({}, fs(this, t)), {}, { type: this.constructor.type, version: mr, originX: u, originY: d, left: G(l), top: G(c), width: G(f), height: G(g), fill: Do(n) ? n.toObject() : n, stroke: Do(r) ? r.toObject() : r, strokeWidth: G(p), strokeDashArray: h && h.concat(), strokeLineCap: b, strokeDashOffset: m, strokeLineJoin: v, strokeUniform: y, strokeMiterLimit: G(_), scaleX: G(S), scaleY: G(A), angle: G(T), flipX: E, flipY: O, opacity: G(N), shadow: o && o.toObject(), visible: D, backgroundColor: R, fillRule: k, paintFirst: P, globalCompositeOperation: j, skewX: G(M), skewY: G(L) }, e ? { clipPath: e } : null);
2086
+ const G = (at) => Q(at, s), it = w(w({}, fs(this, t)), {}, { type: this.constructor.type, version: mr, originX: u, originY: d, left: G(l), top: G(c), width: G(f), height: G(g), fill: Do(n) ? n.toObject() : n, stroke: Do(r) ? r.toObject() : r, strokeWidth: G(p), strokeDashArray: h && h.concat(), strokeLineCap: b, strokeDashOffset: m, strokeLineJoin: v, strokeUniform: y, strokeMiterLimit: G(_), scaleX: G(S), scaleY: G(A), angle: G(T), flipX: E, flipY: P, opacity: G(N), shadow: o && o.toObject(), visible: D, backgroundColor: R, fillRule: k, paintFirst: O, globalCompositeOperation: j, skewX: G(M), skewY: G(L) }, e ? { clipPath: e } : null);
2087
2087
  return this.includeDefaultValues ? it : this._removeDefaultValues(it);
2088
2088
  }
2089
2089
  toDatalessObject(t) {
@@ -2239,8 +2239,8 @@ function Sh(a, t, e, s, i) {
2239
2239
  if (le(n, h)) return !1;
2240
2240
  const { origin: u, flip: d } = tr[r], f = mt(e[u]) * (n[d] ? -1 : 1), g = -Math.sign(f) * (n[c] ? -1 : 1), p = 0.5 * -((n[l] === 0 && Jr(e, X, X, s, i)[a] > 0 || n[l] > 0 ? 1 : -1) * g) + 0.5;
2241
2241
  return Bs(Xa, Hs(((m, v, y, _) => (function(S, A, T) {
2242
- let { target: E, ex: O, ey: N, skewingSide: D } = A, R = st(A, zc);
2243
- const { skew: k } = tr[S], P = T.subtract(new C(O, N)).divide(new C(E.scaleX, E.scaleY))[S], j = E[k], M = R[k], L = Math.tan(lt(M)), G = S === "y" ? E._getTransformedDimensions({ scaleX: 1, scaleY: 1, skewX: 0 }).x : E._getTransformedDimensions({ scaleX: 1, scaleY: 1 }).y, it = 2 * P * D / Math.max(G, 1) + L, at = Ce(Math.atan(it));
2242
+ let { target: E, ex: P, ey: N, skewingSide: D } = A, R = st(A, zc);
2243
+ const { skew: k } = tr[S], O = T.subtract(new C(P, N)).divide(new C(E.scaleX, E.scaleY))[S], j = E[k], M = R[k], L = Math.tan(lt(M)), G = S === "y" ? E._getTransformedDimensions({ scaleX: 1, scaleY: 1, skewX: 0 }).x : E._getTransformedDimensions({ scaleX: 1, scaleY: 1 }).y, it = 2 * O * D / Math.max(G, 1) + L, at = Ce(Math.atan(it));
2244
2244
  E.set(k, at);
2245
2245
  const xt = j !== E[k];
2246
2246
  if (xt && S === "y") {
@@ -3106,8 +3106,8 @@ function Tr(a, t, e, s, i, n, r, o) {
3106
3106
  for (let _ = 0; _ < 2; ++_) {
3107
3107
  if (_ > 0 && (f = 6 * t - 12 * s + 6 * n, g = -3 * t + 9 * s - 9 * n + 3 * o, p = 3 * s - 3 * t), c(g) < 1e-12) {
3108
3108
  if (c(f) < 1e-12) continue;
3109
- const O = -p / f;
3110
- 0 < O && O < 1 && u.push(O);
3109
+ const P = -p / f;
3110
+ 0 < P && P < 1 && u.push(P);
3111
3111
  continue;
3112
3112
  }
3113
3113
  const S = f * f - 4 * p * g;
@@ -3132,18 +3132,18 @@ const Au = (a, t, e) => {
3132
3132
  const u = ((d, f, g, p, b, m, v) => {
3133
3133
  if (g === 0 || p === 0) return [];
3134
3134
  let y = 0, _ = 0, S = 0;
3135
- const A = Math.PI, T = v * Hr, E = ue(T), O = ce(T), N = 0.5 * (-O * d - E * f), D = 0.5 * (-O * f + E * d), R = g ** 2, k = p ** 2, P = D ** 2, j = N ** 2, M = R * k - R * P - k * j;
3135
+ const A = Math.PI, T = v * Hr, E = ue(T), P = ce(T), N = 0.5 * (-P * d - E * f), D = 0.5 * (-P * f + E * d), R = g ** 2, k = p ** 2, O = D ** 2, j = N ** 2, M = R * k - R * O - k * j;
3136
3136
  let L = Math.abs(g), G = Math.abs(p);
3137
3137
  if (M < 0) {
3138
3138
  const ge = Math.sqrt(1 - M / (R * k));
3139
3139
  L *= ge, G *= ge;
3140
- } else S = (b === m ? -1 : 1) * Math.sqrt(M / (R * P + k * j));
3141
- const it = S * L * D / G, at = -S * G * N / L, xt = O * it - E * at + 0.5 * d, gt = E * it + O * at + 0.5 * f;
3140
+ } else S = (b === m ? -1 : 1) * Math.sqrt(M / (R * O + k * j));
3141
+ const it = S * L * D / G, at = -S * G * N / L, xt = P * it - E * at + 0.5 * d, gt = E * it + P * at + 0.5 * f;
3142
3142
  let et = ha(1, 0, (N - it) / L, (D - at) / G), Pt = ha((N - it) / L, (D - at) / G, (-N - it) / L, (-D - at) / G);
3143
3143
  m === 0 && Pt > 0 ? Pt -= 2 * A : m === 1 && Pt < 0 && (Pt += 2 * A);
3144
3144
  const fe = Math.ceil(Math.abs(Pt / A * 2)), ht = [], K = Pt / fe, je = 8 / 3 * Math.sin(K / 4) * Math.sin(K / 4) / Math.sin(K / 2);
3145
3145
  let ms = et + K;
3146
- for (let ge = 0; ge < fe; ge++) ht[ge] = Cu(et, ms, O, E, L, G, xt, gt, je, y, _), y = ht[ge][5], _ = ht[ge][6], et = ms, ms += K;
3146
+ for (let ge = 0; ge < fe; ge++) ht[ge] = Cu(et, ms, P, E, L, G, xt, gt, je, y, _), y = ht[ge][5], _ = ht[ge][6], et = ms, ms += K;
3147
3147
  return ht;
3148
3148
  })(l - a, c - t, i, n, o, h, r);
3149
3149
  for (let d = 0, f = u.length; d < f; d++) u[d][1] += a, u[d][2] += t, u[d][3] += a, u[d][4] += t, u[d][5] += a, u[d][6] += t;
@@ -4931,24 +4931,24 @@ class Ct extends tl {
4931
4931
  const d = this._textLines[l], f = u / this.lineHeight, g = this._getLineLeftOffset(l);
4932
4932
  let p = 0, b = 0, m = this.getValueOfPropertyAt(l, 0, e), v = this.getValueOfPropertyAt(l, 0, vt), y = this.getValueOfPropertyAt(l, 0, hs), _ = m, S = v, A = y;
4933
4933
  const T = s + f * (1 - this._fontSizeFraction);
4934
- let E = this.getHeightOfChar(l, 0), O = this.getValueOfPropertyAt(l, 0, "deltaY");
4934
+ let E = this.getHeightOfChar(l, 0), P = this.getValueOfPropertyAt(l, 0, "deltaY");
4935
4935
  for (let R = 0, k = d.length; R < k; R++) {
4936
- const P = this.__charBounds[l][R];
4936
+ const O = this.__charBounds[l][R];
4937
4937
  _ = this.getValueOfPropertyAt(l, R, e), S = this.getValueOfPropertyAt(l, R, vt), A = this.getValueOfPropertyAt(l, R, hs);
4938
4938
  const j = this.getHeightOfChar(l, R), M = this.getValueOfPropertyAt(l, R, "deltaY");
4939
4939
  if (n && _ && S) {
4940
4940
  const L = this.fontSize * A / 1e3;
4941
- t.save(), t.fillStyle = v, t.translate(P.renderLeft, P.renderTop), t.rotate(P.angle), t.fillRect(-P.kernedWidth / 2, h * j + M - o * L, P.kernedWidth, L), t.restore();
4942
- } else if ((_ !== m || S !== v || j !== E || A !== y || M !== O) && b > 0) {
4941
+ t.save(), t.fillStyle = v, t.translate(O.renderLeft, O.renderTop), t.rotate(O.angle), t.fillRect(-O.kernedWidth / 2, h * j + M - o * L, O.kernedWidth, L), t.restore();
4942
+ } else if ((_ !== m || S !== v || j !== E || A !== y || M !== P) && b > 0) {
4943
4943
  const L = this.fontSize * y / 1e3;
4944
4944
  let G = i + g + p;
4945
- this.direction === "rtl" && (G = this.width - G - b), m && v && y && (t.fillStyle = v, t.fillRect(G, T + h * E + O - o * L, b, L)), p = P.left, b = P.width, m = _, y = A, v = S, E = j, O = M;
4946
- } else b += P.kernedWidth;
4945
+ this.direction === "rtl" && (G = this.width - G - b), m && v && y && (t.fillStyle = v, t.fillRect(G, T + h * E + P - o * L, b, L)), p = O.left, b = O.width, m = _, y = A, v = S, E = j, P = M;
4946
+ } else b += O.kernedWidth;
4947
4947
  }
4948
4948
  let N = i + g + p;
4949
4949
  this.direction === "rtl" && (N = this.width - N - b), t.fillStyle = S;
4950
4950
  const D = this.fontSize * A / 1e3;
4951
- _ && S && A && t.fillRect(N, T + h * E + O - o * D, b - r, D), s += u;
4951
+ _ && S && A && t.fillRect(N, T + h * E + P - o * D, b - r, D), s += u;
4952
4952
  }
4953
4953
  this._removeShadow(t);
4954
4954
  }
@@ -6389,32 +6389,32 @@ async function bd(a, t) {
6389
6389
  const u = il(c, ["use", "svg:use"]), d = ["x", "y", "xlink:href", "href", "transform"];
6390
6390
  for (const f of u) {
6391
6391
  const g = f.attributes, p = {};
6392
- for (const O of g) O.value && (p[O.name] = O.value);
6392
+ for (const P of g) P.value && (p[P.name] = P.value);
6393
6393
  const b = (p["xlink:href"] || p.href || "").slice(1);
6394
6394
  if (b === "") return;
6395
6395
  const m = c.getElementById(b);
6396
6396
  if (m === null) return;
6397
6397
  let v = m.cloneNode(!0);
6398
6398
  const y = v.attributes, _ = {};
6399
- for (const O of y) O.value && (_[O.name] = O.value);
6399
+ for (const P of y) P.value && (_[P.name] = P.value);
6400
6400
  const { x: S = 0, y: A = 0, transform: T = "" } = p, E = "".concat(T, " ").concat(_.transform || "", " translate(").concat(S, ", ").concat(A, ")");
6401
6401
  if (or(v), /^svg$/i.test(v.nodeName)) {
6402
- const O = v.ownerDocument.createElementNS(_r, "g");
6402
+ const P = v.ownerDocument.createElementNS(_r, "g");
6403
6403
  Object.entries(_).forEach(((N) => {
6404
6404
  let [D, R] = N;
6405
- return O.setAttributeNS(_r, D, R);
6406
- })), O.append(...v.childNodes), v = O;
6405
+ return P.setAttributeNS(_r, D, R);
6406
+ })), P.append(...v.childNodes), v = P;
6407
6407
  }
6408
- for (const O of g) {
6409
- if (!O) continue;
6410
- const { name: N, value: D } = O;
6408
+ for (const P of g) {
6409
+ if (!P) continue;
6410
+ const { name: N, value: D } = P;
6411
6411
  if (!d.includes(N)) if (N === "style") {
6412
6412
  const R = {};
6413
- Sr(D, R), Object.entries(_).forEach(((P) => {
6414
- let [j, M] = P;
6413
+ Sr(D, R), Object.entries(_).forEach(((O) => {
6414
+ let [j, M] = O;
6415
6415
  R[j] = M;
6416
6416
  })), Sr(_.style || "", R);
6417
- const k = Object.entries(R).map(((P) => P.join(":"))).join(";");
6417
+ const k = Object.entries(R).map(((O) => O.join(":"))).join(";");
6418
6418
  v.setAttribute(N, k);
6419
6419
  } else !_[N] && v.setAttribute(N, D);
6420
6420
  }
@@ -7457,21 +7457,21 @@ class Gi extends wt {
7457
7457
  lanczosResize(t, e, s, i, n) {
7458
7458
  const r = t.imageData.data, o = t.ctx.createImageData(i, n), h = o.data, l = this.lanczosCreate(this.lanczosLobes), c = this.rcpScaleX, u = this.rcpScaleY, d = 2 / this.rcpScaleX, f = 2 / this.rcpScaleY, g = Math.ceil(c * this.lanczosLobes / 2), p = Math.ceil(u * this.lanczosLobes / 2), b = {}, m = { x: 0, y: 0 }, v = { x: 0, y: 0 };
7459
7459
  return (function y(_) {
7460
- let S, A, T, E, O, N, D, R, k, P, j;
7460
+ let S, A, T, E, P, N, D, R, k, O, j;
7461
7461
  for (m.x = (_ + 0.5) * c, v.x = Math.floor(m.x), S = 0; S < n; S++) {
7462
- for (m.y = (S + 0.5) * u, v.y = Math.floor(m.y), O = 0, N = 0, D = 0, R = 0, k = 0, A = v.x - g; A <= v.x + g; A++) if (!(A < 0 || A >= e)) {
7463
- P = Math.floor(1e3 * Math.abs(A - m.x)), b[P] || (b[P] = {});
7464
- for (let M = v.y - p; M <= v.y + p; M++) M < 0 || M >= s || (j = Math.floor(1e3 * Math.abs(M - m.y)), b[P][j] || (b[P][j] = l(Math.sqrt(Math.pow(P * d, 2) + Math.pow(j * f, 2)) / 1e3)), T = b[P][j], T > 0 && (E = 4 * (M * e + A), O += T, N += T * r[E], D += T * r[E + 1], R += T * r[E + 2], k += T * r[E + 3]));
7462
+ for (m.y = (S + 0.5) * u, v.y = Math.floor(m.y), P = 0, N = 0, D = 0, R = 0, k = 0, A = v.x - g; A <= v.x + g; A++) if (!(A < 0 || A >= e)) {
7463
+ O = Math.floor(1e3 * Math.abs(A - m.x)), b[O] || (b[O] = {});
7464
+ for (let M = v.y - p; M <= v.y + p; M++) M < 0 || M >= s || (j = Math.floor(1e3 * Math.abs(M - m.y)), b[O][j] || (b[O][j] = l(Math.sqrt(Math.pow(O * d, 2) + Math.pow(j * f, 2)) / 1e3)), T = b[O][j], T > 0 && (E = 4 * (M * e + A), P += T, N += T * r[E], D += T * r[E + 1], R += T * r[E + 2], k += T * r[E + 3]));
7465
7465
  }
7466
- E = 4 * (S * i + _), h[E] = N / O, h[E + 1] = D / O, h[E + 2] = R / O, h[E + 3] = k / O;
7466
+ E = 4 * (S * i + _), h[E] = N / P, h[E + 1] = D / P, h[E + 2] = R / P, h[E + 3] = k / P;
7467
7467
  }
7468
7468
  return ++_ < i ? y(_) : o;
7469
7469
  })(0);
7470
7470
  }
7471
7471
  bilinearFiltering(t, e, s, i, n) {
7472
7472
  let r, o, h, l, c, u, d, f, g, p, b, m, v, y = 0;
7473
- const _ = this.rcpScaleX, S = this.rcpScaleY, A = 4 * (e - 1), T = t.imageData.data, E = t.ctx.createImageData(i, n), O = E.data;
7474
- for (d = 0; d < n; d++) for (f = 0; f < i; f++) for (c = Math.floor(_ * f), u = Math.floor(S * d), g = _ * f - c, p = S * d - u, v = 4 * (u * e + c), b = 0; b < 4; b++) r = T[v + b], o = T[v + 4 + b], h = T[v + A + b], l = T[v + A + 4 + b], m = r * (1 - g) * (1 - p) + o * g * (1 - p) + h * p * (1 - g) + l * g * p, O[y++] = m;
7473
+ const _ = this.rcpScaleX, S = this.rcpScaleY, A = 4 * (e - 1), T = t.imageData.data, E = t.ctx.createImageData(i, n), P = E.data;
7474
+ for (d = 0; d < n; d++) for (f = 0; f < i; f++) for (c = Math.floor(_ * f), u = Math.floor(S * d), g = _ * f - c, p = S * d - u, v = 4 * (u * e + c), b = 0; b < 4; b++) r = T[v + b], o = T[v + 4 + b], h = T[v + A + b], l = T[v + A + 4 + b], m = r * (1 - g) * (1 - p) + o * g * (1 - p) + h * p * (1 - g) + l * g * p, P[y++] = m;
7475
7475
  return E;
7476
7476
  }
7477
7477
  hermiteFastResize(t, e, s, i, n) {
@@ -7481,11 +7481,11 @@ class Gi extends wt {
7481
7481
  let b = 0, m = 0, v = 0, y = 0, _ = 0, S = 0, A = 0;
7482
7482
  const T = (f + 0.5) * o;
7483
7483
  for (let E = Math.floor(f * o); E < (f + 1) * o; E++) {
7484
- const O = Math.abs(T - (E + 0.5)) / l, N = (g + 0.5) * r, D = O * O;
7484
+ const P = Math.abs(T - (E + 0.5)) / l, N = (g + 0.5) * r, D = P * P;
7485
7485
  for (let R = Math.floor(g * r); R < (g + 1) * r; R++) {
7486
7486
  let k = Math.abs(N - (R + 0.5)) / h;
7487
- const P = Math.sqrt(D + k * k);
7488
- P > 1 && P < -1 || (b = 2 * P * P * P - 3 * P * P + 1, b > 0 && (k = 4 * (R + E * e), A += b * c[k + 3], v += b, c[k + 3] < 255 && (b = b * c[k + 3] / 250), y += b * c[k], _ += b * c[k + 1], S += b * c[k + 2], m += b));
7487
+ const O = Math.sqrt(D + k * k);
7488
+ O > 1 && O < -1 || (b = 2 * O * O * O - 3 * O * O + 1, b > 0 && (k = 4 * (R + E * e), A += b * c[k + 3], v += b, c[k + 3] < 255 && (b = b * c[k + 3] / 250), y += b * c[k], _ += b * c[k + 1], S += b * c[k + 2], m += b));
7489
7489
  }
7490
7490
  }
7491
7491
  d[p] = y / m, d[p + 1] = _ / m, d[p + 2] = S / m, d[p + 3] = A / v;
@@ -10607,7 +10607,7 @@ class z {
10607
10607
  const y = p(o, h), _ = b(o, h);
10608
10608
  let S = d(..._);
10609
10609
  const A = z._round(n + S[0]), T = z._round(r + S[1]);
10610
- let E = 1, O = 1, N, D;
10610
+ let E = 1, P = 1, N, D;
10611
10611
  if (e.fromKeyboard)
10612
10612
  ({
10613
10613
  deltaX: N,
@@ -10622,12 +10622,12 @@ class z {
10622
10622
  }
10623
10623
  if ([N, D] = g(N / s, D / i), m) {
10624
10624
  const M = Math.hypot(o, h);
10625
- E = O = Math.max(Math.min(Math.hypot(_[0] - y[0] - N, _[1] - y[1] - D) / M, 1 / o, 1 / h), l / o, c / h);
10626
- } else v ? E = Math.max(l, Math.min(1, Math.abs(_[0] - y[0] - N))) / o : O = Math.max(c, Math.min(1, Math.abs(_[1] - y[1] - D))) / h;
10627
- const R = z._round(o * E), k = z._round(h * O);
10625
+ E = P = Math.max(Math.min(Math.hypot(_[0] - y[0] - N, _[1] - y[1] - D) / M, 1 / o, 1 / h), l / o, c / h);
10626
+ } else v ? E = Math.max(l, Math.min(1, Math.abs(_[0] - y[0] - N))) / o : P = Math.max(c, Math.min(1, Math.abs(_[1] - y[1] - D))) / h;
10627
+ const R = z._round(o * E), k = z._round(h * P);
10628
10628
  S = d(...b(R, k));
10629
- const P = A - S[0], j = T - S[1];
10630
- this.#o ||= [this.x, this.y, this.width, this.height], this.width = R, this.height = k, this.x = P, this.y = j, this.setDims(s * R, i * k), this.fixAndSetPosition(), this._onResizing();
10629
+ const O = A - S[0], j = T - S[1];
10630
+ this.#o ||= [this.x, this.y, this.width, this.height], this.width = R, this.height = k, this.x = O, this.y = j, this.setDims(s * R, i * k), this.fixAndSetPosition(), this._onResizing();
10631
10631
  }
10632
10632
  _onResizing() {
10633
10633
  }
@@ -11386,8 +11386,8 @@ class ef {
11386
11386
  return _.charCodeAt(S) << 24 | _.charCodeAt(S + 1) << 16 | _.charCodeAt(S + 2) << 8 | _.charCodeAt(S + 3) & 255;
11387
11387
  }
11388
11388
  function i(_, S, A, T) {
11389
- const E = _.substring(0, S), O = _.substring(S + A);
11390
- return E + T + O;
11389
+ const E = _.substring(0, S), P = _.substring(S + A);
11390
+ return E + T + P;
11391
11391
  }
11392
11392
  let n, r;
11393
11393
  const o = this._document.createElement("canvas");
@@ -12019,14 +12019,14 @@ class rf extends pl {
12019
12019
  const g = (m, v, y) => {
12020
12020
  const _ = new Array(256), S = (u - c) / y, A = m / 255, T = (v - m) / (255 * y);
12021
12021
  let E = 0;
12022
- for (let O = 0; O <= y; O++) {
12023
- const N = Math.round(c + O * S), D = A + O * T;
12022
+ for (let P = 0; P <= y; P++) {
12023
+ const N = Math.round(c + P * S), D = A + P * T;
12024
12024
  for (let R = E; R <= N; R++)
12025
12025
  _[R] = D;
12026
12026
  E = N + 1;
12027
12027
  }
12028
- for (let O = E; O < 256; O++)
12029
- _[O] = _[E - 1];
12028
+ for (let P = E; P < 256; P++)
12029
+ _[P] = _[E - 1];
12030
12030
  return _.join(",");
12031
12031
  }, p = `g_${this.#i}_hcm_${t}_filter`, b = o.filter = this.#g(p);
12032
12032
  return this.#o(b), this.#p(g(d[0], f[0], 5), g(d[1], f[1], 5), g(d[2], f[2], 5), b), o.url = this.#u(p), o.url;
@@ -12158,22 +12158,22 @@ function fr(a, t, e, s, i, n, r, o) {
12158
12158
  const f = (h[e] + t.offsetX) * t.scaleX, g = (h[e + 1] + t.offsetY) * t.scaleY, p = (h[s] + t.offsetX) * t.scaleX, b = (h[s + 1] + t.offsetY) * t.scaleY, m = (h[i] + t.offsetX) * t.scaleX, v = (h[i + 1] + t.offsetY) * t.scaleY;
12159
12159
  if (g >= v)
12160
12160
  return;
12161
- const y = l[n], _ = l[n + 1], S = l[n + 2], A = l[r], T = l[r + 1], E = l[r + 2], O = l[o], N = l[o + 1], D = l[o + 2], R = Math.round(g), k = Math.round(v);
12162
- let P, j, M, L, G, it, at, xt;
12161
+ const y = l[n], _ = l[n + 1], S = l[n + 2], A = l[r], T = l[r + 1], E = l[r + 2], P = l[o], N = l[o + 1], D = l[o + 2], R = Math.round(g), k = Math.round(v);
12162
+ let O, j, M, L, G, it, at, xt;
12163
12163
  for (let gt = R; gt <= k; gt++) {
12164
12164
  if (gt < b) {
12165
12165
  const K = gt < g ? 0 : (g - gt) / (g - b);
12166
- P = f - (f - p) * K, j = y - (y - A) * K, M = _ - (_ - T) * K, L = S - (S - E) * K;
12166
+ O = f - (f - p) * K, j = y - (y - A) * K, M = _ - (_ - T) * K, L = S - (S - E) * K;
12167
12167
  } else {
12168
12168
  let K;
12169
- gt > v ? K = 1 : b === v ? K = 0 : K = (b - gt) / (b - v), P = p - (p - m) * K, j = A - (A - O) * K, M = T - (T - N) * K, L = E - (E - D) * K;
12169
+ gt > v ? K = 1 : b === v ? K = 0 : K = (b - gt) / (b - v), O = p - (p - m) * K, j = A - (A - P) * K, M = T - (T - N) * K, L = E - (E - D) * K;
12170
12170
  }
12171
12171
  let et;
12172
- gt < g ? et = 0 : gt > v ? et = 1 : et = (g - gt) / (g - v), G = f - (f - m) * et, it = y - (y - O) * et, at = _ - (_ - N) * et, xt = S - (S - D) * et;
12173
- const Pt = Math.round(Math.min(P, G)), fe = Math.round(Math.max(P, G));
12172
+ gt < g ? et = 0 : gt > v ? et = 1 : et = (g - gt) / (g - v), G = f - (f - m) * et, it = y - (y - P) * et, at = _ - (_ - N) * et, xt = S - (S - D) * et;
12173
+ const Pt = Math.round(Math.min(O, G)), fe = Math.round(Math.max(O, G));
12174
12174
  let ht = u * gt + Pt * 4;
12175
12175
  for (let K = Pt; K <= fe; K++)
12176
- et = (P - K) / (P - G), et < 0 ? et = 0 : et > 1 && (et = 1), c[ht++] = j - (j - it) * et | 0, c[ht++] = M - (M - at) * et | 0, c[ht++] = L - (L - xt) * et | 0, c[ht++] = 255;
12176
+ et = (O - K) / (O - G), et < 0 ? et = 0 : et > 1 && (et = 1), c[ht++] = j - (j - it) * et | 0, c[ht++] = M - (M - at) * et | 0, c[ht++] = L - (L - xt) * et | 0, c[ht++] = 255;
12177
12177
  }
12178
12178
  }
12179
12179
  function uf(a, t, e) {
@@ -12278,11 +12278,11 @@ class yo {
12278
12278
  h = Math.abs(h), l = Math.abs(l), In("TilingType: " + n);
12279
12279
  const c = e[0], u = e[1], d = e[2], f = e[3], g = d - c, p = f - u, b = B.singularValueDecompose2dScale(this.matrix), m = B.singularValueDecompose2dScale(this.baseTransform), v = b[0] * m[0], y = b[1] * m[1];
12280
12280
  let _ = g, S = p, A = !1, T = !1;
12281
- const E = Math.ceil(h * v), O = Math.ceil(l * y), N = Math.ceil(g * v), D = Math.ceil(p * y);
12282
- E >= N ? _ = h : A = !0, O >= D ? S = l : T = !0;
12283
- const R = this.getSizeAndScale(_, this.ctx.canvas.width, v), k = this.getSizeAndScale(S, this.ctx.canvas.height, y), P = t.cachedCanvases.getCanvas("pattern", R.size, k.size), j = P.context, M = o.createCanvasGraphics(j);
12281
+ const E = Math.ceil(h * v), P = Math.ceil(l * y), N = Math.ceil(g * v), D = Math.ceil(p * y);
12282
+ E >= N ? _ = h : A = !0, P >= D ? S = l : T = !0;
12283
+ const R = this.getSizeAndScale(_, this.ctx.canvas.width, v), k = this.getSizeAndScale(S, this.ctx.canvas.height, y), O = t.cachedCanvases.getCanvas("pattern", R.size, k.size), j = O.context, M = o.createCanvasGraphics(j);
12284
12284
  if (M.groupLevel = t.groupLevel, this.setFillAndStrokeStyleToContext(M, i, r), j.translate(-R.scale * c, -k.scale * u), M.transform(R.scale, 0, 0, k.scale, 0, 0), j.save(), this.clipBbox(M, c, u, d, f), M.baseTransform = rt(M.ctx), M.executeOperatorList(s), M.endDrawing(), j.restore(), A || T) {
12285
- const L = P.canvas;
12285
+ const L = O.canvas;
12286
12286
  A && (_ = h), T && (S = l);
12287
12287
  const G = this.getSizeAndScale(_, this.ctx.canvas.width, v), it = this.getSizeAndScale(S, this.ctx.canvas.height, y), at = G.size, xt = it.size, gt = t.cachedCanvases.getCanvas("pattern-workaround", at, xt), et = gt.context, Pt = A ? Math.floor(g / h) : 0, fe = T ? Math.floor(p / l) : 0;
12288
12288
  for (let ht = 0; ht <= Pt; ht++)
@@ -12297,7 +12297,7 @@ class yo {
12297
12297
  };
12298
12298
  }
12299
12299
  return {
12300
- canvas: P.canvas,
12300
+ canvas: O.canvas,
12301
12301
  scaleX: R.scale,
12302
12302
  scaleY: k.scale,
12303
12303
  offsetX: c,
@@ -12428,12 +12428,12 @@ class vf {
12428
12428
  function Ui(a, t, e, s, i, n, r, o, h, l) {
12429
12429
  const [c, u, d, f, g, p] = rt(a);
12430
12430
  if (u === 0 && d === 0) {
12431
- const v = r * c + g, y = Math.round(v), _ = o * f + p, S = Math.round(_), A = (r + h) * c + g, T = Math.abs(Math.round(A) - y) || 1, E = (o + l) * f + p, O = Math.abs(Math.round(E) - S) || 1;
12432
- return a.setTransform(Math.sign(c), 0, 0, Math.sign(f), y, S), a.drawImage(t, e, s, i, n, 0, 0, T, O), a.setTransform(c, u, d, f, g, p), [T, O];
12431
+ const v = r * c + g, y = Math.round(v), _ = o * f + p, S = Math.round(_), A = (r + h) * c + g, T = Math.abs(Math.round(A) - y) || 1, E = (o + l) * f + p, P = Math.abs(Math.round(E) - S) || 1;
12432
+ return a.setTransform(Math.sign(c), 0, 0, Math.sign(f), y, S), a.drawImage(t, e, s, i, n, 0, 0, T, P), a.setTransform(c, u, d, f, g, p), [T, P];
12433
12433
  }
12434
12434
  if (c === 0 && f === 0) {
12435
- const v = o * d + g, y = Math.round(v), _ = r * u + p, S = Math.round(_), A = (o + l) * d + g, T = Math.abs(Math.round(A) - y) || 1, E = (r + h) * u + p, O = Math.abs(Math.round(E) - S) || 1;
12436
- return a.setTransform(0, Math.sign(u), Math.sign(d), 0, y, S), a.drawImage(t, e, s, i, n, 0, 0, O, T), a.setTransform(c, u, d, f, g, p), [O, T];
12435
+ const v = o * d + g, y = Math.round(v), _ = r * u + p, S = Math.round(_), A = (o + l) * d + g, T = Math.abs(Math.round(A) - y) || 1, E = (r + h) * u + p, P = Math.abs(Math.round(E) - S) || 1;
12436
+ return a.setTransform(0, Math.sign(u), Math.sign(d), 0, y, S), a.drawImage(t, e, s, i, n, 0, 0, P, T), a.setTransform(c, u, d, f, g, p), [P, T];
12437
12437
  }
12438
12438
  a.drawImage(t, e, s, i, n, r, o, h, l);
12439
12439
  const b = Math.hypot(c, u), m = Math.hypot(d, f);
@@ -12558,9 +12558,9 @@ function Pa(a, t) {
12558
12558
  for (g = d < n ? Vt : i, l = 0, f = 0; f < g; f++) {
12559
12559
  const A = b - h;
12560
12560
  let T = 0;
12561
- const E = A > y ? s : A * 8 - 7, O = E & -8;
12561
+ const E = A > y ? s : A * 8 - 7, P = E & -8;
12562
12562
  let N = 0, D = 0;
12563
- for (; T < O; T += 8)
12563
+ for (; T < P; T += 8)
12564
12564
  D = c[h++], m[l++] = D & 128 ? _ : S, m[l++] = D & 64 ? _ : S, m[l++] = D & 32 ? _ : S, m[l++] = D & 16 ? _ : S, m[l++] = D & 8 ? _ : S, m[l++] = D & 4 ? _ : S, m[l++] = D & 2 ? _ : S, m[l++] = D & 1 ? _ : S;
12565
12565
  for (; T < E; T++)
12566
12566
  N === 0 && (D = c[h++], N = 128), m[l++] = D & N ? _ : S, N >>= 1;
@@ -12725,16 +12725,16 @@ class Es {
12725
12725
  if ((t.bitmap || t.data) && t.count > 1) {
12726
12726
  const E = t.bitmap || t.data.buffer;
12727
12727
  l = JSON.stringify(r ? o : [o.slice(0, 4), n]), h = this._cachedBitmapsMap.get(E), h || (h = /* @__PURE__ */ new Map(), this._cachedBitmapsMap.set(E, h));
12728
- const O = h.get(l);
12729
- if (O && !r) {
12728
+ const P = h.get(l);
12729
+ if (P && !r) {
12730
12730
  const N = Math.round(Math.min(o[0], o[2]) + o[4]), D = Math.round(Math.min(o[1], o[3]) + o[5]);
12731
12731
  return {
12732
- canvas: O,
12732
+ canvas: P,
12733
12733
  offsetX: N,
12734
12734
  offsetY: D
12735
12735
  };
12736
12736
  }
12737
- c = O;
12737
+ c = P;
12738
12738
  }
12739
12739
  c || (u = this.cachedCanvases.getCanvas("maskCanvas", s, i), Oa(u.context, t));
12740
12740
  let d = B.transform(o, [1 / s, 0, 0, -1 / i, 0, 0]);
@@ -13082,8 +13082,8 @@ class Es {
13082
13082
  if (r !== 1 && (n.scale(r, r), y /= r), n.lineWidth = y, s.isInvalidPDFjsFont) {
13083
13083
  const T = [];
13084
13084
  let E = 0;
13085
- for (const O of t)
13086
- T.push(O.unicode), E += O.width;
13085
+ for (const P of t)
13086
+ T.push(P.unicode), E += P.width;
13087
13087
  n.fillText(T.join(""), 0, 0), e.x += E * p * c, n.restore(), this.compose();
13088
13088
  return;
13089
13089
  }
@@ -13095,19 +13095,19 @@ class Es {
13095
13095
  continue;
13096
13096
  }
13097
13097
  let E = !1;
13098
- const O = (T.isSpace ? h : 0) + o, N = T.fontChar, D = T.accent;
13099
- let R, k, P = T.width;
13098
+ const P = (T.isSpace ? h : 0) + o, N = T.fontChar, D = T.accent;
13099
+ let R, k, O = T.width;
13100
13100
  if (d) {
13101
- const M = T.vmetric || g, L = -(T.vmetric ? M[1] : P * 0.5) * p, G = M[2] * p;
13102
- P = M ? -M[0] : P, R = L / r, k = (S + G) / r;
13101
+ const M = T.vmetric || g, L = -(T.vmetric ? M[1] : O * 0.5) * p, G = M[2] * p;
13102
+ O = M ? -M[0] : O, R = L / r, k = (S + G) / r;
13103
13103
  } else
13104
13104
  R = S / r, k = 0;
13105
- if (s.remeasure && P > 0) {
13105
+ if (s.remeasure && O > 0) {
13106
13106
  const M = n.measureText(N).width * 1e3 / i * r;
13107
- if (P < M && this.isFontSubpixelAAEnabled) {
13108
- const L = P / M;
13107
+ if (O < M && this.isFontSubpixelAAEnabled) {
13108
+ const L = O / M;
13109
13109
  E = !0, n.save(), n.scale(L, 1), R /= L;
13110
- } else P !== M && (R += (P - M) / 2e3 * i / r);
13110
+ } else O !== M && (R += (O - M) / 2e3 * i / r);
13111
13111
  }
13112
13112
  if (this.contentVisible && (T.isInFont || s.missingFile)) {
13113
13113
  if (b && !D)
@@ -13117,7 +13117,7 @@ class Es {
13117
13117
  this.paintChar(D.fontChar, M, L, m, v);
13118
13118
  }
13119
13119
  }
13120
- const j = d ? P * p - O * l : P * p + O * l;
13120
+ const j = d ? O * p - P * l : O * p + P * l;
13121
13121
  S += j, E && n.restore();
13122
13122
  }
13123
13123
  d ? e.y -= S : e.x += S * c, n.restore(), this.compose();
@@ -14893,7 +14893,7 @@ function Jf(a = {}) {
14893
14893
  docId: e
14894
14894
  } = t, s = a.url ? Zf(a.url) : null, i = a.data ? Qf(a.data) : null, n = a.httpHeaders || null, r = a.withCredentials === !0, o = a.password ?? null, h = a.range instanceof Al ? a.range : null, l = Number.isInteger(a.rangeChunkSize) && a.rangeChunkSize > 0 ? a.rangeChunkSize : Xf;
14895
14895
  let c = a.worker instanceof ks ? a.worker : null;
14896
- const u = a.verbosity, d = typeof a.docBaseUrl == "string" && !Bn(a.docBaseUrl) ? a.docBaseUrl : null, f = typeof a.cMapUrl == "string" ? a.cMapUrl : null, g = a.cMapPacked !== !1, p = a.CMapReaderFactory || $f, b = typeof a.standardFontDataUrl == "string" ? a.standardFontDataUrl : null, m = a.StandardFontDataFactory || Kf, v = a.stopAtErrors !== !0, y = Number.isInteger(a.maxImageSize) && a.maxImageSize > -1 ? a.maxImageSize : -1, _ = a.isEvalSupported !== !1, S = typeof a.isOffscreenCanvasSupported == "boolean" ? a.isOffscreenCanvasSupported : !kt, A = typeof a.isImageDecoderSupported == "boolean" ? a.isImageDecoderSupported : !kt && (jt.platform.isFirefox || !globalThis.chrome), T = Number.isInteger(a.canvasMaxAreaInBytes) ? a.canvasMaxAreaInBytes : -1, E = typeof a.disableFontFace == "boolean" ? a.disableFontFace : kt, O = a.fontExtraProperties === !0, N = a.enableXfa === !0, D = a.ownerDocument || globalThis.document, R = a.disableRange === !0, k = a.disableStream === !0, P = a.disableAutoFetch === !0, j = a.pdfBug === !0, M = a.CanvasFactory || Yf, L = a.FilterFactory || qf, G = a.enableHWA === !0, it = h ? h.length : a.length ?? NaN, at = typeof a.useSystemFonts == "boolean" ? a.useSystemFonts : !kt && !E, xt = typeof a.useWorkerFetch == "boolean" ? a.useWorkerFetch : p === gl && m === bl && f && b && Ks(f, document.baseURI) && Ks(b, document.baseURI), gt = null;
14896
+ const u = a.verbosity, d = typeof a.docBaseUrl == "string" && !Bn(a.docBaseUrl) ? a.docBaseUrl : null, f = typeof a.cMapUrl == "string" ? a.cMapUrl : null, g = a.cMapPacked !== !1, p = a.CMapReaderFactory || $f, b = typeof a.standardFontDataUrl == "string" ? a.standardFontDataUrl : null, m = a.StandardFontDataFactory || Kf, v = a.stopAtErrors !== !0, y = Number.isInteger(a.maxImageSize) && a.maxImageSize > -1 ? a.maxImageSize : -1, _ = a.isEvalSupported !== !1, S = typeof a.isOffscreenCanvasSupported == "boolean" ? a.isOffscreenCanvasSupported : !kt, A = typeof a.isImageDecoderSupported == "boolean" ? a.isImageDecoderSupported : !kt && (jt.platform.isFirefox || !globalThis.chrome), T = Number.isInteger(a.canvasMaxAreaInBytes) ? a.canvasMaxAreaInBytes : -1, E = typeof a.disableFontFace == "boolean" ? a.disableFontFace : kt, P = a.fontExtraProperties === !0, N = a.enableXfa === !0, D = a.ownerDocument || globalThis.document, R = a.disableRange === !0, k = a.disableStream === !0, O = a.disableAutoFetch === !0, j = a.pdfBug === !0, M = a.CanvasFactory || Yf, L = a.FilterFactory || qf, G = a.enableHWA === !0, it = h ? h.length : a.length ?? NaN, at = typeof a.useSystemFonts == "boolean" ? a.useSystemFonts : !kt && !E, xt = typeof a.useWorkerFetch == "boolean" ? a.useWorkerFetch : p === gl && m === bl && f && b && Ks(f, document.baseURI) && Ks(b, document.baseURI), gt = null;
14897
14897
  Fd(u);
14898
14898
  const et = {
14899
14899
  canvasFactory: new M({
@@ -14924,7 +14924,7 @@ function Jf(a = {}) {
14924
14924
  apiVersion: "4.10.38",
14925
14925
  data: i,
14926
14926
  password: o,
14927
- disableAutoFetch: P,
14927
+ disableAutoFetch: O,
14928
14928
  rangeChunkSize: l,
14929
14929
  length: it,
14930
14930
  docBaseUrl: d,
@@ -14937,19 +14937,19 @@ function Jf(a = {}) {
14937
14937
  isOffscreenCanvasSupported: S,
14938
14938
  isImageDecoderSupported: A,
14939
14939
  canvasMaxAreaInBytes: T,
14940
- fontExtraProperties: O,
14940
+ fontExtraProperties: P,
14941
14941
  useSystemFonts: at,
14942
14942
  cMapUrl: xt ? f : null,
14943
14943
  standardFontDataUrl: xt ? b : null
14944
14944
  }
14945
14945
  }, fe = {
14946
14946
  disableFontFace: E,
14947
- fontExtraProperties: O,
14947
+ fontExtraProperties: P,
14948
14948
  ownerDocument: D,
14949
14949
  pdfBug: j,
14950
14950
  styleElement: gt,
14951
14951
  loadingParams: {
14952
- disableAutoFetch: P,
14952
+ disableAutoFetch: O,
14953
14953
  enableXfa: N
14954
14954
  }
14955
14955
  };
@@ -16799,8 +16799,8 @@ class ft {
16799
16799
  const f = c.createElement("clipPath"), g = `clippath_${this.data.id}`;
16800
16800
  f.setAttribute("id", g), f.setAttribute("clipPathUnits", "objectBoundingBox"), d.append(f);
16801
16801
  for (let p = 2, b = t.length; p < b; p += 8) {
16802
- const m = t[p], v = t[p + 1], y = t[p + 2], _ = t[p + 3], S = c.createElement("rect"), A = (y - e) / h, T = (n - v) / l, E = (m - y) / h, O = (v - _) / l;
16803
- S.setAttribute("x", A), S.setAttribute("y", T), S.setAttribute("width", E), S.setAttribute("height", O), f.append(S), o?.push(`<rect vector-effect="non-scaling-stroke" x="${A}" y="${T}" width="${E}" height="${O}"/>`);
16802
+ const m = t[p], v = t[p + 1], y = t[p + 2], _ = t[p + 3], S = c.createElement("rect"), A = (y - e) / h, T = (n - v) / l, E = (m - y) / h, P = (v - _) / l;
16803
+ S.setAttribute("x", A), S.setAttribute("y", T), S.setAttribute("width", E), S.setAttribute("height", P), f.append(S), o?.push(`<rect vector-effect="non-scaling-stroke" x="${A}" y="${T}" width="${E}" height="${P}"/>`);
16804
16804
  }
16805
16805
  this.#e && (o.push("</g></svg>')"), r.backgroundImage = o.join("")), this.container.append(u), this.container.style.clipPath = `url(#${g})`;
16806
16806
  }
@@ -18940,8 +18940,8 @@ class Ir {
18940
18940
  width: v,
18941
18941
  height: y
18942
18942
  } of t) {
18943
- const _ = Math.floor((b - e) / l) * l, S = Math.ceil((b + v + e) / l) * l, A = Math.floor((m - e) / l) * l, T = Math.ceil((m + y + e) / l) * l, E = [_, A, T, !0], O = [S, A, T, !1];
18944
- this.#s.push(E, O), n = Math.min(n, _), r = Math.max(r, S), o = Math.min(o, A), h = Math.max(h, T);
18943
+ const _ = Math.floor((b - e) / l) * l, S = Math.ceil((b + v + e) / l) * l, A = Math.floor((m - e) / l) * l, T = Math.ceil((m + y + e) / l) * l, E = [_, A, T, !0], P = [S, A, T, !1];
18944
+ this.#s.push(E, P), n = Math.min(n, _), r = Math.max(r, S), o = Math.min(o, A), h = Math.max(h, T);
18945
18945
  }
18946
18946
  const c = r - n + 2 * s, u = h - o + 2 * s, d = n - s, f = o - s, g = this.#s.at(i ? -1 : -2), p = [g[0], g[2]];
18947
18947
  for (const b of this.#s) {
@@ -20559,8 +20559,8 @@ class Vn extends I {
20559
20559
  let [_, S, A, T] = m.subarray(0, 4);
20560
20560
  y.set([NaN, NaN, NaN, NaN, _, S], 0);
20561
20561
  for (let E = 4; E < v; E += 2) {
20562
- const O = m[E], N = m[E + 1];
20563
- y.set(I.createBezierPoints(_, S, A, T, O, N), (E - 2) * 3), [_, S, A, T] = [A, T, O, N];
20562
+ const P = m[E], N = m[E + 1];
20563
+ y.set(I.createBezierPoints(_, S, A, T, P, N), (E - 2) * 3), [_, S, A, T] = [A, T, P, N];
20564
20564
  }
20565
20565
  }
20566
20566
  }
@@ -21993,14 +21993,14 @@ function Ig(a, t = 500) {
21993
21993
  function Ng(a) {
21994
21994
  return new Promise((t, e) => {
21995
21995
  const s = new FileReader();
21996
- s.addEventListener("load", () => t(s.result)), s.addEventListener("error", e), s.readAsDataURL(a);
21996
+ s.addEventListener("load", () => t(s.result)), s.addEventListener("error", e), s.readAsArrayBuffer(a);
21997
21997
  });
21998
21998
  }
21999
21999
  Fl() || (Og.workerSrc = `https://cdnjs.cloudflare.com/ajax/libs/pdf.js/${Lg}/pdf.worker.min.mjs`);
22000
22000
  async function jg(a) {
22001
- const t = "data:application/pdf;base64,", e = await Ng(a);
22002
- if (typeof e == "string")
22003
- return globalThis.atob(e.slice(t.length));
22001
+ const t = await Ng(a);
22002
+ if (t instanceof ArrayBuffer)
22003
+ return t;
22004
22004
  }
22005
22005
  function Fl() {
22006
22006
  try {
@@ -22009,7 +22009,7 @@ function Fl() {
22009
22009
  return !1;
22010
22010
  }
22011
22011
  }
22012
- async function Bg({ page: a, PDFBase64: t, scale: e, password: s }, i) {
22012
+ async function Bg({ page: a, data: t, scale: e, password: s }, i) {
22013
22013
  const n = Fg() / window.devicePixelRatio;
22014
22014
  if (Fl()) {
22015
22015
  const r = new Worker(new URL(
@@ -22049,7 +22049,7 @@ function zg(a, t) {
22049
22049
  PDFId: `${a.name}-${e}`,
22050
22050
  name: a.name.replace(/.pdf/, ""),
22051
22051
  updateDate: e,
22052
- PDFBase64: t
22052
+ data: t
22053
22053
  };
22054
22054
  }
22055
22055
  async function Gg({ src: a }, t, e) {
@@ -22124,7 +22124,7 @@ function Jg(a, t, e) {
22124
22124
  async function Zg(a, t, e) {
22125
22125
  const s = await jg(a);
22126
22126
  if (!s) return;
22127
- const i = zg(a, s), n = await jl({ page: 1, PDFBase64: s, scale: 0.8, password: t }, e);
22127
+ const i = zg(a, s), n = await jl({ page: 1, data: s, scale: 0.8, password: t }, e);
22128
22128
  return { ...i, pages: n };
22129
22129
  }
22130
22130
  function jl(a, t) {
@@ -22173,74 +22173,74 @@ function sp(a) {
22173
22173
  function d() {
22174
22174
  if (!t || Ft.has(t)) return;
22175
22175
  const k = Hg(t);
22176
- return k.on("selection:created", (P) => {
22177
- if (r?.(P), P.selected.length <= 1) return;
22176
+ return k.on("selection:created", (O) => {
22177
+ if (r?.(O), O.selected.length <= 1) return;
22178
22178
  const j = k.getActiveObject();
22179
22179
  j && (l = j, e?.value && l.set(e.value), l._cornerSize = l.cornerSize, S(c));
22180
- }), k.on("selection:cleared", (P) => {
22181
- o?.(P), T(k);
22180
+ }), k.on("selection:cleared", (O) => {
22181
+ o?.(O), T(k);
22182
22182
  }), s && k.on("mouse:down", s), i && k.on("mouse:move", i), n && k.on("mouse:up", n), k;
22183
22183
  }
22184
- function f(k, P) {
22185
- return Jg(k, P, t);
22184
+ function f(k, O) {
22185
+ return Jg(k, O, t);
22186
22186
  }
22187
22187
  function g(k) {
22188
22188
  return jl(k, t);
22189
22189
  }
22190
- function p({ url: k, scale: P = 0.5 }) {
22191
- return Il(t, { url: k, scale: P });
22190
+ function p({ url: k, scale: O = 0.5 }) {
22191
+ return Il(t, { url: k, scale: O });
22192
22192
  }
22193
- async function b(k, P, j) {
22193
+ async function b(k, O, j) {
22194
22194
  const M = Ft.get(t);
22195
22195
  if (!M) return;
22196
- const L = await Tt.fromURL(k, {}, { ...ql, ...P });
22196
+ const L = await Tt.fromURL(k, {}, { ...ql, ...O });
22197
22197
  jr(L, j), M.add(L), v(M, L), M.setActiveObject(L);
22198
22198
  }
22199
- function m(k, P, j) {
22199
+ function m(k, O, j) {
22200
22200
  const M = Ft.get(t);
22201
22201
  if (!M) return;
22202
22202
  const L = new Ct(k, {
22203
22203
  ...Kl,
22204
- ...P
22204
+ ...O
22205
22205
  });
22206
22206
  jr(L, j), M.add(L), v(M, L), M.setActiveObject(L);
22207
22207
  }
22208
- function v(k, P) {
22209
- P.on("selected", (j) => y({ canvas: k, target: j.target })), P.on("modified", (j) => y({ canvas: k, target: j.target })), P.on("scaling", () => T(k)), P.on("moving", () => T(k)), P.on("rotating", () => T(k)), P._cornerSize = P._cornerSize ?? P.cornerSize;
22208
+ function v(k, O) {
22209
+ O.on("selected", (j) => y({ canvas: k, target: j.target })), O.on("modified", (j) => y({ canvas: k, target: j.target })), O.on("scaling", () => T(k)), O.on("moving", () => T(k)), O.on("rotating", () => T(k)), O._cornerSize = O._cornerSize ?? O.cornerSize;
22210
22210
  }
22211
22211
  async function y({
22212
22212
  canvas: k,
22213
- target: P,
22213
+ target: O,
22214
22214
  stroke: j = u.stroke,
22215
22215
  uuid: M = Date.now()
22216
22216
  }) {
22217
22217
  if (k.getActiveObjects().length > 1 || h?.stroke === `${j}-${M}`) return;
22218
22218
  const G = await Gg(u, M, j);
22219
- T(k), h = G, l = P, _(k, P, M), S(c, !0), G && k.add(G);
22219
+ T(k), h = G, l = O, _(k, O, M), S(c, !0), G && k.add(G);
22220
22220
  }
22221
- function _(k, P, j) {
22221
+ function _(k, O, j) {
22222
22222
  h && (h.on("selected", () => {
22223
- k.remove(P), T(k);
22223
+ k.remove(O), T(k);
22224
22224
  }), h.on("mouseover", () => {
22225
22225
  y({
22226
22226
  canvas: k,
22227
- target: P,
22227
+ target: O,
22228
22228
  stroke: u.hoverStroke,
22229
22229
  uuid: j
22230
22230
  });
22231
22231
  }), h.on("mouseout", () => {
22232
- y({ canvas: k, target: P, stroke: u.stroke, uuid: j });
22232
+ y({ canvas: k, target: O, stroke: u.stroke, uuid: j });
22233
22233
  }));
22234
22234
  }
22235
- function S(k, P = !1) {
22235
+ function S(k, O = !1) {
22236
22236
  const j = Ft.get(t);
22237
- c = k, j && (Yg(l, k), Ug(l, k, h), !P && j.renderAll());
22237
+ c = k, j && (Yg(l, k), Ug(l, k, h), !O && j.renderAll());
22238
22238
  }
22239
22239
  function A(k) {
22240
22240
  if (!k) return;
22241
22241
  u = { ...u, ...k };
22242
- const P = Ft.get(t);
22243
- !h || !l || !P || y({ target: l, canvas: P });
22242
+ const O = Ft.get(t);
22243
+ !h || !l || !O || y({ target: l, canvas: O });
22244
22244
  }
22245
22245
  function T(k) {
22246
22246
  l = null, h && (k.remove(h), h = null);
@@ -22248,7 +22248,7 @@ function sp(a) {
22248
22248
  function E() {
22249
22249
  $g(t);
22250
22250
  }
22251
- function O() {
22251
+ function P() {
22252
22252
  qg(t);
22253
22253
  }
22254
22254
  function N(k) {
@@ -22268,7 +22268,7 @@ function sp(a) {
22268
22268
  addFabric: b,
22269
22269
  addTextFabric: m,
22270
22270
  clearActive: E,
22271
- deleteCanvas: O,
22271
+ deleteCanvas: P,
22272
22272
  scaleFabric: S,
22273
22273
  setCloseSvgOptions: A,
22274
22274
  setActiveFabric: N,
@@ -22334,14 +22334,14 @@ const op = /* @__PURE__ */ Hl({
22334
22334
  async function A() {
22335
22335
  const { file: D, page: R, fileScale: k } = s;
22336
22336
  globalThis.requestAnimationFrame(async () => {
22337
- if (await Gl(), c(), D.PDFBase64.startsWith("data:image") || D.canvas) {
22338
- const { canvas: P } = D, j = P ? 7 : 3, M = P?.length ? P[R - 1] : D.PDFBase64;
22339
- g({ url: M, scale: k / j }), i("loaded");
22337
+ if (await Gl(), c(), typeof D.data == "string") {
22338
+ const j = D.data;
22339
+ g({ url: j, scale: k / 3 }), i("loaded");
22340
22340
  return;
22341
22341
  }
22342
22342
  await u({
22343
22343
  page: R,
22344
- PDFBase64: D.PDFBase64,
22344
+ data: D.canvas?.[R - 1] ?? D.data,
22345
22345
  scale: k,
22346
22346
  password: s.password
22347
22347
  }), i("loaded");
@@ -22349,13 +22349,13 @@ const op = /* @__PURE__ */ Hl({
22349
22349
  }
22350
22350
  function T(D) {
22351
22351
  if (!s.isDrop || !D.dataTransfer) return;
22352
- const { dataTransfer: R, offsetX: k, offsetY: P } = D, j = R.getData("text/plain"), M = R.getData("text/uri-list"), L = R.getData("custom/offset"), G = L ? JSON.parse(L) : null, it = { top: P, left: k }, at = { x: G?.offsetX ?? 0, y: G?.offsetY ?? 0 };
22353
- M ? E(M, it, at) : j && O(j, it, at);
22352
+ const { dataTransfer: R, offsetX: k, offsetY: O } = D, j = R.getData("text/plain"), M = R.getData("text/uri-list"), L = R.getData("custom/offset"), G = L ? JSON.parse(L) : null, it = { top: O, left: k }, at = { x: G?.offsetX ?? 0, y: G?.offsetY ?? 0 };
22353
+ M ? E(M, it, at) : j && P(j, it, at);
22354
22354
  }
22355
22355
  function E(D, R, k) {
22356
22356
  d(D, { ...s.dropImageOptions, ...R }, k);
22357
22357
  }
22358
- function O(D, R, k) {
22358
+ function P(D, R, k) {
22359
22359
  f(D, { ...s.dropTextOptions, ...R }, k);
22360
22360
  }
22361
22361
  function N() {
@@ -22364,7 +22364,7 @@ const op = /* @__PURE__ */ Hl({
22364
22364
  return Wn([() => s.fileScale, () => s.page, () => s.file, () => s.password], N), Wn(h, (D) => m(D), { immediate: !0 }), Wn(() => s.closeSvgOptions, y, { immediate: !0 }), n(b), t({
22365
22365
  reload: A,
22366
22366
  addImage: E,
22367
- addText: O,
22367
+ addText: P,
22368
22368
  clearActive: p,
22369
22369
  deleteCanvas: b,
22370
22370
  setActiveFabric: v,