@vouchfor/embeds 0.0.0-experiment.1f98c5e → 0.0.0-experiment.2163a85

Sign up to get free protection for your applications and to get access to all the features.
Files changed (37) hide show
  1. package/dist/es/embeds.js +1139 -7
  2. package/dist/es/embeds.js.map +1 -1
  3. package/dist/es/src/components/DialogEmbed/DialogOverlay.d.ts +20 -0
  4. package/dist/es/src/components/DialogEmbed/DialogPortal.d.ts +36 -0
  5. package/dist/es/src/components/DialogEmbed/index.d.ts +38 -0
  6. package/dist/es/src/components/PlayerEmbed/controllers/event-forwarder.d.ts +15 -0
  7. package/dist/es/src/components/{Embed → PlayerEmbed}/controllers/fetcher.d.ts +4 -4
  8. package/dist/es/src/components/{Embed/controllers/tracking.d.ts → PlayerEmbed/controllers/tracking/index.d.ts} +14 -11
  9. package/dist/es/src/components/PlayerEmbed/controllers/tracking/utils.d.ts +17 -0
  10. package/dist/es/src/components/{Embed → PlayerEmbed}/index.d.ts +26 -22
  11. package/dist/es/src/components/PlayerEmbed/tests/data.d.ts +3 -0
  12. package/dist/es/src/index.d.ts +2 -1
  13. package/dist/iife/dialog-embed/embed.iife.js +1750 -0
  14. package/dist/iife/dialog-embed/embed.iife.js.map +1 -0
  15. package/dist/iife/embeds.iife.js +573 -381
  16. package/dist/iife/embeds.iife.js.map +1 -1
  17. package/dist/iife/player-embed/embed.iife.js +1612 -0
  18. package/dist/iife/player-embed/embed.iife.js.map +1 -0
  19. package/package.json +42 -32
  20. package/src/components/DialogEmbed/Dialog.stories.ts +91 -0
  21. package/src/components/DialogEmbed/DialogOverlay.ts +131 -0
  22. package/src/components/DialogEmbed/DialogPortal.ts +126 -0
  23. package/src/components/DialogEmbed/index.ts +97 -0
  24. package/src/components/{Embed/Embed.stories.ts → PlayerEmbed/PlayerEmbed.stories.ts} +15 -15
  25. package/src/components/{Embed → PlayerEmbed}/controllers/event-forwarder.ts +6 -5
  26. package/src/components/{Embed → PlayerEmbed}/controllers/fetcher.ts +11 -11
  27. package/src/components/{Embed/controllers/tracking.ts → PlayerEmbed/controllers/tracking/index.ts} +47 -118
  28. package/src/components/PlayerEmbed/controllers/tracking/utils.ts +95 -0
  29. package/src/components/{Embed → PlayerEmbed}/index.ts +56 -23
  30. package/src/components/PlayerEmbed/tests/PlayerEmbed.spec.ts +80 -0
  31. package/src/components/PlayerEmbed/tests/data.ts +183 -0
  32. package/src/index.ts +2 -1
  33. package/dist/es/browser-95c87c48.js +0 -433
  34. package/dist/es/browser-95c87c48.js.map +0 -1
  35. package/dist/es/index-9dd8a4fa.js +0 -9950
  36. package/dist/es/index-9dd8a4fa.js.map +0 -1
  37. package/src/components/Embed/Embed.spec.ts +0 -17
@@ -0,0 +1,183 @@
1
+ import type { Vouch } from '@vouchfor/video-utils';
2
+
3
+ /* eslint-disable max-lines */
4
+ const data = {
5
+ id: '85a7f7fb-897c-41a4-be7b-2636cf991f2c',
6
+ hashId: '6JQEIPeStt',
7
+ questions: {
8
+ items: [
9
+ {
10
+ id: '5c66bb3a-ed68-41a0-a601-a49865104418',
11
+ title: `"Emoji": 🇯🇵 🙏
12
+ Arabic: خَرَجَ الوَلَدُ.
13
+ Chinese: 简化字不讲理
14
+ Hebrew: עִבְרִית
15
+ Japanese Kanji: 漢字
16
+ Japanese Hiragana: 平仮名
17
+ Japanese Katakana: 片仮名
18
+ Devangari Hindi: ॳॴॶॷऎऒऔ
19
+ Korean Hangul: 정음/正音
20
+ Cyrillic: АБВГДЕЖЗИКЛМН
21
+ Greek: αβγδ`,
22
+ answer: {
23
+ id: '5c66bb3a-ed68-41a0-a601-a49865104418',
24
+ label: null,
25
+ metadata: {
26
+ duration: 18.5
27
+ },
28
+ settings: {
29
+ endOffset: 0,
30
+ startOffset: 0
31
+ },
32
+ media: {
33
+ input:
34
+ 'https://d2rxhdlm2q91uk.cloudfront.net/TVik9uTMgE/6JQEIPeStt/5c66bb3a-ed68-41a0-a601-a49865104418/5c66bb3a-ed68-41a0-a601-a49865104418_input.mp4?Policy=eyJTdGF0ZW1lbnQiOlt7IlJlc291cmNlIjo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iSVIH5VlWi~KRvMRZnQpHWxfVvnvvxifuk8bODDHh1Ba7MJxrAkdoskzP7xVYO3NbROscTPZ5tKnK9SVt2tnpdW0Aqxj1e2kH6WJhqwgxFfCDqDojMEesx-om71R99U0hMjwDHUF~EDEk6L6wrmD0OfXxbeKd-g5FoTPdJg__',
37
+ playlist:
38
+ 'https://d2rxhdlm2q91uk.cloudfront.net/TVik9uTMgE/6JQEIPeStt/5c66bb3a-ed68-41a0-a601-a49865104418/5c66bb3a-ed68-41a0-a601-a49865104418.m3u8?Policy=eyJTdGF0ZW1lbnQiOlt7IlJlc291cmNlIjoiaHR0cHM6Ly9kMnJ4aGRsbTJxOTF1ay5jbG91ZGZyb250Lm5ldC9UVmlrOXVUTWdFLyoiLCJDb25kaXRpb24iOnsiRGF0ZUxlc3NUaGFuIjp7IkFXUzpFcG9jaFRpbWUiOjIwMTQ1NDI2MzV9fX1dfQ__&Key-Pair-Id=K2SWKOH0FA5F6M&Signature=vh-ZjBnHDhIIKRe4vr8GHppegY2VIRwXvC~QdX8aV9b5eylmQ~I~EmQ2MKwLOWuQ14DHOF~GU8oAfjXTMWgmZdeu1YzHkDHpQzi1b~NLgipJmpYe9-9OR67MC8jvNTva6OQ5PKsdN6tQBn9vWbBOP5gXEMZLtBP1tsopNu7ZpaUduyPiSVIH5VlWi~KRvMRZnQpHWxfVvnvvxifuk8bODDHh1Ba7MJxrAkdoskzP7xVYO3NbROscTPZ5tKnK9SVt2tnpdW0Aqxj1e2kH6WJhqwgxFfCDqDojMEesx-om71R99U0hMjwDHUF~EDEk6L6wrmD0OfXxbeKd-g5FoTPdJg__',
39
+ thumbnail:
40
+ 'https://d2rxhdlm2q91uk.cloudfront.net/TVik9uTMgE/6JQEIPeStt/5c66bb3a-ed68-41a0-a601-a49865104418/5c66bb3a-ed68-41a0-a601-a49865104418_poster.0000001.jpg?Policy=eyJTdGF0ZW1lbnQiOlt7IlJlc291cmNlIjoiaHR0cHM6Ly9kMnJ4aGRsbTJxOTF1ay5jbG91ZGZyb250Lm5ldC9UVmlrOXVUTWdFLyoiLCJDb25kaXRpb24iOnsiRGF0ZUxlc3NUaGFuIjp7IkFXUzpFcG9jaFRpbWUiOjIwMTYzMjM0Mjl9fX1dfQ__&Key-Pair-Id=K2SWKOH0FA5F6M&Signature=SGA54MFpy4jaqKJHKEuxRfjk-~NBFAh1tdW9Y6uYJwc0LFjDDgX1sraerSyohmVhj~-QVIrglY5BvglDIhrFcLJWGTkgj4vhyLprk1a7EDckv0HBgp-k1ZKvoDtt3wBOzrL4GicfXBkuMpIu5jv5MY3xemlJj2a6V~h65XJuLO4u-xS~McH6rS3mRxoNl4GcYUVm4upre1DGQx-5Suy6Ateoxl6xxoF8kg5EL02KxkIGiRpwXJTvVmUuVF0rpBj-IE40MfmhLBQ1NNSXiqb3-HjpkKwhYPvB5APVh23mzGmqJ0P3jbr2F1cU4Jvlqsjb6GVP61wGOz9ITeWPZkOy8A__'
41
+ },
42
+ client: {
43
+ id: '03540d70-1c75-4867-a235-bac842ed6ce4',
44
+ name: 'Not Supplied',
45
+ logoSrc: 'https://logo.clearbit.com/vouchfor.com?size=260'
46
+ },
47
+ contact: {
48
+ id: 'b62f62a3-0cd4-4512-9b52-121cb2f3e72f',
49
+ name: 'Aaron Williams'
50
+ },
51
+ captions: {
52
+ current:
53
+ 'WEBVTT\n\n1\n00:00:01.549 --> 00:00:05.920\n🇯🇵 🙏 こんにちは 藤森 章 です 。 え ? 今 日本 の え ? 東京 に 住ん で\n\n2\n00:00:05.929 --> 00:00:11.359\nいる 高校 三 年 生 です 。 えっと 父親 が 日本 人 で 母親 が は\n\n3\n00:00:11.619 --> 00:00:13.130\nえー 中国 人 な ん です けれど も 。\n\n4\n00:00:13.939 --> 00:00:17.889\nえ ? 上海 に 行っ た 時 に 国際 学校 に 通っ て い た の で 。\n\n5\n00:00:17.899 --> 00:00:20.389\nえー 英語 を 日本 語 、 中国 語 、 三 語 を しゃ ます\n\n6\n00:00:21.030 --> 00:00:23.549\nえー で 、 その 中 で 経験 し た こと な ん です けれど も 、\n\n7\n00:00:24.040 --> 00:00:26.700\n日本 語 の 素晴らしい ところ って いう の は 、\n\n8\n00:00:27.260 --> 00:00:27.809\nやっぱり\n\n9\n00:00:28.489 --> 00:00:31.540\n和歌 に も 見 られる よう な 多彩 な 表現 力 と\n\n10\n00:00:32.349 --> 00:00:33.819\nえ 奥深い\n\n11\n00:00:34.770 --> 00:00:38.520\nえー 、 感情 表現 など に ある と 思い ます 。 えー これ を 見 て\n\n12\n00:00:38.759 --> 00:00:41.599\n日本 語 に 興味 を 持っ た 方 は 、 是非 その\n\n13\n00:00:43.180 --> 00:00:43.770\n奥深い\n\n14\n00:00:44.299 --> 00:00:45.630\n表現 など を え 、\n\n15\n00:00:46.299 --> 00:00:49.209\n見 て 、 感じ て えー 、 触れ て み て ください 。 ありがとう\n\n16\n00:00:49.220 --> 00:00:49.599\nござい まし た 。\n'
54
+ }
55
+ }
56
+ },
57
+ {
58
+ id: '5c66bb3a-ed68-41a0-a601-a49865104418',
59
+ // title: "What is the business problem you're trying to solve?",
60
+ answer: {
61
+ id: '5c66bb3a-ed68-41a0-a601-a49865104418',
62
+ label: 'Hello this label is overridden',
63
+ metadata: {
64
+ duration: 18.5
65
+ },
66
+ settings: {
67
+ endOffset: 0.385945945945946,
68
+ startOffset: 0.3037837837837838,
69
+ crop: {
70
+ x: 0.4,
71
+ y: 0.4,
72
+ width: 0.4,
73
+ height: 0.4
74
+ }
75
+ },
76
+ media: {
77
+ input:
78
+ 'https://d2rxhdlm2q91uk.cloudfront.net/TVik9uTMgE/6JQEIPeStt/5c66bb3a-ed68-41a0-a601-a49865104418/5c66bb3a-ed68-41a0-a601-a49865104418_input.mp4?Policy=eyJTdGF0ZW1lbnQiOlt7IlJlc291cmNlIjoiaHR0cHM6Ly9kMnJ4aGRsbTJxOTF1ay5jbG91ZGZyb250Lm5ldC9UVmlrOXVUTWdFLyoiLCJDb25kaXRpb24iOnsiRGF0ZUxlc3NUa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xFfCDqDojMEesx-om71R99U0hMjwDHUF~EDEk6L6wrmD0OfXxbeKd-g5FoTPdJg__',
81
+ playlist:
82
+ 'https://d2rxhdlm2q91uk.cloudfront.net/TVik9uTMgE/6JQEIPeStt/5c66bb3a-ed68-41a0-a601-a49865104418/5c66bb3a-ed68-41a0-a601-a49865104418.m3u8?Policy=eyJTdGF0ZW1lbnQiOlt7IlJlc291cmNlIjoiaHR0cHM6Ly9kMnJ4aGRsbTJxOTF1ay5jbG91ZGZyb250Lm5ldC9UVmlrOXVUTWdFLyoiLCJDb25kaXRpb24iOnsiRGF0ZUxlc3NUaGFuIjp7IkFXUzpFcG9jaFRpbWUiOjIwMTQ1NDI2MzV9fX1dfQ__&Key-Pair-Id=K2SWKOH0FA5F6M&Signature=vh-ZjBnHDhIIKRe4vr8GHppegY2VIRwXvC~QdX8aV9b5eylmQ~I~EmQ2MKwLOWuQ14DHOF~GU8oAfjXTMWgmZdeu1YzHkDHpQzi1b~NLgipJmpYe9-9OR67MC8jvNTva6OQ5PKsdN6tQBn9vWbBOP5gXEMZLtBP1tsopNu7ZpaUduyPiSVIH5VlWi~KRvMRZnQpHWxfVvnvvxifuk8bODDHh1Ba7MJxrAkdoskzP7xVYO3NbROscTPZ5tKnK9SVt2tnpdW0Aqxj1e2kH6WJhqwgxFfCDqDojMEesx-om71R99U0hMjwDHUF~EDEk6L6wrmD0OfXxbeKd-g5FoTPdJg__',
83
+ thumbnail:
84
+ 'https://d2rxhdlm2q91uk.cloudfront.net/TVik9uTMgE/6JQEIPeStt/5c66bb3a-ed68-41a0-a601-a49865104418/5c66bb3a-ed68-41a0-a601-a49865104418_poster.0000001.jpg?Policy=eyJTdGF0ZW1lbnQiOlt7IlJlc291cmNlIjoiaHR0cHM6Ly9kMnJ4aGRsbTJxOTF1ay5jbG91ZGZyb250Lm5ldC9UVmlrOXVUTWdFLyoiLCJDb25kaXRpb24iOnsiRGF0ZUxlc3NUaGFuIjp7IkFXUzpFcG9jaFRpbWUiOjIwMTYzMjM0Mjl9fX1dfQ__&Key-Pair-Id=K2SWKOH0FA5F6M&Signature=SGA54MFpy4jaqKJHKEuxRfjk-~NBFAh1tdW9Y6uYJwc0LFjDDgX1sraerSyohmVhj~-QVIrglY5BvglDIhrFcLJWGTkgj4vhyLprk1a7EDckv0HBgp-k1ZKvoDtt3wBOzrL4GicfXBkuMpIu5jv5MY3xemlJj2a6V~h65XJuLO4u-xS~McH6rS3mRxoNl4GcYUVm4upre1DGQx-5Suy6Ateoxl6xxoF8kg5EL02KxkIGiRpwXJTvVmUuVF0rpBj-IE40MfmhLBQ1NNSXiqb3-HjpkKwhYPvB5APVh23mzGmqJ0P3jbr2F1cU4Jvlqsjb6GVP61wGOz9ITeWPZkOy8A__'
85
+ },
86
+ client: {
87
+ id: '03540d70-1c75-4867-a235-bac842ed6ce4',
88
+ logoSrc: 'https://logo.clearbit.com/vouchfor.com?size=260'
89
+ },
90
+ contact: {
91
+ id: 'b62f62a3-0cd4-4512-9b52-121cb2f3e72f',
92
+ name: 'Aaron Williams',
93
+ roleTitle: 'Software Engineer'
94
+ },
95
+ captions: {
96
+ current:
97
+ "WEBVTT\r\n\r\n1\r\n00:00:01.710 --> 00:00:05.250\r\nwe are trying to solve, uh, world hunger.\r\n\r\n2\r\n00:00:05.420 --> 00:00:08.369\r\nI think it's an important goal. Uh, we\r\n\r\n3\r\n00:00:08.380 --> 00:00:09.489\r\nalso would like to get rid of\r\n\r\n4\r\n00:00:09.500 --> 00:00:12.050\r\ntuberculosis. Um, in general. And\r\n\r\n5\r\n00:00:12.060 --> 00:00:15.329\r\nprobably malaria, too. Uh, it's gonna be\r\n\r\n6\r\n00:00:15.340 --> 00:00:17.180\r\na couple of weeks, but I think we can do\r\n\r\n7\r\n00:00:17.190 --> 00:00:17.319\r\nit.\r\n"
98
+ }
99
+ }
100
+ },
101
+ {
102
+ id: 'e77c81a7-f6ef-4eae-91fc-b620d092d8d6',
103
+ title: 'What are the priorities for your business/team this quarter?',
104
+ answer: {
105
+ id: 'e77c81a7-f6ef-4eae-91fc-b620d092d8d6',
106
+ label: null,
107
+ metadata: {
108
+ duration: 16.167
109
+ },
110
+ settings: {
111
+ endOffset: 0,
112
+ startOffset: 0
113
+ },
114
+ media: {
115
+ input:
116
+ 'https://d2rxhdlm2q91uk.cloudfront.net/TVik9uTMgE/6JQEIPeStt/e77c81a7-f6ef-4eae-91fc-b620d092d8d6/e77c81a7-f6ef-4eae-91fc-b620d092d8d6_input.mp4?Policy=eyJTdGF0ZW1lbnQiOlt7IlJlc291cmNlIjoiaHR0cHM6Ly9kMnJ4aGRsbTJxOTF1ay5jbG91ZGZyb250Lm5ldC9UVmlrOXVUTWdFLyoiLCJDb25kaXRpb24iOnsiRGF0ZUxlc3NUaGFuIjp7IkFXUzpFcG9jaFRpbWUiOjIwMTQ1NDI2MzV9fX1dfQ__&Key-Pair-Id=K2SWKOH0FA5F6M&Signature=vh-ZjBnHDhIIKRe4vr8GHppegY2VIRwXvC~QdX8aV9b5eylmQ~I~EmQ2MKwLOWuQ14DHOF~GU8oAfjXTMWgmZdeu1YzHkDHpQzi1b~NLgipJmpYe9-9OR67MC8jvNTva6OQ5PKsdN6tQBn9vWbBOP5gXEMZLtBP1tsopNu7ZpaUduyPiSVIH5VlWi~KRvMRZnQpHWxfVvnvvxifuk8bODDHh1Ba7MJxrAkdoskzP7xVYO3NbROscTPZ5tKnK9SVt2tnpdW0Aqxj1e2kH6WJhqwgxFfCDqDojMEesx-om71R99U0hMjwDHUF~EDEk6L6wrmD0OfXxbeKd-g5FoTPdJg__',
117
+ video:
118
+ 'https://d2rxhdlm2q91uk.cloudfront.net/TVik9uTMgE/6JQEIPeStt/e77c81a7-f6ef-4eae-91fc-b620d092d8d6/e77c81a7-f6ef-4eae-91fc-b620d092d8d6.mp4?Policy=eyJTdGF0ZW1lbnQiOlt7IlJlc291cmNlIjoiaHR0cHM6Ly9kMnJ4aGRsbTJxOTF1ay5jbG91ZGZyb250Lm5ldC9UVmlrOXVUTW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zP7xVYO3NbROscTPZ5tKnK9SVt2tnpdW0Aqxj1e2kH6WJhqwgxFfCDqDojMEesx-om71R99U0hMjwDHUF~EDEk6L6wrmD0OfXxbeKd-g5FoTPdJg__',
121
+ thumbnail:
122
+ 'https://d2rxhdlm2q91uk.cloudfront.net/TVik9uTMgE/6JQEIPeStt/e77c81a7-f6ef-4eae-91fc-b620d092d8d6/e77c81a7-f6ef-4eae-91fc-b620d092d8d6_poster.0000001.jpg?Policy=eyJTdGF0ZW1lbnQiOlt7IlJlc291cmNlIjoiaHR0cHM6Ly9kMnJ4aGRsbTJxOTF1ay5jbG91ZGZyb250Lm5ldC9UVmlrOXVUTWdFLyoiLCJDb25kaXRpb24iOnsiRGF0ZUxlc3NUaGFuIjp7IkFXUzpFcG9jaFRpbWUiOjIwMTYzMjM0Mjl9fX1dfQ__&Key-Pair-Id=K2SWKOH0FA5F6M&Signature=SGA54MFpy4jaqKJHKEuxRfjk-~NBFAh1tdW9Y6uYJwc0LFjDDgX1sraerSyohmVhj~-QVIrglY5BvglDIhrFcLJWGTkgj4vhyLprk1a7EDckv0HBgp-k1ZKvoDtt3wBOzrL4GicfXBkuMpIu5jv5MY3xemlJj2a6V~h65XJuLO4u-xS~McH6rS3mRxoNl4GcYUVm4upre1DGQx-5Suy6Ateoxl6xxoF8kg5EL02KxkIGiRpwXJTvVmUuVF0rpBj-IE40MfmhLBQ1NNSXiqb3-HjpkKwhYPvB5APVh23mzGmqJ0P3jbr2F1cU4Jvlqsjb6GVP61wGOz9ITeWPZkOy8A__'
123
+ },
124
+ client: {
125
+ id: '03540d70-1c75-4867-a235-bac842ed6ce4',
126
+ name: 'Vouch',
127
+ logoSrc: 'https://logo.clearbit.com/vouchfor.com?size=260'
128
+ },
129
+ contact: {
130
+ id: 'b62f62a3-0cd4-4512-9b52-121cb2f3e72f',
131
+ name: 'Aaron Williams',
132
+ roleTitle: 'Software Engineer'
133
+ },
134
+ captions: {
135
+ current:
136
+ 'WEBVTT\r\n\r\n1\r\n00:00:00.709 --> 00:00:03.059\r\npriorities for this business. Uh, for\r\n\r\n2\r\n00:00:03.069 --> 00:00:06.010\r\nthis quarter, uh, to make more money,\r\n\r\n3\r\n00:00:06.019 --> 00:00:09.050\r\nmore profits, Uh, get everything, uh,\r\n\r\n4\r\n00:00:09.069 --> 00:00:13.439\r\nswept away. All our heuristics should be\r\n\r\n5\r\n00:00:13.529 --> 00:00:15.119\r\ntop of the line.\r\n'
137
+ }
138
+ }
139
+ },
140
+ {
141
+ id: '39fd188d-a4dc-43b9-bac8-32fd71bfbc90',
142
+ title: 'What are your biggest pain points?',
143
+ answer: {
144
+ id: '39fd188d-a4dc-43b9-bac8-32fd71bfbc90',
145
+ label: null,
146
+ metadata: {
147
+ duration: 13.792
148
+ },
149
+ settings: {
150
+ endOffset: 0,
151
+ startOffset: 0
152
+ },
153
+ media: {
154
+ input:
155
+ 'https://d2rxhdlm2q91uk.cloudfront.net/TVik9uTMgE/6JQEIPeStt/39fd188d-a4dc-43b9-bac8-32fd71bfbc90/39fd188d-a4dc-43b9-bac8-32fd71bfbc90_input.mp4?Policy=eyJTdGF0ZW1lbnQiOlt7IlJlc291cmNlIjoiaHR0cHM6Ly9kMnJ4aGRsbTJxOTF1ay5jbG91ZGZyb250Lm5ldC9UVmlrOXVUTWdFLyoiLCJDb25kaXRpb24iOnsiRGF0ZUxlc3NUaGFuIjp7IkFXUzpFcG9jaFRpbWUiOjIwMTQ1NDI2MzV9fX1dfQ__&Key-Pair-Id=K2SWKOH0FA5F6M&Signature=vh-ZjBnHDhIIKRe4vr8GHppegY2VIRwXvC~QdX8aV9b5eylmQ~I~EmQ2MKwLOWuQ14DHOF~GU8oAfjXTMWgmZdeu1YzHkDHpQzi1b~NLgipJmpYe9-9OR67MC8jvNTva6OQ5PKsdN6tQBn9vWbBOP5gXEMZLtBP1tsopNu7ZpaUduyPiSVIH5VlWi~KRvMRZnQpHWxfVvnvvxifuk8bODDHh1Ba7MJxrAkdoskzP7xVYO3NbROscTPZ5tKnK9SVt2tnpdW0Aqxj1e2kH6WJhqwgxFfCDqDojMEesx-om71R99U0hMjwDHUF~EDEk6L6wrmD0OfXxbeKd-g5FoTPdJg__',
156
+ video:
157
+ 'https://d2rxhdlm2q91uk.cloudfront.net/TVik9uTMgE/6JQEIPeStt/39fd188d-a4dc-43b9-bac8-32fd71bfbc90/39fd188d-a4dc-43b9-bac8-32fd71bfbc90.mp4?Policy=eyJTdGF0ZW1lbnQiOlt7IlJlc291cmNlIjoiaHR0cHM6Ly9kMnJ4aGRsbTJxOTF1ay5jbG91ZGZyb250Lm5ldC9UVmlrOXVUTWdFLyoiLCJDb25kaXRpb24iOnsiRGF0ZUxlc3NUaGFuIjp7IkFXUzpFcG9jaFRpbWUiOjIwMTQ1NDI2MzV9fX1dfQ__&Key-Pair-Id=K2SWKOH0FA5F6M&Signature=vh-ZjBnHDhIIKRe4vr8GHppegY2VIRwXvC~QdX8aV9b5eylmQ~I~EmQ2MKwLOWuQ14DHOF~GU8oAfjXTMWgmZdeu1YzHkDHpQzi1b~NLgipJmpYe9-9OR67MC8jvNTva6OQ5PKsdN6tQBn9vWbBOP5gXEMZLtBP1tsopNu7ZpaUduyPiSVIH5VlWi~KRvMRZnQpHWxfVvnvvxifuk8bODDHh1Ba7MJxrAkdoskzP7xVYO3NbROscTPZ5tKnK9SVt2tnpdW0Aqxj1e2kH6WJhqwgxFfCDqDojMEesx-om71R99U0hMjwDHUF~EDEk6L6wrmD0OfXxbeKd-g5FoTPdJg__',
158
+ playlist:
159
+ 'https://d2rxhdlm2q91uk.cloudfront.net/TVik9uTMgE/6JQEIPeStt/39fd188d-a4dc-43b9-bac8-32fd71bfbc90/39fd188d-a4dc-43b9-bac8-32fd71bfbc90.m3u8?Policy=eyJTdGF0ZW1lbnQiOlt7IlJlc291cmNlIjoiaHR0cHM6Ly9kMnJ4aGRsbTJxOTF1ay5jbG91ZGZyb250Lm5ldC9UVmlrOXVUTWdFLyoiLCJDb25kaXRpb24iOnsiRG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IE40MfmhLBQ1NNSXiqb3-HjpkKwhYPvB5APVh23mzGmqJ0P3jbr2F1cU4Jvlqsjb6GVP61wGOz9ITeWPZkOy8A__'
162
+ },
163
+ client: {
164
+ id: '03540d70-1c75-4867-a235-bac842ed6ce4',
165
+ name: 'Vouch',
166
+ logoSrc: 'https://logo.clearbit.com/vouchfor.com?size=260'
167
+ },
168
+ contact: {
169
+ id: 'b62f62a3-0cd4-4512-9b52-121cb2f3e72f',
170
+ name: 'Aaron Williams',
171
+ roleTitle: 'Software Engineer'
172
+ },
173
+ captions: {
174
+ current:
175
+ "WEBVTT\r\n\r\n1\r\n00:00:00.790 --> 00:00:03.269\r\nuh, the biggest pain points this this\r\n\r\n2\r\n00:00:03.279 --> 00:00:07.170\r\nquarter. Um, Jerry has been doing the\r\n\r\n3\r\n00:00:07.179 --> 00:00:09.180\r\nworst work that he's ever been doing.\r\n\r\n4\r\n00:00:09.390 --> 00:00:11.680\r\nAnd we must fire him, Jerry. Goodbye,\r\n\r\n5\r\n00:00:11.689 --> 00:00:12.149\r\nJerry.\r\n"
176
+ }
177
+ }
178
+ }
179
+ ]
180
+ }
181
+ } as Vouch;
182
+
183
+ export { data };
package/src/index.ts CHANGED
@@ -1 +1,2 @@
1
- export { Embed } from '~/components/Embed';
1
+ export { PlayerEmbed } from '~/components/PlayerEmbed';
2
+ export { DialogEmbed } from '~/components/DialogEmbed';
@@ -1,433 +0,0 @@
1
- var I = Object.defineProperty;
2
- var q = (o, e, t) => e in o ? I(o, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : o[e] = t;
3
- var U = (o, e, t) => (q(o, typeof e != "symbol" ? e + "" : e, t), t);
4
- import { c as G, g as H } from "./index-9dd8a4fa.js";
5
- function J(o, e) {
6
- for (var t = 0; t < e.length; t++) {
7
- const r = e[t];
8
- if (typeof r != "string" && !Array.isArray(r)) {
9
- for (const n in r)
10
- if (n !== "default" && !(n in o)) {
11
- const i = Object.getOwnPropertyDescriptor(r, n);
12
- i && Object.defineProperty(o, n, i.get ? i : {
13
- enumerable: !0,
14
- get: () => r[n]
15
- });
16
- }
17
- }
18
- }
19
- return Object.freeze(Object.defineProperty(o, Symbol.toStringTag, { value: "Module" }));
20
- }
21
- function h(o) {
22
- if (typeof o != "string")
23
- throw new TypeError("Path must be a string. Received " + JSON.stringify(o));
24
- }
25
- function L(o, e) {
26
- for (var t = "", r = 0, n = -1, i = 0, a, s = 0; s <= o.length; ++s) {
27
- if (s < o.length)
28
- a = o.charCodeAt(s);
29
- else {
30
- if (a === 47)
31
- break;
32
- a = 47;
33
- }
34
- if (a === 47) {
35
- if (!(n === s - 1 || i === 1))
36
- if (n !== s - 1 && i === 2) {
37
- if (t.length < 2 || r !== 2 || t.charCodeAt(t.length - 1) !== 46 || t.charCodeAt(t.length - 2) !== 46) {
38
- if (t.length > 2) {
39
- var l = t.lastIndexOf("/");
40
- if (l !== t.length - 1) {
41
- l === -1 ? (t = "", r = 0) : (t = t.slice(0, l), r = t.length - 1 - t.lastIndexOf("/")), n = s, i = 0;
42
- continue;
43
- }
44
- } else if (t.length === 2 || t.length === 1) {
45
- t = "", r = 0, n = s, i = 0;
46
- continue;
47
- }
48
- }
49
- e && (t.length > 0 ? t += "/.." : t = "..", r = 2);
50
- } else
51
- t.length > 0 ? t += "/" + o.slice(n + 1, s) : t = o.slice(n + 1, s), r = s - n - 1;
52
- n = s, i = 0;
53
- } else
54
- a === 46 && i !== -1 ? ++i : i = -1;
55
- }
56
- return t;
57
- }
58
- function V(o, e) {
59
- var t = e.dir || e.root, r = e.base || (e.name || "") + (e.ext || "");
60
- return t ? t === e.root ? t + r : t + o + r : r;
61
- }
62
- var p = {
63
- // path.resolve([from ...], to)
64
- resolve: function() {
65
- for (var e = "", t = !1, r, n = arguments.length - 1; n >= -1 && !t; n--) {
66
- var i;
67
- n >= 0 ? i = arguments[n] : (r === void 0 && (r = process.cwd()), i = r), h(i), i.length !== 0 && (e = i + "/" + e, t = i.charCodeAt(0) === 47);
68
- }
69
- return e = L(e, !t), t ? e.length > 0 ? "/" + e : "/" : e.length > 0 ? e : ".";
70
- },
71
- normalize: function(e) {
72
- if (h(e), e.length === 0)
73
- return ".";
74
- var t = e.charCodeAt(0) === 47, r = e.charCodeAt(e.length - 1) === 47;
75
- return e = L(e, !t), e.length === 0 && !t && (e = "."), e.length > 0 && r && (e += "/"), t ? "/" + e : e;
76
- },
77
- isAbsolute: function(e) {
78
- return h(e), e.length > 0 && e.charCodeAt(0) === 47;
79
- },
80
- join: function() {
81
- if (arguments.length === 0)
82
- return ".";
83
- for (var e, t = 0; t < arguments.length; ++t) {
84
- var r = arguments[t];
85
- h(r), r.length > 0 && (e === void 0 ? e = r : e += "/" + r);
86
- }
87
- return e === void 0 ? "." : p.normalize(e);
88
- },
89
- relative: function(e, t) {
90
- if (h(e), h(t), e === t || (e = p.resolve(e), t = p.resolve(t), e === t))
91
- return "";
92
- for (var r = 1; r < e.length && e.charCodeAt(r) === 47; ++r)
93
- ;
94
- for (var n = e.length, i = n - r, a = 1; a < t.length && t.charCodeAt(a) === 47; ++a)
95
- ;
96
- for (var s = t.length, l = s - a, u = i < l ? i : l, c = -1, f = 0; f <= u; ++f) {
97
- if (f === u) {
98
- if (l > u) {
99
- if (t.charCodeAt(a + f) === 47)
100
- return t.slice(a + f + 1);
101
- if (f === 0)
102
- return t.slice(a + f);
103
- } else
104
- i > u && (e.charCodeAt(r + f) === 47 ? c = f : f === 0 && (c = 0));
105
- break;
106
- }
107
- var g = e.charCodeAt(r + f), v = t.charCodeAt(a + f);
108
- if (g !== v)
109
- break;
110
- g === 47 && (c = f);
111
- }
112
- var d = "";
113
- for (f = r + c + 1; f <= n; ++f)
114
- (f === n || e.charCodeAt(f) === 47) && (d.length === 0 ? d += ".." : d += "/..");
115
- return d.length > 0 ? d + t.slice(a + c) : (a += c, t.charCodeAt(a) === 47 && ++a, t.slice(a));
116
- },
117
- _makeLong: function(e) {
118
- return e;
119
- },
120
- dirname: function(e) {
121
- if (h(e), e.length === 0)
122
- return ".";
123
- for (var t = e.charCodeAt(0), r = t === 47, n = -1, i = !0, a = e.length - 1; a >= 1; --a)
124
- if (t = e.charCodeAt(a), t === 47) {
125
- if (!i) {
126
- n = a;
127
- break;
128
- }
129
- } else
130
- i = !1;
131
- return n === -1 ? r ? "/" : "." : r && n === 1 ? "//" : e.slice(0, n);
132
- },
133
- basename: function(e, t) {
134
- if (t !== void 0 && typeof t != "string")
135
- throw new TypeError('"ext" argument must be a string');
136
- h(e);
137
- var r = 0, n = -1, i = !0, a;
138
- if (t !== void 0 && t.length > 0 && t.length <= e.length) {
139
- if (t.length === e.length && t === e)
140
- return "";
141
- var s = t.length - 1, l = -1;
142
- for (a = e.length - 1; a >= 0; --a) {
143
- var u = e.charCodeAt(a);
144
- if (u === 47) {
145
- if (!i) {
146
- r = a + 1;
147
- break;
148
- }
149
- } else
150
- l === -1 && (i = !1, l = a + 1), s >= 0 && (u === t.charCodeAt(s) ? --s === -1 && (n = a) : (s = -1, n = l));
151
- }
152
- return r === n ? n = l : n === -1 && (n = e.length), e.slice(r, n);
153
- } else {
154
- for (a = e.length - 1; a >= 0; --a)
155
- if (e.charCodeAt(a) === 47) {
156
- if (!i) {
157
- r = a + 1;
158
- break;
159
- }
160
- } else
161
- n === -1 && (i = !1, n = a + 1);
162
- return n === -1 ? "" : e.slice(r, n);
163
- }
164
- },
165
- extname: function(e) {
166
- h(e);
167
- for (var t = -1, r = 0, n = -1, i = !0, a = 0, s = e.length - 1; s >= 0; --s) {
168
- var l = e.charCodeAt(s);
169
- if (l === 47) {
170
- if (!i) {
171
- r = s + 1;
172
- break;
173
- }
174
- continue;
175
- }
176
- n === -1 && (i = !1, n = s + 1), l === 46 ? t === -1 ? t = s : a !== 1 && (a = 1) : t !== -1 && (a = -1);
177
- }
178
- return t === -1 || n === -1 || // We saw a non-dot character immediately before the dot
179
- a === 0 || // The (right-most) trimmed path component is exactly '..'
180
- a === 1 && t === n - 1 && t === r + 1 ? "" : e.slice(t, n);
181
- },
182
- format: function(e) {
183
- if (e === null || typeof e != "object")
184
- throw new TypeError('The "pathObject" argument must be of type Object. Received type ' + typeof e);
185
- return V("/", e);
186
- },
187
- parse: function(e) {
188
- h(e);
189
- var t = { root: "", dir: "", base: "", ext: "", name: "" };
190
- if (e.length === 0)
191
- return t;
192
- var r = e.charCodeAt(0), n = r === 47, i;
193
- n ? (t.root = "/", i = 1) : i = 0;
194
- for (var a = -1, s = 0, l = -1, u = !0, c = e.length - 1, f = 0; c >= i; --c) {
195
- if (r = e.charCodeAt(c), r === 47) {
196
- if (!u) {
197
- s = c + 1;
198
- break;
199
- }
200
- continue;
201
- }
202
- l === -1 && (u = !1, l = c + 1), r === 46 ? a === -1 ? a = c : f !== 1 && (f = 1) : a !== -1 && (f = -1);
203
- }
204
- return a === -1 || l === -1 || // We saw a non-dot character immediately before the dot
205
- f === 0 || // The (right-most) trimmed path component is exactly '..'
206
- f === 1 && a === l - 1 && a === s + 1 ? l !== -1 && (s === 0 && n ? t.base = t.name = e.slice(1, l) : t.base = t.name = e.slice(s, l)) : (s === 0 && n ? (t.name = e.slice(1, a), t.base = e.slice(1, l)) : (t.name = e.slice(s, a), t.base = e.slice(s, l)), t.ext = e.slice(a, l)), s > 0 ? t.dir = e.slice(0, s - 1) : n && (t.dir = "/"), t;
207
- },
208
- sep: "/",
209
- delimiter: ":",
210
- win32: null,
211
- posix: null
212
- };
213
- p.posix = p;
214
- var W = p;
215
- const { basename: B, extname: Y } = W;
216
- class Z {
217
- constructor() {
218
- let e = (() => typeof G > "u")(), t = "image/png", r = "image/jpeg", n = "image/jpeg", i = "image/webp", a = "application/pdf", s = "image/svg+xml";
219
- Object.assign(this, {
220
- toMime: this.toMime.bind(this),
221
- fromMime: this.fromMime.bind(this),
222
- expected: e ? '"png", "jpg", or "webp"' : '"png", "jpg", "pdf", or "svg"',
223
- formats: e ? { png: t, jpg: r, jpeg: n, webp: i } : { png: t, jpg: r, jpeg: n, pdf: a, svg: s },
224
- mimes: e ? { [t]: "png", [r]: "jpg", [i]: "webp" } : { [t]: "png", [r]: "jpg", [a]: "pdf", [s]: "svg" }
225
- });
226
- }
227
- toMime(e) {
228
- return this.formats[(e || "").replace(/^\./, "").toLowerCase()];
229
- }
230
- fromMime(e) {
231
- return this.mimes[e];
232
- }
233
- }
234
- function K(o, { filename: e = "", extension: t = "", format: m, page: n, quality: i, matte: a, density: s, outline: l, archive: v } = {}) {
235
- var { fromMime: c, toMime: f, expected: g } = new Z(), v = v || "canvas", d = m || t.replace(/@\d+x$/i, "") || Y(e), m = c(f(d) || d), y = f(m), b = o.length;
236
- if (!d)
237
- throw new Error("Cannot determine image format (use a filename extension or 'format' argument)");
238
- if (!m)
239
- throw new Error(`Unsupported file format "${d}" (expected ${g})`);
240
- if (!b)
241
- throw new RangeError("Canvas has no associated contexts (try calling getContext or newPage first)");
242
- let C, E, z = e.replace(/{(\d*)}/g, (D, A) => (E = !0, A = parseInt(A, 10), C = isFinite(A) ? A : isFinite(C) ? C : -1, "{}")), w = n > 0 ? n - 1 : n < 0 ? b + n : void 0;
243
- if (isFinite(w) && w < 0 || w >= b)
244
- throw new RangeError(
245
- b == 1 ? `Canvas only has a ‘page 1’ (${w} is out of bounds)` : `Canvas has pages 1–${b} (${w} is out of bounds)`
246
- );
247
- if (o = isFinite(w) ? [o[w]] : E || m == "pdf" ? o : o.slice(-1), i === void 0)
248
- i = 0.92;
249
- else if (typeof i != "number" || !isFinite(i) || i < 0 || i > 1)
250
- throw new TypeError("The quality option must be an number in the 0.0–1.0 range");
251
- if (s === void 0) {
252
- let D = (t || B(e, d)).match(/@(\d+)x$/i);
253
- s = D ? parseInt(D[1], 10) : 1;
254
- } else if (typeof s != "number" || !Number.isInteger(s) || s < 1)
255
- throw new TypeError("The density option must be a non-negative integer");
256
- return l === void 0 ? l = !0 : m == "svg" && (l = !!l), { filename: e, pattern: z, format: m, mime: y, pages: o, padding: C, quality: i, matte: a, density: s, outline: l, archive: v };
257
- }
258
- class j {
259
- static for(e) {
260
- return new j().append(e).get();
261
- }
262
- constructor() {
263
- this.crc = -1;
264
- }
265
- get() {
266
- return ~this.crc;
267
- }
268
- append(e) {
269
- for (var t = this.crc | 0, r = this.table, n = 0, i = e.length | 0; n < i; n++)
270
- t = t >>> 8 ^ r[(t ^ e[n]) & 255];
271
- return this.crc = t, this;
272
- }
273
- }
274
- j.prototype.table = (() => {
275
- var o, e, t, r = [];
276
- for (o = 0; o < 256; o++) {
277
- for (t = o, e = 0; e < 8; e++)
278
- t = t & 1 ? t >>> 1 ^ 3988292384 : t >>> 1;
279
- r[o] = t;
280
- }
281
- return r;
282
- })();
283
- function S(o) {
284
- let e = new Uint8Array(o), t = new DataView(e.buffer), r = {
285
- array: e,
286
- view: t,
287
- size: o,
288
- set8(n, i) {
289
- return t.setUint8(n, i), r;
290
- },
291
- set16(n, i) {
292
- return t.setUint16(n, i, !0), r;
293
- },
294
- set32(n, i) {
295
- return t.setUint32(n, i, !0), r;
296
- },
297
- bytes(n, i) {
298
- return e.set(i, n), r;
299
- }
300
- };
301
- return r;
302
- }
303
- const x = class x {
304
- constructor(e) {
305
- let t = /* @__PURE__ */ new Date();
306
- Object.assign(this, {
307
- directory: e,
308
- offset: 0,
309
- files: [],
310
- time: (t.getHours() << 6 | t.getMinutes()) << 5 | t.getSeconds() / 2,
311
- date: (t.getFullYear() - 1980 << 4 | t.getMonth() + 1) << 5 | t.getDate()
312
- }), this.add(e);
313
- }
314
- async add(e, t) {
315
- let r = !t, n = x.encoder.encode(`${this.directory}/${r ? "" : e}`), i = new Uint8Array(r ? 0 : await t.arrayBuffer()), a = 30 + n.length, s = a + i.length, l = 16, { offset: u } = this, c = S(26).set32(0, 134742036).set16(6, this.time).set16(8, this.date).set32(10, j.for(i)).set32(14, i.length).set32(18, i.length).set16(22, n.length);
316
- u += a;
317
- let f = S(a + i.length + l).set32(0, 67324752).bytes(4, c.array).bytes(30, n).bytes(a, i);
318
- u += i.length, f.set32(s, 134695760).bytes(s + 4, c.array.slice(10, 22)), u += l, this.files.push({ offset: u, folder: r, name: n, header: c, payload: f }), this.offset = u;
319
- }
320
- toBuffer() {
321
- let e = this.files.reduce((f, { name: g }) => 46 + g.length + f, 0), t = S(e + 22), r = 0;
322
- for (var { offset: n, name: i, header: a, folder: s } of this.files)
323
- t.set32(r, 33639248).set16(r + 4, 20).bytes(r + 6, a.array).set8(r + 38, s ? 16 : 0).set32(r + 42, n).bytes(r + 46, i), r += 46 + i.length;
324
- t.set32(r, 101010256).set16(r + 8, this.files.length).set16(r + 10, this.files.length).set32(r + 12, e).set32(r + 16, this.offset);
325
- let l = new Uint8Array(this.offset + t.size), u = 0;
326
- for (var { payload: c } of this.files)
327
- l.set(c.array, u), u += c.size;
328
- return l.set(t.array, u), l;
329
- }
330
- get blob() {
331
- return new Blob([this.toBuffer()], { type: "application/zip" });
332
- }
333
- };
334
- U(x, "encoder", new TextEncoder());
335
- let k = x;
336
- const $ = (o, e, t, r) => {
337
- if (r) {
338
- let { width: n, height: i } = o, a = Object.assign(document.createElement("canvas"), { width: n, height: i }), s = a.getContext("2d");
339
- s.fillStyle = r, s.fillRect(0, 0, n, i), s.drawImage(o, 0, 0), o = a;
340
- }
341
- return new Promise((n, i) => o.toBlob(n, e, t));
342
- }, N = (...o) => $(...o).then((e) => e.arrayBuffer()), Q = async (o, e, t, r, n) => {
343
- T(n, await $(o, e, t, r));
344
- }, X = async (o, e, t, r, n, i, a) => {
345
- let s = (c) => i.replace("{}", String(c + 1).padStart(a, "0")), l = B(n, ".zip") || "archive", u = new k(l);
346
- await Promise.all(o.map(async (c, f) => {
347
- let g = s(f);
348
- await u.add(g, await $(c, e, t, r));
349
- })), T(`${l}.zip`, u.blob);
350
- }, T = (o, e) => {
351
- const t = window.URL.createObjectURL(e), r = document.createElement("a");
352
- r.style.display = "none", r.href = t, r.setAttribute("download", o), typeof r.download > "u" && r.setAttribute("target", "_blank"), document.body.appendChild(r), r.click(), document.body.removeChild(r), setTimeout(() => window.URL.revokeObjectURL(t), 100);
353
- }, ee = (o, e, t) => o.map((r) => {
354
- if (e == 1 && !t)
355
- return r.canvas;
356
- let n = document.createElement("canvas"), i = n.getContext("2d"), a = r.canvas ? r.canvas : r;
357
- return n.width = a.width * e, n.height = a.height * e, t && (i.fillStyle = t, i.fillRect(0, 0, n.width, n.height)), i.scale(e, e), i.drawImage(a, 0, 0), n;
358
- });
359
- var te = { asBuffer: N, asDownload: Q, asZipDownload: X, atScale: ee, options: K };
360
- const { asBuffer: P, asDownload: re, asZipDownload: ne, atScale: O, options: R } = te, M = Symbol.for("toDataURL"), ie = (o) => {
361
- let e = Object.assign(new F(), { crossOrigin: "Anonymous", src: o });
362
- return e.decode().then(() => e);
363
- };
364
- class ae {
365
- constructor(e, t) {
366
- let r = document.createElement("canvas"), n = [];
367
- Object.defineProperty(r, "async", { value: !0, writable: !1, enumerable: !0 });
368
- for (var [i, a] of Object.entries({
369
- png: () => P(r, "image/png"),
370
- jpg: () => P(r, "image/jpeg"),
371
- pages: () => n.concat(r).map((s) => s.getContext("2d"))
372
- }))
373
- Object.defineProperty(r, i, { get: a });
374
- return Object.assign(r, {
375
- width: e,
376
- height: t,
377
- newPage(...s) {
378
- var { width: u, height: c } = r, l = Object.assign(document.createElement("canvas"), { width: u, height: c });
379
- l.getContext("2d").drawImage(r, 0, 0), n.push(l);
380
- var [u, c] = s.length ? s : [u, c];
381
- return Object.assign(r, { width: u, height: c }).getContext("2d");
382
- },
383
- saveAs(s, l) {
384
- l = typeof l == "number" ? { quality: l } : l;
385
- let u = R(this.pages, { filename: s, ...l }), { pattern: c, padding: f, mime: g, quality: v, matte: d, density: m, archive: y } = u, b = O(u.pages, m);
386
- return f == null ? re(b[0], g, v, d, s) : ne(b, g, v, d, y, c, f);
387
- },
388
- toBuffer(s = "png", l = {}) {
389
- l = typeof l == "number" ? { quality: l } : l;
390
- let u = R(this.pages, { extension: s, ...l }), { mime: c, quality: f, matte: g, pages: v, density: d } = u, m = O(v, d, g)[0];
391
- return P(m, c, f, g);
392
- },
393
- [M]: r.toDataURL.bind(r),
394
- toDataURL(s = "png", l = {}) {
395
- l = typeof l == "number" ? { quality: l } : l;
396
- let u = R(this.pages, { extension: s, ...l }), { mime: c, quality: f, matte: g, pages: v, density: d } = u, m = O(v, d, g)[0], y = m[m === r ? M : "toDataURL"](c, f);
397
- return Promise.resolve(y);
398
- }
399
- });
400
- }
401
- }
402
- const {
403
- CanvasRenderingContext2D: se,
404
- CanvasGradient: oe,
405
- CanvasPattern: le,
406
- Image: F,
407
- ImageData: fe,
408
- Path2D: ce,
409
- DOMMatrix: ue,
410
- DOMRect: de,
411
- DOMPoint: ge
412
- } = window;
413
- var _ = {
414
- Canvas: ae,
415
- loadImage: ie,
416
- CanvasRenderingContext2D: se,
417
- CanvasGradient: oe,
418
- CanvasPattern: le,
419
- Image: F,
420
- ImageData: fe,
421
- Path2D: ce,
422
- DOMMatrix: ue,
423
- DOMRect: de,
424
- DOMPoint: ge
425
- };
426
- const me = /* @__PURE__ */ H(_), be = /* @__PURE__ */ J({
427
- __proto__: null,
428
- default: me
429
- }, [_]);
430
- export {
431
- be as b
432
- };
433
- //# sourceMappingURL=browser-95c87c48.js.map