@quartz-community/obsidian-plugin-excalidraw 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,4169 @@
1
+ import { createRequire } from 'module';
2
+
3
+ createRequire(import.meta.url);
4
+ var __defProp = Object.defineProperty;
5
+ var __export = (target, all2) => {
6
+ for (var name in all2)
7
+ __defProp(target, name, { get: all2[name], enumerable: true });
8
+ };
9
+
10
+ // node_modules/@quartz-community/utils/dist/path.js
11
+ function isRelativeURL(s4) {
12
+ const validStart = /^\.{1,2}/.test(s4);
13
+ const validEnding = !endsWith(s4, "index");
14
+ return validStart && validEnding && ![".md", ".html"].includes(getFileExtension(s4) ?? "");
15
+ }
16
+ function simplifySlug(fp) {
17
+ const res = stripSlashes(trimSuffix(fp, "index"), true);
18
+ return res.length === 0 ? "/" : res;
19
+ }
20
+ function slugifyFilePath(fp, excludeExt) {
21
+ fp = stripSlashes(fp);
22
+ const ext = getFileExtension(fp);
23
+ const withoutFileExt = fp.replace(new RegExp(ext + "$"), "");
24
+ const finalExt = [".md", ".html", void 0].includes(ext) ? "" : ext;
25
+ let slug2 = _sluggify(withoutFileExt);
26
+ if (endsWith(slug2, "_index")) {
27
+ slug2 = slug2.replace(/_index$/, "index");
28
+ }
29
+ const segments = slug2.split("/");
30
+ if (segments.length >= 2 && segments[segments.length - 1] === segments[segments.length - 2]) {
31
+ segments[segments.length - 1] = "index";
32
+ slug2 = segments.join("/");
33
+ }
34
+ return slug2 + (finalExt ?? "");
35
+ }
36
+ function joinSegments(...args) {
37
+ if (args.length === 0) {
38
+ return "";
39
+ }
40
+ let joined = args.filter((segment) => segment !== "" && segment !== "/").map((segment) => stripSlashes(segment)).join("/");
41
+ const first = args[0];
42
+ const last = args[args.length - 1];
43
+ if (first?.startsWith("/")) {
44
+ joined = "/" + joined;
45
+ }
46
+ if (last?.endsWith("/")) {
47
+ joined = joined + "/";
48
+ }
49
+ return joined;
50
+ }
51
+ function endsWith(s4, suffix) {
52
+ return s4 === suffix || s4.endsWith("/" + suffix);
53
+ }
54
+ function trimSuffix(s4, suffix) {
55
+ if (endsWith(s4, suffix)) {
56
+ s4 = s4.slice(0, -suffix.length);
57
+ }
58
+ return s4;
59
+ }
60
+ function stripSlashes(s4, onlyStripPrefix) {
61
+ if (s4.startsWith("/")) {
62
+ s4 = s4.substring(1);
63
+ }
64
+ if (!onlyStripPrefix && s4.endsWith("/")) {
65
+ s4 = s4.slice(0, -1);
66
+ }
67
+ return s4;
68
+ }
69
+ function getFileExtension(s4) {
70
+ return s4.match(/\.[A-Za-z0-9]+$/)?.[0];
71
+ }
72
+ function pathToRoot(slug2) {
73
+ let rootPath = slug2.split("/").filter((x4) => x4 !== "").slice(0, -1).map((_3) => "..").join("/");
74
+ if (rootPath.length === 0) {
75
+ rootPath = ".";
76
+ }
77
+ return rootPath;
78
+ }
79
+ function resolveRelative(current, target) {
80
+ const res = joinSegments(pathToRoot(current), simplifySlug(target));
81
+ return res;
82
+ }
83
+ function slugifyPath(s4) {
84
+ return s4.split("/").map(
85
+ (segment) => segment.replace(/\s/g, "-").replace(/&/g, "-and-").replace(/%/g, "-percent").replace(/\?/g, "").replace(/#/g, "").replace(/[<>:"|*]/g, "").toLowerCase()
86
+ ).join("/").replace(/\/$/, "");
87
+ }
88
+ function normalizeHastElement(rawEl, curBase, newBase) {
89
+ const el = structuredClone(rawEl);
90
+ _rebaseHastElement(el, "src", curBase, newBase);
91
+ _rebaseHastElement(el, "href", curBase, newBase);
92
+ if (el.children) {
93
+ el.children = el.children.map(
94
+ (child) => child.type === "element" ? normalizeHastElement(child, curBase, newBase) : child
95
+ );
96
+ }
97
+ return el;
98
+ }
99
+ function _rebaseHastElement(el, attr, curBase, newBase) {
100
+ const value = el.properties?.[attr];
101
+ if (value === void 0 || value === null) return;
102
+ const href = String(value);
103
+ if (!isRelativeURL(href)) return;
104
+ el.properties[attr] = joinSegments(resolveRelative(curBase, newBase), "..", href);
105
+ }
106
+ function _sluggify(s4) {
107
+ return slugifyPath(s4);
108
+ }
109
+
110
+ // node_modules/html-void-elements/index.js
111
+ var htmlVoidElements = [
112
+ "area",
113
+ "base",
114
+ "basefont",
115
+ "bgsound",
116
+ "br",
117
+ "col",
118
+ "command",
119
+ "embed",
120
+ "frame",
121
+ "hr",
122
+ "image",
123
+ "img",
124
+ "input",
125
+ "keygen",
126
+ "link",
127
+ "meta",
128
+ "param",
129
+ "source",
130
+ "track",
131
+ "wbr"
132
+ ];
133
+
134
+ // node_modules/property-information/lib/util/schema.js
135
+ var Schema = class {
136
+ /**
137
+ * @param {SchemaType['property']} property
138
+ * Property.
139
+ * @param {SchemaType['normal']} normal
140
+ * Normal.
141
+ * @param {Space | undefined} [space]
142
+ * Space.
143
+ * @returns
144
+ * Schema.
145
+ */
146
+ constructor(property, normal, space) {
147
+ this.normal = normal;
148
+ this.property = property;
149
+ if (space) {
150
+ this.space = space;
151
+ }
152
+ }
153
+ };
154
+ Schema.prototype.normal = {};
155
+ Schema.prototype.property = {};
156
+ Schema.prototype.space = void 0;
157
+
158
+ // node_modules/property-information/lib/util/merge.js
159
+ function merge(definitions, space) {
160
+ const property = {};
161
+ const normal = {};
162
+ for (const definition of definitions) {
163
+ Object.assign(property, definition.property);
164
+ Object.assign(normal, definition.normal);
165
+ }
166
+ return new Schema(property, normal, space);
167
+ }
168
+
169
+ // node_modules/property-information/lib/normalize.js
170
+ function normalize(value) {
171
+ return value.toLowerCase();
172
+ }
173
+
174
+ // node_modules/property-information/lib/util/info.js
175
+ var Info = class {
176
+ /**
177
+ * @param {string} property
178
+ * Property.
179
+ * @param {string} attribute
180
+ * Attribute.
181
+ * @returns
182
+ * Info.
183
+ */
184
+ constructor(property, attribute) {
185
+ this.attribute = attribute;
186
+ this.property = property;
187
+ }
188
+ };
189
+ Info.prototype.attribute = "";
190
+ Info.prototype.booleanish = false;
191
+ Info.prototype.boolean = false;
192
+ Info.prototype.commaOrSpaceSeparated = false;
193
+ Info.prototype.commaSeparated = false;
194
+ Info.prototype.defined = false;
195
+ Info.prototype.mustUseProperty = false;
196
+ Info.prototype.number = false;
197
+ Info.prototype.overloadedBoolean = false;
198
+ Info.prototype.property = "";
199
+ Info.prototype.spaceSeparated = false;
200
+ Info.prototype.space = void 0;
201
+
202
+ // node_modules/property-information/lib/util/types.js
203
+ var types_exports = {};
204
+ __export(types_exports, {
205
+ boolean: () => boolean,
206
+ booleanish: () => booleanish,
207
+ commaOrSpaceSeparated: () => commaOrSpaceSeparated,
208
+ commaSeparated: () => commaSeparated,
209
+ number: () => number,
210
+ overloadedBoolean: () => overloadedBoolean,
211
+ spaceSeparated: () => spaceSeparated
212
+ });
213
+ var powers = 0;
214
+ var boolean = increment();
215
+ var booleanish = increment();
216
+ var overloadedBoolean = increment();
217
+ var number = increment();
218
+ var spaceSeparated = increment();
219
+ var commaSeparated = increment();
220
+ var commaOrSpaceSeparated = increment();
221
+ function increment() {
222
+ return 2 ** ++powers;
223
+ }
224
+
225
+ // node_modules/property-information/lib/util/defined-info.js
226
+ var checks = (
227
+ /** @type {ReadonlyArray<keyof typeof types>} */
228
+ Object.keys(types_exports)
229
+ );
230
+ var DefinedInfo = class extends Info {
231
+ /**
232
+ * @constructor
233
+ * @param {string} property
234
+ * Property.
235
+ * @param {string} attribute
236
+ * Attribute.
237
+ * @param {number | null | undefined} [mask]
238
+ * Mask.
239
+ * @param {Space | undefined} [space]
240
+ * Space.
241
+ * @returns
242
+ * Info.
243
+ */
244
+ constructor(property, attribute, mask, space) {
245
+ let index = -1;
246
+ super(property, attribute);
247
+ mark(this, "space", space);
248
+ if (typeof mask === "number") {
249
+ while (++index < checks.length) {
250
+ const check = checks[index];
251
+ mark(this, checks[index], (mask & types_exports[check]) === types_exports[check]);
252
+ }
253
+ }
254
+ }
255
+ };
256
+ DefinedInfo.prototype.defined = true;
257
+ function mark(values, key2, value) {
258
+ if (value) {
259
+ values[key2] = value;
260
+ }
261
+ }
262
+
263
+ // node_modules/property-information/lib/util/create.js
264
+ function create(definition) {
265
+ const properties = {};
266
+ const normals = {};
267
+ for (const [property, value] of Object.entries(definition.properties)) {
268
+ const info = new DefinedInfo(
269
+ property,
270
+ definition.transform(definition.attributes || {}, property),
271
+ value,
272
+ definition.space
273
+ );
274
+ if (definition.mustUseProperty && definition.mustUseProperty.includes(property)) {
275
+ info.mustUseProperty = true;
276
+ }
277
+ properties[property] = info;
278
+ normals[normalize(property)] = property;
279
+ normals[normalize(info.attribute)] = property;
280
+ }
281
+ return new Schema(properties, normals, definition.space);
282
+ }
283
+
284
+ // node_modules/property-information/lib/aria.js
285
+ var aria = create({
286
+ properties: {
287
+ ariaActiveDescendant: null,
288
+ ariaAtomic: booleanish,
289
+ ariaAutoComplete: null,
290
+ ariaBusy: booleanish,
291
+ ariaChecked: booleanish,
292
+ ariaColCount: number,
293
+ ariaColIndex: number,
294
+ ariaColSpan: number,
295
+ ariaControls: spaceSeparated,
296
+ ariaCurrent: null,
297
+ ariaDescribedBy: spaceSeparated,
298
+ ariaDetails: null,
299
+ ariaDisabled: booleanish,
300
+ ariaDropEffect: spaceSeparated,
301
+ ariaErrorMessage: null,
302
+ ariaExpanded: booleanish,
303
+ ariaFlowTo: spaceSeparated,
304
+ ariaGrabbed: booleanish,
305
+ ariaHasPopup: null,
306
+ ariaHidden: booleanish,
307
+ ariaInvalid: null,
308
+ ariaKeyShortcuts: null,
309
+ ariaLabel: null,
310
+ ariaLabelledBy: spaceSeparated,
311
+ ariaLevel: number,
312
+ ariaLive: null,
313
+ ariaModal: booleanish,
314
+ ariaMultiLine: booleanish,
315
+ ariaMultiSelectable: booleanish,
316
+ ariaOrientation: null,
317
+ ariaOwns: spaceSeparated,
318
+ ariaPlaceholder: null,
319
+ ariaPosInSet: number,
320
+ ariaPressed: booleanish,
321
+ ariaReadOnly: booleanish,
322
+ ariaRelevant: null,
323
+ ariaRequired: booleanish,
324
+ ariaRoleDescription: spaceSeparated,
325
+ ariaRowCount: number,
326
+ ariaRowIndex: number,
327
+ ariaRowSpan: number,
328
+ ariaSelected: booleanish,
329
+ ariaSetSize: number,
330
+ ariaSort: null,
331
+ ariaValueMax: number,
332
+ ariaValueMin: number,
333
+ ariaValueNow: number,
334
+ ariaValueText: null,
335
+ role: null
336
+ },
337
+ transform(_3, property) {
338
+ return property === "role" ? property : "aria-" + property.slice(4).toLowerCase();
339
+ }
340
+ });
341
+
342
+ // node_modules/property-information/lib/util/case-sensitive-transform.js
343
+ function caseSensitiveTransform(attributes, attribute) {
344
+ return attribute in attributes ? attributes[attribute] : attribute;
345
+ }
346
+
347
+ // node_modules/property-information/lib/util/case-insensitive-transform.js
348
+ function caseInsensitiveTransform(attributes, property) {
349
+ return caseSensitiveTransform(attributes, property.toLowerCase());
350
+ }
351
+
352
+ // node_modules/property-information/lib/html.js
353
+ var html = create({
354
+ attributes: {
355
+ acceptcharset: "accept-charset",
356
+ classname: "class",
357
+ htmlfor: "for",
358
+ httpequiv: "http-equiv"
359
+ },
360
+ mustUseProperty: ["checked", "multiple", "muted", "selected"],
361
+ properties: {
362
+ // Standard Properties.
363
+ abbr: null,
364
+ accept: commaSeparated,
365
+ acceptCharset: spaceSeparated,
366
+ accessKey: spaceSeparated,
367
+ action: null,
368
+ allow: null,
369
+ allowFullScreen: boolean,
370
+ allowPaymentRequest: boolean,
371
+ allowUserMedia: boolean,
372
+ alt: null,
373
+ as: null,
374
+ async: boolean,
375
+ autoCapitalize: null,
376
+ autoComplete: spaceSeparated,
377
+ autoFocus: boolean,
378
+ autoPlay: boolean,
379
+ blocking: spaceSeparated,
380
+ capture: null,
381
+ charSet: null,
382
+ checked: boolean,
383
+ cite: null,
384
+ className: spaceSeparated,
385
+ cols: number,
386
+ colSpan: null,
387
+ content: null,
388
+ contentEditable: booleanish,
389
+ controls: boolean,
390
+ controlsList: spaceSeparated,
391
+ coords: number | commaSeparated,
392
+ crossOrigin: null,
393
+ data: null,
394
+ dateTime: null,
395
+ decoding: null,
396
+ default: boolean,
397
+ defer: boolean,
398
+ dir: null,
399
+ dirName: null,
400
+ disabled: boolean,
401
+ download: overloadedBoolean,
402
+ draggable: booleanish,
403
+ encType: null,
404
+ enterKeyHint: null,
405
+ fetchPriority: null,
406
+ form: null,
407
+ formAction: null,
408
+ formEncType: null,
409
+ formMethod: null,
410
+ formNoValidate: boolean,
411
+ formTarget: null,
412
+ headers: spaceSeparated,
413
+ height: number,
414
+ hidden: overloadedBoolean,
415
+ high: number,
416
+ href: null,
417
+ hrefLang: null,
418
+ htmlFor: spaceSeparated,
419
+ httpEquiv: spaceSeparated,
420
+ id: null,
421
+ imageSizes: null,
422
+ imageSrcSet: null,
423
+ inert: boolean,
424
+ inputMode: null,
425
+ integrity: null,
426
+ is: null,
427
+ isMap: boolean,
428
+ itemId: null,
429
+ itemProp: spaceSeparated,
430
+ itemRef: spaceSeparated,
431
+ itemScope: boolean,
432
+ itemType: spaceSeparated,
433
+ kind: null,
434
+ label: null,
435
+ lang: null,
436
+ language: null,
437
+ list: null,
438
+ loading: null,
439
+ loop: boolean,
440
+ low: number,
441
+ manifest: null,
442
+ max: null,
443
+ maxLength: number,
444
+ media: null,
445
+ method: null,
446
+ min: null,
447
+ minLength: number,
448
+ multiple: boolean,
449
+ muted: boolean,
450
+ name: null,
451
+ nonce: null,
452
+ noModule: boolean,
453
+ noValidate: boolean,
454
+ onAbort: null,
455
+ onAfterPrint: null,
456
+ onAuxClick: null,
457
+ onBeforeMatch: null,
458
+ onBeforePrint: null,
459
+ onBeforeToggle: null,
460
+ onBeforeUnload: null,
461
+ onBlur: null,
462
+ onCancel: null,
463
+ onCanPlay: null,
464
+ onCanPlayThrough: null,
465
+ onChange: null,
466
+ onClick: null,
467
+ onClose: null,
468
+ onContextLost: null,
469
+ onContextMenu: null,
470
+ onContextRestored: null,
471
+ onCopy: null,
472
+ onCueChange: null,
473
+ onCut: null,
474
+ onDblClick: null,
475
+ onDrag: null,
476
+ onDragEnd: null,
477
+ onDragEnter: null,
478
+ onDragExit: null,
479
+ onDragLeave: null,
480
+ onDragOver: null,
481
+ onDragStart: null,
482
+ onDrop: null,
483
+ onDurationChange: null,
484
+ onEmptied: null,
485
+ onEnded: null,
486
+ onError: null,
487
+ onFocus: null,
488
+ onFormData: null,
489
+ onHashChange: null,
490
+ onInput: null,
491
+ onInvalid: null,
492
+ onKeyDown: null,
493
+ onKeyPress: null,
494
+ onKeyUp: null,
495
+ onLanguageChange: null,
496
+ onLoad: null,
497
+ onLoadedData: null,
498
+ onLoadedMetadata: null,
499
+ onLoadEnd: null,
500
+ onLoadStart: null,
501
+ onMessage: null,
502
+ onMessageError: null,
503
+ onMouseDown: null,
504
+ onMouseEnter: null,
505
+ onMouseLeave: null,
506
+ onMouseMove: null,
507
+ onMouseOut: null,
508
+ onMouseOver: null,
509
+ onMouseUp: null,
510
+ onOffline: null,
511
+ onOnline: null,
512
+ onPageHide: null,
513
+ onPageShow: null,
514
+ onPaste: null,
515
+ onPause: null,
516
+ onPlay: null,
517
+ onPlaying: null,
518
+ onPopState: null,
519
+ onProgress: null,
520
+ onRateChange: null,
521
+ onRejectionHandled: null,
522
+ onReset: null,
523
+ onResize: null,
524
+ onScroll: null,
525
+ onScrollEnd: null,
526
+ onSecurityPolicyViolation: null,
527
+ onSeeked: null,
528
+ onSeeking: null,
529
+ onSelect: null,
530
+ onSlotChange: null,
531
+ onStalled: null,
532
+ onStorage: null,
533
+ onSubmit: null,
534
+ onSuspend: null,
535
+ onTimeUpdate: null,
536
+ onToggle: null,
537
+ onUnhandledRejection: null,
538
+ onUnload: null,
539
+ onVolumeChange: null,
540
+ onWaiting: null,
541
+ onWheel: null,
542
+ open: boolean,
543
+ optimum: number,
544
+ pattern: null,
545
+ ping: spaceSeparated,
546
+ placeholder: null,
547
+ playsInline: boolean,
548
+ popover: null,
549
+ popoverTarget: null,
550
+ popoverTargetAction: null,
551
+ poster: null,
552
+ preload: null,
553
+ readOnly: boolean,
554
+ referrerPolicy: null,
555
+ rel: spaceSeparated,
556
+ required: boolean,
557
+ reversed: boolean,
558
+ rows: number,
559
+ rowSpan: number,
560
+ sandbox: spaceSeparated,
561
+ scope: null,
562
+ scoped: boolean,
563
+ seamless: boolean,
564
+ selected: boolean,
565
+ shadowRootClonable: boolean,
566
+ shadowRootDelegatesFocus: boolean,
567
+ shadowRootMode: null,
568
+ shape: null,
569
+ size: number,
570
+ sizes: null,
571
+ slot: null,
572
+ span: number,
573
+ spellCheck: booleanish,
574
+ src: null,
575
+ srcDoc: null,
576
+ srcLang: null,
577
+ srcSet: null,
578
+ start: number,
579
+ step: null,
580
+ style: null,
581
+ tabIndex: number,
582
+ target: null,
583
+ title: null,
584
+ translate: null,
585
+ type: null,
586
+ typeMustMatch: boolean,
587
+ useMap: null,
588
+ value: booleanish,
589
+ width: number,
590
+ wrap: null,
591
+ writingSuggestions: null,
592
+ // Legacy.
593
+ // See: https://html.spec.whatwg.org/#other-elements,-attributes-and-apis
594
+ align: null,
595
+ // Several. Use CSS `text-align` instead,
596
+ aLink: null,
597
+ // `<body>`. Use CSS `a:active {color}` instead
598
+ archive: spaceSeparated,
599
+ // `<object>`. List of URIs to archives
600
+ axis: null,
601
+ // `<td>` and `<th>`. Use `scope` on `<th>`
602
+ background: null,
603
+ // `<body>`. Use CSS `background-image` instead
604
+ bgColor: null,
605
+ // `<body>` and table elements. Use CSS `background-color` instead
606
+ border: number,
607
+ // `<table>`. Use CSS `border-width` instead,
608
+ borderColor: null,
609
+ // `<table>`. Use CSS `border-color` instead,
610
+ bottomMargin: number,
611
+ // `<body>`
612
+ cellPadding: null,
613
+ // `<table>`
614
+ cellSpacing: null,
615
+ // `<table>`
616
+ char: null,
617
+ // Several table elements. When `align=char`, sets the character to align on
618
+ charOff: null,
619
+ // Several table elements. When `char`, offsets the alignment
620
+ classId: null,
621
+ // `<object>`
622
+ clear: null,
623
+ // `<br>`. Use CSS `clear` instead
624
+ code: null,
625
+ // `<object>`
626
+ codeBase: null,
627
+ // `<object>`
628
+ codeType: null,
629
+ // `<object>`
630
+ color: null,
631
+ // `<font>` and `<hr>`. Use CSS instead
632
+ compact: boolean,
633
+ // Lists. Use CSS to reduce space between items instead
634
+ declare: boolean,
635
+ // `<object>`
636
+ event: null,
637
+ // `<script>`
638
+ face: null,
639
+ // `<font>`. Use CSS instead
640
+ frame: null,
641
+ // `<table>`
642
+ frameBorder: null,
643
+ // `<iframe>`. Use CSS `border` instead
644
+ hSpace: number,
645
+ // `<img>` and `<object>`
646
+ leftMargin: number,
647
+ // `<body>`
648
+ link: null,
649
+ // `<body>`. Use CSS `a:link {color: *}` instead
650
+ longDesc: null,
651
+ // `<frame>`, `<iframe>`, and `<img>`. Use an `<a>`
652
+ lowSrc: null,
653
+ // `<img>`. Use a `<picture>`
654
+ marginHeight: number,
655
+ // `<body>`
656
+ marginWidth: number,
657
+ // `<body>`
658
+ noResize: boolean,
659
+ // `<frame>`
660
+ noHref: boolean,
661
+ // `<area>`. Use no href instead of an explicit `nohref`
662
+ noShade: boolean,
663
+ // `<hr>`. Use background-color and height instead of borders
664
+ noWrap: boolean,
665
+ // `<td>` and `<th>`
666
+ object: null,
667
+ // `<applet>`
668
+ profile: null,
669
+ // `<head>`
670
+ prompt: null,
671
+ // `<isindex>`
672
+ rev: null,
673
+ // `<link>`
674
+ rightMargin: number,
675
+ // `<body>`
676
+ rules: null,
677
+ // `<table>`
678
+ scheme: null,
679
+ // `<meta>`
680
+ scrolling: booleanish,
681
+ // `<frame>`. Use overflow in the child context
682
+ standby: null,
683
+ // `<object>`
684
+ summary: null,
685
+ // `<table>`
686
+ text: null,
687
+ // `<body>`. Use CSS `color` instead
688
+ topMargin: number,
689
+ // `<body>`
690
+ valueType: null,
691
+ // `<param>`
692
+ version: null,
693
+ // `<html>`. Use a doctype.
694
+ vAlign: null,
695
+ // Several. Use CSS `vertical-align` instead
696
+ vLink: null,
697
+ // `<body>`. Use CSS `a:visited {color}` instead
698
+ vSpace: number,
699
+ // `<img>` and `<object>`
700
+ // Non-standard Properties.
701
+ allowTransparency: null,
702
+ autoCorrect: null,
703
+ autoSave: null,
704
+ disablePictureInPicture: boolean,
705
+ disableRemotePlayback: boolean,
706
+ prefix: null,
707
+ property: null,
708
+ results: number,
709
+ security: null,
710
+ unselectable: null
711
+ },
712
+ space: "html",
713
+ transform: caseInsensitiveTransform
714
+ });
715
+
716
+ // node_modules/property-information/lib/svg.js
717
+ var svg = create({
718
+ attributes: {
719
+ accentHeight: "accent-height",
720
+ alignmentBaseline: "alignment-baseline",
721
+ arabicForm: "arabic-form",
722
+ baselineShift: "baseline-shift",
723
+ capHeight: "cap-height",
724
+ className: "class",
725
+ clipPath: "clip-path",
726
+ clipRule: "clip-rule",
727
+ colorInterpolation: "color-interpolation",
728
+ colorInterpolationFilters: "color-interpolation-filters",
729
+ colorProfile: "color-profile",
730
+ colorRendering: "color-rendering",
731
+ crossOrigin: "crossorigin",
732
+ dataType: "datatype",
733
+ dominantBaseline: "dominant-baseline",
734
+ enableBackground: "enable-background",
735
+ fillOpacity: "fill-opacity",
736
+ fillRule: "fill-rule",
737
+ floodColor: "flood-color",
738
+ floodOpacity: "flood-opacity",
739
+ fontFamily: "font-family",
740
+ fontSize: "font-size",
741
+ fontSizeAdjust: "font-size-adjust",
742
+ fontStretch: "font-stretch",
743
+ fontStyle: "font-style",
744
+ fontVariant: "font-variant",
745
+ fontWeight: "font-weight",
746
+ glyphName: "glyph-name",
747
+ glyphOrientationHorizontal: "glyph-orientation-horizontal",
748
+ glyphOrientationVertical: "glyph-orientation-vertical",
749
+ hrefLang: "hreflang",
750
+ horizAdvX: "horiz-adv-x",
751
+ horizOriginX: "horiz-origin-x",
752
+ horizOriginY: "horiz-origin-y",
753
+ imageRendering: "image-rendering",
754
+ letterSpacing: "letter-spacing",
755
+ lightingColor: "lighting-color",
756
+ markerEnd: "marker-end",
757
+ markerMid: "marker-mid",
758
+ markerStart: "marker-start",
759
+ navDown: "nav-down",
760
+ navDownLeft: "nav-down-left",
761
+ navDownRight: "nav-down-right",
762
+ navLeft: "nav-left",
763
+ navNext: "nav-next",
764
+ navPrev: "nav-prev",
765
+ navRight: "nav-right",
766
+ navUp: "nav-up",
767
+ navUpLeft: "nav-up-left",
768
+ navUpRight: "nav-up-right",
769
+ onAbort: "onabort",
770
+ onActivate: "onactivate",
771
+ onAfterPrint: "onafterprint",
772
+ onBeforePrint: "onbeforeprint",
773
+ onBegin: "onbegin",
774
+ onCancel: "oncancel",
775
+ onCanPlay: "oncanplay",
776
+ onCanPlayThrough: "oncanplaythrough",
777
+ onChange: "onchange",
778
+ onClick: "onclick",
779
+ onClose: "onclose",
780
+ onCopy: "oncopy",
781
+ onCueChange: "oncuechange",
782
+ onCut: "oncut",
783
+ onDblClick: "ondblclick",
784
+ onDrag: "ondrag",
785
+ onDragEnd: "ondragend",
786
+ onDragEnter: "ondragenter",
787
+ onDragExit: "ondragexit",
788
+ onDragLeave: "ondragleave",
789
+ onDragOver: "ondragover",
790
+ onDragStart: "ondragstart",
791
+ onDrop: "ondrop",
792
+ onDurationChange: "ondurationchange",
793
+ onEmptied: "onemptied",
794
+ onEnd: "onend",
795
+ onEnded: "onended",
796
+ onError: "onerror",
797
+ onFocus: "onfocus",
798
+ onFocusIn: "onfocusin",
799
+ onFocusOut: "onfocusout",
800
+ onHashChange: "onhashchange",
801
+ onInput: "oninput",
802
+ onInvalid: "oninvalid",
803
+ onKeyDown: "onkeydown",
804
+ onKeyPress: "onkeypress",
805
+ onKeyUp: "onkeyup",
806
+ onLoad: "onload",
807
+ onLoadedData: "onloadeddata",
808
+ onLoadedMetadata: "onloadedmetadata",
809
+ onLoadStart: "onloadstart",
810
+ onMessage: "onmessage",
811
+ onMouseDown: "onmousedown",
812
+ onMouseEnter: "onmouseenter",
813
+ onMouseLeave: "onmouseleave",
814
+ onMouseMove: "onmousemove",
815
+ onMouseOut: "onmouseout",
816
+ onMouseOver: "onmouseover",
817
+ onMouseUp: "onmouseup",
818
+ onMouseWheel: "onmousewheel",
819
+ onOffline: "onoffline",
820
+ onOnline: "ononline",
821
+ onPageHide: "onpagehide",
822
+ onPageShow: "onpageshow",
823
+ onPaste: "onpaste",
824
+ onPause: "onpause",
825
+ onPlay: "onplay",
826
+ onPlaying: "onplaying",
827
+ onPopState: "onpopstate",
828
+ onProgress: "onprogress",
829
+ onRateChange: "onratechange",
830
+ onRepeat: "onrepeat",
831
+ onReset: "onreset",
832
+ onResize: "onresize",
833
+ onScroll: "onscroll",
834
+ onSeeked: "onseeked",
835
+ onSeeking: "onseeking",
836
+ onSelect: "onselect",
837
+ onShow: "onshow",
838
+ onStalled: "onstalled",
839
+ onStorage: "onstorage",
840
+ onSubmit: "onsubmit",
841
+ onSuspend: "onsuspend",
842
+ onTimeUpdate: "ontimeupdate",
843
+ onToggle: "ontoggle",
844
+ onUnload: "onunload",
845
+ onVolumeChange: "onvolumechange",
846
+ onWaiting: "onwaiting",
847
+ onZoom: "onzoom",
848
+ overlinePosition: "overline-position",
849
+ overlineThickness: "overline-thickness",
850
+ paintOrder: "paint-order",
851
+ panose1: "panose-1",
852
+ pointerEvents: "pointer-events",
853
+ referrerPolicy: "referrerpolicy",
854
+ renderingIntent: "rendering-intent",
855
+ shapeRendering: "shape-rendering",
856
+ stopColor: "stop-color",
857
+ stopOpacity: "stop-opacity",
858
+ strikethroughPosition: "strikethrough-position",
859
+ strikethroughThickness: "strikethrough-thickness",
860
+ strokeDashArray: "stroke-dasharray",
861
+ strokeDashOffset: "stroke-dashoffset",
862
+ strokeLineCap: "stroke-linecap",
863
+ strokeLineJoin: "stroke-linejoin",
864
+ strokeMiterLimit: "stroke-miterlimit",
865
+ strokeOpacity: "stroke-opacity",
866
+ strokeWidth: "stroke-width",
867
+ tabIndex: "tabindex",
868
+ textAnchor: "text-anchor",
869
+ textDecoration: "text-decoration",
870
+ textRendering: "text-rendering",
871
+ transformOrigin: "transform-origin",
872
+ typeOf: "typeof",
873
+ underlinePosition: "underline-position",
874
+ underlineThickness: "underline-thickness",
875
+ unicodeBidi: "unicode-bidi",
876
+ unicodeRange: "unicode-range",
877
+ unitsPerEm: "units-per-em",
878
+ vAlphabetic: "v-alphabetic",
879
+ vHanging: "v-hanging",
880
+ vIdeographic: "v-ideographic",
881
+ vMathematical: "v-mathematical",
882
+ vectorEffect: "vector-effect",
883
+ vertAdvY: "vert-adv-y",
884
+ vertOriginX: "vert-origin-x",
885
+ vertOriginY: "vert-origin-y",
886
+ wordSpacing: "word-spacing",
887
+ writingMode: "writing-mode",
888
+ xHeight: "x-height",
889
+ // These were camelcased in Tiny. Now lowercased in SVG 2
890
+ playbackOrder: "playbackorder",
891
+ timelineBegin: "timelinebegin"
892
+ },
893
+ properties: {
894
+ about: commaOrSpaceSeparated,
895
+ accentHeight: number,
896
+ accumulate: null,
897
+ additive: null,
898
+ alignmentBaseline: null,
899
+ alphabetic: number,
900
+ amplitude: number,
901
+ arabicForm: null,
902
+ ascent: number,
903
+ attributeName: null,
904
+ attributeType: null,
905
+ azimuth: number,
906
+ bandwidth: null,
907
+ baselineShift: null,
908
+ baseFrequency: null,
909
+ baseProfile: null,
910
+ bbox: null,
911
+ begin: null,
912
+ bias: number,
913
+ by: null,
914
+ calcMode: null,
915
+ capHeight: number,
916
+ className: spaceSeparated,
917
+ clip: null,
918
+ clipPath: null,
919
+ clipPathUnits: null,
920
+ clipRule: null,
921
+ color: null,
922
+ colorInterpolation: null,
923
+ colorInterpolationFilters: null,
924
+ colorProfile: null,
925
+ colorRendering: null,
926
+ content: null,
927
+ contentScriptType: null,
928
+ contentStyleType: null,
929
+ crossOrigin: null,
930
+ cursor: null,
931
+ cx: null,
932
+ cy: null,
933
+ d: null,
934
+ dataType: null,
935
+ defaultAction: null,
936
+ descent: number,
937
+ diffuseConstant: number,
938
+ direction: null,
939
+ display: null,
940
+ dur: null,
941
+ divisor: number,
942
+ dominantBaseline: null,
943
+ download: boolean,
944
+ dx: null,
945
+ dy: null,
946
+ edgeMode: null,
947
+ editable: null,
948
+ elevation: number,
949
+ enableBackground: null,
950
+ end: null,
951
+ event: null,
952
+ exponent: number,
953
+ externalResourcesRequired: null,
954
+ fill: null,
955
+ fillOpacity: number,
956
+ fillRule: null,
957
+ filter: null,
958
+ filterRes: null,
959
+ filterUnits: null,
960
+ floodColor: null,
961
+ floodOpacity: null,
962
+ focusable: null,
963
+ focusHighlight: null,
964
+ fontFamily: null,
965
+ fontSize: null,
966
+ fontSizeAdjust: null,
967
+ fontStretch: null,
968
+ fontStyle: null,
969
+ fontVariant: null,
970
+ fontWeight: null,
971
+ format: null,
972
+ fr: null,
973
+ from: null,
974
+ fx: null,
975
+ fy: null,
976
+ g1: commaSeparated,
977
+ g2: commaSeparated,
978
+ glyphName: commaSeparated,
979
+ glyphOrientationHorizontal: null,
980
+ glyphOrientationVertical: null,
981
+ glyphRef: null,
982
+ gradientTransform: null,
983
+ gradientUnits: null,
984
+ handler: null,
985
+ hanging: number,
986
+ hatchContentUnits: null,
987
+ hatchUnits: null,
988
+ height: null,
989
+ href: null,
990
+ hrefLang: null,
991
+ horizAdvX: number,
992
+ horizOriginX: number,
993
+ horizOriginY: number,
994
+ id: null,
995
+ ideographic: number,
996
+ imageRendering: null,
997
+ initialVisibility: null,
998
+ in: null,
999
+ in2: null,
1000
+ intercept: number,
1001
+ k: number,
1002
+ k1: number,
1003
+ k2: number,
1004
+ k3: number,
1005
+ k4: number,
1006
+ kernelMatrix: commaOrSpaceSeparated,
1007
+ kernelUnitLength: null,
1008
+ keyPoints: null,
1009
+ // SEMI_COLON_SEPARATED
1010
+ keySplines: null,
1011
+ // SEMI_COLON_SEPARATED
1012
+ keyTimes: null,
1013
+ // SEMI_COLON_SEPARATED
1014
+ kerning: null,
1015
+ lang: null,
1016
+ lengthAdjust: null,
1017
+ letterSpacing: null,
1018
+ lightingColor: null,
1019
+ limitingConeAngle: number,
1020
+ local: null,
1021
+ markerEnd: null,
1022
+ markerMid: null,
1023
+ markerStart: null,
1024
+ markerHeight: null,
1025
+ markerUnits: null,
1026
+ markerWidth: null,
1027
+ mask: null,
1028
+ maskContentUnits: null,
1029
+ maskUnits: null,
1030
+ mathematical: null,
1031
+ max: null,
1032
+ media: null,
1033
+ mediaCharacterEncoding: null,
1034
+ mediaContentEncodings: null,
1035
+ mediaSize: number,
1036
+ mediaTime: null,
1037
+ method: null,
1038
+ min: null,
1039
+ mode: null,
1040
+ name: null,
1041
+ navDown: null,
1042
+ navDownLeft: null,
1043
+ navDownRight: null,
1044
+ navLeft: null,
1045
+ navNext: null,
1046
+ navPrev: null,
1047
+ navRight: null,
1048
+ navUp: null,
1049
+ navUpLeft: null,
1050
+ navUpRight: null,
1051
+ numOctaves: null,
1052
+ observer: null,
1053
+ offset: null,
1054
+ onAbort: null,
1055
+ onActivate: null,
1056
+ onAfterPrint: null,
1057
+ onBeforePrint: null,
1058
+ onBegin: null,
1059
+ onCancel: null,
1060
+ onCanPlay: null,
1061
+ onCanPlayThrough: null,
1062
+ onChange: null,
1063
+ onClick: null,
1064
+ onClose: null,
1065
+ onCopy: null,
1066
+ onCueChange: null,
1067
+ onCut: null,
1068
+ onDblClick: null,
1069
+ onDrag: null,
1070
+ onDragEnd: null,
1071
+ onDragEnter: null,
1072
+ onDragExit: null,
1073
+ onDragLeave: null,
1074
+ onDragOver: null,
1075
+ onDragStart: null,
1076
+ onDrop: null,
1077
+ onDurationChange: null,
1078
+ onEmptied: null,
1079
+ onEnd: null,
1080
+ onEnded: null,
1081
+ onError: null,
1082
+ onFocus: null,
1083
+ onFocusIn: null,
1084
+ onFocusOut: null,
1085
+ onHashChange: null,
1086
+ onInput: null,
1087
+ onInvalid: null,
1088
+ onKeyDown: null,
1089
+ onKeyPress: null,
1090
+ onKeyUp: null,
1091
+ onLoad: null,
1092
+ onLoadedData: null,
1093
+ onLoadedMetadata: null,
1094
+ onLoadStart: null,
1095
+ onMessage: null,
1096
+ onMouseDown: null,
1097
+ onMouseEnter: null,
1098
+ onMouseLeave: null,
1099
+ onMouseMove: null,
1100
+ onMouseOut: null,
1101
+ onMouseOver: null,
1102
+ onMouseUp: null,
1103
+ onMouseWheel: null,
1104
+ onOffline: null,
1105
+ onOnline: null,
1106
+ onPageHide: null,
1107
+ onPageShow: null,
1108
+ onPaste: null,
1109
+ onPause: null,
1110
+ onPlay: null,
1111
+ onPlaying: null,
1112
+ onPopState: null,
1113
+ onProgress: null,
1114
+ onRateChange: null,
1115
+ onRepeat: null,
1116
+ onReset: null,
1117
+ onResize: null,
1118
+ onScroll: null,
1119
+ onSeeked: null,
1120
+ onSeeking: null,
1121
+ onSelect: null,
1122
+ onShow: null,
1123
+ onStalled: null,
1124
+ onStorage: null,
1125
+ onSubmit: null,
1126
+ onSuspend: null,
1127
+ onTimeUpdate: null,
1128
+ onToggle: null,
1129
+ onUnload: null,
1130
+ onVolumeChange: null,
1131
+ onWaiting: null,
1132
+ onZoom: null,
1133
+ opacity: null,
1134
+ operator: null,
1135
+ order: null,
1136
+ orient: null,
1137
+ orientation: null,
1138
+ origin: null,
1139
+ overflow: null,
1140
+ overlay: null,
1141
+ overlinePosition: number,
1142
+ overlineThickness: number,
1143
+ paintOrder: null,
1144
+ panose1: null,
1145
+ path: null,
1146
+ pathLength: number,
1147
+ patternContentUnits: null,
1148
+ patternTransform: null,
1149
+ patternUnits: null,
1150
+ phase: null,
1151
+ ping: spaceSeparated,
1152
+ pitch: null,
1153
+ playbackOrder: null,
1154
+ pointerEvents: null,
1155
+ points: null,
1156
+ pointsAtX: number,
1157
+ pointsAtY: number,
1158
+ pointsAtZ: number,
1159
+ preserveAlpha: null,
1160
+ preserveAspectRatio: null,
1161
+ primitiveUnits: null,
1162
+ propagate: null,
1163
+ property: commaOrSpaceSeparated,
1164
+ r: null,
1165
+ radius: null,
1166
+ referrerPolicy: null,
1167
+ refX: null,
1168
+ refY: null,
1169
+ rel: commaOrSpaceSeparated,
1170
+ rev: commaOrSpaceSeparated,
1171
+ renderingIntent: null,
1172
+ repeatCount: null,
1173
+ repeatDur: null,
1174
+ requiredExtensions: commaOrSpaceSeparated,
1175
+ requiredFeatures: commaOrSpaceSeparated,
1176
+ requiredFonts: commaOrSpaceSeparated,
1177
+ requiredFormats: commaOrSpaceSeparated,
1178
+ resource: null,
1179
+ restart: null,
1180
+ result: null,
1181
+ rotate: null,
1182
+ rx: null,
1183
+ ry: null,
1184
+ scale: null,
1185
+ seed: null,
1186
+ shapeRendering: null,
1187
+ side: null,
1188
+ slope: null,
1189
+ snapshotTime: null,
1190
+ specularConstant: number,
1191
+ specularExponent: number,
1192
+ spreadMethod: null,
1193
+ spacing: null,
1194
+ startOffset: null,
1195
+ stdDeviation: null,
1196
+ stemh: null,
1197
+ stemv: null,
1198
+ stitchTiles: null,
1199
+ stopColor: null,
1200
+ stopOpacity: null,
1201
+ strikethroughPosition: number,
1202
+ strikethroughThickness: number,
1203
+ string: null,
1204
+ stroke: null,
1205
+ strokeDashArray: commaOrSpaceSeparated,
1206
+ strokeDashOffset: null,
1207
+ strokeLineCap: null,
1208
+ strokeLineJoin: null,
1209
+ strokeMiterLimit: number,
1210
+ strokeOpacity: number,
1211
+ strokeWidth: null,
1212
+ style: null,
1213
+ surfaceScale: number,
1214
+ syncBehavior: null,
1215
+ syncBehaviorDefault: null,
1216
+ syncMaster: null,
1217
+ syncTolerance: null,
1218
+ syncToleranceDefault: null,
1219
+ systemLanguage: commaOrSpaceSeparated,
1220
+ tabIndex: number,
1221
+ tableValues: null,
1222
+ target: null,
1223
+ targetX: number,
1224
+ targetY: number,
1225
+ textAnchor: null,
1226
+ textDecoration: null,
1227
+ textRendering: null,
1228
+ textLength: null,
1229
+ timelineBegin: null,
1230
+ title: null,
1231
+ transformBehavior: null,
1232
+ type: null,
1233
+ typeOf: commaOrSpaceSeparated,
1234
+ to: null,
1235
+ transform: null,
1236
+ transformOrigin: null,
1237
+ u1: null,
1238
+ u2: null,
1239
+ underlinePosition: number,
1240
+ underlineThickness: number,
1241
+ unicode: null,
1242
+ unicodeBidi: null,
1243
+ unicodeRange: null,
1244
+ unitsPerEm: number,
1245
+ values: null,
1246
+ vAlphabetic: number,
1247
+ vMathematical: number,
1248
+ vectorEffect: null,
1249
+ vHanging: number,
1250
+ vIdeographic: number,
1251
+ version: null,
1252
+ vertAdvY: number,
1253
+ vertOriginX: number,
1254
+ vertOriginY: number,
1255
+ viewBox: null,
1256
+ viewTarget: null,
1257
+ visibility: null,
1258
+ width: null,
1259
+ widths: null,
1260
+ wordSpacing: null,
1261
+ writingMode: null,
1262
+ x: null,
1263
+ x1: null,
1264
+ x2: null,
1265
+ xChannelSelector: null,
1266
+ xHeight: number,
1267
+ y: null,
1268
+ y1: null,
1269
+ y2: null,
1270
+ yChannelSelector: null,
1271
+ z: null,
1272
+ zoomAndPan: null
1273
+ },
1274
+ space: "svg",
1275
+ transform: caseSensitiveTransform
1276
+ });
1277
+
1278
+ // node_modules/property-information/lib/xlink.js
1279
+ var xlink = create({
1280
+ properties: {
1281
+ xLinkActuate: null,
1282
+ xLinkArcRole: null,
1283
+ xLinkHref: null,
1284
+ xLinkRole: null,
1285
+ xLinkShow: null,
1286
+ xLinkTitle: null,
1287
+ xLinkType: null
1288
+ },
1289
+ space: "xlink",
1290
+ transform(_3, property) {
1291
+ return "xlink:" + property.slice(5).toLowerCase();
1292
+ }
1293
+ });
1294
+
1295
+ // node_modules/property-information/lib/xmlns.js
1296
+ var xmlns = create({
1297
+ attributes: { xmlnsxlink: "xmlns:xlink" },
1298
+ properties: { xmlnsXLink: null, xmlns: null },
1299
+ space: "xmlns",
1300
+ transform: caseInsensitiveTransform
1301
+ });
1302
+
1303
+ // node_modules/property-information/lib/xml.js
1304
+ var xml = create({
1305
+ properties: { xmlBase: null, xmlLang: null, xmlSpace: null },
1306
+ space: "xml",
1307
+ transform(_3, property) {
1308
+ return "xml:" + property.slice(3).toLowerCase();
1309
+ }
1310
+ });
1311
+
1312
+ // node_modules/property-information/lib/find.js
1313
+ var cap = /[A-Z]/g;
1314
+ var dash = /-[a-z]/g;
1315
+ var valid = /^data[-\w.:]+$/i;
1316
+ function find(schema, value) {
1317
+ const normal = normalize(value);
1318
+ let property = value;
1319
+ let Type = Info;
1320
+ if (normal in schema.normal) {
1321
+ return schema.property[schema.normal[normal]];
1322
+ }
1323
+ if (normal.length > 4 && normal.slice(0, 4) === "data" && valid.test(value)) {
1324
+ if (value.charAt(4) === "-") {
1325
+ const rest = value.slice(5).replace(dash, camelcase);
1326
+ property = "data" + rest.charAt(0).toUpperCase() + rest.slice(1);
1327
+ } else {
1328
+ const rest = value.slice(4);
1329
+ if (!dash.test(rest)) {
1330
+ let dashes = rest.replace(cap, kebab);
1331
+ if (dashes.charAt(0) !== "-") {
1332
+ dashes = "-" + dashes;
1333
+ }
1334
+ value = "data" + dashes;
1335
+ }
1336
+ }
1337
+ Type = DefinedInfo;
1338
+ }
1339
+ return new Type(property, value);
1340
+ }
1341
+ function kebab($0) {
1342
+ return "-" + $0.toLowerCase();
1343
+ }
1344
+ function camelcase($0) {
1345
+ return $0.charAt(1).toUpperCase();
1346
+ }
1347
+
1348
+ // node_modules/property-information/index.js
1349
+ var html2 = merge([aria, html, xlink, xmlns, xml], "html");
1350
+ var svg2 = merge([aria, svg, xlink, xmlns, xml], "svg");
1351
+
1352
+ // node_modules/zwitch/index.js
1353
+ var own2 = {}.hasOwnProperty;
1354
+ function zwitch(key2, options) {
1355
+ const settings = options || {};
1356
+ function one2(value, ...parameters) {
1357
+ let fn = one2.invalid;
1358
+ const handlers = one2.handlers;
1359
+ if (value && own2.call(value, key2)) {
1360
+ const id = String(value[key2]);
1361
+ fn = own2.call(handlers, id) ? handlers[id] : one2.unknown;
1362
+ }
1363
+ if (fn) {
1364
+ return fn.call(this, value, ...parameters);
1365
+ }
1366
+ }
1367
+ one2.handlers = settings.handlers || {};
1368
+ one2.invalid = settings.invalid;
1369
+ one2.unknown = settings.unknown;
1370
+ return one2;
1371
+ }
1372
+
1373
+ // node_modules/stringify-entities/lib/core.js
1374
+ var defaultSubsetRegex = /["&'<>`]/g;
1375
+ var surrogatePairsRegex = /[\uD800-\uDBFF][\uDC00-\uDFFF]/g;
1376
+ var controlCharactersRegex = (
1377
+ // eslint-disable-next-line no-control-regex, unicorn/no-hex-escape
1378
+ /[\x01-\t\v\f\x0E-\x1F\x7F\x81\x8D\x8F\x90\x9D\xA0-\uFFFF]/g
1379
+ );
1380
+ var regexEscapeRegex = /[|\\{}()[\]^$+*?.]/g;
1381
+ var subsetToRegexCache = /* @__PURE__ */ new WeakMap();
1382
+ function core(value, options) {
1383
+ value = value.replace(
1384
+ options.subset ? charactersToExpressionCached(options.subset) : defaultSubsetRegex,
1385
+ basic
1386
+ );
1387
+ if (options.subset || options.escapeOnly) {
1388
+ return value;
1389
+ }
1390
+ return value.replace(surrogatePairsRegex, surrogate).replace(controlCharactersRegex, basic);
1391
+ function surrogate(pair, index, all2) {
1392
+ return options.format(
1393
+ (pair.charCodeAt(0) - 55296) * 1024 + pair.charCodeAt(1) - 56320 + 65536,
1394
+ all2.charCodeAt(index + 2),
1395
+ options
1396
+ );
1397
+ }
1398
+ function basic(character, index, all2) {
1399
+ return options.format(
1400
+ character.charCodeAt(0),
1401
+ all2.charCodeAt(index + 1),
1402
+ options
1403
+ );
1404
+ }
1405
+ }
1406
+ function charactersToExpressionCached(subset) {
1407
+ let cached = subsetToRegexCache.get(subset);
1408
+ if (!cached) {
1409
+ cached = charactersToExpression(subset);
1410
+ subsetToRegexCache.set(subset, cached);
1411
+ }
1412
+ return cached;
1413
+ }
1414
+ function charactersToExpression(subset) {
1415
+ const groups = [];
1416
+ let index = -1;
1417
+ while (++index < subset.length) {
1418
+ groups.push(subset[index].replace(regexEscapeRegex, "\\$&"));
1419
+ }
1420
+ return new RegExp("(?:" + groups.join("|") + ")", "g");
1421
+ }
1422
+
1423
+ // node_modules/stringify-entities/lib/util/to-hexadecimal.js
1424
+ var hexadecimalRegex = /[\dA-Fa-f]/;
1425
+ function toHexadecimal(code, next, omit) {
1426
+ const value = "&#x" + code.toString(16).toUpperCase();
1427
+ return omit && next && !hexadecimalRegex.test(String.fromCharCode(next)) ? value : value + ";";
1428
+ }
1429
+
1430
+ // node_modules/stringify-entities/lib/util/to-decimal.js
1431
+ var decimalRegex = /\d/;
1432
+ function toDecimal(code, next, omit) {
1433
+ const value = "&#" + String(code);
1434
+ return omit && next && !decimalRegex.test(String.fromCharCode(next)) ? value : value + ";";
1435
+ }
1436
+
1437
+ // node_modules/character-entities-legacy/index.js
1438
+ var characterEntitiesLegacy = [
1439
+ "AElig",
1440
+ "AMP",
1441
+ "Aacute",
1442
+ "Acirc",
1443
+ "Agrave",
1444
+ "Aring",
1445
+ "Atilde",
1446
+ "Auml",
1447
+ "COPY",
1448
+ "Ccedil",
1449
+ "ETH",
1450
+ "Eacute",
1451
+ "Ecirc",
1452
+ "Egrave",
1453
+ "Euml",
1454
+ "GT",
1455
+ "Iacute",
1456
+ "Icirc",
1457
+ "Igrave",
1458
+ "Iuml",
1459
+ "LT",
1460
+ "Ntilde",
1461
+ "Oacute",
1462
+ "Ocirc",
1463
+ "Ograve",
1464
+ "Oslash",
1465
+ "Otilde",
1466
+ "Ouml",
1467
+ "QUOT",
1468
+ "REG",
1469
+ "THORN",
1470
+ "Uacute",
1471
+ "Ucirc",
1472
+ "Ugrave",
1473
+ "Uuml",
1474
+ "Yacute",
1475
+ "aacute",
1476
+ "acirc",
1477
+ "acute",
1478
+ "aelig",
1479
+ "agrave",
1480
+ "amp",
1481
+ "aring",
1482
+ "atilde",
1483
+ "auml",
1484
+ "brvbar",
1485
+ "ccedil",
1486
+ "cedil",
1487
+ "cent",
1488
+ "copy",
1489
+ "curren",
1490
+ "deg",
1491
+ "divide",
1492
+ "eacute",
1493
+ "ecirc",
1494
+ "egrave",
1495
+ "eth",
1496
+ "euml",
1497
+ "frac12",
1498
+ "frac14",
1499
+ "frac34",
1500
+ "gt",
1501
+ "iacute",
1502
+ "icirc",
1503
+ "iexcl",
1504
+ "igrave",
1505
+ "iquest",
1506
+ "iuml",
1507
+ "laquo",
1508
+ "lt",
1509
+ "macr",
1510
+ "micro",
1511
+ "middot",
1512
+ "nbsp",
1513
+ "not",
1514
+ "ntilde",
1515
+ "oacute",
1516
+ "ocirc",
1517
+ "ograve",
1518
+ "ordf",
1519
+ "ordm",
1520
+ "oslash",
1521
+ "otilde",
1522
+ "ouml",
1523
+ "para",
1524
+ "plusmn",
1525
+ "pound",
1526
+ "quot",
1527
+ "raquo",
1528
+ "reg",
1529
+ "sect",
1530
+ "shy",
1531
+ "sup1",
1532
+ "sup2",
1533
+ "sup3",
1534
+ "szlig",
1535
+ "thorn",
1536
+ "times",
1537
+ "uacute",
1538
+ "ucirc",
1539
+ "ugrave",
1540
+ "uml",
1541
+ "uuml",
1542
+ "yacute",
1543
+ "yen",
1544
+ "yuml"
1545
+ ];
1546
+
1547
+ // node_modules/character-entities-html4/index.js
1548
+ var characterEntitiesHtml4 = {
1549
+ nbsp: "\xA0",
1550
+ iexcl: "\xA1",
1551
+ cent: "\xA2",
1552
+ pound: "\xA3",
1553
+ curren: "\xA4",
1554
+ yen: "\xA5",
1555
+ brvbar: "\xA6",
1556
+ sect: "\xA7",
1557
+ uml: "\xA8",
1558
+ copy: "\xA9",
1559
+ ordf: "\xAA",
1560
+ laquo: "\xAB",
1561
+ not: "\xAC",
1562
+ shy: "\xAD",
1563
+ reg: "\xAE",
1564
+ macr: "\xAF",
1565
+ deg: "\xB0",
1566
+ plusmn: "\xB1",
1567
+ sup2: "\xB2",
1568
+ sup3: "\xB3",
1569
+ acute: "\xB4",
1570
+ micro: "\xB5",
1571
+ para: "\xB6",
1572
+ middot: "\xB7",
1573
+ cedil: "\xB8",
1574
+ sup1: "\xB9",
1575
+ ordm: "\xBA",
1576
+ raquo: "\xBB",
1577
+ frac14: "\xBC",
1578
+ frac12: "\xBD",
1579
+ frac34: "\xBE",
1580
+ iquest: "\xBF",
1581
+ Agrave: "\xC0",
1582
+ Aacute: "\xC1",
1583
+ Acirc: "\xC2",
1584
+ Atilde: "\xC3",
1585
+ Auml: "\xC4",
1586
+ Aring: "\xC5",
1587
+ AElig: "\xC6",
1588
+ Ccedil: "\xC7",
1589
+ Egrave: "\xC8",
1590
+ Eacute: "\xC9",
1591
+ Ecirc: "\xCA",
1592
+ Euml: "\xCB",
1593
+ Igrave: "\xCC",
1594
+ Iacute: "\xCD",
1595
+ Icirc: "\xCE",
1596
+ Iuml: "\xCF",
1597
+ ETH: "\xD0",
1598
+ Ntilde: "\xD1",
1599
+ Ograve: "\xD2",
1600
+ Oacute: "\xD3",
1601
+ Ocirc: "\xD4",
1602
+ Otilde: "\xD5",
1603
+ Ouml: "\xD6",
1604
+ times: "\xD7",
1605
+ Oslash: "\xD8",
1606
+ Ugrave: "\xD9",
1607
+ Uacute: "\xDA",
1608
+ Ucirc: "\xDB",
1609
+ Uuml: "\xDC",
1610
+ Yacute: "\xDD",
1611
+ THORN: "\xDE",
1612
+ szlig: "\xDF",
1613
+ agrave: "\xE0",
1614
+ aacute: "\xE1",
1615
+ acirc: "\xE2",
1616
+ atilde: "\xE3",
1617
+ auml: "\xE4",
1618
+ aring: "\xE5",
1619
+ aelig: "\xE6",
1620
+ ccedil: "\xE7",
1621
+ egrave: "\xE8",
1622
+ eacute: "\xE9",
1623
+ ecirc: "\xEA",
1624
+ euml: "\xEB",
1625
+ igrave: "\xEC",
1626
+ iacute: "\xED",
1627
+ icirc: "\xEE",
1628
+ iuml: "\xEF",
1629
+ eth: "\xF0",
1630
+ ntilde: "\xF1",
1631
+ ograve: "\xF2",
1632
+ oacute: "\xF3",
1633
+ ocirc: "\xF4",
1634
+ otilde: "\xF5",
1635
+ ouml: "\xF6",
1636
+ divide: "\xF7",
1637
+ oslash: "\xF8",
1638
+ ugrave: "\xF9",
1639
+ uacute: "\xFA",
1640
+ ucirc: "\xFB",
1641
+ uuml: "\xFC",
1642
+ yacute: "\xFD",
1643
+ thorn: "\xFE",
1644
+ yuml: "\xFF",
1645
+ fnof: "\u0192",
1646
+ Alpha: "\u0391",
1647
+ Beta: "\u0392",
1648
+ Gamma: "\u0393",
1649
+ Delta: "\u0394",
1650
+ Epsilon: "\u0395",
1651
+ Zeta: "\u0396",
1652
+ Eta: "\u0397",
1653
+ Theta: "\u0398",
1654
+ Iota: "\u0399",
1655
+ Kappa: "\u039A",
1656
+ Lambda: "\u039B",
1657
+ Mu: "\u039C",
1658
+ Nu: "\u039D",
1659
+ Xi: "\u039E",
1660
+ Omicron: "\u039F",
1661
+ Pi: "\u03A0",
1662
+ Rho: "\u03A1",
1663
+ Sigma: "\u03A3",
1664
+ Tau: "\u03A4",
1665
+ Upsilon: "\u03A5",
1666
+ Phi: "\u03A6",
1667
+ Chi: "\u03A7",
1668
+ Psi: "\u03A8",
1669
+ Omega: "\u03A9",
1670
+ alpha: "\u03B1",
1671
+ beta: "\u03B2",
1672
+ gamma: "\u03B3",
1673
+ delta: "\u03B4",
1674
+ epsilon: "\u03B5",
1675
+ zeta: "\u03B6",
1676
+ eta: "\u03B7",
1677
+ theta: "\u03B8",
1678
+ iota: "\u03B9",
1679
+ kappa: "\u03BA",
1680
+ lambda: "\u03BB",
1681
+ mu: "\u03BC",
1682
+ nu: "\u03BD",
1683
+ xi: "\u03BE",
1684
+ omicron: "\u03BF",
1685
+ pi: "\u03C0",
1686
+ rho: "\u03C1",
1687
+ sigmaf: "\u03C2",
1688
+ sigma: "\u03C3",
1689
+ tau: "\u03C4",
1690
+ upsilon: "\u03C5",
1691
+ phi: "\u03C6",
1692
+ chi: "\u03C7",
1693
+ psi: "\u03C8",
1694
+ omega: "\u03C9",
1695
+ thetasym: "\u03D1",
1696
+ upsih: "\u03D2",
1697
+ piv: "\u03D6",
1698
+ bull: "\u2022",
1699
+ hellip: "\u2026",
1700
+ prime: "\u2032",
1701
+ Prime: "\u2033",
1702
+ oline: "\u203E",
1703
+ frasl: "\u2044",
1704
+ weierp: "\u2118",
1705
+ image: "\u2111",
1706
+ real: "\u211C",
1707
+ trade: "\u2122",
1708
+ alefsym: "\u2135",
1709
+ larr: "\u2190",
1710
+ uarr: "\u2191",
1711
+ rarr: "\u2192",
1712
+ darr: "\u2193",
1713
+ harr: "\u2194",
1714
+ crarr: "\u21B5",
1715
+ lArr: "\u21D0",
1716
+ uArr: "\u21D1",
1717
+ rArr: "\u21D2",
1718
+ dArr: "\u21D3",
1719
+ hArr: "\u21D4",
1720
+ forall: "\u2200",
1721
+ part: "\u2202",
1722
+ exist: "\u2203",
1723
+ empty: "\u2205",
1724
+ nabla: "\u2207",
1725
+ isin: "\u2208",
1726
+ notin: "\u2209",
1727
+ ni: "\u220B",
1728
+ prod: "\u220F",
1729
+ sum: "\u2211",
1730
+ minus: "\u2212",
1731
+ lowast: "\u2217",
1732
+ radic: "\u221A",
1733
+ prop: "\u221D",
1734
+ infin: "\u221E",
1735
+ ang: "\u2220",
1736
+ and: "\u2227",
1737
+ or: "\u2228",
1738
+ cap: "\u2229",
1739
+ cup: "\u222A",
1740
+ int: "\u222B",
1741
+ there4: "\u2234",
1742
+ sim: "\u223C",
1743
+ cong: "\u2245",
1744
+ asymp: "\u2248",
1745
+ ne: "\u2260",
1746
+ equiv: "\u2261",
1747
+ le: "\u2264",
1748
+ ge: "\u2265",
1749
+ sub: "\u2282",
1750
+ sup: "\u2283",
1751
+ nsub: "\u2284",
1752
+ sube: "\u2286",
1753
+ supe: "\u2287",
1754
+ oplus: "\u2295",
1755
+ otimes: "\u2297",
1756
+ perp: "\u22A5",
1757
+ sdot: "\u22C5",
1758
+ lceil: "\u2308",
1759
+ rceil: "\u2309",
1760
+ lfloor: "\u230A",
1761
+ rfloor: "\u230B",
1762
+ lang: "\u2329",
1763
+ rang: "\u232A",
1764
+ loz: "\u25CA",
1765
+ spades: "\u2660",
1766
+ clubs: "\u2663",
1767
+ hearts: "\u2665",
1768
+ diams: "\u2666",
1769
+ quot: '"',
1770
+ amp: "&",
1771
+ lt: "<",
1772
+ gt: ">",
1773
+ OElig: "\u0152",
1774
+ oelig: "\u0153",
1775
+ Scaron: "\u0160",
1776
+ scaron: "\u0161",
1777
+ Yuml: "\u0178",
1778
+ circ: "\u02C6",
1779
+ tilde: "\u02DC",
1780
+ ensp: "\u2002",
1781
+ emsp: "\u2003",
1782
+ thinsp: "\u2009",
1783
+ zwnj: "\u200C",
1784
+ zwj: "\u200D",
1785
+ lrm: "\u200E",
1786
+ rlm: "\u200F",
1787
+ ndash: "\u2013",
1788
+ mdash: "\u2014",
1789
+ lsquo: "\u2018",
1790
+ rsquo: "\u2019",
1791
+ sbquo: "\u201A",
1792
+ ldquo: "\u201C",
1793
+ rdquo: "\u201D",
1794
+ bdquo: "\u201E",
1795
+ dagger: "\u2020",
1796
+ Dagger: "\u2021",
1797
+ permil: "\u2030",
1798
+ lsaquo: "\u2039",
1799
+ rsaquo: "\u203A",
1800
+ euro: "\u20AC"
1801
+ };
1802
+
1803
+ // node_modules/stringify-entities/lib/constant/dangerous.js
1804
+ var dangerous = [
1805
+ "cent",
1806
+ "copy",
1807
+ "divide",
1808
+ "gt",
1809
+ "lt",
1810
+ "not",
1811
+ "para",
1812
+ "times"
1813
+ ];
1814
+
1815
+ // node_modules/stringify-entities/lib/util/to-named.js
1816
+ var own3 = {}.hasOwnProperty;
1817
+ var characters = {};
1818
+ var key;
1819
+ for (key in characterEntitiesHtml4) {
1820
+ if (own3.call(characterEntitiesHtml4, key)) {
1821
+ characters[characterEntitiesHtml4[key]] = key;
1822
+ }
1823
+ }
1824
+ var notAlphanumericRegex = /[^\dA-Za-z]/;
1825
+ function toNamed(code, next, omit, attribute) {
1826
+ const character = String.fromCharCode(code);
1827
+ if (own3.call(characters, character)) {
1828
+ const name = characters[character];
1829
+ const value = "&" + name;
1830
+ if (omit && characterEntitiesLegacy.includes(name) && !dangerous.includes(name) && (!attribute || next && next !== 61 && notAlphanumericRegex.test(String.fromCharCode(next)))) {
1831
+ return value;
1832
+ }
1833
+ return value + ";";
1834
+ }
1835
+ return "";
1836
+ }
1837
+
1838
+ // node_modules/stringify-entities/lib/util/format-smart.js
1839
+ function formatSmart(code, next, options) {
1840
+ let numeric = toHexadecimal(code, next, options.omitOptionalSemicolons);
1841
+ let named;
1842
+ if (options.useNamedReferences || options.useShortestReferences) {
1843
+ named = toNamed(
1844
+ code,
1845
+ next,
1846
+ options.omitOptionalSemicolons,
1847
+ options.attribute
1848
+ );
1849
+ }
1850
+ if ((options.useShortestReferences || !named) && options.useShortestReferences) {
1851
+ const decimal = toDecimal(code, next, options.omitOptionalSemicolons);
1852
+ if (decimal.length < numeric.length) {
1853
+ numeric = decimal;
1854
+ }
1855
+ }
1856
+ return named && (!options.useShortestReferences || named.length < numeric.length) ? named : numeric;
1857
+ }
1858
+
1859
+ // node_modules/stringify-entities/lib/index.js
1860
+ function stringifyEntities(value, options) {
1861
+ return core(value, Object.assign({ format: formatSmart }, options));
1862
+ }
1863
+
1864
+ // node_modules/hast-util-to-html/lib/handle/comment.js
1865
+ var htmlCommentRegex = /^>|^->|<!--|-->|--!>|<!-$/g;
1866
+ var bogusCommentEntitySubset = [">"];
1867
+ var commentEntitySubset = ["<", ">"];
1868
+ function comment(node, _1, _22, state) {
1869
+ return state.settings.bogusComments ? "<?" + stringifyEntities(
1870
+ node.value,
1871
+ Object.assign({}, state.settings.characterReferences, {
1872
+ subset: bogusCommentEntitySubset
1873
+ })
1874
+ ) + ">" : "<!--" + node.value.replace(htmlCommentRegex, encode) + "-->";
1875
+ function encode($0) {
1876
+ return stringifyEntities(
1877
+ $0,
1878
+ Object.assign({}, state.settings.characterReferences, {
1879
+ subset: commentEntitySubset
1880
+ })
1881
+ );
1882
+ }
1883
+ }
1884
+
1885
+ // node_modules/hast-util-to-html/lib/handle/doctype.js
1886
+ function doctype(_1, _22, _3, state) {
1887
+ return "<!" + (state.settings.upperDoctype ? "DOCTYPE" : "doctype") + (state.settings.tightDoctype ? "" : " ") + "html>";
1888
+ }
1889
+
1890
+ // node_modules/ccount/index.js
1891
+ function ccount(value, character) {
1892
+ const source = String(value);
1893
+ if (typeof character !== "string") {
1894
+ throw new TypeError("Expected character");
1895
+ }
1896
+ let count = 0;
1897
+ let index = source.indexOf(character);
1898
+ while (index !== -1) {
1899
+ count++;
1900
+ index = source.indexOf(character, index + character.length);
1901
+ }
1902
+ return count;
1903
+ }
1904
+
1905
+ // node_modules/comma-separated-tokens/index.js
1906
+ function stringify(values, options) {
1907
+ const settings = options || {};
1908
+ const input = values[values.length - 1] === "" ? [...values, ""] : values;
1909
+ return input.join(
1910
+ (settings.padRight ? " " : "") + "," + (settings.padLeft === false ? "" : " ")
1911
+ ).trim();
1912
+ }
1913
+
1914
+ // node_modules/space-separated-tokens/index.js
1915
+ function stringify2(values) {
1916
+ return values.join(" ").trim();
1917
+ }
1918
+
1919
+ // node_modules/hast-util-whitespace/lib/index.js
1920
+ var re = /[ \t\n\f\r]/g;
1921
+ function whitespace(thing) {
1922
+ return typeof thing === "object" ? thing.type === "text" ? empty(thing.value) : false : empty(thing);
1923
+ }
1924
+ function empty(value) {
1925
+ return value.replace(re, "") === "";
1926
+ }
1927
+
1928
+ // node_modules/hast-util-to-html/lib/omission/util/siblings.js
1929
+ var siblingAfter = siblings(1);
1930
+ var siblingBefore = siblings(-1);
1931
+ var emptyChildren = [];
1932
+ function siblings(increment2) {
1933
+ return sibling;
1934
+ function sibling(parent, index, includeWhitespace) {
1935
+ const siblings2 = parent ? parent.children : emptyChildren;
1936
+ let offset = (index || 0) + increment2;
1937
+ let next = siblings2[offset];
1938
+ if (!includeWhitespace) {
1939
+ while (next && whitespace(next)) {
1940
+ offset += increment2;
1941
+ next = siblings2[offset];
1942
+ }
1943
+ }
1944
+ return next;
1945
+ }
1946
+ }
1947
+
1948
+ // node_modules/hast-util-to-html/lib/omission/omission.js
1949
+ var own4 = {}.hasOwnProperty;
1950
+ function omission(handlers) {
1951
+ return omit;
1952
+ function omit(node, index, parent) {
1953
+ return own4.call(handlers, node.tagName) && handlers[node.tagName](node, index, parent);
1954
+ }
1955
+ }
1956
+
1957
+ // node_modules/hast-util-to-html/lib/omission/closing.js
1958
+ var closing = omission({
1959
+ body,
1960
+ caption: headOrColgroupOrCaption,
1961
+ colgroup: headOrColgroupOrCaption,
1962
+ dd,
1963
+ dt,
1964
+ head: headOrColgroupOrCaption,
1965
+ html: html3,
1966
+ li,
1967
+ optgroup,
1968
+ option,
1969
+ p,
1970
+ rp: rubyElement,
1971
+ rt: rubyElement,
1972
+ tbody,
1973
+ td: cells,
1974
+ tfoot,
1975
+ th: cells,
1976
+ thead,
1977
+ tr
1978
+ });
1979
+ function headOrColgroupOrCaption(_3, index, parent) {
1980
+ const next = siblingAfter(parent, index, true);
1981
+ return !next || next.type !== "comment" && !(next.type === "text" && whitespace(next.value.charAt(0)));
1982
+ }
1983
+ function html3(_3, index, parent) {
1984
+ const next = siblingAfter(parent, index);
1985
+ return !next || next.type !== "comment";
1986
+ }
1987
+ function body(_3, index, parent) {
1988
+ const next = siblingAfter(parent, index);
1989
+ return !next || next.type !== "comment";
1990
+ }
1991
+ function p(_3, index, parent) {
1992
+ const next = siblingAfter(parent, index);
1993
+ return next ? next.type === "element" && (next.tagName === "address" || next.tagName === "article" || next.tagName === "aside" || next.tagName === "blockquote" || next.tagName === "details" || next.tagName === "div" || next.tagName === "dl" || next.tagName === "fieldset" || next.tagName === "figcaption" || next.tagName === "figure" || next.tagName === "footer" || next.tagName === "form" || next.tagName === "h1" || next.tagName === "h2" || next.tagName === "h3" || next.tagName === "h4" || next.tagName === "h5" || next.tagName === "h6" || next.tagName === "header" || next.tagName === "hgroup" || next.tagName === "hr" || next.tagName === "main" || next.tagName === "menu" || next.tagName === "nav" || next.tagName === "ol" || next.tagName === "p" || next.tagName === "pre" || next.tagName === "section" || next.tagName === "table" || next.tagName === "ul") : !parent || // Confusing parent.
1994
+ !(parent.type === "element" && (parent.tagName === "a" || parent.tagName === "audio" || parent.tagName === "del" || parent.tagName === "ins" || parent.tagName === "map" || parent.tagName === "noscript" || parent.tagName === "video"));
1995
+ }
1996
+ function li(_3, index, parent) {
1997
+ const next = siblingAfter(parent, index);
1998
+ return !next || next.type === "element" && next.tagName === "li";
1999
+ }
2000
+ function dt(_3, index, parent) {
2001
+ const next = siblingAfter(parent, index);
2002
+ return Boolean(
2003
+ next && next.type === "element" && (next.tagName === "dt" || next.tagName === "dd")
2004
+ );
2005
+ }
2006
+ function dd(_3, index, parent) {
2007
+ const next = siblingAfter(parent, index);
2008
+ return !next || next.type === "element" && (next.tagName === "dt" || next.tagName === "dd");
2009
+ }
2010
+ function rubyElement(_3, index, parent) {
2011
+ const next = siblingAfter(parent, index);
2012
+ return !next || next.type === "element" && (next.tagName === "rp" || next.tagName === "rt");
2013
+ }
2014
+ function optgroup(_3, index, parent) {
2015
+ const next = siblingAfter(parent, index);
2016
+ return !next || next.type === "element" && next.tagName === "optgroup";
2017
+ }
2018
+ function option(_3, index, parent) {
2019
+ const next = siblingAfter(parent, index);
2020
+ return !next || next.type === "element" && (next.tagName === "option" || next.tagName === "optgroup");
2021
+ }
2022
+ function thead(_3, index, parent) {
2023
+ const next = siblingAfter(parent, index);
2024
+ return Boolean(
2025
+ next && next.type === "element" && (next.tagName === "tbody" || next.tagName === "tfoot")
2026
+ );
2027
+ }
2028
+ function tbody(_3, index, parent) {
2029
+ const next = siblingAfter(parent, index);
2030
+ return !next || next.type === "element" && (next.tagName === "tbody" || next.tagName === "tfoot");
2031
+ }
2032
+ function tfoot(_3, index, parent) {
2033
+ return !siblingAfter(parent, index);
2034
+ }
2035
+ function tr(_3, index, parent) {
2036
+ const next = siblingAfter(parent, index);
2037
+ return !next || next.type === "element" && next.tagName === "tr";
2038
+ }
2039
+ function cells(_3, index, parent) {
2040
+ const next = siblingAfter(parent, index);
2041
+ return !next || next.type === "element" && (next.tagName === "td" || next.tagName === "th");
2042
+ }
2043
+
2044
+ // node_modules/hast-util-to-html/lib/omission/opening.js
2045
+ var opening = omission({
2046
+ body: body2,
2047
+ colgroup,
2048
+ head,
2049
+ html: html4,
2050
+ tbody: tbody2
2051
+ });
2052
+ function html4(node) {
2053
+ const head2 = siblingAfter(node, -1);
2054
+ return !head2 || head2.type !== "comment";
2055
+ }
2056
+ function head(node) {
2057
+ const seen = /* @__PURE__ */ new Set();
2058
+ for (const child2 of node.children) {
2059
+ if (child2.type === "element" && (child2.tagName === "base" || child2.tagName === "title")) {
2060
+ if (seen.has(child2.tagName)) return false;
2061
+ seen.add(child2.tagName);
2062
+ }
2063
+ }
2064
+ const child = node.children[0];
2065
+ return !child || child.type === "element";
2066
+ }
2067
+ function body2(node) {
2068
+ const head2 = siblingAfter(node, -1, true);
2069
+ return !head2 || head2.type !== "comment" && !(head2.type === "text" && whitespace(head2.value.charAt(0))) && !(head2.type === "element" && (head2.tagName === "meta" || head2.tagName === "link" || head2.tagName === "script" || head2.tagName === "style" || head2.tagName === "template"));
2070
+ }
2071
+ function colgroup(node, index, parent) {
2072
+ const previous = siblingBefore(parent, index);
2073
+ const head2 = siblingAfter(node, -1, true);
2074
+ if (parent && previous && previous.type === "element" && previous.tagName === "colgroup" && closing(previous, parent.children.indexOf(previous), parent)) {
2075
+ return false;
2076
+ }
2077
+ return Boolean(head2 && head2.type === "element" && head2.tagName === "col");
2078
+ }
2079
+ function tbody2(node, index, parent) {
2080
+ const previous = siblingBefore(parent, index);
2081
+ const head2 = siblingAfter(node, -1);
2082
+ if (parent && previous && previous.type === "element" && (previous.tagName === "thead" || previous.tagName === "tbody") && closing(previous, parent.children.indexOf(previous), parent)) {
2083
+ return false;
2084
+ }
2085
+ return Boolean(head2 && head2.type === "element" && head2.tagName === "tr");
2086
+ }
2087
+
2088
+ // node_modules/hast-util-to-html/lib/handle/element.js
2089
+ var constants = {
2090
+ // See: <https://html.spec.whatwg.org/#attribute-name-state>.
2091
+ name: [
2092
+ [" \n\f\r &/=>".split(""), " \n\f\r \"&'/=>`".split("")],
2093
+ [`\0
2094
+ \f\r "&'/<=>`.split(""), "\0 \n\f\r \"&'/<=>`".split("")]
2095
+ ],
2096
+ // See: <https://html.spec.whatwg.org/#attribute-value-(unquoted)-state>.
2097
+ unquoted: [
2098
+ [" \n\f\r &>".split(""), "\0 \n\f\r \"&'<=>`".split("")],
2099
+ ["\0 \n\f\r \"&'<=>`".split(""), "\0 \n\f\r \"&'<=>`".split("")]
2100
+ ],
2101
+ // See: <https://html.spec.whatwg.org/#attribute-value-(single-quoted)-state>.
2102
+ single: [
2103
+ ["&'".split(""), "\"&'`".split("")],
2104
+ ["\0&'".split(""), "\0\"&'`".split("")]
2105
+ ],
2106
+ // See: <https://html.spec.whatwg.org/#attribute-value-(double-quoted)-state>.
2107
+ double: [
2108
+ ['"&'.split(""), "\"&'`".split("")],
2109
+ ['\0"&'.split(""), "\0\"&'`".split("")]
2110
+ ]
2111
+ };
2112
+ function element(node, index, parent, state) {
2113
+ const schema = state.schema;
2114
+ const omit = schema.space === "svg" ? false : state.settings.omitOptionalTags;
2115
+ let selfClosing = schema.space === "svg" ? state.settings.closeEmptyElements : state.settings.voids.includes(node.tagName.toLowerCase());
2116
+ const parts = [];
2117
+ let last;
2118
+ if (schema.space === "html" && node.tagName === "svg") {
2119
+ state.schema = svg2;
2120
+ }
2121
+ const attributes = serializeAttributes(state, node.properties);
2122
+ const content = state.all(
2123
+ schema.space === "html" && node.tagName === "template" ? node.content : node
2124
+ );
2125
+ state.schema = schema;
2126
+ if (content) selfClosing = false;
2127
+ if (attributes || !omit || !opening(node, index, parent)) {
2128
+ parts.push("<", node.tagName, attributes ? " " + attributes : "");
2129
+ if (selfClosing && (schema.space === "svg" || state.settings.closeSelfClosing)) {
2130
+ last = attributes.charAt(attributes.length - 1);
2131
+ if (!state.settings.tightSelfClosing || last === "/" || last && last !== '"' && last !== "'") {
2132
+ parts.push(" ");
2133
+ }
2134
+ parts.push("/");
2135
+ }
2136
+ parts.push(">");
2137
+ }
2138
+ parts.push(content);
2139
+ if (!selfClosing && (!omit || !closing(node, index, parent))) {
2140
+ parts.push("</" + node.tagName + ">");
2141
+ }
2142
+ return parts.join("");
2143
+ }
2144
+ function serializeAttributes(state, properties) {
2145
+ const values = [];
2146
+ let index = -1;
2147
+ let key2;
2148
+ if (properties) {
2149
+ for (key2 in properties) {
2150
+ if (properties[key2] !== null && properties[key2] !== void 0) {
2151
+ const value = serializeAttribute(state, key2, properties[key2]);
2152
+ if (value) values.push(value);
2153
+ }
2154
+ }
2155
+ }
2156
+ while (++index < values.length) {
2157
+ const last = state.settings.tightAttributes ? values[index].charAt(values[index].length - 1) : void 0;
2158
+ if (index !== values.length - 1 && last !== '"' && last !== "'") {
2159
+ values[index] += " ";
2160
+ }
2161
+ }
2162
+ return values.join("");
2163
+ }
2164
+ function serializeAttribute(state, key2, value) {
2165
+ const info = find(state.schema, key2);
2166
+ const x4 = state.settings.allowParseErrors && state.schema.space === "html" ? 0 : 1;
2167
+ const y4 = state.settings.allowDangerousCharacters ? 0 : 1;
2168
+ let quote = state.quote;
2169
+ let result;
2170
+ if (info.overloadedBoolean && (value === info.attribute || value === "")) {
2171
+ value = true;
2172
+ } else if ((info.boolean || info.overloadedBoolean) && (typeof value !== "string" || value === info.attribute || value === "")) {
2173
+ value = Boolean(value);
2174
+ }
2175
+ if (value === null || value === void 0 || value === false || typeof value === "number" && Number.isNaN(value)) {
2176
+ return "";
2177
+ }
2178
+ const name = stringifyEntities(
2179
+ info.attribute,
2180
+ Object.assign({}, state.settings.characterReferences, {
2181
+ // Always encode without parse errors in non-HTML.
2182
+ subset: constants.name[x4][y4]
2183
+ })
2184
+ );
2185
+ if (value === true) return name;
2186
+ value = Array.isArray(value) ? (info.commaSeparated ? stringify : stringify2)(value, {
2187
+ padLeft: !state.settings.tightCommaSeparatedLists
2188
+ }) : String(value);
2189
+ if (state.settings.collapseEmptyAttributes && !value) return name;
2190
+ if (state.settings.preferUnquoted) {
2191
+ result = stringifyEntities(
2192
+ value,
2193
+ Object.assign({}, state.settings.characterReferences, {
2194
+ attribute: true,
2195
+ subset: constants.unquoted[x4][y4]
2196
+ })
2197
+ );
2198
+ }
2199
+ if (result !== value) {
2200
+ if (state.settings.quoteSmart && ccount(value, quote) > ccount(value, state.alternative)) {
2201
+ quote = state.alternative;
2202
+ }
2203
+ result = quote + stringifyEntities(
2204
+ value,
2205
+ Object.assign({}, state.settings.characterReferences, {
2206
+ // Always encode without parse errors in non-HTML.
2207
+ subset: (quote === "'" ? constants.single : constants.double)[x4][y4],
2208
+ attribute: true
2209
+ })
2210
+ ) + quote;
2211
+ }
2212
+ return name + (result ? "=" + result : result);
2213
+ }
2214
+
2215
+ // node_modules/hast-util-to-html/lib/handle/text.js
2216
+ var textEntitySubset = ["<", "&"];
2217
+ function text(node, _3, parent, state) {
2218
+ return parent && parent.type === "element" && (parent.tagName === "script" || parent.tagName === "style") ? node.value : stringifyEntities(
2219
+ node.value,
2220
+ Object.assign({}, state.settings.characterReferences, {
2221
+ subset: textEntitySubset
2222
+ })
2223
+ );
2224
+ }
2225
+
2226
+ // node_modules/hast-util-to-html/lib/handle/raw.js
2227
+ function raw(node, index, parent, state) {
2228
+ return state.settings.allowDangerousHtml ? node.value : text(node, index, parent, state);
2229
+ }
2230
+
2231
+ // node_modules/hast-util-to-html/lib/handle/root.js
2232
+ function root(node, _1, _22, state) {
2233
+ return state.all(node);
2234
+ }
2235
+
2236
+ // node_modules/hast-util-to-html/lib/handle/index.js
2237
+ var handle = zwitch("type", {
2238
+ invalid,
2239
+ unknown,
2240
+ handlers: { comment, doctype, element, raw, root, text }
2241
+ });
2242
+ function invalid(node) {
2243
+ throw new Error("Expected node, not `" + node + "`");
2244
+ }
2245
+ function unknown(node_) {
2246
+ const node = (
2247
+ /** @type {Nodes} */
2248
+ node_
2249
+ );
2250
+ throw new Error("Cannot compile unknown node `" + node.type + "`");
2251
+ }
2252
+
2253
+ // node_modules/hast-util-to-html/lib/index.js
2254
+ var emptyOptions = {};
2255
+ var emptyCharacterReferences = {};
2256
+ var emptyChildren2 = [];
2257
+ function toHtml(tree, options) {
2258
+ const options_ = options || emptyOptions;
2259
+ const quote = options_.quote || '"';
2260
+ const alternative = quote === '"' ? "'" : '"';
2261
+ if (quote !== '"' && quote !== "'") {
2262
+ throw new Error("Invalid quote `" + quote + "`, expected `'` or `\"`");
2263
+ }
2264
+ const state = {
2265
+ one,
2266
+ all,
2267
+ settings: {
2268
+ omitOptionalTags: options_.omitOptionalTags || false,
2269
+ allowParseErrors: options_.allowParseErrors || false,
2270
+ allowDangerousCharacters: options_.allowDangerousCharacters || false,
2271
+ quoteSmart: options_.quoteSmart || false,
2272
+ preferUnquoted: options_.preferUnquoted || false,
2273
+ tightAttributes: options_.tightAttributes || false,
2274
+ upperDoctype: options_.upperDoctype || false,
2275
+ tightDoctype: options_.tightDoctype || false,
2276
+ bogusComments: options_.bogusComments || false,
2277
+ tightCommaSeparatedLists: options_.tightCommaSeparatedLists || false,
2278
+ tightSelfClosing: options_.tightSelfClosing || false,
2279
+ collapseEmptyAttributes: options_.collapseEmptyAttributes || false,
2280
+ allowDangerousHtml: options_.allowDangerousHtml || false,
2281
+ voids: options_.voids || htmlVoidElements,
2282
+ characterReferences: options_.characterReferences || emptyCharacterReferences,
2283
+ closeSelfClosing: options_.closeSelfClosing || false,
2284
+ closeEmptyElements: options_.closeEmptyElements || false
2285
+ },
2286
+ schema: options_.space === "svg" ? svg2 : html2,
2287
+ quote,
2288
+ alternative
2289
+ };
2290
+ return state.one(
2291
+ Array.isArray(tree) ? { type: "root", children: tree } : tree,
2292
+ void 0,
2293
+ void 0
2294
+ );
2295
+ }
2296
+ function one(node, index, parent) {
2297
+ return handle(node, index, parent, this);
2298
+ }
2299
+ function all(parent) {
2300
+ const results = [];
2301
+ const children = parent && parent.children || emptyChildren2;
2302
+ let index = -1;
2303
+ while (++index < children.length) {
2304
+ results[index] = this.one(children[index], index, parent);
2305
+ }
2306
+ return results.join("");
2307
+ }
2308
+
2309
+ // node_modules/roughjs/bundled/rough.esm.js
2310
+ function t(t4, e4, s4) {
2311
+ if (t4 && t4.length) {
2312
+ const [n4, o4] = e4, a4 = Math.PI / 180 * s4, h4 = Math.cos(a4), r4 = Math.sin(a4);
2313
+ for (const e5 of t4) {
2314
+ const [t5, s5] = e5;
2315
+ e5[0] = (t5 - n4) * h4 - (s5 - o4) * r4 + n4, e5[1] = (t5 - n4) * r4 + (s5 - o4) * h4 + o4;
2316
+ }
2317
+ }
2318
+ }
2319
+ function e(t4, e4) {
2320
+ return t4[0] === e4[0] && t4[1] === e4[1];
2321
+ }
2322
+ function s(s4, n4, o4, a4 = 1) {
2323
+ const h4 = o4, r4 = Math.max(n4, 0.1), i4 = s4[0] && s4[0][0] && "number" == typeof s4[0][0] ? [s4] : s4, c4 = [0, 0];
2324
+ if (h4) for (const e4 of i4) t(e4, c4, h4);
2325
+ const l4 = (function(t4, s5, n5) {
2326
+ const o5 = [];
2327
+ for (const s6 of t4) {
2328
+ const t5 = [...s6];
2329
+ e(t5[0], t5[t5.length - 1]) || t5.push([t5[0][0], t5[0][1]]), t5.length > 2 && o5.push(t5);
2330
+ }
2331
+ const a5 = [];
2332
+ s5 = Math.max(s5, 0.1);
2333
+ const h5 = [];
2334
+ for (const t5 of o5) for (let e4 = 0; e4 < t5.length - 1; e4++) {
2335
+ const s6 = t5[e4], n6 = t5[e4 + 1];
2336
+ if (s6[1] !== n6[1]) {
2337
+ const t6 = Math.min(s6[1], n6[1]);
2338
+ h5.push({ ymin: t6, ymax: Math.max(s6[1], n6[1]), x: t6 === s6[1] ? s6[0] : n6[0], islope: (n6[0] - s6[0]) / (n6[1] - s6[1]) });
2339
+ }
2340
+ }
2341
+ if (h5.sort(((t5, e4) => t5.ymin < e4.ymin ? -1 : t5.ymin > e4.ymin ? 1 : t5.x < e4.x ? -1 : t5.x > e4.x ? 1 : t5.ymax === e4.ymax ? 0 : (t5.ymax - e4.ymax) / Math.abs(t5.ymax - e4.ymax))), !h5.length) return a5;
2342
+ let r5 = [], i5 = h5[0].ymin, c5 = 0;
2343
+ for (; r5.length || h5.length; ) {
2344
+ if (h5.length) {
2345
+ let t5 = -1;
2346
+ for (let e4 = 0; e4 < h5.length && !(h5[e4].ymin > i5); e4++) t5 = e4;
2347
+ h5.splice(0, t5 + 1).forEach(((t6) => {
2348
+ r5.push({ s: i5, edge: t6 });
2349
+ }));
2350
+ }
2351
+ if (r5 = r5.filter(((t5) => !(t5.edge.ymax <= i5))), r5.sort(((t5, e4) => t5.edge.x === e4.edge.x ? 0 : (t5.edge.x - e4.edge.x) / Math.abs(t5.edge.x - e4.edge.x))), (1 !== n5 || c5 % s5 == 0) && r5.length > 1) for (let t5 = 0; t5 < r5.length; t5 += 2) {
2352
+ const e4 = t5 + 1;
2353
+ if (e4 >= r5.length) break;
2354
+ const s6 = r5[t5].edge, n6 = r5[e4].edge;
2355
+ a5.push([[Math.round(s6.x), i5], [Math.round(n6.x), i5]]);
2356
+ }
2357
+ i5 += n5, r5.forEach(((t5) => {
2358
+ t5.edge.x = t5.edge.x + n5 * t5.edge.islope;
2359
+ })), c5++;
2360
+ }
2361
+ return a5;
2362
+ })(i4, r4, a4);
2363
+ if (h4) {
2364
+ for (const e4 of i4) t(e4, c4, -h4);
2365
+ !(function(e4, s5, n5) {
2366
+ const o5 = [];
2367
+ e4.forEach(((t4) => o5.push(...t4))), t(o5, s5, n5);
2368
+ })(l4, c4, -h4);
2369
+ }
2370
+ return l4;
2371
+ }
2372
+ function n(t4, e4) {
2373
+ var n4;
2374
+ const o4 = e4.hachureAngle + 90;
2375
+ let a4 = e4.hachureGap;
2376
+ a4 < 0 && (a4 = 4 * e4.strokeWidth), a4 = Math.round(Math.max(a4, 0.1));
2377
+ let h4 = 1;
2378
+ return e4.roughness >= 1 && ((null === (n4 = e4.randomizer) || void 0 === n4 ? void 0 : n4.next()) || Math.random()) > 0.7 && (h4 = a4), s(t4, a4, o4, h4 || 1);
2379
+ }
2380
+ var o = class {
2381
+ constructor(t4) {
2382
+ this.helper = t4;
2383
+ }
2384
+ fillPolygons(t4, e4) {
2385
+ return this._fillPolygons(t4, e4);
2386
+ }
2387
+ _fillPolygons(t4, e4) {
2388
+ const s4 = n(t4, e4);
2389
+ return { type: "fillSketch", ops: this.renderLines(s4, e4) };
2390
+ }
2391
+ renderLines(t4, e4) {
2392
+ const s4 = [];
2393
+ for (const n4 of t4) s4.push(...this.helper.doubleLineOps(n4[0][0], n4[0][1], n4[1][0], n4[1][1], e4));
2394
+ return s4;
2395
+ }
2396
+ };
2397
+ function a(t4) {
2398
+ const e4 = t4[0], s4 = t4[1];
2399
+ return Math.sqrt(Math.pow(e4[0] - s4[0], 2) + Math.pow(e4[1] - s4[1], 2));
2400
+ }
2401
+ var h = class extends o {
2402
+ fillPolygons(t4, e4) {
2403
+ let s4 = e4.hachureGap;
2404
+ s4 < 0 && (s4 = 4 * e4.strokeWidth), s4 = Math.max(s4, 0.1);
2405
+ const o4 = n(t4, Object.assign({}, e4, { hachureGap: s4 })), h4 = Math.PI / 180 * e4.hachureAngle, r4 = [], i4 = 0.5 * s4 * Math.cos(h4), c4 = 0.5 * s4 * Math.sin(h4);
2406
+ for (const [t5, e5] of o4) a([t5, e5]) && r4.push([[t5[0] - i4, t5[1] + c4], [...e5]], [[t5[0] + i4, t5[1] - c4], [...e5]]);
2407
+ return { type: "fillSketch", ops: this.renderLines(r4, e4) };
2408
+ }
2409
+ };
2410
+ var r = class extends o {
2411
+ fillPolygons(t4, e4) {
2412
+ const s4 = this._fillPolygons(t4, e4), n4 = Object.assign({}, e4, { hachureAngle: e4.hachureAngle + 90 }), o4 = this._fillPolygons(t4, n4);
2413
+ return s4.ops = s4.ops.concat(o4.ops), s4;
2414
+ }
2415
+ };
2416
+ var i = class {
2417
+ constructor(t4) {
2418
+ this.helper = t4;
2419
+ }
2420
+ fillPolygons(t4, e4) {
2421
+ const s4 = n(t4, e4 = Object.assign({}, e4, { hachureAngle: 0 }));
2422
+ return this.dotsOnLines(s4, e4);
2423
+ }
2424
+ dotsOnLines(t4, e4) {
2425
+ const s4 = [];
2426
+ let n4 = e4.hachureGap;
2427
+ n4 < 0 && (n4 = 4 * e4.strokeWidth), n4 = Math.max(n4, 0.1);
2428
+ let o4 = e4.fillWeight;
2429
+ o4 < 0 && (o4 = e4.strokeWidth / 2);
2430
+ const h4 = n4 / 4;
2431
+ for (const r4 of t4) {
2432
+ const t5 = a(r4), i4 = t5 / n4, c4 = Math.ceil(i4) - 1, l4 = t5 - c4 * n4, u5 = (r4[0][0] + r4[1][0]) / 2 - n4 / 4, p5 = Math.min(r4[0][1], r4[1][1]);
2433
+ for (let t6 = 0; t6 < c4; t6++) {
2434
+ const a4 = p5 + l4 + t6 * n4, r5 = u5 - h4 + 2 * Math.random() * h4, i5 = a4 - h4 + 2 * Math.random() * h4, c5 = this.helper.ellipse(r5, i5, o4, o4, e4);
2435
+ s4.push(...c5.ops);
2436
+ }
2437
+ }
2438
+ return { type: "fillSketch", ops: s4 };
2439
+ }
2440
+ };
2441
+ var c = class {
2442
+ constructor(t4) {
2443
+ this.helper = t4;
2444
+ }
2445
+ fillPolygons(t4, e4) {
2446
+ const s4 = n(t4, e4);
2447
+ return { type: "fillSketch", ops: this.dashedLine(s4, e4) };
2448
+ }
2449
+ dashedLine(t4, e4) {
2450
+ const s4 = e4.dashOffset < 0 ? e4.hachureGap < 0 ? 4 * e4.strokeWidth : e4.hachureGap : e4.dashOffset, n4 = e4.dashGap < 0 ? e4.hachureGap < 0 ? 4 * e4.strokeWidth : e4.hachureGap : e4.dashGap, o4 = [];
2451
+ return t4.forEach(((t5) => {
2452
+ const h4 = a(t5), r4 = Math.floor(h4 / (s4 + n4)), i4 = (h4 + n4 - r4 * (s4 + n4)) / 2;
2453
+ let c4 = t5[0], l4 = t5[1];
2454
+ c4[0] > l4[0] && (c4 = t5[1], l4 = t5[0]);
2455
+ const u5 = Math.atan((l4[1] - c4[1]) / (l4[0] - c4[0]));
2456
+ for (let t6 = 0; t6 < r4; t6++) {
2457
+ const a4 = t6 * (s4 + n4), h5 = a4 + s4, r5 = [c4[0] + a4 * Math.cos(u5) + i4 * Math.cos(u5), c4[1] + a4 * Math.sin(u5) + i4 * Math.sin(u5)], l5 = [c4[0] + h5 * Math.cos(u5) + i4 * Math.cos(u5), c4[1] + h5 * Math.sin(u5) + i4 * Math.sin(u5)];
2458
+ o4.push(...this.helper.doubleLineOps(r5[0], r5[1], l5[0], l5[1], e4));
2459
+ }
2460
+ })), o4;
2461
+ }
2462
+ };
2463
+ var l = class {
2464
+ constructor(t4) {
2465
+ this.helper = t4;
2466
+ }
2467
+ fillPolygons(t4, e4) {
2468
+ const s4 = e4.hachureGap < 0 ? 4 * e4.strokeWidth : e4.hachureGap, o4 = e4.zigzagOffset < 0 ? s4 : e4.zigzagOffset, a4 = n(t4, e4 = Object.assign({}, e4, { hachureGap: s4 + o4 }));
2469
+ return { type: "fillSketch", ops: this.zigzagLines(a4, o4, e4) };
2470
+ }
2471
+ zigzagLines(t4, e4, s4) {
2472
+ const n4 = [];
2473
+ return t4.forEach(((t5) => {
2474
+ const o4 = a(t5), h4 = Math.round(o4 / (2 * e4));
2475
+ let r4 = t5[0], i4 = t5[1];
2476
+ r4[0] > i4[0] && (r4 = t5[1], i4 = t5[0]);
2477
+ const c4 = Math.atan((i4[1] - r4[1]) / (i4[0] - r4[0]));
2478
+ for (let t6 = 0; t6 < h4; t6++) {
2479
+ const o5 = 2 * t6 * e4, a4 = 2 * (t6 + 1) * e4, h5 = Math.sqrt(2 * Math.pow(e4, 2)), i5 = [r4[0] + o5 * Math.cos(c4), r4[1] + o5 * Math.sin(c4)], l4 = [r4[0] + a4 * Math.cos(c4), r4[1] + a4 * Math.sin(c4)], u5 = [i5[0] + h5 * Math.cos(c4 + Math.PI / 4), i5[1] + h5 * Math.sin(c4 + Math.PI / 4)];
2480
+ n4.push(...this.helper.doubleLineOps(i5[0], i5[1], u5[0], u5[1], s4), ...this.helper.doubleLineOps(u5[0], u5[1], l4[0], l4[1], s4));
2481
+ }
2482
+ })), n4;
2483
+ }
2484
+ };
2485
+ var u = {};
2486
+ var p2 = class {
2487
+ constructor(t4) {
2488
+ this.seed = t4;
2489
+ }
2490
+ next() {
2491
+ return this.seed ? (2 ** 31 - 1 & (this.seed = Math.imul(48271, this.seed))) / 2 ** 31 : Math.random();
2492
+ }
2493
+ };
2494
+ var f = 0;
2495
+ var d = 1;
2496
+ var g = 2;
2497
+ var M = { A: 7, a: 7, C: 6, c: 6, H: 1, h: 1, L: 2, l: 2, M: 2, m: 2, Q: 4, q: 4, S: 4, s: 4, T: 2, t: 2, V: 1, v: 1, Z: 0, z: 0 };
2498
+ function k(t4, e4) {
2499
+ return t4.type === e4;
2500
+ }
2501
+ function b(t4) {
2502
+ const e4 = [], s4 = (function(t5) {
2503
+ const e5 = new Array();
2504
+ for (; "" !== t5; ) if (t5.match(/^([ \t\r\n,]+)/)) t5 = t5.substr(RegExp.$1.length);
2505
+ else if (t5.match(/^([aAcChHlLmMqQsStTvVzZ])/)) e5[e5.length] = { type: f, text: RegExp.$1 }, t5 = t5.substr(RegExp.$1.length);
2506
+ else {
2507
+ if (!t5.match(/^(([-+]?[0-9]+(\.[0-9]*)?|[-+]?\.[0-9]+)([eE][-+]?[0-9]+)?)/)) return [];
2508
+ e5[e5.length] = { type: d, text: `${parseFloat(RegExp.$1)}` }, t5 = t5.substr(RegExp.$1.length);
2509
+ }
2510
+ return e5[e5.length] = { type: g, text: "" }, e5;
2511
+ })(t4);
2512
+ let n4 = "BOD", o4 = 0, a4 = s4[o4];
2513
+ for (; !k(a4, g); ) {
2514
+ let h4 = 0;
2515
+ const r4 = [];
2516
+ if ("BOD" === n4) {
2517
+ if ("M" !== a4.text && "m" !== a4.text) return b("M0,0" + t4);
2518
+ o4++, h4 = M[a4.text], n4 = a4.text;
2519
+ } else k(a4, d) ? h4 = M[n4] : (o4++, h4 = M[a4.text], n4 = a4.text);
2520
+ if (!(o4 + h4 < s4.length)) throw new Error("Path data ended short");
2521
+ for (let t5 = o4; t5 < o4 + h4; t5++) {
2522
+ const e5 = s4[t5];
2523
+ if (!k(e5, d)) throw new Error("Param not a number: " + n4 + "," + e5.text);
2524
+ r4[r4.length] = +e5.text;
2525
+ }
2526
+ if ("number" != typeof M[n4]) throw new Error("Bad segment: " + n4);
2527
+ {
2528
+ const t5 = { key: n4, data: r4 };
2529
+ e4.push(t5), o4 += h4, a4 = s4[o4], "M" === n4 && (n4 = "L"), "m" === n4 && (n4 = "l");
2530
+ }
2531
+ }
2532
+ return e4;
2533
+ }
2534
+ function y(t4) {
2535
+ let e4 = 0, s4 = 0, n4 = 0, o4 = 0;
2536
+ const a4 = [];
2537
+ for (const { key: h4, data: r4 } of t4) switch (h4) {
2538
+ case "M":
2539
+ a4.push({ key: "M", data: [...r4] }), [e4, s4] = r4, [n4, o4] = r4;
2540
+ break;
2541
+ case "m":
2542
+ e4 += r4[0], s4 += r4[1], a4.push({ key: "M", data: [e4, s4] }), n4 = e4, o4 = s4;
2543
+ break;
2544
+ case "L":
2545
+ a4.push({ key: "L", data: [...r4] }), [e4, s4] = r4;
2546
+ break;
2547
+ case "l":
2548
+ e4 += r4[0], s4 += r4[1], a4.push({ key: "L", data: [e4, s4] });
2549
+ break;
2550
+ case "C":
2551
+ a4.push({ key: "C", data: [...r4] }), e4 = r4[4], s4 = r4[5];
2552
+ break;
2553
+ case "c": {
2554
+ const t5 = r4.map(((t6, n5) => n5 % 2 ? t6 + s4 : t6 + e4));
2555
+ a4.push({ key: "C", data: t5 }), e4 = t5[4], s4 = t5[5];
2556
+ break;
2557
+ }
2558
+ case "Q":
2559
+ a4.push({ key: "Q", data: [...r4] }), e4 = r4[2], s4 = r4[3];
2560
+ break;
2561
+ case "q": {
2562
+ const t5 = r4.map(((t6, n5) => n5 % 2 ? t6 + s4 : t6 + e4));
2563
+ a4.push({ key: "Q", data: t5 }), e4 = t5[2], s4 = t5[3];
2564
+ break;
2565
+ }
2566
+ case "A":
2567
+ a4.push({ key: "A", data: [...r4] }), e4 = r4[5], s4 = r4[6];
2568
+ break;
2569
+ case "a":
2570
+ e4 += r4[5], s4 += r4[6], a4.push({ key: "A", data: [r4[0], r4[1], r4[2], r4[3], r4[4], e4, s4] });
2571
+ break;
2572
+ case "H":
2573
+ a4.push({ key: "H", data: [...r4] }), e4 = r4[0];
2574
+ break;
2575
+ case "h":
2576
+ e4 += r4[0], a4.push({ key: "H", data: [e4] });
2577
+ break;
2578
+ case "V":
2579
+ a4.push({ key: "V", data: [...r4] }), s4 = r4[0];
2580
+ break;
2581
+ case "v":
2582
+ s4 += r4[0], a4.push({ key: "V", data: [s4] });
2583
+ break;
2584
+ case "S":
2585
+ a4.push({ key: "S", data: [...r4] }), e4 = r4[2], s4 = r4[3];
2586
+ break;
2587
+ case "s": {
2588
+ const t5 = r4.map(((t6, n5) => n5 % 2 ? t6 + s4 : t6 + e4));
2589
+ a4.push({ key: "S", data: t5 }), e4 = t5[2], s4 = t5[3];
2590
+ break;
2591
+ }
2592
+ case "T":
2593
+ a4.push({ key: "T", data: [...r4] }), e4 = r4[0], s4 = r4[1];
2594
+ break;
2595
+ case "t":
2596
+ e4 += r4[0], s4 += r4[1], a4.push({ key: "T", data: [e4, s4] });
2597
+ break;
2598
+ case "Z":
2599
+ case "z":
2600
+ a4.push({ key: "Z", data: [] }), e4 = n4, s4 = o4;
2601
+ }
2602
+ return a4;
2603
+ }
2604
+ function m(t4) {
2605
+ const e4 = [];
2606
+ let s4 = "", n4 = 0, o4 = 0, a4 = 0, h4 = 0, r4 = 0, i4 = 0;
2607
+ for (const { key: c4, data: l4 } of t4) {
2608
+ switch (c4) {
2609
+ case "M":
2610
+ e4.push({ key: "M", data: [...l4] }), [n4, o4] = l4, [a4, h4] = l4;
2611
+ break;
2612
+ case "C":
2613
+ e4.push({ key: "C", data: [...l4] }), n4 = l4[4], o4 = l4[5], r4 = l4[2], i4 = l4[3];
2614
+ break;
2615
+ case "L":
2616
+ e4.push({ key: "L", data: [...l4] }), [n4, o4] = l4;
2617
+ break;
2618
+ case "H":
2619
+ n4 = l4[0], e4.push({ key: "L", data: [n4, o4] });
2620
+ break;
2621
+ case "V":
2622
+ o4 = l4[0], e4.push({ key: "L", data: [n4, o4] });
2623
+ break;
2624
+ case "S": {
2625
+ let t5 = 0, a5 = 0;
2626
+ "C" === s4 || "S" === s4 ? (t5 = n4 + (n4 - r4), a5 = o4 + (o4 - i4)) : (t5 = n4, a5 = o4), e4.push({ key: "C", data: [t5, a5, ...l4] }), r4 = l4[0], i4 = l4[1], n4 = l4[2], o4 = l4[3];
2627
+ break;
2628
+ }
2629
+ case "T": {
2630
+ const [t5, a5] = l4;
2631
+ let h5 = 0, c5 = 0;
2632
+ "Q" === s4 || "T" === s4 ? (h5 = n4 + (n4 - r4), c5 = o4 + (o4 - i4)) : (h5 = n4, c5 = o4);
2633
+ const u5 = n4 + 2 * (h5 - n4) / 3, p5 = o4 + 2 * (c5 - o4) / 3, f5 = t5 + 2 * (h5 - t5) / 3, d4 = a5 + 2 * (c5 - a5) / 3;
2634
+ e4.push({ key: "C", data: [u5, p5, f5, d4, t5, a5] }), r4 = h5, i4 = c5, n4 = t5, o4 = a5;
2635
+ break;
2636
+ }
2637
+ case "Q": {
2638
+ const [t5, s5, a5, h5] = l4, c5 = n4 + 2 * (t5 - n4) / 3, u5 = o4 + 2 * (s5 - o4) / 3, p5 = a5 + 2 * (t5 - a5) / 3, f5 = h5 + 2 * (s5 - h5) / 3;
2639
+ e4.push({ key: "C", data: [c5, u5, p5, f5, a5, h5] }), r4 = t5, i4 = s5, n4 = a5, o4 = h5;
2640
+ break;
2641
+ }
2642
+ case "A": {
2643
+ const t5 = Math.abs(l4[0]), s5 = Math.abs(l4[1]), a5 = l4[2], h5 = l4[3], r5 = l4[4], i5 = l4[5], c5 = l4[6];
2644
+ if (0 === t5 || 0 === s5) e4.push({ key: "C", data: [n4, o4, i5, c5, i5, c5] }), n4 = i5, o4 = c5;
2645
+ else if (n4 !== i5 || o4 !== c5) {
2646
+ x(n4, o4, i5, c5, t5, s5, a5, h5, r5).forEach((function(t6) {
2647
+ e4.push({ key: "C", data: t6 });
2648
+ })), n4 = i5, o4 = c5;
2649
+ }
2650
+ break;
2651
+ }
2652
+ case "Z":
2653
+ e4.push({ key: "Z", data: [] }), n4 = a4, o4 = h4;
2654
+ }
2655
+ s4 = c4;
2656
+ }
2657
+ return e4;
2658
+ }
2659
+ function w(t4, e4, s4) {
2660
+ return [t4 * Math.cos(s4) - e4 * Math.sin(s4), t4 * Math.sin(s4) + e4 * Math.cos(s4)];
2661
+ }
2662
+ function x(t4, e4, s4, n4, o4, a4, h4, r4, i4, c4) {
2663
+ const l4 = (u5 = h4, Math.PI * u5 / 180);
2664
+ var u5;
2665
+ let p5 = [], f5 = 0, d4 = 0, g4 = 0, M4 = 0;
2666
+ if (c4) [f5, d4, g4, M4] = c4;
2667
+ else {
2668
+ [t4, e4] = w(t4, e4, -l4), [s4, n4] = w(s4, n4, -l4);
2669
+ const h5 = (t4 - s4) / 2, c5 = (e4 - n4) / 2;
2670
+ let u6 = h5 * h5 / (o4 * o4) + c5 * c5 / (a4 * a4);
2671
+ u6 > 1 && (u6 = Math.sqrt(u6), o4 *= u6, a4 *= u6);
2672
+ const p6 = o4 * o4, k5 = a4 * a4, b4 = p6 * k5 - p6 * c5 * c5 - k5 * h5 * h5, y5 = p6 * c5 * c5 + k5 * h5 * h5, m5 = (r4 === i4 ? -1 : 1) * Math.sqrt(Math.abs(b4 / y5));
2673
+ g4 = m5 * o4 * c5 / a4 + (t4 + s4) / 2, M4 = m5 * -a4 * h5 / o4 + (e4 + n4) / 2, f5 = Math.asin(parseFloat(((e4 - M4) / a4).toFixed(9))), d4 = Math.asin(parseFloat(((n4 - M4) / a4).toFixed(9))), t4 < g4 && (f5 = Math.PI - f5), s4 < g4 && (d4 = Math.PI - d4), f5 < 0 && (f5 = 2 * Math.PI + f5), d4 < 0 && (d4 = 2 * Math.PI + d4), i4 && f5 > d4 && (f5 -= 2 * Math.PI), !i4 && d4 > f5 && (d4 -= 2 * Math.PI);
2674
+ }
2675
+ let k4 = d4 - f5;
2676
+ if (Math.abs(k4) > 120 * Math.PI / 180) {
2677
+ const t5 = d4, e5 = s4, r5 = n4;
2678
+ d4 = i4 && d4 > f5 ? f5 + 120 * Math.PI / 180 * 1 : f5 + 120 * Math.PI / 180 * -1, p5 = x(s4 = g4 + o4 * Math.cos(d4), n4 = M4 + a4 * Math.sin(d4), e5, r5, o4, a4, h4, 0, i4, [d4, t5, g4, M4]);
2679
+ }
2680
+ k4 = d4 - f5;
2681
+ const b3 = Math.cos(f5), y4 = Math.sin(f5), m4 = Math.cos(d4), P4 = Math.sin(d4), v4 = Math.tan(k4 / 4), S4 = 4 / 3 * o4 * v4, O4 = 4 / 3 * a4 * v4, L4 = [t4, e4], T4 = [t4 + S4 * y4, e4 - O4 * b3], D4 = [s4 + S4 * P4, n4 - O4 * m4], A4 = [s4, n4];
2682
+ if (T4[0] = 2 * L4[0] - T4[0], T4[1] = 2 * L4[1] - T4[1], c4) return [T4, D4, A4].concat(p5);
2683
+ {
2684
+ p5 = [T4, D4, A4].concat(p5);
2685
+ const t5 = [];
2686
+ for (let e5 = 0; e5 < p5.length; e5 += 3) {
2687
+ const s5 = w(p5[e5][0], p5[e5][1], l4), n5 = w(p5[e5 + 1][0], p5[e5 + 1][1], l4), o5 = w(p5[e5 + 2][0], p5[e5 + 2][1], l4);
2688
+ t5.push([s5[0], s5[1], n5[0], n5[1], o5[0], o5[1]]);
2689
+ }
2690
+ return t5;
2691
+ }
2692
+ }
2693
+ var P = { randOffset: function(t4, e4) {
2694
+ return G(t4, e4);
2695
+ }, randOffsetWithRange: function(t4, e4, s4) {
2696
+ return E(t4, e4, s4);
2697
+ }, ellipse: function(t4, e4, s4, n4, o4) {
2698
+ const a4 = T(s4, n4, o4);
2699
+ return D(t4, e4, o4, a4).opset;
2700
+ }, doubleLineOps: function(t4, e4, s4, n4, o4) {
2701
+ return $(t4, e4, s4, n4, o4, true);
2702
+ } };
2703
+ function v(t4, e4, s4, n4, o4) {
2704
+ return { type: "path", ops: $(t4, e4, s4, n4, o4) };
2705
+ }
2706
+ function S(t4, e4, s4) {
2707
+ const n4 = (t4 || []).length;
2708
+ if (n4 > 2) {
2709
+ const o4 = [];
2710
+ for (let e5 = 0; e5 < n4 - 1; e5++) o4.push(...$(t4[e5][0], t4[e5][1], t4[e5 + 1][0], t4[e5 + 1][1], s4));
2711
+ return e4 && o4.push(...$(t4[n4 - 1][0], t4[n4 - 1][1], t4[0][0], t4[0][1], s4)), { type: "path", ops: o4 };
2712
+ }
2713
+ return 2 === n4 ? v(t4[0][0], t4[0][1], t4[1][0], t4[1][1], s4) : { type: "path", ops: [] };
2714
+ }
2715
+ function O(t4, e4, s4, n4, o4) {
2716
+ return (function(t5, e5) {
2717
+ return S(t5, true, e5);
2718
+ })([[t4, e4], [t4 + s4, e4], [t4 + s4, e4 + n4], [t4, e4 + n4]], o4);
2719
+ }
2720
+ function L(t4, e4) {
2721
+ if (t4.length) {
2722
+ const s4 = "number" == typeof t4[0][0] ? [t4] : t4, n4 = j(s4[0], 1 * (1 + 0.2 * e4.roughness), e4), o4 = e4.disableMultiStroke ? [] : j(s4[0], 1.5 * (1 + 0.22 * e4.roughness), z(e4));
2723
+ for (let t5 = 1; t5 < s4.length; t5++) {
2724
+ const a4 = s4[t5];
2725
+ if (a4.length) {
2726
+ const t6 = j(a4, 1 * (1 + 0.2 * e4.roughness), e4), s5 = e4.disableMultiStroke ? [] : j(a4, 1.5 * (1 + 0.22 * e4.roughness), z(e4));
2727
+ for (const e5 of t6) "move" !== e5.op && n4.push(e5);
2728
+ for (const t7 of s5) "move" !== t7.op && o4.push(t7);
2729
+ }
2730
+ }
2731
+ return { type: "path", ops: n4.concat(o4) };
2732
+ }
2733
+ return { type: "path", ops: [] };
2734
+ }
2735
+ function T(t4, e4, s4) {
2736
+ const n4 = Math.sqrt(2 * Math.PI * Math.sqrt((Math.pow(t4 / 2, 2) + Math.pow(e4 / 2, 2)) / 2)), o4 = Math.ceil(Math.max(s4.curveStepCount, s4.curveStepCount / Math.sqrt(200) * n4)), a4 = 2 * Math.PI / o4;
2737
+ let h4 = Math.abs(t4 / 2), r4 = Math.abs(e4 / 2);
2738
+ const i4 = 1 - s4.curveFitting;
2739
+ return h4 += G(h4 * i4, s4), r4 += G(r4 * i4, s4), { increment: a4, rx: h4, ry: r4 };
2740
+ }
2741
+ function D(t4, e4, s4, n4) {
2742
+ const [o4, a4] = F(n4.increment, t4, e4, n4.rx, n4.ry, 1, n4.increment * E(0.1, E(0.4, 1, s4), s4), s4);
2743
+ let h4 = q(o4, null, s4);
2744
+ if (!s4.disableMultiStroke && 0 !== s4.roughness) {
2745
+ const [o5] = F(n4.increment, t4, e4, n4.rx, n4.ry, 1.5, 0, s4), a5 = q(o5, null, s4);
2746
+ h4 = h4.concat(a5);
2747
+ }
2748
+ return { estimatedPoints: a4, opset: { type: "path", ops: h4 } };
2749
+ }
2750
+ function A(t4, e4, s4, n4, o4, a4, h4, r4, i4) {
2751
+ const c4 = t4, l4 = e4;
2752
+ let u5 = Math.abs(s4 / 2), p5 = Math.abs(n4 / 2);
2753
+ u5 += G(0.01 * u5, i4), p5 += G(0.01 * p5, i4);
2754
+ let f5 = o4, d4 = a4;
2755
+ for (; f5 < 0; ) f5 += 2 * Math.PI, d4 += 2 * Math.PI;
2756
+ d4 - f5 > 2 * Math.PI && (f5 = 0, d4 = 2 * Math.PI);
2757
+ const g4 = 2 * Math.PI / i4.curveStepCount, M4 = Math.min(g4 / 2, (d4 - f5) / 2), k4 = V(M4, c4, l4, u5, p5, f5, d4, 1, i4);
2758
+ if (!i4.disableMultiStroke) {
2759
+ const t5 = V(M4, c4, l4, u5, p5, f5, d4, 1.5, i4);
2760
+ k4.push(...t5);
2761
+ }
2762
+ return h4 && (r4 ? k4.push(...$(c4, l4, c4 + u5 * Math.cos(f5), l4 + p5 * Math.sin(f5), i4), ...$(c4, l4, c4 + u5 * Math.cos(d4), l4 + p5 * Math.sin(d4), i4)) : k4.push({ op: "lineTo", data: [c4, l4] }, { op: "lineTo", data: [c4 + u5 * Math.cos(f5), l4 + p5 * Math.sin(f5)] })), { type: "path", ops: k4 };
2763
+ }
2764
+ function _(t4, e4) {
2765
+ const s4 = m(y(b(t4))), n4 = [];
2766
+ let o4 = [0, 0], a4 = [0, 0];
2767
+ for (const { key: t5, data: h4 } of s4) switch (t5) {
2768
+ case "M":
2769
+ a4 = [h4[0], h4[1]], o4 = [h4[0], h4[1]];
2770
+ break;
2771
+ case "L":
2772
+ n4.push(...$(a4[0], a4[1], h4[0], h4[1], e4)), a4 = [h4[0], h4[1]];
2773
+ break;
2774
+ case "C": {
2775
+ const [t6, s5, o5, r4, i4, c4] = h4;
2776
+ n4.push(...Z(t6, s5, o5, r4, i4, c4, a4, e4)), a4 = [i4, c4];
2777
+ break;
2778
+ }
2779
+ case "Z":
2780
+ n4.push(...$(a4[0], a4[1], o4[0], o4[1], e4)), a4 = [o4[0], o4[1]];
2781
+ }
2782
+ return { type: "path", ops: n4 };
2783
+ }
2784
+ function I(t4, e4) {
2785
+ const s4 = [];
2786
+ for (const n4 of t4) if (n4.length) {
2787
+ const t5 = e4.maxRandomnessOffset || 0, o4 = n4.length;
2788
+ if (o4 > 2) {
2789
+ s4.push({ op: "move", data: [n4[0][0] + G(t5, e4), n4[0][1] + G(t5, e4)] });
2790
+ for (let a4 = 1; a4 < o4; a4++) s4.push({ op: "lineTo", data: [n4[a4][0] + G(t5, e4), n4[a4][1] + G(t5, e4)] });
2791
+ }
2792
+ }
2793
+ return { type: "fillPath", ops: s4 };
2794
+ }
2795
+ function C(t4, e4) {
2796
+ return (function(t5, e5) {
2797
+ let s4 = t5.fillStyle || "hachure";
2798
+ if (!u[s4]) switch (s4) {
2799
+ case "zigzag":
2800
+ u[s4] || (u[s4] = new h(e5));
2801
+ break;
2802
+ case "cross-hatch":
2803
+ u[s4] || (u[s4] = new r(e5));
2804
+ break;
2805
+ case "dots":
2806
+ u[s4] || (u[s4] = new i(e5));
2807
+ break;
2808
+ case "dashed":
2809
+ u[s4] || (u[s4] = new c(e5));
2810
+ break;
2811
+ case "zigzag-line":
2812
+ u[s4] || (u[s4] = new l(e5));
2813
+ break;
2814
+ default:
2815
+ s4 = "hachure", u[s4] || (u[s4] = new o(e5));
2816
+ }
2817
+ return u[s4];
2818
+ })(e4, P).fillPolygons(t4, e4);
2819
+ }
2820
+ function z(t4) {
2821
+ const e4 = Object.assign({}, t4);
2822
+ return e4.randomizer = void 0, t4.seed && (e4.seed = t4.seed + 1), e4;
2823
+ }
2824
+ function W(t4) {
2825
+ return t4.randomizer || (t4.randomizer = new p2(t4.seed || 0)), t4.randomizer.next();
2826
+ }
2827
+ function E(t4, e4, s4, n4 = 1) {
2828
+ return s4.roughness * n4 * (W(s4) * (e4 - t4) + t4);
2829
+ }
2830
+ function G(t4, e4, s4 = 1) {
2831
+ return E(-t4, t4, e4, s4);
2832
+ }
2833
+ function $(t4, e4, s4, n4, o4, a4 = false) {
2834
+ const h4 = a4 ? o4.disableMultiStrokeFill : o4.disableMultiStroke, r4 = R(t4, e4, s4, n4, o4, true, false);
2835
+ if (h4) return r4;
2836
+ const i4 = R(t4, e4, s4, n4, o4, true, true);
2837
+ return r4.concat(i4);
2838
+ }
2839
+ function R(t4, e4, s4, n4, o4, a4, h4) {
2840
+ const r4 = Math.pow(t4 - s4, 2) + Math.pow(e4 - n4, 2), i4 = Math.sqrt(r4);
2841
+ let c4 = 1;
2842
+ c4 = i4 < 200 ? 1 : i4 > 500 ? 0.4 : -16668e-7 * i4 + 1.233334;
2843
+ let l4 = o4.maxRandomnessOffset || 0;
2844
+ l4 * l4 * 100 > r4 && (l4 = i4 / 10);
2845
+ const u5 = l4 / 2, p5 = 0.2 + 0.2 * W(o4);
2846
+ let f5 = o4.bowing * o4.maxRandomnessOffset * (n4 - e4) / 200, d4 = o4.bowing * o4.maxRandomnessOffset * (t4 - s4) / 200;
2847
+ f5 = G(f5, o4, c4), d4 = G(d4, o4, c4);
2848
+ const g4 = [], M4 = () => G(u5, o4, c4), k4 = () => G(l4, o4, c4), b3 = o4.preserveVertices;
2849
+ return (h4 ? g4.push({ op: "move", data: [t4 + (b3 ? 0 : M4()), e4 + (b3 ? 0 : M4())] }) : g4.push({ op: "move", data: [t4 + (b3 ? 0 : G(l4, o4, c4)), e4 + (b3 ? 0 : G(l4, o4, c4))] })), h4 ? g4.push({ op: "bcurveTo", data: [f5 + t4 + (s4 - t4) * p5 + M4(), d4 + e4 + (n4 - e4) * p5 + M4(), f5 + t4 + 2 * (s4 - t4) * p5 + M4(), d4 + e4 + 2 * (n4 - e4) * p5 + M4(), s4 + (b3 ? 0 : M4()), n4 + (b3 ? 0 : M4())] }) : g4.push({ op: "bcurveTo", data: [f5 + t4 + (s4 - t4) * p5 + k4(), d4 + e4 + (n4 - e4) * p5 + k4(), f5 + t4 + 2 * (s4 - t4) * p5 + k4(), d4 + e4 + 2 * (n4 - e4) * p5 + k4(), s4 + (b3 ? 0 : k4()), n4 + (b3 ? 0 : k4())] }), g4;
2850
+ }
2851
+ function j(t4, e4, s4) {
2852
+ if (!t4.length) return [];
2853
+ const n4 = [];
2854
+ n4.push([t4[0][0] + G(e4, s4), t4[0][1] + G(e4, s4)]), n4.push([t4[0][0] + G(e4, s4), t4[0][1] + G(e4, s4)]);
2855
+ for (let o4 = 1; o4 < t4.length; o4++) n4.push([t4[o4][0] + G(e4, s4), t4[o4][1] + G(e4, s4)]), o4 === t4.length - 1 && n4.push([t4[o4][0] + G(e4, s4), t4[o4][1] + G(e4, s4)]);
2856
+ return q(n4, null, s4);
2857
+ }
2858
+ function q(t4, e4, s4) {
2859
+ const n4 = t4.length, o4 = [];
2860
+ if (n4 > 3) {
2861
+ const a4 = [], h4 = 1 - s4.curveTightness;
2862
+ o4.push({ op: "move", data: [t4[1][0], t4[1][1]] });
2863
+ for (let e5 = 1; e5 + 2 < n4; e5++) {
2864
+ const s5 = t4[e5];
2865
+ a4[0] = [s5[0], s5[1]], a4[1] = [s5[0] + (h4 * t4[e5 + 1][0] - h4 * t4[e5 - 1][0]) / 6, s5[1] + (h4 * t4[e5 + 1][1] - h4 * t4[e5 - 1][1]) / 6], a4[2] = [t4[e5 + 1][0] + (h4 * t4[e5][0] - h4 * t4[e5 + 2][0]) / 6, t4[e5 + 1][1] + (h4 * t4[e5][1] - h4 * t4[e5 + 2][1]) / 6], a4[3] = [t4[e5 + 1][0], t4[e5 + 1][1]], o4.push({ op: "bcurveTo", data: [a4[1][0], a4[1][1], a4[2][0], a4[2][1], a4[3][0], a4[3][1]] });
2866
+ }
2867
+ } else 3 === n4 ? (o4.push({ op: "move", data: [t4[1][0], t4[1][1]] }), o4.push({ op: "bcurveTo", data: [t4[1][0], t4[1][1], t4[2][0], t4[2][1], t4[2][0], t4[2][1]] })) : 2 === n4 && o4.push(...R(t4[0][0], t4[0][1], t4[1][0], t4[1][1], s4, true, true));
2868
+ return o4;
2869
+ }
2870
+ function F(t4, e4, s4, n4, o4, a4, h4, r4) {
2871
+ const i4 = [], c4 = [];
2872
+ if (0 === r4.roughness) {
2873
+ t4 /= 4, c4.push([e4 + n4 * Math.cos(-t4), s4 + o4 * Math.sin(-t4)]);
2874
+ for (let a5 = 0; a5 <= 2 * Math.PI; a5 += t4) {
2875
+ const t5 = [e4 + n4 * Math.cos(a5), s4 + o4 * Math.sin(a5)];
2876
+ i4.push(t5), c4.push(t5);
2877
+ }
2878
+ c4.push([e4 + n4 * Math.cos(0), s4 + o4 * Math.sin(0)]), c4.push([e4 + n4 * Math.cos(t4), s4 + o4 * Math.sin(t4)]);
2879
+ } else {
2880
+ const l4 = G(0.5, r4) - Math.PI / 2;
2881
+ c4.push([G(a4, r4) + e4 + 0.9 * n4 * Math.cos(l4 - t4), G(a4, r4) + s4 + 0.9 * o4 * Math.sin(l4 - t4)]);
2882
+ const u5 = 2 * Math.PI + l4 - 0.01;
2883
+ for (let h5 = l4; h5 < u5; h5 += t4) {
2884
+ const t5 = [G(a4, r4) + e4 + n4 * Math.cos(h5), G(a4, r4) + s4 + o4 * Math.sin(h5)];
2885
+ i4.push(t5), c4.push(t5);
2886
+ }
2887
+ c4.push([G(a4, r4) + e4 + n4 * Math.cos(l4 + 2 * Math.PI + 0.5 * h4), G(a4, r4) + s4 + o4 * Math.sin(l4 + 2 * Math.PI + 0.5 * h4)]), c4.push([G(a4, r4) + e4 + 0.98 * n4 * Math.cos(l4 + h4), G(a4, r4) + s4 + 0.98 * o4 * Math.sin(l4 + h4)]), c4.push([G(a4, r4) + e4 + 0.9 * n4 * Math.cos(l4 + 0.5 * h4), G(a4, r4) + s4 + 0.9 * o4 * Math.sin(l4 + 0.5 * h4)]);
2888
+ }
2889
+ return [c4, i4];
2890
+ }
2891
+ function V(t4, e4, s4, n4, o4, a4, h4, r4, i4) {
2892
+ const c4 = a4 + G(0.1, i4), l4 = [];
2893
+ l4.push([G(r4, i4) + e4 + 0.9 * n4 * Math.cos(c4 - t4), G(r4, i4) + s4 + 0.9 * o4 * Math.sin(c4 - t4)]);
2894
+ for (let a5 = c4; a5 <= h4; a5 += t4) l4.push([G(r4, i4) + e4 + n4 * Math.cos(a5), G(r4, i4) + s4 + o4 * Math.sin(a5)]);
2895
+ return l4.push([e4 + n4 * Math.cos(h4), s4 + o4 * Math.sin(h4)]), l4.push([e4 + n4 * Math.cos(h4), s4 + o4 * Math.sin(h4)]), q(l4, null, i4);
2896
+ }
2897
+ function Z(t4, e4, s4, n4, o4, a4, h4, r4) {
2898
+ const i4 = [], c4 = [r4.maxRandomnessOffset || 1, (r4.maxRandomnessOffset || 1) + 0.3];
2899
+ let l4 = [0, 0];
2900
+ const u5 = r4.disableMultiStroke ? 1 : 2, p5 = r4.preserveVertices;
2901
+ for (let f5 = 0; f5 < u5; f5++) 0 === f5 ? i4.push({ op: "move", data: [h4[0], h4[1]] }) : i4.push({ op: "move", data: [h4[0] + (p5 ? 0 : G(c4[0], r4)), h4[1] + (p5 ? 0 : G(c4[0], r4))] }), l4 = p5 ? [o4, a4] : [o4 + G(c4[f5], r4), a4 + G(c4[f5], r4)], i4.push({ op: "bcurveTo", data: [t4 + G(c4[f5], r4), e4 + G(c4[f5], r4), s4 + G(c4[f5], r4), n4 + G(c4[f5], r4), l4[0], l4[1]] });
2902
+ return i4;
2903
+ }
2904
+ function Q(t4) {
2905
+ return [...t4];
2906
+ }
2907
+ function H(t4, e4 = 0) {
2908
+ const s4 = t4.length;
2909
+ if (s4 < 3) throw new Error("A curve must have at least three points.");
2910
+ const n4 = [];
2911
+ if (3 === s4) n4.push(Q(t4[0]), Q(t4[1]), Q(t4[2]), Q(t4[2]));
2912
+ else {
2913
+ const s5 = [];
2914
+ s5.push(t4[0], t4[0]);
2915
+ for (let e5 = 1; e5 < t4.length; e5++) s5.push(t4[e5]), e5 === t4.length - 1 && s5.push(t4[e5]);
2916
+ const o4 = [], a4 = 1 - e4;
2917
+ n4.push(Q(s5[0]));
2918
+ for (let t5 = 1; t5 + 2 < s5.length; t5++) {
2919
+ const e5 = s5[t5];
2920
+ o4[0] = [e5[0], e5[1]], o4[1] = [e5[0] + (a4 * s5[t5 + 1][0] - a4 * s5[t5 - 1][0]) / 6, e5[1] + (a4 * s5[t5 + 1][1] - a4 * s5[t5 - 1][1]) / 6], o4[2] = [s5[t5 + 1][0] + (a4 * s5[t5][0] - a4 * s5[t5 + 2][0]) / 6, s5[t5 + 1][1] + (a4 * s5[t5][1] - a4 * s5[t5 + 2][1]) / 6], o4[3] = [s5[t5 + 1][0], s5[t5 + 1][1]], n4.push(o4[1], o4[2], o4[3]);
2921
+ }
2922
+ }
2923
+ return n4;
2924
+ }
2925
+ function N(t4, e4) {
2926
+ return Math.pow(t4[0] - e4[0], 2) + Math.pow(t4[1] - e4[1], 2);
2927
+ }
2928
+ function B(t4, e4, s4) {
2929
+ const n4 = N(e4, s4);
2930
+ if (0 === n4) return N(t4, e4);
2931
+ let o4 = ((t4[0] - e4[0]) * (s4[0] - e4[0]) + (t4[1] - e4[1]) * (s4[1] - e4[1])) / n4;
2932
+ return o4 = Math.max(0, Math.min(1, o4)), N(t4, J(e4, s4, o4));
2933
+ }
2934
+ function J(t4, e4, s4) {
2935
+ return [t4[0] + (e4[0] - t4[0]) * s4, t4[1] + (e4[1] - t4[1]) * s4];
2936
+ }
2937
+ function K(t4, e4, s4, n4) {
2938
+ const o4 = n4 || [];
2939
+ if ((function(t5, e5) {
2940
+ const s5 = t5[e5 + 0], n5 = t5[e5 + 1], o5 = t5[e5 + 2], a5 = t5[e5 + 3];
2941
+ let h5 = 3 * n5[0] - 2 * s5[0] - a5[0];
2942
+ h5 *= h5;
2943
+ let r4 = 3 * n5[1] - 2 * s5[1] - a5[1];
2944
+ r4 *= r4;
2945
+ let i4 = 3 * o5[0] - 2 * a5[0] - s5[0];
2946
+ i4 *= i4;
2947
+ let c4 = 3 * o5[1] - 2 * a5[1] - s5[1];
2948
+ return c4 *= c4, h5 < i4 && (h5 = i4), r4 < c4 && (r4 = c4), h5 + r4;
2949
+ })(t4, e4) < s4) {
2950
+ const s5 = t4[e4 + 0];
2951
+ if (o4.length) {
2952
+ (a4 = o4[o4.length - 1], h4 = s5, Math.sqrt(N(a4, h4))) > 1 && o4.push(s5);
2953
+ } else o4.push(s5);
2954
+ o4.push(t4[e4 + 3]);
2955
+ } else {
2956
+ const n5 = 0.5, a5 = t4[e4 + 0], h5 = t4[e4 + 1], r4 = t4[e4 + 2], i4 = t4[e4 + 3], c4 = J(a5, h5, n5), l4 = J(h5, r4, n5), u5 = J(r4, i4, n5), p5 = J(c4, l4, n5), f5 = J(l4, u5, n5), d4 = J(p5, f5, n5);
2957
+ K([a5, c4, p5, d4], 0, s4, o4), K([d4, f5, u5, i4], 0, s4, o4);
2958
+ }
2959
+ var a4, h4;
2960
+ return o4;
2961
+ }
2962
+ function U(t4, e4) {
2963
+ return X(t4, 0, t4.length, e4);
2964
+ }
2965
+ function X(t4, e4, s4, n4, o4) {
2966
+ const a4 = o4 || [], h4 = t4[e4], r4 = t4[s4 - 1];
2967
+ let i4 = 0, c4 = 1;
2968
+ for (let n5 = e4 + 1; n5 < s4 - 1; ++n5) {
2969
+ const e5 = B(t4[n5], h4, r4);
2970
+ e5 > i4 && (i4 = e5, c4 = n5);
2971
+ }
2972
+ return Math.sqrt(i4) > n4 ? (X(t4, e4, c4 + 1, n4, a4), X(t4, c4, s4, n4, a4)) : (a4.length || a4.push(h4), a4.push(r4)), a4;
2973
+ }
2974
+ function Y(t4, e4 = 0.15, s4) {
2975
+ const n4 = [], o4 = (t4.length - 1) / 3;
2976
+ for (let s5 = 0; s5 < o4; s5++) {
2977
+ K(t4, 3 * s5, e4, n4);
2978
+ }
2979
+ return s4 && s4 > 0 ? X(n4, 0, n4.length, s4) : n4;
2980
+ }
2981
+ var tt = "none";
2982
+ var et = class {
2983
+ constructor(t4) {
2984
+ this.defaultOptions = { maxRandomnessOffset: 2, roughness: 1, bowing: 1, stroke: "#000", strokeWidth: 1, curveTightness: 0, curveFitting: 0.95, curveStepCount: 9, fillStyle: "hachure", fillWeight: -1, hachureAngle: -41, hachureGap: -1, dashOffset: -1, dashGap: -1, zigzagOffset: -1, seed: 0, disableMultiStroke: false, disableMultiStrokeFill: false, preserveVertices: false, fillShapeRoughnessGain: 0.8 }, this.config = t4 || {}, this.config.options && (this.defaultOptions = this._o(this.config.options));
2985
+ }
2986
+ static newSeed() {
2987
+ return Math.floor(Math.random() * 2 ** 31);
2988
+ }
2989
+ _o(t4) {
2990
+ return t4 ? Object.assign({}, this.defaultOptions, t4) : this.defaultOptions;
2991
+ }
2992
+ _d(t4, e4, s4) {
2993
+ return { shape: t4, sets: e4 || [], options: s4 || this.defaultOptions };
2994
+ }
2995
+ line(t4, e4, s4, n4, o4) {
2996
+ const a4 = this._o(o4);
2997
+ return this._d("line", [v(t4, e4, s4, n4, a4)], a4);
2998
+ }
2999
+ rectangle(t4, e4, s4, n4, o4) {
3000
+ const a4 = this._o(o4), h4 = [], r4 = O(t4, e4, s4, n4, a4);
3001
+ if (a4.fill) {
3002
+ const o5 = [[t4, e4], [t4 + s4, e4], [t4 + s4, e4 + n4], [t4, e4 + n4]];
3003
+ "solid" === a4.fillStyle ? h4.push(I([o5], a4)) : h4.push(C([o5], a4));
3004
+ }
3005
+ return a4.stroke !== tt && h4.push(r4), this._d("rectangle", h4, a4);
3006
+ }
3007
+ ellipse(t4, e4, s4, n4, o4) {
3008
+ const a4 = this._o(o4), h4 = [], r4 = T(s4, n4, a4), i4 = D(t4, e4, a4, r4);
3009
+ if (a4.fill) if ("solid" === a4.fillStyle) {
3010
+ const s5 = D(t4, e4, a4, r4).opset;
3011
+ s5.type = "fillPath", h4.push(s5);
3012
+ } else h4.push(C([i4.estimatedPoints], a4));
3013
+ return a4.stroke !== tt && h4.push(i4.opset), this._d("ellipse", h4, a4);
3014
+ }
3015
+ circle(t4, e4, s4, n4) {
3016
+ const o4 = this.ellipse(t4, e4, s4, s4, n4);
3017
+ return o4.shape = "circle", o4;
3018
+ }
3019
+ linearPath(t4, e4) {
3020
+ const s4 = this._o(e4);
3021
+ return this._d("linearPath", [S(t4, false, s4)], s4);
3022
+ }
3023
+ arc(t4, e4, s4, n4, o4, a4, h4 = false, r4) {
3024
+ const i4 = this._o(r4), c4 = [], l4 = A(t4, e4, s4, n4, o4, a4, h4, true, i4);
3025
+ if (h4 && i4.fill) if ("solid" === i4.fillStyle) {
3026
+ const h5 = Object.assign({}, i4);
3027
+ h5.disableMultiStroke = true;
3028
+ const r5 = A(t4, e4, s4, n4, o4, a4, true, false, h5);
3029
+ r5.type = "fillPath", c4.push(r5);
3030
+ } else c4.push((function(t5, e5, s5, n5, o5, a5, h5) {
3031
+ const r5 = t5, i5 = e5;
3032
+ let c5 = Math.abs(s5 / 2), l5 = Math.abs(n5 / 2);
3033
+ c5 += G(0.01 * c5, h5), l5 += G(0.01 * l5, h5);
3034
+ let u5 = o5, p5 = a5;
3035
+ for (; u5 < 0; ) u5 += 2 * Math.PI, p5 += 2 * Math.PI;
3036
+ p5 - u5 > 2 * Math.PI && (u5 = 0, p5 = 2 * Math.PI);
3037
+ const f5 = (p5 - u5) / h5.curveStepCount, d4 = [];
3038
+ for (let t6 = u5; t6 <= p5; t6 += f5) d4.push([r5 + c5 * Math.cos(t6), i5 + l5 * Math.sin(t6)]);
3039
+ return d4.push([r5 + c5 * Math.cos(p5), i5 + l5 * Math.sin(p5)]), d4.push([r5, i5]), C([d4], h5);
3040
+ })(t4, e4, s4, n4, o4, a4, i4));
3041
+ return i4.stroke !== tt && c4.push(l4), this._d("arc", c4, i4);
3042
+ }
3043
+ curve(t4, e4) {
3044
+ const s4 = this._o(e4), n4 = [], o4 = L(t4, s4);
3045
+ if (s4.fill && s4.fill !== tt) if ("solid" === s4.fillStyle) {
3046
+ const e5 = L(t4, Object.assign(Object.assign({}, s4), { disableMultiStroke: true, roughness: s4.roughness ? s4.roughness + s4.fillShapeRoughnessGain : 0 }));
3047
+ n4.push({ type: "fillPath", ops: this._mergedShape(e5.ops) });
3048
+ } else {
3049
+ const e5 = [], o5 = t4;
3050
+ if (o5.length) {
3051
+ const t5 = "number" == typeof o5[0][0] ? [o5] : o5;
3052
+ for (const n5 of t5) n5.length < 3 ? e5.push(...n5) : 3 === n5.length ? e5.push(...Y(H([n5[0], n5[0], n5[1], n5[2]]), 10, (1 + s4.roughness) / 2)) : e5.push(...Y(H(n5), 10, (1 + s4.roughness) / 2));
3053
+ }
3054
+ e5.length && n4.push(C([e5], s4));
3055
+ }
3056
+ return s4.stroke !== tt && n4.push(o4), this._d("curve", n4, s4);
3057
+ }
3058
+ polygon(t4, e4) {
3059
+ const s4 = this._o(e4), n4 = [], o4 = S(t4, true, s4);
3060
+ return s4.fill && ("solid" === s4.fillStyle ? n4.push(I([t4], s4)) : n4.push(C([t4], s4))), s4.stroke !== tt && n4.push(o4), this._d("polygon", n4, s4);
3061
+ }
3062
+ path(t4, e4) {
3063
+ const s4 = this._o(e4), n4 = [];
3064
+ if (!t4) return this._d("path", n4, s4);
3065
+ t4 = (t4 || "").replace(/\n/g, " ").replace(/(-\s)/g, "-").replace("/(ss)/g", " ");
3066
+ const o4 = s4.fill && "transparent" !== s4.fill && s4.fill !== tt, a4 = s4.stroke !== tt, h4 = !!(s4.simplification && s4.simplification < 1), r4 = (function(t5, e5, s5) {
3067
+ const n5 = m(y(b(t5))), o5 = [];
3068
+ let a5 = [], h5 = [0, 0], r5 = [];
3069
+ const i5 = () => {
3070
+ r5.length >= 4 && a5.push(...Y(r5, e5)), r5 = [];
3071
+ }, c4 = () => {
3072
+ i5(), a5.length && (o5.push(a5), a5 = []);
3073
+ };
3074
+ for (const { key: t6, data: e6 } of n5) switch (t6) {
3075
+ case "M":
3076
+ c4(), h5 = [e6[0], e6[1]], a5.push(h5);
3077
+ break;
3078
+ case "L":
3079
+ i5(), a5.push([e6[0], e6[1]]);
3080
+ break;
3081
+ case "C":
3082
+ if (!r5.length) {
3083
+ const t7 = a5.length ? a5[a5.length - 1] : h5;
3084
+ r5.push([t7[0], t7[1]]);
3085
+ }
3086
+ r5.push([e6[0], e6[1]]), r5.push([e6[2], e6[3]]), r5.push([e6[4], e6[5]]);
3087
+ break;
3088
+ case "Z":
3089
+ i5(), a5.push([h5[0], h5[1]]);
3090
+ }
3091
+ if (c4(), !s5) return o5;
3092
+ const l4 = [];
3093
+ for (const t6 of o5) {
3094
+ const e6 = U(t6, s5);
3095
+ e6.length && l4.push(e6);
3096
+ }
3097
+ return l4;
3098
+ })(t4, 1, h4 ? 4 - 4 * (s4.simplification || 1) : (1 + s4.roughness) / 2), i4 = _(t4, s4);
3099
+ if (o4) if ("solid" === s4.fillStyle) if (1 === r4.length) {
3100
+ const e5 = _(t4, Object.assign(Object.assign({}, s4), { disableMultiStroke: true, roughness: s4.roughness ? s4.roughness + s4.fillShapeRoughnessGain : 0 }));
3101
+ n4.push({ type: "fillPath", ops: this._mergedShape(e5.ops) });
3102
+ } else n4.push(I(r4, s4));
3103
+ else n4.push(C(r4, s4));
3104
+ return a4 && (h4 ? r4.forEach(((t5) => {
3105
+ n4.push(S(t5, false, s4));
3106
+ })) : n4.push(i4)), this._d("path", n4, s4);
3107
+ }
3108
+ opsToPath(t4, e4) {
3109
+ let s4 = "";
3110
+ for (const n4 of t4.ops) {
3111
+ const t5 = "number" == typeof e4 && e4 >= 0 ? n4.data.map(((t6) => +t6.toFixed(e4))) : n4.data;
3112
+ switch (n4.op) {
3113
+ case "move":
3114
+ s4 += `M${t5[0]} ${t5[1]} `;
3115
+ break;
3116
+ case "bcurveTo":
3117
+ s4 += `C${t5[0]} ${t5[1]}, ${t5[2]} ${t5[3]}, ${t5[4]} ${t5[5]} `;
3118
+ break;
3119
+ case "lineTo":
3120
+ s4 += `L${t5[0]} ${t5[1]} `;
3121
+ }
3122
+ }
3123
+ return s4.trim();
3124
+ }
3125
+ toPaths(t4) {
3126
+ const e4 = t4.sets || [], s4 = t4.options || this.defaultOptions, n4 = [];
3127
+ for (const t5 of e4) {
3128
+ let e5 = null;
3129
+ switch (t5.type) {
3130
+ case "path":
3131
+ e5 = { d: this.opsToPath(t5), stroke: s4.stroke, strokeWidth: s4.strokeWidth, fill: tt };
3132
+ break;
3133
+ case "fillPath":
3134
+ e5 = { d: this.opsToPath(t5), stroke: tt, strokeWidth: 0, fill: s4.fill || tt };
3135
+ break;
3136
+ case "fillSketch":
3137
+ e5 = this.fillSketch(t5, s4);
3138
+ }
3139
+ e5 && n4.push(e5);
3140
+ }
3141
+ return n4;
3142
+ }
3143
+ fillSketch(t4, e4) {
3144
+ let s4 = e4.fillWeight;
3145
+ return s4 < 0 && (s4 = e4.strokeWidth / 2), { d: this.opsToPath(t4), stroke: e4.fill || tt, strokeWidth: s4, fill: tt };
3146
+ }
3147
+ _mergedShape(t4) {
3148
+ return t4.filter(((t5, e4) => 0 === e4 || "move" !== t5.op));
3149
+ }
3150
+ };
3151
+ var st = class {
3152
+ constructor(t4, e4) {
3153
+ this.canvas = t4, this.ctx = this.canvas.getContext("2d"), this.gen = new et(e4);
3154
+ }
3155
+ draw(t4) {
3156
+ const e4 = t4.sets || [], s4 = t4.options || this.getDefaultOptions(), n4 = this.ctx, o4 = t4.options.fixedDecimalPlaceDigits;
3157
+ for (const a4 of e4) switch (a4.type) {
3158
+ case "path":
3159
+ n4.save(), n4.strokeStyle = "none" === s4.stroke ? "transparent" : s4.stroke, n4.lineWidth = s4.strokeWidth, s4.strokeLineDash && n4.setLineDash(s4.strokeLineDash), s4.strokeLineDashOffset && (n4.lineDashOffset = s4.strokeLineDashOffset), this._drawToContext(n4, a4, o4), n4.restore();
3160
+ break;
3161
+ case "fillPath": {
3162
+ n4.save(), n4.fillStyle = s4.fill || "";
3163
+ const e5 = "curve" === t4.shape || "polygon" === t4.shape || "path" === t4.shape ? "evenodd" : "nonzero";
3164
+ this._drawToContext(n4, a4, o4, e5), n4.restore();
3165
+ break;
3166
+ }
3167
+ case "fillSketch":
3168
+ this.fillSketch(n4, a4, s4);
3169
+ }
3170
+ }
3171
+ fillSketch(t4, e4, s4) {
3172
+ let n4 = s4.fillWeight;
3173
+ n4 < 0 && (n4 = s4.strokeWidth / 2), t4.save(), s4.fillLineDash && t4.setLineDash(s4.fillLineDash), s4.fillLineDashOffset && (t4.lineDashOffset = s4.fillLineDashOffset), t4.strokeStyle = s4.fill || "", t4.lineWidth = n4, this._drawToContext(t4, e4, s4.fixedDecimalPlaceDigits), t4.restore();
3174
+ }
3175
+ _drawToContext(t4, e4, s4, n4 = "nonzero") {
3176
+ t4.beginPath();
3177
+ for (const n5 of e4.ops) {
3178
+ const e5 = "number" == typeof s4 && s4 >= 0 ? n5.data.map(((t5) => +t5.toFixed(s4))) : n5.data;
3179
+ switch (n5.op) {
3180
+ case "move":
3181
+ t4.moveTo(e5[0], e5[1]);
3182
+ break;
3183
+ case "bcurveTo":
3184
+ t4.bezierCurveTo(e5[0], e5[1], e5[2], e5[3], e5[4], e5[5]);
3185
+ break;
3186
+ case "lineTo":
3187
+ t4.lineTo(e5[0], e5[1]);
3188
+ }
3189
+ }
3190
+ "fillPath" === e4.type ? t4.fill(n4) : t4.stroke();
3191
+ }
3192
+ get generator() {
3193
+ return this.gen;
3194
+ }
3195
+ getDefaultOptions() {
3196
+ return this.gen.defaultOptions;
3197
+ }
3198
+ line(t4, e4, s4, n4, o4) {
3199
+ const a4 = this.gen.line(t4, e4, s4, n4, o4);
3200
+ return this.draw(a4), a4;
3201
+ }
3202
+ rectangle(t4, e4, s4, n4, o4) {
3203
+ const a4 = this.gen.rectangle(t4, e4, s4, n4, o4);
3204
+ return this.draw(a4), a4;
3205
+ }
3206
+ ellipse(t4, e4, s4, n4, o4) {
3207
+ const a4 = this.gen.ellipse(t4, e4, s4, n4, o4);
3208
+ return this.draw(a4), a4;
3209
+ }
3210
+ circle(t4, e4, s4, n4) {
3211
+ const o4 = this.gen.circle(t4, e4, s4, n4);
3212
+ return this.draw(o4), o4;
3213
+ }
3214
+ linearPath(t4, e4) {
3215
+ const s4 = this.gen.linearPath(t4, e4);
3216
+ return this.draw(s4), s4;
3217
+ }
3218
+ polygon(t4, e4) {
3219
+ const s4 = this.gen.polygon(t4, e4);
3220
+ return this.draw(s4), s4;
3221
+ }
3222
+ arc(t4, e4, s4, n4, o4, a4, h4 = false, r4) {
3223
+ const i4 = this.gen.arc(t4, e4, s4, n4, o4, a4, h4, r4);
3224
+ return this.draw(i4), i4;
3225
+ }
3226
+ curve(t4, e4) {
3227
+ const s4 = this.gen.curve(t4, e4);
3228
+ return this.draw(s4), s4;
3229
+ }
3230
+ path(t4, e4) {
3231
+ const s4 = this.gen.path(t4, e4);
3232
+ return this.draw(s4), s4;
3233
+ }
3234
+ };
3235
+ var nt = "http://www.w3.org/2000/svg";
3236
+ var ot = class {
3237
+ constructor(t4, e4) {
3238
+ this.svg = t4, this.gen = new et(e4);
3239
+ }
3240
+ draw(t4) {
3241
+ const e4 = t4.sets || [], s4 = t4.options || this.getDefaultOptions(), n4 = this.svg.ownerDocument || window.document, o4 = n4.createElementNS(nt, "g"), a4 = t4.options.fixedDecimalPlaceDigits;
3242
+ for (const h4 of e4) {
3243
+ let e5 = null;
3244
+ switch (h4.type) {
3245
+ case "path":
3246
+ e5 = n4.createElementNS(nt, "path"), e5.setAttribute("d", this.opsToPath(h4, a4)), e5.setAttribute("stroke", s4.stroke), e5.setAttribute("stroke-width", s4.strokeWidth + ""), e5.setAttribute("fill", "none"), s4.strokeLineDash && e5.setAttribute("stroke-dasharray", s4.strokeLineDash.join(" ").trim()), s4.strokeLineDashOffset && e5.setAttribute("stroke-dashoffset", `${s4.strokeLineDashOffset}`);
3247
+ break;
3248
+ case "fillPath":
3249
+ e5 = n4.createElementNS(nt, "path"), e5.setAttribute("d", this.opsToPath(h4, a4)), e5.setAttribute("stroke", "none"), e5.setAttribute("stroke-width", "0"), e5.setAttribute("fill", s4.fill || ""), "curve" !== t4.shape && "polygon" !== t4.shape || e5.setAttribute("fill-rule", "evenodd");
3250
+ break;
3251
+ case "fillSketch":
3252
+ e5 = this.fillSketch(n4, h4, s4);
3253
+ }
3254
+ e5 && o4.appendChild(e5);
3255
+ }
3256
+ return o4;
3257
+ }
3258
+ fillSketch(t4, e4, s4) {
3259
+ let n4 = s4.fillWeight;
3260
+ n4 < 0 && (n4 = s4.strokeWidth / 2);
3261
+ const o4 = t4.createElementNS(nt, "path");
3262
+ return o4.setAttribute("d", this.opsToPath(e4, s4.fixedDecimalPlaceDigits)), o4.setAttribute("stroke", s4.fill || ""), o4.setAttribute("stroke-width", n4 + ""), o4.setAttribute("fill", "none"), s4.fillLineDash && o4.setAttribute("stroke-dasharray", s4.fillLineDash.join(" ").trim()), s4.fillLineDashOffset && o4.setAttribute("stroke-dashoffset", `${s4.fillLineDashOffset}`), o4;
3263
+ }
3264
+ get generator() {
3265
+ return this.gen;
3266
+ }
3267
+ getDefaultOptions() {
3268
+ return this.gen.defaultOptions;
3269
+ }
3270
+ opsToPath(t4, e4) {
3271
+ return this.gen.opsToPath(t4, e4);
3272
+ }
3273
+ line(t4, e4, s4, n4, o4) {
3274
+ const a4 = this.gen.line(t4, e4, s4, n4, o4);
3275
+ return this.draw(a4);
3276
+ }
3277
+ rectangle(t4, e4, s4, n4, o4) {
3278
+ const a4 = this.gen.rectangle(t4, e4, s4, n4, o4);
3279
+ return this.draw(a4);
3280
+ }
3281
+ ellipse(t4, e4, s4, n4, o4) {
3282
+ const a4 = this.gen.ellipse(t4, e4, s4, n4, o4);
3283
+ return this.draw(a4);
3284
+ }
3285
+ circle(t4, e4, s4, n4) {
3286
+ const o4 = this.gen.circle(t4, e4, s4, n4);
3287
+ return this.draw(o4);
3288
+ }
3289
+ linearPath(t4, e4) {
3290
+ const s4 = this.gen.linearPath(t4, e4);
3291
+ return this.draw(s4);
3292
+ }
3293
+ polygon(t4, e4) {
3294
+ const s4 = this.gen.polygon(t4, e4);
3295
+ return this.draw(s4);
3296
+ }
3297
+ arc(t4, e4, s4, n4, o4, a4, h4 = false, r4) {
3298
+ const i4 = this.gen.arc(t4, e4, s4, n4, o4, a4, h4, r4);
3299
+ return this.draw(i4);
3300
+ }
3301
+ curve(t4, e4) {
3302
+ const s4 = this.gen.curve(t4, e4);
3303
+ return this.draw(s4);
3304
+ }
3305
+ path(t4, e4) {
3306
+ const s4 = this.gen.path(t4, e4);
3307
+ return this.draw(s4);
3308
+ }
3309
+ };
3310
+ var at = { canvas: (t4, e4) => new st(t4, e4), svg: (t4, e4) => new ot(t4, e4), generator: (t4) => new et(t4), newSeed: () => et.newSeed() };
3311
+
3312
+ // node_modules/perfect-freehand/dist/esm/index.mjs
3313
+ var { PI: e2 } = Math;
3314
+ var t2 = e2 + 1e-4;
3315
+ var n2 = 0.5;
3316
+ var r2 = [1, 1];
3317
+ function i2(e4, t4, n4, r4 = (e5) => e5) {
3318
+ return e4 * r4(0.5 - t4 * (0.5 - n4));
3319
+ }
3320
+ var { min: a2 } = Math;
3321
+ function o2(e4, t4, n4) {
3322
+ let r4 = a2(1, t4 / n4);
3323
+ return a2(1, e4 + (a2(1, 1 - r4) - e4) * (r4 * 0.275));
3324
+ }
3325
+ function s2(e4) {
3326
+ return [-e4[0], -e4[1]];
3327
+ }
3328
+ function c2(e4, t4) {
3329
+ return [e4[0] + t4[0], e4[1] + t4[1]];
3330
+ }
3331
+ function l2(e4, t4, n4) {
3332
+ return e4[0] = t4[0] + n4[0], e4[1] = t4[1] + n4[1], e4;
3333
+ }
3334
+ function u2(e4, t4) {
3335
+ return [e4[0] - t4[0], e4[1] - t4[1]];
3336
+ }
3337
+ function d2(e4, t4, n4) {
3338
+ return e4[0] = t4[0] - n4[0], e4[1] = t4[1] - n4[1], e4;
3339
+ }
3340
+ function f2(e4, t4) {
3341
+ return [e4[0] * t4, e4[1] * t4];
3342
+ }
3343
+ function p3(e4, t4, n4) {
3344
+ return e4[0] = t4[0] * n4, e4[1] = t4[1] * n4, e4;
3345
+ }
3346
+ function m2(e4, t4) {
3347
+ return [e4[0] / t4, e4[1] / t4];
3348
+ }
3349
+ function h2(e4) {
3350
+ return [e4[1], -e4[0]];
3351
+ }
3352
+ function g2(e4, t4) {
3353
+ let n4 = t4[0];
3354
+ return e4[0] = t4[1], e4[1] = -n4, e4;
3355
+ }
3356
+ function ee(e4, t4) {
3357
+ return e4[0] * t4[0] + e4[1] * t4[1];
3358
+ }
3359
+ function _2(e4, t4) {
3360
+ return e4[0] === t4[0] && e4[1] === t4[1];
3361
+ }
3362
+ function v2(e4) {
3363
+ return Math.hypot(e4[0], e4[1]);
3364
+ }
3365
+ function y2(e4, t4) {
3366
+ let n4 = e4[0] - t4[0], r4 = e4[1] - t4[1];
3367
+ return n4 * n4 + r4 * r4;
3368
+ }
3369
+ function b2(e4) {
3370
+ return m2(e4, v2(e4));
3371
+ }
3372
+ function x2(e4, t4) {
3373
+ return Math.hypot(e4[1] - t4[1], e4[0] - t4[0]);
3374
+ }
3375
+ function S2(e4, t4, n4) {
3376
+ let r4 = Math.sin(n4), i4 = Math.cos(n4), a4 = e4[0] - t4[0], o4 = e4[1] - t4[1], s4 = a4 * i4 - o4 * r4, c4 = a4 * r4 + o4 * i4;
3377
+ return [s4 + t4[0], c4 + t4[1]];
3378
+ }
3379
+ function C2(e4, t4, n4, r4) {
3380
+ let i4 = Math.sin(r4), a4 = Math.cos(r4), o4 = t4[0] - n4[0], s4 = t4[1] - n4[1], c4 = o4 * a4 - s4 * i4, l4 = o4 * i4 + s4 * a4;
3381
+ return e4[0] = c4 + n4[0], e4[1] = l4 + n4[1], e4;
3382
+ }
3383
+ function w2(e4, t4, n4) {
3384
+ return c2(e4, f2(u2(t4, e4), n4));
3385
+ }
3386
+ function te(e4, t4, n4, r4) {
3387
+ let i4 = n4[0] - t4[0], a4 = n4[1] - t4[1];
3388
+ return e4[0] = t4[0] + i4 * r4, e4[1] = t4[1] + a4 * r4, e4;
3389
+ }
3390
+ function T2(e4, t4, n4) {
3391
+ return c2(e4, f2(t4, n4));
3392
+ }
3393
+ var E2 = [0, 0];
3394
+ var D2 = [0, 0];
3395
+ var O2 = [0, 0];
3396
+ function k2(e4, n4) {
3397
+ let r4 = T2(e4, b2(h2(u2(e4, c2(e4, [1, 1])))), -n4), i4 = [], a4 = 1 / 13;
3398
+ for (let n5 = a4; n5 <= 1; n5 += a4) i4.push(S2(r4, e4, t2 * 2 * n5));
3399
+ return i4;
3400
+ }
3401
+ function A2(e4, n4, r4) {
3402
+ let i4 = [], a4 = 1 / r4;
3403
+ for (let r5 = a4; r5 <= 1; r5 += a4) i4.push(S2(n4, e4, t2 * r5));
3404
+ return i4;
3405
+ }
3406
+ function j2(e4, t4, n4) {
3407
+ let r4 = u2(t4, n4), i4 = f2(r4, 0.5), a4 = f2(r4, 0.51);
3408
+ return [u2(e4, i4), u2(e4, a4), c2(e4, a4), c2(e4, i4)];
3409
+ }
3410
+ function M2(e4, n4, r4, i4) {
3411
+ let a4 = [], o4 = T2(e4, n4, r4), s4 = 1 / i4;
3412
+ for (let n5 = s4; n5 < 1; n5 += s4) a4.push(S2(o4, e4, t2 * 3 * n5));
3413
+ return a4;
3414
+ }
3415
+ function ne(e4, t4, n4) {
3416
+ return [c2(e4, f2(t4, n4)), c2(e4, f2(t4, n4 * 0.99)), u2(e4, f2(t4, n4 * 0.99)), u2(e4, f2(t4, n4))];
3417
+ }
3418
+ function N2(e4, t4, n4) {
3419
+ return e4 === false || e4 === void 0 ? 0 : e4 === true ? Math.max(t4, n4) : e4;
3420
+ }
3421
+ function re2(e4, t4, n4) {
3422
+ return e4.slice(0, 10).reduce((e5, r4) => {
3423
+ let i4 = r4.pressure;
3424
+ return t4 && (i4 = o2(e5, r4.distance, n4)), (e5 + i4) / 2;
3425
+ }, e4[0].pressure);
3426
+ }
3427
+ function P2(e4, n4 = {}) {
3428
+ let { size: r4 = 16, smoothing: a4 = 0.5, thinning: f5 = 0.5, simulatePressure: m4 = true, easing: _3 = (e5) => e5, start: v4 = {}, end: b3 = {}, last: x4 = false } = n4, { cap: S4 = true, easing: w4 = (e5) => e5 * (2 - e5) } = v4, { cap: T4 = true, easing: P4 = (e5) => --e5 * e5 * e5 + 1 } = b3;
3429
+ if (e4.length === 0 || r4 <= 0) return [];
3430
+ let F4 = e4[e4.length - 1].runningLength, I4 = N2(v4.taper, r4, F4), L4 = N2(b3.taper, r4, F4), R3 = (r4 * a4) ** 2, z3 = [], B3 = [], V3 = re2(e4, m4, r4), H2 = i2(r4, f5, e4[e4.length - 1].pressure, _3), U2, W2 = e4[0].vector, G2 = e4[0].point, K2 = G2, q3 = G2, J2 = K2, Y2 = false;
3431
+ for (let n5 = 0; n5 < e4.length; n5++) {
3432
+ let { pressure: a5 } = e4[n5], { point: s4, vector: h4, distance: v5, runningLength: b4 } = e4[n5], x5 = n5 === e4.length - 1;
3433
+ if (!x5 && F4 - b4 < 3) continue;
3434
+ f5 ? (m4 && (a5 = o2(V3, v5, r4)), H2 = i2(r4, f5, a5, _3)) : H2 = r4 / 2, U2 === void 0 && (U2 = H2);
3435
+ let S5 = b4 < I4 ? w4(b4 / I4) : 1, T5 = F4 - b4 < L4 ? P4((F4 - b4) / L4) : 1;
3436
+ H2 = Math.max(0.01, H2 * Math.min(S5, T5));
3437
+ let k4 = (x5 ? e4[n5] : e4[n5 + 1]).vector, A4 = x5 ? 1 : ee(h4, k4), j4 = ee(h4, W2) < 0 && !Y2, M4 = A4 !== null && A4 < 0;
3438
+ if (j4 || M4) {
3439
+ g2(E2, W2), p3(E2, E2, H2);
3440
+ for (let e5 = 0; e5 <= 1; e5 += 0.07692307692307693) d2(D2, s4, E2), C2(D2, D2, s4, t2 * e5), q3 = [D2[0], D2[1]], z3.push(q3), l2(O2, s4, E2), C2(O2, O2, s4, t2 * -e5), J2 = [O2[0], O2[1]], B3.push(J2);
3441
+ G2 = q3, K2 = J2, M4 && (Y2 = true);
3442
+ continue;
3443
+ }
3444
+ if (Y2 = false, x5) {
3445
+ g2(E2, h4), p3(E2, E2, H2), z3.push(u2(s4, E2)), B3.push(c2(s4, E2));
3446
+ continue;
3447
+ }
3448
+ te(E2, k4, h4, A4), g2(E2, E2), p3(E2, E2, H2), d2(D2, s4, E2), q3 = [D2[0], D2[1]], (n5 <= 1 || y2(G2, q3) > R3) && (z3.push(q3), G2 = q3), l2(O2, s4, E2), J2 = [O2[0], O2[1]], (n5 <= 1 || y2(K2, J2) > R3) && (B3.push(J2), K2 = J2), V3 = a5, W2 = h4;
3449
+ }
3450
+ let X2 = [e4[0].point[0], e4[0].point[1]], Z2 = e4.length > 1 ? [e4[e4.length - 1].point[0], e4[e4.length - 1].point[1]] : c2(e4[0].point, [1, 1]), Q2 = [], $3 = [];
3451
+ if (e4.length === 1) {
3452
+ if (!(I4 || L4) || x4) return k2(X2, U2 || H2);
3453
+ } else {
3454
+ I4 || L4 && e4.length === 1 || (S4 ? Q2.push(...A2(X2, B3[0], 13)) : Q2.push(...j2(X2, z3[0], B3[0])));
3455
+ let t4 = h2(s2(e4[e4.length - 1].vector));
3456
+ L4 || I4 && e4.length === 1 ? $3.push(Z2) : T4 ? $3.push(...M2(Z2, t4, H2, 29)) : $3.push(...ne(Z2, t4, H2));
3457
+ }
3458
+ return z3.concat($3, B3.reverse(), Q2);
3459
+ }
3460
+ var F2 = [0, 0];
3461
+ function I2(e4) {
3462
+ return e4 != null && e4 >= 0;
3463
+ }
3464
+ function L2(e4, t4 = {}) {
3465
+ let { streamline: i4 = 0.5, size: a4 = 16, last: o4 = false } = t4;
3466
+ if (e4.length === 0) return [];
3467
+ let s4 = 0.15 + (1 - i4) * 0.85, l4 = Array.isArray(e4[0]) ? e4 : e4.map(({ x: e5, y: t5, pressure: r4 = n2 }) => [e5, t5, r4]);
3468
+ if (l4.length === 2) {
3469
+ let e5 = l4[1];
3470
+ l4 = l4.slice(0, -1);
3471
+ for (let t5 = 1; t5 < 5; t5++) l4.push(w2(l4[0], e5, t5 / 4));
3472
+ }
3473
+ l4.length === 1 && (l4 = [...l4, [...c2(l4[0], r2), ...l4[0].slice(2)]]);
3474
+ let u5 = [{ point: [l4[0][0], l4[0][1]], pressure: I2(l4[0][2]) ? l4[0][2] : 0.25, vector: [...r2], distance: 0, runningLength: 0 }], f5 = false, p5 = 0, m4 = u5[0], h4 = l4.length - 1;
3475
+ for (let e5 = 1; e5 < l4.length; e5++) {
3476
+ let t5 = o4 && e5 === h4 ? [l4[e5][0], l4[e5][1]] : w2(m4.point, l4[e5], s4);
3477
+ if (_2(m4.point, t5)) continue;
3478
+ let r4 = x2(t5, m4.point);
3479
+ if (p5 += r4, e5 < h4 && !f5) {
3480
+ if (p5 < a4) continue;
3481
+ f5 = true;
3482
+ }
3483
+ d2(F2, m4.point, t5), m4 = { point: t5, pressure: I2(l4[e5][2]) ? l4[e5][2] : n2, vector: b2(F2), distance: r4, runningLength: p5 }, u5.push(m4);
3484
+ }
3485
+ return u5[0].vector = u5[1]?.vector || [0, 0], u5;
3486
+ }
3487
+ function R2(e4, t4 = {}) {
3488
+ return P2(L2(e4, t4), t4);
3489
+ }
3490
+
3491
+ // src/renderer.ts
3492
+ var gen = at.generator();
3493
+ var FONT_FAMILIES = {
3494
+ 1: "Virgil, Segoe UI Emoji, sans-serif",
3495
+ 2: "Helvetica, Arial, sans-serif",
3496
+ 3: "Cascadia, monospace",
3497
+ 4: "Virgil, Segoe UI Emoji, sans-serif"
3498
+ };
3499
+ function renderToSvg(data, opts = {}, ctx) {
3500
+ const elements = data.elements.filter((el) => !el.isDeleted);
3501
+ if (elements.length === 0) {
3502
+ return {
3503
+ svg: '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"></svg>',
3504
+ overlays: [],
3505
+ viewBox: { width: 100, height: 100, offsetX: 0, offsetY: 0 }
3506
+ };
3507
+ }
3508
+ const padding = opts.exportPadding ?? 20;
3509
+ const bbox = computeBoundingBox(elements);
3510
+ const width = Math.ceil(bbox.width + padding * 2);
3511
+ const height = Math.ceil(bbox.height + padding * 2);
3512
+ const offsetX = -bbox.minX + padding;
3513
+ const offsetY = -bbox.minY + padding;
3514
+ const bgColor = resolveBgColor(data, opts);
3515
+ const overlays = [];
3516
+ const embeddables = elements.filter((el) => el.type === "embeddable" || el.type === "iframe");
3517
+ for (const el of embeddables) {
3518
+ const link = el.link ?? "";
3519
+ const isWikilink = link.startsWith("[[");
3520
+ overlays.push({
3521
+ id: el.id,
3522
+ x: el.x,
3523
+ y: el.y,
3524
+ width: el.width,
3525
+ height: el.height,
3526
+ link,
3527
+ isWikilink,
3528
+ resolved: ctx?.resolvedEmbeds?.[el.id]
3529
+ });
3530
+ }
3531
+ const renderedElements = elements.map((el) => renderElement(el, data, ctx)).filter(Boolean);
3532
+ const parts = [
3533
+ `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 ${width} ${height}" width="100%" height="100%" preserveAspectRatio="xMidYMid meet" data-bg-color="${escapeAttr(bgColor ?? "#ffffff")}">`,
3534
+ `<defs>${getFontDefs()}</defs>`,
3535
+ `<g transform="translate(${offsetX}, ${offsetY})">`,
3536
+ ...renderedElements,
3537
+ "</g>",
3538
+ "</svg>"
3539
+ ];
3540
+ return {
3541
+ svg: parts.filter(Boolean).join("\n"),
3542
+ overlays,
3543
+ viewBox: { width, height, offsetX, offsetY }
3544
+ };
3545
+ }
3546
+ function resolveBgColor(data, opts) {
3547
+ const exportBg = data.appState.exportBackground ?? true;
3548
+ if (!exportBg) return null;
3549
+ if (opts.darkMode === "dark") return "#1e1e1e";
3550
+ if (opts.darkMode === "light") return data.appState.viewBackgroundColor ?? "#ffffff";
3551
+ const rawBg = data.appState.viewBackgroundColor ?? "#ffffff";
3552
+ const lower = rawBg.toLowerCase();
3553
+ if (lower === "#ffffff" || lower === "#ffffffff") return "var(--excalidraw-bg, #ffffff)";
3554
+ return rawBg;
3555
+ }
3556
+ function renderElement(el, data, ctx) {
3557
+ const inner = renderElementInner(el, data, ctx);
3558
+ if (!inner) return "";
3559
+ const attrs = [];
3560
+ if (el.angle && el.angle !== 0) {
3561
+ const cx = el.x + el.width / 2;
3562
+ const cy = el.y + el.height / 2;
3563
+ const deg = el.angle * 180 / Math.PI;
3564
+ attrs.push(`transform="rotate(${deg.toFixed(2)}, ${cx.toFixed(2)}, ${cy.toFixed(2)})"`);
3565
+ }
3566
+ if (el.opacity != null && el.opacity < 100) {
3567
+ attrs.push(`opacity="${el.opacity / 100}"`);
3568
+ }
3569
+ if (attrs.length > 0) {
3570
+ return `<g ${attrs.join(" ")}>${inner}</g>`;
3571
+ }
3572
+ return inner;
3573
+ }
3574
+ function renderElementInner(el, data, ctx) {
3575
+ switch (el.type) {
3576
+ case "rectangle":
3577
+ return renderRectangle(el);
3578
+ case "ellipse":
3579
+ return renderEllipse(el);
3580
+ case "diamond":
3581
+ return renderDiamond(el);
3582
+ case "line":
3583
+ case "arrow":
3584
+ return renderLinearElement(el);
3585
+ case "text":
3586
+ return renderText(el);
3587
+ case "freedraw":
3588
+ return renderFreedraw(el);
3589
+ case "image":
3590
+ return renderImage(el, data, ctx);
3591
+ case "frame":
3592
+ case "magicframe":
3593
+ return renderFrame(el);
3594
+ case "embeddable":
3595
+ case "iframe":
3596
+ return renderEmbeddable(el);
3597
+ default:
3598
+ return "";
3599
+ }
3600
+ }
3601
+ var DARK_MODE_MAP = {
3602
+ "#1e1e1e": "#d3d3d3",
3603
+ "#000000": "#ededed",
3604
+ "#343a40": "#b7bcc1",
3605
+ "#868e96": "#6e757c",
3606
+ "#ced4da": "#33383d",
3607
+ "#e9ecef": "#202325",
3608
+ "#f8f9fa": "#161718",
3609
+ "#e03131": "#ff8383",
3610
+ "#fa5252": "#fa6969",
3611
+ "#ff8787": "#b44d4d",
3612
+ "#ffc9c9": "#5a2c2c",
3613
+ "#fff5f5": "#1f1717",
3614
+ "#c2255c": "#ff8dbc",
3615
+ "#e64980": "#f56e9d",
3616
+ "#f783ac": "#b04d70",
3617
+ "#fcc2d7": "#602e40",
3618
+ "#fff0f6": "#26191e",
3619
+ "#9c36b5": "#e28af8",
3620
+ "#be4bdb": "#d471ed",
3621
+ "#da77f2": "#a954be",
3622
+ "#eebefa": "#5b3165",
3623
+ "#f8f0fc": "#211a25",
3624
+ "#6741d9": "#b595ff",
3625
+ "#7950f2": "#a885ff",
3626
+ "#9775fa": "#8a6cdf",
3627
+ "#d0bfff": "#4a3b72",
3628
+ "#f3f0ff": "#1f1c29",
3629
+ "#1971c2": "#56a2e8",
3630
+ "#228be6": "#3791e0",
3631
+ "#4dabf7": "#2273b4",
3632
+ "#a5d8ff": "#154162",
3633
+ "#e7f5ff": "#121e26",
3634
+ "#0c8599": "#3da5b6",
3635
+ "#15aabf": "#0f8fa1",
3636
+ "#3bc9db": "#007281",
3637
+ "#99e9f2": "#004149",
3638
+ "#e3fafc": "#0a1e20",
3639
+ "#099268": "#32a783",
3640
+ "#12b886": "#039267",
3641
+ "#38d9a9": "#00744b",
3642
+ "#96f2d7": "#00422b",
3643
+ "#e6fcf5": "#0a1d17",
3644
+ "#2f9e44": "#39994b",
3645
+ "#40c057": "#16842a",
3646
+ "#69db7c": "#056715",
3647
+ "#b2f2bb": "#043b0c",
3648
+ "#ebfbee": "#0f1d12",
3649
+ "#f08c00": "#b86200",
3650
+ "#fab005": "#905000",
3651
+ "#ffd43b": "#5f3a00",
3652
+ "#ffec99": "#362600",
3653
+ "#fff9db": "#1e1900",
3654
+ "#e8590c": "#f17634",
3655
+ "#fd7e14": "#cd6005",
3656
+ "#ffa94d": "#924800",
3657
+ "#ffd8a8": "#4c2b01",
3658
+ "#fff4e6": "#22190d",
3659
+ "#846358": "#a98d84",
3660
+ "#a18072": "#917569",
3661
+ "#d2bab0": "#5a463d",
3662
+ "#eaddd7": "#362b26",
3663
+ "#f8f1ee": "#221c1a",
3664
+ "#ffffff": "#121212"
3665
+ };
3666
+ function themeColor(color) {
3667
+ const lower = color.toLowerCase();
3668
+ if (lower in DARK_MODE_MAP) {
3669
+ return `var(--excalidraw-color-${lower.slice(1)}, ${color})`;
3670
+ }
3671
+ return color;
3672
+ }
3673
+ function roughOpts(el) {
3674
+ return {
3675
+ seed: el.seed,
3676
+ roughness: el.roughness,
3677
+ stroke: el.strokeColor === "transparent" ? "none" : themeColor(el.strokeColor),
3678
+ strokeWidth: el.strokeWidth,
3679
+ fill: el.backgroundColor === "transparent" ? void 0 : themeColor(el.backgroundColor),
3680
+ fillStyle: mapFillStyle(el.fillStyle),
3681
+ strokeLineDash: mapStrokeStyle(el.strokeStyle, el.strokeWidth)
3682
+ };
3683
+ }
3684
+ function mapFillStyle(style) {
3685
+ switch (style) {
3686
+ case "hachure":
3687
+ return "hachure";
3688
+ case "cross-hatch":
3689
+ return "cross-hatch";
3690
+ case "solid":
3691
+ return "solid";
3692
+ case "zigzag":
3693
+ return "zigzag";
3694
+ case "dots":
3695
+ return "dots";
3696
+ case "dashed":
3697
+ return "dashed";
3698
+ case "zigzag-line":
3699
+ return "zigzag-line";
3700
+ default:
3701
+ return "hachure";
3702
+ }
3703
+ }
3704
+ function mapStrokeStyle(style, width) {
3705
+ switch (style) {
3706
+ case "dashed":
3707
+ return [8 * width, 4 * width];
3708
+ case "dotted":
3709
+ return [1.5 * width, 4 * width];
3710
+ default:
3711
+ return void 0;
3712
+ }
3713
+ }
3714
+ function renderRectangle(el) {
3715
+ const opts = roughOpts(el);
3716
+ const drawable = gen.rectangle(el.x, el.y, el.width, el.height, opts);
3717
+ return drawableToSvg(drawable);
3718
+ }
3719
+ function renderEllipse(el) {
3720
+ const opts = roughOpts(el);
3721
+ const cx = el.x + el.width / 2;
3722
+ const cy = el.y + el.height / 2;
3723
+ const drawable = gen.ellipse(cx, cy, el.width, el.height, opts);
3724
+ return drawableToSvg(drawable);
3725
+ }
3726
+ function renderDiamond(el) {
3727
+ const opts = roughOpts(el);
3728
+ const cx = el.x + el.width / 2;
3729
+ const cy = el.y + el.height / 2;
3730
+ const hw = el.width / 2;
3731
+ const hh = el.height / 2;
3732
+ const points = [
3733
+ [cx, cy - hh],
3734
+ [cx + hw, cy],
3735
+ [cx, cy + hh],
3736
+ [cx - hw, cy]
3737
+ ];
3738
+ const drawable = gen.polygon(points, opts);
3739
+ return drawableToSvg(drawable);
3740
+ }
3741
+ function renderLinearElement(el) {
3742
+ const points = el.points ?? [];
3743
+ if (points.length < 2) return "";
3744
+ const opts = {
3745
+ ...roughOpts(el),
3746
+ fill: void 0,
3747
+ fillStyle: void 0
3748
+ };
3749
+ const absolutePoints = points.map(([px, py]) => [el.x + px, el.y + py]);
3750
+ let svg3;
3751
+ if (points.length > 2) {
3752
+ const drawable = gen.curve(absolutePoints, opts);
3753
+ svg3 = drawableToSvg(drawable);
3754
+ } else {
3755
+ const drawable = gen.linearPath(absolutePoints, opts);
3756
+ svg3 = drawableToSvg(drawable);
3757
+ }
3758
+ if (el.type === "arrow") {
3759
+ svg3 += renderArrowheads(el, absolutePoints);
3760
+ }
3761
+ return svg3;
3762
+ }
3763
+ function renderArrowheads(el, points) {
3764
+ let svg3 = "";
3765
+ const color = el.strokeColor === "transparent" ? "none" : el.strokeColor;
3766
+ if (el.endArrowhead && el.endArrowhead !== "none" && points.length >= 2) {
3767
+ const tip = points[points.length - 1];
3768
+ const prev = points[points.length - 2];
3769
+ svg3 += renderArrowhead(prev, tip, color, el.strokeWidth);
3770
+ }
3771
+ if (el.startArrowhead && el.startArrowhead !== "none" && points.length >= 2) {
3772
+ const tip = points[0];
3773
+ const prev = points[1];
3774
+ svg3 += renderArrowhead(prev, tip, color, el.strokeWidth);
3775
+ }
3776
+ return svg3;
3777
+ }
3778
+ function renderArrowhead(from, to, color, strokeWidth) {
3779
+ const angle = Math.atan2(to[1] - from[1], to[0] - from[0]);
3780
+ const headLen = 10 + strokeWidth * 2;
3781
+ const headAngle = Math.PI / 6;
3782
+ const x1 = to[0] - headLen * Math.cos(angle - headAngle);
3783
+ const y1 = to[1] - headLen * Math.sin(angle - headAngle);
3784
+ const x22 = to[0] - headLen * Math.cos(angle + headAngle);
3785
+ const y22 = to[1] - headLen * Math.sin(angle + headAngle);
3786
+ return `<path d="M${x1.toFixed(2)} ${y1.toFixed(2)} L${to[0].toFixed(2)} ${to[1].toFixed(2)} L${x22.toFixed(2)} ${y22.toFixed(2)}" fill="none" stroke="${escapeAttr(color)}" stroke-width="${strokeWidth}" stroke-linecap="round" stroke-linejoin="round" />`;
3787
+ }
3788
+ function renderText(el) {
3789
+ if (!el.text) return "";
3790
+ const fontFamily = FONT_FAMILIES[el.fontFamily ?? 1] ?? "Virgil, Segoe UI Emoji, sans-serif";
3791
+ const fontSize = el.fontSize ?? 20;
3792
+ const textAnchor = mapTextAlign(el.textAlign);
3793
+ const color = el.strokeColor === "transparent" ? "var(--excalidraw-fg, #000000)" : themeColor(el.strokeColor);
3794
+ const lines = el.text.split("\n");
3795
+ const lineHeight = fontSize * 1.25;
3796
+ const totalHeight = lines.length * lineHeight;
3797
+ let startY = el.y;
3798
+ if (el.verticalAlign === "middle") {
3799
+ startY = el.y + (el.height - totalHeight) / 2;
3800
+ } else if (el.verticalAlign === "bottom") {
3801
+ startY = el.y + el.height - totalHeight;
3802
+ }
3803
+ let textX = el.x;
3804
+ if (el.textAlign === "center") {
3805
+ textX = el.x + el.width / 2;
3806
+ } else if (el.textAlign === "right") {
3807
+ textX = el.x + el.width;
3808
+ }
3809
+ const tspans = lines.map((line, i4) => {
3810
+ const y4 = startY + fontSize + i4 * lineHeight;
3811
+ return `<tspan x="${textX.toFixed(2)}" y="${y4.toFixed(2)}">${escapeXml(line)}</tspan>`;
3812
+ }).join("");
3813
+ return `<text font-family="${escapeAttr(fontFamily)}" font-size="${fontSize}" fill="${escapeAttr(color)}" text-anchor="${textAnchor}" dominant-baseline="auto">${tspans}</text>`;
3814
+ }
3815
+ function mapTextAlign(align) {
3816
+ switch (align) {
3817
+ case "center":
3818
+ return "middle";
3819
+ case "right":
3820
+ return "end";
3821
+ default:
3822
+ return "start";
3823
+ }
3824
+ }
3825
+ function renderFreedraw(el) {
3826
+ const points = el.points ?? [];
3827
+ if (points.length < 2) return "";
3828
+ const absolutePoints = points.map(
3829
+ ([px, py]) => [el.x + px, el.y + py, 0.5]
3830
+ );
3831
+ const strokePoints = R2(absolutePoints, {
3832
+ size: el.strokeWidth * 4.5,
3833
+ thinning: 0.6,
3834
+ smoothing: 0.5,
3835
+ streamline: 0.5,
3836
+ simulatePressure: el.simulatePressure ?? true
3837
+ });
3838
+ if (strokePoints.length < 2) return "";
3839
+ const d4 = getSvgPathFromStroke(strokePoints);
3840
+ const color = el.strokeColor === "transparent" ? "var(--excalidraw-fg, #000000)" : themeColor(el.strokeColor);
3841
+ return `<path d="${d4}" fill="${escapeAttr(color)}" stroke="none" />`;
3842
+ }
3843
+ function getSvgPathFromStroke(points) {
3844
+ if (points.length < 2) return "";
3845
+ const first = points[0];
3846
+ let d4 = `M${first[0].toFixed(2)} ${first[1].toFixed(2)}`;
3847
+ for (let i4 = 1; i4 < points.length - 1; i4++) {
3848
+ const curr = points[i4];
3849
+ const next = points[i4 + 1];
3850
+ const mx = (curr[0] + next[0]) / 2;
3851
+ const my = (curr[1] + next[1]) / 2;
3852
+ d4 += ` Q${curr[0].toFixed(2)} ${curr[1].toFixed(2)} ${mx.toFixed(2)} ${my.toFixed(2)}`;
3853
+ }
3854
+ d4 += " Z";
3855
+ return d4;
3856
+ }
3857
+ function renderImage(el, data, ctx) {
3858
+ if (!el.fileId) return "";
3859
+ const file = data.files[el.fileId];
3860
+ if (file?.dataURL) {
3861
+ return `<image x="${el.x}" y="${el.y}" width="${el.width}" height="${el.height}" href="${escapeAttr(file.dataURL)}" preserveAspectRatio="xMidYMid meet" />`;
3862
+ }
3863
+ const resolvedUrl = ctx?.resolvedImages?.[el.fileId];
3864
+ if (resolvedUrl) {
3865
+ return `<image x="${el.x}" y="${el.y}" width="${el.width}" height="${el.height}" href="${escapeAttr(resolvedUrl)}" preserveAspectRatio="xMidYMid meet" />`;
3866
+ }
3867
+ return "";
3868
+ }
3869
+ function renderFrame(el) {
3870
+ return `<rect x="${el.x}" y="${el.y}" width="${el.width}" height="${el.height}" fill="none" stroke="#aaaaaa" stroke-width="1" stroke-dasharray="5 5" />`;
3871
+ }
3872
+ function renderEmbeddable(el) {
3873
+ return `<rect x="${el.x}" y="${el.y}" width="${el.width}" height="${el.height}" fill="var(--excalidraw-bg, #f8f9fa)" stroke="var(--excalidraw-color-ced4da, #dee2e6)" stroke-width="2" rx="8" ry="8" data-embed-id="${el.id}" />`;
3874
+ }
3875
+ function drawableToSvg(drawable) {
3876
+ const paths = [];
3877
+ for (const set of drawable.sets) {
3878
+ const d4 = opsToPath(set.ops);
3879
+ if (!d4) continue;
3880
+ if (set.type === "path") {
3881
+ paths.push(
3882
+ `<path d="${d4}" stroke="${escapeAttr(drawable.options.stroke ?? "none")}" stroke-width="${drawable.options.strokeWidth ?? 1}" fill="none"${strokeDashAttr(drawable.options.strokeLineDash)} />`
3883
+ );
3884
+ } else if (set.type === "fillPath") {
3885
+ paths.push(
3886
+ `<path d="${d4}" fill="${escapeAttr(drawable.options.fill ?? "none")}" stroke="none" />`
3887
+ );
3888
+ } else if (set.type === "fillSketch") {
3889
+ paths.push(
3890
+ `<path d="${d4}" stroke="${escapeAttr(drawable.options.fill ?? "none")}" stroke-width="${(drawable.options.fillWeight ?? drawable.options.strokeWidth ?? 1) * 0.5}" fill="none" />`
3891
+ );
3892
+ }
3893
+ }
3894
+ return paths.join("\n");
3895
+ }
3896
+ function strokeDashAttr(dash2) {
3897
+ if (!dash2 || dash2.length === 0) return "";
3898
+ return ` stroke-dasharray="${dash2.join(" ")}"`;
3899
+ }
3900
+ function opsToPath(ops) {
3901
+ let d4 = "";
3902
+ for (const item of ops) {
3903
+ const p5 = item.data;
3904
+ switch (item.op) {
3905
+ case "move":
3906
+ d4 += `M${p5[0].toFixed(2)} ${p5[1].toFixed(2)} `;
3907
+ break;
3908
+ case "lineTo":
3909
+ d4 += `L${p5[0].toFixed(2)} ${p5[1].toFixed(2)} `;
3910
+ break;
3911
+ case "bcurveTo":
3912
+ d4 += `C${p5[0].toFixed(2)} ${p5[1].toFixed(2)},${p5[2].toFixed(2)} ${p5[3].toFixed(2)},${p5[4].toFixed(2)} ${p5[5].toFixed(2)} `;
3913
+ break;
3914
+ }
3915
+ }
3916
+ return d4.trim();
3917
+ }
3918
+ function computeBoundingBox(elements) {
3919
+ let minX = Infinity;
3920
+ let minY = Infinity;
3921
+ let maxX = -Infinity;
3922
+ let maxY = -Infinity;
3923
+ for (const el of elements) {
3924
+ const corners = getElementCorners(el);
3925
+ for (const [cx, cy] of corners) {
3926
+ if (cx < minX) minX = cx;
3927
+ if (cy < minY) minY = cy;
3928
+ if (cx > maxX) maxX = cx;
3929
+ if (cy > maxY) maxY = cy;
3930
+ }
3931
+ }
3932
+ if (!isFinite(minX)) {
3933
+ return { minX: 0, minY: 0, maxX: 100, maxY: 100, width: 100, height: 100 };
3934
+ }
3935
+ return { minX, minY, maxX, maxY, width: maxX - minX, height: maxY - minY };
3936
+ }
3937
+ function getElementCorners(el) {
3938
+ if ((el.type === "line" || el.type === "arrow" || el.type === "freedraw") && el.points) {
3939
+ return el.points.map(([px, py]) => [el.x + px, el.y + py]);
3940
+ }
3941
+ const corners = [
3942
+ [el.x, el.y],
3943
+ [el.x + el.width, el.y],
3944
+ [el.x + el.width, el.y + el.height],
3945
+ [el.x, el.y + el.height]
3946
+ ];
3947
+ if (el.angle && el.angle !== 0) {
3948
+ const cx = el.x + el.width / 2;
3949
+ const cy = el.y + el.height / 2;
3950
+ return corners.map(([x4, y4]) => rotatePoint(x4, y4, cx, cy, el.angle));
3951
+ }
3952
+ return corners;
3953
+ }
3954
+ function rotatePoint(x4, y4, cx, cy, angle) {
3955
+ const cos = Math.cos(angle);
3956
+ const sin = Math.sin(angle);
3957
+ const dx = x4 - cx;
3958
+ const dy = y4 - cy;
3959
+ return [cx + dx * cos - dy * sin, cy + dx * sin + dy * cos];
3960
+ }
3961
+ function getFontDefs() {
3962
+ return `<style>
3963
+ @font-face {
3964
+ font-family: "Virgil";
3965
+ src: url("https://unpkg.com/@excalidraw/excalidraw@0.17.0/dist/prod/Virgil-Regular-hO16.woff2") format("woff2");
3966
+ }
3967
+ </style>`;
3968
+ }
3969
+ function escapeXml(str) {
3970
+ return str.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;").replace(/'/g, "&#39;");
3971
+ }
3972
+ function escapeAttr(str) {
3973
+ return str.replace(/&/g, "&amp;").replace(/"/g, "&quot;").replace(/</g, "&lt;").replace(/>/g, "&gt;");
3974
+ }
3975
+
3976
+ // src/components/styles/excalidraw.scss
3977
+ var excalidraw_default = '.excalidraw-page {\n position: relative;\n width: 100%;\n height: 100%;\n max-width: none;\n margin: 0;\n overflow: hidden;\n user-select: none;\n background-color: var(--light);\n}\n\n.excalidraw-container {\n position: relative;\n width: 100%;\n height: 100%;\n overflow: hidden;\n display: flex;\n align-items: center;\n justify-content: center;\n cursor: grab;\n touch-action: none;\n background-color: var(--light);\n}\n.excalidraw-container:active {\n cursor: grabbing;\n}\n.excalidraw-container svg {\n width: 100%;\n height: 100%;\n object-fit: contain;\n transform-origin: 0 0;\n}\n\n:root {\n --excalidraw-fg: #1e1e1e;\n --excalidraw-bg: #ffffff;\n --excalidraw-color-1e1e1e: #1e1e1e;\n --excalidraw-color-000000: #000000;\n --excalidraw-color-ffffff: #ffffff;\n --excalidraw-color-343a40: #343a40;\n --excalidraw-color-868e96: #868e96;\n --excalidraw-color-ced4da: #ced4da;\n --excalidraw-color-e9ecef: #e9ecef;\n --excalidraw-color-f8f9fa: #f8f9fa;\n --excalidraw-color-e03131: #e03131;\n --excalidraw-color-fa5252: #fa5252;\n --excalidraw-color-ff8787: #ff8787;\n --excalidraw-color-ffc9c9: #ffc9c9;\n --excalidraw-color-fff5f5: #fff5f5;\n --excalidraw-color-c2255c: #c2255c;\n --excalidraw-color-e64980: #e64980;\n --excalidraw-color-f783ac: #f783ac;\n --excalidraw-color-fcc2d7: #fcc2d7;\n --excalidraw-color-fff0f6: #fff0f6;\n --excalidraw-color-9c36b5: #9c36b5;\n --excalidraw-color-be4bdb: #be4bdb;\n --excalidraw-color-da77f2: #da77f2;\n --excalidraw-color-eebefa: #eebefa;\n --excalidraw-color-f8f0fc: #f8f0fc;\n --excalidraw-color-6741d9: #6741d9;\n --excalidraw-color-7950f2: #7950f2;\n --excalidraw-color-9775fa: #9775fa;\n --excalidraw-color-d0bfff: #d0bfff;\n --excalidraw-color-f3f0ff: #f3f0ff;\n --excalidraw-color-1971c2: #1971c2;\n --excalidraw-color-228be6: #228be6;\n --excalidraw-color-4dabf7: #4dabf7;\n --excalidraw-color-a5d8ff: #a5d8ff;\n --excalidraw-color-e7f5ff: #e7f5ff;\n --excalidraw-color-0c8599: #0c8599;\n --excalidraw-color-15aabf: #15aabf;\n --excalidraw-color-3bc9db: #3bc9db;\n --excalidraw-color-99e9f2: #99e9f2;\n --excalidraw-color-e3fafc: #e3fafc;\n --excalidraw-color-099268: #099268;\n --excalidraw-color-12b886: #12b886;\n --excalidraw-color-38d9a9: #38d9a9;\n --excalidraw-color-96f2d7: #96f2d7;\n --excalidraw-color-e6fcf5: #e6fcf5;\n --excalidraw-color-2f9e44: #2f9e44;\n --excalidraw-color-40c057: #40c057;\n --excalidraw-color-69db7c: #69db7c;\n --excalidraw-color-b2f2bb: #b2f2bb;\n --excalidraw-color-ebfbee: #ebfbee;\n --excalidraw-color-f08c00: #f08c00;\n --excalidraw-color-fab005: #fab005;\n --excalidraw-color-ffd43b: #ffd43b;\n --excalidraw-color-ffec99: #ffec99;\n --excalidraw-color-fff9db: #fff9db;\n --excalidraw-color-e8590c: #e8590c;\n --excalidraw-color-fd7e14: #fd7e14;\n --excalidraw-color-ffa94d: #ffa94d;\n --excalidraw-color-ffd8a8: #ffd8a8;\n --excalidraw-color-fff4e6: #fff4e6;\n --excalidraw-color-846358: #846358;\n --excalidraw-color-a18072: #a18072;\n --excalidraw-color-d2bab0: #d2bab0;\n --excalidraw-color-eaddd7: #eaddd7;\n --excalidraw-color-f8f1ee: #f8f1ee;\n}\n\n:root[saved-theme=dark] {\n --excalidraw-fg: #d3d3d3;\n --excalidraw-bg: #121212;\n --excalidraw-color-1e1e1e: #d3d3d3;\n --excalidraw-color-000000: #ededed;\n --excalidraw-color-ffffff: #121212;\n --excalidraw-color-343a40: #b7bcc1;\n --excalidraw-color-868e96: #6e757c;\n --excalidraw-color-ced4da: #33383d;\n --excalidraw-color-e9ecef: #202325;\n --excalidraw-color-f8f9fa: #161718;\n --excalidraw-color-e03131: #ff8383;\n --excalidraw-color-fa5252: #fa6969;\n --excalidraw-color-ff8787: #b44d4d;\n --excalidraw-color-ffc9c9: #5a2c2c;\n --excalidraw-color-fff5f5: #1f1717;\n --excalidraw-color-c2255c: #ff8dbc;\n --excalidraw-color-e64980: #f56e9d;\n --excalidraw-color-f783ac: #b04d70;\n --excalidraw-color-fcc2d7: #602e40;\n --excalidraw-color-fff0f6: #26191e;\n --excalidraw-color-9c36b5: #e28af8;\n --excalidraw-color-be4bdb: #d471ed;\n --excalidraw-color-da77f2: #a954be;\n --excalidraw-color-eebefa: #5b3165;\n --excalidraw-color-f8f0fc: #211a25;\n --excalidraw-color-6741d9: #b595ff;\n --excalidraw-color-7950f2: #a885ff;\n --excalidraw-color-9775fa: #8a6cdf;\n --excalidraw-color-d0bfff: #4a3b72;\n --excalidraw-color-f3f0ff: #1f1c29;\n --excalidraw-color-1971c2: #56a2e8;\n --excalidraw-color-228be6: #3791e0;\n --excalidraw-color-4dabf7: #2273b4;\n --excalidraw-color-a5d8ff: #154162;\n --excalidraw-color-e7f5ff: #121e26;\n --excalidraw-color-0c8599: #3da5b6;\n --excalidraw-color-15aabf: #0f8fa1;\n --excalidraw-color-3bc9db: #007281;\n --excalidraw-color-99e9f2: #004149;\n --excalidraw-color-e3fafc: #0a1e20;\n --excalidraw-color-099268: #32a783;\n --excalidraw-color-12b886: #039267;\n --excalidraw-color-38d9a9: #00744b;\n --excalidraw-color-96f2d7: #00422b;\n --excalidraw-color-e6fcf5: #0a1d17;\n --excalidraw-color-2f9e44: #39994b;\n --excalidraw-color-40c057: #16842a;\n --excalidraw-color-69db7c: #056715;\n --excalidraw-color-b2f2bb: #043b0c;\n --excalidraw-color-ebfbee: #0f1d12;\n --excalidraw-color-f08c00: #b86200;\n --excalidraw-color-fab005: #905000;\n --excalidraw-color-ffd43b: #5f3a00;\n --excalidraw-color-ffec99: #362600;\n --excalidraw-color-fff9db: #1e1900;\n --excalidraw-color-e8590c: #f17634;\n --excalidraw-color-fd7e14: #cd6005;\n --excalidraw-color-ffa94d: #924800;\n --excalidraw-color-ffd8a8: #4c2b01;\n --excalidraw-color-fff4e6: #22190d;\n --excalidraw-color-846358: #a98d84;\n --excalidraw-color-a18072: #917569;\n --excalidraw-color-d2bab0: #5a463d;\n --excalidraw-color-eaddd7: #362b26;\n --excalidraw-color-f8f1ee: #221c1a;\n}\n\n.excalidraw-controls {\n position: fixed;\n bottom: 1rem;\n right: 1rem;\n z-index: 10;\n display: flex;\n flex-direction: row;\n gap: 0.25rem;\n}\n.excalidraw-controls button {\n width: 2rem;\n height: 2rem;\n border: 1px solid var(--lightgray);\n border-radius: 6px;\n background: var(--light);\n color: var(--darkgray);\n font-size: 1.2rem;\n line-height: 1;\n cursor: pointer;\n display: flex;\n align-items: center;\n justify-content: center;\n transition: background-color 0.1s ease;\n}\n.excalidraw-controls button:hover {\n background: var(--lightgray);\n}\n\n.page[data-frame=excalidraw] {\n --excalidraw-sidebar-width: 300px;\n}\n\n.page[data-frame=excalidraw] .excalidraw-frame {\n position: relative;\n width: 100%;\n height: 100%;\n overflow: hidden;\n padding-left: 0;\n transition: padding-left 0.2s ease;\n}\n\n.page[data-frame=excalidraw] .excalidraw-stage {\n width: 100%;\n height: 100%;\n}\n\n.page[data-frame=excalidraw] .excalidraw-sidebar {\n position: fixed;\n top: 0;\n height: 100vh;\n width: var(--excalidraw-sidebar-width);\n box-sizing: border-box;\n background: var(--light);\n border-right: 1px solid var(--lightgray);\n box-shadow: 8px 0 24px rgba(0, 0, 0, 0.12);\n overflow-y: hidden;\n left: calc(-1 * var(--excalidraw-sidebar-width));\n transition: left 0.25s ease;\n z-index: 20;\n}\n\n.page[data-frame=excalidraw] .excalidraw-sidebar-toggle {\n position: fixed;\n top: 12px;\n left: 12px;\n width: 32px;\n height: 32px;\n border: 1px solid var(--lightgray);\n border-radius: 6px;\n background: var(--light);\n color: var(--darkgray);\n cursor: pointer;\n display: flex;\n align-items: center;\n justify-content: center;\n z-index: 30;\n transition: background 0.1s ease, left 0.25s ease;\n}\n.page[data-frame=excalidraw] .excalidraw-sidebar-toggle:hover {\n background: var(--lightgray);\n}\n.page[data-frame=excalidraw] .excalidraw-sidebar-toggle svg {\n pointer-events: none;\n}\n\n.page[data-frame=excalidraw] .excalidraw-sidebar-icon-close {\n display: none;\n}\n\n.page[data-frame=excalidraw].excalidraw-sidebar-open .excalidraw-frame {\n padding-left: var(--excalidraw-sidebar-width);\n}\n\n.page[data-frame=excalidraw].excalidraw-sidebar-open .excalidraw-sidebar {\n left: 0;\n}\n\n.page[data-frame=excalidraw].excalidraw-sidebar-open .excalidraw-sidebar-toggle {\n left: calc(var(--excalidraw-sidebar-width) + 12px);\n}\n\n.page[data-frame=excalidraw].excalidraw-sidebar-open .excalidraw-sidebar-icon-open {\n display: none;\n}\n\n.page[data-frame=excalidraw].excalidraw-sidebar-open .excalidraw-sidebar-icon-close {\n display: block;\n}\n\n@media (max-width: 800px) {\n .page[data-frame=excalidraw] {\n --excalidraw-sidebar-width: calc(100vw - 56px);\n }\n .page[data-frame=excalidraw].excalidraw-sidebar-open .excalidraw-frame {\n padding-left: 0;\n }\n .page[data-frame=excalidraw].excalidraw-sidebar-open .excalidraw-sidebar-toggle {\n left: calc(var(--excalidraw-sidebar-width) + 12px);\n }\n}\n.page[data-frame=excalidraw] .excalidraw-sidebar {\n padding: 1rem;\n display: flex;\n flex-direction: column;\n gap: 1rem;\n}\n.page[data-frame=excalidraw] .excalidraw-sidebar .spacer {\n display: none;\n}\n.page[data-frame=excalidraw] .excalidraw-sidebar .explorer button.desktop-explorer,\n.page[data-frame=excalidraw] .excalidraw-sidebar .explorer button.mobile-explorer {\n display: none !important;\n}\n.page[data-frame=excalidraw] .excalidraw-sidebar .explorer {\n order: initial;\n overflow-y: hidden;\n overflow: hidden;\n flex: 1 1 0;\n min-height: 0;\n flex-shrink: initial;\n align-self: initial;\n margin-top: 0;\n margin-bottom: 0;\n}\n.page[data-frame=excalidraw] .excalidraw-sidebar .explorer .explorer-content,\n.page[data-frame=excalidraw] .excalidraw-sidebar .explorer.collapsed > .explorer-content,\n.page[data-frame=excalidraw] .excalidraw-sidebar .explorer:not(.collapsed) > .explorer-content {\n position: static;\n width: auto;\n max-width: none;\n height: 100%;\n max-height: 100%;\n transform: none !important;\n visibility: visible !important;\n padding: 0;\n overflow-y: auto;\n z-index: auto;\n background-color: transparent;\n}\n.page[data-frame=excalidraw] .excalidraw-sidebar .explorer-content > .explorer-ul {\n overscroll-behavior: auto;\n}\n\n.excalidraw-overlays {\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n pointer-events: none;\n}\n\n.excalidraw-overlay {\n position: absolute;\n display: none;\n flex-direction: column;\n pointer-events: auto;\n cursor: default;\n user-select: text;\n}\n\n.excalidraw-embed-note,\n.excalidraw-embed-url {\n width: 100%;\n height: 100%;\n overflow: hidden;\n border-radius: 8px;\n border: 2px solid var(--lightgray);\n display: flex;\n flex-direction: column;\n background: var(--light);\n box-sizing: border-box;\n}\n\n.excalidraw-embed-header {\n padding: 8px 12px;\n border-bottom: 1px solid var(--lightgray);\n font-size: 13px;\n font-family: var(--bodyFont, sans-serif);\n color: var(--darkgray);\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n flex-shrink: 0;\n}\n.excalidraw-embed-header a {\n color: var(--darkgray);\n text-decoration: none;\n}\n\n.excalidraw-embed-content {\n flex: 1;\n overflow: auto;\n padding: 8px 12px;\n font-family: var(--bodyFont, sans-serif);\n font-size: 12px;\n line-height: 1.5;\n color: var(--darkgray);\n background: var(--light);\n}\n\n.excalidraw-embed-open-link {\n display: block;\n padding: 4px 0;\n color: var(--secondary);\n font-size: 12px;\n text-decoration: none;\n font-family: var(--bodyFont, sans-serif);\n}\n\n.excalidraw-embed-body {\n font-size: 12px;\n line-height: 1.5;\n color: var(--dark);\n}\n.excalidraw-embed-body h1 {\n font-size: 1.6em;\n margin: 0.5em 0 0.25em;\n}\n.excalidraw-embed-body h2 {\n font-size: 1.4em;\n margin: 0.5em 0 0.25em;\n}\n.excalidraw-embed-body h3 {\n font-size: 1.2em;\n margin: 0.4em 0 0.2em;\n}\n.excalidraw-embed-body h4 {\n font-size: 1.1em;\n margin: 0.4em 0 0.2em;\n}\n.excalidraw-embed-body h5 {\n font-size: 1.05em;\n margin: 0.3em 0 0.15em;\n}\n.excalidraw-embed-body h6 {\n font-size: 1em;\n margin: 0.3em 0 0.15em;\n}\n.excalidraw-embed-body h1[id] > a[href^="#"],\n.excalidraw-embed-body h2[id] > a[href^="#"],\n.excalidraw-embed-body h3[id] > a[href^="#"],\n.excalidraw-embed-body h4[id] > a[href^="#"],\n.excalidraw-embed-body h5[id] > a[href^="#"],\n.excalidraw-embed-body h6[id] > a[href^="#"] {\n display: none;\n}\n\n.excalidraw-embed-missing {\n color: var(--gray);\n font-size: 12px;\n}\n\n.excalidraw-embed-iframe {\n flex: 1;\n width: 100%;\n border: none;\n}\n\n.transclude .excalidraw-page {\n height: auto;\n}\n.transclude .excalidraw-container {\n height: auto;\n min-height: 400px;\n}\n.transclude .excalidraw-controls {\n position: absolute;\n}\n\n.popover-inner .excalidraw-page {\n height: auto;\n}\n.popover-inner .excalidraw-container {\n height: auto;\n min-height: 200px;\n max-height: 300px;\n}\n.popover-inner .excalidraw-controls {\n display: none;\n}';
3978
+
3979
+ // src/components/scripts/excalidraw.inline.ts
3980
+ var excalidraw_inline_default = `function B(){let n=document.querySelector(".page[data-frame='excalidraw']");if(n){N(n),q(n);return}let t=document.querySelectorAll(".excalidraw-page");for(let v of t)q(v)}function N(n){let t=n.querySelector(".excalidraw-sidebar-toggle");t&&(t.addEventListener("click",()=>{n.classList.toggle("excalidraw-sidebar-open")}),window.addCleanup(()=>{n.classList.remove("excalidraw-sidebar-open")}))}function q(n){let t=n.querySelector(".excalidraw-container");if(!t)return;let v=t.querySelector("svg");if(!v)return;t.style.backgroundColor="var(--excalidraw-bg, var(--light))";var h=n.querySelector(".excalidraw-overlays");let a=1,u=0,d=0,c=!1,m=0,M=0;function O(){if(h){var e=h.querySelectorAll(".excalidraw-overlay");if(e.length!==0){var o=parseFloat(h.getAttribute("data-offset-x"))||0,l=parseFloat(h.getAttribute("data-offset-y"))||0,r=v.getScreenCTM(),g=t.getBoundingClientRect();if(r)for(var p=0;p<e.length;p++){var i=e[p],A=parseFloat(i.getAttribute("data-x"))||0,Y=parseFloat(i.getAttribute("data-y"))||0,T=parseFloat(i.getAttribute("data-w"))||0,P=parseFloat(i.getAttribute("data-h"))||0,C=A+o,F=Y+l,k=C*r.a+r.e-g.left,z=F*r.d+r.f-g.top,D=T*r.a,I=P*r.d;i.style.left=k+"px",i.style.top=z+"px",i.style.width=D+"px",i.style.height=I+"px",i.style.display="flex"}}}}O();function s(){v.style.transform="translate("+u+"px, "+d+"px) scale("+a+")",O()}function y(e){e.preventDefault();var o=e.deltaY>0?-.15:.15;a=Math.max(.1,Math.min(5,a+o)),s()}function E(e){e.button===0&&(c=!0,m=e.clientX-u,M=e.clientY-d,t.style.cursor="grabbing")}function w(e){c&&(u=e.clientX-m,d=e.clientY-M,s())}function x(){c=!1,t.style.cursor="grab"}var L=n.querySelector(".excalidraw-zoom-in"),S=n.querySelector(".excalidraw-zoom-out"),b=n.querySelector(".excalidraw-reset");L&&L.addEventListener("click",function(){a=Math.min(5,a+.15),s()}),S&&S.addEventListener("click",function(){a=Math.max(.1,a-.15),s()}),b&&b.addEventListener("click",function(){a=1,u=0,d=0,s()});var f=0;function X(e){if(e.touches.length===1)c=!0,m=e.touches[0].clientX-u,M=e.touches[0].clientY-d;else if(e.touches.length===2){c=!1;var o=e.touches[0].clientX-e.touches[1].clientX,l=e.touches[0].clientY-e.touches[1].clientY;f=Math.sqrt(o*o+l*l)}}function Z(e){if(e.preventDefault(),e.touches.length===1&&c)u=e.touches[0].clientX-m,d=e.touches[0].clientY-M,s();else if(e.touches.length===2&&f>0){var o=e.touches[0].clientX-e.touches[1].clientX,l=e.touches[0].clientY-e.touches[1].clientY,r=Math.sqrt(o*o+l*l),g=r/f;a=Math.max(.1,Math.min(5,a*g)),f=r,s()}}function _(){c=!1,f=0}t.addEventListener("wheel",y,{passive:!1}),t.addEventListener("mousedown",E),document.addEventListener("mousemove",w),document.addEventListener("mouseup",x),t.addEventListener("touchstart",X,{passive:!0}),t.addEventListener("touchmove",Z,{passive:!1}),t.addEventListener("touchend",_),window.addCleanup(function(){t.removeEventListener("wheel",y),t.removeEventListener("mousedown",E),document.removeEventListener("mousemove",w),document.removeEventListener("mouseup",x),t.removeEventListener("touchstart",X),t.removeEventListener("touchmove",Z),t.removeEventListener("touchend",_)})}document.addEventListener("nav",B);
3981
+ `;
3982
+ var l3;
3983
+ l3 = { __e: function(n4, l4, u5, t4) {
3984
+ for (var i4, o4, r4; l4 = l4.__; ) if ((i4 = l4.__c) && !i4.__) try {
3985
+ if ((o4 = i4.constructor) && null != o4.getDerivedStateFromError && (i4.setState(o4.getDerivedStateFromError(n4)), r4 = i4.__d), null != i4.componentDidCatch && (i4.componentDidCatch(n4, t4 || {}), r4 = i4.__d), r4) return i4.__E = i4;
3986
+ } catch (l5) {
3987
+ n4 = l5;
3988
+ }
3989
+ throw n4;
3990
+ } }, "function" == typeof Promise ? Promise.prototype.then.bind(Promise.resolve()) : setTimeout;
3991
+
3992
+ // node_modules/preact/jsx-runtime/dist/jsxRuntime.mjs
3993
+ var f4 = 0;
3994
+ function u4(e4, t4, n4, o4, i4, u5) {
3995
+ t4 || (t4 = {});
3996
+ var a4, c4, p5 = t4;
3997
+ if ("ref" in p5) for (c4 in p5 = {}, t4) "ref" == c4 ? a4 = t4[c4] : p5[c4] = t4[c4];
3998
+ var l4 = { type: e4, props: p5, key: n4, ref: a4, __k: null, __: null, __b: 0, __e: null, __c: null, constructor: void 0, __v: --f4, __i: -1, __u: 0, __source: i4, __self: u5 };
3999
+ if ("function" == typeof e4 && (a4 = e4.defaultProps)) for (c4 in a4) void 0 === p5[c4] && (p5[c4] = a4[c4]);
4000
+ return l3.vnode && l3.vnode(l4), l4;
4001
+ }
4002
+
4003
+ // src/components/ExcalidrawBody.tsx
4004
+ function stripTranscludes(html5) {
4005
+ return html5.replace(/<blockquote[^>]*class="[^"]*transclude[^"]*"[^>]*>[\s\S]*?<\/blockquote>/gi, "").replace(/<div[^>]*class="[^"]*transclude[^"]*"[^>]*>[\s\S]*?<\/div>/gi, "");
4006
+ }
4007
+ function resolveEmbeds(data, currentSlug, allFiles) {
4008
+ const result = {};
4009
+ const embeddables = data.elements.filter(
4010
+ (el) => el.type === "embeddable" || el.type === "iframe"
4011
+ );
4012
+ for (const el of embeddables) {
4013
+ const link = el.link ?? "";
4014
+ if (!link.startsWith("[[")) continue;
4015
+ const target = link.replace(/^\[\[/, "").replace(/\]\]$/, "");
4016
+ const targetLower = target.toLowerCase();
4017
+ const page = allFiles.find((f5) => {
4018
+ if (!f5.slug) return false;
4019
+ if (f5.slug === targetLower) return true;
4020
+ const lastSegment = f5.slug.split("/").pop();
4021
+ return lastSegment === targetLower;
4022
+ });
4023
+ const pageSlug = page?.slug ?? slugifyFilePath(target);
4024
+ const href = resolveRelative(currentSlug, pageSlug);
4025
+ if (!page || !page.htmlAst) {
4026
+ result[el.id] = {
4027
+ html: `<a href="${href}" style="color:#228be6;text-decoration:none;font-size:13px;">${target}</a>`,
4028
+ href
4029
+ };
4030
+ continue;
4031
+ }
4032
+ const tree = page.htmlAst;
4033
+ const rebased = {
4034
+ ...tree,
4035
+ children: tree.children.map((child) => {
4036
+ if (child.type === "element") {
4037
+ return normalizeHastElement(
4038
+ child,
4039
+ currentSlug,
4040
+ pageSlug
4041
+ );
4042
+ }
4043
+ return child;
4044
+ })
4045
+ };
4046
+ let html5 = toHtml(rebased, { allowDangerousHtml: true });
4047
+ html5 = stripTranscludes(html5);
4048
+ result[el.id] = { html: html5, href };
4049
+ }
4050
+ return result;
4051
+ }
4052
+ function resolveImages(imagePaths, currentSlug) {
4053
+ const result = {};
4054
+ for (const [hash, filePath] of Object.entries(imagePaths)) {
4055
+ const imageSlug = slugifyFilePath(filePath);
4056
+ result[hash] = resolveRelative(currentSlug, imageSlug);
4057
+ }
4058
+ return result;
4059
+ }
4060
+ function renderOverlay(overlay) {
4061
+ const label = overlay.link.replace(/^\[\[/, "").replace(/\]\]$/, "").replace(/^https?:\/\//, "");
4062
+ const truncatedLabel = label.length > 50 ? label.slice(0, 47) + "..." : label;
4063
+ if (overlay.isWikilink) {
4064
+ const noteContent = overlay.resolved ? `<a href="${overlay.resolved.href}" class="excalidraw-embed-open-link">Open note \u2192</a><div class="excalidraw-embed-body">${overlay.resolved.html}</div>` : `<span class="excalidraw-embed-missing">Note not found</span>`;
4065
+ return /* @__PURE__ */ u4(
4066
+ "div",
4067
+ {
4068
+ class: "excalidraw-overlay excalidraw-embed-note",
4069
+ "data-overlay-id": overlay.id,
4070
+ "data-x": overlay.x,
4071
+ "data-y": overlay.y,
4072
+ "data-w": overlay.width,
4073
+ "data-h": overlay.height,
4074
+ children: [
4075
+ /* @__PURE__ */ u4("div", { class: "excalidraw-embed-header", children: "\u{1F4C4} " + truncatedLabel }),
4076
+ /* @__PURE__ */ u4("div", { class: "excalidraw-embed-content", dangerouslySetInnerHTML: { __html: noteContent } })
4077
+ ]
4078
+ }
4079
+ );
4080
+ }
4081
+ return /* @__PURE__ */ u4(
4082
+ "div",
4083
+ {
4084
+ class: "excalidraw-overlay excalidraw-embed-url",
4085
+ "data-overlay-id": overlay.id,
4086
+ "data-x": overlay.x,
4087
+ "data-y": overlay.y,
4088
+ "data-w": overlay.width,
4089
+ "data-h": overlay.height,
4090
+ children: [
4091
+ /* @__PURE__ */ u4("div", { class: "excalidraw-embed-header", children: /* @__PURE__ */ u4("a", { href: overlay.link, target: "_blank", rel: "noopener noreferrer", children: "\u{1F517} " + truncatedLabel }) }),
4092
+ /* @__PURE__ */ u4(
4093
+ "iframe",
4094
+ {
4095
+ src: overlay.link,
4096
+ class: "excalidraw-embed-iframe",
4097
+ sandbox: "allow-scripts allow-same-origin allow-popups",
4098
+ loading: "lazy",
4099
+ referrerpolicy: "no-referrer"
4100
+ }
4101
+ )
4102
+ ]
4103
+ }
4104
+ );
4105
+ }
4106
+ var ExcalidrawBody_default = ((userOpts) => {
4107
+ const Component = (props) => {
4108
+ const { fileData, allFiles } = props;
4109
+ const data = fileData.excalidrawData;
4110
+ const options = fileData.excalidrawOptions ?? userOpts ?? {};
4111
+ const currentSlug = fileData.slug;
4112
+ const resolvedEmbedMap = allFiles ? resolveEmbeds(data, currentSlug, allFiles) : void 0;
4113
+ const imagePaths = fileData.excalidrawImagePaths ?? {};
4114
+ const resolvedImageMap = resolveImages(imagePaths, currentSlug);
4115
+ const renderCtx = {
4116
+ resolvedEmbeds: resolvedEmbedMap,
4117
+ resolvedImages: resolvedImageMap
4118
+ };
4119
+ const result = renderToSvg(data, options, renderCtx);
4120
+ return /* @__PURE__ */ u4(
4121
+ "article",
4122
+ {
4123
+ class: "excalidraw-page",
4124
+ role: "img",
4125
+ "aria-label": fileData.frontmatter?.title ?? "Excalidraw drawing",
4126
+ children: [
4127
+ /* @__PURE__ */ u4("div", { class: "excalidraw-controls", children: [
4128
+ /* @__PURE__ */ u4("button", { class: "excalidraw-zoom-in", type: "button", "aria-label": "Zoom in", children: "+" }),
4129
+ /* @__PURE__ */ u4("button", { class: "excalidraw-zoom-out", type: "button", "aria-label": "Zoom out", children: "\u2212" }),
4130
+ /* @__PURE__ */ u4("button", { class: "excalidraw-reset", type: "button", "aria-label": "Reset view", children: "\u27F2" })
4131
+ ] }),
4132
+ /* @__PURE__ */ u4("div", { class: "excalidraw-container", dangerouslySetInnerHTML: { __html: result.svg } }),
4133
+ /* @__PURE__ */ u4(
4134
+ "div",
4135
+ {
4136
+ class: "excalidraw-overlays",
4137
+ "data-viewbox-w": result.viewBox.width,
4138
+ "data-viewbox-h": result.viewBox.height,
4139
+ "data-offset-x": result.viewBox.offsetX,
4140
+ "data-offset-y": result.viewBox.offsetY,
4141
+ children: result.overlays.map((o4) => renderOverlay(o4))
4142
+ }
4143
+ ),
4144
+ options.enableInteraction !== false && /* @__PURE__ */ u4(
4145
+ "script",
4146
+ {
4147
+ type: "application/json",
4148
+ class: "excalidraw-data",
4149
+ dangerouslySetInnerHTML: {
4150
+ __html: JSON.stringify({
4151
+ elements: data.elements,
4152
+ appState: data.appState,
4153
+ files: data.files
4154
+ })
4155
+ }
4156
+ }
4157
+ )
4158
+ ]
4159
+ }
4160
+ );
4161
+ };
4162
+ Component.css = excalidraw_default;
4163
+ Component.afterDOMLoaded = excalidraw_inline_default;
4164
+ return Component;
4165
+ });
4166
+
4167
+ export { ExcalidrawBody_default as ExcalidrawBody };
4168
+ //# sourceMappingURL=index.js.map
4169
+ //# sourceMappingURL=index.js.map