@component-hook/pdf-canvas 1.3.1-alpha.3 → 1.3.1-alpha.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/react/pdf-canvas.es.d.ts +0 -1
- package/dist/react/pdf-canvas.es.js +392 -392
- package/dist/react/pdf-canvas.umd.js +30 -30
- package/dist/vue/pdf-canvas.es.d.ts +0 -1
- package/dist/vue/pdf-canvas.es.js +190 -190
- package/dist/vue/pdf-canvas.umd.js +7 -7
- package/package.json +4 -4
|
@@ -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:
|
|
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: L, fillRule: k, paintFirst: O, globalCompositeOperation: j, skewX: M, skewY: R } = 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:
|
|
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: L, fillRule: k, paintFirst: O, globalCompositeOperation: j, skewX: G(M), skewY: G(R) }, e ? { clipPath: e } : null);
|
|
2087
2087
|
return this.includeDefaultValues ? it : this._removeDefaultValues(it);
|
|
2088
2088
|
}
|
|
2089
2089
|
toDatalessObject(t) {
|
|
@@ -2239,10 +2239,10 @@ 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:
|
|
2243
|
-
const { skew:
|
|
2244
|
-
E.set(
|
|
2245
|
-
const xt = j !== E[
|
|
2242
|
+
let { target: E, ex: P, ey: N, skewingSide: D } = A, L = 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 = L[k], R = 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) + R, at = Ce(Math.atan(it));
|
|
2244
|
+
E.set(k, at);
|
|
2245
|
+
const xt = j !== E[k];
|
|
2246
2246
|
if (xt && S === "y") {
|
|
2247
2247
|
const { skewX: gt, scaleX: et } = E, Pt = E._getTransformedDimensions({ skewY: j }), fe = E._getTransformedDimensions(), ht = gt !== 0 ? Pt.x / fe.x : 1;
|
|
2248
2248
|
ht !== 1 && E.set(Ht, ht * et);
|
|
@@ -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
|
|
3110
|
-
0 <
|
|
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),
|
|
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), L = g ** 2, k = p ** 2, O = D ** 2, j = N ** 2, M = L * k - L * O - k * j;
|
|
3136
3136
|
let R = Math.abs(g), G = Math.abs(p);
|
|
3137
|
-
if (
|
|
3138
|
-
const ge = Math.sqrt(1 -
|
|
3137
|
+
if (M < 0) {
|
|
3138
|
+
const ge = Math.sqrt(1 - M / (L * k));
|
|
3139
3139
|
R *= ge, G *= ge;
|
|
3140
|
-
} else S = (b === m ? -1 : 1) * Math.sqrt(
|
|
3141
|
-
const it = S * R * D / G, at = -S * G * N / R, xt =
|
|
3140
|
+
} else S = (b === m ? -1 : 1) * Math.sqrt(M / (L * O + k * j));
|
|
3141
|
+
const it = S * R * D / G, at = -S * G * N / R, 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) / R, (D - at) / G), Pt = ha((N - it) / R, (D - at) / G, (-N - it) / R, (-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,
|
|
3146
|
+
for (let ge = 0; ge < fe; ge++) ht[ge] = Cu(et, ms, P, E, R, 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),
|
|
4935
|
-
for (let L = 0,
|
|
4936
|
-
const
|
|
4934
|
+
let E = this.getHeightOfChar(l, 0), P = this.getValueOfPropertyAt(l, 0, "deltaY");
|
|
4935
|
+
for (let L = 0, k = d.length; L < k; L++) {
|
|
4936
|
+
const O = this.__charBounds[l][L];
|
|
4937
4937
|
_ = this.getValueOfPropertyAt(l, L, e), S = this.getValueOfPropertyAt(l, L, vt), A = this.getValueOfPropertyAt(l, L, hs);
|
|
4938
|
-
const j = this.getHeightOfChar(l, L),
|
|
4938
|
+
const j = this.getHeightOfChar(l, L), M = this.getValueOfPropertyAt(l, L, "deltaY");
|
|
4939
4939
|
if (n && _ && S) {
|
|
4940
4940
|
const R = this.fontSize * A / 1e3;
|
|
4941
|
-
t.save(), t.fillStyle = v, t.translate(
|
|
4942
|
-
} else if ((_ !== m || S !== v || j !== E || A !== y ||
|
|
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 * R, O.kernedWidth, R), t.restore();
|
|
4942
|
+
} else if ((_ !== m || S !== v || j !== E || A !== y || M !== P) && b > 0) {
|
|
4943
4943
|
const R = 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 +
|
|
4946
|
-
} else b +=
|
|
4945
|
+
this.direction === "rtl" && (G = this.width - G - b), m && v && y && (t.fillStyle = v, t.fillRect(G, T + h * E + P - o * R, b, R)), 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 +
|
|
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,33 +6389,33 @@ 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
|
|
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
|
|
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
|
|
6402
|
+
const P = v.ownerDocument.createElementNS(_r, "g");
|
|
6403
6403
|
Object.entries(_).forEach(((N) => {
|
|
6404
6404
|
let [D, L] = N;
|
|
6405
|
-
return
|
|
6406
|
-
})),
|
|
6405
|
+
return P.setAttributeNS(_r, D, L);
|
|
6406
|
+
})), P.append(...v.childNodes), v = P;
|
|
6407
6407
|
}
|
|
6408
|
-
for (const
|
|
6409
|
-
if (!
|
|
6410
|
-
const { name: N, value: D } =
|
|
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 L = {};
|
|
6413
|
-
Sr(D, L), Object.entries(_).forEach(((
|
|
6414
|
-
let [j,
|
|
6415
|
-
L[j] =
|
|
6413
|
+
Sr(D, L), Object.entries(_).forEach(((O) => {
|
|
6414
|
+
let [j, M] = O;
|
|
6415
|
+
L[j] = M;
|
|
6416
6416
|
})), Sr(_.style || "", L);
|
|
6417
|
-
const
|
|
6418
|
-
v.setAttribute(N,
|
|
6417
|
+
const k = Object.entries(L).map(((O) => O.join(":"))).join(";");
|
|
6418
|
+
v.setAttribute(N, k);
|
|
6419
6419
|
} else !_[N] && v.setAttribute(N, D);
|
|
6420
6420
|
}
|
|
6421
6421
|
v.setAttribute("transform", E), v.setAttribute("instantiated_by_use", "1"), v.removeAttribute("id"), f.parentNode.replaceChild(v, f);
|
|
@@ -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,
|
|
7460
|
+
let S, A, T, E, P, N, D, L, 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),
|
|
7463
|
-
|
|
7464
|
-
for (let
|
|
7462
|
+
for (m.y = (S + 0.5) * u, v.y = Math.floor(m.y), P = 0, N = 0, D = 0, L = 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], L += T * r[E + 2], k += T * r[E + 3]));
|
|
7465
7465
|
}
|
|
7466
|
-
E = 4 * (S * i + _), h[E] = N /
|
|
7466
|
+
E = 4 * (S * i + _), h[E] = N / P, h[E + 1] = D / P, h[E + 2] = L / 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),
|
|
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,
|
|
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
|
|
7484
|
+
const P = Math.abs(T - (E + 0.5)) / l, N = (g + 0.5) * r, D = P * P;
|
|
7485
7485
|
for (let L = Math.floor(g * r); L < (g + 1) * r; L++) {
|
|
7486
|
-
let
|
|
7487
|
-
const
|
|
7488
|
-
|
|
7486
|
+
let k = Math.abs(N - (L + 0.5)) / h;
|
|
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 * (L + 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;
|
|
@@ -10560,38 +10560,38 @@ class z {
|
|
|
10560
10560
|
return Math.round(t * 1e4) / 1e4;
|
|
10561
10561
|
}
|
|
10562
10562
|
#C(t, e) {
|
|
10563
|
-
const [s, i] = this.parentDimensions, n = this.x, r = this.y, o = this.width, h = this.height, l = z.MIN_SIZE / s, c = z.MIN_SIZE / i, u = this.#k(this.rotation), d = (
|
|
10563
|
+
const [s, i] = this.parentDimensions, n = this.x, r = this.y, o = this.width, h = this.height, l = z.MIN_SIZE / s, c = z.MIN_SIZE / i, u = this.#k(this.rotation), d = (M, R) => [u[0] * M + u[2] * R, u[1] * M + u[3] * R], f = this.#k(360 - this.rotation), g = (M, R) => [f[0] * M + f[2] * R, f[1] * M + f[3] * R];
|
|
10564
10564
|
let p, b, m = !1, v = !1;
|
|
10565
10565
|
switch (t) {
|
|
10566
10566
|
case "topLeft":
|
|
10567
|
-
m = !0, p = (
|
|
10567
|
+
m = !0, p = (M, R) => [0, 0], b = (M, R) => [M, R];
|
|
10568
10568
|
break;
|
|
10569
10569
|
case "topMiddle":
|
|
10570
|
-
p = (
|
|
10570
|
+
p = (M, R) => [M / 2, 0], b = (M, R) => [M / 2, R];
|
|
10571
10571
|
break;
|
|
10572
10572
|
case "topRight":
|
|
10573
|
-
m = !0, p = (
|
|
10573
|
+
m = !0, p = (M, R) => [M, 0], b = (M, R) => [0, R];
|
|
10574
10574
|
break;
|
|
10575
10575
|
case "middleRight":
|
|
10576
|
-
v = !0, p = (
|
|
10576
|
+
v = !0, p = (M, R) => [M, R / 2], b = (M, R) => [0, R / 2];
|
|
10577
10577
|
break;
|
|
10578
10578
|
case "bottomRight":
|
|
10579
|
-
m = !0, p = (
|
|
10579
|
+
m = !0, p = (M, R) => [M, R], b = (M, R) => [0, 0];
|
|
10580
10580
|
break;
|
|
10581
10581
|
case "bottomMiddle":
|
|
10582
|
-
p = (
|
|
10582
|
+
p = (M, R) => [M / 2, R], b = (M, R) => [M / 2, 0];
|
|
10583
10583
|
break;
|
|
10584
10584
|
case "bottomLeft":
|
|
10585
|
-
m = !0, p = (
|
|
10585
|
+
m = !0, p = (M, R) => [0, R], b = (M, R) => [M, 0];
|
|
10586
10586
|
break;
|
|
10587
10587
|
case "middleLeft":
|
|
10588
|
-
v = !0, p = (
|
|
10588
|
+
v = !0, p = (M, R) => [0, R / 2], b = (M, R) => [M, R / 2];
|
|
10589
10589
|
break;
|
|
10590
10590
|
}
|
|
10591
10591
|
const y = p(o, h), _ = b(o, h);
|
|
10592
10592
|
let S = d(..._);
|
|
10593
10593
|
const A = z._round(n + S[0]), T = z._round(r + S[1]);
|
|
10594
|
-
let E = 1,
|
|
10594
|
+
let E = 1, P = 1, N, D;
|
|
10595
10595
|
if (e.fromKeyboard)
|
|
10596
10596
|
({
|
|
10597
10597
|
deltaX: N,
|
|
@@ -10599,19 +10599,19 @@ class z {
|
|
|
10599
10599
|
} = e);
|
|
10600
10600
|
else {
|
|
10601
10601
|
const {
|
|
10602
|
-
screenX:
|
|
10602
|
+
screenX: M,
|
|
10603
10603
|
screenY: R
|
|
10604
10604
|
} = e, [G, it] = this.#c;
|
|
10605
|
-
[N, D] = this.screenToPageTranslation(
|
|
10605
|
+
[N, D] = this.screenToPageTranslation(M - G, R - it), this.#c[0] = M, this.#c[1] = R;
|
|
10606
10606
|
}
|
|
10607
10607
|
if ([N, D] = g(N / s, D / i), m) {
|
|
10608
|
-
const
|
|
10609
|
-
E =
|
|
10610
|
-
} else v ? E = Math.max(l, Math.min(1, Math.abs(_[0] - y[0] - N))) / o :
|
|
10611
|
-
const L = z._round(o * E),
|
|
10612
|
-
S = d(...b(L,
|
|
10613
|
-
const
|
|
10614
|
-
this.#o ||= [this.x, this.y, this.width, this.height], this.width = L, this.height =
|
|
10608
|
+
const M = Math.hypot(o, h);
|
|
10609
|
+
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);
|
|
10610
|
+
} 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;
|
|
10611
|
+
const L = z._round(o * E), k = z._round(h * P);
|
|
10612
|
+
S = d(...b(L, k));
|
|
10613
|
+
const O = A - S[0], j = T - S[1];
|
|
10614
|
+
this.#o ||= [this.x, this.y, this.width, this.height], this.width = L, this.height = k, this.x = O, this.y = j, this.setDims(s * L, i * k), this.fixAndSetPosition(), this._onResizing();
|
|
10615
10615
|
}
|
|
10616
10616
|
_onResizing() {
|
|
10617
10617
|
}
|
|
@@ -11370,8 +11370,8 @@ class Qd {
|
|
|
11370
11370
|
return _.charCodeAt(S) << 24 | _.charCodeAt(S + 1) << 16 | _.charCodeAt(S + 2) << 8 | _.charCodeAt(S + 3) & 255;
|
|
11371
11371
|
}
|
|
11372
11372
|
function i(_, S, A, T) {
|
|
11373
|
-
const E = _.substring(0, S),
|
|
11374
|
-
return E + T +
|
|
11373
|
+
const E = _.substring(0, S), P = _.substring(S + A);
|
|
11374
|
+
return E + T + P;
|
|
11375
11375
|
}
|
|
11376
11376
|
let n, r;
|
|
11377
11377
|
const o = this._document.createElement("canvas");
|
|
@@ -12003,14 +12003,14 @@ class sf extends pl {
|
|
|
12003
12003
|
const g = (m, v, y) => {
|
|
12004
12004
|
const _ = new Array(256), S = (u - c) / y, A = m / 255, T = (v - m) / (255 * y);
|
|
12005
12005
|
let E = 0;
|
|
12006
|
-
for (let
|
|
12007
|
-
const N = Math.round(c +
|
|
12006
|
+
for (let P = 0; P <= y; P++) {
|
|
12007
|
+
const N = Math.round(c + P * S), D = A + P * T;
|
|
12008
12008
|
for (let L = E; L <= N; L++)
|
|
12009
12009
|
_[L] = D;
|
|
12010
12010
|
E = N + 1;
|
|
12011
12011
|
}
|
|
12012
|
-
for (let
|
|
12013
|
-
_[
|
|
12012
|
+
for (let P = E; P < 256; P++)
|
|
12013
|
+
_[P] = _[E - 1];
|
|
12014
12014
|
return _.join(",");
|
|
12015
12015
|
}, p = `g_${this.#i}_hcm_${t}_filter`, b = o.filter = this.#g(p);
|
|
12016
12016
|
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;
|
|
@@ -12142,22 +12142,22 @@ function fr(a, t, e, s, i, n, r, o) {
|
|
|
12142
12142
|
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;
|
|
12143
12143
|
if (g >= v)
|
|
12144
12144
|
return;
|
|
12145
|
-
const y = l[n], _ = l[n + 1], S = l[n + 2], A = l[r], T = l[r + 1], E = l[r + 2],
|
|
12146
|
-
let
|
|
12147
|
-
for (let gt = L; gt <=
|
|
12145
|
+
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], L = Math.round(g), k = Math.round(v);
|
|
12146
|
+
let O, j, M, R, G, it, at, xt;
|
|
12147
|
+
for (let gt = L; gt <= k; gt++) {
|
|
12148
12148
|
if (gt < b) {
|
|
12149
12149
|
const K = gt < g ? 0 : (g - gt) / (g - b);
|
|
12150
|
-
|
|
12150
|
+
O = f - (f - p) * K, j = y - (y - A) * K, M = _ - (_ - T) * K, R = S - (S - E) * K;
|
|
12151
12151
|
} else {
|
|
12152
12152
|
let K;
|
|
12153
|
-
gt > v ? K = 1 : b === v ? K = 0 : K = (b - gt) / (b - v),
|
|
12153
|
+
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, R = E - (E - D) * K;
|
|
12154
12154
|
}
|
|
12155
12155
|
let et;
|
|
12156
|
-
gt < g ? et = 0 : gt > v ? et = 1 : et = (g - gt) / (g - v), G = f - (f - m) * et, it = y - (y -
|
|
12157
|
-
const Pt = Math.round(Math.min(
|
|
12156
|
+
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;
|
|
12157
|
+
const Pt = Math.round(Math.min(O, G)), fe = Math.round(Math.max(O, G));
|
|
12158
12158
|
let ht = u * gt + Pt * 4;
|
|
12159
12159
|
for (let K = Pt; K <= fe; K++)
|
|
12160
|
-
et = (
|
|
12160
|
+
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++] = R - (R - xt) * et | 0, c[ht++] = 255;
|
|
12161
12161
|
}
|
|
12162
12162
|
}
|
|
12163
12163
|
function lf(a, t, e) {
|
|
@@ -12262,11 +12262,11 @@ class yo {
|
|
|
12262
12262
|
h = Math.abs(h), l = Math.abs(l), In("TilingType: " + n);
|
|
12263
12263
|
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];
|
|
12264
12264
|
let _ = g, S = p, A = !1, T = !1;
|
|
12265
|
-
const E = Math.ceil(h * v),
|
|
12266
|
-
E >= N ? _ = h : A = !0,
|
|
12267
|
-
const L = this.getSizeAndScale(_, this.ctx.canvas.width, v),
|
|
12268
|
-
if (
|
|
12269
|
-
const R =
|
|
12265
|
+
const E = Math.ceil(h * v), P = Math.ceil(l * y), N = Math.ceil(g * v), D = Math.ceil(p * y);
|
|
12266
|
+
E >= N ? _ = h : A = !0, P >= D ? S = l : T = !0;
|
|
12267
|
+
const L = this.getSizeAndScale(_, this.ctx.canvas.width, v), k = this.getSizeAndScale(S, this.ctx.canvas.height, y), O = t.cachedCanvases.getCanvas("pattern", L.size, k.size), j = O.context, M = o.createCanvasGraphics(j);
|
|
12268
|
+
if (M.groupLevel = t.groupLevel, this.setFillAndStrokeStyleToContext(M, i, r), j.translate(-L.scale * c, -k.scale * u), M.transform(L.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) {
|
|
12269
|
+
const R = O.canvas;
|
|
12270
12270
|
A && (_ = h), T && (S = l);
|
|
12271
12271
|
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;
|
|
12272
12272
|
for (let ht = 0; ht <= Pt; ht++)
|
|
@@ -12281,9 +12281,9 @@ class yo {
|
|
|
12281
12281
|
};
|
|
12282
12282
|
}
|
|
12283
12283
|
return {
|
|
12284
|
-
canvas:
|
|
12284
|
+
canvas: O.canvas,
|
|
12285
12285
|
scaleX: L.scale,
|
|
12286
|
-
scaleY:
|
|
12286
|
+
scaleY: k.scale,
|
|
12287
12287
|
offsetX: c,
|
|
12288
12288
|
offsetY: u
|
|
12289
12289
|
};
|
|
@@ -12412,12 +12412,12 @@ class mf {
|
|
|
12412
12412
|
function Ui(a, t, e, s, i, n, r, o, h, l) {
|
|
12413
12413
|
const [c, u, d, f, g, p] = rt(a);
|
|
12414
12414
|
if (u === 0 && d === 0) {
|
|
12415
|
-
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,
|
|
12416
|
-
return a.setTransform(Math.sign(c), 0, 0, Math.sign(f), y, S), a.drawImage(t, e, s, i, n, 0, 0, T,
|
|
12415
|
+
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;
|
|
12416
|
+
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];
|
|
12417
12417
|
}
|
|
12418
12418
|
if (c === 0 && f === 0) {
|
|
12419
|
-
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,
|
|
12420
|
-
return a.setTransform(0, Math.sign(u), Math.sign(d), 0, y, S), a.drawImage(t, e, s, i, n, 0, 0,
|
|
12419
|
+
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;
|
|
12420
|
+
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];
|
|
12421
12421
|
}
|
|
12422
12422
|
a.drawImage(t, e, s, i, n, r, o, h, l);
|
|
12423
12423
|
const b = Math.hypot(c, u), m = Math.hypot(d, f);
|
|
@@ -12542,9 +12542,9 @@ function Pa(a, t) {
|
|
|
12542
12542
|
for (g = d < n ? Vt : i, l = 0, f = 0; f < g; f++) {
|
|
12543
12543
|
const A = b - h;
|
|
12544
12544
|
let T = 0;
|
|
12545
|
-
const E = A > y ? s : A * 8 - 7,
|
|
12545
|
+
const E = A > y ? s : A * 8 - 7, P = E & -8;
|
|
12546
12546
|
let N = 0, D = 0;
|
|
12547
|
-
for (; T <
|
|
12547
|
+
for (; T < P; T += 8)
|
|
12548
12548
|
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;
|
|
12549
12549
|
for (; T < E; T++)
|
|
12550
12550
|
N === 0 && (D = c[h++], N = 128), m[l++] = D & N ? _ : S, N >>= 1;
|
|
@@ -12709,16 +12709,16 @@ class Es {
|
|
|
12709
12709
|
if ((t.bitmap || t.data) && t.count > 1) {
|
|
12710
12710
|
const E = t.bitmap || t.data.buffer;
|
|
12711
12711
|
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));
|
|
12712
|
-
const
|
|
12713
|
-
if (
|
|
12712
|
+
const P = h.get(l);
|
|
12713
|
+
if (P && !r) {
|
|
12714
12714
|
const N = Math.round(Math.min(o[0], o[2]) + o[4]), D = Math.round(Math.min(o[1], o[3]) + o[5]);
|
|
12715
12715
|
return {
|
|
12716
|
-
canvas:
|
|
12716
|
+
canvas: P,
|
|
12717
12717
|
offsetX: N,
|
|
12718
12718
|
offsetY: D
|
|
12719
12719
|
};
|
|
12720
12720
|
}
|
|
12721
|
-
c =
|
|
12721
|
+
c = P;
|
|
12722
12722
|
}
|
|
12723
12723
|
c || (u = this.cachedCanvases.getCanvas("maskCanvas", s, i), Oa(u.context, t));
|
|
12724
12724
|
let d = B.transform(o, [1 / s, 0, 0, -1 / i, 0, 0]);
|
|
@@ -13066,8 +13066,8 @@ class Es {
|
|
|
13066
13066
|
if (r !== 1 && (n.scale(r, r), y /= r), n.lineWidth = y, s.isInvalidPDFjsFont) {
|
|
13067
13067
|
const T = [];
|
|
13068
13068
|
let E = 0;
|
|
13069
|
-
for (const
|
|
13070
|
-
T.push(
|
|
13069
|
+
for (const P of t)
|
|
13070
|
+
T.push(P.unicode), E += P.width;
|
|
13071
13071
|
n.fillText(T.join(""), 0, 0), e.x += E * p * c, n.restore(), this.compose();
|
|
13072
13072
|
return;
|
|
13073
13073
|
}
|
|
@@ -13079,29 +13079,29 @@ class Es {
|
|
|
13079
13079
|
continue;
|
|
13080
13080
|
}
|
|
13081
13081
|
let E = !1;
|
|
13082
|
-
const
|
|
13083
|
-
let L,
|
|
13082
|
+
const P = (T.isSpace ? h : 0) + o, N = T.fontChar, D = T.accent;
|
|
13083
|
+
let L, k, O = T.width;
|
|
13084
13084
|
if (d) {
|
|
13085
|
-
const
|
|
13086
|
-
|
|
13085
|
+
const M = T.vmetric || g, R = -(T.vmetric ? M[1] : O * 0.5) * p, G = M[2] * p;
|
|
13086
|
+
O = M ? -M[0] : O, L = R / r, k = (S + G) / r;
|
|
13087
13087
|
} else
|
|
13088
|
-
L = S / r,
|
|
13089
|
-
if (s.remeasure &&
|
|
13090
|
-
const
|
|
13091
|
-
if (
|
|
13092
|
-
const R =
|
|
13088
|
+
L = S / r, k = 0;
|
|
13089
|
+
if (s.remeasure && O > 0) {
|
|
13090
|
+
const M = n.measureText(N).width * 1e3 / i * r;
|
|
13091
|
+
if (O < M && this.isFontSubpixelAAEnabled) {
|
|
13092
|
+
const R = O / M;
|
|
13093
13093
|
E = !0, n.save(), n.scale(R, 1), L /= R;
|
|
13094
|
-
} else
|
|
13094
|
+
} else O !== M && (L += (O - M) / 2e3 * i / r);
|
|
13095
13095
|
}
|
|
13096
13096
|
if (this.contentVisible && (T.isInFont || s.missingFile)) {
|
|
13097
13097
|
if (b && !D)
|
|
13098
|
-
n.fillText(N, L,
|
|
13099
|
-
else if (this.paintChar(N, L,
|
|
13100
|
-
const
|
|
13101
|
-
this.paintChar(D.fontChar,
|
|
13098
|
+
n.fillText(N, L, k);
|
|
13099
|
+
else if (this.paintChar(N, L, k, m, v), D) {
|
|
13100
|
+
const M = L + i * D.offset.x / r, R = k - i * D.offset.y / r;
|
|
13101
|
+
this.paintChar(D.fontChar, M, R, m, v);
|
|
13102
13102
|
}
|
|
13103
13103
|
}
|
|
13104
|
-
const j = d ?
|
|
13104
|
+
const j = d ? O * p - P * l : O * p + P * l;
|
|
13105
13105
|
S += j, E && n.restore();
|
|
13106
13106
|
}
|
|
13107
13107
|
d ? e.y -= S : e.x += S * c, n.restore(), this.compose();
|
|
@@ -14877,10 +14877,10 @@ function qf(a = {}) {
|
|
|
14877
14877
|
docId: e
|
|
14878
14878
|
} = t, s = a.url ? Kf(a.url) : null, i = a.data ? Jf(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 : Gf;
|
|
14879
14879
|
let c = a.worker instanceof ks ? a.worker : null;
|
|
14880
|
-
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 || Uf, b = typeof a.standardFontDataUrl == "string" ? a.standardFontDataUrl : null, m = a.StandardFontDataFactory || $f, 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,
|
|
14880
|
+
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 || Uf, b = typeof a.standardFontDataUrl == "string" ? a.standardFontDataUrl : null, m = a.StandardFontDataFactory || $f, 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, L = a.disableRange === !0, k = a.disableStream === !0, O = a.disableAutoFetch === !0, j = a.pdfBug === !0, M = a.CanvasFactory || Wf, R = a.FilterFactory || Yf, 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;
|
|
14881
14881
|
Rd(u);
|
|
14882
14882
|
const et = {
|
|
14883
|
-
canvasFactory: new
|
|
14883
|
+
canvasFactory: new M({
|
|
14884
14884
|
ownerDocument: D,
|
|
14885
14885
|
enableHWA: G
|
|
14886
14886
|
}),
|
|
@@ -14908,7 +14908,7 @@ function qf(a = {}) {
|
|
|
14908
14908
|
apiVersion: "4.10.38",
|
|
14909
14909
|
data: i,
|
|
14910
14910
|
password: o,
|
|
14911
|
-
disableAutoFetch:
|
|
14911
|
+
disableAutoFetch: O,
|
|
14912
14912
|
rangeChunkSize: l,
|
|
14913
14913
|
length: it,
|
|
14914
14914
|
docBaseUrl: d,
|
|
@@ -14921,19 +14921,19 @@ function qf(a = {}) {
|
|
|
14921
14921
|
isOffscreenCanvasSupported: S,
|
|
14922
14922
|
isImageDecoderSupported: A,
|
|
14923
14923
|
canvasMaxAreaInBytes: T,
|
|
14924
|
-
fontExtraProperties:
|
|
14924
|
+
fontExtraProperties: P,
|
|
14925
14925
|
useSystemFonts: at,
|
|
14926
14926
|
cMapUrl: xt ? f : null,
|
|
14927
14927
|
standardFontDataUrl: xt ? b : null
|
|
14928
14928
|
}
|
|
14929
14929
|
}, fe = {
|
|
14930
14930
|
disableFontFace: E,
|
|
14931
|
-
fontExtraProperties:
|
|
14931
|
+
fontExtraProperties: P,
|
|
14932
14932
|
ownerDocument: D,
|
|
14933
14933
|
pdfBug: j,
|
|
14934
14934
|
styleElement: gt,
|
|
14935
14935
|
loadingParams: {
|
|
14936
|
-
disableAutoFetch:
|
|
14936
|
+
disableAutoFetch: O,
|
|
14937
14937
|
enableXfa: N
|
|
14938
14938
|
}
|
|
14939
14939
|
};
|
|
@@ -14947,7 +14947,7 @@ function qf(a = {}) {
|
|
|
14947
14947
|
if (h)
|
|
14948
14948
|
K = new Cf(h, {
|
|
14949
14949
|
disableRange: L,
|
|
14950
|
-
disableStream:
|
|
14950
|
+
disableStream: k
|
|
14951
14951
|
});
|
|
14952
14952
|
else if (!i) {
|
|
14953
14953
|
if (!s)
|
|
@@ -14969,7 +14969,7 @@ function qf(a = {}) {
|
|
|
14969
14969
|
withCredentials: r,
|
|
14970
14970
|
rangeChunkSize: l,
|
|
14971
14971
|
disableRange: L,
|
|
14972
|
-
disableStream:
|
|
14972
|
+
disableStream: k
|
|
14973
14973
|
});
|
|
14974
14974
|
}
|
|
14975
14975
|
return ht.then((je) => {
|
|
@@ -16783,8 +16783,8 @@ class ft {
|
|
|
16783
16783
|
const f = c.createElement("clipPath"), g = `clippath_${this.data.id}`;
|
|
16784
16784
|
f.setAttribute("id", g), f.setAttribute("clipPathUnits", "objectBoundingBox"), d.append(f);
|
|
16785
16785
|
for (let p = 2, b = t.length; p < b; p += 8) {
|
|
16786
|
-
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,
|
|
16787
|
-
S.setAttribute("x", A), S.setAttribute("y", T), S.setAttribute("width", E), S.setAttribute("height",
|
|
16786
|
+
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;
|
|
16787
|
+
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}"/>`);
|
|
16788
16788
|
}
|
|
16789
16789
|
this.#e && (o.push("</g></svg>')"), r.backgroundImage = o.join("")), this.container.append(u), this.container.style.clipPath = `url(#${g})`;
|
|
16790
16790
|
}
|
|
@@ -18924,8 +18924,8 @@ class Ir {
|
|
|
18924
18924
|
width: v,
|
|
18925
18925
|
height: y
|
|
18926
18926
|
} of t) {
|
|
18927
|
-
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],
|
|
18928
|
-
this.#s.push(E,
|
|
18927
|
+
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];
|
|
18928
|
+
this.#s.push(E, P), n = Math.min(n, _), r = Math.max(r, S), o = Math.min(o, A), h = Math.max(h, T);
|
|
18929
18929
|
}
|
|
18930
18930
|
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]];
|
|
18931
18931
|
for (const b of this.#s) {
|
|
@@ -20543,8 +20543,8 @@ class Vn extends I {
|
|
|
20543
20543
|
let [_, S, A, T] = m.subarray(0, 4);
|
|
20544
20544
|
y.set([NaN, NaN, NaN, NaN, _, S], 0);
|
|
20545
20545
|
for (let E = 4; E < v; E += 2) {
|
|
20546
|
-
const
|
|
20547
|
-
y.set(I.createBezierPoints(_, S, A, T,
|
|
20546
|
+
const P = m[E], N = m[E + 1];
|
|
20547
|
+
y.set(I.createBezierPoints(_, S, A, T, P, N), (E - 2) * 3), [_, S, A, T] = [A, T, P, N];
|
|
20548
20548
|
}
|
|
20549
20549
|
}
|
|
20550
20550
|
}
|
|
@@ -22157,87 +22157,87 @@ function Qg(a) {
|
|
|
22157
22157
|
let h = null, l = null, c = 1, u = { ...Zl };
|
|
22158
22158
|
function d() {
|
|
22159
22159
|
if (!t || Ft.has(t)) return;
|
|
22160
|
-
const
|
|
22161
|
-
return
|
|
22162
|
-
if (r?.(
|
|
22163
|
-
const j =
|
|
22160
|
+
const k = Ng(t);
|
|
22161
|
+
return k.on("selection:created", (O) => {
|
|
22162
|
+
if (r?.(O), O.selected.length <= 1) return;
|
|
22163
|
+
const j = k.getActiveObject();
|
|
22164
22164
|
j && (l = j, e?.value && l.set(e.value), l._cornerSize = l.cornerSize, S(c));
|
|
22165
|
-
}),
|
|
22166
|
-
o?.(
|
|
22167
|
-
}), s &&
|
|
22165
|
+
}), k.on("selection:cleared", (O) => {
|
|
22166
|
+
o?.(O), T(k);
|
|
22167
|
+
}), s && k.on("mouse:down", s), i && k.on("mouse:move", i), n && k.on("mouse:up", n), k;
|
|
22168
22168
|
}
|
|
22169
|
-
function f(
|
|
22170
|
-
return $g(
|
|
22169
|
+
function f(k, O) {
|
|
22170
|
+
return $g(k, O, t);
|
|
22171
22171
|
}
|
|
22172
|
-
function g(
|
|
22173
|
-
return jl(
|
|
22172
|
+
function g(k) {
|
|
22173
|
+
return jl(k, t);
|
|
22174
22174
|
}
|
|
22175
|
-
function p({ data:
|
|
22176
|
-
return Il(t, { data:
|
|
22175
|
+
function p({ data: k, scale: O = 0.5 }) {
|
|
22176
|
+
return Il(t, { data: k, scale: O });
|
|
22177
22177
|
}
|
|
22178
|
-
async function b(
|
|
22179
|
-
const
|
|
22180
|
-
if (!
|
|
22181
|
-
const R = await Tt.fromURL(
|
|
22182
|
-
jr(R, j),
|
|
22178
|
+
async function b(k, O, j) {
|
|
22179
|
+
const M = Ft.get(t);
|
|
22180
|
+
if (!M) return;
|
|
22181
|
+
const R = await Tt.fromURL(k, {}, { ...ql, ...O });
|
|
22182
|
+
jr(R, j), M.add(R), v(M, R), M.setActiveObject(R);
|
|
22183
22183
|
}
|
|
22184
|
-
function m(
|
|
22185
|
-
const
|
|
22186
|
-
if (!
|
|
22187
|
-
const R = new Ct(
|
|
22184
|
+
function m(k, O, j) {
|
|
22185
|
+
const M = Ft.get(t);
|
|
22186
|
+
if (!M) return;
|
|
22187
|
+
const R = new Ct(k, {
|
|
22188
22188
|
...Kl,
|
|
22189
|
-
...
|
|
22189
|
+
...O
|
|
22190
22190
|
});
|
|
22191
|
-
jr(R, j),
|
|
22191
|
+
jr(R, j), M.add(R), v(M, R), M.setActiveObject(R);
|
|
22192
22192
|
}
|
|
22193
|
-
function v(
|
|
22194
|
-
|
|
22193
|
+
function v(k, O) {
|
|
22194
|
+
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;
|
|
22195
22195
|
}
|
|
22196
22196
|
async function y({
|
|
22197
|
-
canvas:
|
|
22198
|
-
target:
|
|
22197
|
+
canvas: k,
|
|
22198
|
+
target: O,
|
|
22199
22199
|
stroke: j = u.stroke,
|
|
22200
|
-
uuid:
|
|
22200
|
+
uuid: M = Date.now()
|
|
22201
22201
|
}) {
|
|
22202
|
-
if (
|
|
22203
|
-
const G = await Bg(u,
|
|
22204
|
-
T(
|
|
22202
|
+
if (k.getActiveObjects().length > 1 || h?.stroke === `${j}-${M}`) return;
|
|
22203
|
+
const G = await Bg(u, M, j);
|
|
22204
|
+
T(k), h = G, l = O, _(k, O, M), S(c, !0), G && k.add(G);
|
|
22205
22205
|
}
|
|
22206
|
-
function _(
|
|
22206
|
+
function _(k, O, j) {
|
|
22207
22207
|
h && (h.on("selected", () => {
|
|
22208
|
-
|
|
22208
|
+
k.remove(O), T(k);
|
|
22209
22209
|
}), h.on("mouseover", () => {
|
|
22210
22210
|
y({
|
|
22211
|
-
canvas:
|
|
22212
|
-
target:
|
|
22211
|
+
canvas: k,
|
|
22212
|
+
target: O,
|
|
22213
22213
|
stroke: u.hoverStroke,
|
|
22214
22214
|
uuid: j
|
|
22215
22215
|
});
|
|
22216
22216
|
}), h.on("mouseout", () => {
|
|
22217
|
-
y({ canvas:
|
|
22217
|
+
y({ canvas: k, target: O, stroke: u.stroke, uuid: j });
|
|
22218
22218
|
}));
|
|
22219
22219
|
}
|
|
22220
|
-
function S(
|
|
22220
|
+
function S(k, O = !1) {
|
|
22221
22221
|
const j = Ft.get(t);
|
|
22222
|
-
c =
|
|
22222
|
+
c = k, j && (Xg(l, k), Vg(l, k, h), !O && j.renderAll());
|
|
22223
22223
|
}
|
|
22224
|
-
function A(
|
|
22225
|
-
if (!
|
|
22226
|
-
u = { ...u, ...
|
|
22227
|
-
const
|
|
22228
|
-
!h || !l || !
|
|
22224
|
+
function A(k) {
|
|
22225
|
+
if (!k) return;
|
|
22226
|
+
u = { ...u, ...k };
|
|
22227
|
+
const O = Ft.get(t);
|
|
22228
|
+
!h || !l || !O || y({ target: l, canvas: O });
|
|
22229
22229
|
}
|
|
22230
|
-
function T(
|
|
22231
|
-
l = null, h && (
|
|
22230
|
+
function T(k) {
|
|
22231
|
+
l = null, h && (k.remove(h), h = null);
|
|
22232
22232
|
}
|
|
22233
22233
|
function E() {
|
|
22234
22234
|
Wg(t);
|
|
22235
22235
|
}
|
|
22236
|
-
function
|
|
22236
|
+
function P() {
|
|
22237
22237
|
Ug(t);
|
|
22238
22238
|
}
|
|
22239
|
-
function N(
|
|
22240
|
-
Kg(t,
|
|
22239
|
+
function N(k) {
|
|
22240
|
+
Kg(t, k);
|
|
22241
22241
|
}
|
|
22242
22242
|
function D() {
|
|
22243
22243
|
return Jg(t, v);
|
|
@@ -22253,7 +22253,7 @@ function Qg(a) {
|
|
|
22253
22253
|
addFabric: b,
|
|
22254
22254
|
addTextFabric: m,
|
|
22255
22255
|
clearActive: E,
|
|
22256
|
-
deleteCanvas:
|
|
22256
|
+
deleteCanvas: P,
|
|
22257
22257
|
scaleFabric: S,
|
|
22258
22258
|
setCloseSvgOptions: A,
|
|
22259
22259
|
setActiveFabric: N,
|
|
@@ -22317,31 +22317,31 @@ const ip = /* @__PURE__ */ Hl({
|
|
|
22317
22317
|
});
|
|
22318
22318
|
A(), tp(N);
|
|
22319
22319
|
async function A() {
|
|
22320
|
-
const { file: D, page: L, fileScale:
|
|
22320
|
+
const { file: D, page: L, fileScale: k } = s;
|
|
22321
22321
|
globalThis.requestAnimationFrame(async () => {
|
|
22322
|
-
if (await Gl(), c(), D.data?.type.startsWith("image/")
|
|
22323
|
-
const
|
|
22324
|
-
|
|
22322
|
+
if (await Gl(), c(), D.data?.type.startsWith("image/")) {
|
|
22323
|
+
const j = D.data;
|
|
22324
|
+
j && g({ data: j, scale: k / 3 }), i("loaded");
|
|
22325
22325
|
return;
|
|
22326
22326
|
}
|
|
22327
22327
|
D.data && await u({
|
|
22328
22328
|
page: L,
|
|
22329
22329
|
data: D.data,
|
|
22330
|
-
scale:
|
|
22330
|
+
scale: k,
|
|
22331
22331
|
password: s.password
|
|
22332
22332
|
}), i("loaded");
|
|
22333
22333
|
});
|
|
22334
22334
|
}
|
|
22335
22335
|
function T(D) {
|
|
22336
22336
|
if (!s.isDrop || !D.dataTransfer) return;
|
|
22337
|
-
const { dataTransfer: L, offsetX:
|
|
22338
|
-
|
|
22337
|
+
const { dataTransfer: L, offsetX: k, offsetY: O } = D, j = L.getData("text/plain"), M = L.getData("text/uri-list"), R = L.getData("custom/offset"), G = R ? JSON.parse(R) : null, it = { top: O, left: k }, at = { x: G?.offsetX ?? 0, y: G?.offsetY ?? 0 };
|
|
22338
|
+
M ? E(M, it, at) : j && P(j, it, at);
|
|
22339
22339
|
}
|
|
22340
|
-
function E(D, L,
|
|
22341
|
-
d(D, { ...s.dropImageOptions, ...L },
|
|
22340
|
+
function E(D, L, k) {
|
|
22341
|
+
d(D, { ...s.dropImageOptions, ...L }, k);
|
|
22342
22342
|
}
|
|
22343
|
-
function
|
|
22344
|
-
f(D, { ...s.dropTextOptions, ...L },
|
|
22343
|
+
function P(D, L, k) {
|
|
22344
|
+
f(D, { ...s.dropTextOptions, ...L }, k);
|
|
22345
22345
|
}
|
|
22346
22346
|
function N() {
|
|
22347
22347
|
s.manualReload || A(), i("reload");
|
|
@@ -22349,7 +22349,7 @@ const ip = /* @__PURE__ */ Hl({
|
|
|
22349
22349
|
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({
|
|
22350
22350
|
reload: A,
|
|
22351
22351
|
addImage: E,
|
|
22352
|
-
addText:
|
|
22352
|
+
addText: P,
|
|
22353
22353
|
clearActive: p,
|
|
22354
22354
|
deleteCanvas: b,
|
|
22355
22355
|
setActiveFabric: v,
|