@algorisys/yappydraw 0.8.278 → 0.8.284

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (46) hide show
  1. package/README.md +2 -2
  2. package/chunks/{AllPackages-DytsA6Gg.js → AllPackages-NXu9X6xl.js} +5 -5
  3. package/chunks/{BaseConfiguration-B0Un-ANd.js → BaseConfiguration-Cn1Beeg_.js} +3 -3
  4. package/chunks/{Entities-XwxJEcR3.js → Entities-DNDwR9nR.js} +1 -1
  5. package/chunks/{Factory-B4kWsy6c.js → Factory-hCmMrRZd.js} +8 -8
  6. package/chunks/{InputJax-DQpRzuU2.js → InputJax-BnvzjXPP.js} +1 -1
  7. package/chunks/PrioritizedList-CopFulOu.js +35 -0
  8. package/chunks/{TeXAtom-COgv6VHH.js → TeXAtom-i5HZ7jSY.js} +25 -25
  9. package/chunks/__vite-browser-external-BsdCVVos.js +110 -0
  10. package/chunks/_commonjsHelpers-DaMA6jEr.js +8 -0
  11. package/chunks/{canva-ai-7n8RQQlp.js → canva-ai-Bn55G-RK.js} +8 -8
  12. package/chunks/{choice-dialog-state-DzWAU-Fv.js → choice-dialog-state-C3iNX5d9.js} +1 -1
  13. package/chunks/{design-generator-AHGi1XTI.js → design-generator-DH124WNv.js} +1 -1
  14. package/chunks/{drawing-engine-DfKBHdTi.js → drawing-engine-BsOJV2hA.js} +1 -1
  15. package/chunks/{drawings-store-Cyv-1e1L.js → drawings-store-CN5GhfbN.js} +19 -19
  16. package/chunks/{ds-operations-C9fmILbu.js → ds-operations-DZRV2pe2.js} +1 -1
  17. package/chunks/{export-game-C1SNNfRf.js → export-game-C-6KMFRu.js} +1 -1
  18. package/chunks/{game-runtime-ztkqHa3o.js → game-runtime-DYNjw0j0.js} +76 -76
  19. package/chunks/{html-CEj6ZeJc.js → html-BBKfobGE.js} +56 -55
  20. package/chunks/html2canvas.esm-BWVIUcAF.js +4802 -0
  21. package/chunks/{index-vjDu6_KH.js → index-VL9TAaVA.js} +18876 -15818
  22. package/chunks/index.es-Cmz4JyRm.js +6665 -0
  23. package/chunks/jspdf.es.min-rJE95jGX.js +9859 -0
  24. package/chunks/lcms-Car3bVu8.js +949 -0
  25. package/chunks/lcms-tShoQ1hy.js +4 -0
  26. package/chunks/{liteAdaptor-BZby1Qz2.js → liteAdaptor-DFCyQb98.js} +2 -2
  27. package/chunks/{lucide-solid-UJTMB-sy.js → lucide-solid-D0XBq3EO.js} +1 -1
  28. package/chunks/{markdown-to-slides-CKGVwM_7.js → markdown-to-slides-CRpkf5KS.js} +16 -16
  29. package/chunks/{mathjax-CnUrFnFS.js → mathjax-BPYOiwki.js} +1 -1
  30. package/chunks/{mathjax-D6cR72fZ.js → mathjax-BYK64638.js} +2 -2
  31. package/chunks/{morph-animator-D7JpZIyR.js → morph-animator-DiHl564V.js} +1 -1
  32. package/chunks/{onboarding-tour-DsN4nEFc.js → onboarding-tour-BInImPzk.js} +32 -32
  33. package/chunks/pdf-cmyk-CqVZV2FF.js +339 -0
  34. package/chunks/pdf-vector-DhjM0Hvn.js +200 -0
  35. package/chunks/pdf-x-DBYFVbAz.js +220 -0
  36. package/chunks/purify.es-C2Qa7b4C.js +906 -0
  37. package/chunks/{search-qTCHUaUH.js → search-BwITDpaH.js} +2 -2
  38. package/chunks/{slide-generator-CoHxujzf.js → slide-generator-Da0DCaYV.js} +8 -8
  39. package/chunks/{svg-B2urwbCV.js → svg-CGqKTjgw.js} +3 -3
  40. package/chunks/svg2pdf.es.min-BVaMJ-wC.js +2452 -0
  41. package/chunks/{tex-BTCIQDRb.js → tex-Cc_XKudY.js} +4 -4
  42. package/chunks/{turntable-ai-BEZd382K.js → turntable-ai-CIDk9Jmv.js} +1 -1
  43. package/chunks/{yappy-NspTXSPk.css → yappy-FCQs01wv.css} +1 -1
  44. package/package.json +1 -1
  45. package/yappy.js +5 -5
  46. package/chunks/PrioritizedList-TjDg4i-s.js +0 -39
@@ -0,0 +1,2452 @@
1
+ import { g as At } from "./_commonjsHelpers-DaMA6jEr.js";
2
+ import { E as te, O as Tt, q as we, M as ke } from "./jspdf.es.min-rJE95jGX.js";
3
+ var ct, Lt;
4
+ function Me() {
5
+ if (Lt) return ct;
6
+ Lt = 1;
7
+ var i = {}, e = i.hasOwnProperty, t = function(l, u) {
8
+ if (!l)
9
+ return u;
10
+ var f = {};
11
+ for (var c in u)
12
+ f[c] = e.call(l, c) ? l[c] : u[c];
13
+ return f;
14
+ }, r = /[ -,\.\/:-@\[-\^`\{-~]/, n = /[ -,\.\/:-@\[\]\^`\{-~]/, s = /(^|\\+)?(\\[A-F0-9]{1,6})\x20(?![a-fA-F0-9\x20])/g, a = function o(l, u) {
15
+ u = t(u, o.options), u.quotes != "single" && u.quotes != "double" && (u.quotes = "single");
16
+ for (var f = u.quotes == "double" ? '"' : "'", c = u.isIdentifier, p = l.charAt(0), h = "", g = 0, d = l.length; g < d; ) {
17
+ var m = l.charAt(g++), x = m.charCodeAt(), v = void 0;
18
+ if (x < 32 || x > 126) {
19
+ if (x >= 55296 && x <= 56319 && g < d) {
20
+ var S = l.charCodeAt(g++);
21
+ (S & 64512) == 56320 ? x = ((x & 1023) << 10) + (S & 1023) + 65536 : g--;
22
+ }
23
+ v = "\\" + x.toString(16).toUpperCase() + " ";
24
+ } else
25
+ u.escapeEverything ? r.test(m) ? v = "\\" + m : v = "\\" + x.toString(16).toUpperCase() + " " : /[\t\n\f\r\x0B]/.test(m) ? v = "\\" + x.toString(16).toUpperCase() + " " : m == "\\" || !c && (m == '"' && f == m || m == "'" && f == m) || c && n.test(m) ? v = "\\" + m : v = m;
26
+ h += v;
27
+ }
28
+ return c && (/^-[-\d]/.test(h) ? h = "\\-" + h.slice(1) : /\d/.test(p) && (h = "\\3" + p + " " + h.slice(1))), h = h.replace(s, function(w, y, k) {
29
+ return y && y.length % 2 ? w : (y || "") + k;
30
+ }), !c && u.wrap ? f + h + f : h;
31
+ };
32
+ return a.options = {
33
+ escapeEverything: !1,
34
+ isIdentifier: !1,
35
+ quotes: "single",
36
+ wrap: !1
37
+ }, a.version = "3.0.0", ct = a, ct;
38
+ }
39
+ var Ce = Me();
40
+ const ee = /* @__PURE__ */ At(Ce);
41
+ var pt, Ot;
42
+ function Fe() {
43
+ if (Ot) return pt;
44
+ Ot = 1;
45
+ var i = 0, e = 1, t = 2, r = 3, n = 4, s = 5, a = 6, o = /[a-z0-9_-]/i, l = /[\s\t]/, u = function(p) {
46
+ for (var h = !0, g = i, d = "", m = 0, x, v, S = []; ; ) {
47
+ if (v = p[m], g === i) {
48
+ if (!v && h)
49
+ break;
50
+ if (!v && !h)
51
+ throw new Error("Parse error");
52
+ if (v === '"' || v === "'")
53
+ x = v, g = e, h = !1;
54
+ else if (!l.test(v)) if (o.test(v))
55
+ g = r, h = !1, m--;
56
+ else
57
+ throw new Error("Parse error");
58
+ } else if (g === e)
59
+ if (v)
60
+ v === "\\" ? g = t : v === x ? (S.push(d), d = "", g = n) : d += v;
61
+ else throw new Error("Parse Error");
62
+ else if (g === t)
63
+ if (v === x || v === "\\")
64
+ d += v, g = e;
65
+ else
66
+ throw new Error("Parse error");
67
+ else if (g === r)
68
+ if (v)
69
+ o.test(v) ? d += v : v === "," ? (S.push(d), d = "", g = i) : l.test(v) ? g = s : v === "\\" && (g = a);
70
+ else {
71
+ S.push(d);
72
+ break;
73
+ }
74
+ else if (g === a) {
75
+ if (/[0-9a-f]/i.test(v))
76
+ throw new Error("Parse error");
77
+ d += v, g = r;
78
+ } else if (g === s)
79
+ if (v) {
80
+ if (o.test(v))
81
+ d += " " + v, g = r;
82
+ else if (v === ",")
83
+ S.push(d), d = "", g = i;
84
+ else if (!l.test(v)) throw new Error("Parse error");
85
+ } else {
86
+ S.push(d);
87
+ break;
88
+ }
89
+ else if (g === n)
90
+ if (v) {
91
+ if (v === ",")
92
+ g = i;
93
+ else if (!l.test(v)) throw new Error("Parse error");
94
+ } else break;
95
+ m++;
96
+ }
97
+ return S;
98
+ }, f = /[^a-z0-9_-]/i, c = function(p, h) {
99
+ var g = h && h.quote || '"';
100
+ if (g !== '"' && g !== "'")
101
+ throw new Error("Quote must be `'` or `\"`");
102
+ for (var d = new RegExp(g, "g"), m = [], x = 0; x < p.length; ++x) {
103
+ var v = p[x];
104
+ f.test(v) && (v = v.replace(/\\/g, "\\\\").replace(d, "\\" + g), v = g + v + g), m.push(v);
105
+ }
106
+ return m.join(", ");
107
+ };
108
+ return pt = {
109
+ parse: u,
110
+ stringify: c
111
+ }, pt;
112
+ }
113
+ var Ae = Fe();
114
+ const Te = /* @__PURE__ */ At(Ae);
115
+ var dt, qt;
116
+ function Pe() {
117
+ if (qt) return dt;
118
+ qt = 1;
119
+ var i = { a: 7, c: 6, h: 1, l: 2, m: 2, r: 4, q: 4, s: 4, t: 2, v: 1, z: 0 }, e = [
120
+ 5760,
121
+ 6158,
122
+ 8192,
123
+ 8193,
124
+ 8194,
125
+ 8195,
126
+ 8196,
127
+ 8197,
128
+ 8198,
129
+ 8199,
130
+ 8200,
131
+ 8201,
132
+ 8202,
133
+ 8239,
134
+ 8287,
135
+ 12288,
136
+ 65279
137
+ ];
138
+ function t(h) {
139
+ return h === 10 || h === 13 || h === 8232 || h === 8233 || // Line terminators
140
+ // White spaces
141
+ h === 32 || h === 9 || h === 11 || h === 12 || h === 160 || h >= 5760 && e.indexOf(h) >= 0;
142
+ }
143
+ function r(h) {
144
+ switch (h | 32) {
145
+ case 109:
146
+ case 122:
147
+ case 108:
148
+ case 104:
149
+ case 118:
150
+ case 99:
151
+ case 115:
152
+ case 113:
153
+ case 116:
154
+ case 97:
155
+ case 114:
156
+ return !0;
157
+ }
158
+ return !1;
159
+ }
160
+ function n(h) {
161
+ return (h | 32) === 97;
162
+ }
163
+ function s(h) {
164
+ return h >= 48 && h <= 57;
165
+ }
166
+ function a(h) {
167
+ return h >= 48 && h <= 57 || /* 0..9 */
168
+ h === 43 || /* + */
169
+ h === 45 || /* - */
170
+ h === 46;
171
+ }
172
+ function o(h) {
173
+ this.index = 0, this.path = h, this.max = h.length, this.result = [], this.param = 0, this.err = "", this.segmentStart = 0, this.data = [];
174
+ }
175
+ function l(h) {
176
+ for (; h.index < h.max && t(h.path.charCodeAt(h.index)); )
177
+ h.index++;
178
+ }
179
+ function u(h) {
180
+ var g = h.path.charCodeAt(h.index);
181
+ if (g === 48) {
182
+ h.param = 0, h.index++;
183
+ return;
184
+ }
185
+ if (g === 49) {
186
+ h.param = 1, h.index++;
187
+ return;
188
+ }
189
+ h.err = "SvgPath: arc flag can be 0 or 1 only (at pos " + h.index + ")";
190
+ }
191
+ function f(h) {
192
+ var g = h.index, d = g, m = h.max, x = !1, v = !1, S = !1, w = !1, y;
193
+ if (d >= m) {
194
+ h.err = "SvgPath: missed param (at pos " + d + ")";
195
+ return;
196
+ }
197
+ if (y = h.path.charCodeAt(d), (y === 43 || y === 45) && (d++, y = d < m ? h.path.charCodeAt(d) : 0), !s(y) && y !== 46) {
198
+ h.err = "SvgPath: param should start with 0..9 or `.` (at pos " + d + ")";
199
+ return;
200
+ }
201
+ if (y !== 46) {
202
+ if (x = y === 48, d++, y = d < m ? h.path.charCodeAt(d) : 0, x && d < m && y && s(y)) {
203
+ h.err = "SvgPath: numbers started with `0` such as `09` are illegal (at pos " + g + ")";
204
+ return;
205
+ }
206
+ for (; d < m && s(h.path.charCodeAt(d)); )
207
+ d++, v = !0;
208
+ y = d < m ? h.path.charCodeAt(d) : 0;
209
+ }
210
+ if (y === 46) {
211
+ for (w = !0, d++; s(h.path.charCodeAt(d)); )
212
+ d++, S = !0;
213
+ y = d < m ? h.path.charCodeAt(d) : 0;
214
+ }
215
+ if (y === 101 || y === 69) {
216
+ if (w && !v && !S) {
217
+ h.err = "SvgPath: invalid float exponent (at pos " + d + ")";
218
+ return;
219
+ }
220
+ if (d++, y = d < m ? h.path.charCodeAt(d) : 0, (y === 43 || y === 45) && d++, d < m && s(h.path.charCodeAt(d)))
221
+ for (; d < m && s(h.path.charCodeAt(d)); )
222
+ d++;
223
+ else {
224
+ h.err = "SvgPath: invalid float exponent (at pos " + d + ")";
225
+ return;
226
+ }
227
+ }
228
+ h.index = d, h.param = parseFloat(h.path.slice(g, d)) + 0;
229
+ }
230
+ function c(h) {
231
+ var g, d;
232
+ g = h.path[h.segmentStart], d = g.toLowerCase();
233
+ var m = h.data;
234
+ if (d === "m" && m.length > 2 && (h.result.push([g, m[0], m[1]]), m = m.slice(2), d = "l", g = g === "m" ? "l" : "L"), d === "r")
235
+ h.result.push([g].concat(m));
236
+ else
237
+ for (; m.length >= i[d] && (h.result.push([g].concat(m.splice(0, i[d]))), !!i[d]); )
238
+ ;
239
+ }
240
+ function p(h) {
241
+ var g = h.max, d, m, x, v, S;
242
+ if (h.segmentStart = h.index, d = h.path.charCodeAt(h.index), m = n(d), !r(d)) {
243
+ h.err = "SvgPath: bad command " + h.path[h.index] + " (at pos " + h.index + ")";
244
+ return;
245
+ }
246
+ if (v = i[h.path[h.index].toLowerCase()], h.index++, l(h), h.data = [], !v) {
247
+ c(h);
248
+ return;
249
+ }
250
+ for (x = !1; ; ) {
251
+ for (S = v; S > 0; S--) {
252
+ if (m && (S === 3 || S === 4) ? u(h) : f(h), h.err.length) {
253
+ c(h);
254
+ return;
255
+ }
256
+ h.data.push(h.param), l(h), x = !1, h.index < g && h.path.charCodeAt(h.index) === 44 && (h.index++, l(h), x = !0);
257
+ }
258
+ if (!x && (h.index >= h.max || !a(h.path.charCodeAt(h.index))))
259
+ break;
260
+ }
261
+ c(h);
262
+ }
263
+ return dt = function(g) {
264
+ var d = new o(g), m = d.max;
265
+ for (l(d); d.index < m && !d.err.length; )
266
+ p(d);
267
+ return d.result.length && ("mM".indexOf(d.result[0][0]) < 0 ? (d.err = "SvgPath: string should start with `M` or `m`", d.result = []) : d.result[0][0] = "M"), {
268
+ err: d.err,
269
+ segments: d.result
270
+ };
271
+ }, dt;
272
+ }
273
+ var gt, Dt;
274
+ function re() {
275
+ if (Dt) return gt;
276
+ Dt = 1;
277
+ function i(t, r) {
278
+ return [
279
+ t[0] * r[0] + t[2] * r[1],
280
+ t[1] * r[0] + t[3] * r[1],
281
+ t[0] * r[2] + t[2] * r[3],
282
+ t[1] * r[2] + t[3] * r[3],
283
+ t[0] * r[4] + t[2] * r[5] + t[4],
284
+ t[1] * r[4] + t[3] * r[5] + t[5]
285
+ ];
286
+ }
287
+ function e() {
288
+ if (!(this instanceof e))
289
+ return new e();
290
+ this.queue = [], this.cache = null;
291
+ }
292
+ return e.prototype.matrix = function(t) {
293
+ return t[0] === 1 && t[1] === 0 && t[2] === 0 && t[3] === 1 && t[4] === 0 && t[5] === 0 ? this : (this.cache = null, this.queue.push(t), this);
294
+ }, e.prototype.translate = function(t, r) {
295
+ return (t !== 0 || r !== 0) && (this.cache = null, this.queue.push([1, 0, 0, 1, t, r])), this;
296
+ }, e.prototype.scale = function(t, r) {
297
+ return (t !== 1 || r !== 1) && (this.cache = null, this.queue.push([t, 0, 0, r, 0, 0])), this;
298
+ }, e.prototype.rotate = function(t, r, n) {
299
+ var s, a, o;
300
+ return t !== 0 && (this.translate(r, n), s = t * Math.PI / 180, a = Math.cos(s), o = Math.sin(s), this.queue.push([a, o, -o, a, 0, 0]), this.cache = null, this.translate(-r, -n)), this;
301
+ }, e.prototype.skewX = function(t) {
302
+ return t !== 0 && (this.cache = null, this.queue.push([1, 0, Math.tan(t * Math.PI / 180), 1, 0, 0])), this;
303
+ }, e.prototype.skewY = function(t) {
304
+ return t !== 0 && (this.cache = null, this.queue.push([1, Math.tan(t * Math.PI / 180), 0, 1, 0, 0])), this;
305
+ }, e.prototype.toArray = function() {
306
+ if (this.cache)
307
+ return this.cache;
308
+ if (!this.queue.length)
309
+ return this.cache = [1, 0, 0, 1, 0, 0], this.cache;
310
+ if (this.cache = this.queue[0], this.queue.length === 1)
311
+ return this.cache;
312
+ for (var t = 1; t < this.queue.length; t++)
313
+ this.cache = i(this.cache, this.queue[t]);
314
+ return this.cache;
315
+ }, e.prototype.calc = function(t, r, n) {
316
+ var s;
317
+ return this.queue.length ? (this.cache || (this.cache = this.toArray()), s = this.cache, [
318
+ t * s[0] + r * s[2] + (n ? 0 : s[4]),
319
+ t * s[1] + r * s[3] + (n ? 0 : s[5])
320
+ ]) : [t, r];
321
+ }, gt = e, gt;
322
+ }
323
+ var vt, Ht;
324
+ function Ee() {
325
+ if (Ht) return vt;
326
+ Ht = 1;
327
+ var i = re(), e = {
328
+ matrix: !0,
329
+ scale: !0,
330
+ rotate: !0,
331
+ translate: !0,
332
+ skewX: !0,
333
+ skewY: !0
334
+ }, t = /\s*(matrix|translate|scale|rotate|skewX|skewY)\s*\(\s*(.+?)\s*\)[\s,]*/, r = /[\s,]+/;
335
+ return vt = function(s) {
336
+ var a = new i(), o, l;
337
+ return s.split(t).forEach(function(u) {
338
+ if (u.length) {
339
+ if (typeof e[u] < "u") {
340
+ o = u;
341
+ return;
342
+ }
343
+ switch (l = u.split(r).map(function(f) {
344
+ return +f || 0;
345
+ }), o) {
346
+ case "matrix":
347
+ l.length === 6 && a.matrix(l);
348
+ return;
349
+ case "scale":
350
+ l.length === 1 ? a.scale(l[0], l[0]) : l.length === 2 && a.scale(l[0], l[1]);
351
+ return;
352
+ case "rotate":
353
+ l.length === 1 ? a.rotate(l[0], 0, 0) : l.length === 3 && a.rotate(l[0], l[1], l[2]);
354
+ return;
355
+ case "translate":
356
+ l.length === 1 ? a.translate(l[0], 0) : l.length === 2 && a.translate(l[0], l[1]);
357
+ return;
358
+ case "skewX":
359
+ l.length === 1 && a.skewX(l[0]);
360
+ return;
361
+ case "skewY":
362
+ l.length === 1 && a.skewY(l[0]);
363
+ return;
364
+ }
365
+ }
366
+ }), a;
367
+ }, vt;
368
+ }
369
+ var mt, Vt;
370
+ function Be() {
371
+ if (Vt) return mt;
372
+ Vt = 1;
373
+ var i = Math.PI * 2;
374
+ function e(n, s, a, o) {
375
+ var l = n * o - s * a < 0 ? -1 : 1, u = n * a + s * o;
376
+ return u > 1 && (u = 1), u < -1 && (u = -1), l * Math.acos(u);
377
+ }
378
+ function t(n, s, a, o, l, u, f, c, p, h) {
379
+ var g = h * (n - a) / 2 + p * (s - o) / 2, d = -p * (n - a) / 2 + h * (s - o) / 2, m = f * f, x = c * c, v = g * g, S = d * d, w = m * x - m * S - x * v;
380
+ w < 0 && (w = 0), w /= m * S + x * v, w = Math.sqrt(w) * (l === u ? -1 : 1);
381
+ var y = w * f / c * d, k = w * -c / f * g, B = h * y - p * k + (n + a) / 2, _ = p * y + h * k + (s + o) / 2, P = (g - y) / f, T = (d - k) / c, D = (-g - y) / f, A = (-d - k) / c, R = e(1, 0, P, T), N = e(P, T, D, A);
382
+ return u === 0 && N > 0 && (N -= i), u === 1 && N < 0 && (N += i), [B, _, R, N];
383
+ }
384
+ function r(n, s) {
385
+ var a = 1.3333333333333333 * Math.tan(s / 4), o = Math.cos(n), l = Math.sin(n), u = Math.cos(n + s), f = Math.sin(n + s);
386
+ return [o, l, o - l * a, l + o * a, u + f * a, f - u * a, u, f];
387
+ }
388
+ return mt = function(s, a, o, l, u, f, c, p, h) {
389
+ var g = Math.sin(h * i / 360), d = Math.cos(h * i / 360), m = d * (s - o) / 2 + g * (a - l) / 2, x = -g * (s - o) / 2 + d * (a - l) / 2;
390
+ if (m === 0 && x === 0)
391
+ return [];
392
+ if (c === 0 || p === 0)
393
+ return [];
394
+ c = Math.abs(c), p = Math.abs(p);
395
+ var v = m * m / (c * c) + x * x / (p * p);
396
+ v > 1 && (c *= Math.sqrt(v), p *= Math.sqrt(v));
397
+ var S = t(s, a, o, l, u, f, c, p, g, d), w = [], y = S[2], k = S[3], B = Math.max(Math.ceil(Math.abs(k) / (i / 4)), 1);
398
+ k /= B;
399
+ for (var _ = 0; _ < B; _++)
400
+ w.push(r(y, k)), y += k;
401
+ return w.map(function(P) {
402
+ for (var T = 0; T < P.length; T += 2) {
403
+ var D = P[T + 0], A = P[T + 1];
404
+ D *= c, A *= p;
405
+ var R = d * D - g * A, N = g * D + d * A;
406
+ P[T + 0] = R + S[0], P[T + 1] = N + S[1];
407
+ }
408
+ return P;
409
+ });
410
+ }, mt;
411
+ }
412
+ var xt, jt;
413
+ function Ie() {
414
+ if (jt) return xt;
415
+ jt = 1;
416
+ var i = 1e-10, e = Math.PI / 180;
417
+ function t(r, n, s) {
418
+ if (!(this instanceof t))
419
+ return new t(r, n, s);
420
+ this.rx = r, this.ry = n, this.ax = s;
421
+ }
422
+ return t.prototype.transform = function(r) {
423
+ var n = Math.cos(this.ax * e), s = Math.sin(this.ax * e), a = [
424
+ this.rx * (r[0] * n + r[2] * s),
425
+ this.rx * (r[1] * n + r[3] * s),
426
+ this.ry * (-r[0] * s + r[2] * n),
427
+ this.ry * (-r[1] * s + r[3] * n)
428
+ ], o = a[0] * a[0] + a[2] * a[2], l = a[1] * a[1] + a[3] * a[3], u = ((a[0] - a[3]) * (a[0] - a[3]) + (a[2] + a[1]) * (a[2] + a[1])) * ((a[0] + a[3]) * (a[0] + a[3]) + (a[2] - a[1]) * (a[2] - a[1])), f = (o + l) / 2;
429
+ if (u < i * f)
430
+ return this.rx = this.ry = Math.sqrt(f), this.ax = 0, this;
431
+ var c = a[0] * a[1] + a[2] * a[3];
432
+ u = Math.sqrt(u);
433
+ var p = f + u / 2, h = f - u / 2;
434
+ return this.ax = Math.abs(c) < i && Math.abs(p - l) < i ? 90 : Math.atan(
435
+ Math.abs(c) > Math.abs(p - l) ? (p - o) / c : c / (p - l)
436
+ ) * 180 / Math.PI, this.ax >= 0 ? (this.rx = Math.sqrt(p), this.ry = Math.sqrt(h)) : (this.ax += 90, this.rx = Math.sqrt(h), this.ry = Math.sqrt(p)), this;
437
+ }, t.prototype.isDegenerate = function() {
438
+ return this.rx < i * this.ry || this.ry < i * this.rx;
439
+ }, xt = t, xt;
440
+ }
441
+ var bt, Wt;
442
+ function Ne() {
443
+ if (Wt) return bt;
444
+ Wt = 1;
445
+ var i = Pe(), e = Ee(), t = re(), r = Be(), n = Ie();
446
+ function s(a) {
447
+ if (!(this instanceof s))
448
+ return new s(a);
449
+ var o = i(a);
450
+ this.segments = o.segments, this.err = o.err, this.__stack = [];
451
+ }
452
+ return s.from = function(a) {
453
+ if (typeof a == "string") return new s(a);
454
+ if (a instanceof s) {
455
+ var o = new s("");
456
+ return o.err = a.err, o.segments = a.segments.map(function(l) {
457
+ return l.slice();
458
+ }), o.__stack = a.__stack.map(function(l) {
459
+ return t().matrix(l.toArray());
460
+ }), o;
461
+ }
462
+ throw new Error("SvgPath.from: invalid param type " + a);
463
+ }, s.prototype.__matrix = function(a) {
464
+ var o = this, l;
465
+ a.queue.length && this.iterate(function(u, f, c, p) {
466
+ var h, g, d, m;
467
+ switch (u[0]) {
468
+ // Process 'assymetric' commands separately
469
+ case "v":
470
+ h = a.calc(0, u[1], !0), g = h[0] === 0 ? ["v", h[1]] : ["l", h[0], h[1]];
471
+ break;
472
+ case "V":
473
+ h = a.calc(c, u[1], !1), g = h[0] === a.calc(c, p, !1)[0] ? ["V", h[1]] : ["L", h[0], h[1]];
474
+ break;
475
+ case "h":
476
+ h = a.calc(u[1], 0, !0), g = h[1] === 0 ? ["h", h[0]] : ["l", h[0], h[1]];
477
+ break;
478
+ case "H":
479
+ h = a.calc(u[1], p, !1), g = h[1] === a.calc(c, p, !1)[1] ? ["H", h[0]] : ["L", h[0], h[1]];
480
+ break;
481
+ case "a":
482
+ case "A":
483
+ var x = a.toArray(), v = n(u[1], u[2], u[3]).transform(x);
484
+ if (x[0] * x[3] - x[1] * x[2] < 0 && (u[5] = u[5] ? "0" : "1"), h = a.calc(u[6], u[7], u[0] === "a"), u[0] === "A" && u[6] === c && u[7] === p || u[0] === "a" && u[6] === 0 && u[7] === 0) {
485
+ g = [u[0] === "a" ? "l" : "L", h[0], h[1]];
486
+ break;
487
+ }
488
+ v.isDegenerate() ? g = [u[0] === "a" ? "l" : "L", h[0], h[1]] : g = [u[0], v.rx, v.ry, v.ax, u[4], u[5], h[0], h[1]];
489
+ break;
490
+ case "m":
491
+ m = f > 0, h = a.calc(u[1], u[2], m), g = ["m", h[0], h[1]];
492
+ break;
493
+ default:
494
+ for (d = u[0], g = [d], m = d.toLowerCase() === d, l = 1; l < u.length; l += 2)
495
+ h = a.calc(u[l], u[l + 1], m), g.push(h[0], h[1]);
496
+ }
497
+ o.segments[f] = g;
498
+ }, !0);
499
+ }, s.prototype.__evaluateStack = function() {
500
+ var a, o;
501
+ if (this.__stack.length) {
502
+ if (this.__stack.length === 1) {
503
+ this.__matrix(this.__stack[0]), this.__stack = [];
504
+ return;
505
+ }
506
+ for (a = t(), o = this.__stack.length; --o >= 0; )
507
+ a.matrix(this.__stack[o].toArray());
508
+ this.__matrix(a), this.__stack = [];
509
+ }
510
+ }, s.prototype.toString = function() {
511
+ var a = "", o = "", l = !1;
512
+ this.__evaluateStack();
513
+ for (var u = 0, f = this.segments.length; u < f; u++) {
514
+ var c = this.segments[u], p = c[0];
515
+ p !== o || p === "m" || p === "M" ? (p === "m" && o === "z" && (a += " "), a += p, l = !1) : l = !0;
516
+ for (var h = 1; h < c.length; h++) {
517
+ var g = c[h];
518
+ h === 1 ? l && g >= 0 && (a += " ") : g >= 0 && (a += " "), a += g;
519
+ }
520
+ o = p;
521
+ }
522
+ return a;
523
+ }, s.prototype.translate = function(a, o) {
524
+ return this.__stack.push(t().translate(a, o || 0)), this;
525
+ }, s.prototype.scale = function(a, o) {
526
+ return this.__stack.push(t().scale(a, !o && o !== 0 ? a : o)), this;
527
+ }, s.prototype.rotate = function(a, o, l) {
528
+ return this.__stack.push(t().rotate(a, o || 0, l || 0)), this;
529
+ }, s.prototype.skewX = function(a) {
530
+ return this.__stack.push(t().skewX(a)), this;
531
+ }, s.prototype.skewY = function(a) {
532
+ return this.__stack.push(t().skewY(a)), this;
533
+ }, s.prototype.matrix = function(a) {
534
+ return this.__stack.push(t().matrix(a)), this;
535
+ }, s.prototype.transform = function(a) {
536
+ return a.trim() ? (this.__stack.push(e(a)), this) : this;
537
+ }, s.prototype.round = function(a) {
538
+ var o = 0, l = 0, u = 0, f = 0, c;
539
+ return a = a || 0, this.__evaluateStack(), this.segments.forEach(function(p) {
540
+ var h = p[0].toLowerCase() === p[0];
541
+ switch (p[0]) {
542
+ case "H":
543
+ case "h":
544
+ h && (p[1] += u), u = p[1] - p[1].toFixed(a), p[1] = +p[1].toFixed(a);
545
+ return;
546
+ case "V":
547
+ case "v":
548
+ h && (p[1] += f), f = p[1] - p[1].toFixed(a), p[1] = +p[1].toFixed(a);
549
+ return;
550
+ case "Z":
551
+ case "z":
552
+ u = o, f = l;
553
+ return;
554
+ case "M":
555
+ case "m":
556
+ h && (p[1] += u, p[2] += f), u = p[1] - p[1].toFixed(a), f = p[2] - p[2].toFixed(a), o = u, l = f, p[1] = +p[1].toFixed(a), p[2] = +p[2].toFixed(a);
557
+ return;
558
+ case "A":
559
+ case "a":
560
+ h && (p[6] += u, p[7] += f), u = p[6] - p[6].toFixed(a), f = p[7] - p[7].toFixed(a), p[1] = +p[1].toFixed(a), p[2] = +p[2].toFixed(a), p[3] = +p[3].toFixed(a + 2), p[6] = +p[6].toFixed(a), p[7] = +p[7].toFixed(a);
561
+ return;
562
+ default:
563
+ c = p.length, h && (p[c - 2] += u, p[c - 1] += f), u = p[c - 2] - p[c - 2].toFixed(a), f = p[c - 1] - p[c - 1].toFixed(a), p.forEach(function(g, d) {
564
+ d && (p[d] = +p[d].toFixed(a));
565
+ });
566
+ return;
567
+ }
568
+ }), this;
569
+ }, s.prototype.iterate = function(a, o) {
570
+ var l = this.segments, u = {}, f = !1, c = 0, p = 0, h = 0, g = 0, d, m, x;
571
+ if (o || this.__evaluateStack(), l.forEach(function(v, S) {
572
+ var w = a(v, S, c, p);
573
+ Array.isArray(w) && (u[S] = w, f = !0);
574
+ var y = v[0] === v[0].toLowerCase();
575
+ switch (v[0]) {
576
+ case "m":
577
+ case "M":
578
+ c = v[1] + (y ? c : 0), p = v[2] + (y ? p : 0), h = c, g = p;
579
+ return;
580
+ case "h":
581
+ case "H":
582
+ c = v[1] + (y ? c : 0);
583
+ return;
584
+ case "v":
585
+ case "V":
586
+ p = v[1] + (y ? p : 0);
587
+ return;
588
+ case "z":
589
+ case "Z":
590
+ c = h, p = g;
591
+ return;
592
+ default:
593
+ c = v[v.length - 2] + (y ? c : 0), p = v[v.length - 1] + (y ? p : 0);
594
+ }
595
+ }), !f)
596
+ return this;
597
+ for (x = [], d = 0; d < l.length; d++)
598
+ if (typeof u[d] < "u")
599
+ for (m = 0; m < u[d].length; m++)
600
+ x.push(u[d][m]);
601
+ else
602
+ x.push(l[d]);
603
+ return this.segments = x, this;
604
+ }, s.prototype.abs = function() {
605
+ return this.iterate(function(a, o, l, u) {
606
+ var f = a[0], c = f.toUpperCase(), p;
607
+ if (f !== c)
608
+ switch (a[0] = c, f) {
609
+ case "v":
610
+ a[1] += u;
611
+ return;
612
+ case "a":
613
+ a[6] += l, a[7] += u;
614
+ return;
615
+ default:
616
+ for (p = 1; p < a.length; p++)
617
+ a[p] += p % 2 ? l : u;
618
+ }
619
+ }, !0), this;
620
+ }, s.prototype.rel = function() {
621
+ return this.iterate(function(a, o, l, u) {
622
+ var f = a[0], c = f.toLowerCase(), p;
623
+ if (f !== c && !(o === 0 && f === "M"))
624
+ switch (a[0] = c, f) {
625
+ case "V":
626
+ a[1] -= u;
627
+ return;
628
+ case "A":
629
+ a[6] -= l, a[7] -= u;
630
+ return;
631
+ default:
632
+ for (p = 1; p < a.length; p++)
633
+ a[p] -= p % 2 ? l : u;
634
+ }
635
+ }, !0), this;
636
+ }, s.prototype.unarc = function() {
637
+ return this.iterate(function(a, o, l, u) {
638
+ var f, c, p, h = [], g = a[0];
639
+ return g !== "A" && g !== "a" ? null : (g === "a" ? (c = l + a[6], p = u + a[7]) : (c = a[6], p = a[7]), f = r(l, u, c, p, a[4], a[5], a[1], a[2], a[3]), f.length === 0 ? [[a[0] === "a" ? "l" : "L", a[6], a[7]]] : (f.forEach(function(d) {
640
+ h.push(["C", d[2], d[3], d[4], d[5], d[6], d[7]]);
641
+ }), h));
642
+ }), this;
643
+ }, s.prototype.unshort = function() {
644
+ var a = this.segments, o, l, u, f, c;
645
+ return this.iterate(function(p, h, g, d) {
646
+ var m = p[0], x = m.toUpperCase(), v;
647
+ h && (x === "T" ? (v = m === "t", u = a[h - 1], u[0] === "Q" ? (o = u[1] - g, l = u[2] - d) : u[0] === "q" ? (o = u[1] - u[3], l = u[2] - u[4]) : (o = 0, l = 0), f = -o, c = -l, v || (f += g, c += d), a[h] = [
648
+ v ? "q" : "Q",
649
+ f,
650
+ c,
651
+ p[1],
652
+ p[2]
653
+ ]) : x === "S" && (v = m === "s", u = a[h - 1], u[0] === "C" ? (o = u[3] - g, l = u[4] - d) : u[0] === "c" ? (o = u[3] - u[5], l = u[4] - u[6]) : (o = 0, l = 0), f = -o, c = -l, v || (f += g, c += d), a[h] = [
654
+ v ? "c" : "C",
655
+ f,
656
+ c,
657
+ p[1],
658
+ p[2],
659
+ p[3],
660
+ p[4]
661
+ ]));
662
+ }), this;
663
+ }, bt = s, bt;
664
+ }
665
+ var yt, Gt;
666
+ function Re() {
667
+ return Gt || (Gt = 1, yt = Ne()), yt;
668
+ }
669
+ var _e = Re();
670
+ const Le = /* @__PURE__ */ At(_e);
671
+ var Ut = function(i) {
672
+ var e = i, t, r = {
673
+ a: 0,
674
+ b: 0,
675
+ c: 0
676
+ }, n = [], s = /(\[[^\]]+\])/g, a = /(#[^\#\s\+>~\.\[:\)]+)/g, o = /(\.[^\s\+>~\.\[:\)]+)/g, l = /(::[^\s\+>~\.\[:]+|:first-line|:first-letter|:before|:after)/gi, u = /(:(?!not|global|local)[\w-]+\([^\)]*\))/gi, f = /(:(?!not|global|local)[^\s\+>~\.\[:]+)/g, c = /([^\s\+>~\.\[:]+)/g;
677
+ return t = function(p, h) {
678
+ var g, d, m, x, v, S;
679
+ if (p.test(e))
680
+ for (g = e.match(p), d = 0, m = g.length; d < m; d += 1)
681
+ r[h] += 1, x = g[d], v = e.indexOf(x), S = x.length, n.push({
682
+ selector: i.substr(v, S),
683
+ type: h,
684
+ index: v,
685
+ length: S
686
+ }), e = e.replace(x, Array(S + 1).join(" "));
687
+ }, (function() {
688
+ var p = function(m) {
689
+ var x, v, S, w;
690
+ if (m.test(e))
691
+ for (x = e.match(m), v = 0, S = x.length; v < S; v += 1)
692
+ w = x[v], e = e.replace(w, Array(w.length + 1).join("A"));
693
+ }, h = /\\[0-9A-Fa-f]{6}\s?/g, g = /\\[0-9A-Fa-f]{1,5}\s/g, d = /\\./g;
694
+ p(h), p(g), p(d);
695
+ })(), (function() {
696
+ var p = /{[^]*/gm, h, g, d, m;
697
+ if (p.test(e))
698
+ for (h = e.match(p), g = 0, d = h.length; g < d; g += 1)
699
+ m = h[g], e = e.replace(m, Array(m.length + 1).join(" "));
700
+ })(), t(s, "b"), t(a, "a"), t(o, "b"), t(l, "c"), t(u, "b"), t(f, "b"), e = e.replace(/[\*\s\+>~]/g, " "), e = e.replace(/[#\.]/g, " "), e = e.replace(/:not/g, " "), e = e.replace(/:local/g, " "), e = e.replace(/:global/g, " "), e = e.replace(/[\(\)]/g, " "), t(c, "c"), n.sort(function(p, h) {
701
+ return p.index - h.index;
702
+ }), {
703
+ selector: i,
704
+ specificity: "0," + r.a.toString() + "," + r.b.toString() + "," + r.c.toString(),
705
+ specificityArray: [0, r.a, r.b, r.c],
706
+ parts: n
707
+ };
708
+ }, Oe = function(i, e) {
709
+ var t, r, n;
710
+ if (typeof i == "string") {
711
+ if (i.indexOf(",") !== -1)
712
+ throw "Invalid CSS selector";
713
+ t = Ut(i).specificityArray;
714
+ } else if (Array.isArray(i)) {
715
+ if (i.filter(function(s) {
716
+ return typeof s == "number";
717
+ }).length !== 4)
718
+ throw "Invalid specificity array";
719
+ t = i;
720
+ } else
721
+ throw "Invalid CSS selector or specificity array";
722
+ if (typeof e == "string") {
723
+ if (e.indexOf(",") !== -1)
724
+ throw "Invalid CSS selector";
725
+ r = Ut(e).specificityArray;
726
+ } else if (Array.isArray(e)) {
727
+ if (e.filter(function(s) {
728
+ return typeof s == "number";
729
+ }).length !== 4)
730
+ throw "Invalid specificity array";
731
+ r = e;
732
+ } else
733
+ throw "Invalid CSS selector or specificity array";
734
+ for (n = 0; n < 4; n += 1) {
735
+ if (t[n] < r[n])
736
+ return -1;
737
+ if (t[n] > r[n])
738
+ return 1;
739
+ }
740
+ return 0;
741
+ }, Ct = function(i, e) {
742
+ return Ct = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(t, r) {
743
+ t.__proto__ = r;
744
+ } || function(t, r) {
745
+ for (var n in r) Object.prototype.hasOwnProperty.call(r, n) && (t[n] = r[n]);
746
+ }, Ct(i, e);
747
+ };
748
+ function M(i, e) {
749
+ if (typeof e != "function" && e !== null) throw new TypeError("Class extends value " + String(e) + " is not a constructor or null");
750
+ function t() {
751
+ this.constructor = i;
752
+ }
753
+ Ct(i, e), i.prototype = e === null ? Object.create(e) : (t.prototype = e.prototype, new t());
754
+ }
755
+ var ot = function() {
756
+ return ot = Object.assign || function(i) {
757
+ for (var e, t = 1, r = arguments.length; t < r; t++) for (var n in e = arguments[t]) Object.prototype.hasOwnProperty.call(e, n) && (i[n] = e[n]);
758
+ return i;
759
+ }, ot.apply(this, arguments);
760
+ };
761
+ function C(i, e, t, r) {
762
+ return new (t || (t = Promise))((function(n, s) {
763
+ function a(u) {
764
+ try {
765
+ l(r.next(u));
766
+ } catch (f) {
767
+ s(f);
768
+ }
769
+ }
770
+ function o(u) {
771
+ try {
772
+ l(r.throw(u));
773
+ } catch (f) {
774
+ s(f);
775
+ }
776
+ }
777
+ function l(u) {
778
+ var f;
779
+ u.done ? n(u.value) : (f = u.value, f instanceof t ? f : new t((function(c) {
780
+ c(f);
781
+ }))).then(a, o);
782
+ }
783
+ l((r = r.apply(i, e || [])).next());
784
+ }));
785
+ }
786
+ function F(i, e) {
787
+ var t, r, n, s = { label: 0, sent: function() {
788
+ if (1 & n[0]) throw n[1];
789
+ return n[1];
790
+ }, trys: [], ops: [] }, a = Object.create((typeof Iterator == "function" ? Iterator : Object).prototype);
791
+ return a.next = o(0), a.throw = o(1), a.return = o(2), typeof Symbol == "function" && (a[Symbol.iterator] = function() {
792
+ return this;
793
+ }), a;
794
+ function o(l) {
795
+ return function(u) {
796
+ return (function(f) {
797
+ if (t) throw new TypeError("Generator is already executing.");
798
+ for (; a && (a = 0, f[0] && (s = 0)), s; ) try {
799
+ if (t = 1, r && (n = 2 & f[0] ? r.return : f[0] ? r.throw || ((n = r.return) && n.call(r), 0) : r.next) && !(n = n.call(r, f[1])).done) return n;
800
+ switch (r = 0, n && (f = [2 & f[0], n.value]), f[0]) {
801
+ case 0:
802
+ case 1:
803
+ n = f;
804
+ break;
805
+ case 4:
806
+ return s.label++, { value: f[1], done: !1 };
807
+ case 5:
808
+ s.label++, r = f[1], f = [0];
809
+ continue;
810
+ case 7:
811
+ f = s.ops.pop(), s.trys.pop();
812
+ continue;
813
+ default:
814
+ if (n = s.trys, !((n = n.length > 0 && n[n.length - 1]) || f[0] !== 6 && f[0] !== 2)) {
815
+ s = 0;
816
+ continue;
817
+ }
818
+ if (f[0] === 3 && (!n || f[1] > n[0] && f[1] < n[3])) {
819
+ s.label = f[1];
820
+ break;
821
+ }
822
+ if (f[0] === 6 && s.label < n[1]) {
823
+ s.label = n[1], n = f;
824
+ break;
825
+ }
826
+ if (n && s.label < n[2]) {
827
+ s.label = n[2], s.ops.push(f);
828
+ break;
829
+ }
830
+ n[2] && s.ops.pop(), s.trys.pop();
831
+ continue;
832
+ }
833
+ f = e.call(i, s);
834
+ } catch (c) {
835
+ f = [6, c], r = 0;
836
+ } finally {
837
+ t = n = 0;
838
+ }
839
+ if (5 & f[0]) throw f[1];
840
+ return { value: f[0] ? f[1] : void 0, done: !0 };
841
+ })([l, u]);
842
+ };
843
+ }
844
+ }
845
+ var O = (function() {
846
+ function i(e) {
847
+ if (this.a = void 0, this.r = 0, this.g = 0, this.b = 0, this.simpleColors = {}, this.colorDefs = [], this.ok = !1, e) {
848
+ for (var t in e.charAt(0) == "#" && (e = e.substr(1, 6)), e = (e = e.replace(/ /g, "")).toLowerCase(), this.simpleColors = { aliceblue: "f0f8ff", antiquewhite: "faebd7", aqua: "00ffff", aquamarine: "7fffd4", azure: "f0ffff", beige: "f5f5dc", bisque: "ffe4c4", black: "000000", blanchedalmond: "ffebcd", blue: "0000ff", blueviolet: "8a2be2", brown: "a52a2a", burlywood: "deb887", cadetblue: "5f9ea0", chartreuse: "7fff00", chocolate: "d2691e", coral: "ff7f50", cornflowerblue: "6495ed", cornsilk: "fff8dc", crimson: "dc143c", cyan: "00ffff", 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", feldspar: "d19275", firebrick: "b22222", floralwhite: "fffaf0", forestgreen: "228b22", fuchsia: "ff00ff", 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", lightslateblue: "8470ff", lightslategray: "778899", lightslategrey: "778899", lightsteelblue: "b0c4de", lightyellow: "ffffe0", lime: "00ff00", limegreen: "32cd32", linen: "faf0e6", magenta: "ff00ff", maroon: "800000", mediumaquamarine: "66cdaa", mediumblue: "0000cd", mediumorchid: "ba55d3", mediumpurple: "9370d8", 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: "d87093", papayawhip: "ffefd5", peachpuff: "ffdab9", peru: "cd853f", pink: "ffc0cb", plum: "dda0dd", powderblue: "b0e0e6", purple: "800080", red: "ff0000", 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", violetred: "d02090", wheat: "f5deb3", white: "ffffff", whitesmoke: "f5f5f5", yellow: "ffff00", yellowgreen: "9acd32" }, this.simpleColors) e == t && (e = this.simpleColors[t]);
849
+ this.colorDefs = [{ re: /^rgb\((\d{1,3}),\s*(\d{1,3}),\s*(\d{1,3})\)$/, example: ["rgb(123, 234, 45)", "rgb(255,234,245)"], process: function(l) {
850
+ return [parseInt(l[1]), parseInt(l[2]), parseInt(l[3])];
851
+ } }, { re: /^rgb\(([0-9.]+)%,\s*([0-9.]+)%,\s*([0-9.]+)%\)$/, example: ["rgb(50.5%, 25.75%, 75.5%)", "rgb(100%,0%,0%)"], process: function(l) {
852
+ return [Math.round(2.55 * parseFloat(l[1])), Math.round(2.55 * parseFloat(l[2])), Math.round(2.55 * parseFloat(l[3]))];
853
+ } }, { re: /^(\w{2})(\w{2})(\w{2})$/, example: ["#00ff00", "336699"], process: function(l) {
854
+ return [parseInt(l[1], 16), parseInt(l[2], 16), parseInt(l[3], 16)];
855
+ } }, { re: /^(\w{1})(\w{1})(\w{1})$/, example: ["#fb0", "f0f"], process: function(l) {
856
+ return [parseInt(l[1] + l[1], 16), parseInt(l[2] + l[2], 16), parseInt(l[3] + l[3], 16)];
857
+ } }];
858
+ for (var r = 0; r < this.colorDefs.length; r++) {
859
+ var n = this.colorDefs[r].re, s = this.colorDefs[r].process, a = n.exec(e);
860
+ if (a) {
861
+ var o = s(a);
862
+ this.r = o[0], this.g = o[1], this.b = o[2], this.ok = !0;
863
+ }
864
+ }
865
+ this.r = this.r < 0 || isNaN(this.r) ? 0 : this.r > 255 ? 255 : this.r, this.g = this.g < 0 || isNaN(this.g) ? 0 : this.g > 255 ? 255 : this.g, this.b = this.b < 0 || isNaN(this.b) ? 0 : this.b > 255 ? 255 : this.b;
866
+ }
867
+ }
868
+ return i.prototype.toRGB = function() {
869
+ return "rgb(" + this.r + ", " + this.g + ", " + this.b + ")";
870
+ }, i.prototype.toRGBA = function() {
871
+ return "rgba(" + this.r + ", " + this.g + ", " + this.b + ", " + (this.a || "1") + ")";
872
+ }, i.prototype.toHex = function() {
873
+ var e = this.r.toString(16), t = this.g.toString(16), r = this.b.toString(16);
874
+ return e.length == 1 && (e = "0" + e), t.length == 1 && (t = "0" + t), r.length == 1 && (r = "0" + r), "#" + e + t + r;
875
+ }, i.prototype.getHelpXML = function() {
876
+ for (var e = [], t = 0; t < this.colorDefs.length; t++) for (var r = this.colorDefs[t].example, n = 0; n < r.length; n++) e[e.length] = r[n];
877
+ for (var s in this.simpleColors) e[e.length] = s;
878
+ var a = document.createElement("ul");
879
+ for (a.setAttribute("id", "rgbcolor-examples"), t = 0; t < e.length; t++) try {
880
+ var o = document.createElement("li"), l = new i(e[t]), u = document.createElement("div");
881
+ u.style.cssText = "margin: 3px; border: 1px solid black; background:" + l.toHex() + "; color:" + l.toHex(), u.appendChild(document.createTextNode("test"));
882
+ var f = document.createTextNode(" " + e[t] + " -> " + l.toRGB() + " -> " + l.toHex());
883
+ o.appendChild(u), o.appendChild(f), a.appendChild(o);
884
+ } catch {
885
+ }
886
+ return a;
887
+ }, i;
888
+ })(), I = (function() {
889
+ function i(e) {
890
+ this.color = e;
891
+ }
892
+ return i.prototype.getFillData = function(e, t) {
893
+ return C(this, void 0, void 0, (function() {
894
+ return F(this, (function(r) {
895
+ return [2, void 0];
896
+ }));
897
+ }));
898
+ }, i;
899
+ })(), J = (function() {
900
+ function i() {
901
+ this.xmlSpace = "", this.whiteSpace = "", this.fill = null, this.fillOpacity = 1, this.fontFamily = "", this.fontSize = 16, this.fontStyle = "", this.fontWeight = "", this.opacity = 1, this.stroke = null, this.strokeDasharray = null, this.strokeDashoffset = 0, this.strokeLinecap = "", this.strokeLinejoin = "", this.strokeMiterlimit = 4, this.strokeOpacity = 1, this.strokeWidth = 1, this.alignmentBaseline = "", this.textAnchor = "", this.visibility = "", this.color = null, this.contextFill = null, this.contextStroke = null, this.fillRule = null;
902
+ }
903
+ return i.prototype.clone = function() {
904
+ var e = new i();
905
+ return e.xmlSpace = this.xmlSpace, e.whiteSpace = this.whiteSpace, e.fill = this.fill, e.fillOpacity = this.fillOpacity, e.fontFamily = this.fontFamily, e.fontSize = this.fontSize, e.fontStyle = this.fontStyle, e.fontWeight = this.fontWeight, e.opacity = this.opacity, e.stroke = this.stroke, e.strokeDasharray = this.strokeDasharray, e.strokeDashoffset = this.strokeDashoffset, e.strokeLinecap = this.strokeLinecap, e.strokeLinejoin = this.strokeLinejoin, e.strokeMiterlimit = this.strokeMiterlimit, e.strokeOpacity = this.strokeOpacity, e.strokeWidth = this.strokeWidth, e.textAnchor = this.textAnchor, e.alignmentBaseline = this.alignmentBaseline, e.visibility = this.visibility, e.color = this.color, e.fillRule = this.fillRule, e.contextFill = this.contextFill, e.contextStroke = this.contextStroke, e;
906
+ }, i.default = function() {
907
+ var e = new i();
908
+ return e.xmlSpace = "default", e.whiteSpace = "normal", e.fill = new I(new O("rgb(0, 0, 0)")), e.fillOpacity = 1, e.fontFamily = "times", e.fontSize = 16, e.fontStyle = "normal", e.fontWeight = "normal", e.opacity = 1, e.stroke = null, e.strokeDasharray = null, e.strokeDashoffset = 0, e.strokeLinecap = "butt", e.strokeLinejoin = "miter", e.strokeMiterlimit = 4, e.strokeOpacity = 1, e.strokeWidth = 1, e.alignmentBaseline = "baseline", e.textAnchor = "start", e.visibility = "visible", e.color = new O("rgb(0, 0, 0)"), e.fillRule = "nonzero", e.contextFill = null, e.contextStroke = null, e;
909
+ }, i.getContextColors = function(e, t) {
910
+ t === void 0 && (t = !1);
911
+ var r = {};
912
+ return e.attributeState.contextFill && (r.contextFill = e.attributeState.contextFill), e.attributeState.contextStroke && (r.contextStroke = e.attributeState.contextStroke), t && e.attributeState.color && (r.color = e.attributeState.color), r;
913
+ }, i;
914
+ })(), Y = (function() {
915
+ function i(e, t) {
916
+ var r, n, s;
917
+ this.pdf = e, this.svg2pdfParameters = t.svg2pdfParameters, this.attributeState = t.attributeState ? t.attributeState.clone() : J.default(), this.viewport = t.viewport, this.refsHandler = t.refsHandler, this.styleSheets = t.styleSheets, this.textMeasure = t.textMeasure, this.transform = (r = t.transform) !== null && r !== void 0 ? r : this.pdf.unitMatrix, this.withinClipPath = (n = t.withinClipPath) !== null && n !== void 0 && n, this.withinUse = (s = t.withinUse) !== null && s !== void 0 && s;
918
+ }
919
+ return i.prototype.clone = function(e) {
920
+ var t, r, n, s;
921
+ return e === void 0 && (e = {}), new i(this.pdf, { svg2pdfParameters: this.svg2pdfParameters, attributeState: e.attributeState ? e.attributeState.clone() : this.attributeState.clone(), viewport: (t = e.viewport) !== null && t !== void 0 ? t : this.viewport, refsHandler: this.refsHandler, styleSheets: this.styleSheets, textMeasure: this.textMeasure, transform: (r = e.transform) !== null && r !== void 0 ? r : this.transform, withinClipPath: (n = e.withinClipPath) !== null && n !== void 0 ? n : this.withinClipPath, withinUse: (s = e.withinUse) !== null && s !== void 0 ? s : this.withinUse });
922
+ }, i;
923
+ })(), ie = (function() {
924
+ function i(e) {
925
+ this.renderedElements = {}, this.idMap = e, this.idPrefix = String(i.instanceCounter++);
926
+ }
927
+ return i.prototype.getRendered = function(e, t, r) {
928
+ return C(this, void 0, void 0, (function() {
929
+ var n, s;
930
+ return F(this, (function(a) {
931
+ switch (a.label) {
932
+ case 0:
933
+ return n = this.generateKey(e, t), this.renderedElements.hasOwnProperty(n) ? [2, this.renderedElements[e]] : (s = this.get(e), this.renderedElements[n] = s, [4, r(s)]);
934
+ case 1:
935
+ return a.sent(), [2, s];
936
+ }
937
+ }));
938
+ }));
939
+ }, i.prototype.get = function(e) {
940
+ return this.idMap[ee(e, { isIdentifier: !0 })];
941
+ }, i.prototype.generateKey = function(e, t) {
942
+ var r = "";
943
+ return t && (r = ["color", "contextFill", "contextStroke"].map((function(n) {
944
+ var s, a;
945
+ return (a = (s = t[n]) === null || s === void 0 ? void 0 : s.toRGBA()) !== null && a !== void 0 ? a : "";
946
+ })).join("|")), this.idPrefix + "|" + e + "|" + r;
947
+ }, i.instanceCounter = 0, i;
948
+ })();
949
+ function zt(i, e) {
950
+ return Math.atan2(e[1] - i[1], e[0] - i[0]);
951
+ }
952
+ var Yt = 2 / 3;
953
+ function Xt(i, e) {
954
+ return [Yt * (e[0] - i[0]) + i[0], Yt * (e[1] - i[1]) + i[1]];
955
+ }
956
+ function tt(i) {
957
+ var e = Math.sqrt(i[0] * i[0] + i[1] * i[1]);
958
+ return [i[0] / e, i[1] / e];
959
+ }
960
+ function Q(i, e) {
961
+ return tt([e[0] - i[0], e[1] - i[1]]);
962
+ }
963
+ function st(i, e) {
964
+ return [i[0] + e[0], i[1] + e[1]];
965
+ }
966
+ function St(i, e) {
967
+ var t = i[0], r = i[1];
968
+ return [e.a * t + e.c * r + e.e, e.b * t + e.d * r + e.f];
969
+ }
970
+ var Z = (function() {
971
+ function i() {
972
+ this.segments = [];
973
+ }
974
+ return i.prototype.moveTo = function(e, t) {
975
+ return this.segments.push(new E(e, t)), this;
976
+ }, i.prototype.lineTo = function(e, t) {
977
+ return this.segments.push(new U(e, t)), this;
978
+ }, i.prototype.curveTo = function(e, t, r, n, s, a) {
979
+ return this.segments.push(new q(e, t, r, n, s, a)), this;
980
+ }, i.prototype.close = function() {
981
+ return this.segments.push(new Ft()), this;
982
+ }, i.prototype.transform = function(e) {
983
+ this.segments.forEach((function(t) {
984
+ if (t instanceof E || t instanceof U || t instanceof q) {
985
+ var r = St([t.x, t.y], e);
986
+ t.x = r[0], t.y = r[1];
987
+ }
988
+ if (t instanceof q) {
989
+ var n = St([t.x1, t.y1], e), s = St([t.x2, t.y2], e);
990
+ t.x1 = n[0], t.y1 = n[1], t.x2 = s[0], t.y2 = s[1];
991
+ }
992
+ }));
993
+ }, i.prototype.draw = function(e) {
994
+ var t = e.pdf;
995
+ this.segments.forEach((function(r) {
996
+ r instanceof E ? t.moveTo(r.x, r.y) : r instanceof U ? t.lineTo(r.x, r.y) : r instanceof q ? t.curveTo(r.x1, r.y1, r.x2, r.y2, r.x, r.y) : t.close();
997
+ }));
998
+ }, i;
999
+ })(), E = function(i, e) {
1000
+ this.x = i, this.y = e;
1001
+ }, U = function(i, e) {
1002
+ this.x = i, this.y = e;
1003
+ }, q = function(i, e, t, r, n, s) {
1004
+ this.x1 = i, this.y1 = e, this.x2 = t, this.y2 = r, this.x = n, this.y = s;
1005
+ }, Ft = function() {
1006
+ };
1007
+ function z(i, e) {
1008
+ return e.split(",").indexOf((i.nodeName || i.tagName).toLowerCase()) >= 0;
1009
+ }
1010
+ function b(i, e, t, r) {
1011
+ var n;
1012
+ r === void 0 && (r = t);
1013
+ var s = (n = i.style) === null || n === void 0 ? void 0 : n.getPropertyValue(r);
1014
+ if (s) return s;
1015
+ var a = e.getPropertyValue(i, r);
1016
+ return a || i.hasAttribute(t) && i.getAttribute(t) || void 0;
1017
+ }
1018
+ function j(i, e, t) {
1019
+ if (b(i.element, t.styleSheets, "display") === "none") return !1;
1020
+ var r = e, n = b(i.element, t.styleSheets, "visibility");
1021
+ return n && (r = n !== "hidden"), r;
1022
+ }
1023
+ function X(i, e, t) {
1024
+ var r = j(i, e, t);
1025
+ return i.element.childNodes.length !== 0 && (i.children.forEach((function(n) {
1026
+ n.isVisible(r, t) && (r = !0);
1027
+ })), r);
1028
+ }
1029
+ var qe = (function() {
1030
+ function i() {
1031
+ this.markers = [];
1032
+ }
1033
+ return i.prototype.addMarker = function(e) {
1034
+ this.markers.push(e);
1035
+ }, i.prototype.draw = function(e) {
1036
+ return C(this, void 0, void 0, (function() {
1037
+ var t, r, n, s, a, o, l, u;
1038
+ return F(this, (function(f) {
1039
+ switch (f.label) {
1040
+ case 0:
1041
+ t = 0, f.label = 1;
1042
+ case 1:
1043
+ return t < this.markers.length ? (r = this.markers[t], n = void 0, s = r.angle, a = r.anchor, o = Math.cos(s), l = Math.sin(s), n = e.pdf.Matrix(o, l, -l, o, a[0], a[1]), n = e.pdf.matrixMult(e.pdf.Matrix(e.attributeState.strokeWidth, 0, 0, e.attributeState.strokeWidth, 0, 0), n), n = e.pdf.matrixMult(n, e.transform), e.pdf.saveGraphicsState(), u = J.getContextColors(e), [4, e.refsHandler.getRendered(r.id, u, (function(c) {
1044
+ return c.apply(e);
1045
+ }))]) : [3, 4];
1046
+ case 2:
1047
+ f.sent(), e.pdf.doFormObject(e.refsHandler.generateKey(r.id, u), n), e.pdf.restoreGraphicsState(), f.label = 3;
1048
+ case 3:
1049
+ return t++, [3, 1];
1050
+ case 4:
1051
+ return [2];
1052
+ }
1053
+ }));
1054
+ }));
1055
+ }, i;
1056
+ })(), G = function(i, e, t, r) {
1057
+ r === void 0 && (r = !1), this.id = i, this.anchor = e, this.angle = t, this.isStartMarker = r;
1058
+ }, Pt = /url\(["']?#([^"']+)["']?\)/, De = { bottom: "bottom", "text-bottom": "bottom", top: "top", "text-top": "top", hanging: "hanging", middle: "middle", central: "middle", center: "middle", mathematical: "middle", ideographic: "ideographic", alphabetic: "alphabetic", baseline: "alphabetic" }, $t = "http://www.w3.org/2000/svg";
1059
+ function H(i, e) {
1060
+ var t;
1061
+ return (t = i && i.toString().match(/^([-0-9.]+)em$/)) ? parseFloat(t[1]) * e : (t = i && i.toString().match(/^([-0-9.]+)(px|)$/)) ? parseFloat(t[1]) : 0;
1062
+ }
1063
+ function ne(i) {
1064
+ return De[i] || "alphabetic";
1065
+ }
1066
+ function L(i) {
1067
+ for (var e, t = [], r = /[+-]?(?:\d+\.?\d*|\.\d+)(?:[eE][+-]?\d+)?/g; e = r.exec(i); ) t.push(parseFloat(e[0]));
1068
+ return t;
1069
+ }
1070
+ function K(i, e) {
1071
+ if (i === "transparent") {
1072
+ var t = new O("rgb(0,0,0)");
1073
+ return t.a = 0, t;
1074
+ }
1075
+ if (e && i.toLowerCase() === "currentcolor") return e.color || new O("rgb(0,0,0)");
1076
+ if (e && i.toLowerCase() === "context-stroke") return e.contextStroke || new O("rgb(0,0,0)");
1077
+ if (e && i.toLowerCase() === "context-fill") return e.contextFill || new O("rgb(0,0,0)");
1078
+ var r = /\s*rgba\(((?:[^,)]*,){3}[^,)]*)\)\s*/.exec(i);
1079
+ if (r) {
1080
+ var n = L(r[1]), s = new O("rgb(" + n.slice(0, 3).join(",") + ")");
1081
+ return s.a = n[3], s;
1082
+ }
1083
+ return new O(i);
1084
+ }
1085
+ var V = { "sans-serif": "helvetica", verdana: "helvetica", arial: "helvetica", fixed: "courier", monospace: "courier", terminal: "courier", serif: "times", cursive: "times", fantasy: "times" }, wt, He = (wt = te.version.split("."), parseFloat(wt[0]) === 2 && parseFloat(wt[1]) === 3);
1086
+ function ae(i, e) {
1087
+ return He ? e == 400 ? i == "italic" ? "italic" : "normal" : e == 700 && i !== "italic" ? "bold" : i + "" + e : e == 400 || e === "normal" ? i === "italic" ? "italic" : "normal" : e != 700 && e !== "bold" || i !== "normal" ? (e == 700 ? "bold" : e) + "" + i : "bold";
1088
+ }
1089
+ function Et(i, e) {
1090
+ if (b(e.element, i.styleSheets, "display") === "none") return [0, 0, 0, 0];
1091
+ var t = [];
1092
+ return e.children.forEach((function(r) {
1093
+ var n = r.getBoundingBox(i);
1094
+ if (n[0] !== 0 || n[1] !== 0 || n[2] !== 0 || n[3] !== 0) {
1095
+ var s = r.computeNodeTransform(i);
1096
+ n[0] = n[0] * s.sx + s.tx, n[1] = n[1] * s.sy + s.ty, n[2] = n[2] * s.sx, n[3] = n[3] * s.sy, t = t.length === 0 ? n : [Math.min(t[0], n[0]), Math.min(t[1], n[1]), Math.max(t[0] + t[2], n[0] + n[2]) - Math.min(t[0], n[0]), Math.max(t[1] + t[3], n[1] + n[3]) - Math.min(t[1], n[1])];
1097
+ }
1098
+ })), t.length === 0 ? [0, 0, 0, 0] : t;
1099
+ }
1100
+ function et(i, e) {
1101
+ var t = parseFloat, r = t(i.getAttribute("x1")) || t(b(i, e.styleSheets, "x")) || t(b(i, e.styleSheets, "cx")) - t(b(i, e.styleSheets, "r")) || 0, n = t(i.getAttribute("x2")) || r + t(b(i, e.styleSheets, "width")) || t(b(i, e.styleSheets, "cx")) + t(b(i, e.styleSheets, "r")) || 0, s = t(i.getAttribute("y1")) || t(b(i, e.styleSheets, "y")) || t(b(i, e.styleSheets, "cy")) - t(b(i, e.styleSheets, "r")) || 0, a = t(i.getAttribute("y2")) || s + t(b(i, e.styleSheets, "height")) || t(b(i, e.styleSheets, "cy")) + t(b(i, e.styleSheets, "r")) || 0;
1102
+ return [Math.min(r, n), Math.min(s, a), Math.max(r, n) - Math.min(r, n), Math.max(s, a) - Math.min(s, a)];
1103
+ }
1104
+ function rt(i, e, t, r, n, s, a, o) {
1105
+ o === void 0 && (o = !1);
1106
+ var l, u, f = e[0], c = e[1], p = e[2], h = e[3], g = n / p, d = s / h, m = i.getAttribute("preserveAspectRatio");
1107
+ if (m) {
1108
+ var x = m.split(" ");
1109
+ x[0] === "defer" && (x = x.slice(1)), l = x[0], u = x[1] || "meet";
1110
+ } else l = "xMidYMid", u = "meet";
1111
+ if (l !== "none" && (u === "meet" ? g = d = Math.min(g, d) : u === "slice" && (g = d = Math.max(g, d))), o) return a.pdf.Matrix(g, 0, 0, d, 0, 0);
1112
+ var v = t - f * g, S = r - c * d;
1113
+ l.indexOf("xMid") >= 0 ? v += (n - p * g) / 2 : l.indexOf("xMax") >= 0 && (v += n - p * g), l.indexOf("YMid") >= 0 ? S += (s - h * d) / 2 : l.indexOf("YMax") >= 0 && (S += s - h * d);
1114
+ var w = a.pdf.Matrix(1, 0, 0, 1, v, S), y = a.pdf.Matrix(g, 0, 0, d, 0, 0);
1115
+ return a.pdf.matrixMult(y, w);
1116
+ }
1117
+ function lt(i, e) {
1118
+ if (!i || i === "none") return e.pdf.unitMatrix;
1119
+ for (var t, r, n = /^[\s,]*matrix\(([^)]+)\)\s*/, s = /^[\s,]*translate\(([^)]+)\)\s*/, a = /^[\s,]*rotate\(([^)]+)\)\s*/, o = /^[\s,]*scale\(([^)]+)\)\s*/, l = /^[\s,]*skewX\(([^)]+)\)\s*/, u = /^[\s,]*skewY\(([^)]+)\)\s*/, f = e.pdf.unitMatrix; i.length > 0 && i.length !== r; ) {
1120
+ r = i.length;
1121
+ var c = n.exec(i);
1122
+ if (c && (t = L(c[1]), f = e.pdf.matrixMult(e.pdf.Matrix(t[0], t[1], t[2], t[3], t[4], t[5]), f), i = i.substr(c[0].length)), c = a.exec(i)) {
1123
+ t = L(c[1]);
1124
+ var p = Math.PI * t[0] / 180;
1125
+ if (f = e.pdf.matrixMult(e.pdf.Matrix(Math.cos(p), Math.sin(p), -Math.sin(p), Math.cos(p), 0, 0), f), t[1] || t[2]) {
1126
+ var h = e.pdf.Matrix(1, 0, 0, 1, t[1], t[2]), g = e.pdf.Matrix(1, 0, 0, 1, -t[1], -t[2]);
1127
+ f = e.pdf.matrixMult(g, e.pdf.matrixMult(f, h));
1128
+ }
1129
+ i = i.substr(c[0].length);
1130
+ }
1131
+ (c = s.exec(i)) && (t = L(c[1]), f = e.pdf.matrixMult(e.pdf.Matrix(1, 0, 0, 1, t[0], t[1] || 0), f), i = i.substr(c[0].length)), (c = o.exec(i)) && ((t = L(c[1]))[1] || (t[1] = t[0]), f = e.pdf.matrixMult(e.pdf.Matrix(t[0], 0, 0, t[1], 0, 0), f), i = i.substr(c[0].length)), (c = l.exec(i)) && (t = parseFloat(c[1]), t *= Math.PI / 180, f = e.pdf.matrixMult(e.pdf.Matrix(1, 0, Math.tan(t), 1, 0, 0), f), i = i.substr(c[0].length)), (c = u.exec(i)) && (t = parseFloat(c[1]), t *= Math.PI / 180, f = e.pdf.matrixMult(e.pdf.Matrix(1, Math.tan(t), 0, 1, 0, 0), f), i = i.substr(c[0].length));
1132
+ }
1133
+ return f;
1134
+ }
1135
+ var Bt = (function() {
1136
+ function i(e, t) {
1137
+ this.element = e, this.children = t, this.parent = null;
1138
+ }
1139
+ return i.prototype.setParent = function(e) {
1140
+ this.parent = e;
1141
+ }, i.prototype.getParent = function() {
1142
+ return this.parent;
1143
+ }, i.prototype.getBoundingBox = function(e) {
1144
+ return b(this.element, e.styleSheets, "display") === "none" ? [0, 0, 0, 0] : this.getBoundingBoxCore(e);
1145
+ }, i.prototype.computeNodeTransform = function(e) {
1146
+ var t = this.computeNodeTransformCore(e), r = b(this.element, e.styleSheets, "transform");
1147
+ return r ? e.pdf.matrixMult(t, lt(r, e)) : t;
1148
+ }, i;
1149
+ })(), it = (function(i) {
1150
+ function e() {
1151
+ return i !== null && i.apply(this, arguments) || this;
1152
+ }
1153
+ return M(e, i), e.prototype.render = function(t) {
1154
+ return Promise.resolve();
1155
+ }, e.prototype.getBoundingBoxCore = function(t) {
1156
+ return [];
1157
+ }, e.prototype.computeNodeTransformCore = function(t) {
1158
+ return t.pdf.unitMatrix;
1159
+ }, e;
1160
+ })(Bt), se = (function(i) {
1161
+ function e(t, r, n) {
1162
+ var s = i.call(this, r, n) || this;
1163
+ return s.pdfGradientType = t, s.contextColor = void 0, s;
1164
+ }
1165
+ return M(e, i), e.prototype.apply = function(t) {
1166
+ return C(this, void 0, void 0, (function() {
1167
+ var r, n, s, a, o, l;
1168
+ return F(this, (function(u) {
1169
+ return (r = this.element.getAttribute("id")) ? (n = this.getStops(t.styleSheets), s = 0, a = !1, n.forEach((function(f) {
1170
+ var c = f.opacity;
1171
+ c && c !== 1 && (s += c, a = !0);
1172
+ })), a && (o = new Tt({ opacity: s / n.length })), l = new ke(this.pdfGradientType, this.getCoordinates(), n, o), t.pdf.addShadingPattern(r, l), [2]) : [2];
1173
+ }));
1174
+ }));
1175
+ }, e.prototype.getStops = function(t) {
1176
+ var r = this;
1177
+ if (this.stops) return this.stops;
1178
+ if (this.contextColor === void 0) {
1179
+ this.contextColor = null;
1180
+ for (var n = this; n; ) {
1181
+ var s = b(n.element, t, "color");
1182
+ if (s) {
1183
+ this.contextColor = K(s, null);
1184
+ break;
1185
+ }
1186
+ n = n.getParent();
1187
+ }
1188
+ }
1189
+ var a = [];
1190
+ return this.children.forEach((function(o) {
1191
+ if (o.element.tagName.toLowerCase() === "stop") {
1192
+ var l = b(o.element, t, "color"), u = K(b(o.element, t, "stop-color") || "", l ? { color: K(l, null) } : { color: r.contextColor }), f = parseFloat(b(o.element, t, "stop-opacity") || "1");
1193
+ a.push({ offset: e.parseGradientOffset(o.element.getAttribute("offset") || "0"), color: [u.r, u.g, u.b], opacity: f });
1194
+ }
1195
+ })), this.stops = a;
1196
+ }, e.prototype.getBoundingBoxCore = function(t) {
1197
+ return et(this.element, t);
1198
+ }, e.prototype.computeNodeTransformCore = function(t) {
1199
+ return t.pdf.unitMatrix;
1200
+ }, e.prototype.isVisible = function(t, r) {
1201
+ return X(this, t, r);
1202
+ }, e.parseGradientOffset = function(t) {
1203
+ var r = parseFloat(t);
1204
+ return !isNaN(r) && t.indexOf("%") >= 0 ? r / 100 : r;
1205
+ }, e;
1206
+ })(it), oe = (function(i) {
1207
+ function e(t, r) {
1208
+ return i.call(this, "axial", t, r) || this;
1209
+ }
1210
+ return M(e, i), e.prototype.getCoordinates = function() {
1211
+ return [parseFloat(this.element.getAttribute("x1") || "0"), parseFloat(this.element.getAttribute("y1") || "0"), parseFloat(this.element.getAttribute("x2") || "1"), parseFloat(this.element.getAttribute("y2") || "0")];
1212
+ }, e;
1213
+ })(se), le = (function(i) {
1214
+ function e(t, r) {
1215
+ return i.call(this, "radial", t, r) || this;
1216
+ }
1217
+ return M(e, i), e.prototype.getCoordinates = function() {
1218
+ var t = this.element.getAttribute("cx"), r = this.element.getAttribute("cy"), n = this.element.getAttribute("fx"), s = this.element.getAttribute("fy");
1219
+ return [parseFloat(n || t || "0.5"), parseFloat(s || r || "0.5"), 0, parseFloat(t || "0.5"), parseFloat(r || "0.5"), parseFloat(this.element.getAttribute("r") || "0.5")];
1220
+ }, e;
1221
+ })(se), Ve = (function() {
1222
+ function i(e, t) {
1223
+ this.key = e, this.gradient = t;
1224
+ }
1225
+ return i.prototype.getFillData = function(e, t) {
1226
+ return C(this, void 0, void 0, (function() {
1227
+ var r, n, s;
1228
+ return F(this, (function(a) {
1229
+ switch (a.label) {
1230
+ case 0:
1231
+ return [4, t.refsHandler.getRendered(this.key, null, (function(o) {
1232
+ return o.apply(new Y(t.pdf, { refsHandler: t.refsHandler, textMeasure: t.textMeasure, styleSheets: t.styleSheets, viewport: t.viewport, svg2pdfParameters: t.svg2pdfParameters }));
1233
+ }))];
1234
+ case 1:
1235
+ return a.sent(), this.gradient.element.hasAttribute("gradientUnits") && this.gradient.element.getAttribute("gradientUnits").toLowerCase() !== "objectboundingbox" ? r = t.pdf.unitMatrix : (n = e.getBoundingBox(t), r = t.pdf.Matrix(n[2], 0, 0, n[3], n[0], n[1])), s = lt(b(this.gradient.element, t.styleSheets, "gradientTransform", "transform"), t), [2, { key: this.key, matrix: t.pdf.matrixMult(s, r) }];
1236
+ }
1237
+ }));
1238
+ }));
1239
+ }, i;
1240
+ })(), ue = (function(i) {
1241
+ function e() {
1242
+ return i !== null && i.apply(this, arguments) || this;
1243
+ }
1244
+ return M(e, i), e.prototype.apply = function(t) {
1245
+ return C(this, void 0, void 0, (function() {
1246
+ var r, n, s, a, o;
1247
+ return F(this, (function(l) {
1248
+ switch (l.label) {
1249
+ case 0:
1250
+ if (!(r = this.element.getAttribute("id"))) return [2];
1251
+ n = this.getBoundingBox(t), s = new we([n[0], n[1], n[0] + n[2], n[1] + n[3]], n[2], n[3]), t.pdf.beginTilingPattern(s), a = 0, o = this.children, l.label = 1;
1252
+ case 1:
1253
+ return a < o.length ? [4, o[a].render(new Y(t.pdf, { attributeState: t.attributeState, refsHandler: t.refsHandler, styleSheets: t.styleSheets, viewport: t.viewport, svg2pdfParameters: t.svg2pdfParameters, textMeasure: t.textMeasure }))] : [3, 4];
1254
+ case 2:
1255
+ l.sent(), l.label = 3;
1256
+ case 3:
1257
+ return a++, [3, 1];
1258
+ case 4:
1259
+ return t.pdf.endTilingPattern(r, s), [2];
1260
+ }
1261
+ }));
1262
+ }));
1263
+ }, e.prototype.getBoundingBoxCore = function(t) {
1264
+ return et(this.element, t);
1265
+ }, e.prototype.computeNodeTransformCore = function(t) {
1266
+ return t.pdf.unitMatrix;
1267
+ }, e.prototype.isVisible = function(t, r) {
1268
+ return X(this, t, r);
1269
+ }, e;
1270
+ })(it), je = (function() {
1271
+ function i(e, t) {
1272
+ this.key = e, this.pattern = t;
1273
+ }
1274
+ return i.prototype.getFillData = function(e, t) {
1275
+ return C(this, void 0, void 0, (function() {
1276
+ var r, n, s, a, o, l, u, f, c, p, h, g;
1277
+ return F(this, (function(d) {
1278
+ switch (d.label) {
1279
+ case 0:
1280
+ return [4, t.refsHandler.getRendered(this.key, null, (function(m) {
1281
+ return m.apply(new Y(t.pdf, { refsHandler: t.refsHandler, textMeasure: t.textMeasure, styleSheets: t.styleSheets, viewport: t.viewport, svg2pdfParameters: t.svg2pdfParameters }));
1282
+ }))];
1283
+ case 1:
1284
+ return d.sent(), r = { key: this.key, boundingBox: void 0, xStep: 0, yStep: 0, matrix: void 0 }, s = t.pdf.unitMatrix, this.pattern.element.hasAttribute("patternUnits") && this.pattern.element.getAttribute("patternUnits").toLowerCase() !== "objectboundingbox" || (n = e.getBoundingBox(t), s = t.pdf.Matrix(1, 0, 0, 1, n[0], n[1]), o = this.pattern.getBoundingBox(t), l = o[0] * n[0] || 0, u = o[1] * n[1] || 0, f = o[2] * n[2] || 0, c = o[3] * n[3] || 0, r.boundingBox = [l, u, l + f, u + c], r.xStep = f, r.yStep = c), a = t.pdf.unitMatrix, this.pattern.element.hasAttribute("patternContentUnits") && this.pattern.element.getAttribute("patternContentUnits").toLowerCase() === "objectboundingbox" && (n || (n = e.getBoundingBox(t)), a = t.pdf.Matrix(n[2], 0, 0, n[3], 0, 0), o = r.boundingBox || this.pattern.getBoundingBox(t), l = o[0] / n[0] || 0, u = o[1] / n[1] || 0, f = o[2] / n[2] || 0, c = o[3] / n[3] || 0, r.boundingBox = [l, u, l + f, u + c], r.xStep = f, r.yStep = c), p = t.pdf.unitMatrix, (h = b(this.pattern.element, t.styleSheets, "patternTransform", "transform")) && (p = lt(h, t)), g = a, g = t.pdf.matrixMult(g, s), g = t.pdf.matrixMult(g, p), g = t.pdf.matrixMult(g, t.transform), r.matrix = g, [2, r];
1285
+ }
1286
+ }));
1287
+ }));
1288
+ }, i;
1289
+ })();
1290
+ function We(i, e) {
1291
+ var t = Pt.exec(i);
1292
+ if (t) {
1293
+ var r = t[1], n = e.refsHandler.get(r);
1294
+ return n && (n instanceof oe || n instanceof le) ? (function(a, o, l) {
1295
+ var u = o.getStops(l.styleSheets);
1296
+ if (u.length === 0) return null;
1297
+ if (u.length === 1) {
1298
+ var f = u[0].color, c = new O();
1299
+ return c.ok = !0, c.r = f[0], c.g = f[1], c.b = f[2], c.a = u[0].opacity, new I(c);
1300
+ }
1301
+ return new Ve(a, o);
1302
+ })(r, n, e) : n && n instanceof ue ? new je(r, n) : new I(new O("rgb(0, 0, 0)"));
1303
+ }
1304
+ var s = K(i, e.attributeState);
1305
+ return s.ok ? new I(s) : null;
1306
+ }
1307
+ function It(i, e, t) {
1308
+ var r = t || e.element, n = b(r, i.styleSheets, "color");
1309
+ if (n) {
1310
+ var s = K(n, i.attributeState);
1311
+ s.ok ? i.attributeState.color = s : i.attributeState.color = new O("rgb(0,0,0)");
1312
+ }
1313
+ var a = b(r, i.styleSheets, "visibility");
1314
+ a && (i.attributeState.visibility = a);
1315
+ var o = b(r, i.styleSheets, "fill");
1316
+ o && (i.attributeState.fill = We(o, i));
1317
+ var l = b(r, i.styleSheets, "fill-opacity");
1318
+ l && (i.attributeState.fillOpacity = parseFloat(l));
1319
+ var u = b(r, i.styleSheets, "stroke-opacity");
1320
+ u && (i.attributeState.strokeOpacity = parseFloat(u));
1321
+ var f = b(r, i.styleSheets, "opacity");
1322
+ f && (i.attributeState.opacity = parseFloat(f));
1323
+ var c = b(r, i.styleSheets, "stroke-width");
1324
+ c !== void 0 && c !== "" && (i.attributeState.strokeWidth = Math.abs(parseFloat(c)));
1325
+ var p = b(r, i.styleSheets, "stroke");
1326
+ if (p) if (p === "none") i.attributeState.stroke = null;
1327
+ else {
1328
+ var h = K(p, i.attributeState);
1329
+ h.ok && (i.attributeState.stroke = new I(h));
1330
+ }
1331
+ p && i.attributeState.stroke instanceof I && (i.attributeState.contextStroke = i.attributeState.stroke.color), o && i.attributeState.fill instanceof I && (i.attributeState.contextFill = i.attributeState.fill.color);
1332
+ var g = b(r, i.styleSheets, "stroke-linecap");
1333
+ g && (i.attributeState.strokeLinecap = g);
1334
+ var d = b(r, i.styleSheets, "stroke-linejoin");
1335
+ d && (i.attributeState.strokeLinejoin = d);
1336
+ var m = b(r, i.styleSheets, "stroke-dasharray");
1337
+ if (m) {
1338
+ var x = parseInt(b(r, i.styleSheets, "stroke-dashoffset") || "0");
1339
+ i.attributeState.strokeDasharray = L(m), i.attributeState.strokeDashoffset = x;
1340
+ }
1341
+ var v = b(r, i.styleSheets, "stroke-miterlimit");
1342
+ v !== void 0 && v !== "" && (i.attributeState.strokeMiterlimit = parseFloat(v));
1343
+ var S = r.getAttribute("xml:space");
1344
+ S && (i.attributeState.xmlSpace = S);
1345
+ var w = b(r, i.styleSheets, "white-space");
1346
+ w && (i.attributeState.whiteSpace = w);
1347
+ var y = b(r, i.styleSheets, "font-weight");
1348
+ y && (i.attributeState.fontWeight = y);
1349
+ var k = b(r, i.styleSheets, "font-style");
1350
+ k && (i.attributeState.fontStyle = k);
1351
+ var B = b(r, i.styleSheets, "font-family");
1352
+ if (B) {
1353
+ var _ = Te.parse(B);
1354
+ i.attributeState.fontFamily = (function(W, ft, be) {
1355
+ var ye = ae(W.fontStyle, W.fontWeight), Se = be.pdf.getFontList(), at = "";
1356
+ return ft.some((function($) {
1357
+ var _t = Se[$];
1358
+ return _t && _t.indexOf(ye) >= 0 ? (at = $, !0) : ($ = $.toLowerCase(), !!V.hasOwnProperty($) && (at = $, !0));
1359
+ })) || (at = "times"), at;
1360
+ })(i.attributeState, _, i);
1361
+ }
1362
+ var P = b(r, i.styleSheets, "font-size");
1363
+ if (P) {
1364
+ var T = i.pdf.getFontSize();
1365
+ i.attributeState.fontSize = H(P, T);
1366
+ }
1367
+ var D = b(r, i.styleSheets, "vertical-align") || b(r, i.styleSheets, "alignment-baseline");
1368
+ if (D) {
1369
+ var A = D.match(/(baseline|text-bottom|alphabetic|ideographic|middle|central|mathematical|text-top|bottom|center|top|hanging)/);
1370
+ A && (i.attributeState.alignmentBaseline = A[0]);
1371
+ }
1372
+ var R = b(r, i.styleSheets, "text-anchor");
1373
+ R && (i.attributeState.textAnchor = R);
1374
+ var N = b(r, i.styleSheets, "fill-rule");
1375
+ N && (i.attributeState.fillRule = N);
1376
+ }
1377
+ function Nt(i, e, t) {
1378
+ var r = 1, n = 1;
1379
+ r *= i.attributeState.fillOpacity, r *= i.attributeState.opacity, i.attributeState.fill instanceof I && i.attributeState.fill.color.a !== void 0 && (r *= i.attributeState.fill.color.a), n *= i.attributeState.strokeOpacity, n *= i.attributeState.opacity, i.attributeState.stroke instanceof I && i.attributeState.stroke.color.a !== void 0 && (n *= i.attributeState.stroke.color.a);
1380
+ var s, a, o = r < 1, l = n < 1;
1381
+ if (z(t, "use") ? (o = !0, l = !0, r *= i.attributeState.fill ? 1 : 0, n *= i.attributeState.stroke ? 1 : 0) : i.withinUse && (i.attributeState.fill !== e.attributeState.fill ? (o = !0, r *= i.attributeState.fill ? 1 : 0) : o && !i.attributeState.fill && (r = 0), i.attributeState.stroke !== e.attributeState.stroke ? (l = !0, n *= i.attributeState.stroke ? 1 : 0) : l && !i.attributeState.stroke && (n = 0)), o || l) {
1382
+ var u = {};
1383
+ o && (u.opacity = r), l && (u["stroke-opacity"] = n), i.pdf.setGState(new Tt(u));
1384
+ }
1385
+ if (i.attributeState.fill && i.attributeState.fill !== e.attributeState.fill && i.attributeState.fill instanceof I && i.attributeState.fill.color.ok && !z(t, "text") && i.pdf.setFillColor(i.attributeState.fill.color.r, i.attributeState.fill.color.g, i.attributeState.fill.color.b), i.attributeState.strokeWidth !== e.attributeState.strokeWidth && i.pdf.setLineWidth(i.attributeState.strokeWidth), i.attributeState.stroke !== e.attributeState.stroke && i.attributeState.stroke instanceof I && i.pdf.setDrawColor(i.attributeState.stroke.color.r, i.attributeState.stroke.color.g, i.attributeState.stroke.color.b), i.attributeState.strokeLinecap !== e.attributeState.strokeLinecap && i.pdf.setLineCap(i.attributeState.strokeLinecap), i.attributeState.strokeLinejoin !== e.attributeState.strokeLinejoin && i.pdf.setLineJoin(i.attributeState.strokeLinejoin), i.attributeState.strokeDasharray === e.attributeState.strokeDasharray && i.attributeState.strokeDashoffset === e.attributeState.strokeDashoffset || !i.attributeState.strokeDasharray || i.pdf.setLineDashPattern(i.attributeState.strokeDasharray, i.attributeState.strokeDashoffset), i.attributeState.strokeMiterlimit !== e.attributeState.strokeMiterlimit && i.pdf.setLineMiterLimit(i.attributeState.strokeMiterlimit), i.attributeState.fontFamily !== e.attributeState.fontFamily && (s = V.hasOwnProperty(i.attributeState.fontFamily) ? V[i.attributeState.fontFamily] : i.attributeState.fontFamily), i.attributeState.fill && i.attributeState.fill !== e.attributeState.fill && i.attributeState.fill instanceof I && i.attributeState.fill.color.ok) {
1386
+ var f = i.attributeState.fill.color;
1387
+ i.pdf.setTextColor(f.r, f.g, f.b);
1388
+ }
1389
+ i.attributeState.fontWeight === e.attributeState.fontWeight && i.attributeState.fontStyle === e.attributeState.fontStyle || (a = ae(i.attributeState.fontStyle, i.attributeState.fontWeight)), s === void 0 && a === void 0 || (s === void 0 && (s = V.hasOwnProperty(i.attributeState.fontFamily) ? V[i.attributeState.fontFamily] : i.attributeState.fontFamily), i.pdf.setFont(s, a)), i.attributeState.fontSize !== e.attributeState.fontSize && i.pdf.setFontSize(i.attributeState.fontSize * i.pdf.internal.scaleFactor);
1390
+ }
1391
+ function he(i, e, t) {
1392
+ var r = Pt.exec(i);
1393
+ if (r) {
1394
+ var n = r[1];
1395
+ return t.refsHandler.get(n) || void 0;
1396
+ }
1397
+ }
1398
+ function fe(i, e, t) {
1399
+ return C(this, void 0, void 0, (function() {
1400
+ var r, n;
1401
+ return F(this, (function(s) {
1402
+ switch (s.label) {
1403
+ case 0:
1404
+ return r = t.clone(), e.element.hasAttribute("clipPathUnits") && e.element.getAttribute("clipPathUnits").toLowerCase() === "objectboundingbox" && (n = i.getBoundingBox(t), r.transform = t.pdf.matrixMult(t.pdf.Matrix(n[2], 0, 0, n[3], n[0], n[1]), t.transform)), [4, e.apply(r)];
1405
+ case 1:
1406
+ return s.sent(), [2];
1407
+ }
1408
+ }));
1409
+ }));
1410
+ }
1411
+ var ce = (function(i) {
1412
+ function e() {
1413
+ return i !== null && i.apply(this, arguments) || this;
1414
+ }
1415
+ return M(e, i), e.prototype.render = function(t) {
1416
+ return C(this, void 0, void 0, (function() {
1417
+ var r, n, s, a;
1418
+ return F(this, (function(o) {
1419
+ switch (o.label) {
1420
+ case 0:
1421
+ return this.isVisible(t.attributeState.visibility !== "hidden", t) ? ((r = t.clone()).transform = r.pdf.matrixMult(this.computeNodeTransform(r), t.transform), It(r, this), n = b(this.element, r.styleSheets, "clip-path"), (s = n && n !== "none") ? (a = he(n, 0, r)) ? a.isVisible(!0, r) ? (r.pdf.saveGraphicsState(), [4, fe(this, a, r)]) : [3, 2] : [3, 4] : [3, 5]) : [2];
1422
+ case 1:
1423
+ return o.sent(), [3, 3];
1424
+ case 2:
1425
+ return [2];
1426
+ case 3:
1427
+ return [3, 5];
1428
+ case 4:
1429
+ s = !1, o.label = 5;
1430
+ case 5:
1431
+ return r.withinClipPath || r.pdf.saveGraphicsState(), Nt(r, t, this.element), [4, this.renderCore(r)];
1432
+ case 6:
1433
+ return o.sent(), r.withinClipPath || r.pdf.restoreGraphicsState(), s && r.pdf.restoreGraphicsState(), [2];
1434
+ }
1435
+ }));
1436
+ }));
1437
+ }, e;
1438
+ })(Bt), ut = (function(i) {
1439
+ function e() {
1440
+ return i !== null && i.apply(this, arguments) || this;
1441
+ }
1442
+ return M(e, i), e;
1443
+ })(ce), nt = (function(i) {
1444
+ function e(t, r, n) {
1445
+ var s = i.call(this, r, n) || this;
1446
+ return s.cachedPath = null, s.hasMarkers = t, s;
1447
+ }
1448
+ return M(e, i), e.prototype.renderCore = function(t) {
1449
+ return C(this, void 0, void 0, (function() {
1450
+ var r;
1451
+ return F(this, (function(n) {
1452
+ switch (n.label) {
1453
+ case 0:
1454
+ return (r = this.getCachedPath(t)) === null || r.segments.length === 0 ? [2] : (t.withinClipPath ? r.transform(t.transform) : t.pdf.setCurrentTransformationMatrix(t.transform), r.draw(t), [4, this.fillOrStroke(t)]);
1455
+ case 1:
1456
+ return n.sent(), this.hasMarkers ? [4, this.drawMarkers(t, r)] : [3, 3];
1457
+ case 2:
1458
+ n.sent(), n.label = 3;
1459
+ case 3:
1460
+ return [2];
1461
+ }
1462
+ }));
1463
+ }));
1464
+ }, e.prototype.getCachedPath = function(t) {
1465
+ return this.cachedPath || (this.cachedPath = this.getPath(t));
1466
+ }, e.prototype.drawMarkers = function(t, r) {
1467
+ return C(this, void 0, void 0, (function() {
1468
+ return F(this, (function(n) {
1469
+ switch (n.label) {
1470
+ case 0:
1471
+ return [4, this.getMarkers(r, t).draw(t.clone({ transform: t.pdf.unitMatrix }))];
1472
+ case 1:
1473
+ return n.sent(), [2];
1474
+ }
1475
+ }));
1476
+ }));
1477
+ }, e.prototype.fillOrStroke = function(t) {
1478
+ return C(this, void 0, void 0, (function() {
1479
+ var r, n, s, a, o;
1480
+ return F(this, (function(l) {
1481
+ switch (l.label) {
1482
+ case 0:
1483
+ return t.withinClipPath ? [2] : (r = t.attributeState.fill, n = t.attributeState.stroke && t.attributeState.strokeWidth !== 0, r ? [4, r.getFillData(this, t)] : [3, 2]);
1484
+ case 1:
1485
+ return a = l.sent(), [3, 3];
1486
+ case 2:
1487
+ a = void 0, l.label = 3;
1488
+ case 3:
1489
+ return s = a, o = t.attributeState.fillRule === "evenodd", r && n || t.withinUse ? o ? t.pdf.fillStrokeEvenOdd(s) : t.pdf.fillStroke(s) : r ? o ? t.pdf.fillEvenOdd(s) : t.pdf.fill(s) : n ? t.pdf.stroke() : t.pdf.discardPath(), [2];
1490
+ }
1491
+ }));
1492
+ }));
1493
+ }, e.prototype.getBoundingBoxCore = function(t) {
1494
+ var r = this.getCachedPath(t);
1495
+ if (!r || !r.segments.length) return [0, 0, 0, 0];
1496
+ for (var n = Number.POSITIVE_INFINITY, s = Number.POSITIVE_INFINITY, a = Number.NEGATIVE_INFINITY, o = Number.NEGATIVE_INFINITY, l = 0, u = 0, f = 0; f < r.segments.length; f++) {
1497
+ var c = r.segments[f];
1498
+ (c instanceof E || c instanceof U || c instanceof q) && (l = c.x, u = c.y), c instanceof q ? (n = Math.min(n, l, c.x1, c.x2, c.x), a = Math.max(a, l, c.x1, c.x2, c.x), s = Math.min(s, u, c.y1, c.y2, c.y), o = Math.max(o, u, c.y1, c.y2, c.y)) : (n = Math.min(n, l), a = Math.max(a, l), s = Math.min(s, u), o = Math.max(o, u));
1499
+ }
1500
+ return [n, s, a - n, o - s];
1501
+ }, e.prototype.getMarkers = function(t, r) {
1502
+ var n = b(this.element, r.styleSheets, "marker-start"), s = b(this.element, r.styleSheets, "marker-mid"), a = b(this.element, r.styleSheets, "marker-end"), o = new qe();
1503
+ if (n || s || a) {
1504
+ a && (a = kt(a)), n && (n = kt(n)), s && (s = kt(s));
1505
+ for (var l = t.segments, u = [1, 0], f = void 0, c = !1, p = [1, 0], h = !1, g = function(m) {
1506
+ var x = l[m], v = n && (m === 1 || !(l[m] instanceof E) && l[m - 1] instanceof E);
1507
+ v && l.forEach((function(_, P) {
1508
+ if (!h && _ instanceof Ft && P > m) {
1509
+ var T = l[P - 1];
1510
+ h = (T instanceof E || T instanceof U || T instanceof q) && T;
1511
+ }
1512
+ }));
1513
+ var S = a && (m === l.length - 1 || !(l[m] instanceof E) && l[m + 1] instanceof E), w = s && m > 0 && !(m === 1 && l[m - 1] instanceof E), y = l[m - 1] || null;
1514
+ if (y instanceof E || y instanceof U || y instanceof q)
1515
+ if (x instanceof q) v && o.addMarker(new G(n, [y.x, y.y], zt(h ? [h.x, h.y] : [y.x, y.y], [x.x1, x.y1]), !0)), S && o.addMarker(new G(a, [x.x, x.y], zt([x.x2, x.y2], [x.x, x.y]))), w && (f = Q([y.x, y.y], [x.x1, x.y1]), f = y instanceof E ? f : tt(st(u, f)), o.addMarker(new G(s, [y.x, y.y], Math.atan2(f[1], f[0])))), u = Q([x.x2, x.y2], [x.x, x.y]);
1516
+ else if (x instanceof E || x instanceof U) {
1517
+ if (f = Q([y.x, y.y], [x.x, x.y]), v) {
1518
+ var k = h ? Q([h.x, h.y], [x.x, x.y]) : f;
1519
+ o.addMarker(new G(n, [y.x, y.y], Math.atan2(k[1], k[0]), !0));
1520
+ }
1521
+ S && o.addMarker(new G(a, [x.x, x.y], Math.atan2(f[1], f[0]))), w && (k = x instanceof E ? u : y instanceof E ? f : tt(st(u, f)), o.addMarker(new G(s, [y.x, y.y], Math.atan2(k[1], k[0])))), u = f;
1522
+ } else x instanceof Ft && (f = Q([y.x, y.y], [c.x, c.y]), w && (k = y instanceof E ? f : tt(st(u, f)), o.addMarker(new G(s, [y.x, y.y], Math.atan2(k[1], k[0])))), S && (k = tt(st(f, p)), o.addMarker(new G(a, [c.x, c.y], Math.atan2(k[1], k[0])))), u = f);
1523
+ else {
1524
+ c = x instanceof E && x;
1525
+ var B = l[m + 1];
1526
+ (B instanceof E || B instanceof U || B instanceof q) && (p = Q([c.x, c.y], [B.x, B.y]));
1527
+ }
1528
+ }, d = 0; d < l.length; d++) g(d);
1529
+ }
1530
+ return o.markers.forEach((function(m) {
1531
+ var x = r.refsHandler.get(m.id);
1532
+ if (x) {
1533
+ var v = b(x.element, r.styleSheets, "orient");
1534
+ v != null && (m.isStartMarker && v === "auto-start-reverse" && (m.angle += Math.PI), isNaN(Number(v)) || (m.angle = parseFloat(v) / 180 * Math.PI));
1535
+ }
1536
+ })), o;
1537
+ }, e;
1538
+ })(ut);
1539
+ function kt(i) {
1540
+ var e = Pt.exec(i);
1541
+ return e && e[1] || void 0;
1542
+ }
1543
+ var Ge = (function(i) {
1544
+ function e(t, r) {
1545
+ return i.call(this, !0, t, r) || this;
1546
+ }
1547
+ return M(e, i), e.prototype.getPath = function(t) {
1548
+ if (t.withinClipPath || t.attributeState.stroke === null) return null;
1549
+ var r = parseFloat(this.element.getAttribute("x1") || "0"), n = parseFloat(this.element.getAttribute("y1") || "0"), s = parseFloat(this.element.getAttribute("x2") || "0"), a = parseFloat(this.element.getAttribute("y2") || "0");
1550
+ return r || s || n || a ? new Z().moveTo(r, n).lineTo(s, a) : null;
1551
+ }, e.prototype.computeNodeTransformCore = function(t) {
1552
+ return t.pdf.unitMatrix;
1553
+ }, e.prototype.isVisible = function(t, r) {
1554
+ return j(this, t, r);
1555
+ }, e.prototype.fillOrStroke = function(t) {
1556
+ return C(this, void 0, void 0, (function() {
1557
+ return F(this, (function(r) {
1558
+ switch (r.label) {
1559
+ case 0:
1560
+ return t.attributeState.fill = null, [4, i.prototype.fillOrStroke.call(this, t)];
1561
+ case 1:
1562
+ return r.sent(), [2];
1563
+ }
1564
+ }));
1565
+ }));
1566
+ }, e;
1567
+ })(nt), pe = (function(i) {
1568
+ function e() {
1569
+ return i !== null && i.apply(this, arguments) || this;
1570
+ }
1571
+ return M(e, i), e.prototype.apply = function(t) {
1572
+ return C(this, void 0, void 0, (function() {
1573
+ var r, n, s, a, o;
1574
+ return F(this, (function(l) {
1575
+ switch (l.label) {
1576
+ case 0:
1577
+ return this.isVisible(t.attributeState.visibility !== "hidden", t) ? ((r = t.clone()).transform = r.pdf.unitMatrix, It(r, this), n = b(this.element, r.styleSheets, "clip-path"), n && n !== "none" && (s = he(n, 0, r)) ? s.isVisible(!0, r) ? [4, fe(this, s, r)] : [3, 2] : [3, 3]) : [2];
1578
+ case 1:
1579
+ return l.sent(), [3, 3];
1580
+ case 2:
1581
+ return [2];
1582
+ case 3:
1583
+ Nt(r, t, this.element), a = 0, o = this.children, l.label = 4;
1584
+ case 4:
1585
+ return a < o.length ? [4, o[a].render(r)] : [3, 7];
1586
+ case 5:
1587
+ l.sent(), l.label = 6;
1588
+ case 6:
1589
+ return a++, [3, 4];
1590
+ case 7:
1591
+ return [2];
1592
+ }
1593
+ }));
1594
+ }));
1595
+ }, e.prototype.getBoundingBoxCore = function(t) {
1596
+ return Et(t, this);
1597
+ }, e.prototype.isVisible = function(t, r) {
1598
+ return X(this, t, r);
1599
+ }, e.prototype.computeNodeTransformCore = function(t) {
1600
+ var r = parseFloat(b(this.element, t.styleSheets, "x") || "0"), n = parseFloat(b(this.element, t.styleSheets, "y") || "0"), s = this.element.getAttribute("viewBox");
1601
+ if (s) {
1602
+ var a = L(s), o = parseFloat(b(this.element, t.styleSheets, "width") || b(this.element.ownerSVGElement, t.styleSheets, "width") || s[2]), l = parseFloat(b(this.element, t.styleSheets, "height") || b(this.element.ownerSVGElement, t.styleSheets, "height") || s[3]);
1603
+ return rt(this.element, a, r, n, o, l, t);
1604
+ }
1605
+ return t.pdf.Matrix(1, 0, 0, 1, r, n);
1606
+ }, e;
1607
+ })(it), ht = function(i, e) {
1608
+ this.width = i, this.height = e;
1609
+ }, Ue = (function(i) {
1610
+ function e() {
1611
+ return i !== null && i.apply(this, arguments) || this;
1612
+ }
1613
+ return M(e, i), e.prototype.renderCore = function(t) {
1614
+ return C(this, void 0, void 0, (function() {
1615
+ var r, n, s, a, o, l, u, f, c, p, h, g, d;
1616
+ return F(this, (function(m) {
1617
+ switch (m.label) {
1618
+ case 0:
1619
+ return r = parseFloat, (n = this.element.getAttribute("href") || this.element.getAttribute("xlink:href")) ? (s = n.substring(1), a = t.refsHandler.get(s), o = z(a.element, "symbol,svg") && a.element.hasAttribute("viewBox"), l = r(b(this.element, t.styleSheets, "x") || "0"), u = r(b(this.element, t.styleSheets, "y") || "0"), f = void 0, c = void 0, o ? (f = r(b(this.element, t.styleSheets, "width") || b(a.element, t.styleSheets, "width") || "0"), c = r(b(this.element, t.styleSheets, "height") || b(a.element, t.styleSheets, "height") || "0"), l += r(b(a.element, t.styleSheets, "x") || "0"), u += r(b(a.element, t.styleSheets, "y") || "0"), h = L(a.element.getAttribute("viewBox")), p = rt(a.element, h, l, u, f, c, t)) : p = t.pdf.Matrix(1, 0, 0, 1, l, u), g = J.getContextColors(t, !0), d = new Y(t.pdf, { refsHandler: t.refsHandler, styleSheets: t.styleSheets, withinUse: !0, viewport: o ? new ht(f, c) : t.viewport, svg2pdfParameters: t.svg2pdfParameters, textMeasure: t.textMeasure, attributeState: Object.assign(J.default(), g) }), [4, t.refsHandler.getRendered(s, g, (function(x) {
1620
+ return e.renderReferencedNode(x, s, d);
1621
+ }))]) : [2];
1622
+ case 1:
1623
+ return m.sent(), t.pdf.saveGraphicsState(), t.pdf.setCurrentTransformationMatrix(t.transform), o && b(a.element, t.styleSheets, "overflow") !== "visible" && (t.pdf.rect(l, u, f, c), t.pdf.clip().discardPath()), t.pdf.doFormObject(t.refsHandler.generateKey(s, g), p), t.pdf.restoreGraphicsState(), [2];
1624
+ }
1625
+ }));
1626
+ }));
1627
+ }, e.renderReferencedNode = function(t, r, n) {
1628
+ return C(this, void 0, void 0, (function() {
1629
+ var s;
1630
+ return F(this, (function(a) {
1631
+ switch (a.label) {
1632
+ case 0:
1633
+ return s = [(s = t.getBoundingBox(n))[0] - 0.5 * s[2], s[1] - 0.5 * s[3], 2 * s[2], 2 * s[3]], n.pdf.beginFormObject(s[0], s[1], s[2], s[3], n.pdf.unitMatrix), t instanceof pe ? [4, t.apply(n)] : [3, 2];
1634
+ case 1:
1635
+ return a.sent(), [3, 4];
1636
+ case 2:
1637
+ return [4, t.render(n)];
1638
+ case 3:
1639
+ a.sent(), a.label = 4;
1640
+ case 4:
1641
+ return n.pdf.endFormObject(n.refsHandler.generateKey(r, n.attributeState)), [2];
1642
+ }
1643
+ }));
1644
+ }));
1645
+ }, e.prototype.getBoundingBoxCore = function(t) {
1646
+ return et(this.element, t);
1647
+ }, e.prototype.isVisible = function(t, r) {
1648
+ return j(this, t, r);
1649
+ }, e.prototype.computeNodeTransformCore = function(t) {
1650
+ return t.pdf.unitMatrix;
1651
+ }, e;
1652
+ })(ut), ze = (function(i) {
1653
+ function e(t, r) {
1654
+ return i.call(this, !1, t, r) || this;
1655
+ }
1656
+ return M(e, i), e.prototype.getPath = function(t) {
1657
+ var r = parseFloat(b(this.element, t.styleSheets, "width") || "0"), n = parseFloat(b(this.element, t.styleSheets, "height") || "0");
1658
+ if (!isFinite(r) || r <= 0 || !isFinite(n) || n <= 0) return null;
1659
+ var s = b(this.element, t.styleSheets, "rx"), a = b(this.element, t.styleSheets, "ry"), o = Math.min(parseFloat(s || a || "0"), 0.5 * r), l = Math.min(parseFloat(a || s || "0"), 0.5 * n), u = parseFloat(b(this.element, t.styleSheets, "x") || "0"), f = parseFloat(b(this.element, t.styleSheets, "y") || "0"), c = 4 / 3 * (Math.SQRT2 - 1);
1660
+ return o === 0 && l === 0 ? new Z().moveTo(u, f).lineTo(u + r, f).lineTo(u + r, f + n).lineTo(u, f + n).close() : new Z().moveTo(u += o, f).lineTo(u += r - 2 * o, f).curveTo(u + o * c, f, u + o, f + (l - l * c), u += o, f += l).lineTo(u, f += n - 2 * l).curveTo(u, f + l * c, u - o * c, f + l, u -= o, f += l).lineTo(u += 2 * o - r, f).curveTo(u - o * c, f, u - o, f - l * c, u -= o, f -= l).lineTo(u, f += 2 * l - n).curveTo(u, f - l * c, u + o * c, f - l, u += o, f -= l).close();
1661
+ }, e.prototype.computeNodeTransformCore = function(t) {
1662
+ return t.pdf.unitMatrix;
1663
+ }, e.prototype.isVisible = function(t, r) {
1664
+ return j(this, t, r);
1665
+ }, e;
1666
+ })(nt), de = (function(i) {
1667
+ function e(t, r) {
1668
+ return i.call(this, !1, t, r) || this;
1669
+ }
1670
+ return M(e, i), e.prototype.getPath = function(t) {
1671
+ var r = this.getRx(t), n = this.getRy(t);
1672
+ if (!isFinite(r) || n <= 0 || !isFinite(n) || n <= 0) return null;
1673
+ var s = parseFloat(b(this.element, t.styleSheets, "cx") || "0"), a = parseFloat(b(this.element, t.styleSheets, "cy") || "0"), o = 4 / 3 * (Math.SQRT2 - 1) * r, l = 4 / 3 * (Math.SQRT2 - 1) * n;
1674
+ return new Z().moveTo(s + r, a).curveTo(s + r, a - l, s + o, a - n, s, a - n).curveTo(s - o, a - n, s - r, a - l, s - r, a).curveTo(s - r, a + l, s - o, a + n, s, a + n).curveTo(s + o, a + n, s + r, a + l, s + r, a);
1675
+ }, e.prototype.computeNodeTransformCore = function(t) {
1676
+ return t.pdf.unitMatrix;
1677
+ }, e.prototype.isVisible = function(t, r) {
1678
+ return j(this, t, r);
1679
+ }, e;
1680
+ })(nt), Ye = (function(i) {
1681
+ function e(t, r) {
1682
+ return i.call(this, t, r) || this;
1683
+ }
1684
+ return M(e, i), e.prototype.getRx = function(t) {
1685
+ return parseFloat(b(this.element, t.styleSheets, "rx") || "0");
1686
+ }, e.prototype.getRy = function(t) {
1687
+ return parseFloat(b(this.element, t.styleSheets, "ry") || "0");
1688
+ }, e;
1689
+ })(de);
1690
+ function ge(i) {
1691
+ var e = "invisible", t = i.stroke && i.strokeWidth !== 0, r = i.fill;
1692
+ return r && t ? e = "fillThenStroke" : r ? e = "fill" : t && (e = "stroke"), e;
1693
+ }
1694
+ function Qt(i) {
1695
+ return i.replace(/[\n\r]/g, "");
1696
+ }
1697
+ function Kt(i) {
1698
+ return i.replace(/[\t]/g, " ");
1699
+ }
1700
+ function Jt(i) {
1701
+ return i.replace(/ +/g, " ");
1702
+ }
1703
+ function Zt(i, e, t) {
1704
+ switch (b(i, t.styleSheets, "text-transform")) {
1705
+ case "uppercase":
1706
+ return e.toUpperCase();
1707
+ case "lowercase":
1708
+ return e.toLowerCase();
1709
+ default:
1710
+ return e;
1711
+ }
1712
+ }
1713
+ var Mt = (function() {
1714
+ function i(e, t, r, n) {
1715
+ this.textNode = e, this.texts = [], this.textNodes = [], this.contexts = [], this.textAnchor = t, this.originX = r, this.originY = n, this.textMeasures = [];
1716
+ }
1717
+ return i.prototype.setX = function(e) {
1718
+ this.originX = e;
1719
+ }, i.prototype.setY = function(e) {
1720
+ this.originY = e;
1721
+ }, i.prototype.add = function(e, t, r) {
1722
+ this.texts.push(t), this.textNodes.push(e), this.contexts.push(r);
1723
+ }, i.prototype.rightTrimText = function() {
1724
+ for (var e = this.texts.length - 1; e >= 0; e--)
1725
+ if (this.contexts[e].attributeState.xmlSpace === "preserve" || this.contexts[e].attributeState.whiteSpace === "pre" || (this.texts[e] = this.texts[e].replace(/\s+$/, "")), this.texts[e].match(/[^\s]/)) return !1;
1726
+ return !0;
1727
+ }, i.prototype.measureText = function(e) {
1728
+ for (var t = 0; t < this.texts.length; t++) this.textMeasures.push({ width: e.textMeasure.measureTextWidth(this.texts[t], this.contexts[t].attributeState), length: this.texts[t].length });
1729
+ }, i.prototype.put = function(e, t) {
1730
+ var r, n, s, a, o = [], l = [], u = [], f = this.originX, c = this.originY, p = f, h = f;
1731
+ for (r = 0; r < this.textNodes.length; r++) {
1732
+ n = this.textNodes[r], s = this.contexts[r], a = this.textMeasures[r] || { width: e.textMeasure.measureTextWidth(this.texts[r], this.contexts[r].attributeState), length: this.texts[r].length };
1733
+ var g = f, d = c;
1734
+ if (n.nodeName !== "#text" && !o.includes(n)) {
1735
+ o.push(n);
1736
+ var m = i.resolveRelativePositionAttribute(n, "dx");
1737
+ m !== null && (g += H(m, s.attributeState.fontSize));
1738
+ var x = i.resolveRelativePositionAttribute(n, "dy");
1739
+ x !== null && (d += H(x, s.attributeState.fontSize));
1740
+ }
1741
+ l[r] = g, u[r] = d, f = g + a.width + a.length * t, c = d, p = Math.min(p, g), h = Math.max(h, f);
1742
+ }
1743
+ var v = 0;
1744
+ switch (this.textAnchor) {
1745
+ case "start":
1746
+ v = 0;
1747
+ break;
1748
+ case "middle":
1749
+ v = (h - p) / 2;
1750
+ break;
1751
+ case "end":
1752
+ v = h - p;
1753
+ }
1754
+ for (r = 0; r < this.textNodes.length; r++) if (n = this.textNodes[r], s = this.contexts[r], n.nodeName === "#text" || s.attributeState.visibility !== "hidden") {
1755
+ e.pdf.saveGraphicsState(), Nt(s, e, n);
1756
+ var S = s.attributeState.alignmentBaseline, w = ge(s.attributeState);
1757
+ e.pdf.text(this.texts[r], l[r] - v, u[r], { baseline: ne(S), angle: e.transform, renderingMode: w === "fill" ? void 0 : w, charSpace: t === 0 ? void 0 : t }), e.pdf.restoreGraphicsState();
1758
+ }
1759
+ return [f, c];
1760
+ }, i.resolveRelativePositionAttribute = function(e, t) {
1761
+ for (var r, n = e; n && z(n, "tspan"); ) {
1762
+ if (n.hasAttribute(t)) return n.getAttribute(t);
1763
+ if (((r = e.parentElement) === null || r === void 0 ? void 0 : r.firstChild) !== e) break;
1764
+ n = n.parentElement;
1765
+ }
1766
+ return null;
1767
+ }, i;
1768
+ })(), Xe = (function(i) {
1769
+ function e() {
1770
+ var t = i !== null && i.apply(this, arguments) || this;
1771
+ return t.boundingBox = [], t;
1772
+ }
1773
+ return M(e, i), e.prototype.processTSpans = function(t, r, n, s, a, o) {
1774
+ for (var l = n.pdf.getFontSize(), u = n.attributeState.xmlSpace === "preserve" || n.attributeState.whiteSpace === "pre", f = !0, c = !1, p = 0; p < r.childNodes.length; p++) {
1775
+ var h = r.childNodes[p];
1776
+ if (h.textContent) {
1777
+ var g = h.textContent;
1778
+ if (h.nodeName === "#text") {
1779
+ var d = Qt(g);
1780
+ d = Kt(d), u || (d = Jt(d), f && d.match(/^\s/) && (c = !0), d.match(/[^\s]/) && (f = !1), o.prevText.match(/\s$/) && (d = d.replace(/^\s+/, "")));
1781
+ var m = Zt(r, d, n);
1782
+ a.add(r, m, n), o.prevText = g, o.prevContext = n;
1783
+ } else if (!z(h, "title")) {
1784
+ if (z(h, "tspan")) {
1785
+ var x = h, v = x.getAttribute("x");
1786
+ if (v !== null) {
1787
+ var S = H(v, l);
1788
+ a = new Mt(this, b(x, n.styleSheets, "text-anchor") || n.attributeState.textAnchor, S, 0), s.push({ type: "y", chunk: a });
1789
+ }
1790
+ var w = x.getAttribute("y");
1791
+ if (w !== null) {
1792
+ var y = H(w, l);
1793
+ a = new Mt(this, b(x, n.styleSheets, "text-anchor") || n.attributeState.textAnchor, 0, y), s.push({ type: "x", chunk: a });
1794
+ }
1795
+ var k = n.clone();
1796
+ It(k, t, x), this.processTSpans(t, x, k, s, a, o);
1797
+ }
1798
+ }
1799
+ }
1800
+ }
1801
+ return c;
1802
+ }, e.prototype.renderCore = function(t) {
1803
+ return C(this, void 0, void 0, (function() {
1804
+ var r, n, s, a, o, l, u, f, c, p, h, g, d, m, x, v, S, w, y, k, B, _, P, T;
1805
+ return F(this, (function(D) {
1806
+ if (t.pdf.saveGraphicsState(), r = 0, n = 0, s = 1, a = t.pdf.getFontSize(), o = H(this.element.getAttribute("x"), a), l = H(this.element.getAttribute("y"), a), u = H(this.element.getAttribute("dx"), a), f = H(this.element.getAttribute("dy"), a), c = parseFloat(this.element.getAttribute("textLength") || "0"), p = t.attributeState.visibility, this.element.childElementCount === 0) h = this.element.textContent || "", g = (function(A, R) {
1807
+ return A = Kt(A = Qt(A)), R.xmlSpace === "preserve" || R.whiteSpace === "pre" || (A = Jt(A = A.trim())), A;
1808
+ })(h, t.attributeState), d = Zt(this.element, g, t), r = t.textMeasure.getTextOffset(d, t.attributeState), c > 0 && (m = t.textMeasure.measureTextWidth(d, t.attributeState), !(t.attributeState.xmlSpace === "preserve" || t.attributeState.whiteSpace === "pre") && h.match(/^\s/) && (s = 0), n = (c - m) / (d.length - s) || 0), p === "visible" && (x = t.attributeState.alignmentBaseline, v = ge(t.attributeState), t.pdf.text(d, o + u - r, l + f, { baseline: ne(x), angle: t.transform, renderingMode: v === "fill" ? void 0 : v, charSpace: n === 0 ? void 0 : n }), S = l + f + 0.1 * a, this.boundingBox = [o + u - r, S - a, t.textMeasure.measureTextWidth(d, t.attributeState), a]);
1809
+ else {
1810
+ for (w = [], y = new Mt(this, t.attributeState.textAnchor, o + u, l + f), w.push({ type: "", chunk: y }), k = this.processTSpans(this, this.element, t, w, y, { prevText: " ", prevContext: t }), s = k ? 0 : 1, B = !0, _ = w.length - 1; _ >= 0; _--) B && (B = w[_].chunk.rightTrimText());
1811
+ c > 0 && (P = 0, T = 0, w.forEach((function(A) {
1812
+ var R = A.chunk;
1813
+ R.measureText(t), R.textMeasures.forEach((function(N) {
1814
+ var W = N.width, ft = N.length;
1815
+ P += W, T += ft;
1816
+ }));
1817
+ })), n = (c - P) / (T - s)), w.reduce((function(A, R) {
1818
+ var N = R.type, W = R.chunk;
1819
+ return N === "x" ? W.setX(A[0]) : N === "y" && W.setY(A[1]), W.put(t, n);
1820
+ }), [0, 0]);
1821
+ }
1822
+ return t.pdf.restoreGraphicsState(), [2];
1823
+ }));
1824
+ }));
1825
+ }, e.prototype.isVisible = function(t, r) {
1826
+ return X(this, t, r);
1827
+ }, e.prototype.getBoundingBoxCore = function(t) {
1828
+ return this.boundingBox.length > 0 ? this.boundingBox : et(this.element, t);
1829
+ }, e.prototype.computeNodeTransformCore = function(t) {
1830
+ return t.pdf.unitMatrix;
1831
+ }, e;
1832
+ })(ut), $e = (function(i) {
1833
+ function e(t, r) {
1834
+ return i.call(this, !0, t, r) || this;
1835
+ }
1836
+ return M(e, i), e.prototype.computeNodeTransformCore = function(t) {
1837
+ return t.pdf.unitMatrix;
1838
+ }, e.prototype.isVisible = function(t, r) {
1839
+ return j(this, t, r);
1840
+ }, e.prototype.getPath = function(t) {
1841
+ var r, n, s = new Le(b(this.element, t.styleSheets, "d") || "").unshort().unarc().abs(), a = new Z();
1842
+ return s.iterate((function(o) {
1843
+ switch (o[0]) {
1844
+ case "M":
1845
+ a.moveTo(o[1], o[2]);
1846
+ break;
1847
+ case "L":
1848
+ a.lineTo(o[1], o[2]);
1849
+ break;
1850
+ case "H":
1851
+ a.lineTo(o[1], n);
1852
+ break;
1853
+ case "V":
1854
+ a.lineTo(r, o[1]);
1855
+ break;
1856
+ case "C":
1857
+ a.curveTo(o[1], o[2], o[3], o[4], o[5], o[6]);
1858
+ break;
1859
+ case "Q":
1860
+ var l = Xt([r, n], [o[1], o[2]]), u = Xt([o[3], o[4]], [o[1], o[2]]);
1861
+ a.curveTo(l[0], l[1], u[0], u[1], o[3], o[4]);
1862
+ break;
1863
+ case "Z":
1864
+ a.close();
1865
+ }
1866
+ switch (o[0]) {
1867
+ case "M":
1868
+ case "L":
1869
+ r = o[1], n = o[2];
1870
+ break;
1871
+ case "H":
1872
+ r = o[1];
1873
+ break;
1874
+ case "V":
1875
+ n = o[1];
1876
+ break;
1877
+ case "C":
1878
+ r = o[5], n = o[6];
1879
+ break;
1880
+ case "Q":
1881
+ r = o[3], n = o[4];
1882
+ }
1883
+ })), a;
1884
+ }, e;
1885
+ })(nt), Qe = /^\s*data:(([^/,;]+\/[^/,;]+)(?:;([^,;=]+=[^,;=]+))?)?(?:;(base64))?,((?:.|\s)*)$/i, Ke = (function(i) {
1886
+ function e(t, r, n) {
1887
+ var s = i.call(this, t, r) || this;
1888
+ return s.imageLoadingPromise = null, s.imageUrl = s.element.getAttribute("xlink:href") || s.element.getAttribute("href"), s.imageUrl && e.shouldLoadImage(s.imageUrl, n.svg2pdfParameters.loadImages) && (s.imageLoadingPromise = e.fetchImageData(s.imageUrl)), s;
1889
+ }
1890
+ return M(e, i), e.shouldLoadImage = function(t, r) {
1891
+ return r !== !1 && (!(r instanceof RegExp) || (r.lastIndex = 0, r.test(t)));
1892
+ }, e.prototype.renderCore = function(t) {
1893
+ return C(this, void 0, void 0, (function() {
1894
+ var r, n, s, a, o, l, u, f, c, p, h, g, d, m, x, v, S, w, y;
1895
+ return F(this, (function(k) {
1896
+ switch (k.label) {
1897
+ case 0:
1898
+ return this.imageLoadingPromise ? (t.pdf.setCurrentTransformationMatrix(t.transform), r = parseFloat(b(this.element, t.styleSheets, "width") || "0"), n = parseFloat(b(this.element, t.styleSheets, "height") || "0"), s = parseFloat(b(this.element, t.styleSheets, "x") || "0"), a = parseFloat(b(this.element, t.styleSheets, "y") || "0"), !isFinite(r) || r <= 0 || !isFinite(n) || n <= 0 ? [2] : [4, this.imageLoadingPromise]) : [2];
1899
+ case 1:
1900
+ return o = k.sent(), l = o.data, (u = o.format).indexOf("svg") !== 0 ? [3, 3] : (f = new DOMParser(), c = f.parseFromString(l, "image/svg+xml").firstElementChild, (!(p = this.element.getAttribute("preserveAspectRatio")) || p.indexOf("defer") < 0 || !c.getAttribute("preserveAspectRatio")) && c.setAttribute("preserveAspectRatio", p || ""), c.setAttribute("x", String(s)), c.setAttribute("y", String(a)), c.setAttribute("width", String(r)), c.setAttribute("height", String(n)), h = {}, g = new Y(t.pdf, { refsHandler: new ie(h), styleSheets: t.styleSheets, viewport: new ht(r, n), svg2pdfParameters: t.svg2pdfParameters, textMeasure: t.textMeasure }), [4, Rt(c, g, h).render(g)]);
1901
+ case 2:
1902
+ return k.sent(), [2];
1903
+ case 3:
1904
+ d = "data:image/".concat(u, ";base64,").concat(btoa(l)), k.label = 4;
1905
+ case 4:
1906
+ return k.trys.push([4, 6, , 7]), [4, e.getImageDimensions(d)];
1907
+ case 5:
1908
+ return m = k.sent(), x = m[0], v = m[1], S = [0, 0, x, v], w = rt(this.element, S, s, a, r, n, t), t.pdf.setCurrentTransformationMatrix(w), t.pdf.addImage(d, "", 0, 0, x, v), [3, 7];
1909
+ case 6:
1910
+ return y = k.sent(), typeof console == "object" && console.warn && console.warn("Could not load image ".concat(this.imageUrl, `.
1911
+ `).concat(y)), [3, 7];
1912
+ case 7:
1913
+ return [2];
1914
+ }
1915
+ }));
1916
+ }));
1917
+ }, e.prototype.getBoundingBoxCore = function(t) {
1918
+ return et(this.element, t);
1919
+ }, e.prototype.computeNodeTransformCore = function(t) {
1920
+ return t.pdf.unitMatrix;
1921
+ }, e.prototype.isVisible = function(t, r) {
1922
+ return j(this, t, r);
1923
+ }, e.fetchImageData = function(t) {
1924
+ return C(this, void 0, void 0, (function() {
1925
+ var r, n, s, a, o;
1926
+ return F(this, (function(l) {
1927
+ switch (l.label) {
1928
+ case 0:
1929
+ if (!(s = t.match(Qe))) return [3, 1];
1930
+ if (a = s[2], (o = a.split("/"))[0] !== "image") throw new Error("Unsupported image URL: ".concat(t));
1931
+ return n = o[1], r = s[5], s[4] === "base64" ? (r = r.replace(/\s/g, ""), r = atob(r)) : r = decodeURIComponent(r), [3, 3];
1932
+ case 1:
1933
+ return [4, e.fetchImage(t)];
1934
+ case 2:
1935
+ r = l.sent(), n = t.substring(t.lastIndexOf(".") + 1), l.label = 3;
1936
+ case 3:
1937
+ return [2, { data: r, format: n }];
1938
+ }
1939
+ }));
1940
+ }));
1941
+ }, e.fetchImage = function(t) {
1942
+ return new Promise((function(r, n) {
1943
+ var s = new XMLHttpRequest();
1944
+ s.open("GET", t, !0), s.responseType = "arraybuffer", s.onload = function() {
1945
+ if (s.status !== 200) throw new Error("Error ".concat(s.status, ": Failed to load image '").concat(t, "'"));
1946
+ for (var a = new Uint8Array(s.response), o = "", l = 0; l < a.length; l++) o += String.fromCharCode(a[l]);
1947
+ r(o);
1948
+ }, s.onerror = n, s.onabort = n, s.send(null);
1949
+ }));
1950
+ }, e.getMimeType = function(t) {
1951
+ switch (t = t.toLowerCase()) {
1952
+ case "jpg":
1953
+ case "jpeg":
1954
+ return "image/jpeg";
1955
+ default:
1956
+ return "image/".concat(t);
1957
+ }
1958
+ }, e.getImageDimensions = function(t) {
1959
+ return new Promise((function(r, n) {
1960
+ var s = new Image();
1961
+ s.onload = function() {
1962
+ r([s.width, s.height]);
1963
+ }, s.onerror = n, s.src = t;
1964
+ }));
1965
+ }, e;
1966
+ })(ut), ve = (function(i) {
1967
+ function e(t, r, n) {
1968
+ var s = i.call(this, !0, r, n) || this;
1969
+ return s.closed = t, s;
1970
+ }
1971
+ return M(e, i), e.prototype.getPath = function(t) {
1972
+ if (!this.element.hasAttribute("points") || this.element.getAttribute("points") === "") return null;
1973
+ var r = e.parsePointsString(this.element.getAttribute("points")), n = new Z();
1974
+ if (r.length < 1) return n;
1975
+ n.moveTo(r[0][0], r[0][1]);
1976
+ for (var s = 1; s < r.length; s++) n.lineTo(r[s][0], r[s][1]);
1977
+ return this.closed && n.close(), n;
1978
+ }, e.prototype.isVisible = function(t, r) {
1979
+ return j(this, t, r);
1980
+ }, e.prototype.computeNodeTransformCore = function(t) {
1981
+ return t.pdf.unitMatrix;
1982
+ }, e.parsePointsString = function(t) {
1983
+ for (var r = L(t), n = [], s = 0; s < r.length - 1; s += 2) {
1984
+ var a = r[s], o = r[s + 1];
1985
+ n.push([a, o]);
1986
+ }
1987
+ return n;
1988
+ }, e;
1989
+ })(nt), Je = (function(i) {
1990
+ function e(t, r) {
1991
+ return i.call(this, !0, t, r) || this;
1992
+ }
1993
+ return M(e, i), e;
1994
+ })(ve), Ze = (function(i) {
1995
+ function e() {
1996
+ return i !== null && i.apply(this, arguments) || this;
1997
+ }
1998
+ return M(e, i), e.prototype.render = function(t) {
1999
+ return Promise.resolve();
2000
+ }, e.prototype.getBoundingBoxCore = function(t) {
2001
+ return [0, 0, 0, 0];
2002
+ }, e.prototype.computeNodeTransformCore = function(t) {
2003
+ return t.pdf.unitMatrix;
2004
+ }, e.prototype.isVisible = function(t, r) {
2005
+ return j(this, t, r);
2006
+ }, e;
2007
+ })(Bt), tr = (function(i) {
2008
+ function e() {
2009
+ return i !== null && i.apply(this, arguments) || this;
2010
+ }
2011
+ return M(e, i), e.prototype.apply = function(t) {
2012
+ return C(this, void 0, void 0, (function() {
2013
+ var r, n, s, a, o, l;
2014
+ return F(this, (function(u) {
2015
+ switch (u.label) {
2016
+ case 0:
2017
+ r = this.computeNodeTransform(t), n = this.getBoundingBox(t), t.pdf.beginFormObject(n[0], n[1], n[2], n[3], r), s = J.getContextColors(t), (function(f) {
2018
+ var c = f.attributeState, p = f.pdf, h = 1, g = 1;
2019
+ h *= c.fillOpacity, h *= c.opacity, c.fill instanceof I && c.fill.color.a !== void 0 && (h *= c.fill.color.a), g *= c.strokeOpacity, g *= c.opacity, c.stroke instanceof I && c.stroke.color.a !== void 0 && (g *= c.stroke.color.a);
2020
+ var d, m = {};
2021
+ if (m.opacity = h, m["stroke-opacity"] = g, p.setGState(new Tt(m)), c.fill && c.fill instanceof I && c.fill.color.ok ? p.setFillColor(c.fill.color.r, c.fill.color.g, c.fill.color.b) : p.setFillColor(0, 0, 0), p.setLineWidth(c.strokeWidth), c.stroke instanceof I ? p.setDrawColor(c.stroke.color.r, c.stroke.color.g, c.stroke.color.b) : p.setDrawColor(0, 0, 0), p.setLineCap(c.strokeLinecap), p.setLineJoin(c.strokeLinejoin), c.strokeDasharray ? p.setLineDashPattern(c.strokeDasharray, c.strokeDashoffset) : p.setLineDashPattern([], 0), p.setLineMiterLimit(c.strokeMiterlimit), d = V.hasOwnProperty(c.fontFamily) ? V[c.fontFamily] : c.fontFamily, c.fill && c.fill instanceof I && c.fill.color.ok) {
2022
+ var x = c.fill.color;
2023
+ p.setTextColor(x.r, x.g, x.b);
2024
+ } else p.setTextColor(0, 0, 0);
2025
+ var v = "";
2026
+ c.fontWeight === "bold" && (v = "bold"), c.fontStyle === "italic" && (v += "italic"), v === "" && (v = "normal"), d !== void 0 || v !== void 0 ? (d === void 0 && (d = V.hasOwnProperty(c.fontFamily) ? V[c.fontFamily] : c.fontFamily), p.setFont(d, v)) : p.setFont("helvetica", v), p.setFontSize(c.fontSize * p.internal.scaleFactor);
2027
+ })(a = new Y(t.pdf, { refsHandler: t.refsHandler, styleSheets: t.styleSheets, viewport: t.viewport, svg2pdfParameters: t.svg2pdfParameters, textMeasure: t.textMeasure, attributeState: Object.assign(J.default(), s) })), o = 0, l = this.children, u.label = 1;
2028
+ case 1:
2029
+ return o < l.length ? [4, l[o].render(a)] : [3, 4];
2030
+ case 2:
2031
+ u.sent(), u.label = 3;
2032
+ case 3:
2033
+ return o++, [3, 1];
2034
+ case 4:
2035
+ return t.pdf.endFormObject(a.refsHandler.generateKey(this.element.getAttribute("id"), s)), [2];
2036
+ }
2037
+ }));
2038
+ }));
2039
+ }, e.prototype.getBoundingBoxCore = function(t) {
2040
+ var r, n = this.element.getAttribute("viewBox");
2041
+ return n && (r = L(n)), [r && r[0] || 0, r && r[1] || 0, r && r[2] || parseFloat(this.element.getAttribute("markerWidth") || "3"), r && r[3] || parseFloat(this.element.getAttribute("markerHeight") || "3")];
2042
+ }, e.prototype.computeNodeTransformCore = function(t) {
2043
+ var r, n = parseFloat(this.element.getAttribute("refX") || "0"), s = parseFloat(this.element.getAttribute("refY") || "0"), a = this.element.getAttribute("viewBox");
2044
+ if (a) {
2045
+ var o = L(a);
2046
+ r = rt(this.element, o, 0, 0, parseFloat(this.element.getAttribute("markerWidth") || "3"), parseFloat(this.element.getAttribute("markerHeight") || "3"), t, !0), r = t.pdf.matrixMult(t.pdf.Matrix(1, 0, 0, 1, -n, -s), r);
2047
+ } else r = t.pdf.Matrix(1, 0, 0, 1, -n, -s);
2048
+ return r;
2049
+ }, e.prototype.isVisible = function(t, r) {
2050
+ return X(this, t, r);
2051
+ }, e;
2052
+ })(it), er = (function(i) {
2053
+ function e(t, r) {
2054
+ return i.call(this, t, r) || this;
2055
+ }
2056
+ return M(e, i), e.prototype.getR = function(t) {
2057
+ var r;
2058
+ return (r = this.r) !== null && r !== void 0 ? r : this.r = parseFloat(b(this.element, t.styleSheets, "r") || "0");
2059
+ }, e.prototype.getRx = function(t) {
2060
+ return this.getR(t);
2061
+ }, e.prototype.getRy = function(t) {
2062
+ return this.getR(t);
2063
+ }, e;
2064
+ })(de), rr = (function(i) {
2065
+ function e(t, r) {
2066
+ return i.call(this, !1, t, r) || this;
2067
+ }
2068
+ return M(e, i), e;
2069
+ })(ve), me = (function(i) {
2070
+ function e() {
2071
+ return i !== null && i.apply(this, arguments) || this;
2072
+ }
2073
+ return M(e, i), e.prototype.renderCore = function(t) {
2074
+ return C(this, void 0, void 0, (function() {
2075
+ var r, n;
2076
+ return F(this, (function(s) {
2077
+ switch (s.label) {
2078
+ case 0:
2079
+ r = 0, n = this.children, s.label = 1;
2080
+ case 1:
2081
+ return r < n.length ? [4, n[r].render(t)] : [3, 4];
2082
+ case 2:
2083
+ s.sent(), s.label = 3;
2084
+ case 3:
2085
+ return r++, [3, 1];
2086
+ case 4:
2087
+ return [2];
2088
+ }
2089
+ }));
2090
+ }));
2091
+ }, e.prototype.getBoundingBoxCore = function(t) {
2092
+ return Et(t, this);
2093
+ }, e;
2094
+ })(ce), ir = (function(i) {
2095
+ function e() {
2096
+ return i !== null && i.apply(this, arguments) || this;
2097
+ }
2098
+ return M(e, i), e.prototype.isVisible = function(t, r) {
2099
+ return X(this, t, r);
2100
+ }, e.prototype.render = function(t) {
2101
+ return C(this, void 0, void 0, (function() {
2102
+ var r, n, s, a, o;
2103
+ return F(this, (function(l) {
2104
+ switch (l.label) {
2105
+ case 0:
2106
+ return this.isVisible(t.attributeState.visibility !== "hidden", t) ? (r = this.getX(t), n = this.getY(t), s = this.getWidth(t), a = this.getHeight(t), t.pdf.saveGraphicsState(), o = t.transform, this.element.hasAttribute("transform") && (o = t.pdf.matrixMult(lt(this.element.getAttribute("transform"), t), o)), t.pdf.setCurrentTransformationMatrix(o), t.withinUse || b(this.element, t.styleSheets, "overflow") === "visible" || t.pdf.rect(r, n, s, a).clip().discardPath(), [4, i.prototype.render.call(this, t.clone({ transform: t.pdf.unitMatrix, viewport: t.withinUse ? t.viewport : new ht(s, a) }))]) : [2];
2107
+ case 1:
2108
+ return l.sent(), t.pdf.restoreGraphicsState(), [2];
2109
+ }
2110
+ }));
2111
+ }));
2112
+ }, e.prototype.computeNodeTransform = function(t) {
2113
+ return this.computeNodeTransformCore(t);
2114
+ }, e.prototype.computeNodeTransformCore = function(t) {
2115
+ if (t.withinUse) return t.pdf.unitMatrix;
2116
+ var r, n = this.getX(t), s = this.getY(t), a = this.getViewBox();
2117
+ if (a) {
2118
+ var o = this.getWidth(t), l = this.getHeight(t);
2119
+ r = rt(this.element, a, n, s, o, l, t);
2120
+ } else r = t.pdf.Matrix(1, 0, 0, 1, n, s);
2121
+ return r;
2122
+ }, e.prototype.getWidth = function(t) {
2123
+ if (this.width !== void 0) return this.width;
2124
+ var r, n, s = t.svg2pdfParameters;
2125
+ if (this.isOutermostSvg(t)) if (s.width != null) r = s.width;
2126
+ else if (n = b(this.element, t.styleSheets, "width")) r = parseFloat(n);
2127
+ else {
2128
+ var a = this.getViewBox();
2129
+ if (a && (s.height != null || b(this.element, t.styleSheets, "height"))) {
2130
+ var o = a[2] / a[3];
2131
+ r = this.getHeight(t) * o;
2132
+ } else r = Math.min(300, t.viewport.width, 2 * t.viewport.height);
2133
+ }
2134
+ else r = (n = b(this.element, t.styleSheets, "width")) ? parseFloat(n) : t.viewport.width;
2135
+ return this.width = r;
2136
+ }, e.prototype.getHeight = function(t) {
2137
+ if (this.height !== void 0) return this.height;
2138
+ var r, n, s = t.svg2pdfParameters;
2139
+ if (this.isOutermostSvg(t)) if (s.height != null) r = s.height;
2140
+ else if (n = b(this.element, t.styleSheets, "height")) r = parseFloat(n);
2141
+ else {
2142
+ var a = this.getViewBox();
2143
+ if (a) {
2144
+ var o = a[2] / a[3];
2145
+ r = this.getWidth(t) / o;
2146
+ } else r = Math.min(150, t.viewport.width / 2, t.viewport.height);
2147
+ }
2148
+ else r = (n = b(this.element, t.styleSheets, "height")) ? parseFloat(n) : t.viewport.height;
2149
+ return this.height = r;
2150
+ }, e.prototype.getX = function(t) {
2151
+ if (this.x !== void 0) return this.x;
2152
+ if (this.isOutermostSvg(t)) return this.x = 0;
2153
+ var r = b(this.element, t.styleSheets, "x");
2154
+ return this.x = r ? parseFloat(r) : 0;
2155
+ }, e.prototype.getY = function(t) {
2156
+ if (this.y !== void 0) return this.y;
2157
+ if (this.isOutermostSvg(t)) return this.y = 0;
2158
+ var r = b(this.element, t.styleSheets, "y");
2159
+ return this.y = r ? parseFloat(r) : 0;
2160
+ }, e.prototype.getViewBox = function() {
2161
+ if (this.viewBox !== void 0) return this.viewBox;
2162
+ var t = this.element.getAttribute("viewBox");
2163
+ return this.viewBox = t ? L(t) : void 0;
2164
+ }, e.prototype.isOutermostSvg = function(t) {
2165
+ return t.svg2pdfParameters.element === this.element;
2166
+ }, e;
2167
+ })(me), xe = (function(i) {
2168
+ function e() {
2169
+ return i !== null && i.apply(this, arguments) || this;
2170
+ }
2171
+ return M(e, i), e.prototype.isVisible = function(t, r) {
2172
+ return X(this, t, r);
2173
+ }, e.prototype.computeNodeTransformCore = function(t) {
2174
+ return t.pdf.unitMatrix;
2175
+ }, e;
2176
+ })(me), nr = (function(i) {
2177
+ function e() {
2178
+ return i !== null && i.apply(this, arguments) || this;
2179
+ }
2180
+ return M(e, i), e.prototype.renderCore = function(t) {
2181
+ return C(this, void 0, void 0, (function() {
2182
+ var r, n, s, a;
2183
+ return F(this, (function(o) {
2184
+ switch (o.label) {
2185
+ case 0:
2186
+ return [4, i.prototype.renderCore.call(this, t)];
2187
+ case 1:
2188
+ return o.sent(), (r = b(this.element, t.styleSheets, "href")) && (n = this.getBoundingBox(t), s = t.pdf.internal.scaleFactor, a = t.pdf.internal.pageSize.getHeight(), t.pdf.link(s * (n[0] * t.transform.sx + t.transform.tx), a - s * ((n[1] + n[3]) * t.transform.sy + t.transform.ty), s * n[2], s * n[3], { url: r })), [2];
2189
+ }
2190
+ }));
2191
+ }));
2192
+ }, e;
2193
+ })(xe), ar = (function(i) {
2194
+ function e() {
2195
+ return i !== null && i.apply(this, arguments) || this;
2196
+ }
2197
+ return M(e, i), e.prototype.apply = function(t) {
2198
+ return C(this, void 0, void 0, (function() {
2199
+ var r, n, s, a, o;
2200
+ return F(this, (function(l) {
2201
+ switch (l.label) {
2202
+ case 0:
2203
+ if (!this.isVisible(!0, t)) return [2];
2204
+ r = t.pdf.matrixMult(this.computeNodeTransform(t), t.transform), t.pdf.setCurrentTransformationMatrix(r), n = 0, s = this.children, l.label = 1;
2205
+ case 1:
2206
+ return n < s.length ? [4, s[n].render(new Y(t.pdf, { refsHandler: t.refsHandler, styleSheets: t.styleSheets, viewport: t.viewport, withinClipPath: !0, svg2pdfParameters: t.svg2pdfParameters, textMeasure: t.textMeasure }))] : [3, 4];
2207
+ case 2:
2208
+ l.sent(), l.label = 3;
2209
+ case 3:
2210
+ return n++, [3, 1];
2211
+ case 4:
2212
+ return a = this.children.length > 0 && !!b(this.children[0].element, t.styleSheets, "clip-rule"), o = a ? this.getClipRuleAttr(this.children[0].element, t.styleSheets) : this.getClipRuleAttr(this.element, t.styleSheets), t.pdf.clip(o).discardPath(), t.pdf.setCurrentTransformationMatrix(r.inversed()), [2];
2213
+ }
2214
+ }));
2215
+ }));
2216
+ }, e.prototype.getBoundingBoxCore = function(t) {
2217
+ return Et(t, this);
2218
+ }, e.prototype.isVisible = function(t, r) {
2219
+ return X(this, t, r);
2220
+ }, e.prototype.getClipRuleAttr = function(t, r) {
2221
+ return b(t, r, "clip-rule") === "evenodd" ? "evenodd" : void 0;
2222
+ }, e;
2223
+ })(it);
2224
+ function Rt(i, e, t) {
2225
+ var r, n = [];
2226
+ switch ((function(a, o) {
2227
+ for (var l = [], u = 0; u < a.childNodes.length; u++) {
2228
+ var f = a.childNodes[u];
2229
+ f.nodeName.charAt(0) !== "#" && l.push(f);
2230
+ }
2231
+ for (u = 0; u < l.length; u++) o(u, l[u]);
2232
+ })(i, (function(a, o) {
2233
+ return n.push(Rt(o, e, t));
2234
+ })), i.tagName.toLowerCase()) {
2235
+ case "a":
2236
+ r = new nr(i, n);
2237
+ break;
2238
+ case "g":
2239
+ r = new xe(i, n);
2240
+ break;
2241
+ case "circle":
2242
+ r = new er(i, n);
2243
+ break;
2244
+ case "clippath":
2245
+ r = new ar(i, n);
2246
+ break;
2247
+ case "ellipse":
2248
+ r = new Ye(i, n);
2249
+ break;
2250
+ case "lineargradient":
2251
+ r = new oe(i, n);
2252
+ break;
2253
+ case "image":
2254
+ r = new Ke(i, n, e);
2255
+ break;
2256
+ case "line":
2257
+ r = new Ge(i, n);
2258
+ break;
2259
+ case "marker":
2260
+ r = new tr(i, n);
2261
+ break;
2262
+ case "path":
2263
+ r = new $e(i, n);
2264
+ break;
2265
+ case "pattern":
2266
+ r = new ue(i, n);
2267
+ break;
2268
+ case "polygon":
2269
+ r = new Je(i, n);
2270
+ break;
2271
+ case "polyline":
2272
+ r = new rr(i, n);
2273
+ break;
2274
+ case "radialgradient":
2275
+ r = new le(i, n);
2276
+ break;
2277
+ case "rect":
2278
+ r = new ze(i, n);
2279
+ break;
2280
+ case "svg":
2281
+ r = new ir(i, n);
2282
+ break;
2283
+ case "symbol":
2284
+ r = new pe(i, n);
2285
+ break;
2286
+ case "text":
2287
+ r = new Xe(i, n);
2288
+ break;
2289
+ case "use":
2290
+ r = new Ue(i, n);
2291
+ break;
2292
+ default:
2293
+ r = new Ze(i, n);
2294
+ }
2295
+ if (t != null && r.element.hasAttribute("id")) {
2296
+ var s = ee(r.element.id, { isIdentifier: !0 });
2297
+ t[s] = t[s] || r;
2298
+ }
2299
+ return r.children.forEach((function(a) {
2300
+ return a.setParent(r);
2301
+ })), r;
2302
+ }
2303
+ var sr = (function() {
2304
+ function i(e, t) {
2305
+ this.rootSvg = e, this.loadExternalSheets = t, this.styleSheets = [];
2306
+ }
2307
+ return i.prototype.load = function() {
2308
+ return C(this, void 0, void 0, (function() {
2309
+ var e;
2310
+ return F(this, (function(t) {
2311
+ switch (t.label) {
2312
+ case 0:
2313
+ return [4, this.collectStyleSheetTexts()];
2314
+ case 1:
2315
+ return e = t.sent(), this.parseCssSheets(e), [2];
2316
+ }
2317
+ }));
2318
+ }));
2319
+ }, i.prototype.collectStyleSheetTexts = function() {
2320
+ return C(this, void 0, void 0, (function() {
2321
+ var e, t, r, n, s;
2322
+ return F(this, (function(a) {
2323
+ switch (a.label) {
2324
+ case 0:
2325
+ if (e = [], this.loadExternalSheets && this.rootSvg.ownerDocument) for (n = 0; n < this.rootSvg.ownerDocument.childNodes.length; n++) (t = this.rootSvg.ownerDocument.childNodes[n]).nodeName === "xml-stylesheet" && typeof t.data == "string" && e.push(i.loadSheet(t.data.match(/href=["'].*?["']/)[0].split("=")[1].slice(1, -1)));
2326
+ for (r = this.rootSvg.querySelectorAll("style,link"), n = 0; n < r.length; n++) z(s = r[n], "style") ? e.push(s.textContent) : this.loadExternalSheets && z(s, "link") && s.getAttribute("rel") === "stylesheet" && s.hasAttribute("href") && e.push(i.loadSheet(s.getAttribute("href")));
2327
+ return [4, Promise.all(e)];
2328
+ case 1:
2329
+ return [2, a.sent().filter((function(o) {
2330
+ return o !== null;
2331
+ }))];
2332
+ }
2333
+ }));
2334
+ }));
2335
+ }, i.prototype.parseCssSheets = function(e) {
2336
+ for (var t = document.implementation.createHTMLDocument(""), r = 0, n = e; r < n.length; r++) {
2337
+ var s = n[r], a = t.createElement("style");
2338
+ a.textContent = s, t.body.appendChild(a);
2339
+ var o = a.sheet;
2340
+ if (o instanceof CSSStyleSheet) {
2341
+ for (var l = o.cssRules.length - 1; l >= 0; l--) {
2342
+ var u = o.cssRules[l];
2343
+ if (u instanceof CSSStyleRule) {
2344
+ var f = u;
2345
+ if (f.selectorText.indexOf(",") >= 0) {
2346
+ o.deleteRule(l);
2347
+ for (var c = f.cssText.substring(f.selectorText.length), p = i.splitSelectorAtCommas(f.selectorText), h = 0; h < p.length; h++) o.insertRule(p[h] + c, l + h);
2348
+ }
2349
+ } else o.deleteRule(l);
2350
+ }
2351
+ this.styleSheets.push(o);
2352
+ }
2353
+ }
2354
+ }, i.splitSelectorAtCommas = function(e) {
2355
+ if (e.trim().length === 0) return [];
2356
+ for (var t, r = /,|["']/g, n = /\\[\s\S]|"/g, s = /\\[\s\S]|'/g, a = [], o = "initial", l = -1, u = n, f = 0; f < e.length; ) switch (o) {
2357
+ case "initial":
2358
+ r.lastIndex = f, (t = r.exec(e)) ? (t[0] === "," ? (a.push(e.substring(l + 1, r.lastIndex - 1).trim()), l = r.lastIndex - 1) : (o = "withinQuotes", u = t[0] === '"' ? n : s), f = r.lastIndex) : (a.push(e.substring(l + 1).trim()), f = e.length);
2359
+ break;
2360
+ case "withinQuotes":
2361
+ u.lastIndex = f, (t = u.exec(e)) ? (f = u.lastIndex, t[0].length === 1 && (o = "initial")) : f = e.length;
2362
+ }
2363
+ return a;
2364
+ }, i.loadSheet = function(e) {
2365
+ return new Promise((function(t, r) {
2366
+ var n = new XMLHttpRequest();
2367
+ n.open("GET", e, !0), n.responseType = "text", n.onload = function() {
2368
+ n.status !== 200 && r(new Error("Error ".concat(n.status, ": Failed to load '").concat(e, "'"))), t(n.responseText);
2369
+ }, n.onerror = r, n.onabort = r, n.send(null);
2370
+ })).catch((function() {
2371
+ return null;
2372
+ }));
2373
+ }, i.prototype.getPropertyValue = function(e, t) {
2374
+ for (var r = [], n = 0, s = this.styleSheets; n < s.length; n++) for (var a = s[n], o = 0; o < a.cssRules.length; o++) {
2375
+ var l = a.cssRules[o];
2376
+ l.style.getPropertyValue(t) && e.matches(l.selectorText) && r.push(l);
2377
+ }
2378
+ if (r.length !== 0)
2379
+ return r.reduce((function(u, f) {
2380
+ return p = f, ((h = (c = u).style.getPropertyPriority(t)) !== p.style.getPropertyPriority(t) ? h === "important" ? 1 : -1 : Oe(c.selectorText, p.selectorText)) === 1 ? u : f;
2381
+ var c, p, h;
2382
+ })).style.getPropertyValue(t) || void 0;
2383
+ }, i;
2384
+ })(), or = (function() {
2385
+ function i() {
2386
+ this.measureMethods = {};
2387
+ }
2388
+ return i.prototype.getTextOffset = function(e, t) {
2389
+ var r = t.textAnchor;
2390
+ if (r === "start") return 0;
2391
+ var n = this.measureTextWidth(e, t), s = 0;
2392
+ switch (r) {
2393
+ case "end":
2394
+ s = n;
2395
+ break;
2396
+ case "middle":
2397
+ s = n / 2;
2398
+ }
2399
+ return s;
2400
+ }, i.prototype.measureTextWidth = function(e, t) {
2401
+ if (e.length === 0) return 0;
2402
+ var r = t.fontFamily;
2403
+ return this.getMeasureFunction(r).call(this, e, t.fontFamily, t.fontSize + "px", t.fontStyle, t.fontWeight);
2404
+ }, i.prototype.getMeasurementTextNode = function() {
2405
+ if (!this.textMeasuringTextElement) {
2406
+ this.textMeasuringTextElement = document.createElementNS($t, "text");
2407
+ var e = document.createElementNS($t, "svg");
2408
+ e.appendChild(this.textMeasuringTextElement), e.style.setProperty("position", "absolute"), e.style.setProperty("visibility", "hidden"), document.body.appendChild(e);
2409
+ }
2410
+ return this.textMeasuringTextElement;
2411
+ }, i.prototype.canvasTextMeasure = function(e, t, r, n, s) {
2412
+ var a = document.createElement("canvas").getContext("2d");
2413
+ return a != null ? (a.font = [n, s, r, t].join(" "), a.measureText(e).width) : 0;
2414
+ }, i.prototype.svgTextMeasure = function(e, t, r, n, s, a) {
2415
+ a === void 0 && (a = this.getMeasurementTextNode());
2416
+ var o = a;
2417
+ return o.setAttribute("font-family", t), o.setAttribute("font-size", r), o.setAttribute("font-style", n), o.setAttribute("font-weight", s), o.setAttributeNS("http://www.w3.org/XML/1998/namespace", "xml:space", "preserve"), o.textContent = e, o.getBBox().width;
2418
+ }, i.prototype.getMeasureFunction = function(e) {
2419
+ var t = this.measureMethods[e];
2420
+ if (!t) {
2421
+ var r = "16px", n = "normal", s = "normal", a = this.canvasTextMeasure(i.testString, e, r, n, s), o = this.svgTextMeasure(i.testString, e, r, n, s);
2422
+ t = Math.abs(a - o) < i.epsilon ? this.canvasTextMeasure : this.svgTextMeasure, this.measureMethods[e] = t;
2423
+ }
2424
+ return t;
2425
+ }, i.prototype.cleanupTextMeasuring = function() {
2426
+ if (this.textMeasuringTextElement) {
2427
+ var e = this.textMeasuringTextElement.parentNode;
2428
+ e && document.body.removeChild(e), this.textMeasuringTextElement = void 0;
2429
+ }
2430
+ }, i.testString = `abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ 0123456789!"$%&/()=?'\\+*-_.:,;^}][{#~|<>`, i.epsilon = 0.1, i;
2431
+ })();
2432
+ function lr(i, e) {
2433
+ return C(this, arguments, void 0, (function(t, r, n) {
2434
+ var s, a, o, l, u, f, c, p, h, g, d, m, x, v;
2435
+ return n === void 0 && (n = {}), F(this, (function(S) {
2436
+ switch (S.label) {
2437
+ case 0:
2438
+ return s = (m = n.x) !== null && m !== void 0 ? m : 0, a = (x = n.y) !== null && x !== void 0 ? x : 0, o = (v = n.loadExternalStyleSheets) !== null && v !== void 0 && v, u = new ie(l = {}), [4, (f = new sr(t, o)).load()];
2439
+ case 1:
2440
+ return S.sent(), c = new ht(r.internal.pageSize.getWidth(), r.internal.pageSize.getHeight()), p = ot(ot({}, n), { element: t }), h = new or(), g = new Y(r, { refsHandler: u, styleSheets: f, viewport: c, svg2pdfParameters: p, textMeasure: h }), r.advancedAPI(), r.saveGraphicsState(), r.setCurrentTransformationMatrix(r.Matrix(1, 0, 0, 1, s, a)), r.setLineWidth(g.attributeState.strokeWidth), d = g.attributeState.fill.color, r.setFillColor(d.r, d.g, d.b), r.setFont(g.attributeState.fontFamily), r.setFontSize(g.attributeState.fontSize * r.internal.scaleFactor), [4, Rt(t, g, l).render(g)];
2441
+ case 2:
2442
+ return S.sent(), r.restoreGraphicsState(), r.compatAPI(), g.textMeasure.cleanupTextMeasuring(), [2, r];
2443
+ }
2444
+ }));
2445
+ }));
2446
+ }
2447
+ te.API.svg = function(i, e) {
2448
+ return e === void 0 && (e = {}), lr(i, this, e);
2449
+ };
2450
+ export {
2451
+ lr as svg2pdf
2452
+ };