makethisbetter 1.21.2 → 1.22.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.
- package/README.md +105 -7
- package/dist/annotate/draw-note-bar.d.ts +3 -2
- package/dist/annotate/draw-note-bar.d.ts.map +1 -1
- package/dist/annotate/draw.d.ts +10 -2
- package/dist/annotate/draw.d.ts.map +1 -1
- package/dist/annotate/highlighter.d.ts +1 -3
- package/dist/annotate/highlighter.d.ts.map +1 -1
- package/dist/annotate/overlay.d.ts +1 -1
- package/dist/annotate/pin.d.ts +1 -1
- package/dist/annotate/session.d.ts +3 -3
- package/dist/annotate/session.d.ts.map +1 -1
- package/dist/annotate/toolbar.d.ts +4 -2
- package/dist/annotate/toolbar.d.ts.map +1 -1
- package/dist/api/client.d.ts +10 -2
- package/dist/api/client.d.ts.map +1 -1
- package/dist/context/breadcrumbs.d.ts +1 -1
- package/dist/context/breadcrumbs.d.ts.map +1 -1
- package/dist/context/dom-utils.d.ts +5 -0
- package/dist/context/dom-utils.d.ts.map +1 -1
- package/dist/context/dom-utils.test.d.ts +2 -0
- package/dist/context/dom-utils.test.d.ts.map +1 -0
- package/dist/context/error-summary.d.ts +1 -1
- package/dist/context/frustration.d.ts +3 -0
- package/dist/context/frustration.d.ts.map +1 -1
- package/dist/global.d.ts +1 -1
- package/dist/html-to-image.cjs +3 -0
- package/dist/html-to-image.cjs.map +1 -0
- package/dist/html-to-image.js +513 -0
- package/dist/html-to-image.js.map +1 -0
- package/dist/i18n/de.d.ts +2 -0
- package/dist/i18n/de.d.ts.map +1 -1
- package/dist/i18n/en.d.ts +2 -0
- package/dist/i18n/en.d.ts.map +1 -1
- package/dist/i18n/es.d.ts +2 -0
- package/dist/i18n/es.d.ts.map +1 -1
- package/dist/i18n/fr.d.ts +2 -0
- package/dist/i18n/fr.d.ts.map +1 -1
- package/dist/i18n/index.d.ts +1 -1
- package/dist/i18n/ja.d.ts +2 -0
- package/dist/i18n/ja.d.ts.map +1 -1
- package/dist/i18n/ko.d.ts +2 -0
- package/dist/i18n/ko.d.ts.map +1 -1
- package/dist/i18n/zh-CN.d.ts +2 -0
- package/dist/i18n/zh-CN.d.ts.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/makethisbetter.cjs +81 -72
- package/dist/makethisbetter.cjs.map +1 -1
- package/dist/makethisbetter.esm.js +1750 -1699
- package/dist/makethisbetter.esm.js.map +1 -1
- package/dist/makethisbetter.js +45 -35
- package/dist/makethisbetter.js.map +1 -1
- package/dist/makethisbetter.standalone.js +4361 -0
- package/dist/makethisbetter.standalone.js.map +1 -0
- package/dist/popup/clarify-session.d.ts +99 -0
- package/dist/popup/clarify-session.d.ts.map +1 -0
- package/dist/popup/clarify-session.test.d.ts +2 -0
- package/dist/popup/clarify-session.test.d.ts.map +1 -0
- package/dist/popup/clarify.d.ts +37 -53
- package/dist/popup/clarify.d.ts.map +1 -1
- package/dist/popup/comment.d.ts +7 -4
- package/dist/popup/comment.d.ts.map +1 -1
- package/dist/popup/failure.d.ts +12 -0
- package/dist/popup/failure.d.ts.map +1 -0
- package/dist/popup/focus-trap.d.ts +25 -0
- package/dist/popup/focus-trap.d.ts.map +1 -0
- package/dist/popup/position.d.ts +18 -0
- package/dist/popup/position.d.ts.map +1 -0
- package/dist/popup/success.d.ts +4 -2
- package/dist/popup/success.d.ts.map +1 -1
- package/dist/privacy/dom.d.ts +2 -0
- package/dist/privacy/dom.d.ts.map +1 -1
- package/dist/record/control-bar.d.ts +2 -2
- package/dist/record/session.d.ts +3 -4
- package/dist/record/session.d.ts.map +1 -1
- package/dist/screenshot/capture.d.ts +17 -2
- package/dist/screenshot/capture.d.ts.map +1 -1
- package/dist/screenshot/geometry.d.ts +50 -0
- package/dist/screenshot/geometry.d.ts.map +1 -0
- package/dist/screenshot/image.d.ts +2 -0
- package/dist/screenshot/image.d.ts.map +1 -0
- package/dist/screenshot/svg-path.d.ts +3 -0
- package/dist/screenshot/svg-path.d.ts.map +1 -0
- package/dist/types.d.ts +20 -0
- package/dist/types.d.ts.map +1 -1
- package/dist/widget/brand-colors.d.ts +2 -2
- package/dist/widget/controller.d.ts +35 -24
- package/dist/widget/controller.d.ts.map +1 -1
- package/dist/widget/dim-overlay.d.ts +1 -1
- package/dist/widget/frustration-prompt.d.ts +2 -2
- package/dist/widget/mode-states.d.ts +152 -0
- package/dist/widget/mode-states.d.ts.map +1 -0
- package/dist/widget/mode-transitions.test.d.ts +2 -0
- package/dist/widget/mode-transitions.test.d.ts.map +1 -0
- package/dist/widget/payload.d.ts +15 -4
- package/dist/widget/payload.d.ts.map +1 -1
- package/dist/widget/pet.d.ts +1 -11
- package/dist/widget/pet.d.ts.map +1 -1
- package/dist/widget/recording-manager.d.ts +3 -3
- package/dist/widget/shadow.d.ts +4 -4
- package/dist/widget/shadow.d.ts.map +1 -1
- package/dist/widget/submission-lifecycle.d.ts +69 -0
- package/dist/widget/submission-lifecycle.d.ts.map +1 -0
- package/dist/widget/tab.d.ts +2 -2
- package/package.json +15 -6
- package/src/annotate/draw-note-bar.ts +6 -2
- package/src/annotate/draw.ts +73 -8
- package/src/annotate/highlighter.ts +1 -76
- package/src/annotate/session.ts +27 -11
- package/src/annotate/toolbar.ts +14 -1
- package/src/api/client.ts +37 -13
- package/src/context/breadcrumbs.ts +1 -2
- package/src/context/dom-utils.ts +92 -1
- package/src/context/frustration.ts +34 -5
- package/src/i18n/de.ts +2 -0
- package/src/i18n/en.ts +2 -0
- package/src/i18n/es.ts +2 -0
- package/src/i18n/fr.ts +2 -0
- package/src/i18n/ja.ts +2 -0
- package/src/i18n/ko.ts +2 -0
- package/src/i18n/zh-CN.ts +2 -0
- package/src/index.ts +7 -1
- package/src/popup/clarify-session.ts +550 -0
- package/src/popup/clarify.ts +182 -447
- package/src/popup/comment.ts +42 -16
- package/src/popup/failure.ts +57 -0
- package/src/popup/focus-trap.ts +77 -0
- package/src/popup/position.ts +36 -0
- package/src/popup/success.ts +29 -3
- package/src/privacy/dom.ts +4 -1
- package/src/record/session.ts +22 -5
- package/src/screenshot/capture.ts +228 -195
- package/src/screenshot/geometry.ts +119 -0
- package/src/screenshot/image.ts +8 -0
- package/src/screenshot/svg-path.ts +29 -0
- package/src/styles/widget.css +64 -0
- package/src/types.ts +20 -0
- package/src/vite-env.d.ts +6 -0
- package/src/widget/controller.ts +227 -254
- package/src/widget/mode-states.ts +316 -0
- package/src/widget/payload.ts +18 -11
- package/src/widget/pet.ts +3 -1
- package/src/widget/shadow.ts +21 -29
- package/src/widget/submission-lifecycle.ts +239 -0
- package/dist/index.d.cts +0 -19
- package/dist/index.d.mts +0 -19
- package/dist/screenshot/crop.d.ts +0 -18
- package/dist/screenshot/crop.d.ts.map +0 -1
- package/dist/screenshot/crop.test.d.ts +0 -2
- package/dist/screenshot/crop.test.d.ts.map +0 -1
- package/src/screenshot/crop.ts +0 -131
package/README.md
CHANGED
|
@@ -79,18 +79,18 @@ User clicks feedback tab
|
|
|
79
79
|
'use client'
|
|
80
80
|
import { useEffect } from 'react'
|
|
81
81
|
|
|
82
|
-
export function FeedbackProvider() {
|
|
82
|
+
export function FeedbackProvider({ user }: { user?: { id: string, email?: string } }) {
|
|
83
83
|
useEffect(() => {
|
|
84
84
|
import('makethisbetter').then(({ MakeThisBetter }) => {
|
|
85
85
|
MakeThisBetter.init({
|
|
86
86
|
projectKey: process.env.NEXT_PUBLIC_MTB_KEY!,
|
|
87
|
-
user
|
|
87
|
+
user
|
|
88
88
|
})
|
|
89
89
|
})
|
|
90
90
|
return () => {
|
|
91
91
|
import('makethisbetter').then(({ MakeThisBetter }) => MakeThisBetter.destroy())
|
|
92
92
|
}
|
|
93
|
-
}, [])
|
|
93
|
+
}, [user])
|
|
94
94
|
return null
|
|
95
95
|
}
|
|
96
96
|
```
|
|
@@ -430,6 +430,88 @@ operations documented in the specification.
|
|
|
430
430
|
|
|
431
431
|
The cloud platform at [makethisbetter.dev](https://makethisbetter.dev) adds AI triage, dashboard, GitHub/Linear sync, and email notifications on top.
|
|
432
432
|
|
|
433
|
+
## Content Security Policy
|
|
434
|
+
|
|
435
|
+
If your site sends a `Content-Security-Policy` header, three directives can
|
|
436
|
+
affect the widget.
|
|
437
|
+
|
|
438
|
+
**`script-src`.** The npm build ships inside your own bundle and needs no entry
|
|
439
|
+
of its own. The CDN build loads from unpkg:
|
|
440
|
+
|
|
441
|
+
```
|
|
442
|
+
script-src https://unpkg.com;
|
|
443
|
+
```
|
|
444
|
+
|
|
445
|
+
Interaction Replay loads the rrweb recorder on demand. The SDK first tries a
|
|
446
|
+
dynamic `import('@rrweb/record')` — when your bundler resolved that dependency,
|
|
447
|
+
the recorder is part of your own assets and nothing changes. When that import
|
|
448
|
+
is unavailable (the CDN build, or a bundler that externalized it), the SDK
|
|
449
|
+
injects a version-pinned, SRI-checked script from jsDelivr:
|
|
450
|
+
|
|
451
|
+
```
|
|
452
|
+
script-src https://cdn.jsdelivr.net;
|
|
453
|
+
```
|
|
454
|
+
|
|
455
|
+
The injected tag carries a `sha384` `integrity` attribute and
|
|
456
|
+
`crossorigin="anonymous"`, so the browser refuses to run the file if the CDN
|
|
457
|
+
content ever changes; the exact hash is pinned in the source next to the URL.
|
|
458
|
+
Because the tag is created by script, adding that hash to `script-src` does not
|
|
459
|
+
allowlist it — either allow the `cdn.jsdelivr.net` host, or use
|
|
460
|
+
`'strict-dynamic'` with a nonce on the widget's own script tag so trust
|
|
461
|
+
propagates to scripts it creates.
|
|
462
|
+
|
|
463
|
+
**When `script-src` blocks the recorder**, nothing on your page breaks: the
|
|
464
|
+
replay cannot start, the SDK logs
|
|
465
|
+
`[MakeThisBetter] Interaction replay unavailable, falling back to markup`, and
|
|
466
|
+
the toolbar switches back to Markup mode. Annotation, screenshots, and text
|
|
467
|
+
feedback are unaffected.
|
|
468
|
+
|
|
469
|
+
**`connect-src`.** Submissions go to `https://makethisbetter.dev` by default,
|
|
470
|
+
or to the origin of your `apiUrl` when self-hosting:
|
|
471
|
+
|
|
472
|
+
```
|
|
473
|
+
connect-src https://makethisbetter.dev;
|
|
474
|
+
```
|
|
475
|
+
|
|
476
|
+
**`style-src`.** The widget injects one `<style>` element into its own shadow
|
|
477
|
+
root and never touches your page's stylesheets. Browsers still evaluate the
|
|
478
|
+
page's CSP for elements inside a shadow root, so a `style-src` that forbids
|
|
479
|
+
`'unsafe-inline'` can leave the widget unstyled. Browser behavior inside shadow
|
|
480
|
+
roots has varied between engines and versions — if you run a strict
|
|
481
|
+
`style-src`, open the widget once and check.
|
|
482
|
+
|
|
483
|
+
### Avoiding the rrweb CDN entirely
|
|
484
|
+
|
|
485
|
+
An allowlist that cannot add jsDelivr can serve the recorder from its own
|
|
486
|
+
origin instead. Before injecting the CDN script, the loader checks for an
|
|
487
|
+
existing `window.rrwebRecord` global and uses it as-is:
|
|
488
|
+
|
|
489
|
+
```bash
|
|
490
|
+
curl -o public/vendor/rrweb-record.min.js \
|
|
491
|
+
https://cdn.jsdelivr.net/npm/@rrweb/record@2.1.0/umd/record.min.js
|
|
492
|
+
```
|
|
493
|
+
|
|
494
|
+
```html
|
|
495
|
+
<script src="/vendor/rrweb-record.min.js"></script>
|
|
496
|
+
<script src="https://unpkg.com/makethisbetter@1"></script>
|
|
497
|
+
<script>
|
|
498
|
+
MakeThisBetter.init({ projectKey: 'mtb_proj_YOUR_KEY' })
|
|
499
|
+
</script>
|
|
500
|
+
```
|
|
501
|
+
|
|
502
|
+
No SDK configuration is needed — the pre-loaded global wins and the CDN is
|
|
503
|
+
never contacted. Keep the file at the version the SDK pins
|
|
504
|
+
(`@rrweb/record@2.1.0`), because the replay privacy filter is written against
|
|
505
|
+
that recorder's event shape.
|
|
506
|
+
|
|
507
|
+
## Iframes
|
|
508
|
+
|
|
509
|
+
The widget scopes itself to the document it was initialized in: it positions
|
|
510
|
+
against that frame's viewport and reports that frame's URL, DOM, and
|
|
511
|
+
interactions. Install it in the frame whose UI you want feedback on. Capturing
|
|
512
|
+
across frame boundaries — a parent page recording an embedded iframe, or the
|
|
513
|
+
reverse — is not supported.
|
|
514
|
+
|
|
433
515
|
## API
|
|
434
516
|
|
|
435
517
|
```ts
|
|
@@ -493,10 +575,26 @@ Shadow DOM Host (#mtb-widget-host)
|
|
|
493
575
|
|
|
494
576
|
| Format | Size | gzip |
|
|
495
577
|
|--------|------|------|
|
|
496
|
-
| IIFE | ~
|
|
497
|
-
| ESM | ~
|
|
498
|
-
|
|
499
|
-
|
|
578
|
+
| IIFE (`makethisbetter.js`) | ~160 KB | ~44 KB |
|
|
579
|
+
| ESM (`makethisbetter.esm.js`) | ~187 KB | ~49 KB |
|
|
580
|
+
| CJS (`makethisbetter.cjs`) | ~146 KB | ~39 KB |
|
|
581
|
+
| Screenshot chunk (`html-to-image.js` / `.cjs`) | ~17 KB / ~14 KB | ~6 KB / ~5 KB |
|
|
582
|
+
| Standalone ESM (`makethisbetter.standalone.js`) | ~205 KB | ~55 KB |
|
|
583
|
+
|
|
584
|
+
The ESM and CJS bundles load the screenshot renderer (html-to-image) on demand
|
|
585
|
+
from the sibling chunk the first time a capture path warms up, so sessions that
|
|
586
|
+
never open the widget skip its weight; bundlers split it into the consumer's
|
|
587
|
+
own chunks the same way. The IIFE bundle keeps it inlined — classic-script
|
|
588
|
+
pages get exactly one file, and its size includes the renderer.
|
|
589
|
+
|
|
590
|
+
Copying a single file out of `dist/` by path — Rails importmap downloads,
|
|
591
|
+
self-hosting, vendoring into a repo — must use the standalone ESM build
|
|
592
|
+
(`dist/makethisbetter.standalone.js`, also exported as
|
|
593
|
+
`makethisbetter/standalone`): it inlines the screenshot chunk so it survives
|
|
594
|
+
being served under a digested or relocated filename. Vendoring the split ESM
|
|
595
|
+
file alone leaves its relative `./html-to-image.js` import unresolvable and
|
|
596
|
+
screenshot capture silently degrades to text-only feedback. The rrweb recorder (~78 KB) is loaded on demand when
|
|
597
|
+
Interaction Replay starts and is not included in these numbers.
|
|
500
598
|
|
|
501
599
|
## Development
|
|
502
600
|
|
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import type { ShadowContainer } from '../widget/shadow';
|
|
2
|
-
import type { I18nMessages } from '../i18n';
|
|
1
|
+
import type { ShadowContainer } from '../widget/shadow.js';
|
|
2
|
+
import type { I18nMessages } from '../i18n/index.js';
|
|
3
3
|
interface DrawNoteBarOptions {
|
|
4
4
|
messages: I18nMessages;
|
|
5
5
|
onUndo: () => void;
|
|
6
6
|
onRedo: () => void;
|
|
7
7
|
onCancel: () => void;
|
|
8
8
|
onSubmit: (note: string) => void;
|
|
9
|
+
onActivity?: () => void;
|
|
9
10
|
}
|
|
10
11
|
export declare class DrawNoteBar {
|
|
11
12
|
private el;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"draw-note-bar.d.ts","sourceRoot":"","sources":["../../src/annotate/draw-note-bar.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAA;AACvD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAA;AAI3C,UAAU,kBAAkB;IAC1B,QAAQ,EAAE,YAAY,CAAA;IACtB,MAAM,EAAE,MAAM,IAAI,CAAA;IAClB,MAAM,EAAE,MAAM,IAAI,CAAA;IAClB,QAAQ,EAAE,MAAM,IAAI,CAAA;IACpB,QAAQ,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAA;
|
|
1
|
+
{"version":3,"file":"draw-note-bar.d.ts","sourceRoot":"","sources":["../../src/annotate/draw-note-bar.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAA;AACvD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAA;AAI3C,UAAU,kBAAkB;IAC1B,QAAQ,EAAE,YAAY,CAAA;IACtB,MAAM,EAAE,MAAM,IAAI,CAAA;IAClB,MAAM,EAAE,MAAM,IAAI,CAAA;IAClB,QAAQ,EAAE,MAAM,IAAI,CAAA;IACpB,QAAQ,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAA;IAGhC,UAAU,CAAC,EAAE,MAAM,IAAI,CAAA;CACxB;AAED,qBAAa,WAAW;IACtB,OAAO,CAAC,EAAE,CAAgB;IAC1B,OAAO,CAAC,KAAK,CAAa;IAC1B,OAAO,CAAC,KAAK,CAAmB;IAChC,OAAO,CAAC,OAAO,CAAoB;IACnC,OAAO,CAAC,OAAO,CAAoB;IACnC,OAAO,CAAC,SAAS,CAAoB;IACrC,OAAO,CAAC,QAAQ,CAAwB;IACxC,OAAO,CAAC,WAAW,CAAQ;gBAEf,MAAM,EAAE,eAAe,EAAE,IAAI,EAAE,kBAAkB;IAiC7D,OAAO,CAAC,SAAS;IAejB,WAAW,CAAC,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,GAAG,IAAI;IAKrD,OAAO,CAAC,MAAM;IAId,OAAO,IAAI,IAAI;CAIhB"}
|
package/dist/annotate/draw.d.ts
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
import type { ShadowContainer } from '../widget/shadow';
|
|
2
|
-
import type { Annotation } from '../types';
|
|
1
|
+
import type { ShadowContainer } from '../widget/shadow.js';
|
|
2
|
+
import type { Annotation } from '../types.js';
|
|
3
|
+
import type { ScrollOffset } from '../screenshot/geometry.js';
|
|
3
4
|
export declare class DrawLayer {
|
|
4
5
|
private svg;
|
|
5
6
|
private currentPath;
|
|
6
7
|
private currentPoints;
|
|
8
|
+
private currentAnchor;
|
|
7
9
|
private isDrawing;
|
|
8
10
|
private committed;
|
|
9
11
|
private redoStack;
|
|
@@ -27,6 +29,12 @@ export declare class DrawLayer {
|
|
|
27
29
|
canRedo(): boolean;
|
|
28
30
|
hasStrokes(): boolean;
|
|
29
31
|
getAnnotation(): Annotation | null;
|
|
32
|
+
/**
|
|
33
|
+
* How far the drawing's frame has drifted from the live viewport, so a caller
|
|
34
|
+
* can map a point in the drawing back onto the page as it stands now — which
|
|
35
|
+
* is what hit-testing the drawing's target needs.
|
|
36
|
+
*/
|
|
37
|
+
viewportDrift(): ScrollOffset;
|
|
30
38
|
clearAll(): void;
|
|
31
39
|
isCurrentlyDrawing(): boolean;
|
|
32
40
|
destroy(): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"draw.d.ts","sourceRoot":"","sources":["../../src/annotate/draw.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAA;AACvD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,UAAU,CAAA;
|
|
1
|
+
{"version":3,"file":"draw.d.ts","sourceRoot":"","sources":["../../src/annotate/draw.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAA;AACvD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,UAAU,CAAA;AAI1C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAA;AAkB1D,qBAAa,SAAS;IACpB,OAAO,CAAC,GAAG,CAAe;IAC1B,OAAO,CAAC,WAAW,CAA8B;IACjD,OAAO,CAAC,aAAa,CAAc;IAInC,OAAO,CAAC,aAAa,CAA8B;IACnD,OAAO,CAAC,SAAS,CAAQ;IACzB,OAAO,CAAC,SAAS,CAAe;IAChC,OAAO,CAAC,SAAS,CAA6D;gBAElE,MAAM,EAAE,eAAe;IAMnC,SAAS,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,IAAI;IAQrC,YAAY,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,IAAI;IAMxC;;;;;;;OAOG;IACH,cAAc,IAAI,MAAM;IAaxB,YAAY,IAAI,OAAO;IAevB,iBAAiB,IAAI,IAAI;IAOzB,IAAI,IAAI,OAAO;IAQf,IAAI,IAAI,OAAO;IAYf,OAAO,IAAI,OAAO;IAIlB,OAAO,IAAI,OAAO;IAIlB,UAAU,IAAI,OAAO;IAIrB,aAAa,IAAI,UAAU,GAAG,IAAI;IAsBlC;;;;OAIG;IACH,aAAa,IAAI,YAAY;IAS7B,QAAQ,IAAI,IAAI;IAShB,kBAAkB,IAAI,OAAO;IAI7B,OAAO,IAAI,IAAI;IAIf,OAAO,CAAC,UAAU;CAUnB"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ShadowContainer } from '../widget/shadow';
|
|
1
|
+
import type { ShadowContainer } from '../widget/shadow.js';
|
|
2
2
|
export declare class ElementHighlighter {
|
|
3
3
|
private highlightEl;
|
|
4
4
|
private tooltipEl;
|
|
@@ -9,6 +9,4 @@ export declare class ElementHighlighter {
|
|
|
9
9
|
hide(): void;
|
|
10
10
|
destroy(): void;
|
|
11
11
|
}
|
|
12
|
-
export declare function getElementName(el: Element): string;
|
|
13
|
-
export declare function getCssSelector(el: Element): string;
|
|
14
12
|
//# sourceMappingURL=highlighter.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"highlighter.d.ts","sourceRoot":"","sources":["../../src/annotate/highlighter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAA;
|
|
1
|
+
{"version":3,"file":"highlighter.d.ts","sourceRoot":"","sources":["../../src/annotate/highlighter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAA;AAGvD,qBAAa,kBAAkB;IAC7B,OAAO,CAAC,WAAW,CAAgB;IACnC,OAAO,CAAC,SAAS,CAAgB;gBAErB,MAAM,EAAE,eAAe;IAOnC,SAAS,CAAC,EAAE,EAAE,OAAO,GAAG,IAAI;IAU5B,OAAO,CAAC,WAAW;IASnB,MAAM,IAAI,IAAI;IAKd,IAAI,IAAI,IAAI;IAMZ,OAAO,IAAI,IAAI;CAIhB"}
|
package/dist/annotate/pin.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { ShadowContainer } from '../widget/shadow';
|
|
2
|
-
import type { I18nMessages } from '../i18n';
|
|
3
|
-
import type { Annotation } from '../types';
|
|
1
|
+
import type { ShadowContainer } from '../widget/shadow.js';
|
|
2
|
+
import type { I18nMessages } from '../i18n/index.js';
|
|
3
|
+
import type { Annotation } from '../types.js';
|
|
4
4
|
interface SessionHandlers {
|
|
5
5
|
onPin: (annotation: Annotation, targetName: string) => void;
|
|
6
6
|
onDrawStroke: () => void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"session.d.ts","sourceRoot":"","sources":["../../src/annotate/session.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAA;AACvD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAA;AAC3C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,UAAU,CAAA;
|
|
1
|
+
{"version":3,"file":"session.d.ts","sourceRoot":"","sources":["../../src/annotate/session.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAA;AACvD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAA;AAC3C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,UAAU,CAAA;AAe1C,UAAU,eAAe;IACvB,KAAK,EAAE,CAAC,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,KAAK,IAAI,CAAA;IAC3D,YAAY,EAAE,MAAM,IAAI,CAAA;CACzB;AAkBD,qBAAa,iBAAiB;IAe1B,OAAO,CAAC,QAAQ;IAChB,OAAO,CAAC,QAAQ;IAflB,OAAO,CAAC,OAAO,CAAmB;IAClC,OAAO,CAAC,WAAW,CAAoB;IACvC,OAAO,CAAC,SAAS,CAAW;IAC5B,OAAO,CAAC,SAAS,CAAW;IAC5B,OAAO,CAAC,iBAAiB,CAAO;IAChC,OAAO,CAAC,qBAAqB,CAAsB;IACnD,OAAO,CAAC,SAAS,CAAI;IACrB,OAAO,CAAC,SAAS,CAAI;IAGrB,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAmB;gBAGvC,MAAM,EAAE,eAAe,EACf,QAAQ,EAAE,YAAY,EACtB,QAAQ,EAAE,eAAe;IAoBnC,OAAO,CAAC,iBAAiB;IAKzB,OAAO,CAAC,iBAAiB;IAiBzB,OAAO,CAAC,eAAe;IAOvB,OAAO,CAAC,sBAAsB;IAM9B,OAAO,CAAC,eAAe;IAQvB,OAAO,CAAC,YAAY;IA0CpB,QAAQ,IAAI,IAAI;IAIhB,QAAQ,IAAI,IAAI;IAIhB,WAAW,IAAI,OAAO;IAItB,WAAW,IAAI,OAAO;IAItB,cAAc,IAAI,OAAO;IAIzB,OAAO,CAAC,iBAAiB;IAWzB,iBAAiB,IAAI,UAAU,GAAG,IAAI;IAiCtC,SAAS,IAAI,IAAI;IAIjB,kBAAkB,IAAI,IAAI;IAO1B,aAAa,IAAI,IAAI;IAIrB,OAAO,IAAI,IAAI;CAMhB"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { ShadowContainer } from '../widget/shadow';
|
|
2
|
-
import type { I18nMessages } from '../i18n';
|
|
1
|
+
import type { ShadowContainer } from '../widget/shadow.js';
|
|
2
|
+
import type { I18nMessages } from '../i18n/index.js';
|
|
3
3
|
export type ToolbarMode = 'markup' | 'record';
|
|
4
4
|
export declare class AnnotationToolbar {
|
|
5
5
|
private el;
|
|
@@ -12,7 +12,9 @@ export declare class AnnotationToolbar {
|
|
|
12
12
|
private currentMode;
|
|
13
13
|
private readonly touch;
|
|
14
14
|
private handlePointerMove;
|
|
15
|
+
private touchHintDismissListening;
|
|
15
16
|
private dismissTouchHint;
|
|
17
|
+
private stopTouchHintDismissListening;
|
|
16
18
|
constructor(shadow: ShadowContainer, messages: I18nMessages, onExit: () => void, onModeChange?: (mode: ToolbarMode) => void, position?: 'left' | 'right', showTouchHint?: boolean);
|
|
17
19
|
private buildHTML;
|
|
18
20
|
private idleHint;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toolbar.d.ts","sourceRoot":"","sources":["../../src/annotate/toolbar.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAA;AACvD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAA;AAI3C,MAAM,MAAM,WAAW,GAAG,QAAQ,GAAG,QAAQ,CAAA;AAM7C,qBAAa,iBAAiB;IAC5B,OAAO,CAAC,EAAE,CAAgB;IAI1B,OAAO,CAAC,SAAS,CAAgB;IACjC,OAAO,CAAC,UAAU,CAAkB;IACpC,OAAO,CAAC,IAAI,CAAa;IACzB,OAAO,CAAC,SAAS,CAAoB;IACrC,OAAO,CAAC,SAAS,CAAoB;IACrC,OAAO,CAAC,QAAQ,CAAc;IAC9B,OAAO,CAAC,WAAW,CAAwB;IAC3C,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAS;IAS/B,OAAO,CAAC,iBAAiB,CAQxB;
|
|
1
|
+
{"version":3,"file":"toolbar.d.ts","sourceRoot":"","sources":["../../src/annotate/toolbar.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAA;AACvD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAA;AAI3C,MAAM,MAAM,WAAW,GAAG,QAAQ,GAAG,QAAQ,CAAA;AAM7C,qBAAa,iBAAiB;IAC5B,OAAO,CAAC,EAAE,CAAgB;IAI1B,OAAO,CAAC,SAAS,CAAgB;IACjC,OAAO,CAAC,UAAU,CAAkB;IACpC,OAAO,CAAC,IAAI,CAAa;IACzB,OAAO,CAAC,SAAS,CAAoB;IACrC,OAAO,CAAC,SAAS,CAAoB;IACrC,OAAO,CAAC,QAAQ,CAAc;IAC9B,OAAO,CAAC,WAAW,CAAwB;IAC3C,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAS;IAS/B,OAAO,CAAC,iBAAiB,CAQxB;IAMD,OAAO,CAAC,yBAAyB,CAAQ;IAEzC,OAAO,CAAC,gBAAgB,CAGvB;IAED,OAAO,CAAC,6BAA6B;gBAOnC,MAAM,EAAE,eAAe,EACvB,QAAQ,EAAE,YAAY,EACtB,MAAM,EAAE,MAAM,IAAI,EAClB,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,WAAW,KAAK,IAAI,EAC1C,QAAQ,GAAE,MAAM,GAAG,OAAiB,EACpC,aAAa,UAAO;IAgDtB,OAAO,CAAC,SAAS;IAmBjB,OAAO,CAAC,QAAQ;IAIhB,OAAO,CAAC,IAAI,EAAE,WAAW,GAAG,IAAI;IAahC,OAAO,IAAI,WAAW;IAItB;;;;;;;OAOG;IACH,MAAM,IAAI,MAAM;IAIhB,OAAO,IAAI,IAAI;CAOhB"}
|
package/dist/api/client.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { FeedbackPayload, FeedbackResponse, SubmissionSessionResponse, ClarifyResponse, ClarifyMessage } from '../types';
|
|
1
|
+
import type { FeedbackPayload, FeedbackResponse, SubmissionSessionResponse, ClarifyResponse, ClarifyMessage } from '../types.js';
|
|
2
2
|
export interface ClarifyStreamResult {
|
|
3
3
|
messages: ClarifyMessage[];
|
|
4
4
|
done: boolean;
|
|
@@ -9,13 +9,21 @@ export declare class ApiError extends Error {
|
|
|
9
9
|
constructor(status: number);
|
|
10
10
|
}
|
|
11
11
|
export declare function isTerminalConflict(error: unknown): boolean;
|
|
12
|
+
export declare const FINALIZE_TIMEOUT_MS = 25000;
|
|
13
|
+
export interface ApiClientOptions {
|
|
14
|
+
projectKey: string;
|
|
15
|
+
apiUrl?: string;
|
|
16
|
+
retryDelayMs?: number;
|
|
17
|
+
userToken?: string;
|
|
18
|
+
userTokenFn?: () => Promise<string>;
|
|
19
|
+
}
|
|
12
20
|
export declare class ApiClient {
|
|
13
21
|
private apiUrl;
|
|
14
22
|
private projectKey;
|
|
15
23
|
private retryDelayMs;
|
|
16
24
|
private userToken?;
|
|
17
25
|
private userTokenFn?;
|
|
18
|
-
constructor(
|
|
26
|
+
constructor(options: ApiClientOptions);
|
|
19
27
|
resolveUserToken(): Promise<string | undefined>;
|
|
20
28
|
private authHeaders;
|
|
21
29
|
private submissionHeaders;
|
package/dist/api/client.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/api/client.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,eAAe,EACf,gBAAgB,EAChB,yBAAyB,EACzB,eAAe,EACf,cAAc,EACf,MAAM,UAAU,CAAA;AAGjB,MAAM,WAAW,mBAAmB;IAClC,QAAQ,EAAE,cAAc,EAAE,CAAA;IAC1B,IAAI,EAAE,OAAO,CAAA;IACb,MAAM,CAAC,EAAE,OAAO,CAAA;CACjB;AAKD,qBAAa,QAAS,SAAQ,KAAK;IACjC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;gBAEX,MAAM,EAAE,MAAM;CAK3B;AAED,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAE1D;AAKD,
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/api/client.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,eAAe,EACf,gBAAgB,EAChB,yBAAyB,EACzB,eAAe,EACf,cAAc,EACf,MAAM,UAAU,CAAA;AAGjB,MAAM,WAAW,mBAAmB;IAClC,QAAQ,EAAE,cAAc,EAAE,CAAA;IAC1B,IAAI,EAAE,OAAO,CAAA;IACb,MAAM,CAAC,EAAE,OAAO,CAAA;CACjB;AAKD,qBAAa,QAAS,SAAQ,KAAK;IACjC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;gBAEX,MAAM,EAAE,MAAM;CAK3B;AAED,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAE1D;AAKD,eAAO,MAAM,mBAAmB,QAAS,CAAA;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Ae,CAAC;IAatF,mBAAmB,CACvB,mBAAmB,EAAE,MAAM,EAC3B,KAAK,EAAE,MAAM,EACb,OAAO,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,EAC/B,MAAM,CAAC,EAAE,WAAW,GACnB,OAAO,CAAC,mBAAmB,CAAC;IAuBzB,yBAAyB,CAAC,mBAAmB,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,gBAAgB,CAAC;IAmBhG,wBAAwB,CAAC,mBAAmB,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;YAQ3E,cAAc;CAqB7B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"breadcrumbs.d.ts","sourceRoot":"","sources":["../../src/context/breadcrumbs.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"breadcrumbs.d.ts","sourceRoot":"","sources":["../../src/context/breadcrumbs.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,UAAU,CAAA;AAiB1C,qBAAa,mBAAmB;IAC9B,OAAO,CAAC,WAAW,CAAmB;IACtC,OAAO,CAAC,MAAM,CAAQ;IACtB,OAAO,CAAC,iBAAiB,CAA4B;IACrD,OAAO,CAAC,iBAAiB,CAAyB;IAClD,OAAO,CAAC,kBAAkB,CAAoB;IAC9C,OAAO,CAAC,qBAAqB,CAA4B;IACzD,OAAO,CAAC,OAAO,CAAK;;IAOpB,KAAK,IAAI,IAAI;IAUb,IAAI,IAAI,IAAI;IAWZ,cAAc,IAAI,UAAU,EAAE;IAI9B,OAAO,CAAC,GAAG;IAOX,OAAO,CAAC,WAAW;IAgBnB,OAAO,CAAC,YAAY;IAoBpB,OAAO,CAAC,WAAW;IAWnB,OAAO,CAAC,gBAAgB;CAiBzB"}
|
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
export declare const WIDGET_HOST_ID = "mtb-widget-host";
|
|
1
2
|
export declare function isWidgetElement(el: Element): boolean;
|
|
3
|
+
export declare function elementUnderPoint(x: number, y: number): Element | null;
|
|
2
4
|
export declare function escapeHtml(text: string): string;
|
|
5
|
+
export declare function isImeConfirmKeydown(event: KeyboardEvent): boolean;
|
|
6
|
+
export declare function getElementName(el: Element): string;
|
|
7
|
+
export declare function getCssSelector(el: Element): string;
|
|
3
8
|
//# sourceMappingURL=dom-utils.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dom-utils.d.ts","sourceRoot":"","sources":["../../src/context/dom-utils.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"dom-utils.d.ts","sourceRoot":"","sources":["../../src/context/dom-utils.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,cAAc,oBAAoB,CAAA;AAE/C,wBAAgB,eAAe,CAAC,EAAE,EAAE,OAAO,GAAG,OAAO,CAIpD;AAID,wBAAgB,iBAAiB,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,OAAO,GAAG,IAAI,CAEtE;AAED,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAO/C;AAOD,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,aAAa,GAAG,OAAO,CAEjE;AAsBD,wBAAgB,cAAc,CAAC,EAAE,EAAE,OAAO,GAAG,MAAM,CAqBlD;AAED,wBAAgB,cAAc,CAAC,EAAE,EAAE,OAAO,GAAG,MAAM,CA+BlD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dom-utils.test.d.ts","sourceRoot":"","sources":["../../src/context/dom-utils.test.ts"],"names":[],"mappings":""}
|
|
@@ -28,9 +28,12 @@ export declare class FrustrationDetector {
|
|
|
28
28
|
private domObserver;
|
|
29
29
|
private pendingDomChecks;
|
|
30
30
|
private lastMutationAt;
|
|
31
|
+
private pendingTimers;
|
|
31
32
|
constructor(onFrustration: (event: FrustrationEvent) => void);
|
|
32
33
|
start(): void;
|
|
33
34
|
stop(): void;
|
|
35
|
+
private schedule;
|
|
36
|
+
private clearPendingTimers;
|
|
34
37
|
private startNavigationTracking;
|
|
35
38
|
private stopNavigationTracking;
|
|
36
39
|
private noteNavigationStarted;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"frustration.d.ts","sourceRoot":"","sources":["../../src/context/frustration.ts"],"names":[],"mappings":"AAMA,MAAM,MAAM,iBAAiB,GACzB,YAAY,GACZ,YAAY,GACZ,kBAAkB,GAClB,cAAc,GACd,YAAY,GACZ,gBAAgB,CAAA;AAEpB,MAAM,WAAW,gBAAgB;IAC/B,MAAM,EAAE,iBAAiB,CAAA;IACzB,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,SAAS,EAAE,MAAM,CAAA;CAClB;AA8CD,qBAAa,mBAAmB;IAC9B,OAAO,CAAC,YAAY,CAAoB;IACxC,OAAO,CAAC,aAAa,CAAmC;IACxD,OAAO,CAAC,iBAAiB,CAAyB;IAClD,OAAO,CAAC,iBAAiB,CAA4B;IACrD,OAAO,CAAC,MAAM,CAAQ;IACtB,OAAO,CAAC,eAAe,CAAiD;IACxE,OAAO,CAAC,aAAa,CAAI;IACzB,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,WAAW,CAAS;IAE5C,OAAO,CAAC,aAAa,CAAe;IACpC,OAAO,CAAC,qBAAqB,CAA4B;IACzD,OAAO,CAAC,qBAAqB,CAA4B;IACzD,OAAO,CAAC,2BAA2B,CAA4B;IAC/D,OAAO,CAAC,gBAAgB,CAAK;IAC7B,OAAO,CAAC,kBAAkB,CAAoC;IAC9D,OAAO,CAAC,mBAAmB,CAAoC;IAC/D,OAAO,CAAC,iBAAiB,CAAiC;IAC1D,OAAO,CAAC,iBAAiB,CAAiC;IAC1D,OAAO,CAAC,qBAAqB,CAA2C;IACxE,OAAO,CAAC,aAAa,CAAoB;IACzC,OAAO,CAAC,WAAW,CAAgC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aAAa,EAAE,CAAC,KAAK,EAAE,gBAAgB,KAAK,IAAI;IAK5D,KAAK,IAAI,IAAI;IAwBb,IAAI,IAAI,IAAI;IAqBZ,OAAO,CAAC,QAAQ;IAQhB,OAAO,CAAC,kBAAkB;IAK1B,OAAO,CAAC,uBAAuB;IAmB/B,OAAO,CAAC,sBAAsB;IAmB9B,OAAO,CAAC,qBAAqB;IAQ7B,OAAO,CAAC,YAAY;IAOpB,OAAO,CAAC,YAAY;IAUpB,OAAO,CAAC,iBAAiB;IAOzB,OAAO,CAAC,gBAAgB;IAgBxB,OAAO,CAAC,WAAW;IA8BnB,OAAO,CAAC,gBAAgB;IAyBxB,OAAO,CAAC,gBAAgB;IAexB,OAAO,CAAC,qBAAqB;IAS7B,OAAO,CAAC,2BAA2B;IAQnC,OAAO,CAAC,qBAAqB;IAO7B,OAAO,CAAC,iBAAiB;IAoBzB,OAAO,CAAC,iBAAiB;IASzB,OAAO,CAAC,cAAc;IAmCtB,OAAO,CAAC,iBAAiB;IAwBzB,OAAO,CAAC,iBAAiB;IAazB,OAAO,CAAC,qBAAqB;IAK7B,OAAO,CAAC,gBAAgB;IAmBxB,OAAO,CAAC,iBAAiB;IAgBzB,OAAO,CAAC,sBAAsB;IAU9B,OAAO,CAAC,WAAW;IAQnB,OAAO,CAAC,gBAAgB;CAKzB"}
|
package/dist/global.d.ts
CHANGED
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function j(t,e){if(t.match(/^[a-z]+:\/\//i))return t;if(t.match(/^\/\//))return window.location.protocol+t;if(t.match(/^[a-z]+:/i))return t;const n=document.implementation.createHTMLDocument(),r=n.createElement("base"),s=n.createElement("a");return n.head.appendChild(r),n.body.appendChild(s),e&&(r.href=e),s.href=t,s.href}const z=(()=>{let t=0;const e=()=>`0000${(Math.random()*36**4<<0).toString(36)}`.slice(-4);return()=>(t+=1,`u${e()}${t}`)})();function g(t){const e=[];for(let n=0,r=t.length;n<r;n++)e.push(t[n]);return e}let m=null;function D(t={}){return m||(t.includeStyleProperties?(m=t.includeStyleProperties,m):(m=g(window.getComputedStyle(document.documentElement)),m))}function w(t,e){const r=(t.ownerDocument.defaultView||window).getComputedStyle(t).getPropertyValue(e);return r?parseFloat(r.replace("px","")):0}function G(t){const e=w(t,"border-left-width"),n=w(t,"border-right-width");return t.clientWidth+e+n}function X(t){const e=w(t,"border-top-width"),n=w(t,"border-bottom-width");return t.clientHeight+e+n}function R(t,e={}){const n=e.width||G(t),r=e.height||X(t);return{width:n,height:r}}function J(){let t,e;try{e=process}catch{}const n=e&&e.env?e.env.devicePixelRatio:null;return n&&(t=parseInt(n,10),Number.isNaN(t)&&(t=1)),t||window.devicePixelRatio||1}const u=16384;function K(t){(t.width>u||t.height>u)&&(t.width>u&&t.height>u?t.width>t.height?(t.height*=u/t.width,t.width=u):(t.width*=u/t.height,t.height=u):t.width>u?(t.height*=u/t.width,t.width=u):(t.width*=u/t.height,t.height=u))}function Q(t,e={}){return t.toBlob?new Promise(n=>{t.toBlob(n,e.type?e.type:"image/png",e.quality?e.quality:1)}):new Promise(n=>{const r=window.atob(t.toDataURL(e.type?e.type:void 0,e.quality?e.quality:void 0).split(",")[1]),s=r.length,i=new Uint8Array(s);for(let a=0;a<s;a+=1)i[a]=r.charCodeAt(a);n(new Blob([i],{type:e.type?e.type:"image/png"}))})}function p(t){return new Promise((e,n)=>{const r=new Image;r.onload=()=>{r.decode().then(()=>{requestAnimationFrame(()=>e(r))})},r.onerror=n,r.crossOrigin="anonymous",r.decoding="async",r.src=t})}async function Y(t){return Promise.resolve().then(()=>new XMLSerializer().serializeToString(t)).then(encodeURIComponent).then(e=>`data:image/svg+xml;charset=utf-8,${e}`)}async function Z(t,e,n){const r="http://www.w3.org/2000/svg",s=document.createElementNS(r,"svg"),i=document.createElementNS(r,"foreignObject");return s.setAttribute("width",`${e}`),s.setAttribute("height",`${n}`),s.setAttribute("viewBox",`0 0 ${e} ${n}`),i.setAttribute("width","100%"),i.setAttribute("height","100%"),i.setAttribute("x","0"),i.setAttribute("y","0"),i.setAttribute("externalResourcesRequired","true"),s.appendChild(i),i.appendChild(t),Y(s)}const l=(t,e)=>{if(t instanceof e)return!0;const n=Object.getPrototypeOf(t);return n===null?!1:n.constructor.name===e.name||l(n,e)};function N(t){const e=t.getPropertyValue("content");return`${t.cssText} content: '${e.replace(/'|"/g,"")}';`}function tt(t,e){return D(e).map(n=>{const r=t.getPropertyValue(n),s=t.getPropertyPriority(n);return`${n}: ${r}${s?" !important":""};`}).join(" ")}function et(t,e,n,r){const s=`.${t}:${e}`,i=n.cssText?N(n):tt(n,r);return document.createTextNode(`${s}{${i}}`)}function T(t,e,n,r){const s=window.getComputedStyle(t,n),i=s.getPropertyValue("content");if(i===""||i==="none")return;const a=z();try{e.className=`${e.className} ${a}`}catch{return}const c=document.createElement("style");c.appendChild(et(a,n,s,r)),e.appendChild(c)}function nt(t,e,n){T(t,e,":before",n),T(t,e,":after",n)}const $="application/font-woff",F="image/jpeg",rt={woff:$,woff2:$,ttf:"application/font-truetype",eot:"application/vnd.ms-fontobject",png:"image/png",jpg:F,jpeg:F,gif:"image/gif",tiff:"image/tiff",svg:"image/svg+xml",webp:"image/webp"};function it(t){const e=/\.([^./]*?)$/g.exec(t);return e?e[1]:""}function C(t){const e=it(t).toLowerCase();return rt[e]||""}function st(t){return t.split(/,/)[1]}function x(t){return t.search(/^(data:)/)!==-1}function at(t,e){return`data:${e};base64,${t}`}async function U(t,e,n){const r=await fetch(t,e);if(r.status===404)throw new Error(`Resource "${r.url}" not found`);const s=await r.blob();return new Promise((i,a)=>{const c=new FileReader;c.onerror=a,c.onloadend=()=>{try{i(n({res:r,result:c.result}))}catch(o){a(o)}},c.readAsDataURL(s)})}const E={};function ct(t,e,n){let r=t.replace(/\?.*/,"");return n&&(r=t),/ttf|otf|eot|woff2?/i.test(r)&&(r=r.replace(/.*\//,"")),e?`[${e}]${r}`:r}async function P(t,e,n){const r=ct(t,e,n.includeQueryParams);if(E[r]!=null)return E[r];n.cacheBust&&(t+=(/\?/.test(t)?"&":"?")+new Date().getTime());let s;try{const i=await U(t,n.fetchRequestInit,({res:a,result:c})=>(e||(e=a.headers.get("Content-Type")||""),st(c)));s=at(i,e)}catch(i){s=n.imagePlaceholder||"";let a=`Failed to fetch resource: ${t}`;i&&(a=typeof i=="string"?i:i.message),a&&console.warn(a)}return E[r]=s,s}async function ot(t){const e=t.toDataURL();return e==="data:,"?t.cloneNode(!1):p(e)}async function lt(t,e){if(t.currentSrc){const i=document.createElement("canvas"),a=i.getContext("2d");i.width=t.clientWidth,i.height=t.clientHeight,a?.drawImage(t,0,0,i.width,i.height);const c=i.toDataURL();return p(c)}const n=t.poster,r=C(n),s=await P(n,r,e);return p(s)}async function ut(t,e){var n;try{if(!((n=t?.contentDocument)===null||n===void 0)&&n.body)return await S(t.contentDocument.body,e,!0)}catch{}return t.cloneNode(!1)}async function ft(t,e){return l(t,HTMLCanvasElement)?ot(t):l(t,HTMLVideoElement)?lt(t,e):l(t,HTMLIFrameElement)?ut(t,e):t.cloneNode(k(t))}const ht=t=>t.tagName!=null&&t.tagName.toUpperCase()==="SLOT",k=t=>t.tagName!=null&&t.tagName.toUpperCase()==="SVG";async function gt(t,e,n){var r,s;if(k(e))return e;let i=[];return ht(t)&&t.assignedNodes?i=g(t.assignedNodes()):l(t,HTMLIFrameElement)&&(!((r=t.contentDocument)===null||r===void 0)&&r.body)?i=g(t.contentDocument.body.childNodes):i=g(((s=t.shadowRoot)!==null&&s!==void 0?s:t).childNodes),i.length===0||l(t,HTMLVideoElement)||await i.reduce((a,c)=>a.then(()=>S(c,n)).then(o=>{o&&e.appendChild(o)}),Promise.resolve()),e}function mt(t,e,n){const r=e.style;if(!r)return;const s=window.getComputedStyle(t);s.cssText?(r.cssText=s.cssText,r.transformOrigin=s.transformOrigin):D(n).forEach(i=>{let a=s.getPropertyValue(i);i==="font-size"&&a.endsWith("px")&&(a=`${Math.floor(parseFloat(a.substring(0,a.length-2)))-.1}px`),l(t,HTMLIFrameElement)&&i==="display"&&a==="inline"&&(a="block"),i==="d"&&e.getAttribute("d")&&(a=`path(${e.getAttribute("d")})`),r.setProperty(i,a,s.getPropertyPriority(i))})}function dt(t,e){l(t,HTMLTextAreaElement)&&(e.innerHTML=t.value),l(t,HTMLInputElement)&&e.setAttribute("value",t.value)}function yt(t,e){if(l(t,HTMLSelectElement)){const n=e,r=Array.from(n.children).find(s=>t.value===s.getAttribute("value"));r&&r.setAttribute("selected","")}}function wt(t,e,n){return l(e,Element)&&(mt(t,e,n),nt(t,e,n),dt(t,e),yt(t,e)),e}async function pt(t,e){const n=t.querySelectorAll?t.querySelectorAll("use"):[];if(n.length===0)return t;const r={};for(let i=0;i<n.length;i++){const c=n[i].getAttribute("xlink:href");if(c){const o=t.querySelector(c),f=document.querySelector(c);!o&&f&&!r[c]&&(r[c]=await S(f,e,!0))}}const s=Object.values(r);if(s.length){const i="http://www.w3.org/1999/xhtml",a=document.createElementNS(i,"svg");a.setAttribute("xmlns",i),a.style.position="absolute",a.style.width="0",a.style.height="0",a.style.overflow="hidden",a.style.display="none";const c=document.createElementNS(i,"defs");a.appendChild(c);for(let o=0;o<s.length;o++)c.appendChild(s[o]);t.appendChild(a)}return t}async function S(t,e,n){return!n&&e.filter&&!e.filter(t)?null:Promise.resolve(t).then(r=>ft(r,e)).then(r=>gt(t,r,e)).then(r=>wt(t,r,e)).then(r=>pt(r,e))}const H=/url\((['"]?)([^'"]+?)\1\)/g,St=/url\([^)]+\)\s*format\((["']?)([^"']+)\1\)/g,bt=/src:\s*(?:url\([^)]+\)\s*format\([^)]+\)[,;]\s*)+/g;function Et(t){const e=t.replace(/([.*+?^${}()|\[\]\/\\])/g,"\\$1");return new RegExp(`(url\\(['"]?)(${e})(['"]?\\))`,"g")}function xt(t){const e=[];return t.replace(H,(n,r,s)=>(e.push(s),n)),e.filter(n=>!x(n))}async function Rt(t,e,n,r,s){try{const i=n?j(e,n):e,a=C(e);let c;return s||(c=await P(i,a,r)),t.replace(Et(e),`$1${c}$3`)}catch{}return t}function Ct(t,{preferredFontFormat:e}){return e?t.replace(bt,n=>{for(;;){const[r,,s]=St.exec(n)||[];if(!s)return"";if(s===e)return`src: ${r};`}}):t}function V(t){return t.search(H)!==-1}async function M(t,e,n){if(!V(t))return t;const r=Ct(t,n);return xt(r).reduce((i,a)=>i.then(c=>Rt(c,a,e,n)),Promise.resolve(r))}async function d(t,e,n){var r;const s=(r=e.style)===null||r===void 0?void 0:r.getPropertyValue(t);if(s){const i=await M(s,null,n);return e.style.setProperty(t,i,e.style.getPropertyPriority(t)),!0}return!1}async function Pt(t,e){await d("background",t,e)||await d("background-image",t,e),await d("mask",t,e)||await d("-webkit-mask",t,e)||await d("mask-image",t,e)||await d("-webkit-mask-image",t,e)}async function Tt(t,e){const n=l(t,HTMLImageElement);if(!(n&&!x(t.src))&&!(l(t,SVGImageElement)&&!x(t.href.baseVal)))return;const r=n?t.src:t.href.baseVal,s=await P(r,C(r),e);await new Promise((i,a)=>{t.onload=i,t.onerror=e.onImageErrorHandler?(...o)=>{try{i(e.onImageErrorHandler(...o))}catch(f){a(f)}}:a;const c=t;c.decode&&(c.decode=i),c.loading==="lazy"&&(c.loading="eager"),n?(t.srcset="",t.src=s):t.href.baseVal=s})}async function $t(t,e){const r=g(t.childNodes).map(s=>O(s,e));await Promise.all(r).then(()=>t)}async function O(t,e){l(t,Element)&&(await Pt(t,e),await Tt(t,e),await $t(t,e))}function Ft(t,e){const{style:n}=t;e.backgroundColor&&(n.backgroundColor=e.backgroundColor),e.width&&(n.width=`${e.width}px`),e.height&&(n.height=`${e.height}px`);const r=e.style;return r!=null&&Object.keys(r).forEach(s=>{n[s]=r[s]}),t}const L={};async function I(t){let e=L[t];if(e!=null)return e;const r=await(await fetch(t)).text();return e={url:t,cssText:r},L[t]=e,e}async function A(t,e){let n=t.cssText;const r=/url\(["']?([^"')]+)["']?\)/g,i=(n.match(/url\([^)]+\)/g)||[]).map(async a=>{let c=a.replace(r,"$1");return c.startsWith("https://")||(c=new URL(c,t.url).href),U(c,e.fetchRequestInit,({result:o})=>(n=n.replace(a,`url(${o})`),[a,o]))});return Promise.all(i).then(()=>n)}function v(t){if(t==null)return[];const e=[],n=/(\/\*[\s\S]*?\*\/)/gi;let r=t.replace(n,"");const s=new RegExp("((@.*?keyframes [\\s\\S]*?){([\\s\\S]*?}\\s*?)})","gi");for(;;){const o=s.exec(r);if(o===null)break;e.push(o[0])}r=r.replace(s,"");const i=/@import[\s\S]*?url\([^)]*\)[\s\S]*?;/gi,a="((\\s*?(?:\\/\\*[\\s\\S]*?\\*\\/)?\\s*?@media[\\s\\S]*?){([\\s\\S]*?)}\\s*?})|(([\\s\\S]*?){([\\s\\S]*?)})",c=new RegExp(a,"gi");for(;;){let o=i.exec(r);if(o===null){if(o=c.exec(r),o===null)break;i.lastIndex=c.lastIndex}else c.lastIndex=i.lastIndex;e.push(o[0])}return e}async function Lt(t,e){const n=[],r=[];return t.forEach(s=>{if("cssRules"in s)try{g(s.cssRules||[]).forEach((i,a)=>{if(i.type===CSSRule.IMPORT_RULE){let c=a+1;const o=i.href,f=I(o).then(h=>A(h,e)).then(h=>v(h).forEach(b=>{try{s.insertRule(b,b.startsWith("@import")?c+=1:s.cssRules.length)}catch(W){console.error("Error inserting rule from remote css",{rule:b,error:W})}})).catch(h=>{console.error("Error loading remote css",h.toString())});r.push(f)}})}catch(i){const a=t.find(c=>c.href==null)||document.styleSheets[0];s.href!=null&&r.push(I(s.href).then(c=>A(c,e)).then(c=>v(c).forEach(o=>{a.insertRule(o,a.cssRules.length)})).catch(c=>{console.error("Error loading remote stylesheet",c)})),console.error("Error inlining remote css file",i)}}),Promise.all(r).then(()=>(t.forEach(s=>{if("cssRules"in s)try{g(s.cssRules||[]).forEach(i=>{n.push(i)})}catch(i){console.error(`Error while reading CSS rules from ${s.href}`,i)}}),n))}function It(t){return t.filter(e=>e.type===CSSRule.FONT_FACE_RULE).filter(e=>V(e.style.getPropertyValue("src")))}async function At(t,e){if(t.ownerDocument==null)throw new Error("Provided element is not within a Document");const n=g(t.ownerDocument.styleSheets),r=await Lt(n,e);return It(r)}function _(t){return t.trim().replace(/["']/g,"")}function vt(t){const e=new Set;function n(r){(r.style.fontFamily||getComputedStyle(r).fontFamily).split(",").forEach(i=>{e.add(_(i))}),Array.from(r.children).forEach(i=>{i instanceof HTMLElement&&n(i)})}return n(t),e}async function q(t,e){const n=await At(t,e),r=vt(t);return(await Promise.all(n.filter(i=>r.has(_(i.style.fontFamily))).map(i=>{const a=i.parentStyleSheet?i.parentStyleSheet.href:null;return M(i.cssText,a,e)}))).join(`
|
|
2
|
+
`)}async function Dt(t,e){const n=e.fontEmbedCSS!=null?e.fontEmbedCSS:e.skipFonts?null:await q(t,e);if(n){const r=document.createElement("style"),s=document.createTextNode(n);r.appendChild(s),t.firstChild?t.insertBefore(r,t.firstChild):t.appendChild(r)}}async function B(t,e={}){const{width:n,height:r}=R(t,e),s=await S(t,e,!0);return await Dt(s,e),await O(s,e),Ft(s,e),await Z(s,n,r)}async function y(t,e={}){const{width:n,height:r}=R(t,e),s=await B(t,e),i=await p(s),a=document.createElement("canvas"),c=a.getContext("2d"),o=e.pixelRatio||J(),f=e.canvasWidth||n,h=e.canvasHeight||r;return a.width=f*o,a.height=h*o,e.skipAutoScale||K(a),a.style.width=`${f}`,a.style.height=`${h}`,e.backgroundColor&&(c.fillStyle=e.backgroundColor,c.fillRect(0,0,a.width,a.height)),c.drawImage(i,0,0,a.width,a.height),a}async function Ut(t,e={}){const{width:n,height:r}=R(t,e);return(await y(t,e)).getContext("2d").getImageData(0,0,n,r).data}async function kt(t,e={}){return(await y(t,e)).toDataURL()}async function Ht(t,e={}){return(await y(t,e)).toDataURL("image/jpeg",e.quality||1)}async function Vt(t,e={}){const n=await y(t,e);return await Q(n)}async function Mt(t,e={}){return q(t,e)}exports.getFontEmbedCSS=Mt;exports.toBlob=Vt;exports.toCanvas=y;exports.toJpeg=Ht;exports.toPixelData=Ut;exports.toPng=kt;exports.toSvg=B;
|
|
3
|
+
//# sourceMappingURL=html-to-image.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"html-to-image.cjs","sources":["../node_modules/html-to-image/es/util.js","../node_modules/html-to-image/es/clone-pseudos.js","../node_modules/html-to-image/es/mimes.js","../node_modules/html-to-image/es/dataurl.js","../node_modules/html-to-image/es/clone-node.js","../node_modules/html-to-image/es/embed-resources.js","../node_modules/html-to-image/es/embed-images.js","../node_modules/html-to-image/es/apply-style.js","../node_modules/html-to-image/es/embed-webfonts.js","../node_modules/html-to-image/es/index.js"],"sourcesContent":["export function resolveUrl(url, baseUrl) {\n // url is absolute already\n if (url.match(/^[a-z]+:\\/\\//i)) {\n return url;\n }\n // url is absolute already, without protocol\n if (url.match(/^\\/\\//)) {\n return window.location.protocol + url;\n }\n // dataURI, mailto:, tel:, etc.\n if (url.match(/^[a-z]+:/i)) {\n return url;\n }\n const doc = document.implementation.createHTMLDocument();\n const base = doc.createElement('base');\n const a = doc.createElement('a');\n doc.head.appendChild(base);\n doc.body.appendChild(a);\n if (baseUrl) {\n base.href = baseUrl;\n }\n a.href = url;\n return a.href;\n}\nexport const uuid = (() => {\n // generate uuid for className of pseudo elements.\n // We should not use GUIDs, otherwise pseudo elements sometimes cannot be captured.\n let counter = 0;\n // ref: http://stackoverflow.com/a/6248722/2519373\n const random = () => \n // eslint-disable-next-line no-bitwise\n `0000${((Math.random() * 36 ** 4) << 0).toString(36)}`.slice(-4);\n return () => {\n counter += 1;\n return `u${random()}${counter}`;\n };\n})();\nexport function delay(ms) {\n return (args) => new Promise((resolve) => {\n setTimeout(() => resolve(args), ms);\n });\n}\nexport function toArray(arrayLike) {\n const arr = [];\n for (let i = 0, l = arrayLike.length; i < l; i++) {\n arr.push(arrayLike[i]);\n }\n return arr;\n}\nlet styleProps = null;\nexport function getStyleProperties(options = {}) {\n if (styleProps) {\n return styleProps;\n }\n if (options.includeStyleProperties) {\n styleProps = options.includeStyleProperties;\n return styleProps;\n }\n styleProps = toArray(window.getComputedStyle(document.documentElement));\n return styleProps;\n}\nfunction px(node, styleProperty) {\n const win = node.ownerDocument.defaultView || window;\n const val = win.getComputedStyle(node).getPropertyValue(styleProperty);\n return val ? parseFloat(val.replace('px', '')) : 0;\n}\nfunction getNodeWidth(node) {\n const leftBorder = px(node, 'border-left-width');\n const rightBorder = px(node, 'border-right-width');\n return node.clientWidth + leftBorder + rightBorder;\n}\nfunction getNodeHeight(node) {\n const topBorder = px(node, 'border-top-width');\n const bottomBorder = px(node, 'border-bottom-width');\n return node.clientHeight + topBorder + bottomBorder;\n}\nexport function getImageSize(targetNode, options = {}) {\n const width = options.width || getNodeWidth(targetNode);\n const height = options.height || getNodeHeight(targetNode);\n return { width, height };\n}\nexport function getPixelRatio() {\n let ratio;\n let FINAL_PROCESS;\n try {\n FINAL_PROCESS = process;\n }\n catch (e) {\n // pass\n }\n const val = FINAL_PROCESS && FINAL_PROCESS.env\n ? FINAL_PROCESS.env.devicePixelRatio\n : null;\n if (val) {\n ratio = parseInt(val, 10);\n if (Number.isNaN(ratio)) {\n ratio = 1;\n }\n }\n return ratio || window.devicePixelRatio || 1;\n}\n// @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/canvas#maximum_canvas_size\nconst canvasDimensionLimit = 16384;\nexport function checkCanvasDimensions(canvas) {\n if (canvas.width > canvasDimensionLimit ||\n canvas.height > canvasDimensionLimit) {\n if (canvas.width > canvasDimensionLimit &&\n canvas.height > canvasDimensionLimit) {\n if (canvas.width > canvas.height) {\n canvas.height *= canvasDimensionLimit / canvas.width;\n canvas.width = canvasDimensionLimit;\n }\n else {\n canvas.width *= canvasDimensionLimit / canvas.height;\n canvas.height = canvasDimensionLimit;\n }\n }\n else if (canvas.width > canvasDimensionLimit) {\n canvas.height *= canvasDimensionLimit / canvas.width;\n canvas.width = canvasDimensionLimit;\n }\n else {\n canvas.width *= canvasDimensionLimit / canvas.height;\n canvas.height = canvasDimensionLimit;\n }\n }\n}\nexport function canvasToBlob(canvas, options = {}) {\n if (canvas.toBlob) {\n return new Promise((resolve) => {\n canvas.toBlob(resolve, options.type ? options.type : 'image/png', options.quality ? options.quality : 1);\n });\n }\n return new Promise((resolve) => {\n const binaryString = window.atob(canvas\n .toDataURL(options.type ? options.type : undefined, options.quality ? options.quality : undefined)\n .split(',')[1]);\n const len = binaryString.length;\n const binaryArray = new Uint8Array(len);\n for (let i = 0; i < len; i += 1) {\n binaryArray[i] = binaryString.charCodeAt(i);\n }\n resolve(new Blob([binaryArray], {\n type: options.type ? options.type : 'image/png',\n }));\n });\n}\nexport function createImage(url) {\n return new Promise((resolve, reject) => {\n const img = new Image();\n img.onload = () => {\n img.decode().then(() => {\n requestAnimationFrame(() => resolve(img));\n });\n };\n img.onerror = reject;\n img.crossOrigin = 'anonymous';\n img.decoding = 'async';\n img.src = url;\n });\n}\nexport async function svgToDataURL(svg) {\n return Promise.resolve()\n .then(() => new XMLSerializer().serializeToString(svg))\n .then(encodeURIComponent)\n .then((html) => `data:image/svg+xml;charset=utf-8,${html}`);\n}\nexport async function nodeToDataURL(node, width, height) {\n const xmlns = 'http://www.w3.org/2000/svg';\n const svg = document.createElementNS(xmlns, 'svg');\n const foreignObject = document.createElementNS(xmlns, 'foreignObject');\n svg.setAttribute('width', `${width}`);\n svg.setAttribute('height', `${height}`);\n svg.setAttribute('viewBox', `0 0 ${width} ${height}`);\n foreignObject.setAttribute('width', '100%');\n foreignObject.setAttribute('height', '100%');\n foreignObject.setAttribute('x', '0');\n foreignObject.setAttribute('y', '0');\n foreignObject.setAttribute('externalResourcesRequired', 'true');\n svg.appendChild(foreignObject);\n foreignObject.appendChild(node);\n return svgToDataURL(svg);\n}\nexport const isInstanceOfElement = (node, instance) => {\n if (node instanceof instance)\n return true;\n const nodePrototype = Object.getPrototypeOf(node);\n if (nodePrototype === null)\n return false;\n return (nodePrototype.constructor.name === instance.name ||\n isInstanceOfElement(nodePrototype, instance));\n};\n//# sourceMappingURL=util.js.map","import { uuid, getStyleProperties } from './util';\nfunction formatCSSText(style) {\n const content = style.getPropertyValue('content');\n return `${style.cssText} content: '${content.replace(/'|\"/g, '')}';`;\n}\nfunction formatCSSProperties(style, options) {\n return getStyleProperties(options)\n .map((name) => {\n const value = style.getPropertyValue(name);\n const priority = style.getPropertyPriority(name);\n return `${name}: ${value}${priority ? ' !important' : ''};`;\n })\n .join(' ');\n}\nfunction getPseudoElementStyle(className, pseudo, style, options) {\n const selector = `.${className}:${pseudo}`;\n const cssText = style.cssText\n ? formatCSSText(style)\n : formatCSSProperties(style, options);\n return document.createTextNode(`${selector}{${cssText}}`);\n}\nfunction clonePseudoElement(nativeNode, clonedNode, pseudo, options) {\n const style = window.getComputedStyle(nativeNode, pseudo);\n const content = style.getPropertyValue('content');\n if (content === '' || content === 'none') {\n return;\n }\n const className = uuid();\n try {\n clonedNode.className = `${clonedNode.className} ${className}`;\n }\n catch (err) {\n return;\n }\n const styleElement = document.createElement('style');\n styleElement.appendChild(getPseudoElementStyle(className, pseudo, style, options));\n clonedNode.appendChild(styleElement);\n}\nexport function clonePseudoElements(nativeNode, clonedNode, options) {\n clonePseudoElement(nativeNode, clonedNode, ':before', options);\n clonePseudoElement(nativeNode, clonedNode, ':after', options);\n}\n//# sourceMappingURL=clone-pseudos.js.map","const WOFF = 'application/font-woff';\nconst JPEG = 'image/jpeg';\nconst mimes = {\n woff: WOFF,\n woff2: WOFF,\n ttf: 'application/font-truetype',\n eot: 'application/vnd.ms-fontobject',\n png: 'image/png',\n jpg: JPEG,\n jpeg: JPEG,\n gif: 'image/gif',\n tiff: 'image/tiff',\n svg: 'image/svg+xml',\n webp: 'image/webp',\n};\nfunction getExtension(url) {\n const match = /\\.([^./]*?)$/g.exec(url);\n return match ? match[1] : '';\n}\nexport function getMimeType(url) {\n const extension = getExtension(url).toLowerCase();\n return mimes[extension] || '';\n}\n//# sourceMappingURL=mimes.js.map","function getContentFromDataUrl(dataURL) {\n return dataURL.split(/,/)[1];\n}\nexport function isDataUrl(url) {\n return url.search(/^(data:)/) !== -1;\n}\nexport function makeDataUrl(content, mimeType) {\n return `data:${mimeType};base64,${content}`;\n}\nexport async function fetchAsDataURL(url, init, process) {\n const res = await fetch(url, init);\n if (res.status === 404) {\n throw new Error(`Resource \"${res.url}\" not found`);\n }\n const blob = await res.blob();\n return new Promise((resolve, reject) => {\n const reader = new FileReader();\n reader.onerror = reject;\n reader.onloadend = () => {\n try {\n resolve(process({ res, result: reader.result }));\n }\n catch (error) {\n reject(error);\n }\n };\n reader.readAsDataURL(blob);\n });\n}\nconst cache = {};\nfunction getCacheKey(url, contentType, includeQueryParams) {\n let key = url.replace(/\\?.*/, '');\n if (includeQueryParams) {\n key = url;\n }\n // font resource\n if (/ttf|otf|eot|woff2?/i.test(key)) {\n key = key.replace(/.*\\//, '');\n }\n return contentType ? `[${contentType}]${key}` : key;\n}\nexport async function resourceToDataURL(resourceUrl, contentType, options) {\n const cacheKey = getCacheKey(resourceUrl, contentType, options.includeQueryParams);\n if (cache[cacheKey] != null) {\n return cache[cacheKey];\n }\n // ref: https://developer.mozilla.org/en/docs/Web/API/XMLHttpRequest/Using_XMLHttpRequest#Bypassing_the_cache\n if (options.cacheBust) {\n // eslint-disable-next-line no-param-reassign\n resourceUrl += (/\\?/.test(resourceUrl) ? '&' : '?') + new Date().getTime();\n }\n let dataURL;\n try {\n const content = await fetchAsDataURL(resourceUrl, options.fetchRequestInit, ({ res, result }) => {\n if (!contentType) {\n // eslint-disable-next-line no-param-reassign\n contentType = res.headers.get('Content-Type') || '';\n }\n return getContentFromDataUrl(result);\n });\n dataURL = makeDataUrl(content, contentType);\n }\n catch (error) {\n dataURL = options.imagePlaceholder || '';\n let msg = `Failed to fetch resource: ${resourceUrl}`;\n if (error) {\n msg = typeof error === 'string' ? error : error.message;\n }\n if (msg) {\n console.warn(msg);\n }\n }\n cache[cacheKey] = dataURL;\n return dataURL;\n}\n//# sourceMappingURL=dataurl.js.map","import { clonePseudoElements } from './clone-pseudos';\nimport { createImage, toArray, isInstanceOfElement, getStyleProperties, } from './util';\nimport { getMimeType } from './mimes';\nimport { resourceToDataURL } from './dataurl';\nasync function cloneCanvasElement(canvas) {\n const dataURL = canvas.toDataURL();\n if (dataURL === 'data:,') {\n return canvas.cloneNode(false);\n }\n return createImage(dataURL);\n}\nasync function cloneVideoElement(video, options) {\n if (video.currentSrc) {\n const canvas = document.createElement('canvas');\n const ctx = canvas.getContext('2d');\n canvas.width = video.clientWidth;\n canvas.height = video.clientHeight;\n ctx === null || ctx === void 0 ? void 0 : ctx.drawImage(video, 0, 0, canvas.width, canvas.height);\n const dataURL = canvas.toDataURL();\n return createImage(dataURL);\n }\n const poster = video.poster;\n const contentType = getMimeType(poster);\n const dataURL = await resourceToDataURL(poster, contentType, options);\n return createImage(dataURL);\n}\nasync function cloneIFrameElement(iframe, options) {\n var _a;\n try {\n if ((_a = iframe === null || iframe === void 0 ? void 0 : iframe.contentDocument) === null || _a === void 0 ? void 0 : _a.body) {\n return (await cloneNode(iframe.contentDocument.body, options, true));\n }\n }\n catch (_b) {\n // Failed to clone iframe\n }\n return iframe.cloneNode(false);\n}\nasync function cloneSingleNode(node, options) {\n if (isInstanceOfElement(node, HTMLCanvasElement)) {\n return cloneCanvasElement(node);\n }\n if (isInstanceOfElement(node, HTMLVideoElement)) {\n return cloneVideoElement(node, options);\n }\n if (isInstanceOfElement(node, HTMLIFrameElement)) {\n return cloneIFrameElement(node, options);\n }\n return node.cloneNode(isSVGElement(node));\n}\nconst isSlotElement = (node) => node.tagName != null && node.tagName.toUpperCase() === 'SLOT';\nconst isSVGElement = (node) => node.tagName != null && node.tagName.toUpperCase() === 'SVG';\nasync function cloneChildren(nativeNode, clonedNode, options) {\n var _a, _b;\n if (isSVGElement(clonedNode)) {\n return clonedNode;\n }\n let children = [];\n if (isSlotElement(nativeNode) && nativeNode.assignedNodes) {\n children = toArray(nativeNode.assignedNodes());\n }\n else if (isInstanceOfElement(nativeNode, HTMLIFrameElement) &&\n ((_a = nativeNode.contentDocument) === null || _a === void 0 ? void 0 : _a.body)) {\n children = toArray(nativeNode.contentDocument.body.childNodes);\n }\n else {\n children = toArray(((_b = nativeNode.shadowRoot) !== null && _b !== void 0 ? _b : nativeNode).childNodes);\n }\n if (children.length === 0 ||\n isInstanceOfElement(nativeNode, HTMLVideoElement)) {\n return clonedNode;\n }\n await children.reduce((deferred, child) => deferred\n .then(() => cloneNode(child, options))\n .then((clonedChild) => {\n if (clonedChild) {\n clonedNode.appendChild(clonedChild);\n }\n }), Promise.resolve());\n return clonedNode;\n}\nfunction cloneCSSStyle(nativeNode, clonedNode, options) {\n const targetStyle = clonedNode.style;\n if (!targetStyle) {\n return;\n }\n const sourceStyle = window.getComputedStyle(nativeNode);\n if (sourceStyle.cssText) {\n targetStyle.cssText = sourceStyle.cssText;\n targetStyle.transformOrigin = sourceStyle.transformOrigin;\n }\n else {\n getStyleProperties(options).forEach((name) => {\n let value = sourceStyle.getPropertyValue(name);\n if (name === 'font-size' && value.endsWith('px')) {\n const reducedFont = Math.floor(parseFloat(value.substring(0, value.length - 2))) - 0.1;\n value = `${reducedFont}px`;\n }\n if (isInstanceOfElement(nativeNode, HTMLIFrameElement) &&\n name === 'display' &&\n value === 'inline') {\n value = 'block';\n }\n if (name === 'd' && clonedNode.getAttribute('d')) {\n value = `path(${clonedNode.getAttribute('d')})`;\n }\n targetStyle.setProperty(name, value, sourceStyle.getPropertyPriority(name));\n });\n }\n}\nfunction cloneInputValue(nativeNode, clonedNode) {\n if (isInstanceOfElement(nativeNode, HTMLTextAreaElement)) {\n clonedNode.innerHTML = nativeNode.value;\n }\n if (isInstanceOfElement(nativeNode, HTMLInputElement)) {\n clonedNode.setAttribute('value', nativeNode.value);\n }\n}\nfunction cloneSelectValue(nativeNode, clonedNode) {\n if (isInstanceOfElement(nativeNode, HTMLSelectElement)) {\n const clonedSelect = clonedNode;\n const selectedOption = Array.from(clonedSelect.children).find((child) => nativeNode.value === child.getAttribute('value'));\n if (selectedOption) {\n selectedOption.setAttribute('selected', '');\n }\n }\n}\nfunction decorate(nativeNode, clonedNode, options) {\n if (isInstanceOfElement(clonedNode, Element)) {\n cloneCSSStyle(nativeNode, clonedNode, options);\n clonePseudoElements(nativeNode, clonedNode, options);\n cloneInputValue(nativeNode, clonedNode);\n cloneSelectValue(nativeNode, clonedNode);\n }\n return clonedNode;\n}\nasync function ensureSVGSymbols(clone, options) {\n const uses = clone.querySelectorAll ? clone.querySelectorAll('use') : [];\n if (uses.length === 0) {\n return clone;\n }\n const processedDefs = {};\n for (let i = 0; i < uses.length; i++) {\n const use = uses[i];\n const id = use.getAttribute('xlink:href');\n if (id) {\n const exist = clone.querySelector(id);\n const definition = document.querySelector(id);\n if (!exist && definition && !processedDefs[id]) {\n // eslint-disable-next-line no-await-in-loop\n processedDefs[id] = (await cloneNode(definition, options, true));\n }\n }\n }\n const nodes = Object.values(processedDefs);\n if (nodes.length) {\n const ns = 'http://www.w3.org/1999/xhtml';\n const svg = document.createElementNS(ns, 'svg');\n svg.setAttribute('xmlns', ns);\n svg.style.position = 'absolute';\n svg.style.width = '0';\n svg.style.height = '0';\n svg.style.overflow = 'hidden';\n svg.style.display = 'none';\n const defs = document.createElementNS(ns, 'defs');\n svg.appendChild(defs);\n for (let i = 0; i < nodes.length; i++) {\n defs.appendChild(nodes[i]);\n }\n clone.appendChild(svg);\n }\n return clone;\n}\nexport async function cloneNode(node, options, isRoot) {\n if (!isRoot && options.filter && !options.filter(node)) {\n return null;\n }\n return Promise.resolve(node)\n .then((clonedNode) => cloneSingleNode(clonedNode, options))\n .then((clonedNode) => cloneChildren(node, clonedNode, options))\n .then((clonedNode) => decorate(node, clonedNode, options))\n .then((clonedNode) => ensureSVGSymbols(clonedNode, options));\n}\n//# sourceMappingURL=clone-node.js.map","import { resolveUrl } from './util';\nimport { getMimeType } from './mimes';\nimport { isDataUrl, makeDataUrl, resourceToDataURL } from './dataurl';\nconst URL_REGEX = /url\\((['\"]?)([^'\"]+?)\\1\\)/g;\nconst URL_WITH_FORMAT_REGEX = /url\\([^)]+\\)\\s*format\\(([\"']?)([^\"']+)\\1\\)/g;\nconst FONT_SRC_REGEX = /src:\\s*(?:url\\([^)]+\\)\\s*format\\([^)]+\\)[,;]\\s*)+/g;\nfunction toRegex(url) {\n // eslint-disable-next-line no-useless-escape\n const escaped = url.replace(/([.*+?^${}()|\\[\\]\\/\\\\])/g, '\\\\$1');\n return new RegExp(`(url\\\\(['\"]?)(${escaped})(['\"]?\\\\))`, 'g');\n}\nexport function parseURLs(cssText) {\n const urls = [];\n cssText.replace(URL_REGEX, (raw, quotation, url) => {\n urls.push(url);\n return raw;\n });\n return urls.filter((url) => !isDataUrl(url));\n}\nexport async function embed(cssText, resourceURL, baseURL, options, getContentFromUrl) {\n try {\n const resolvedURL = baseURL ? resolveUrl(resourceURL, baseURL) : resourceURL;\n const contentType = getMimeType(resourceURL);\n let dataURL;\n if (getContentFromUrl) {\n const content = await getContentFromUrl(resolvedURL);\n dataURL = makeDataUrl(content, contentType);\n }\n else {\n dataURL = await resourceToDataURL(resolvedURL, contentType, options);\n }\n return cssText.replace(toRegex(resourceURL), `$1${dataURL}$3`);\n }\n catch (error) {\n // pass\n }\n return cssText;\n}\nfunction filterPreferredFontFormat(str, { preferredFontFormat }) {\n return !preferredFontFormat\n ? str\n : str.replace(FONT_SRC_REGEX, (match) => {\n // eslint-disable-next-line no-constant-condition\n while (true) {\n const [src, , format] = URL_WITH_FORMAT_REGEX.exec(match) || [];\n if (!format) {\n return '';\n }\n if (format === preferredFontFormat) {\n return `src: ${src};`;\n }\n }\n });\n}\nexport function shouldEmbed(url) {\n return url.search(URL_REGEX) !== -1;\n}\nexport async function embedResources(cssText, baseUrl, options) {\n if (!shouldEmbed(cssText)) {\n return cssText;\n }\n const filteredCSSText = filterPreferredFontFormat(cssText, options);\n const urls = parseURLs(filteredCSSText);\n return urls.reduce((deferred, url) => deferred.then((css) => embed(css, url, baseUrl, options)), Promise.resolve(filteredCSSText));\n}\n//# sourceMappingURL=embed-resources.js.map","import { embedResources } from './embed-resources';\nimport { toArray, isInstanceOfElement } from './util';\nimport { isDataUrl, resourceToDataURL } from './dataurl';\nimport { getMimeType } from './mimes';\nasync function embedProp(propName, node, options) {\n var _a;\n const propValue = (_a = node.style) === null || _a === void 0 ? void 0 : _a.getPropertyValue(propName);\n if (propValue) {\n const cssString = await embedResources(propValue, null, options);\n node.style.setProperty(propName, cssString, node.style.getPropertyPriority(propName));\n return true;\n }\n return false;\n}\nasync function embedBackground(clonedNode, options) {\n ;\n (await embedProp('background', clonedNode, options)) ||\n (await embedProp('background-image', clonedNode, options));\n (await embedProp('mask', clonedNode, options)) ||\n (await embedProp('-webkit-mask', clonedNode, options)) ||\n (await embedProp('mask-image', clonedNode, options)) ||\n (await embedProp('-webkit-mask-image', clonedNode, options));\n}\nasync function embedImageNode(clonedNode, options) {\n const isImageElement = isInstanceOfElement(clonedNode, HTMLImageElement);\n if (!(isImageElement && !isDataUrl(clonedNode.src)) &&\n !(isInstanceOfElement(clonedNode, SVGImageElement) &&\n !isDataUrl(clonedNode.href.baseVal))) {\n return;\n }\n const url = isImageElement ? clonedNode.src : clonedNode.href.baseVal;\n const dataURL = await resourceToDataURL(url, getMimeType(url), options);\n await new Promise((resolve, reject) => {\n clonedNode.onload = resolve;\n clonedNode.onerror = options.onImageErrorHandler\n ? (...attributes) => {\n try {\n resolve(options.onImageErrorHandler(...attributes));\n }\n catch (error) {\n reject(error);\n }\n }\n : reject;\n const image = clonedNode;\n if (image.decode) {\n image.decode = resolve;\n }\n if (image.loading === 'lazy') {\n image.loading = 'eager';\n }\n if (isImageElement) {\n clonedNode.srcset = '';\n clonedNode.src = dataURL;\n }\n else {\n clonedNode.href.baseVal = dataURL;\n }\n });\n}\nasync function embedChildren(clonedNode, options) {\n const children = toArray(clonedNode.childNodes);\n const deferreds = children.map((child) => embedImages(child, options));\n await Promise.all(deferreds).then(() => clonedNode);\n}\nexport async function embedImages(clonedNode, options) {\n if (isInstanceOfElement(clonedNode, Element)) {\n await embedBackground(clonedNode, options);\n await embedImageNode(clonedNode, options);\n await embedChildren(clonedNode, options);\n }\n}\n//# sourceMappingURL=embed-images.js.map","export function applyStyle(node, options) {\n const { style } = node;\n if (options.backgroundColor) {\n style.backgroundColor = options.backgroundColor;\n }\n if (options.width) {\n style.width = `${options.width}px`;\n }\n if (options.height) {\n style.height = `${options.height}px`;\n }\n const manual = options.style;\n if (manual != null) {\n Object.keys(manual).forEach((key) => {\n style[key] = manual[key];\n });\n }\n return node;\n}\n//# sourceMappingURL=apply-style.js.map","import { toArray } from './util';\nimport { fetchAsDataURL } from './dataurl';\nimport { shouldEmbed, embedResources } from './embed-resources';\nconst cssFetchCache = {};\nasync function fetchCSS(url) {\n let cache = cssFetchCache[url];\n if (cache != null) {\n return cache;\n }\n const res = await fetch(url);\n const cssText = await res.text();\n cache = { url, cssText };\n cssFetchCache[url] = cache;\n return cache;\n}\nasync function embedFonts(data, options) {\n let cssText = data.cssText;\n const regexUrl = /url\\([\"']?([^\"')]+)[\"']?\\)/g;\n const fontLocs = cssText.match(/url\\([^)]+\\)/g) || [];\n const loadFonts = fontLocs.map(async (loc) => {\n let url = loc.replace(regexUrl, '$1');\n if (!url.startsWith('https://')) {\n url = new URL(url, data.url).href;\n }\n return fetchAsDataURL(url, options.fetchRequestInit, ({ result }) => {\n cssText = cssText.replace(loc, `url(${result})`);\n return [loc, result];\n });\n });\n return Promise.all(loadFonts).then(() => cssText);\n}\nfunction parseCSS(source) {\n if (source == null) {\n return [];\n }\n const result = [];\n const commentsRegex = /(\\/\\*[\\s\\S]*?\\*\\/)/gi;\n // strip out comments\n let cssText = source.replace(commentsRegex, '');\n // eslint-disable-next-line prefer-regex-literals\n const keyframesRegex = new RegExp('((@.*?keyframes [\\\\s\\\\S]*?){([\\\\s\\\\S]*?}\\\\s*?)})', 'gi');\n // eslint-disable-next-line no-constant-condition\n while (true) {\n const matches = keyframesRegex.exec(cssText);\n if (matches === null) {\n break;\n }\n result.push(matches[0]);\n }\n cssText = cssText.replace(keyframesRegex, '');\n const importRegex = /@import[\\s\\S]*?url\\([^)]*\\)[\\s\\S]*?;/gi;\n // to match css & media queries together\n const combinedCSSRegex = '((\\\\s*?(?:\\\\/\\\\*[\\\\s\\\\S]*?\\\\*\\\\/)?\\\\s*?@media[\\\\s\\\\S]' +\n '*?){([\\\\s\\\\S]*?)}\\\\s*?})|(([\\\\s\\\\S]*?){([\\\\s\\\\S]*?)})';\n // unified regex\n const unifiedRegex = new RegExp(combinedCSSRegex, 'gi');\n // eslint-disable-next-line no-constant-condition\n while (true) {\n let matches = importRegex.exec(cssText);\n if (matches === null) {\n matches = unifiedRegex.exec(cssText);\n if (matches === null) {\n break;\n }\n else {\n importRegex.lastIndex = unifiedRegex.lastIndex;\n }\n }\n else {\n unifiedRegex.lastIndex = importRegex.lastIndex;\n }\n result.push(matches[0]);\n }\n return result;\n}\nasync function getCSSRules(styleSheets, options) {\n const ret = [];\n const deferreds = [];\n // First loop inlines imports\n styleSheets.forEach((sheet) => {\n if ('cssRules' in sheet) {\n try {\n toArray(sheet.cssRules || []).forEach((item, index) => {\n if (item.type === CSSRule.IMPORT_RULE) {\n let importIndex = index + 1;\n const url = item.href;\n const deferred = fetchCSS(url)\n .then((metadata) => embedFonts(metadata, options))\n .then((cssText) => parseCSS(cssText).forEach((rule) => {\n try {\n sheet.insertRule(rule, rule.startsWith('@import')\n ? (importIndex += 1)\n : sheet.cssRules.length);\n }\n catch (error) {\n console.error('Error inserting rule from remote css', {\n rule,\n error,\n });\n }\n }))\n .catch((e) => {\n console.error('Error loading remote css', e.toString());\n });\n deferreds.push(deferred);\n }\n });\n }\n catch (e) {\n const inline = styleSheets.find((a) => a.href == null) || document.styleSheets[0];\n if (sheet.href != null) {\n deferreds.push(fetchCSS(sheet.href)\n .then((metadata) => embedFonts(metadata, options))\n .then((cssText) => parseCSS(cssText).forEach((rule) => {\n inline.insertRule(rule, inline.cssRules.length);\n }))\n .catch((err) => {\n console.error('Error loading remote stylesheet', err);\n }));\n }\n console.error('Error inlining remote css file', e);\n }\n }\n });\n return Promise.all(deferreds).then(() => {\n // Second loop parses rules\n styleSheets.forEach((sheet) => {\n if ('cssRules' in sheet) {\n try {\n toArray(sheet.cssRules || []).forEach((item) => {\n ret.push(item);\n });\n }\n catch (e) {\n console.error(`Error while reading CSS rules from ${sheet.href}`, e);\n }\n }\n });\n return ret;\n });\n}\nfunction getWebFontRules(cssRules) {\n return cssRules\n .filter((rule) => rule.type === CSSRule.FONT_FACE_RULE)\n .filter((rule) => shouldEmbed(rule.style.getPropertyValue('src')));\n}\nasync function parseWebFontRules(node, options) {\n if (node.ownerDocument == null) {\n throw new Error('Provided element is not within a Document');\n }\n const styleSheets = toArray(node.ownerDocument.styleSheets);\n const cssRules = await getCSSRules(styleSheets, options);\n return getWebFontRules(cssRules);\n}\nfunction normalizeFontFamily(font) {\n return font.trim().replace(/[\"']/g, '');\n}\nfunction getUsedFonts(node) {\n const fonts = new Set();\n function traverse(node) {\n const fontFamily = node.style.fontFamily || getComputedStyle(node).fontFamily;\n fontFamily.split(',').forEach((font) => {\n fonts.add(normalizeFontFamily(font));\n });\n Array.from(node.children).forEach((child) => {\n if (child instanceof HTMLElement) {\n traverse(child);\n }\n });\n }\n traverse(node);\n return fonts;\n}\nexport async function getWebFontCSS(node, options) {\n const rules = await parseWebFontRules(node, options);\n const usedFonts = getUsedFonts(node);\n const cssTexts = await Promise.all(rules\n .filter((rule) => usedFonts.has(normalizeFontFamily(rule.style.fontFamily)))\n .map((rule) => {\n const baseUrl = rule.parentStyleSheet\n ? rule.parentStyleSheet.href\n : null;\n return embedResources(rule.cssText, baseUrl, options);\n }));\n return cssTexts.join('\\n');\n}\nexport async function embedWebFonts(clonedNode, options) {\n const cssText = options.fontEmbedCSS != null\n ? options.fontEmbedCSS\n : options.skipFonts\n ? null\n : await getWebFontCSS(clonedNode, options);\n if (cssText) {\n const styleNode = document.createElement('style');\n const sytleContent = document.createTextNode(cssText);\n styleNode.appendChild(sytleContent);\n if (clonedNode.firstChild) {\n clonedNode.insertBefore(styleNode, clonedNode.firstChild);\n }\n else {\n clonedNode.appendChild(styleNode);\n }\n }\n}\n//# sourceMappingURL=embed-webfonts.js.map","import { cloneNode } from './clone-node';\nimport { embedImages } from './embed-images';\nimport { applyStyle } from './apply-style';\nimport { embedWebFonts, getWebFontCSS } from './embed-webfonts';\nimport { getImageSize, getPixelRatio, createImage, canvasToBlob, nodeToDataURL, checkCanvasDimensions, } from './util';\nexport async function toSvg(node, options = {}) {\n const { width, height } = getImageSize(node, options);\n const clonedNode = (await cloneNode(node, options, true));\n await embedWebFonts(clonedNode, options);\n await embedImages(clonedNode, options);\n applyStyle(clonedNode, options);\n const datauri = await nodeToDataURL(clonedNode, width, height);\n return datauri;\n}\nexport async function toCanvas(node, options = {}) {\n const { width, height } = getImageSize(node, options);\n const svg = await toSvg(node, options);\n const img = await createImage(svg);\n const canvas = document.createElement('canvas');\n const context = canvas.getContext('2d');\n const ratio = options.pixelRatio || getPixelRatio();\n const canvasWidth = options.canvasWidth || width;\n const canvasHeight = options.canvasHeight || height;\n canvas.width = canvasWidth * ratio;\n canvas.height = canvasHeight * ratio;\n if (!options.skipAutoScale) {\n checkCanvasDimensions(canvas);\n }\n canvas.style.width = `${canvasWidth}`;\n canvas.style.height = `${canvasHeight}`;\n if (options.backgroundColor) {\n context.fillStyle = options.backgroundColor;\n context.fillRect(0, 0, canvas.width, canvas.height);\n }\n context.drawImage(img, 0, 0, canvas.width, canvas.height);\n return canvas;\n}\nexport async function toPixelData(node, options = {}) {\n const { width, height } = getImageSize(node, options);\n const canvas = await toCanvas(node, options);\n const ctx = canvas.getContext('2d');\n return ctx.getImageData(0, 0, width, height).data;\n}\nexport async function toPng(node, options = {}) {\n const canvas = await toCanvas(node, options);\n return canvas.toDataURL();\n}\nexport async function toJpeg(node, options = {}) {\n const canvas = await toCanvas(node, options);\n return canvas.toDataURL('image/jpeg', options.quality || 1);\n}\nexport async function toBlob(node, options = {}) {\n const canvas = await toCanvas(node, options);\n const blob = await canvasToBlob(canvas);\n return blob;\n}\nexport async function getFontEmbedCSS(node, options = {}) {\n return getWebFontCSS(node, options);\n}\n//# sourceMappingURL=index.js.map"],"names":["resolveUrl","url","baseUrl","doc","base","a","uuid","counter","random","toArray","arrayLike","arr","i","l","styleProps","getStyleProperties","options","px","node","styleProperty","val","getNodeWidth","leftBorder","rightBorder","getNodeHeight","topBorder","bottomBorder","getImageSize","targetNode","width","height","getPixelRatio","ratio","FINAL_PROCESS","canvasDimensionLimit","checkCanvasDimensions","canvas","canvasToBlob","resolve","binaryString","len","binaryArray","createImage","reject","img","svgToDataURL","svg","html","nodeToDataURL","xmlns","foreignObject","isInstanceOfElement","instance","nodePrototype","formatCSSText","style","content","formatCSSProperties","name","value","priority","getPseudoElementStyle","className","pseudo","selector","cssText","clonePseudoElement","nativeNode","clonedNode","styleElement","clonePseudoElements","WOFF","JPEG","mimes","getExtension","match","getMimeType","extension","getContentFromDataUrl","dataURL","isDataUrl","makeDataUrl","mimeType","fetchAsDataURL","init","process","res","blob","reader","error","cache","getCacheKey","contentType","includeQueryParams","key","resourceToDataURL","resourceUrl","cacheKey","result","msg","cloneCanvasElement","cloneVideoElement","video","ctx","poster","cloneIFrameElement","iframe","_a","cloneNode","cloneSingleNode","isSVGElement","isSlotElement","cloneChildren","_b","children","deferred","child","clonedChild","cloneCSSStyle","targetStyle","sourceStyle","cloneInputValue","cloneSelectValue","clonedSelect","selectedOption","decorate","ensureSVGSymbols","clone","uses","processedDefs","id","exist","definition","nodes","ns","defs","isRoot","URL_REGEX","URL_WITH_FORMAT_REGEX","FONT_SRC_REGEX","toRegex","escaped","parseURLs","urls","raw","quotation","embed","resourceURL","baseURL","getContentFromUrl","resolvedURL","filterPreferredFontFormat","str","preferredFontFormat","src","format","shouldEmbed","embedResources","filteredCSSText","css","embedProp","propName","propValue","cssString","embedBackground","embedImageNode","isImageElement","attributes","image","embedChildren","deferreds","embedImages","applyStyle","manual","cssFetchCache","fetchCSS","embedFonts","data","regexUrl","loadFonts","loc","parseCSS","source","commentsRegex","keyframesRegex","matches","importRegex","combinedCSSRegex","unifiedRegex","getCSSRules","styleSheets","ret","sheet","item","index","importIndex","metadata","rule","e","inline","err","getWebFontRules","cssRules","parseWebFontRules","normalizeFontFamily","font","getUsedFonts","fonts","traverse","getWebFontCSS","rules","usedFonts","embedWebFonts","styleNode","sytleContent","toSvg","toCanvas","context","canvasWidth","canvasHeight","toPixelData","toPng","toJpeg","toBlob","getFontEmbedCSS"],"mappings":"gFAAO,SAASA,EAAWC,EAAKC,EAAS,CAErC,GAAID,EAAI,MAAM,eAAe,EACzB,OAAOA,EAGX,GAAIA,EAAI,MAAM,OAAO,EACjB,OAAO,OAAO,SAAS,SAAWA,EAGtC,GAAIA,EAAI,MAAM,WAAW,EACrB,OAAOA,EAEX,MAAME,EAAM,SAAS,eAAe,mBAAkB,EAChDC,EAAOD,EAAI,cAAc,MAAM,EAC/BE,EAAIF,EAAI,cAAc,GAAG,EAC/B,OAAAA,EAAI,KAAK,YAAYC,CAAI,EACzBD,EAAI,KAAK,YAAYE,CAAC,EAClBH,IACAE,EAAK,KAAOF,GAEhBG,EAAE,KAAOJ,EACFI,EAAE,IACb,CACO,MAAMC,GAAQ,IAAM,CAGvB,IAAIC,EAAU,EAEd,MAAMC,EAAS,IAEf,QAAS,KAAK,OAAM,EAAK,IAAM,GAAM,GAAG,SAAS,EAAE,CAAC,GAAG,MAAM,EAAE,EAC/D,MAAO,KACHD,GAAW,EACJ,IAAIC,GAAQ,GAAGD,CAAO,GAErC,GAAC,EAMM,SAASE,EAAQC,EAAW,CAC/B,MAAMC,EAAM,CAAA,EACZ,QAASC,EAAI,EAAGC,EAAIH,EAAU,OAAQE,EAAIC,EAAGD,IACzCD,EAAI,KAAKD,EAAUE,CAAC,CAAC,EAEzB,OAAOD,CACX,CACA,IAAIG,EAAa,KACV,SAASC,EAAmBC,EAAU,GAA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