tiny-essentials 1.28.14 → 1.28.16

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 (622) hide show
  1. package/TinyFork.mjs +45 -23
  2. package/changelog/1/28/14.md +3 -3
  3. package/changelog/1/28/15.md +11 -0
  4. package/changelog/1/28/16.md +19 -0
  5. package/dist/_/numbers.d.mts.map +1 -0
  6. package/dist/v1/TinyAdvancedRaffle.min.js +1 -1
  7. package/dist/v1/TinyBasicsEs.min.js +1 -1
  8. package/dist/v1/TinyDebugger.min.js +1 -1
  9. package/dist/v1/TinyEssentials.min.js +1 -1
  10. package/dist/v1/TinyI18.min.js +1 -1
  11. package/dist/v1/TinyIframeEvents.min.js +1 -1
  12. package/dist/v1/TinyLocalStorage.min.js +1 -1
  13. package/dist/v1/TinyMediaPlayer.min.js +1 -1
  14. package/dist/v1/TinyNewWinEvents.min.js +1 -1
  15. package/dist/v1/TinyRadioFm.min.js +1 -1
  16. package/dist/v1/TinySmartScroller.min.js +1 -1
  17. package/dist/v1/TinyUploadClicker.min.js +1 -1
  18. package/dist/v1/basics/array.d.mts.map +1 -0
  19. package/dist/v1/basics/browserDetector.d.mts.map +1 -0
  20. package/dist/v1/basics/clock.d.mts.map +1 -0
  21. package/dist/v1/basics/collision.d.mts.map +1 -0
  22. package/dist/v1/basics/deprecated/html.d.mts.map +1 -0
  23. package/dist/v1/basics/extendObjType/Buffer.d.mts.map +1 -0
  24. package/dist/v1/basics/fullScreen.d.mts.map +1 -0
  25. package/dist/v1/basics/html.d.mts.map +1 -0
  26. package/dist/v1/basics/index.d.mts.map +1 -0
  27. package/dist/v1/basics/mediaContent.cjs +208 -212
  28. package/dist/v1/basics/mediaContent.d.mts +22 -14
  29. package/dist/v1/basics/mediaContent.d.mts.map +1 -0
  30. package/dist/v1/basics/mediaContent.mjs +190 -191
  31. package/dist/v1/basics/objChecker.d.mts.map +1 -0
  32. package/dist/v1/basics/objFilter.d.mts.map +1 -0
  33. package/dist/v1/basics/promiseUtils.d.mts.map +1 -0
  34. package/dist/v1/basics/simpleMath.d.mts.map +1 -0
  35. package/dist/v1/basics/text.d.mts.map +1 -0
  36. package/dist/v1/fileManager/asyncFuncs.d.mts.map +1 -0
  37. package/dist/v1/fileManager/index.d.mts.map +1 -0
  38. package/dist/v1/fileManager/normalFuncs.d.mts.map +1 -0
  39. package/dist/v1/index.cjs +49 -45
  40. package/dist/v1/index.d.mts +47 -45
  41. package/dist/v1/index.d.mts.map +1 -0
  42. package/dist/v1/index.mjs +47 -45
  43. package/dist/v1/libs/array/TinyArrayComparator.d.mts.map +1 -0
  44. package/dist/v1/libs/array/TinyArrayPaginator.d.mts.map +1 -0
  45. package/dist/v1/libs/color/ColorSafeStringify.d.mts.map +1 -0
  46. package/dist/v1/libs/color/TinyColorConverter.d.mts.map +1 -0
  47. package/dist/v1/libs/color/TinyColorValidator.d.mts.map +1 -0
  48. package/dist/v1/libs/{TinyDayNightCycle.cjs → game/TinyDayNightCycle.cjs} +2 -2
  49. package/dist/v1/libs/game/TinyDayNightCycle.d.mts.map +1 -0
  50. package/dist/v1/libs/{TinyDayNightCycle.mjs → game/TinyDayNightCycle.mjs} +1 -1
  51. package/dist/v1/libs/{TinyGamepad.cjs → game/TinyGamepad.cjs} +2 -2
  52. package/dist/v1/libs/game/TinyGamepad.d.mts.map +1 -0
  53. package/dist/v1/libs/{TinyGamepad.mjs → game/TinyGamepad.mjs} +1 -1
  54. package/dist/v1/libs/game/TinyInventory.d.mts.map +1 -0
  55. package/dist/v1/libs/game/TinyInventoryTrader.d.mts.map +1 -0
  56. package/dist/v1/libs/game/TinyLevelUp.d.mts.map +1 -0
  57. package/dist/v1/libs/game/TinyNeedBar.d.mts.map +1 -0
  58. package/dist/v1/libs/html/TinyDomReadyManager.d.mts.map +1 -0
  59. package/dist/v1/libs/{TinyElementObserver.cjs → html/TinyElementObserver.cjs} +2 -2
  60. package/dist/v1/libs/html/TinyElementObserver.d.mts.map +1 -0
  61. package/dist/v1/libs/{TinyElementObserver.mjs → html/TinyElementObserver.mjs} +1 -1
  62. package/dist/v1/libs/html/TinyHtml/TinyHtmlAnchor.d.mts.map +1 -0
  63. package/dist/v1/libs/html/TinyHtml/TinyHtmlButton.d.mts.map +1 -0
  64. package/dist/v1/libs/html/TinyHtml/TinyHtmlCanvas.d.mts.map +1 -0
  65. package/dist/v1/libs/html/TinyHtml/TinyHtmlDatalist.d.mts.map +1 -0
  66. package/dist/v1/libs/html/TinyHtml/TinyHtmlEmbed.d.mts.map +1 -0
  67. package/dist/v1/libs/html/TinyHtml/TinyHtmlForm.d.mts.map +1 -0
  68. package/dist/v1/libs/html/TinyHtml/TinyHtmlIcon.d.mts.map +1 -0
  69. package/dist/v1/libs/html/TinyHtml/TinyHtmlIframe.d.mts.map +1 -0
  70. package/dist/v1/libs/html/TinyHtml/TinyHtmlImage.d.mts.map +1 -0
  71. package/dist/v1/libs/html/TinyHtml/TinyHtmlInput.d.mts.map +1 -0
  72. package/dist/v1/libs/html/TinyHtml/TinyHtmlLink.d.mts.map +1 -0
  73. package/dist/v1/libs/html/TinyHtml/TinyHtmlMedia.d.mts.map +1 -0
  74. package/dist/v1/libs/html/TinyHtml/TinyHtmlScript.d.mts.map +1 -0
  75. package/dist/v1/libs/html/TinyHtml/TinyHtmlSelect.d.mts.map +1 -0
  76. package/dist/v1/libs/html/TinyHtml/TinyHtmlStyle.d.mts.map +1 -0
  77. package/dist/v1/libs/html/TinyHtml/TinyHtmlTemplate.d.mts.map +1 -0
  78. package/dist/v1/libs/html/TinyHtml/TinyHtmlTextarea.d.mts.map +1 -0
  79. package/dist/v1/libs/html/TinyHtml/index.d.mts.map +1 -0
  80. package/dist/v1/libs/html/TinyHtml/input/TinyHtmlColorInput.d.mts.map +1 -0
  81. package/dist/v1/libs/html/TinyHtml/input/TinyHtmlFileInput.d.mts.map +1 -0
  82. package/dist/v1/libs/html/TinyHtml/input/TinyHtmlHiddenInput.d.mts.map +1 -0
  83. package/dist/v1/libs/html/TinyHtml/input/TinyHtmlImageInput.d.mts.map +1 -0
  84. package/dist/v1/libs/html/TinyHtml/input/button/TinyHtmlButtonInput.d.mts.map +1 -0
  85. package/dist/v1/libs/html/TinyHtml/input/button/TinyHtmlResetInput.d.mts.map +1 -0
  86. package/dist/v1/libs/html/TinyHtml/input/button/TinyHtmlSubmitInput.d.mts.map +1 -0
  87. package/dist/v1/libs/html/TinyHtml/input/check/TinyHtmlCheckboxInput.d.mts.map +1 -0
  88. package/dist/v1/libs/html/TinyHtml/input/check/TinyHtmlRadioInput.d.mts.map +1 -0
  89. package/dist/v1/libs/html/TinyHtml/input/date/TinyHtmlDateInput.d.mts.map +1 -0
  90. package/dist/v1/libs/html/TinyHtml/input/date/TinyHtmlDateTimeInput.d.mts.map +1 -0
  91. package/dist/v1/libs/html/TinyHtml/input/date/TinyHtmlMonthInput.d.mts.map +1 -0
  92. package/dist/v1/libs/html/TinyHtml/input/date/TinyHtmlTimeInput.d.mts.map +1 -0
  93. package/dist/v1/libs/html/TinyHtml/input/date/TinyHtmlWeekInput.d.mts.map +1 -0
  94. package/dist/v1/libs/html/TinyHtml/input/number/TinyHtmlNumberInput.d.mts.map +1 -0
  95. package/dist/v1/libs/html/TinyHtml/input/number/TinyHtmlRangeInput.d.mts.map +1 -0
  96. package/dist/v1/libs/html/TinyHtml/input/text/TinyHtmlEmailInput.d.mts.map +1 -0
  97. package/dist/v1/libs/html/TinyHtml/input/text/TinyHtmlPasswordInput.d.mts.map +1 -0
  98. package/dist/v1/libs/html/TinyHtml/input/text/TinyHtmlSearchInput.d.mts.map +1 -0
  99. package/dist/v1/libs/html/TinyHtml/input/text/TinyHtmlTelInput.d.mts.map +1 -0
  100. package/dist/v1/libs/html/TinyHtml/input/text/TinyHtmlTextInput.d.mts.map +1 -0
  101. package/dist/v1/libs/html/TinyHtml/input/text/TinyHtmlUrlInput.d.mts.map +1 -0
  102. package/dist/v1/libs/html/TinyHtml/media/TinyHtmlAudio.d.mts.map +1 -0
  103. package/dist/v1/libs/html/TinyHtml/media/TinyHtmlObject.d.mts.map +1 -0
  104. package/dist/v1/libs/html/TinyHtml/media/TinyHtmlSource.d.mts.map +1 -0
  105. package/dist/v1/libs/html/TinyHtml/media/TinyHtmlVideo.d.mts.map +1 -0
  106. package/dist/v1/libs/{TinyHtml.cjs → html/TinyHtml.cjs} +4 -4
  107. package/dist/v1/libs/{TinyHtml.d.mts → html/TinyHtml.d.mts} +3 -3
  108. package/dist/v1/libs/html/TinyHtml.d.mts.map +1 -0
  109. package/dist/v1/libs/{TinyHtml.mjs → html/TinyHtml.mjs} +4 -4
  110. package/dist/v1/libs/{TinyDragDropDetector.cjs → html/drag/TinyDragDropDetector.cjs} +2 -2
  111. package/dist/v1/libs/html/drag/TinyDragDropDetector.d.mts.map +1 -0
  112. package/dist/v1/libs/{TinyDragDropDetector.mjs → html/drag/TinyDragDropDetector.mjs} +1 -1
  113. package/dist/v1/libs/{TinyDragger.cjs → html/drag/TinyDragger.cjs} +5 -5
  114. package/dist/v1/libs/{TinyDragger.d.mts → html/drag/TinyDragger.d.mts} +2 -2
  115. package/dist/v1/libs/html/drag/TinyDragger.d.mts.map +1 -0
  116. package/dist/v1/libs/{TinyDragger.mjs → html/drag/TinyDragger.mjs} +4 -4
  117. package/dist/v1/libs/{TinyIframeEvents.cjs → html/events/TinyIframeEvents.cjs} +3 -3
  118. package/dist/v1/libs/html/events/TinyIframeEvents.d.mts.map +1 -0
  119. package/dist/v1/libs/{TinyIframeEvents.mjs → html/events/TinyIframeEvents.mjs} +2 -2
  120. package/dist/v1/libs/{TinyNewWinEvents.cjs → html/events/TinyNewWinEvents.cjs} +2 -2
  121. package/dist/v1/libs/html/events/TinyNewWinEvents.d.mts.map +1 -0
  122. package/dist/v1/libs/{TinyNewWinEvents.mjs → html/events/TinyNewWinEvents.mjs} +1 -1
  123. package/dist/v1/libs/{TinyNotifications.cjs → html/notification/TinyNotifications.cjs} +1 -1
  124. package/dist/v1/libs/html/notification/TinyNotifications.d.mts.map +1 -0
  125. package/dist/v1/libs/{TinyNotifications.mjs → html/notification/TinyNotifications.mjs} +1 -1
  126. package/dist/v1/libs/{TinyNotifyCenter.cjs → html/notification/TinyNotifyCenter.cjs} +2 -2
  127. package/dist/v1/libs/html/notification/TinyNotifyCenter.d.mts.map +1 -0
  128. package/dist/v1/libs/{TinyNotifyCenter.mjs → html/notification/TinyNotifyCenter.mjs} +1 -1
  129. package/dist/v1/libs/{TinyToastNotify.cjs → html/notification/TinyToastNotify.cjs} +2 -2
  130. package/dist/v1/libs/html/notification/TinyToastNotify.d.mts.map +1 -0
  131. package/dist/v1/libs/{TinyToastNotify.mjs → html/notification/TinyToastNotify.mjs} +1 -1
  132. package/dist/v1/libs/{TinyAfterScrollWatcher.cjs → html/scroll/TinyAfterScrollWatcher.cjs} +2 -2
  133. package/dist/v1/libs/html/scroll/TinyAfterScrollWatcher.d.mts.map +1 -0
  134. package/dist/v1/libs/{TinyAfterScrollWatcher.mjs → html/scroll/TinyAfterScrollWatcher.mjs} +1 -1
  135. package/dist/v1/libs/{TinySmartScroller.cjs → html/scroll/TinySmartScroller.cjs} +4 -4
  136. package/dist/v1/libs/{TinySmartScroller.d.mts → html/scroll/TinySmartScroller.d.mts} +2 -2
  137. package/dist/v1/libs/html/scroll/TinySmartScroller.d.mts.map +1 -0
  138. package/dist/v1/libs/{TinySmartScroller.mjs → html/scroll/TinySmartScroller.mjs} +3 -3
  139. package/dist/v1/libs/{TinyAnalogClock.cjs → html/templates/TinyAnalogClock.cjs} +2 -2
  140. package/dist/v1/libs/html/templates/TinyAnalogClock.d.mts.map +1 -0
  141. package/dist/v1/libs/{TinyAnalogClock.mjs → html/templates/TinyAnalogClock.mjs} +1 -1
  142. package/dist/v1/libs/html/templates/TinyCookieConsent.d.mts.map +1 -0
  143. package/dist/v1/libs/html/templates/TinyLoadingScreen.d.mts.map +1 -0
  144. package/dist/v1/libs/{TinyUploadClicker.cjs → html/upload/TinyUploadClicker.cjs} +1 -10
  145. package/dist/v1/libs/{TinyUploadClicker.d.mts → html/upload/TinyUploadClicker.d.mts} +24 -24
  146. package/dist/v1/libs/html/upload/TinyUploadClicker.d.mts.map +1 -0
  147. package/dist/v1/libs/{TinyUploadClicker.mjs → html/upload/TinyUploadClicker.mjs} +1 -1
  148. package/dist/v1/libs/{TinyAdvancedRaffle.cjs → math/TinyAdvancedRaffle.cjs} +2 -2
  149. package/dist/v1/libs/math/TinyAdvancedRaffle.d.mts.map +1 -0
  150. package/dist/v1/libs/{TinyAdvancedRaffle.mjs → math/TinyAdvancedRaffle.mjs} +1 -1
  151. package/dist/v1/libs/math/TinyMamdaniInferenceSystem.d.mts.map +1 -0
  152. package/dist/v1/libs/{TinyRateLimiter.cjs → math/TinyRateLimiter.cjs} +2 -2
  153. package/dist/v1/libs/math/TinyRateLimiter.d.mts.map +1 -0
  154. package/dist/v1/libs/{TinyRateLimiter.mjs → math/TinyRateLimiter.mjs} +1 -1
  155. package/dist/v1/libs/{TinySimpleDice.cjs → math/TinySimpleDice.cjs} +1 -1
  156. package/dist/v1/libs/math/TinySimpleDice.d.mts.map +1 -0
  157. package/dist/v1/libs/{TinySimpleDice.mjs → math/TinySimpleDice.mjs} +1 -1
  158. package/dist/v1/libs/{TinyTimeout.cjs → math/TinyTimeout.cjs} +3 -3
  159. package/dist/v1/libs/math/TinyTimeout.d.mts.map +1 -0
  160. package/dist/v1/libs/{TinyTimeout.mjs → math/TinyTimeout.mjs} +2 -2
  161. package/dist/v1/libs/{TinyMediaPlayer → media/TinyMediaPlayer}/HtmlAudio.cjs +5 -5
  162. package/dist/v1/libs/{TinyMediaPlayer → media/TinyMediaPlayer}/HtmlAudio.d.mts +4 -4
  163. package/dist/v1/libs/media/TinyMediaPlayer/HtmlAudio.d.mts.map +1 -0
  164. package/dist/v1/libs/{TinyMediaPlayer → media/TinyMediaPlayer}/HtmlAudio.mjs +4 -4
  165. package/dist/v1/libs/{TinyMediaPlayer → media/TinyMediaPlayer}/HtmlVideo.cjs +5 -5
  166. package/dist/v1/libs/{TinyMediaPlayer → media/TinyMediaPlayer}/HtmlVideo.d.mts +4 -4
  167. package/dist/v1/libs/media/TinyMediaPlayer/HtmlVideo.d.mts.map +1 -0
  168. package/dist/v1/libs/{TinyMediaPlayer → media/TinyMediaPlayer}/HtmlVideo.mjs +4 -4
  169. package/dist/v1/libs/{TinyMediaPlayer → media/TinyMediaPlayer}/Mock.cjs +5 -5
  170. package/dist/v1/libs/{TinyMediaPlayer → media/TinyMediaPlayer}/Mock.d.mts +2 -2
  171. package/dist/v1/libs/media/TinyMediaPlayer/Mock.d.mts.map +1 -0
  172. package/dist/v1/libs/{TinyMediaPlayer → media/TinyMediaPlayer}/Mock.mjs +4 -4
  173. package/dist/v1/libs/{TinyMediaPlayer → media/TinyMediaPlayer}/SoundCloud.cjs +6 -6
  174. package/dist/v1/libs/{TinyMediaPlayer → media/TinyMediaPlayer}/SoundCloud.d.mts +4 -4
  175. package/dist/v1/libs/media/TinyMediaPlayer/SoundCloud.d.mts.map +1 -0
  176. package/dist/v1/libs/{TinyMediaPlayer → media/TinyMediaPlayer}/SoundCloud.mjs +5 -5
  177. package/dist/v1/libs/{TinyMediaPlayer → media/TinyMediaPlayer}/Youtube.cjs +6 -6
  178. package/dist/v1/libs/{TinyMediaPlayer → media/TinyMediaPlayer}/Youtube.d.mts +4 -4
  179. package/dist/v1/libs/media/TinyMediaPlayer/Youtube.d.mts.map +1 -0
  180. package/dist/v1/libs/{TinyMediaPlayer → media/TinyMediaPlayer}/Youtube.mjs +5 -5
  181. package/dist/v1/libs/media/TinyMediaPlayer/docs/SoundCloudWidget.d.mts.map +1 -0
  182. package/dist/v1/libs/media/TinyMediaPlayer/docs/YouTubePlayer.d.mts.map +1 -0
  183. package/dist/v1/libs/{TinyMediaPlayer → media/TinyMediaPlayer}/index.cjs +4 -4
  184. package/dist/v1/libs/{TinyMediaPlayer → media/TinyMediaPlayer}/index.d.mts +2 -2
  185. package/dist/v1/libs/media/TinyMediaPlayer/index.d.mts.map +1 -0
  186. package/dist/v1/libs/{TinyMediaPlayer → media/TinyMediaPlayer}/index.mjs +3 -3
  187. package/dist/v1/libs/{TinyMediaPlayer.cjs → media/TinyMediaPlayer.cjs} +13 -13
  188. package/dist/v1/libs/{TinyMediaPlayer.d.mts → media/TinyMediaPlayer.d.mts} +18 -18
  189. package/dist/v1/libs/media/TinyMediaPlayer.d.mts.map +1 -0
  190. package/dist/v1/libs/{TinyMediaPlayer.mjs → media/TinyMediaPlayer.mjs} +13 -13
  191. package/dist/v1/libs/{TinyRadioFm.cjs → media/TinyRadioFm.cjs} +15 -15
  192. package/dist/v1/libs/{TinyRadioFm.d.mts → media/TinyRadioFm.d.mts} +22 -22
  193. package/dist/v1/libs/media/TinyRadioFm.d.mts.map +1 -0
  194. package/dist/v1/libs/{TinyRadioFm.mjs → media/TinyRadioFm.mjs} +14 -14
  195. package/dist/v1/libs/{TinyLocalStorage.cjs → storage/TinyLocalStorage.cjs} +3 -3
  196. package/dist/v1/libs/storage/TinyLocalStorage.d.mts.map +1 -0
  197. package/dist/v1/libs/{TinyLocalStorage.mjs → storage/TinyLocalStorage.mjs} +2 -2
  198. package/dist/v1/libs/text/TinyClipboard.d.mts.map +1 -0
  199. package/dist/v1/libs/{TinyI18.cjs → text/TinyI18.cjs} +2 -2
  200. package/dist/v1/libs/text/TinyI18.d.mts.map +1 -0
  201. package/dist/v1/libs/{TinyI18.mjs → text/TinyI18.mjs} +1 -1
  202. package/dist/v1/libs/{TinyTextDiffer.cjs → text/TinyTextDiffer.cjs} +2 -2
  203. package/dist/v1/libs/text/TinyTextDiffer.d.mts.map +1 -0
  204. package/dist/v1/libs/{TinyTextDiffer.mjs → text/TinyTextDiffer.mjs} +1 -1
  205. package/dist/v1/libs/text/TinyTextRangeEditor.d.mts.map +1 -0
  206. package/dist/v1/libs/text/TinyTextarea.d.mts.map +1 -0
  207. package/dist/v1/libs/{TinyClassManager → tools/TinyClassManager}/TinyPluginInliner.cjs +1 -1
  208. package/dist/v1/libs/tools/TinyClassManager/TinyPluginInliner.d.mts.map +1 -0
  209. package/dist/v1/libs/tools/TinyClassManager.d.mts.map +1 -0
  210. package/dist/v1/libs/{TinyDebugger.cjs → tools/TinyDebugger.cjs} +2 -2
  211. package/dist/v1/libs/tools/TinyDebugger.d.mts.map +1 -0
  212. package/dist/v1/libs/{TinyDebugger.mjs → tools/TinyDebugger.mjs} +2 -2
  213. package/dist/v1/libs/tools/TinyPkgExportValidator.cjs +462 -0
  214. package/dist/v1/libs/tools/TinyPkgExportValidator.d.mts +104 -0
  215. package/dist/v1/libs/tools/TinyPkgExportValidator.d.mts.map +1 -0
  216. package/dist/v1/libs/tools/TinyPkgExportValidator.mjs +407 -0
  217. package/dist/v1/libs/tools/examples/TinyClassManager.d.mts.map +1 -0
  218. package/dist/v1/libs/utils/TinyPromiseQueue.d.mts.map +1 -0
  219. package/dist/v1/libs/{UltraRandomMsgGen.cjs → utils/UltraRandomMsgGen.cjs} +2 -2
  220. package/dist/v1/libs/utils/UltraRandomMsgGen.d.mts.map +1 -0
  221. package/dist/v1/libs/{UltraRandomMsgGen.mjs → utils/UltraRandomMsgGen.mjs} +1 -1
  222. package/dist/v1/libs/{utils.d.mts → utils/tools.d.mts} +1 -1
  223. package/dist/v1/libs/utils/tools.d.mts.map +1 -0
  224. package/docs/TinyFork.md +2 -2
  225. package/docs/v1/Exports.md +129 -92
  226. package/docs/v1/README.md +100 -49
  227. package/docs/v1/libs/{TinyArrayComparator.md → array/TinyArrayComparator.md} +1 -1
  228. package/docs/v1/libs/{TinyArrayPaginator.md → array/TinyArrayPaginator.md} +1 -1
  229. package/docs/v1/libs/{ColorSafeStringify.md → color/ColorSafeStringify.md} +1 -1
  230. package/docs/v1/libs/{TinyLevelUp.md → game/TinyLevelUp.md} +1 -1
  231. package/docs/v1/libs/{TinyDomReadyManager.md → html/TinyDomReadyManager.md} +1 -1
  232. package/docs/v1/libs/{TinyElementObserver.md → html/TinyElementObserver.md} +1 -1
  233. package/docs/v1/libs/{TinyDragDropDetector.md → html/drag/TinyDragDropDetector.md} +1 -1
  234. package/docs/v1/libs/{TinyDragger.md → html/drag/TinyDragger.md} +1 -1
  235. package/docs/v1/libs/{TinyIframeEvents.md → html/events/TinyIframeEvents.md} +2 -2
  236. package/docs/v1/libs/{TinyNewWinEvents.md → html/events/TinyNewWinEvents.md} +2 -2
  237. package/docs/v1/libs/{TinyNotifications.md → html/notification/TinyNotifications.md} +1 -1
  238. package/docs/v1/libs/{TinyAfterScrollWatcher.md → html/scroll/TinyAfterScrollWatcher.md} +1 -1
  239. package/docs/v1/libs/{TinyAnalogClock.md → html/templates/TinyAnalogClock.md} +1 -1
  240. package/docs/v1/libs/{TinyCookieConsent.md → html/templates/TinyCookieConsent.md} +1 -1
  241. package/docs/v1/libs/{TinyLoadingScreen.md → html/templates/TinyLoadingScreen.md} +1 -1
  242. package/docs/v1/libs/{TinyMediaPlayer.md → media/TinyMediaPlayer.md} +8 -8
  243. package/docs/v1/libs/{TinyClipboard.md → text/TinyClipboard.md} +1 -1
  244. package/docs/v1/libs/{TinyTextDiffer.md → text/TinyTextDiffer.md} +1 -1
  245. package/docs/v1/libs/{TinyTextarea.md → text/TinyTextarea.md} +1 -1
  246. package/docs/v1/libs/{TinyClassManager → tools/TinyClassManager}/TinyPluginInliner.md +2 -2
  247. package/docs/v1/libs/{TinyClassManager.md → tools/TinyClassManager.md} +1 -1
  248. package/docs/v1/libs/{TinyDebugger.md → tools/TinyDebugger.md} +1 -1
  249. package/docs/v1/libs/tools/TinyPkgExportValidator.md +234 -0
  250. package/docs/v1/libs/{TinyPromiseQueue.md → utils/TinyPromiseQueue.md} +2 -2
  251. package/package.json +305 -303
  252. package/dist/v1/build/ColorSafeStringify.cjs +0 -7
  253. package/dist/v1/build/ColorSafeStringify.d.mts +0 -3
  254. package/dist/v1/build/ColorSafeStringify.mjs +0 -2
  255. package/dist/v1/build/TinyAdvancedRaffle.cjs +0 -7
  256. package/dist/v1/build/TinyAdvancedRaffle.d.mts +0 -3
  257. package/dist/v1/build/TinyAdvancedRaffle.mjs +0 -2
  258. package/dist/v1/build/TinyAfterScrollWatcher.cjs +0 -7
  259. package/dist/v1/build/TinyAfterScrollWatcher.d.mts +0 -3
  260. package/dist/v1/build/TinyAfterScrollWatcher.mjs +0 -2
  261. package/dist/v1/build/TinyAnalogClock.cjs +0 -7
  262. package/dist/v1/build/TinyAnalogClock.d.mts +0 -3
  263. package/dist/v1/build/TinyAnalogClock.mjs +0 -2
  264. package/dist/v1/build/TinyArrayComparator.cjs +0 -7
  265. package/dist/v1/build/TinyArrayComparator.d.mts +0 -3
  266. package/dist/v1/build/TinyArrayComparator.mjs +0 -2
  267. package/dist/v1/build/TinyArrayPaginator.cjs +0 -7
  268. package/dist/v1/build/TinyArrayPaginator.d.mts +0 -3
  269. package/dist/v1/build/TinyArrayPaginator.mjs +0 -2
  270. package/dist/v1/build/TinyClassManager.cjs +0 -7
  271. package/dist/v1/build/TinyClassManager.d.mts +0 -3
  272. package/dist/v1/build/TinyClassManager.mjs +0 -2
  273. package/dist/v1/build/TinyClipboard.cjs +0 -7
  274. package/dist/v1/build/TinyClipboard.d.mts +0 -3
  275. package/dist/v1/build/TinyClipboard.mjs +0 -2
  276. package/dist/v1/build/TinyColorConverter.cjs +0 -7
  277. package/dist/v1/build/TinyColorConverter.d.mts +0 -3
  278. package/dist/v1/build/TinyColorConverter.mjs +0 -2
  279. package/dist/v1/build/TinyColorValidator.cjs +0 -7
  280. package/dist/v1/build/TinyColorValidator.d.mts +0 -3
  281. package/dist/v1/build/TinyColorValidator.mjs +0 -2
  282. package/dist/v1/build/TinyCookieConsent.cjs +0 -7
  283. package/dist/v1/build/TinyCookieConsent.d.mts +0 -3
  284. package/dist/v1/build/TinyCookieConsent.mjs +0 -2
  285. package/dist/v1/build/TinyDayNightCycle.cjs +0 -7
  286. package/dist/v1/build/TinyDayNightCycle.d.mts +0 -3
  287. package/dist/v1/build/TinyDayNightCycle.mjs +0 -2
  288. package/dist/v1/build/TinyDebugger.cjs +0 -7
  289. package/dist/v1/build/TinyDebugger.d.mts +0 -3
  290. package/dist/v1/build/TinyDebugger.mjs +0 -2
  291. package/dist/v1/build/TinyDomReadyManager.cjs +0 -7
  292. package/dist/v1/build/TinyDomReadyManager.d.mts +0 -3
  293. package/dist/v1/build/TinyDomReadyManager.mjs +0 -2
  294. package/dist/v1/build/TinyDragDropDetector.cjs +0 -7
  295. package/dist/v1/build/TinyDragDropDetector.d.mts +0 -3
  296. package/dist/v1/build/TinyDragDropDetector.mjs +0 -2
  297. package/dist/v1/build/TinyDragger.cjs +0 -7
  298. package/dist/v1/build/TinyDragger.d.mts +0 -3
  299. package/dist/v1/build/TinyDragger.mjs +0 -2
  300. package/dist/v1/build/TinyElementObserver.cjs +0 -7
  301. package/dist/v1/build/TinyElementObserver.d.mts +0 -3
  302. package/dist/v1/build/TinyElementObserver.mjs +0 -2
  303. package/dist/v1/build/TinyGamepad.cjs +0 -7
  304. package/dist/v1/build/TinyGamepad.d.mts +0 -3
  305. package/dist/v1/build/TinyGamepad.mjs +0 -2
  306. package/dist/v1/build/TinyHtml.cjs +0 -7
  307. package/dist/v1/build/TinyHtml.d.mts +0 -3
  308. package/dist/v1/build/TinyHtml.mjs +0 -2
  309. package/dist/v1/build/TinyI18.cjs +0 -7
  310. package/dist/v1/build/TinyI18.d.mts +0 -3
  311. package/dist/v1/build/TinyI18.mjs +0 -2
  312. package/dist/v1/build/TinyIframeEvents.cjs +0 -7
  313. package/dist/v1/build/TinyIframeEvents.d.mts +0 -3
  314. package/dist/v1/build/TinyIframeEvents.mjs +0 -2
  315. package/dist/v1/build/TinyInventory.cjs +0 -7
  316. package/dist/v1/build/TinyInventory.d.mts +0 -3
  317. package/dist/v1/build/TinyInventory.mjs +0 -2
  318. package/dist/v1/build/TinyInventoryTrader.cjs +0 -7
  319. package/dist/v1/build/TinyInventoryTrader.d.mts +0 -3
  320. package/dist/v1/build/TinyInventoryTrader.mjs +0 -2
  321. package/dist/v1/build/TinyLevelUp.cjs +0 -7
  322. package/dist/v1/build/TinyLevelUp.d.mts +0 -3
  323. package/dist/v1/build/TinyLevelUp.mjs +0 -2
  324. package/dist/v1/build/TinyLoadingScreen.cjs +0 -7
  325. package/dist/v1/build/TinyLoadingScreen.d.mts +0 -3
  326. package/dist/v1/build/TinyLoadingScreen.mjs +0 -2
  327. package/dist/v1/build/TinyLocalStorage.cjs +0 -7
  328. package/dist/v1/build/TinyLocalStorage.d.mts +0 -3
  329. package/dist/v1/build/TinyLocalStorage.mjs +0 -2
  330. package/dist/v1/build/TinyMediaPlayer.cjs +0 -7
  331. package/dist/v1/build/TinyMediaPlayer.d.mts +0 -3
  332. package/dist/v1/build/TinyMediaPlayer.mjs +0 -2
  333. package/dist/v1/build/TinyNeedBar.cjs +0 -7
  334. package/dist/v1/build/TinyNeedBar.d.mts +0 -3
  335. package/dist/v1/build/TinyNeedBar.mjs +0 -2
  336. package/dist/v1/build/TinyNewWinEvents.cjs +0 -7
  337. package/dist/v1/build/TinyNewWinEvents.d.mts +0 -3
  338. package/dist/v1/build/TinyNewWinEvents.mjs +0 -2
  339. package/dist/v1/build/TinyNotifications.cjs +0 -7
  340. package/dist/v1/build/TinyNotifications.d.mts +0 -3
  341. package/dist/v1/build/TinyNotifications.mjs +0 -2
  342. package/dist/v1/build/TinyNotifyCenter.cjs +0 -7
  343. package/dist/v1/build/TinyNotifyCenter.d.mts +0 -3
  344. package/dist/v1/build/TinyNotifyCenter.mjs +0 -2
  345. package/dist/v1/build/TinyPromiseQueue.cjs +0 -7
  346. package/dist/v1/build/TinyPromiseQueue.d.mts +0 -3
  347. package/dist/v1/build/TinyPromiseQueue.mjs +0 -2
  348. package/dist/v1/build/TinyRadioFm.cjs +0 -7
  349. package/dist/v1/build/TinyRadioFm.d.mts +0 -3
  350. package/dist/v1/build/TinyRadioFm.mjs +0 -2
  351. package/dist/v1/build/TinyRateLimiter.cjs +0 -7
  352. package/dist/v1/build/TinyRateLimiter.d.mts +0 -3
  353. package/dist/v1/build/TinyRateLimiter.mjs +0 -2
  354. package/dist/v1/build/TinySimpleDice.cjs +0 -7
  355. package/dist/v1/build/TinySimpleDice.d.mts +0 -3
  356. package/dist/v1/build/TinySimpleDice.mjs +0 -2
  357. package/dist/v1/build/TinySmartScroller.cjs +0 -7
  358. package/dist/v1/build/TinySmartScroller.d.mts +0 -3
  359. package/dist/v1/build/TinySmartScroller.mjs +0 -2
  360. package/dist/v1/build/TinyTextDiffer.cjs +0 -7
  361. package/dist/v1/build/TinyTextDiffer.d.mts +0 -3
  362. package/dist/v1/build/TinyTextDiffer.mjs +0 -2
  363. package/dist/v1/build/TinyTextRangeEditor.cjs +0 -7
  364. package/dist/v1/build/TinyTextRangeEditor.d.mts +0 -3
  365. package/dist/v1/build/TinyTextRangeEditor.mjs +0 -2
  366. package/dist/v1/build/TinyTextarea.cjs +0 -7
  367. package/dist/v1/build/TinyTextarea.d.mts +0 -3
  368. package/dist/v1/build/TinyTextarea.mjs +0 -2
  369. package/dist/v1/build/TinyTimeout.cjs +0 -7
  370. package/dist/v1/build/TinyTimeout.d.mts +0 -3
  371. package/dist/v1/build/TinyTimeout.mjs +0 -2
  372. package/dist/v1/build/TinyToastNotify.cjs +0 -7
  373. package/dist/v1/build/TinyToastNotify.d.mts +0 -3
  374. package/dist/v1/build/TinyToastNotify.mjs +0 -2
  375. package/dist/v1/build/TinyUploadClicker.cjs +0 -7
  376. package/dist/v1/build/TinyUploadClicker.d.mts +0 -3
  377. package/dist/v1/build/TinyUploadClicker.mjs +0 -2
  378. package/dist/v1/build/UltraRandomMsgGen.cjs +0 -7
  379. package/dist/v1/build/UltraRandomMsgGen.d.mts +0 -3
  380. package/dist/v1/build/UltraRandomMsgGen.mjs +0 -2
  381. /package/dist/v1/libs/{TinyArrayComparator.cjs → array/TinyArrayComparator.cjs} +0 -0
  382. /package/dist/v1/libs/{TinyArrayComparator.d.mts → array/TinyArrayComparator.d.mts} +0 -0
  383. /package/dist/v1/libs/{TinyArrayComparator.mjs → array/TinyArrayComparator.mjs} +0 -0
  384. /package/dist/v1/libs/{TinyArrayPaginator.cjs → array/TinyArrayPaginator.cjs} +0 -0
  385. /package/dist/v1/libs/{TinyArrayPaginator.d.mts → array/TinyArrayPaginator.d.mts} +0 -0
  386. /package/dist/v1/libs/{TinyArrayPaginator.mjs → array/TinyArrayPaginator.mjs} +0 -0
  387. /package/dist/v1/libs/{ColorSafeStringify.cjs → color/ColorSafeStringify.cjs} +0 -0
  388. /package/dist/v1/libs/{ColorSafeStringify.d.mts → color/ColorSafeStringify.d.mts} +0 -0
  389. /package/dist/v1/libs/{ColorSafeStringify.mjs → color/ColorSafeStringify.mjs} +0 -0
  390. /package/dist/v1/libs/{TinyColorConverter.cjs → color/TinyColorConverter.cjs} +0 -0
  391. /package/dist/v1/libs/{TinyColorConverter.d.mts → color/TinyColorConverter.d.mts} +0 -0
  392. /package/dist/v1/libs/{TinyColorConverter.mjs → color/TinyColorConverter.mjs} +0 -0
  393. /package/dist/v1/libs/{TinyColorValidator.cjs → color/TinyColorValidator.cjs} +0 -0
  394. /package/dist/v1/libs/{TinyColorValidator.d.mts → color/TinyColorValidator.d.mts} +0 -0
  395. /package/dist/v1/libs/{TinyColorValidator.mjs → color/TinyColorValidator.mjs} +0 -0
  396. /package/dist/v1/libs/{TinyDayNightCycle.d.mts → game/TinyDayNightCycle.d.mts} +0 -0
  397. /package/dist/v1/libs/{TinyGamepad.d.mts → game/TinyGamepad.d.mts} +0 -0
  398. /package/dist/v1/libs/{TinyInventory.cjs → game/TinyInventory.cjs} +0 -0
  399. /package/dist/v1/libs/{TinyInventory.d.mts → game/TinyInventory.d.mts} +0 -0
  400. /package/dist/v1/libs/{TinyInventory.mjs → game/TinyInventory.mjs} +0 -0
  401. /package/dist/v1/libs/{TinyInventoryTrader.cjs → game/TinyInventoryTrader.cjs} +0 -0
  402. /package/dist/v1/libs/{TinyInventoryTrader.d.mts → game/TinyInventoryTrader.d.mts} +0 -0
  403. /package/dist/v1/libs/{TinyInventoryTrader.mjs → game/TinyInventoryTrader.mjs} +0 -0
  404. /package/dist/v1/libs/{TinyLevelUp.cjs → game/TinyLevelUp.cjs} +0 -0
  405. /package/dist/v1/libs/{TinyLevelUp.d.mts → game/TinyLevelUp.d.mts} +0 -0
  406. /package/dist/v1/libs/{TinyLevelUp.mjs → game/TinyLevelUp.mjs} +0 -0
  407. /package/dist/v1/libs/{TinyNeedBar.cjs → game/TinyNeedBar.cjs} +0 -0
  408. /package/dist/v1/libs/{TinyNeedBar.d.mts → game/TinyNeedBar.d.mts} +0 -0
  409. /package/dist/v1/libs/{TinyNeedBar.mjs → game/TinyNeedBar.mjs} +0 -0
  410. /package/dist/v1/libs/{TinyDomReadyManager.cjs → html/TinyDomReadyManager.cjs} +0 -0
  411. /package/dist/v1/libs/{TinyDomReadyManager.d.mts → html/TinyDomReadyManager.d.mts} +0 -0
  412. /package/dist/v1/libs/{TinyDomReadyManager.mjs → html/TinyDomReadyManager.mjs} +0 -0
  413. /package/dist/v1/libs/{TinyElementObserver.d.mts → html/TinyElementObserver.d.mts} +0 -0
  414. /package/dist/v1/libs/{TinyHtml → html/TinyHtml}/TinyHtmlAnchor.cjs +0 -0
  415. /package/dist/v1/libs/{TinyHtml → html/TinyHtml}/TinyHtmlAnchor.d.mts +0 -0
  416. /package/dist/v1/libs/{TinyHtml → html/TinyHtml}/TinyHtmlAnchor.mjs +0 -0
  417. /package/dist/v1/libs/{TinyHtml → html/TinyHtml}/TinyHtmlButton.cjs +0 -0
  418. /package/dist/v1/libs/{TinyHtml → html/TinyHtml}/TinyHtmlButton.d.mts +0 -0
  419. /package/dist/v1/libs/{TinyHtml → html/TinyHtml}/TinyHtmlButton.mjs +0 -0
  420. /package/dist/v1/libs/{TinyHtml → html/TinyHtml}/TinyHtmlCanvas.cjs +0 -0
  421. /package/dist/v1/libs/{TinyHtml → html/TinyHtml}/TinyHtmlCanvas.d.mts +0 -0
  422. /package/dist/v1/libs/{TinyHtml → html/TinyHtml}/TinyHtmlCanvas.mjs +0 -0
  423. /package/dist/v1/libs/{TinyHtml → html/TinyHtml}/TinyHtmlDatalist.cjs +0 -0
  424. /package/dist/v1/libs/{TinyHtml → html/TinyHtml}/TinyHtmlDatalist.d.mts +0 -0
  425. /package/dist/v1/libs/{TinyHtml → html/TinyHtml}/TinyHtmlDatalist.mjs +0 -0
  426. /package/dist/v1/libs/{TinyHtml → html/TinyHtml}/TinyHtmlEmbed.cjs +0 -0
  427. /package/dist/v1/libs/{TinyHtml → html/TinyHtml}/TinyHtmlEmbed.d.mts +0 -0
  428. /package/dist/v1/libs/{TinyHtml → html/TinyHtml}/TinyHtmlEmbed.mjs +0 -0
  429. /package/dist/v1/libs/{TinyHtml → html/TinyHtml}/TinyHtmlForm.cjs +0 -0
  430. /package/dist/v1/libs/{TinyHtml → html/TinyHtml}/TinyHtmlForm.d.mts +0 -0
  431. /package/dist/v1/libs/{TinyHtml → html/TinyHtml}/TinyHtmlForm.mjs +0 -0
  432. /package/dist/v1/libs/{TinyHtml → html/TinyHtml}/TinyHtmlIcon.cjs +0 -0
  433. /package/dist/v1/libs/{TinyHtml → html/TinyHtml}/TinyHtmlIcon.d.mts +0 -0
  434. /package/dist/v1/libs/{TinyHtml → html/TinyHtml}/TinyHtmlIcon.mjs +0 -0
  435. /package/dist/v1/libs/{TinyHtml → html/TinyHtml}/TinyHtmlIframe.cjs +0 -0
  436. /package/dist/v1/libs/{TinyHtml → html/TinyHtml}/TinyHtmlIframe.d.mts +0 -0
  437. /package/dist/v1/libs/{TinyHtml → html/TinyHtml}/TinyHtmlIframe.mjs +0 -0
  438. /package/dist/v1/libs/{TinyHtml → html/TinyHtml}/TinyHtmlImage.cjs +0 -0
  439. /package/dist/v1/libs/{TinyHtml → html/TinyHtml}/TinyHtmlImage.d.mts +0 -0
  440. /package/dist/v1/libs/{TinyHtml → html/TinyHtml}/TinyHtmlImage.mjs +0 -0
  441. /package/dist/v1/libs/{TinyHtml → html/TinyHtml}/TinyHtmlInput.cjs +0 -0
  442. /package/dist/v1/libs/{TinyHtml → html/TinyHtml}/TinyHtmlInput.d.mts +0 -0
  443. /package/dist/v1/libs/{TinyHtml → html/TinyHtml}/TinyHtmlInput.mjs +0 -0
  444. /package/dist/v1/libs/{TinyHtml → html/TinyHtml}/TinyHtmlLink.cjs +0 -0
  445. /package/dist/v1/libs/{TinyHtml → html/TinyHtml}/TinyHtmlLink.d.mts +0 -0
  446. /package/dist/v1/libs/{TinyHtml → html/TinyHtml}/TinyHtmlLink.mjs +0 -0
  447. /package/dist/v1/libs/{TinyHtml → html/TinyHtml}/TinyHtmlMedia.cjs +0 -0
  448. /package/dist/v1/libs/{TinyHtml → html/TinyHtml}/TinyHtmlMedia.d.mts +0 -0
  449. /package/dist/v1/libs/{TinyHtml → html/TinyHtml}/TinyHtmlMedia.mjs +0 -0
  450. /package/dist/v1/libs/{TinyHtml → html/TinyHtml}/TinyHtmlScript.cjs +0 -0
  451. /package/dist/v1/libs/{TinyHtml → html/TinyHtml}/TinyHtmlScript.d.mts +0 -0
  452. /package/dist/v1/libs/{TinyHtml → html/TinyHtml}/TinyHtmlScript.mjs +0 -0
  453. /package/dist/v1/libs/{TinyHtml → html/TinyHtml}/TinyHtmlSelect.cjs +0 -0
  454. /package/dist/v1/libs/{TinyHtml → html/TinyHtml}/TinyHtmlSelect.d.mts +0 -0
  455. /package/dist/v1/libs/{TinyHtml → html/TinyHtml}/TinyHtmlSelect.mjs +0 -0
  456. /package/dist/v1/libs/{TinyHtml → html/TinyHtml}/TinyHtmlStyle.cjs +0 -0
  457. /package/dist/v1/libs/{TinyHtml → html/TinyHtml}/TinyHtmlStyle.d.mts +0 -0
  458. /package/dist/v1/libs/{TinyHtml → html/TinyHtml}/TinyHtmlStyle.mjs +0 -0
  459. /package/dist/v1/libs/{TinyHtml → html/TinyHtml}/TinyHtmlTemplate.cjs +0 -0
  460. /package/dist/v1/libs/{TinyHtml → html/TinyHtml}/TinyHtmlTemplate.d.mts +0 -0
  461. /package/dist/v1/libs/{TinyHtml → html/TinyHtml}/TinyHtmlTemplate.mjs +0 -0
  462. /package/dist/v1/libs/{TinyHtml → html/TinyHtml}/TinyHtmlTextarea.cjs +0 -0
  463. /package/dist/v1/libs/{TinyHtml → html/TinyHtml}/TinyHtmlTextarea.d.mts +0 -0
  464. /package/dist/v1/libs/{TinyHtml → html/TinyHtml}/TinyHtmlTextarea.mjs +0 -0
  465. /package/dist/v1/libs/{TinyHtml → html/TinyHtml}/index.cjs +0 -0
  466. /package/dist/v1/libs/{TinyHtml → html/TinyHtml}/index.d.mts +0 -0
  467. /package/dist/v1/libs/{TinyHtml → html/TinyHtml}/index.mjs +0 -0
  468. /package/dist/v1/libs/{TinyHtml → html/TinyHtml}/input/TinyHtmlColorInput.cjs +0 -0
  469. /package/dist/v1/libs/{TinyHtml → html/TinyHtml}/input/TinyHtmlColorInput.d.mts +0 -0
  470. /package/dist/v1/libs/{TinyHtml → html/TinyHtml}/input/TinyHtmlColorInput.mjs +0 -0
  471. /package/dist/v1/libs/{TinyHtml → html/TinyHtml}/input/TinyHtmlFileInput.cjs +0 -0
  472. /package/dist/v1/libs/{TinyHtml → html/TinyHtml}/input/TinyHtmlFileInput.d.mts +0 -0
  473. /package/dist/v1/libs/{TinyHtml → html/TinyHtml}/input/TinyHtmlFileInput.mjs +0 -0
  474. /package/dist/v1/libs/{TinyHtml → html/TinyHtml}/input/TinyHtmlHiddenInput.cjs +0 -0
  475. /package/dist/v1/libs/{TinyHtml → html/TinyHtml}/input/TinyHtmlHiddenInput.d.mts +0 -0
  476. /package/dist/v1/libs/{TinyHtml → html/TinyHtml}/input/TinyHtmlHiddenInput.mjs +0 -0
  477. /package/dist/v1/libs/{TinyHtml → html/TinyHtml}/input/TinyHtmlImageInput.cjs +0 -0
  478. /package/dist/v1/libs/{TinyHtml → html/TinyHtml}/input/TinyHtmlImageInput.d.mts +0 -0
  479. /package/dist/v1/libs/{TinyHtml → html/TinyHtml}/input/TinyHtmlImageInput.mjs +0 -0
  480. /package/dist/v1/libs/{TinyHtml → html/TinyHtml}/input/button/TinyHtmlButtonInput.cjs +0 -0
  481. /package/dist/v1/libs/{TinyHtml → html/TinyHtml}/input/button/TinyHtmlButtonInput.d.mts +0 -0
  482. /package/dist/v1/libs/{TinyHtml → html/TinyHtml}/input/button/TinyHtmlButtonInput.mjs +0 -0
  483. /package/dist/v1/libs/{TinyHtml → html/TinyHtml}/input/button/TinyHtmlResetInput.cjs +0 -0
  484. /package/dist/v1/libs/{TinyHtml → html/TinyHtml}/input/button/TinyHtmlResetInput.d.mts +0 -0
  485. /package/dist/v1/libs/{TinyHtml → html/TinyHtml}/input/button/TinyHtmlResetInput.mjs +0 -0
  486. /package/dist/v1/libs/{TinyHtml → html/TinyHtml}/input/button/TinyHtmlSubmitInput.cjs +0 -0
  487. /package/dist/v1/libs/{TinyHtml → html/TinyHtml}/input/button/TinyHtmlSubmitInput.d.mts +0 -0
  488. /package/dist/v1/libs/{TinyHtml → html/TinyHtml}/input/button/TinyHtmlSubmitInput.mjs +0 -0
  489. /package/dist/v1/libs/{TinyHtml → html/TinyHtml}/input/check/TinyHtmlCheckboxInput.cjs +0 -0
  490. /package/dist/v1/libs/{TinyHtml → html/TinyHtml}/input/check/TinyHtmlCheckboxInput.d.mts +0 -0
  491. /package/dist/v1/libs/{TinyHtml → html/TinyHtml}/input/check/TinyHtmlCheckboxInput.mjs +0 -0
  492. /package/dist/v1/libs/{TinyHtml → html/TinyHtml}/input/check/TinyHtmlRadioInput.cjs +0 -0
  493. /package/dist/v1/libs/{TinyHtml → html/TinyHtml}/input/check/TinyHtmlRadioInput.d.mts +0 -0
  494. /package/dist/v1/libs/{TinyHtml → html/TinyHtml}/input/check/TinyHtmlRadioInput.mjs +0 -0
  495. /package/dist/v1/libs/{TinyHtml → html/TinyHtml}/input/date/TinyHtmlDateInput.cjs +0 -0
  496. /package/dist/v1/libs/{TinyHtml → html/TinyHtml}/input/date/TinyHtmlDateInput.d.mts +0 -0
  497. /package/dist/v1/libs/{TinyHtml → html/TinyHtml}/input/date/TinyHtmlDateInput.mjs +0 -0
  498. /package/dist/v1/libs/{TinyHtml → html/TinyHtml}/input/date/TinyHtmlDateTimeInput.cjs +0 -0
  499. /package/dist/v1/libs/{TinyHtml → html/TinyHtml}/input/date/TinyHtmlDateTimeInput.d.mts +0 -0
  500. /package/dist/v1/libs/{TinyHtml → html/TinyHtml}/input/date/TinyHtmlDateTimeInput.mjs +0 -0
  501. /package/dist/v1/libs/{TinyHtml → html/TinyHtml}/input/date/TinyHtmlMonthInput.cjs +0 -0
  502. /package/dist/v1/libs/{TinyHtml → html/TinyHtml}/input/date/TinyHtmlMonthInput.d.mts +0 -0
  503. /package/dist/v1/libs/{TinyHtml → html/TinyHtml}/input/date/TinyHtmlMonthInput.mjs +0 -0
  504. /package/dist/v1/libs/{TinyHtml → html/TinyHtml}/input/date/TinyHtmlTimeInput.cjs +0 -0
  505. /package/dist/v1/libs/{TinyHtml → html/TinyHtml}/input/date/TinyHtmlTimeInput.d.mts +0 -0
  506. /package/dist/v1/libs/{TinyHtml → html/TinyHtml}/input/date/TinyHtmlTimeInput.mjs +0 -0
  507. /package/dist/v1/libs/{TinyHtml → html/TinyHtml}/input/date/TinyHtmlWeekInput.cjs +0 -0
  508. /package/dist/v1/libs/{TinyHtml → html/TinyHtml}/input/date/TinyHtmlWeekInput.d.mts +0 -0
  509. /package/dist/v1/libs/{TinyHtml → html/TinyHtml}/input/date/TinyHtmlWeekInput.mjs +0 -0
  510. /package/dist/v1/libs/{TinyHtml → html/TinyHtml}/input/number/TinyHtmlNumberInput.cjs +0 -0
  511. /package/dist/v1/libs/{TinyHtml → html/TinyHtml}/input/number/TinyHtmlNumberInput.d.mts +0 -0
  512. /package/dist/v1/libs/{TinyHtml → html/TinyHtml}/input/number/TinyHtmlNumberInput.mjs +0 -0
  513. /package/dist/v1/libs/{TinyHtml → html/TinyHtml}/input/number/TinyHtmlRangeInput.cjs +0 -0
  514. /package/dist/v1/libs/{TinyHtml → html/TinyHtml}/input/number/TinyHtmlRangeInput.d.mts +0 -0
  515. /package/dist/v1/libs/{TinyHtml → html/TinyHtml}/input/number/TinyHtmlRangeInput.mjs +0 -0
  516. /package/dist/v1/libs/{TinyHtml → html/TinyHtml}/input/text/TinyHtmlEmailInput.cjs +0 -0
  517. /package/dist/v1/libs/{TinyHtml → html/TinyHtml}/input/text/TinyHtmlEmailInput.d.mts +0 -0
  518. /package/dist/v1/libs/{TinyHtml → html/TinyHtml}/input/text/TinyHtmlEmailInput.mjs +0 -0
  519. /package/dist/v1/libs/{TinyHtml → html/TinyHtml}/input/text/TinyHtmlPasswordInput.cjs +0 -0
  520. /package/dist/v1/libs/{TinyHtml → html/TinyHtml}/input/text/TinyHtmlPasswordInput.d.mts +0 -0
  521. /package/dist/v1/libs/{TinyHtml → html/TinyHtml}/input/text/TinyHtmlPasswordInput.mjs +0 -0
  522. /package/dist/v1/libs/{TinyHtml → html/TinyHtml}/input/text/TinyHtmlSearchInput.cjs +0 -0
  523. /package/dist/v1/libs/{TinyHtml → html/TinyHtml}/input/text/TinyHtmlSearchInput.d.mts +0 -0
  524. /package/dist/v1/libs/{TinyHtml → html/TinyHtml}/input/text/TinyHtmlSearchInput.mjs +0 -0
  525. /package/dist/v1/libs/{TinyHtml → html/TinyHtml}/input/text/TinyHtmlTelInput.cjs +0 -0
  526. /package/dist/v1/libs/{TinyHtml → html/TinyHtml}/input/text/TinyHtmlTelInput.d.mts +0 -0
  527. /package/dist/v1/libs/{TinyHtml → html/TinyHtml}/input/text/TinyHtmlTelInput.mjs +0 -0
  528. /package/dist/v1/libs/{TinyHtml → html/TinyHtml}/input/text/TinyHtmlTextInput.cjs +0 -0
  529. /package/dist/v1/libs/{TinyHtml → html/TinyHtml}/input/text/TinyHtmlTextInput.d.mts +0 -0
  530. /package/dist/v1/libs/{TinyHtml → html/TinyHtml}/input/text/TinyHtmlTextInput.mjs +0 -0
  531. /package/dist/v1/libs/{TinyHtml → html/TinyHtml}/input/text/TinyHtmlUrlInput.cjs +0 -0
  532. /package/dist/v1/libs/{TinyHtml → html/TinyHtml}/input/text/TinyHtmlUrlInput.d.mts +0 -0
  533. /package/dist/v1/libs/{TinyHtml → html/TinyHtml}/input/text/TinyHtmlUrlInput.mjs +0 -0
  534. /package/dist/v1/libs/{TinyHtml → html/TinyHtml}/media/TinyHtmlAudio.cjs +0 -0
  535. /package/dist/v1/libs/{TinyHtml → html/TinyHtml}/media/TinyHtmlAudio.d.mts +0 -0
  536. /package/dist/v1/libs/{TinyHtml → html/TinyHtml}/media/TinyHtmlAudio.mjs +0 -0
  537. /package/dist/v1/libs/{TinyHtml → html/TinyHtml}/media/TinyHtmlObject.cjs +0 -0
  538. /package/dist/v1/libs/{TinyHtml → html/TinyHtml}/media/TinyHtmlObject.d.mts +0 -0
  539. /package/dist/v1/libs/{TinyHtml → html/TinyHtml}/media/TinyHtmlObject.mjs +0 -0
  540. /package/dist/v1/libs/{TinyHtml → html/TinyHtml}/media/TinyHtmlSource.cjs +0 -0
  541. /package/dist/v1/libs/{TinyHtml → html/TinyHtml}/media/TinyHtmlSource.d.mts +0 -0
  542. /package/dist/v1/libs/{TinyHtml → html/TinyHtml}/media/TinyHtmlSource.mjs +0 -0
  543. /package/dist/v1/libs/{TinyHtml → html/TinyHtml}/media/TinyHtmlVideo.cjs +0 -0
  544. /package/dist/v1/libs/{TinyHtml → html/TinyHtml}/media/TinyHtmlVideo.d.mts +0 -0
  545. /package/dist/v1/libs/{TinyHtml → html/TinyHtml}/media/TinyHtmlVideo.mjs +0 -0
  546. /package/dist/v1/libs/{TinyDragDropDetector.d.mts → html/drag/TinyDragDropDetector.d.mts} +0 -0
  547. /package/dist/v1/libs/{TinyIframeEvents.d.mts → html/events/TinyIframeEvents.d.mts} +0 -0
  548. /package/dist/v1/libs/{TinyNewWinEvents.d.mts → html/events/TinyNewWinEvents.d.mts} +0 -0
  549. /package/dist/v1/libs/{TinyNotifications.d.mts → html/notification/TinyNotifications.d.mts} +0 -0
  550. /package/dist/v1/libs/{TinyNotifyCenter.d.mts → html/notification/TinyNotifyCenter.d.mts} +0 -0
  551. /package/dist/v1/libs/{TinyToastNotify.d.mts → html/notification/TinyToastNotify.d.mts} +0 -0
  552. /package/dist/v1/libs/{TinyAfterScrollWatcher.d.mts → html/scroll/TinyAfterScrollWatcher.d.mts} +0 -0
  553. /package/dist/v1/libs/{TinyAnalogClock.d.mts → html/templates/TinyAnalogClock.d.mts} +0 -0
  554. /package/dist/v1/libs/{TinyCookieConsent.cjs → html/templates/TinyCookieConsent.cjs} +0 -0
  555. /package/dist/v1/libs/{TinyCookieConsent.d.mts → html/templates/TinyCookieConsent.d.mts} +0 -0
  556. /package/dist/v1/libs/{TinyCookieConsent.mjs → html/templates/TinyCookieConsent.mjs} +0 -0
  557. /package/dist/v1/libs/{TinyLoadingScreen.cjs → html/templates/TinyLoadingScreen.cjs} +0 -0
  558. /package/dist/v1/libs/{TinyLoadingScreen.d.mts → html/templates/TinyLoadingScreen.d.mts} +0 -0
  559. /package/dist/v1/libs/{TinyLoadingScreen.mjs → html/templates/TinyLoadingScreen.mjs} +0 -0
  560. /package/dist/v1/libs/{TinyAdvancedRaffle.d.mts → math/TinyAdvancedRaffle.d.mts} +0 -0
  561. /package/dist/v1/libs/{TinyMamdaniInferenceSystem.cjs → math/TinyMamdaniInferenceSystem.cjs} +0 -0
  562. /package/dist/v1/libs/{TinyMamdaniInferenceSystem.d.mts → math/TinyMamdaniInferenceSystem.d.mts} +0 -0
  563. /package/dist/v1/libs/{TinyMamdaniInferenceSystem.mjs → math/TinyMamdaniInferenceSystem.mjs} +0 -0
  564. /package/dist/v1/libs/{TinyRateLimiter.d.mts → math/TinyRateLimiter.d.mts} +0 -0
  565. /package/dist/v1/libs/{TinySimpleDice.d.mts → math/TinySimpleDice.d.mts} +0 -0
  566. /package/dist/v1/libs/{TinyTimeout.d.mts → math/TinyTimeout.d.mts} +0 -0
  567. /package/dist/v1/libs/{TinyMediaPlayer → media/TinyMediaPlayer}/docs/SoundCloudWidget.cjs +0 -0
  568. /package/dist/v1/libs/{TinyMediaPlayer → media/TinyMediaPlayer}/docs/SoundCloudWidget.d.mts +0 -0
  569. /package/dist/v1/libs/{TinyMediaPlayer → media/TinyMediaPlayer}/docs/SoundCloudWidget.mjs +0 -0
  570. /package/dist/v1/libs/{TinyMediaPlayer → media/TinyMediaPlayer}/docs/YouTubePlayer.cjs +0 -0
  571. /package/dist/v1/libs/{TinyMediaPlayer → media/TinyMediaPlayer}/docs/YouTubePlayer.d.mts +0 -0
  572. /package/dist/v1/libs/{TinyMediaPlayer → media/TinyMediaPlayer}/docs/YouTubePlayer.mjs +0 -0
  573. /package/dist/v1/libs/{TinyLocalStorage.d.mts → storage/TinyLocalStorage.d.mts} +0 -0
  574. /package/dist/v1/libs/{TinyClipboard.cjs → text/TinyClipboard.cjs} +0 -0
  575. /package/dist/v1/libs/{TinyClipboard.d.mts → text/TinyClipboard.d.mts} +0 -0
  576. /package/dist/v1/libs/{TinyClipboard.mjs → text/TinyClipboard.mjs} +0 -0
  577. /package/dist/v1/libs/{TinyI18.d.mts → text/TinyI18.d.mts} +0 -0
  578. /package/dist/v1/libs/{TinyTextDiffer.d.mts → text/TinyTextDiffer.d.mts} +0 -0
  579. /package/dist/v1/libs/{TinyTextRangeEditor.cjs → text/TinyTextRangeEditor.cjs} +0 -0
  580. /package/dist/v1/libs/{TinyTextRangeEditor.d.mts → text/TinyTextRangeEditor.d.mts} +0 -0
  581. /package/dist/v1/libs/{TinyTextRangeEditor.mjs → text/TinyTextRangeEditor.mjs} +0 -0
  582. /package/dist/v1/libs/{TinyTextarea.cjs → text/TinyTextarea.cjs} +0 -0
  583. /package/dist/v1/libs/{TinyTextarea.d.mts → text/TinyTextarea.d.mts} +0 -0
  584. /package/dist/v1/libs/{TinyTextarea.mjs → text/TinyTextarea.mjs} +0 -0
  585. /package/dist/v1/libs/{TinyClassManager → tools/TinyClassManager}/TinyPluginInliner.d.mts +0 -0
  586. /package/dist/v1/libs/{TinyClassManager → tools/TinyClassManager}/TinyPluginInliner.mjs +0 -0
  587. /package/dist/v1/libs/{TinyClassManager.cjs → tools/TinyClassManager.cjs} +0 -0
  588. /package/dist/v1/libs/{TinyClassManager.d.mts → tools/TinyClassManager.d.mts} +0 -0
  589. /package/dist/v1/libs/{TinyClassManager.mjs → tools/TinyClassManager.mjs} +0 -0
  590. /package/dist/v1/libs/{TinyDebugger.d.mts → tools/TinyDebugger.d.mts} +0 -0
  591. /package/dist/v1/libs/{examples → tools/examples}/TinyClassManager.cjs +0 -0
  592. /package/dist/v1/libs/{examples → tools/examples}/TinyClassManager.d.mts +0 -0
  593. /package/dist/v1/libs/{examples → tools/examples}/TinyClassManager.mjs +0 -0
  594. /package/dist/v1/libs/{TinyPromiseQueue.cjs → utils/TinyPromiseQueue.cjs} +0 -0
  595. /package/dist/v1/libs/{TinyPromiseQueue.d.mts → utils/TinyPromiseQueue.d.mts} +0 -0
  596. /package/dist/v1/libs/{TinyPromiseQueue.mjs → utils/TinyPromiseQueue.mjs} +0 -0
  597. /package/dist/v1/libs/{UltraRandomMsgGen.d.mts → utils/UltraRandomMsgGen.d.mts} +0 -0
  598. /package/dist/v1/libs/{utils.cjs → utils/tools.cjs} +0 -0
  599. /package/dist/v1/libs/{utils.mjs → utils/tools.mjs} +0 -0
  600. /package/docs/v1/libs/{TinyColorConverter.md → color/TinyColorConverter.md} +0 -0
  601. /package/docs/v1/libs/{TinyColorValidator.md → color/TinyColorValidator.md} +0 -0
  602. /package/docs/v1/libs/{TinyDayNightCycle.md → game/TinyDayNightCycle.md} +0 -0
  603. /package/docs/v1/libs/{TinyGamepad.md → game/TinyGamepad.md} +0 -0
  604. /package/docs/v1/libs/{TinyInventory.md → game/TinyInventory.md} +0 -0
  605. /package/docs/v1/libs/{TinyInventoryTrader.md → game/TinyInventoryTrader.md} +0 -0
  606. /package/docs/v1/libs/{TinyNeedBar.md → game/TinyNeedBar.md} +0 -0
  607. /package/docs/v1/libs/{TinyHtml.md → html/TinyHtml.md} +0 -0
  608. /package/docs/v1/libs/{TinyHtmlTips.md → html/TinyHtmlTips.md} +0 -0
  609. /package/docs/v1/libs/{TinyNotifyCenter.md → html/notification/TinyNotifyCenter.md} +0 -0
  610. /package/docs/v1/libs/{TinyToastNotify.md → html/notification/TinyToastNotify.md} +0 -0
  611. /package/docs/v1/libs/{TinySmartScroller.md → html/scroll/TinySmartScroller.md} +0 -0
  612. /package/docs/v1/libs/{TinyUploadClicker.md → html/upload/TinyUploadClicker.md} +0 -0
  613. /package/docs/v1/libs/{TinyAdvancedRaffle.md → math/TinyAdvancedRaffle.md} +0 -0
  614. /package/docs/v1/libs/{TinyMamdaniInferenceSystem.md → math/TinyMamdaniInferenceSystem.md} +0 -0
  615. /package/docs/v1/libs/{TinyRateLimiter.md → math/TinyRateLimiter.md} +0 -0
  616. /package/docs/v1/libs/{TinySimpleDice.md → math/TinySimpleDice.md} +0 -0
  617. /package/docs/v1/libs/{TinyTimeout.md → math/TinyTimeout.md} +0 -0
  618. /package/docs/v1/libs/{TinyRadioFm.md → media/TinyRadioFm.md} +0 -0
  619. /package/docs/v1/libs/{TinyLocalStorage.md → storage/TinyLocalStorage.md} +0 -0
  620. /package/docs/v1/libs/{TinyI18.md → text/TinyI18.md} +0 -0
  621. /package/docs/v1/libs/{TinyTextRangeEditor.md → text/TinyTextRangeEditor.md} +0 -0
  622. /package/docs/v1/libs/{UltraRandomMsgGen.md → utils/UltraRandomMsgGen.md} +0 -0
@@ -1 +1 @@
1
- (()=>{var e={975(e,t,r){"use strict";var n=r(606);function o(e){if("string"!=typeof e)throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}function s(e,t){for(var r,n="",o=0,s=-1,i=0,a=0;a<=e.length;++a){if(a<e.length)r=e.charCodeAt(a);else{if(47===r)break;r=47}if(47===r){if(s===a-1||1===i);else if(s!==a-1&&2===i){if(n.length<2||2!==o||46!==n.charCodeAt(n.length-1)||46!==n.charCodeAt(n.length-2))if(n.length>2){var l=n.lastIndexOf("/");if(l!==n.length-1){-1===l?(n="",o=0):o=(n=n.slice(0,l)).length-1-n.lastIndexOf("/"),s=a,i=0;continue}}else if(2===n.length||1===n.length){n="",o=0,s=a,i=0;continue}t&&(n.length>0?n+="/..":n="..",o=2)}else n.length>0?n+="/"+e.slice(s+1,a):n=e.slice(s+1,a),o=a-s-1;s=a,i=0}else 46===r&&-1!==i?++i:i=-1}return n}var i={resolve:function(){for(var e,t="",r=!1,i=arguments.length-1;i>=-1&&!r;i--){var a;i>=0?a=arguments[i]:(void 0===e&&(e=n.cwd()),a=e),o(a),0!==a.length&&(t=a+"/"+t,r=47===a.charCodeAt(0))}return t=s(t,!r),r?t.length>0?"/"+t:"/":t.length>0?t:"."},normalize:function(e){if(o(e),0===e.length)return".";var t=47===e.charCodeAt(0),r=47===e.charCodeAt(e.length-1);return 0!==(e=s(e,!t)).length||t||(e="."),e.length>0&&r&&(e+="/"),t?"/"+e:e},isAbsolute:function(e){return o(e),e.length>0&&47===e.charCodeAt(0)},join:function(){if(0===arguments.length)return".";for(var e,t=0;t<arguments.length;++t){var r=arguments[t];o(r),r.length>0&&(void 0===e?e=r:e+="/"+r)}return void 0===e?".":i.normalize(e)},relative:function(e,t){if(o(e),o(t),e===t)return"";if((e=i.resolve(e))===(t=i.resolve(t)))return"";for(var r=1;r<e.length&&47===e.charCodeAt(r);++r);for(var n=e.length,s=n-r,a=1;a<t.length&&47===t.charCodeAt(a);++a);for(var l=t.length-a,c=s<l?s:l,f=-1,h=0;h<=c;++h){if(h===c){if(l>c){if(47===t.charCodeAt(a+h))return t.slice(a+h+1);if(0===h)return t.slice(a+h)}else s>c&&(47===e.charCodeAt(r+h)?f=h:0===h&&(f=0));break}var u=e.charCodeAt(r+h);if(u!==t.charCodeAt(a+h))break;47===u&&(f=h)}var p="";for(h=r+f+1;h<=n;++h)h!==n&&47!==e.charCodeAt(h)||(0===p.length?p+="..":p+="/..");return p.length>0?p+t.slice(a+f):(a+=f,47===t.charCodeAt(a)&&++a,t.slice(a))},_makeLong:function(e){return e},dirname:function(e){if(o(e),0===e.length)return".";for(var t=e.charCodeAt(0),r=47===t,n=-1,s=!0,i=e.length-1;i>=1;--i)if(47===(t=e.charCodeAt(i))){if(!s){n=i;break}}else s=!1;return-1===n?r?"/":".":r&&1===n?"//":e.slice(0,n)},basename:function(e,t){if(void 0!==t&&"string"!=typeof t)throw new TypeError('"ext" argument must be a string');o(e);var r,n=0,s=-1,i=!0;if(void 0!==t&&t.length>0&&t.length<=e.length){if(t.length===e.length&&t===e)return"";var a=t.length-1,l=-1;for(r=e.length-1;r>=0;--r){var c=e.charCodeAt(r);if(47===c){if(!i){n=r+1;break}}else-1===l&&(i=!1,l=r+1),a>=0&&(c===t.charCodeAt(a)?-1===--a&&(s=r):(a=-1,s=l))}return n===s?s=l:-1===s&&(s=e.length),e.slice(n,s)}for(r=e.length-1;r>=0;--r)if(47===e.charCodeAt(r)){if(!i){n=r+1;break}}else-1===s&&(i=!1,s=r+1);return-1===s?"":e.slice(n,s)},extname:function(e){o(e);for(var t=-1,r=0,n=-1,s=!0,i=0,a=e.length-1;a>=0;--a){var l=e.charCodeAt(a);if(47!==l)-1===n&&(s=!1,n=a+1),46===l?-1===t?t=a:1!==i&&(i=1):-1!==t&&(i=-1);else if(!s){r=a+1;break}}return-1===t||-1===n||0===i||1===i&&t===n-1&&t===r+1?"":e.slice(t,n)},format:function(e){if(null===e||"object"!=typeof e)throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof e);return function(e,t){var r=t.dir||t.root,n=t.base||(t.name||"")+(t.ext||"");return r?r===t.root?r+n:r+"/"+n:n}(0,e)},parse:function(e){o(e);var t={root:"",dir:"",base:"",ext:"",name:""};if(0===e.length)return t;var r,n=e.charCodeAt(0),s=47===n;s?(t.root="/",r=1):r=0;for(var i=-1,a=0,l=-1,c=!0,f=e.length-1,h=0;f>=r;--f)if(47!==(n=e.charCodeAt(f)))-1===l&&(c=!1,l=f+1),46===n?-1===i?i=f:1!==h&&(h=1):-1!==i&&(h=-1);else if(!c){a=f+1;break}return-1===i||-1===l||0===h||1===h&&i===l-1&&i===a+1?-1!==l&&(t.base=t.name=0===a&&s?e.slice(1,l):e.slice(a,l)):(0===a&&s?(t.name=e.slice(1,i),t.base=e.slice(1,l)):(t.name=e.slice(a,i),t.base=e.slice(a,l)),t.ext=e.slice(i,l)),a>0?t.dir=e.slice(0,a-1):s&&(t.dir="/"),t},sep:"/",delimiter:":",win32:null,posix:null};i.posix=i,e.exports=i},606(e){var t,r,n=e.exports={};function o(){throw new Error("setTimeout has not been defined")}function s(){throw new Error("clearTimeout has not been defined")}function i(e){if(t===setTimeout)return setTimeout(e,0);if((t===o||!t)&&setTimeout)return t=setTimeout,setTimeout(e,0);try{return t(e,0)}catch(r){try{return t.call(null,e,0)}catch(r){return t.call(this,e,0)}}}!function(){try{t="function"==typeof setTimeout?setTimeout:o}catch(e){t=o}try{r="function"==typeof clearTimeout?clearTimeout:s}catch(e){r=s}}();var a,l=[],c=!1,f=-1;function h(){c&&a&&(c=!1,a.length?l=a.concat(l):f=-1,l.length&&u())}function u(){if(!c){var e=i(h);c=!0;for(var t=l.length;t;){for(a=l,l=[];++f<t;)a&&a[f].run();f=-1,t=l.length}a=null,c=!1,function(e){if(r===clearTimeout)return clearTimeout(e);if((r===s||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(e);try{return r(e)}catch(t){try{return r.call(null,e)}catch(t){return r.call(this,e)}}}(e)}}function p(e,t){this.fun=e,this.array=t}function y(){}n.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)t[r-1]=arguments[r];l.push(new p(e,t)),1!==l.length||c||i(u)},p.prototype.run=function(){this.fun.apply(null,this.array)},n.title="browser",n.browser=!0,n.env={},n.argv=[],n.version="",n.versions={},n.on=y,n.addListener=y,n.once=y,n.off=y,n.removeListener=y,n.removeAllListeners=y,n.emit=y,n.prependListener=y,n.prependOnceListener=y,n.listeners=function(e){return[]},n.binding=function(e){throw new Error("process.binding is not supported")},n.cwd=function(){return"/"},n.chdir=function(e){throw new Error("process.chdir is not supported")},n.umask=function(){return 0}},766(){},911(){}};const t={};function r(n){const o=t[n];if(void 0!==o)return o.exports;const s=t[n]={exports:{}};return e[n](s,s.exports,r),s.exports}r.d=(e,t)=>{if(Array.isArray(t))for(var n=0;n<t.length;){var o=t[n++],s=t[n++];r.o(e,o)?0===s&&n++:0===s?Object.defineProperty(e,o,{enumerable:!0,value:t[n++]}):Object.defineProperty(e,o,{enumerable:!0,get:s})}else for(var o in t)r.o(t,o)&&!r.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);let n={};(()=>{"use strict";r.d(n,{TinyI18:()=>i});var e=r(911),t=r(766),o=r(975);const s=e=>{if(e)throw new Error("This TinyI18 instance has been destroyed and can no longer be used.")};const i=class{static async mergeLocaleFiles({files:r,output:n,spaces:o=0}){if("number"!=typeof o||Number.isNaN(o)||o<0)throw new TypeError('mergeLocaleFiles: "spaces" must be a non-negative number');if(!Array.isArray(r)||0===r.length)throw new TypeError('mergeLocaleFiles: "files" must be a non-empty array of file paths');if("string"!=typeof n||!n)throw new TypeError('mergeLocaleFiles: "output" must be a non-empty string path');const s={};for(const n of r){if("string"!=typeof n||!n)throw new TypeError("mergeLocaleFiles: each file path must be a non-empty string");if(!(0,t.existsSync)(n))throw new Error(`mergeLocaleFiles: file "${n}" does not exist`);const r=await(0,e.readFile)(n,"utf-8");let o;try{o=JSON.parse(r)}catch(e){throw new Error(`mergeLocaleFiles: file "${n}" is not valid JSON`)}Object.assign(s,o)}await(0,e.writeFile)(n,JSON.stringify(s,null,o),"utf-8")}#e=!1;get destroyed(){return this.#e}#t;#r;#n=null;#o;#s=null;#i=new Map;#a=new Map;#l=new Map;#c=new Map;get currentLocale(){return s(this.#e),this.#n}get defaultLocale(){return s(this.#e),this.#r}get mode(){return s(this.#e),this.#t}get strict(){return s(this.#e),this.#o}get basePath(){return s(this.#e),this.#s}get stats(){s(this.#e);const e=[];for(const t of this.#i.keys())e.push(this.getStatsForLocale(t));return e}get stringTables(){s(this.#e);const e={};for(const[t,r]of this.#i.entries())e[t]=this.#f(r);return e}get patternTables(){s(this.#e);const e={};for(const[t,r]of this.#a.entries())e[t]=r.map(e=>({$pattern:new RegExp(e.$pattern.source,e.$pattern.flags),value:this.#f(e.value),elseValue:this.#f(e.elseValue)}));return e}get helpers(){s(this.#e);const e={};for(const[t,r]of this.#l.entries())e[t]=r;return e}get regexCache(){s(this.#e);const e={};for(const[t,r]of this.#c.entries())e[t]=new RegExp(r.source,r.flags);return e}#f(e){if(null==e||"string"==typeof e||"function"==typeof e||"number"==typeof e)return e;if(e instanceof RegExp)return new RegExp(e.source,e.flags);if(Array.isArray(e))return e.map(e=>this.#f(e));if("object"==typeof e){const t={};for(const[r,n]of Object.entries(e))t[r]=this.#f(n);return t}return e}#h(e){if(void 0!==e&&"string"!=typeof e)throw new TypeError('#resolveOrder: "forceLocale" must be a string if provided');const t=[];return e&&"string"==typeof e&&this.#i.has(e)?t.push(e):this.#n&&t.push(this.#n),t.push(this.#r),t}#u(e,t){if(!Array.isArray(e)||!e.every(e=>"string"==typeof e))throw new TypeError('#resolveExact: "order" must be an array of strings');if("string"!=typeof t||!t)throw new TypeError('#resolveExact: "key" must be a non-empty string');for(const r of e){const e=this.#i.get(r);if(e&&Object.prototype.hasOwnProperty.call(e,t))return e[t]}}#p(e,t){if(!Array.isArray(e)||!e.every(e=>"string"==typeof e))throw new TypeError('#resolveByPattern: "order" must be an array of strings');if("string"!=typeof t||!t)throw new TypeError('#resolveByPattern: "key" must be a non-empty string');for(const r of e){const e=this.#a.get(r)||[];for(const r of e)return r.$pattern.test(t)?r.value:r.elseValue??void 0}}#y(e,t){if(null==e){if(this.#o)throw new TypeError('#materialize: "value" cannot be null or undefined');return""}if("string"==typeof e)return this.#g(e,t);if("function"==typeof e)return e(t??{},this.#d());if(e&&"object"==typeof e&&"string"==typeof e.$fn){const r=this.#l.get(e.$fn);if("function"!=typeof r){if(this.#o)throw new Error(`TinyI18: helper "${e.$fn}" is not registered`);return""}return r({...t??{},args:void 0!==e.args?e.args:void 0},this.#d())}if(this.#o)throw new Error("TinyI18: unsupported entry type");return""}#g(e,t){if("string"!=typeof e)throw new TypeError('#interpolate: "template" must be a string');if(void 0!==t&&(null===t||"object"!=typeof t))throw new TypeError('#interpolate: "params" must be an object if provided');return t&&"object"==typeof t?e.replace(/\{([a-zA-Z0-9_.$-]+)\}/g,(e,r)=>{const n=this.#b(t,r);return null==n?"":String(n)}):e}#b(e,t){if(!e||"object"!=typeof e)throw new TypeError('#dotGet: "obj" must be an object');if("string"!=typeof t||!t)throw new TypeError('#dotGet: "path" must be a non-empty string');const r=t.split(".");let n=e;for(const e of r){if(null==n)return;n=n[e]}return n}#d(){return{has:e=>this.#l.has(e),call:(e,t,r)=>{const n=this.#l.get(e);if("function"!=typeof n)throw new Error(`Helper "${e}" not found`);return n(t,r??{})}}}#w(e,t){if("string"!=typeof e||!e)throw new TypeError('#ingestLocale: "locale" must be a non-empty string');if(!t||"object"!=typeof t)throw new TypeError('#ingestLocale: "raw" must be an object');if("string"!=typeof e||!e)throw new TypeError("#ingestLocale: invalid locale");if(!t||"object"!=typeof t)throw new TypeError('#ingestLocale: "raw" must be an object');const r={...this.#i.get(e)??{}},n=[...this.#a.get(e)??[]],o=(e,t)=>{if(null!=t)if("string"==typeof t||"function"==typeof t||t&&"object"==typeof t&&"string"==typeof t.$fn){if(!e)throw new TypeError("Leaf value requires a key path");r[e]=t}else if(t&&"object"==typeof t){if(t.$pattern instanceof RegExp&&Object.prototype.hasOwnProperty.call(t,"value"))return void n.push({$pattern:t.$pattern,value:t.value,elseValue:t.elseValue});for(const[r,n]of Object.entries(t))o(e?`${e}.${r}`:r,n)}};o("",t),this.#i.set(e,r),this.#a.set(e,n),this.#i.has(this.#r)||(this.#i.set(this.#r,{}),this.#a.set(this.#r,[]))}#m(e){if("string"!=typeof e||!e)throw new TypeError('#unloadLocale: "locale" must be a non-empty string');e!==this.#r&&(this.#i.delete(e),this.#a.delete(e))}async#T(t){if("string"!=typeof t||!t)throw new TypeError('#loadLocaleFromFile: "locale" must be a non-empty string');if("string"!=typeof this.#s||!this.#s)throw new TypeError('#loadLocaleFromFile: "this.#basePath" must be a non-empty string');const r=(0,o.join)(this.#s,`${t}.json`);let n;try{const t=await(0,e.readFile)(r,"utf8");n=JSON.parse(t)}catch(e){if(!(e instanceof Error))return;if(this.#o)throw new Error(`TinyI18: failed to load or parse ${r}: ${e.message}`);return this.#i.set(t,{}),void this.#a.set(t,[])}const s={...this.#i.get(t)??{}},i=[...this.#a.get(t)??[]],a=(e,t)=>{if(null!=t){if(t&&"object"==typeof t&&"string"==typeof t.$pattern&&Object.prototype.hasOwnProperty.call(t,"value")){const e=this.#v(t.$pattern);return void i.push({$pattern:e,value:this.#E(t.value),elseValue:this.#E(t.elseValue)})}if("string"==typeof t||t&&"object"==typeof t&&"string"==typeof t.$fn){if(!e)throw new TypeError("Leaf value requires a key path");s[e]=this.#E(t)}else if(t&&"object"==typeof t)for(const[r,n]of Object.entries(t))a(e?`${e}.${r}`:r,n)}};a("",n),this.#i.set(t,s),this.#a.set(t,i)}#v(e){if("string"!=typeof e||!e)throw new TypeError('#safeRegExp: "src" must be a non-empty string');const t=this.#c.get(e);if(t)return t;try{const t=new RegExp(e);return this.#c.set(e,t),t}catch{if(this.#o)throw new Error(`TinyI18: invalid regex "${e}" in file`);return/^$/}}#E(e){if("string"==typeof e)return e;if(e&&"object"==typeof e&&"string"==typeof e.$fn)return{$fn:String(e.$fn),args:e.args};if(this.#o)throw new Error("TinyI18: unsupported value in file JSON");return""}constructor(e){if(!e||"object"!=typeof e)throw new TypeError("TinyI18: options must be an object");const{mode:t,defaultLocale:r,basePath:n,localResources:o,strict:s=!0}=e;if("local"!==t&&"file"!==t)throw new TypeError('TinyI18: "mode" must be "local" or "file"');if("string"!=typeof r||!r)throw new TypeError('TinyI18: "defaultLocale" must be a non-empty string');if("boolean"!=typeof s)throw new TypeError('TinyI18: "strict" must be a boolean');if("file"===t){if("string"!=typeof n||!n)throw new TypeError('TinyI18: "basePath" is required in file mode');this.#s=n}if(this.#t=t,this.#r=r,this.#o=s,"local"===t&&o&&"object"==typeof o)for(const[e,t]of Object.entries(o))this.#w(e,t);this.#i.has(this.#r)||(this.#i.set(this.#r,{}),this.#a.set(this.#r,[]))}clearRegexCache(){s(this.#e),this.#c.clear()}registerHelper(e,t){if(s(this.#e),"string"!=typeof e||!e)throw new TypeError('registerHelper: "name" must be non-empty string');if("function"!=typeof t)throw new TypeError('registerHelper: "fn" must be a function');this.#l.set(e,t)}unregisterHelper(e){if(s(this.#e),"string"!=typeof e||!e)throw new TypeError('unregisterHelper: "name" must be non-empty string');return this.#l.delete(e)}loadLocaleLocal(e,t){if(s(this.#e),"local"!==this.#t)throw new TypeError('loadLocaleLocal is only available in "local" mode');this.#w(e,t)}async setLocale(e){if(s(this.#e),null!==e&&("string"!=typeof e||!e))throw new TypeError('setLocale: "locale" must be string or null');const t=this.#n;null!==e&&("file"===this.#t?await this.#T(e):this.#i.has(e)||(this.#i.set(e,{}),this.#a.set(e,[]))),"file"===this.#t&&t&&t!==this.#r&&t!==e&&this.#m(t),this.#n=e}t(e,t=void 0,r=void 0){return this.get(e,t,r)}get(e,t=void 0,r=void 0){if(s(this.#e),"string"!=typeof e||!e)throw new TypeError('get: "key" must be a non-empty string');const{locale:n}=r||{},o=this.#h(n);let i=this.#u(o,e);if(void 0===i){if(this.#o)throw new Error(`TinyI18: missing translation for key "${e}"`);return e}return this.#y(i,t)}p(e,t){return this.resolveByPattern(e,t)}resolveByPattern(e,t){if(s(this.#e),"string"!=typeof e||!e)throw new TypeError('get: "key" must be a non-empty string');const{locale:r}=t||{},n=this.#h(r);let o=this.#p(n,e);if(void 0===o){if(this.#o)throw new Error(`TinyI18: missing translation for key "${e}"`);return e}return o}resetToDefaultOnly(){if(s(this.#e),"file"===this.#t)for(const e of Array.from(this.#i.keys()))e!==this.#r&&this.#m(e);this.#n=null}getStatsForLocale(e){if(s(this.#e),"string"!=typeof e||!e)throw new TypeError('getStatsForLocale: "locale" must be a non-empty string');if(!this.#i.has(e))throw new Error(`getStatsForLocale: locale "${e}" is not registered`);return{locale:e,strings:Object.keys(this.#i.get(e)??{}).length,patterns:this.#a.get(e)?.length??0,isDefault:e===this.#r,isCurrent:e===this.#n}}destroy(){this.#e||(this.#i.clear(),this.#a.clear(),this.#l.clear(),this.#c.clear(),this.#n=null,this.#s=null,this.#e=!0)}}})(),window.TinyI18=n.TinyI18})();
1
+ (()=>{var e={975(e,t,r){"use strict";var n=r(606);function o(e){if("string"!=typeof e)throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}function s(e,t){for(var r,n="",o=0,s=-1,i=0,a=0;a<=e.length;++a){if(a<e.length)r=e.charCodeAt(a);else{if(47===r)break;r=47}if(47===r){if(s===a-1||1===i);else if(s!==a-1&&2===i){if(n.length<2||2!==o||46!==n.charCodeAt(n.length-1)||46!==n.charCodeAt(n.length-2))if(n.length>2){var l=n.lastIndexOf("/");if(l!==n.length-1){-1===l?(n="",o=0):o=(n=n.slice(0,l)).length-1-n.lastIndexOf("/"),s=a,i=0;continue}}else if(2===n.length||1===n.length){n="",o=0,s=a,i=0;continue}t&&(n.length>0?n+="/..":n="..",o=2)}else n.length>0?n+="/"+e.slice(s+1,a):n=e.slice(s+1,a),o=a-s-1;s=a,i=0}else 46===r&&-1!==i?++i:i=-1}return n}var i={resolve:function(){for(var e,t="",r=!1,i=arguments.length-1;i>=-1&&!r;i--){var a;i>=0?a=arguments[i]:(void 0===e&&(e=n.cwd()),a=e),o(a),0!==a.length&&(t=a+"/"+t,r=47===a.charCodeAt(0))}return t=s(t,!r),r?t.length>0?"/"+t:"/":t.length>0?t:"."},normalize:function(e){if(o(e),0===e.length)return".";var t=47===e.charCodeAt(0),r=47===e.charCodeAt(e.length-1);return 0!==(e=s(e,!t)).length||t||(e="."),e.length>0&&r&&(e+="/"),t?"/"+e:e},isAbsolute:function(e){return o(e),e.length>0&&47===e.charCodeAt(0)},join:function(){if(0===arguments.length)return".";for(var e,t=0;t<arguments.length;++t){var r=arguments[t];o(r),r.length>0&&(void 0===e?e=r:e+="/"+r)}return void 0===e?".":i.normalize(e)},relative:function(e,t){if(o(e),o(t),e===t)return"";if((e=i.resolve(e))===(t=i.resolve(t)))return"";for(var r=1;r<e.length&&47===e.charCodeAt(r);++r);for(var n=e.length,s=n-r,a=1;a<t.length&&47===t.charCodeAt(a);++a);for(var l=t.length-a,c=s<l?s:l,f=-1,h=0;h<=c;++h){if(h===c){if(l>c){if(47===t.charCodeAt(a+h))return t.slice(a+h+1);if(0===h)return t.slice(a+h)}else s>c&&(47===e.charCodeAt(r+h)?f=h:0===h&&(f=0));break}var u=e.charCodeAt(r+h);if(u!==t.charCodeAt(a+h))break;47===u&&(f=h)}var p="";for(h=r+f+1;h<=n;++h)h!==n&&47!==e.charCodeAt(h)||(0===p.length?p+="..":p+="/..");return p.length>0?p+t.slice(a+f):(a+=f,47===t.charCodeAt(a)&&++a,t.slice(a))},_makeLong:function(e){return e},dirname:function(e){if(o(e),0===e.length)return".";for(var t=e.charCodeAt(0),r=47===t,n=-1,s=!0,i=e.length-1;i>=1;--i)if(47===(t=e.charCodeAt(i))){if(!s){n=i;break}}else s=!1;return-1===n?r?"/":".":r&&1===n?"//":e.slice(0,n)},basename:function(e,t){if(void 0!==t&&"string"!=typeof t)throw new TypeError('"ext" argument must be a string');o(e);var r,n=0,s=-1,i=!0;if(void 0!==t&&t.length>0&&t.length<=e.length){if(t.length===e.length&&t===e)return"";var a=t.length-1,l=-1;for(r=e.length-1;r>=0;--r){var c=e.charCodeAt(r);if(47===c){if(!i){n=r+1;break}}else-1===l&&(i=!1,l=r+1),a>=0&&(c===t.charCodeAt(a)?-1===--a&&(s=r):(a=-1,s=l))}return n===s?s=l:-1===s&&(s=e.length),e.slice(n,s)}for(r=e.length-1;r>=0;--r)if(47===e.charCodeAt(r)){if(!i){n=r+1;break}}else-1===s&&(i=!1,s=r+1);return-1===s?"":e.slice(n,s)},extname:function(e){o(e);for(var t=-1,r=0,n=-1,s=!0,i=0,a=e.length-1;a>=0;--a){var l=e.charCodeAt(a);if(47!==l)-1===n&&(s=!1,n=a+1),46===l?-1===t?t=a:1!==i&&(i=1):-1!==t&&(i=-1);else if(!s){r=a+1;break}}return-1===t||-1===n||0===i||1===i&&t===n-1&&t===r+1?"":e.slice(t,n)},format:function(e){if(null===e||"object"!=typeof e)throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof e);return function(e,t){var r=t.dir||t.root,n=t.base||(t.name||"")+(t.ext||"");return r?r===t.root?r+n:r+"/"+n:n}(0,e)},parse:function(e){o(e);var t={root:"",dir:"",base:"",ext:"",name:""};if(0===e.length)return t;var r,n=e.charCodeAt(0),s=47===n;s?(t.root="/",r=1):r=0;for(var i=-1,a=0,l=-1,c=!0,f=e.length-1,h=0;f>=r;--f)if(47!==(n=e.charCodeAt(f)))-1===l&&(c=!1,l=f+1),46===n?-1===i?i=f:1!==h&&(h=1):-1!==i&&(h=-1);else if(!c){a=f+1;break}return-1===i||-1===l||0===h||1===h&&i===l-1&&i===a+1?-1!==l&&(t.base=t.name=0===a&&s?e.slice(1,l):e.slice(a,l)):(0===a&&s?(t.name=e.slice(1,i),t.base=e.slice(1,l)):(t.name=e.slice(a,i),t.base=e.slice(a,l)),t.ext=e.slice(i,l)),a>0?t.dir=e.slice(0,a-1):s&&(t.dir="/"),t},sep:"/",delimiter:":",win32:null,posix:null};i.posix=i,e.exports=i},606(e){var t,r,n=e.exports={};function o(){throw new Error("setTimeout has not been defined")}function s(){throw new Error("clearTimeout has not been defined")}function i(e){if(t===setTimeout)return setTimeout(e,0);if((t===o||!t)&&setTimeout)return t=setTimeout,setTimeout(e,0);try{return t(e,0)}catch(r){try{return t.call(null,e,0)}catch(r){return t.call(this,e,0)}}}!function(){try{t="function"==typeof setTimeout?setTimeout:o}catch(e){t=o}try{r="function"==typeof clearTimeout?clearTimeout:s}catch(e){r=s}}();var a,l=[],c=!1,f=-1;function h(){c&&a&&(c=!1,a.length?l=a.concat(l):f=-1,l.length&&u())}function u(){if(!c){var e=i(h);c=!0;for(var t=l.length;t;){for(a=l,l=[];++f<t;)a&&a[f].run();f=-1,t=l.length}a=null,c=!1,function(e){if(r===clearTimeout)return clearTimeout(e);if((r===s||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(e);try{return r(e)}catch(t){try{return r.call(null,e)}catch(t){return r.call(this,e)}}}(e)}}function p(e,t){this.fun=e,this.array=t}function y(){}n.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)t[r-1]=arguments[r];l.push(new p(e,t)),1!==l.length||c||i(u)},p.prototype.run=function(){this.fun.apply(null,this.array)},n.title="browser",n.browser=!0,n.env={},n.argv=[],n.version="",n.versions={},n.on=y,n.addListener=y,n.once=y,n.off=y,n.removeListener=y,n.removeAllListeners=y,n.emit=y,n.prependListener=y,n.prependOnceListener=y,n.listeners=function(e){return[]},n.binding=function(e){throw new Error("process.binding is not supported")},n.cwd=function(){return"/"},n.chdir=function(e){throw new Error("process.chdir is not supported")},n.umask=function(){return 0}},494(){},31(){}};const t={};function r(n){const o=t[n];if(void 0!==o)return o.exports;const s=t[n]={exports:{}};return e[n](s,s.exports,r),s.exports}r.d=(e,t)=>{if(Array.isArray(t))for(var n=0;n<t.length;){var o=t[n++],s=t[n++];r.o(e,o)?0===s&&n++:0===s?Object.defineProperty(e,o,{enumerable:!0,value:t[n++]}):Object.defineProperty(e,o,{enumerable:!0,get:s})}else for(var o in t)r.o(t,o)&&!r.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);let n={};(()=>{"use strict";r.d(n,{TinyI18:()=>i});var e=r(31),t=r(494),o=r(975);const s=e=>{if(e)throw new Error("This TinyI18 instance has been destroyed and can no longer be used.")};const i=class{static async mergeLocaleFiles({files:r,output:n,spaces:o=0}){if("number"!=typeof o||Number.isNaN(o)||o<0)throw new TypeError('mergeLocaleFiles: "spaces" must be a non-negative number');if(!Array.isArray(r)||0===r.length)throw new TypeError('mergeLocaleFiles: "files" must be a non-empty array of file paths');if("string"!=typeof n||!n)throw new TypeError('mergeLocaleFiles: "output" must be a non-empty string path');const s={};for(const n of r){if("string"!=typeof n||!n)throw new TypeError("mergeLocaleFiles: each file path must be a non-empty string");if(!(0,t.existsSync)(n))throw new Error(`mergeLocaleFiles: file "${n}" does not exist`);const r=await(0,e.readFile)(n,"utf-8");let o;try{o=JSON.parse(r)}catch(e){throw new Error(`mergeLocaleFiles: file "${n}" is not valid JSON`)}Object.assign(s,o)}await(0,e.writeFile)(n,JSON.stringify(s,null,o),"utf-8")}#e=!1;get destroyed(){return this.#e}#t;#r;#n=null;#o;#s=null;#i=new Map;#a=new Map;#l=new Map;#c=new Map;get currentLocale(){return s(this.#e),this.#n}get defaultLocale(){return s(this.#e),this.#r}get mode(){return s(this.#e),this.#t}get strict(){return s(this.#e),this.#o}get basePath(){return s(this.#e),this.#s}get stats(){s(this.#e);const e=[];for(const t of this.#i.keys())e.push(this.getStatsForLocale(t));return e}get stringTables(){s(this.#e);const e={};for(const[t,r]of this.#i.entries())e[t]=this.#f(r);return e}get patternTables(){s(this.#e);const e={};for(const[t,r]of this.#a.entries())e[t]=r.map(e=>({$pattern:new RegExp(e.$pattern.source,e.$pattern.flags),value:this.#f(e.value),elseValue:this.#f(e.elseValue)}));return e}get helpers(){s(this.#e);const e={};for(const[t,r]of this.#l.entries())e[t]=r;return e}get regexCache(){s(this.#e);const e={};for(const[t,r]of this.#c.entries())e[t]=new RegExp(r.source,r.flags);return e}#f(e){if(null==e||"string"==typeof e||"function"==typeof e||"number"==typeof e)return e;if(e instanceof RegExp)return new RegExp(e.source,e.flags);if(Array.isArray(e))return e.map(e=>this.#f(e));if("object"==typeof e){const t={};for(const[r,n]of Object.entries(e))t[r]=this.#f(n);return t}return e}#h(e){if(void 0!==e&&"string"!=typeof e)throw new TypeError('#resolveOrder: "forceLocale" must be a string if provided');const t=[];return e&&"string"==typeof e&&this.#i.has(e)?t.push(e):this.#n&&t.push(this.#n),t.push(this.#r),t}#u(e,t){if(!Array.isArray(e)||!e.every(e=>"string"==typeof e))throw new TypeError('#resolveExact: "order" must be an array of strings');if("string"!=typeof t||!t)throw new TypeError('#resolveExact: "key" must be a non-empty string');for(const r of e){const e=this.#i.get(r);if(e&&Object.prototype.hasOwnProperty.call(e,t))return e[t]}}#p(e,t){if(!Array.isArray(e)||!e.every(e=>"string"==typeof e))throw new TypeError('#resolveByPattern: "order" must be an array of strings');if("string"!=typeof t||!t)throw new TypeError('#resolveByPattern: "key" must be a non-empty string');for(const r of e){const e=this.#a.get(r)||[];for(const r of e)return r.$pattern.test(t)?r.value:r.elseValue??void 0}}#y(e,t){if(null==e){if(this.#o)throw new TypeError('#materialize: "value" cannot be null or undefined');return""}if("string"==typeof e)return this.#g(e,t);if("function"==typeof e)return e(t??{},this.#d());if(e&&"object"==typeof e&&"string"==typeof e.$fn){const r=this.#l.get(e.$fn);if("function"!=typeof r){if(this.#o)throw new Error(`TinyI18: helper "${e.$fn}" is not registered`);return""}return r({...t??{},args:void 0!==e.args?e.args:void 0},this.#d())}if(this.#o)throw new Error("TinyI18: unsupported entry type");return""}#g(e,t){if("string"!=typeof e)throw new TypeError('#interpolate: "template" must be a string');if(void 0!==t&&(null===t||"object"!=typeof t))throw new TypeError('#interpolate: "params" must be an object if provided');return t&&"object"==typeof t?e.replace(/\{([a-zA-Z0-9_.$-]+)\}/g,(e,r)=>{const n=this.#b(t,r);return null==n?"":String(n)}):e}#b(e,t){if(!e||"object"!=typeof e)throw new TypeError('#dotGet: "obj" must be an object');if("string"!=typeof t||!t)throw new TypeError('#dotGet: "path" must be a non-empty string');const r=t.split(".");let n=e;for(const e of r){if(null==n)return;n=n[e]}return n}#d(){return{has:e=>this.#l.has(e),call:(e,t,r)=>{const n=this.#l.get(e);if("function"!=typeof n)throw new Error(`Helper "${e}" not found`);return n(t,r??{})}}}#w(e,t){if("string"!=typeof e||!e)throw new TypeError('#ingestLocale: "locale" must be a non-empty string');if(!t||"object"!=typeof t)throw new TypeError('#ingestLocale: "raw" must be an object');if("string"!=typeof e||!e)throw new TypeError("#ingestLocale: invalid locale");if(!t||"object"!=typeof t)throw new TypeError('#ingestLocale: "raw" must be an object');const r={...this.#i.get(e)??{}},n=[...this.#a.get(e)??[]],o=(e,t)=>{if(null!=t)if("string"==typeof t||"function"==typeof t||t&&"object"==typeof t&&"string"==typeof t.$fn){if(!e)throw new TypeError("Leaf value requires a key path");r[e]=t}else if(t&&"object"==typeof t){if(t.$pattern instanceof RegExp&&Object.prototype.hasOwnProperty.call(t,"value"))return void n.push({$pattern:t.$pattern,value:t.value,elseValue:t.elseValue});for(const[r,n]of Object.entries(t))o(e?`${e}.${r}`:r,n)}};o("",t),this.#i.set(e,r),this.#a.set(e,n),this.#i.has(this.#r)||(this.#i.set(this.#r,{}),this.#a.set(this.#r,[]))}#m(e){if("string"!=typeof e||!e)throw new TypeError('#unloadLocale: "locale" must be a non-empty string');e!==this.#r&&(this.#i.delete(e),this.#a.delete(e))}async#T(t){if("string"!=typeof t||!t)throw new TypeError('#loadLocaleFromFile: "locale" must be a non-empty string');if("string"!=typeof this.#s||!this.#s)throw new TypeError('#loadLocaleFromFile: "this.#basePath" must be a non-empty string');const r=(0,o.join)(this.#s,`${t}.json`);let n;try{const t=await(0,e.readFile)(r,"utf8");n=JSON.parse(t)}catch(e){if(!(e instanceof Error))return;if(this.#o)throw new Error(`TinyI18: failed to load or parse ${r}: ${e.message}`);return this.#i.set(t,{}),void this.#a.set(t,[])}const s={...this.#i.get(t)??{}},i=[...this.#a.get(t)??[]],a=(e,t)=>{if(null!=t){if(t&&"object"==typeof t&&"string"==typeof t.$pattern&&Object.prototype.hasOwnProperty.call(t,"value")){const e=this.#v(t.$pattern);return void i.push({$pattern:e,value:this.#E(t.value),elseValue:this.#E(t.elseValue)})}if("string"==typeof t||t&&"object"==typeof t&&"string"==typeof t.$fn){if(!e)throw new TypeError("Leaf value requires a key path");s[e]=this.#E(t)}else if(t&&"object"==typeof t)for(const[r,n]of Object.entries(t))a(e?`${e}.${r}`:r,n)}};a("",n),this.#i.set(t,s),this.#a.set(t,i)}#v(e){if("string"!=typeof e||!e)throw new TypeError('#safeRegExp: "src" must be a non-empty string');const t=this.#c.get(e);if(t)return t;try{const t=new RegExp(e);return this.#c.set(e,t),t}catch{if(this.#o)throw new Error(`TinyI18: invalid regex "${e}" in file`);return/^$/}}#E(e){if("string"==typeof e)return e;if(e&&"object"==typeof e&&"string"==typeof e.$fn)return{$fn:String(e.$fn),args:e.args};if(this.#o)throw new Error("TinyI18: unsupported value in file JSON");return""}constructor(e){if(!e||"object"!=typeof e)throw new TypeError("TinyI18: options must be an object");const{mode:t,defaultLocale:r,basePath:n,localResources:o,strict:s=!0}=e;if("local"!==t&&"file"!==t)throw new TypeError('TinyI18: "mode" must be "local" or "file"');if("string"!=typeof r||!r)throw new TypeError('TinyI18: "defaultLocale" must be a non-empty string');if("boolean"!=typeof s)throw new TypeError('TinyI18: "strict" must be a boolean');if("file"===t){if("string"!=typeof n||!n)throw new TypeError('TinyI18: "basePath" is required in file mode');this.#s=n}if(this.#t=t,this.#r=r,this.#o=s,"local"===t&&o&&"object"==typeof o)for(const[e,t]of Object.entries(o))this.#w(e,t);this.#i.has(this.#r)||(this.#i.set(this.#r,{}),this.#a.set(this.#r,[]))}clearRegexCache(){s(this.#e),this.#c.clear()}registerHelper(e,t){if(s(this.#e),"string"!=typeof e||!e)throw new TypeError('registerHelper: "name" must be non-empty string');if("function"!=typeof t)throw new TypeError('registerHelper: "fn" must be a function');this.#l.set(e,t)}unregisterHelper(e){if(s(this.#e),"string"!=typeof e||!e)throw new TypeError('unregisterHelper: "name" must be non-empty string');return this.#l.delete(e)}loadLocaleLocal(e,t){if(s(this.#e),"local"!==this.#t)throw new TypeError('loadLocaleLocal is only available in "local" mode');this.#w(e,t)}async setLocale(e){if(s(this.#e),null!==e&&("string"!=typeof e||!e))throw new TypeError('setLocale: "locale" must be string or null');const t=this.#n;null!==e&&("file"===this.#t?await this.#T(e):this.#i.has(e)||(this.#i.set(e,{}),this.#a.set(e,[]))),"file"===this.#t&&t&&t!==this.#r&&t!==e&&this.#m(t),this.#n=e}t(e,t=void 0,r=void 0){return this.get(e,t,r)}get(e,t=void 0,r=void 0){if(s(this.#e),"string"!=typeof e||!e)throw new TypeError('get: "key" must be a non-empty string');const{locale:n}=r||{},o=this.#h(n);let i=this.#u(o,e);if(void 0===i){if(this.#o)throw new Error(`TinyI18: missing translation for key "${e}"`);return e}return this.#y(i,t)}p(e,t){return this.resolveByPattern(e,t)}resolveByPattern(e,t){if(s(this.#e),"string"!=typeof e||!e)throw new TypeError('get: "key" must be a non-empty string');const{locale:r}=t||{},n=this.#h(r);let o=this.#p(n,e);if(void 0===o){if(this.#o)throw new Error(`TinyI18: missing translation for key "${e}"`);return e}return o}resetToDefaultOnly(){if(s(this.#e),"file"===this.#t)for(const e of Array.from(this.#i.keys()))e!==this.#r&&this.#m(e);this.#n=null}getStatsForLocale(e){if(s(this.#e),"string"!=typeof e||!e)throw new TypeError('getStatsForLocale: "locale" must be a non-empty string');if(!this.#i.has(e))throw new Error(`getStatsForLocale: locale "${e}" is not registered`);return{locale:e,strings:Object.keys(this.#i.get(e)??{}).length,patterns:this.#a.get(e)?.length??0,isDefault:e===this.#r,isCurrent:e===this.#n}}destroy(){this.#e||(this.#i.clear(),this.#a.clear(),this.#l.clear(),this.#c.clear(),this.#n=null,this.#s=null,this.#e=!0)}}})(),window.TinyI18=n.TinyI18})();
@@ -1 +1 @@
1
- (()=>{"use strict";var e={323(e,t,n){n.d(t,{TinyIframeEvents:()=>h});var r=n.cjs(function(e,t){var n,r="object"==typeof Reflect?Reflect:null,i=r&&"function"==typeof r.apply?r.apply:function(e,t,n){return Function.prototype.apply.call(e,t,n)};n=r&&"function"==typeof r.ownKeys?r.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var s=Number.isNaN||function(e){return e!=e};function o(){o.init.call(this)}e.exports=o,e.exports.once=function(e,t){return new Promise(function(n,r){function i(n){e.removeListener(t,s),r(n)}function s(){"function"==typeof e.removeListener&&e.removeListener("error",i),n([].slice.call(arguments))}l(e,t,s,{once:!0}),"error"!==t&&function(e,t){"function"==typeof e.on&&l(e,"error",t,{once:!0})}(e,i)})},o.EventEmitter=o,o.prototype._events=void 0,o.prototype._eventsCount=0,o.prototype._maxListeners=void 0;var a=10;function h(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function u(e){return void 0===e._maxListeners?o.defaultMaxListeners:e._maxListeners}function d(e,t,n,r){var i,s,o,a;if(h(n),void 0===(s=e._events)?(s=e._events=Object.create(null),e._eventsCount=0):(void 0!==s.newListener&&(e.emit("newListener",t,n.listener?n.listener:n),s=e._events),o=s[t]),void 0===o)o=s[t]=n,++e._eventsCount;else if("function"==typeof o?o=s[t]=r?[n,o]:[o,n]:r?o.unshift(n):o.push(n),(i=u(e))>0&&o.length>i&&!o.warned){o.warned=!0;var d=new Error("Possible EventEmitter memory leak detected. "+o.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");d.name="MaxListenersExceededWarning",d.emitter=e,d.type=t,d.count=o.length,a=d,console&&console.warn&&console.warn(a)}return e}function f(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function p(e,t,n){var r={fired:!1,wrapFn:void 0,target:e,type:t,listener:n},i=f.bind(r);return i.listener=n,r.wrapFn=i,i}function v(e,t,n){var r=e._events;if(void 0===r)return[];var i=r[t];return void 0===i?[]:"function"==typeof i?n?[i.listener||i]:[i]:n?function(e){for(var t=new Array(e.length),n=0;n<t.length;++n)t[n]=e[n].listener||e[n];return t}(i):y(i,i.length)}function c(e){var t=this._events;if(void 0!==t){var n=t[e];if("function"==typeof n)return 1;if(void 0!==n)return n.length}return 0}function y(e,t){for(var n=new Array(t),r=0;r<t;++r)n[r]=e[r];return n}function l(e,t,n,r){if("function"==typeof e.on)r.once?e.once(t,n):e.on(t,n);else{if("function"!=typeof e.addEventListener)throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof e);e.addEventListener(t,function i(s){r.once&&e.removeEventListener(t,i),n(s)})}}Object.defineProperty(o,"defaultMaxListeners",{enumerable:!0,get:function(){return a},set:function(e){if("number"!=typeof e||e<0||s(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");a=e}}),o.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},o.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||s(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this},o.prototype.getMaxListeners=function(){return u(this)},o.prototype.emit=function(e){for(var t=[],n=1;n<arguments.length;n++)t.push(arguments[n]);var r="error"===e,s=this._events;if(void 0!==s)r=r&&void 0===s.error;else if(!r)return!1;if(r){var o;if(t.length>0&&(o=t[0]),o instanceof Error)throw o;var a=new Error("Unhandled error."+(o?" ("+o.message+")":""));throw a.context=o,a}var h=s[e];if(void 0===h)return!1;if("function"==typeof h)i(h,this,t);else{var u=h.length,d=y(h,u);for(n=0;n<u;++n)i(d[n],this,t)}return!0},o.prototype.addListener=function(e,t){return d(this,e,t,!1)},o.prototype.on=o.prototype.addListener,o.prototype.prependListener=function(e,t){return d(this,e,t,!0)},o.prototype.once=function(e,t){return h(t),this.on(e,p(this,e,t)),this},o.prototype.prependOnceListener=function(e,t){return h(t),this.prependListener(e,p(this,e,t)),this},o.prototype.removeListener=function(e,t){var n,r,i,s,o;if(h(t),void 0===(r=this._events))return this;if(void 0===(n=r[e]))return this;if(n===t||n.listener===t)0===--this._eventsCount?this._events=Object.create(null):(delete r[e],r.removeListener&&this.emit("removeListener",e,n.listener||t));else if("function"!=typeof n){for(i=-1,s=n.length-1;s>=0;s--)if(n[s]===t||n[s].listener===t){o=n[s].listener,i=s;break}if(i<0)return this;0===i?n.shift():function(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}(n,i),1===n.length&&(r[e]=n[0]),void 0!==r.removeListener&&this.emit("removeListener",e,o||t)}return this},o.prototype.off=o.prototype.removeListener,o.prototype.removeAllListeners=function(e){var t,n,r;if(void 0===(n=this._events))return this;if(void 0===n.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==n[e]&&(0===--this._eventsCount?this._events=Object.create(null):delete n[e]),this;if(0===arguments.length){var i,s=Object.keys(n);for(r=0;r<s.length;++r)"removeListener"!==(i=s[r])&&this.removeAllListeners(i);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(t=n[e]))this.removeListener(e,t);else if(void 0!==t)for(r=t.length-1;r>=0;r--)this.removeListener(e,t[r]);return this},o.prototype.listeners=function(e){return v(this,e,!0)},o.prototype.rawListeners=function(e){return v(this,e,!1)},o.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):c.call(e,t)},o.prototype.listenerCount=c,o.prototype.eventNames=function(){return this._eventsCount>0?n(this._events):[]}});function i(e){return null!==e&&"object"==typeof e&&!Array.isArray(e)&&"[object Object]"===Object.prototype.toString.call(e)}const s=e=>{if(e)throw new Error("This TinyIframeEvents instance has been destroyed and can no longer be used.")};const o=new WeakMap;class a extends r.EventEmitter{#e;get targetWindow(){return s(this.#t),this.#e}#n;get targetIframeElement(){return s(this.#t),this.#n}#r;get targetOrigin(){return s(this.#t),this.#r}#i;get selfType(){return s(this.#t),this.#i}#t=!1;#s=!1;get ready(){return s(this.#t),this.#s}onReady(e){s(this.#t),this.#s?e():this.once(this.#o,e)}#a=null;#h=[];#u;#d;#o;#f=null;constructor({targetIframe:e,targetOrigin:t=window.location.origin,secretEventName:n="__tinyIframeEvent__",handshakeEventName:r="__tinyIframeHandshake__",readyEventName:i="__tinyIframeReady__"}={}){if(super(),!(void 0===e||e instanceof HTMLIFrameElement&&e.contentWindow))throw new TypeError('[TinyIframeEvents] Invalid "targetIframe": expected HTMLIFrameElement, received '+typeof e);if("string"!=typeof t)throw new TypeError('[TinyIframeEvents] Invalid "targetOrigin": expected string, received '+typeof t);if(this.#n=e,this.#e=e?.contentWindow??window.parent,this.#r=t,this.#i=e?"parent":"iframe",this.#u=n,this.#d=r,this.#o=i,o.has(this.#e))throw new Error("Duplicate window reference.");this._boundWindowMessage=this.#p.bind(this),this._boundPortMessage=this.#v.bind(this),this.#c(),o.set(this.#e,this)}get secretEventName(){return s(this.#t),this.#u}set secretEventName(e){if(s(this.#t),"string"!=typeof e)throw new TypeError("TinyIframeEvents: secretEventName must be a string.");this.#u=e}get handshakeEventName(){return s(this.#t),this.#d}set handshakeEventName(e){if(s(this.#t),"string"!=typeof e)throw new TypeError("TinyIframeEvents: handshakeEventName must be a string.");this.#d=e}get readyEventName(){return s(this.#t),this.#o}set readyEventName(e){if(s(this.#t),"string"!=typeof e)throw new TypeError("TinyIframeEvents: readyEventName must be a string.");this.#o=e}#c(){"parent"===this.#i?(this.#f=()=>{if(this.#t)return;this.#a&&this.#a.close();const e=new MessageChannel;this.#a=e.port1,this.#a.onmessage=this._boundPortMessage,this.#s=!1,this.#e.postMessage({type:this.#d},this.#r,[e.port2])},this.#n&&(this.#n.addEventListener("load",this.#f),this.#f())):window.addEventListener("message",this._boundWindowMessage,!1)}#p(e){const t=e.data,n=e.ports;i(t)&&t.type===this.#d&&0!==n.length&&(this.#a=n[0],this.#a.onmessage=this._boundPortMessage,window.removeEventListener("message",this._boundWindowMessage),this.#a.postMessage({type:`${this.#d}_ACK`}),this.#y())}#v(e){const t=e.data;if(i(t)&&t.type===`${this.#d}_ACK`)return void this.#y();if(!i(t)||!t[this.#u])return;const n=t.eventName,r=t.payload,s=t.direction;"string"!=typeof n||"iframe"===this.#i&&"iframe"!==s||"parent"===this.#i&&"parent"!==s||this.emit(`win:${n}`,r,e)}#y(){this.#s||(this.#s=!0,this.#l(),this.emit(this.#o))}#l(){for(;this.#h.length>0;){const e=this.#h.shift();e&&this.#a&&this.#a.postMessage(e)}}winEmit(e,t){if(s(this.#t),"string"!=typeof e)throw new TypeError("Event name must be a string.");if(this.#t)throw new Error("Cannot emit: instance has been destroyed.");const n={[this.#u]:!0,eventName:e,payload:t,direction:"parent"===this.#i?"iframe":"parent"};this.#s&&this.#a?this.#a.postMessage(n):this.#h.push(n)}isDestroyed(){return this.#t}destroy(){this.#t||(this.#s=!1,window.removeEventListener("message",this._boundWindowMessage),this.#n&&this.#f&&this.#n.removeEventListener("load",this.#f),this.#a&&(this.#a.close(),this.#a=null),this.removeAllListeners(),this.#h=[],o.delete(this.#e),this.#t=!0)}}const h=a}};const t={};function n(r){const i=t[r];if(void 0!==i)return i.exports;const s=t[r]={exports:{}};return e[r](s,s.exports,n),s.exports}n.d=(e,t)=>{if(Array.isArray(t))for(var r=0;r<t.length;){var i=t[r++],s=t[r++];n.o(e,i)?0===s&&r++:0===s?Object.defineProperty(e,i,{enumerable:!0,value:t[r++]}):Object.defineProperty(e,i,{enumerable:!0,get:s})}else for(var i in t)n.o(t,i)&&!n.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.cjs=e=>{const t={exports:{}};return e.call(t.exports,t,t.exports),t.exports};let r=n(323);window.TinyIframeEvents=r.TinyIframeEvents})();
1
+ (()=>{"use strict";var e={187(e,t,n){n.d(t,{TinyIframeEvents:()=>h});var r=n.cjs(function(e,t){var n,r="object"==typeof Reflect?Reflect:null,i=r&&"function"==typeof r.apply?r.apply:function(e,t,n){return Function.prototype.apply.call(e,t,n)};n=r&&"function"==typeof r.ownKeys?r.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var s=Number.isNaN||function(e){return e!=e};function o(){o.init.call(this)}e.exports=o,e.exports.once=function(e,t){return new Promise(function(n,r){function i(n){e.removeListener(t,s),r(n)}function s(){"function"==typeof e.removeListener&&e.removeListener("error",i),n([].slice.call(arguments))}l(e,t,s,{once:!0}),"error"!==t&&function(e,t){"function"==typeof e.on&&l(e,"error",t,{once:!0})}(e,i)})},o.EventEmitter=o,o.prototype._events=void 0,o.prototype._eventsCount=0,o.prototype._maxListeners=void 0;var a=10;function h(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function u(e){return void 0===e._maxListeners?o.defaultMaxListeners:e._maxListeners}function d(e,t,n,r){var i,s,o,a;if(h(n),void 0===(s=e._events)?(s=e._events=Object.create(null),e._eventsCount=0):(void 0!==s.newListener&&(e.emit("newListener",t,n.listener?n.listener:n),s=e._events),o=s[t]),void 0===o)o=s[t]=n,++e._eventsCount;else if("function"==typeof o?o=s[t]=r?[n,o]:[o,n]:r?o.unshift(n):o.push(n),(i=u(e))>0&&o.length>i&&!o.warned){o.warned=!0;var d=new Error("Possible EventEmitter memory leak detected. "+o.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");d.name="MaxListenersExceededWarning",d.emitter=e,d.type=t,d.count=o.length,a=d,console&&console.warn&&console.warn(a)}return e}function f(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function p(e,t,n){var r={fired:!1,wrapFn:void 0,target:e,type:t,listener:n},i=f.bind(r);return i.listener=n,r.wrapFn=i,i}function v(e,t,n){var r=e._events;if(void 0===r)return[];var i=r[t];return void 0===i?[]:"function"==typeof i?n?[i.listener||i]:[i]:n?function(e){for(var t=new Array(e.length),n=0;n<t.length;++n)t[n]=e[n].listener||e[n];return t}(i):y(i,i.length)}function c(e){var t=this._events;if(void 0!==t){var n=t[e];if("function"==typeof n)return 1;if(void 0!==n)return n.length}return 0}function y(e,t){for(var n=new Array(t),r=0;r<t;++r)n[r]=e[r];return n}function l(e,t,n,r){if("function"==typeof e.on)r.once?e.once(t,n):e.on(t,n);else{if("function"!=typeof e.addEventListener)throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof e);e.addEventListener(t,function i(s){r.once&&e.removeEventListener(t,i),n(s)})}}Object.defineProperty(o,"defaultMaxListeners",{enumerable:!0,get:function(){return a},set:function(e){if("number"!=typeof e||e<0||s(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");a=e}}),o.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},o.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||s(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this},o.prototype.getMaxListeners=function(){return u(this)},o.prototype.emit=function(e){for(var t=[],n=1;n<arguments.length;n++)t.push(arguments[n]);var r="error"===e,s=this._events;if(void 0!==s)r=r&&void 0===s.error;else if(!r)return!1;if(r){var o;if(t.length>0&&(o=t[0]),o instanceof Error)throw o;var a=new Error("Unhandled error."+(o?" ("+o.message+")":""));throw a.context=o,a}var h=s[e];if(void 0===h)return!1;if("function"==typeof h)i(h,this,t);else{var u=h.length,d=y(h,u);for(n=0;n<u;++n)i(d[n],this,t)}return!0},o.prototype.addListener=function(e,t){return d(this,e,t,!1)},o.prototype.on=o.prototype.addListener,o.prototype.prependListener=function(e,t){return d(this,e,t,!0)},o.prototype.once=function(e,t){return h(t),this.on(e,p(this,e,t)),this},o.prototype.prependOnceListener=function(e,t){return h(t),this.prependListener(e,p(this,e,t)),this},o.prototype.removeListener=function(e,t){var n,r,i,s,o;if(h(t),void 0===(r=this._events))return this;if(void 0===(n=r[e]))return this;if(n===t||n.listener===t)0===--this._eventsCount?this._events=Object.create(null):(delete r[e],r.removeListener&&this.emit("removeListener",e,n.listener||t));else if("function"!=typeof n){for(i=-1,s=n.length-1;s>=0;s--)if(n[s]===t||n[s].listener===t){o=n[s].listener,i=s;break}if(i<0)return this;0===i?n.shift():function(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}(n,i),1===n.length&&(r[e]=n[0]),void 0!==r.removeListener&&this.emit("removeListener",e,o||t)}return this},o.prototype.off=o.prototype.removeListener,o.prototype.removeAllListeners=function(e){var t,n,r;if(void 0===(n=this._events))return this;if(void 0===n.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==n[e]&&(0===--this._eventsCount?this._events=Object.create(null):delete n[e]),this;if(0===arguments.length){var i,s=Object.keys(n);for(r=0;r<s.length;++r)"removeListener"!==(i=s[r])&&this.removeAllListeners(i);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(t=n[e]))this.removeListener(e,t);else if(void 0!==t)for(r=t.length-1;r>=0;r--)this.removeListener(e,t[r]);return this},o.prototype.listeners=function(e){return v(this,e,!0)},o.prototype.rawListeners=function(e){return v(this,e,!1)},o.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):c.call(e,t)},o.prototype.listenerCount=c,o.prototype.eventNames=function(){return this._eventsCount>0?n(this._events):[]}});function i(e){return null!==e&&"object"==typeof e&&!Array.isArray(e)&&"[object Object]"===Object.prototype.toString.call(e)}const s=e=>{if(e)throw new Error("This TinyIframeEvents instance has been destroyed and can no longer be used.")};const o=new WeakMap;class a extends r.EventEmitter{#e;get targetWindow(){return s(this.#t),this.#e}#n;get targetIframeElement(){return s(this.#t),this.#n}#r;get targetOrigin(){return s(this.#t),this.#r}#i;get selfType(){return s(this.#t),this.#i}#t=!1;#s=!1;get ready(){return s(this.#t),this.#s}onReady(e){s(this.#t),this.#s?e():this.once(this.#o,e)}#a=null;#h=[];#u;#d;#o;#f=null;constructor({targetIframe:e,targetOrigin:t=window.location.origin,secretEventName:n="__tinyIframeEvent__",handshakeEventName:r="__tinyIframeHandshake__",readyEventName:i="__tinyIframeReady__"}={}){if(super(),!(void 0===e||e instanceof HTMLIFrameElement&&e.contentWindow))throw new TypeError('[TinyIframeEvents] Invalid "targetIframe": expected HTMLIFrameElement, received '+typeof e);if("string"!=typeof t)throw new TypeError('[TinyIframeEvents] Invalid "targetOrigin": expected string, received '+typeof t);if(this.#n=e,this.#e=e?.contentWindow??window.parent,this.#r=t,this.#i=e?"parent":"iframe",this.#u=n,this.#d=r,this.#o=i,o.has(this.#e))throw new Error("Duplicate window reference.");this._boundWindowMessage=this.#p.bind(this),this._boundPortMessage=this.#v.bind(this),this.#c(),o.set(this.#e,this)}get secretEventName(){return s(this.#t),this.#u}set secretEventName(e){if(s(this.#t),"string"!=typeof e)throw new TypeError("TinyIframeEvents: secretEventName must be a string.");this.#u=e}get handshakeEventName(){return s(this.#t),this.#d}set handshakeEventName(e){if(s(this.#t),"string"!=typeof e)throw new TypeError("TinyIframeEvents: handshakeEventName must be a string.");this.#d=e}get readyEventName(){return s(this.#t),this.#o}set readyEventName(e){if(s(this.#t),"string"!=typeof e)throw new TypeError("TinyIframeEvents: readyEventName must be a string.");this.#o=e}#c(){"parent"===this.#i?(this.#f=()=>{if(this.#t)return;this.#a&&this.#a.close();const e=new MessageChannel;this.#a=e.port1,this.#a.onmessage=this._boundPortMessage,this.#s=!1,this.#e.postMessage({type:this.#d},this.#r,[e.port2])},this.#n&&(this.#n.addEventListener("load",this.#f),this.#f())):window.addEventListener("message",this._boundWindowMessage,!1)}#p(e){const t=e.data,n=e.ports;i(t)&&t.type===this.#d&&0!==n.length&&(this.#a=n[0],this.#a.onmessage=this._boundPortMessage,window.removeEventListener("message",this._boundWindowMessage),this.#a.postMessage({type:`${this.#d}_ACK`}),this.#y())}#v(e){const t=e.data;if(i(t)&&t.type===`${this.#d}_ACK`)return void this.#y();if(!i(t)||!t[this.#u])return;const n=t.eventName,r=t.payload,s=t.direction;"string"!=typeof n||"iframe"===this.#i&&"iframe"!==s||"parent"===this.#i&&"parent"!==s||this.emit(`win:${n}`,r,e)}#y(){this.#s||(this.#s=!0,this.#l(),this.emit(this.#o))}#l(){for(;this.#h.length>0;){const e=this.#h.shift();e&&this.#a&&this.#a.postMessage(e)}}winEmit(e,t){if(s(this.#t),"string"!=typeof e)throw new TypeError("Event name must be a string.");if(this.#t)throw new Error("Cannot emit: instance has been destroyed.");const n={[this.#u]:!0,eventName:e,payload:t,direction:"parent"===this.#i?"iframe":"parent"};this.#s&&this.#a?this.#a.postMessage(n):this.#h.push(n)}isDestroyed(){return this.#t}destroy(){this.#t||(this.#s=!1,window.removeEventListener("message",this._boundWindowMessage),this.#n&&this.#f&&this.#n.removeEventListener("load",this.#f),this.#a&&(this.#a.close(),this.#a=null),this.removeAllListeners(),this.#h=[],o.delete(this.#e),this.#t=!0)}}const h=a}};const t={};function n(r){const i=t[r];if(void 0!==i)return i.exports;const s=t[r]={exports:{}};return e[r](s,s.exports,n),s.exports}n.d=(e,t)=>{if(Array.isArray(t))for(var r=0;r<t.length;){var i=t[r++],s=t[r++];n.o(e,i)?0===s&&r++:0===s?Object.defineProperty(e,i,{enumerable:!0,value:t[r++]}):Object.defineProperty(e,i,{enumerable:!0,get:s})}else for(var i in t)n.o(t,i)&&!n.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.cjs=e=>{const t={exports:{}};return e.call(t.exports,t,t.exports),t.exports};let r=n(187);window.TinyIframeEvents=r.TinyIframeEvents})();
@@ -1 +1 @@
1
- (()=>{"use strict";var e={683(e,t,r){r.d(t,{TinyLocalStorage:()=>u});var n=r.cjs(function(e,t){var r,n="object"==typeof Reflect?Reflect:null,o=n&&"function"==typeof n.apply?n.apply:function(e,t,r){return Function.prototype.apply.call(e,t,r)};r=n&&"function"==typeof n.ownKeys?n.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var s=Number.isNaN||function(e){return e!=e};function i(){i.init.call(this)}e.exports=i,e.exports.once=function(e,t){return new Promise(function(r,n){function o(r){e.removeListener(t,s),n(r)}function s(){"function"==typeof e.removeListener&&e.removeListener("error",o),r([].slice.call(arguments))}g(e,t,s,{once:!0}),"error"!==t&&function(e,t){"function"==typeof e.on&&g(e,"error",t,{once:!0})}(e,o)})},i.EventEmitter=i,i.prototype._events=void 0,i.prototype._eventsCount=0,i.prototype._maxListeners=void 0;var a=10;function l(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function c(e){return void 0===e._maxListeners?i.defaultMaxListeners:e._maxListeners}function u(e,t,r,n){var o,s,i,a;if(l(r),void 0===(s=e._events)?(s=e._events=Object.create(null),e._eventsCount=0):(void 0!==s.newListener&&(e.emit("newListener",t,r.listener?r.listener:r),s=e._events),i=s[t]),void 0===i)i=s[t]=r,++e._eventsCount;else if("function"==typeof i?i=s[t]=n?[r,i]:[i,r]:n?i.unshift(r):i.push(r),(o=c(e))>0&&i.length>o&&!i.warned){i.warned=!0;var u=new Error("Possible EventEmitter memory leak detected. "+i.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");u.name="MaxListenersExceededWarning",u.emitter=e,u.type=t,u.count=i.length,a=u,console&&console.warn&&console.warn(a)}return e}function y(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function f(e,t,r){var n={fired:!1,wrapFn:void 0,target:e,type:t,listener:r},o=y.bind(n);return o.listener=r,n.wrapFn=o,o}function h(e,t,r){var n=e._events;if(void 0===n)return[];var o=n[t];return void 0===o?[]:"function"==typeof o?r?[o.listener||o]:[o]:r?function(e){for(var t=new Array(e.length),r=0;r<t.length;++r)t[r]=e[r].listener||e[r];return t}(o):d(o,o.length)}function p(e){var t=this._events;if(void 0!==t){var r=t[e];if("function"==typeof r)return 1;if(void 0!==r)return r.length}return 0}function d(e,t){for(var r=new Array(t),n=0;n<t;++n)r[n]=e[n];return r}function g(e,t,r,n){if("function"==typeof e.on)n.once?e.once(t,r):e.on(t,r);else{if("function"!=typeof e.addEventListener)throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof e);e.addEventListener(t,function o(s){n.once&&e.removeEventListener(t,o),r(s)})}}Object.defineProperty(i,"defaultMaxListeners",{enumerable:!0,get:function(){return a},set:function(e){if("number"!=typeof e||e<0||s(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");a=e}}),i.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},i.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||s(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this},i.prototype.getMaxListeners=function(){return c(this)},i.prototype.emit=function(e){for(var t=[],r=1;r<arguments.length;r++)t.push(arguments[r]);var n="error"===e,s=this._events;if(void 0!==s)n=n&&void 0===s.error;else if(!n)return!1;if(n){var i;if(t.length>0&&(i=t[0]),i instanceof Error)throw i;var a=new Error("Unhandled error."+(i?" ("+i.message+")":""));throw a.context=i,a}var l=s[e];if(void 0===l)return!1;if("function"==typeof l)o(l,this,t);else{var c=l.length,u=d(l,c);for(r=0;r<c;++r)o(u[r],this,t)}return!0},i.prototype.addListener=function(e,t){return u(this,e,t,!1)},i.prototype.on=i.prototype.addListener,i.prototype.prependListener=function(e,t){return u(this,e,t,!0)},i.prototype.once=function(e,t){return l(t),this.on(e,f(this,e,t)),this},i.prototype.prependOnceListener=function(e,t){return l(t),this.prependListener(e,f(this,e,t)),this},i.prototype.removeListener=function(e,t){var r,n,o,s,i;if(l(t),void 0===(n=this._events))return this;if(void 0===(r=n[e]))return this;if(r===t||r.listener===t)0===--this._eventsCount?this._events=Object.create(null):(delete n[e],n.removeListener&&this.emit("removeListener",e,r.listener||t));else if("function"!=typeof r){for(o=-1,s=r.length-1;s>=0;s--)if(r[s]===t||r[s].listener===t){i=r[s].listener,o=s;break}if(o<0)return this;0===o?r.shift():function(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}(r,o),1===r.length&&(n[e]=r[0]),void 0!==n.removeListener&&this.emit("removeListener",e,i||t)}return this},i.prototype.off=i.prototype.removeListener,i.prototype.removeAllListeners=function(e){var t,r,n;if(void 0===(r=this._events))return this;if(void 0===r.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==r[e]&&(0===--this._eventsCount?this._events=Object.create(null):delete r[e]),this;if(0===arguments.length){var o,s=Object.keys(r);for(n=0;n<s.length;++n)"removeListener"!==(o=s[n])&&this.removeAllListeners(o);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(t=r[e]))this.removeListener(e,t);else if(void 0!==t)for(n=t.length-1;n>=0;n--)this.removeListener(e,t[n]);return this},i.prototype.listeners=function(e){return h(this,e,!0)},i.prototype.rawListeners=function(e){return h(this,e,!1)},i.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):p.call(e,t)},i.prototype.listenerCount=p,i.prototype.eventNames=function(){return this._eventsCount>0?r(this._events):[]}});function o(e){return null!==e&&"object"==typeof e&&!Array.isArray(e)&&"[object Object]"===Object.prototype.toString.call(e)}const s=e=>{if(e)throw new Error("This TinyLocalStorage instance has been destroyed and can no longer be used.")};const i=new Map,a=new Map,l=new Set(["string","boolean","object","array",String,Boolean,Number,Object,Array,BigInt,Symbol]);class c extends n.EventEmitter{static hasJsonType(e){return i.has(e)&&a.has(e)||l.has(e)}static registerJsonType(e,t,r,n=!1){if(l.has(e))throw new Error(`Cannot register type "${e}" because it is frozen.`);i.set(e,t),a.set(e,r),n&&l.add(e)}static deleteJsonType(e){if(l.has(e))throw new Error(`Cannot remove type "${e}" because it is frozen.`);let t=!1;return i.delete(e)&&(t=!0),a.delete(e)&&(t=!0),t}static encodeSpecialJson(e){if(void 0===e)return{__undefined__:!0};if(null===e)return{__null__:!0};for(const[t,r]of i.entries())if("string"!=typeof t&&e instanceof t||typeof e===t)return r(e,c.encodeSpecialJson);if(Array.isArray(e))return e.map(c.encodeSpecialJson);if(o(e)){const t={};for(const r in e)t[r]=c.encodeSpecialJson(e[r]);return t}return e}static decodeSpecialJson(e){const t=o(e);if(t){if(e.__undefined__)return;if(e.__null__)return null}if(Array.isArray(e))return e.map(c.decodeSpecialJson);if(t){for(const[t,r]of a.entries())if(r.check&&r.check(e))return r.decode(e,c.decodeSpecialJson);const t={};for(const r in e)t[r]=c.decodeSpecialJson(e[r]);return t}return e}#e=!1;get destroyed(){return this.#e}#t=window.localStorage;#r=null;#n=0;#o=e=>this.emit("storage",e);constructor(e){if(super(),void 0!==e&&"string"!=typeof e)throw new TypeError("TinyLocalStorage: dbName must be a string if provided.");"string"==typeof e&&(this.#r=`LSDB::${e}`),window.addEventListener("storage",this.#o)}#s(e){if("string"==typeof e&&e.startsWith("LSDB::"))throw new Error(`TinyLocalStorage: Key "${e}" may conflict with reserved dbKeys.`)}updateStorageVersion(e,t){if(s(this.#e),"string"!=typeof this.#r)throw new Error("TinyLocalStorage: Database key is not initialized. Set a valid dbName in the constructor.");if("number"!=typeof e||Number.isNaN(e)||e<1)throw new TypeError("TinyLocalStorage: version must be a positive number.");if("function"!=typeof t)throw new TypeError("TinyLocalStorage: onUpgrade must be a function.");const r=parseInt(localStorage.getItem(this.#r),10)||0;if("number"!=typeof r||Number.isNaN(r)||r<0)throw new TypeError("TinyLocalStorage: saved version in localStorage is not a valid number.");if(e<r)throw new Error(`TinyLocalStorage: Cannot downgrade database version from ${r} to ${e}.`);e>r&&(t(r,e),localStorage.setItem(this.#r,String(e)),this.#n=e)}getDbKey(){return s(this.#e),this.#r}getVersion(){return s(this.#e),this.#n}setLocalStorage(e){if(s(this.#e),!(e instanceof Storage))throw new TypeError("Argument must be a valid instance of Storage.");this.#t=e}localStorageExists(){return s(this.#e),this.#t instanceof Storage}#i(e,t){if("string"!=typeof e||!e.length)throw new TypeError("Key must be a non-empty string.");return c.encodeSpecialJson(t)}setJson(e,t){if(s(this.#e),this.#s(e),!(o(t)||Array.isArray(t)||t instanceof Map||t instanceof Set))throw new TypeError("The storage value is not a valid JSON-compatible structure.");const r=this.#i(e,t);return this.emit("setJson",e,t),this.#t.setItem(e,JSON.stringify(r))}#a(e,t){if("string"!=typeof e||!e.length)throw new TypeError("Key must be a non-empty string.");const r=this.#t.getItem(e),n={obj:()=>({}),array:()=>[],map:()=>new Map,set:()=>new Set},o="function"==typeof n[t]?n[t]():null;let s;try{s=JSON.parse(r)}catch{return o}return{decoded:c.decodeSpecialJson(s),fallback:o}}getJson(e,t){s(this.#e);const{decoded:r,fallback:n}=this.#a(e,t);return r instanceof Map||r instanceof Set||Array.isArray(r)||o(r)?r:n}setDate(e,t){if(s(this.#e),this.#s(e),!(t instanceof Date))throw new TypeError("Value must be a Date.");const r=this.#i(e,t);return this.emit("setDate",e,t),this.#t.setItem(e,JSON.stringify(r))}getDate(e){s(this.#e);const t=this.#a(e).decoded;return t instanceof Date?t:null}setRegExp(e,t){if(s(this.#e),this.#s(e),!(t instanceof RegExp))throw new TypeError("Value must be a RegExp.");const r=this.#i(e,t);return this.emit("setRegExp",e,t),this.#t.setItem(e,JSON.stringify(r))}getRegExp(e){s(this.#e);const t=this.#a(e).decoded;return t instanceof RegExp?t:null}setBigInt(e,t){if(s(this.#e),this.#s(e),"bigint"!=typeof t)throw new TypeError("Value must be a BigInt.");const r=this.#i(e,t);return this.emit("setBigInt",e,t),this.#t.setItem(e,JSON.stringify(r))}getBigInt(e){s(this.#e);const t=this.#a(e).decoded;return"bigint"==typeof t?t:null}setSymbol(e,t){if(s(this.#e),this.#s(e),"symbol"!=typeof t)throw new TypeError("Value must be a Symbol.");const r=this.#i(e,t);return this.emit("setSymbol",e,t),this.#t.setItem(e,JSON.stringify(r))}getSymbol(e){s(this.#e);const t=this.#a(e).decoded;return"symbol"==typeof t?t:null}getValue(e){return s(this.#e),this.#a(e).decoded??null}setItem(e,t){if(s(this.#e),this.#s(e),"string"!=typeof e||!e.length)throw new TypeError("Key must be a non-empty string.");return this.emit("setItem",e,t),this.#t.setItem(e,t)}getItem(e){if(s(this.#e),"string"!=typeof e||!e.length)throw new TypeError("Key must be a non-empty string.");return this.#t.getItem(e)}setString(e,t){if(s(this.#e),this.#s(e),"string"!=typeof e||!e.length)throw new TypeError("Key must be a non-empty string.");if("string"!=typeof t)throw new TypeError("Value must be a string.");return this.emit("setString",e,t),this.#t.setItem(e,JSON.stringify({__string__:!0,value:t}))}getString(e){if(s(this.#e),"string"!=typeof e||!e.length)throw new TypeError("Key must be a non-empty string.");let t=this.#t.getItem(e);try{if(t=JSON.parse(t),!o(t)||!t.__string__||"string"!=typeof t.value)return null;t=t.value}catch{t=null}return"string"==typeof t?t:null}setNumber(e,t){if(s(this.#e),this.#s(e),"string"!=typeof e||!e.length)throw new TypeError("Key must be a non-empty string.");if("number"!=typeof t)throw new TypeError("Value must be a number.");return this.emit("setNumber",e,t),this.#t.setItem(e,String(t))}getNumber(e){if(s(this.#e),"string"!=typeof e||!e.length)throw new TypeError("Key must be a non-empty string.");let t=this.#t.getItem(e);return"number"==typeof t||"string"==typeof t&&t.length>0&&(t=parseFloat(t),!Number.isNaN(t))?t:null}setBool(e,t){if(s(this.#e),this.#s(e),"string"!=typeof e||!e.length)throw new TypeError("Key must be a non-empty string.");if("boolean"!=typeof t)throw new TypeError("Value must be a boolean.");return this.emit("setBool",e,t),this.#t.setItem(e,String(t))}getBool(e){if(s(this.#e),"string"!=typeof e||!e.length)throw new TypeError("Key must be a non-empty string.");const t=this.#t.getItem(e);if("boolean"==typeof t)return t;if("string"==typeof t){if("true"===t)return!0;if("false"===t)return!1}return null}removeItem(e){if(s(this.#e),"string"!=typeof e||!e.length)throw new TypeError("Key must be a non-empty string.");return this.emit("removeItem",e),this.#t.removeItem(e)}clearLocalStorage(){return s(this.#e),this.#t.clear()}destroy(){this.#e||(window.removeEventListener("storage",this.#o),this.removeAllListeners(),this.#e=!0)}}c.registerJsonType(Map,(e,t)=>({__map__:!0,data:Array.from(e.entries()).map(([e,r])=>[e,t(r)])}),{check:e=>e.__map__,decode:(e,t)=>new Map(e.data.map(([e,r])=>[e,t(r)]))},!0),c.registerJsonType(Set,(e,t)=>({__set__:!0,data:Array.from(e).map(t)}),{check:e=>e.__set__,decode:(e,t)=>new Set(e.data.map(t))},!0),c.registerJsonType(Date,e=>({__date__:!0,value:e.toISOString()}),{check:e=>e.__date__,decode:e=>new Date(e.value)},!0),c.registerJsonType(RegExp,e=>({__regexp__:!0,source:e.source,flags:e.flags}),{check:e=>e.__regexp__,decode:e=>new RegExp(e.source,e.flags)},!0),c.registerJsonType("number",e=>({__number__:!0,value:e.toString()}),{check:e=>e.__number__,decode:e=>Number(e.value)},!0),c.registerJsonType("bigint",e=>({__bigint__:!0,value:e.toString()}),{check:e=>e.__bigint__,decode:e=>BigInt(e.value)},!0),c.registerJsonType("symbol",e=>({__symbol__:!0,key:Symbol.keyFor(e)??e.description??null}),{check:e=>e.__symbol__,decode:e=>{const t=e.key;return null!=t?Symbol.for(t):Symbol()}},!0);const u=c}};const t={};function r(n){const o=t[n];if(void 0!==o)return o.exports;const s=t[n]={exports:{}};return e[n](s,s.exports,r),s.exports}r.d=(e,t)=>{if(Array.isArray(t))for(var n=0;n<t.length;){var o=t[n++],s=t[n++];r.o(e,o)?0===s&&n++:0===s?Object.defineProperty(e,o,{enumerable:!0,value:t[n++]}):Object.defineProperty(e,o,{enumerable:!0,get:s})}else for(var o in t)r.o(t,o)&&!r.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.cjs=e=>{const t={exports:{}};return e.call(t.exports,t,t.exports),t.exports};let n=r(683);window.TinyLocalStorage=n.TinyLocalStorage})();
1
+ (()=>{"use strict";var e={757(e,t,r){r.d(t,{TinyLocalStorage:()=>u});var n=r.cjs(function(e,t){var r,n="object"==typeof Reflect?Reflect:null,o=n&&"function"==typeof n.apply?n.apply:function(e,t,r){return Function.prototype.apply.call(e,t,r)};r=n&&"function"==typeof n.ownKeys?n.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var s=Number.isNaN||function(e){return e!=e};function i(){i.init.call(this)}e.exports=i,e.exports.once=function(e,t){return new Promise(function(r,n){function o(r){e.removeListener(t,s),n(r)}function s(){"function"==typeof e.removeListener&&e.removeListener("error",o),r([].slice.call(arguments))}g(e,t,s,{once:!0}),"error"!==t&&function(e,t){"function"==typeof e.on&&g(e,"error",t,{once:!0})}(e,o)})},i.EventEmitter=i,i.prototype._events=void 0,i.prototype._eventsCount=0,i.prototype._maxListeners=void 0;var a=10;function l(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function c(e){return void 0===e._maxListeners?i.defaultMaxListeners:e._maxListeners}function u(e,t,r,n){var o,s,i,a;if(l(r),void 0===(s=e._events)?(s=e._events=Object.create(null),e._eventsCount=0):(void 0!==s.newListener&&(e.emit("newListener",t,r.listener?r.listener:r),s=e._events),i=s[t]),void 0===i)i=s[t]=r,++e._eventsCount;else if("function"==typeof i?i=s[t]=n?[r,i]:[i,r]:n?i.unshift(r):i.push(r),(o=c(e))>0&&i.length>o&&!i.warned){i.warned=!0;var u=new Error("Possible EventEmitter memory leak detected. "+i.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");u.name="MaxListenersExceededWarning",u.emitter=e,u.type=t,u.count=i.length,a=u,console&&console.warn&&console.warn(a)}return e}function y(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function f(e,t,r){var n={fired:!1,wrapFn:void 0,target:e,type:t,listener:r},o=y.bind(n);return o.listener=r,n.wrapFn=o,o}function h(e,t,r){var n=e._events;if(void 0===n)return[];var o=n[t];return void 0===o?[]:"function"==typeof o?r?[o.listener||o]:[o]:r?function(e){for(var t=new Array(e.length),r=0;r<t.length;++r)t[r]=e[r].listener||e[r];return t}(o):d(o,o.length)}function p(e){var t=this._events;if(void 0!==t){var r=t[e];if("function"==typeof r)return 1;if(void 0!==r)return r.length}return 0}function d(e,t){for(var r=new Array(t),n=0;n<t;++n)r[n]=e[n];return r}function g(e,t,r,n){if("function"==typeof e.on)n.once?e.once(t,r):e.on(t,r);else{if("function"!=typeof e.addEventListener)throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof e);e.addEventListener(t,function o(s){n.once&&e.removeEventListener(t,o),r(s)})}}Object.defineProperty(i,"defaultMaxListeners",{enumerable:!0,get:function(){return a},set:function(e){if("number"!=typeof e||e<0||s(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");a=e}}),i.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},i.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||s(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this},i.prototype.getMaxListeners=function(){return c(this)},i.prototype.emit=function(e){for(var t=[],r=1;r<arguments.length;r++)t.push(arguments[r]);var n="error"===e,s=this._events;if(void 0!==s)n=n&&void 0===s.error;else if(!n)return!1;if(n){var i;if(t.length>0&&(i=t[0]),i instanceof Error)throw i;var a=new Error("Unhandled error."+(i?" ("+i.message+")":""));throw a.context=i,a}var l=s[e];if(void 0===l)return!1;if("function"==typeof l)o(l,this,t);else{var c=l.length,u=d(l,c);for(r=0;r<c;++r)o(u[r],this,t)}return!0},i.prototype.addListener=function(e,t){return u(this,e,t,!1)},i.prototype.on=i.prototype.addListener,i.prototype.prependListener=function(e,t){return u(this,e,t,!0)},i.prototype.once=function(e,t){return l(t),this.on(e,f(this,e,t)),this},i.prototype.prependOnceListener=function(e,t){return l(t),this.prependListener(e,f(this,e,t)),this},i.prototype.removeListener=function(e,t){var r,n,o,s,i;if(l(t),void 0===(n=this._events))return this;if(void 0===(r=n[e]))return this;if(r===t||r.listener===t)0===--this._eventsCount?this._events=Object.create(null):(delete n[e],n.removeListener&&this.emit("removeListener",e,r.listener||t));else if("function"!=typeof r){for(o=-1,s=r.length-1;s>=0;s--)if(r[s]===t||r[s].listener===t){i=r[s].listener,o=s;break}if(o<0)return this;0===o?r.shift():function(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}(r,o),1===r.length&&(n[e]=r[0]),void 0!==n.removeListener&&this.emit("removeListener",e,i||t)}return this},i.prototype.off=i.prototype.removeListener,i.prototype.removeAllListeners=function(e){var t,r,n;if(void 0===(r=this._events))return this;if(void 0===r.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==r[e]&&(0===--this._eventsCount?this._events=Object.create(null):delete r[e]),this;if(0===arguments.length){var o,s=Object.keys(r);for(n=0;n<s.length;++n)"removeListener"!==(o=s[n])&&this.removeAllListeners(o);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(t=r[e]))this.removeListener(e,t);else if(void 0!==t)for(n=t.length-1;n>=0;n--)this.removeListener(e,t[n]);return this},i.prototype.listeners=function(e){return h(this,e,!0)},i.prototype.rawListeners=function(e){return h(this,e,!1)},i.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):p.call(e,t)},i.prototype.listenerCount=p,i.prototype.eventNames=function(){return this._eventsCount>0?r(this._events):[]}});function o(e){return null!==e&&"object"==typeof e&&!Array.isArray(e)&&"[object Object]"===Object.prototype.toString.call(e)}const s=e=>{if(e)throw new Error("This TinyLocalStorage instance has been destroyed and can no longer be used.")};const i=new Map,a=new Map,l=new Set(["string","boolean","object","array",String,Boolean,Number,Object,Array,BigInt,Symbol]);class c extends n.EventEmitter{static hasJsonType(e){return i.has(e)&&a.has(e)||l.has(e)}static registerJsonType(e,t,r,n=!1){if(l.has(e))throw new Error(`Cannot register type "${e}" because it is frozen.`);i.set(e,t),a.set(e,r),n&&l.add(e)}static deleteJsonType(e){if(l.has(e))throw new Error(`Cannot remove type "${e}" because it is frozen.`);let t=!1;return i.delete(e)&&(t=!0),a.delete(e)&&(t=!0),t}static encodeSpecialJson(e){if(void 0===e)return{__undefined__:!0};if(null===e)return{__null__:!0};for(const[t,r]of i.entries())if("string"!=typeof t&&e instanceof t||typeof e===t)return r(e,c.encodeSpecialJson);if(Array.isArray(e))return e.map(c.encodeSpecialJson);if(o(e)){const t={};for(const r in e)t[r]=c.encodeSpecialJson(e[r]);return t}return e}static decodeSpecialJson(e){const t=o(e);if(t){if(e.__undefined__)return;if(e.__null__)return null}if(Array.isArray(e))return e.map(c.decodeSpecialJson);if(t){for(const[t,r]of a.entries())if(r.check&&r.check(e))return r.decode(e,c.decodeSpecialJson);const t={};for(const r in e)t[r]=c.decodeSpecialJson(e[r]);return t}return e}#e=!1;get destroyed(){return this.#e}#t=window.localStorage;#r=null;#n=0;#o=e=>this.emit("storage",e);constructor(e){if(super(),void 0!==e&&"string"!=typeof e)throw new TypeError("TinyLocalStorage: dbName must be a string if provided.");"string"==typeof e&&(this.#r=`LSDB::${e}`),window.addEventListener("storage",this.#o)}#s(e){if("string"==typeof e&&e.startsWith("LSDB::"))throw new Error(`TinyLocalStorage: Key "${e}" may conflict with reserved dbKeys.`)}updateStorageVersion(e,t){if(s(this.#e),"string"!=typeof this.#r)throw new Error("TinyLocalStorage: Database key is not initialized. Set a valid dbName in the constructor.");if("number"!=typeof e||Number.isNaN(e)||e<1)throw new TypeError("TinyLocalStorage: version must be a positive number.");if("function"!=typeof t)throw new TypeError("TinyLocalStorage: onUpgrade must be a function.");const r=parseInt(localStorage.getItem(this.#r),10)||0;if("number"!=typeof r||Number.isNaN(r)||r<0)throw new TypeError("TinyLocalStorage: saved version in localStorage is not a valid number.");if(e<r)throw new Error(`TinyLocalStorage: Cannot downgrade database version from ${r} to ${e}.`);e>r&&(t(r,e),localStorage.setItem(this.#r,String(e)),this.#n=e)}getDbKey(){return s(this.#e),this.#r}getVersion(){return s(this.#e),this.#n}setLocalStorage(e){if(s(this.#e),!(e instanceof Storage))throw new TypeError("Argument must be a valid instance of Storage.");this.#t=e}localStorageExists(){return s(this.#e),this.#t instanceof Storage}#i(e,t){if("string"!=typeof e||!e.length)throw new TypeError("Key must be a non-empty string.");return c.encodeSpecialJson(t)}setJson(e,t){if(s(this.#e),this.#s(e),!(o(t)||Array.isArray(t)||t instanceof Map||t instanceof Set))throw new TypeError("The storage value is not a valid JSON-compatible structure.");const r=this.#i(e,t);return this.emit("setJson",e,t),this.#t.setItem(e,JSON.stringify(r))}#a(e,t){if("string"!=typeof e||!e.length)throw new TypeError("Key must be a non-empty string.");const r=this.#t.getItem(e),n={obj:()=>({}),array:()=>[],map:()=>new Map,set:()=>new Set},o="function"==typeof n[t]?n[t]():null;let s;try{s=JSON.parse(r)}catch{return o}return{decoded:c.decodeSpecialJson(s),fallback:o}}getJson(e,t){s(this.#e);const{decoded:r,fallback:n}=this.#a(e,t);return r instanceof Map||r instanceof Set||Array.isArray(r)||o(r)?r:n}setDate(e,t){if(s(this.#e),this.#s(e),!(t instanceof Date))throw new TypeError("Value must be a Date.");const r=this.#i(e,t);return this.emit("setDate",e,t),this.#t.setItem(e,JSON.stringify(r))}getDate(e){s(this.#e);const t=this.#a(e).decoded;return t instanceof Date?t:null}setRegExp(e,t){if(s(this.#e),this.#s(e),!(t instanceof RegExp))throw new TypeError("Value must be a RegExp.");const r=this.#i(e,t);return this.emit("setRegExp",e,t),this.#t.setItem(e,JSON.stringify(r))}getRegExp(e){s(this.#e);const t=this.#a(e).decoded;return t instanceof RegExp?t:null}setBigInt(e,t){if(s(this.#e),this.#s(e),"bigint"!=typeof t)throw new TypeError("Value must be a BigInt.");const r=this.#i(e,t);return this.emit("setBigInt",e,t),this.#t.setItem(e,JSON.stringify(r))}getBigInt(e){s(this.#e);const t=this.#a(e).decoded;return"bigint"==typeof t?t:null}setSymbol(e,t){if(s(this.#e),this.#s(e),"symbol"!=typeof t)throw new TypeError("Value must be a Symbol.");const r=this.#i(e,t);return this.emit("setSymbol",e,t),this.#t.setItem(e,JSON.stringify(r))}getSymbol(e){s(this.#e);const t=this.#a(e).decoded;return"symbol"==typeof t?t:null}getValue(e){return s(this.#e),this.#a(e).decoded??null}setItem(e,t){if(s(this.#e),this.#s(e),"string"!=typeof e||!e.length)throw new TypeError("Key must be a non-empty string.");return this.emit("setItem",e,t),this.#t.setItem(e,t)}getItem(e){if(s(this.#e),"string"!=typeof e||!e.length)throw new TypeError("Key must be a non-empty string.");return this.#t.getItem(e)}setString(e,t){if(s(this.#e),this.#s(e),"string"!=typeof e||!e.length)throw new TypeError("Key must be a non-empty string.");if("string"!=typeof t)throw new TypeError("Value must be a string.");return this.emit("setString",e,t),this.#t.setItem(e,JSON.stringify({__string__:!0,value:t}))}getString(e){if(s(this.#e),"string"!=typeof e||!e.length)throw new TypeError("Key must be a non-empty string.");let t=this.#t.getItem(e);try{if(t=JSON.parse(t),!o(t)||!t.__string__||"string"!=typeof t.value)return null;t=t.value}catch{t=null}return"string"==typeof t?t:null}setNumber(e,t){if(s(this.#e),this.#s(e),"string"!=typeof e||!e.length)throw new TypeError("Key must be a non-empty string.");if("number"!=typeof t)throw new TypeError("Value must be a number.");return this.emit("setNumber",e,t),this.#t.setItem(e,String(t))}getNumber(e){if(s(this.#e),"string"!=typeof e||!e.length)throw new TypeError("Key must be a non-empty string.");let t=this.#t.getItem(e);return"number"==typeof t||"string"==typeof t&&t.length>0&&(t=parseFloat(t),!Number.isNaN(t))?t:null}setBool(e,t){if(s(this.#e),this.#s(e),"string"!=typeof e||!e.length)throw new TypeError("Key must be a non-empty string.");if("boolean"!=typeof t)throw new TypeError("Value must be a boolean.");return this.emit("setBool",e,t),this.#t.setItem(e,String(t))}getBool(e){if(s(this.#e),"string"!=typeof e||!e.length)throw new TypeError("Key must be a non-empty string.");const t=this.#t.getItem(e);if("boolean"==typeof t)return t;if("string"==typeof t){if("true"===t)return!0;if("false"===t)return!1}return null}removeItem(e){if(s(this.#e),"string"!=typeof e||!e.length)throw new TypeError("Key must be a non-empty string.");return this.emit("removeItem",e),this.#t.removeItem(e)}clearLocalStorage(){return s(this.#e),this.#t.clear()}destroy(){this.#e||(window.removeEventListener("storage",this.#o),this.removeAllListeners(),this.#e=!0)}}c.registerJsonType(Map,(e,t)=>({__map__:!0,data:Array.from(e.entries()).map(([e,r])=>[e,t(r)])}),{check:e=>e.__map__,decode:(e,t)=>new Map(e.data.map(([e,r])=>[e,t(r)]))},!0),c.registerJsonType(Set,(e,t)=>({__set__:!0,data:Array.from(e).map(t)}),{check:e=>e.__set__,decode:(e,t)=>new Set(e.data.map(t))},!0),c.registerJsonType(Date,e=>({__date__:!0,value:e.toISOString()}),{check:e=>e.__date__,decode:e=>new Date(e.value)},!0),c.registerJsonType(RegExp,e=>({__regexp__:!0,source:e.source,flags:e.flags}),{check:e=>e.__regexp__,decode:e=>new RegExp(e.source,e.flags)},!0),c.registerJsonType("number",e=>({__number__:!0,value:e.toString()}),{check:e=>e.__number__,decode:e=>Number(e.value)},!0),c.registerJsonType("bigint",e=>({__bigint__:!0,value:e.toString()}),{check:e=>e.__bigint__,decode:e=>BigInt(e.value)},!0),c.registerJsonType("symbol",e=>({__symbol__:!0,key:Symbol.keyFor(e)??e.description??null}),{check:e=>e.__symbol__,decode:e=>{const t=e.key;return null!=t?Symbol.for(t):Symbol()}},!0);const u=c}};const t={};function r(n){const o=t[n];if(void 0!==o)return o.exports;const s=t[n]={exports:{}};return e[n](s,s.exports,r),s.exports}r.d=(e,t)=>{if(Array.isArray(t))for(var n=0;n<t.length;){var o=t[n++],s=t[n++];r.o(e,o)?0===s&&n++:0===s?Object.defineProperty(e,o,{enumerable:!0,value:t[n++]}):Object.defineProperty(e,o,{enumerable:!0,get:s})}else for(var o in t)r.o(t,o)&&!r.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.cjs=e=>{const t={exports:{}};return e.call(t.exports,t,t.exports),t.exports};let n=r(757);window.TinyLocalStorage=n.TinyLocalStorage})();
@@ -1 +1 @@
1
- (()=>{"use strict";var e={163(e,t,r){r.d(t,{TinyMediaPlayer:()=>L});var o=r.cjs(function(e,t){var r,o="object"==typeof Reflect?Reflect:null,n=o&&"function"==typeof o.apply?o.apply:function(e,t,r){return Function.prototype.apply.call(e,t,r)};r=o&&"function"==typeof o.ownKeys?o.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var i=Number.isNaN||function(e){return e!=e};function s(){s.init.call(this)}e.exports=s,e.exports.once=function(e,t){return new Promise(function(r,o){function n(r){e.removeListener(t,i),o(r)}function i(){"function"==typeof e.removeListener&&e.removeListener("error",n),r([].slice.call(arguments))}f(e,t,i,{once:!0}),"error"!==t&&function(e,t){"function"==typeof e.on&&f(e,"error",t,{once:!0})}(e,n)})},s.EventEmitter=s,s.prototype._events=void 0,s.prototype._eventsCount=0,s.prototype._maxListeners=void 0;var a=10;function l(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function d(e){return void 0===e._maxListeners?s.defaultMaxListeners:e._maxListeners}function u(e,t,r,o){var n,i,s,a;if(l(r),void 0===(i=e._events)?(i=e._events=Object.create(null),e._eventsCount=0):(void 0!==i.newListener&&(e.emit("newListener",t,r.listener?r.listener:r),i=e._events),s=i[t]),void 0===s)s=i[t]=r,++e._eventsCount;else if("function"==typeof s?s=i[t]=o?[r,s]:[s,r]:o?s.unshift(r):s.push(r),(n=d(e))>0&&s.length>n&&!s.warned){s.warned=!0;var u=new Error("Possible EventEmitter memory leak detected. "+s.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");u.name="MaxListenersExceededWarning",u.emitter=e,u.type=t,u.count=s.length,a=u,console&&console.warn&&console.warn(a)}return e}function h(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function m(e,t,r){var o={fired:!1,wrapFn:void 0,target:e,type:t,listener:r},n=h.bind(o);return n.listener=r,o.wrapFn=n,n}function p(e,t,r){var o=e._events;if(void 0===o)return[];var n=o[t];return void 0===n?[]:"function"==typeof n?r?[n.listener||n]:[n]:r?function(e){for(var t=new Array(e.length),r=0;r<t.length;++r)t[r]=e[r].listener||e[r];return t}(n):y(n,n.length)}function c(e){var t=this._events;if(void 0!==t){var r=t[e];if("function"==typeof r)return 1;if(void 0!==r)return r.length}return 0}function y(e,t){for(var r=new Array(t),o=0;o<t;++o)r[o]=e[o];return r}function f(e,t,r,o){if("function"==typeof e.on)o.once?e.once(t,r):e.on(t,r);else{if("function"!=typeof e.addEventListener)throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof e);e.addEventListener(t,function n(i){o.once&&e.removeEventListener(t,n),r(i)})}}Object.defineProperty(s,"defaultMaxListeners",{enumerable:!0,get:function(){return a},set:function(e){if("number"!=typeof e||e<0||i(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");a=e}}),s.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},s.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||i(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this},s.prototype.getMaxListeners=function(){return d(this)},s.prototype.emit=function(e){for(var t=[],r=1;r<arguments.length;r++)t.push(arguments[r]);var o="error"===e,i=this._events;if(void 0!==i)o=o&&void 0===i.error;else if(!o)return!1;if(o){var s;if(t.length>0&&(s=t[0]),s instanceof Error)throw s;var a=new Error("Unhandled error."+(s?" ("+s.message+")":""));throw a.context=s,a}var l=i[e];if(void 0===l)return!1;if("function"==typeof l)n(l,this,t);else{var d=l.length,u=y(l,d);for(r=0;r<d;++r)n(u[r],this,t)}return!0},s.prototype.addListener=function(e,t){return u(this,e,t,!1)},s.prototype.on=s.prototype.addListener,s.prototype.prependListener=function(e,t){return u(this,e,t,!0)},s.prototype.once=function(e,t){return l(t),this.on(e,m(this,e,t)),this},s.prototype.prependOnceListener=function(e,t){return l(t),this.prependListener(e,m(this,e,t)),this},s.prototype.removeListener=function(e,t){var r,o,n,i,s;if(l(t),void 0===(o=this._events))return this;if(void 0===(r=o[e]))return this;if(r===t||r.listener===t)0===--this._eventsCount?this._events=Object.create(null):(delete o[e],o.removeListener&&this.emit("removeListener",e,r.listener||t));else if("function"!=typeof r){for(n=-1,i=r.length-1;i>=0;i--)if(r[i]===t||r[i].listener===t){s=r[i].listener,n=i;break}if(n<0)return this;0===n?r.shift():function(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}(r,n),1===r.length&&(o[e]=r[0]),void 0!==o.removeListener&&this.emit("removeListener",e,s||t)}return this},s.prototype.off=s.prototype.removeListener,s.prototype.removeAllListeners=function(e){var t,r,o;if(void 0===(r=this._events))return this;if(void 0===r.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==r[e]&&(0===--this._eventsCount?this._events=Object.create(null):delete r[e]),this;if(0===arguments.length){var n,i=Object.keys(r);for(o=0;o<i.length;++o)"removeListener"!==(n=i[o])&&this.removeAllListeners(n);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(t=r[e]))this.removeListener(e,t);else if(void 0!==t)for(o=t.length-1;o>=0;o--)this.removeListener(e,t[o]);return this},s.prototype.listeners=function(e){return p(this,e,!0)},s.prototype.rawListeners=function(e){return p(this,e,!1)},s.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):c.call(e,t)},s.prototype.listenerCount=c,s.prototype.eventNames=function(){return this._eventsCount>0?r(this._events):[]}});function n(e){if(!Array.isArray(e)&&!i(e))throw new TypeError("Argument must be either an Array or a pure JSON Object.");return Array.isArray(e)?e.length:Object.keys(e).length}function i(e){return null!==e&&"object"==typeof e&&!Array.isArray(e)&&"[object Object]"===Object.prototype.toString.call(e)}function s(e){return null!==e&&"object"==typeof e&&!Array.isArray(e)}const a=["chrome","firefox","ie","edge","safari","opera","yandex","other"];class l extends o.EventEmitter{#e;#t;#r;#o;#n;#i=new Map([["log",""],["info",""],["warn",""],["error",""],["debug",""],["reset",""],["black",""],["red",""],["green",""],["yellow",""],["blue",""],["magenta",""],["cyan",""],["white",""],["gray",""]]);#s=new Map([["log","[_log_LOG_reset_]"],["info","[_info_INFO_reset_]"],["warn","[_warn_WARN_reset_]"],["error","[_error_ERROR_reset_]"],["debug","[_debug_DEBUG_reset_]"]]);constructor({logger:e,id:t,debugMode:r,canEmitLogs:o=!1,useLogColors:n=!1}){if(super(),!s(e))throw new TypeError("Logger must be an object that implements the Console interface.");if("string"!=typeof t)throw new TypeError("Logger instance id must be a string.");if("boolean"!=typeof r)throw new TypeError("debugMode must be a boolean.");if("boolean"!=typeof o)throw new TypeError("canEmitLogs must be a boolean.");if("boolean"!=typeof n)throw new TypeError("useLogColors must be a boolean.");this.#t=t,this.#e=e,this.#o=r,this.#r=o,this.#n="firefox"!==function(e=[]){const t=function(e=[]){if(!Array.isArray(e))throw new TypeError('The "disable" argument must be an array.');for(const t of e)if(!a.includes(t))throw new TypeError(`Invalid browser name provided in disable array: ${t}`);const t={chrome:0,firefox:0,ie:0,edge:0,safari:0,opera:0,yandex:0,other:0};t[function(){const e=navigator.userAgent;return-1!==e.indexOf("Chrome")?"chrome":-1!==e.indexOf("Firefox")?"firefox":-1!==e.indexOf("MSIE")?"ie":-1!==e.indexOf("Edge")?"edge":-1!==e.indexOf("Safari")?"safari":-1!==e.indexOf("Opera")?"opera":-1!==e.indexOf("YaBrowser")?"yandex":"other"}()]++;const r=function(){const e=(Array.prototype.slice.call(window.getComputedStyle(document.documentElement,"")).join("").match(/-(moz|webkit|ms)-/)??["",""])[1];return"moz"===e?"gecko":"webkit"===e?"webkit":"ms"===e?"trident":"other"}();"gecko"===r?e.indexOf("firefox")<0&&t.firefox++:"webkit"===r?(e.indexOf("chrome")<0&&t.chrome++,e.indexOf("safari")<0&&t.safari++,e.indexOf("opera")<0&&t.opera++,e.indexOf("edge")<0&&t.edge++):"trident"===r?e.indexOf("ie")<0&&t.ie++:e.indexOf("other")<0&&t.other++;const o=function(){const e=!!window.opr&&!!opr.addons||!!window.opera||navigator.userAgent.indexOf(" OPR/")>=0,t="undefined"!=typeof InstallTrigger,r=/constructor/i.test(window.HTMLElement)||"[object SafariRemoteNotification]"===(!window.safari||"undefined"!=typeof safari&&safari.pushNotification).toString(),o=!!document.documentMode,n=!o&&!!window.StyleMedia,i=!!window.chrome;return{isOpera:e,isFirefox:t,isSafari:r,isIE:o,isEdge:n,isChrome:i,isBlink:(i||e)&&!!window.CSS}}();return o.isOpera&&e.indexOf("opera")<0&&t.opera++,o.isFirefox&&e.indexOf("firefox")<0&&t.firefox++,o.isSafari&&e.indexOf("safari")<0&&t.safari++,o.isIE&&e.indexOf("ie")<0&&t.ie++,o.isEdge&&e.indexOf("edge")<0&&t.edge++,o.isChrome&&e.indexOf("chrome")<0&&t.chrome++,t}(e);return Object.keys(t).reduce((e,r)=>t[r]>t[e]?r:e)}()&&n,this.log("info","Emit logs of debug mode set to: "+(this.#o?"ON":"OFF")),this.log("info","Custom logger assigned.")}get logId(){return this.#t}get canEmitLogs(){return this.#r}get useLogColors(){return this.#n}set useLogColors(e){if("boolean"!=typeof e)throw new TypeError("useLogColors must be a boolean.");this.#n=e,this.log("info","Log Colors usage mode set to: "+(this.#n?"ON":"OFF")),this.emit("setDebugMode",e)}get debugMode(){return this.#o}set debugMode(e){if("boolean"!=typeof e)throw new TypeError("debugMode must be a boolean.");this.#o=e,this.log("info","Debug mode set to: "+(this.#o?"ON":"OFF")),this.emit("setDebugMode",e)}_addLogColor(e,t){this.#i.set(e,t)}_removeLogColor(e){this.#i.delete(e)}_addLogPrefix(e,t){this.#s.set(e,t)}_removeLogPrefix(e){this.#s.delete(e)}#a(e){if("string"!=typeof e)return e;let t=e;for(const[e,r]of this.#s){const o=new RegExp(`\\:${e}\\:`,"g");t=t.replace(o,r)}for(const[e,r]of this.#i){const o=new RegExp(`\\_${e}\\_`,"g");t=t.replace(o,this.#n?r:"")}return t}logClear(){if(this.#o)return this.#r&&this.emit("debug:clear"),this.#e.clear?this.#e.clear():console.clear()}logGroupEnd(){if(this.#o)return this.#r&&this.emit("debug:groupEnd"),this.#e.groupEnd?this.#e.groupEnd():console.groupEnd()}logLabel(e,t){if(!this.#o)return;const r=["count","countReset","time","timeEnd","profile","profileEnd","timeStamp"];if(!r.includes(e))throw new TypeError(`Invalid logType. Expected one of: ${r.join(", ")}`);if(void 0!==t&&"string"!=typeof t)throw new TypeError("The label must be a string.");const o=this.#e[e]?this.#e[e]:console[e];if(!o)throw new TypeError(`The log type "${e}" is not supported by the provided logger or console.`);return this.#r&&this.emit("debug:logLabel",e,t),o(t)}logTimeLabel(e,...t){if(this.#o)return this.#r&&this.emit("debug:timeLog",e,...t),this.#e.timeLog?this.#e.timeLog(e,...t):console.timeLog(e,...t)}logAssert(e,...t){if(this.#o)return this.#r&&this.emit("debug:assert",e,...t),this.#e.assert?this.#e.assert(e,...t):console.assert(e,...t)}logDir(e,t){if(this.#o)return this.#r&&this.emit("debug:dir",e,t),this.#e.dir?this.#e.dir(e,t):console.dir(e,t)}logTable(e,t){if(this.#o){if(!(void 0===t||Array.isArray(t)&&t.every(e=>"string"==typeof e)))throw new TypeError("Properties must be an array of strings.");return this.#r&&this.emit("debug:table",e,t),this.#e.table?this.#e.table(e,t):console.table(e,t)}}log(e,t,...r){if(!this.#o)return;const o=["log","info","warn","error","debug","dirxml","group","groupCollapsed","trace"];if(!o.includes(e))throw new TypeError(`Invalid logType. Expected one of: ${o.join(", ")}`);if("string"!=typeof t)throw new TypeError("The message must be a string.");let n=this.#t,i=t;n=this.#a(n),i=this.#a(i);const s=this.#e[e]?this.#e[e]:console[e];return s?(this.#r&&this.emit("debug:log",n,i,...r),s(n,i,...r)):(this.#r&&this.emit("debug:log",n,i,...r),console.log(n,i,...r))}}const d=l,u=(e,t)=>{if("string"!=typeof t)throw new TypeError('Expected "name" to be a string.');if("string"!=typeof e)throw new TypeError(`Expected "${t}" to be a string, but received ${typeof e}.`)},h=(e,t)=>{if("string"!=typeof t)throw new TypeError('Expected "name" to be a string.');if("function"!=typeof e)throw new TypeError(`Expected "${t}" to be a function, but received ${typeof e}.`)},m=(e,t)=>{if("string"!=typeof t)throw new TypeError('Expected "name" to be a string.');if("object"!=typeof e||null===e||Array.isArray(e))throw new TypeError(`Expected "${t}" to be a plain object, but received ${null===e?"null":Array.isArray(e)?"array":typeof e}.`)},p=(e,t=!1)=>!t&&void 0===e,c=(e,t=!1)=>p(e,t)||"string"==typeof e||!t&&null===e,y=(e,t=!1)=>p(e,t)||"number"==typeof e||!t&&null===e,f=(e,t=!1)=>p(e,t)||"boolean"==typeof e||!t&&null===e,g=(e,t)=>!!p(e)||(h(t,"valueValidator"),Array.isArray(e)&&e.every(t)),w=new Map;class b extends Error{constructor(e,t,r){if(u(e,"message"),u(t,"url"),"string"!=typeof r)throw new TypeError(`Expected "stage" to be a string, but received ${typeof r}.`);super(e),this.name="MediaLoadingError",this.url=t,this.stage=r}}const v=async e=>{u(e,"str");const t=(new TextEncoder).encode(e),r=await crypto.subtle.digest("SHA-1",t);return Array.from(new Uint8Array(r)).map(e=>e.toString(16).padStart(2,"0")).join("").substring(0,8)},E=(e,t="image/jpeg")=>{if(!(e instanceof Uint8Array)&&"string"!=typeof e)throw new TypeError(`Expected "data" to be an instance of Uint8Array or a string, but received ${typeof e}.`);u(t,"format");const r=e=>{const t=URL.createObjectURL(e),r=w.get(t);return w.set(t,"number"==typeof r?r+1:1),t};if(e instanceof Uint8Array)return r(new Blob([e],{type:t}));if("string"==typeof e&&e.startsWith("data:")){const o=e.split(",")[1],n=atob(o),i=new Uint8Array(n.length);for(let e=0;e<n.length;e++)i[e]=n.charCodeAt(e);return r(new Blob([i],{type:t}))}return"string"==typeof e?e:""},T=(e,t=!1)=>{if(i(e)){if(4!==n(e)){if(t)return!1;throw new TypeError("Invalid fetch data: Object must be an MediaContentFetchData.")}I(e.common),m(e.native,"_fetchData.native"),m(e.format,"_fetchData.format"),m(e.quality,"_fetchData.quality");for(const r in e.native){const o=e.native[r];if(!g(o,e=>"string"==typeof e.id)){if(t)return!1;throw new TypeError(`Invalid native data: "${r}" must be an array of native fetch data.`)}}}return!0},I=e=>{if(m(e,"common"),T(e._fetchData),!c(e.title))throw new TypeError('Invalid metadata: "title" must be a string or null.');if(!c(e.album))throw new TypeError('Invalid metadata: "album" must be a string or null.');if(!c(e.albumartist))throw new TypeError('Invalid metadata: "albumartist" must be a a string or null.');if(!c(e.artist))throw new TypeError('Invalid metadata: "artist" must be a string or null.');if(!f(e.compilation))throw new TypeError('Invalid metadata: "compilation" must be a boolean or null.');if(!f(e.podcast))throw new TypeError('Invalid metadata: "podcast" must be a boolean or null.');if(!f(e.gapless))throw new TypeError('Invalid metadata: "gapless" must be a boolean or null.');if(!f(e.showMovement))throw new TypeError('Invalid metadata: "showMovement" must be a boolean or null.');if(!y(e.averageLevel))throw new TypeError('Invalid metadata: "averageLevel" must be a number or null.');if(!y(e.peakLevel))throw new TypeError('Invalid metadata: "peakLevel" must be a number or null.');if(!y(e.hdVideo))throw new TypeError('Invalid metadata: "hdVideo" must be a number or null.');if(!y(e.stik))throw new TypeError('Invalid metadata: "stik" must be a number or null.');if(!y(e.playCounter))throw new TypeError('Invalid metadata: "playCounter" must be a number or null.');if(!y(e.tvSeason))throw new TypeError('Invalid metadata: "tvSeason" must be a number or null.');if(!y(e.tvEpisode))throw new TypeError('Invalid metadata: "tvEpisode" must be a number or null.');if(!y(e.year))throw new TypeError('Invalid metadata: "year" must be a number or null.');if(!y(e.bpm))throw new TypeError('Invalid metadata: "bpm" must be a number or null.');if(!y(e.originalyear))throw new TypeError('Invalid metadata: "originalyear" must be a number or null.');if(!y(e.movementTotal))throw new TypeError('Invalid metadata: "movementTotal" must be a number or null.');if(!c(e.date))throw new TypeError('Invalid metadata: "date" must be a string or null.');if(!c(e.originaldate))throw new TypeError('Invalid metadata: "originaldate" must be a string or null.');if(!c(e.releasedate))throw new TypeError('Invalid metadata: "releasedate" must be a string or null.');if(!c(e.albumsort))throw new TypeError('Invalid metadata: "albumsort" must be a string or null.');if(!c(e.titlesort))throw new TypeError('Invalid metadata: "titlesort" must be a string or null.');if(!c(e.work))throw new TypeError('Invalid metadata: "work" must be a string or null.');if(!c(e.artistsort))throw new TypeError('Invalid metadata: "artistsort" must be a string or null.');if(!c(e.albumartistsort))throw new TypeError('Invalid metadata: "albumartistsort" must be a string or null.');if(!c(e.composersort))throw new TypeError('Invalid metadata: "composersort" must be a string or null.');if(!c(e.grouping))throw new TypeError('Invalid metadata: "grouping" must be a string or null.');if(!c(e.longDescription))throw new TypeError('Invalid metadata: "longDescription" must be a string or null.');if(!c(e.totaltracks))throw new TypeError('Invalid metadata: "totaltracks" must be a string or null.');if(!c(e.totaldiscs))throw new TypeError('Invalid metadata: "totaldiscs" must be a string or null.');if(!c(e.mood))throw new TypeError('Invalid metadata: "mood" must be a string or null.');if(!c(e.media))throw new TypeError('Invalid metadata: "media" must be a string or null.');if(!c(e.tvShow))throw new TypeError('Invalid metadata: "tvShow" must be a string or null.');if(!c(e.tvShowSort))throw new TypeError('Invalid metadata: "tvShowSort" must be a string or null.');if(!c(e.tvEpisodeId))throw new TypeError('Invalid metadata: "tvEpisodeId" must be a string or null.');if(!c(e.tvNetwork))throw new TypeError('Invalid metadata: "tvNetwork" must be a string or null.');if(!c(e.podcasturl))throw new TypeError('Invalid metadata: "podcasturl" must be a string or null.');if(!c(e.releasestatus))throw new TypeError('Invalid metadata: "releasestatus" must be a string or null.');if(!c(e.releasecountry))throw new TypeError('Invalid metadata: "releasecountry" must be a string or null.');if(!c(e.script))throw new TypeError('Invalid metadata: "script" must be a string or null.');if(!c(e.language))throw new TypeError('Invalid metadata: "language" must be a string or null.');if(!c(e.copyright))throw new TypeError('Invalid metadata: "copyright" must be a string or null.');if(!c(e.license))throw new TypeError('Invalid metadata: "license" must be a string or null.');if(!c(e.encodedby))throw new TypeError('Invalid metadata: "encodedby" must be a string or null.');if(!c(e.encodersettings))throw new TypeError('Invalid metadata: "encodersettings" must be a string or null.');if(!c(e.barcode))throw new TypeError('Invalid metadata: "barcode" must be a string or null.');if(!c(e.asin))throw new TypeError('Invalid metadata: "asin" must be a string or null.');if(!c(e.website))throw new TypeError('Invalid metadata: "website" must be a string or null.');if(!c(e.originalalbum))throw new TypeError('Invalid metadata: "originalalbum" must be a string or null.');if(!c(e.originalartist))throw new TypeError('Invalid metadata: "originalartist" must be a string or null.');if(!c(e.key))throw new TypeError('Invalid metadata: "key" must be a string or null.');if(!c(e.movement))throw new TypeError('Invalid metadata: "movement" must be a string or null.');if(!c(e.podcastId))throw new TypeError('Invalid metadata: "podcastId" must be a string or null.');if(!g(e.albumartists,e=>"string"==typeof e))throw new TypeError('Invalid metadata: "albumartists" must be an array of strings.');if(!g(e.genre,e=>"string"==typeof e))throw new TypeError('Invalid metadata: "genre" must be an array of strings.');if(!g(e.label,e=>"string"==typeof e))throw new TypeError('Invalid metadata: "label" must be an array of strings.');if(!g(e.composer,e=>"string"==typeof e))throw new TypeError('Invalid metadata: "composer" must be an array of strings.');if(!g(e.artists,e=>"string"==typeof e))throw new TypeError('Invalid metadata: "artists" must be an array of strings.');if(!g(e.lyricist,e=>"string"==typeof e))throw new TypeError('Invalid metadata: "lyricist" must be an array of strings.');if(!g(e.writer,e=>"string"==typeof e))throw new TypeError('Invalid metadata: "writer" must be an array of strings.');if(!g(e.conductor,e=>"string"==typeof e))throw new TypeError('Invalid metadata: "conductor" must be an array of strings.');if(!g(e.remixer,e=>"string"==typeof e))throw new TypeError('Invalid metadata: "remixer" must be an array of strings.');if(!g(e.arranger,e=>"string"==typeof e))throw new TypeError('Invalid metadata: "arranger" must be an array of strings.');if(!g(e.engineer,e=>"string"==typeof e))throw new TypeError('Invalid metadata: "engineer" must be an array of strings.');if(!g(e.publisher,e=>"string"==typeof e))throw new TypeError('Invalid metadata: "publisher" must be an array of strings.');if(!g(e.producer,e=>"string"==typeof e))throw new TypeError('Invalid metadata: "producer" must be an array of strings.');if(!g(e.djmixer,e=>"string"==typeof e))throw new TypeError('Invalid metadata: "djmixer" must be an array of strings.');if(!g(e.mixer,e=>"string"==typeof e))throw new TypeError('Invalid metadata: "mixer" must be an array of strings.');if(!g(e.technician,e=>"string"==typeof e))throw new TypeError('Invalid metadata: "technician" must be an array of strings.');if(!g(e.subtitle,e=>"string"==typeof e))throw new TypeError('Invalid metadata: "subtitle" must be an array of strings.');if(!g(e.description,e=>"string"==typeof e))throw new TypeError('Invalid metadata: "description" must be an array of strings.');if(!g(e.discsubtitle,e=>"string"==typeof e))throw new TypeError('Invalid metadata: "discsubtitle" must be an array of strings.');if(!g(e.releasetype,e=>"string"==typeof e))throw new TypeError('Invalid metadata: "releasetype" must be an array of strings.');if(!g(e.isrc,e=>"string"==typeof e))throw new TypeError('Invalid metadata: "isrc" must be an array of strings.');if(!g(e.performer_instrument,e=>"string"==typeof e))throw new TypeError('Invalid metadata: "performer_instrument" must be an array of strings.');if(!g(e.notes,e=>"string"==typeof e))throw new TypeError('Invalid metadata: "notes" must be an array of strings.');if(!g(e.category,e=>"string"==typeof e))throw new TypeError('Invalid metadata: "category" must be an array of strings.');if(!g(e.keywords,e=>"string"==typeof e))throw new TypeError('Invalid metadata: "keywords" must be an array of strings.');if(!g(e.catalognumber,e=>"string"==typeof e))throw new TypeError('Invalid metadata: "catalognumber" must be an array of strings.');if(!g(e.picture,e=>e&&"object"==typeof e&&(void 0===e.description||"string"==typeof e.description)&&(void 0===e.name||"string"==typeof e.name)&&(void 0===e.type||"string"==typeof e.type)&&"string"==typeof e.format&&(e.data instanceof Uint8Array||"string"==typeof e.data)))throw new TypeError('Invalid metadata: "picture" must be an array of pictures.');if(!g(e.comment,e=>null!==e&&"object"==typeof e&&c(e.descriptor)&&c(e.language)&&c(e.text)))throw new TypeError('Invalid metadata: "comment" must be an array of valid IComment objects.');if(!g(e.lyrics,e=>null!==e&&"object"==typeof e&&c(e.text)&&g(e.syncText,e=>null!==e&&"object"==typeof e&&c(e.text,!0)&&y(e.timestamp))&&(e=>null!==e&&"object"==typeof e&&y(e.notSynchronized,!0)&&y(e.mpegFrameNumber,!0)&&y(e.milliseconds,!0))(e.timeStampFormat)&&(e=>null!==e&&"object"==typeof e&&y(e.other,!0)&&y(e.lyrics,!0)&&y(e.text,!0)&&y(e.movement_part,!0)&&y(e.events,!0)&&y(e.chord,!0)&&y(e.trivia_pop,!0))(e.contentType)))throw new TypeError('Invalid metadata: "lyrics" must be an array of valid ILyricsTag objects.');if(!g(e.rating,e=>null!==e&&"object"==typeof e&&c(e.source)&&y(e.rating)))throw new TypeError('Invalid metadata: "rating" must be an array of valid IRating objects.');const t=(e,t)=>{if(!p(t)&&null!==t){if("object"!=typeof t)throw new TypeError(`Invalid metadata: "${e}" must be an object or null.`);if("number"!=typeof t.no&&null!==t.no)throw new TypeError(`Invalid metadata: "${e}.no" must be a number or null.`);if("number"!=typeof t.of&&null!==t.of)throw new TypeError(`Invalid metadata: "${e}.of" must be a number or null.`)}};t("disk",e.disk),t("track",e.track),t("movementIndex",e.movementIndex)},x=e=>t=>{if(t)throw new Error(`This ${e} instance has been destroyed and can no longer be used.`)},A=x("BaseMediaAdapter");class k extends o.EventEmitter{constructor(){if(new.target===k)throw new Error("BaseMediaAdapter is an abstract class and cannot be instantiated directly.");super()}#l=!1;get destroyed(){return this.#l}static getThumbnailUrl(e){if("string"!=typeof e||""===e.trim())throw new TypeError('The "trackId" must be a non-empty string.');return""}static canHandle(e){throw new Error('Method "canHandle" must be implemented by the subclass.')}isReady(){throw A(this.#l),new Error('Method "isReady" must be implemented by the subclass.')}isPaused(){throw A(this.#l),new Error('Method "isPaused" must be implemented by the subclass.')}isEnded(){throw A(this.#l),new Error('Method "isEnded" must be implemented by the subclass.')}async waitIsReady(){throw A(this.#l),new Error('Method "waitIsReady" must be implemented by the subclass.')}canHandle(e){return A(this.#l),k.canHandle(e)}async play(e){throw A(this.#l),new Error('Method "play" must be implemented by the subclass.')}async pause(){throw A(this.#l),new Error('Method "pause" must be implemented by the subclass.')}async stop(){throw A(this.#l),new Error('Method "stop" must be implemented by the subclass.')}async seek(e){throw A(this.#l),new Error('Method "seek" must be implemented by the subclass.')}isMuted(){throw A(this.#l),new Error('Method "isMuted" must be implemented by the subclass.')}async mute(){throw A(this.#l),new Error('Method "mute" must be implemented by the subclass.')}async unMute(){throw A(this.#l),new Error('Method "unMute" must be implemented by the subclass.')}getCurrentTime(){throw A(this.#l),new Error('Method "getCurrentTime" must be implemented by the subclass.')}getTotalDuration(){throw A(this.#l),new Error('Method "getTotalDuration" must be implemented by the subclass.')}getRemainingTime(){throw A(this.#l),new Error('Method "getRemainingTime" must be implemented by the subclass.')}getPlaybackPercentage(){throw A(this.#l),new Error('Method "getPlaybackPercentage" must be implemented by the subclass.')}getTimeData(){throw A(this.#l),new Error('Method "getTimeData" must be implemented by the subclass.')}setVolume(e){throw A(this.#l),new Error('Method "setVolume" must be implemented by the subclass.')}getVolume(){throw A(this.#l),new Error('Method "getVolume" must be implemented by the subclass.')}async getContentData(){throw A(this.#l),new Error('Method "getContentData" must be implemented by the subclass.')}destroy(){this.#l||(this.removeAllListeners(),this.#l=!0,this.emit("destroyed"))}}const M=x("TinyMediaPlayer");class C extends d{static BaseMediaAdapter=k;static#d="Unknown Artist";static get unknownArtist(){return C.#d}static set unknownArtist(e){if("string"!=typeof e&&"function"!=typeof e)throw new TypeError("unknownArtist must be a string or a function.");C.#d=e}static async parseContent(e,t,r,o,s,a){return(async(e,t={},r={},o=e=>{if(!(e instanceof Blob))throw new TypeError('Expected "data" to be a Blob.');return new Promise((e,t)=>t(new TypeError("parseFile library not found.")))},s={},a=!0,l="null")=>{if("string"!=typeof e&&!(e instanceof HTMLMediaElement))throw new TypeError("Source must be a string or an HTMLMediaElement.");if(m(t,"defaultMetadata"),m(r,"metadata"),h(o,"parseFile"),m(s,"callbacks"),s.onProgress&&"function"!=typeof s.onProgress)throw new TypeError("callbacks.onProgress must be a function.");if(s.onError&&"function"!=typeof s.onError)throw new TypeError("callbacks.onError must be a function.");if("string"!=typeof l&&"function"!=typeof l)throw new TypeError("unknownArtist must be a string or a function returning a string.");let d,p="";const c=(t,r)=>{if(u(t,"stage"),void 0!==r&&!(r instanceof Event))throw new TypeError('Expected "event" to be an Event or undefined.');s.onProgress&&s.onProgress({event:r,status:"loading",stage:t,url:p||(e instanceof HTMLMediaElement?e.src:"unknown")})},y=(t,r)=>{if(!(t instanceof Error))throw new TypeError('Expected "error" to be an Error.');u(r,"stage"),s.onError&&s.onError({error:t instanceof Error?t:new Error(String(t)),url:p||(e instanceof HTMLMediaElement?e.src:"unknown"),stage:r})};try{c("INITIALIZING"),"string"==typeof e?(p=e,d=new Audio(p)):(d=e,p=d.src);try{await new Promise((e,t)=>{const r=e=>c("DOWNLOADING",e),o=()=>{i(),e(void 0)},n=e=>{i(),t(new Error(`HTMLMediaElement failed to load: ${e.message||"Unknown error"}`))},i=()=>{d.removeEventListener("progress",r),d.removeEventListener("loadedmetadata",o),d.removeEventListener("error",n)};d.addEventListener("progress",r),d.addEventListener("loadedmetadata",o),d.addEventListener("error",n),d.readyState>=1&&(i(),e(void 0))}),c("METADATA_LOADED")}catch(e){throw new b(e instanceof Error?e.message:"UNKNOWN ERROR",p,"METADATA")}const m={id:r.id||await v(p),duration:Math.floor(1e3*d.duration),url:p,weight:r.weight??1};let f={};c("EXTRACTING_ID3");try{f=await(async(e,t,r=!0)=>{u(e,"url"),h(t,"parseFile");try{const o=await fetch(e);if(!o.ok)throw new Error(`Failed to fetch audio file: ${o.status} ${o.statusText}`);const s=await o.blob(),a=await t(s);if(!a||"object"!=typeof a.common)throw new TypeError('Invalid metadata: "common" property is missing.');void 0!==typeof a.common["performer:instrument"]&&(a.common.performer_instrument=a.common["performer:instrument"]),T(a);const l=a.common;I(l);const d=([e,t])=>Array.isArray(t)?t.length>0:i(t)?n(Object.fromEntries(Object.entries(t).filter(d)))>0:null!==t,u=l?.picture?.map(e=>({...e,data:r?E(e.data,e.format):e.data}))??[];a.common={...a.common,picture:u.map(e=>({...e,data:""}))},r&&Object.keys(a.native).forEach(e=>{a.native[e]=a.native[e].map(e=>{if(e.value&&"object"==typeof e.value&&e.value.data instanceof Uint8Array){const t=l?.picture?.findIndex(t=>t.data===e.value.data&&t.format===e.value.format&&t.description===e.value.description&&t.name===e.value.name)??-1;if(u[t])return{...e,value:{...e.value,data:""}}}return e})});const h=Object.fromEntries(Object.entries({title:l?.title??null,album:l?.album??null,albumartist:l?.albumartist??null,albumartists:l?.albumartists??[],genre:l?.genre??[],label:l?.label??[],composer:l?.composer??[],year:l?.year??null,artist:l?.artist??null,artists:l?.artists??[],disk:l?.disk?{no:l.disk.no,of:l.disk.of}:null,track:l?.track?{no:l.track.no,of:l.track.of}:null,movementIndex:l?.movementIndex?{no:l.movementIndex.no,of:l.movementIndex.of}:null,picture:u,date:l?.date??null,originaldate:l?.originaldate??null,originalyear:l?.originalyear??null,releasedate:l?.releasedate??null,comment:l?.comment??[],lyrics:l?.lyrics??[],albumsort:l?.albumsort??null,titlesort:l?.titlesort??null,work:l?.work??null,artistsort:l?.artistsort??null,albumartistsort:l?.albumartistsort??null,composersort:l?.composersort??null,lyricist:l?.lyricist??[],writer:l?.writer??[],conductor:l?.conductor??[],remixer:l?.remixer??[],arranger:l?.arranger??[],engineer:l?.engineer??[],publisher:l?.publisher??[],producer:l?.producer??[],djmixer:l?.djmixer??[],mixer:l?.mixer??[],technician:l?.technician??[],grouping:l?.grouping??null,subtitle:l?.subtitle??[],description:l?.description??[],longDescription:l?.longDescription??null,discsubtitle:l?.discsubtitle??[],totaltracks:l?.totaltracks??null,totaldiscs:l?.totaldiscs??null,movementTotal:l?.movementTotal??null,compilation:l?.compilation??null,rating:l?.rating??[],bpm:l?.bpm??null,mood:l?.mood??null,media:l?.media??null,catalognumber:l?.catalognumber??[],tvShow:l?.tvShow??null,tvShowSort:l?.tvShowSort??null,tvSeason:l?.tvSeason??null,tvEpisode:l?.tvEpisode??null,tvEpisodeId:l?.tvEpisodeId??null,tvNetwork:l?.tvNetwork??null,podcast:l?.podcast??null,podcasturl:l?.podcasturl??null,releasestatus:l?.releasestatus??null,releasetype:l?.releasetype??[],releasecountry:l?.releasecountry??null,script:l?.script??null,language:l?.language??null,copyright:l?.copyright??null,license:l?.license??null,encodedby:l?.encodedby??null,encodersettings:l?.encodersettings??null,gapless:l?.gapless??null,barcode:l?.barcode??null,isrc:l?.isrc??[],asin:l?.asin??null,website:l?.website??null,performer_instrument:l?.performer_instrument??[],averageLevel:l?.averageLevel??null,peakLevel:l?.peakLevel??null,notes:l?.notes??[],originalalbum:l?.originalalbum??null,originalartist:l?.originalartist??null,key:l?.key??null,category:l?.category??[],hdVideo:l?.hdVideo??null,keywords:l?.keywords??[],movement:l?.movement??null,podcastId:l?.podcastId??null,showMovement:l?.showMovement??null,stik:l?.stik??null,playCounter:l?.playCounter??null}).filter(d));return h._fetchData=a,h}catch(e){throw e}})(p,o,a)}catch(e){y(e instanceof Error?e:new Error("Unknown Error"),"ID3"),console.warn(`[TinyAudioUtils] ID3 extraction failed for ${p}. Falling back to filename.`)}const g=e=>{u(e,"url");try{return(e.split(/[?#]/)[0].split("/").pop()??"").replace(/\.[^/.]+$/,"")||"Unknown Track"}catch{return"Unknown Track"}},w=e=>{const t={...e};return i(t._fetchData)&&(i(f._fetchData)&&(t._fetchData={...f._fetchData}),i(e._fetchData)&&(void 0!==e._fetchData.common&&(t._fetchData.common=e._fetchData.common),void 0!==e._fetchData.native&&(t._fetchData.native=e._fetchData.native),void 0!==e._fetchData.format&&(t._fetchData.format=e._fetchData.format),void 0!==e._fetchData.quality&&(t._fetchData.quality=e._fetchData.quality))),t},x={...m,...w(t),...f,...w(r),title:f.title||r.title||g(p),artist:f.artist||r.artist||("string"==typeof l?l:String(l()))};return s.onProgress&&s.onProgress({status:"success",stage:"COMPLETE",url:p}),x}catch(e){if(e instanceof b)throw e;const t=new b(e instanceof Error?e.message:"UNKNOWN ERROR",p,"INITIALIZING");throw y(t,"INITIALIZING"),t}})(e,t,r,o,s,a,C.#d)}#l=!1;get destroyed(){return this.#l}#u=new Set;#h=new WeakMap;#m=[];#p=-1;#c="NONE";#y=!1;#f=!1;#g=!1;#w=1;#b;#v;#E;#T=!1;#I;#x;#A=null;#k=null;#M=300;get fadeVolumeSpeed(){return M(this.#l),this.#M}set fadeVolumeSpeed(e){if(M(this.#l),"number"!=typeof e)throw new TypeError("fadeVolumeSpeed must be a number.");if(e<0)throw new RangeError("fadeVolumeSpeed cannot be negative.");this.#M=e,this.emit("fadeVolumeSpeedChange",this.#M)}#C=2e3;get prevClickTimeoutDuration(){return M(this.#l),this.#C}set prevClickTimeoutDuration(e){if(M(this.#l),"number"!=typeof e)throw new TypeError("prevClickTimeoutDuration must be a number.");if(e<0)throw new RangeError("prevClickTimeoutDuration cannot be negative.");this.#C=e,this.emit("prevClickTimeoutDurationChange",this.#C)}get repeatCurrentOnPrev(){return M(this.#l),this.#E}set repeatCurrentOnPrev(e){if(M(this.#l),"boolean"!=typeof e)throw new TypeError("repeatCurrentOnPrev must be a boolean.");this.#E=e,this.emit("repeatCurrentOnPrevChange",this.#E)}get smoothPlayPauseVolume(){return M(this.#l),this.#I}set smoothPlayPauseVolume(e){if(M(this.#l),"boolean"!=typeof e)throw new TypeError("smoothPlayPauseVolume must be a boolean.");this.#I=e,this.emit("smoothPlayPauseVolumeChange",this.#I)}get smoothStopVolume(){return M(this.#l),this.#x}set smoothStopVolume(e){if(M(this.#l),"boolean"!=typeof e)throw new TypeError("smoothStopVolume must be a boolean.");this.#x=e,this.emit("smoothStopVolumeChange",this.#x)}constructor(e={}){if(!s(e))throw new TypeError("Options must be a non-null object.");if(super({id:"[_blue_TinyMediaPlayer_reset_] :debug:",logger:e.logger??console,debugMode:e.debugMode??!1,useLogColors:e.useLogColors??!1}),void 0!==e.persistVolume){if("boolean"!=typeof e.persistVolume)throw new TypeError("persistVolume must be a boolean.");this.#b=e.persistVolume}else this.#b=!1;if(void 0!==e.volumeStorageKey){if("string"!=typeof e.volumeStorageKey)throw new TypeError("volumeStorageKey must be a string.");this.#v=e.volumeStorageKey}else this.#v="tiny_media_player_volume";if(void 0!==e.repeatCurrentOnPrev){if("boolean"!=typeof e.repeatCurrentOnPrev)throw new TypeError("repeatCurrentOnPrev must be a boolean.");this.#E=e.repeatCurrentOnPrev}else this.#E=!1;if(void 0!==e.smoothPlayPauseVolume){if("boolean"!=typeof e.smoothPlayPauseVolume)throw new TypeError("smoothPlayPauseVolume must be a boolean.");this.#I=e.smoothPlayPauseVolume}else this.#I=!1;if(void 0!==e.smoothStopVolume){if("boolean"!=typeof e.smoothStopVolume)throw new TypeError("smoothStopVolume must be a boolean.");this.#x=e.smoothStopVolume}else this.#x=!1;this.#b&&this.#L(),this.log("info","Instance initialized.",{options:e})}#L(){try{if("undefined"!=typeof window&&window.localStorage){const e=window.localStorage.getItem(this.#v);if(null!==e){const t=parseFloat(e);!isNaN(t)&&t>=0&&t<=1&&(this.#w=t,this.log("info",`Volume loaded from storage: ${this.#w}`))}}}catch(e){console.warn("[TinyMediaPlayer] Failed to read volume from localStorage.",e)}}#P(){try{this.#b&&"undefined"!=typeof window&&window.localStorage&&(window.localStorage.setItem(this.#v,this.#w.toString()),this.log("info",`Volume saved to storage: ${this.#w}`))}catch(e){console.warn("[TinyMediaPlayer] Failed to save volume to localStorage.",e)}}_getWeightedRandomIndex(){if(0===this.#m.length)return-1;if(1===this.#m.length)return 0;let e=0;for(let t=0;t<this.#m.length;t++){if(t===this.#p)continue;const r=this.#m[t];e+="number"==typeof r.weight&&r.weight>0?r.weight:1}let t=Math.random()*e;for(let e=0;e<this.#m.length;e++){if(e===this.#p)continue;const r=this.#m[e],o="number"==typeof r.weight&&r.weight>0?r.weight:1;if(t<o)return e;t-=o}return this.#p===this.#m.length-1?0:this.#m.length-1}async#S(e){this.#A&&this.#A.abort(),this.#A=new AbortController;const{signal:t}=this.#A,r=this.#_();if(!r)return;const o=r.getVolume(),n=performance.now(),i=this.#M;return this.log("info",`Starting volume fade: ${o} -> ${e}`),new Promise(s=>{const a=l=>{if(t.aborted)return this.log("info","Volume fade aborted."),s();const d=l-n,u=Math.min(d/i,1),h=o+(e-o)*u,m=Math.max(0,Math.min(1,h));r.setVolume(m),u<1?requestAnimationFrame(a):(r.setVolume(e),this.log("info",`Volume fade completed: ${e}`),s())};requestAnimationFrame(a)})}get playlist(){return M(this.#l),[...this.#m]}set playlist(e){if(M(this.#l),!Array.isArray(e))throw new TypeError("Playlist must be an array of MediaContent objects.");e.forEach(e=>I(e));const t=this.#f;let r=null;if(-1!==this.#p&&this.#m.length>0)try{r=this.#_()}catch(e){}this.#m=e,this.log("info",`Playlist updated. New size: ${this.#m.length}`),this.emit("playlistUpdate",this.playlist),0===this.#m.length?this.#p=-1:(this.#p>=this.#m.length||-1===this.#p)&&(this.#p=0),this.emit("trackChange",this.#p),t&&(async()=>{try{r&&await r.stop(),-1!==this.#p&&await this.play()}catch(e){this.log("error","Background transition error on playlist update:",e),console.warn("[TinyMediaPlayer] Background transition error on playlist update:",e)}})()}get currentIndex(){return M(this.#l),this.#p}set currentIndex(e){if(M(this.#l),"number"!=typeof e)throw new TypeError("Current index must be a number.");if(e<-1||e>=this.#m.length&&this.#m.length>0)throw new RangeError(`Index ${e} is out of bounds for the current playlist.`);if(this.#p===e)return;this.log("info",`Index change requested: ${this.#p} -> ${e}`);const t=this.#f;let r=null;if(-1!==this.#p&&this.#m.length>0)try{r=this.#_()}catch(e){}this.#p=e,this.emit("trackChange",this.#p),t&&(async()=>{try{r&&await r.stop(),-1!==this.#p&&await this.play()}catch(e){this.log("error","Background transition error on index update:",e),console.warn("[TinyMediaPlayer] Background transition error on index update:",e)}})()}get loopMode(){return M(this.#l),this.#c}set loopMode(e){M(this.#l);const t=["NONE","TRACK","PLAYLIST"];if(!t.includes(e))throw new TypeError(`Loop mode must be one of: ${t.join(", ")}.`);this.#c=e,this.log("info",`Loop mode changed to: ${this.#c}`),this.emit("loopModeChange",this.#c)}get isRandom(){return M(this.#l),this.#y}set isRandom(e){if(M(this.#l),"boolean"!=typeof e)throw new TypeError("Random mode state must be a boolean.");this.#y=e,this.log("info",`Random mode: ${this.#y}`),this.emit("randomModeChange",this.#y)}get isPlaying(){return M(this.#l),this.#f}get volume(){return M(this.#l),this.#w}set volume(e){if(M(this.#l),"number"!=typeof e)throw new TypeError("Volume must be a number.");if(e<0||e>1)throw new RangeError("Volume must be tightly constrained between 0.0 and 1.0.");if(this.#A&&this.#A.abort(),this.log("info",`Volume changed: ${this.#w} -> ${e}`),this.#w=e,this.#P(),this.emit("volumeChange",this.#w),-1!==this.#p&&this.#m.length>0)try{const e=this.#_();e&&e.setVolume(this.#w)}catch(e){}}get persistVolume(){return M(this.#l),this.#b}set persistVolume(e){if(M(this.#l),"boolean"!=typeof e)throw new TypeError("Persist volume parameter must be a boolean.");this.#b=e,this.log("info",`Persist volume: ${this.#b}`),e&&this.#P()}get volumeStorageKey(){return M(this.#l),this.#v}set volumeStorageKey(e){if(M(this.#l),"string"!=typeof e)throw new TypeError("Volume storage key must be a string.");if(""===e.trim())throw new TypeError("Volume storage key cannot be an empty string.");const t=this.#v;this.#v=e;try{this.#b&&"undefined"!=typeof window&&window.localStorage&&(window.localStorage.removeItem(t),this.#P())}catch(e){console.warn("[TinyMediaPlayer] Failed to migrate volume storage key.",e)}}get isMuted(){return M(this.#l),this.#g}async mute(){M(this.#l);const e=this.#_();e&&(await e.mute(),this.#g=!0,this.emit("muteChange",this.#g),this.log("info","Playback muted successfully."))}async unMute(){M(this.#l);const e=this.#_();e&&(await e.unMute(),this.#g=!1,this.emit("muteChange",this.#g),this.log("info","Playback unmuted successfully."))}get adapters(){return Array.from(this.#u)}get adaptersSize(){return this.#u.size}static#O=["timeupdate","ended"];static get defaultAdapterEventNames(){return structuredClone(C.#O)}static set defaultAdapterEventNames(e){if(!Array.isArray(e)||!e.every(e=>"string"==typeof e))throw new TypeError("TinyMediaPlayer.defaultAdapterEventNames must be an array of strings.");C.#O=[...e]}#V=new Set(C.defaultAdapterEventNames);#R(e){const t=this.#h.get(e);t&&(this.#V.forEach(r=>{const o=t.get(r);o&&e.off(r,o)}),t.clear(),this.#h.delete(e))}registerAdapter(e){if(M(this.#l),!(e instanceof k))throw new TypeError("Adapter must be an instance of BaseMediaAdapter.");this.log("info","Registering new adapter:",e);const t=new Map;this.#h.set(e,t),this.#V.forEach(t=>{this.#j(e,t)}),this.#u.add(e)}removeAdapter(e){if(M(this.#l),!(e instanceof k))throw new TypeError("Adapter must be an instance of BaseMediaAdapter.");return this.log("info","Removing adapter:",e),this.#R(e),this.#u.delete(e)}destroyAdapter(e){if(M(this.#l),!(e instanceof k))throw new TypeError("Adapter must be an instance of BaseMediaAdapter.");this.log("info","Destroying adapter:",e),this.#R(e);const t=this.#u.delete(e);return t&&e.destroy(),t}hasAdapter(e){if(M(this.#l),!(e instanceof k))throw new TypeError("Adapter must be an instance of BaseMediaAdapter.");return this.#u.has(e)}destroyAllAdapters(){M(this.#l),this.log("info","Destroying all adapters."),this.#u.forEach(e=>{this.#R(e),e.destroy()}),this.#u.clear()}clearAdapters(){M(this.#l),this.log("info","Clearing all adapters."),this.#u.forEach(e=>this.#R(e)),this.#u.clear()}getMediaAdapter(e){if(!s(e))throw new TypeError("Content must be a valid object.");for(const t of this.#u.values())if(t.canHandle(e))return t;return null}#_(){if(-1===this.#p||0===this.#m.length)return null;const e=this.#m[this.#p],t=this.getMediaAdapter(e);if(t)return t;const r=`No compatible adapter found for content ID: ${e.id}.`;throw this.log("error",r),new Error(r)}addAdapterEvent(e){if(M(this.#l),"string"!=typeof e)throw new TypeError("Event name must be a string.");this.#V.has(e)||(this.log("info",`Adding adapter event listener: ${e}`),this.#V.add(e),this.#u.forEach(t=>{this.#j(t,e)}))}removeAdapterEvent(e){if(M(this.#l),"string"!=typeof e)throw new TypeError("Event name must be a string.");this.#V.has(e)&&(this.log("info",`Removing adapter event listener: ${e}`),this.#V.delete(e),this.#u.forEach(t=>{this.#N(t,e)}))}resetAdapterEvents(){M(this.#l);const e=C.defaultAdapterEventNames,t=Array.from(this.#V);for(const r of t)e.includes(r)||this.removeAdapterEvent(r);for(const t of e)this.#V.has(t)||this.addAdapterEvent(t)}#j(e,t){const r=this.#h.get(e);if(!r)return;const o=(...e)=>{this.#l||("timeupdate"!==t&&this.log("debug",`Adapter event triggered: ${t}`,...e),this.emit(t,...e))};e.on(t,o),r.set(t,o)}#N(e,t){const r=this.#h.get(e);if(!r)return;const o=r.get(t);o&&(e.off(t,o),r.delete(t))}addTrack(e){if(M(this.#l),!s(e)||"string"!=typeof e.url)throw new TypeError("Track content must be a valid MediaContent object containing a URL.");const t={id:"",title:"",artist:"",url:"",duration:0,weight:1,...e};I(t);const r=this.#m.push(t);return this.log("info",`Track added. New length: ${r}`,t),-1===this.#p&&(this.#p=0,this.emit("trackChange",this.#p)),this.emit("playlistUpdate",this.playlist),r}existsTrack(e){if(M(this.#l),"number"!=typeof e)throw new TypeError("Index must be a number.");return e>=0&&e<this.#m.length}getTrack(e){if(M(this.#l),"number"!=typeof e)throw new TypeError("Index must be a number.");if(!this.existsTrack(e))throw new RangeError(`Index ${e} is out of bounds for the current playlist.`);return this.#m[e]}async removeTrack(e){if(M(this.#l),"number"!=typeof e)throw new TypeError("Index must be a number.");if(!this.existsTrack(e))throw new RangeError(`Index ${e} is out of bounds for the current playlist.`);this.log("info",`Removing track at index: ${e}`),e===this.#p?(await this.stop(),this.#m.splice(e,1),0===this.#m.length?this.#p=-1:this.#p>=this.#m.length&&(this.#p=0),this.emit("trackChange",this.#p)):(this.#m.splice(e,1),e<this.#p&&(this.#p-=1,this.emit("trackChange",this.#p))),this.emit("playlistUpdate",this.playlist)}searchTrack(e){if(M(this.#l),"string"!=typeof e&&"function"!=typeof e)throw new TypeError("Search query must be a string or a boolean evaluation function.");this.log("info","Searching playlist...",{query:e});const t=[];for(let r=0;r<this.#m.length;r++){const o=this.#m[r];let n=!1;if("function"==typeof e)n=Boolean(e(o));else{const t=e.toLowerCase(),r=o.title&&o.title.toLowerCase().includes(t),i=o.artist&&o.artist.toLowerCase().includes(t),s=o.album&&o.album.toLowerCase().includes(t);n=Boolean(r||i||s)}n&&t.push({track:o,index:r})}return this.log("info",`Search completed. Found ${t.length} results.`),t}async clearPlaylist(){M(this.#l),this.log("info","Clearing entire playlist."),await this.stop(),this.#m=[],this.#p=-1,this.emit("playlistUpdate",this.playlist),this.emit("trackChange",this.#p)}async play(){M(this.#l),this.log("info",`Attempting to play track at index: ${this.#p}`);const e=this.#_();if(e){this.#I?await this.#S(this.#w):e.setVolume(this.#w);try{await e.play(this.#m[this.#p]),this.#g&&await e.mute(),this.#f=!0,this.log("info","Playback started successfully."),this.emit("play",this.#p)}catch(e){throw this.log("error","Failed to play track:",e),e}}else this.log("error","Failed to play track:",`Active adapter not found for track at index ${this.#p}.`)}async pause(){M(this.#l),this.log("info","Attempting to pause playback.");const e=this.#_();e&&(this.#I&&await this.#S(0),await e.pause(),this.#f=!1,this.log("info","Playback paused."),this.emit("pause",this.#p))}async stop(){M(this.#l),this.log("info","Attempting to stop playback.");const e=this.#_();e&&(this.#x&&await this.#S(0),await e.stop(),this.#f=!1,this.log("info","Playback stopped."),this.emit("stop",this.#p))}async next(){if(M(this.#l),0!==this.#m.length){if(this.log("info","Next track requested."),await this.stop(),"TRACK"===this.#c)return this.log("info","Loop mode: TRACK. Repeating current track."),void await this.play();if(this.#y)this.#p=this._getWeightedRandomIndex(),this.log("info",`Random mode: Selected index ${this.#p}`);else{let e=this.#p+1;if(e>=this.#m.length){if("PLAYLIST"!==this.#c)return void this.log("info","End of playlist reached. Stopping.");e=0,this.log("info","Loop mode: PLAYLIST. Returning to start.")}this.#p=e}this.emit("trackChange",this.#p),await this.play()}}async prev(){if(M(this.#l),0!==this.#m.length){if(this.#E&&!this.#T)return this.log("info",'UX: Repeat current track on first "prev" click.'),this.#T=!0,this.#k&&clearTimeout(this.#k),this.#k=setTimeout(()=>{this.#T=!1,this.#k=null},2e3),await this.stop(),void await this.play();if(this.#k&&(clearTimeout(this.#k),this.#k=null),this.#T=!1,this.log("info","Previous track requested."),await this.stop(),this.#y)this.#p=this._getWeightedRandomIndex(),this.log("info",`Random mode: Selected index ${this.#p}`);else{let e=this.#p-1;if(e<0){if("PLAYLIST"!==this.#c)return void this.log("info","Start of playlist reached. Stopping.");e=this.#m.length-1,this.log("info","Loop mode: PLAYLIST. Returning to end.")}this.#p=e}this.emit("trackChange",this.#p),await this.play()}}async skipTo(e){if(M(this.#l),"number"!=typeof e)throw new TypeError("Index must be a number.");if(!this.existsTrack(e))throw new RangeError(`Index ${e} is out of bounds for the current playlist.`);this.log("info",`Skipping to index: ${e}`),await this.stop(),this.#p=e,this.emit("trackChange",this.#p),await this.play()}async seek(e){if(M(this.#l),"number"!=typeof e)throw new TypeError("Seek time must be a number in milliseconds.");if(e<0)throw new RangeError("Seek time cannot be negative.");this.log("info",`Seeking to: ${e}ms`);const t=this.#_();t&&(await t.seek(e),this.emit("seek",e))}async step(e){if(M(this.#l),"number"!=typeof e)throw new TypeError("Step amount must be a number in milliseconds.");this.log("info",`Stepping by: ${e}ms`);const t=this.#_();if(!t)return;let r=t.getCurrentTime()+e;r<0&&(r=0),await this.seek(r)}getCurrentTime(){M(this.#l);try{const e=this.#_();return e?e.getCurrentTime():0}catch{return 0}}getTotalDuration(){M(this.#l);try{const e=this.#_();return e?e.getTotalDuration():0}catch{return 0}}getRemainingTime(){M(this.#l);try{const e=this.#_();return e?e.getRemainingTime():0}catch{return 0}}getPlaybackPercentage(){M(this.#l);try{const e=this.#_();return e?e.getPlaybackPercentage():0}catch{return 0}}get isPaused(){M(this.#l);try{const e=this.#_();return!!e&&e.isPaused()}catch{return!1}}get isEnded(){M(this.#l);try{const e=this.#_();return!e||e.isEnded()}catch{return!0}}async getContentData(){M(this.#l);const e={id:"",createdAt:"",artistId:"",artistName:"",description:"",title:"",duration:0,avatar:"",url:""};try{const t=this.#_();return t?t.getContentData():e}catch{return e}}async waitIsReady(){M(this.#l);const e=this.#_();if(e)return e.waitIsReady()}async destroy(){if(!this.#l){this.log("info","Destroying TinyMediaPlayer instance.");try{this.#f&&await this.stop()}catch(e){this.log("error","Non-fatal error during playback termination:",e),console.warn("[TinyMediaPlayer] Non-fatal error during playback termination:",e)}this.#k&&clearTimeout(this.#k),this.#m=[],this.#p=-1,this.#f=!1,this.#T=!1,this.destroyAllAdapters(),this.removeAllListeners(),this.#V.clear(),this.#l=!0,this.emit("destroyed")}}}const L=C}};const t={};function r(o){const n=t[o];if(void 0!==n)return n.exports;const i=t[o]={exports:{}};return e[o](i,i.exports,r),i.exports}r.d=(e,t)=>{if(Array.isArray(t))for(var o=0;o<t.length;){var n=t[o++],i=t[o++];r.o(e,n)?0===i&&o++:0===i?Object.defineProperty(e,n,{enumerable:!0,value:t[o++]}):Object.defineProperty(e,n,{enumerable:!0,get:i})}else for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.cjs=e=>{const t={exports:{}};return e.call(t.exports,t,t.exports),t.exports};let o=r(163);window.TinyMediaPlayer=o.TinyMediaPlayer})();
1
+ (()=>{"use strict";var e={314(e,t,r){r.d(t,{TinyMediaPlayer:()=>L});var o=r.cjs(function(e,t){var r,o="object"==typeof Reflect?Reflect:null,n=o&&"function"==typeof o.apply?o.apply:function(e,t,r){return Function.prototype.apply.call(e,t,r)};r=o&&"function"==typeof o.ownKeys?o.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var i=Number.isNaN||function(e){return e!=e};function s(){s.init.call(this)}e.exports=s,e.exports.once=function(e,t){return new Promise(function(r,o){function n(r){e.removeListener(t,i),o(r)}function i(){"function"==typeof e.removeListener&&e.removeListener("error",n),r([].slice.call(arguments))}f(e,t,i,{once:!0}),"error"!==t&&function(e,t){"function"==typeof e.on&&f(e,"error",t,{once:!0})}(e,n)})},s.EventEmitter=s,s.prototype._events=void 0,s.prototype._eventsCount=0,s.prototype._maxListeners=void 0;var a=10;function l(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function d(e){return void 0===e._maxListeners?s.defaultMaxListeners:e._maxListeners}function u(e,t,r,o){var n,i,s,a;if(l(r),void 0===(i=e._events)?(i=e._events=Object.create(null),e._eventsCount=0):(void 0!==i.newListener&&(e.emit("newListener",t,r.listener?r.listener:r),i=e._events),s=i[t]),void 0===s)s=i[t]=r,++e._eventsCount;else if("function"==typeof s?s=i[t]=o?[r,s]:[s,r]:o?s.unshift(r):s.push(r),(n=d(e))>0&&s.length>n&&!s.warned){s.warned=!0;var u=new Error("Possible EventEmitter memory leak detected. "+s.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");u.name="MaxListenersExceededWarning",u.emitter=e,u.type=t,u.count=s.length,a=u,console&&console.warn&&console.warn(a)}return e}function h(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function m(e,t,r){var o={fired:!1,wrapFn:void 0,target:e,type:t,listener:r},n=h.bind(o);return n.listener=r,o.wrapFn=n,n}function p(e,t,r){var o=e._events;if(void 0===o)return[];var n=o[t];return void 0===n?[]:"function"==typeof n?r?[n.listener||n]:[n]:r?function(e){for(var t=new Array(e.length),r=0;r<t.length;++r)t[r]=e[r].listener||e[r];return t}(n):y(n,n.length)}function c(e){var t=this._events;if(void 0!==t){var r=t[e];if("function"==typeof r)return 1;if(void 0!==r)return r.length}return 0}function y(e,t){for(var r=new Array(t),o=0;o<t;++o)r[o]=e[o];return r}function f(e,t,r,o){if("function"==typeof e.on)o.once?e.once(t,r):e.on(t,r);else{if("function"!=typeof e.addEventListener)throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof e);e.addEventListener(t,function n(i){o.once&&e.removeEventListener(t,n),r(i)})}}Object.defineProperty(s,"defaultMaxListeners",{enumerable:!0,get:function(){return a},set:function(e){if("number"!=typeof e||e<0||i(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");a=e}}),s.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},s.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||i(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this},s.prototype.getMaxListeners=function(){return d(this)},s.prototype.emit=function(e){for(var t=[],r=1;r<arguments.length;r++)t.push(arguments[r]);var o="error"===e,i=this._events;if(void 0!==i)o=o&&void 0===i.error;else if(!o)return!1;if(o){var s;if(t.length>0&&(s=t[0]),s instanceof Error)throw s;var a=new Error("Unhandled error."+(s?" ("+s.message+")":""));throw a.context=s,a}var l=i[e];if(void 0===l)return!1;if("function"==typeof l)n(l,this,t);else{var d=l.length,u=y(l,d);for(r=0;r<d;++r)n(u[r],this,t)}return!0},s.prototype.addListener=function(e,t){return u(this,e,t,!1)},s.prototype.on=s.prototype.addListener,s.prototype.prependListener=function(e,t){return u(this,e,t,!0)},s.prototype.once=function(e,t){return l(t),this.on(e,m(this,e,t)),this},s.prototype.prependOnceListener=function(e,t){return l(t),this.prependListener(e,m(this,e,t)),this},s.prototype.removeListener=function(e,t){var r,o,n,i,s;if(l(t),void 0===(o=this._events))return this;if(void 0===(r=o[e]))return this;if(r===t||r.listener===t)0===--this._eventsCount?this._events=Object.create(null):(delete o[e],o.removeListener&&this.emit("removeListener",e,r.listener||t));else if("function"!=typeof r){for(n=-1,i=r.length-1;i>=0;i--)if(r[i]===t||r[i].listener===t){s=r[i].listener,n=i;break}if(n<0)return this;0===n?r.shift():function(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}(r,n),1===r.length&&(o[e]=r[0]),void 0!==o.removeListener&&this.emit("removeListener",e,s||t)}return this},s.prototype.off=s.prototype.removeListener,s.prototype.removeAllListeners=function(e){var t,r,o;if(void 0===(r=this._events))return this;if(void 0===r.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==r[e]&&(0===--this._eventsCount?this._events=Object.create(null):delete r[e]),this;if(0===arguments.length){var n,i=Object.keys(r);for(o=0;o<i.length;++o)"removeListener"!==(n=i[o])&&this.removeAllListeners(n);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(t=r[e]))this.removeListener(e,t);else if(void 0!==t)for(o=t.length-1;o>=0;o--)this.removeListener(e,t[o]);return this},s.prototype.listeners=function(e){return p(this,e,!0)},s.prototype.rawListeners=function(e){return p(this,e,!1)},s.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):c.call(e,t)},s.prototype.listenerCount=c,s.prototype.eventNames=function(){return this._eventsCount>0?r(this._events):[]}});function n(e){if(!Array.isArray(e)&&!i(e))throw new TypeError("Argument must be either an Array or a pure JSON Object.");return Array.isArray(e)?e.length:Object.keys(e).length}function i(e){return null!==e&&"object"==typeof e&&!Array.isArray(e)&&"[object Object]"===Object.prototype.toString.call(e)}function s(e){return null!==e&&"object"==typeof e&&!Array.isArray(e)}const a=["chrome","firefox","ie","edge","safari","opera","yandex","other"];class l extends o.EventEmitter{#e;#t;#r;#o;#n;#i=new Map([["log",""],["info",""],["warn",""],["error",""],["debug",""],["reset",""],["black",""],["red",""],["green",""],["yellow",""],["blue",""],["magenta",""],["cyan",""],["white",""],["gray",""]]);#s=new Map([["log","[_log_LOG_reset_]"],["info","[_info_INFO_reset_]"],["warn","[_warn_WARN_reset_]"],["error","[_error_ERROR_reset_]"],["debug","[_debug_DEBUG_reset_]"]]);constructor({logger:e,id:t,debugMode:r,canEmitLogs:o=!1,useLogColors:n=!1}){if(super(),!s(e))throw new TypeError("Logger must be an object that implements the Console interface.");if("string"!=typeof t)throw new TypeError("Logger instance id must be a string.");if("boolean"!=typeof r)throw new TypeError("debugMode must be a boolean.");if("boolean"!=typeof o)throw new TypeError("canEmitLogs must be a boolean.");if("boolean"!=typeof n)throw new TypeError("useLogColors must be a boolean.");this.#t=t,this.#e=e,this.#o=r,this.#r=o,this.#n="firefox"!==function(e=[]){const t=function(e=[]){if(!Array.isArray(e))throw new TypeError('The "disable" argument must be an array.');for(const t of e)if(!a.includes(t))throw new TypeError(`Invalid browser name provided in disable array: ${t}`);const t={chrome:0,firefox:0,ie:0,edge:0,safari:0,opera:0,yandex:0,other:0};t[function(){const e=navigator.userAgent;return-1!==e.indexOf("Chrome")?"chrome":-1!==e.indexOf("Firefox")?"firefox":-1!==e.indexOf("MSIE")?"ie":-1!==e.indexOf("Edge")?"edge":-1!==e.indexOf("Safari")?"safari":-1!==e.indexOf("Opera")?"opera":-1!==e.indexOf("YaBrowser")?"yandex":"other"}()]++;const r=function(){const e=(Array.prototype.slice.call(window.getComputedStyle(document.documentElement,"")).join("").match(/-(moz|webkit|ms)-/)??["",""])[1];return"moz"===e?"gecko":"webkit"===e?"webkit":"ms"===e?"trident":"other"}();"gecko"===r?e.indexOf("firefox")<0&&t.firefox++:"webkit"===r?(e.indexOf("chrome")<0&&t.chrome++,e.indexOf("safari")<0&&t.safari++,e.indexOf("opera")<0&&t.opera++,e.indexOf("edge")<0&&t.edge++):"trident"===r?e.indexOf("ie")<0&&t.ie++:e.indexOf("other")<0&&t.other++;const o=function(){const e=!!window.opr&&!!opr.addons||!!window.opera||navigator.userAgent.indexOf(" OPR/")>=0,t="undefined"!=typeof InstallTrigger,r=/constructor/i.test(window.HTMLElement)||"[object SafariRemoteNotification]"===(!window.safari||"undefined"!=typeof safari&&safari.pushNotification).toString(),o=!!document.documentMode,n=!o&&!!window.StyleMedia,i=!!window.chrome;return{isOpera:e,isFirefox:t,isSafari:r,isIE:o,isEdge:n,isChrome:i,isBlink:(i||e)&&!!window.CSS}}();return o.isOpera&&e.indexOf("opera")<0&&t.opera++,o.isFirefox&&e.indexOf("firefox")<0&&t.firefox++,o.isSafari&&e.indexOf("safari")<0&&t.safari++,o.isIE&&e.indexOf("ie")<0&&t.ie++,o.isEdge&&e.indexOf("edge")<0&&t.edge++,o.isChrome&&e.indexOf("chrome")<0&&t.chrome++,t}(e);return Object.keys(t).reduce((e,r)=>t[r]>t[e]?r:e)}()&&n,this.log("info","Emit logs of debug mode set to: "+(this.#o?"ON":"OFF")),this.log("info","Custom logger assigned.")}get logId(){return this.#t}get canEmitLogs(){return this.#r}get useLogColors(){return this.#n}set useLogColors(e){if("boolean"!=typeof e)throw new TypeError("useLogColors must be a boolean.");this.#n=e,this.log("info","Log Colors usage mode set to: "+(this.#n?"ON":"OFF")),this.emit("setDebugMode",e)}get debugMode(){return this.#o}set debugMode(e){if("boolean"!=typeof e)throw new TypeError("debugMode must be a boolean.");this.#o=e,this.log("info","Debug mode set to: "+(this.#o?"ON":"OFF")),this.emit("setDebugMode",e)}_addLogColor(e,t){this.#i.set(e,t)}_removeLogColor(e){this.#i.delete(e)}_addLogPrefix(e,t){this.#s.set(e,t)}_removeLogPrefix(e){this.#s.delete(e)}#a(e){if("string"!=typeof e)return e;let t=e;for(const[e,r]of this.#s){const o=new RegExp(`\\:${e}\\:`,"g");t=t.replace(o,r)}for(const[e,r]of this.#i){const o=new RegExp(`\\_${e}\\_`,"g");t=t.replace(o,this.#n?r:"")}return t}logClear(){if(this.#o)return this.#r&&this.emit("debug:clear"),this.#e.clear?this.#e.clear():console.clear()}logGroupEnd(){if(this.#o)return this.#r&&this.emit("debug:groupEnd"),this.#e.groupEnd?this.#e.groupEnd():console.groupEnd()}logLabel(e,t){if(!this.#o)return;const r=["count","countReset","time","timeEnd","profile","profileEnd","timeStamp"];if(!r.includes(e))throw new TypeError(`Invalid logType. Expected one of: ${r.join(", ")}`);if(void 0!==t&&"string"!=typeof t)throw new TypeError("The label must be a string.");const o=this.#e[e]?this.#e[e]:console[e];if(!o)throw new TypeError(`The log type "${e}" is not supported by the provided logger or console.`);return this.#r&&this.emit("debug:logLabel",e,t),o(t)}logTimeLabel(e,...t){if(this.#o)return this.#r&&this.emit("debug:timeLog",e,...t),this.#e.timeLog?this.#e.timeLog(e,...t):console.timeLog(e,...t)}logAssert(e,...t){if(this.#o)return this.#r&&this.emit("debug:assert",e,...t),this.#e.assert?this.#e.assert(e,...t):console.assert(e,...t)}logDir(e,t){if(this.#o)return this.#r&&this.emit("debug:dir",e,t),this.#e.dir?this.#e.dir(e,t):console.dir(e,t)}logTable(e,t){if(this.#o){if(!(void 0===t||Array.isArray(t)&&t.every(e=>"string"==typeof e)))throw new TypeError("Properties must be an array of strings.");return this.#r&&this.emit("debug:table",e,t),this.#e.table?this.#e.table(e,t):console.table(e,t)}}log(e,t,...r){if(!this.#o)return;const o=["log","info","warn","error","debug","dirxml","group","groupCollapsed","trace"];if(!o.includes(e))throw new TypeError(`Invalid logType. Expected one of: ${o.join(", ")}`);if("string"!=typeof t)throw new TypeError("The message must be a string.");let n=this.#t,i=t;n=this.#a(n),i=this.#a(i);const s=this.#e[e]?this.#e[e]:console[e];return s?(this.#r&&this.emit("debug:log",n,i,...r),s(n,i,...r)):(this.#r&&this.emit("debug:log",n,i,...r),console.log(n,i,...r))}}const d=l,u=(e,t)=>{if("string"!=typeof t)throw new TypeError('Expected "name" to be a string.');if("string"!=typeof e)throw new TypeError(`Expected "${t}" to be a string, but received ${typeof e}.`)},h=(e,t)=>{if("string"!=typeof t)throw new TypeError('Expected "name" to be a string.');if("function"!=typeof e)throw new TypeError(`Expected "${t}" to be a function, but received ${typeof e}.`)},m=(e,t)=>{if("string"!=typeof t)throw new TypeError('Expected "name" to be a string.');if("object"!=typeof e||null===e||Array.isArray(e))throw new TypeError(`Expected "${t}" to be a plain object, but received ${null===e?"null":Array.isArray(e)?"array":typeof e}.`)},p=(e,t=!1)=>!t&&void 0===e,c=(e,t=!1)=>p(e,t)||"string"==typeof e||!t&&null===e,y=(e,t=!1)=>p(e,t)||"number"==typeof e||!t&&null===e,f=(e,t=!1)=>p(e,t)||"boolean"==typeof e||!t&&null===e,g=(e,t)=>!!p(e)||(h(t,"valueValidator"),Array.isArray(e)&&e.every(t)),w=new Map;class b extends Error{constructor(e,t,r){if(u(e,"message"),u(t,"url"),"string"!=typeof r)throw new TypeError(`Expected "stage" to be a string, but received ${typeof r}.`);super(e),this.name="MediaLoadingError",this.url=t,this.stage=r}}const v=async e=>{u(e,"str");const t=(new TextEncoder).encode(e),r=await crypto.subtle.digest("SHA-1",t);return Array.from(new Uint8Array(r)).map(e=>e.toString(16).padStart(2,"0")).join("").substring(0,8)},E=(e,t="image/jpeg")=>{if(!(e instanceof Uint8Array)&&"string"!=typeof e)throw new TypeError(`Expected "data" to be an instance of Uint8Array or a string, but received ${typeof e}.`);u(t,"format");const r=e=>{const t=URL.createObjectURL(e),r=w.get(t);return w.set(t,"number"==typeof r?r+1:1),t};if(e instanceof Uint8Array)return r(new Blob([e],{type:t}));if("string"==typeof e&&e.startsWith("data:")){const o=e.split(",")[1],n=atob(o),i=new Uint8Array(n.length);for(let e=0;e<n.length;e++)i[e]=n.charCodeAt(e);return r(new Blob([i],{type:t}))}return"string"==typeof e?e:""},T=(e,t=!1)=>{if(i(e)){if(4!==n(e)){if(t)return!1;throw new TypeError("Invalid fetch data: Object must be an MediaContentFetchData.")}I(e.common),m(e.native,"_fetchData.native"),m(e.format,"_fetchData.format"),m(e.quality,"_fetchData.quality");for(const r in e.native){const o=e.native[r];if(!g(o,e=>"string"==typeof e.id)){if(t)return!1;throw new TypeError(`Invalid native data: "${r}" must be an array of native fetch data.`)}}}return!0},I=e=>{if(m(e,"common"),T(e._fetchData),!c(e.title))throw new TypeError('Invalid metadata: "title" must be a string or null.');if(!c(e.album))throw new TypeError('Invalid metadata: "album" must be a string or null.');if(!c(e.albumartist))throw new TypeError('Invalid metadata: "albumartist" must be a a string or null.');if(!c(e.artist))throw new TypeError('Invalid metadata: "artist" must be a string or null.');if(!f(e.compilation))throw new TypeError('Invalid metadata: "compilation" must be a boolean or null.');if(!f(e.podcast))throw new TypeError('Invalid metadata: "podcast" must be a boolean or null.');if(!f(e.gapless))throw new TypeError('Invalid metadata: "gapless" must be a boolean or null.');if(!f(e.showMovement))throw new TypeError('Invalid metadata: "showMovement" must be a boolean or null.');if(!y(e.averageLevel))throw new TypeError('Invalid metadata: "averageLevel" must be a number or null.');if(!y(e.peakLevel))throw new TypeError('Invalid metadata: "peakLevel" must be a number or null.');if(!y(e.hdVideo))throw new TypeError('Invalid metadata: "hdVideo" must be a number or null.');if(!y(e.stik))throw new TypeError('Invalid metadata: "stik" must be a number or null.');if(!y(e.playCounter))throw new TypeError('Invalid metadata: "playCounter" must be a number or null.');if(!y(e.tvSeason))throw new TypeError('Invalid metadata: "tvSeason" must be a number or null.');if(!y(e.tvEpisode))throw new TypeError('Invalid metadata: "tvEpisode" must be a number or null.');if(!y(e.year))throw new TypeError('Invalid metadata: "year" must be a number or null.');if(!y(e.bpm))throw new TypeError('Invalid metadata: "bpm" must be a number or null.');if(!y(e.originalyear))throw new TypeError('Invalid metadata: "originalyear" must be a number or null.');if(!y(e.movementTotal))throw new TypeError('Invalid metadata: "movementTotal" must be a number or null.');if(!c(e.date))throw new TypeError('Invalid metadata: "date" must be a string or null.');if(!c(e.originaldate))throw new TypeError('Invalid metadata: "originaldate" must be a string or null.');if(!c(e.releasedate))throw new TypeError('Invalid metadata: "releasedate" must be a string or null.');if(!c(e.albumsort))throw new TypeError('Invalid metadata: "albumsort" must be a string or null.');if(!c(e.titlesort))throw new TypeError('Invalid metadata: "titlesort" must be a string or null.');if(!c(e.work))throw new TypeError('Invalid metadata: "work" must be a string or null.');if(!c(e.artistsort))throw new TypeError('Invalid metadata: "artistsort" must be a string or null.');if(!c(e.albumartistsort))throw new TypeError('Invalid metadata: "albumartistsort" must be a string or null.');if(!c(e.composersort))throw new TypeError('Invalid metadata: "composersort" must be a string or null.');if(!c(e.grouping))throw new TypeError('Invalid metadata: "grouping" must be a string or null.');if(!c(e.longDescription))throw new TypeError('Invalid metadata: "longDescription" must be a string or null.');if(!c(e.totaltracks))throw new TypeError('Invalid metadata: "totaltracks" must be a string or null.');if(!c(e.totaldiscs))throw new TypeError('Invalid metadata: "totaldiscs" must be a string or null.');if(!c(e.mood))throw new TypeError('Invalid metadata: "mood" must be a string or null.');if(!c(e.media))throw new TypeError('Invalid metadata: "media" must be a string or null.');if(!c(e.tvShow))throw new TypeError('Invalid metadata: "tvShow" must be a string or null.');if(!c(e.tvShowSort))throw new TypeError('Invalid metadata: "tvShowSort" must be a string or null.');if(!c(e.tvEpisodeId))throw new TypeError('Invalid metadata: "tvEpisodeId" must be a string or null.');if(!c(e.tvNetwork))throw new TypeError('Invalid metadata: "tvNetwork" must be a string or null.');if(!c(e.podcasturl))throw new TypeError('Invalid metadata: "podcasturl" must be a string or null.');if(!c(e.releasestatus))throw new TypeError('Invalid metadata: "releasestatus" must be a string or null.');if(!c(e.releasecountry))throw new TypeError('Invalid metadata: "releasecountry" must be a string or null.');if(!c(e.script))throw new TypeError('Invalid metadata: "script" must be a string or null.');if(!c(e.language))throw new TypeError('Invalid metadata: "language" must be a string or null.');if(!c(e.copyright))throw new TypeError('Invalid metadata: "copyright" must be a string or null.');if(!c(e.license))throw new TypeError('Invalid metadata: "license" must be a string or null.');if(!c(e.encodedby))throw new TypeError('Invalid metadata: "encodedby" must be a string or null.');if(!c(e.encodersettings))throw new TypeError('Invalid metadata: "encodersettings" must be a string or null.');if(!c(e.barcode))throw new TypeError('Invalid metadata: "barcode" must be a string or null.');if(!c(e.asin))throw new TypeError('Invalid metadata: "asin" must be a string or null.');if(!c(e.website))throw new TypeError('Invalid metadata: "website" must be a string or null.');if(!c(e.originalalbum))throw new TypeError('Invalid metadata: "originalalbum" must be a string or null.');if(!c(e.originalartist))throw new TypeError('Invalid metadata: "originalartist" must be a string or null.');if(!c(e.key))throw new TypeError('Invalid metadata: "key" must be a string or null.');if(!c(e.movement))throw new TypeError('Invalid metadata: "movement" must be a string or null.');if(!c(e.podcastId))throw new TypeError('Invalid metadata: "podcastId" must be a string or null.');if(!g(e.albumartists,e=>"string"==typeof e))throw new TypeError('Invalid metadata: "albumartists" must be an array of strings.');if(!g(e.genre,e=>"string"==typeof e))throw new TypeError('Invalid metadata: "genre" must be an array of strings.');if(!g(e.label,e=>"string"==typeof e))throw new TypeError('Invalid metadata: "label" must be an array of strings.');if(!g(e.composer,e=>"string"==typeof e))throw new TypeError('Invalid metadata: "composer" must be an array of strings.');if(!g(e.artists,e=>"string"==typeof e))throw new TypeError('Invalid metadata: "artists" must be an array of strings.');if(!g(e.lyricist,e=>"string"==typeof e))throw new TypeError('Invalid metadata: "lyricist" must be an array of strings.');if(!g(e.writer,e=>"string"==typeof e))throw new TypeError('Invalid metadata: "writer" must be an array of strings.');if(!g(e.conductor,e=>"string"==typeof e))throw new TypeError('Invalid metadata: "conductor" must be an array of strings.');if(!g(e.remixer,e=>"string"==typeof e))throw new TypeError('Invalid metadata: "remixer" must be an array of strings.');if(!g(e.arranger,e=>"string"==typeof e))throw new TypeError('Invalid metadata: "arranger" must be an array of strings.');if(!g(e.engineer,e=>"string"==typeof e))throw new TypeError('Invalid metadata: "engineer" must be an array of strings.');if(!g(e.publisher,e=>"string"==typeof e))throw new TypeError('Invalid metadata: "publisher" must be an array of strings.');if(!g(e.producer,e=>"string"==typeof e))throw new TypeError('Invalid metadata: "producer" must be an array of strings.');if(!g(e.djmixer,e=>"string"==typeof e))throw new TypeError('Invalid metadata: "djmixer" must be an array of strings.');if(!g(e.mixer,e=>"string"==typeof e))throw new TypeError('Invalid metadata: "mixer" must be an array of strings.');if(!g(e.technician,e=>"string"==typeof e))throw new TypeError('Invalid metadata: "technician" must be an array of strings.');if(!g(e.subtitle,e=>"string"==typeof e))throw new TypeError('Invalid metadata: "subtitle" must be an array of strings.');if(!g(e.description,e=>"string"==typeof e))throw new TypeError('Invalid metadata: "description" must be an array of strings.');if(!g(e.discsubtitle,e=>"string"==typeof e))throw new TypeError('Invalid metadata: "discsubtitle" must be an array of strings.');if(!g(e.releasetype,e=>"string"==typeof e))throw new TypeError('Invalid metadata: "releasetype" must be an array of strings.');if(!g(e.isrc,e=>"string"==typeof e))throw new TypeError('Invalid metadata: "isrc" must be an array of strings.');if(!g(e.performer_instrument,e=>"string"==typeof e))throw new TypeError('Invalid metadata: "performer_instrument" must be an array of strings.');if(!g(e.notes,e=>"string"==typeof e))throw new TypeError('Invalid metadata: "notes" must be an array of strings.');if(!g(e.category,e=>"string"==typeof e))throw new TypeError('Invalid metadata: "category" must be an array of strings.');if(!g(e.keywords,e=>"string"==typeof e))throw new TypeError('Invalid metadata: "keywords" must be an array of strings.');if(!g(e.catalognumber,e=>"string"==typeof e))throw new TypeError('Invalid metadata: "catalognumber" must be an array of strings.');if(!g(e.picture,e=>e&&"object"==typeof e&&(void 0===e.description||"string"==typeof e.description)&&(void 0===e.name||"string"==typeof e.name)&&(void 0===e.type||"string"==typeof e.type)&&"string"==typeof e.format&&(e.data instanceof Uint8Array||"string"==typeof e.data)))throw new TypeError('Invalid metadata: "picture" must be an array of pictures.');if(!g(e.comment,e=>null!==e&&"object"==typeof e&&c(e.descriptor)&&c(e.language)&&c(e.text)))throw new TypeError('Invalid metadata: "comment" must be an array of valid IComment objects.');if(!g(e.lyrics,e=>null!==e&&"object"==typeof e&&c(e.text)&&c(e.descriptor)&&c(e.language)&&(!Array.isArray(e)||g(e.syncText,e=>null!==e&&"object"==typeof e&&c(e.text)&&y(e.timestamp)))&&(e=>void 0===e||null!==e&&"object"==typeof e&&y(e.notSynchronized)&&y(e.mpegFrameNumber)&&y(e.milliseconds))(e.timeStampFormat)&&(e=>void 0===e||null!==e&&"object"==typeof e&&y(e.other)&&y(e.lyrics)&&y(e.text)&&y(e.movement_part)&&y(e.events)&&y(e.chord)&&y(e.trivia_pop))(e.contentType)))throw new TypeError('Invalid metadata: "lyrics" must be an array of valid ILyricsTag objects.');if(!g(e.rating,e=>null!==e&&"object"==typeof e&&c(e.source)&&y(e.rating)))throw new TypeError('Invalid metadata: "rating" must be an array of valid IRating objects.');const t=(e,t)=>{if(!p(t)&&null!==t){if("object"!=typeof t)throw new TypeError(`Invalid metadata: "${e}" must be an object or null.`);if("number"!=typeof t.no&&null!==t.no)throw new TypeError(`Invalid metadata: "${e}.no" must be a number or null.`);if("number"!=typeof t.of&&null!==t.of)throw new TypeError(`Invalid metadata: "${e}.of" must be a number or null.`)}};t("disk",e.disk),t("track",e.track),t("movementIndex",e.movementIndex)},x=e=>t=>{if(t)throw new Error(`This ${e} instance has been destroyed and can no longer be used.`)},A=x("BaseMediaAdapter");class k extends o.EventEmitter{constructor(){if(new.target===k)throw new Error("BaseMediaAdapter is an abstract class and cannot be instantiated directly.");super()}#l=!1;get destroyed(){return this.#l}static getThumbnailUrl(e){if("string"!=typeof e||""===e.trim())throw new TypeError('The "trackId" must be a non-empty string.');return""}static canHandle(e){throw new Error('Method "canHandle" must be implemented by the subclass.')}isReady(){throw A(this.#l),new Error('Method "isReady" must be implemented by the subclass.')}isPaused(){throw A(this.#l),new Error('Method "isPaused" must be implemented by the subclass.')}isEnded(){throw A(this.#l),new Error('Method "isEnded" must be implemented by the subclass.')}async waitIsReady(){throw A(this.#l),new Error('Method "waitIsReady" must be implemented by the subclass.')}canHandle(e){return A(this.#l),k.canHandle(e)}async play(e){throw A(this.#l),new Error('Method "play" must be implemented by the subclass.')}async pause(){throw A(this.#l),new Error('Method "pause" must be implemented by the subclass.')}async stop(){throw A(this.#l),new Error('Method "stop" must be implemented by the subclass.')}async seek(e){throw A(this.#l),new Error('Method "seek" must be implemented by the subclass.')}isMuted(){throw A(this.#l),new Error('Method "isMuted" must be implemented by the subclass.')}async mute(){throw A(this.#l),new Error('Method "mute" must be implemented by the subclass.')}async unMute(){throw A(this.#l),new Error('Method "unMute" must be implemented by the subclass.')}getCurrentTime(){throw A(this.#l),new Error('Method "getCurrentTime" must be implemented by the subclass.')}getTotalDuration(){throw A(this.#l),new Error('Method "getTotalDuration" must be implemented by the subclass.')}getRemainingTime(){throw A(this.#l),new Error('Method "getRemainingTime" must be implemented by the subclass.')}getPlaybackPercentage(){throw A(this.#l),new Error('Method "getPlaybackPercentage" must be implemented by the subclass.')}getTimeData(){throw A(this.#l),new Error('Method "getTimeData" must be implemented by the subclass.')}setVolume(e){throw A(this.#l),new Error('Method "setVolume" must be implemented by the subclass.')}getVolume(){throw A(this.#l),new Error('Method "getVolume" must be implemented by the subclass.')}async getContentData(){throw A(this.#l),new Error('Method "getContentData" must be implemented by the subclass.')}destroy(){this.#l||(this.removeAllListeners(),this.#l=!0,this.emit("destroyed"))}}const M=x("TinyMediaPlayer");class C extends d{static BaseMediaAdapter=k;static#d="Unknown Artist";static get unknownArtist(){return C.#d}static set unknownArtist(e){if("string"!=typeof e&&"function"!=typeof e)throw new TypeError("unknownArtist must be a string or a function.");C.#d=e}static async parseContent(e,t,r,o,s,a){return(async(e,t={},r={},o=e=>{if(!(e instanceof Blob))throw new TypeError('Expected "data" to be a Blob.');return new Promise((e,t)=>t(new TypeError("parseFile library not found.")))},s={},a=!0,l="null")=>{if("string"!=typeof e&&!(e instanceof HTMLMediaElement))throw new TypeError("Source must be a string or an HTMLMediaElement.");if(m(t,"defaultMetadata"),m(r,"metadata"),h(o,"parseFile"),m(s,"callbacks"),s.onProgress&&"function"!=typeof s.onProgress)throw new TypeError("callbacks.onProgress must be a function.");if(s.onError&&"function"!=typeof s.onError)throw new TypeError("callbacks.onError must be a function.");if("string"!=typeof l&&"function"!=typeof l)throw new TypeError("unknownArtist must be a string or a function returning a string.");let d,p="";const c=(t,r)=>{if(u(t,"stage"),void 0!==r&&!(r instanceof Event))throw new TypeError('Expected "event" to be an Event or undefined.');s.onProgress&&s.onProgress({event:r,status:"loading",stage:t,url:p||(e instanceof HTMLMediaElement?e.src:"unknown")})},y=(t,r)=>{if(!(t instanceof Error))throw new TypeError('Expected "error" to be an Error.');u(r,"stage"),s.onError&&s.onError({error:t instanceof Error?t:new Error(String(t)),url:p||(e instanceof HTMLMediaElement?e.src:"unknown"),stage:r})};try{c("INITIALIZING"),"string"==typeof e?(p=e,d=new Audio(p)):(d=e,p=d.src);try{await new Promise((e,t)=>{const r=e=>c("DOWNLOADING",e),o=()=>{i(),e(void 0)},n=e=>{i(),t(new Error(`HTMLMediaElement failed to load: ${e.message||"Unknown error"}`))},i=()=>{d.removeEventListener("progress",r),d.removeEventListener("loadedmetadata",o),d.removeEventListener("error",n)};d.addEventListener("progress",r),d.addEventListener("loadedmetadata",o),d.addEventListener("error",n),d.readyState>=1&&(i(),e(void 0))}),c("METADATA_LOADED")}catch(e){throw new b(e instanceof Error?e.message:"UNKNOWN ERROR",p,"METADATA")}const m={id:r.id||await v(p),duration:Math.floor(1e3*d.duration),url:p,weight:r.weight??1};let f={};c("EXTRACTING_ID3");try{f=await(async(e,t,r=!0)=>{u(e,"url"),h(t,"parseFile");const o=await fetch(e);if(!o.ok)throw new Error(`Failed to fetch audio file: ${o.status} ${o.statusText}`);const s=await o.blob(),a=await t(s);if(!a||"object"!=typeof a.common)throw new TypeError('Invalid metadata: "common" property is missing.');void 0!==typeof a.common["performer:instrument"]&&(a.common.performer_instrument=a.common["performer:instrument"]),T(a);const l=a.common;I(l);const d=([e,t])=>Array.isArray(t)?t.length>0:i(t)?n(Object.fromEntries(Object.entries(t).filter(d)))>0:null!==t,m=l?.picture?.map(e=>({...e,data:r?E(e.data,e.format):e.data}))??[];a.common={...a.common,picture:m.map(e=>({...e,data:""}))},r&&Object.keys(a.native).forEach(e=>{a.native[e]=a.native[e].map(e=>{if(e.value&&"object"==typeof e.value&&e.value.data instanceof Uint8Array){const t=l?.picture?.findIndex(t=>t.data===e.value.data&&t.format===e.value.format&&t.description===e.value.description&&t.name===e.value.name)??-1;if(m[t])return{...e,value:{...e.value,data:""}}}return e})});const p=Object.fromEntries(Object.entries({title:l?.title??null,album:l?.album??null,albumartist:l?.albumartist??null,albumartists:l?.albumartists??[],genre:l?.genre??[],label:l?.label??[],composer:l?.composer??[],year:l?.year??null,artist:l?.artist??null,artists:l?.artists??[],disk:l?.disk?{no:l.disk.no,of:l.disk.of}:null,track:l?.track?{no:l.track.no,of:l.track.of}:null,movementIndex:l?.movementIndex?{no:l.movementIndex.no,of:l.movementIndex.of}:null,picture:m,date:l?.date??null,originaldate:l?.originaldate??null,originalyear:l?.originalyear??null,releasedate:l?.releasedate??null,comment:l?.comment??[],lyrics:l?.lyrics??[],albumsort:l?.albumsort??null,titlesort:l?.titlesort??null,work:l?.work??null,artistsort:l?.artistsort??null,albumartistsort:l?.albumartistsort??null,composersort:l?.composersort??null,lyricist:l?.lyricist??[],writer:l?.writer??[],conductor:l?.conductor??[],remixer:l?.remixer??[],arranger:l?.arranger??[],engineer:l?.engineer??[],publisher:l?.publisher??[],producer:l?.producer??[],djmixer:l?.djmixer??[],mixer:l?.mixer??[],technician:l?.technician??[],grouping:l?.grouping??null,subtitle:l?.subtitle??[],description:l?.description??[],longDescription:l?.longDescription??null,discsubtitle:l?.discsubtitle??[],totaltracks:l?.totaltracks??null,totaldiscs:l?.totaldiscs??null,movementTotal:l?.movementTotal??null,compilation:l?.compilation??null,rating:l?.rating??[],bpm:l?.bpm??null,mood:l?.mood??null,media:l?.media??null,catalognumber:l?.catalognumber??[],tvShow:l?.tvShow??null,tvShowSort:l?.tvShowSort??null,tvSeason:l?.tvSeason??null,tvEpisode:l?.tvEpisode??null,tvEpisodeId:l?.tvEpisodeId??null,tvNetwork:l?.tvNetwork??null,podcast:l?.podcast??null,podcasturl:l?.podcasturl??null,releasestatus:l?.releasestatus??null,releasetype:l?.releasetype??[],releasecountry:l?.releasecountry??null,script:l?.script??null,language:l?.language??null,copyright:l?.copyright??null,license:l?.license??null,encodedby:l?.encodedby??null,encodersettings:l?.encodersettings??null,gapless:l?.gapless??null,barcode:l?.barcode??null,isrc:l?.isrc??[],asin:l?.asin??null,website:l?.website??null,performer_instrument:l?.performer_instrument??[],averageLevel:l?.averageLevel??null,peakLevel:l?.peakLevel??null,notes:l?.notes??[],originalalbum:l?.originalalbum??null,originalartist:l?.originalartist??null,key:l?.key??null,category:l?.category??[],hdVideo:l?.hdVideo??null,keywords:l?.keywords??[],movement:l?.movement??null,podcastId:l?.podcastId??null,showMovement:l?.showMovement??null,stik:l?.stik??null,playCounter:l?.playCounter??null}).filter(d));return p._fetchData=a,p})(p,o,a)}catch(e){y(e instanceof Error?e:new Error("Unknown Error"),"ID3"),console.warn(`[TinyAudioUtils] ID3 extraction failed for ${p}. Falling back to filename.`)}const g=e=>{u(e,"url");try{return(e.split(/[?#]/)[0].split("/").pop()??"").replace(/\.[^/.]+$/,"")||"Unknown Track"}catch{return"Unknown Track"}},w=e=>{const t={...e};return i(t._fetchData)&&(i(f._fetchData)&&(t._fetchData={...f._fetchData}),i(e._fetchData)&&(void 0!==e._fetchData.common&&(t._fetchData.common=e._fetchData.common),void 0!==e._fetchData.native&&(t._fetchData.native=e._fetchData.native),void 0!==e._fetchData.format&&(t._fetchData.format=e._fetchData.format),void 0!==e._fetchData.quality&&(t._fetchData.quality=e._fetchData.quality))),t},x={...m,...w(t),...f,...w(r),title:f.title||r.title||g(p),artist:f.artist||r.artist||("string"==typeof l?l:String(l()))};return s.onProgress&&s.onProgress({status:"success",stage:"COMPLETE",url:p}),x}catch(e){if(e instanceof b)throw e;const t=new b(e instanceof Error?e.message:"UNKNOWN ERROR",p,"INITIALIZING");throw y(t,"INITIALIZING"),t}})(e,t,r,o,s,a,C.#d)}#l=!1;get destroyed(){return this.#l}#u=new Set;#h=new WeakMap;#m=[];#p=-1;#c="NONE";#y=!1;#f=!1;#g=!1;#w=1;#b;#v;#E;#T=!1;#I;#x;#A=null;#k=null;#M=300;get fadeVolumeSpeed(){return M(this.#l),this.#M}set fadeVolumeSpeed(e){if(M(this.#l),"number"!=typeof e)throw new TypeError("fadeVolumeSpeed must be a number.");if(e<0)throw new RangeError("fadeVolumeSpeed cannot be negative.");this.#M=e,this.emit("fadeVolumeSpeedChange",this.#M)}#C=2e3;get prevClickTimeoutDuration(){return M(this.#l),this.#C}set prevClickTimeoutDuration(e){if(M(this.#l),"number"!=typeof e)throw new TypeError("prevClickTimeoutDuration must be a number.");if(e<0)throw new RangeError("prevClickTimeoutDuration cannot be negative.");this.#C=e,this.emit("prevClickTimeoutDurationChange",this.#C)}get repeatCurrentOnPrev(){return M(this.#l),this.#E}set repeatCurrentOnPrev(e){if(M(this.#l),"boolean"!=typeof e)throw new TypeError("repeatCurrentOnPrev must be a boolean.");this.#E=e,this.emit("repeatCurrentOnPrevChange",this.#E)}get smoothPlayPauseVolume(){return M(this.#l),this.#I}set smoothPlayPauseVolume(e){if(M(this.#l),"boolean"!=typeof e)throw new TypeError("smoothPlayPauseVolume must be a boolean.");this.#I=e,this.emit("smoothPlayPauseVolumeChange",this.#I)}get smoothStopVolume(){return M(this.#l),this.#x}set smoothStopVolume(e){if(M(this.#l),"boolean"!=typeof e)throw new TypeError("smoothStopVolume must be a boolean.");this.#x=e,this.emit("smoothStopVolumeChange",this.#x)}constructor(e={}){if(!s(e))throw new TypeError("Options must be a non-null object.");if(super({id:"[_blue_TinyMediaPlayer_reset_] :debug:",logger:e.logger??console,debugMode:e.debugMode??!1,useLogColors:e.useLogColors??!1}),void 0!==e.persistVolume){if("boolean"!=typeof e.persistVolume)throw new TypeError("persistVolume must be a boolean.");this.#b=e.persistVolume}else this.#b=!1;if(void 0!==e.volumeStorageKey){if("string"!=typeof e.volumeStorageKey)throw new TypeError("volumeStorageKey must be a string.");this.#v=e.volumeStorageKey}else this.#v="tiny_media_player_volume";if(void 0!==e.repeatCurrentOnPrev){if("boolean"!=typeof e.repeatCurrentOnPrev)throw new TypeError("repeatCurrentOnPrev must be a boolean.");this.#E=e.repeatCurrentOnPrev}else this.#E=!1;if(void 0!==e.smoothPlayPauseVolume){if("boolean"!=typeof e.smoothPlayPauseVolume)throw new TypeError("smoothPlayPauseVolume must be a boolean.");this.#I=e.smoothPlayPauseVolume}else this.#I=!1;if(void 0!==e.smoothStopVolume){if("boolean"!=typeof e.smoothStopVolume)throw new TypeError("smoothStopVolume must be a boolean.");this.#x=e.smoothStopVolume}else this.#x=!1;this.#b&&this.#L(),this.log("info","Instance initialized.",{options:e})}#L(){try{if("undefined"!=typeof window&&window.localStorage){const e=window.localStorage.getItem(this.#v);if(null!==e){const t=parseFloat(e);!isNaN(t)&&t>=0&&t<=1&&(this.#w=t,this.log("info",`Volume loaded from storage: ${this.#w}`))}}}catch(e){console.warn("[TinyMediaPlayer] Failed to read volume from localStorage.",e)}}#P(){try{this.#b&&"undefined"!=typeof window&&window.localStorage&&(window.localStorage.setItem(this.#v,this.#w.toString()),this.log("info",`Volume saved to storage: ${this.#w}`))}catch(e){console.warn("[TinyMediaPlayer] Failed to save volume to localStorage.",e)}}_getWeightedRandomIndex(){if(0===this.#m.length)return-1;if(1===this.#m.length)return 0;let e=0;for(let t=0;t<this.#m.length;t++){if(t===this.#p)continue;const r=this.#m[t];e+="number"==typeof r.weight&&r.weight>0?r.weight:1}let t=Math.random()*e;for(let e=0;e<this.#m.length;e++){if(e===this.#p)continue;const r=this.#m[e],o="number"==typeof r.weight&&r.weight>0?r.weight:1;if(t<o)return e;t-=o}return this.#p===this.#m.length-1?0:this.#m.length-1}async#S(e){this.#A&&this.#A.abort(),this.#A=new AbortController;const{signal:t}=this.#A,r=this.#_();if(!r)return;const o=r.getVolume(),n=performance.now(),i=this.#M;return this.log("info",`Starting volume fade: ${o} -> ${e}`),new Promise(s=>{const a=l=>{if(t.aborted)return this.log("info","Volume fade aborted."),s();const d=l-n,u=Math.min(d/i,1),h=o+(e-o)*u,m=Math.max(0,Math.min(1,h));r.setVolume(m),u<1?requestAnimationFrame(a):(r.setVolume(e),this.log("info",`Volume fade completed: ${e}`),s())};requestAnimationFrame(a)})}get playlist(){return M(this.#l),[...this.#m]}set playlist(e){if(M(this.#l),!Array.isArray(e))throw new TypeError("Playlist must be an array of MediaContent objects.");e.forEach(e=>I(e));const t=this.#f;let r=null;if(-1!==this.#p&&this.#m.length>0)try{r=this.#_()}catch(e){}this.#m=e,this.log("info",`Playlist updated. New size: ${this.#m.length}`),this.emit("playlistUpdate",this.playlist),0===this.#m.length?this.#p=-1:(this.#p>=this.#m.length||-1===this.#p)&&(this.#p=0),this.emit("trackChange",this.#p),t&&(async()=>{try{r&&await r.stop(),-1!==this.#p&&await this.play()}catch(e){this.log("error","Background transition error on playlist update:",e),console.warn("[TinyMediaPlayer] Background transition error on playlist update:",e)}})()}get currentIndex(){return M(this.#l),this.#p}set currentIndex(e){if(M(this.#l),"number"!=typeof e)throw new TypeError("Current index must be a number.");if(e<-1||e>=this.#m.length&&this.#m.length>0)throw new RangeError(`Index ${e} is out of bounds for the current playlist.`);if(this.#p===e)return;this.log("info",`Index change requested: ${this.#p} -> ${e}`);const t=this.#f;let r=null;if(-1!==this.#p&&this.#m.length>0)try{r=this.#_()}catch(e){}this.#p=e,this.emit("trackChange",this.#p),t&&(async()=>{try{r&&await r.stop(),-1!==this.#p&&await this.play()}catch(e){this.log("error","Background transition error on index update:",e),console.warn("[TinyMediaPlayer] Background transition error on index update:",e)}})()}get loopMode(){return M(this.#l),this.#c}set loopMode(e){M(this.#l);const t=["NONE","TRACK","PLAYLIST"];if(!t.includes(e))throw new TypeError(`Loop mode must be one of: ${t.join(", ")}.`);this.#c=e,this.log("info",`Loop mode changed to: ${this.#c}`),this.emit("loopModeChange",this.#c)}get isRandom(){return M(this.#l),this.#y}set isRandom(e){if(M(this.#l),"boolean"!=typeof e)throw new TypeError("Random mode state must be a boolean.");this.#y=e,this.log("info",`Random mode: ${this.#y}`),this.emit("randomModeChange",this.#y)}get isPlaying(){return M(this.#l),this.#f}get volume(){return M(this.#l),this.#w}set volume(e){if(M(this.#l),"number"!=typeof e)throw new TypeError("Volume must be a number.");if(e<0||e>1)throw new RangeError("Volume must be tightly constrained between 0.0 and 1.0.");if(this.#A&&this.#A.abort(),this.log("info",`Volume changed: ${this.#w} -> ${e}`),this.#w=e,this.#P(),this.emit("volumeChange",this.#w),-1!==this.#p&&this.#m.length>0)try{const e=this.#_();e&&e.setVolume(this.#w)}catch(e){}}get persistVolume(){return M(this.#l),this.#b}set persistVolume(e){if(M(this.#l),"boolean"!=typeof e)throw new TypeError("Persist volume parameter must be a boolean.");this.#b=e,this.log("info",`Persist volume: ${this.#b}`),e&&this.#P()}get volumeStorageKey(){return M(this.#l),this.#v}set volumeStorageKey(e){if(M(this.#l),"string"!=typeof e)throw new TypeError("Volume storage key must be a string.");if(""===e.trim())throw new TypeError("Volume storage key cannot be an empty string.");const t=this.#v;this.#v=e;try{this.#b&&"undefined"!=typeof window&&window.localStorage&&(window.localStorage.removeItem(t),this.#P())}catch(e){console.warn("[TinyMediaPlayer] Failed to migrate volume storage key.",e)}}get isMuted(){return M(this.#l),this.#g}async mute(){M(this.#l);const e=this.#_();e&&(await e.mute(),this.#g=!0,this.emit("muteChange",this.#g),this.log("info","Playback muted successfully."))}async unMute(){M(this.#l);const e=this.#_();e&&(await e.unMute(),this.#g=!1,this.emit("muteChange",this.#g),this.log("info","Playback unmuted successfully."))}get adapters(){return Array.from(this.#u)}get adaptersSize(){return this.#u.size}static#O=["timeupdate","ended"];static get defaultAdapterEventNames(){return structuredClone(C.#O)}static set defaultAdapterEventNames(e){if(!Array.isArray(e)||!e.every(e=>"string"==typeof e))throw new TypeError("TinyMediaPlayer.defaultAdapterEventNames must be an array of strings.");C.#O=[...e]}#V=new Set(C.defaultAdapterEventNames);#R(e){const t=this.#h.get(e);t&&(this.#V.forEach(r=>{const o=t.get(r);o&&e.off(r,o)}),t.clear(),this.#h.delete(e))}registerAdapter(e){if(M(this.#l),!(e instanceof k))throw new TypeError("Adapter must be an instance of BaseMediaAdapter.");this.log("info","Registering new adapter:",e);const t=new Map;this.#h.set(e,t),this.#V.forEach(t=>{this.#j(e,t)}),this.#u.add(e)}removeAdapter(e){if(M(this.#l),!(e instanceof k))throw new TypeError("Adapter must be an instance of BaseMediaAdapter.");return this.log("info","Removing adapter:",e),this.#R(e),this.#u.delete(e)}destroyAdapter(e){if(M(this.#l),!(e instanceof k))throw new TypeError("Adapter must be an instance of BaseMediaAdapter.");this.log("info","Destroying adapter:",e),this.#R(e);const t=this.#u.delete(e);return t&&e.destroy(),t}hasAdapter(e){if(M(this.#l),!(e instanceof k))throw new TypeError("Adapter must be an instance of BaseMediaAdapter.");return this.#u.has(e)}destroyAllAdapters(){M(this.#l),this.log("info","Destroying all adapters."),this.#u.forEach(e=>{this.#R(e),e.destroy()}),this.#u.clear()}clearAdapters(){M(this.#l),this.log("info","Clearing all adapters."),this.#u.forEach(e=>this.#R(e)),this.#u.clear()}getMediaAdapter(e){if(!s(e))throw new TypeError("Content must be a valid object.");for(const t of this.#u.values())if(t.canHandle(e))return t;return null}#_(){if(-1===this.#p||0===this.#m.length)return null;const e=this.#m[this.#p],t=this.getMediaAdapter(e);if(t)return t;const r=`No compatible adapter found for content ID: ${e.id}.`;throw this.log("error",r),new Error(r)}addAdapterEvent(e){if(M(this.#l),"string"!=typeof e)throw new TypeError("Event name must be a string.");this.#V.has(e)||(this.log("info",`Adding adapter event listener: ${e}`),this.#V.add(e),this.#u.forEach(t=>{this.#j(t,e)}))}removeAdapterEvent(e){if(M(this.#l),"string"!=typeof e)throw new TypeError("Event name must be a string.");this.#V.has(e)&&(this.log("info",`Removing adapter event listener: ${e}`),this.#V.delete(e),this.#u.forEach(t=>{this.#N(t,e)}))}resetAdapterEvents(){M(this.#l);const e=C.defaultAdapterEventNames,t=Array.from(this.#V);for(const r of t)e.includes(r)||this.removeAdapterEvent(r);for(const t of e)this.#V.has(t)||this.addAdapterEvent(t)}#j(e,t){const r=this.#h.get(e);if(!r)return;const o=(...e)=>{this.#l||("timeupdate"!==t&&this.log("debug",`Adapter event triggered: ${t}`,...e),this.emit(t,...e))};e.on(t,o),r.set(t,o)}#N(e,t){const r=this.#h.get(e);if(!r)return;const o=r.get(t);o&&(e.off(t,o),r.delete(t))}addTrack(e){if(M(this.#l),!s(e)||"string"!=typeof e.url)throw new TypeError("Track content must be a valid MediaContent object containing a URL.");const t={id:"",title:"",artist:"",url:"",duration:0,weight:1,...e};I(t);const r=this.#m.push(t);return this.log("info",`Track added. New length: ${r}`,t),-1===this.#p&&(this.#p=0,this.emit("trackChange",this.#p)),this.emit("playlistUpdate",this.playlist),r}existsTrack(e){if(M(this.#l),"number"!=typeof e)throw new TypeError("Index must be a number.");return e>=0&&e<this.#m.length}getTrack(e){if(M(this.#l),"number"!=typeof e)throw new TypeError("Index must be a number.");if(!this.existsTrack(e))throw new RangeError(`Index ${e} is out of bounds for the current playlist.`);return this.#m[e]}async removeTrack(e){if(M(this.#l),"number"!=typeof e)throw new TypeError("Index must be a number.");if(!this.existsTrack(e))throw new RangeError(`Index ${e} is out of bounds for the current playlist.`);this.log("info",`Removing track at index: ${e}`),e===this.#p?(await this.stop(),this.#m.splice(e,1),0===this.#m.length?this.#p=-1:this.#p>=this.#m.length&&(this.#p=0),this.emit("trackChange",this.#p)):(this.#m.splice(e,1),e<this.#p&&(this.#p-=1,this.emit("trackChange",this.#p))),this.emit("playlistUpdate",this.playlist)}searchTrack(e){if(M(this.#l),"string"!=typeof e&&"function"!=typeof e)throw new TypeError("Search query must be a string or a boolean evaluation function.");this.log("info","Searching playlist...",{query:e});const t=[];for(let r=0;r<this.#m.length;r++){const o=this.#m[r];let n=!1;if("function"==typeof e)n=Boolean(e(o));else{const t=e.toLowerCase(),r=o.title&&o.title.toLowerCase().includes(t),i=o.artist&&o.artist.toLowerCase().includes(t),s=o.album&&o.album.toLowerCase().includes(t);n=Boolean(r||i||s)}n&&t.push({track:o,index:r})}return this.log("info",`Search completed. Found ${t.length} results.`),t}async clearPlaylist(){M(this.#l),this.log("info","Clearing entire playlist."),await this.stop(),this.#m=[],this.#p=-1,this.emit("playlistUpdate",this.playlist),this.emit("trackChange",this.#p)}async play(){M(this.#l),this.log("info",`Attempting to play track at index: ${this.#p}`);const e=this.#_();if(e){this.#I?await this.#S(this.#w):e.setVolume(this.#w);try{await e.play(this.#m[this.#p]),this.#g&&await e.mute(),this.#f=!0,this.log("info","Playback started successfully."),this.emit("play",this.#p)}catch(e){throw this.log("error","Failed to play track:",e),e}}else this.log("error","Failed to play track:",`Active adapter not found for track at index ${this.#p}.`)}async pause(){M(this.#l),this.log("info","Attempting to pause playback.");const e=this.#_();e&&(this.#I&&await this.#S(0),await e.pause(),this.#f=!1,this.log("info","Playback paused."),this.emit("pause",this.#p))}async stop(){M(this.#l),this.log("info","Attempting to stop playback.");const e=this.#_();e&&(this.#x&&await this.#S(0),await e.stop(),this.#f=!1,this.log("info","Playback stopped."),this.emit("stop",this.#p))}async next(){if(M(this.#l),0!==this.#m.length){if(this.log("info","Next track requested."),await this.stop(),"TRACK"===this.#c)return this.log("info","Loop mode: TRACK. Repeating current track."),void await this.play();if(this.#y)this.#p=this._getWeightedRandomIndex(),this.log("info",`Random mode: Selected index ${this.#p}`);else{let e=this.#p+1;if(e>=this.#m.length){if("PLAYLIST"!==this.#c)return void this.log("info","End of playlist reached. Stopping.");e=0,this.log("info","Loop mode: PLAYLIST. Returning to start.")}this.#p=e}this.emit("trackChange",this.#p),await this.play()}}async prev(){if(M(this.#l),0!==this.#m.length){if(this.#E&&!this.#T)return this.log("info",'UX: Repeat current track on first "prev" click.'),this.#T=!0,this.#k&&clearTimeout(this.#k),this.#k=setTimeout(()=>{this.#T=!1,this.#k=null},2e3),await this.stop(),void await this.play();if(this.#k&&(clearTimeout(this.#k),this.#k=null),this.#T=!1,this.log("info","Previous track requested."),await this.stop(),this.#y)this.#p=this._getWeightedRandomIndex(),this.log("info",`Random mode: Selected index ${this.#p}`);else{let e=this.#p-1;if(e<0){if("PLAYLIST"!==this.#c)return void this.log("info","Start of playlist reached. Stopping.");e=this.#m.length-1,this.log("info","Loop mode: PLAYLIST. Returning to end.")}this.#p=e}this.emit("trackChange",this.#p),await this.play()}}async skipTo(e){if(M(this.#l),"number"!=typeof e)throw new TypeError("Index must be a number.");if(!this.existsTrack(e))throw new RangeError(`Index ${e} is out of bounds for the current playlist.`);this.log("info",`Skipping to index: ${e}`),await this.stop(),this.#p=e,this.emit("trackChange",this.#p),await this.play()}async seek(e){if(M(this.#l),"number"!=typeof e)throw new TypeError("Seek time must be a number in milliseconds.");if(e<0)throw new RangeError("Seek time cannot be negative.");this.log("info",`Seeking to: ${e}ms`);const t=this.#_();t&&(await t.seek(e),this.emit("seek",e))}async step(e){if(M(this.#l),"number"!=typeof e)throw new TypeError("Step amount must be a number in milliseconds.");this.log("info",`Stepping by: ${e}ms`);const t=this.#_();if(!t)return;let r=t.getCurrentTime()+e;r<0&&(r=0),await this.seek(r)}getCurrentTime(){M(this.#l);try{const e=this.#_();return e?e.getCurrentTime():0}catch{return 0}}getTotalDuration(){M(this.#l);try{const e=this.#_();return e?e.getTotalDuration():0}catch{return 0}}getRemainingTime(){M(this.#l);try{const e=this.#_();return e?e.getRemainingTime():0}catch{return 0}}getPlaybackPercentage(){M(this.#l);try{const e=this.#_();return e?e.getPlaybackPercentage():0}catch{return 0}}get isPaused(){M(this.#l);try{const e=this.#_();return!!e&&e.isPaused()}catch{return!1}}get isEnded(){M(this.#l);try{const e=this.#_();return!e||e.isEnded()}catch{return!0}}async getContentData(){M(this.#l);const e={id:"",createdAt:"",artistId:"",artistName:"",description:"",title:"",duration:0,avatar:"",url:""};try{const t=this.#_();return t?t.getContentData():e}catch{return e}}async waitIsReady(){M(this.#l);const e=this.#_();if(e)return e.waitIsReady()}async destroy(){if(!this.#l){this.log("info","Destroying TinyMediaPlayer instance.");try{this.#f&&await this.stop()}catch(e){this.log("error","Non-fatal error during playback termination:",e),console.warn("[TinyMediaPlayer] Non-fatal error during playback termination:",e)}this.#k&&clearTimeout(this.#k),this.#m=[],this.#p=-1,this.#f=!1,this.#T=!1,this.destroyAllAdapters(),this.removeAllListeners(),this.#V.clear(),this.#l=!0,this.emit("destroyed")}}}const L=C}};const t={};function r(o){const n=t[o];if(void 0!==n)return n.exports;const i=t[o]={exports:{}};return e[o](i,i.exports,r),i.exports}r.d=(e,t)=>{if(Array.isArray(t))for(var o=0;o<t.length;){var n=t[o++],i=t[o++];r.o(e,n)?0===i&&o++:0===i?Object.defineProperty(e,n,{enumerable:!0,value:t[o++]}):Object.defineProperty(e,n,{enumerable:!0,get:i})}else for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.cjs=e=>{const t={exports:{}};return e.call(t.exports,t,t.exports),t.exports};let o=r(314);window.TinyMediaPlayer=o.TinyMediaPlayer})();
@@ -1 +1 @@
1
- (()=>{"use strict";var e={700(e,t,n){n.d(t,{TinyNewWinEvents:()=>a});var r=n.cjs(function(e,t){var n,r="object"==typeof Reflect?Reflect:null,i=r&&"function"==typeof r.apply?r.apply:function(e,t,n){return Function.prototype.apply.call(e,t,n)};n=r&&"function"==typeof r.ownKeys?r.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var s=Number.isNaN||function(e){return e!=e};function o(){o.init.call(this)}e.exports=o,e.exports.once=function(e,t){return new Promise(function(n,r){function i(n){e.removeListener(t,s),r(n)}function s(){"function"==typeof e.removeListener&&e.removeListener("error",i),n([].slice.call(arguments))}y(e,t,s,{once:!0}),"error"!==t&&function(e,t){"function"==typeof e.on&&y(e,"error",t,{once:!0})}(e,i)})},o.EventEmitter=o,o.prototype._events=void 0,o.prototype._eventsCount=0,o.prototype._maxListeners=void 0;var a=10;function h(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function u(e){return void 0===e._maxListeners?o.defaultMaxListeners:e._maxListeners}function f(e,t,n,r){var i,s,o,a;if(h(n),void 0===(s=e._events)?(s=e._events=Object.create(null),e._eventsCount=0):(void 0!==s.newListener&&(e.emit("newListener",t,n.listener?n.listener:n),s=e._events),o=s[t]),void 0===o)o=s[t]=n,++e._eventsCount;else if("function"==typeof o?o=s[t]=r?[n,o]:[o,n]:r?o.unshift(n):o.push(n),(i=u(e))>0&&o.length>i&&!o.warned){o.warned=!0;var f=new Error("Possible EventEmitter memory leak detected. "+o.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");f.name="MaxListenersExceededWarning",f.emitter=e,f.type=t,f.count=o.length,a=f,console&&console.warn&&console.warn(a)}return e}function d(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function l(e,t,n){var r={fired:!1,wrapFn:void 0,target:e,type:t,listener:n},i=d.bind(r);return i.listener=n,r.wrapFn=i,i}function p(e,t,n){var r=e._events;if(void 0===r)return[];var i=r[t];return void 0===i?[]:"function"==typeof i?n?[i.listener||i]:[i]:n?function(e){for(var t=new Array(e.length),n=0;n<t.length;++n)t[n]=e[n].listener||e[n];return t}(i):c(i,i.length)}function v(e){var t=this._events;if(void 0!==t){var n=t[e];if("function"==typeof n)return 1;if(void 0!==n)return n.length}return 0}function c(e,t){for(var n=new Array(t),r=0;r<t;++r)n[r]=e[r];return n}function y(e,t,n,r){if("function"==typeof e.on)r.once?e.once(t,n):e.on(t,n);else{if("function"!=typeof e.addEventListener)throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof e);e.addEventListener(t,function i(s){r.once&&e.removeEventListener(t,i),n(s)})}}Object.defineProperty(o,"defaultMaxListeners",{enumerable:!0,get:function(){return a},set:function(e){if("number"!=typeof e||e<0||s(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");a=e}}),o.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},o.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||s(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this},o.prototype.getMaxListeners=function(){return u(this)},o.prototype.emit=function(e){for(var t=[],n=1;n<arguments.length;n++)t.push(arguments[n]);var r="error"===e,s=this._events;if(void 0!==s)r=r&&void 0===s.error;else if(!r)return!1;if(r){var o;if(t.length>0&&(o=t[0]),o instanceof Error)throw o;var a=new Error("Unhandled error."+(o?" ("+o.message+")":""));throw a.context=o,a}var h=s[e];if(void 0===h)return!1;if("function"==typeof h)i(h,this,t);else{var u=h.length,f=c(h,u);for(n=0;n<u;++n)i(f[n],this,t)}return!0},o.prototype.addListener=function(e,t){return f(this,e,t,!1)},o.prototype.on=o.prototype.addListener,o.prototype.prependListener=function(e,t){return f(this,e,t,!0)},o.prototype.once=function(e,t){return h(t),this.on(e,l(this,e,t)),this},o.prototype.prependOnceListener=function(e,t){return h(t),this.prependListener(e,l(this,e,t)),this},o.prototype.removeListener=function(e,t){var n,r,i,s,o;if(h(t),void 0===(r=this._events))return this;if(void 0===(n=r[e]))return this;if(n===t||n.listener===t)0===--this._eventsCount?this._events=Object.create(null):(delete r[e],r.removeListener&&this.emit("removeListener",e,n.listener||t));else if("function"!=typeof n){for(i=-1,s=n.length-1;s>=0;s--)if(n[s]===t||n[s].listener===t){o=n[s].listener,i=s;break}if(i<0)return this;0===i?n.shift():function(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}(n,i),1===n.length&&(r[e]=n[0]),void 0!==r.removeListener&&this.emit("removeListener",e,o||t)}return this},o.prototype.off=o.prototype.removeListener,o.prototype.removeAllListeners=function(e){var t,n,r;if(void 0===(n=this._events))return this;if(void 0===n.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==n[e]&&(0===--this._eventsCount?this._events=Object.create(null):delete n[e]),this;if(0===arguments.length){var i,s=Object.keys(n);for(r=0;r<s.length;++r)"removeListener"!==(i=s[r])&&this.removeAllListeners(i);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(t=n[e]))this.removeListener(e,t);else if(void 0!==t)for(r=t.length-1;r>=0;r--)this.removeListener(e,t[r]);return this},o.prototype.listeners=function(e){return p(this,e,!0)},o.prototype.rawListeners=function(e){return p(this,e,!1)},o.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):v.call(e,t)},o.prototype.listenerCount=v,o.prototype.eventNames=function(){return this._eventsCount>0?n(this._events):[]}});const i=e=>{if(e)throw new Error("This TinyNewWinEvents instance has been destroyed and can no longer be used.")};const s=new WeakMap;class o extends r.EventEmitter{#e;#t;#n=[];#r=!1;#i=!1;#s=null;#o="__TNE_READY__";#a="__TNE_ROUTE__";#h=!1;get destroyed(){return this.#h}get readyEventName(){return i(this.#h),this.#o}set readyEventName(e){if(i(this.#h),"string"!=typeof e)throw new TypeError("TinyNewWinEvents: readyEventName must be a string.");this.#o=e}get routeEventName(){return i(this.#h),this.#a}set routeEventName(e){if(i(this.#h),"string"!=typeof e)throw new TypeError("TinyNewWinEvents: routeEventName must be a string.");this.#a=e}constructor({targetOrigin:e,url:t,name:n,features:r}={}){if(super(),"string"==typeof n&&"_blank"===n)throw new Error('TinyNewWinEvents: The window name "_blank" is not supported. Please use a custom name to allow tracking.');if(void 0!==e&&"string"!=typeof e)throw new TypeError('TinyNewWinEvents: The "targetOrigin" option must be a string.');if(void 0!==t&&"string"!=typeof t)throw new TypeError('TinyNewWinEvents: The "url" option must be a string.');if(void 0!==r&&"string"!=typeof r)throw new TypeError('TinyNewWinEvents: The "features" option must be a string if provided.');if(void 0===t?this.#e=window.opener:(this.#e="string"==typeof t?window.open(t,n,r):t,this.#i=!0),!this.#e||s.has(this.#e))throw new Error("Invalid or duplicate window reference.");this.#t=e??window.location.origin,this._handleMessage=this.#u.bind(this),window.addEventListener("message",this._handleMessage,!1),this.#i||(this.#f(this.#o,null),this.#d())}getWin(){return i(this.#h),this.#e}#u(e){if(!e.source||this.#e&&e.source!==this.#e)return;const{type:t,route:n,payload:r}=e.data||{};if(t===this.#o)return this.#r=!0,this.#l(),this.#d(),void(this.#i&&this.#f(this.#o,null));t===this.#a&&this.emit(`win:${n}`,r,e)}#l(){for(;this.#n.length;){const e=this.#n.shift();if(e){const{route:t,payload:n}=e;this.winEmit(t,n)}}}#f(e,t,n=""){this.#e&&this.#e.closed||this.#e?.postMessage({type:e,route:n,payload:t},this.#t)}close(){if(i(this.#h),!this.#i)throw new Error("Only host can close the window.");this.#e&&!this.#e.closed&&this.#e.close()}winEmit(e,t){if(i(this.#h),"string"!=typeof e)throw new TypeError("Event name must be a string.");if(this.isDestroyed())throw new Error("Cannot emit: instance has been destroyed.");this.#r?this.#f(this.#a,t,e):this.#n.push({route:e,payload:t})}isConnected(){return i(this.#h),!(!this.#r||!this.#e||this.#e.closed)}#d(){this.#e&&!this.#s&&(this.#s=setInterval(()=>{this.#e?.closed&&(this.emit("WINDOW_REF_CLOSED"),this.destroy())},500),s.set(this.#e,this.#s))}onClose(e){i(this.#h),this.on("WINDOW_REF_CLOSED",e)}offClose(e){i(this.#h),this.off("WINDOW_REF_CLOSED",e)}isDestroyed(){return!this.#e}destroy(){this.#e&&(this.#s&&(clearInterval(this.#s),this.#s=null,s.delete(this.#e)),window.removeEventListener("message",this._handleMessage),this.#n=[],this.#r=!1,this.#e=null,this.removeAllListeners(),this.#h=!0)}}const a=o}};const t={};function n(r){const i=t[r];if(void 0!==i)return i.exports;const s=t[r]={exports:{}};return e[r](s,s.exports,n),s.exports}n.d=(e,t)=>{if(Array.isArray(t))for(var r=0;r<t.length;){var i=t[r++],s=t[r++];n.o(e,i)?0===s&&r++:0===s?Object.defineProperty(e,i,{enumerable:!0,value:t[r++]}):Object.defineProperty(e,i,{enumerable:!0,get:s})}else for(var i in t)n.o(t,i)&&!n.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.cjs=e=>{const t={exports:{}};return e.call(t.exports,t,t.exports),t.exports};let r=n(700);window.TinyNewWinEvents=r.TinyNewWinEvents})();
1
+ (()=>{"use strict";var e={208(e,t,n){n.d(t,{TinyNewWinEvents:()=>a});var r=n.cjs(function(e,t){var n,r="object"==typeof Reflect?Reflect:null,i=r&&"function"==typeof r.apply?r.apply:function(e,t,n){return Function.prototype.apply.call(e,t,n)};n=r&&"function"==typeof r.ownKeys?r.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var s=Number.isNaN||function(e){return e!=e};function o(){o.init.call(this)}e.exports=o,e.exports.once=function(e,t){return new Promise(function(n,r){function i(n){e.removeListener(t,s),r(n)}function s(){"function"==typeof e.removeListener&&e.removeListener("error",i),n([].slice.call(arguments))}y(e,t,s,{once:!0}),"error"!==t&&function(e,t){"function"==typeof e.on&&y(e,"error",t,{once:!0})}(e,i)})},o.EventEmitter=o,o.prototype._events=void 0,o.prototype._eventsCount=0,o.prototype._maxListeners=void 0;var a=10;function h(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function u(e){return void 0===e._maxListeners?o.defaultMaxListeners:e._maxListeners}function f(e,t,n,r){var i,s,o,a;if(h(n),void 0===(s=e._events)?(s=e._events=Object.create(null),e._eventsCount=0):(void 0!==s.newListener&&(e.emit("newListener",t,n.listener?n.listener:n),s=e._events),o=s[t]),void 0===o)o=s[t]=n,++e._eventsCount;else if("function"==typeof o?o=s[t]=r?[n,o]:[o,n]:r?o.unshift(n):o.push(n),(i=u(e))>0&&o.length>i&&!o.warned){o.warned=!0;var f=new Error("Possible EventEmitter memory leak detected. "+o.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");f.name="MaxListenersExceededWarning",f.emitter=e,f.type=t,f.count=o.length,a=f,console&&console.warn&&console.warn(a)}return e}function d(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function l(e,t,n){var r={fired:!1,wrapFn:void 0,target:e,type:t,listener:n},i=d.bind(r);return i.listener=n,r.wrapFn=i,i}function p(e,t,n){var r=e._events;if(void 0===r)return[];var i=r[t];return void 0===i?[]:"function"==typeof i?n?[i.listener||i]:[i]:n?function(e){for(var t=new Array(e.length),n=0;n<t.length;++n)t[n]=e[n].listener||e[n];return t}(i):c(i,i.length)}function v(e){var t=this._events;if(void 0!==t){var n=t[e];if("function"==typeof n)return 1;if(void 0!==n)return n.length}return 0}function c(e,t){for(var n=new Array(t),r=0;r<t;++r)n[r]=e[r];return n}function y(e,t,n,r){if("function"==typeof e.on)r.once?e.once(t,n):e.on(t,n);else{if("function"!=typeof e.addEventListener)throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof e);e.addEventListener(t,function i(s){r.once&&e.removeEventListener(t,i),n(s)})}}Object.defineProperty(o,"defaultMaxListeners",{enumerable:!0,get:function(){return a},set:function(e){if("number"!=typeof e||e<0||s(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");a=e}}),o.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},o.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||s(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this},o.prototype.getMaxListeners=function(){return u(this)},o.prototype.emit=function(e){for(var t=[],n=1;n<arguments.length;n++)t.push(arguments[n]);var r="error"===e,s=this._events;if(void 0!==s)r=r&&void 0===s.error;else if(!r)return!1;if(r){var o;if(t.length>0&&(o=t[0]),o instanceof Error)throw o;var a=new Error("Unhandled error."+(o?" ("+o.message+")":""));throw a.context=o,a}var h=s[e];if(void 0===h)return!1;if("function"==typeof h)i(h,this,t);else{var u=h.length,f=c(h,u);for(n=0;n<u;++n)i(f[n],this,t)}return!0},o.prototype.addListener=function(e,t){return f(this,e,t,!1)},o.prototype.on=o.prototype.addListener,o.prototype.prependListener=function(e,t){return f(this,e,t,!0)},o.prototype.once=function(e,t){return h(t),this.on(e,l(this,e,t)),this},o.prototype.prependOnceListener=function(e,t){return h(t),this.prependListener(e,l(this,e,t)),this},o.prototype.removeListener=function(e,t){var n,r,i,s,o;if(h(t),void 0===(r=this._events))return this;if(void 0===(n=r[e]))return this;if(n===t||n.listener===t)0===--this._eventsCount?this._events=Object.create(null):(delete r[e],r.removeListener&&this.emit("removeListener",e,n.listener||t));else if("function"!=typeof n){for(i=-1,s=n.length-1;s>=0;s--)if(n[s]===t||n[s].listener===t){o=n[s].listener,i=s;break}if(i<0)return this;0===i?n.shift():function(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}(n,i),1===n.length&&(r[e]=n[0]),void 0!==r.removeListener&&this.emit("removeListener",e,o||t)}return this},o.prototype.off=o.prototype.removeListener,o.prototype.removeAllListeners=function(e){var t,n,r;if(void 0===(n=this._events))return this;if(void 0===n.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==n[e]&&(0===--this._eventsCount?this._events=Object.create(null):delete n[e]),this;if(0===arguments.length){var i,s=Object.keys(n);for(r=0;r<s.length;++r)"removeListener"!==(i=s[r])&&this.removeAllListeners(i);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(t=n[e]))this.removeListener(e,t);else if(void 0!==t)for(r=t.length-1;r>=0;r--)this.removeListener(e,t[r]);return this},o.prototype.listeners=function(e){return p(this,e,!0)},o.prototype.rawListeners=function(e){return p(this,e,!1)},o.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):v.call(e,t)},o.prototype.listenerCount=v,o.prototype.eventNames=function(){return this._eventsCount>0?n(this._events):[]}});const i=e=>{if(e)throw new Error("This TinyNewWinEvents instance has been destroyed and can no longer be used.")};const s=new WeakMap;class o extends r.EventEmitter{#e;#t;#n=[];#r=!1;#i=!1;#s=null;#o="__TNE_READY__";#a="__TNE_ROUTE__";#h=!1;get destroyed(){return this.#h}get readyEventName(){return i(this.#h),this.#o}set readyEventName(e){if(i(this.#h),"string"!=typeof e)throw new TypeError("TinyNewWinEvents: readyEventName must be a string.");this.#o=e}get routeEventName(){return i(this.#h),this.#a}set routeEventName(e){if(i(this.#h),"string"!=typeof e)throw new TypeError("TinyNewWinEvents: routeEventName must be a string.");this.#a=e}constructor({targetOrigin:e,url:t,name:n,features:r}={}){if(super(),"string"==typeof n&&"_blank"===n)throw new Error('TinyNewWinEvents: The window name "_blank" is not supported. Please use a custom name to allow tracking.');if(void 0!==e&&"string"!=typeof e)throw new TypeError('TinyNewWinEvents: The "targetOrigin" option must be a string.');if(void 0!==t&&"string"!=typeof t)throw new TypeError('TinyNewWinEvents: The "url" option must be a string.');if(void 0!==r&&"string"!=typeof r)throw new TypeError('TinyNewWinEvents: The "features" option must be a string if provided.');if(void 0===t?this.#e=window.opener:(this.#e="string"==typeof t?window.open(t,n,r):t,this.#i=!0),!this.#e||s.has(this.#e))throw new Error("Invalid or duplicate window reference.");this.#t=e??window.location.origin,this._handleMessage=this.#u.bind(this),window.addEventListener("message",this._handleMessage,!1),this.#i||(this.#f(this.#o,null),this.#d())}getWin(){return i(this.#h),this.#e}#u(e){if(!e.source||this.#e&&e.source!==this.#e)return;const{type:t,route:n,payload:r}=e.data||{};if(t===this.#o)return this.#r=!0,this.#l(),this.#d(),void(this.#i&&this.#f(this.#o,null));t===this.#a&&this.emit(`win:${n}`,r,e)}#l(){for(;this.#n.length;){const e=this.#n.shift();if(e){const{route:t,payload:n}=e;this.winEmit(t,n)}}}#f(e,t,n=""){this.#e&&this.#e.closed||this.#e?.postMessage({type:e,route:n,payload:t},this.#t)}close(){if(i(this.#h),!this.#i)throw new Error("Only host can close the window.");this.#e&&!this.#e.closed&&this.#e.close()}winEmit(e,t){if(i(this.#h),"string"!=typeof e)throw new TypeError("Event name must be a string.");if(this.isDestroyed())throw new Error("Cannot emit: instance has been destroyed.");this.#r?this.#f(this.#a,t,e):this.#n.push({route:e,payload:t})}isConnected(){return i(this.#h),!(!this.#r||!this.#e||this.#e.closed)}#d(){this.#e&&!this.#s&&(this.#s=setInterval(()=>{this.#e?.closed&&(this.emit("WINDOW_REF_CLOSED"),this.destroy())},500),s.set(this.#e,this.#s))}onClose(e){i(this.#h),this.on("WINDOW_REF_CLOSED",e)}offClose(e){i(this.#h),this.off("WINDOW_REF_CLOSED",e)}isDestroyed(){return!this.#e}destroy(){this.#e&&(this.#s&&(clearInterval(this.#s),this.#s=null,s.delete(this.#e)),window.removeEventListener("message",this._handleMessage),this.#n=[],this.#r=!1,this.#e=null,this.removeAllListeners(),this.#h=!0)}}const a=o}};const t={};function n(r){const i=t[r];if(void 0!==i)return i.exports;const s=t[r]={exports:{}};return e[r](s,s.exports,n),s.exports}n.d=(e,t)=>{if(Array.isArray(t))for(var r=0;r<t.length;){var i=t[r++],s=t[r++];n.o(e,i)?0===s&&r++:0===s?Object.defineProperty(e,i,{enumerable:!0,value:t[r++]}):Object.defineProperty(e,i,{enumerable:!0,get:s})}else for(var i in t)n.o(t,i)&&!n.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.cjs=e=>{const t={exports:{}};return e.call(t.exports,t,t.exports),t.exports};let r=n(208);window.TinyNewWinEvents=r.TinyNewWinEvents})();