@kanorio/elements 0.0.0-stage → 1.0.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.
Files changed (274) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +57 -2
  3. package/dist/MediaPlayer-MWIDJORE.js +2 -0
  4. package/dist/MediaPlayer-STITRANS.js +13 -0
  5. package/dist/PDFViewerFull-HIUSAO57.js +13 -0
  6. package/dist/PDFViewerFull-L7VMOAMU.js +28062 -0
  7. package/dist/altcha-DSOKKAAV.js +3153 -0
  8. package/dist/altcha-FLBUR2LJ.js +4 -0
  9. package/dist/ar-4CBE4BWH.js +1233 -0
  10. package/dist/ar-6G7ZVSQ3.js +2 -0
  11. package/dist/ar-XCPH4WO5.js +98 -0
  12. package/dist/ar-ZVJL6XGE.js +2 -0
  13. package/dist/bg-4WPFSAMC.js +2 -0
  14. package/dist/bg-BKFL64I6.js +98 -0
  15. package/dist/bg-CB273F4D.js +1233 -0
  16. package/dist/bg-HCH4LMEX.js +2 -0
  17. package/dist/bn-HLYDEXHQ.js +1233 -0
  18. package/dist/bn-HVEVBAGM.js +98 -0
  19. package/dist/bn-OY7YGJIT.js +2 -0
  20. package/dist/bn-XX3O4VQB.js +2 -0
  21. package/dist/chunk-2UBPQBQI.js +1848 -0
  22. package/dist/chunk-5OB57Z46.js +23620 -0
  23. package/dist/chunk-6LJZ4HRF.js +1350 -0
  24. package/dist/chunk-6TUB24LJ.js +415 -0
  25. package/dist/chunk-74RRJOB4.js +15 -0
  26. package/dist/chunk-7TNRMVML.js +2 -0
  27. package/dist/chunk-BH27SBYG.js +2 -0
  28. package/dist/chunk-BQU7QZGC.js +4 -0
  29. package/dist/chunk-CHSZMJ5D.js +15103 -0
  30. package/dist/chunk-DDKQOHPW.js +930 -0
  31. package/dist/chunk-E5ZVE4VL.js +5 -0
  32. package/dist/chunk-FGBB7FT5.js +4 -0
  33. package/dist/chunk-FSH5K5FU.js +57 -0
  34. package/dist/chunk-G3PMV62Z.js +36 -0
  35. package/dist/chunk-IUB5YLUU.js +1538 -0
  36. package/dist/chunk-J7AP6FJF.js +8616 -0
  37. package/dist/chunk-LKOMEUNH.js +72 -0
  38. package/dist/chunk-NB57OIQA.js +2 -0
  39. package/dist/chunk-NLJE74VA.js +2 -0
  40. package/dist/chunk-NQBPWU5Z.js +15 -0
  41. package/dist/chunk-OJQYDPRD.js +39 -0
  42. package/dist/chunk-PDKFEXLU.js +59 -0
  43. package/dist/chunk-POG53MIA.js +2 -0
  44. package/dist/chunk-PXABHOW4.js +10871 -0
  45. package/dist/chunk-QDUG7UMV.js +363 -0
  46. package/dist/chunk-RFBBAUMM.js +2 -0
  47. package/dist/chunk-RJTKNOYT.js +67 -0
  48. package/dist/chunk-VH4656UY.js +2 -0
  49. package/dist/chunk-XAORGJWX.js +2 -0
  50. package/dist/chunk-Y77XXKLY.js +1858 -0
  51. package/dist/cs-EDLILQAV.js +1233 -0
  52. package/dist/cs-EOBDWVFI.js +2 -0
  53. package/dist/cs-Q732FDDB.js +98 -0
  54. package/dist/cs-UO3FC3H4.js +2 -0
  55. package/dist/da-43RMOYSN.js +98 -0
  56. package/dist/da-ANHSL3GD.js +2 -0
  57. package/dist/da-RBW34GCF.js +2 -0
  58. package/dist/da-SJ7YQT4L.js +1233 -0
  59. package/dist/de-2D2GW24Z.js +2 -0
  60. package/dist/de-5WGC4CMF.js +1233 -0
  61. package/dist/de-CPU2ARG7.js +98 -0
  62. package/dist/de-GVWNGUWZ.js +2 -0
  63. package/dist/deliverables-QUJISOBO.js +98 -0
  64. package/dist/deliverables-Z6ZBT6D3.js +2046 -0
  65. package/dist/el-FRNBHLQF.js +98 -0
  66. package/dist/el-HCBWOOCJ.js +1233 -0
  67. package/dist/el-KK7DBDUW.js +2 -0
  68. package/dist/el-SK362ZEN.js +2 -0
  69. package/dist/elements.css +2 -0
  70. package/dist/en-AU-BQA3DX35.js +1233 -0
  71. package/dist/en-AU-VZAXNXRA.js +2 -0
  72. package/dist/en-CA-T2VRZJVQ.js +2 -0
  73. package/dist/en-CA-ZWY5HD2Z.js +1233 -0
  74. package/dist/en-GB-CH3IGZSE.js +1233 -0
  75. package/dist/en-GB-MZQ2MGOR.js +2 -0
  76. package/dist/en-M24TV37U.js +2 -0
  77. package/dist/en-OURP64TI.js +2 -0
  78. package/dist/en-US-VWMNQOMN.js +2 -0
  79. package/dist/en-US-WJZ2OBFI.js +1233 -0
  80. package/dist/en-USCPKTM6.js +1233 -0
  81. package/dist/en-YND44PUO.js +98 -0
  82. package/dist/errors-7SQHRWKX.js +77 -0
  83. package/dist/errors-S6NFCUG2.js +2 -0
  84. package/dist/es-419-EMD4NA5M.js +2 -0
  85. package/dist/es-419-GPBJSXLV.js +2 -0
  86. package/dist/es-419-S6IHEZ4E.js +1233 -0
  87. package/dist/es-419-XPZOWYCA.js +98 -0
  88. package/dist/es-ES-EGMSPSY2.js +1233 -0
  89. package/dist/es-ES-U6NF6JHU.js +2 -0
  90. package/dist/es-es-ILD7QLKC.js +98 -0
  91. package/dist/es-es-MPX25JA6.js +2 -0
  92. package/dist/fa-5J3M6LW4.js +2 -0
  93. package/dist/fa-OC7ZPRF2.js +98 -0
  94. package/dist/fa-OFIO7IXD.js +1233 -0
  95. package/dist/fa-ZTPM4LEB.js +2 -0
  96. package/dist/fi-2V2STXSQ.js +2 -0
  97. package/dist/fi-7J4LPMG2.js +98 -0
  98. package/dist/fi-FMEAITYP.js +1233 -0
  99. package/dist/fi-N3BC4FYB.js +2 -0
  100. package/dist/fr-CA-IKSBTBHG.js +2 -0
  101. package/dist/fr-CA-S23ERMPM.js +1233 -0
  102. package/dist/fr-FR-RRTMSQWD.js +2 -0
  103. package/dist/fr-FR-SOIXFVK2.js +1233 -0
  104. package/dist/fr-ca-SUWTTOEW.js +2 -0
  105. package/dist/fr-ca-UUHAWMHI.js +98 -0
  106. package/dist/fr-fr-SGQ77PBC.js +98 -0
  107. package/dist/fr-fr-XE2V7MKM.js +2 -0
  108. package/dist/gu-RT7GQT5B.js +2 -0
  109. package/dist/gu-Z2QX2VCX.js +1233 -0
  110. package/dist/he-27MBDHSP.js +2 -0
  111. package/dist/he-E7RIZOIT.js +1233 -0
  112. package/dist/he-QGD477CH.js +98 -0
  113. package/dist/he-R3UJFF46.js +2 -0
  114. package/dist/hi-2AVAXR7K.js +1233 -0
  115. package/dist/hi-6ZBMVMGH.js +2 -0
  116. package/dist/hi-SGQH4OWG.js +98 -0
  117. package/dist/hi-XJHFN25N.js +2 -0
  118. package/dist/hls-C5FWCMHH.js +37426 -0
  119. package/dist/hls-ZQNRY2TQ.js +45 -0
  120. package/dist/hu-IOGZTF7L.js +2 -0
  121. package/dist/hu-KNZXJ7ZI.js +98 -0
  122. package/dist/hu-ORVGO3ZY.js +1233 -0
  123. package/dist/hu-PKL3T3JT.js +2 -0
  124. package/dist/id-FKFVQIN6.js +2 -0
  125. package/dist/id-JH2DLDBA.js +98 -0
  126. package/dist/id-TMOJUCBD.js +1233 -0
  127. package/dist/id-WLBO2VOW.js +2 -0
  128. package/dist/index.d.ts +2955 -0
  129. package/dist/index.js +67 -0
  130. package/dist/it-AGUEDSVA.js +2 -0
  131. package/dist/it-PJAB5BQB.js +98 -0
  132. package/dist/it-WF5BTFFJ.js +2 -0
  133. package/dist/it-YMZRYSIJ.js +1233 -0
  134. package/dist/ja-2ZVND7MB.js +2 -0
  135. package/dist/ja-555SY4AF.js +1233 -0
  136. package/dist/ja-RMBJ7E5Z.js +2 -0
  137. package/dist/ja-ZKBUQDUT.js +98 -0
  138. package/dist/kanorio-elements.js +97 -0
  139. package/dist/km-DF366BBP.js +1233 -0
  140. package/dist/km-JIUQ7MSM.js +2 -0
  141. package/dist/kn-KTJPREMQ.js +2 -0
  142. package/dist/kn-MJKASLJD.js +1233 -0
  143. package/dist/ko-CGY75OW4.js +2 -0
  144. package/dist/ko-KECCYX66.js +2 -0
  145. package/dist/ko-L5735TRU.js +98 -0
  146. package/dist/ko-S3OTZKIG.js +1233 -0
  147. package/dist/lo-7R55FKUB.js +1233 -0
  148. package/dist/lo-DNWTAFYF.js +2 -0
  149. package/dist/ml-B4BJPFVQ.js +2 -0
  150. package/dist/ml-FCTNQ4SP.js +1233 -0
  151. package/dist/mr-FJ4EDO7F.js +2 -0
  152. package/dist/mr-TZTFABWX.js +2 -0
  153. package/dist/mr-VZ5Y74YA.js +1233 -0
  154. package/dist/mr-Y464JCKX.js +98 -0
  155. package/dist/ms-VCX47GHB.js +2 -0
  156. package/dist/ms-WAJKD7ZV.js +1233 -0
  157. package/dist/my-S5L32WDK.js +2 -0
  158. package/dist/my-T7Y3Y64H.js +1233 -0
  159. package/dist/nb-53GCFBHF.js +2 -0
  160. package/dist/nb-IJDALVGX.js +99 -0
  161. package/dist/nb-LXBBUZUD.js +1233 -0
  162. package/dist/nb-PWWLEFUC.js +2 -0
  163. package/dist/ne-F7EEIDMA.js +2 -0
  164. package/dist/ne-NDLRKG6T.js +1233 -0
  165. package/dist/nl-262SKC6R.js +98 -0
  166. package/dist/nl-BE-3KOYUD6Y.js +1233 -0
  167. package/dist/nl-BE-VZJDK6CH.js +2 -0
  168. package/dist/nl-NL-3OIKN2DQ.js +2 -0
  169. package/dist/nl-NL-T7SQOLLA.js +1233 -0
  170. package/dist/nl-XKCUNU3P.js +2 -0
  171. package/dist/nn-AHWRAFXZ.js +1233 -0
  172. package/dist/nn-YH7F7UK3.js +2 -0
  173. package/dist/pa-HC24FOUI.js +2 -0
  174. package/dist/pa-J26C5J7M.js +1233 -0
  175. package/dist/pl-QSTOYTPG.js +1233 -0
  176. package/dist/pl-T7J6A26Y.js +2 -0
  177. package/dist/pl-TYHET6JJ.js +2 -0
  178. package/dist/pl-XDJJ6AUG.js +98 -0
  179. package/dist/prod-MRWX5W24.js +38 -0
  180. package/dist/prod-YHXWTKNF.js +2 -0
  181. package/dist/pt-BR-4QRR4PXU.js +2 -0
  182. package/dist/pt-BR-7JM75AGX.js +1233 -0
  183. package/dist/pt-PT-W3WZEROD.js +1233 -0
  184. package/dist/pt-PT-Z5FI4CLF.js +2 -0
  185. package/dist/pt-br-2W4P4ZAJ.js +2 -0
  186. package/dist/pt-br-JP6VI5C5.js +98 -0
  187. package/dist/pt-pt-22LJFZT5.js +98 -0
  188. package/dist/pt-pt-HOBFIPWZ.js +2 -0
  189. package/dist/ro-3KXIEYVK.js +98 -0
  190. package/dist/ro-3YUPB2TJ.js +1233 -0
  191. package/dist/ro-JXHNIBOA.js +2 -0
  192. package/dist/ro-KHPOLQC6.js +2 -0
  193. package/dist/ru-5ZVLKPFN.js +2 -0
  194. package/dist/ru-ASND25AB.js +2 -0
  195. package/dist/ru-ATGZC5LB.js +1233 -0
  196. package/dist/ru-W44AHOIC.js +98 -0
  197. package/dist/si-RHXLIDQI.js +1233 -0
  198. package/dist/si-U3O6NRHE.js +2 -0
  199. package/dist/srt-parser-6DEDUV5P.js +43 -0
  200. package/dist/srt-parser-E666S3YO.js +3 -0
  201. package/dist/ssa-parser-5GJ737XF.js +309 -0
  202. package/dist/ssa-parser-BR3CTDHR.js +5 -0
  203. package/dist/sv-5LOOKXJA.js +98 -0
  204. package/dist/sv-6GKNCPMS.js +2 -0
  205. package/dist/sv-LL3HMUIA.js +1233 -0
  206. package/dist/sv-RRJ6LYFT.js +2 -0
  207. package/dist/sw-HBNHIHPG.js +2 -0
  208. package/dist/sw-HP7MYGQ5.js +1233 -0
  209. package/dist/sw-NTSCFQXY.js +2 -0
  210. package/dist/sw-YIUB7QN3.js +98 -0
  211. package/dist/ta-4RG3PWN5.js +98 -0
  212. package/dist/ta-ARSNSDK5.js +2 -0
  213. package/dist/ta-Q2LBTDH6.js +2 -0
  214. package/dist/ta-Z5EVUBYF.js +1233 -0
  215. package/dist/te-FAWIFHVW.js +2 -0
  216. package/dist/te-FXJYUGGL.js +98 -0
  217. package/dist/te-GDV3DJFJ.js +1233 -0
  218. package/dist/te-TIMB7HBY.js +2 -0
  219. package/dist/th-7CEFYE5H.js +2 -0
  220. package/dist/th-CFAEFK3E.js +1233 -0
  221. package/dist/th-KGPTXFIF.js +2 -0
  222. package/dist/th-TC6J25FB.js +98 -0
  223. package/dist/tl-2JDK2CBL.js +2 -0
  224. package/dist/tl-SGZM4XSX.js +1233 -0
  225. package/dist/tr-27OEWIPE.js +1233 -0
  226. package/dist/tr-2MEHQO75.js +98 -0
  227. package/dist/tr-7P2UAX7U.js +2 -0
  228. package/dist/tr-NKD6C4RY.js +2 -0
  229. package/dist/uk-CXQISVJP.js +2 -0
  230. package/dist/uk-EJIGGLKY.js +1233 -0
  231. package/dist/uk-JCI3UE6Q.js +98 -0
  232. package/dist/uk-QM5BBWP7.js +2 -0
  233. package/dist/ur-5EWYHPME.js +1233 -0
  234. package/dist/ur-IIOUQYSA.js +98 -0
  235. package/dist/ur-M3QWGAPF.js +2 -0
  236. package/dist/ur-TLLPXSTM.js +2 -0
  237. package/dist/vi-AXQYYRD3.js +2 -0
  238. package/dist/vi-JALLXYS7.js +1233 -0
  239. package/dist/vi-SS65KZTI.js +2 -0
  240. package/dist/vi-YQVNQEVG.js +98 -0
  241. package/dist/vidstack-B9fTkxQO-LJP5ADOO.js +215 -0
  242. package/dist/vidstack-B9fTkxQO-OCT23G55.js +2 -0
  243. package/dist/vidstack-BmcqUMKx-A2W3TQB6.js +2 -0
  244. package/dist/vidstack-BmcqUMKx-G6TB22IC.js +286 -0
  245. package/dist/vidstack-C0fPJIzs-7AH6MOHO.js +2 -0
  246. package/dist/vidstack-C0fPJIzs-PNQOR4TK.js +11 -0
  247. package/dist/vidstack-CHcsWfRV-UAVLHO6N.js +40 -0
  248. package/dist/vidstack-CHcsWfRV-V52LFHYG.js +2 -0
  249. package/dist/vidstack-CvezEmSQ-JXKCQ4VQ.js +2 -0
  250. package/dist/vidstack-CvezEmSQ-R32NZKJ2.js +130 -0
  251. package/dist/vidstack-D2vrrUMs-7XAY5IBS.js +2 -0
  252. package/dist/vidstack-D2vrrUMs-FNQR2A5M.js +467 -0
  253. package/dist/vidstack-Di0HObvT-6ND3AXWZ.js +112 -0
  254. package/dist/vidstack-Di0HObvT-ZV7XK2OT.js +2 -0
  255. package/dist/vidstack-DiaLSJYx-H762DXYG.js +2 -0
  256. package/dist/vidstack-DiaLSJYx-S7DDW2H3.js +380 -0
  257. package/dist/vidstack-Dy74GavT-EYLL6MEF.js +2 -0
  258. package/dist/vidstack-Dy74GavT-XNIJ7PF4.js +11 -0
  259. package/dist/vidstack-GkTzay8D-C7EJKMV4.js +2 -0
  260. package/dist/vidstack-GkTzay8D-SQU5IF3P.js +482 -0
  261. package/dist/web-components.d.ts +12 -0
  262. package/dist/web-components.js +123 -0
  263. package/dist/worker.js +1 -0
  264. package/dist/zh-CN-PVVDP25S.js +2 -0
  265. package/dist/zh-CN-TLPNCXUN.js +1233 -0
  266. package/dist/zh-HK-GOKVZUJZ.js +1233 -0
  267. package/dist/zh-HK-Z5B2ANLW.js +2 -0
  268. package/dist/zh-Hant-2R7T4HJT.js +1233 -0
  269. package/dist/zh-Hant-MWAFLLDD.js +2 -0
  270. package/dist/zh-cn-D36OS2SI.js +2 -0
  271. package/dist/zh-cn-Z5YVUN62.js +98 -0
  272. package/dist/zh-tw-JWILJCBD.js +2 -0
  273. package/dist/zh-tw-X7JGMR4G.js +98 -0
  274. package/package.json +84 -3
@@ -0,0 +1,482 @@
1
+ "use client";
2
+ import {
3
+ getVimeoVideoInfo,
4
+ resolveVimeoVideoId
5
+ } from "./chunk-FSH5K5FU.js";
6
+ import {
7
+ EmbedProvider
8
+ } from "./chunk-RJTKNOYT.js";
9
+ import {
10
+ ListSymbol,
11
+ QualitySymbol,
12
+ RAFLoop,
13
+ TextTrack,
14
+ TimeRange,
15
+ preconnect
16
+ } from "./chunk-2UBPQBQI.js";
17
+ import {
18
+ createScope,
19
+ deferredPromise,
20
+ effect,
21
+ isArray,
22
+ isString,
23
+ listenEvent,
24
+ peek,
25
+ signal
26
+ } from "./chunk-IUB5YLUU.js";
27
+ import "./chunk-G3PMV62Z.js";
28
+
29
+ // ../../node_modules/.pnpm/@vidstack+react@1.15.6_@types+react@19.2.8_react@19.2.1/node_modules/@vidstack/react/prod/chunks/vidstack-GkTzay8D.js
30
+ var trackedVimeoEvents = [
31
+ "bufferend",
32
+ "bufferstart",
33
+ "durationchange",
34
+ "ended",
35
+ "enterpictureinpicture",
36
+ "error",
37
+ "fullscreenchange",
38
+ "leavepictureinpicture",
39
+ "loaded",
40
+ "playProgress",
41
+ "loadProgress",
42
+ "pause",
43
+ "play",
44
+ "playbackratechange",
45
+ "qualitychange",
46
+ "seeked",
47
+ "seeking",
48
+ "timeupdate",
49
+ "volumechange",
50
+ "waiting"
51
+ ];
52
+ var VimeoProvider = class extends EmbedProvider {
53
+ $$PROVIDER_TYPE = "VIMEO";
54
+ scope = createScope();
55
+ fullscreen;
56
+ #ctx;
57
+ #videoId = signal("");
58
+ #pro = signal(false);
59
+ #hash = null;
60
+ #currentSrc = null;
61
+ #fullscreenActive = false;
62
+ #seekableRange = new TimeRange(0, 0);
63
+ #timeRAF = new RAFLoop(this.#onAnimationFrame.bind(this));
64
+ #currentCue = null;
65
+ #chaptersTrack = null;
66
+ #promises = /* @__PURE__ */ new Map();
67
+ #videoInfoPromise = null;
68
+ constructor(iframe, ctx) {
69
+ super(iframe);
70
+ this.#ctx = ctx;
71
+ const self = this;
72
+ this.fullscreen = {
73
+ get active() {
74
+ return self.#fullscreenActive;
75
+ },
76
+ supported: true,
77
+ enter: () => this.#remote("requestFullscreen"),
78
+ exit: () => this.#remote("exitFullscreen")
79
+ };
80
+ }
81
+ /**
82
+ * Whether tracking session data should be enabled on the embed, including cookies and analytics.
83
+ * This is turned off by default to be GDPR-compliant.
84
+ *
85
+ * @defaultValue `false`
86
+ */
87
+ cookies = false;
88
+ title = true;
89
+ byline = true;
90
+ portrait = true;
91
+ color = "00ADEF";
92
+ get type() {
93
+ return "vimeo";
94
+ }
95
+ get currentSrc() {
96
+ return this.#currentSrc;
97
+ }
98
+ get videoId() {
99
+ return this.#videoId();
100
+ }
101
+ get hash() {
102
+ return this.#hash;
103
+ }
104
+ get isPro() {
105
+ return this.#pro();
106
+ }
107
+ preconnect() {
108
+ preconnect(this.getOrigin());
109
+ }
110
+ setup() {
111
+ super.setup();
112
+ effect(this.#watchVideoId.bind(this));
113
+ effect(this.#watchVideoInfo.bind(this));
114
+ effect(this.#watchPro.bind(this));
115
+ this.#ctx.notify("provider-setup", this);
116
+ }
117
+ destroy() {
118
+ this.#reset();
119
+ this.fullscreen = void 0;
120
+ const message = "provider destroyed";
121
+ for (const promises of this.#promises.values()) for (const { reject } of promises) reject(message);
122
+ this.#promises.clear();
123
+ this.#remote("destroy");
124
+ }
125
+ async play() {
126
+ return this.#remote("play");
127
+ }
128
+ async pause() {
129
+ return this.#remote("pause");
130
+ }
131
+ setMuted(muted) {
132
+ this.#remote("setMuted", muted);
133
+ }
134
+ setCurrentTime(time) {
135
+ this.#remote("seekTo", time);
136
+ this.#ctx.notify("seeking", time);
137
+ }
138
+ setVolume(volume) {
139
+ this.#remote("setVolume", volume);
140
+ this.#remote("setMuted", peek(this.#ctx.$state.muted));
141
+ }
142
+ setPlaybackRate(rate) {
143
+ this.#remote("setPlaybackRate", rate);
144
+ }
145
+ async loadSource(src) {
146
+ if (!isString(src.src)) {
147
+ this.#currentSrc = null;
148
+ this.#hash = null;
149
+ this.#videoId.set("");
150
+ return;
151
+ }
152
+ const { videoId, hash } = resolveVimeoVideoId(src.src);
153
+ this.#videoId.set(videoId ?? "");
154
+ this.#hash = hash ?? null;
155
+ this.#currentSrc = src;
156
+ }
157
+ #watchVideoId() {
158
+ this.#reset();
159
+ const videoId = this.#videoId();
160
+ if (!videoId) {
161
+ this.src.set("");
162
+ return;
163
+ }
164
+ this.src.set(`${this.getOrigin()}/video/${videoId}`);
165
+ this.#ctx.notify("load-start");
166
+ }
167
+ #watchVideoInfo() {
168
+ const videoId = this.#videoId();
169
+ if (!videoId) return;
170
+ const promise = deferredPromise(), abort = new AbortController();
171
+ this.#videoInfoPromise = promise;
172
+ getVimeoVideoInfo(videoId, abort, this.#hash).then((info) => {
173
+ promise.resolve(info);
174
+ }).catch((e) => {
175
+ promise.reject();
176
+ });
177
+ return () => {
178
+ promise.reject();
179
+ abort.abort();
180
+ };
181
+ }
182
+ #watchPro() {
183
+ const isPro = this.#pro(), { $state, qualities } = this.#ctx;
184
+ $state.canSetPlaybackRate.set(isPro);
185
+ qualities[ListSymbol.setReadonly](!isPro);
186
+ if (isPro) return listenEvent(qualities, "change", () => {
187
+ if (qualities.auto) return;
188
+ const id = qualities.selected?.id;
189
+ if (id) this.#remote("setQuality", id);
190
+ });
191
+ }
192
+ getOrigin() {
193
+ return "https://player.vimeo.com";
194
+ }
195
+ buildParams() {
196
+ const { keyDisabled } = this.#ctx.$props, { playsInline, nativeControls } = this.#ctx.$state, showControls = nativeControls();
197
+ return {
198
+ title: this.title,
199
+ byline: this.byline,
200
+ color: this.color,
201
+ portrait: this.portrait,
202
+ controls: showControls,
203
+ h: this.hash,
204
+ keyboard: showControls && !keyDisabled(),
205
+ transparent: true,
206
+ playsinline: playsInline(),
207
+ dnt: !this.cookies
208
+ };
209
+ }
210
+ #onAnimationFrame() {
211
+ this.#remote("getCurrentTime");
212
+ }
213
+ #preventTimeUpdates = false;
214
+ #onTimeUpdate(time, trigger) {
215
+ if (this.#preventTimeUpdates && time === 0) return;
216
+ const { realCurrentTime, paused, bufferedEnd, seekableEnd, live } = this.#ctx.$state;
217
+ if (realCurrentTime() === time) return;
218
+ const prevTime = realCurrentTime();
219
+ this.#ctx.notify("time-change", time, trigger);
220
+ if (Math.abs(prevTime - time) > 1.5) {
221
+ this.#ctx.notify("seeking", time, trigger);
222
+ if (!paused() && bufferedEnd() < time) this.#ctx.notify("waiting", void 0, trigger);
223
+ }
224
+ if (!live() && seekableEnd() - time < 0.01) {
225
+ this.#ctx.notify("end", void 0, trigger);
226
+ this.#preventTimeUpdates = true;
227
+ setTimeout(() => {
228
+ this.#preventTimeUpdates = false;
229
+ }, 500);
230
+ }
231
+ }
232
+ #onSeeked(time, trigger) {
233
+ this.#ctx.notify("seeked", time, trigger);
234
+ }
235
+ #onLoaded(trigger) {
236
+ const videoId = this.#videoId();
237
+ this.#videoInfoPromise?.promise.then((info) => {
238
+ if (!info) return;
239
+ const { title, poster, duration, pro } = info;
240
+ this.#pro.set(pro);
241
+ this.#ctx.notify("title-change", title, trigger);
242
+ this.#ctx.notify("poster-change", poster, trigger);
243
+ this.#ctx.notify("duration-change", duration, trigger);
244
+ this.#onReady(duration, trigger);
245
+ }).catch(() => {
246
+ if (videoId !== this.#videoId()) return;
247
+ this.#remote("getVideoTitle");
248
+ this.#remote("getDuration");
249
+ });
250
+ }
251
+ #onReady(duration, trigger) {
252
+ const { nativeControls } = this.#ctx.$state, showEmbedControls = nativeControls();
253
+ this.#seekableRange = new TimeRange(0, duration);
254
+ const detail = {
255
+ buffered: new TimeRange(0, 0),
256
+ seekable: this.#seekableRange,
257
+ duration
258
+ };
259
+ this.#ctx.delegate.ready(detail, trigger);
260
+ if (!showEmbedControls) this.#remote("_hideOverlay");
261
+ this.#remote("getQualities");
262
+ this.#remote("getChapters");
263
+ }
264
+ #onMethod(method, data, trigger) {
265
+ switch (method) {
266
+ case "getVideoTitle":
267
+ const videoTitle = data;
268
+ this.#ctx.notify("title-change", videoTitle, trigger);
269
+ break;
270
+ case "getDuration":
271
+ const duration = data;
272
+ if (!this.#ctx.$state.canPlay()) this.#onReady(duration, trigger);
273
+ else this.#ctx.notify("duration-change", duration, trigger);
274
+ break;
275
+ case "getCurrentTime":
276
+ this.#onTimeUpdate(data, trigger);
277
+ break;
278
+ case "getBuffered":
279
+ if (isArray(data) && data.length) this.#onLoadProgress(data[data.length - 1][1], trigger);
280
+ break;
281
+ case "setMuted":
282
+ case "getMuted":
283
+ this.#onVolumeChange(peek(this.#ctx.$state.volume), data, trigger);
284
+ break;
285
+ case "getChapters":
286
+ this.#onChaptersChange(data);
287
+ break;
288
+ case "getQualities":
289
+ this.#onQualitiesChange(data, trigger);
290
+ break;
291
+ }
292
+ this.#getPromise(method)?.resolve();
293
+ }
294
+ #attachListeners() {
295
+ for (const type of trackedVimeoEvents) this.#remote("addEventListener", type);
296
+ }
297
+ #onPause(trigger) {
298
+ this.#timeRAF.stop();
299
+ this.#ctx.notify("pause", void 0, trigger);
300
+ }
301
+ async #onPlay(trigger) {
302
+ this.#timeRAF.start();
303
+ await this.#remote("getMuted");
304
+ this.#ctx.notify("play", void 0, trigger);
305
+ }
306
+ #onPlayProgress(trigger) {
307
+ const { paused } = this.#ctx.$state;
308
+ if (!paused() && !this.#preventTimeUpdates) this.#ctx.notify("playing", void 0, trigger);
309
+ }
310
+ #onLoadProgress(buffered, trigger) {
311
+ const detail = {
312
+ buffered: new TimeRange(0, buffered),
313
+ seekable: this.#seekableRange
314
+ };
315
+ this.#ctx.notify("progress", detail, trigger);
316
+ }
317
+ #onBufferStart(trigger) {
318
+ this.#ctx.notify("waiting", void 0, trigger);
319
+ }
320
+ #onBufferEnd(trigger) {
321
+ const { paused } = this.#ctx.$state;
322
+ if (!paused()) this.#ctx.notify("playing", void 0, trigger);
323
+ }
324
+ async #onWaiting(trigger) {
325
+ const { paused } = this.#ctx.$state;
326
+ if (paused()) {
327
+ await this.#remote("getMuted");
328
+ this.#ctx.notify("play", void 0, trigger);
329
+ }
330
+ this.#ctx.notify("waiting", void 0, trigger);
331
+ }
332
+ #onVolumeChange(volume, muted, trigger) {
333
+ const detail = {
334
+ volume,
335
+ muted
336
+ };
337
+ this.#ctx.notify("volume-change", detail, trigger);
338
+ }
339
+ #onChaptersChange(chapters) {
340
+ this.#removeChapters();
341
+ if (!chapters.length) return;
342
+ const track = new TextTrack({
343
+ kind: "chapters",
344
+ default: true
345
+ }), { seekableEnd } = this.#ctx.$state;
346
+ for (let i = 0; i < chapters.length; i++) {
347
+ const chapter = chapters[i], nextChapter = chapters[i + 1];
348
+ track.addCue(new window.VTTCue(chapter.startTime, nextChapter?.startTime ?? seekableEnd(), chapter.title));
349
+ }
350
+ this.#chaptersTrack = track;
351
+ this.#ctx.textTracks.add(track);
352
+ }
353
+ #removeChapters() {
354
+ if (!this.#chaptersTrack) return;
355
+ this.#ctx.textTracks.remove(this.#chaptersTrack);
356
+ this.#chaptersTrack = null;
357
+ }
358
+ #onQualitiesChange(qualities, trigger) {
359
+ this.#ctx.qualities[QualitySymbol.enableAuto] = qualities.some((q) => q.id === "auto") ? () => this.#remote("setQuality", "auto") : void 0;
360
+ for (const quality of qualities) {
361
+ if (quality.id === "auto") continue;
362
+ const height = +quality.id.slice(0, -1);
363
+ if (isNaN(height)) continue;
364
+ this.#ctx.qualities[ListSymbol.add]({
365
+ id: quality.id,
366
+ width: height * (16 / 9),
367
+ height,
368
+ codec: "avc1,h.264",
369
+ bitrate: -1
370
+ }, trigger);
371
+ }
372
+ this.#onQualityChange(qualities.find((q) => q.active), trigger);
373
+ }
374
+ #onQualityChange({ id } = {}, trigger) {
375
+ if (!id) return;
376
+ const isAuto = id === "auto", newQuality = this.#ctx.qualities.getById(id);
377
+ if (isAuto) {
378
+ this.#ctx.qualities[QualitySymbol.setAuto](isAuto, trigger);
379
+ this.#ctx.qualities[ListSymbol.select](void 0, true, trigger);
380
+ } else this.#ctx.qualities[ListSymbol.select](newQuality ?? void 0, true, trigger);
381
+ }
382
+ #onEvent(event, payload, trigger) {
383
+ switch (event) {
384
+ case "ready":
385
+ this.#attachListeners();
386
+ break;
387
+ case "loaded":
388
+ this.#onLoaded(trigger);
389
+ break;
390
+ case "play":
391
+ this.#onPlay(trigger);
392
+ break;
393
+ case "playProgress":
394
+ this.#onPlayProgress(trigger);
395
+ break;
396
+ case "pause":
397
+ this.#onPause(trigger);
398
+ break;
399
+ case "loadProgress":
400
+ this.#onLoadProgress(payload.seconds, trigger);
401
+ break;
402
+ case "waiting":
403
+ this.#onWaiting(trigger);
404
+ break;
405
+ case "bufferstart":
406
+ this.#onBufferStart(trigger);
407
+ break;
408
+ case "bufferend":
409
+ this.#onBufferEnd(trigger);
410
+ break;
411
+ case "volumechange":
412
+ this.#onVolumeChange(payload.volume, peek(this.#ctx.$state.muted), trigger);
413
+ break;
414
+ case "durationchange":
415
+ this.#seekableRange = new TimeRange(0, payload.duration);
416
+ this.#ctx.notify("duration-change", payload.duration, trigger);
417
+ break;
418
+ case "playbackratechange":
419
+ this.#ctx.notify("rate-change", payload.playbackRate, trigger);
420
+ break;
421
+ case "qualitychange":
422
+ this.#onQualityChange(payload, trigger);
423
+ break;
424
+ case "fullscreenchange":
425
+ this.#fullscreenActive = payload.fullscreen;
426
+ this.#ctx.notify("fullscreen-change", payload.fullscreen, trigger);
427
+ break;
428
+ case "enterpictureinpicture":
429
+ this.#ctx.notify("picture-in-picture-change", true, trigger);
430
+ break;
431
+ case "leavepictureinpicture":
432
+ this.#ctx.notify("picture-in-picture-change", false, trigger);
433
+ break;
434
+ case "ended":
435
+ this.#ctx.notify("end", void 0, trigger);
436
+ break;
437
+ case "error":
438
+ this.#onError(payload, trigger);
439
+ break;
440
+ case "seek":
441
+ case "seeked":
442
+ this.#onSeeked(payload.seconds, trigger);
443
+ break;
444
+ }
445
+ }
446
+ #onError(error, trigger) {
447
+ const { message, method } = error;
448
+ if (method === "setPlaybackRate") this.#pro.set(false);
449
+ if (method) this.#getPromise(method)?.reject(message);
450
+ }
451
+ onMessage(message, event) {
452
+ if (message.event) this.#onEvent(message.event, message.data, event);
453
+ else if (message.method) this.#onMethod(message.method, message.value, event);
454
+ }
455
+ onLoad() {
456
+ }
457
+ async #remote(command, arg) {
458
+ let promise = deferredPromise(), promises = this.#promises.get(command);
459
+ if (!promises) this.#promises.set(command, promises = []);
460
+ promises.push(promise);
461
+ this.postMessage({
462
+ method: command,
463
+ value: arg
464
+ });
465
+ return promise.promise;
466
+ }
467
+ #reset() {
468
+ this.#timeRAF.stop();
469
+ this.#seekableRange = new TimeRange(0, 0);
470
+ this.#videoInfoPromise = null;
471
+ this.#currentCue = null;
472
+ this.#pro.set(false);
473
+ this.#removeChapters();
474
+ }
475
+ #getPromise(command) {
476
+ return this.#promises.get(command)?.shift();
477
+ }
478
+ };
479
+ export {
480
+ VimeoProvider
481
+ };
482
+ //# sourceMappingURL=vidstack-GkTzay8D-SQU5IF3P.js.map
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Web Component 殼:每個自訂元素掛一個 React root,屬性→props(kebab→camel,JSON 屬性自動解析)。
3
+ * `defineKanorioElements()` 冪等;CDN 單檔在載入時自動呼叫。
4
+ *
5
+ * <script type="module" src="https://js.kanorio.com/elements/v1/kanorio-elements.js"></script>
6
+ * <kanorio-account site-url="https://demo.kanorio.com"></kanorio-account>
7
+ * <kanorio-unit site-url="https://demo.kanorio.com" deliverable="cmw0abc123"></kanorio-unit>
8
+ */
9
+ declare function attributesToProps(el: Element): Record<string, unknown>;
10
+ declare function defineKanorioElements(): void;
11
+
12
+ export { attributesToProps, defineKanorioElements };
@@ -0,0 +1,123 @@
1
+ import {
2
+ FORM_SUBMIT_EVENT,
3
+ KanorioAccount,
4
+ KanorioAnalytics,
5
+ KanorioCurriculum,
6
+ KanorioForm,
7
+ KanorioLightbox,
8
+ KanorioLogin,
9
+ KanorioMedia,
10
+ KanorioRating,
11
+ KanorioReviews,
12
+ KanorioUnit,
13
+ LOGIN_EVENT,
14
+ LOGOUT_EVENT
15
+ } from "./chunk-5OB57Z46.js";
16
+ import "./chunk-QDUG7UMV.js";
17
+ import "./chunk-CHSZMJ5D.js";
18
+ import "./chunk-DDKQOHPW.js";
19
+ import "./chunk-Y77XXKLY.js";
20
+ import "./chunk-J7AP6FJF.js";
21
+ import "./chunk-G3PMV62Z.js";
22
+
23
+ // src/web-components.ts
24
+ import { createElement } from "react";
25
+ import { createRoot } from "react-dom/client";
26
+
27
+ // src/altcha-worker.ts
28
+ var blobUrls = /* @__PURE__ */ new Map();
29
+ function workerScriptUrl(workerUrl) {
30
+ return String(new URL(workerUrl || "./worker.js", import.meta.url));
31
+ }
32
+ function isCrossOriginBundle() {
33
+ if (typeof window === "undefined" || typeof window.location === "undefined") return false;
34
+ try {
35
+ return new URL(import.meta.url).origin !== window.location.origin;
36
+ } catch {
37
+ return false;
38
+ }
39
+ }
40
+ function createSameOriginWorker(scriptUrl) {
41
+ let blobUrl = blobUrls.get(scriptUrl);
42
+ if (!blobUrl) {
43
+ blobUrl = URL.createObjectURL(new Blob([`importScripts(${JSON.stringify(scriptUrl)});`], { type: "text/javascript" }));
44
+ blobUrls.set(scriptUrl, blobUrl);
45
+ }
46
+ return new Worker(blobUrl);
47
+ }
48
+ var patched = null;
49
+ function ensureAltchaWorkerFactory() {
50
+ if (!isCrossOriginBundle()) return Promise.resolve();
51
+ patched ??= import("./altcha-DSOKKAAV.js").then(() => {
52
+ globalThis.altchaCreateWorker = (workerUrl) => createSameOriginWorker(workerScriptUrl(workerUrl));
53
+ });
54
+ return patched;
55
+ }
56
+
57
+ // src/web-components.ts
58
+ var JSON_ATTRS = /* @__PURE__ */ new Set(["images", "alts", "filenames", "protection", "outline", "expand-all", "allow-download", "auto-play", "loop", "muted", "columns", "page-count", "file-size", "brand", "follow-redirect", "hidden-values", "captions"]);
59
+ function parseAttr(name, value) {
60
+ if (!JSON_ATTRS.has(name)) return value;
61
+ if (value === "") return true;
62
+ try {
63
+ return JSON.parse(value);
64
+ } catch {
65
+ return value;
66
+ }
67
+ }
68
+ function camel(name) {
69
+ return name.replace(/-([a-z])/g, (_, c) => c.toUpperCase());
70
+ }
71
+ function attributesToProps(el) {
72
+ const props = {};
73
+ for (const attr of Array.from(el.attributes)) {
74
+ if (attr.name === "class" || attr.name === "style" || attr.name === "id") continue;
75
+ props[camel(attr.name)] = parseAttr(attr.name, attr.value);
76
+ }
77
+ return props;
78
+ }
79
+ function define(tag, Component, events = {}) {
80
+ if (typeof customElements === "undefined" || customElements.get(tag)) return;
81
+ class KanorioElement extends HTMLElement {
82
+ root = null;
83
+ observer = null;
84
+ connectedCallback() {
85
+ this.root = createRoot(this);
86
+ this.render();
87
+ this.observer = new MutationObserver(() => this.render());
88
+ this.observer.observe(this, { attributes: true });
89
+ }
90
+ disconnectedCallback() {
91
+ this.observer?.disconnect();
92
+ this.root?.unmount();
93
+ this.root = null;
94
+ }
95
+ render() {
96
+ if (!this.root) return;
97
+ const props = attributesToProps(this);
98
+ for (const [prop, eventName] of Object.entries(events)) {
99
+ props[prop] = (detail) => this.dispatchEvent(new CustomEvent(eventName, { detail, bubbles: true }));
100
+ }
101
+ this.root.render(createElement(Component, props));
102
+ }
103
+ }
104
+ customElements.define(tag, KanorioElement);
105
+ }
106
+ function defineKanorioElements() {
107
+ void ensureAltchaWorkerFactory();
108
+ define("kanorio-media", KanorioMedia);
109
+ define("kanorio-lightbox", KanorioLightbox);
110
+ define("kanorio-unit", KanorioUnit, { onUnitChange: "kanorio:unit-change", onProgress: "kanorio:progress" });
111
+ define("kanorio-curriculum", KanorioCurriculum);
112
+ define("kanorio-reviews", KanorioReviews);
113
+ define("kanorio-rating", KanorioRating);
114
+ define("kanorio-account", KanorioAccount, { onLogin: LOGIN_EVENT, onLogout: LOGOUT_EVENT });
115
+ define("kanorio-login", KanorioLogin, { onLogin: LOGIN_EVENT, onLogout: LOGOUT_EVENT });
116
+ define("kanorio-form", KanorioForm, { onSuccess: FORM_SUBMIT_EVENT });
117
+ define("kanorio-analytics", KanorioAnalytics);
118
+ }
119
+ export {
120
+ attributesToProps,
121
+ defineKanorioElements
122
+ };
123
+ //# sourceMappingURL=web-components.js.map
package/dist/worker.js ADDED
@@ -0,0 +1 @@
1
+ (function(){"use strict";const d=new TextEncoder;function p(e){return[...new Uint8Array(e)].map(t=>t.toString(16).padStart(2,"0")).join("")}async function b(e,t,r){if(typeof crypto>"u"||!("subtle"in crypto)||!("digest"in crypto.subtle))throw new Error("Web Crypto is not available. Secure context is required (https://developer.mozilla.org/en-US/docs/Web/Security/Secure_Contexts).");return p(await crypto.subtle.digest(r.toUpperCase(),d.encode(e+t)))}function w(e,t,r="SHA-256",n=1e6,l=0){const o=new AbortController,a=Date.now();return{promise:(async()=>{for(let c=l;c<=n;c+=1){if(o.signal.aborted)return null;if(await b(t,c,r)===e)return{number:c,took:Date.now()-a}}return null})(),controller:o}}function h(e){const t=atob(e),r=new Uint8Array(t.length);for(let n=0;n<t.length;n++)r[n]=t.charCodeAt(n);return r}function g(e,t=12){const r=new Uint8Array(t);for(let n=0;n<t;n++)r[n]=e%256,e=Math.floor(e/256);return r}async function m(e,t="",r=1e6,n=0){const l="AES-GCM",o=new AbortController,a=Date.now(),s=async()=>{for(let i=n;i<=r;i+=1){if(o.signal.aborted||!c||!u)return null;try{const f=await crypto.subtle.decrypt({name:l,iv:g(i)},c,u);if(f)return{clearText:new TextDecoder().decode(f),took:Date.now()-a}}catch{}}return null};let c=null,u=null;try{u=h(e);const i=await crypto.subtle.digest("SHA-256",d.encode(t));c=await crypto.subtle.importKey("raw",i,l,!1,["decrypt"])}catch{return{promise:Promise.reject(),controller:o}}return{promise:s(),controller:o}}let y;onmessage=async e=>{const{type:t,payload:r,start:n,max:l}=e.data;let o=null;if(t==="abort")y?.abort(),y=void 0;else if(t==="work"){if("obfuscated"in r){const{key:a,obfuscated:s}=r||{};o=await m(s,a,l,n)}else{const{algorithm:a,challenge:s,salt:c}=r||{};o=w(s,c,a,l,n)}y=o.controller,o.promise.then(a=>{self.postMessage(a&&{...a,worker:!0})})}}})();