@therealtinhtute/baroiplayer 1.0.8 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (1003) hide show
  1. package/LICENSE +2 -2
  2. package/README.md +15 -15
  3. package/dist/context/media.js +2 -0
  4. package/dist/context/media.js.map +1 -0
  5. package/dist/context/media.mjs +15 -0
  6. package/dist/context/media.mjs.map +1 -0
  7. package/dist/context/store.js +2 -0
  8. package/dist/context/store.js.map +1 -0
  9. package/dist/context/store.mjs +5 -0
  10. package/dist/context/store.mjs.map +1 -0
  11. package/dist/context-BYwDoSRX.js +1172 -0
  12. package/dist/context-BYwDoSRX.js.map +1 -0
  13. package/dist/context-eNS62_ac.cjs +23 -0
  14. package/dist/context-eNS62_ac.cjs.map +1 -0
  15. package/dist/core-events-B1iM2F46.cjs +2 -0
  16. package/dist/core-events-B1iM2F46.cjs.map +1 -0
  17. package/dist/core-events-DunPHKRE.js +484 -0
  18. package/dist/core-events-DunPHKRE.js.map +1 -0
  19. package/dist/core-plugins-CROGvQUy.js +686 -0
  20. package/dist/core-plugins-CROGvQUy.js.map +1 -0
  21. package/dist/core-plugins-DtsHBOtF.cjs +2 -0
  22. package/dist/core-plugins-DtsHBOtF.cjs.map +1 -0
  23. package/dist/core.js +37 -0
  24. package/dist/core.js.map +1 -0
  25. package/dist/core.mjs +1233 -0
  26. package/dist/core.mjs.map +1 -0
  27. package/dist/enhanced-components-DUw2KrmQ.js +1142 -0
  28. package/dist/enhanced-components-DUw2KrmQ.js.map +1 -0
  29. package/dist/enhanced-components-DXBCHU0v.cjs +2 -0
  30. package/dist/enhanced-components-DXBCHU0v.cjs.map +1 -0
  31. package/dist/hooks-BW-JjVgP.cjs +4 -0
  32. package/dist/hooks-BW-JjVgP.cjs.map +1 -0
  33. package/dist/hooks-CyX6De5M.js +1693 -0
  34. package/dist/hooks-CyX6De5M.js.map +1 -0
  35. package/dist/index.css +1 -102
  36. package/dist/index.js +112 -21
  37. package/dist/index.js.map +1 -0
  38. package/dist/index.mjs +6275 -16
  39. package/dist/index.mjs.map +1 -0
  40. package/dist/minimal-components-Bdcpxav5.cjs +2 -0
  41. package/dist/minimal-components-Bdcpxav5.cjs.map +1 -0
  42. package/dist/minimal-components-DlRK7Qu_.js +1927 -0
  43. package/dist/minimal-components-DlRK7Qu_.js.map +1 -0
  44. package/dist/minimal-components.css +1 -589
  45. package/dist/mona-loading.gif +0 -0
  46. package/dist/performance-monitor-C5k6FDXw.js +301 -0
  47. package/dist/performance-monitor-C5k6FDXw.js.map +1 -0
  48. package/dist/performance-monitor-lJmuUjQQ.cjs +2 -0
  49. package/dist/performance-monitor-lJmuUjQQ.cjs.map +1 -0
  50. package/dist/utils-CFOue_9K.cjs +9 -0
  51. package/dist/utils-CFOue_9K.cjs.map +1 -0
  52. package/dist/utils-Dzpl2ArK.js +2844 -0
  53. package/dist/utils-Dzpl2ArK.js.map +1 -0
  54. package/dist/utils.js +2 -0
  55. package/dist/utils.js.map +1 -0
  56. package/dist/utils.mjs +11 -0
  57. package/dist/utils.mjs.map +1 -0
  58. package/package.json +11 -40
  59. package/src/adapters/videojs-adapter.tsx +441 -441
  60. package/src/components/AnimateLoading.tsx +85 -93
  61. package/src/components/LoadingState.tsx +199 -208
  62. package/src/components/__tests__/media-player-accessibility.test.tsx +510 -0
  63. package/src/components/__tests__/media-player-react19.test.tsx +457 -0
  64. package/src/components/accessibility/keyboard-help-overlay.tsx +199 -207
  65. package/src/components/basic/index.ts +28 -28
  66. package/src/components/enhanced/advanced-features.tsx +49 -54
  67. package/src/components/enhanced/debug-panel.tsx +148 -122
  68. package/src/components/enhanced/enhanced-controls.tsx +117 -120
  69. package/src/components/enhanced/enhanced-media-player.tsx +228 -214
  70. package/src/components/enhanced/error-handling.tsx +50 -57
  71. package/src/components/enhanced/index.ts +27 -27
  72. package/src/components/enhanced/media-player-enhanced.tsx +117 -83
  73. package/src/components/examples/basic-video-player.tsx +35 -40
  74. package/src/components/examples/enhanced-controls-example.tsx +16 -30
  75. package/src/components/examples/enhanced-media-player-example.tsx +196 -187
  76. package/src/components/examples/loading-states-demo.tsx +113 -113
  77. package/src/components/examples/react-19-demo.tsx +88 -116
  78. package/src/components/examples/volume-orientation-demo.tsx +77 -85
  79. package/src/components/icon-demo.tsx +189 -202
  80. package/src/components/icons/svg-icons/ArrowLeftIcon.tsx +13 -13
  81. package/src/components/icons/svg-icons/ArrowRightIcon.tsx +13 -13
  82. package/src/components/icons/svg-icons/AudioIcon.tsx +16 -16
  83. package/src/components/icons/svg-icons/BackwardIcon.tsx +7 -7
  84. package/src/components/icons/svg-icons/CameraIcon.tsx +13 -13
  85. package/src/components/icons/svg-icons/CheckIcon.tsx +13 -13
  86. package/src/components/icons/svg-icons/EnablePiPIcon.tsx +13 -13
  87. package/src/components/icons/svg-icons/ForwardIcon.tsx +7 -7
  88. package/src/components/icons/svg-icons/FullscreenEnterIcon.tsx +18 -18
  89. package/src/components/icons/svg-icons/FullscreenExitIcon.tsx +18 -18
  90. package/src/components/icons/svg-icons/LoadingIcon.tsx +27 -27
  91. package/src/components/icons/svg-icons/PauseIcon.tsx +18 -18
  92. package/src/components/icons/svg-icons/PlayIcon.tsx +16 -16
  93. package/src/components/icons/svg-icons/PlaybackSpeedIcon.tsx +18 -18
  94. package/src/components/icons/svg-icons/QualityIcon.tsx +16 -16
  95. package/src/components/icons/svg-icons/SettingsIcon.tsx +7 -7
  96. package/src/components/icons/svg-icons/SliderIcon.tsx +16 -16
  97. package/src/components/icons/svg-icons/SubtitleIcon.tsx +16 -16
  98. package/src/components/icons/svg-icons/SubtitleOffIcon.tsx +20 -20
  99. package/src/components/icons/svg-icons/UnPiPIcon.tsx +13 -13
  100. package/src/components/icons/svg-icons/VolumeMutedIcon.tsx +11 -11
  101. package/src/components/icons/svg-icons/VolumeOneIcon.tsx +17 -17
  102. package/src/components/icons/svg-icons/VolumeThreeIcon.tsx +11 -11
  103. package/src/components/icons/svg-icons/VolumeTwoIcon.tsx +11 -11
  104. package/src/components/legacy.tsx +8 -14
  105. package/src/components/media-metadata-display.tsx +78 -79
  106. package/src/components/media-player-controls.tsx +37 -40
  107. package/src/components/media-player-error.tsx +2 -2
  108. package/src/components/media-player-fullscreen.tsx +2 -2
  109. package/src/components/media-player-hls.tsx +89 -89
  110. package/src/components/media-player-play.tsx +2 -2
  111. package/src/components/media-player-root.tsx +20 -22
  112. package/src/components/media-player-seek.tsx +1 -1
  113. package/src/components/media-player-tooltip.tsx +1 -1
  114. package/src/components/media-player-video.tsx +28 -6
  115. package/src/components/media-player-volume.tsx +3 -3
  116. package/src/components/media-player.tsx +209 -174
  117. package/src/components/media-suspense.tsx +71 -89
  118. package/src/components/player-settings-form.tsx +143 -148
  119. package/src/components/react-player-wrapper.tsx +23 -23
  120. package/src/components/simple-video-player.tsx +53 -51
  121. package/src/components/ui/blur-poster.tsx +93 -0
  122. package/src/components/ui/empty-state.tsx +91 -0
  123. package/src/components/ui/enhanced-seek-bar.tsx +75 -56
  124. package/src/components/ui/error-state.tsx +124 -0
  125. package/src/components/ui/fullscreen-button.tsx +71 -50
  126. package/src/components/ui/loading-skeleton.tsx +107 -0
  127. package/src/components/ui/media-resource-preloader.tsx +265 -198
  128. package/src/components/ui/offline-message.tsx +98 -0
  129. package/src/components/ui/play-button.tsx +79 -87
  130. package/src/components/ui/seek-bar.tsx +170 -140
  131. package/src/components/ui/time-display.tsx +33 -12
  132. package/src/components/ui/volume-control.tsx +91 -44
  133. package/src/components/unified/base-media-player.tsx +45 -51
  134. package/src/components/unified/media-player.tsx +3 -3
  135. package/src/components/variants/minimal/AccessibleMinimalPlayer.tsx +508 -502
  136. package/src/components/variants/minimal/EnhancedMinimalMediaPlayer.tsx +108 -87
  137. package/src/components/variants/minimal/MinimalControls.tsx +100 -118
  138. package/src/components/variants/minimal/MinimalLoading.tsx +19 -23
  139. package/src/components/variants/minimal/MinimalMediaPlayer.tsx +283 -280
  140. package/src/components/variants/minimal/MinimalOverlay.tsx +43 -49
  141. package/src/components/variants/minimal/MinimalPlayButton.tsx +44 -53
  142. package/src/components/variants/minimal/MinimalSeekBar.tsx +130 -140
  143. package/src/components/variants/minimal/MinimalVolumeControl.tsx +59 -64
  144. package/src/components/variants/minimal/SimpleMinimalPlayer.tsx +29 -32
  145. package/src/components/variants/minimal/components/CenterPlayButton.tsx +1 -1
  146. package/src/components/variants/minimal/components/ControlBar.tsx +7 -11
  147. package/src/components/variants/minimal/components/EnhancedSettingsMenu.tsx +381 -330
  148. package/src/components/variants/minimal/components/PlaybackControls.tsx +6 -11
  149. package/src/components/variants/minimal/components/RightControls.tsx +8 -17
  150. package/src/components/variants/minimal/components/SeekBar.tsx +16 -20
  151. package/src/components/variants/minimal/components/SettingsDropdown.tsx +12 -14
  152. package/src/components/variants/minimal/components/SubtitleDisplay.tsx +1 -1
  153. package/src/components/variants/minimal/components/TimeDisplay.tsx +2 -5
  154. package/src/components/variants/minimal/components/VideoElement.tsx +3 -10
  155. package/src/components/variants/minimal/components/VolumeControl.tsx +42 -39
  156. package/src/components/video-player.tsx +10 -10
  157. package/src/context/__tests__/media-store.test.ts +509 -0
  158. package/src/context/error-handling.ts +106 -102
  159. package/src/context/media-context.tsx +56 -10
  160. package/src/context/media-provider.tsx +16 -17
  161. package/src/context/media-store.ts +68 -60
  162. package/src/context/persistence.ts +74 -65
  163. package/src/core/events/event-system.ts +422 -416
  164. package/src/core/events/hooks.ts +275 -252
  165. package/src/core/events/index.ts +14 -14
  166. package/src/core/events/middleware.ts +269 -252
  167. package/src/core/index.ts +8 -8
  168. package/src/core/optimization/bundle-optimizer.tsx +65 -60
  169. package/src/core/performance/cicd.ts +91 -89
  170. package/src/core/performance/index.ts +22 -22
  171. package/src/core/performance/media-loading-optimizer.ts +518 -512
  172. package/src/core/performance/performance-budgets.ts +414 -409
  173. package/src/core/performance/performance-monitor.tsx +451 -439
  174. package/src/core/performance/performance-testing.ts +439 -437
  175. package/src/core/plugins/__tests__/registry.test.ts +595 -0
  176. package/src/core/plugins/base-plugin.ts +197 -196
  177. package/src/core/plugins/enhanced-plugin-system.ts +136 -136
  178. package/src/core/plugins/examples/analytics-plugin.ts +229 -230
  179. package/src/core/plugins/index.ts +26 -26
  180. package/src/core/plugins/registry.ts +315 -323
  181. package/src/core/plugins/types.ts +97 -105
  182. package/src/core/plugins/utils.ts +292 -291
  183. package/src/core/progressive-loading.tsx +297 -288
  184. package/src/core/providers/enhanced-hls-provider.ts +118 -90
  185. package/src/core/providers/lazy-provider.tsx +51 -0
  186. package/src/core/providers/service-provider.tsx +104 -108
  187. package/src/core/utils.tsx +22 -26
  188. package/src/features/media-session/media-session-manager.ts +406 -402
  189. package/src/features/picture-in-picture/pip-manager.ts +364 -365
  190. package/src/features/playlist/playlist-manager.ts +597 -585
  191. package/src/features/subtitles/subtitle-manager.ts +424 -430
  192. package/src/features/subtitles/subtitle-parser.ts +274 -273
  193. package/src/features/thumbnails/thumbnail-generator.ts +504 -502
  194. package/src/hooks/__tests__/use-media-player.test.ts +712 -0
  195. package/src/hooks/__tests__/use-media-state.test.tsx +316 -0
  196. package/src/hooks/accessibility/index.ts +20 -20
  197. package/src/hooks/accessibility/use-accessibility-preferences.ts +177 -175
  198. package/src/hooks/accessibility/use-focus-management.ts +170 -163
  199. package/src/hooks/accessibility/use-keyboard-shortcuts.ts +132 -124
  200. package/src/hooks/accessibility/use-screen-reader.ts +191 -161
  201. package/src/hooks/core/index.ts +30 -30
  202. package/src/hooks/legacy.ts +3 -9
  203. package/src/hooks/use-buffer-health.ts +218 -0
  204. package/src/hooks/use-enhanced-media-player.ts +74 -82
  205. package/src/hooks/use-focus-trap.tsx +162 -0
  206. package/src/hooks/use-intelligent-preloading.ts +236 -232
  207. package/src/hooks/use-keyboard-controls.ts +80 -80
  208. package/src/hooks/use-keyboard-shortcuts.ts +255 -0
  209. package/src/hooks/use-media-actions.ts +81 -72
  210. package/src/hooks/use-media-metadata.ts +75 -73
  211. package/src/hooks/use-media-optimistic.ts +145 -151
  212. package/src/hooks/use-media-player.ts +109 -107
  213. package/src/hooks/use-media-state.ts +63 -59
  214. package/src/hooks/use-memory-optimization.ts +119 -117
  215. package/src/hooks/use-network-status.ts +124 -0
  216. package/src/hooks/use-optimistic-controls.ts +91 -88
  217. package/src/hooks/use-optimized-media.ts +76 -56
  218. package/src/hooks/use-smart-preload.ts +230 -0
  219. package/src/hooks/use-touch-gestures.ts +427 -383
  220. package/src/hooks/useEnhancedSubtitles.ts +245 -245
  221. package/src/hooks/useKeyboardShortcuts.ts +52 -52
  222. package/src/hooks/useMediaControls.ts +22 -22
  223. package/src/hooks/useScreenshot.ts +51 -47
  224. package/src/hooks/useSubtitles.ts +53 -53
  225. package/src/hooks/useVideoPlayer.ts +61 -61
  226. package/src/icons/components/FullscreenIcon.tsx +34 -35
  227. package/src/icons/components/SettingsIcon.tsx +35 -36
  228. package/src/icons/components/animated/LoadingIcon.tsx +25 -41
  229. package/src/icons/components/animated/PlayPauseIcon.tsx +38 -46
  230. package/src/icons/components/media/PauseIcon.tsx +36 -37
  231. package/src/icons/components/media/PlayIcon.tsx +35 -36
  232. package/src/icons/components/volume/VolumeIcon.tsx +36 -37
  233. package/src/icons/components/volume/VolumeOffIcon.tsx +36 -37
  234. package/src/icons/index.ts +38 -38
  235. package/src/icons/provider.tsx +40 -46
  236. package/src/icons/types.ts +51 -31
  237. package/src/index-enhanced.ts +10 -10
  238. package/src/index-legacy.ts +3 -4
  239. package/src/index.css +80 -80
  240. package/src/index.ts +8 -23
  241. package/src/lib/__tests__/async-utils.test.ts +291 -0
  242. package/src/lib/async-utils.ts +194 -0
  243. package/src/lib/deprecation.ts +4 -4
  244. package/src/lib/index.ts +3 -2
  245. package/src/lib/utils.ts +3 -3
  246. package/src/styles/globals.css +3 -3
  247. package/src/styles/minimal-player.css +606 -574
  248. package/src/styles/pixel-art.css +23 -28
  249. package/src/styles/videojs.css +43 -43
  250. package/src/test/accessibility-utils.ts +208 -0
  251. package/src/test/browser-simulation.ts +235 -0
  252. package/src/test/media-mocks.ts +156 -0
  253. package/src/test/performance-utils.ts +192 -0
  254. package/src/test/setup.ts +241 -44
  255. package/src/types/events.ts +30 -30
  256. package/src/types/formats.ts +56 -72
  257. package/src/types/index.ts +5 -40
  258. package/src/types/videojs-plugins.d.ts +6 -6
  259. package/dist/index.d.ts +0 -1425
  260. package/dist/package.json +0 -62
  261. package/dist/src/adapters/videojs-adapter.d.ts +0 -38
  262. package/dist/src/adapters/videojs-adapter.tsx +0 -470
  263. package/dist/src/components/AnimateLoading.d.ts +0 -9
  264. package/dist/src/components/AnimateLoading.tsx +0 -115
  265. package/dist/src/components/LoadingState.d.ts +0 -33
  266. package/dist/src/components/LoadingState.tsx +0 -248
  267. package/dist/src/components/accessibility/keyboard-help-overlay.d.ts +0 -17
  268. package/dist/src/components/accessibility/keyboard-help-overlay.tsx +0 -213
  269. package/dist/src/components/audio-player.d.ts +0 -3
  270. package/dist/src/components/audio-player.tsx +0 -85
  271. package/dist/src/components/basic/index.d.ts +0 -26
  272. package/dist/src/components/basic/index.ts +0 -37
  273. package/dist/src/components/enhanced/advanced-features.d.ts +0 -45
  274. package/dist/src/components/enhanced/advanced-features.tsx +0 -316
  275. package/dist/src/components/enhanced/debug-panel.d.ts +0 -70
  276. package/dist/src/components/enhanced/debug-panel.tsx +0 -422
  277. package/dist/src/components/enhanced/enhanced-controls.d.ts +0 -50
  278. package/dist/src/components/enhanced/enhanced-controls.tsx +0 -600
  279. package/dist/src/components/enhanced/enhanced-media-player.d.ts +0 -26
  280. package/dist/src/components/enhanced/enhanced-media-player.tsx +0 -509
  281. package/dist/src/components/enhanced/error-handling.d.ts +0 -36
  282. package/dist/src/components/enhanced/error-handling.tsx +0 -345
  283. package/dist/src/components/enhanced/index.d.ts +0 -7
  284. package/dist/src/components/enhanced/index.ts +0 -39
  285. package/dist/src/components/enhanced/media-player-enhanced.d.ts +0 -21
  286. package/dist/src/components/enhanced/media-player-enhanced.tsx +0 -349
  287. package/dist/src/components/examples/basic-video-player.d.ts +0 -10
  288. package/dist/src/components/examples/basic-video-player.tsx +0 -55
  289. package/dist/src/components/examples/custom-controls-example.d.ts +0 -10
  290. package/dist/src/components/examples/custom-controls-example.tsx +0 -63
  291. package/dist/src/components/examples/enhanced-controls-example.d.ts +0 -9
  292. package/dist/src/components/examples/enhanced-controls-example.tsx +0 -114
  293. package/dist/src/components/examples/enhanced-media-player-example.d.ts +0 -9
  294. package/dist/src/components/examples/enhanced-media-player-example.tsx +0 -293
  295. package/dist/src/components/examples/loading-states-demo.d.ts +0 -2
  296. package/dist/src/components/examples/loading-states-demo.tsx +0 -142
  297. package/dist/src/components/examples/react-19-demo.d.ts +0 -10
  298. package/dist/src/components/examples/react-19-demo.tsx +0 -381
  299. package/dist/src/components/examples/volume-orientation-demo.d.ts +0 -2
  300. package/dist/src/components/examples/volume-orientation-demo.tsx +0 -114
  301. package/dist/src/components/icon-demo.d.ts +0 -2
  302. package/dist/src/components/icon-demo.tsx +0 -209
  303. package/dist/src/components/icons/index.d.ts +0 -36
  304. package/dist/src/components/icons/index.tsx +0 -166
  305. package/dist/src/components/icons/svg-icons/ArrowLeftIcon.d.ts +0 -4
  306. package/dist/src/components/icons/svg-icons/ArrowLeftIcon.tsx +0 -18
  307. package/dist/src/components/icons/svg-icons/ArrowRightIcon.d.ts +0 -4
  308. package/dist/src/components/icons/svg-icons/ArrowRightIcon.tsx +0 -18
  309. package/dist/src/components/icons/svg-icons/AudioIcon.d.ts +0 -4
  310. package/dist/src/components/icons/svg-icons/AudioIcon.tsx +0 -22
  311. package/dist/src/components/icons/svg-icons/BackwardIcon.d.ts +0 -4
  312. package/dist/src/components/icons/svg-icons/BackwardIcon.tsx +0 -12
  313. package/dist/src/components/icons/svg-icons/CameraIcon.d.ts +0 -4
  314. package/dist/src/components/icons/svg-icons/CameraIcon.tsx +0 -19
  315. package/dist/src/components/icons/svg-icons/CheckIcon.d.ts +0 -4
  316. package/dist/src/components/icons/svg-icons/CheckIcon.tsx +0 -19
  317. package/dist/src/components/icons/svg-icons/EnablePiPIcon.d.ts +0 -4
  318. package/dist/src/components/icons/svg-icons/EnablePiPIcon.tsx +0 -17
  319. package/dist/src/components/icons/svg-icons/ForwardIcon.d.ts +0 -4
  320. package/dist/src/components/icons/svg-icons/ForwardIcon.tsx +0 -12
  321. package/dist/src/components/icons/svg-icons/FullscreenEnterIcon.d.ts +0 -4
  322. package/dist/src/components/icons/svg-icons/FullscreenEnterIcon.tsx +0 -23
  323. package/dist/src/components/icons/svg-icons/FullscreenExitIcon.d.ts +0 -4
  324. package/dist/src/components/icons/svg-icons/FullscreenExitIcon.tsx +0 -23
  325. package/dist/src/components/icons/svg-icons/LoadingIcon.d.ts +0 -4
  326. package/dist/src/components/icons/svg-icons/LoadingIcon.tsx +0 -32
  327. package/dist/src/components/icons/svg-icons/PauseIcon.d.ts +0 -4
  328. package/dist/src/components/icons/svg-icons/PauseIcon.tsx +0 -23
  329. package/dist/src/components/icons/svg-icons/PlayIcon.d.ts +0 -4
  330. package/dist/src/components/icons/svg-icons/PlayIcon.tsx +0 -21
  331. package/dist/src/components/icons/svg-icons/PlaybackSpeedIcon.d.ts +0 -4
  332. package/dist/src/components/icons/svg-icons/PlaybackSpeedIcon.tsx +0 -23
  333. package/dist/src/components/icons/svg-icons/QualityIcon.d.ts +0 -4
  334. package/dist/src/components/icons/svg-icons/QualityIcon.tsx +0 -21
  335. package/dist/src/components/icons/svg-icons/SettingsIcon.d.ts +0 -4
  336. package/dist/src/components/icons/svg-icons/SettingsIcon.tsx +0 -12
  337. package/dist/src/components/icons/svg-icons/SliderIcon.d.ts +0 -4
  338. package/dist/src/components/icons/svg-icons/SliderIcon.tsx +0 -21
  339. package/dist/src/components/icons/svg-icons/SubtitleIcon.d.ts +0 -4
  340. package/dist/src/components/icons/svg-icons/SubtitleIcon.tsx +0 -21
  341. package/dist/src/components/icons/svg-icons/SubtitleOffIcon.d.ts +0 -4
  342. package/dist/src/components/icons/svg-icons/SubtitleOffIcon.tsx +0 -25
  343. package/dist/src/components/icons/svg-icons/UnPiPIcon.d.ts +0 -4
  344. package/dist/src/components/icons/svg-icons/UnPiPIcon.tsx +0 -17
  345. package/dist/src/components/icons/svg-icons/VolumeMutedIcon.d.ts +0 -4
  346. package/dist/src/components/icons/svg-icons/VolumeMutedIcon.tsx +0 -16
  347. package/dist/src/components/icons/svg-icons/VolumeOneIcon.d.ts +0 -4
  348. package/dist/src/components/icons/svg-icons/VolumeOneIcon.tsx +0 -22
  349. package/dist/src/components/icons/svg-icons/VolumeThreeIcon.d.ts +0 -4
  350. package/dist/src/components/icons/svg-icons/VolumeThreeIcon.tsx +0 -16
  351. package/dist/src/components/icons/svg-icons/VolumeTwoIcon.d.ts +0 -4
  352. package/dist/src/components/icons/svg-icons/VolumeTwoIcon.tsx +0 -16
  353. package/dist/src/components/legacy.d.ts +0 -13
  354. package/dist/src/components/legacy.tsx +0 -93
  355. package/dist/src/components/media-metadata-display.d.ts +0 -11
  356. package/dist/src/components/media-metadata-display.tsx +0 -100
  357. package/dist/src/components/media-player-audio.d.ts +0 -9
  358. package/dist/src/components/media-player-audio.tsx +0 -39
  359. package/dist/src/components/media-player-controls.d.ts +0 -23
  360. package/dist/src/components/media-player-controls.tsx +0 -226
  361. package/dist/src/components/media-player-error.d.ts +0 -16
  362. package/dist/src/components/media-player-error.tsx +0 -163
  363. package/dist/src/components/media-player-fullscreen.d.ts +0 -12
  364. package/dist/src/components/media-player-fullscreen.tsx +0 -109
  365. package/dist/src/components/media-player-hls.d.ts +0 -23
  366. package/dist/src/components/media-player-hls.tsx +0 -111
  367. package/dist/src/components/media-player-loading.d.ts +0 -12
  368. package/dist/src/components/media-player-loading.tsx +0 -76
  369. package/dist/src/components/media-player-play.d.ts +0 -11
  370. package/dist/src/components/media-player-play.tsx +0 -75
  371. package/dist/src/components/media-player-root.d.ts +0 -28
  372. package/dist/src/components/media-player-root.tsx +0 -340
  373. package/dist/src/components/media-player-seek.d.ts +0 -15
  374. package/dist/src/components/media-player-seek.tsx +0 -168
  375. package/dist/src/components/media-player-time.d.ts +0 -12
  376. package/dist/src/components/media-player-time.tsx +0 -99
  377. package/dist/src/components/media-player-tooltip.d.ts +0 -13
  378. package/dist/src/components/media-player-tooltip.tsx +0 -58
  379. package/dist/src/components/media-player-video.d.ts +0 -9
  380. package/dist/src/components/media-player-video.tsx +0 -39
  381. package/dist/src/components/media-player-volume.d.ts +0 -13
  382. package/dist/src/components/media-player-volume.tsx +0 -155
  383. package/dist/src/components/media-player.d.ts +0 -3
  384. package/dist/src/components/media-player.tsx +0 -257
  385. package/dist/src/components/media-suspense.d.ts +0 -78
  386. package/dist/src/components/media-suspense.tsx +0 -362
  387. package/dist/src/components/player-settings-form.d.ts +0 -8
  388. package/dist/src/components/player-settings-form.tsx +0 -163
  389. package/dist/src/components/react-player-wrapper.d.ts +0 -64
  390. package/dist/src/components/react-player-wrapper.tsx +0 -651
  391. package/dist/src/components/simple-video-player.d.ts +0 -9
  392. package/dist/src/components/simple-video-player.tsx +0 -60
  393. package/dist/src/components/ui/button.tsx +0 -49
  394. package/dist/src/components/ui/dropdown-menu.tsx +0 -137
  395. package/dist/src/components/ui/enhanced-seek-bar.d.ts +0 -3
  396. package/dist/src/components/ui/enhanced-seek-bar.tsx +0 -235
  397. package/dist/src/components/ui/fullscreen-button.d.ts +0 -3
  398. package/dist/src/components/ui/fullscreen-button.tsx +0 -60
  399. package/dist/src/components/ui/icons.tsx +0 -174
  400. package/dist/src/components/ui/media-resource-preloader.d.ts +0 -21
  401. package/dist/src/components/ui/media-resource-preloader.tsx +0 -393
  402. package/dist/src/components/ui/play-button.d.ts +0 -3
  403. package/dist/src/components/ui/play-button.tsx +0 -107
  404. package/dist/src/components/ui/seek-bar.d.ts +0 -3
  405. package/dist/src/components/ui/seek-bar.tsx +0 -161
  406. package/dist/src/components/ui/slider.tsx +0 -55
  407. package/dist/src/components/ui/time-display.d.ts +0 -3
  408. package/dist/src/components/ui/time-display.tsx +0 -40
  409. package/dist/src/components/ui/tooltip.tsx +0 -131
  410. package/dist/src/components/ui/volume-control.d.ts +0 -3
  411. package/dist/src/components/ui/volume-control.tsx +0 -143
  412. package/dist/src/components/unified/base-media-player.d.ts +0 -18
  413. package/dist/src/components/unified/base-media-player.tsx +0 -246
  414. package/dist/src/components/unified/media-player.d.ts +0 -37
  415. package/dist/src/components/unified/media-player.tsx +0 -75
  416. package/dist/src/components/variants/minimal/AccessibleMinimalPlayer.d.ts +0 -42
  417. package/dist/src/components/variants/minimal/AccessibleMinimalPlayer.tsx +0 -561
  418. package/dist/src/components/variants/minimal/EnhancedMinimalMediaPlayer.d.ts +0 -44
  419. package/dist/src/components/variants/minimal/EnhancedMinimalMediaPlayer.tsx +0 -552
  420. package/dist/src/components/variants/minimal/MinimalControls.d.ts +0 -19
  421. package/dist/src/components/variants/minimal/MinimalControls.tsx +0 -142
  422. package/dist/src/components/variants/minimal/MinimalLoading.d.ts +0 -10
  423. package/dist/src/components/variants/minimal/MinimalLoading.tsx +0 -32
  424. package/dist/src/components/variants/minimal/MinimalMediaPlayer.d.ts +0 -38
  425. package/dist/src/components/variants/minimal/MinimalMediaPlayer.tsx +0 -315
  426. package/dist/src/components/variants/minimal/MinimalOverlay.d.ts +0 -11
  427. package/dist/src/components/variants/minimal/MinimalOverlay.tsx +0 -64
  428. package/dist/src/components/variants/minimal/MinimalPlayButton.d.ts +0 -9
  429. package/dist/src/components/variants/minimal/MinimalPlayButton.tsx +0 -65
  430. package/dist/src/components/variants/minimal/MinimalSeekBar.d.ts +0 -7
  431. package/dist/src/components/variants/minimal/MinimalSeekBar.tsx +0 -150
  432. package/dist/src/components/variants/minimal/MinimalVolumeControl.d.ts +0 -7
  433. package/dist/src/components/variants/minimal/MinimalVolumeControl.tsx +0 -80
  434. package/dist/src/components/variants/minimal/SimpleMinimalPlayer.d.ts +0 -22
  435. package/dist/src/components/variants/minimal/SimpleMinimalPlayer.tsx +0 -209
  436. package/dist/src/components/variants/minimal/components/CenterPlayButton.d.ts +0 -7
  437. package/dist/src/components/variants/minimal/components/CenterPlayButton.tsx +0 -22
  438. package/dist/src/components/variants/minimal/components/ControlBar.d.ts +0 -43
  439. package/dist/src/components/variants/minimal/components/ControlBar.tsx +0 -146
  440. package/dist/src/components/variants/minimal/components/EnhancedSettingsMenu.d.ts +0 -24
  441. package/dist/src/components/variants/minimal/components/EnhancedSettingsMenu.tsx +0 -361
  442. package/dist/src/components/variants/minimal/components/PlaybackControls.d.ts +0 -9
  443. package/dist/src/components/variants/minimal/components/PlaybackControls.tsx +0 -51
  444. package/dist/src/components/variants/minimal/components/RightControls.d.ts +0 -25
  445. package/dist/src/components/variants/minimal/components/RightControls.tsx +0 -173
  446. package/dist/src/components/variants/minimal/components/SeekBar.d.ts +0 -11
  447. package/dist/src/components/variants/minimal/components/SeekBar.tsx +0 -131
  448. package/dist/src/components/variants/minimal/components/SettingsDropdown.d.ts +0 -9
  449. package/dist/src/components/variants/minimal/components/SettingsDropdown.tsx +0 -70
  450. package/dist/src/components/variants/minimal/components/SubtitleDisplay.d.ts +0 -7
  451. package/dist/src/components/variants/minimal/components/SubtitleDisplay.tsx +0 -21
  452. package/dist/src/components/variants/minimal/components/TimeDisplay.d.ts +0 -7
  453. package/dist/src/components/variants/minimal/components/TimeDisplay.tsx +0 -18
  454. package/dist/src/components/variants/minimal/components/VideoElement.d.ts +0 -13
  455. package/dist/src/components/variants/minimal/components/VideoElement.tsx +0 -40
  456. package/dist/src/components/variants/minimal/components/VolumeControl.d.ts +0 -13
  457. package/dist/src/components/variants/minimal/components/VolumeControl.tsx +0 -217
  458. package/dist/src/components/variants/minimal/index.d.ts +0 -17
  459. package/dist/src/components/variants/minimal/index.ts +0 -23
  460. package/dist/src/components/video-player.d.ts +0 -3
  461. package/dist/src/components/video-player.tsx +0 -100
  462. package/dist/src/context/error-handling.d.ts +0 -72
  463. package/dist/src/context/error-handling.ts +0 -394
  464. package/dist/src/context/media-context.d.ts +0 -104
  465. package/dist/src/context/media-context.tsx +0 -208
  466. package/dist/src/context/media-provider.d.ts +0 -26
  467. package/dist/src/context/media-provider.tsx +0 -265
  468. package/dist/src/context/media-store.d.ts +0 -33
  469. package/dist/src/context/media-store.ts +0 -379
  470. package/dist/src/context/persistence.d.ts +0 -83
  471. package/dist/src/context/persistence.ts +0 -453
  472. package/dist/src/core/events/event-system.d.ts +0 -170
  473. package/dist/src/core/events/event-system.ts +0 -442
  474. package/dist/src/core/events/hooks.d.ts +0 -33
  475. package/dist/src/core/events/hooks.ts +0 -302
  476. package/dist/src/core/events/index.d.ts +0 -6
  477. package/dist/src/core/events/index.ts +0 -22
  478. package/dist/src/core/events/middleware.d.ts +0 -39
  479. package/dist/src/core/events/middleware.ts +0 -269
  480. package/dist/src/core/index.d.ts +0 -8
  481. package/dist/src/core/index.ts +0 -22
  482. package/dist/src/core/optimization/bundle-optimizer.d.ts +0 -44
  483. package/dist/src/core/optimization/bundle-optimizer.tsx +0 -308
  484. package/dist/src/core/performance/cicd.d.ts +0 -8
  485. package/dist/src/core/performance/cicd.ts +0 -96
  486. package/dist/src/core/performance/index.d.ts +0 -10
  487. package/dist/src/core/performance/index.ts +0 -38
  488. package/dist/src/core/performance/media-loading-optimizer.d.ts +0 -105
  489. package/dist/src/core/performance/media-loading-optimizer.ts +0 -538
  490. package/dist/src/core/performance/performance-budgets.d.ts +0 -68
  491. package/dist/src/core/performance/performance-budgets.ts +0 -432
  492. package/dist/src/core/performance/performance-monitor.d.ts +0 -95
  493. package/dist/src/core/performance/performance-monitor.tsx +0 -476
  494. package/dist/src/core/performance/performance-testing.d.ts +0 -69
  495. package/dist/src/core/performance/performance-testing.ts +0 -459
  496. package/dist/src/core/plugins/base-plugin.d.ts +0 -52
  497. package/dist/src/core/plugins/base-plugin.ts +0 -224
  498. package/dist/src/core/plugins/enhanced-plugin-system.d.ts +0 -160
  499. package/dist/src/core/plugins/enhanced-plugin-system.ts +0 -417
  500. package/dist/src/core/plugins/examples/analytics-plugin.d.ts +0 -30
  501. package/dist/src/core/plugins/examples/analytics-plugin.ts +0 -242
  502. package/dist/src/core/plugins/index.d.ts +0 -8
  503. package/dist/src/core/plugins/index.ts +0 -39
  504. package/dist/src/core/plugins/registry.d.ts +0 -31
  505. package/dist/src/core/plugins/registry.ts +0 -327
  506. package/dist/src/core/plugins/types.d.ts +0 -101
  507. package/dist/src/core/plugins/types.ts +0 -159
  508. package/dist/src/core/plugins/utils.d.ts +0 -38
  509. package/dist/src/core/plugins/utils.ts +0 -316
  510. package/dist/src/core/progressive-loading.d.ts +0 -88
  511. package/dist/src/core/progressive-loading.tsx +0 -322
  512. package/dist/src/core/providers/enhanced-hls-provider.d.ts +0 -50
  513. package/dist/src/core/providers/enhanced-hls-provider.ts +0 -308
  514. package/dist/src/core/providers/service-provider.d.ts +0 -49
  515. package/dist/src/core/providers/service-provider.tsx +0 -168
  516. package/dist/src/core/utils.d.ts +0 -25
  517. package/dist/src/core/utils.tsx +0 -38
  518. package/dist/src/features/media-session/media-session-manager.d.ts +0 -132
  519. package/dist/src/features/media-session/media-session-manager.ts +0 -429
  520. package/dist/src/features/picture-in-picture/pip-manager.d.ts +0 -94
  521. package/dist/src/features/picture-in-picture/pip-manager.ts +0 -429
  522. package/dist/src/features/playlist/playlist-manager.d.ts +0 -208
  523. package/dist/src/features/playlist/playlist-manager.ts +0 -606
  524. package/dist/src/features/subtitles/subtitle-manager.d.ts +0 -136
  525. package/dist/src/features/subtitles/subtitle-manager.ts +0 -441
  526. package/dist/src/features/subtitles/subtitle-parser.d.ts +0 -60
  527. package/dist/src/features/subtitles/subtitle-parser.ts +0 -280
  528. package/dist/src/features/thumbnails/thumbnail-generator.d.ts +0 -136
  529. package/dist/src/features/thumbnails/thumbnail-generator.ts +0 -519
  530. package/dist/src/hooks/accessibility/index.d.ts +0 -5
  531. package/dist/src/hooks/accessibility/index.ts +0 -27
  532. package/dist/src/hooks/accessibility/use-accessibility-preferences.d.ts +0 -14
  533. package/dist/src/hooks/accessibility/use-accessibility-preferences.ts +0 -188
  534. package/dist/src/hooks/accessibility/use-focus-management.d.ts +0 -31
  535. package/dist/src/hooks/accessibility/use-focus-management.ts +0 -176
  536. package/dist/src/hooks/accessibility/use-keyboard-shortcuts.d.ts +0 -38
  537. package/dist/src/hooks/accessibility/use-keyboard-shortcuts.ts +0 -144
  538. package/dist/src/hooks/accessibility/use-screen-reader.d.ts +0 -22
  539. package/dist/src/hooks/accessibility/use-screen-reader.ts +0 -182
  540. package/dist/src/hooks/core/index.d.ts +0 -18
  541. package/dist/src/hooks/core/index.ts +0 -47
  542. package/dist/src/hooks/legacy.d.ts +0 -18
  543. package/dist/src/hooks/legacy.ts +0 -27
  544. package/dist/src/hooks/use-enhanced-media-player.d.ts +0 -88
  545. package/dist/src/hooks/use-enhanced-media-player.ts +0 -485
  546. package/dist/src/hooks/use-intelligent-preloading.d.ts +0 -66
  547. package/dist/src/hooks/use-intelligent-preloading.ts +0 -363
  548. package/dist/src/hooks/use-keyboard-controls.d.ts +0 -13
  549. package/dist/src/hooks/use-keyboard-controls.ts +0 -115
  550. package/dist/src/hooks/use-media-actions.d.ts +0 -62
  551. package/dist/src/hooks/use-media-actions.ts +0 -175
  552. package/dist/src/hooks/use-media-metadata.d.ts +0 -11
  553. package/dist/src/hooks/use-media-metadata.ts +0 -89
  554. package/dist/src/hooks/use-media-optimistic.d.ts +0 -36
  555. package/dist/src/hooks/use-media-optimistic.ts +0 -270
  556. package/dist/src/hooks/use-media-player.d.ts +0 -31
  557. package/dist/src/hooks/use-media-player.ts +0 -310
  558. package/dist/src/hooks/use-media-state.d.ts +0 -17
  559. package/dist/src/hooks/use-media-state.ts +0 -190
  560. package/dist/src/hooks/use-memory-optimization.d.ts +0 -40
  561. package/dist/src/hooks/use-memory-optimization.ts +0 -358
  562. package/dist/src/hooks/use-mobile.ts +0 -125
  563. package/dist/src/hooks/use-optimistic-controls.d.ts +0 -22
  564. package/dist/src/hooks/use-optimistic-controls.ts +0 -92
  565. package/dist/src/hooks/use-optimized-media.d.ts +0 -46
  566. package/dist/src/hooks/use-optimized-media.ts +0 -263
  567. package/dist/src/hooks/use-touch-gestures.d.ts +0 -47
  568. package/dist/src/hooks/use-touch-gestures.ts +0 -417
  569. package/dist/src/hooks/useEnhancedSubtitles.d.ts +0 -39
  570. package/dist/src/hooks/useEnhancedSubtitles.ts +0 -258
  571. package/dist/src/hooks/useKeyboardShortcuts.d.ts +0 -10
  572. package/dist/src/hooks/useKeyboardShortcuts.ts +0 -74
  573. package/dist/src/hooks/useMediaControls.d.ts +0 -9
  574. package/dist/src/hooks/useMediaControls.ts +0 -52
  575. package/dist/src/hooks/useScreenshot.d.ts +0 -4
  576. package/dist/src/hooks/useScreenshot.ts +0 -57
  577. package/dist/src/hooks/useSubtitles.d.ts +0 -8
  578. package/dist/src/hooks/useSubtitles.ts +0 -91
  579. package/dist/src/hooks/useVideoPlayer.d.ts +0 -32
  580. package/dist/src/hooks/useVideoPlayer.ts +0 -232
  581. package/dist/src/icons/components/FullscreenIcon.d.ts +0 -3
  582. package/dist/src/icons/components/FullscreenIcon.tsx +0 -37
  583. package/dist/src/icons/components/SettingsIcon.d.ts +0 -3
  584. package/dist/src/icons/components/SettingsIcon.tsx +0 -38
  585. package/dist/src/icons/components/animated/LoadingIcon.d.ts +0 -3
  586. package/dist/src/icons/components/animated/LoadingIcon.tsx +0 -43
  587. package/dist/src/icons/components/animated/PlayPauseIcon.d.ts +0 -7
  588. package/dist/src/icons/components/animated/PlayPauseIcon.tsx +0 -50
  589. package/dist/src/icons/components/media/PauseIcon.d.ts +0 -3
  590. package/dist/src/icons/components/media/PauseIcon.tsx +0 -39
  591. package/dist/src/icons/components/media/PlayIcon.d.ts +0 -3
  592. package/dist/src/icons/components/media/PlayIcon.tsx +0 -38
  593. package/dist/src/icons/components/volume/VolumeIcon.d.ts +0 -3
  594. package/dist/src/icons/components/volume/VolumeIcon.tsx +0 -39
  595. package/dist/src/icons/components/volume/VolumeOffIcon.d.ts +0 -3
  596. package/dist/src/icons/components/volume/VolumeOffIcon.tsx +0 -39
  597. package/dist/src/icons/index.d.ts +0 -28
  598. package/dist/src/icons/index.ts +0 -56
  599. package/dist/src/icons/provider.d.ts +0 -13
  600. package/dist/src/icons/provider.tsx +0 -64
  601. package/dist/src/icons/types.d.ts +0 -18
  602. package/dist/src/icons/types.ts +0 -40
  603. package/dist/src/index-enhanced.d.ts +0 -13
  604. package/dist/src/index-enhanced.ts +0 -35
  605. package/dist/src/index-legacy.d.ts +0 -81
  606. package/dist/src/index-legacy.ts +0 -327
  607. package/dist/src/index.css +0 -102
  608. package/dist/src/index.d.ts +0 -38
  609. package/dist/src/index.minimal.d.ts +0 -2
  610. package/dist/src/index.minimal.ts +0 -4
  611. package/dist/src/index.ts +0 -216
  612. package/dist/src/lib/deprecation.d.ts +0 -7
  613. package/dist/src/lib/deprecation.ts +0 -51
  614. package/dist/src/lib/format-time.d.ts +0 -9
  615. package/dist/src/lib/format-time.ts +0 -37
  616. package/dist/src/lib/index.d.ts +0 -3
  617. package/dist/src/lib/index.ts +0 -3
  618. package/dist/src/lib/utils.d.ts +0 -3
  619. package/dist/src/lib/utils.ts +0 -6
  620. package/dist/src/styles/globals.css +0 -462
  621. package/dist/src/styles/minimal-player.css +0 -589
  622. package/dist/src/styles/pixel-art.css +0 -46
  623. package/dist/src/styles/videojs.css +0 -100
  624. package/dist/src/test/setup.d.ts +0 -2
  625. package/dist/src/test/setup.ts +0 -79
  626. package/dist/src/types/events.d.ts +0 -41
  627. package/dist/src/types/events.ts +0 -47
  628. package/dist/src/types/formats.d.ts +0 -45
  629. package/dist/src/types/formats.ts +0 -95
  630. package/dist/src/types/index.d.ts +0 -128
  631. package/dist/src/types/index.ts +0 -225
  632. package/dist/src/types/videojs-plugins.d.ts +0 -14
  633. package/dist/styles/globals.css +0 -462
  634. package/dist/styles/minimal-player.css +0 -589
  635. package/dist/styles/pixel-art.css +0 -46
  636. package/dist/styles/videojs.css +0 -100
  637. package/src/adapters/videojs-adapter.d.ts +0 -38
  638. package/src/adapters/videojs-adapter.d.ts.map +0 -1
  639. package/src/components/AnimateLoading.d.ts +0 -9
  640. package/src/components/AnimateLoading.d.ts.map +0 -1
  641. package/src/components/LoadingState.d.ts +0 -33
  642. package/src/components/LoadingState.d.ts.map +0 -1
  643. package/src/components/accessibility/keyboard-help-overlay.d.ts +0 -17
  644. package/src/components/accessibility/keyboard-help-overlay.d.ts.map +0 -1
  645. package/src/components/audio-player.d.ts +0 -3
  646. package/src/components/audio-player.d.ts.map +0 -1
  647. package/src/components/basic/index.d.ts +0 -26
  648. package/src/components/basic/index.d.ts.map +0 -1
  649. package/src/components/enhanced/advanced-features.d.ts +0 -45
  650. package/src/components/enhanced/advanced-features.d.ts.map +0 -1
  651. package/src/components/enhanced/debug-panel.d.ts +0 -70
  652. package/src/components/enhanced/debug-panel.d.ts.map +0 -1
  653. package/src/components/enhanced/enhanced-controls.d.ts +0 -50
  654. package/src/components/enhanced/enhanced-controls.d.ts.map +0 -1
  655. package/src/components/enhanced/enhanced-media-player.d.ts +0 -26
  656. package/src/components/enhanced/enhanced-media-player.d.ts.map +0 -1
  657. package/src/components/enhanced/error-handling.d.ts +0 -36
  658. package/src/components/enhanced/error-handling.d.ts.map +0 -1
  659. package/src/components/enhanced/index.d.ts +0 -7
  660. package/src/components/enhanced/index.d.ts.map +0 -1
  661. package/src/components/enhanced/media-player-enhanced.d.ts +0 -21
  662. package/src/components/enhanced/media-player-enhanced.d.ts.map +0 -1
  663. package/src/components/examples/basic-video-player.d.ts +0 -10
  664. package/src/components/examples/basic-video-player.d.ts.map +0 -1
  665. package/src/components/examples/custom-controls-example.d.ts +0 -10
  666. package/src/components/examples/custom-controls-example.d.ts.map +0 -1
  667. package/src/components/examples/enhanced-controls-example.d.ts +0 -9
  668. package/src/components/examples/enhanced-controls-example.d.ts.map +0 -1
  669. package/src/components/examples/enhanced-media-player-example.d.ts +0 -9
  670. package/src/components/examples/enhanced-media-player-example.d.ts.map +0 -1
  671. package/src/components/examples/loading-states-demo.d.ts +0 -2
  672. package/src/components/examples/loading-states-demo.d.ts.map +0 -1
  673. package/src/components/examples/react-19-demo.d.ts +0 -10
  674. package/src/components/examples/react-19-demo.d.ts.map +0 -1
  675. package/src/components/examples/volume-orientation-demo.d.ts +0 -2
  676. package/src/components/examples/volume-orientation-demo.d.ts.map +0 -1
  677. package/src/components/icon-demo.d.ts +0 -2
  678. package/src/components/icon-demo.d.ts.map +0 -1
  679. package/src/components/icons/index.d.ts +0 -36
  680. package/src/components/icons/index.d.ts.map +0 -1
  681. package/src/components/icons/svg-icons/ArrowLeftIcon.d.ts +0 -4
  682. package/src/components/icons/svg-icons/ArrowLeftIcon.d.ts.map +0 -1
  683. package/src/components/icons/svg-icons/ArrowRightIcon.d.ts +0 -4
  684. package/src/components/icons/svg-icons/ArrowRightIcon.d.ts.map +0 -1
  685. package/src/components/icons/svg-icons/AudioIcon.d.ts +0 -4
  686. package/src/components/icons/svg-icons/AudioIcon.d.ts.map +0 -1
  687. package/src/components/icons/svg-icons/BackwardIcon.d.ts +0 -4
  688. package/src/components/icons/svg-icons/BackwardIcon.d.ts.map +0 -1
  689. package/src/components/icons/svg-icons/CameraIcon.d.ts +0 -4
  690. package/src/components/icons/svg-icons/CameraIcon.d.ts.map +0 -1
  691. package/src/components/icons/svg-icons/CheckIcon.d.ts +0 -4
  692. package/src/components/icons/svg-icons/CheckIcon.d.ts.map +0 -1
  693. package/src/components/icons/svg-icons/EnablePiPIcon.d.ts +0 -4
  694. package/src/components/icons/svg-icons/EnablePiPIcon.d.ts.map +0 -1
  695. package/src/components/icons/svg-icons/ForwardIcon.d.ts +0 -4
  696. package/src/components/icons/svg-icons/ForwardIcon.d.ts.map +0 -1
  697. package/src/components/icons/svg-icons/FullscreenEnterIcon.d.ts +0 -4
  698. package/src/components/icons/svg-icons/FullscreenEnterIcon.d.ts.map +0 -1
  699. package/src/components/icons/svg-icons/FullscreenExitIcon.d.ts +0 -4
  700. package/src/components/icons/svg-icons/FullscreenExitIcon.d.ts.map +0 -1
  701. package/src/components/icons/svg-icons/LoadingIcon.d.ts +0 -4
  702. package/src/components/icons/svg-icons/LoadingIcon.d.ts.map +0 -1
  703. package/src/components/icons/svg-icons/PauseIcon.d.ts +0 -4
  704. package/src/components/icons/svg-icons/PauseIcon.d.ts.map +0 -1
  705. package/src/components/icons/svg-icons/PlayIcon.d.ts +0 -4
  706. package/src/components/icons/svg-icons/PlayIcon.d.ts.map +0 -1
  707. package/src/components/icons/svg-icons/PlaybackSpeedIcon.d.ts +0 -4
  708. package/src/components/icons/svg-icons/PlaybackSpeedIcon.d.ts.map +0 -1
  709. package/src/components/icons/svg-icons/QualityIcon.d.ts +0 -4
  710. package/src/components/icons/svg-icons/QualityIcon.d.ts.map +0 -1
  711. package/src/components/icons/svg-icons/SettingsIcon.d.ts +0 -4
  712. package/src/components/icons/svg-icons/SettingsIcon.d.ts.map +0 -1
  713. package/src/components/icons/svg-icons/SliderIcon.d.ts +0 -4
  714. package/src/components/icons/svg-icons/SliderIcon.d.ts.map +0 -1
  715. package/src/components/icons/svg-icons/SubtitleIcon.d.ts +0 -4
  716. package/src/components/icons/svg-icons/SubtitleIcon.d.ts.map +0 -1
  717. package/src/components/icons/svg-icons/SubtitleOffIcon.d.ts +0 -4
  718. package/src/components/icons/svg-icons/SubtitleOffIcon.d.ts.map +0 -1
  719. package/src/components/icons/svg-icons/UnPiPIcon.d.ts +0 -4
  720. package/src/components/icons/svg-icons/UnPiPIcon.d.ts.map +0 -1
  721. package/src/components/icons/svg-icons/VolumeMutedIcon.d.ts +0 -4
  722. package/src/components/icons/svg-icons/VolumeMutedIcon.d.ts.map +0 -1
  723. package/src/components/icons/svg-icons/VolumeOneIcon.d.ts +0 -4
  724. package/src/components/icons/svg-icons/VolumeOneIcon.d.ts.map +0 -1
  725. package/src/components/icons/svg-icons/VolumeThreeIcon.d.ts +0 -4
  726. package/src/components/icons/svg-icons/VolumeThreeIcon.d.ts.map +0 -1
  727. package/src/components/icons/svg-icons/VolumeTwoIcon.d.ts +0 -4
  728. package/src/components/icons/svg-icons/VolumeTwoIcon.d.ts.map +0 -1
  729. package/src/components/legacy.d.ts +0 -13
  730. package/src/components/legacy.d.ts.map +0 -1
  731. package/src/components/media-metadata-display.d.ts +0 -11
  732. package/src/components/media-metadata-display.d.ts.map +0 -1
  733. package/src/components/media-player-audio.d.ts +0 -9
  734. package/src/components/media-player-audio.d.ts.map +0 -1
  735. package/src/components/media-player-controls.d.ts +0 -23
  736. package/src/components/media-player-controls.d.ts.map +0 -1
  737. package/src/components/media-player-error.d.ts +0 -16
  738. package/src/components/media-player-error.d.ts.map +0 -1
  739. package/src/components/media-player-fullscreen.d.ts +0 -12
  740. package/src/components/media-player-fullscreen.d.ts.map +0 -1
  741. package/src/components/media-player-hls.d.ts +0 -23
  742. package/src/components/media-player-hls.d.ts.map +0 -1
  743. package/src/components/media-player-loading.d.ts +0 -12
  744. package/src/components/media-player-loading.d.ts.map +0 -1
  745. package/src/components/media-player-play.d.ts +0 -11
  746. package/src/components/media-player-play.d.ts.map +0 -1
  747. package/src/components/media-player-root.d.ts +0 -28
  748. package/src/components/media-player-root.d.ts.map +0 -1
  749. package/src/components/media-player-seek.d.ts +0 -15
  750. package/src/components/media-player-seek.d.ts.map +0 -1
  751. package/src/components/media-player-time.d.ts +0 -12
  752. package/src/components/media-player-time.d.ts.map +0 -1
  753. package/src/components/media-player-tooltip.d.ts +0 -13
  754. package/src/components/media-player-tooltip.d.ts.map +0 -1
  755. package/src/components/media-player-video.d.ts +0 -9
  756. package/src/components/media-player-video.d.ts.map +0 -1
  757. package/src/components/media-player-volume.d.ts +0 -13
  758. package/src/components/media-player-volume.d.ts.map +0 -1
  759. package/src/components/media-player.d.ts +0 -3
  760. package/src/components/media-player.d.ts.map +0 -1
  761. package/src/components/media-suspense.d.ts +0 -78
  762. package/src/components/media-suspense.d.ts.map +0 -1
  763. package/src/components/player-settings-form.d.ts +0 -8
  764. package/src/components/player-settings-form.d.ts.map +0 -1
  765. package/src/components/react-player-wrapper.d.ts +0 -64
  766. package/src/components/react-player-wrapper.d.ts.map +0 -1
  767. package/src/components/simple-video-player.d.ts +0 -9
  768. package/src/components/simple-video-player.d.ts.map +0 -1
  769. package/src/components/ui/button.tsx +0 -49
  770. package/src/components/ui/dropdown-menu.tsx +0 -137
  771. package/src/components/ui/enhanced-seek-bar.d.ts +0 -3
  772. package/src/components/ui/enhanced-seek-bar.d.ts.map +0 -1
  773. package/src/components/ui/fullscreen-button.d.ts +0 -3
  774. package/src/components/ui/fullscreen-button.d.ts.map +0 -1
  775. package/src/components/ui/icons.tsx +0 -174
  776. package/src/components/ui/media-resource-preloader.d.ts +0 -21
  777. package/src/components/ui/media-resource-preloader.d.ts.map +0 -1
  778. package/src/components/ui/play-button.d.ts +0 -3
  779. package/src/components/ui/play-button.d.ts.map +0 -1
  780. package/src/components/ui/seek-bar.d.ts +0 -3
  781. package/src/components/ui/seek-bar.d.ts.map +0 -1
  782. package/src/components/ui/slider.tsx +0 -55
  783. package/src/components/ui/time-display.d.ts +0 -3
  784. package/src/components/ui/time-display.d.ts.map +0 -1
  785. package/src/components/ui/tooltip.tsx +0 -131
  786. package/src/components/ui/volume-control.d.ts +0 -3
  787. package/src/components/ui/volume-control.d.ts.map +0 -1
  788. package/src/components/unified/base-media-player.d.ts +0 -18
  789. package/src/components/unified/base-media-player.d.ts.map +0 -1
  790. package/src/components/unified/media-player.d.ts +0 -37
  791. package/src/components/unified/media-player.d.ts.map +0 -1
  792. package/src/components/variants/minimal/AccessibleMinimalPlayer.d.ts +0 -42
  793. package/src/components/variants/minimal/AccessibleMinimalPlayer.d.ts.map +0 -1
  794. package/src/components/variants/minimal/EnhancedMinimalMediaPlayer.d.ts +0 -44
  795. package/src/components/variants/minimal/EnhancedMinimalMediaPlayer.d.ts.map +0 -1
  796. package/src/components/variants/minimal/MinimalControls.d.ts +0 -19
  797. package/src/components/variants/minimal/MinimalControls.d.ts.map +0 -1
  798. package/src/components/variants/minimal/MinimalLoading.d.ts +0 -10
  799. package/src/components/variants/minimal/MinimalLoading.d.ts.map +0 -1
  800. package/src/components/variants/minimal/MinimalMediaPlayer.d.ts +0 -38
  801. package/src/components/variants/minimal/MinimalMediaPlayer.d.ts.map +0 -1
  802. package/src/components/variants/minimal/MinimalOverlay.d.ts +0 -11
  803. package/src/components/variants/minimal/MinimalOverlay.d.ts.map +0 -1
  804. package/src/components/variants/minimal/MinimalPlayButton.d.ts +0 -9
  805. package/src/components/variants/minimal/MinimalPlayButton.d.ts.map +0 -1
  806. package/src/components/variants/minimal/MinimalSeekBar.d.ts +0 -7
  807. package/src/components/variants/minimal/MinimalSeekBar.d.ts.map +0 -1
  808. package/src/components/variants/minimal/MinimalVolumeControl.d.ts +0 -7
  809. package/src/components/variants/minimal/MinimalVolumeControl.d.ts.map +0 -1
  810. package/src/components/variants/minimal/SimpleMinimalPlayer.d.ts +0 -22
  811. package/src/components/variants/minimal/SimpleMinimalPlayer.d.ts.map +0 -1
  812. package/src/components/variants/minimal/components/CenterPlayButton.d.ts +0 -7
  813. package/src/components/variants/minimal/components/CenterPlayButton.d.ts.map +0 -1
  814. package/src/components/variants/minimal/components/ControlBar.d.ts +0 -43
  815. package/src/components/variants/minimal/components/ControlBar.d.ts.map +0 -1
  816. package/src/components/variants/minimal/components/EnhancedSettingsMenu.d.ts +0 -24
  817. package/src/components/variants/minimal/components/EnhancedSettingsMenu.d.ts.map +0 -1
  818. package/src/components/variants/minimal/components/PlaybackControls.d.ts +0 -9
  819. package/src/components/variants/minimal/components/PlaybackControls.d.ts.map +0 -1
  820. package/src/components/variants/minimal/components/RightControls.d.ts +0 -25
  821. package/src/components/variants/minimal/components/RightControls.d.ts.map +0 -1
  822. package/src/components/variants/minimal/components/SeekBar.d.ts +0 -11
  823. package/src/components/variants/minimal/components/SeekBar.d.ts.map +0 -1
  824. package/src/components/variants/minimal/components/SettingsDropdown.d.ts +0 -9
  825. package/src/components/variants/minimal/components/SettingsDropdown.d.ts.map +0 -1
  826. package/src/components/variants/minimal/components/SubtitleDisplay.d.ts +0 -7
  827. package/src/components/variants/minimal/components/SubtitleDisplay.d.ts.map +0 -1
  828. package/src/components/variants/minimal/components/TimeDisplay.d.ts +0 -7
  829. package/src/components/variants/minimal/components/TimeDisplay.d.ts.map +0 -1
  830. package/src/components/variants/minimal/components/VideoElement.d.ts +0 -13
  831. package/src/components/variants/minimal/components/VideoElement.d.ts.map +0 -1
  832. package/src/components/variants/minimal/components/VolumeControl.d.ts +0 -13
  833. package/src/components/variants/minimal/components/VolumeControl.d.ts.map +0 -1
  834. package/src/components/variants/minimal/index.d.ts +0 -17
  835. package/src/components/variants/minimal/index.d.ts.map +0 -1
  836. package/src/components/video-player.d.ts +0 -3
  837. package/src/components/video-player.d.ts.map +0 -1
  838. package/src/context/error-handling.d.ts +0 -72
  839. package/src/context/error-handling.d.ts.map +0 -1
  840. package/src/context/media-context.d.ts +0 -104
  841. package/src/context/media-context.d.ts.map +0 -1
  842. package/src/context/media-provider.d.ts +0 -26
  843. package/src/context/media-provider.d.ts.map +0 -1
  844. package/src/context/media-store.d.ts +0 -33
  845. package/src/context/media-store.d.ts.map +0 -1
  846. package/src/context/persistence.d.ts +0 -83
  847. package/src/context/persistence.d.ts.map +0 -1
  848. package/src/core/events/event-system.d.ts +0 -170
  849. package/src/core/events/event-system.d.ts.map +0 -1
  850. package/src/core/events/hooks.d.ts +0 -33
  851. package/src/core/events/hooks.d.ts.map +0 -1
  852. package/src/core/events/index.d.ts +0 -6
  853. package/src/core/events/index.d.ts.map +0 -1
  854. package/src/core/events/middleware.d.ts +0 -39
  855. package/src/core/events/middleware.d.ts.map +0 -1
  856. package/src/core/index.d.ts +0 -8
  857. package/src/core/index.d.ts.map +0 -1
  858. package/src/core/optimization/bundle-optimizer.d.ts +0 -44
  859. package/src/core/optimization/bundle-optimizer.d.ts.map +0 -1
  860. package/src/core/performance/cicd.d.ts +0 -8
  861. package/src/core/performance/cicd.d.ts.map +0 -1
  862. package/src/core/performance/index.d.ts +0 -10
  863. package/src/core/performance/index.d.ts.map +0 -1
  864. package/src/core/performance/media-loading-optimizer.d.ts +0 -105
  865. package/src/core/performance/media-loading-optimizer.d.ts.map +0 -1
  866. package/src/core/performance/performance-budgets.d.ts +0 -68
  867. package/src/core/performance/performance-budgets.d.ts.map +0 -1
  868. package/src/core/performance/performance-monitor.d.ts +0 -95
  869. package/src/core/performance/performance-monitor.d.ts.map +0 -1
  870. package/src/core/performance/performance-testing.d.ts +0 -69
  871. package/src/core/performance/performance-testing.d.ts.map +0 -1
  872. package/src/core/plugins/base-plugin.d.ts +0 -52
  873. package/src/core/plugins/base-plugin.d.ts.map +0 -1
  874. package/src/core/plugins/enhanced-plugin-system.d.ts +0 -160
  875. package/src/core/plugins/enhanced-plugin-system.d.ts.map +0 -1
  876. package/src/core/plugins/examples/analytics-plugin.d.ts +0 -30
  877. package/src/core/plugins/examples/analytics-plugin.d.ts.map +0 -1
  878. package/src/core/plugins/index.d.ts +0 -8
  879. package/src/core/plugins/index.d.ts.map +0 -1
  880. package/src/core/plugins/registry.d.ts +0 -31
  881. package/src/core/plugins/registry.d.ts.map +0 -1
  882. package/src/core/plugins/types.d.ts +0 -101
  883. package/src/core/plugins/types.d.ts.map +0 -1
  884. package/src/core/plugins/utils.d.ts +0 -38
  885. package/src/core/plugins/utils.d.ts.map +0 -1
  886. package/src/core/progressive-loading.d.ts +0 -88
  887. package/src/core/progressive-loading.d.ts.map +0 -1
  888. package/src/core/providers/enhanced-hls-provider.d.ts +0 -50
  889. package/src/core/providers/enhanced-hls-provider.d.ts.map +0 -1
  890. package/src/core/providers/service-provider.d.ts +0 -49
  891. package/src/core/providers/service-provider.d.ts.map +0 -1
  892. package/src/core/utils.d.ts +0 -25
  893. package/src/core/utils.d.ts.map +0 -1
  894. package/src/features/media-session/media-session-manager.d.ts +0 -132
  895. package/src/features/media-session/media-session-manager.d.ts.map +0 -1
  896. package/src/features/picture-in-picture/pip-manager.d.ts +0 -94
  897. package/src/features/picture-in-picture/pip-manager.d.ts.map +0 -1
  898. package/src/features/playlist/playlist-manager.d.ts +0 -208
  899. package/src/features/playlist/playlist-manager.d.ts.map +0 -1
  900. package/src/features/subtitles/subtitle-manager.d.ts +0 -136
  901. package/src/features/subtitles/subtitle-manager.d.ts.map +0 -1
  902. package/src/features/subtitles/subtitle-parser.d.ts +0 -60
  903. package/src/features/subtitles/subtitle-parser.d.ts.map +0 -1
  904. package/src/features/thumbnails/thumbnail-generator.d.ts +0 -136
  905. package/src/features/thumbnails/thumbnail-generator.d.ts.map +0 -1
  906. package/src/hooks/accessibility/index.d.ts +0 -5
  907. package/src/hooks/accessibility/index.d.ts.map +0 -1
  908. package/src/hooks/accessibility/use-accessibility-preferences.d.ts +0 -14
  909. package/src/hooks/accessibility/use-accessibility-preferences.d.ts.map +0 -1
  910. package/src/hooks/accessibility/use-focus-management.d.ts +0 -31
  911. package/src/hooks/accessibility/use-focus-management.d.ts.map +0 -1
  912. package/src/hooks/accessibility/use-keyboard-shortcuts.d.ts +0 -38
  913. package/src/hooks/accessibility/use-keyboard-shortcuts.d.ts.map +0 -1
  914. package/src/hooks/accessibility/use-screen-reader.d.ts +0 -22
  915. package/src/hooks/accessibility/use-screen-reader.d.ts.map +0 -1
  916. package/src/hooks/core/index.d.ts +0 -18
  917. package/src/hooks/core/index.d.ts.map +0 -1
  918. package/src/hooks/legacy.d.ts +0 -18
  919. package/src/hooks/legacy.d.ts.map +0 -1
  920. package/src/hooks/use-enhanced-media-player.d.ts +0 -88
  921. package/src/hooks/use-enhanced-media-player.d.ts.map +0 -1
  922. package/src/hooks/use-intelligent-preloading.d.ts +0 -66
  923. package/src/hooks/use-intelligent-preloading.d.ts.map +0 -1
  924. package/src/hooks/use-keyboard-controls.d.ts +0 -13
  925. package/src/hooks/use-keyboard-controls.d.ts.map +0 -1
  926. package/src/hooks/use-media-actions.d.ts +0 -62
  927. package/src/hooks/use-media-actions.d.ts.map +0 -1
  928. package/src/hooks/use-media-metadata.d.ts +0 -11
  929. package/src/hooks/use-media-metadata.d.ts.map +0 -1
  930. package/src/hooks/use-media-optimistic.d.ts +0 -36
  931. package/src/hooks/use-media-optimistic.d.ts.map +0 -1
  932. package/src/hooks/use-media-player.d.ts +0 -31
  933. package/src/hooks/use-media-player.d.ts.map +0 -1
  934. package/src/hooks/use-media-state.d.ts +0 -17
  935. package/src/hooks/use-media-state.d.ts.map +0 -1
  936. package/src/hooks/use-memory-optimization.d.ts +0 -40
  937. package/src/hooks/use-memory-optimization.d.ts.map +0 -1
  938. package/src/hooks/use-mobile.ts +0 -125
  939. package/src/hooks/use-optimistic-controls.d.ts +0 -22
  940. package/src/hooks/use-optimistic-controls.d.ts.map +0 -1
  941. package/src/hooks/use-optimized-media.d.ts +0 -46
  942. package/src/hooks/use-optimized-media.d.ts.map +0 -1
  943. package/src/hooks/use-touch-gestures.d.ts +0 -47
  944. package/src/hooks/use-touch-gestures.d.ts.map +0 -1
  945. package/src/hooks/useEnhancedSubtitles.d.ts +0 -39
  946. package/src/hooks/useEnhancedSubtitles.d.ts.map +0 -1
  947. package/src/hooks/useKeyboardShortcuts.d.ts +0 -10
  948. package/src/hooks/useKeyboardShortcuts.d.ts.map +0 -1
  949. package/src/hooks/useMediaControls.d.ts +0 -9
  950. package/src/hooks/useMediaControls.d.ts.map +0 -1
  951. package/src/hooks/useScreenshot.d.ts +0 -4
  952. package/src/hooks/useScreenshot.d.ts.map +0 -1
  953. package/src/hooks/useSubtitles.d.ts +0 -8
  954. package/src/hooks/useSubtitles.d.ts.map +0 -1
  955. package/src/hooks/useVideoPlayer.d.ts +0 -32
  956. package/src/hooks/useVideoPlayer.d.ts.map +0 -1
  957. package/src/icons/components/FullscreenIcon.d.ts +0 -3
  958. package/src/icons/components/FullscreenIcon.d.ts.map +0 -1
  959. package/src/icons/components/SettingsIcon.d.ts +0 -3
  960. package/src/icons/components/SettingsIcon.d.ts.map +0 -1
  961. package/src/icons/components/animated/LoadingIcon.d.ts +0 -3
  962. package/src/icons/components/animated/LoadingIcon.d.ts.map +0 -1
  963. package/src/icons/components/animated/PlayPauseIcon.d.ts +0 -7
  964. package/src/icons/components/animated/PlayPauseIcon.d.ts.map +0 -1
  965. package/src/icons/components/media/PauseIcon.d.ts +0 -3
  966. package/src/icons/components/media/PauseIcon.d.ts.map +0 -1
  967. package/src/icons/components/media/PlayIcon.d.ts +0 -3
  968. package/src/icons/components/media/PlayIcon.d.ts.map +0 -1
  969. package/src/icons/components/volume/VolumeIcon.d.ts +0 -3
  970. package/src/icons/components/volume/VolumeIcon.d.ts.map +0 -1
  971. package/src/icons/components/volume/VolumeOffIcon.d.ts +0 -3
  972. package/src/icons/components/volume/VolumeOffIcon.d.ts.map +0 -1
  973. package/src/icons/index.d.ts +0 -28
  974. package/src/icons/index.d.ts.map +0 -1
  975. package/src/icons/provider.d.ts +0 -13
  976. package/src/icons/provider.d.ts.map +0 -1
  977. package/src/icons/types.d.ts +0 -18
  978. package/src/icons/types.d.ts.map +0 -1
  979. package/src/index-enhanced.d.ts +0 -13
  980. package/src/index-enhanced.d.ts.map +0 -1
  981. package/src/index-legacy.d.ts +0 -81
  982. package/src/index-legacy.d.ts.map +0 -1
  983. package/src/index.d.ts +0 -38
  984. package/src/index.d.ts.map +0 -1
  985. package/src/index.minimal.d.ts +0 -2
  986. package/src/index.minimal.d.ts.map +0 -1
  987. package/src/index.minimal.ts +0 -4
  988. package/src/lib/deprecation.d.ts +0 -7
  989. package/src/lib/deprecation.d.ts.map +0 -1
  990. package/src/lib/format-time.d.ts +0 -9
  991. package/src/lib/format-time.d.ts.map +0 -1
  992. package/src/lib/index.d.ts +0 -3
  993. package/src/lib/index.d.ts.map +0 -1
  994. package/src/lib/utils.d.ts +0 -3
  995. package/src/lib/utils.d.ts.map +0 -1
  996. package/src/test/setup.d.ts +0 -2
  997. package/src/test/setup.d.ts.map +0 -1
  998. package/src/types/events.d.ts +0 -41
  999. package/src/types/events.d.ts.map +0 -1
  1000. package/src/types/formats.d.ts +0 -45
  1001. package/src/types/formats.d.ts.map +0 -1
  1002. package/src/types/index.d.ts +0 -128
  1003. package/src/types/index.d.ts.map +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"core-events-B1iM2F46.cjs","sources":["../src/core/events/event-system.ts","../src/core/events/middleware.ts","../src/core/events/hooks.ts","../src/core/events/index.ts"],"sourcesContent":["// Event system types\nexport interface MediaPlayerEvent {\n\ttype: string\n\ttimestamp: number\n\ttarget?: string\n\tdetail?: any\n\tbubbles?: boolean\n\tcancelable?: boolean\n\tdefaultPrevented?: boolean\n}\n\nexport type EventHandler<T = any> = (event: MediaPlayerEvent & { detail: T }) => void\nexport type EventUnsubscriber = () => void\n\nexport interface EventOptions {\n\tonce?: boolean\n\tpassive?: boolean\n\tpriority?: \"high\" | \"normal\" | \"low\"\n\tfilter?: (event: MediaPlayerEvent) => boolean\n}\n\n// Event categories for organization\nexport type EventCategory =\n\t| \"media\" // Media playback events\n\t| \"user\" // User interaction events\n\t| \"system\" // System/internal events\n\t| \"plugin\" // Plugin events\n\t| \"error\" // Error events\n\t| \"performance\" // Performance events\n\n// Standard media events\nexport interface MediaEvents {\n\t// Playback events\n\t\"media:loadstart\": { src: string }\n\t\"media:loadeddata\": { duration: number }\n\t\"media:canplay\": {}\n\t\"media:canplaythrough\": {}\n\t\"media:play\": { currentTime: number }\n\t\"media:pause\": { currentTime: number }\n\t\"media:ended\": { duration: number }\n\t\"media:seeking\": { currentTime: number; targetTime: number }\n\t\"media:seeked\": { currentTime: number; previousTime: number }\n\t\"media:timeupdate\": { currentTime: number; duration: number }\n\t\"media:durationchange\": { duration: number }\n\t\"media:volumechange\": { volume: number; muted: boolean }\n\t\"media:ratechange\": { playbackRate: number }\n\n\t// Loading events\n\t\"media:loadedmetadata\": { src: string }\n\t\"media:progress\": { buffered: TimeRanges }\n\t\"media:suspend\": {}\n\t\"media:abort\": {}\n\t\"media:error\": { error: Error }\n\t\"media:stalled\": {}\n\t\"media:waiting\": {}\n\n\t// User interaction events\n\t\"user:click\": { x: number; y: number; element: string }\n\t\"user:hover\": { element: string }\n\t\"user:focus\": { element: string }\n\t\"user:keyboard\": {\n\t\tkey: string\n\t\tcode: string\n\t\taltKey: boolean\n\t\tctrlKey: boolean\n\t\tshiftKey: boolean\n\t}\n\t\"user:gesture\": { type: string; data: any }\n\n\t// System events\n\t\"system:ready\": {}\n\t\"system:resize\": { width: number; height: number }\n\t\"system:fullscreen\": { isFullscreen: boolean }\n\t\"system:pip\": { isPictureInPicture: boolean }\n\t\"system:visibility\": { isVisible: boolean }\n\n\t// Plugin events\n\t\"plugin:loaded\": { name: string }\n\t\"plugin:enabled\": { name: string }\n\t\"plugin:disabled\": { name: string }\n\t\"plugin:error\": { name: string; error: Error }\n\n\t// Performance events\n\t\"performance:fps\": { fps: number }\n\t\"performance:memory\": { used: number; total: number }\n\t\"performance:load\": { loadTime: number }\n}\n\n// Event bus implementation\nexport class EventBus {\n\tprivate listeners = new Map<\n\t\tstring,\n\t\tArray<{\n\t\t\thandler: EventHandler\n\t\t\toptions: EventOptions\n\t\t\tid: string\n\t\t}>\n\t>()\n\n\tprivate eventQueue: MediaPlayerEvent[] = []\n\tprivate isProcessing = false\n\tprivate middlewares: Array<(event: MediaPlayerEvent) => MediaPlayerEvent | null> = []\n\tprivate eventHistory: MediaPlayerEvent[] = []\n\tprivate maxHistorySize = 1000\n\n\t// Subscribe to events\n\ton<K extends keyof MediaEvents>(\n\t\ttype: K,\n\t\thandler: EventHandler<MediaEvents[K]>,\n\t\toptions: EventOptions = {}\n\t): EventUnsubscriber {\n\t\treturn this.addEventListener(type, handler as EventHandler, options)\n\t}\n\n\t// Subscribe to events (one-time)\n\tonce<K extends keyof MediaEvents>(\n\t\ttype: K,\n\t\thandler: EventHandler<MediaEvents[K]>,\n\t\toptions: EventOptions = {}\n\t): EventUnsubscriber {\n\t\treturn this.addEventListener(type, handler as EventHandler, { ...options, once: true })\n\t}\n\n\t// Subscribe to events with wildcard support\n\taddEventListener(\n\t\ttype: string,\n\t\thandler: EventHandler,\n\t\toptions: EventOptions = {}\n\t): EventUnsubscriber {\n\t\tconst id = this.generateId()\n\t\tconst listener = { handler, options, id }\n\n\t\tif (!this.listeners.has(type)) {\n\t\t\tthis.listeners.set(type, [])\n\t\t}\n\n\t\tconst listeners = this.listeners.get(type)!\n\n\t\t// Insert based on priority\n\t\tconst priority = options.priority || \"normal\"\n\t\tconst priorityValue = { high: 2, normal: 1, low: 0 }[priority]\n\n\t\tlet insertIndex = listeners.length\n\t\tfor (let i = 0; i < listeners.length; i++) {\n\t\t\tconst listener = listeners[i]\n\t\t\tif (!listener) continue\n\t\t\tconst listenerPriority = listener.options.priority || \"normal\"\n\t\t\tif (priorityValue > { high: 2, normal: 1, low: 0 }[listenerPriority]) {\n\t\t\t\tinsertIndex = i\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\n\t\tlisteners.splice(insertIndex, 0, listener)\n\n\t\t// Return unsubscriber\n\t\treturn () => {\n\t\t\tconst index = listeners.findIndex((l) => l.id === id)\n\t\t\tif (index !== -1) {\n\t\t\t\tlisteners.splice(index, 1)\n\t\t\t}\n\t\t\tif (listeners.length === 0) {\n\t\t\t\tthis.listeners.delete(type)\n\t\t\t}\n\t\t}\n\t}\n\n\t// Remove event listener\n\tremoveEventListener(type: string, handler?: EventHandler): void {\n\t\tconst listeners = this.listeners.get(type)\n\t\tif (!listeners) return\n\n\t\tif (handler) {\n\t\t\tconst index = listeners.findIndex((l) => l.handler === handler)\n\t\t\tif (index !== -1) {\n\t\t\t\tlisteners.splice(index, 1)\n\t\t\t}\n\t\t} else {\n\t\t\tthis.listeners.delete(type)\n\t\t}\n\n\t\tif (listeners && listeners.length === 0) {\n\t\t\tthis.listeners.delete(type)\n\t\t}\n\t}\n\n\t// Emit events\n\temit<K extends keyof MediaEvents>(\n\t\ttype: K,\n\t\tdetail?: MediaEvents[K],\n\t\toptions?: Partial<MediaPlayerEvent>\n\t): boolean {\n\t\tconst event: MediaPlayerEvent = {\n\t\t\ttype,\n\t\t\ttimestamp: Date.now(),\n\t\t\tdetail,\n\t\t\tbubbles: true,\n\t\t\tcancelable: true,\n\t\t\tdefaultPrevented: false,\n\t\t\t...options\n\t\t}\n\n\t\treturn this.dispatchEvent(event)\n\t}\n\n\t// Dispatch event\n\tdispatchEvent(event: MediaPlayerEvent): boolean {\n\t\t// Apply middlewares\n\t\tlet processedEvent: MediaPlayerEvent | null = event\n\t\tfor (const middleware of this.middlewares) {\n\t\t\tprocessedEvent = middleware(processedEvent)\n\t\t\tif (!processedEvent) {\n\t\t\t\treturn false // Event was cancelled by middleware\n\t\t\t}\n\t\t}\n\n\t\t// Add to history\n\t\tthis.addToHistory(processedEvent)\n\n\t\t// Queue event for processing\n\t\tthis.eventQueue.push(processedEvent)\n\n\t\tif (!this.isProcessing) {\n\t\t\tthis.processEventQueue()\n\t\t}\n\n\t\treturn !processedEvent.defaultPrevented\n\t}\n\n\t// Process event queue with React 19 concurrent scheduling\n\tprivate processEventQueue(): void {\n\t\tif (this.isProcessing) return\n\n\t\tthis.isProcessing = true\n\n\t\t// Use scheduler for non-blocking event processing\n\t\tconst schedule =\n\t\t\ttypeof window !== \"undefined\" && \"scheduler\" in window\n\t\t\t\t? (window as any).scheduler.postTask\n\t\t\t\t: (cb: () => void) => setTimeout(cb, 0)\n\n\t\tconst processNext = () => {\n\t\t\tif (this.eventQueue.length === 0) {\n\t\t\t\tthis.isProcessing = false\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tconst batchSize = Math.min(this.eventQueue.length, 5) // Process max 5 events per frame\n\t\t\tconst events = this.eventQueue.splice(0, batchSize)\n\n\t\t\t// Process events in parallel using Promise.all\n\t\t\tPromise.all(events.map((event) => this.processEvent(event).catch(console.error)))\n\t\t\t\t.then(() => {\n\t\t\t\t\t// Schedule next batch in next frame\n\t\t\t\t\tschedule(processNext)\n\t\t\t\t})\n\t\t\t\t.catch(() => {\n\t\t\t\t\tthis.isProcessing = false\n\t\t\t\t})\n\t\t}\n\n\t\tschedule(processNext)\n\t}\n\n\t// Process individual event\n\tprivate async processEvent(event: MediaPlayerEvent): Promise<void> {\n\t\tconst { type } = event\n\n\t\t// Get exact matches\n\t\tconst exactListeners = this.listeners.get(type) || []\n\n\t\t// Get wildcard matches\n\t\tconst wildcardListeners: typeof exactListeners = []\n\t\tfor (const [pattern, listeners] of this.listeners.entries()) {\n\t\t\tif (pattern.includes(\"*\") && this.matchPattern(type, pattern)) {\n\t\t\t\twildcardListeners.push(...listeners)\n\t\t\t}\n\t\t}\n\n\t\t// Combine and sort by priority\n\t\tconst allListeners = [...exactListeners, ...wildcardListeners].sort((a, b) => {\n\t\t\tconst priorityA = { high: 2, normal: 1, low: 0 }[a.options.priority || \"normal\"]\n\t\t\tconst priorityB = { high: 2, normal: 1, low: 0 }[b.options.priority || \"normal\"]\n\t\t\treturn priorityB - priorityA\n\t\t})\n\n\t\t// Execute listeners\n\t\tconst listenersToRemove: string[] = []\n\n\t\tfor (const listener of allListeners) {\n\t\t\t// Apply filter if present\n\t\t\tif (listener.options.filter && !listener.options.filter(event)) {\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\ttry {\n\t\t\t\t// Execute handler\n\t\t\t\tawait Promise.resolve(listener.handler(event as any))\n\n\t\t\t\t// Mark for removal if once\n\t\t\t\tif (listener.options.once) {\n\t\t\t\t\tlistenersToRemove.push(listener.id)\n\t\t\t\t}\n\n\t\t\t\t// Stop propagation if event was cancelled\n\t\t\t\tif (event.defaultPrevented && !event.bubbles) {\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t} catch (error) {\n\t\t\t\tconsole.error(`Error in event handler for ${type}:`, error)\n\n\t\t\t\t// Log error instead\n\t\t\t\tconsole.error(`Event handler error for ${type}:`, error)\n\t\t\t}\n\t\t}\n\n\t\t// Remove one-time listeners\n\t\tfor (const id of listenersToRemove) {\n\t\t\tfor (const [eventType, listeners] of this.listeners.entries()) {\n\t\t\t\tconst index = listeners.findIndex((l) => l.id === id)\n\t\t\t\tif (index !== -1) {\n\t\t\t\t\tlisteners.splice(index, 1)\n\t\t\t\t\tif (listeners.length === 0) {\n\t\t\t\t\t\tthis.listeners.delete(eventType)\n\t\t\t\t\t}\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t// Add middleware\n\tuse(middleware: (event: MediaPlayerEvent) => MediaPlayerEvent | null): () => void {\n\t\tthis.middlewares.push(middleware)\n\t\treturn () => {\n\t\t\tconst index = this.middlewares.indexOf(middleware)\n\t\t\tif (index !== -1) {\n\t\t\t\tthis.middlewares.splice(index, 1)\n\t\t\t}\n\t\t}\n\t}\n\n\t// Event history management\n\tprivate addToHistory(event: MediaPlayerEvent): void {\n\t\tthis.eventHistory.push(event)\n\t\tif (this.eventHistory.length > this.maxHistorySize) {\n\t\t\tthis.eventHistory.shift()\n\t\t}\n\t}\n\n\t// Get event history\n\tgetHistory(filter?: (event: MediaPlayerEvent) => boolean): MediaPlayerEvent[] {\n\t\treturn filter ? this.eventHistory.filter(filter) : [...this.eventHistory]\n\t}\n\n\t// Clear event history\n\tclearHistory(): void {\n\t\tthis.eventHistory = []\n\t}\n\n\t// Pattern matching for wildcards\n\tprivate matchPattern(eventType: string, pattern: string): boolean {\n\t\tconst regex = new RegExp(\"^\" + pattern.replace(/\\*/g, \".*\").replace(/\\?/g, \".\") + \"$\")\n\t\treturn regex.test(eventType)\n\t}\n\n\t// Generate unique ID\n\tprivate generateId(): string {\n\t\treturn `event_${Date.now()}_${Math.random().toString(36).substr(2, 9)}`\n\t}\n\n\t// Get listener count\n\tgetListenerCount(type?: string): number {\n\t\tif (type) {\n\t\t\treturn this.listeners.get(type)?.length || 0\n\t\t}\n\t\treturn Array.from(this.listeners.values()).reduce((sum, listeners) => sum + listeners.length, 0)\n\t}\n\n\t// Get all event types\n\tgetEventTypes(): string[] {\n\t\treturn Array.from(this.listeners.keys())\n\t}\n\n\t// Clear all listeners\n\tremoveAllListeners(type?: string): void {\n\t\tif (type) {\n\t\t\tthis.listeners.delete(type)\n\t\t} else {\n\t\t\tthis.listeners.clear()\n\t\t}\n\t}\n\n\t// Destroy event bus\n\tdestroy(): void {\n\t\tthis.listeners.clear()\n\t\tthis.eventQueue = []\n\t\tthis.middlewares = []\n\t\tthis.eventHistory = []\n\t\tthis.isProcessing = false\n\t}\n}\n\n// Default event bus instance\nexport const defaultEventBus = new EventBus()\n\n// Event delegation helper\nexport class EventDelegator {\n\tprivate eventBus: EventBus\n\tprivate element: HTMLElement\n\tprivate delegatedEvents = new Set<string>()\n\n\tconstructor(eventBus: EventBus, element: HTMLElement) {\n\t\tthis.eventBus = eventBus\n\t\tthis.element = element\n\t}\n\n\t// Delegate DOM events to event bus\n\tdelegate(domEvent: string, mediaEvent?: string): void {\n\t\tif (this.delegatedEvents.has(domEvent)) return\n\n\t\tconst handler = (e: Event) => {\n\t\t\tthis.eventBus.emit(mediaEvent || (`dom:${domEvent}` as any), {\n\t\t\t\toriginalEvent: e,\n\t\t\t\ttarget: (e.target as HTMLElement)?.tagName.toLowerCase(),\n\t\t\t\tcurrentTarget: (e.currentTarget as HTMLElement)?.tagName.toLowerCase()\n\t\t\t})\n\t\t}\n\n\t\tthis.element.addEventListener(domEvent, handler, { passive: true })\n\t\tthis.delegatedEvents.add(domEvent)\n\t}\n\n\t// Setup common delegations\n\tsetupCommonDelegations(): void {\n\t\tthis.delegate(\"click\", \"user:click\")\n\t\tthis.delegate(\"mouseenter\", \"user:hover\")\n\t\tthis.delegate(\"mouseleave\", \"user:hover\")\n\t\tthis.delegate(\"focus\", \"user:focus\")\n\t\tthis.delegate(\"blur\", \"user:focus\")\n\t\tthis.delegate(\"keydown\", \"user:keyboard\")\n\t\tthis.delegate(\"keyup\", \"user:keyboard\")\n\t}\n\n\tdestroy(): void {\n\t\tthis.delegatedEvents.clear()\n\t}\n}\n","import type { MediaPlayerEvent } from \"./event-system\"\n\n// Middleware function type\nexport type EventMiddleware = (event: MediaPlayerEvent) => MediaPlayerEvent | null\n\n// Common middleware implementations\nexport const eventMiddlewares = {\n\t// Logging middleware\n\tlogger:\n\t\t(prefix = \"[Event]\"): EventMiddleware =>\n\t\t(event) => {\n\t\t\tif (process.env.NODE_ENV === \"development\") {\n\t\t\t\tconsole.log(`${prefix} ${event.type}`, event.detail)\n\t\t\t}\n\t\t\treturn event\n\t\t},\n\n\t// Throttling middleware\n\tthrottle: (eventTypes: string[], delay = 100): EventMiddleware => {\n\t\tconst lastTimes = new Map<string, number>()\n\n\t\treturn (event) => {\n\t\t\tif (eventTypes.includes(event.type)) {\n\t\t\t\tconst lastTime = lastTimes.get(event.type) || 0\n\t\t\t\tconst now = event.timestamp\n\n\t\t\t\tif (now - lastTime < delay) {\n\t\t\t\t\treturn null // Throttle this event\n\t\t\t\t}\n\n\t\t\t\tlastTimes.set(event.type, now)\n\t\t\t}\n\n\t\t\treturn event\n\t\t}\n\t},\n\n\t// Debouncing middleware\n\tdebounce: (eventTypes: string[], delay = 100): EventMiddleware => {\n\t\tconst timeouts = new Map<string, NodeJS.Timeout>()\n\t\tconst eventQueue = new Map<string, MediaPlayerEvent>()\n\n\t\treturn (event) => {\n\t\t\tif (eventTypes.includes(event.type)) {\n\t\t\t\t// Clear existing timeout\n\t\t\t\tconst existingTimeout = timeouts.get(event.type)\n\t\t\t\tif (existingTimeout) {\n\t\t\t\t\tclearTimeout(existingTimeout)\n\t\t\t\t}\n\n\t\t\t\t// Store the latest event\n\t\t\t\teventQueue.set(event.type, event)\n\n\t\t\t\t// Set new timeout\n\t\t\t\tconst timeout = setTimeout(() => {\n\t\t\t\t\tconst queuedEvent = eventQueue.get(event.type)\n\t\t\t\t\tif (queuedEvent) {\n\t\t\t\t\t\t// Process the debounced event\n\t\t\t\t\t\t// Note: This is a simplified approach - in a real implementation,\n\t\t\t\t\t\t// you'd need to re-inject the event into the processing pipeline\n\t\t\t\t\t\teventQueue.delete(event.type)\n\t\t\t\t\t\ttimeouts.delete(event.type)\n\t\t\t\t\t}\n\t\t\t\t}, delay)\n\n\t\t\t\ttimeouts.set(event.type, timeout)\n\n\t\t\t\treturn null // Don't process immediately\n\t\t\t}\n\n\t\t\treturn event\n\t\t}\n\t},\n\n\t// Filtering middleware\n\tfilter:\n\t\t(predicate: (event: MediaPlayerEvent) => boolean): EventMiddleware =>\n\t\t(event) => {\n\t\t\treturn predicate(event) ? event : null\n\t\t},\n\n\t// Event transformation middleware\n\ttransform:\n\t\t(transformer: (event: MediaPlayerEvent) => MediaPlayerEvent): EventMiddleware =>\n\t\t(event) => {\n\t\t\ttry {\n\t\t\t\treturn transformer(event)\n\t\t\t} catch (error) {\n\t\t\t\tconsole.error(\"Error in event transformer:\", error)\n\t\t\t\treturn event\n\t\t\t}\n\t\t},\n\n\t// Performance monitoring middleware\n\tperformance: (): EventMiddleware => {\n\t\tconst metrics = new Map<string, { count: number; totalTime: number }>()\n\n\t\treturn (event) => {\n\t\t\tconst startTime = performance.now()\n\n\t\t\t// Update metrics\n\t\t\tconst existing = metrics.get(event.type) || { count: 0, totalTime: 0 }\n\t\t\texisting.count++\n\t\t\texisting.totalTime += performance.now() - startTime\n\t\t\tmetrics.set(event.type, existing)\n\n\t\t\t// Log metrics periodically (every 100 events)\n\t\t\tif (existing.count % 100 === 0) {\n\t\t\t\tconst avgTime = existing.totalTime / existing.count\n\t\t\t\tconsole.log(`Event ${event.type}: ${existing.count} calls, avg ${avgTime.toFixed(2)}ms`)\n\t\t\t}\n\n\t\t\treturn event\n\t\t}\n\t},\n\n\t// Error handling middleware\n\terrorHandler:\n\t\t(onError?: (error: Error, event: MediaPlayerEvent) => void): EventMiddleware =>\n\t\t(event) => {\n\t\t\ttry {\n\t\t\t\t// Validate event structure\n\t\t\t\tif (!event.type || typeof event.type !== \"string\") {\n\t\t\t\t\tthrow new Error(\"Invalid event: missing or invalid type\")\n\t\t\t\t}\n\n\t\t\t\tif (!event.timestamp || typeof event.timestamp !== \"number\") {\n\t\t\t\t\tthrow new Error(\"Invalid event: missing or invalid timestamp\")\n\t\t\t\t}\n\n\t\t\t\treturn event\n\t\t\t} catch (error) {\n\t\t\t\tif (onError) {\n\t\t\t\t\tonError(error as Error, event)\n\t\t\t\t} else {\n\t\t\t\t\tconsole.error(\"Event validation error:\", error)\n\t\t\t\t}\n\t\t\t\treturn null\n\t\t\t}\n\t\t},\n\n\t// Security middleware (prevent certain events or sanitize data)\n\tsecurity:\n\t\t(\n\t\t\toptions: {\n\t\t\t\tblockedEventTypes?: string[]\n\t\t\t\tsanitizeDetail?: boolean\n\t\t\t\tmaxDetailSize?: number\n\t\t\t} = {}\n\t\t): EventMiddleware =>\n\t\t(event) => {\n\t\t\tconst { blockedEventTypes = [], sanitizeDetail = true, maxDetailSize = 10000 } = options\n\n\t\t\t// Block certain event types\n\t\t\tif (blockedEventTypes.includes(event.type)) {\n\t\t\t\tconsole.warn(`Blocked event type: ${event.type}`)\n\t\t\t\treturn null\n\t\t\t}\n\n\t\t\t// Sanitize detail if needed\n\t\t\tif (sanitizeDetail && event.detail) {\n\t\t\t\ttry {\n\t\t\t\t\tconst detailStr = JSON.stringify(event.detail)\n\t\t\t\t\tif (detailStr.length > maxDetailSize) {\n\t\t\t\t\t\tconsole.warn(`Event detail too large, truncating: ${event.type}`)\n\t\t\t\t\t\tevent.detail = { ...event.detail, _truncated: true }\n\t\t\t\t\t}\n\t\t\t\t} catch (error) {\n\t\t\t\t\tconsole.warn(`Failed to serialize event detail: ${event.type}`)\n\t\t\t\t\tevent.detail = { _serializationError: true }\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn event\n\t\t},\n\n\t// Conditional middleware\n\twhen:\n\t\t(\n\t\t\tcondition: (event: MediaPlayerEvent) => boolean,\n\t\t\tmiddleware: EventMiddleware\n\t\t): EventMiddleware =>\n\t\t(event) => {\n\t\t\treturn condition(event) ? middleware(event) : event\n\t\t},\n\n\t// Chain multiple middleware\n\tchain:\n\t\t(...middlewares: EventMiddleware[]): EventMiddleware =>\n\t\t(event) => {\n\t\t\tlet currentEvent: MediaPlayerEvent | null = event\n\n\t\t\tfor (const middleware of middlewares) {\n\t\t\t\tif (currentEvent === null) break\n\t\t\t\tcurrentEvent = middleware(currentEvent)\n\t\t\t}\n\n\t\t\treturn currentEvent\n\t\t}\n}\n\n// Middleware builder class\nexport class MiddlewareBuilder {\n\tprivate middlewares: EventMiddleware[] = []\n\n\t// Add middleware\n\tuse(middleware: EventMiddleware): this {\n\t\tthis.middlewares.push(middleware)\n\t\treturn this\n\t}\n\n\t// Add logging\n\tlog(prefix?: string): this {\n\t\treturn this.use(eventMiddlewares.logger(prefix))\n\t}\n\n\t// Add throttling\n\tthrottle(eventTypes: string[], delay?: number): this {\n\t\treturn this.use(eventMiddlewares.throttle(eventTypes, delay))\n\t}\n\n\t// Add debouncing\n\tdebounce(eventTypes: string[], delay?: number): this {\n\t\treturn this.use(eventMiddlewares.debounce(eventTypes, delay))\n\t}\n\n\t// Add filtering\n\tfilter(predicate: (event: MediaPlayerEvent) => boolean): this {\n\t\treturn this.use(eventMiddlewares.filter(predicate))\n\t}\n\n\t// Add transformation\n\ttransform(transformer: (event: MediaPlayerEvent) => MediaPlayerEvent): this {\n\t\treturn this.use(eventMiddlewares.transform(transformer))\n\t}\n\n\t// Add performance monitoring\n\tperformance(): this {\n\t\treturn this.use(eventMiddlewares.performance())\n\t}\n\n\t// Add error handling\n\terrorHandler(onError?: (error: Error, event: MediaPlayerEvent) => void): this {\n\t\treturn this.use(eventMiddlewares.errorHandler(onError))\n\t}\n\n\t// Add security\n\tsecurity(options?: Parameters<typeof eventMiddlewares.security>[0]): this {\n\t\treturn this.use(eventMiddlewares.security(options))\n\t}\n\n\t// Add conditional middleware\n\twhen(condition: (event: MediaPlayerEvent) => boolean, middleware: EventMiddleware): this {\n\t\treturn this.use(eventMiddlewares.when(condition, middleware))\n\t}\n\n\t// Build the final middleware\n\tbuild(): EventMiddleware {\n\t\treturn eventMiddlewares.chain(...this.middlewares)\n\t}\n}\n\n// Helper to create middleware builder\nexport const createMiddleware = () => new MiddlewareBuilder()\n\n// Export commonly used middleware combinations\nexport const commonMiddlewares = {\n\t// Development middleware stack\n\tdevelopment: () => createMiddleware().log(\"[Dev Event]\").performance().errorHandler().build(),\n\n\t// Production middleware stack\n\tproduction: () =>\n\t\tcreateMiddleware()\n\t\t\t.security()\n\t\t\t.errorHandler()\n\t\t\t.throttle([\"media:timeupdate\", \"user:mousemove\"], 16) // ~60fps\n\t\t\t.build(),\n\n\t// Testing middleware stack\n\ttesting: () =>\n\t\tcreateMiddleware()\n\t\t\t.errorHandler((error, event) => {\n\t\t\t\tthrow new Error(`Event error in test: ${error.message} for event ${event.type}`)\n\t\t\t})\n\t\t\t.build()\n}\n","import React, { useEffect, useRef, useCallback, useMemo, useState } from \"react\"\nimport {\n\tEventBus,\n\ttype EventHandler,\n\ttype EventOptions,\n\ttype EventUnsubscriber,\n\ttype MediaEvents\n} from \"./event-system\"\n\n// Hook to use event bus with React\nexport function useEventBus(eventBus?: EventBus): EventBus {\n\tconst [eventBusInstance, setEventBusInstance] = useState(() => eventBus || new EventBus())\n\n\tuseEffect(() => {\n\t\t// If an external eventBus is provided, we don't manage its lifecycle\n\t\tif (eventBus) {\n\t\t\tsetEventBusInstance(eventBus)\n\t\t\treturn () => {\n\t\t\t\t// Don't destroy externally provided event bus\n\t\t\t}\n\t\t}\n\n\t\treturn () => {\n\t\t\t// Cleanup internally created event bus on unmount\n\t\t\teventBusInstance.destroy()\n\t\t}\n\t}, [eventBus, eventBusInstance])\n\n\treturn eventBusInstance\n}\n\n// Hook to listen to events\nexport function useEventListener<K extends keyof MediaEvents>(\n\teventBus: EventBus,\n\ttype: K,\n\thandler: EventHandler<MediaEvents[K]>,\n\toptions?: EventOptions,\n\tdeps?: React.DependencyList\n): void {\n\tconst handlerRef = useRef(handler)\n\tconst optionsRef = useRef(options)\n\n\t// Update refs when dependencies change\n\tuseEffect(() => {\n\t\thandlerRef.current = handler\n\t\toptionsRef.current = options\n\t})\n\n\tuseEffect(() => {\n\t\tconst unsubscribe = eventBus.on(type, handlerRef.current, optionsRef.current)\n\t\treturn unsubscribe\n\t}, [eventBus, type])\n}\n\n// Hook to emit events\nexport function useEventEmitter(eventBus: EventBus) {\n\treturn useCallback(\n\t\t<K extends keyof MediaEvents>(\n\t\t\ttype: K,\n\t\t\tdetail?: MediaEvents[K],\n\t\t\toptions?: Partial<MediaEvents[K]>\n\t\t) => {\n\t\t\treturn eventBus.emit(type, detail, options)\n\t\t},\n\t\t[eventBus]\n\t)\n}\n\n// Hook for one-time event listeners\nexport function useEventOnce<K extends keyof MediaEvents>(\n\teventBus: EventBus,\n\ttype: K,\n\thandler: EventHandler<MediaEvents[K]>,\n\tdeps?: React.DependencyList\n): void {\n\tuseEventListener(eventBus, type, handler, { once: true }, deps)\n}\n\n// Hook to create event handlers with automatic cleanup\nexport function useEventHandlers(eventBus: EventBus) {\n\tconst handlersRef = useRef<EventUnsubscriber[]>([])\n\n\tconst addHandler = useCallback(\n\t\t<K extends keyof MediaEvents>(\n\t\t\ttype: K,\n\t\t\thandler: EventHandler<MediaEvents[K]>,\n\t\t\toptions?: EventOptions\n\t\t) => {\n\t\t\tconst unsubscribe = eventBus.on(type, handler, options)\n\t\t\thandlersRef.current.push(unsubscribe)\n\t\t\treturn unsubscribe\n\t\t},\n\t\t[eventBus]\n\t)\n\n\tconst removeAllHandlers = useCallback(() => {\n\t\thandlersRef.current.forEach((unsubscribe) => unsubscribe())\n\t\thandlersRef.current = []\n\t}, [])\n\n\tuseEffect(() => {\n\t\treturn removeAllHandlers\n\t}, [removeAllHandlers])\n\n\treturn {\n\t\ton: addHandler,\n\t\tremoveAll: removeAllHandlers\n\t}\n}\n\n// Hook for event history\nexport function useEventHistory(\n\teventBus: EventBus,\n\tfilter?: (event: any) => boolean,\n\tmaxSize = 100\n) {\n\tconst [history, setHistory] = useState<any[]>([])\n\n\tuseEffect(() => {\n\t\tconst unsubscribe = eventBus.addEventListener(\"*\", (event) => {\n\t\t\tif (!filter || filter(event)) {\n\t\t\t\tsetHistory((prevHistory) => {\n\t\t\t\t\tconst newHistory = [...prevHistory, event]\n\n\t\t\t\t\t// Limit history size\n\t\t\t\t\tif (newHistory.length > maxSize) {\n\t\t\t\t\t\treturn newHistory.slice(-maxSize)\n\t\t\t\t\t}\n\n\t\t\t\t\treturn newHistory\n\t\t\t\t})\n\t\t\t}\n\t\t})\n\n\t\treturn unsubscribe\n\t}, [eventBus, filter, maxSize])\n\n\tconst clearHistory = useCallback(() => {\n\t\tsetHistory([])\n\t}, [])\n\n\treturn {\n\t\thistory,\n\t\tclearHistory\n\t}\n}\n\n// Hook for event metrics/analytics\nexport function useEventMetrics(eventBus: EventBus) {\n\tconst metricsRef = useRef<\n\t\tMap<\n\t\t\tstring,\n\t\t\t{\n\t\t\t\tcount: number\n\t\t\t\tlastTimestamp: number\n\t\t\t\tfrequency: number // events per second\n\t\t\t}\n\t\t>\n\t>(new Map())\n\n\tuseEffect(() => {\n\t\tconst updateMetrics = (event: any) => {\n\t\t\tconst existing = metricsRef.current.get(event.type) || {\n\t\t\t\tcount: 0,\n\t\t\t\tlastTimestamp: 0,\n\t\t\t\tfrequency: 0\n\t\t\t}\n\n\t\t\texisting.count++\n\n\t\t\tif (existing.lastTimestamp > 0) {\n\t\t\t\tconst timeDiff = (event.timestamp - existing.lastTimestamp) / 1000 // seconds\n\t\t\t\texisting.frequency = timeDiff > 0 ? 1 / timeDiff : 0\n\t\t\t}\n\n\t\t\texisting.lastTimestamp = event.timestamp\n\t\t\tmetricsRef.current.set(event.type, existing)\n\t\t}\n\n\t\tconst unsubscribe = eventBus.addEventListener(\"*\", updateMetrics)\n\t\treturn unsubscribe\n\t}, [eventBus])\n\n\tconst getMetrics = useCallback(() => {\n\t\treturn Object.fromEntries(metricsRef.current.entries())\n\t}, [])\n\n\tconst resetMetrics = useCallback(() => {\n\t\tmetricsRef.current.clear()\n\t}, [])\n\n\treturn {\n\t\tgetMetrics,\n\t\tresetMetrics\n\t}\n}\n\n// Hook for event debugging\nexport function useEventDebugger(\n\teventBus: EventBus,\n\toptions: {\n\t\tlogEvents?: boolean\n\t\tlogMetrics?: boolean\n\t\tfilterEventTypes?: string[]\n\t} = {}\n) {\n\tconst { logEvents = true, logMetrics = false, filterEventTypes } = options\n\n\tuseEffect(() => {\n\t\tif (!logEvents) return\n\n\t\tconst unsubscribe = eventBus.addEventListener(\"*\", (event) => {\n\t\t\tif (filterEventTypes && !filterEventTypes.includes(event.type)) {\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tconsole.group(`🎯 Event: ${event.type}`)\n\t\t\tconsole.log(\"Timestamp:\", new Date(event.timestamp).toISOString())\n\t\t\tconsole.log(\"Detail:\", event.detail)\n\t\t\tconsole.log(\"Bubbles:\", event.bubbles)\n\t\t\tconsole.log(\"Cancelable:\", event.cancelable)\n\t\t\tconsole.groupEnd()\n\t\t})\n\n\t\treturn unsubscribe\n\t}, [eventBus, logEvents, filterEventTypes])\n\n\tuseEffect(() => {\n\t\tif (!logMetrics) return\n\n\t\tconst interval = setInterval(() => {\n\t\t\tconst listenerCount = eventBus.getListenerCount()\n\t\t\tconst eventTypes = eventBus.getEventTypes()\n\n\t\t\tconsole.group(\"📊 Event Metrics\")\n\t\t\tconsole.log(\"Total Listeners:\", listenerCount)\n\t\t\tconsole.log(\"Event Types:\", eventTypes.length)\n\t\t\tconsole.log(\"Active Types:\", eventTypes)\n\t\t\tconsole.groupEnd()\n\t\t}, 5000)\n\n\t\treturn () => clearInterval(interval)\n\t}, [eventBus, logMetrics])\n}\n\n// Hook for conditional event handling\nexport function useConditionalEventListener<K extends keyof MediaEvents>(\n\teventBus: EventBus,\n\ttype: K,\n\thandler: EventHandler<MediaEvents[K]>,\n\tcondition: boolean | (() => boolean),\n\toptions?: EventOptions,\n\tdeps?: React.DependencyList\n): void {\n\tconst shouldListen = useMemo(() => {\n\t\treturn typeof condition === \"function\" ? condition() : condition\n\t}, [condition])\n\n\tuseEffect(() => {\n\t\tif (!shouldListen) return\n\n\t\tconst unsubscribe = eventBus.on(type, handler, options)\n\t\treturn unsubscribe\n\t}, [eventBus, type, shouldListen])\n}\n\n// Hook for event state synchronization\nexport function useEventState<T>(\n\teventBus: EventBus,\n\tinitialValue: T,\n\teventMapping: Record<string, (detail: any, currentValue: T) => T>\n) {\n\tconst [state, setState] = useState<T>(initialValue)\n\n\tuseEffect(() => {\n\t\tconst unsubscribers: EventUnsubscriber[] = []\n\n\t\tObject.entries(eventMapping).forEach(([eventType, updater]) => {\n\t\t\tconst unsubscribe = eventBus.addEventListener(eventType, (event) => {\n\t\t\t\tsetState((current) => updater(event.detail, current))\n\t\t\t})\n\t\t\tunsubscribers.push(unsubscribe)\n\t\t})\n\n\t\treturn () => {\n\t\t\tunsubscribers.forEach((unsubscribe) => unsubscribe())\n\t\t}\n\t}, [eventBus, eventMapping])\n\n\treturn state\n}\n\n// Hook for creating event-driven effects\nexport function useEventEffect<K extends keyof MediaEvents>(\n\teventBus: EventBus,\n\ttype: K,\n\teffect: (detail: MediaEvents[K]) => void | (() => void),\n\tdeps?: React.DependencyList\n): void {\n\tconst cleanupRef = useRef<(() => void) | void>(undefined)\n\n\tuseEventListener(\n\t\teventBus,\n\t\ttype,\n\t\tuseCallback((event) => {\n\t\t\t// Clean up previous effect\n\t\t\tif (typeof cleanupRef.current === \"function\") {\n\t\t\t\tcleanupRef.current()\n\t\t\t}\n\n\t\t\t// Run new effect\n\t\t\tcleanupRef.current = effect(event.detail)\n\t\t}, []),\n\t\tundefined,\n\t\tdeps\n\t)\n\n\tuseEffect(() => {\n\t\treturn () => {\n\t\t\tif (typeof cleanupRef.current === \"function\") {\n\t\t\t\tcleanupRef.current()\n\t\t\t}\n\t\t}\n\t}, [])\n}\n","// Event system exports\nexport {\n\tEventBus,\n\tEventDelegator,\n\tdefaultEventBus\n} from \"./event-system\"\n\nexport type {\n\tMediaPlayerEvent,\n\tEventHandler,\n\tEventUnsubscriber,\n\tEventOptions,\n\tEventCategory,\n\tMediaEvents\n} from \"./event-system\"\n\n// Event utilities\nexport * from \"./middleware\"\nexport * from \"./hooks\"\n\n// Version\nexport const EVENT_SYSTEM_VERSION = \"1.0.0\"\n"],"names":["EventBus","__publicField","type","handler","options","id","listener","listeners","priority","priorityValue","insertIndex","i","listenerPriority","index","l","detail","event","processedEvent","middleware","schedule","cb","processNext","batchSize","events","exactListeners","wildcardListeners","pattern","allListeners","a","b","priorityA","listenersToRemove","error","eventType","filter","sum","defaultEventBus","EventDelegator","eventBus","element","domEvent","mediaEvent","e","eventMiddlewares","prefix","eventTypes","delay","lastTimes","lastTime","now","timeouts","eventQueue","existingTimeout","timeout","predicate","transformer","metrics","startTime","existing","avgTime","onError","blockedEventTypes","sanitizeDetail","maxDetailSize","condition","middlewares","currentEvent","MiddlewareBuilder","createMiddleware","commonMiddlewares","useEventBus","eventBusInstance","setEventBusInstance","useState","useEffect","useEventListener","deps","handlerRef","useRef","optionsRef","useEventEmitter","useCallback","useEventOnce","useEventHandlers","handlersRef","addHandler","unsubscribe","removeAllHandlers","useEventHistory","maxSize","history","setHistory","prevHistory","newHistory","clearHistory","useEventMetrics","metricsRef","updateMetrics","timeDiff","getMetrics","resetMetrics","useEventDebugger","logEvents","logMetrics","filterEventTypes","interval","listenerCount","useConditionalEventListener","shouldListen","useMemo","useEventState","initialValue","eventMapping","state","setState","unsubscribers","updater","current","useEventEffect","effect","cleanupRef","EVENT_SYSTEM_VERSION"],"mappings":"0MAyFO,MAAMA,CAAS,CAAf,cACEC,EAAA,qBAAgB,KAShBA,EAAA,kBAAiC,CAAA,GACjCA,EAAA,oBAAe,IACfA,EAAA,mBAA2E,CAAA,GAC3EA,EAAA,oBAAmC,CAAA,GACnCA,EAAA,sBAAiB,KAGzB,GACCC,EACAC,EACAC,EAAwB,CAAA,EACJ,CACpB,OAAO,KAAK,iBAAiBF,EAAMC,EAAyBC,CAAO,CACpE,CAGA,KACCF,EACAC,EACAC,EAAwB,CAAA,EACJ,CACpB,OAAO,KAAK,iBAAiBF,EAAMC,EAAyB,CAAE,GAAGC,EAAS,KAAM,GAAM,CACvF,CAGA,iBACCF,EACAC,EACAC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,EAAIzC,EAAAA,SAAYsC,CAAY,EAElDrC,OAAAA,EAAAA,UAAU,IAAM,CACf,MAAMyC,EAAqC,CAAA,EAE3C,cAAO,QAAQH,CAAY,EAAE,QAAQ,CAAC,CAAC/E,EAAWmF,CAAO,IAAM,CAC9D,MAAM9B,EAAchD,EAAS,iBAAiBL,EAAYjB,GAAU,CACnEkG,EAAUG,GAAYD,EAAQpG,EAAM,OAAQqG,CAAO,CAAC,CACrD,CAAC,EACDF,EAAc,KAAK7B,CAAW,CAC/B,CAAC,EAEM,IAAM,CACZ6B,EAAc,QAAS7B,GAAgBA,EAAA,CAAa,CACrD,CACD,EAAG,CAAChD,EAAU0E,CAAY,CAAC,EAEpBC,CACR,CAGO,SAASK,EACfhF,EACApC,EACAqH,EACA3C,EACO,CACP,MAAM4C,EAAa1C,EAAAA,OAA4B,MAAS,EAExDH,EACCrC,EACApC,EACA+E,EAAAA,YAAajE,GAAU,CAElB,OAAOwG,EAAW,SAAY,YACjCA,EAAW,QAAA,EAIZA,EAAW,QAAUD,EAAOvG,EAAM,MAAM,CACzC,EAAG,CAAA,CAAE,EACL,MAED,EAEA0D,EAAAA,UAAU,IACF,IAAM,CACR,OAAO8C,EAAW,SAAY,YACjCA,EAAW,QAAA,CAEb,EACE,CAAA,CAAE,CACN,CC/SO,MAAMC,EAAuB"}
@@ -0,0 +1,484 @@
1
+ var T = Object.defineProperty;
2
+ var H = (s, e, t) => e in s ? T(s, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : s[e] = t;
3
+ var d = (s, e, t) => H(s, typeof e != "symbol" ? e + "" : e, t);
4
+ import { useState as E, useEffect as h, useRef as g, useCallback as p, useMemo as L } from "react";
5
+ class b {
6
+ constructor() {
7
+ d(this, "listeners", /* @__PURE__ */ new Map());
8
+ d(this, "eventQueue", []);
9
+ d(this, "isProcessing", !1);
10
+ d(this, "middlewares", []);
11
+ d(this, "eventHistory", []);
12
+ d(this, "maxHistorySize", 1e3);
13
+ }
14
+ // Subscribe to events
15
+ on(e, t, r = {}) {
16
+ return this.addEventListener(e, t, r);
17
+ }
18
+ // Subscribe to events (one-time)
19
+ once(e, t, r = {}) {
20
+ return this.addEventListener(e, t, { ...r, once: !0 });
21
+ }
22
+ // Subscribe to events with wildcard support
23
+ addEventListener(e, t, r = {}) {
24
+ const n = this.generateId(), l = { handler: t, options: r, id: n };
25
+ this.listeners.has(e) || this.listeners.set(e, []);
26
+ const i = this.listeners.get(e), o = r.priority || "normal", u = { high: 2, normal: 1, low: 0 }[o];
27
+ let c = i.length;
28
+ for (let a = 0; a < i.length; a++) {
29
+ const m = i[a];
30
+ if (!m) continue;
31
+ const v = m.options.priority || "normal";
32
+ if (u > { high: 2, normal: 1, low: 0 }[v]) {
33
+ c = a;
34
+ break;
35
+ }
36
+ }
37
+ return i.splice(c, 0, l), () => {
38
+ const a = i.findIndex((m) => m.id === n);
39
+ a !== -1 && i.splice(a, 1), i.length === 0 && this.listeners.delete(e);
40
+ };
41
+ }
42
+ // Remove event listener
43
+ removeEventListener(e, t) {
44
+ const r = this.listeners.get(e);
45
+ if (r) {
46
+ if (t) {
47
+ const n = r.findIndex((l) => l.handler === t);
48
+ n !== -1 && r.splice(n, 1);
49
+ } else
50
+ this.listeners.delete(e);
51
+ r && r.length === 0 && this.listeners.delete(e);
52
+ }
53
+ }
54
+ // Emit events
55
+ emit(e, t, r) {
56
+ const n = {
57
+ type: e,
58
+ timestamp: Date.now(),
59
+ detail: t,
60
+ bubbles: !0,
61
+ cancelable: !0,
62
+ defaultPrevented: !1,
63
+ ...r
64
+ };
65
+ return this.dispatchEvent(n);
66
+ }
67
+ // Dispatch event
68
+ dispatchEvent(e) {
69
+ let t = e;
70
+ for (const r of this.middlewares)
71
+ if (t = r(t), !t)
72
+ return !1;
73
+ return this.addToHistory(t), this.eventQueue.push(t), this.isProcessing || this.processEventQueue(), !t.defaultPrevented;
74
+ }
75
+ // Process event queue with React 19 concurrent scheduling
76
+ processEventQueue() {
77
+ if (this.isProcessing) return;
78
+ this.isProcessing = !0;
79
+ const e = typeof window < "u" && "scheduler" in window ? window.scheduler.postTask : (r) => setTimeout(r, 0), t = () => {
80
+ if (this.eventQueue.length === 0) {
81
+ this.isProcessing = !1;
82
+ return;
83
+ }
84
+ const r = Math.min(this.eventQueue.length, 5), n = this.eventQueue.splice(0, r);
85
+ Promise.all(n.map((l) => this.processEvent(l).catch(console.error))).then(() => {
86
+ e(t);
87
+ }).catch(() => {
88
+ this.isProcessing = !1;
89
+ });
90
+ };
91
+ e(t);
92
+ }
93
+ // Process individual event
94
+ async processEvent(e) {
95
+ const { type: t } = e, r = this.listeners.get(t) || [], n = [];
96
+ for (const [o, u] of this.listeners.entries())
97
+ o.includes("*") && this.matchPattern(t, o) && n.push(...u);
98
+ const l = [...r, ...n].sort((o, u) => {
99
+ const c = { high: 2, normal: 1, low: 0 }[o.options.priority || "normal"];
100
+ return { high: 2, normal: 1, low: 0 }[u.options.priority || "normal"] - c;
101
+ }), i = [];
102
+ for (const o of l)
103
+ if (!(o.options.filter && !o.options.filter(e)))
104
+ try {
105
+ if (await Promise.resolve(o.handler(e)), o.options.once && i.push(o.id), e.defaultPrevented && !e.bubbles)
106
+ break;
107
+ } catch (u) {
108
+ console.error(`Error in event handler for ${t}:`, u), console.error(`Event handler error for ${t}:`, u);
109
+ }
110
+ for (const o of i)
111
+ for (const [u, c] of this.listeners.entries()) {
112
+ const a = c.findIndex((m) => m.id === o);
113
+ if (a !== -1) {
114
+ c.splice(a, 1), c.length === 0 && this.listeners.delete(u);
115
+ break;
116
+ }
117
+ }
118
+ }
119
+ // Add middleware
120
+ use(e) {
121
+ return this.middlewares.push(e), () => {
122
+ const t = this.middlewares.indexOf(e);
123
+ t !== -1 && this.middlewares.splice(t, 1);
124
+ };
125
+ }
126
+ // Event history management
127
+ addToHistory(e) {
128
+ this.eventHistory.push(e), this.eventHistory.length > this.maxHistorySize && this.eventHistory.shift();
129
+ }
130
+ // Get event history
131
+ getHistory(e) {
132
+ return e ? this.eventHistory.filter(e) : [...this.eventHistory];
133
+ }
134
+ // Clear event history
135
+ clearHistory() {
136
+ this.eventHistory = [];
137
+ }
138
+ // Pattern matching for wildcards
139
+ matchPattern(e, t) {
140
+ return new RegExp("^" + t.replace(/\*/g, ".*").replace(/\?/g, ".") + "$").test(e);
141
+ }
142
+ // Generate unique ID
143
+ generateId() {
144
+ return `event_${Date.now()}_${Math.random().toString(36).substr(2, 9)}`;
145
+ }
146
+ // Get listener count
147
+ getListenerCount(e) {
148
+ return e ? this.listeners.get(e)?.length || 0 : Array.from(this.listeners.values()).reduce((t, r) => t + r.length, 0);
149
+ }
150
+ // Get all event types
151
+ getEventTypes() {
152
+ return Array.from(this.listeners.keys());
153
+ }
154
+ // Clear all listeners
155
+ removeAllListeners(e) {
156
+ e ? this.listeners.delete(e) : this.listeners.clear();
157
+ }
158
+ // Destroy event bus
159
+ destroy() {
160
+ this.listeners.clear(), this.eventQueue = [], this.middlewares = [], this.eventHistory = [], this.isProcessing = !1;
161
+ }
162
+ }
163
+ const k = new b();
164
+ class P {
165
+ constructor(e, t) {
166
+ d(this, "eventBus");
167
+ d(this, "element");
168
+ d(this, "delegatedEvents", /* @__PURE__ */ new Set());
169
+ this.eventBus = e, this.element = t;
170
+ }
171
+ // Delegate DOM events to event bus
172
+ delegate(e, t) {
173
+ if (this.delegatedEvents.has(e)) return;
174
+ const r = (n) => {
175
+ this.eventBus.emit(t || `dom:${e}`, {
176
+ originalEvent: n,
177
+ target: n.target?.tagName.toLowerCase(),
178
+ currentTarget: n.currentTarget?.tagName.toLowerCase()
179
+ });
180
+ };
181
+ this.element.addEventListener(e, r, { passive: !0 }), this.delegatedEvents.add(e);
182
+ }
183
+ // Setup common delegations
184
+ setupCommonDelegations() {
185
+ this.delegate("click", "user:click"), this.delegate("mouseenter", "user:hover"), this.delegate("mouseleave", "user:hover"), this.delegate("focus", "user:focus"), this.delegate("blur", "user:focus"), this.delegate("keydown", "user:keyboard"), this.delegate("keyup", "user:keyboard");
186
+ }
187
+ destroy() {
188
+ this.delegatedEvents.clear();
189
+ }
190
+ }
191
+ const f = {
192
+ // Logging middleware
193
+ logger: (s = "[Event]") => (e) => (process.env.NODE_ENV === "development" && console.log(`${s} ${e.type}`, e.detail), e),
194
+ // Throttling middleware
195
+ throttle: (s, e = 100) => {
196
+ const t = /* @__PURE__ */ new Map();
197
+ return (r) => {
198
+ if (s.includes(r.type)) {
199
+ const n = t.get(r.type) || 0, l = r.timestamp;
200
+ if (l - n < e)
201
+ return null;
202
+ t.set(r.type, l);
203
+ }
204
+ return r;
205
+ };
206
+ },
207
+ // Debouncing middleware
208
+ debounce: (s, e = 100) => {
209
+ const t = /* @__PURE__ */ new Map(), r = /* @__PURE__ */ new Map();
210
+ return (n) => {
211
+ if (s.includes(n.type)) {
212
+ const l = t.get(n.type);
213
+ l && clearTimeout(l), r.set(n.type, n);
214
+ const i = setTimeout(() => {
215
+ r.get(n.type) && (r.delete(n.type), t.delete(n.type));
216
+ }, e);
217
+ return t.set(n.type, i), null;
218
+ }
219
+ return n;
220
+ };
221
+ },
222
+ // Filtering middleware
223
+ filter: (s) => (e) => s(e) ? e : null,
224
+ // Event transformation middleware
225
+ transform: (s) => (e) => {
226
+ try {
227
+ return s(e);
228
+ } catch (t) {
229
+ return console.error("Error in event transformer:", t), e;
230
+ }
231
+ },
232
+ // Performance monitoring middleware
233
+ performance: () => {
234
+ const s = /* @__PURE__ */ new Map();
235
+ return (e) => {
236
+ const t = performance.now(), r = s.get(e.type) || { count: 0, totalTime: 0 };
237
+ if (r.count++, r.totalTime += performance.now() - t, s.set(e.type, r), r.count % 100 === 0) {
238
+ const n = r.totalTime / r.count;
239
+ console.log(`Event ${e.type}: ${r.count} calls, avg ${n.toFixed(2)}ms`);
240
+ }
241
+ return e;
242
+ };
243
+ },
244
+ // Error handling middleware
245
+ errorHandler: (s) => (e) => {
246
+ try {
247
+ if (!e.type || typeof e.type != "string")
248
+ throw new Error("Invalid event: missing or invalid type");
249
+ if (!e.timestamp || typeof e.timestamp != "number")
250
+ throw new Error("Invalid event: missing or invalid timestamp");
251
+ return e;
252
+ } catch (t) {
253
+ return s ? s(t, e) : console.error("Event validation error:", t), null;
254
+ }
255
+ },
256
+ // Security middleware (prevent certain events or sanitize data)
257
+ security: (s = {}) => (e) => {
258
+ const { blockedEventTypes: t = [], sanitizeDetail: r = !0, maxDetailSize: n = 1e4 } = s;
259
+ if (t.includes(e.type))
260
+ return console.warn(`Blocked event type: ${e.type}`), null;
261
+ if (r && e.detail)
262
+ try {
263
+ JSON.stringify(e.detail).length > n && (console.warn(`Event detail too large, truncating: ${e.type}`), e.detail = { ...e.detail, _truncated: !0 });
264
+ } catch {
265
+ console.warn(`Failed to serialize event detail: ${e.type}`), e.detail = { _serializationError: !0 };
266
+ }
267
+ return e;
268
+ },
269
+ // Conditional middleware
270
+ when: (s, e) => (t) => s(t) ? e(t) : t,
271
+ // Chain multiple middleware
272
+ chain: (...s) => (e) => {
273
+ let t = e;
274
+ for (const r of s) {
275
+ if (t === null) break;
276
+ t = r(t);
277
+ }
278
+ return t;
279
+ }
280
+ };
281
+ class x {
282
+ constructor() {
283
+ d(this, "middlewares", []);
284
+ }
285
+ // Add middleware
286
+ use(e) {
287
+ return this.middlewares.push(e), this;
288
+ }
289
+ // Add logging
290
+ log(e) {
291
+ return this.use(f.logger(e));
292
+ }
293
+ // Add throttling
294
+ throttle(e, t) {
295
+ return this.use(f.throttle(e, t));
296
+ }
297
+ // Add debouncing
298
+ debounce(e, t) {
299
+ return this.use(f.debounce(e, t));
300
+ }
301
+ // Add filtering
302
+ filter(e) {
303
+ return this.use(f.filter(e));
304
+ }
305
+ // Add transformation
306
+ transform(e) {
307
+ return this.use(f.transform(e));
308
+ }
309
+ // Add performance monitoring
310
+ performance() {
311
+ return this.use(f.performance());
312
+ }
313
+ // Add error handling
314
+ errorHandler(e) {
315
+ return this.use(f.errorHandler(e));
316
+ }
317
+ // Add security
318
+ security(e) {
319
+ return this.use(f.security(e));
320
+ }
321
+ // Add conditional middleware
322
+ when(e, t) {
323
+ return this.use(f.when(e, t));
324
+ }
325
+ // Build the final middleware
326
+ build() {
327
+ return f.chain(...this.middlewares);
328
+ }
329
+ }
330
+ const y = () => new x(), S = {
331
+ // Development middleware stack
332
+ development: () => y().log("[Dev Event]").performance().errorHandler().build(),
333
+ // Production middleware stack
334
+ production: () => y().security().errorHandler().throttle(["media:timeupdate", "user:mousemove"], 16).build(),
335
+ // Testing middleware stack
336
+ testing: () => y().errorHandler((s, e) => {
337
+ throw new Error(`Event error in test: ${s.message} for event ${e.type}`);
338
+ }).build()
339
+ };
340
+ function I(s) {
341
+ const [e, t] = E(() => s || new b());
342
+ return h(() => s ? (t(s), () => {
343
+ }) : () => {
344
+ e.destroy();
345
+ }, [s, e]), e;
346
+ }
347
+ function w(s, e, t, r, n) {
348
+ const l = g(t), i = g(r);
349
+ h(() => {
350
+ l.current = t, i.current = r;
351
+ }), h(() => s.on(e, l.current, i.current), [s, e]);
352
+ }
353
+ function D(s) {
354
+ return p(
355
+ (e, t, r) => s.emit(e, t, r),
356
+ [s]
357
+ );
358
+ }
359
+ function C(s, e, t, r) {
360
+ w(s, e, t, { once: !0 });
361
+ }
362
+ function Q(s) {
363
+ const e = g([]), t = p(
364
+ (n, l, i) => {
365
+ const o = s.on(n, l, i);
366
+ return e.current.push(o), o;
367
+ },
368
+ [s]
369
+ ), r = p(() => {
370
+ e.current.forEach((n) => n()), e.current = [];
371
+ }, []);
372
+ return h(() => r, [r]), {
373
+ on: t,
374
+ removeAll: r
375
+ };
376
+ }
377
+ function R(s, e, t = 100) {
378
+ const [r, n] = E([]);
379
+ h(() => s.addEventListener("*", (o) => {
380
+ (!e || e(o)) && n((u) => {
381
+ const c = [...u, o];
382
+ return c.length > t ? c.slice(-t) : c;
383
+ });
384
+ }), [s, e, t]);
385
+ const l = p(() => {
386
+ n([]);
387
+ }, []);
388
+ return {
389
+ history: r,
390
+ clearHistory: l
391
+ };
392
+ }
393
+ function N(s) {
394
+ const e = g(/* @__PURE__ */ new Map());
395
+ h(() => {
396
+ const n = (i) => {
397
+ const o = e.current.get(i.type) || {
398
+ count: 0,
399
+ lastTimestamp: 0,
400
+ frequency: 0
401
+ };
402
+ if (o.count++, o.lastTimestamp > 0) {
403
+ const u = (i.timestamp - o.lastTimestamp) / 1e3;
404
+ o.frequency = u > 0 ? 1 / u : 0;
405
+ }
406
+ o.lastTimestamp = i.timestamp, e.current.set(i.type, o);
407
+ };
408
+ return s.addEventListener("*", n);
409
+ }, [s]);
410
+ const t = p(() => Object.fromEntries(e.current.entries()), []), r = p(() => {
411
+ e.current.clear();
412
+ }, []);
413
+ return {
414
+ getMetrics: t,
415
+ resetMetrics: r
416
+ };
417
+ }
418
+ function O(s, e = {}) {
419
+ const { logEvents: t = !0, logMetrics: r = !1, filterEventTypes: n } = e;
420
+ h(() => t ? s.addEventListener("*", (i) => {
421
+ n && !n.includes(i.type) || (console.group(`🎯 Event: ${i.type}`), console.log("Timestamp:", new Date(i.timestamp).toISOString()), console.log("Detail:", i.detail), console.log("Bubbles:", i.bubbles), console.log("Cancelable:", i.cancelable), console.groupEnd());
422
+ }) : void 0, [s, t, n]), h(() => {
423
+ if (!r) return;
424
+ const l = setInterval(() => {
425
+ const i = s.getListenerCount(), o = s.getEventTypes();
426
+ console.group("📊 Event Metrics"), console.log("Total Listeners:", i), console.log("Event Types:", o.length), console.log("Active Types:", o), console.groupEnd();
427
+ }, 5e3);
428
+ return () => clearInterval(l);
429
+ }, [s, r]);
430
+ }
431
+ function A(s, e, t, r, n, l) {
432
+ const i = L(() => typeof r == "function" ? r() : r, [r]);
433
+ h(() => i ? s.on(e, t, n) : void 0, [s, e, i]);
434
+ }
435
+ function _(s, e, t) {
436
+ const [r, n] = E(e);
437
+ return h(() => {
438
+ const l = [];
439
+ return Object.entries(t).forEach(([i, o]) => {
440
+ const u = s.addEventListener(i, (c) => {
441
+ n((a) => o(c.detail, a));
442
+ });
443
+ l.push(u);
444
+ }), () => {
445
+ l.forEach((i) => i());
446
+ };
447
+ }, [s, t]), r;
448
+ }
449
+ function z(s, e, t, r) {
450
+ const n = g(void 0);
451
+ w(
452
+ s,
453
+ e,
454
+ p((l) => {
455
+ typeof n.current == "function" && n.current(), n.current = t(l.detail);
456
+ }, []),
457
+ void 0
458
+ ), h(() => () => {
459
+ typeof n.current == "function" && n.current();
460
+ }, []);
461
+ }
462
+ const q = "1.0.0";
463
+ export {
464
+ b as E,
465
+ x as M,
466
+ q as a,
467
+ P as b,
468
+ y as c,
469
+ k as d,
470
+ f as e,
471
+ S as f,
472
+ w as g,
473
+ D as h,
474
+ C as i,
475
+ Q as j,
476
+ R as k,
477
+ N as l,
478
+ O as m,
479
+ A as n,
480
+ _ as o,
481
+ z as p,
482
+ I as u
483
+ };
484
+ //# sourceMappingURL=core-events-DunPHKRE.js.map