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

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.
@@ -11,10 +11,10 @@ var Io = (a, t, e, s) => ({
11
11
  return oe(a, t, s);
12
12
  }
13
13
  });
14
- import Zl, { useRef as ws, useEffect as Js, forwardRef as Ql, useMemo as No, useImperativeHandle as tc } from "react";
14
+ import Ql, { useRef as ws, useEffect as Js, forwardRef as tc, useMemo as No, useImperativeHandle as ec } from "react";
15
15
  var Ai = { exports: {} }, Vs = {};
16
16
  var jo;
17
- function ec() {
17
+ function sc() {
18
18
  if (jo) return Vs;
19
19
  jo = 1;
20
20
  var a = Symbol.for("react.transitional.element"), t = Symbol.for("react.fragment");
@@ -37,7 +37,7 @@ function ec() {
37
37
  }
38
38
  var Ws = {};
39
39
  var Bo;
40
- function sc() {
40
+ function ic() {
41
41
  return Bo || (Bo = 1, process.env.NODE_ENV !== "production" && (function() {
42
42
  function a(E) {
43
43
  if (E == null) return null;
@@ -69,14 +69,14 @@ function sc() {
69
69
  case y:
70
70
  return (E._context.displayName || "Context") + ".Consumer";
71
71
  case S:
72
- var H = E.render;
73
- return E = E.displayName, E || (E = H.displayName || H.name || "", E = E !== "" ? "ForwardRef(" + E + ")" : "ForwardRef"), E;
72
+ var z = E.render;
73
+ return E = E.displayName, E || (E = z.displayName || z.name || "", E = E !== "" ? "ForwardRef(" + E + ")" : "ForwardRef"), E;
74
74
  case k:
75
- return H = E.displayName || null, H !== null ? H : a(E.type) || "Memo";
75
+ return z = E.displayName || null, z !== null ? z : a(E.type) || "Memo";
76
76
  case P:
77
- H = E._payload, E = E._init;
77
+ z = E._payload, E = E._init;
78
78
  try {
79
- return a(E(H));
79
+ return a(E(z));
80
80
  } catch {
81
81
  }
82
82
  }
@@ -88,15 +88,15 @@ function sc() {
88
88
  function e(E) {
89
89
  try {
90
90
  t(E);
91
- var H = !1;
91
+ var z = !1;
92
92
  } catch {
93
- H = !0;
93
+ z = !0;
94
94
  }
95
- if (H) {
96
- H = console;
97
- var V = H.error, J = typeof Symbol == "function" && Symbol.toStringTag && E[Symbol.toStringTag] || E.constructor.name || "Object";
95
+ if (z) {
96
+ z = console;
97
+ var V = z.error, J = typeof Symbol == "function" && Symbol.toStringTag && E[Symbol.toStringTag] || E.constructor.name || "Object";
98
98
  return V.call(
99
- H,
99
+ z,
100
100
  "The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
101
101
  J
102
102
  ), t(E);
@@ -107,8 +107,8 @@ function sc() {
107
107
  if (typeof E == "object" && E !== null && E.$$typeof === P)
108
108
  return "<...>";
109
109
  try {
110
- var H = a(E);
111
- return H ? "<" + H + ">" : "<...>";
110
+ var z = a(E);
111
+ return z ? "<" + z + ">" : "<...>";
112
112
  } catch {
113
113
  return "<...>";
114
114
  }
@@ -122,16 +122,16 @@ function sc() {
122
122
  }
123
123
  function r(E) {
124
124
  if (O.call(E, "key")) {
125
- var H = Object.getOwnPropertyDescriptor(E, "key").get;
126
- if (H && H.isReactWarning) return !1;
125
+ var z = Object.getOwnPropertyDescriptor(E, "key").get;
126
+ if (z && z.isReactWarning) return !1;
127
127
  }
128
128
  return E.key !== void 0;
129
129
  }
130
- function o(E, H) {
130
+ function o(E, z) {
131
131
  function V() {
132
132
  M || (M = !0, console.error(
133
133
  "%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",
134
- H
134
+ z
135
135
  ));
136
136
  }
137
137
  V.isReactWarning = !0, Object.defineProperty(E, "key", {
@@ -145,12 +145,12 @@ function sc() {
145
145
  "Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."
146
146
  )), E = this.props.ref, E !== void 0 ? E : null;
147
147
  }
148
- function l(E, H, V, J, At, st) {
148
+ function l(E, z, V, J, At, st) {
149
149
  var B = V.ref;
150
150
  return E = {
151
151
  $$typeof: g,
152
152
  type: E,
153
- key: H,
153
+ key: z,
154
154
  props: V,
155
155
  _owner: J
156
156
  }, (B !== void 0 ? B : null) !== null ? Object.defineProperty(E, "ref", {
@@ -178,8 +178,8 @@ function sc() {
178
178
  value: st
179
179
  }), Object.freeze && (Object.freeze(E.props), Object.freeze(E)), E;
180
180
  }
181
- function c(E, H, V, J, At, st) {
182
- var B = H.children;
181
+ function c(E, z, V, J, At, st) {
182
+ var B = z.children;
183
183
  if (B !== void 0)
184
184
  if (J)
185
185
  if (D(B)) {
@@ -191,12 +191,12 @@ function sc() {
191
191
  "React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."
192
192
  );
193
193
  else u(B);
194
- if (O.call(H, "key")) {
194
+ if (O.call(z, "key")) {
195
195
  B = a(E);
196
- var at = Object.keys(H).filter(function(Wt) {
196
+ var ut = Object.keys(z).filter(function(Wt) {
197
197
  return Wt !== "key";
198
198
  });
199
- J = 0 < at.length ? "{key: someKey, " + at.join(": ..., ") + ": ...}" : "{key: someKey}", lt[B + J] || (at = 0 < at.length ? "{" + at.join(": ..., ") + ": ...}" : "{}", console.error(
199
+ J = 0 < ut.length ? "{key: someKey, " + ut.join(": ..., ") + ": ...}" : "{key: someKey}", ht[B + J] || (ut = 0 < ut.length ? "{" + ut.join(": ..., ") + ": ...}" : "{}", console.error(
200
200
  `A props object containing a "key" prop is being spread into JSX:
201
201
  let props = %s;
202
202
  <%s {...props} />
@@ -205,15 +205,15 @@ React keys must be passed directly to JSX without using spread:
205
205
  <%s key={someKey} {...props} />`,
206
206
  J,
207
207
  B,
208
- at,
208
+ ut,
209
209
  B
210
- ), lt[B + J] = !0);
210
+ ), ht[B + J] = !0);
211
211
  }
212
- if (B = null, V !== void 0 && (e(V), B = "" + V), r(H) && (e(H.key), B = "" + H.key), "key" in H) {
212
+ if (B = null, V !== void 0 && (e(V), B = "" + V), r(z) && (e(z.key), B = "" + z.key), "key" in z) {
213
213
  V = {};
214
- for (var Tt in H)
215
- Tt !== "key" && (V[Tt] = H[Tt]);
216
- } else V = H;
214
+ for (var Tt in z)
215
+ Tt !== "key" && (V[Tt] = z[Tt]);
216
+ } else V = z;
217
217
  return B && o(
218
218
  V,
219
219
  typeof E == "function" ? E.displayName || E.name || "Unknown" : E
@@ -232,7 +232,7 @@ React keys must be passed directly to JSX without using spread:
232
232
  function d(E) {
233
233
  return typeof E == "object" && E !== null && E.$$typeof === g;
234
234
  }
235
- var f = Zl, g = Symbol.for("react.transitional.element"), p = Symbol.for("react.portal"), b = Symbol.for("react.fragment"), m = Symbol.for("react.strict_mode"), v = Symbol.for("react.profiler"), y = Symbol.for("react.consumer"), _ = Symbol.for("react.context"), S = Symbol.for("react.forward_ref"), A = Symbol.for("react.suspense"), T = Symbol.for("react.suspense_list"), k = Symbol.for("react.memo"), P = Symbol.for("react.lazy"), N = Symbol.for("react.activity"), F = Symbol.for("react.client.reference"), I = f.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, O = Object.prototype.hasOwnProperty, D = Array.isArray, z = console.createTask ? console.createTask : function() {
235
+ var f = Ql, g = Symbol.for("react.transitional.element"), p = Symbol.for("react.portal"), b = Symbol.for("react.fragment"), m = Symbol.for("react.strict_mode"), v = Symbol.for("react.profiler"), y = Symbol.for("react.consumer"), _ = Symbol.for("react.context"), S = Symbol.for("react.forward_ref"), A = Symbol.for("react.suspense"), T = Symbol.for("react.suspense_list"), k = Symbol.for("react.memo"), P = Symbol.for("react.lazy"), N = Symbol.for("react.activity"), F = Symbol.for("react.client.reference"), I = f.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, O = Object.prototype.hasOwnProperty, D = Array.isArray, H = console.createTask ? console.createTask : function() {
236
236
  return null;
237
237
  };
238
238
  f = {
@@ -243,36 +243,36 @@ React keys must be passed directly to JSX without using spread:
243
243
  var M, R = {}, W = f.react_stack_bottom_frame.bind(
244
244
  f,
245
245
  n
246
- )(), ot = z(s(n)), lt = {};
247
- Ws.Fragment = b, Ws.jsx = function(E, H, V) {
246
+ )(), ot = H(s(n)), ht = {};
247
+ Ws.Fragment = b, Ws.jsx = function(E, z, V) {
248
248
  var J = 1e4 > I.recentlyCreatedOwnerStacks++;
249
249
  return c(
250
250
  E,
251
- H,
251
+ z,
252
252
  V,
253
253
  !1,
254
254
  J ? Error("react-stack-top-frame") : W,
255
- J ? z(s(E)) : ot
255
+ J ? H(s(E)) : ot
256
256
  );
257
- }, Ws.jsxs = function(E, H, V) {
257
+ }, Ws.jsxs = function(E, z, V) {
258
258
  var J = 1e4 > I.recentlyCreatedOwnerStacks++;
259
259
  return c(
260
260
  E,
261
- H,
261
+ z,
262
262
  V,
263
263
  !0,
264
264
  J ? Error("react-stack-top-frame") : W,
265
- J ? z(s(E)) : ot
265
+ J ? H(s(E)) : ot
266
266
  );
267
267
  };
268
268
  })()), Ws;
269
269
  }
270
270
  var Ho;
271
- function ic() {
272
- return Ho || (Ho = 1, process.env.NODE_ENV === "production" ? Ai.exports = ec() : Ai.exports = sc()), Ai.exports;
271
+ function nc() {
272
+ return Ho || (Ho = 1, process.env.NODE_ENV === "production" ? Ai.exports = sc() : Ai.exports = ic()), Ai.exports;
273
273
  }
274
- var zo = ic();
275
- const nc = "data:image/svg+xml,%3csvg%20width='24'%20height='24'%20viewBox='0%200%2040%2040'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3ccircle%20cx='20'%20cy='20'%20r='10.75'%20stroke='currentColor'%20stroke-width='2.5'/%3e%3cpath%20d='M16%2024L23.7782%2016.2218'%20stroke='currentColor'%20stroke-width='2.5'%20stroke-linecap='round'/%3e%3cpath%20d='M24%2024L16.2218%2016.2218'%20stroke='currentColor'%20stroke-width='2.5'%20stroke-linecap='round'/%3e%3c/svg%3e", rc = {
274
+ var zo = nc();
275
+ const rc = "data:image/svg+xml,%3csvg%20width='24'%20height='24'%20viewBox='0%200%2040%2040'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3ccircle%20cx='20'%20cy='20'%20r='10.75'%20stroke='currentColor'%20stroke-width='2.5'/%3e%3cpath%20d='M16%2024L23.7782%2016.2218'%20stroke='currentColor'%20stroke-width='2.5'%20stroke-linecap='round'/%3e%3cpath%20d='M24%2024L16.2218%2016.2218'%20stroke='currentColor'%20stroke-width='2.5'%20stroke-linecap='round'/%3e%3c/svg%3e", oc = {
276
276
  top: 100,
277
277
  left: 50,
278
278
  scaleX: 0.5,
@@ -281,7 +281,7 @@ const nc = "data:image/svg+xml,%3csvg%20width='24'%20height='24'%20viewBox='0%20
281
281
  cornerStrokeColor: "black",
282
282
  cornerSize: 6,
283
283
  selectionBackgroundColor: "rgba(245, 245, 245, 0.8)"
284
- }, oc = {
284
+ }, ac = {
285
285
  top: 100,
286
286
  left: 50,
287
287
  fontFamily: "helvetica",
@@ -291,16 +291,16 @@ const nc = "data:image/svg+xml,%3csvg%20width='24'%20height='24'%20viewBox='0%20
291
291
  scaleY: 0.7,
292
292
  cornerSize: 6,
293
293
  selectionBackgroundColor: "rgba(245, 245, 245, 0.8)"
294
- }, ac = {
294
+ }, hc = {
295
295
  borderColor: "black",
296
296
  cornerStrokeColor: "black",
297
297
  cornerSize: 8,
298
298
  selectionBackgroundColor: "rgba(245, 245, 245, 0.8)"
299
- }, hc = {
299
+ }, lc = {
300
300
  stroke: "#000",
301
301
  hoverStroke: "#B7EC5D",
302
- src: nc
303
- }, lc = [
302
+ src: rc
303
+ }, cc = [
304
304
  "borderColor",
305
305
  "cornerStrokeColor",
306
306
  "cornerSize",
@@ -343,7 +343,7 @@ function w(a) {
343
343
  }
344
344
  return a;
345
345
  }
346
- function ht(a, t) {
346
+ function at(a, t) {
347
347
  if (a == null) return {};
348
348
  var e, s, i = (function(r, o) {
349
349
  if (r == null) return {};
@@ -406,9 +406,9 @@ class Gr extends xe {
406
406
  super("".concat(t, " 'options.signal' is in 'aborted' state"));
407
407
  }
408
408
  }
409
- class cc {
409
+ class uc {
410
410
  }
411
- class uc extends cc {
411
+ class dc extends uc {
412
412
  testPrecision(t, e) {
413
413
  const s = "precision ".concat(e, ` float;
414
414
  void main(){}`), i = t.createShader(t.FRAGMENT_SHADER);
@@ -422,10 +422,10 @@ void main(){}`), i = t.createShader(t.FRAGMENT_SHADER);
422
422
  return !!this.maxTextureSize && this.maxTextureSize >= t;
423
423
  }
424
424
  }
425
- const dc = {};
425
+ const fc = {};
426
426
  let Wo;
427
- const Ce = () => Wo || (Wo = { document, window, isTouchSupported: "ontouchstart" in window || "ontouchstart" in document || window && window.navigator && window.navigator.maxTouchPoints > 0, WebGLProbe: new uc(), dispose() {
428
- }, copyPasteData: dc }), Is = () => Ce().document, mi = () => Ce().window, Qa = () => {
427
+ const Ce = () => Wo || (Wo = { document, window, isTouchSupported: "ontouchstart" in window || "ontouchstart" in document || window && window.navigator && window.navigator.maxTouchPoints > 0, WebGLProbe: new dc(), dispose() {
428
+ }, copyPasteData: fc }), Is = () => Ce().document, mi = () => Ce().window, Qa = () => {
429
429
  var a;
430
430
  return Math.max((a = tt.devicePixelRatio) !== null && a !== void 0 ? a : mi().devicePixelRatio, 1);
431
431
  }, si = new class {
@@ -450,7 +450,7 @@ const Ce = () => Wo || (Wo = { document, window, isTouchSupported: "ontouchstart
450
450
  }(), yr = "6.9.0";
451
451
  function os() {
452
452
  }
453
- const We = Math.PI / 2, Ne = 2 * Math.PI, Vr = Math.PI / 180, Gt = Object.freeze([1, 0, 0, 1, 0, 0]), Wr = 16, He = 0.4477152502, $ = "center", et = "left", qt = "top", _r = "bottom", pt = "right", Bt = "none", Xr = /\r?\n/, th = "moving", Tn = "scaling", eh = "rotating", Ur = "rotate", sh = "skewing", ci = "resizing", fc = "modifyPoly", gc = "modifyPath", an = "changed", En = "scale", Vt = "scaleX", te = "scaleY", Ns = "skewX", js = "skewY", wt = "fill", Ht = "stroke", hn = "modified", vs = "json", Kn = "svg", L = new class {
453
+ const We = Math.PI / 2, Ne = 2 * Math.PI, Vr = Math.PI / 180, Gt = Object.freeze([1, 0, 0, 1, 0, 0]), Wr = 16, He = 0.4477152502, $ = "center", et = "left", qt = "top", _r = "bottom", pt = "right", Bt = "none", Xr = /\r?\n/, th = "moving", Tn = "scaling", eh = "rotating", Ur = "rotate", sh = "skewing", ci = "resizing", gc = "modifyPoly", pc = "modifyPath", an = "changed", En = "scale", Vt = "scaleX", te = "scaleY", Ns = "skewX", js = "skewY", wt = "fill", Ht = "stroke", hn = "modified", vs = "json", Kn = "svg", L = new class {
454
454
  constructor() {
455
455
  this[vs] = /* @__PURE__ */ new Map(), this[Kn] = /* @__PURE__ */ new Map();
456
456
  }
@@ -494,7 +494,7 @@ const We = Math.PI / 2, Ne = 2 * Math.PI, Vr = Math.PI / 180, Gt = Object.freeze
494
494
  return t.forEach(((e) => e.abort())), t;
495
495
  }
496
496
  }();
497
- class pc {
497
+ class mc {
498
498
  constructor() {
499
499
  x(this, "__eventListeners", {});
500
500
  }
@@ -795,7 +795,7 @@ function ih(a) {
795
795
  }
796
796
  return t;
797
797
  }
798
- class nh extends pc {
798
+ class nh extends mc {
799
799
  _setOptions() {
800
800
  let t = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
801
801
  for (const e in t) this.set(e, t[e]);
@@ -823,8 +823,8 @@ function ii(a) {
823
823
  function rh(a) {
824
824
  return mi().cancelAnimationFrame(a);
825
825
  }
826
- let mc = 0;
827
- const Xe = () => mc++, Ae = () => {
826
+ let bc = 0;
827
+ const Xe = () => bc++, Ae = () => {
828
828
  const a = Is().createElement("canvas");
829
829
  if (!a || a.getContext === void 0) throw new xe("Failed to create `canvas` element");
830
830
  return a;
@@ -973,7 +973,7 @@ class gh {
973
973
  Ce().dispose(this.lower.el), delete this.lower;
974
974
  }
975
975
  }
976
- const bc = { backgroundVpt: !0, backgroundColor: "", overlayVpt: !0, overlayColor: "", includeDefaultValues: !0, svgViewportTransformation: !0, renderOnAddRemove: !0, skipOffscreen: !0, enableRetinaScaling: !0, imageSmoothingEnabled: !0, controlsAboveOverlay: !1, allowTouchScrolling: !1, viewportTransform: [...Gt] }, vc = ["objects"];
976
+ const vc = { backgroundVpt: !0, backgroundColor: "", overlayVpt: !0, overlayColor: "", includeDefaultValues: !0, svgViewportTransformation: !0, renderOnAddRemove: !0, skipOffscreen: !0, enableRetinaScaling: !0, imageSmoothingEnabled: !0, controlsAboveOverlay: !1, allowTouchScrolling: !1, viewportTransform: [...Gt] }, yc = ["objects"];
977
977
  class yi extends ih(nh) {
978
978
  get lowerCanvasEl() {
979
979
  var t;
@@ -1279,7 +1279,7 @@ Resulting to default behavior: removing object from previous canvas and adding t
1279
1279
  loadFromJSON(t, e) {
1280
1280
  let { signal: s } = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
1281
1281
  if (!t) return Promise.reject(new xe("`json` is undefined"));
1282
- const i = typeof t == "string" ? JSON.parse(t) : t, { objects: n = [] } = i, r = ht(i, vc), { backgroundImage: o, background: h, overlayImage: l, overlay: c, clipPath: u } = r, d = this.renderOnAddRemove;
1282
+ const i = typeof t == "string" ? JSON.parse(t) : t, { objects: n = [] } = i, r = at(i, yc), { backgroundImage: o, background: h, overlayImage: l, overlay: c, clipPath: u } = r, d = this.renderOnAddRemove;
1283
1283
  return this.renderOnAddRemove = !1, Promise.all([Ds(n, { reviver: e, signal: s }), vi({ backgroundImage: o, backgroundColor: h, overlayImage: l, overlayColor: c, clipPath: u }, { signal: s })]).then(((f) => {
1284
1284
  let [g, p] = f;
1285
1285
  return this.clear(), this.add(...g), this.set(r), this.set(p), this.renderOnAddRemove = d, this;
@@ -1323,14 +1323,14 @@ Resulting to default behavior: removing object from previous canvas and adding t
1323
1323
  return "#<Canvas (".concat(this.complexity(), "): { objects: ").concat(this._objects.length, " }>");
1324
1324
  }
1325
1325
  }
1326
- x(yi, "ownDefaults", bc);
1327
- const yc = ["touchstart", "touchmove", "touchend"], ph = (a) => {
1326
+ x(yi, "ownDefaults", vc);
1327
+ const _c = ["touchstart", "touchmove", "touchend"], ph = (a) => {
1328
1328
  const t = uh(a.target), e = (function(s) {
1329
1329
  const i = s.changedTouches;
1330
1330
  return i && i[0] ? i[0] : s;
1331
1331
  })(a);
1332
1332
  return new C(e.clientX + t.left, e.clientY + t.top);
1333
- }, cn = (a) => yc.includes(a.type) || a.pointerType === "touch", $o = (a) => {
1333
+ }, cn = (a) => _c.includes(a.type) || a.pointerType === "touch", $o = (a) => {
1334
1334
  a.preventDefault(), a.stopPropagation();
1335
1335
  }, Se = (a) => {
1336
1336
  let t = 0, e = 0, s = 0, i = 0;
@@ -1339,8 +1339,8 @@ const yc = ["touchstart", "touchmove", "touchend"], ph = (a) => {
1339
1339
  (o > s || !n) && (s = o), (o < t || !n) && (t = o), (h > i || !n) && (i = h), (h < e || !n) && (e = h);
1340
1340
  }
1341
1341
  return { left: t, top: e, width: s - t, height: i - e };
1342
- }, _c = ["translateX", "translateY", "scaleX", "scaleY"], mh = (a, t) => Ls(a, mt(t, a.calcOwnMatrix())), Ls = (a, t) => {
1343
- const e = hs(t), { translateX: s, translateY: i, scaleX: n, scaleY: r } = e, o = ht(e, _c), h = new C(s, i);
1342
+ }, wc = ["translateX", "translateY", "scaleX", "scaleY"], mh = (a, t) => Ls(a, mt(t, a.calcOwnMatrix())), Ls = (a, t) => {
1343
+ const e = hs(t), { translateX: s, translateY: i, scaleX: n, scaleY: r } = e, o = at(e, wc), h = new C(s, i);
1344
1344
  a.flipX = !1, a.flipY = !1, Object.assign(a, o), a.set({ scaleX: n, scaleY: r }), a.setPositionByOrigin(h, $, $);
1345
1345
  }, bh = (a) => {
1346
1346
  a.scaleX = 1, a.scaleY = 1, a.skewX = 0, a.skewY = 0, a.flipX = !1, a.flipY = !1, a.rotate(0);
@@ -1363,7 +1363,7 @@ const yc = ["touchstart", "touchmove", "touchend"], ph = (a) => {
1363
1363
  var e;
1364
1364
  const { transform: { target: s } } = t;
1365
1365
  (e = s.canvas) === null || e === void 0 || e.fire("object:".concat(a), w(w({}, t), {}, { target: s })), s.fire(a, t);
1366
- }, wc = { left: -0.5, top: -0.5, center: 0, bottom: 0.5, right: 0.5 }, yt = (a) => typeof a == "string" ? wc[a] : a - 0.5, un = "not-allowed";
1366
+ }, xc = { left: -0.5, top: -0.5, center: 0, bottom: 0.5, right: 0.5 }, yt = (a) => typeof a == "string" ? xc[a] : a - 0.5, un = "not-allowed";
1367
1367
  function _h(a) {
1368
1368
  return yt(a.originX) === yt($) && yt(a.originY) === yt($);
1369
1369
  }
@@ -1384,7 +1384,7 @@ function to(a, t, e, s, i) {
1384
1384
  })(r, new C(s, i), t, e);
1385
1385
  return u.x >= c && (u.x -= c), u.x <= -c && (u.x += c), u.y >= c && (u.y -= c), u.y <= c && (u.y += c), u.x -= h.offsetX, u.y -= h.offsetY, u;
1386
1386
  }
1387
- const xc = (a, t, e, s) => {
1387
+ const Sc = (a, t, e, s) => {
1388
1388
  const { target: i, offsetX: n, offsetY: r } = t, o = e - n, h = s - r, l = !fe(i, "lockMovementX") && i.left !== o, c = !fe(i, "lockMovementY") && i.top !== h;
1389
1389
  return l && i.set(et, o), c && i.set(qt, h), (l || c) && yh(th, wh(a, t, e, s)), l || c;
1390
1390
  }, dn = (a) => a.replace(/\s+/g, " "), Ko = { aliceblue: "#F0F8FF", antiquewhite: "#FAEBD7", aqua: "#0FF", aquamarine: "#7FFFD4", azure: "#F0FFFF", beige: "#F5F5DC", bisque: "#FFE4C4", black: "#000", blanchedalmond: "#FFEBCD", blue: "#00F", blueviolet: "#8A2BE2", brown: "#A52A2A", burlywood: "#DEB887", cadetblue: "#5F9EA0", chartreuse: "#7FFF00", chocolate: "#D2691E", coral: "#FF7F50", cornflowerblue: "#6495ED", cornsilk: "#FFF8DC", crimson: "#DC143C", cyan: "#0FF", darkblue: "#00008B", darkcyan: "#008B8B", darkgoldenrod: "#B8860B", darkgray: "#A9A9A9", darkgrey: "#A9A9A9", darkgreen: "#006400", darkkhaki: "#BDB76B", darkmagenta: "#8B008B", darkolivegreen: "#556B2F", darkorange: "#FF8C00", darkorchid: "#9932CC", darkred: "#8B0000", darksalmon: "#E9967A", darkseagreen: "#8FBC8F", darkslateblue: "#483D8B", darkslategray: "#2F4F4F", darkslategrey: "#2F4F4F", darkturquoise: "#00CED1", darkviolet: "#9400D3", deeppink: "#FF1493", deepskyblue: "#00BFFF", dimgray: "#696969", dimgrey: "#696969", dodgerblue: "#1E90FF", firebrick: "#B22222", floralwhite: "#FFFAF0", forestgreen: "#228B22", fuchsia: "#F0F", gainsboro: "#DCDCDC", ghostwhite: "#F8F8FF", gold: "#FFD700", goldenrod: "#DAA520", gray: "#808080", grey: "#808080", green: "#008000", greenyellow: "#ADFF2F", honeydew: "#F0FFF0", hotpink: "#FF69B4", indianred: "#CD5C5C", indigo: "#4B0082", ivory: "#FFFFF0", khaki: "#F0E68C", lavender: "#E6E6FA", lavenderblush: "#FFF0F5", lawngreen: "#7CFC00", lemonchiffon: "#FFFACD", lightblue: "#ADD8E6", lightcoral: "#F08080", lightcyan: "#E0FFFF", lightgoldenrodyellow: "#FAFAD2", lightgray: "#D3D3D3", lightgrey: "#D3D3D3", lightgreen: "#90EE90", lightpink: "#FFB6C1", lightsalmon: "#FFA07A", lightseagreen: "#20B2AA", lightskyblue: "#87CEFA", lightslategray: "#789", lightslategrey: "#789", lightsteelblue: "#B0C4DE", lightyellow: "#FFFFE0", lime: "#0F0", limegreen: "#32CD32", linen: "#FAF0E6", magenta: "#F0F", maroon: "#800000", mediumaquamarine: "#66CDAA", mediumblue: "#0000CD", mediumorchid: "#BA55D3", mediumpurple: "#9370DB", mediumseagreen: "#3CB371", mediumslateblue: "#7B68EE", mediumspringgreen: "#00FA9A", mediumturquoise: "#48D1CC", mediumvioletred: "#C71585", midnightblue: "#191970", mintcream: "#F5FFFA", mistyrose: "#FFE4E1", moccasin: "#FFE4B5", navajowhite: "#FFDEAD", navy: "#000080", oldlace: "#FDF5E6", olive: "#808000", olivedrab: "#6B8E23", orange: "#FFA500", orangered: "#FF4500", orchid: "#DA70D6", palegoldenrod: "#EEE8AA", palegreen: "#98FB98", paleturquoise: "#AFEEEE", palevioletred: "#DB7093", papayawhip: "#FFEFD5", peachpuff: "#FFDAB9", peru: "#CD853F", pink: "#FFC0CB", plum: "#DDA0DD", powderblue: "#B0E0E6", purple: "#800080", rebeccapurple: "#639", red: "#F00", rosybrown: "#BC8F8F", royalblue: "#4169E1", saddlebrown: "#8B4513", salmon: "#FA8072", sandybrown: "#F4A460", seagreen: "#2E8B57", seashell: "#FFF5EE", sienna: "#A0522D", silver: "#C0C0C0", skyblue: "#87CEEB", slateblue: "#6A5ACD", slategray: "#708090", slategrey: "#708090", snow: "#FFFAFA", springgreen: "#00FF7F", steelblue: "#4682B4", tan: "#D2B48C", teal: "#008080", thistle: "#D8BFD8", tomato: "#FF6347", turquoise: "#40E0D0", violet: "#EE82EE", wheat: "#F5DEB3", white: "#FFF", whitesmoke: "#F5F5F5", yellow: "#FF0", yellowgreen: "#9ACD32" }, Jn = (a, t, e) => (e < 0 && (e += 1), e > 1 && (e -= 1), e < 1 / 6 ? a + 6 * (t - a) * e : e < 0.5 ? t : e < 2 / 3 ? a + (t - a) * (2 / 3 - e) * 6 : a), Jo = (a, t, e, s) => {
@@ -1609,9 +1609,9 @@ class Sh {
1609
1609
  function On(a) {
1610
1610
  return new RegExp("^(" + a.join("|") + ")\\b", "i");
1611
1611
  }
1612
- const ls = "textDecorationThickness", Ch = ["fontSize", "fontWeight", "fontFamily", "fontStyle"], Ah = ["underline", "overline", "linethrough"], Th = [...Ch, "lineHeight", "text", "charSpacing", "textAlign", "styles", "path", "pathStartOffset", "pathSide", "pathAlign"], Eh = [...Th, ...Ah, "textBackgroundColor", "direction", ls], Sc = [...Ch, ...Ah, Ht, "strokeWidth", wt, "deltaY", "textBackgroundColor", ls], Cc = { _reNewline: Xr, _reSpacesAndTabs: /[ \t\r]/g, _reSpaceAndTab: /[ \t\r]/, _reWords: /\S+/g, fontSize: 40, fontWeight: "normal", fontFamily: "Times New Roman", underline: !1, overline: !1, linethrough: !1, textAlign: et, fontStyle: "normal", lineHeight: 1.16, textBackgroundColor: "", stroke: null, shadow: null, path: void 0, pathStartOffset: 0, pathSide: et, pathAlign: "baseline", charSpacing: 0, deltaY: 0, direction: "ltr", CACHE_FONT_SIZE: 400, MIN_TEXT_WIDTH: 2, superscript: { size: 0.6, baseline: -0.35 }, subscript: { size: 0.6, baseline: 0.11 }, _fontSizeFraction: 0.222, offsets: { underline: 0.1, linethrough: -0.28167, overline: -0.81333 }, _fontSizeMult: 1.13, [ls]: 66.667 }, we = "justify", fn = "justify-left", ri = "justify-right", oi = "justify-center";
1612
+ const ls = "textDecorationThickness", Ch = ["fontSize", "fontWeight", "fontFamily", "fontStyle"], Ah = ["underline", "overline", "linethrough"], Th = [...Ch, "lineHeight", "text", "charSpacing", "textAlign", "styles", "path", "pathStartOffset", "pathSide", "pathAlign"], Eh = [...Th, ...Ah, "textBackgroundColor", "direction", ls], Cc = [...Ch, ...Ah, Ht, "strokeWidth", wt, "deltaY", "textBackgroundColor", ls], Ac = { _reNewline: Xr, _reSpacesAndTabs: /[ \t\r]/g, _reSpaceAndTab: /[ \t\r]/, _reWords: /\S+/g, fontSize: 40, fontWeight: "normal", fontFamily: "Times New Roman", underline: !1, overline: !1, linethrough: !1, textAlign: et, fontStyle: "normal", lineHeight: 1.16, textBackgroundColor: "", stroke: null, shadow: null, path: void 0, pathStartOffset: 0, pathSide: et, pathAlign: "baseline", charSpacing: 0, deltaY: 0, direction: "ltr", CACHE_FONT_SIZE: 400, MIN_TEXT_WIDTH: 2, superscript: { size: 0.6, baseline: -0.35 }, subscript: { size: 0.6, baseline: 0.11 }, _fontSizeFraction: 0.222, offsets: { underline: 0.1, linethrough: -0.28167, overline: -0.81333 }, _fontSizeMult: 1.13, [ls]: 66.667 }, we = "justify", fn = "justify-left", ri = "justify-right", oi = "justify-center";
1613
1613
  var ta, ea, sa;
1614
- const de = String.raw(ta || (ta = Ee(["[-+]?(?:d*.d+|d+.?)(?:[eE][-+]?d+)?"], ["[-+]?(?:\\d*\\.\\d+|\\d+\\.?)(?:[eE][-+]?\\d+)?"]))), Zn = String.raw(ea || (ea = Ee(["(?:s*,?s+|s*,s*)"], ["(?:\\s*,?\\s+|\\s*,\\s*)"]))), Sr = "http://www.w3.org/2000/svg", Ac = new RegExp("(normal|italic)?\\s*(normal|small-caps)?\\s*(normal|bold|bolder|lighter|100|200|300|400|500|600|700|800|900)?\\s*(" + de + "(?:px|cm|mm|em|pt|pc|in)*)(?:\\/(normal|" + de + "))?\\s+(.*)"), Tc = { cx: et, x: et, r: "radius", cy: qt, y: qt, display: "visible", visibility: "visible", transform: "transformMatrix", "fill-opacity": "fillOpacity", "fill-rule": "fillRule", "font-family": "fontFamily", "font-size": "fontSize", "font-style": "fontStyle", "font-weight": "fontWeight", "letter-spacing": "charSpacing", "paint-order": "paintFirst", "stroke-dasharray": "strokeDashArray", "stroke-dashoffset": "strokeDashOffset", "stroke-linecap": "strokeLineCap", "stroke-linejoin": "strokeLineJoin", "stroke-miterlimit": "strokeMiterLimit", "stroke-opacity": "strokeOpacity", "stroke-width": "strokeWidth", "text-decoration": "textDecoration", "text-anchor": "textAnchor", opacity: "opacity", "clip-path": "clipPath", "clip-rule": "clipRule", "vector-effect": "strokeUniform", "image-rendering": "imageSmoothing", "text-decoration-thickness": ls }, Qn = "font-size", tr = "clip-path", Ec = On(["path", "circle", "polygon", "polyline", "ellipse", "rect", "line", "image", "text"]), kc = On(["symbol", "image", "marker", "pattern", "view", "svg"]), ia = On(["symbol", "g", "a", "svg", "clipPath", "defs"]), na = new RegExp(String.raw(sa || (sa = Ee(["^s*(", ")", "(", ")", "(", ")", "(", ")s*$"], ["^\\s*(", ")", "(", ")", "(", ")", "(", ")\\s*$"])), de, Zn, de, Zn, de, Zn, de)), Mc = new C(1, 0), kh = new C(), so = (a, t) => a.rotate(t), gn = (a, t) => new C(t).subtract(a), pn = (a) => a.distanceFrom(kh), mn = (a, t) => Math.atan2(Ts(a, t), Ph(a, t)), Mh = (a) => mn(Mc, a), Dn = (a) => a.eq(kh) ? a : a.scalarDivide(pn(a)), io = function(a) {
1614
+ const de = String.raw(ta || (ta = Ee(["[-+]?(?:d*.d+|d+.?)(?:[eE][-+]?d+)?"], ["[-+]?(?:\\d*\\.\\d+|\\d+\\.?)(?:[eE][-+]?\\d+)?"]))), Zn = String.raw(ea || (ea = Ee(["(?:s*,?s+|s*,s*)"], ["(?:\\s*,?\\s+|\\s*,\\s*)"]))), Sr = "http://www.w3.org/2000/svg", Tc = new RegExp("(normal|italic)?\\s*(normal|small-caps)?\\s*(normal|bold|bolder|lighter|100|200|300|400|500|600|700|800|900)?\\s*(" + de + "(?:px|cm|mm|em|pt|pc|in)*)(?:\\/(normal|" + de + "))?\\s+(.*)"), Ec = { cx: et, x: et, r: "radius", cy: qt, y: qt, display: "visible", visibility: "visible", transform: "transformMatrix", "fill-opacity": "fillOpacity", "fill-rule": "fillRule", "font-family": "fontFamily", "font-size": "fontSize", "font-style": "fontStyle", "font-weight": "fontWeight", "letter-spacing": "charSpacing", "paint-order": "paintFirst", "stroke-dasharray": "strokeDashArray", "stroke-dashoffset": "strokeDashOffset", "stroke-linecap": "strokeLineCap", "stroke-linejoin": "strokeLineJoin", "stroke-miterlimit": "strokeMiterLimit", "stroke-opacity": "strokeOpacity", "stroke-width": "strokeWidth", "text-decoration": "textDecoration", "text-anchor": "textAnchor", opacity: "opacity", "clip-path": "clipPath", "clip-rule": "clipRule", "vector-effect": "strokeUniform", "image-rendering": "imageSmoothing", "text-decoration-thickness": ls }, Qn = "font-size", tr = "clip-path", kc = On(["path", "circle", "polygon", "polyline", "ellipse", "rect", "line", "image", "text"]), Mc = On(["symbol", "image", "marker", "pattern", "view", "svg"]), ia = On(["symbol", "g", "a", "svg", "clipPath", "defs"]), na = new RegExp(String.raw(sa || (sa = Ee(["^s*(", ")", "(", ")", "(", ")", "(", ")s*$"], ["^\\s*(", ")", "(", ")", "(", ")", "(", ")\\s*$"])), de, Zn, de, Zn, de, Zn, de)), Pc = new C(1, 0), kh = new C(), so = (a, t) => a.rotate(t), gn = (a, t) => new C(t).subtract(a), pn = (a) => a.distanceFrom(kh), mn = (a, t) => Math.atan2(Ts(a, t), Ph(a, t)), Mh = (a) => mn(Pc, a), Dn = (a) => a.eq(kh) ? a : a.scalarDivide(pn(a)), io = function(a) {
1615
1615
  let t = !(arguments.length > 1 && arguments[1] !== void 0) || arguments[1];
1616
1616
  return Dn(new C(-a.y, a.x).scalarMultiply(t ? 1 : -1));
1617
1617
  }, Ts = (a, t) => a.x * t.y - a.y * t.x, Ph = (a, t) => a.x * t.x + a.y * t.y, Cr = (a, t, e) => {
@@ -1655,8 +1655,8 @@ class Fe {
1655
1655
  }
1656
1656
  }
1657
1657
  x(Fe, "ownDefaults", { color: "rgb(0,0,0)", blur: 0, offsetX: 0, offsetY: 0, affectStroke: !1, includeDefaultValues: !0, nonScaling: !1 }), x(Fe, "type", "shadow"), L.setClass(Fe, "shadow");
1658
- const cs = (a, t, e) => Math.max(a, Math.min(t, e)), Pc = [qt, et, Vt, te, "flipX", "flipY", "originX", "originY", "angle", "opacity", "globalCompositeOperation", "shadow", "visible", Ns, js], je = [wt, Ht, "strokeWidth", "strokeDashArray", "width", "height", "paintFirst", "strokeUniform", "strokeLineCap", "strokeDashOffset", "strokeLineJoin", "strokeMiterLimit", "backgroundColor", "clipPath"], Oc = { top: 0, left: 0, width: 0, height: 0, angle: 0, flipX: !1, flipY: !1, scaleX: 1, scaleY: 1, minScaleLimit: 0, skewX: 0, skewY: 0, originX: et, originY: qt, strokeWidth: 1, strokeUniform: !1, padding: 0, opacity: 1, paintFirst: wt, fill: "rgb(0,0,0)", fillRule: "nonzero", stroke: null, strokeDashArray: null, strokeDashOffset: 0, strokeLineCap: "butt", strokeLineJoin: "miter", strokeMiterLimit: 4, globalCompositeOperation: "source-over", backgroundColor: "", shadow: null, visible: !0, includeDefaultValues: !0, excludeFromExport: !1, objectCaching: !0, clipPath: void 0, inverted: !1, absolutePositioned: !1, centeredRotation: !0, centeredScaling: !1, dirty: !0 }, er = (a, t, e, s) => (a < Math.abs(t) ? (a = t, s = e / 4) : s = t === 0 && a === 0 ? e / Ne * Math.asin(1) : e / Ne * Math.asin(t / a), { a, c: t, p: e, s }), aa = (a, t, e, s, i) => a * Math.pow(2, 10 * (s -= 1)) * Math.sin((s * i - t) * Ne / e), Oh = (a, t, e, s) => -e * Math.cos(a / s * We) + e + t, Ar = (a, t, e, s) => (a /= s) < 1 / 2.75 ? e * (7.5625 * a * a) + t : a < 2 / 2.75 ? e * (7.5625 * (a -= 1.5 / 2.75) * a + 0.75) + t : a < 2.5 / 2.75 ? e * (7.5625 * (a -= 2.25 / 2.75) * a + 0.9375) + t : e * (7.5625 * (a -= 2.625 / 2.75) * a + 0.984375) + t, ha = (a, t, e, s) => e - Ar(s - a, 0, e, s) + t;
1659
- var Dc = Object.freeze({ __proto__: null, defaultEasing: Oh, easeInBack: function(a, t, e, s) {
1658
+ const cs = (a, t, e) => Math.max(a, Math.min(t, e)), Oc = [qt, et, Vt, te, "flipX", "flipY", "originX", "originY", "angle", "opacity", "globalCompositeOperation", "shadow", "visible", Ns, js], je = [wt, Ht, "strokeWidth", "strokeDashArray", "width", "height", "paintFirst", "strokeUniform", "strokeLineCap", "strokeDashOffset", "strokeLineJoin", "strokeMiterLimit", "backgroundColor", "clipPath"], Dc = { top: 0, left: 0, width: 0, height: 0, angle: 0, flipX: !1, flipY: !1, scaleX: 1, scaleY: 1, minScaleLimit: 0, skewX: 0, skewY: 0, originX: et, originY: qt, strokeWidth: 1, strokeUniform: !1, padding: 0, opacity: 1, paintFirst: wt, fill: "rgb(0,0,0)", fillRule: "nonzero", stroke: null, strokeDashArray: null, strokeDashOffset: 0, strokeLineCap: "butt", strokeLineJoin: "miter", strokeMiterLimit: 4, globalCompositeOperation: "source-over", backgroundColor: "", shadow: null, visible: !0, includeDefaultValues: !0, excludeFromExport: !1, objectCaching: !0, clipPath: void 0, inverted: !1, absolutePositioned: !1, centeredRotation: !0, centeredScaling: !1, dirty: !0 }, er = (a, t, e, s) => (a < Math.abs(t) ? (a = t, s = e / 4) : s = t === 0 && a === 0 ? e / Ne * Math.asin(1) : e / Ne * Math.asin(t / a), { a, c: t, p: e, s }), aa = (a, t, e, s, i) => a * Math.pow(2, 10 * (s -= 1)) * Math.sin((s * i - t) * Ne / e), Oh = (a, t, e, s) => -e * Math.cos(a / s * We) + e + t, Ar = (a, t, e, s) => (a /= s) < 1 / 2.75 ? e * (7.5625 * a * a) + t : a < 2 / 2.75 ? e * (7.5625 * (a -= 1.5 / 2.75) * a + 0.75) + t : a < 2.5 / 2.75 ? e * (7.5625 * (a -= 2.25 / 2.75) * a + 0.9375) + t : e * (7.5625 * (a -= 2.625 / 2.75) * a + 0.984375) + t, ha = (a, t, e, s) => e - Ar(s - a, 0, e, s) + t;
1659
+ var Rc = Object.freeze({ __proto__: null, defaultEasing: Oh, easeInBack: function(a, t, e, s) {
1660
1660
  let i = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : 1.70158;
1661
1661
  return e * (a /= s) * a * ((i + 1) * a - i) + t;
1662
1662
  }, easeInBounce: ha, easeInCirc: (a, t, e, s) => -e * (Math.sqrt(1 - (a /= s) * a) - 1) + t, easeInCubic: (a, t, e, s) => e * (a / s) ** 3 + t, easeInElastic: (a, t, e, s) => {
@@ -1690,10 +1690,10 @@ var Dc = Object.freeze({ __proto__: null, defaultEasing: Oh, easeInBack: functio
1690
1690
  const { a: r, s: o, p: h, c: l } = er(i, e, n, 1.70158);
1691
1691
  return r * 2 ** (-10 * a) * Math.sin((a * s - o) * Ne / h) + l + t;
1692
1692
  }, easeOutExpo: (a, t, e, s) => a === s ? t + e : e * -(2 ** (-10 * a / s) + 1) + t, easeOutQuad: (a, t, e, s) => -e * (a /= s) * (a - 2) + t, easeOutQuart: (a, t, e, s) => -e * ((a = a / s - 1) * a ** 3 - 1) + t, easeOutQuint: (a, t, e, s) => e * ((a / s - 1) ** 5 + 1) + t, easeOutSine: (a, t, e, s) => e * Math.sin(a / s * We) + t });
1693
- const Rc = () => !1;
1693
+ const Lc = () => !1;
1694
1694
  class no {
1695
1695
  constructor(t) {
1696
- let { startValue: e, byValue: s, duration: i = 500, delay: n = 0, easing: r = Oh, onStart: o = os, onChange: h = os, onComplete: l = os, abort: c = Rc, target: u } = t;
1696
+ let { startValue: e, byValue: s, duration: i = 500, delay: n = 0, easing: r = Oh, onStart: o = os, onChange: h = os, onComplete: l = os, abort: c = Lc, target: u } = t;
1697
1697
  x(this, "_state", "pending"), x(this, "durationProgress", 0), x(this, "valueProgress", 0), this.tick = this.tick.bind(this), this.duration = i, this.delay = n, this.easing = r, this._onStart = o, this._onChange = h, this._onComplete = l, this._abort = c, this.target = u, this.startValue = e, this.byValue = s, this.value = this.startValue, this.endValue = Object.freeze(this.calculate(this.duration).value);
1698
1698
  }
1699
1699
  get state() {
@@ -1724,32 +1724,32 @@ class no {
1724
1724
  this._state = "aborted", this.unregister();
1725
1725
  }
1726
1726
  }
1727
- const Lc = ["startValue", "endValue"];
1728
- class Fc extends no {
1727
+ const Fc = ["startValue", "endValue"];
1728
+ class Ic extends no {
1729
1729
  constructor(t) {
1730
1730
  let { startValue: e = 0, endValue: s = 100 } = t;
1731
- super(w(w({}, ht(t, Lc)), {}, { startValue: e, byValue: s - e }));
1731
+ super(w(w({}, at(t, Fc)), {}, { startValue: e, byValue: s - e }));
1732
1732
  }
1733
1733
  calculate(t) {
1734
1734
  const e = this.easing(t, this.startValue, this.byValue, this.duration);
1735
1735
  return { value: e, valueProgress: Math.abs((e - this.startValue) / this.byValue) };
1736
1736
  }
1737
1737
  }
1738
- const Ic = ["startValue", "endValue"];
1739
- class Nc extends no {
1738
+ const Nc = ["startValue", "endValue"];
1739
+ class jc extends no {
1740
1740
  constructor(t) {
1741
1741
  let { startValue: e = [0], endValue: s = [100] } = t;
1742
- super(w(w({}, ht(t, Ic)), {}, { startValue: e, byValue: s.map(((i, n) => i - e[n])) }));
1742
+ super(w(w({}, at(t, Nc)), {}, { startValue: e, byValue: s.map(((i, n) => i - e[n])) }));
1743
1743
  }
1744
1744
  calculate(t) {
1745
1745
  const e = this.startValue.map(((s, i) => this.easing(t, s, this.byValue[i], this.duration, i)));
1746
1746
  return { value: e, valueProgress: Math.abs((e[0] - this.startValue[0]) / this.byValue[0]) };
1747
1747
  }
1748
1748
  }
1749
- const jc = ["startValue", "endValue", "easing", "onChange", "onComplete", "abort"], Bc = (a, t, e, s) => t + e * (1 - Math.cos(a / s * We)), sr = (a) => a && ((t, e, s) => a(new it(t).toRgba(), e, s));
1750
- class Hc extends no {
1749
+ const Bc = ["startValue", "endValue", "easing", "onChange", "onComplete", "abort"], Hc = (a, t, e, s) => t + e * (1 - Math.cos(a / s * We)), sr = (a) => a && ((t, e, s) => a(new it(t).toRgba(), e, s));
1750
+ class zc extends no {
1751
1751
  constructor(t) {
1752
- let { startValue: e, endValue: s, easing: i = Bc, onChange: n, onComplete: r, abort: o } = t, h = ht(t, jc);
1752
+ let { startValue: e, endValue: s, easing: i = Hc, onChange: n, onComplete: r, abort: o } = t, h = at(t, Bc);
1753
1753
  const l = new it(e).getSource(), c = new it(s).getSource();
1754
1754
  super(w(w({}, h), {}, { startValue: l, byValue: c.map(((u, d) => u - l[d])), easing: i, onChange: sr(n), onComplete: sr(r), abort: sr(o) }));
1755
1755
  }
@@ -1759,11 +1759,11 @@ class Hc extends no {
1759
1759
  }
1760
1760
  }
1761
1761
  function ro(a) {
1762
- const t = ((e) => Array.isArray(e.startValue) || Array.isArray(e.endValue))(a) ? new Nc(a) : new Fc(a);
1762
+ const t = ((e) => Array.isArray(e.startValue) || Array.isArray(e.endValue))(a) ? new jc(a) : new Ic(a);
1763
1763
  return t.start(), t;
1764
1764
  }
1765
1765
  function Dh(a) {
1766
- const t = new Hc(a);
1766
+ const t = new zc(a);
1767
1767
  return t.start(), t;
1768
1768
  }
1769
1769
  class dt {
@@ -1841,7 +1841,7 @@ class dt {
1841
1841
  return dt.intersectPolygonPolygon(t, [i, r, n, o]);
1842
1842
  }
1843
1843
  }
1844
- class zc extends nh {
1844
+ class Gc extends nh {
1845
1845
  getX() {
1846
1846
  return this.getXY().x;
1847
1847
  }
@@ -2026,8 +2026,8 @@ class zc extends nh {
2026
2026
  return this.translateToOriginPoint(this.getRelativeCenterPoint(), et, qt);
2027
2027
  }
2028
2028
  }
2029
- const Gc = ["type"], Vc = ["extraParam"];
2030
- let ke = class en extends zc {
2029
+ const Vc = ["type"], Wc = ["extraParam"];
2030
+ let ke = class en extends Gc {
2031
2031
  static getDefaults() {
2032
2032
  return en.ownDefaults;
2033
2033
  }
@@ -2341,9 +2341,9 @@ let ke = class en extends zc {
2341
2341
  toObject() {
2342
2342
  const t = (arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : []).concat(en.customProperties, this.constructor.customProperties || []);
2343
2343
  let e;
2344
- const s = tt.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: k, flipY: P, opacity: N, visible: F, backgroundColor: I, fillRule: O, paintFirst: D, globalCompositeOperation: z, skewX: M, skewY: R } = this;
2344
+ const s = tt.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: k, flipY: P, opacity: N, visible: F, backgroundColor: I, fillRule: O, paintFirst: D, globalCompositeOperation: H, skewX: M, skewY: R } = this;
2345
2345
  i && !i.excludeFromExport && (e = i.toObject(t.concat("inverted", "absolutePositioned")));
2346
- const W = (lt) => nt(lt, s), ot = w(w({}, gs(this, t)), {}, { type: this.constructor.type, version: yr, originX: u, originY: d, left: W(l), top: W(c), width: W(f), height: W(g), fill: Xo(n) ? n.toObject() : n, stroke: Xo(r) ? r.toObject() : r, strokeWidth: W(p), strokeDashArray: h && h.concat(), strokeLineCap: b, strokeDashOffset: m, strokeLineJoin: v, strokeUniform: y, strokeMiterLimit: W(_), scaleX: W(S), scaleY: W(A), angle: W(T), flipX: k, flipY: P, opacity: W(N), shadow: o && o.toObject(), visible: F, backgroundColor: I, fillRule: O, paintFirst: D, globalCompositeOperation: z, skewX: W(M), skewY: W(R) }, e ? { clipPath: e } : null);
2346
+ const W = (ht) => nt(ht, s), ot = w(w({}, gs(this, t)), {}, { type: this.constructor.type, version: yr, originX: u, originY: d, left: W(l), top: W(c), width: W(f), height: W(g), fill: Xo(n) ? n.toObject() : n, stroke: Xo(r) ? r.toObject() : r, strokeWidth: W(p), strokeDashArray: h && h.concat(), strokeLineCap: b, strokeDashOffset: m, strokeLineJoin: v, strokeUniform: y, strokeMiterLimit: W(_), scaleX: W(S), scaleY: W(A), angle: W(T), flipX: k, flipY: P, opacity: W(N), shadow: o && o.toObject(), visible: F, backgroundColor: I, fillRule: O, paintFirst: D, globalCompositeOperation: H, skewX: W(M), skewY: W(R) }, e ? { clipPath: e } : null);
2347
2347
  return this.includeDefaultValues ? ot : this._removeDefaultValues(ot);
2348
2348
  }
2349
2349
  toDatalessObject(t) {
@@ -2361,14 +2361,14 @@ let ke = class en extends zc {
2361
2361
  return "#<".concat(this.constructor.type, ">");
2362
2362
  }
2363
2363
  static _fromObject(t) {
2364
- let e = ht(t, Gc), s = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, { extraParam: i } = s, n = ht(s, Vc);
2364
+ let e = at(t, Vc), s = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, { extraParam: i } = s, n = at(s, Wc);
2365
2365
  return vi(e, n).then(((r) => i ? (delete r[i], new this(e[i], r)) : new this(r)));
2366
2366
  }
2367
2367
  static fromObject(t, e) {
2368
2368
  return this._fromObject(t, e);
2369
2369
  }
2370
2370
  };
2371
- x(ke, "stateProperties", Pc), x(ke, "cacheProperties", je), x(ke, "ownDefaults", Oc), x(ke, "type", "FabricObject"), x(ke, "colorProperties", [wt, Ht, "backgroundColor"]), x(ke, "customProperties", []), L.setClass(ke), L.setClass(ke, "object");
2371
+ x(ke, "stateProperties", Oc), x(ke, "cacheProperties", je), x(ke, "ownDefaults", Dc), x(ke, "type", "FabricObject"), x(ke, "colorProperties", [wt, Ht, "backgroundColor"]), x(ke, "customProperties", []), L.setClass(ke), L.setClass(ke, "object");
2372
2372
  const Hs = (a, t, e) => (s, i, n, r) => {
2373
2373
  const o = t(s, i, n, r);
2374
2374
  return o && yh(a, w(w({}, wh(s, i, n, r)), e)), o;
@@ -2387,13 +2387,13 @@ const la = Hs(ci, zs(((a, t, e, s) => {
2387
2387
  }
2388
2388
  return !1;
2389
2389
  })));
2390
- function Wc(a, t, e, s, i) {
2390
+ function Xc(a, t, e, s, i) {
2391
2391
  s = s || {};
2392
2392
  const n = this.sizeX || s.cornerSize || i.cornerSize, r = this.sizeY || s.cornerSize || i.cornerSize, o = s.transparentCorners !== void 0 ? s.transparentCorners : i.transparentCorners, h = o ? Ht : wt, l = !o && (s.cornerStrokeColor || i.cornerStrokeColor);
2393
2393
  let c, u = t, d = e;
2394
2394
  a.save(), a.fillStyle = s.cornerColor || i.cornerColor || "", a.strokeStyle = s.cornerStrokeColor || i.cornerStrokeColor || "", n > r ? (c = n, a.scale(1, r / n), d = e * n / r) : r > n ? (c = r, a.scale(n / r, 1), u = t * r / n) : c = n, a.beginPath(), a.arc(u, d, c / 2, 0, Ne, !1), a[h](), l && a.stroke(), a.restore();
2395
2395
  }
2396
- function Xc(a, t, e, s, i) {
2396
+ function Uc(a, t, e, s, i) {
2397
2397
  s = s || {};
2398
2398
  const n = this.sizeX || s.cornerSize || i.cornerSize, r = this.sizeY || s.cornerSize || i.cornerSize, o = s.transparentCorners !== void 0 ? s.transparentCorners : i.transparentCorners, h = o ? Ht : wt, l = !o && (s.cornerStrokeColor || i.cornerStrokeColor), c = n / 2, u = r / 2;
2399
2399
  a.save(), a.fillStyle = s.cornerColor || i.cornerColor || "", a.strokeStyle = s.cornerStrokeColor || i.cornerStrokeColor || "", a.translate(t, e);
@@ -2439,10 +2439,10 @@ class he {
2439
2439
  return { tl: new C(-0.5, -0.5).transform(o), tr: new C(0.5, -0.5).transform(o), br: new C(0.5, 0.5).transform(o), bl: new C(-0.5, 0.5).transform(o) };
2440
2440
  }
2441
2441
  render(t, e, s, i, n) {
2442
- ((i = i || {}).cornerStyle || n.cornerStyle) === "circle" ? Wc.call(this, t, e, s, i, n) : Xc.call(this, t, e, s, i, n);
2442
+ ((i = i || {}).cornerStyle || n.cornerStyle) === "circle" ? Xc.call(this, t, e, s, i, n) : Uc.call(this, t, e, s, i, n);
2443
2443
  }
2444
2444
  }
2445
- const Uc = (a, t, e) => e.lockRotation ? un : t.cursorStyle, Yc = Hs(eh, zs(((a, t, e, s) => {
2445
+ const Yc = (a, t, e) => e.lockRotation ? un : t.cursorStyle, $c = Hs(eh, zs(((a, t, e, s) => {
2446
2446
  let { target: i, ex: n, ey: r, theta: o, originX: h, originY: l } = t;
2447
2447
  const c = i.translateToOriginPoint(i.getRelativeCenterPoint(), h, l);
2448
2448
  if (fe(i, "lockRotation")) return !1;
@@ -2466,11 +2466,11 @@ function Lh(a, t, e) {
2466
2466
  const { width: n, height: r, strokeWidth: o } = a;
2467
2467
  return n === 0 && o === 0 && t !== "y" || r === 0 && o === 0 && t !== "x";
2468
2468
  }
2469
- const $c = ["e", "se", "s", "sw", "w", "nw", "n", "ne", "e"], Zs = (a, t, e) => {
2469
+ const qc = ["e", "se", "s", "sw", "w", "nw", "n", "ne", "e"], Zs = (a, t, e) => {
2470
2470
  const s = Rh(a, e);
2471
2471
  if (Lh(e, t.x !== 0 && t.y === 0 ? "x" : t.x === 0 && t.y !== 0 ? "y" : "", s)) return un;
2472
2472
  const i = xh(e, t);
2473
- return "".concat($c[i], "-resize");
2473
+ return "".concat(qc[i], "-resize");
2474
2474
  };
2475
2475
  function oo(a, t, e, s) {
2476
2476
  let i = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : {};
@@ -2489,35 +2489,35 @@ function oo(a, t, e, s) {
2489
2489
  const g = n.scaleX, p = n.scaleY;
2490
2490
  return r ? (r === "x" && n.set(Vt, l), r === "y" && n.set(te, c)) : (!fe(n, "lockScalingX") && n.set(Vt, l), !fe(n, "lockScalingY") && n.set(te, c)), g !== n.scaleX || p !== n.scaleY;
2491
2491
  }
2492
- const Ei = Hs(Tn, zs(((a, t, e, s) => oo(a, t, e, s)))), qc = Hs(Tn, zs(((a, t, e, s) => oo(a, t, e, s, { by: "x" })))), Kc = Hs(Tn, zs(((a, t, e, s) => oo(a, t, e, s, { by: "y" })))), Jc = ["target", "ex", "ey", "skewingSide"], ir = { x: { counterAxis: "y", scale: Vt, skew: Ns, lockSkewing: "lockSkewingX", origin: "originX", flip: "flipX" }, y: { counterAxis: "x", scale: te, skew: js, lockSkewing: "lockSkewingY", origin: "originY", flip: "flipY" } }, Zc = ["ns", "nesw", "ew", "nwse"], Qc = (a, t, e) => {
2492
+ const Ei = Hs(Tn, zs(((a, t, e, s) => oo(a, t, e, s)))), Kc = Hs(Tn, zs(((a, t, e, s) => oo(a, t, e, s, { by: "x" })))), Jc = Hs(Tn, zs(((a, t, e, s) => oo(a, t, e, s, { by: "y" })))), Zc = ["target", "ex", "ey", "skewingSide"], ir = { x: { counterAxis: "y", scale: Vt, skew: Ns, lockSkewing: "lockSkewingX", origin: "originX", flip: "flipX" }, y: { counterAxis: "x", scale: te, skew: js, lockSkewing: "lockSkewingY", origin: "originY", flip: "flipY" } }, Qc = ["ns", "nesw", "ew", "nwse"], tu = (a, t, e) => {
2493
2493
  if (t.x !== 0 && fe(e, "lockSkewingY") || t.y !== 0 && fe(e, "lockSkewingX")) return un;
2494
2494
  const s = xh(e, t) % 4;
2495
- return "".concat(Zc[s], "-resize");
2495
+ return "".concat(Qc[s], "-resize");
2496
2496
  };
2497
2497
  function Fh(a, t, e, s, i) {
2498
2498
  const { target: n } = e, { counterAxis: r, origin: o, lockSkewing: h, skew: l, flip: c } = ir[a];
2499
2499
  if (fe(n, h)) return !1;
2500
2500
  const { origin: u, flip: d } = ir[r], f = yt(e[u]) * (n[d] ? -1 : 1), g = -Math.sign(f) * (n[c] ? -1 : 1), p = 0.5 * -((n[l] === 0 && to(e, $, $, s, i)[a] > 0 || n[l] > 0 ? 1 : -1) * g) + 0.5;
2501
2501
  return Hs(sh, zs(((m, v, y, _) => (function(S, A, T) {
2502
- let { target: k, ex: P, ey: N, skewingSide: F } = A, I = ht(A, Jc);
2503
- const { skew: O } = ir[S], D = T.subtract(new C(P, N)).divide(new C(k.scaleX, k.scaleY))[S], z = k[O], M = I[O], R = Math.tan(ft(M)), W = S === "y" ? k._getTransformedDimensions({ scaleX: 1, scaleY: 1, skewX: 0 }).x : k._getTransformedDimensions({ scaleX: 1, scaleY: 1 }).y, ot = 2 * D * F / Math.max(W, 1) + R, lt = Te(Math.atan(ot));
2504
- k.set(O, lt);
2505
- const E = z !== k[O];
2502
+ let { target: k, ex: P, ey: N, skewingSide: F } = A, I = at(A, Zc);
2503
+ const { skew: O } = ir[S], D = T.subtract(new C(P, N)).divide(new C(k.scaleX, k.scaleY))[S], H = k[O], M = I[O], R = Math.tan(ft(M)), W = S === "y" ? k._getTransformedDimensions({ scaleX: 1, scaleY: 1, skewX: 0 }).x : k._getTransformedDimensions({ scaleX: 1, scaleY: 1 }).y, ot = 2 * D * F / Math.max(W, 1) + R, ht = Te(Math.atan(ot));
2504
+ k.set(O, ht);
2505
+ const E = H !== k[O];
2506
2506
  if (E && S === "y") {
2507
- const { skewX: H, scaleX: V } = k, J = k._getTransformedDimensions({ skewY: z }), At = k._getTransformedDimensions(), st = H !== 0 ? J.x / At.x : 1;
2507
+ const { skewX: z, scaleX: V } = k, J = k._getTransformedDimensions({ skewY: H }), At = k._getTransformedDimensions(), st = z !== 0 ? J.x / At.x : 1;
2508
2508
  st !== 1 && k.set(Vt, st * V);
2509
2509
  }
2510
2510
  return E;
2511
2511
  })(a, v, new C(y, _)))))(t, w(w({}, e), {}, { [o]: p, skewingSide: g }), s, i);
2512
2512
  }
2513
- const tu = (a, t, e, s) => Fh("x", a, t, e, s), eu = (a, t, e, s) => Fh("y", a, t, e, s);
2513
+ const eu = (a, t, e, s) => Fh("x", a, t, e, s), su = (a, t, e, s) => Fh("y", a, t, e, s);
2514
2514
  function Rn(a, t) {
2515
2515
  return a[t.canvas.altActionKey];
2516
2516
  }
2517
2517
  const ki = (a, t, e) => {
2518
2518
  const s = Rn(a, e);
2519
2519
  return t.x === 0 ? s ? Ns : te : t.y === 0 ? s ? js : Vt : "";
2520
- }, xs = (a, t, e) => Rn(a, e) ? Qc(0, t, e) : Zs(a, t, e), ca = (a, t, e, s) => Rn(a, t.target) ? eu(a, t, e, s) : qc(a, t, e, s), ua = (a, t, e, s) => Rn(a, t.target) ? tu(a, t, e, s) : Kc(a, t, e, s), Ih = () => ({ ml: new he({ x: -0.5, y: 0, cursorStyleHandler: xs, actionHandler: ca, getActionName: ki }), mr: new he({ x: 0.5, y: 0, cursorStyleHandler: xs, actionHandler: ca, getActionName: ki }), mb: new he({ x: 0, y: 0.5, cursorStyleHandler: xs, actionHandler: ua, getActionName: ki }), mt: new he({ x: 0, y: -0.5, cursorStyleHandler: xs, actionHandler: ua, getActionName: ki }), tl: new he({ x: -0.5, y: -0.5, cursorStyleHandler: Zs, actionHandler: Ei }), tr: new he({ x: 0.5, y: -0.5, cursorStyleHandler: Zs, actionHandler: Ei }), bl: new he({ x: -0.5, y: 0.5, cursorStyleHandler: Zs, actionHandler: Ei }), br: new he({ x: 0.5, y: 0.5, cursorStyleHandler: Zs, actionHandler: Ei }), mtr: new he({ x: 0, y: -0.5, actionHandler: Yc, cursorStyleHandler: Uc, offsetY: -40, withConnection: !0, actionName: Ur }) }), su = () => ({ mr: new he({ x: 0.5, y: 0, actionHandler: la, cursorStyleHandler: xs, actionName: ci }), ml: new he({ x: -0.5, y: 0, actionHandler: la, cursorStyleHandler: xs, actionName: ci }) }), iu = () => w(w({}, Ih()), su());
2520
+ }, xs = (a, t, e) => Rn(a, e) ? tu(0, t, e) : Zs(a, t, e), ca = (a, t, e, s) => Rn(a, t.target) ? su(a, t, e, s) : Kc(a, t, e, s), ua = (a, t, e, s) => Rn(a, t.target) ? eu(a, t, e, s) : Jc(a, t, e, s), Ih = () => ({ ml: new he({ x: -0.5, y: 0, cursorStyleHandler: xs, actionHandler: ca, getActionName: ki }), mr: new he({ x: 0.5, y: 0, cursorStyleHandler: xs, actionHandler: ca, getActionName: ki }), mb: new he({ x: 0, y: 0.5, cursorStyleHandler: xs, actionHandler: ua, getActionName: ki }), mt: new he({ x: 0, y: -0.5, cursorStyleHandler: xs, actionHandler: ua, getActionName: ki }), tl: new he({ x: -0.5, y: -0.5, cursorStyleHandler: Zs, actionHandler: Ei }), tr: new he({ x: 0.5, y: -0.5, cursorStyleHandler: Zs, actionHandler: Ei }), bl: new he({ x: -0.5, y: 0.5, cursorStyleHandler: Zs, actionHandler: Ei }), br: new he({ x: 0.5, y: 0.5, cursorStyleHandler: Zs, actionHandler: Ei }), mtr: new he({ x: 0, y: -0.5, actionHandler: $c, cursorStyleHandler: Yc, offsetY: -40, withConnection: !0, actionName: Ur }) }), iu = () => ({ mr: new he({ x: 0.5, y: 0, actionHandler: la, cursorStyleHandler: xs, actionName: ci }), ml: new he({ x: -0.5, y: 0, actionHandler: la, cursorStyleHandler: xs, actionName: ci }) }), nu = () => w(w({}, Ih()), iu());
2521
2521
  class di extends ke {
2522
2522
  static getDefaults() {
2523
2523
  return w(w({}, super.getDefaults()), di.ownDefaults);
@@ -2694,14 +2694,14 @@ class Bh {
2694
2694
  return t.multiply(this.strokeUniformScalar).scalarMultiply(e);
2695
2695
  }
2696
2696
  }
2697
- const nu = new C();
2697
+ const ru = new C();
2698
2698
  class Es extends Bh {
2699
2699
  static getOrthogonalRotationFactor(t, e) {
2700
2700
  const s = e ? mn(t, e) : Mh(t);
2701
2701
  return Math.abs(s) < We ? -1 : 1;
2702
2702
  }
2703
2703
  constructor(t, e, s, i) {
2704
- super(i), x(this, "AB", void 0), x(this, "AC", void 0), x(this, "alpha", void 0), x(this, "bisector", void 0), this.A = new C(t), this.B = new C(e), this.C = new C(s), this.AB = this.createSideVector(this.A, this.B), this.AC = this.createSideVector(this.A, this.C), this.alpha = mn(this.AB, this.AC), this.bisector = Dn(so(this.AB.eq(nu) ? this.AC : this.AB, this.alpha / 2));
2704
+ super(i), x(this, "AB", void 0), x(this, "AC", void 0), x(this, "alpha", void 0), x(this, "bisector", void 0), this.A = new C(t), this.B = new C(e), this.C = new C(s), this.AB = this.createSideVector(this.A, this.B), this.AC = this.createSideVector(this.A, this.C), this.alpha = mn(this.AB, this.AC), this.bisector = Dn(so(this.AB.eq(ru) ? this.AC : this.AB, this.alpha / 2));
2705
2705
  }
2706
2706
  calcOrthogonalProjection(t, e) {
2707
2707
  let s = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : this.strokeProjectionMagnitude;
@@ -2829,12 +2829,12 @@ const Ln = (a) => {
2829
2829
  return s;
2830
2830
  }));
2831
2831
  }
2832
- return ru(a);
2833
- }, ru = (a) => {
2832
+ return ou(a);
2833
+ }, ou = (a) => {
2834
2834
  const t = [];
2835
- for (let e, s = 0; s < a.length; s++) (e = ou(a, s)) !== !1 && t.push(e);
2835
+ for (let e, s = 0; s < a.length; s++) (e = au(a, s)) !== !1 && t.push(e);
2836
2836
  return t;
2837
- }, ou = (a, t) => {
2837
+ }, au = (a, t) => {
2838
2838
  const e = a.charCodeAt(t);
2839
2839
  if (isNaN(e)) return "";
2840
2840
  if (e < 55296 || e > 57343) return a.charAt(t);
@@ -2849,7 +2849,7 @@ const Ln = (a) => {
2849
2849
  if (55296 > s || s > 56319) throw "Low surrogate without preceding high surrogate";
2850
2850
  return !1;
2851
2851
  };
2852
- var au = Object.freeze({ __proto__: null, capitalize: function(a) {
2852
+ var hu = Object.freeze({ __proto__: null, capitalize: function(a) {
2853
2853
  let t = arguments.length > 1 && arguments[1] !== void 0 && arguments[1];
2854
2854
  return "".concat(a.charAt(0).toUpperCase()).concat(t ? a.slice(1) : a.slice(1).toLowerCase());
2855
2855
  }, escapeXml: zh, graphemeSplit: Ln });
@@ -2890,7 +2890,7 @@ function fa(a, t) {
2890
2890
  }
2891
2891
  return t.length === 0;
2892
2892
  }
2893
- function hu(a, t) {
2893
+ function lu(a, t) {
2894
2894
  let e = !0;
2895
2895
  const s = fa(a, t.pop());
2896
2896
  return s && t.length && (e = (function(i, n) {
@@ -2899,17 +2899,17 @@ function hu(a, t) {
2899
2899
  return n.length === 0;
2900
2900
  })(a, t)), s && e && t.length === 0;
2901
2901
  }
2902
- const lu = (a) => {
2902
+ const cu = (a) => {
2903
2903
  var t;
2904
- return (t = Tc[a]) !== null && t !== void 0 ? t : a;
2905
- }, cu = new RegExp("(".concat(de, ")"), "gi"), uu = (a) => dn(a.replace(cu, " $1 ").replace(/,/gi, " "));
2904
+ return (t = Ec[a]) !== null && t !== void 0 ? t : a;
2905
+ }, uu = new RegExp("(".concat(de, ")"), "gi"), du = (a) => dn(a.replace(uu, " $1 ").replace(/,/gi, " "));
2906
2906
  var ga, pa, ma, ba, va, ya, _a;
2907
- const Nt = "(".concat(de, ")"), du = String.raw(ga || (ga = Ee(["(skewX)(", ")"], ["(skewX)\\(", "\\)"])), Nt), fu = String.raw(pa || (pa = Ee(["(skewY)(", ")"], ["(skewY)\\(", "\\)"])), Nt), gu = String.raw(ma || (ma = Ee(["(rotate)(", "(?: ", " ", ")?)"], ["(rotate)\\(", "(?: ", " ", ")?\\)"])), Nt, Nt, Nt), pu = String.raw(ba || (ba = Ee(["(scale)(", "(?: ", ")?)"], ["(scale)\\(", "(?: ", ")?\\)"])), Nt, Nt), mu = String.raw(va || (va = Ee(["(translate)(", "(?: ", ")?)"], ["(translate)\\(", "(?: ", ")?\\)"])), Nt, Nt), bu = String.raw(ya || (ya = Ee(["(matrix)(", " ", " ", " ", " ", " ", ")"], ["(matrix)\\(", " ", " ", " ", " ", " ", "\\)"])), Nt, Nt, Nt, Nt, Nt, Nt), ho = "(?:".concat(bu, "|").concat(mu, "|").concat(gu, "|").concat(pu, "|").concat(du, "|").concat(fu, ")"), vu = "(?:".concat(ho, "*)"), yu = String.raw(_a || (_a = Ee(["^s*(?:", "?)s*$"], ["^\\s*(?:", "?)\\s*$"])), vu), _u = new RegExp(yu), wu = new RegExp(ho), xu = new RegExp(ho, "g");
2907
+ const Nt = "(".concat(de, ")"), fu = String.raw(ga || (ga = Ee(["(skewX)(", ")"], ["(skewX)\\(", "\\)"])), Nt), gu = String.raw(pa || (pa = Ee(["(skewY)(", ")"], ["(skewY)\\(", "\\)"])), Nt), pu = String.raw(ma || (ma = Ee(["(rotate)(", "(?: ", " ", ")?)"], ["(rotate)\\(", "(?: ", " ", ")?\\)"])), Nt, Nt, Nt), mu = String.raw(ba || (ba = Ee(["(scale)(", "(?: ", ")?)"], ["(scale)\\(", "(?: ", ")?\\)"])), Nt, Nt), bu = String.raw(va || (va = Ee(["(translate)(", "(?: ", ")?)"], ["(translate)\\(", "(?: ", ")?\\)"])), Nt, Nt), vu = String.raw(ya || (ya = Ee(["(matrix)(", " ", " ", " ", " ", " ", ")"], ["(matrix)\\(", " ", " ", " ", " ", " ", "\\)"])), Nt, Nt, Nt, Nt, Nt, Nt), ho = "(?:".concat(vu, "|").concat(bu, "|").concat(pu, "|").concat(mu, "|").concat(fu, "|").concat(gu, ")"), yu = "(?:".concat(ho, "*)"), _u = String.raw(_a || (_a = Ee(["^s*(?:", "?)s*$"], ["^\\s*(?:", "?)\\s*$"])), yu), wu = new RegExp(_u), xu = new RegExp(ho), Su = new RegExp(ho, "g");
2908
2908
  function bn(a) {
2909
2909
  const t = [];
2910
- if (!(a = uu(a).replace(/\s*([()])\s*/gi, "$1")) || a && !_u.test(a)) return [...Gt];
2911
- for (const e of a.matchAll(xu)) {
2912
- const s = wu.exec(e[0]);
2910
+ if (!(a = du(a).replace(/\s*([()])\s*/gi, "$1")) || a && !wu.test(a)) return [...Gt];
2911
+ for (const e of a.matchAll(Su)) {
2912
+ const s = xu.exec(e[0]);
2913
2913
  if (!s) continue;
2914
2914
  let i = Gt;
2915
2915
  const n = s.filter(((g) => !!g)), [, r, ...o] = n, [h, l, c, u, d, f] = o.map(((g) => parseFloat(g)));
@@ -2936,7 +2936,7 @@ function bn(a) {
2936
2936
  }
2937
2937
  return kn(t);
2938
2938
  }
2939
- function Su(a, t, e, s) {
2939
+ function Cu(a, t, e, s) {
2940
2940
  const i = Array.isArray(t);
2941
2941
  let n, r = t;
2942
2942
  if (a !== wt && a !== Ht || t !== Bt) {
@@ -2958,8 +2958,8 @@ function Su(a, t, e, s) {
2958
2958
  } else r = "";
2959
2959
  return !i && isNaN(n) ? r : n;
2960
2960
  }
2961
- function Cu(a, t) {
2962
- const e = a.match(Ac);
2961
+ function Au(a, t) {
2962
+ const e = a.match(Tc);
2963
2963
  if (!e) return;
2964
2964
  const s = e[1], i = e[3], n = e[4], r = e[5], o = e[6];
2965
2965
  s && (t.fontStyle = s), i && (t.fontWeight = isNaN(parseFloat(i)) ? i : parseFloat(i)), n && (t.fontSize = It(n)), o && (t.fontFamily = o), r && (t.lineHeight = r === "normal" ? 1 : r);
@@ -2971,7 +2971,7 @@ function Tr(a, t) {
2971
2971
  t[s.trim().toLowerCase()] = i.trim();
2972
2972
  }));
2973
2973
  }
2974
- function Au(a) {
2974
+ function Tu(a) {
2975
2975
  const t = {}, e = a.getAttribute("style");
2976
2976
  return e && (typeof e == "string" ? Tr(e, t) : (function(s, i) {
2977
2977
  Object.entries(s).forEach(((n) => {
@@ -2980,7 +2980,7 @@ function Au(a) {
2980
2980
  }));
2981
2981
  })(e, t)), t;
2982
2982
  }
2983
- const Tu = { stroke: "strokeOpacity", fill: "fillOpacity" };
2983
+ const Eu = { stroke: "strokeOpacity", fill: "fillOpacity" };
2984
2984
  function Be(a, t, e) {
2985
2985
  if (!a) return {};
2986
2986
  let s, i = {}, n = Wr;
@@ -2990,20 +2990,20 @@ function Be(a, t, e) {
2990
2990
  return u && (l[c] = u), l;
2991
2991
  }), {})), (function(l) {
2992
2992
  let c = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, u = {};
2993
- for (const d in c) hu(l, d.split(" ")) && (u = w(w({}, u), c[d]));
2993
+ for (const d in c) lu(l, d.split(" ")) && (u = w(w({}, u), c[d]));
2994
2994
  return u;
2995
- })(a, e)), Au(a));
2995
+ })(a, e)), Tu(a));
2996
2996
  r[tr] && a.setAttribute(tr, r[tr]), r[Qn] && (s = It(r[Qn], n), r[Qn] = "".concat(s));
2997
2997
  const o = {};
2998
2998
  for (const l in r) {
2999
- const c = lu(l), u = Su(c, r[l], i, s);
2999
+ const c = cu(l), u = Cu(c, r[l], i, s);
3000
3000
  o[c] = u;
3001
3001
  }
3002
- o && o.font && Cu(o.font, o);
3002
+ o && o.font && Au(o.font, o);
3003
3003
  const h = w(w({}, i), o);
3004
3004
  return ia.test(a.nodeName) ? h : (function(l) {
3005
3005
  const c = Rt.getDefaults();
3006
- return Object.entries(Tu).forEach(((u) => {
3006
+ return Object.entries(Eu).forEach(((u) => {
3007
3007
  let [d, f] = u;
3008
3008
  if (l[f] === void 0 || l[d] === "") return;
3009
3009
  if (l[d] === void 0) {
@@ -3016,7 +3016,7 @@ function Be(a, t, e) {
3016
3016
  })), l;
3017
3017
  })(h);
3018
3018
  }
3019
- const Eu = ["left", "top", "width", "height", "visible"], Wh = ["rx", "ry"];
3019
+ const ku = ["left", "top", "width", "height", "visible"], Wh = ["rx", "ry"];
3020
3020
  class _e extends Rt {
3021
3021
  static getDefaults() {
3022
3022
  return w(w({}, super.getDefaults()), _e.ownDefaults);
@@ -3042,7 +3042,7 @@ class _e extends Rt {
3042
3042
  `)];
3043
3043
  }
3044
3044
  static async fromElement(t, e, s) {
3045
- const i = Be(t, this.ATTRIBUTE_NAMES, s), { left: n = 0, top: r = 0, width: o = 0, height: h = 0, visible: l = !0 } = i, c = ht(i, Eu);
3045
+ const i = Be(t, this.ATTRIBUTE_NAMES, s), { left: n = 0, top: r = 0, width: o = 0, height: h = 0, visible: l = !0 } = i, c = at(i, ku);
3046
3046
  return new this(w(w(w({}, e), c), {}, { left: n, top: r, width: o, height: h, visible: !!(l && o && h) }));
3047
3047
  }
3048
3048
  }
@@ -3085,7 +3085,7 @@ class Er extends In {
3085
3085
  }
3086
3086
  }
3087
3087
  x(Er, "type", "fit-content"), L.setClass(Er);
3088
- const ku = ["strategy"], Mu = ["target", "strategy", "bubbles", "prevStrategy"], Uh = "layoutManager";
3088
+ const Mu = ["strategy"], Pu = ["target", "strategy", "bubbles", "prevStrategy"], Uh = "layoutManager";
3089
3089
  class fi {
3090
3090
  constructor() {
3091
3091
  let t = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : new Er();
@@ -3101,7 +3101,7 @@ class fi {
3101
3101
  }
3102
3102
  attachHandlers(t, e) {
3103
3103
  const { target: s } = e;
3104
- return [hn, th, ci, eh, Tn, sh, an, fc, gc].map(((i) => t.on(i, ((n) => this.performLayout(i === hn ? { type: "object_modified", trigger: i, e: n, target: s } : { type: "object_modifying", trigger: i, e: n, target: s })))));
3104
+ return [hn, th, ci, eh, Tn, sh, an, gc, pc].map(((i) => t.on(i, ((n) => this.performLayout(i === hn ? { type: "object_modified", trigger: i, e: n, target: s } : { type: "object_modifying", trigger: i, e: n, target: s })))));
3105
3105
  }
3106
3106
  subscribe(t, e) {
3107
3107
  this.unsubscribe(t, e);
@@ -3120,7 +3120,7 @@ class fi {
3120
3120
  onBeforeLayout(t) {
3121
3121
  const { target: e, type: s } = t, { canvas: i } = e;
3122
3122
  if (s === Re || s === vn ? this.subscribeTargets(t) : s === lo && this.unsubscribeTargets(t), e.fire("layout:before", { context: t }), i && i.fire("object:layout:before", { target: e, context: t }), s === yn && t.deep) {
3123
- const n = ht(t, ku);
3123
+ const n = at(t, Mu);
3124
3124
  e.forEachObject(((r) => r.layoutManager && r.layoutManager.performLayout(w(w({}, n), {}, { bubbles: !1, target: r }))));
3125
3125
  }
3126
3126
  }
@@ -3146,7 +3146,7 @@ class fi {
3146
3146
  s.set({ left: s.left + i.x, top: s.top + i.y });
3147
3147
  }
3148
3148
  onAfterLayout(t, e) {
3149
- const { target: s, strategy: i, bubbles: n, prevStrategy: r } = t, o = ht(t, Mu), { canvas: h } = s;
3149
+ const { target: s, strategy: i, bubbles: n, prevStrategy: r } = t, o = at(t, Pu), { canvas: h } = s;
3150
3150
  s.fire("layout:after", { context: t, result: e }), h && h.fire("object:layout:after", { context: t, result: e, target: s });
3151
3151
  const l = s.parent;
3152
3152
  n && l != null && l.layoutManager && ((o.path || (o.path = [])).push(s), l.layoutManager.performLayout(w(w({}, o), {}, { target: l }))), s.set("dirty", !0);
@@ -3163,8 +3163,8 @@ class fi {
3163
3163
  }
3164
3164
  }
3165
3165
  L.setClass(fi, Uh);
3166
- const Pu = ["type", "objects", "layoutManager"];
3167
- class Ou extends fi {
3166
+ const Ou = ["type", "objects", "layoutManager"];
3167
+ class Du extends fi {
3168
3168
  performLayout() {
3169
3169
  }
3170
3170
  }
@@ -3338,10 +3338,10 @@ class Qt extends ih(Rt) {
3338
3338
  return this._createBaseClipPathSVGMarkup(e, { reviver: t });
3339
3339
  }
3340
3340
  static fromObject(t, e) {
3341
- let { type: s, objects: i = [], layoutManager: n } = t, r = ht(t, Pu);
3341
+ let { type: s, objects: i = [], layoutManager: n } = t, r = at(t, Ou);
3342
3342
  return Promise.all([Ds(i, e), vi(r, e)]).then(((o) => {
3343
3343
  let [h, l] = o;
3344
- const c = new this(h, w(w(w({}, r), l), {}, { layoutManager: new Ou() }));
3344
+ const c = new this(h, w(w(w({}, r), l), {}, { layoutManager: new Du() }));
3345
3345
  if (n) {
3346
3346
  const u = L.getClass(n.type), d = L.getClass(n.strategy);
3347
3347
  c.layoutManager = new u(new d());
@@ -3351,7 +3351,7 @@ class Qt extends ih(Rt) {
3351
3351
  }
3352
3352
  }
3353
3353
  x(Qt, "type", "Group"), x(Qt, "ownDefaults", { strokeWidth: 0, subTargetCheck: !1, interactive: !1 }), L.setClass(Qt);
3354
- const Yh = (a, t) => Math.min(t.width / a.width, t.height / a.height), $h = (a, t) => Math.max(t.width / a.width, t.height / a.height), kr = "\\s*,?\\s*", Us = "".concat(kr, "(").concat(de, ")"), Du = "".concat(Us).concat(Us).concat(Us).concat(kr, "([01])").concat(kr, "([01])").concat(Us).concat(Us), Ru = { m: "l", M: "L" }, Lu = (a, t, e, s, i, n, r, o, h, l, c) => {
3354
+ const Yh = (a, t) => Math.min(t.width / a.width, t.height / a.height), $h = (a, t) => Math.max(t.width / a.width, t.height / a.height), kr = "\\s*,?\\s*", Us = "".concat(kr, "(").concat(de, ")"), Ru = "".concat(Us).concat(Us).concat(Us).concat(kr, "([01])").concat(kr, "([01])").concat(Us).concat(Us), Lu = { m: "l", M: "L" }, Fu = (a, t, e, s, i, n, r, o, h, l, c) => {
3355
3355
  const u = ge(a), d = pe(a), f = ge(t), g = pe(t), p = e * i * f - s * n * g + r, b = s * i * f + e * n * g + o;
3356
3356
  return ["C", l + h * (-e * i * d - s * n * u), c + h * (-s * i * d + e * n * u), p + h * (e * i * g + s * n * f), b + h * (s * i * g - e * n * f), p, b];
3357
3357
  }, wa = (a, t, e, s) => {
@@ -3387,23 +3387,23 @@ function Mr(a, t, e, s, i, n, r, o) {
3387
3387
  const y = [new C(Math.min(...d[0]), Math.min(...d[1])), new C(Math.max(...d[0]), Math.max(...d[1]))];
3388
3388
  return tt.cachesBoundsOfCurve && (si.boundsOfCurveCache[h] = y), y;
3389
3389
  }
3390
- const Fu = (a, t, e) => {
3390
+ const Iu = (a, t, e) => {
3391
3391
  let [s, i, n, r, o, h, l, c] = e;
3392
3392
  const u = ((d, f, g, p, b, m, v) => {
3393
3393
  if (g === 0 || p === 0) return [];
3394
3394
  let y = 0, _ = 0, S = 0;
3395
- const A = Math.PI, T = v * Vr, k = pe(T), P = ge(T), N = 0.5 * (-P * d - k * f), F = 0.5 * (-P * f + k * d), I = g ** 2, O = p ** 2, D = F ** 2, z = N ** 2, M = I * O - I * D - O * z;
3395
+ const A = Math.PI, T = v * Vr, k = pe(T), P = ge(T), N = 0.5 * (-P * d - k * f), F = 0.5 * (-P * f + k * d), I = g ** 2, O = p ** 2, D = F ** 2, H = N ** 2, M = I * O - I * D - O * H;
3396
3396
  let R = Math.abs(g), W = Math.abs(p);
3397
3397
  if (M < 0) {
3398
3398
  const Wt = Math.sqrt(1 - M / (I * O));
3399
3399
  R *= Wt, W *= Wt;
3400
- } else S = (b === m ? -1 : 1) * Math.sqrt(M / (I * D + O * z));
3401
- const ot = S * R * F / W, lt = -S * W * N / R, E = P * ot - k * lt + 0.5 * d, H = k * ot + P * lt + 0.5 * f;
3402
- let V = wa(1, 0, (N - ot) / R, (F - lt) / W), J = wa((N - ot) / R, (F - lt) / W, (-N - ot) / R, (-F - lt) / W);
3400
+ } else S = (b === m ? -1 : 1) * Math.sqrt(M / (I * D + O * H));
3401
+ const ot = S * R * F / W, ht = -S * W * N / R, E = P * ot - k * ht + 0.5 * d, z = k * ot + P * ht + 0.5 * f;
3402
+ let V = wa(1, 0, (N - ot) / R, (F - ht) / W), J = wa((N - ot) / R, (F - ht) / W, (-N - ot) / R, (-F - ht) / W);
3403
3403
  m === 0 && J > 0 ? J -= 2 * A : m === 1 && J < 0 && (J += 2 * A);
3404
- const At = Math.ceil(Math.abs(J / A * 2)), st = [], B = J / At, at = 8 / 3 * Math.sin(B / 4) * Math.sin(B / 4) / Math.sin(B / 2);
3404
+ const At = Math.ceil(Math.abs(J / A * 2)), st = [], B = J / At, ut = 8 / 3 * Math.sin(B / 4) * Math.sin(B / 4) / Math.sin(B / 2);
3405
3405
  let Tt = V + B;
3406
- for (let Wt = 0; Wt < At; Wt++) st[Wt] = Lu(V, Tt, P, k, R, W, E, H, at, y, _), y = st[Wt][5], _ = st[Wt][6], V = Tt, Tt += B;
3406
+ for (let Wt = 0; Wt < At; Wt++) st[Wt] = Fu(V, Tt, P, k, R, W, E, z, ut, y, _), y = st[Wt][5], _ = st[Wt][6], V = Tt, Tt += B;
3407
3407
  return st;
3408
3408
  })(l - a, c - t, i, n, o, h, r);
3409
3409
  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;
@@ -3459,7 +3459,7 @@ const Fu = (a, t, e) => {
3459
3459
  case "a":
3460
3460
  c[6] += t, c[7] += e;
3461
3461
  case "A":
3462
- Fu(t, e, c).forEach(((d) => n.push(d))), t = c[6], e = c[7];
3462
+ Iu(t, e, c).forEach(((d) => n.push(d))), t = c[6], e = c[7];
3463
3463
  break;
3464
3464
  case "z":
3465
3465
  case "Z":
@@ -3471,13 +3471,13 @@ const Fu = (a, t, e) => {
3471
3471
  }, _n = (a, t, e, s) => Math.sqrt((e - a) ** 2 + (s - t) ** 2), Kh = (a, t, e, s, i, n, r, o) => (h) => {
3472
3472
  const l = h ** 3, c = ((f) => 3 * f ** 2 * (1 - f))(h), u = ((f) => 3 * f * (1 - f) ** 2)(h), d = ((f) => (1 - f) ** 3)(h);
3473
3473
  return new C(r * l + i * c + e * u + a * d, o * l + n * c + s * u + t * d);
3474
- }, Jh = (a) => a ** 2, Zh = (a) => 2 * a * (1 - a), Qh = (a) => (1 - a) ** 2, Iu = (a, t, e, s, i, n, r, o) => (h) => {
3474
+ }, Jh = (a) => a ** 2, Zh = (a) => 2 * a * (1 - a), Qh = (a) => (1 - a) ** 2, Nu = (a, t, e, s, i, n, r, o) => (h) => {
3475
3475
  const l = Jh(h), c = Zh(h), u = Qh(h), d = 3 * (u * (e - a) + c * (i - e) + l * (r - i)), f = 3 * (u * (s - t) + c * (n - s) + l * (o - n));
3476
3476
  return Math.atan2(f, d);
3477
- }, Nu = (a, t, e, s, i, n) => (r) => {
3477
+ }, ju = (a, t, e, s, i, n) => (r) => {
3478
3478
  const o = Jh(r), h = Zh(r), l = Qh(r);
3479
3479
  return new C(i * o + e * h + a * l, n * o + s * h + t * l);
3480
- }, ju = (a, t, e, s, i, n) => (r) => {
3480
+ }, Bu = (a, t, e, s, i, n) => (r) => {
3481
3481
  const o = 1 - r, h = 2 * (o * (e - a) + r * (i - e)), l = 2 * (o * (s - t) + r * (n - s));
3482
3482
  return Math.atan2(l, h);
3483
3483
  }, xa = (a, t, e) => {
@@ -3487,7 +3487,7 @@ const Fu = (a, t, e) => {
3487
3487
  i += _n(s.x, s.y, r.x, r.y), s = r;
3488
3488
  }
3489
3489
  return i;
3490
- }, Bu = (a, t) => {
3490
+ }, Hu = (a, t) => {
3491
3491
  let e, s = 0, i = 0, n = { x: a.x, y: a.y }, r = w({}, n), o = 0.01, h = 0;
3492
3492
  const l = a.iterator, c = a.angleFinder;
3493
3493
  for (; i < t && o > 1e-4; ) r = l(s), h = s, e = _n(n.x, n.y, r.x, r.y), e + i > t ? (s -= o, o /= 2) : (n = r, s += o, i += e);
@@ -3505,10 +3505,10 @@ const Fu = (a, t, e) => {
3505
3505
  e = c, e.length = _n(i, n, l[1], l[2]), i = l[1], n = l[2];
3506
3506
  break;
3507
3507
  case "C":
3508
- t = Kh(i, n, l[1], l[2], l[3], l[4], l[5], l[6]), e = c, e.iterator = t, e.angleFinder = Iu(i, n, l[1], l[2], l[3], l[4], l[5], l[6]), e.length = xa(t, i, n), i = l[5], n = l[6];
3508
+ t = Kh(i, n, l[1], l[2], l[3], l[4], l[5], l[6]), e = c, e.iterator = t, e.angleFinder = Nu(i, n, l[1], l[2], l[3], l[4], l[5], l[6]), e.length = xa(t, i, n), i = l[5], n = l[6];
3509
3509
  break;
3510
3510
  case "Q":
3511
- t = Nu(i, n, l[1], l[2], l[3], l[4]), e = c, e.iterator = t, e.angleFinder = ju(i, n, l[1], l[2], l[3], l[4]), e.length = xa(t, i, n), i = l[3], n = l[4];
3511
+ t = ju(i, n, l[1], l[2], l[3], l[4]), e = c, e.iterator = t, e.angleFinder = Bu(i, n, l[1], l[2], l[3], l[4]), e.length = xa(t, i, n), i = l[3], n = l[4];
3512
3512
  break;
3513
3513
  case "Z":
3514
3514
  e = c, e.destX = r, e.destY = o, e.length = _n(i, n, r, o), i = r, n = o;
@@ -3529,32 +3529,32 @@ const Fu = (a, t, e) => {
3529
3529
  return w(w({}, new C(i.x, i.y).lerp(new C(r[1], r[2]), n)), {}, { angle: Math.atan2(r[2] - i.y, r[1] - i.x) });
3530
3530
  case "C":
3531
3531
  case "Q":
3532
- return Bu(i, t);
3532
+ return Hu(i, t);
3533
3533
  }
3534
- }, Hu = new RegExp("[mzlhvcsqta][^mzlhvcsqta]*", "gi"), Sa = new RegExp(Du, "g"), zu = new RegExp(de, "gi"), Gu = { m: 2, l: 2, h: 1, v: 1, c: 6, s: 4, q: 4, t: 2, a: 7 }, el = (a) => {
3534
+ }, zu = new RegExp("[mzlhvcsqta][^mzlhvcsqta]*", "gi"), Sa = new RegExp(Ru, "g"), Gu = new RegExp(de, "gi"), Vu = { m: 2, l: 2, h: 1, v: 1, c: 6, s: 4, q: 4, t: 2, a: 7 }, el = (a) => {
3535
3535
  var t;
3536
- const e = [], s = (t = a.match(Hu)) !== null && t !== void 0 ? t : [];
3536
+ const e = [], s = (t = a.match(zu)) !== null && t !== void 0 ? t : [];
3537
3537
  for (const i of s) {
3538
3538
  const n = i[0];
3539
3539
  if (n === "z" || n === "Z") {
3540
3540
  e.push([n]);
3541
3541
  continue;
3542
3542
  }
3543
- const r = Gu[n.toLowerCase()];
3543
+ const r = Vu[n.toLowerCase()];
3544
3544
  let o = [];
3545
3545
  if (n === "a" || n === "A") {
3546
3546
  Sa.lastIndex = 0;
3547
3547
  for (let h = null; h = Sa.exec(i); ) o.push(...h.slice(1));
3548
- } else o = i.match(zu) || [];
3548
+ } else o = i.match(Gu) || [];
3549
3549
  for (let h = 0; h < o.length; h += r) {
3550
- const l = new Array(r), c = Ru[n];
3550
+ const l = new Array(r), c = Lu[n];
3551
3551
  l[0] = h > 0 && c ? c : n;
3552
3552
  for (let u = 0; u < r; u++) l[u + 1] = parseFloat(o[h + u]);
3553
3553
  e.push(l);
3554
3554
  }
3555
3555
  }
3556
3556
  return e;
3557
- }, Vu = function(a) {
3557
+ }, Wu = function(a) {
3558
3558
  let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 0, e = new C(a[0]), s = new C(a[1]), i = 1, n = 0;
3559
3559
  const r = [], o = a.length, h = o > 2;
3560
3560
  let l;
@@ -3574,7 +3574,7 @@ function wn(a, t) {
3574
3574
  return e.setProperty(i, n);
3575
3575
  })));
3576
3576
  }
3577
- const Wu = (a, t) => Math.floor(Math.random() * (t - a + 1)) + a;
3577
+ const Xu = (a, t) => Math.floor(Math.random() * (t - a + 1)) + a;
3578
3578
  function il(a) {
3579
3579
  let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
3580
3580
  const e = t.onComplete || os, s = new (mi()).XMLHttpRequest(), i = t.signal, n = function() {
@@ -3596,11 +3596,11 @@ const sn = (a, t) => {
3596
3596
  }
3597
3597
  })(a), e = e.transform(a.transformMatrix)), delete a.transformMatrix, t && (a.scaleX *= t.scaleX, a.scaleY *= t.scaleY, a.cropX = t.cropX, a.cropY = t.cropY, e.x += t.offsetLeft, e.y += t.offsetTop, a.width = t.width, a.height = t.height), a.setPositionByOrigin(e, $, $);
3598
3598
  };
3599
- var Xu = Object.freeze({ __proto__: null, addTransformToObject: mh, animate: ro, animateColor: Dh, applyTransformToObject: Ls, calcAngleBetweenVectors: mn, calcDimensionsMatrix: bi, calcPlaneChangeMatrix: _i, calcVectorRotation: Mh, cancelAnimFrame: rh, capValue: cs, composeMatrix: ch, copyCanvasElement: (a) => {
3599
+ var Uu = Object.freeze({ __proto__: null, addTransformToObject: mh, animate: ro, animateColor: Dh, applyTransformToObject: Ls, calcAngleBetweenVectors: mn, calcDimensionsMatrix: bi, calcPlaneChangeMatrix: _i, calcVectorRotation: Mh, cancelAnimFrame: rh, capValue: cs, composeMatrix: ch, copyCanvasElement: (a) => {
3600
3600
  var t;
3601
3601
  const e = ee(a);
3602
3602
  return (t = e.getContext("2d")) === null || t === void 0 || t.drawImage(a, 0, 0), e;
3603
- }, cos: ge, createCanvasElement: Ae, createImage: oh, createRotateMatrix: fs, createScaleMatrix: Mn, createSkewXMatrix: Kr, createSkewYMatrix: Jr, createTranslateMatrix: Bs, createVector: gn, crossProduct: Ts, degreesToRadians: ft, dotProduct: Ph, ease: Dc, enlivenObjectEnlivables: vi, enlivenObjects: Ds, findScaleToCover: $h, findScaleToFit: Yh, getBoundsOfCurve: Mr, getOrthonormalVector: io, getPathSegmentsInfo: co, getPointOnPath: tl, getPointer: ph, getRandomInt: Wu, getRegularPolygonPath: (a, t) => {
3603
+ }, cos: ge, createCanvasElement: Ae, createImage: oh, createRotateMatrix: fs, createScaleMatrix: Mn, createSkewXMatrix: Kr, createSkewYMatrix: Jr, createTranslateMatrix: Bs, createVector: gn, crossProduct: Ts, degreesToRadians: ft, dotProduct: Ph, ease: Rc, enlivenObjectEnlivables: vi, enlivenObjects: Ds, findScaleToCover: $h, findScaleToFit: Yh, getBoundsOfCurve: Mr, getOrthonormalVector: io, getPathSegmentsInfo: co, getPointOnPath: tl, getPointer: ph, getRandomInt: Xu, getRegularPolygonPath: (a, t) => {
3604
3604
  const e = 2 * Math.PI / a;
3605
3605
  let s = -We;
3606
3606
  a % 2 == 0 && (s += e / 2);
@@ -3610,7 +3610,7 @@ var Xu = Object.freeze({ __proto__: null, addTransformToObject: mh, animate: ro,
3610
3610
  i[n] = [n === 0 ? "M" : "L", o, h];
3611
3611
  }
3612
3612
  return i[a] = ["Z"], i;
3613
- }, getSmoothPathFromPoints: Vu, getSvgAttributes: (a) => {
3613
+ }, getSmoothPathFromPoints: Wu, getSvgAttributes: (a) => {
3614
3614
  const t = ["instantiated_by_use", "style", "id", "class"];
3615
3615
  switch (a) {
3616
3616
  case "linearGradient":
@@ -3630,7 +3630,7 @@ var Xu = Object.freeze({ __proto__: null, addTransformToObject: mh, animate: ro,
3630
3630
  }, multiplyTransformMatrices: mt, multiplyTransformMatrixArray: kn, parsePath: el, parsePreserveAspectRatioAttribute: eo, parseUnit: It, pick: gs, projectStrokeOnPoints: Hh, qrDecompose: hs, radiansToDegrees: Te, removeFromArray: Ke, removeTransformFromObject: (a, t) => {
3631
3631
  const e = $t(t), s = mt(e, a.calcOwnMatrix());
3632
3632
  Ls(a, s);
3633
- }, removeTransformMatrixForSvgParsing: sn, request: il, requestAnimFrame: ii, resetObjectTransform: bh, rotatePoint: (a, t, e) => a.rotate(e, t), rotateVector: so, saveObjectTransform: Qr, sendObjectToPlane: xr, sendPointToPlane: as, sendVectorToPlane: vh, setStyle: wn, sin: pe, sizeAfterTransform: Pn, string: au, stylesFromArray: Vh, stylesToArray: Gh, toBlob: qr, toDataURL: $r, toFixed: nt, transformPath: (a, t, e) => (e && (t = mt(t, [1, 0, 0, 1, -e.x, -e.y])), a.map(((s) => {
3633
+ }, removeTransformMatrixForSvgParsing: sn, request: il, requestAnimFrame: ii, resetObjectTransform: bh, rotatePoint: (a, t, e) => a.rotate(e, t), rotateVector: so, saveObjectTransform: Qr, sendObjectToPlane: xr, sendPointToPlane: as, sendVectorToPlane: vh, setStyle: wn, sin: pe, sizeAfterTransform: Pn, string: hu, stylesFromArray: Vh, stylesToArray: Gh, toBlob: qr, toDataURL: $r, toFixed: nt, transformPath: (a, t, e) => (e && (t = mt(t, [1, 0, 0, 1, -e.x, -e.y])), a.map(((s) => {
3634
3634
  const i = [...s];
3635
3635
  for (let n = 1; n < s.length - 1; n += 2) {
3636
3636
  const { x: r, y: o } = Mt({ x: s[n], y: s[n + 1] }, t);
@@ -3638,7 +3638,7 @@ var Xu = Object.freeze({ __proto__: null, addTransformToObject: mh, animate: ro,
3638
3638
  }
3639
3639
  return i;
3640
3640
  }))), transformPoint: Mt });
3641
- class Uu extends gh {
3641
+ class Yu extends gh {
3642
3642
  constructor(t) {
3643
3643
  let { allowTouchScrolling: e = !1, containerClass: s = "" } = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
3644
3644
  super(t), x(this, "upper", void 0), x(this, "container", void 0);
@@ -3694,7 +3694,7 @@ class Nn extends yi {
3694
3694
  return this.elements.container;
3695
3695
  }
3696
3696
  initElements(t) {
3697
- this.elements = new Uu(t, { allowTouchScrolling: this.allowTouchScrolling, containerClass: this.containerClass }), this._createCacheCanvas();
3697
+ this.elements = new Yu(t, { allowTouchScrolling: this.allowTouchScrolling, containerClass: this.containerClass }), this._createCacheCanvas();
3698
3698
  }
3699
3699
  _onObjectAdded(t) {
3700
3700
  this._objectsToRender = void 0, super._onObjectAdded(t);
@@ -3751,7 +3751,7 @@ class Nn extends yi {
3751
3751
  }
3752
3752
  _setupCurrentTransform(t, e, s) {
3753
3753
  var i;
3754
- const n = e.group ? as(this.getScenePoint(t), void 0, e.group.calcTransformMatrix()) : this.getScenePoint(t), { key: r = "", control: o } = e.getActiveControl() || {}, h = s && o ? (i = o.getActionHandler(t, e, o)) === null || i === void 0 ? void 0 : i.bind(o) : xc, l = ((f, g, p, b) => {
3754
+ const n = e.group ? as(this.getScenePoint(t), void 0, e.group.calcTransformMatrix()) : this.getScenePoint(t), { key: r = "", control: o } = e.getActiveControl() || {}, h = s && o ? (i = o.getActionHandler(t, e, o)) === null || i === void 0 ? void 0 : i.bind(o) : Sc, l = ((f, g, p, b) => {
3755
3755
  if (!g || !f) return "drag";
3756
3756
  const m = b.controls[g];
3757
3757
  return m.getActionName(p, m, b);
@@ -3927,7 +3927,7 @@ class Nn extends yi {
3927
3927
  }
3928
3928
  }
3929
3929
  x(Nn, "ownDefaults", { uniformScaling: !0, uniScaleKey: "shiftKey", centeredScaling: !1, centeredRotation: !1, centeredKey: "altKey", altActionKey: "shiftKey", selection: !0, selectionKey: "shiftKey", selectionColor: "rgba(100, 100, 255, 0.3)", selectionDashArray: [], selectionBorderColor: "rgba(255, 255, 255, 0.3)", selectionLineWidth: 1, selectionFullyContained: !1, hoverCursor: "move", moveCursor: "move", defaultCursor: "default", freeDrawingCursor: "crosshair", notAllowedCursor: "not-allowed", perPixelTargetFind: !1, targetFindTolerance: 0, skipTargetFind: !1, stopContextMenu: !1, fireRightClick: !1, fireMiddleClick: !1, enablePointerEvents: !1, containerClass: "canvas-container", preserveObjectStacking: !1 });
3930
- class Yu {
3930
+ class $u {
3931
3931
  constructor(t) {
3932
3932
  x(this, "targets", []), x(this, "__disposer", void 0);
3933
3933
  const e = () => {
@@ -3964,7 +3964,7 @@ class Yu {
3964
3964
  this.clear(), this.__disposer(), delete this.__disposer;
3965
3965
  }
3966
3966
  }
3967
- const $u = ["target", "oldTarget", "fireCanvas", "e"], Kt = { passive: !1 }, ys = (a, t) => {
3967
+ const qu = ["target", "oldTarget", "fireCanvas", "e"], Kt = { passive: !1 }, ys = (a, t) => {
3968
3968
  const e = a.getViewportPoint(t), s = a.getScenePoint(t);
3969
3969
  return { viewportPoint: e, scenePoint: s, pointer: e, absolutePointer: s };
3970
3970
  }, ze = function(a) {
@@ -3973,10 +3973,10 @@ const $u = ["target", "oldTarget", "fireCanvas", "e"], Kt = { passive: !1 }, ys
3973
3973
  }, se = function(a) {
3974
3974
  for (var t = arguments.length, e = new Array(t > 1 ? t - 1 : 0), s = 1; s < t; s++) e[s - 1] = arguments[s];
3975
3975
  return a.removeEventListener(...e);
3976
- }, qu = { mouse: { in: "over", out: "out", targetIn: "mouseover", targetOut: "mouseout", canvasIn: "mouse:over", canvasOut: "mouse:out" }, drag: { in: "enter", out: "leave", targetIn: "dragenter", targetOut: "dragleave", canvasIn: "drag:enter", canvasOut: "drag:leave" } };
3976
+ }, Ku = { mouse: { in: "over", out: "out", targetIn: "mouseover", targetOut: "mouseout", canvasIn: "mouse:over", canvasOut: "mouse:out" }, drag: { in: "enter", out: "leave", targetIn: "dragenter", targetOut: "dragleave", canvasIn: "drag:enter", canvasOut: "drag:leave" } };
3977
3977
  class Pr extends Nn {
3978
3978
  constructor(t) {
3979
- super(t, arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}), x(this, "_isClick", void 0), x(this, "textEditingManager", new Yu(this)), ["_onMouseDown", "_onTouchStart", "_onMouseMove", "_onMouseUp", "_onTouchEnd", "_onResize", "_onMouseWheel", "_onMouseOut", "_onMouseEnter", "_onContextMenu", "_onClick", "_onDragStart", "_onDragEnd", "_onDragProgress", "_onDragOver", "_onDragEnter", "_onDragLeave", "_onDrop"].forEach(((e) => {
3979
+ super(t, arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}), x(this, "_isClick", void 0), x(this, "textEditingManager", new $u(this)), ["_onMouseDown", "_onTouchStart", "_onMouseMove", "_onMouseUp", "_onTouchEnd", "_onResize", "_onMouseWheel", "_onMouseOut", "_onMouseEnter", "_onContextMenu", "_onClick", "_onDragStart", "_onDragEnd", "_onDragProgress", "_onDragOver", "_onDragEnter", "_onDragLeave", "_onDrop"].forEach(((e) => {
3980
3980
  this[e] = this[e].bind(this);
3981
3981
  })), this.addOrRemove(ze, "add");
3982
3982
  }
@@ -4220,8 +4220,8 @@ class Pr extends Nn {
4220
4220
  this._draggedoverTarget = t;
4221
4221
  }
4222
4222
  fireSyntheticInOutEvents(t, e) {
4223
- let { target: s, oldTarget: i, fireCanvas: n, e: r } = e, o = ht(e, $u);
4224
- const { targetIn: h, targetOut: l, canvasIn: c, canvasOut: u } = qu[t], d = i !== s;
4223
+ let { target: s, oldTarget: i, fireCanvas: n, e: r } = e, o = at(e, qu);
4224
+ const { targetIn: h, targetOut: l, canvasIn: c, canvasOut: u } = Ku[t], d = i !== s;
4225
4225
  if (i && d) {
4226
4226
  const f = w(w({}, o), {}, { e: r, target: i, nextTarget: s }, ys(this, r));
4227
4227
  n && this.fire(u, f), i.fire(l, f);
@@ -4289,7 +4289,7 @@ class Pr extends Nn {
4289
4289
  this.removeListeners(), this.textEditingManager.dispose(), super.destroy();
4290
4290
  }
4291
4291
  }
4292
- const nl = { x1: 0, y1: 0, x2: 0, y2: 0 }, Ku = w(w({}, nl), {}, { r1: 0, r2: 0 }), Ss = (a, t) => isNaN(a) && typeof t == "number" ? t : a;
4292
+ const nl = { x1: 0, y1: 0, x2: 0, y2: 0 }, Ju = w(w({}, nl), {}, { r1: 0, r2: 0 }), Ss = (a, t) => isNaN(a) && typeof t == "number" ? t : a;
4293
4293
  function rl(a) {
4294
4294
  return a && /%$/.test(a) && Number.isFinite(parseFloat(a));
4295
4295
  }
@@ -4297,24 +4297,24 @@ function ol(a, t) {
4297
4297
  const e = typeof a == "number" ? a : typeof a == "string" ? parseFloat(a) / (rl(a) ? 100 : 1) : NaN;
4298
4298
  return cs(0, Ss(e, t), 1);
4299
4299
  }
4300
- const Ju = /\s*;\s*/, Zu = /\s*:\s*/;
4301
- function Qu(a, t) {
4300
+ const Zu = /\s*;\s*/, Qu = /\s*:\s*/;
4301
+ function td(a, t) {
4302
4302
  let e, s;
4303
4303
  const i = a.getAttribute("style");
4304
4304
  if (i) {
4305
- const r = i.split(Ju);
4305
+ const r = i.split(Zu);
4306
4306
  r[r.length - 1] === "" && r.pop();
4307
4307
  for (let o = r.length; o--; ) {
4308
- const [h, l] = r[o].split(Zu).map(((c) => c.trim()));
4308
+ const [h, l] = r[o].split(Qu).map(((c) => c.trim()));
4309
4309
  h === "stop-color" ? e = l : h === "stop-opacity" && (s = l);
4310
4310
  }
4311
4311
  }
4312
4312
  const n = new it(e || a.getAttribute("stop-color") || "rgb(0,0,0)");
4313
4313
  return { offset: ol(a.getAttribute("offset"), 0), color: n.toRgb(), opacity: Ss(parseFloat(s || a.getAttribute("stop-opacity") || ""), 1) * n.getAlpha() * t };
4314
4314
  }
4315
- function td(a, t) {
4315
+ function ed(a, t) {
4316
4316
  const e = [], s = a.getElementsByTagName("stop"), i = ol(t, 1);
4317
- for (let n = s.length; n--; ) e.push(Qu(s[n], i));
4317
+ for (let n = s.length; n--; ) e.push(td(s[n], i));
4318
4318
  return e;
4319
4319
  }
4320
4320
  function al(a) {
@@ -4326,7 +4326,7 @@ function hl(a) {
4326
4326
  function ae(a, t) {
4327
4327
  return a.getAttribute(t);
4328
4328
  }
4329
- function ed(a, t) {
4329
+ function sd(a, t) {
4330
4330
  return (function(e, s) {
4331
4331
  let i, { width: n, height: r, gradientUnits: o } = s;
4332
4332
  return Object.entries(e).reduce(((h, l) => {
@@ -4348,7 +4348,7 @@ function ed(a, t) {
4348
4348
  class Qs {
4349
4349
  constructor(t) {
4350
4350
  const { type: e = "linear", gradientUnits: s = "pixels", coords: i = {}, colorStops: n = [], offsetX: r = 0, offsetY: o = 0, gradientTransform: h, id: l } = t || {};
4351
- Object.assign(this, { type: e, gradientUnits: s, coords: w(w({}, e === "radial" ? Ku : nl), i), colorStops: n, offsetX: r, offsetY: o, gradientTransform: h, id: l ? "".concat(l, "_").concat(Xe()) : Xe() });
4351
+ Object.assign(this, { type: e, gradientUnits: s, coords: w(w({}, e === "radial" ? Ju : nl), i), colorStops: n, offsetX: r, offsetY: o, gradientTransform: h, id: l ? "".concat(l, "_").concat(Xe()) : Xe() });
4352
4352
  }
4353
4353
  addColorStop(t) {
4354
4354
  for (const e in t) {
@@ -4405,11 +4405,11 @@ class Qs {
4405
4405
  }
4406
4406
  static fromElement(t, e, s) {
4407
4407
  const i = hl(t), n = e._findCenterFromElement();
4408
- return new this(w({ id: t.getAttribute("id") || void 0, type: al(t), coords: ed(t, { width: s.viewBoxWidth || s.width, height: s.viewBoxHeight || s.height }), colorStops: td(t, s.opacity), gradientUnits: i, gradientTransform: bn(t.getAttribute("gradientTransform") || "") }, i === "pixels" ? { offsetX: e.width / 2 - n.x, offsetY: e.height / 2 - n.y } : { offsetX: 0, offsetY: 0 }));
4408
+ return new this(w({ id: t.getAttribute("id") || void 0, type: al(t), coords: sd(t, { width: s.viewBoxWidth || s.width, height: s.viewBoxHeight || s.height }), colorStops: ed(t, s.opacity), gradientUnits: i, gradientTransform: bn(t.getAttribute("gradientTransform") || "") }, i === "pixels" ? { offsetX: e.width / 2 - n.x, offsetY: e.height / 2 - n.y } : { offsetX: 0, offsetY: 0 }));
4409
4409
  }
4410
4410
  }
4411
4411
  x(Qs, "type", "Gradient"), L.setClass(Qs, "gradient"), L.setClass(Qs, "linear"), L.setClass(Qs, "radial");
4412
- const sd = ["type", "source", "patternTransform"];
4412
+ const id = ["type", "source", "patternTransform"];
4413
4413
  class nr {
4414
4414
  get type() {
4415
4415
  return "pattern";
@@ -4444,16 +4444,16 @@ class nr {
4444
4444
  `);
4445
4445
  }
4446
4446
  static async fromObject(t, e) {
4447
- let { type: s, source: i, patternTransform: n } = t, r = ht(t, sd);
4447
+ let { type: s, source: i, patternTransform: n } = t, r = at(t, id);
4448
4448
  const o = await ni(i, w(w({}, e), {}, { crossOrigin: r.crossOrigin }));
4449
4449
  return new this(w(w({}, r), {}, { patternTransform: n && n.slice(0), source: o }));
4450
4450
  }
4451
4451
  }
4452
4452
  x(nr, "type", "Pattern"), L.setClass(nr), L.setClass(nr, "pattern");
4453
- const id = ["path", "left", "top"], nd = ["d"];
4453
+ const nd = ["path", "left", "top"], rd = ["d"];
4454
4454
  class Ze extends Rt {
4455
4455
  constructor(t) {
4456
- let e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, { path: s, left: i, top: n } = e, r = ht(e, id);
4456
+ let e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, { path: s, left: i, top: n } = e, r = at(e, nd);
4457
4457
  super(), Object.assign(this, Ze.ownDefaults), this.setOptions(r), this._setPath(t || [], !0), typeof i == "number" && this.set(et, i), typeof n == "number" && this.set(qt, n);
4458
4458
  }
4459
4459
  _setPath(t, e) {
@@ -4555,11 +4555,11 @@ class Ze extends Rt {
4555
4555
  }
4556
4556
  static async fromElement(t, e, s) {
4557
4557
  const i = Be(t, this.ATTRIBUTE_NAMES, s), { d: n } = i;
4558
- return new this(n, w(w(w({}, ht(i, nd)), e), {}, { left: void 0, top: void 0 }));
4558
+ return new this(n, w(w(w({}, at(i, rd)), e), {}, { left: void 0, top: void 0 }));
4559
4559
  }
4560
4560
  }
4561
4561
  x(Ze, "type", "Path"), x(Ze, "cacheProperties", [...je, "path", "fillRule"]), x(Ze, "ATTRIBUTE_NAMES", [...$e, "d"]), L.setClass(Ze), L.setSVGClass(Ze);
4562
- const rd = ["left", "top", "radius"], ll = ["radius", "startAngle", "endAngle", "counterClockwise"];
4562
+ const od = ["left", "top", "radius"], ll = ["radius", "startAngle", "endAngle", "counterClockwise"];
4563
4563
  class Oe extends Rt {
4564
4564
  static getDefaults() {
4565
4565
  return w(w({}, super.getDefaults()), Oe.ownDefaults);
@@ -4598,14 +4598,14 @@ class Oe extends Rt {
4598
4598
  }
4599
4599
  static async fromElement(t, e, s) {
4600
4600
  const i = Be(t, this.ATTRIBUTE_NAMES, s), { left: n = 0, top: r = 0, radius: o = 0 } = i;
4601
- return new this(w(w({}, ht(i, rd)), {}, { radius: o, left: n - o, top: r - o }));
4601
+ return new this(w(w({}, at(i, od)), {}, { radius: o, left: n - o, top: r - o }));
4602
4602
  }
4603
4603
  static fromObject(t) {
4604
4604
  return super._fromObject(t);
4605
4605
  }
4606
4606
  }
4607
4607
  x(Oe, "type", "Circle"), x(Oe, "cacheProperties", [...je, ...ll]), x(Oe, "ownDefaults", { radius: 0, startAngle: 0, endAngle: 360, counterClockwise: !1 }), x(Oe, "ATTRIBUTE_NAMES", ["cx", "cy", "r", ...$e]), L.setClass(Oe), L.setSVGClass(Oe);
4608
- const od = ["x1", "y1", "x2", "y2"], ad = ["x1", "y1", "x2", "y2"], Or = ["x1", "x2", "y1", "y2"];
4608
+ const ad = ["x1", "y1", "x2", "y2"], hd = ["x1", "y1", "x2", "y2"], Or = ["x1", "x2", "y1", "y2"];
4609
4609
  class Qe extends Rt {
4610
4610
  constructor() {
4611
4611
  let [t, e, s, i] = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : [0, 0, 0, 0], n = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
@@ -4652,10 +4652,10 @@ class Qe extends Rt {
4652
4652
  }
4653
4653
  static async fromElement(t, e, s) {
4654
4654
  const i = Be(t, this.ATTRIBUTE_NAMES, s), { x1: n = 0, y1: r = 0, x2: o = 0, y2: h = 0 } = i;
4655
- return new this([n, r, o, h], ht(i, od));
4655
+ return new this([n, r, o, h], at(i, ad));
4656
4656
  }
4657
4657
  static fromObject(t) {
4658
- let { x1: e, y1: s, x2: i, y2: n } = t, r = ht(t, ad);
4658
+ let { x1: e, y1: s, x2: i, y2: n } = t, r = at(t, hd);
4659
4659
  return this._fromObject(w(w({}, r), {}, { points: [e, s, i, n] }), { extraParam: "points" });
4660
4660
  }
4661
4661
  }
@@ -4717,14 +4717,14 @@ class De extends Rt {
4717
4717
  return i.left = (i.left || 0) - i.rx, i.top = (i.top || 0) - i.ry, new this(i);
4718
4718
  }
4719
4719
  }
4720
- function hd(a) {
4720
+ function ld(a) {
4721
4721
  if (!a) return [];
4722
4722
  const t = a.replace(/,/g, " ").trim().split(/\s+/), e = [];
4723
4723
  for (let s = 0; s < t.length; s += 2) e.push({ x: parseFloat(t[s]), y: parseFloat(t[s + 1]) });
4724
4724
  return e;
4725
4725
  }
4726
4726
  x(De, "type", "Ellipse"), x(De, "cacheProperties", [...je, ...cl]), x(De, "ownDefaults", { rx: 0, ry: 0 }), x(De, "ATTRIBUTE_NAMES", [...$e, "cx", "cy", "rx", "ry"]), L.setClass(De), L.setSVGClass(De);
4727
- const ld = ["left", "top"], ul = { exactBoundingBox: !1 };
4727
+ const cd = ["left", "top"], ul = { exactBoundingBox: !1 };
4728
4728
  class ce extends Rt {
4729
4729
  static getDefaults() {
4730
4730
  return w(w({}, super.getDefaults()), ce.ownDefaults);
@@ -4814,7 +4814,7 @@ class ce extends Rt {
4814
4814
  return this.points.length;
4815
4815
  }
4816
4816
  static async fromElement(t, e, s) {
4817
- return new this(hd(t.getAttribute("points")), w(w({}, ht(Be(t, this.ATTRIBUTE_NAMES, s), ld)), e));
4817
+ return new this(ld(t.getAttribute("points")), w(w({}, at(Be(t, this.ATTRIBUTE_NAMES, s), cd)), e));
4818
4818
  }
4819
4819
  static fromObject(t) {
4820
4820
  return this._fromObject(t, { extraParam: "points" });
@@ -4907,8 +4907,8 @@ class dl extends Rt {
4907
4907
  delete this.styles[t];
4908
4908
  }
4909
4909
  }
4910
- x(dl, "_styleProperties", Sc);
4911
- const cd = / +/g, ud = /"/g;
4910
+ x(dl, "_styleProperties", Cc);
4911
+ const ud = / +/g, dd = /"/g;
4912
4912
  function rr(a, t, e, s, i) {
4913
4913
  return " ".concat((function(n, r) {
4914
4914
  let { left: o, top: h, width: l, height: c } = r, u = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : tt.NUM_FRACTION_DIGITS;
@@ -4917,7 +4917,7 @@ function rr(a, t, e, s, i) {
4917
4917
  })(a, { left: t, top: e, width: s, height: i }), `
4918
4918
  `);
4919
4919
  }
4920
- const dd = ["textAnchor", "textDecoration", "dx", "dy", "top", "left", "fontSize", "strokeWidth"];
4920
+ const fd = ["textAnchor", "textDecoration", "dx", "dy", "top", "left", "fontSize", "strokeWidth"];
4921
4921
  let or;
4922
4922
  class kt extends dl {
4923
4923
  static getDefaults() {
@@ -5195,14 +5195,14 @@ class kt extends dl {
5195
5195
  for (let I = 0, O = d.length; I < O; I++) {
5196
5196
  const D = this.__charBounds[l][I];
5197
5197
  _ = this.getValueOfPropertyAt(l, I, e), S = this.getValueOfPropertyAt(l, I, wt), A = this.getValueOfPropertyAt(l, I, ls);
5198
- const z = this.getHeightOfChar(l, I), M = this.getValueOfPropertyAt(l, I, "deltaY");
5198
+ const H = this.getHeightOfChar(l, I), M = this.getValueOfPropertyAt(l, I, "deltaY");
5199
5199
  if (n && _ && S) {
5200
5200
  const R = this.fontSize * A / 1e3;
5201
- t.save(), t.fillStyle = v, t.translate(D.renderLeft, D.renderTop), t.rotate(D.angle), t.fillRect(-D.kernedWidth / 2, h * z + M - o * R, D.kernedWidth, R), t.restore();
5202
- } else if ((_ !== m || S !== v || z !== k || A !== y || M !== P) && b > 0) {
5201
+ t.save(), t.fillStyle = v, t.translate(D.renderLeft, D.renderTop), t.rotate(D.angle), t.fillRect(-D.kernedWidth / 2, h * H + M - o * R, D.kernedWidth, R), t.restore();
5202
+ } else if ((_ !== m || S !== v || H !== k || A !== y || M !== P) && b > 0) {
5203
5203
  const R = this.fontSize * y / 1e3;
5204
5204
  let W = i + g + p;
5205
- this.direction === "rtl" && (W = this.width - W - b), m && v && y && (t.fillStyle = v, t.fillRect(W, T + h * k + P - o * R, b, R)), p = D.left, b = D.width, m = _, y = A, v = S, k = z, P = M;
5205
+ this.direction === "rtl" && (W = this.width - W - b), m && v && y && (t.fillStyle = v, t.fillRect(W, T + h * k + P - o * R, b, R)), p = D.left, b = D.width, m = _, y = A, v = S, k = H, P = M;
5206
5206
  } else b += D.kernedWidth;
5207
5207
  }
5208
5208
  let N = i + g + p;
@@ -5246,7 +5246,7 @@ class kt extends dl {
5246
5246
  return 1;
5247
5247
  }
5248
5248
  static async fromElement(t, e, s) {
5249
- const i = Be(t, kt.ATTRIBUTE_NAMES, s), n = w(w({}, e), i), { textAnchor: r = et, textDecoration: o = "", dx: h = 0, dy: l = 0, top: c = 0, left: u = 0, fontSize: d = Wr, strokeWidth: f = 1 } = n, g = ht(n, dd), p = new this(dn(t.textContent || "").trim(), w({ left: u + h, top: c + l, underline: o.includes("underline"), overline: o.includes("overline"), linethrough: o.includes("line-through"), strokeWidth: 0, fontSize: d }, g)), b = p.getScaledHeight() / p.height, m = ((p.height + p.strokeWidth) * p.lineHeight - p.height) * b, v = p.getScaledHeight() + m;
5249
+ const i = Be(t, kt.ATTRIBUTE_NAMES, s), n = w(w({}, e), i), { textAnchor: r = et, textDecoration: o = "", dx: h = 0, dy: l = 0, top: c = 0, left: u = 0, fontSize: d = Wr, strokeWidth: f = 1 } = n, g = at(n, fd), p = new this(dn(t.textContent || "").trim(), w({ left: u + h, top: c + l, underline: o.includes("underline"), overline: o.includes("overline"), linethrough: o.includes("line-through"), strokeWidth: 0, fontSize: d }, g)), b = p.getScaledHeight() / p.height, m = ((p.height + p.strokeWidth) * p.lineHeight - p.height) * b, v = p.getScaledHeight() + m;
5250
5250
  let y = 0;
5251
5251
  return r === $ && (y = p.getScaledWidth() / 2), r === pt && (y = p.getScaledWidth()), p.set({ left: p.left - y, top: p.top - (v - p.fontSize * (0.07 + p._fontSizeFraction)) / p.lineHeight, strokeWidth: f }), p;
5252
5252
  }
@@ -5254,7 +5254,7 @@ class kt extends dl {
5254
5254
  return this._fromObject(w(w({}, t), {}, { styles: Vh(t.styles || {}, t.text) }), { extraParam: "text" });
5255
5255
  }
5256
5256
  }
5257
- x(kt, "textLayoutProperties", Th), x(kt, "cacheProperties", [...je, ...Eh]), x(kt, "ownDefaults", Cc), x(kt, "type", "Text"), x(kt, "genericFonts", ["serif", "sans-serif", "monospace", "cursive", "fantasy", "system-ui", "ui-serif", "ui-sans-serif", "ui-monospace", "ui-rounded", "math", "emoji", "fangsong"]), x(kt, "ATTRIBUTE_NAMES", $e.concat("x", "y", "dx", "dy", "font-family", "font-style", "font-weight", "font-size", "letter-spacing", "text-decoration", "text-anchor")), Nh(kt, [class extends Sh {
5257
+ x(kt, "textLayoutProperties", Th), x(kt, "cacheProperties", [...je, ...Eh]), x(kt, "ownDefaults", Ac), x(kt, "type", "Text"), x(kt, "genericFonts", ["serif", "sans-serif", "monospace", "cursive", "fantasy", "system-ui", "ui-serif", "ui-sans-serif", "ui-monospace", "ui-rounded", "math", "emoji", "fangsong"]), x(kt, "ATTRIBUTE_NAMES", $e.concat("x", "y", "dx", "dy", "font-family", "font-style", "font-weight", "font-size", "letter-spacing", "text-decoration", "text-anchor")), Nh(kt, [class extends Sh {
5258
5258
  _toSVG() {
5259
5259
  const a = this._getSVGLeftTopOffsets(), t = this._getSVGTextAndBg(a.textTop, a.textLeft);
5260
5260
  return this._wrapSVGTextAndBg(t);
@@ -5269,7 +5269,7 @@ x(kt, "textLayoutProperties", Th), x(kt, "cacheProperties", [...je, ...Eh]), x(k
5269
5269
  _wrapSVGTextAndBg(a) {
5270
5270
  let { textBgRects: t, textSpans: e } = a;
5271
5271
  const s = this.getSvgTextDecoration(this);
5272
- return [t.join(""), ' <text xml:space="preserve" ', 'font-family="'.concat(this.fontFamily.replace(ud, "'"), '" '), 'font-size="'.concat(this.fontSize, '" '), this.fontStyle ? 'font-style="'.concat(this.fontStyle, '" ') : "", this.fontWeight ? 'font-weight="'.concat(this.fontWeight, '" ') : "", s ? 'text-decoration="'.concat(s, '" ') : "", this.direction === "rtl" ? 'direction="'.concat(this.direction, '" ') : "", 'style="', this.getSvgStyles(!0), '"', this.addPaintOrder(), " >", e.join(""), `</text>
5272
+ return [t.join(""), ' <text xml:space="preserve" ', 'font-family="'.concat(this.fontFamily.replace(dd, "'"), '" '), 'font-size="'.concat(this.fontSize, '" '), this.fontStyle ? 'font-style="'.concat(this.fontStyle, '" ') : "", this.fontWeight ? 'font-weight="'.concat(this.fontWeight, '" ') : "", s ? 'text-decoration="'.concat(s, '" ') : "", this.direction === "rtl" ? 'direction="'.concat(this.direction, '" ') : "", 'style="', this.getSvgStyles(!0), '"', this.addPaintOrder(), " >", e.join(""), `</text>
5273
5273
  `];
5274
5274
  }
5275
5275
  _getSVGTextAndBg(a, t) {
@@ -5280,7 +5280,7 @@ x(kt, "textLayoutProperties", Th), x(kt, "cacheProperties", [...je, ...Eh]), x(k
5280
5280
  return { textSpans: e, textBgRects: s };
5281
5281
  }
5282
5282
  _createTextCharSpan(a, t, e, s, i) {
5283
- const n = tt.NUM_FRACTION_DIGITS, r = this.getSvgSpanStyles(t, a !== a.trim() || !!a.match(cd)), o = r ? 'style="'.concat(r, '"') : "", h = t.deltaY, l = h ? ' dy="'.concat(nt(h, n), '" ') : "", { angle: c, renderLeft: u, renderTop: d, width: f } = i;
5283
+ const n = tt.NUM_FRACTION_DIGITS, r = this.getSvgSpanStyles(t, a !== a.trim() || !!a.match(ud)), o = r ? 'style="'.concat(r, '"') : "", h = t.deltaY, l = h ? ' dy="'.concat(nt(h, n), '" ') : "", { angle: c, renderLeft: u, renderTop: d, width: f } = i;
5284
5284
  let g = "";
5285
5285
  if (u !== void 0) {
5286
5286
  const p = f / 2;
@@ -5324,7 +5324,7 @@ x(kt, "textLayoutProperties", Th), x(kt, "cacheProperties", [...je, ...Eh]), x(k
5324
5324
  return ["overline", "underline", "line-through"].filter(((t) => a[t.replace("-", "")])).join(" ");
5325
5325
  }
5326
5326
  }]), L.setClass(kt), L.setSVGClass(kt);
5327
- class fd {
5327
+ class gd {
5328
5328
  constructor(t) {
5329
5329
  x(this, "target", void 0), x(this, "__mouseDownInPlace", !1), x(this, "__dragStartFired", !1), x(this, "__isDraggingOver", !1), x(this, "__dragStartSelection", void 0), x(this, "__dragImageDisposer", void 0), x(this, "_dispose", void 0), this.target = t;
5330
5330
  const e = [this.target.on("dragenter", this.dragEnterHandler.bind(this)), this.target.on("dragover", this.dragOverHandler.bind(this)), this.target.on("dragleave", this.dragLeaveHandler.bind(this)), this.target.on("dragend", this.dragEndHandler.bind(this)), this.target.on("drop", this.dropHandler.bind(this))];
@@ -5425,7 +5425,7 @@ class fd {
5425
5425
  }
5426
5426
  }
5427
5427
  const Ca = /[ \n\.,;!\?\-]/;
5428
- class gd extends kt {
5428
+ class pd extends kt {
5429
5429
  constructor() {
5430
5430
  super(...arguments), x(this, "_currentCursorOpacity", 1);
5431
5431
  }
@@ -5660,7 +5660,7 @@ class gd extends kt {
5660
5660
  s <= t ? (e === t ? this._selectionDirection = et : this._selectionDirection === pt && (this._selectionDirection = et, this.selectionEnd = t), this.selectionStart = s) : s > t && s < e ? this._selectionDirection === pt ? this.selectionEnd = s : this.selectionStart = s : (e === t ? this._selectionDirection = pt : this._selectionDirection === et && (this._selectionDirection = pt, this.selectionStart = e), this.selectionEnd = s);
5661
5661
  }
5662
5662
  }
5663
- class pd extends gd {
5663
+ class md extends pd {
5664
5664
  initHiddenTextarea() {
5665
5665
  const t = this.canvas && ue(this.canvas.getElement()) || Is(), e = t.createElement("textarea");
5666
5666
  Object.entries({ autocapitalize: "off", autocorrect: "off", autocomplete: "off", spellcheck: "false", "data-fabric": "textarea", wrap: "off", name: "fabricTextarea" }).map(((r) => {
@@ -5817,12 +5817,12 @@ class pd extends gd {
5817
5817
  }
5818
5818
  }
5819
5819
  const Aa = (a) => !!a.button;
5820
- class md extends pd {
5820
+ class bd extends md {
5821
5821
  constructor() {
5822
5822
  super(...arguments), x(this, "draggableTextDelegate", void 0);
5823
5823
  }
5824
5824
  initBehavior() {
5825
- this.on("mousedown", this._mouseDownHandler), this.on("mouseup", this.mouseUpHandler), this.on("mousedblclick", this.doubleClickHandler), this.on("mousetripleclick", this.tripleClickHandler), this.draggableTextDelegate = new fd(this), super.initBehavior();
5825
+ this.on("mousedown", this._mouseDownHandler), this.on("mouseup", this.mouseUpHandler), this.on("mousedblclick", this.doubleClickHandler), this.on("mousetripleclick", this.tripleClickHandler), this.draggableTextDelegate = new gd(this), super.initBehavior();
5826
5826
  }
5827
5827
  shouldStartDragging() {
5828
5828
  return this.draggableTextDelegate.isActive();
@@ -5879,8 +5879,8 @@ const Pi = "moveCursorUp", Oi = "moveCursorDown", Di = "moveCursorLeft", Ri = "m
5879
5879
  a.setTransform(e, 0, 0, e, 0, 0);
5880
5880
  const s = t.viewportTransform;
5881
5881
  a.transform(s[0], s[1], s[2], s[3], s[4], s[5]);
5882
- }, bd = w({ selectionStart: 0, selectionEnd: 0, selectionColor: "rgba(17,119,255,0.3)", isEditing: !1, editable: !0, editingBorderColor: "rgba(102,153,255,0.25)", cursorWidth: 2, cursorColor: "", cursorDelay: 1e3, cursorDuration: 600, caching: !0, hiddenTextareaContainer: null, keysMap: { 9: Li, 27: Li, 33: Pi, 34: Oi, 35: Ri, 36: Di, 37: Di, 38: Pi, 39: Ri, 40: Oi }, keysMapRtl: { 9: Li, 27: Li, 33: Pi, 34: Oi, 35: Di, 36: Ri, 37: Ri, 38: Pi, 39: Di, 40: Oi }, ctrlKeysMapDown: { 65: "cmdAll" }, ctrlKeysMapUp: { 67: "copy", 88: "cut" } }, { _selectionDirection: null, _reSpace: /\s|\r?\n/, inCompositionMode: !1 });
5883
- class Le extends md {
5882
+ }, vd = w({ selectionStart: 0, selectionEnd: 0, selectionColor: "rgba(17,119,255,0.3)", isEditing: !1, editable: !0, editingBorderColor: "rgba(102,153,255,0.25)", cursorWidth: 2, cursorColor: "", cursorDelay: 1e3, cursorDuration: 600, caching: !0, hiddenTextareaContainer: null, keysMap: { 9: Li, 27: Li, 33: Pi, 34: Oi, 35: Ri, 36: Di, 37: Di, 38: Pi, 39: Ri, 40: Oi }, keysMapRtl: { 9: Li, 27: Li, 33: Pi, 34: Oi, 35: Di, 36: Ri, 37: Ri, 38: Pi, 39: Di, 40: Oi }, ctrlKeysMapDown: { 65: "cmdAll" }, ctrlKeysMapUp: { 67: "copy", 88: "cut" } }, { _selectionDirection: null, _reSpace: /\s|\r?\n/, inCompositionMode: !1 });
5883
+ class Le extends bd {
5884
5884
  static getDefaults() {
5885
5885
  return w(w({}, super.getDefaults()), Le.ownDefaults);
5886
5886
  }
@@ -6034,7 +6034,7 @@ class Le extends md {
6034
6034
  this.exitEditingImpl(), this.draggableTextDelegate.dispose(), super.dispose();
6035
6035
  }
6036
6036
  }
6037
- x(Le, "ownDefaults", bd), x(Le, "type", "IText"), L.setClass(Le), L.setClass(Le, "i-text");
6037
+ x(Le, "ownDefaults", vd), x(Le, "type", "IText"), L.setClass(Le), L.setClass(Le, "i-text");
6038
6038
  class es extends Le {
6039
6039
  static getDefaults() {
6040
6040
  return w(w({}, super.getDefaults()), es.ownDefaults);
@@ -6043,7 +6043,7 @@ class es extends Le {
6043
6043
  super(t, w(w({}, es.ownDefaults), e));
6044
6044
  }
6045
6045
  static createControls() {
6046
- return { controls: iu() };
6046
+ return { controls: nu() };
6047
6047
  }
6048
6048
  initDimensions() {
6049
6049
  this.initialized && (this.isEditing && this.initDelayedCursor(), this._clearCache(), this.dynamicMinWidth = 0, this._styleMap = this._generateStyleMap(this._splitText()), this.dynamicMinWidth > this.width && this._set("width", this.dynamicMinWidth), this.textAlign.includes(we) && this.enlargeSpaces(), this.height = this.calcTextHeight());
@@ -6200,7 +6200,7 @@ class ka extends In {
6200
6200
  }
6201
6201
  }
6202
6202
  x(ka, "type", "fixed"), L.setClass(ka);
6203
- class vd extends fi {
6203
+ class yd extends fi {
6204
6204
  subscribeTargets(t) {
6205
6205
  const e = t.target;
6206
6206
  t.targets.reduce(((s, i) => (i.parent && s.add(i.parent), s)), /* @__PURE__ */ new Set()).forEach(((s) => {
@@ -6222,7 +6222,7 @@ class ss extends Qt {
6222
6222
  let t = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : [], e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
6223
6223
  super(), Object.assign(this, ss.ownDefaults), this.setOptions(e);
6224
6224
  const { left: s, top: i, layoutManager: n } = e;
6225
- this.groupInit(t, { left: s, top: i, layoutManager: n ?? new vd() });
6225
+ this.groupInit(t, { left: s, top: i, layoutManager: n ?? new yd() });
6226
6226
  }
6227
6227
  _shouldSetNestedCoords() {
6228
6228
  return !0;
@@ -6277,7 +6277,7 @@ class ss extends Qt {
6277
6277
  }
6278
6278
  }
6279
6279
  x(ss, "type", "ActiveSelection"), x(ss, "ownDefaults", { multiSelectionStacking: "canvas-stacking" }), L.setClass(ss), L.setClass(ss, "activeSelection");
6280
- class yd {
6280
+ class _d {
6281
6281
  constructor() {
6282
6282
  x(this, "resources", {});
6283
6283
  }
@@ -6367,14 +6367,14 @@ class fl {
6367
6367
  }
6368
6368
  }
6369
6369
  let ar;
6370
- function _d() {
6370
+ function wd() {
6371
6371
  const { WebGLProbe: a } = Ce();
6372
- return a.queryWebGL(Ae()), tt.enableGLFiltering && a.isSupported(tt.textureSize) ? new fl({ tileSize: tt.textureSize }) : new yd();
6372
+ return a.queryWebGL(Ae()), tt.enableGLFiltering && a.isSupported(tt.textureSize) ? new fl({ tileSize: tt.textureSize }) : new _d();
6373
6373
  }
6374
6374
  function hr() {
6375
- return !ar && (!(arguments.length > 0 && arguments[0] !== void 0) || arguments[0]) && (ar = _d()), ar;
6375
+ return !ar && (!(arguments.length > 0 && arguments[0] !== void 0) || arguments[0]) && (ar = wd()), ar;
6376
6376
  }
6377
- const wd = ["filters", "resizeFilter", "src", "crossOrigin", "type"], gl = ["cropX", "cropY"];
6377
+ const xd = ["filters", "resizeFilter", "src", "crossOrigin", "type"], gl = ["cropX", "cropY"];
6378
6378
  class Pt extends Rt {
6379
6379
  static getDefaults() {
6380
6380
  return w(w({}, super.getDefaults()), Pt.ownDefaults);
@@ -6506,7 +6506,7 @@ class Pt extends Rt {
6506
6506
  return !t || t.alignX === Bt && t.alignY === Bt ? (h = e / r, l = s / o) : (t.meetOrSlice === "meet" && (h = l = Yh(this._element, i), n = (e - r * h) / 2, t.alignX === "Min" && (c = -n), t.alignX === "Max" && (c = n), n = (s - o * l) / 2, t.alignY === "Min" && (u = -n), t.alignY === "Max" && (u = n)), t.meetOrSlice === "slice" && (h = l = $h(this._element, i), n = r - e / h, t.alignX === "Mid" && (d = n / 2), t.alignX === "Max" && (d = n), n = o - s / l, t.alignY === "Mid" && (f = n / 2), t.alignY === "Max" && (f = n), r = e / h, o = s / l)), { width: r, height: o, scaleX: h, scaleY: l, offsetLeft: c, offsetTop: u, cropX: d, cropY: f };
6507
6507
  }
6508
6508
  static fromObject(t, e) {
6509
- let { filters: s, resizeFilter: i, src: n, crossOrigin: r, type: o } = t, h = ht(t, wd);
6509
+ let { filters: s, resizeFilter: i, src: n, crossOrigin: r, type: o } = t, h = at(t, xd);
6510
6510
  return Promise.all([ni(n, w(w({}, e), {}, { crossOrigin: r })), s && Ds(s, e), i && Ds([i], e), vi(h, e)]).then(((l) => {
6511
6511
  let [c, u = [], [d] = [], f = {}] = l;
6512
6512
  return new this(c, w(w({}, h), {}, { src: n, filters: u, resizeFilter: d }, f));
@@ -6523,7 +6523,7 @@ class Pt extends Rt {
6523
6523
  }
6524
6524
  }
6525
6525
  function lr(a) {
6526
- if (!kc.test(a.nodeName)) return {};
6526
+ if (!Mc.test(a.nodeName)) return {};
6527
6527
  const t = a.getAttribute("viewBox");
6528
6528
  let e, s, i = 1, n = 1, r = 0, o = 0;
6529
6529
  const h = a.getAttribute("width"), l = a.getAttribute("height"), c = a.getAttribute("x") || 0, u = a.getAttribute("y") || 0, d = !(t && na.test(t)), f = !h || !l || h === "100%" || l === "100%";
@@ -6544,17 +6544,17 @@ function lr(a) {
6544
6544
  return s.setAttribute("transform", e), m;
6545
6545
  }
6546
6546
  x(Pt, "type", "Image"), x(Pt, "cacheProperties", [...je, ...gl]), x(Pt, "ownDefaults", { strokeWidth: 0, srcFromAttribute: !1, minimumScaleTrigger: 0.5, cropX: 0, cropY: 0, imageSmoothing: !0 }), x(Pt, "CSS_CANVAS", "canvas-img"), x(Pt, "ATTRIBUTE_NAMES", [...$e, "x", "y", "width", "height", "preserveAspectRatio", "xlink:href", "href", "crossOrigin", "image-rendering"]), L.setClass(Pt), L.setSVGClass(Pt);
6547
- const xn = (a) => a.tagName.replace("svg:", ""), xd = On(["pattern", "defs", "symbol", "metadata", "clipPath", "mask", "desc"]);
6547
+ const xn = (a) => a.tagName.replace("svg:", ""), Sd = On(["pattern", "defs", "symbol", "metadata", "clipPath", "mask", "desc"]);
6548
6548
  function pl(a, t) {
6549
6549
  let e, s, i, n, r = [];
6550
6550
  for (i = 0, n = t.length; i < n; i++) e = t[i], s = a.getElementsByTagNameNS("http://www.w3.org/2000/svg", e), r = r.concat(Array.from(s));
6551
6551
  return r;
6552
6552
  }
6553
- const Sd = ["gradientTransform", "x1", "x2", "y1", "y2", "gradientUnits", "cx", "cy", "r", "fx", "fy"], cr = "xlink:href";
6553
+ const Cd = ["gradientTransform", "x1", "x2", "y1", "y2", "gradientUnits", "cx", "cy", "r", "fx", "fy"], cr = "xlink:href";
6554
6554
  function ml(a, t) {
6555
6555
  var e;
6556
6556
  const s = ((e = t.getAttribute(cr)) === null || e === void 0 ? void 0 : e.slice(1)) || "", i = a.getElementById(s);
6557
- if (i && i.getAttribute(cr) && ml(a, i), i && (Sd.forEach(((n) => {
6557
+ if (i && i.getAttribute(cr) && ml(a, i), i && (Cd.forEach(((n) => {
6558
6558
  const r = i.getAttribute(n);
6559
6559
  !t.hasAttribute(n) && r && t.setAttribute(n, r);
6560
6560
  })), !t.children.length)) {
@@ -6563,8 +6563,8 @@ function ml(a, t) {
6563
6563
  }
6564
6564
  t.removeAttribute(cr);
6565
6565
  }
6566
- const Cd = ["linearGradient", "radialGradient", "svg:linearGradient", "svg:radialGradient"];
6567
- function Ad(a) {
6566
+ const Ad = ["linearGradient", "radialGradient", "svg:linearGradient", "svg:radialGradient"];
6567
+ function Td(a) {
6568
6568
  const t = a.getElementsByTagName("style"), e = {};
6569
6569
  for (let s = 0; s < t.length; s++) {
6570
6570
  const i = (t[s].textContent || "").replace(/\/\*[\s\S]*?\*\//g, "");
@@ -6585,10 +6585,10 @@ function Ad(a) {
6585
6585
  return e;
6586
6586
  }
6587
6587
  const Ma = (a) => L.getSVGClass(xn(a).toLowerCase());
6588
- class Td {
6588
+ class Ed {
6589
6589
  constructor(t, e, s, i, n) {
6590
6590
  this.elements = t, this.options = e, this.reviver = s, this.regexUrl = /^url\(['"]?#([^'"]+)['"]?\)/g, this.doc = i, this.clipPaths = n, this.gradientDefs = (function(r) {
6591
- const o = pl(r, Cd), h = {};
6591
+ const o = pl(r, Ad), h = {};
6592
6592
  let l = o.length;
6593
6593
  for (; l--; ) {
6594
6594
  const c = o[l];
@@ -6597,7 +6597,7 @@ class Td {
6597
6597
  u && (h[u] = c);
6598
6598
  }
6599
6599
  return h;
6600
- })(i), this.cssRules = Ad(i);
6600
+ })(i), this.cssRules = Td(i);
6601
6601
  }
6602
6602
  parse() {
6603
6603
  return Promise.all(this.elements.map(((t) => this.createObject(t))));
@@ -6640,8 +6640,8 @@ class Td {
6640
6640
  } else delete t.clipPath;
6641
6641
  }
6642
6642
  }
6643
- const Pa = (a) => Ec.test(xn(a)), Dr = () => ({ objects: [], elements: [], options: {}, allElements: [] });
6644
- async function Ed(a, t) {
6643
+ const Pa = (a) => kc.test(xn(a)), Dr = () => ({ objects: [], elements: [], options: {}, allElements: [] });
6644
+ async function kd(a, t) {
6645
6645
  let { crossOrigin: e, signal: s } = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
6646
6646
  if (s && s.aborted) return Ie("log", new Gr("parseSVGDocument")), Dr();
6647
6647
  const i = a.documentElement;
@@ -6671,8 +6671,8 @@ async function Ed(a, t) {
6671
6671
  if (!d.includes(N)) if (N === "style") {
6672
6672
  const I = {};
6673
6673
  Tr(F, I), Object.entries(_).forEach(((D) => {
6674
- let [z, M] = D;
6675
- I[z] = M;
6674
+ let [H, M] = D;
6675
+ I[H] = M;
6676
6676
  })), Tr(_.style || "", I);
6677
6677
  const O = Object.entries(I).map(((D) => D.join(":"))).join(";");
6678
6678
  v.setAttribute(N, O);
@@ -6683,7 +6683,7 @@ async function Ed(a, t) {
6683
6683
  })(a);
6684
6684
  const n = Array.from(i.getElementsByTagName("*")), r = w(w({}, lr(i)), {}, { crossOrigin: e, signal: s }), o = n.filter(((c) => (lr(c), Pa(c) && !(function(u) {
6685
6685
  let d = u;
6686
- for (; d && (d = d.parentElement); ) if (d && d.nodeName && xd.test(xn(d)) && !d.getAttribute("instantiated_by_use")) return !0;
6686
+ for (; d && (d = d.parentElement); ) if (d && d.nodeName && Sd.test(xn(d)) && !d.getAttribute("instantiated_by_use")) return !0;
6687
6687
  return !1;
6688
6688
  })(c))));
6689
6689
  if (!o || o && !o.length) return w(w({}, Dr()), {}, { options: r, allElements: n });
@@ -6692,34 +6692,34 @@ async function Ed(a, t) {
6692
6692
  c.setAttribute("originalTransform", c.getAttribute("transform") || "");
6693
6693
  const u = c.getAttribute("id");
6694
6694
  h[u] = Array.from(c.getElementsByTagName("*")).filter(((d) => Pa(d)));
6695
- })), { objects: await new Td(o, r, t, a, h).parse(), elements: o, options: r, allElements: n };
6695
+ })), { objects: await new Ed(o, r, t, a, h).parse(), elements: o, options: r, allElements: n };
6696
6696
  }
6697
- function kd(a, t) {
6697
+ function Md(a, t) {
6698
6698
  let e = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
6699
6699
  return new Promise(((s, i) => {
6700
6700
  il(a.replace(/^\n\s*/, "").trim(), { onComplete: (n) => {
6701
6701
  const r = n.responseXML;
6702
6702
  r && s(r), i();
6703
6703
  }, signal: e.signal });
6704
- })).then(((s) => Ed(s, t, e))).catch((() => Dr()));
6704
+ })).then(((s) => kd(s, t, e))).catch((() => Dr()));
6705
6705
  }
6706
- const jn = (a) => a.webgl !== void 0, uo = "precision highp float", Md = `
6706
+ const jn = (a) => a.webgl !== void 0, uo = "precision highp float", Pd = `
6707
6707
  `.concat(uo, `;
6708
6708
  varying vec2 vTexCoord;
6709
6709
  uniform sampler2D uTexture;
6710
6710
  void main() {
6711
6711
  gl_FragColor = texture2D(uTexture, vTexCoord);
6712
- }`), Pd = ["type"], Od = ["type"], Dd = new RegExp(uo, "g");
6712
+ }`), Od = ["type"], Dd = ["type"], Rd = new RegExp(uo, "g");
6713
6713
  class Ct {
6714
6714
  get type() {
6715
6715
  return this.constructor.type;
6716
6716
  }
6717
6717
  constructor() {
6718
- let t = ht(arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, Pd);
6718
+ let t = at(arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, Od);
6719
6719
  Object.assign(this, this.constructor.defaults, t);
6720
6720
  }
6721
6721
  getFragmentSource() {
6722
- return Md;
6722
+ return Pd;
6723
6723
  }
6724
6724
  getVertexSource() {
6725
6725
  return `
@@ -6733,7 +6733,7 @@ class Ct {
6733
6733
  createProgram(t) {
6734
6734
  let e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : this.getFragmentSource(), s = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : this.getVertexSource();
6735
6735
  const { WebGLProbe: { GLPrecision: i = "highp" } } = Ce();
6736
- i !== "highp" && (e = e.replace(Dd, uo.replace("highp", i)));
6736
+ i !== "highp" && (e = e.replace(Rd, uo.replace("highp", i)));
6737
6737
  const n = t.createShader(t.VERTEX_SHADER), r = t.createShader(t.FRAGMENT_SHADER), o = t.createProgram();
6738
6738
  if (!n || !r || !o) throw new xe("Vertex, fragment shader or program creation error");
6739
6739
  if (t.shaderSource(n, s), t.compileShader(n), !t.getShaderParameter(n, t.COMPILE_STATUS)) throw new xe("Vertex shader compile error for ".concat(this.type, ": ").concat(t.getShaderInfoLog(n)));
@@ -6807,11 +6807,11 @@ class Ct {
6807
6807
  return this.toObject();
6808
6808
  }
6809
6809
  static async fromObject(t, e) {
6810
- return new this(ht(t, Od));
6810
+ return new this(at(t, Dd));
6811
6811
  }
6812
6812
  }
6813
6813
  x(Ct, "type", "BaseFilter"), x(Ct, "uniformLocations", []);
6814
- const Rd = { multiply: `gl_FragColor.rgb *= uColor.rgb;
6814
+ const Ld = { multiply: `gl_FragColor.rgb *= uColor.rgb;
6815
6815
  `, screen: `gl_FragColor.rgb = 1.0 - (1.0 - gl_FragColor.rgb) * (1.0 - uColor.rgb);
6816
6816
  `, add: `gl_FragColor.rgb += uColor.rgb;
6817
6817
  `, difference: `gl_FragColor.rgb = abs(gl_FragColor.rgb - uColor.rgb);
@@ -6853,7 +6853,7 @@ class Fi extends Ct {
6853
6853
  vec4 color = texture2D(uTexture, vTexCoord);
6854
6854
  gl_FragColor = color;
6855
6855
  if (color.a > 0.0) {
6856
- `.concat(Rd[this.mode], `
6856
+ `.concat(Ld[this.mode], `
6857
6857
  }
6858
6858
  }
6859
6859
  `);
@@ -6904,7 +6904,7 @@ class Fi extends Ct {
6904
6904
  }
6905
6905
  }
6906
6906
  x(Fi, "defaults", { color: "#F95C63", mode: "multiply", alpha: 1 }), x(Fi, "type", "BlendColor"), x(Fi, "uniformLocations", ["uColor"]), L.setClass(Fi);
6907
- const Ld = { multiply: `
6907
+ const Fd = { multiply: `
6908
6908
  precision highp float;
6909
6909
  uniform sampler2D uTexture;
6910
6910
  uniform sampler2D uImage;
@@ -6930,13 +6930,13 @@ const Ld = { multiply: `
6930
6930
  color.a = color2.a;
6931
6931
  gl_FragColor = color;
6932
6932
  }
6933
- ` }, Fd = ["type", "image"];
6933
+ ` }, Id = ["type", "image"];
6934
6934
  class Ii extends Ct {
6935
6935
  getCacheKey() {
6936
6936
  return "".concat(this.type, "_").concat(this.mode);
6937
6937
  }
6938
6938
  getFragmentSource() {
6939
- return Ld[this.mode];
6939
+ return Fd[this.mode];
6940
6940
  }
6941
6941
  getVertexSource() {
6942
6942
  return `
@@ -6988,7 +6988,7 @@ class Ii extends Ct {
6988
6988
  return w(w({}, super.toObject()), {}, { image: this.image && this.image.toObject() });
6989
6989
  }
6990
6990
  static async fromObject(t, e) {
6991
- let { type: s, image: i } = t, n = ht(t, Fd);
6991
+ let { type: s, image: i } = t, n = at(t, Id);
6992
6992
  return Pt.fromObject(i, e).then(((r) => new this(w(w({}, n), {}, { image: r }))));
6993
6993
  }
6994
6994
  }
@@ -7204,7 +7204,7 @@ class Bi extends Ct {
7204
7204
  }
7205
7205
  }
7206
7206
  x(Bi, "type", "Contrast"), x(Bi, "defaults", { contrast: 0 }), x(Bi, "uniformLocations", ["uContrast"]), L.setClass(Bi);
7207
- const Id = { Convolute_3_1: `
7207
+ const Nd = { Convolute_3_1: `
7208
7208
  precision highp float;
7209
7209
  uniform sampler2D uTexture;
7210
7210
  uniform float uMatrix[9];
@@ -7354,7 +7354,7 @@ class Hi extends Ct {
7354
7354
  return "".concat(this.type, "_").concat(Math.sqrt(this.matrix.length), "_").concat(this.opaque ? 1 : 0);
7355
7355
  }
7356
7356
  getFragmentSource() {
7357
- return Id[this.getCacheKey()];
7357
+ return Nd[this.getCacheKey()];
7358
7358
  }
7359
7359
  applyTo2d(t) {
7360
7360
  const e = t.imageData, s = e.data, i = this.matrix, n = Math.round(Math.sqrt(i.length)), r = Math.floor(n / 2), o = e.width, h = e.height, l = t.ctx.createImageData(o, h), c = l.data, u = this.opaque ? 1 : 0;
@@ -7416,7 +7416,7 @@ class zi extends Ct {
7416
7416
  }
7417
7417
  }
7418
7418
  x(zi, "type", vl), x(zi, "defaults", { gamma: [1, 1, 1] }), x(zi, "uniformLocations", ["uGamma"]), L.setClass(zi);
7419
- const Nd = { average: `
7419
+ const jd = { average: `
7420
7420
  precision highp float;
7421
7421
  uniform sampler2D uTexture;
7422
7422
  varying vec2 vTexCoord;
@@ -7468,7 +7468,7 @@ class Gi extends Ct {
7468
7468
  return "".concat(this.type, "_").concat(this.mode);
7469
7469
  }
7470
7470
  getFragmentSource() {
7471
- return Nd[this.mode];
7471
+ return jd[this.mode];
7472
7472
  }
7473
7473
  sendUniformData(t, e) {
7474
7474
  t.uniform1i(e.uMode, 1);
@@ -7478,7 +7478,7 @@ class Gi extends Ct {
7478
7478
  }
7479
7479
  }
7480
7480
  x(Gi, "type", "Grayscale"), x(Gi, "defaults", { mode: "average" }), x(Gi, "uniformLocations", ["uMode"]), L.setClass(Gi);
7481
- const jd = w(w({}, bl), {}, { rotation: 0 });
7481
+ const Bd = w(w({}, bl), {}, { rotation: 0 });
7482
7482
  class ur extends Cs {
7483
7483
  calculateMatrix() {
7484
7484
  const t = this.rotation * Math.PI, e = ge(t), s = pe(t), i = 1 / 3, n = Math.sqrt(i) * s, r = 1 - e;
@@ -7494,7 +7494,7 @@ class ur extends Cs {
7494
7494
  return { type: this.type, rotation: this.rotation };
7495
7495
  }
7496
7496
  }
7497
- x(ur, "type", "HueRotation"), x(ur, "defaults", jd), L.setClass(ur);
7497
+ x(ur, "type", "HueRotation"), x(ur, "defaults", Bd), L.setClass(ur);
7498
7498
  class Vi extends Ct {
7499
7499
  applyTo2d(t) {
7500
7500
  let { imageData: { data: e } } = t;
@@ -7717,11 +7717,11 @@ class Yi extends Ct {
7717
7717
  lanczosResize(t, e, s, i, n) {
7718
7718
  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 };
7719
7719
  return (function y(_) {
7720
- let S, A, T, k, P, N, F, I, O, D, z;
7720
+ let S, A, T, k, P, N, F, I, O, D, H;
7721
7721
  for (m.x = (_ + 0.5) * c, v.x = Math.floor(m.x), S = 0; S < n; S++) {
7722
7722
  for (m.y = (S + 0.5) * u, v.y = Math.floor(m.y), P = 0, N = 0, F = 0, I = 0, O = 0, A = v.x - g; A <= v.x + g; A++) if (!(A < 0 || A >= e)) {
7723
7723
  D = Math.floor(1e3 * Math.abs(A - m.x)), b[D] || (b[D] = {});
7724
- for (let M = v.y - p; M <= v.y + p; M++) M < 0 || M >= s || (z = Math.floor(1e3 * Math.abs(M - m.y)), b[D][z] || (b[D][z] = l(Math.sqrt(Math.pow(D * d, 2) + Math.pow(z * f, 2)) / 1e3)), T = b[D][z], T > 0 && (k = 4 * (M * e + A), P += T, N += T * r[k], F += T * r[k + 1], I += T * r[k + 2], O += T * r[k + 3]));
7724
+ for (let M = v.y - p; M <= v.y + p; M++) M < 0 || M >= s || (H = Math.floor(1e3 * Math.abs(M - m.y)), b[D][H] || (b[D][H] = l(Math.sqrt(Math.pow(D * d, 2) + Math.pow(H * f, 2)) / 1e3)), T = b[D][H], T > 0 && (k = 4 * (M * e + A), P += T, N += T * r[k], F += T * r[k + 1], I += T * r[k + 2], O += T * r[k + 3]));
7725
7725
  }
7726
7726
  k = 4 * (S * i + _), h[k] = N / P, h[k + 1] = F / P, h[k + 2] = I / P, h[k + 3] = O / P;
7727
7727
  }
@@ -7823,22 +7823,6 @@ class qi extends Ct {
7823
7823
  }
7824
7824
  }
7825
7825
  x(qi, "type", "Vibrance"), x(qi, "defaults", { vibrance: 0 }), x(qi, "uniformLocations", ["uVibrance"]), L.setClass(qi);
7826
- function Bd(a) {
7827
- return new Promise((t, e) => {
7828
- const s = globalThis.URL.createObjectURL(a), i = new Image();
7829
- i.src = s, i.addEventListener("load", async () => {
7830
- globalThis.URL.revokeObjectURL(s), t(await Hd(i));
7831
- }), i.addEventListener("error", (n) => {
7832
- globalThis.URL.revokeObjectURL(s), e(n);
7833
- });
7834
- });
7835
- }
7836
- function Hd(a) {
7837
- return new Promise((t) => {
7838
- const e = document.createElement("canvas"), s = e.getContext("2d"), { naturalWidth: i, naturalHeight: n } = a;
7839
- e.width = i, e.height = n, s?.drawImage(a, 0, 0, i, n), t(e.toDataURL("image/jpeg", 0.8));
7840
- });
7841
- }
7842
7826
  var ai = {};
7843
7827
  ai.d = (a, t) => {
7844
7828
  for (var e in t)
@@ -7869,7 +7853,7 @@ ai.d(Y, {
7869
7853
  ),
7870
7854
  AnnotationLayer: () => (
7871
7855
  /* reexport */
7872
- Ig
7856
+ Fg
7873
7857
  ),
7874
7858
  AnnotationMode: () => (
7875
7859
  /* reexport */
@@ -7929,11 +7913,11 @@ ai.d(Y, {
7929
7913
  ),
7930
7914
  PasswordResponses: () => (
7931
7915
  /* reexport */
7932
- Wd
7916
+ Vd
7933
7917
  ),
7934
7918
  PermissionFlag: () => (
7935
7919
  /* reexport */
7936
- Vd
7920
+ Gd
7937
7921
  ),
7938
7922
  PixelsPerInch: () => (
7939
7923
  /* reexport */
@@ -7969,11 +7953,11 @@ ai.d(Y, {
7969
7953
  ),
7970
7954
  build: () => (
7971
7955
  /* reexport */
7972
- mg
7956
+ pg
7973
7957
  ),
7974
7958
  createValidAbsoluteUrl: () => (
7975
7959
  /* reexport */
7976
- $d
7960
+ Yd
7977
7961
  ),
7978
7962
  fetchData: () => (
7979
7963
  /* reexport */
@@ -7981,19 +7965,19 @@ ai.d(Y, {
7981
7965
  ),
7982
7966
  getDocument: () => (
7983
7967
  /* reexport */
7984
- ag
7968
+ og
7985
7969
  ),
7986
7970
  getFilenameFromUrl: () => (
7987
7971
  /* reexport */
7988
- nf
7972
+ sf
7989
7973
  ),
7990
7974
  getPdfFilenameFromUrl: () => (
7991
7975
  /* reexport */
7992
- rf
7976
+ nf
7993
7977
  ),
7994
7978
  getXfaPageViewport: () => (
7995
7979
  /* reexport */
7996
- of
7980
+ rf
7997
7981
  ),
7998
7982
  isDataScheme: () => (
7999
7983
  /* reexport */
@@ -8009,7 +7993,7 @@ ai.d(Y, {
8009
7993
  ),
8010
7994
  normalizeUnicode: () => (
8011
7995
  /* reexport */
8012
- tf
7996
+ Qd
8013
7997
  ),
8014
7998
  setLayerDimensions: () => (
8015
7999
  /* reexport */
@@ -8025,10 +8009,10 @@ ai.d(Y, {
8025
8009
  ),
8026
8010
  version: () => (
8027
8011
  /* reexport */
8028
- pg
8012
+ gg
8029
8013
  )
8030
8014
  });
8031
- const Dt = typeof process == "object" && process + "" == "[object process]" && !process.versions.nw && !(process.versions.electron && process.type && process.type !== "browser"), yl = [1, 0, 0, 1, 0, 0], Rr = [1e-3, 0, 0, 1e-3, 0, 0], zd = 1e7, dr = 1.35, Jt = {
8015
+ const Dt = typeof process == "object" && process + "" == "[object process]" && !process.versions.nw && !(process.versions.electron && process.type && process.type !== "browser"), yl = [1, 0, 0, 1, 0, 0], Rr = [1e-3, 0, 0, 1e-3, 0, 0], Hd = 1e7, dr = 1.35, Jt = {
8032
8016
  ANY: 1,
8033
8017
  DISPLAY: 2,
8034
8018
  PRINT: 4,
@@ -8042,7 +8026,7 @@ const Dt = typeof process == "object" && process + "" == "[object process]" && !
8042
8026
  ENABLE: 1,
8043
8027
  ENABLE_FORMS: 2,
8044
8028
  ENABLE_STORAGE: 3
8045
- }, Gd = "pdfjs_internal_editor_", q = {
8029
+ }, zd = "pdfjs_internal_editor_", q = {
8046
8030
  DISABLE: -1,
8047
8031
  NONE: 0,
8048
8032
  FREETEXT: 3,
@@ -8064,7 +8048,7 @@ const Dt = typeof process == "object" && process + "" == "[object process]" && !
8064
8048
  HIGHLIGHT_FREE: 34,
8065
8049
  HIGHLIGHT_SHOW_ALL: 35,
8066
8050
  DRAW_STEP: 41
8067
- }, Vd = {
8051
+ }, Gd = {
8068
8052
  PRINT: 4,
8069
8053
  MODIFY_CONTENTS: 8,
8070
8054
  COPY: 16,
@@ -8204,15 +8188,15 @@ const Dt = typeof process == "object" && process + "" == "[object process]" && !
8204
8188
  constructPath: 91,
8205
8189
  setStrokeTransparent: 92,
8206
8190
  setFillTransparent: 93
8207
- }, Wd = {
8191
+ }, Vd = {
8208
8192
  NEED_PASSWORD: 1,
8209
8193
  INCORRECT_PASSWORD: 2
8210
8194
  };
8211
8195
  let Hn = Bn.WARNINGS;
8212
- function Xd(a) {
8196
+ function Wd(a) {
8213
8197
  Number.isInteger(a) && (Hn = a);
8214
8198
  }
8215
- function Ud() {
8199
+ function Xd() {
8216
8200
  return Hn;
8217
8201
  }
8218
8202
  function zn(a) {
@@ -8227,7 +8211,7 @@ function rt(a) {
8227
8211
  function _t(a, t) {
8228
8212
  a || rt(t);
8229
8213
  }
8230
- function Yd(a) {
8214
+ function Ud(a) {
8231
8215
  switch (a?.protocol) {
8232
8216
  case "http:":
8233
8217
  case "https:":
@@ -8239,17 +8223,17 @@ function Yd(a) {
8239
8223
  return !1;
8240
8224
  }
8241
8225
  }
8242
- function $d(a, t = null, e = null) {
8226
+ function Yd(a, t = null, e = null) {
8243
8227
  if (!a)
8244
8228
  return null;
8245
8229
  try {
8246
8230
  if (e && typeof a == "string" && (e.addDefaultProtocol && a.startsWith("www.") && a.match(/\./g)?.length >= 2 && (a = `http://${a}`), e.tryConvertEncoding))
8247
8231
  try {
8248
- a = Qd(a);
8232
+ a = Zd(a);
8249
8233
  } catch {
8250
8234
  }
8251
8235
  const s = t ? new URL(a, t) : new URL(a);
8252
- if (Yd(s))
8236
+ if (Ud(s))
8253
8237
  return s;
8254
8238
  } catch {
8255
8239
  }
@@ -8294,7 +8278,7 @@ class Sn extends qe {
8294
8278
  super(t, "UnexpectedResponseException"), this.status = e;
8295
8279
  }
8296
8280
  }
8297
- class qd extends qe {
8281
+ class $d extends qe {
8298
8282
  constructor(t) {
8299
8283
  super(t, "FormatError");
8300
8284
  }
@@ -8323,7 +8307,7 @@ function Gn(a) {
8323
8307
  e[s] = a.charCodeAt(s) & 255;
8324
8308
  return e;
8325
8309
  }
8326
- function Kd(a) {
8310
+ function qd(a) {
8327
8311
  return String.fromCharCode(a >> 24 & 255, a >> 16 & 255, a >> 8 & 255, a & 255);
8328
8312
  }
8329
8313
  function fo(a) {
@@ -8332,11 +8316,11 @@ function fo(a) {
8332
8316
  t[e] = s;
8333
8317
  return t;
8334
8318
  }
8335
- function Jd() {
8319
+ function Kd() {
8336
8320
  const a = new Uint8Array(4);
8337
8321
  return a[0] = 1, new Uint32Array(a.buffer, 0, 1)[0] === 1;
8338
8322
  }
8339
- function Zd() {
8323
+ function Jd() {
8340
8324
  try {
8341
8325
  return new Function(""), !0;
8342
8326
  } catch {
@@ -8345,10 +8329,10 @@ function Zd() {
8345
8329
  }
8346
8330
  class zt {
8347
8331
  static get isLittleEndian() {
8348
- return Z(this, "isLittleEndian", Jd());
8332
+ return Z(this, "isLittleEndian", Kd());
8349
8333
  }
8350
8334
  static get isEvalSupported() {
8351
- return Z(this, "isEvalSupported", Zd());
8335
+ return Z(this, "isEvalSupported", Jd());
8352
8336
  }
8353
8337
  static get isOffscreenCanvasSupported() {
8354
8338
  return Z(this, "isOffscreenCanvasSupported", typeof OffscreenCanvas < "u");
@@ -8435,21 +8419,21 @@ class G {
8435
8419
  return l ? (l[0] = Math.min(l[0], t, o), l[1] = Math.min(l[1], e, h), l[2] = Math.max(l[2], t, o), l[3] = Math.max(l[3], e, h)) : l = [Math.min(t, o), Math.min(e, h), Math.max(t, o), Math.max(e, h)], this.#e(t, s, n, o, e, i, r, h, 3 * (-t + 3 * (s - n) + o), 6 * (t - 2 * s + n), 3 * (s - t), l), this.#e(t, s, n, o, e, i, r, h, 3 * (-e + 3 * (i - r) + h), 6 * (e - 2 * i + r), 3 * (i - e), l), l;
8436
8420
  }
8437
8421
  }
8438
- function Qd(a) {
8422
+ function Zd(a) {
8439
8423
  return decodeURIComponent(escape(a));
8440
8424
  }
8441
8425
  let pr = null, Ra = null;
8442
- function tf(a) {
8426
+ function Qd(a) {
8443
8427
  return pr || (pr = /([\u00a0\u00b5\u037e\u0eb3\u2000-\u200a\u202f\u2126\ufb00-\ufb04\ufb06\ufb20-\ufb36\ufb38-\ufb3c\ufb3e\ufb40-\ufb41\ufb43-\ufb44\ufb46-\ufba1\ufba4-\ufba9\ufbae-\ufbb1\ufbd3-\ufbdc\ufbde-\ufbe7\ufbea-\ufbf8\ufbfc-\ufbfd\ufc00-\ufc5d\ufc64-\ufcf1\ufcf5-\ufd3d\ufd88\ufdf4\ufdfa-\ufdfb\ufe71\ufe77\ufe79\ufe7b\ufe7d]+)|(\ufb05+)/gu, Ra = /* @__PURE__ */ new Map([["ſt", "ſt"]])), a.replaceAll(pr, (t, e, s) => e ? e.normalize("NFKC") : Ra.get(s));
8444
8428
  }
8445
- function ef() {
8429
+ function tf() {
8446
8430
  if (typeof crypto.randomUUID == "function")
8447
8431
  return crypto.randomUUID();
8448
8432
  const a = new Uint8Array(32);
8449
8433
  return crypto.getRandomValues(a), _l(a);
8450
8434
  }
8451
8435
  const go = "pdfjs_internal_id_";
8452
- function sf(a) {
8436
+ function ef(a) {
8453
8437
  return Uint8Array.prototype.toBase64 ? a.toBase64() : btoa(_l(a));
8454
8438
  }
8455
8439
  typeof Promise.try != "function" && (Promise.try = function(a, ...t) {
@@ -8586,10 +8570,10 @@ function Wn(a) {
8586
8570
  function mo(a) {
8587
8571
  return typeof a == "string" && /\.pdf$/i.test(a);
8588
8572
  }
8589
- function nf(a) {
8573
+ function sf(a) {
8590
8574
  return [a] = a.split(/[#?]/, 1), a.substring(a.lastIndexOf("/") + 1);
8591
8575
  }
8592
- function rf(a, t = "document.pdf") {
8576
+ function nf(a, t = "document.pdf") {
8593
8577
  if (typeof a != "string")
8594
8578
  return t;
8595
8579
  if (Wn(a))
@@ -8676,7 +8660,7 @@ class wl {
8676
8660
  return u = u >= 0 && u <= 59 ? u : 0, l === "-" ? (r += c, o += u) : l === "+" && (r -= c, o -= u), new Date(Date.UTC(s, i, n, r, o, h));
8677
8661
  }
8678
8662
  }
8679
- function of(a, {
8663
+ function rf(a, {
8680
8664
  scale: t = 1,
8681
8665
  rotation: e = 0
8682
8666
  }) {
@@ -8698,7 +8682,7 @@ function bo(a) {
8698
8682
  }
8699
8683
  return a.startsWith("rgb(") ? a.slice(4, -1).split(",").map((t) => parseInt(t)) : a.startsWith("rgba(") ? a.slice(5, -1).split(",").map((t) => parseInt(t)).slice(0, 3) : (K(`Not a valid color format: "${a}"`), [0, 0, 0]);
8700
8684
  }
8701
- function af(a) {
8685
+ function of(a) {
8702
8686
  const t = document.createElement("span");
8703
8687
  t.style.visibility = "hidden", document.body.append(t);
8704
8688
  for (const e of a.keys()) {
@@ -8708,7 +8692,7 @@ function af(a) {
8708
8692
  }
8709
8693
  t.remove();
8710
8694
  }
8711
- function ut(a) {
8695
+ function ct(a) {
8712
8696
  const {
8713
8697
  a: t,
8714
8698
  b: e,
@@ -8847,7 +8831,7 @@ class hi {
8847
8831
  this.#t.remove(), this.#e?.destroy(), this.#e = null;
8848
8832
  }
8849
8833
  }
8850
- class hf {
8834
+ class af {
8851
8835
  #t = null;
8852
8836
  #e = null;
8853
8837
  #s;
@@ -8905,14 +8889,14 @@ function Cn(a, t, e) {
8905
8889
  for (const s of e)
8906
8890
  t.addEventListener(s, a[s].bind(a));
8907
8891
  }
8908
- class lf {
8892
+ class hf {
8909
8893
  #t = 0;
8910
8894
  get id() {
8911
- return `${Gd}${this.#t++}`;
8895
+ return `${zd}${this.#t++}`;
8912
8896
  }
8913
8897
  }
8914
8898
  class vo {
8915
- #t = ef();
8899
+ #t = tf();
8916
8900
  #e = 0;
8917
8901
  #s = null;
8918
8902
  static get _isSVGFittingCanvas() {
@@ -9024,7 +9008,7 @@ class vo {
9024
9008
  return t.startsWith(`image_${this.#t}_`);
9025
9009
  }
9026
9010
  }
9027
- class cf {
9011
+ class lf {
9028
9012
  #t = [];
9029
9013
  #e = !1;
9030
9014
  #s;
@@ -9144,7 +9128,7 @@ class yo {
9144
9128
  static _colorsMapping = /* @__PURE__ */ new Map([["CanvasText", [0, 0, 0]], ["Canvas", [255, 255, 255]]]);
9145
9129
  get _colors() {
9146
9130
  const t = /* @__PURE__ */ new Map([["CanvasText", null], ["Canvas", null]]);
9147
- return af(t), Z(this, "_colors", t);
9131
+ return of(t), Z(this, "_colors", t);
9148
9132
  }
9149
9133
  convert(t) {
9150
9134
  const e = bo(t);
@@ -9168,7 +9152,7 @@ class Ye {
9168
9152
  #r = null;
9169
9153
  #n = null;
9170
9154
  #h = null;
9171
- #a = new cf();
9155
+ #a = new lf();
9172
9156
  #c = null;
9173
9157
  #l = null;
9174
9158
  #d = 0;
@@ -9186,7 +9170,7 @@ class Ye {
9186
9170
  #S = null;
9187
9171
  #A = !1;
9188
9172
  #E = null;
9189
- #M = new lf();
9173
+ #M = new hf();
9190
9174
  #x = !1;
9191
9175
  #k = !1;
9192
9176
  #T = null;
@@ -9448,7 +9432,7 @@ class Ye {
9448
9432
  if (!t || t.isCollapsed)
9449
9433
  return;
9450
9434
  const s = this.#B(t).closest(".textLayer"), i = this.getSelectionBoxes(s);
9451
- i && (this.#E ||= new hf(this), this.#E.show(s, i, this.direction === "ltr"));
9435
+ i && (this.#E ||= new af(this), this.#E.show(s, i, this.direction === "ltr"));
9452
9436
  }
9453
9437
  addToAnnotationStorage(t) {
9454
9438
  !t.isEmpty() && this.#n && !this.#n.has(t.id) && this.#n.setValue(t.id, t);
@@ -10494,7 +10478,7 @@ class U {
10494
10478
  return Z(this, "_defaultLineColor", this._colorManager.getHexCode("CanvasText"));
10495
10479
  }
10496
10480
  static deleteAnnotationElement(t) {
10497
- const e = new uf({
10481
+ const e = new cf({
10498
10482
  id: t.parent.getNextId(),
10499
10483
  parent: t.parent,
10500
10484
  uiManager: t._uiManager
@@ -10886,8 +10870,8 @@ class U {
10886
10870
  } else v ? k = 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] - F))) / h;
10887
10871
  const I = U._round(o * k), O = U._round(h * P);
10888
10872
  S = d(...b(I, O));
10889
- const D = A - S[0], z = T - S[1];
10890
- this.#o ||= [this.x, this.y, this.width, this.height], this.width = I, this.height = O, this.x = D, this.y = z, this.setDims(s * I, i * O), this.fixAndSetPosition(), this._onResizing();
10873
+ const D = A - S[0], H = T - S[1];
10874
+ this.#o ||= [this.x, this.y, this.width, this.height], this.width = I, this.height = O, this.x = D, this.y = H, this.setDims(s * I, i * O), this.fixAndSetPosition(), this._onResizing();
10891
10875
  }
10892
10876
  _onResizing() {
10893
10877
  }
@@ -11344,7 +11328,7 @@ class U {
11344
11328
  e?.nodeName === "DIV" && e.classList.contains("annotationContent") && e.remove();
11345
11329
  }
11346
11330
  }
11347
- class uf extends U {
11331
+ class cf extends U {
11348
11332
  constructor(t) {
11349
11333
  super(t), this.annotationElementId = t.annotationElementId, this.deleted = !0;
11350
11334
  }
@@ -11538,7 +11522,7 @@ class Sl extends _o {
11538
11522
  });
11539
11523
  }
11540
11524
  }
11541
- class df {
11525
+ class uf {
11542
11526
  #t = /* @__PURE__ */ new Set();
11543
11527
  constructor({
11544
11528
  ownerDocument: t = globalThis.document,
@@ -11672,7 +11656,7 @@ class df {
11672
11656
  let b = s(d, g);
11673
11657
  for (n = 0, r = u.length - 3; n < r; n += 4)
11674
11658
  b = b - p + s(u, n) | 0;
11675
- n < u.length && (b = b - p + s(u + "XXX", n) | 0), d = i(d, g, 4, Kd(b));
11659
+ n < u.length && (b = b - p + s(u + "XXX", n) | 0), d = i(d, g, 4, qd(b));
11676
11660
  const m = `url(data:font/opentype;base64,${btoa(d)});`, v = `@font-face {font-family:"${u}";src:${m}}`;
11677
11661
  this.insertRule(v);
11678
11662
  const y = this._document.createElement("div");
@@ -11686,7 +11670,7 @@ class df {
11686
11670
  });
11687
11671
  }
11688
11672
  }
11689
- class ff {
11673
+ class df {
11690
11674
  constructor(t, {
11691
11675
  disableFontFace: e = !1,
11692
11676
  fontExtraProperties: s = !1,
@@ -11714,7 +11698,7 @@ class ff {
11714
11698
  createFontFaceRule() {
11715
11699
  if (!this.data || this.disableFontFace)
11716
11700
  return null;
11717
- const t = `url(data:${this.mimetype};base64,${sf(this.data)});`;
11701
+ const t = `url(data:${this.mimetype};base64,${ef(this.data)});`;
11718
11702
  let e;
11719
11703
  if (!this.cssFontInfo)
11720
11704
  e = `@font-face {font-family:"${this.loadedName}";src:${t}}`;
@@ -12080,7 +12064,7 @@ class Cl {
12080
12064
  rt("Abstract method `_createCanvas` called.");
12081
12065
  }
12082
12066
  }
12083
- class gf extends Cl {
12067
+ class ff extends Cl {
12084
12068
  constructor({
12085
12069
  ownerDocument: t = globalThis.document,
12086
12070
  enableHWA: e = !1
@@ -12145,7 +12129,7 @@ class El {
12145
12129
  destroy(t = !1) {
12146
12130
  }
12147
12131
  }
12148
- class pf extends El {
12132
+ class gf extends El {
12149
12133
  #t;
12150
12134
  #e;
12151
12135
  #s;
@@ -12355,19 +12339,19 @@ async function Pl(a) {
12355
12339
  const e = await process.getBuiltinModule("fs").promises.readFile(a);
12356
12340
  return new Uint8Array(e);
12357
12341
  }
12358
- class mf extends El {
12342
+ class pf extends El {
12359
12343
  }
12360
- class bf extends Cl {
12344
+ class mf extends Cl {
12361
12345
  _createCanvas(t, e) {
12362
12346
  return process.getBuiltinModule("module").createRequire(import.meta.url)("@napi-rs/canvas").createCanvas(t, e);
12363
12347
  }
12364
12348
  }
12365
- class vf extends Al {
12349
+ class bf extends Al {
12366
12350
  async _fetch(t) {
12367
12351
  return Pl(t);
12368
12352
  }
12369
12353
  }
12370
- class yf extends kl {
12354
+ class vf extends kl {
12371
12355
  async _fetch(t) {
12372
12356
  return Pl(t);
12373
12357
  }
@@ -12388,7 +12372,7 @@ class wo {
12388
12372
  rt("Abstract method `getPattern` called.");
12389
12373
  }
12390
12374
  }
12391
- class _f extends wo {
12375
+ class yf extends wo {
12392
12376
  constructor(t) {
12393
12377
  super(), this._type = t[1], this._bbox = t[2], this._colorStops = t[3], this._p0 = t[4], this._p1 = t[5], this._r0 = t[6], this._r1 = t[7], this.matrix = null;
12394
12378
  }
@@ -12402,7 +12386,7 @@ class _f extends wo {
12402
12386
  getPattern(t, e, s, i) {
12403
12387
  let n;
12404
12388
  if (i === Ot.STROKE || i === Ot.FILL) {
12405
- const r = e.current.getClippedPathBoundingBox(i, ut(t)) || [0, 0, 0, 0], o = Math.ceil(r[2] - r[0]) || 1, h = Math.ceil(r[3] - r[1]) || 1, l = e.cachedCanvases.getCanvas("pattern", o, h), c = l.context;
12389
+ const r = e.current.getClippedPathBoundingBox(i, ct(t)) || [0, 0, 0, 0], o = Math.ceil(r[2] - r[0]) || 1, h = Math.ceil(r[3] - r[1]) || 1, l = e.cachedCanvases.getCanvas("pattern", o, h), c = l.context;
12406
12390
  c.clearRect(0, 0, c.canvas.width, c.canvas.height), c.beginPath(), c.rect(0, 0, c.canvas.width, c.canvas.height), c.translate(-r[0], -r[1]), s = G.transform(s, [1, 0, 0, 1, r[0], r[1]]), c.transform(...e.baseTransform), this.matrix && c.transform(...this.matrix), Nr(c, this._bbox), c.fillStyle = this._createGradient(c), c.fill(), n = t.createPattern(l.canvas, "no-repeat");
12407
12391
  const u = new DOMMatrix(s);
12408
12392
  n.setTransform(u);
@@ -12419,24 +12403,24 @@ function mr(a, t, e, s, i, n, r, o) {
12419
12403
  if (g >= v)
12420
12404
  return;
12421
12405
  const y = l[n], _ = l[n + 1], S = l[n + 2], A = l[r], T = l[r + 1], k = l[r + 2], P = l[o], N = l[o + 1], F = l[o + 2], I = Math.round(g), O = Math.round(v);
12422
- let D, z, M, R, W, ot, lt, E;
12423
- for (let H = I; H <= O; H++) {
12424
- if (H < b) {
12425
- const B = H < g ? 0 : (g - H) / (g - b);
12426
- D = f - (f - p) * B, z = y - (y - A) * B, M = _ - (_ - T) * B, R = S - (S - k) * B;
12406
+ let D, H, M, R, W, ot, ht, E;
12407
+ for (let z = I; z <= O; z++) {
12408
+ if (z < b) {
12409
+ const B = z < g ? 0 : (g - z) / (g - b);
12410
+ D = f - (f - p) * B, H = y - (y - A) * B, M = _ - (_ - T) * B, R = S - (S - k) * B;
12427
12411
  } else {
12428
12412
  let B;
12429
- H > v ? B = 1 : b === v ? B = 0 : B = (b - H) / (b - v), D = p - (p - m) * B, z = A - (A - P) * B, M = T - (T - N) * B, R = k - (k - F) * B;
12413
+ z > v ? B = 1 : b === v ? B = 0 : B = (b - z) / (b - v), D = p - (p - m) * B, H = A - (A - P) * B, M = T - (T - N) * B, R = k - (k - F) * B;
12430
12414
  }
12431
12415
  let V;
12432
- H < g ? V = 0 : H > v ? V = 1 : V = (g - H) / (g - v), W = f - (f - m) * V, ot = y - (y - P) * V, lt = _ - (_ - N) * V, E = S - (S - F) * V;
12416
+ z < g ? V = 0 : z > v ? V = 1 : V = (g - z) / (g - v), W = f - (f - m) * V, ot = y - (y - P) * V, ht = _ - (_ - N) * V, E = S - (S - F) * V;
12433
12417
  const J = Math.round(Math.min(D, W)), At = Math.round(Math.max(D, W));
12434
- let st = u * H + J * 4;
12418
+ let st = u * z + J * 4;
12435
12419
  for (let B = J; B <= At; B++)
12436
- V = (D - B) / (D - W), V < 0 ? V = 0 : V > 1 && (V = 1), c[st++] = z - (z - ot) * V | 0, c[st++] = M - (M - lt) * V | 0, c[st++] = R - (R - E) * V | 0, c[st++] = 255;
12420
+ V = (D - B) / (D - W), V < 0 ? V = 0 : V > 1 && (V = 1), c[st++] = H - (H - ot) * V | 0, c[st++] = M - (M - ht) * V | 0, c[st++] = R - (R - E) * V | 0, c[st++] = 255;
12437
12421
  }
12438
12422
  }
12439
- function wf(a, t, e) {
12423
+ function _f(a, t, e) {
12440
12424
  const s = t.coords, i = t.colors;
12441
12425
  let n, r;
12442
12426
  switch (t.type) {
@@ -12456,7 +12440,7 @@ function wf(a, t, e) {
12456
12440
  throw new Error("illegal figure");
12457
12441
  }
12458
12442
  }
12459
- class xf extends wo {
12443
+ class wf extends wo {
12460
12444
  constructor(t) {
12461
12445
  super(), this._coords = t[2], this._colors = t[3], this._figures = t[4], this._bounds = t[5], this._bbox = t[7], this._background = t[8], this.matrix = null;
12462
12446
  }
@@ -12475,7 +12459,7 @@ class xf extends wo {
12475
12459
  A[T] = e[0], A[T + 1] = e[1], A[T + 2] = e[2], A[T + 3] = 255;
12476
12460
  }
12477
12461
  for (const A of this._figures)
12478
- wf(_, A, p);
12462
+ _f(_, A, p);
12479
12463
  return y.putImageData(_, 2, 2), {
12480
12464
  canvas: v.canvas,
12481
12465
  offsetX: o - 2 * f,
@@ -12488,7 +12472,7 @@ class xf extends wo {
12488
12472
  Nr(t, this._bbox);
12489
12473
  let n;
12490
12474
  if (i === Ot.SHADING)
12491
- n = G.singularValueDecompose2dScale(ut(t));
12475
+ n = G.singularValueDecompose2dScale(ct(t));
12492
12476
  else if (n = G.singularValueDecompose2dScale(e.baseTransform), this.matrix) {
12493
12477
  const o = G.singularValueDecompose2dScale(this.matrix);
12494
12478
  n = [n[0] * o[0], n[1] * o[1]];
@@ -12497,19 +12481,19 @@ class xf extends wo {
12497
12481
  return i !== Ot.SHADING && (t.setTransform(...e.baseTransform), this.matrix && t.transform(...this.matrix)), t.translate(r.offsetX, r.offsetY), t.scale(r.scaleX, r.scaleY), t.createPattern(r.canvas, "no-repeat");
12498
12482
  }
12499
12483
  }
12500
- class Sf extends wo {
12484
+ class xf extends wo {
12501
12485
  getPattern() {
12502
12486
  return "hotpink";
12503
12487
  }
12504
12488
  }
12505
- function Cf(a) {
12489
+ function Sf(a) {
12506
12490
  switch (a[0]) {
12507
12491
  case "RadialAxial":
12508
- return new _f(a);
12492
+ return new yf(a);
12509
12493
  case "Mesh":
12510
- return new xf(a);
12494
+ return new wf(a);
12511
12495
  case "Dummy":
12512
- return new Sf();
12496
+ return new xf();
12513
12497
  }
12514
12498
  throw new Error(`Unknown IR type: ${a[0]}`);
12515
12499
  }
@@ -12540,16 +12524,16 @@ class xo {
12540
12524
  let _ = g, S = p, A = !1, T = !1;
12541
12525
  const k = Math.ceil(h * v), P = Math.ceil(l * y), N = Math.ceil(g * v), F = Math.ceil(p * y);
12542
12526
  k >= N ? _ = h : A = !0, P >= F ? S = l : T = !0;
12543
- const I = this.getSizeAndScale(_, this.ctx.canvas.width, v), O = this.getSizeAndScale(S, this.ctx.canvas.height, y), D = t.cachedCanvases.getCanvas("pattern", I.size, O.size), z = D.context, M = o.createCanvasGraphics(z);
12544
- if (M.groupLevel = t.groupLevel, this.setFillAndStrokeStyleToContext(M, i, r), z.translate(-I.scale * c, -O.scale * u), M.transform(I.scale, 0, 0, O.scale, 0, 0), z.save(), this.clipBbox(M, c, u, d, f), M.baseTransform = ut(M.ctx), M.executeOperatorList(s), M.endDrawing(), z.restore(), A || T) {
12527
+ const I = this.getSizeAndScale(_, this.ctx.canvas.width, v), O = this.getSizeAndScale(S, this.ctx.canvas.height, y), D = t.cachedCanvases.getCanvas("pattern", I.size, O.size), H = D.context, M = o.createCanvasGraphics(H);
12528
+ if (M.groupLevel = t.groupLevel, this.setFillAndStrokeStyleToContext(M, i, r), H.translate(-I.scale * c, -O.scale * u), M.transform(I.scale, 0, 0, O.scale, 0, 0), H.save(), this.clipBbox(M, c, u, d, f), M.baseTransform = ct(M.ctx), M.executeOperatorList(s), M.endDrawing(), H.restore(), A || T) {
12545
12529
  const R = D.canvas;
12546
12530
  A && (_ = h), T && (S = l);
12547
- const W = this.getSizeAndScale(_, this.ctx.canvas.width, v), ot = this.getSizeAndScale(S, this.ctx.canvas.height, y), lt = W.size, E = ot.size, H = t.cachedCanvases.getCanvas("pattern-workaround", lt, E), V = H.context, J = A ? Math.floor(g / h) : 0, At = T ? Math.floor(p / l) : 0;
12531
+ const W = this.getSizeAndScale(_, this.ctx.canvas.width, v), ot = this.getSizeAndScale(S, this.ctx.canvas.height, y), ht = W.size, E = ot.size, z = t.cachedCanvases.getCanvas("pattern-workaround", ht, E), V = z.context, J = A ? Math.floor(g / h) : 0, At = T ? Math.floor(p / l) : 0;
12548
12532
  for (let st = 0; st <= J; st++)
12549
12533
  for (let B = 0; B <= At; B++)
12550
- V.drawImage(R, lt * st, E * B, lt, E, 0, 0, lt, E);
12534
+ V.drawImage(R, ht * st, E * B, ht, E, 0, 0, ht, E);
12551
12535
  return {
12552
- canvas: H.canvas,
12536
+ canvas: z.canvas,
12553
12537
  scaleX: W.scale,
12554
12538
  scaleY: ot.scale,
12555
12539
  offsetX: c,
@@ -12574,7 +12558,7 @@ class xo {
12574
12558
  }
12575
12559
  clipBbox(t, e, s, i, n) {
12576
12560
  const r = i - e, o = n - s;
12577
- t.ctx.rect(e, s, r, o), t.current.updateRectMinMax(ut(t.ctx), [e, s, i, n]), t.clip(), t.endPath();
12561
+ t.ctx.rect(e, s, r, o), t.current.updateRectMinMax(ct(t.ctx), [e, s, i, n]), t.clip(), t.endPath();
12578
12562
  }
12579
12563
  setFillAndStrokeStyleToContext(t, e, s) {
12580
12564
  const i = t.ctx, n = t.current;
@@ -12588,7 +12572,7 @@ class xo {
12588
12572
  i.fillStyle = o, i.strokeStyle = o, n.fillColor = o, n.strokeColor = o;
12589
12573
  break;
12590
12574
  default:
12591
- throw new qd(`Unsupported paint type: ${e}`);
12575
+ throw new $d(`Unsupported paint type: ${e}`);
12592
12576
  }
12593
12577
  }
12594
12578
  getPattern(t, e, s, i) {
@@ -12601,7 +12585,7 @@ class xo {
12601
12585
  return h.setTransform(o), h;
12602
12586
  }
12603
12587
  }
12604
- function Af({
12588
+ function Cf({
12605
12589
  src: a,
12606
12590
  srcPos: t = 0,
12607
12591
  dest: e,
@@ -12629,8 +12613,8 @@ function Af({
12629
12613
  destPos: f
12630
12614
  };
12631
12615
  }
12632
- const ja = 16, Ba = 100, Tf = 15, Ha = 10, za = 1e3, Yt = 16;
12633
- function Ef(a, t) {
12616
+ const ja = 16, Ba = 100, Af = 15, Ha = 10, za = 1e3, Yt = 16;
12617
+ function Tf(a, t) {
12634
12618
  if (a._removeMirroring)
12635
12619
  throw new Error("Context is already forwarding operations.");
12636
12620
  a.__originalSave = a.save, a.__originalRestore = a.restore, a.__originalRotate = a.rotate, a.__originalScale = a.scale, a.__originalTranslate = a.translate, a.__originalTransform = a.transform, a.__originalSetTransform = a.setTransform, a.__originalResetTransform = a.resetTransform, a.__originalClip = a.clip, a.__originalMoveTo = a.moveTo, a.__originalLineTo = a.lineTo, a.__originalBezierCurveTo = a.bezierCurveTo, a.__originalRect = a.rect, a.__originalClosePath = a.closePath, a.__originalBeginPath = a.beginPath, a._removeMirroring = () => {
@@ -12667,7 +12651,7 @@ function Ef(a, t) {
12667
12651
  t.beginPath(), this.__originalBeginPath();
12668
12652
  };
12669
12653
  }
12670
- class kf {
12654
+ class Ef {
12671
12655
  constructor(t) {
12672
12656
  this.canvasFactory = t, this.cache = /* @__PURE__ */ Object.create(null);
12673
12657
  }
@@ -12686,7 +12670,7 @@ class kf {
12686
12670
  }
12687
12671
  }
12688
12672
  function Ji(a, t, e, s, i, n, r, o, h, l) {
12689
- const [c, u, d, f, g, p] = ut(a);
12673
+ const [c, u, d, f, g, p] = ct(a);
12690
12674
  if (u === 0 && d === 0) {
12691
12675
  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, k = (o + l) * f + p, P = Math.abs(Math.round(k) - S) || 1;
12692
12676
  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];
@@ -12699,7 +12683,7 @@ function Ji(a, t, e, s, i, n, r, o, h, l) {
12699
12683
  const b = Math.hypot(c, u), m = Math.hypot(d, f);
12700
12684
  return [b * h, m * l];
12701
12685
  }
12702
- function Mf(a) {
12686
+ function kf(a) {
12703
12687
  const {
12704
12688
  width: t,
12705
12689
  height: e
@@ -12854,7 +12838,7 @@ function Wa(a, t) {
12854
12838
  const d = u < n ? Yt : i;
12855
12839
  ({
12856
12840
  srcPos: h
12857
- } = Af({
12841
+ } = Cf({
12858
12842
  src: l,
12859
12843
  srcPos: h,
12860
12844
  dest: c,
@@ -12886,13 +12870,13 @@ function Xa(a, t) {
12886
12870
  const s = Math.fround((globalThis.devicePixelRatio || 1) * Fs.PDF_TO_CSS_UNITS);
12887
12871
  return e[0] <= s && e[1] <= s;
12888
12872
  }
12889
- const Pf = ["butt", "round", "square"], Of = ["miter", "round", "bevel"], Df = {}, Ua = {};
12873
+ const Mf = ["butt", "round", "square"], Pf = ["miter", "round", "bevel"], Of = {}, Ua = {};
12890
12874
  class ks {
12891
12875
  constructor(t, e, s, i, n, {
12892
12876
  optionalContentConfig: r,
12893
12877
  markedContentStack: o = null
12894
12878
  }, h, l) {
12895
- this.ctx = t, this.current = new Ga(this.ctx.canvas.width, this.ctx.canvas.height), this.stateStack = [], this.pendingClip = null, this.pendingEOFill = !1, this.res = null, this.xobjs = null, this.commonObjs = e, this.objs = s, this.canvasFactory = i, this.filterFactory = n, this.groupStack = [], this.processingType3 = null, this.baseTransform = null, this.baseTransformStack = [], this.groupLevel = 0, this.smaskStack = [], this.smaskCounter = 0, this.tempSMask = null, this.suspendedCtx = null, this.contentVisible = !0, this.markedContentStack = o || [], this.optionalContentConfig = r, this.cachedCanvases = new kf(this.canvasFactory), this.cachedPatterns = /* @__PURE__ */ new Map(), this.annotationCanvasMap = h, this.viewportScale = 1, this.outputScaleX = 1, this.outputScaleY = 1, this.pageColors = l, this._cachedScaleForStroking = [-1, 0], this._cachedGetSinglePixelWidth = null, this._cachedBitmapsMap = /* @__PURE__ */ new Map();
12879
+ this.ctx = t, this.current = new Ga(this.ctx.canvas.width, this.ctx.canvas.height), this.stateStack = [], this.pendingClip = null, this.pendingEOFill = !1, this.res = null, this.xobjs = null, this.commonObjs = e, this.objs = s, this.canvasFactory = i, this.filterFactory = n, this.groupStack = [], this.processingType3 = null, this.baseTransform = null, this.baseTransformStack = [], this.groupLevel = 0, this.smaskStack = [], this.smaskCounter = 0, this.tempSMask = null, this.suspendedCtx = null, this.contentVisible = !0, this.markedContentStack = o || [], this.optionalContentConfig = r, this.cachedCanvases = new Ef(this.canvasFactory), this.cachedPatterns = /* @__PURE__ */ new Map(), this.annotationCanvasMap = h, this.viewportScale = 1, this.outputScaleX = 1, this.outputScaleY = 1, this.pageColors = l, this._cachedScaleForStroking = [-1, 0], this._cachedGetSinglePixelWidth = null, this._cachedBitmapsMap = /* @__PURE__ */ new Map();
12896
12880
  }
12897
12881
  getObject(t, e = null) {
12898
12882
  return typeof t == "string" ? t.startsWith("g_") ? this.commonObjs.get(t) : this.objs.get(t) : e;
@@ -12906,9 +12890,9 @@ class ks {
12906
12890
  const n = this.ctx.canvas.width, r = this.ctx.canvas.height, o = this.ctx.fillStyle;
12907
12891
  if (this.ctx.fillStyle = i || "#ffffff", this.ctx.fillRect(0, 0, n, r), this.ctx.fillStyle = o, s) {
12908
12892
  const h = this.cachedCanvases.getCanvas("transparent", n, r);
12909
- this.compositeCtx = this.ctx, this.transparentCanvas = h.canvas, this.ctx = h.context, this.ctx.save(), this.ctx.transform(...ut(this.compositeCtx));
12893
+ this.compositeCtx = this.ctx, this.transparentCanvas = h.canvas, this.ctx = h.context, this.ctx.save(), this.ctx.transform(...ct(this.compositeCtx));
12910
12894
  }
12911
- this.ctx.save(), Zi(this.ctx), t && (this.ctx.transform(...t), this.outputScaleX = t[0], this.outputScaleY = t[0]), this.ctx.transform(...e.transform), this.viewportScale = e.scale, this.baseTransform = ut(this.ctx);
12895
+ this.ctx.save(), Zi(this.ctx), t && (this.ctx.transform(...t), this.outputScaleX = t[0], this.outputScaleY = t[0]), this.ctx.transform(...e.transform), this.viewportScale = e.scale, this.baseTransform = ct(this.ctx);
12912
12896
  }
12913
12897
  executeOperatorList(t, e, s, i) {
12914
12898
  const n = t.argsArray, r = t.fnArray;
@@ -12916,7 +12900,7 @@ class ks {
12916
12900
  const h = n.length;
12917
12901
  if (h === o)
12918
12902
  return o;
12919
- const l = h - o > Ha && typeof s == "function", c = l ? Date.now() + Tf : 0;
12903
+ const l = h - o > Ha && typeof s == "function", c = l ? Date.now() + Af : 0;
12920
12904
  let u = 0;
12921
12905
  const d = this.commonObjs, f = this.objs;
12922
12906
  let g;
@@ -12980,7 +12964,7 @@ class ks {
12980
12964
  const e = this.ctx, {
12981
12965
  width: s,
12982
12966
  height: i
12983
- } = t, n = this.current.fillColor, r = this.current.patternFill, o = ut(e);
12967
+ } = t, n = this.current.fillColor, r = this.current.patternFill, o = ct(e);
12984
12968
  let h, l, c, u;
12985
12969
  if ((t.bitmap || t.data) && t.count > 1) {
12986
12970
  const k = t.bitmap || t.data.buffer;
@@ -13000,7 +12984,7 @@ class ks {
13000
12984
  let d = G.transform(o, [1 / s, 0, 0, -1 / i, 0, 0]);
13001
12985
  d = G.transform(d, [1, 0, 0, 1, 0, -i]);
13002
12986
  const [f, g, p, b] = G.getAxialAlignedBoundingBox([0, 0, s, i], d), m = Math.round(p - f) || 1, v = Math.round(b - g) || 1, y = this.cachedCanvases.getCanvas("fillCanvas", m, v), _ = y.context, S = f, A = g;
13003
- _.translate(-S, -A), _.transform(...d), c || (c = this._scaleImage(u.canvas, be(_)), c = c.img, h && r && h.set(l, c)), _.imageSmoothingEnabled = Xa(ut(_), t.interpolate), Ji(_, c, 0, 0, c.width, c.height, 0, 0, s, i), _.globalCompositeOperation = "source-in";
12987
+ _.translate(-S, -A), _.transform(...d), c || (c = this._scaleImage(u.canvas, be(_)), c = c.img, h && r && h.set(l, c)), _.imageSmoothingEnabled = Xa(ct(_), t.interpolate), Ji(_, c, 0, 0, c.width, c.height, 0, 0, s, i), _.globalCompositeOperation = "source-in";
13004
12988
  const T = G.transform(be(_), [1, 0, 0, 1, -S, -A]);
13005
12989
  return _.fillStyle = r ? n.getPattern(e, this, T, Ot.FILL) : n, _.fillRect(0, 0, s, i), h && !r && (this.cachedCanvases.delete("fillCanvas"), h.set(l, y.canvas)), {
13006
12990
  canvas: y.canvas,
@@ -13012,10 +12996,10 @@ class ks {
13012
12996
  t !== this.current.lineWidth && (this._cachedScaleForStroking[0] = -1), this.current.lineWidth = t, this.ctx.lineWidth = t;
13013
12997
  }
13014
12998
  setLineCap(t) {
13015
- this.ctx.lineCap = Pf[t];
12999
+ this.ctx.lineCap = Mf[t];
13016
13000
  }
13017
13001
  setLineJoin(t) {
13018
- this.ctx.lineJoin = Of[t];
13002
+ this.ctx.lineJoin = Pf[t];
13019
13003
  }
13020
13004
  setMiterLimit(t) {
13021
13005
  this.ctx.miterLimit = t;
@@ -13085,7 +13069,7 @@ class ks {
13085
13069
  const t = this.ctx.canvas.width, e = this.ctx.canvas.height, s = "smaskGroupAt" + this.groupLevel, i = this.cachedCanvases.getCanvas(s, t, e);
13086
13070
  this.suspendedCtx = this.ctx, this.ctx = i.context;
13087
13071
  const n = this.ctx;
13088
- n.setTransform(...ut(this.suspendedCtx)), $s(this.suspendedCtx, n), Ef(n, this.suspendedCtx), this.setGState([["BM", "source-over"], ["ca", 1], ["CA", 1]]);
13072
+ n.setTransform(...ct(this.suspendedCtx)), $s(this.suspendedCtx, n), Tf(n, this.suspendedCtx), this.setGState([["BM", "source-over"], ["ca", 1], ["CA", 1]]);
13089
13073
  }
13090
13074
  endSMaskMode() {
13091
13075
  if (!this.inSMaskMode)
@@ -13134,7 +13118,7 @@ class ks {
13134
13118
  constructPath(t, e, s) {
13135
13119
  const i = this.ctx, n = this.current;
13136
13120
  let r = n.x, o = n.y, h, l;
13137
- const c = ut(i), u = c[0] === 0 && c[3] === 0 || c[1] === 0 && c[2] === 0, d = u ? s.slice(0) : null;
13121
+ const c = ct(i), u = c[0] === 0 && c[3] === 0 || c[1] === 0 && c[2] === 0, d = u ? s.slice(0) : null;
13138
13122
  for (let f = 0, g = 0, p = t.length; f < p; f++)
13139
13123
  switch (t[f] | 0) {
13140
13124
  case le.rectangle:
@@ -13199,7 +13183,7 @@ class ks {
13199
13183
  this.consumePath();
13200
13184
  }
13201
13185
  clip() {
13202
- this.pendingClip = Df;
13186
+ this.pendingClip = Of;
13203
13187
  }
13204
13188
  eoClip() {
13205
13189
  this.pendingClip = Ua;
@@ -13291,7 +13275,7 @@ class ks {
13291
13275
  } else
13292
13276
  (u === Et.FILL || u === Et.FILL_STROKE) && r.fillText(t, e, s), (u === Et.STROKE || u === Et.FILL_STROKE) && r.strokeText(t, e, s);
13293
13277
  d && (this.pendingTextPaths ||= []).push({
13294
- transform: ut(r),
13278
+ transform: ct(r),
13295
13279
  x: e,
13296
13280
  y: s,
13297
13281
  fontSize: c,
@@ -13325,12 +13309,12 @@ class ks {
13325
13309
  if (e.patternFill) {
13326
13310
  n.save();
13327
13311
  const T = e.fillColor.getPattern(n, this, be(n), Ot.FILL);
13328
- m = ut(n), n.restore(), n.fillStyle = T;
13312
+ m = ct(n), n.restore(), n.fillStyle = T;
13329
13313
  }
13330
13314
  if (e.patternStroke) {
13331
13315
  n.save();
13332
13316
  const T = e.strokeColor.getPattern(n, this, be(n), Ot.STROKE);
13333
- v = ut(n), n.restore(), n.strokeStyle = T;
13317
+ v = ct(n), n.restore(), n.strokeStyle = T;
13334
13318
  }
13335
13319
  let y = e.lineWidth;
13336
13320
  const _ = e.textMatrixScale;
@@ -13377,8 +13361,8 @@ class ks {
13377
13361
  this.paintChar(F.fontChar, M, R, m, v);
13378
13362
  }
13379
13363
  }
13380
- const z = d ? D * p - P * l : D * p + P * l;
13381
- S += z, k && n.restore();
13364
+ const H = d ? D * p - P * l : D * p + P * l;
13365
+ S += H, k && n.restore();
13382
13366
  }
13383
13367
  d ? e.y -= S : e.x += S * c, n.restore(), this.compose();
13384
13368
  }
@@ -13409,7 +13393,7 @@ class ks {
13409
13393
  getColorN_Pattern(t) {
13410
13394
  let e;
13411
13395
  if (t[0] === "TilingPattern") {
13412
- const s = t[1], i = this.baseTransform || ut(this.ctx), n = {
13396
+ const s = t[1], i = this.baseTransform || ct(this.ctx), n = {
13413
13397
  createCanvasGraphics: (r) => new ks(r, this.commonObjs, this.objs, this.canvasFactory, this.filterFactory, {
13414
13398
  optionalContentConfig: this.optionalContentConfig,
13415
13399
  markedContentStack: this.markedContentStack
@@ -13440,7 +13424,7 @@ class ks {
13440
13424
  }
13441
13425
  _getPattern(t, e = null) {
13442
13426
  let s;
13443
- return this.cachedPatterns.has(t) ? s = this.cachedPatterns.get(t) : (s = Cf(this.getObject(t)), this.cachedPatterns.set(t, s)), e && (s.matrix = e), s;
13427
+ return this.cachedPatterns.has(t) ? s = this.cachedPatterns.get(t) : (s = Sf(this.getObject(t)), this.cachedPatterns.set(t, s)), e && (s.matrix = e), s;
13444
13428
  }
13445
13429
  shadingFill(t) {
13446
13430
  if (!this.contentVisible)
@@ -13467,9 +13451,9 @@ class ks {
13467
13451
  rt("Should not call beginImageData");
13468
13452
  }
13469
13453
  paintFormXObjectBegin(t, e) {
13470
- if (this.contentVisible && (this.save(), this.baseTransformStack.push(this.baseTransform), t && this.transform(...t), this.baseTransform = ut(this.ctx), e)) {
13454
+ if (this.contentVisible && (this.save(), this.baseTransformStack.push(this.baseTransform), t && this.transform(...t), this.baseTransform = ct(this.ctx), e)) {
13471
13455
  const s = e[2] - e[0], i = e[3] - e[1];
13472
- this.ctx.rect(e[0], e[1], s, i), this.current.updateRectMinMax(ut(this.ctx), e), this.clip(), this.endPath();
13456
+ this.ctx.rect(e[0], e[1], s, i), this.current.updateRectMinMax(ct(this.ctx), e), this.clip(), this.endPath();
13473
13457
  }
13474
13458
  }
13475
13459
  paintFormXObjectEnd() {
@@ -13481,10 +13465,10 @@ class ks {
13481
13465
  this.save(), this.inSMaskMode && (this.endSMaskMode(), this.current.activeSMask = null);
13482
13466
  const e = this.ctx;
13483
13467
  t.isolated || zn("TODO: Support non-isolated groups."), t.knockout && K("Knockout groups not supported.");
13484
- const s = ut(e);
13468
+ const s = ct(e);
13485
13469
  if (t.matrix && e.transform(...t.matrix), !t.bbox)
13486
13470
  throw new Error("Bounding box is required.");
13487
- let i = G.getAxialAlignedBoundingBox(t.bbox, ut(e));
13471
+ let i = G.getAxialAlignedBoundingBox(t.bbox, ct(e));
13488
13472
  const n = [0, 0, e.canvas.width, e.canvas.height];
13489
13473
  i = G.intersect(i, n) || [0, 0, 0, 0];
13490
13474
  const r = Math.floor(i[0]), o = Math.floor(i[1]), h = Math.max(Math.ceil(i[2]) - r, 1), l = Math.max(Math.ceil(i[3]) - o, 1);
@@ -13512,7 +13496,7 @@ class ks {
13512
13496
  this.tempSMask = this.smaskStack.pop(), this.restore();
13513
13497
  else {
13514
13498
  this.ctx.restore();
13515
- const i = ut(this.ctx);
13499
+ const i = ct(this.ctx);
13516
13500
  this.restore(), this.ctx.save(), this.ctx.setTransform(...i);
13517
13501
  const n = G.getAxialAlignedBoundingBox([0, 0, e.canvas.width, e.canvas.height], i);
13518
13502
  this.ctx.drawImage(e.canvas, 0, 0), this.ctx.restore(), this.compose(n);
@@ -13523,7 +13507,7 @@ class ks {
13523
13507
  const r = e[2] - e[0], o = e[3] - e[1];
13524
13508
  if (n && this.annotationCanvasMap) {
13525
13509
  s = s.slice(), s[4] -= e[0], s[5] -= e[1], e = e.slice(), e[0] = e[1] = 0, e[2] = r, e[3] = o;
13526
- const [h, l] = G.singularValueDecompose2dScale(ut(this.ctx)), {
13510
+ const [h, l] = G.singularValueDecompose2dScale(ct(this.ctx)), {
13527
13511
  viewportScale: c
13528
13512
  } = this, u = Math.ceil(r * this.outputScaleX * c), d = Math.ceil(o * this.outputScaleY * c);
13529
13513
  this.annotationCanvas = this.canvasFactory.create(u, d);
@@ -13546,7 +13530,7 @@ class ks {
13546
13530
  const e = t.count;
13547
13531
  t = this.getObject(t.data, t), t.count = e;
13548
13532
  const s = this.ctx, i = this.processingType3;
13549
- if (i && (i.compiled === void 0 && (i.compiled = Mf(t)), i.compiled)) {
13533
+ if (i && (i.compiled === void 0 && (i.compiled = kf(t)), i.compiled)) {
13550
13534
  i.compiled(s);
13551
13535
  return;
13552
13536
  }
@@ -13559,7 +13543,7 @@ class ks {
13559
13543
  t = this.getObject(t.data, t);
13560
13544
  const o = this.ctx;
13561
13545
  o.save();
13562
- const h = ut(o);
13546
+ const h = ct(o);
13563
13547
  o.transform(e, s, i, n, 0, 0);
13564
13548
  const l = this._createMaskCanvas(t);
13565
13549
  o.setTransform(1, 0, 0, 1, l.offsetX - h[4], l.offsetY - h[5]);
@@ -13649,7 +13633,7 @@ class ks {
13649
13633
  Va(h, t), n = this.applyTransferMapsToCanvas(h);
13650
13634
  }
13651
13635
  const r = this._scaleImage(n, be(i));
13652
- i.imageSmoothingEnabled = Xa(ut(i), t.interpolate), Ji(i, r.img, 0, 0, r.paintWidth, r.paintHeight, 0, -s, e, s), this.compose(), this.restore();
13636
+ i.imageSmoothingEnabled = Xa(ct(i), t.interpolate), Ji(i, r.img, 0, 0, r.paintWidth, r.paintHeight, 0, -s, e, s), this.compose(), this.restore();
13653
13637
  }
13654
13638
  paintInlineImageXObjectGroup(t, e) {
13655
13639
  if (!this.contentVisible)
@@ -13700,7 +13684,7 @@ class ks {
13700
13684
  }
13701
13685
  getSinglePixelWidth() {
13702
13686
  if (!this._cachedGetSinglePixelWidth) {
13703
- const t = ut(this.ctx);
13687
+ const t = ct(this.ctx);
13704
13688
  if (t[1] === 0 && t[2] === 0)
13705
13689
  this._cachedGetSinglePixelWidth = 1 / Math.min(Math.abs(t[0]), Math.abs(t[3]));
13706
13690
  else {
@@ -13795,7 +13779,7 @@ class li {
13795
13779
  this.#e = t;
13796
13780
  }
13797
13781
  }
13798
- class Rf {
13782
+ class Df {
13799
13783
  #t;
13800
13784
  #e;
13801
13785
  constructor({
@@ -13818,7 +13802,7 @@ class Rf {
13818
13802
  }
13819
13803
  }
13820
13804
  const _s = Symbol("INTERNAL");
13821
- class Lf {
13805
+ class Rf {
13822
13806
  #t = !1;
13823
13807
  #e = !1;
13824
13808
  #s = !1;
@@ -13846,7 +13830,7 @@ class Lf {
13846
13830
  t !== _s && rt("Internal method `_setVisible` called."), this.#s = s, this.#i = e;
13847
13831
  }
13848
13832
  }
13849
- class Ff {
13833
+ class Lf {
13850
13834
  #t = null;
13851
13835
  #e = /* @__PURE__ */ new Map();
13852
13836
  #s = null;
@@ -13855,7 +13839,7 @@ class Ff {
13855
13839
  if (this.renderingIntent = e, this.name = null, this.creator = null, t !== null) {
13856
13840
  this.name = t.name, this.creator = t.creator, this.#i = t.order;
13857
13841
  for (const s of t.groups)
13858
- this.#e.set(s.id, new Lf(e, s));
13842
+ this.#e.set(s.id, new Rf(e, s));
13859
13843
  if (t.baseState === "OFF")
13860
13844
  for (const s of this.#e.values())
13861
13845
  s._setVisible(_s, !1);
@@ -14006,7 +13990,7 @@ class Ff {
14006
13990
  return this.#t = t.hexdigest();
14007
13991
  }
14008
13992
  }
14009
- class If {
13993
+ class Ff {
14010
13994
  constructor(t, {
14011
13995
  disableRange: e = !1,
14012
13996
  disableStream: s = !1
@@ -14075,12 +14059,12 @@ class If {
14075
14059
  getFullReader() {
14076
14060
  _t(!this._fullRequestReader, "PDFDataTransportStream.getFullReader can only be called once.");
14077
14061
  const t = this._queuedChunks;
14078
- return this._queuedChunks = null, new Nf(this, t, this._progressiveDone, this._contentDispositionFilename);
14062
+ return this._queuedChunks = null, new If(this, t, this._progressiveDone, this._contentDispositionFilename);
14079
14063
  }
14080
14064
  getRangeReader(t, e) {
14081
14065
  if (e <= this._progressiveDataLength)
14082
14066
  return null;
14083
- const s = new jf(this, t, e);
14067
+ const s = new Nf(this, t, e);
14084
14068
  return this._pdfDataRangeTransport.requestDataRange(t, e), this._rangeReaders.push(s), s;
14085
14069
  }
14086
14070
  cancelAllRequests(t) {
@@ -14090,7 +14074,7 @@ class If {
14090
14074
  this._pdfDataRangeTransport.abort();
14091
14075
  }
14092
14076
  }
14093
- class Nf {
14077
+ class If {
14094
14078
  constructor(t, e, s = !1, i = null) {
14095
14079
  this._stream = t, this._done = s || !1, this._filename = mo(i) ? i : null, this._queuedChunks = e || [], this._loaded = 0;
14096
14080
  for (const n of this._queuedChunks)
@@ -14145,7 +14129,7 @@ class Nf {
14145
14129
  this._done || (this._done = !0);
14146
14130
  }
14147
14131
  }
14148
- class jf {
14132
+ class Nf {
14149
14133
  constructor(t, e, s) {
14150
14134
  this._stream = t, this._begin = e, this._end = s, this._queuedChunk = null, this._requests = [], this._done = !1, this.onProgress = null;
14151
14135
  }
@@ -14197,7 +14181,7 @@ class jf {
14197
14181
  this._requests.length = 0, this._stream._removeRangeReader(this);
14198
14182
  }
14199
14183
  }
14200
- function Bf(a) {
14184
+ function jf(a) {
14201
14185
  let t = !0, e = s("filename\\*", "i").exec(a);
14202
14186
  if (e) {
14203
14187
  e = e[1];
@@ -14318,7 +14302,7 @@ function Dl({
14318
14302
  function Rl(a) {
14319
14303
  const t = a.get("Content-Disposition");
14320
14304
  if (t) {
14321
- let e = Bf(t);
14305
+ let e = jf(t);
14322
14306
  if (e.includes("%"))
14323
14307
  try {
14324
14308
  e = decodeURIComponent(e);
@@ -14357,12 +14341,12 @@ class Ya {
14357
14341
  return this._fullRequestReader?._loaded ?? 0;
14358
14342
  }
14359
14343
  getFullReader() {
14360
- return _t(!this._fullRequestReader, "PDFFetchStream.getFullReader can only be called once."), this._fullRequestReader = new Hf(this), this._fullRequestReader;
14344
+ return _t(!this._fullRequestReader, "PDFFetchStream.getFullReader can only be called once."), this._fullRequestReader = new Bf(this), this._fullRequestReader;
14361
14345
  }
14362
14346
  getRangeReader(t, e) {
14363
14347
  if (e <= this._progressiveDataLength)
14364
14348
  return null;
14365
- const s = new zf(this, t, e);
14349
+ const s = new Hf(this, t, e);
14366
14350
  return this._rangeRequestReaders.push(s), s;
14367
14351
  }
14368
14352
  cancelAllRequests(t) {
@@ -14371,7 +14355,7 @@ class Ya {
14371
14355
  e.cancel(t);
14372
14356
  }
14373
14357
  }
14374
- class Hf {
14358
+ class Bf {
14375
14359
  constructor(t) {
14376
14360
  this._stream = t, this._reader = null, this._loaded = 0, this._filename = null;
14377
14361
  const e = t.source;
@@ -14429,7 +14413,7 @@ class Hf {
14429
14413
  this._reader?.cancel(t), this._abortController.abort();
14430
14414
  }
14431
14415
  }
14432
- class zf {
14416
+ class Hf {
14433
14417
  constructor(t, e, s) {
14434
14418
  this._stream = t, this._reader = null, this._loaded = 0;
14435
14419
  const i = t.source;
@@ -14470,11 +14454,11 @@ class zf {
14470
14454
  }
14471
14455
  }
14472
14456
  const br = 200, vr = 206;
14473
- function Gf(a) {
14457
+ function zf(a) {
14474
14458
  const t = a.response;
14475
14459
  return typeof t != "string" ? t : Gn(t).buffer;
14476
14460
  }
14477
- class Vf {
14461
+ class Gf {
14478
14462
  _responseOrigin = null;
14479
14463
  constructor({
14480
14464
  url: t,
@@ -14514,7 +14498,7 @@ class Vf {
14514
14498
  s.onError(i.status);
14515
14499
  return;
14516
14500
  }
14517
- const o = Gf(i);
14501
+ const o = zf(i);
14518
14502
  if (n === vr) {
14519
14503
  const h = i.getResponseHeader("Content-Range"), l = /bytes (\d+)-(\d+)\/(\d+)/.exec(h);
14520
14504
  l ? s.onDone({
@@ -14537,19 +14521,19 @@ class Vf {
14537
14521
  delete this.pendingRequests[t], e.abort();
14538
14522
  }
14539
14523
  }
14540
- class Wf {
14524
+ class Vf {
14541
14525
  constructor(t) {
14542
- this._source = t, this._manager = new Vf(t), this._rangeChunkSize = t.rangeChunkSize, this._fullRequestReader = null, this._rangeRequestReaders = [];
14526
+ this._source = t, this._manager = new Gf(t), this._rangeChunkSize = t.rangeChunkSize, this._fullRequestReader = null, this._rangeRequestReaders = [];
14543
14527
  }
14544
14528
  _onRangeRequestReaderClosed(t) {
14545
14529
  const e = this._rangeRequestReaders.indexOf(t);
14546
14530
  e >= 0 && this._rangeRequestReaders.splice(e, 1);
14547
14531
  }
14548
14532
  getFullReader() {
14549
- return _t(!this._fullRequestReader, "PDFNetworkStream.getFullReader can only be called once."), this._fullRequestReader = new Xf(this._manager, this._source), this._fullRequestReader;
14533
+ return _t(!this._fullRequestReader, "PDFNetworkStream.getFullReader can only be called once."), this._fullRequestReader = new Wf(this._manager, this._source), this._fullRequestReader;
14550
14534
  }
14551
14535
  getRangeReader(t, e) {
14552
- const s = new Uf(this._manager, t, e);
14536
+ const s = new Xf(this._manager, t, e);
14553
14537
  return s.onClosed = this._onRangeRequestReaderClosed.bind(this), this._rangeRequestReaders.push(s), s;
14554
14538
  }
14555
14539
  cancelAllRequests(t) {
@@ -14558,7 +14542,7 @@ class Wf {
14558
14542
  e.cancel(t);
14559
14543
  }
14560
14544
  }
14561
- class Xf {
14545
+ class Wf {
14562
14546
  constructor(t, e) {
14563
14547
  this._manager = t, this._url = e.url, this._fullRequestId = t.request({
14564
14548
  onHeadersReceived: this._onHeadersReceived.bind(this),
@@ -14650,7 +14634,7 @@ class Xf {
14650
14634
  this._requests.length = 0, this._manager.isPendingRequest(this._fullRequestId) && this._manager.abortRequest(this._fullRequestId), this._fullRequestReader = null;
14651
14635
  }
14652
14636
  }
14653
- class Uf {
14637
+ class Xf {
14654
14638
  constructor(t, e, s) {
14655
14639
  this._manager = t, this._url = t.url, this._requestId = t.request({
14656
14640
  begin: e,
@@ -14723,27 +14707,27 @@ class Uf {
14723
14707
  this._requests.length = 0, this._manager.isPendingRequest(this._requestId) && this._manager.abortRequest(this._requestId), this._close();
14724
14708
  }
14725
14709
  }
14726
- const Yf = /^[a-z][a-z0-9\-+.]+:/i;
14727
- function $f(a) {
14728
- if (Yf.test(a))
14710
+ const Uf = /^[a-z][a-z0-9\-+.]+:/i;
14711
+ function Yf(a) {
14712
+ if (Uf.test(a))
14729
14713
  return new URL(a);
14730
14714
  const t = process.getBuiltinModule("url");
14731
14715
  return new URL(t.pathToFileURL(a));
14732
14716
  }
14733
- class qf {
14717
+ class $f {
14734
14718
  constructor(t) {
14735
- this.source = t, this.url = $f(t.url), _t(this.url.protocol === "file:", "PDFNodeStream only supports file:// URLs."), this._fullRequestReader = null, this._rangeRequestReaders = [];
14719
+ this.source = t, this.url = Yf(t.url), _t(this.url.protocol === "file:", "PDFNodeStream only supports file:// URLs."), this._fullRequestReader = null, this._rangeRequestReaders = [];
14736
14720
  }
14737
14721
  get _progressiveDataLength() {
14738
14722
  return this._fullRequestReader?._loaded ?? 0;
14739
14723
  }
14740
14724
  getFullReader() {
14741
- return _t(!this._fullRequestReader, "PDFNodeStream.getFullReader can only be called once."), this._fullRequestReader = new Kf(this), this._fullRequestReader;
14725
+ return _t(!this._fullRequestReader, "PDFNodeStream.getFullReader can only be called once."), this._fullRequestReader = new qf(this), this._fullRequestReader;
14742
14726
  }
14743
14727
  getRangeReader(t, e) {
14744
14728
  if (e <= this._progressiveDataLength)
14745
14729
  return null;
14746
- const s = new Jf(this, t, e);
14730
+ const s = new Kf(this, t, e);
14747
14731
  return this._rangeRequestReaders.push(s), s;
14748
14732
  }
14749
14733
  cancelAllRequests(t) {
@@ -14752,7 +14736,7 @@ class qf {
14752
14736
  e.cancel(t);
14753
14737
  }
14754
14738
  }
14755
- class Kf {
14739
+ class qf {
14756
14740
  constructor(t) {
14757
14741
  this._url = t.url, this._done = !1, this._storedError = null, this.onProgress = null;
14758
14742
  const e = t.source;
@@ -14816,7 +14800,7 @@ class Kf {
14816
14800
  }), !this._isStreamingSupported && this._isRangeSupported && this._error(new Ue("streaming is disabled")), this._storedError && this._readableStream.destroy(this._storedError);
14817
14801
  }
14818
14802
  }
14819
- class Jf {
14803
+ class Kf {
14820
14804
  constructor(t, e, s) {
14821
14805
  this._url = t.url, this._done = !1, this._storedError = null, this.onProgress = null, this._loaded = 0, this._readableStream = null, this._readCapability = Promise.withResolvers();
14822
14806
  const i = t.source;
@@ -14866,7 +14850,7 @@ class Jf {
14866
14850
  }), this._storedError && this._readableStream.destroy(this._storedError);
14867
14851
  }
14868
14852
  }
14869
- const Zf = 1e5, Xt = 30, Qf = 0.8;
14853
+ const Jf = 1e5, Xt = 30, Zf = 0.8;
14870
14854
  class Ft {
14871
14855
  #t = Promise.withResolvers();
14872
14856
  #e = null;
@@ -14979,7 +14963,7 @@ class Ft {
14979
14963
  this.#n.ctx ??= Ft.#k(this.#r);
14980
14964
  const e = this.#m, s = this.#o;
14981
14965
  for (const i of t) {
14982
- if (e.length > Zf) {
14966
+ if (e.length > Jf) {
14983
14967
  K("Ignoring additional textDivs for performance reasons."), this.#s = !0;
14984
14968
  return;
14985
14969
  }
@@ -15110,7 +15094,7 @@ class Ft {
15110
15094
  break;
15111
15095
  }
15112
15096
  i.canvas.width = i.canvas.height = 0;
15113
- const l = r ? r / (r + o) : Qf;
15097
+ const l = r ? r / (r + o) : Zf;
15114
15098
  return this.#_.set(t, l), l;
15115
15099
  }
15116
15100
  }
@@ -15142,8 +15126,8 @@ class pi {
15142
15126
  return !(t === "textarea" || t === "input" || t === "option" || t === "select");
15143
15127
  }
15144
15128
  }
15145
- const tg = 65536, eg = 100, sg = 5e3, ig = Dt ? bf : gf, ng = Dt ? vf : Tl, rg = Dt ? mf : pf, og = Dt ? yf : Ml;
15146
- function ag(a = {}) {
15129
+ const Qf = 65536, tg = 100, eg = 5e3, sg = Dt ? mf : ff, ig = Dt ? bf : Tl, ng = Dt ? pf : gf, rg = Dt ? vf : Ml;
15130
+ function og(a = {}) {
15147
15131
  typeof a == "string" || a instanceof URL ? a = {
15148
15132
  url: a
15149
15133
  } : (a instanceof ArrayBuffer || ArrayBuffer.isView(a)) && (a = {
@@ -15151,10 +15135,10 @@ function ag(a = {}) {
15151
15135
  });
15152
15136
  const t = new So(), {
15153
15137
  docId: e
15154
- } = t, s = a.url ? hg(a.url) : null, i = a.data ? lg(a.data) : null, n = a.httpHeaders || null, r = a.withCredentials === !0, o = a.password ?? null, h = a.range instanceof Nl ? a.range : null, l = Number.isInteger(a.rangeChunkSize) && a.rangeChunkSize > 0 ? a.rangeChunkSize : tg;
15138
+ } = t, s = a.url ? ag(a.url) : null, i = a.data ? hg(a.data) : null, n = a.httpHeaders || null, r = a.withCredentials === !0, o = a.password ?? null, h = a.range instanceof Nl ? a.range : null, l = Number.isInteger(a.rangeChunkSize) && a.rangeChunkSize > 0 ? a.rangeChunkSize : Qf;
15155
15139
  let c = a.worker instanceof Ms ? a.worker : null;
15156
- const u = a.verbosity, d = typeof a.docBaseUrl == "string" && !Wn(a.docBaseUrl) ? a.docBaseUrl : null, f = typeof a.cMapUrl == "string" ? a.cMapUrl : null, g = a.cMapPacked !== !1, p = a.CMapReaderFactory || ng, b = typeof a.standardFontDataUrl == "string" ? a.standardFontDataUrl : null, m = a.StandardFontDataFactory || og, 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 : !Dt, A = typeof a.isImageDecoderSupported == "boolean" ? a.isImageDecoderSupported : !Dt && (zt.platform.isFirefox || !globalThis.chrome), T = Number.isInteger(a.canvasMaxAreaInBytes) ? a.canvasMaxAreaInBytes : -1, k = typeof a.disableFontFace == "boolean" ? a.disableFontFace : Dt, P = a.fontExtraProperties === !0, N = a.enableXfa === !0, F = a.ownerDocument || globalThis.document, I = a.disableRange === !0, O = a.disableStream === !0, D = a.disableAutoFetch === !0, z = a.pdfBug === !0, M = a.CanvasFactory || ig, R = a.FilterFactory || rg, W = a.enableHWA === !0, ot = h ? h.length : a.length ?? NaN, lt = typeof a.useSystemFonts == "boolean" ? a.useSystemFonts : !Dt && !k, E = typeof a.useWorkerFetch == "boolean" ? a.useWorkerFetch : p === Tl && m === Ml && f && b && ti(f, document.baseURI) && ti(b, document.baseURI), H = null;
15157
- Xd(u);
15140
+ const u = a.verbosity, d = typeof a.docBaseUrl == "string" && !Wn(a.docBaseUrl) ? a.docBaseUrl : null, f = typeof a.cMapUrl == "string" ? a.cMapUrl : null, g = a.cMapPacked !== !1, p = a.CMapReaderFactory || ig, b = typeof a.standardFontDataUrl == "string" ? a.standardFontDataUrl : null, m = a.StandardFontDataFactory || rg, 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 : !Dt, A = typeof a.isImageDecoderSupported == "boolean" ? a.isImageDecoderSupported : !Dt && (zt.platform.isFirefox || !globalThis.chrome), T = Number.isInteger(a.canvasMaxAreaInBytes) ? a.canvasMaxAreaInBytes : -1, k = typeof a.disableFontFace == "boolean" ? a.disableFontFace : Dt, P = a.fontExtraProperties === !0, N = a.enableXfa === !0, F = a.ownerDocument || globalThis.document, I = a.disableRange === !0, O = a.disableStream === !0, D = a.disableAutoFetch === !0, H = a.pdfBug === !0, M = a.CanvasFactory || sg, R = a.FilterFactory || ng, W = a.enableHWA === !0, ot = h ? h.length : a.length ?? NaN, ht = typeof a.useSystemFonts == "boolean" ? a.useSystemFonts : !Dt && !k, E = typeof a.useWorkerFetch == "boolean" ? a.useWorkerFetch : p === Tl && m === Ml && f && b && ti(f, document.baseURI) && ti(b, document.baseURI), z = null;
15141
+ Wd(u);
15158
15142
  const V = {
15159
15143
  canvasFactory: new M({
15160
15144
  ownerDocument: F,
@@ -15198,7 +15182,7 @@ function ag(a = {}) {
15198
15182
  isImageDecoderSupported: A,
15199
15183
  canvasMaxAreaInBytes: T,
15200
15184
  fontExtraProperties: P,
15201
- useSystemFonts: lt,
15185
+ useSystemFonts: ht,
15202
15186
  cMapUrl: E ? f : null,
15203
15187
  standardFontDataUrl: E ? b : null
15204
15188
  }
@@ -15206,8 +15190,8 @@ function ag(a = {}) {
15206
15190
  disableFontFace: k,
15207
15191
  fontExtraProperties: P,
15208
15192
  ownerDocument: F,
15209
- pdfBug: z,
15210
- styleElement: H,
15193
+ pdfBug: H,
15194
+ styleElement: z,
15211
15195
  loadingParams: {
15212
15196
  disableAutoFetch: D,
15213
15197
  enableXfa: N
@@ -15221,24 +15205,24 @@ function ag(a = {}) {
15221
15205
  const st = c.messageHandler.sendWithPromise("GetDocRequest", J, i ? [i.buffer] : null);
15222
15206
  let B;
15223
15207
  if (h)
15224
- B = new If(h, {
15208
+ B = new Ff(h, {
15225
15209
  disableRange: I,
15226
15210
  disableStream: O
15227
15211
  });
15228
15212
  else if (!i) {
15229
15213
  if (!s)
15230
15214
  throw new Error("getDocument - no `url` parameter provided.");
15231
- let at;
15215
+ let ut;
15232
15216
  if (Dt)
15233
15217
  if (ti(s)) {
15234
15218
  if (typeof fetch > "u" || typeof Response > "u" || !("body" in Response.prototype))
15235
15219
  throw new Error("getDocument - the Fetch API was disabled in Node.js, see `--no-experimental-fetch`.");
15236
- at = Ya;
15220
+ ut = Ya;
15237
15221
  } else
15238
- at = qf;
15222
+ ut = $f;
15239
15223
  else
15240
- at = ti(s) ? Ya : Wf;
15241
- B = new at({
15224
+ ut = ti(s) ? Ya : Vf;
15225
+ B = new ut({
15242
15226
  url: s,
15243
15227
  length: ot,
15244
15228
  httpHeaders: n,
@@ -15248,17 +15232,17 @@ function ag(a = {}) {
15248
15232
  disableStream: O
15249
15233
  });
15250
15234
  }
15251
- return st.then((at) => {
15235
+ return st.then((ut) => {
15252
15236
  if (t.destroyed)
15253
15237
  throw new Error("Loading aborted");
15254
15238
  if (c.destroyed)
15255
15239
  throw new Error("Worker was destroyed");
15256
- const Tt = new ei(e, at, c.port), Wt = new fg(Tt, t, B, At, V);
15240
+ const Tt = new ei(e, ut, c.port), Wt = new dg(Tt, t, B, At, V);
15257
15241
  t._transport = Wt, Tt.send("Ready", null);
15258
15242
  });
15259
15243
  }).catch(t._capability.reject), t;
15260
15244
  }
15261
- function hg(a) {
15245
+ function ag(a) {
15262
15246
  if (a instanceof URL)
15263
15247
  return a.href;
15264
15248
  try {
@@ -15269,7 +15253,7 @@ function hg(a) {
15269
15253
  }
15270
15254
  throw new Error("Invalid PDF url data: either string or URL-object is expected in the url property.");
15271
15255
  }
15272
- function lg(a) {
15256
+ function hg(a) {
15273
15257
  if (Dt && typeof Buffer < "u" && a instanceof Buffer)
15274
15258
  throw new Error("Please provide binary data as `Uint8Array`, rather than `Buffer`.");
15275
15259
  if (a instanceof Uint8Array && a.byteLength === a.buffer.byteLength)
@@ -15348,7 +15332,7 @@ class Nl {
15348
15332
  abort() {
15349
15333
  }
15350
15334
  }
15351
- class cg {
15335
+ class lg {
15352
15336
  constructor(t, e) {
15353
15337
  this._pdfInfo = t, this._transport = e;
15354
15338
  }
@@ -15460,7 +15444,7 @@ class cg {
15460
15444
  return this._transport.getCalculationOrderIds();
15461
15445
  }
15462
15446
  }
15463
- class ug {
15447
+ class cg {
15464
15448
  #t = null;
15465
15449
  #e = !1;
15466
15450
  constructor(t, e, s, i = !1) {
@@ -15672,7 +15656,7 @@ class ug {
15672
15656
  if (t)
15673
15657
  return this.#t = setTimeout(() => {
15674
15658
  this.#t = null, this.#s(!1);
15675
- }, sg), !1;
15659
+ }, eg), !1;
15676
15660
  for (const {
15677
15661
  renderTasks: e,
15678
15662
  operatorList: s
@@ -15752,7 +15736,7 @@ class ug {
15752
15736
  if (t.renderTasks.size > 0)
15753
15737
  return;
15754
15738
  if (e instanceof po) {
15755
- let i = eg;
15739
+ let i = tg;
15756
15740
  e.extraDelay > 0 && e.extraDelay < 1e3 && (i += e.extraDelay), t.streamReaderCancelTimeout = setTimeout(() => {
15757
15741
  t.streamReaderCancelTimeout = null, this._abortOperatorList({
15758
15742
  intentState: t,
@@ -15778,7 +15762,7 @@ class ug {
15778
15762
  return this._stats;
15779
15763
  }
15780
15764
  }
15781
- class dg {
15765
+ class ug {
15782
15766
  #t = /* @__PURE__ */ new Map();
15783
15767
  #e = Promise.resolve();
15784
15768
  postMessage(t, e) {
@@ -15817,17 +15801,17 @@ class dg {
15817
15801
  }
15818
15802
  }
15819
15803
  var An, ns, rs, Ps, rn, Os, on;
15820
- const ct = class ct {
15804
+ const lt = class lt {
15821
15805
  constructor({
15822
15806
  name: t = null,
15823
15807
  port: e = null,
15824
- verbosity: s = Ud()
15808
+ verbosity: s = Xd()
15825
15809
  } = {}) {
15826
15810
  bs(this, Ps);
15827
15811
  if (this.name = t, this.destroyed = !1, this.verbosity = s, this._readyCapability = Promise.withResolvers(), this._port = null, this._webWorker = null, this._messageHandler = null, e) {
15828
- if (oe(ct, rs)?.has(e))
15812
+ if (oe(lt, rs)?.has(e))
15829
15813
  throw new Error("Cannot use more than one PDFWorker per port.");
15830
- (oe(ct, rs) || Gs(ct, rs, /* @__PURE__ */ new WeakMap())).set(e, this), this._initializeFromPort(e);
15814
+ (oe(lt, rs) || Gs(lt, rs, /* @__PURE__ */ new WeakMap())).set(e, this), this._initializeFromPort(e);
15831
15815
  return;
15832
15816
  }
15833
15817
  this._initialize();
@@ -15846,15 +15830,15 @@ const ct = class ct {
15846
15830
  }), Ci(this, Ps, rn).call(this);
15847
15831
  }
15848
15832
  _initialize() {
15849
- if (oe(ct, ns) || oe(ct, Os, on)) {
15833
+ if (oe(lt, ns) || oe(lt, Os, on)) {
15850
15834
  this._setupFakeWorker();
15851
15835
  return;
15852
15836
  }
15853
15837
  let {
15854
15838
  workerSrc: t
15855
- } = ct;
15839
+ } = lt;
15856
15840
  try {
15857
- ct._isSameOrigin(window.location.href, t) || (t = ct._createCDNWrapper(new URL(t, window.location).href));
15841
+ lt._isSameOrigin(window.location.href, t) || (t = lt._createCDNWrapper(new URL(t, window.location).href));
15858
15842
  const e = new Worker(t, {
15859
15843
  type: "module"
15860
15844
  }), s = new ei("main", "worker", e), i = () => {
@@ -15893,21 +15877,21 @@ const ct = class ct {
15893
15877
  this._setupFakeWorker();
15894
15878
  }
15895
15879
  _setupFakeWorker() {
15896
- oe(ct, ns) || (K("Setting up fake worker."), Gs(ct, ns, !0)), ct._setupFakeWorkerGlobal.then((t) => {
15880
+ oe(lt, ns) || (K("Setting up fake worker."), Gs(lt, ns, !0)), lt._setupFakeWorkerGlobal.then((t) => {
15897
15881
  if (this.destroyed) {
15898
15882
  this._readyCapability.reject(new Error("Worker was destroyed"));
15899
15883
  return;
15900
15884
  }
15901
- const e = new dg();
15885
+ const e = new ug();
15902
15886
  this._port = e;
15903
- const s = `fake${Io(ct, An)._++}`, i = new ei(s + "_worker", s, e);
15887
+ const s = `fake${Io(lt, An)._++}`, i = new ei(s + "_worker", s, e);
15904
15888
  t.setup(i, e), this._messageHandler = new ei(s, s + "_worker", e), Ci(this, Ps, rn).call(this);
15905
15889
  }).catch((t) => {
15906
15890
  this._readyCapability.reject(new Error(`Setting up fake worker failed: "${t.message}".`));
15907
15891
  });
15908
15892
  }
15909
15893
  destroy() {
15910
- this.destroyed = !0, this._webWorker?.terminate(), this._webWorker = null, oe(ct, rs)?.delete(this._port), this._port = null, this._messageHandler?.destroy(), this._messageHandler = null;
15894
+ this.destroyed = !0, this._webWorker?.terminate(), this._webWorker = null, oe(lt, rs)?.delete(this._port), this._port = null, this._messageHandler?.destroy(), this._messageHandler = null;
15911
15895
  }
15912
15896
  static fromPort(t) {
15913
15897
  if (!t?.port)
@@ -15918,7 +15902,7 @@ const ct = class ct {
15918
15902
  throw new Error("PDFWorker.fromPort - the worker is being destroyed.\nPlease remember to await `PDFDocumentLoadingTask.destroy()`-calls.");
15919
15903
  return e;
15920
15904
  }
15921
- return new ct(t);
15905
+ return new lt(t);
15922
15906
  }
15923
15907
  static get workerSrc() {
15924
15908
  if (li.workerSrc)
@@ -15942,7 +15926,7 @@ An = new WeakMap(), ns = new WeakMap(), rs = new WeakMap(), Ps = new WeakSet(),
15942
15926
  } catch {
15943
15927
  return null;
15944
15928
  }
15945
- }, bs(ct, Os), bs(ct, An, 0), bs(ct, ns, !1), bs(ct, rs), Dt && (Gs(ct, ns, !0), li.workerSrc ||= "./pdf.worker.mjs"), ct._isSameOrigin = (t, e) => {
15929
+ }, bs(lt, Os), bs(lt, An, 0), bs(lt, ns, !1), bs(lt, rs), Dt && (Gs(lt, ns, !0), li.workerSrc ||= "./pdf.worker.mjs"), lt._isSameOrigin = (t, e) => {
15946
15930
  let s;
15947
15931
  try {
15948
15932
  if (s = new URL(t), !s.origin || s.origin === "null")
@@ -15952,21 +15936,21 @@ An = new WeakMap(), ns = new WeakMap(), rs = new WeakMap(), Ps = new WeakSet(),
15952
15936
  }
15953
15937
  const i = new URL(e, s);
15954
15938
  return s.origin === i.origin;
15955
- }, ct._createCDNWrapper = (t) => {
15939
+ }, lt._createCDNWrapper = (t) => {
15956
15940
  const e = `await import("${t}");`;
15957
15941
  return URL.createObjectURL(new Blob([e], {
15958
15942
  type: "text/javascript"
15959
15943
  }));
15960
15944
  };
15961
- let Ms = ct;
15962
- class fg {
15945
+ let Ms = lt;
15946
+ class dg {
15963
15947
  #t = /* @__PURE__ */ new Map();
15964
15948
  #e = /* @__PURE__ */ new Map();
15965
15949
  #s = /* @__PURE__ */ new Map();
15966
15950
  #i = /* @__PURE__ */ new Map();
15967
15951
  #r = null;
15968
15952
  constructor(t, e, s, i, n) {
15969
- this.messageHandler = t, this.loadingTask = e, this.commonObjs = new jl(), this.fontLoader = new df({
15953
+ this.messageHandler = t, this.loadingTask = e, this.commonObjs = new jl(), this.fontLoader = new uf({
15970
15954
  ownerDocument: i.ownerDocument,
15971
15955
  styleElement: i.styleElement
15972
15956
  }), this.loadingParams = i.loadingParams, this._params = i, this.canvasFactory = n.canvasFactory, this.filterFactory = n.filterFactory, this.cMapReaderFactory = n.cMapReaderFactory, this.standardFontDataFactory = n.standardFontDataFactory, this.destroyed = !1, this.destroyCapability = null, this._networkStream = s, this._fullReader = null, this._lastProgress = null, this.downloadInfoCapability = Promise.withResolvers(), this.setupMessageHandler();
@@ -16112,7 +16096,7 @@ class fg {
16112
16096
  }), t.on("GetDoc", ({
16113
16097
  pdfInfo: s
16114
16098
  }) => {
16115
- this._numPages = s.numPages, this._htmlForXfa = s.htmlForXfa, delete s.htmlForXfa, e._capability.resolve(new cg(s, this));
16099
+ this._numPages = s.numPages, this._htmlForXfa = s.htmlForXfa, delete s.htmlForXfa, e._capability.resolve(new lg(s, this));
16116
16100
  }), t.on("DocException", (s) => {
16117
16101
  e._capability.reject(Ut(s));
16118
16102
  }), t.on("PasswordRequest", (s) => {
@@ -16154,7 +16138,7 @@ class fg {
16154
16138
  K(`Error during font loading: ${d}`), this.commonObjs.resolve(s, d);
16155
16139
  break;
16156
16140
  }
16157
- const l = h && globalThis.FontInspector?.enabled ? (d, f) => globalThis.FontInspector.fontAdded(d, f) : null, c = new ff(n, {
16141
+ const l = h && globalThis.FontInspector?.enabled ? (d, f) => globalThis.FontInspector.fontAdded(d, f) : null, c = new df(n, {
16158
16142
  disableFontFace: r,
16159
16143
  fontExtraProperties: o,
16160
16144
  inspectFont: l
@@ -16195,7 +16179,7 @@ class fg {
16195
16179
  }
16196
16180
  switch (n) {
16197
16181
  case "Image":
16198
- o.objs.resolve(s, r), r?.dataLen > zd && (o._maybeCleanupAfterRender = !0);
16182
+ o.objs.resolve(s, r), r?.dataLen > Hd && (o._maybeCleanupAfterRender = !0);
16199
16183
  break;
16200
16184
  case "Pattern":
16201
16185
  o.objs.resolve(s, r);
@@ -16253,7 +16237,7 @@ class fg {
16253
16237
  if (this.destroyed)
16254
16238
  throw new Error("Transport destroyed");
16255
16239
  n.refStr && this.#i.set(n.refStr, t);
16256
- const r = new ug(e, n, this, this._params.pdfBug);
16240
+ const r = new cg(e, n, this, this._params.pdfBug);
16257
16241
  return this.#e.set(e, r), r;
16258
16242
  });
16259
16243
  return this.#s.set(e, i), i;
@@ -16322,7 +16306,7 @@ class fg {
16322
16306
  return this.messageHandler.sendWithPromise("GetOutline", null);
16323
16307
  }
16324
16308
  getOptionalContentConfig(t) {
16325
- return this.#n("GetOptionalContentConfig").then((e) => new Ff(e, t));
16309
+ return this.#n("GetOptionalContentConfig").then((e) => new Lf(e, t));
16326
16310
  }
16327
16311
  getPermissions() {
16328
16312
  return this.messageHandler.sendWithPromise("GetPermissions", null);
@@ -16333,7 +16317,7 @@ class fg {
16333
16317
  return e;
16334
16318
  const s = this.messageHandler.sendWithPromise(t, null).then((i) => ({
16335
16319
  info: i[0],
16336
- metadata: i[1] ? new Rf(i[1]) : null,
16320
+ metadata: i[1] ? new Df(i[1]) : null,
16337
16321
  contentDispositionFilename: this._fullReader?.filename ?? null,
16338
16322
  contentLength: this._fullReader?.contentLength ?? null
16339
16323
  }));
@@ -16407,7 +16391,7 @@ class jl {
16407
16391
  }
16408
16392
  }
16409
16393
  }
16410
- class gg {
16394
+ class fg {
16411
16395
  #t = null;
16412
16396
  constructor(t) {
16413
16397
  this.#t = t, this.onContinue = null;
@@ -16447,7 +16431,7 @@ class As {
16447
16431
  pdfBug: u = !1,
16448
16432
  pageColors: d = null
16449
16433
  }) {
16450
- this.callback = t, this.params = e, this.objs = s, this.commonObjs = i, this.annotationCanvasMap = n, this.operatorListIdx = null, this.operatorList = r, this._pageIndex = o, this.canvasFactory = h, this.filterFactory = l, this._pdfBug = u, this.pageColors = d, this.running = !1, this.graphicsReadyCallback = null, this.graphicsReady = !1, this._useRequestAnimationFrame = c === !0 && typeof window < "u", this.cancelled = !1, this.capability = Promise.withResolvers(), this.task = new gg(this), this._cancelBound = this.cancel.bind(this), this._continueBound = this._continue.bind(this), this._scheduleNextBound = this._scheduleNext.bind(this), this._nextBound = this._next.bind(this), this._canvas = e.canvasContext.canvas;
16434
+ this.callback = t, this.params = e, this.objs = s, this.commonObjs = i, this.annotationCanvasMap = n, this.operatorListIdx = null, this.operatorList = r, this._pageIndex = o, this.canvasFactory = h, this.filterFactory = l, this._pdfBug = u, this.pageColors = d, this.running = !1, this.graphicsReadyCallback = null, this.graphicsReady = !1, this._useRequestAnimationFrame = c === !0 && typeof window < "u", this.cancelled = !1, this.capability = Promise.withResolvers(), this.task = new fg(this), this._cancelBound = this.cancel.bind(this), this._continueBound = this._continue.bind(this), this._scheduleNextBound = this._scheduleNext.bind(this), this._nextBound = this._next.bind(this), this._canvas = e.canvasContext.canvas;
16451
16435
  }
16452
16436
  get completed() {
16453
16437
  return this.capability.promise.catch(function() {
@@ -16502,7 +16486,7 @@ class As {
16502
16486
  this.cancelled || (this.operatorListIdx = this.gfx.executeOperatorList(this.operatorList, this.operatorListIdx, this._continueBound, this.stepper), this.operatorListIdx === this.operatorList.argsArray.length && (this.running = !1, this.operatorList.lastChunk && (this.gfx.endDrawing(), As.#e.delete(this._canvas), this.callback())));
16503
16487
  }
16504
16488
  }
16505
- const pg = "4.10.38", mg = "f9bea397f";
16489
+ const gg = "4.10.38", pg = "f9bea397f";
16506
16490
  function qa(a) {
16507
16491
  return Math.floor(Math.max(0, Math.min(1, a)) * 255).toString(16).padStart(2, "0");
16508
16492
  }
@@ -16556,7 +16540,7 @@ class Ka {
16556
16540
  return ["CMYK", i, n, r, o];
16557
16541
  }
16558
16542
  }
16559
- class bg {
16543
+ class mg {
16560
16544
  create(t, e, s = !1) {
16561
16545
  if (t <= 0 || e <= 0)
16562
16546
  throw new Error("Invalid SVG dimensions");
@@ -16572,7 +16556,7 @@ class bg {
16572
16556
  rt("Abstract method `_createSVG` called.");
16573
16557
  }
16574
16558
  }
16575
- class Co extends bg {
16559
+ class Co extends mg {
16576
16560
  _createSVG(t) {
16577
16561
  return document.createElementNS(Me, t);
16578
16562
  }
@@ -16726,30 +16710,30 @@ class Bl {
16726
16710
  t.div.style.transform = e, t.div.hidden = !1;
16727
16711
  }
16728
16712
  }
16729
- const Si = 1e3, vg = 9, ds = /* @__PURE__ */ new WeakSet();
16713
+ const Si = 1e3, bg = 9, ds = /* @__PURE__ */ new WeakSet();
16730
16714
  function Ve(a) {
16731
16715
  return {
16732
16716
  width: a[2] - a[0],
16733
16717
  height: a[3] - a[1]
16734
16718
  };
16735
16719
  }
16736
- class yg {
16720
+ class vg {
16737
16721
  static create(t) {
16738
16722
  switch (t.data.annotationType) {
16739
16723
  case xt.LINK:
16740
16724
  return new Hl(t);
16741
16725
  case xt.TEXT:
16742
- return new _g(t);
16726
+ return new yg(t);
16743
16727
  case xt.WIDGET:
16744
16728
  switch (t.data.fieldType) {
16745
16729
  case "Tx":
16746
- return new wg(t);
16730
+ return new _g(t);
16747
16731
  case "Btn":
16748
- return t.data.radioButton ? new zl(t) : t.data.checkBox ? new Sg(t) : new Cg(t);
16732
+ return t.data.radioButton ? new zl(t) : t.data.checkBox ? new xg(t) : new Sg(t);
16749
16733
  case "Ch":
16750
- return new Ag(t);
16734
+ return new Cg(t);
16751
16735
  case "Sig":
16752
- return new xg(t);
16736
+ return new wg(t);
16753
16737
  }
16754
16738
  return new ms(t);
16755
16739
  case xt.POPUP:
@@ -16757,31 +16741,31 @@ class yg {
16757
16741
  case xt.FREETEXT:
16758
16742
  return new Gl(t);
16759
16743
  case xt.LINE:
16760
- return new Eg(t);
16744
+ return new Tg(t);
16761
16745
  case xt.SQUARE:
16762
- return new kg(t);
16746
+ return new Eg(t);
16763
16747
  case xt.CIRCLE:
16764
- return new Mg(t);
16748
+ return new kg(t);
16765
16749
  case xt.POLYLINE:
16766
16750
  return new Vl(t);
16767
16751
  case xt.CARET:
16768
- return new Og(t);
16752
+ return new Pg(t);
16769
16753
  case xt.INK:
16770
16754
  return new Ao(t);
16771
16755
  case xt.POLYGON:
16772
- return new Pg(t);
16756
+ return new Mg(t);
16773
16757
  case xt.HIGHLIGHT:
16774
16758
  return new Wl(t);
16775
16759
  case xt.UNDERLINE:
16776
- return new Dg(t);
16760
+ return new Og(t);
16777
16761
  case xt.SQUIGGLY:
16778
- return new Rg(t);
16762
+ return new Dg(t);
16779
16763
  case xt.STRIKEOUT:
16780
- return new Lg(t);
16764
+ return new Rg(t);
16781
16765
  case xt.STAMP:
16782
16766
  return new Xl(t);
16783
16767
  case xt.FILEATTACHMENT:
16784
- return new Fg(t);
16768
+ return new Lg(t);
16785
16769
  default:
16786
16770
  return new bt(t);
16787
16771
  }
@@ -17286,7 +17270,7 @@ class Hl extends bt {
17286
17270
  };
17287
17271
  }
17288
17272
  }
17289
- class _g extends bt {
17273
+ class yg extends bt {
17290
17274
  constructor(t) {
17291
17275
  super(t, {
17292
17276
  isRenderable: !0
@@ -17355,7 +17339,7 @@ class ms extends bt {
17355
17339
  _setTextStyle(t) {
17356
17340
  const e = ["left", "center", "right"], {
17357
17341
  fontColor: s
17358
- } = this.data.defaultAppearanceData, i = this.data.defaultAppearanceData.fontSize || vg, n = t.style;
17342
+ } = this.data.defaultAppearanceData, i = this.data.defaultAppearanceData.fontSize || bg, n = t.style;
17359
17343
  let r;
17360
17344
  const o = 2, h = (l) => Math.round(10 * l) / 10;
17361
17345
  if (this.data.multiLine) {
@@ -17371,7 +17355,7 @@ class ms extends bt {
17371
17355
  e ? t.setAttribute("required", !0) : t.removeAttribute("required"), t.setAttribute("aria-required", e);
17372
17356
  }
17373
17357
  }
17374
- class wg extends ms {
17358
+ class _g extends ms {
17375
17359
  constructor(t) {
17376
17360
  const e = t.renderForms || t.data.hasOwnCanvas || !t.data.hasAppearance && !!t.data.fieldValue;
17377
17361
  super(t, {
@@ -17571,14 +17555,14 @@ class wg extends ms {
17571
17555
  return this._setTextStyle(s), this._setBackgroundColor(s), this._setDefaultPropertiesFromJS(s), this.container.append(s), this.container;
17572
17556
  }
17573
17557
  }
17574
- class xg extends ms {
17558
+ class wg extends ms {
17575
17559
  constructor(t) {
17576
17560
  super(t, {
17577
17561
  isRenderable: !!t.data.hasOwnCanvas
17578
17562
  });
17579
17563
  }
17580
17564
  }
17581
- class Sg extends ms {
17565
+ class xg extends ms {
17582
17566
  constructor(t) {
17583
17567
  super(t, {
17584
17568
  isRenderable: t.renderForms
@@ -17677,7 +17661,7 @@ class zl extends ms {
17677
17661
  return this._setBackgroundColor(n), this._setDefaultPropertiesFromJS(n), this.container.append(n), this.container;
17678
17662
  }
17679
17663
  }
17680
- class Cg extends Hl {
17664
+ class Sg extends Hl {
17681
17665
  constructor(t) {
17682
17666
  super(t, {
17683
17667
  ignoreBorder: t.data.hasAppearance
@@ -17692,7 +17676,7 @@ class Cg extends Hl {
17692
17676
  })), t;
17693
17677
  }
17694
17678
  }
17695
- class Ag extends ms {
17679
+ class Cg extends ms {
17696
17680
  constructor(t) {
17697
17681
  super(t, {
17698
17682
  isRenderable: t.renderForms
@@ -17843,7 +17827,7 @@ class jr extends bt {
17843
17827
  }
17844
17828
  render() {
17845
17829
  this.container.classList.add("popupAnnotation");
17846
- const t = this.popup = new Tg({
17830
+ const t = this.popup = new Ag({
17847
17831
  container: this.container,
17848
17832
  color: this.data.color,
17849
17833
  titleObj: this.data.titleObj,
@@ -17861,7 +17845,7 @@ class jr extends bt {
17861
17845
  return this.container.setAttribute("aria-controls", e.map((s) => `${go}${s}`).join(",")), this.container;
17862
17846
  }
17863
17847
  }
17864
- class Tg {
17848
+ class Ag {
17865
17849
  #t = this.#E.bind(this);
17866
17850
  #e = this.#T.bind(this);
17867
17851
  #s = this.#k.bind(this);
@@ -18071,7 +18055,7 @@ class Gl extends bt {
18071
18055
  return !this.data.popupRef && this.hasPopupData && this._createPopup(), this._editOnDoubleClick(), this.container;
18072
18056
  }
18073
18057
  }
18074
- class Eg extends bt {
18058
+ class Tg extends bt {
18075
18059
  #t = null;
18076
18060
  constructor(t) {
18077
18061
  super(t, {
@@ -18094,7 +18078,7 @@ class Eg extends bt {
18094
18078
  this.container.classList.add("highlightArea");
18095
18079
  }
18096
18080
  }
18097
- class kg extends bt {
18081
+ class Eg extends bt {
18098
18082
  #t = null;
18099
18083
  constructor(t) {
18100
18084
  super(t, {
@@ -18117,7 +18101,7 @@ class kg extends bt {
18117
18101
  this.container.classList.add("highlightArea");
18118
18102
  }
18119
18103
  }
18120
- class Mg extends bt {
18104
+ class kg extends bt {
18121
18105
  #t = null;
18122
18106
  constructor(t) {
18123
18107
  super(t, {
@@ -18180,12 +18164,12 @@ class Vl extends bt {
18180
18164
  this.container.classList.add("highlightArea");
18181
18165
  }
18182
18166
  }
18183
- class Pg extends Vl {
18167
+ class Mg extends Vl {
18184
18168
  constructor(t) {
18185
18169
  super(t), this.containerClassName = "polygonAnnotation", this.svgElementName = "svg:polygon";
18186
18170
  }
18187
18171
  }
18188
- class Og extends bt {
18172
+ class Pg extends bt {
18189
18173
  constructor(t) {
18190
18174
  super(t, {
18191
18175
  isRenderable: !0,
@@ -18293,7 +18277,7 @@ class Wl extends bt {
18293
18277
  return !this.data.popupRef && this.hasPopupData && this._createPopup(), this.container.classList.add("highlightAnnotation"), this._editOnDoubleClick(), this.container;
18294
18278
  }
18295
18279
  }
18296
- class Dg extends bt {
18280
+ class Og extends bt {
18297
18281
  constructor(t) {
18298
18282
  super(t, {
18299
18283
  isRenderable: !0,
@@ -18305,7 +18289,7 @@ class Dg extends bt {
18305
18289
  return !this.data.popupRef && this.hasPopupData && this._createPopup(), this.container.classList.add("underlineAnnotation"), this.container;
18306
18290
  }
18307
18291
  }
18308
- class Rg extends bt {
18292
+ class Dg extends bt {
18309
18293
  constructor(t) {
18310
18294
  super(t, {
18311
18295
  isRenderable: !0,
@@ -18317,7 +18301,7 @@ class Rg extends bt {
18317
18301
  return !this.data.popupRef && this.hasPopupData && this._createPopup(), this.container.classList.add("squigglyAnnotation"), this.container;
18318
18302
  }
18319
18303
  }
18320
- class Lg extends bt {
18304
+ class Rg extends bt {
18321
18305
  constructor(t) {
18322
18306
  super(t, {
18323
18307
  isRenderable: !0,
@@ -18340,7 +18324,7 @@ class Xl extends bt {
18340
18324
  return this.container.classList.add("stampAnnotation"), this.container.setAttribute("role", "img"), !this.data.popupRef && this.hasPopupData && this._createPopup(), this._editOnDoubleClick(), this.container;
18341
18325
  }
18342
18326
  }
18343
- class Fg extends bt {
18327
+ class Lg extends bt {
18344
18328
  #t = null;
18345
18329
  constructor(t) {
18346
18330
  super(t, {
@@ -18379,7 +18363,7 @@ class Fg extends bt {
18379
18363
  this.downloadManager?.openOrDownloadData(this.content, this.filename);
18380
18364
  }
18381
18365
  }
18382
- class Ig {
18366
+ class Fg {
18383
18367
  #t = null;
18384
18368
  #e = null;
18385
18369
  #s = /* @__PURE__ */ new Map();
@@ -18443,7 +18427,7 @@ class Ig {
18443
18427
  continue;
18444
18428
  }
18445
18429
  n.data = r;
18446
- const h = yg.create(n);
18430
+ const h = vg.create(n);
18447
18431
  if (!h.isRenderable)
18448
18432
  continue;
18449
18433
  if (!o && r.popupRef) {
@@ -19247,7 +19231,7 @@ class Br {
19247
19231
  }
19248
19232
  n.push(d, f);
19249
19233
  }
19250
- return new Ng(i, this.#t, this.#e);
19234
+ return new Ig(i, this.#t, this.#e);
19251
19235
  }
19252
19236
  #n(t) {
19253
19237
  const e = this.#i;
@@ -19309,7 +19293,7 @@ class Br {
19309
19293
  return n;
19310
19294
  }
19311
19295
  }
19312
- class Ng extends j {
19296
+ class Ig extends j {
19313
19297
  #t;
19314
19298
  #e;
19315
19299
  constructor(t, e, s) {
@@ -19347,10 +19331,10 @@ class Ng extends j {
19347
19331
  }
19348
19332
  class Hr extends is {
19349
19333
  newFreeDrawOutline(t, e, s, i, n, r) {
19350
- return new jg(t, e, s, i, n, r);
19334
+ return new Ng(t, e, s, i, n, r);
19351
19335
  }
19352
19336
  }
19353
- class jg extends Ul {
19337
+ class Ng extends Ul {
19354
19338
  newOutliner(t, e, s, i, n, r = 0) {
19355
19339
  return new Hr(t, e, s, i, n, r);
19356
19340
  }
@@ -20137,7 +20121,7 @@ class gt extends U {
20137
20121
  return !1;
20138
20122
  }
20139
20123
  }
20140
- class Bg {
20124
+ class jg {
20141
20125
  #t = /* @__PURE__ */ Object.create(null);
20142
20126
  updateProperty(t, e) {
20143
20127
  this[t] = e, this.updateSVGProperty(t, e);
@@ -20577,7 +20561,7 @@ class X extends U {
20577
20561
  return !1;
20578
20562
  }
20579
20563
  }
20580
- class Hg {
20564
+ class Bg {
20581
20565
  #t = new Float64Array(6);
20582
20566
  #e;
20583
20567
  #s;
@@ -21021,7 +21005,7 @@ class $n extends j {
21021
21005
  };
21022
21006
  }
21023
21007
  }
21024
- class To extends Bg {
21008
+ class To extends jg {
21025
21009
  #t;
21026
21010
  constructor(t) {
21027
21011
  super(), this.#t = t, super.updateProperties({
@@ -21066,7 +21050,7 @@ class Eo extends X {
21066
21050
  return Z(this, "typesMap", /* @__PURE__ */ new Map([[Q.INK_THICKNESS, "stroke-width"], [Q.INK_COLOR, "stroke"], [Q.INK_OPACITY, "stroke-opacity"]]));
21067
21051
  }
21068
21052
  static createDrawerInstance(t, e, s, i, n) {
21069
- return new Hg(t, e, s, i, n, this._defaultDrawingOptions["stroke-width"]);
21053
+ return new Bg(t, e, s, i, n, this._defaultDrawingOptions["stroke-width"]);
21070
21054
  }
21071
21055
  static deserializeDraw(t, e, s, i, n, r) {
21072
21056
  return $n.deserialize(t, e, s, i, n, r);
@@ -22196,7 +22180,7 @@ Y.ColorPicker;
22196
22180
  Y.DOMSVGFactory;
22197
22181
  Y.DrawLayer;
22198
22182
  Y.FeatureTest;
22199
- var zg = Y.GlobalWorkerOptions;
22183
+ var Hg = Y.GlobalWorkerOptions;
22200
22184
  Y.ImageKind;
22201
22185
  Y.InvalidPDFException;
22202
22186
  Y.MissingPDFException;
@@ -22218,7 +22202,7 @@ Y.XfaLayer;
22218
22202
  Y.build;
22219
22203
  Y.createValidAbsoluteUrl;
22220
22204
  Y.fetchData;
22221
- var Gg = Y.getDocument;
22205
+ var zg = Y.getDocument;
22222
22206
  Y.getFilenameFromUrl;
22223
22207
  Y.getPdfFilenameFromUrl;
22224
22208
  Y.getXfaPageViewport;
@@ -22229,19 +22213,19 @@ Y.normalizeUnicode;
22229
22213
  Y.setLayerDimensions;
22230
22214
  Y.shadow;
22231
22215
  Y.stopEvent;
22232
- var Vg = Y.version;
22216
+ var Gg = Y.version;
22233
22217
  let Ja = null;
22234
- function Wg() {
22218
+ function Vg() {
22235
22219
  const a = document.createElement("div");
22236
22220
  a.style.width = "1in", document.body.append(a);
22237
22221
  const t = a.offsetWidth;
22238
22222
  return a.remove(), t;
22239
22223
  }
22240
- function Xg() {
22241
- const a = Ja ?? Wg();
22224
+ function Wg() {
22225
+ const a = Ja ?? Vg();
22242
22226
  return Ja = a, a / 72;
22243
22227
  }
22244
- function Ug(a, t = 500) {
22228
+ function Xg(a, t = 500) {
22245
22229
  if (typeof a != "function") throw new TypeError("The first argument is not a function.");
22246
22230
  let e = null;
22247
22231
  return function(...s) {
@@ -22250,28 +22234,28 @@ function Ug(a, t = 500) {
22250
22234
  }, t);
22251
22235
  };
22252
22236
  }
22253
- function Yg(a) {
22237
+ function Ug(a) {
22254
22238
  return new Promise((t, e) => {
22255
22239
  const s = new FileReader();
22256
22240
  s.addEventListener("load", () => t(s.result)), s.addEventListener("error", e), s.readAsArrayBuffer(a);
22257
22241
  });
22258
22242
  }
22259
- Yl() || (zg.workerSrc = `https://cdnjs.cloudflare.com/ajax/libs/pdf.js/${Vg}/pdf.worker.min.mjs`);
22260
- async function $g(a) {
22261
- const t = await Yg(a);
22243
+ $l() || (Hg.workerSrc = `https://cdnjs.cloudflare.com/ajax/libs/pdf.js/${Gg}/pdf.worker.min.mjs`);
22244
+ async function Yl(a) {
22245
+ const t = await Ug(a);
22262
22246
  if (t instanceof ArrayBuffer)
22263
22247
  return t;
22264
22248
  }
22265
- function Yl() {
22249
+ function $l() {
22266
22250
  try {
22267
22251
  return typeof OffscreenCanvas < "u" && typeof HTMLCanvasElement < "u" && typeof HTMLCanvasElement.prototype.transferControlToOffscreen == "function";
22268
22252
  } catch {
22269
22253
  return !1;
22270
22254
  }
22271
22255
  }
22272
- async function qg({ page: a, data: t, scale: e, password: s }, i) {
22273
- const n = Xg() / window.devicePixelRatio;
22274
- if (Yl()) {
22256
+ async function Yg({ page: a, data: t, scale: e, password: s }, i) {
22257
+ const n = Wg() / window.devicePixelRatio;
22258
+ if ($l()) {
22275
22259
  const r = new Worker(new URL(
22276
22260
  /* @vite-ignore */
22277
22261
  "" + new URL("assets/pdfjs.worker-DawqtvLM.js", import.meta.url).href,
@@ -22288,7 +22272,7 @@ async function qg({ page: a, data: t, scale: e, password: s }, i) {
22288
22272
  });
22289
22273
  });
22290
22274
  } else {
22291
- const r = await Gg({ data: t, password: s }).promise, o = r.numPages;
22275
+ const r = await zg({ data: t, password: s }).promise, o = r.numPages;
22292
22276
  if (!i) return { canvas: null, pages: o };
22293
22277
  const h = await r.getPage(a), l = h.getViewport({ scale: e }), c = document.createElement("canvas"), d = {
22294
22278
  canvasContext: c.getContext("2d"),
@@ -22299,73 +22283,77 @@ async function qg({ page: a, data: t, scale: e, password: s }, i) {
22299
22283
  }
22300
22284
  }
22301
22285
  const jt = /* @__PURE__ */ new Map();
22302
- function Kg(a) {
22286
+ function $g(a) {
22303
22287
  const t = new Pr(a);
22304
22288
  return jt.set(a, t), t;
22305
22289
  }
22306
- function Jg(a, t) {
22290
+ function qg(a, t) {
22307
22291
  const e = Date.now();
22308
22292
  return {
22309
22293
  PDFId: `${a.name}-${e}`,
22310
22294
  name: a.name.replace(/.pdf/, ""),
22311
22295
  updateDate: e,
22312
- data: t
22296
+ data: t,
22297
+ type: a.type
22313
22298
  };
22314
22299
  }
22315
- async function Zg({ src: a }, t, e) {
22300
+ async function Kg({ src: a }, t, e) {
22316
22301
  if (!a || !e) return null;
22317
- const { objects: s, options: i } = await kd(a), n = s.filter((o) => o !== null), r = Xu.groupSVGElements(n, i);
22302
+ const { objects: s, options: i } = await Md(a), n = s.filter((o) => o !== null), r = Uu.groupSVGElements(n, i);
22318
22303
  return n.forEach((o) => {
22319
22304
  o.stroke = e;
22320
22305
  }), r.hoverCursor = "pointer", r.stroke = `${e}-${t}`, r;
22321
22306
  }
22322
- function Qg(a, t) {
22307
+ function Jg(a, t) {
22323
22308
  if (!jt.get(a)) return;
22324
- const s = 1 / 3, i = op(t, s);
22325
- ql(a, i, s);
22309
+ const s = 1 / 3, i = np(t, s);
22310
+ Kl(a, i, s);
22326
22311
  }
22327
- async function tp(a, t) {
22328
- const e = await Bd(a), s = Date.now(), n = {
22329
- PDFId: `${a.name}${s}`,
22312
+ async function Zg(a, t) {
22313
+ const e = await Yl(a);
22314
+ if (!e) return;
22315
+ const s = Date.now(), n = {
22316
+ PDFId: `${a.name}-${s}`,
22330
22317
  name: a.name.replace(/.png|.jpg|.jpeg/, ""),
22331
22318
  updateDate: s,
22332
- PDFBase64: e
22319
+ data: e,
22320
+ type: a.type
22333
22321
  };
22334
- return t && $l(t, { url: e }), { ...n, pages: 1 };
22322
+ return t && ql(t, { data: e, type: a.type }), { ...n, pages: 1 };
22335
22323
  }
22336
- async function $l(a, { url: t, scale: e = 0.5 }) {
22324
+ async function ql(a, { data: t, type: e, scale: s = 0.5 }) {
22337
22325
  if (!jt.get(a)) return;
22338
- const i = await Pt.fromURL(t);
22339
- i.scale(e), ql(a, i, e);
22326
+ const n = new Blob([t], { type: e }), r = URL.createObjectURL(n), o = await Pt.fromURL(r);
22327
+ o.scale(s), Kl(a, o, s), URL.revokeObjectURL(r);
22340
22328
  }
22341
- function ql(a, t, e) {
22329
+ function Kl(a, t, e) {
22342
22330
  const s = jt.get(a);
22343
22331
  s && (s.setWidth(t.width * e), s.setHeight(t.height * e), s.backgroundImage = t, s.renderAll());
22344
22332
  }
22345
- function ep(a, t) {
22333
+ function Qg(a, t) {
22346
22334
  if (!t) return;
22347
22335
  const { oCoords: e } = a;
22348
22336
  if (!e) return;
22349
22337
  const { x: s, y: i } = e.tl.touchCorner.tl, { height: n, width: r, scaleY: o, scaleX: h } = t;
22350
22338
  t.top = i - n * o / 2, t.left = s - r * h / 2, t.setCoords();
22351
22339
  }
22352
- function sp(a, t, e) {
22353
- !e || !a || (e.scale(1 / t), ep(a, e));
22340
+ function tp(a, t, e) {
22341
+ !e || !a || (e.scale(1 / t), Qg(a, e));
22354
22342
  }
22355
- function ip(a, t) {
22343
+ function ep(a, t) {
22356
22344
  if (!a) return;
22357
22345
  const e = a._cornerSize || 6;
22358
22346
  a.borderScaleFactor = 1 / t, a.cornerSize = e * (1 / t), a.touchCornerSize = e * 4 * (1 / t), a.setCoords();
22359
22347
  }
22360
- function np(a) {
22348
+ function sp(a) {
22361
22349
  const t = jt.get(a);
22362
22350
  t && (t.discardActiveObject(), t.renderAll());
22363
22351
  }
22364
- function rp(a) {
22352
+ function ip(a) {
22365
22353
  const t = jt.get(a);
22366
22354
  t && (t.clear(), jt.delete(a));
22367
22355
  }
22368
- function op(a, t) {
22356
+ function np(a, t) {
22369
22357
  return new Pt(a, { scaleX: t, scaleY: t });
22370
22358
  }
22371
22359
  function zr(a, t) {
@@ -22373,27 +22361,27 @@ function zr(a, t) {
22373
22361
  const { left: e, top: s, scaleX: i, scaleY: n, width: r, height: o } = a, h = t.x * r * i, l = t.y * o * n;
22374
22362
  a.set({ left: e - h, top: s - l });
22375
22363
  }
22376
- function ap(a, t, e) {
22364
+ function rp(a, t, e) {
22377
22365
  const s = a.type;
22378
22366
  return {
22379
- "application/pdf": hp,
22367
+ "application/pdf": op,
22380
22368
  "image/png": Za,
22381
22369
  "image/jpeg": Za
22382
22370
  }[s]?.(a, t, e) ?? Promise.reject(new Error(`Unsupported ${s} file type.`));
22383
22371
  }
22384
- async function hp(a, t, e) {
22385
- const s = await $g(a);
22372
+ async function op(a, t, e) {
22373
+ const s = await Yl(a);
22386
22374
  if (!s) return;
22387
- const i = Jg(a, s), n = await Kl({ page: 1, data: s, scale: 0.8, password: t }, e);
22375
+ const i = qg(a, s), n = await Jl({ page: 1, data: s, scale: 0.8, password: t }, e);
22388
22376
  return { ...i, pages: n };
22389
22377
  }
22390
- function Kl(a, t) {
22391
- return qg(a, t).then(({ canvas: e, pages: s }) => (e && t && Qg(t, e), s));
22378
+ function Jl(a, t) {
22379
+ return Yg(a, t).then(({ canvas: e, pages: s }) => (e && t && Jg(t, e), s));
22392
22380
  }
22393
22381
  async function Za(a, t, e) {
22394
- return await tp(a, e);
22382
+ return await Zg(a, e);
22395
22383
  }
22396
- function lp(a, t) {
22384
+ function ap(a, t) {
22397
22385
  const e = jt.get(a);
22398
22386
  if (!e) return;
22399
22387
  const s = e.getActiveObject();
@@ -22401,17 +22389,17 @@ function lp(a, t) {
22401
22389
  i.set(t);
22402
22390
  }) : s.set(t), e.renderAll());
22403
22391
  }
22404
- async function cp(a, t) {
22392
+ async function hp(a, t) {
22405
22393
  const e = jt.get(a);
22406
22394
  if (!e) return;
22407
22395
  const s = e?.getActiveObject();
22408
22396
  if (!s) return;
22409
- const i = await s.clone(lc);
22397
+ const i = await s.clone(cc);
22410
22398
  i instanceof Qt ? i.forEachObject((n) => {
22411
22399
  e.add(n), t(e, n);
22412
22400
  }) : (e.add(i), t(e, i)), zr(i, { x: -0.1, y: -0.1 }), e.setActiveObject(i);
22413
22401
  }
22414
- function up(a) {
22402
+ function lp(a) {
22415
22403
  const t = jt.get(a);
22416
22404
  if (!t) return;
22417
22405
  const e = t.getActiveObject();
@@ -22419,7 +22407,7 @@ function up(a) {
22419
22407
  t.remove(s);
22420
22408
  }), t.discardActiveObject()) : t.remove(e));
22421
22409
  }
22422
- function dp(a) {
22410
+ function cp(a) {
22423
22411
  const {
22424
22412
  id: t = "",
22425
22413
  selectionOptions: e,
@@ -22428,56 +22416,56 @@ function dp(a) {
22428
22416
  pointerUp: n,
22429
22417
  selectionCreated: r,
22430
22418
  selectionCleared: o
22431
- } = a || {}, h = ws(null), l = ws(null), c = ws(1), u = ws({ ...hc });
22419
+ } = a || {}, h = ws(null), l = ws(null), c = ws(1), u = ws({ ...lc });
22432
22420
  function d() {
22433
22421
  if (!t || jt.has(t)) return;
22434
- const O = Kg(t);
22422
+ const O = $g(t);
22435
22423
  return O.on("selection:created", (D) => {
22436
22424
  if (r?.(D), D.selected.length <= 1) return;
22437
- const z = O.getActiveObject();
22438
- z && (l.current = z, e?.value && l.current.set(e.value), l.current._cornerSize = l.current.cornerSize, S(c.current));
22425
+ const H = O.getActiveObject();
22426
+ H && (l.current = H, e?.value && l.current.set(e.value), l.current._cornerSize = l.current.cornerSize, S(c.current));
22439
22427
  }), O.on("selection:cleared", (D) => {
22440
22428
  o?.(D), T(O);
22441
22429
  }), s && O.on("mouse:down", s), i && O.on("mouse:move", i), n && O.on("mouse:up", n), O;
22442
22430
  }
22443
22431
  function f(O, D) {
22444
- return ap(O, D, t);
22432
+ return rp(O, D, t);
22445
22433
  }
22446
22434
  function g(O) {
22447
- return Kl(O, t);
22435
+ return Jl(O, t);
22448
22436
  }
22449
- function p({ url: O, scale: D = 0.5 }) {
22450
- return $l(t, { url: O, scale: D });
22437
+ function p({ data: O, type: D, scale: H = 0.5 }) {
22438
+ return ql(t, { data: O, type: D, scale: H });
22451
22439
  }
22452
- async function b(O, D, z) {
22440
+ async function b(O, D, H) {
22453
22441
  const M = jt.get(t);
22454
22442
  if (!M) return;
22455
- const R = await Pt.fromURL(O, {}, { ...rc, ...D });
22456
- zr(R, z), M.add(R), v(M, R), M.setActiveObject(R);
22443
+ const R = await Pt.fromURL(O, {}, { ...oc, ...D });
22444
+ zr(R, H), M.add(R), v(M, R), M.setActiveObject(R);
22457
22445
  }
22458
- function m(O, D, z) {
22446
+ function m(O, D, H) {
22459
22447
  const M = jt.get(t);
22460
22448
  if (!M) return;
22461
22449
  const R = new kt(O, {
22462
- ...oc,
22450
+ ...ac,
22463
22451
  ...D
22464
22452
  });
22465
- zr(R, z), M.add(R), v(M, R), M.setActiveObject(R);
22453
+ zr(R, H), M.add(R), v(M, R), M.setActiveObject(R);
22466
22454
  }
22467
22455
  function v(O, D) {
22468
- D.on("selected", (z) => y({ canvas: O, target: z.target })), D.on("modified", (z) => y({ canvas: O, target: z.target })), D.on("scaling", () => T(O)), D.on("moving", () => T(O)), D.on("rotating", () => T(O)), D._cornerSize = D._cornerSize ?? D.cornerSize;
22456
+ D.on("selected", (H) => y({ canvas: O, target: H.target })), D.on("modified", (H) => y({ canvas: O, target: H.target })), D.on("scaling", () => T(O)), D.on("moving", () => T(O)), D.on("rotating", () => T(O)), D._cornerSize = D._cornerSize ?? D.cornerSize;
22469
22457
  }
22470
22458
  async function y({
22471
22459
  canvas: O,
22472
22460
  target: D,
22473
- stroke: z = u.current.stroke,
22461
+ stroke: H = u.current.stroke,
22474
22462
  uuid: M = Date.now()
22475
22463
  }) {
22476
- if (O.getActiveObjects().length > 1 || h.current?.stroke === `${z}-${M}`) return;
22477
- const W = await Zg(u.current, M, z);
22464
+ if (O.getActiveObjects().length > 1 || h.current?.stroke === `${H}-${M}`) return;
22465
+ const W = await Kg(u.current, M, H);
22478
22466
  T(O), h.current = W, l.current = D, _(O, D, M), S(c.current, !0), W && O.add(W);
22479
22467
  }
22480
- function _(O, D, z) {
22468
+ function _(O, D, H) {
22481
22469
  h.current && (h.current.on("selected", () => {
22482
22470
  O.remove(D), T(O);
22483
22471
  }), h.current.on("mouseover", () => {
@@ -22485,15 +22473,15 @@ function dp(a) {
22485
22473
  canvas: O,
22486
22474
  target: D,
22487
22475
  stroke: u.current.hoverStroke,
22488
- uuid: z
22476
+ uuid: H
22489
22477
  });
22490
22478
  }), h.current.on("mouseout", () => {
22491
- y({ canvas: O, target: D, stroke: u.current.stroke, uuid: z });
22479
+ y({ canvas: O, target: D, stroke: u.current.stroke, uuid: H });
22492
22480
  }));
22493
22481
  }
22494
22482
  function S(O, D = !1) {
22495
- const z = jt.get(t);
22496
- c.current = O, z && (ip(l.current, O), sp(l.current, O, h.current), !D && z.renderAll());
22483
+ const H = jt.get(t);
22484
+ c.current = O, H && (ep(l.current, O), tp(l.current, O, h.current), !D && H.renderAll());
22497
22485
  }
22498
22486
  function A(O) {
22499
22487
  if (!O) return;
@@ -22505,19 +22493,19 @@ function dp(a) {
22505
22493
  l.current = null, h.current && (O.remove(h.current), h.current = null);
22506
22494
  }
22507
22495
  function k() {
22508
- np(t);
22496
+ sp(t);
22509
22497
  }
22510
22498
  function P() {
22511
- rp(t);
22499
+ ip(t);
22512
22500
  }
22513
22501
  function N(O) {
22514
- lp(t, O);
22502
+ ap(t, O);
22515
22503
  }
22516
22504
  function F() {
22517
- return cp(t, v);
22505
+ return hp(t, v);
22518
22506
  }
22519
22507
  function I() {
22520
- up(t);
22508
+ lp(t);
22521
22509
  }
22522
22510
  return {
22523
22511
  createCanvas: d,
@@ -22535,14 +22523,14 @@ function dp(a) {
22535
22523
  deleteActiveFabric: I
22536
22524
  };
22537
22525
  }
22538
- function fp(a) {
22539
- const t = ws(0), e = Ug(() => {
22526
+ function up(a) {
22527
+ const t = ws(0), e = Xg(() => {
22540
22528
  t.current !== window.innerWidth && (t.current = window.innerWidth, a());
22541
22529
  });
22542
22530
  Js(() => (window.addEventListener("resize", e), () => window.removeEventListener("resize", e)), []);
22543
22531
  }
22544
- const bp = Ql(gp);
22545
- function gp({
22532
+ const pp = tc(dp);
22533
+ function dp({
22546
22534
  file: a,
22547
22535
  page: t = 1,
22548
22536
  canvasId: e = "PDF-canvas",
@@ -22565,20 +22553,20 @@ function gp({
22565
22553
  onSelectionCreated: y,
22566
22554
  onSelectionCleared: _
22567
22555
  }, S) {
22568
- const A = ws(null), T = `${e}-${t - 1}`, k = No(() => s * n, [s, n]), P = No(() => ({ ...ac, ...d }), [d]), {
22556
+ const A = ws(null), T = `${e}-${t - 1}`, k = No(() => s * n, [s, n]), P = No(() => ({ ...hc, ...d }), [d]), {
22569
22557
  createCanvas: N,
22570
22558
  specifyPage: F,
22571
22559
  addFabric: I,
22572
22560
  addTextFabric: O,
22573
22561
  renderImage: D,
22574
- clearActive: z,
22562
+ clearActive: H,
22575
22563
  deleteCanvas: M,
22576
22564
  scaleFabric: R,
22577
22565
  setActiveFabric: W,
22578
22566
  setCloseSvgOptions: ot,
22579
- copyActiveFabric: lt,
22567
+ copyActiveFabric: ht,
22580
22568
  deleteActiveFabric: E
22581
- } = dp({
22569
+ } = cp({
22582
22570
  id: T,
22583
22571
  selectionOptions: P,
22584
22572
  pointerDown: b,
@@ -22587,12 +22575,11 @@ function gp({
22587
22575
  selectionCreated: y,
22588
22576
  selectionCleared: _
22589
22577
  });
22590
- fp(st);
22591
- async function H() {
22578
+ up(st);
22579
+ async function z() {
22592
22580
  globalThis.requestAnimationFrame(async () => {
22593
- if (N(), typeof a.data == "string") {
22594
- const at = a.data;
22595
- D({ url: at, scale: i / 3 }), g?.();
22581
+ if (N(), a.type.startsWith("image/")) {
22582
+ D({ data: a.data, scale: i / 3, type: a.type }), g?.();
22596
22583
  return;
22597
22584
  }
22598
22585
  await F({
@@ -22605,26 +22592,26 @@ function gp({
22605
22592
  }
22606
22593
  function V(B) {
22607
22594
  if (B.preventDefault(), B.stopPropagation(), !o || !B.dataTransfer) return;
22608
- const { dataTransfer: at, nativeEvent: Tt } = B, { offsetX: Wt, offsetY: Jl } = Tt, Mo = at.getData("text/plain"), Po = at.getData("text/uri-list"), Oo = at.getData("custom/offset"), Do = Oo ? JSON.parse(Oo) : null, Ro = { top: Jl, left: Wt }, Lo = { x: Do?.offsetX ?? 0, y: Do?.offsetY ?? 0 };
22595
+ const { dataTransfer: ut, nativeEvent: Tt } = B, { offsetX: Wt, offsetY: Zl } = Tt, Mo = ut.getData("text/plain"), Po = ut.getData("text/uri-list"), Oo = ut.getData("custom/offset"), Do = Oo ? JSON.parse(Oo) : null, Ro = { top: Zl, left: Wt }, Lo = { x: Do?.offsetX ?? 0, y: Do?.offsetY ?? 0 };
22609
22596
  Po ? J(Po, Ro, Lo) : Mo && At(Mo, Ro, Lo);
22610
22597
  }
22611
- function J(B, at, Tt) {
22612
- I(B, { ...c, ...at }, Tt);
22598
+ function J(B, ut, Tt) {
22599
+ I(B, { ...c, ...ut }, Tt);
22613
22600
  }
22614
- function At(B, at, Tt) {
22615
- O(B, { ...l, ...at }, Tt);
22601
+ function At(B, ut, Tt) {
22602
+ O(B, { ...l, ...ut }, Tt);
22616
22603
  }
22617
22604
  function st() {
22618
- f || H(), p?.();
22605
+ f || z(), p?.();
22619
22606
  }
22620
- return tc(S, () => ({
22621
- reload: H,
22607
+ return ec(S, () => ({
22608
+ reload: z,
22622
22609
  addImage: J,
22623
22610
  addText: At,
22624
- clearActive: z,
22611
+ clearActive: H,
22625
22612
  deleteCanvas: M,
22626
22613
  setActiveFabric: W,
22627
- copyActiveFabric: lt,
22614
+ copyActiveFabric: ht,
22628
22615
  deleteActiveFabric: E,
22629
22616
  canvasRef: A
22630
22617
  })), Js(() => {
@@ -22652,7 +22639,7 @@ function gp({
22652
22639
  );
22653
22640
  }
22654
22641
  export {
22655
- bp as default,
22656
- ap as loadFile,
22657
- dp as useFabric
22642
+ pp as default,
22643
+ rp as loadFile,
22644
+ cp as useFabric
22658
22645
  };