@clickview/lite 0.35.0 → 0.35.2-dev.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (406) hide show
  1. package/dist/bundles.json +2 -2
  2. package/dist/css/{1980-lite-3c1d9a0bd8.chunk.css → 1201-lite-c31c094e0b.chunk.css} +1 -1
  3. package/dist/css/1426-lite-840995aa62.chunk.css +26 -0
  4. package/dist/css/{6702-lite-7caa0be777.chunk.css → 1461-lite-8a6d9f8005.chunk.css} +1 -1
  5. package/dist/css/{6822-lite-2c4dbd6721.chunk.css → 1514-lite-b377d8aad7.chunk.css} +1 -1
  6. package/dist/css/{5611-lite-0ad79a4f81.chunk.css → 1519-lite-8818fa8d4c.chunk.css} +1 -1
  7. package/dist/css/{9622-lite-23f29cce3d.chunk.css → 1688-lite-cbde295a12.chunk.css} +1 -1
  8. package/dist/css/1805-lite-971ea2bd5a.chunk.css +5 -0
  9. package/dist/css/{1820-lite-e06465f5de.chunk.css → 1820-lite-983fc2b64e.chunk.css} +1 -1
  10. package/dist/css/{6154-lite-9de6d937cb.chunk.css → 2408-lite-d788a06bf3.chunk.css} +1 -1
  11. package/dist/css/{7564-lite-d60de6c7e1.chunk.css → 2469-lite-7a8e220d2f.chunk.css} +1 -1
  12. package/dist/css/{9522-lite-3c1d9a0bd8.chunk.css → 2651-lite-c31c094e0b.chunk.css} +1 -1
  13. package/dist/css/{9869-lite-baa5f27c85.chunk.css → 2703-lite-c11aaae4be.chunk.css} +6 -3
  14. package/dist/css/2819-lite-1ebce7bdcf.chunk.css +6 -0
  15. package/dist/css/{4373-lite-70e0bc4a9c.chunk.css → 3311-lite-8f53694323.chunk.css} +1 -1
  16. package/dist/css/{7286-lite-871baa523e.chunk.css → 3401-lite-0b8496b169.chunk.css} +2 -2
  17. package/dist/css/{817-lite-d4b875a3bb.chunk.css → 4210-lite-5f2e12e28a.chunk.css} +1 -1
  18. package/dist/css/{3755-lite-0da0cc9d62.chunk.css → 4463-lite-b9b1686d14.chunk.css} +1 -1
  19. package/dist/css/{6957-lite-d486456f1e.chunk.css → 4546-lite-3d08e5e8c2.chunk.css} +1 -1
  20. package/dist/css/{5151-lite-d4ae59eb2d.chunk.css → 4728-lite-be5b495f2e.chunk.css} +1 -1
  21. package/dist/css/487-lite-96ad0f943f.chunk.css +5 -0
  22. package/dist/css/{8095-lite-814daf86d6.chunk.css → 4956-lite-12f53a63d0.chunk.css} +1 -1
  23. package/dist/css/{4405-lite-d4ae59eb2d.chunk.css → 5127-lite-be5b495f2e.chunk.css} +1 -1
  24. package/dist/css/{275-lite-4f19640eb7.chunk.css → 5306-lite-40a1dcaba5.chunk.css} +1 -1
  25. package/dist/css/536-lite-b8b24bff42.chunk.css +29 -0
  26. package/dist/css/5379-lite-b9ce6d4999.chunk.css +29 -0
  27. package/dist/css/5442-lite-5b422a19e4.chunk.css +4 -0
  28. package/dist/css/{5659-lite-0ad79a4f81.chunk.css → 5965-lite-8818fa8d4c.chunk.css} +1 -1
  29. package/dist/css/{1366-lite-69969922c3.chunk.css → 6683-lite-bfbd8a654d.chunk.css} +1 -1
  30. package/dist/css/6746-lite-cbacfd109f.chunk.css +1 -0
  31. package/dist/css/7167-lite-e7bc934b47.chunk.css +5 -0
  32. package/dist/css/7178-lite-d470e2a870.chunk.css +3 -0
  33. package/dist/css/{9714-lite-ac0b76a84c.chunk.css → 757-lite-649ce0643d.chunk.css} +1 -1
  34. package/dist/css/{5555-lite-0ad79a4f81.chunk.css → 763-lite-8818fa8d4c.chunk.css} +1 -1
  35. package/dist/css/{7701-lite-6d26cc737a.chunk.css → 7679-lite-66e1f0dc57.chunk.css} +1 -0
  36. package/dist/css/{1944-lite-6cd5066b84.chunk.css → 7726-lite-25438ca851.chunk.css} +1 -0
  37. package/dist/css/7791-lite-afbd54454d.chunk.css +7 -0
  38. package/dist/css/7864-lite-eaa787cfb2.chunk.css +3 -0
  39. package/dist/css/7877-lite-753ceb57d9.chunk.css +7 -0
  40. package/dist/css/8296-lite-1e63b6b5d8.chunk.css +6 -0
  41. package/dist/css/{5171-lite-67352d5f48.chunk.css → 8364-lite-8c45fd1bcc.chunk.css} +1 -1
  42. package/dist/css/{6076-lite-26ebfc882b.chunk.css → 8469-lite-bc1a27e4da.chunk.css} +1 -1
  43. package/dist/css/{1781-lite-62db879d64.chunk.css → 8541-lite-0f6c636afb.chunk.css} +1 -1
  44. package/dist/css/{3987-lite-26ebfc882b.chunk.css → 9133-lite-bc1a27e4da.chunk.css} +1 -1
  45. package/dist/css/9230-lite-5010e72da6.chunk.css +4 -0
  46. package/dist/css/{3446-lite-1b1ec87a28.chunk.css → 9251-lite-3c8ef33419.chunk.css} +2 -2
  47. package/dist/css/{7164-lite-4424261809.chunk.css → 9516-lite-4751b1e0aa.chunk.css} +5 -5
  48. package/dist/css/{4145-lite-10dcae6491.chunk.css → 9704-lite-60ead9f8df.chunk.css} +1 -1
  49. package/dist/css/{519-lite-e5eb6a5c45.chunk.css → 9719-lite-f28f11cc5a.chunk.css} +2 -1
  50. package/dist/css/{7484-lite-bef9094c58.chunk.css → 9871-lite-71a39d9bb3.chunk.css} +1 -1
  51. package/dist/css/{lite-app-df99273901.css → lite-app-ddb4f64bbb.css} +7 -7
  52. package/dist/languages/en.json +1 -1
  53. package/dist/scripts/{1980-535747e896-lite.chunk.js → 1201-c93ac8a29a-lite.chunk.js} +1 -1
  54. package/dist/scripts/1285-d2e1267792-lite.chunk.js +1 -0
  55. package/dist/scripts/1316-a4f3ec3b20-lite.chunk.js +1 -0
  56. package/dist/scripts/1426-94857a953c-lite.chunk.js +2 -0
  57. package/dist/scripts/{6702-7f040268d0-lite.chunk.js → 1461-f7e964ae21-lite.chunk.js} +1 -1
  58. package/dist/scripts/{6822-35fc1ff6f9-lite.chunk.js → 1514-c423b48155-lite.chunk.js} +1 -1
  59. package/dist/scripts/{1518-eaabe78385-lite.chunk.js → 1518-bed0a6528c-lite.chunk.js} +1 -1
  60. package/dist/scripts/1519-5df8482b24-lite.chunk.js +1 -0
  61. package/dist/scripts/{1526-eda6832e12-lite.chunk.js → 1526-93624f65f1-lite.chunk.js} +1 -1
  62. package/dist/scripts/1672-9ae25f79a6-lite.chunk.js +2 -0
  63. package/dist/scripts/{9622-365c5b0e22-lite.chunk.js → 1688-ca1a2a9f04-lite.chunk.js} +1 -1
  64. package/dist/scripts/1805-05413695af-lite.chunk.js +2 -0
  65. package/dist/scripts/1820-e2042d77dd-lite.chunk.js +1 -0
  66. package/dist/scripts/{1830-8741ff0b49-lite.chunk.js → 1830-95f21db5dc-lite.chunk.js} +1 -1
  67. package/dist/scripts/{1863-e2e84114ee-lite.chunk.js → 1863-0c5334f2c2-lite.chunk.js} +1 -1
  68. package/dist/scripts/1913-fef63b944b-lite.chunk.js +1 -0
  69. package/dist/scripts/1919-7860ed3158-lite.chunk.js +1 -0
  70. package/dist/scripts/209-f1187b4df2-lite.chunk.js +1 -0
  71. package/dist/scripts/{2118-4e769f5020-lite.chunk.js → 2118-7741e69919-lite.chunk.js} +1 -1
  72. package/dist/scripts/214-4053c37c3f-lite.chunk.js +1 -0
  73. package/dist/scripts/2188-0278da007c-lite.chunk.js +1 -0
  74. package/dist/scripts/2208-1799924a6a-lite.chunk.js +1 -0
  75. package/dist/scripts/2235-4a03aae86f-lite.chunk.js +1 -0
  76. package/dist/scripts/2251-519ee9915e-lite.chunk.js +1 -0
  77. package/dist/scripts/2269-aa5750345e-lite.chunk.js +1 -0
  78. package/dist/scripts/2279-d09cf05062-lite.chunk.js +1 -0
  79. package/dist/scripts/{2318-a0fc0fe177-lite.chunk.js → 2318-0eb533e9f6-lite.chunk.js} +1 -1
  80. package/dist/scripts/{6154-05e9ba5525-lite.chunk.js → 2408-04112a0ed3-lite.chunk.js} +1 -1
  81. package/dist/scripts/{7564-b42d4f59a6-lite.chunk.js → 2469-436887b1ed-lite.chunk.js} +1 -1
  82. package/dist/scripts/{9522-f6a3bf5aa5-lite.chunk.js → 2651-1323807150-lite.chunk.js} +1 -1
  83. package/dist/scripts/2703-b8b40c84ef-lite.chunk.js +2 -0
  84. package/dist/scripts/2819-a949173a2e-lite.chunk.js +2 -0
  85. package/dist/scripts/{287-3eba510d3a-lite.chunk.js → 287-c53e62a45c-lite.chunk.js} +1 -1
  86. package/dist/scripts/3012-cd7060bdc9-lite.chunk.js +1 -0
  87. package/dist/scripts/{3020-1f43870f76-lite.chunk.js → 3020-b05e9ea141-lite.chunk.js} +1 -1
  88. package/dist/scripts/3154-eb045d3ab6-lite.chunk.js +1 -0
  89. package/dist/scripts/3216-d62de73736-lite.chunk.js +1 -0
  90. package/dist/scripts/3311-808538c9c6-lite.chunk.js +1 -0
  91. package/dist/scripts/3401-4f2a173341-lite.chunk.js +1 -0
  92. package/dist/scripts/355-59bd6e899f-lite.chunk.js +1 -0
  93. package/dist/scripts/3645-d1313ec6dc-lite.chunk.js +2 -0
  94. package/dist/scripts/3654-0961346057-lite.chunk.js +1 -0
  95. package/dist/scripts/3667-6ce2b5b14a-lite.chunk.js +2 -0
  96. package/dist/scripts/3728-51b81bfa83-lite.chunk.js +1 -0
  97. package/dist/scripts/3836-5487914e10-lite.chunk.js +1 -0
  98. package/dist/scripts/3848-b85b763432-lite.chunk.js +1 -0
  99. package/dist/scripts/3962-3738b0a52e-lite.chunk.js +1 -0
  100. package/dist/scripts/3966-80e9cd7a87-lite.chunk.js +1 -0
  101. package/dist/scripts/{4032-ad48f98700-lite.chunk.js → 4032-01f86c1e49-lite.chunk.js} +1 -1
  102. package/dist/scripts/407-1e3ffc6e32-lite.chunk.js +2 -0
  103. package/dist/scripts/414-50eeedf502-lite.chunk.js +1 -0
  104. package/dist/scripts/4210-dcf489c86f-lite.chunk.js +1 -0
  105. package/dist/scripts/4393-56a2324cff-lite.chunk.js +1 -0
  106. package/dist/scripts/4436-2615b1ce10-lite.chunk.js +1 -0
  107. package/dist/scripts/4441-372ecffa04-lite.chunk.js +2 -0
  108. package/dist/scripts/{3755-6ed23bfa7a-lite.chunk.js → 4463-7a07bc54f0-lite.chunk.js} +1 -1
  109. package/dist/scripts/4537-34124b109e-lite.chunk.js +1 -0
  110. package/dist/scripts/4546-a3452a1fd5-lite.chunk.js +1 -0
  111. package/dist/scripts/4612-60a22d0dd6-lite.chunk.js +1 -0
  112. package/dist/scripts/4617-940157b232-lite.chunk.js +1 -0
  113. package/dist/scripts/4632-450e2f3cf2-lite.chunk.js +1 -0
  114. package/dist/scripts/4676-9295ffc870-lite.chunk.js +2 -0
  115. package/dist/scripts/{4690-b7b01cea5f-lite.chunk.js → 4690-a714a10250-lite.chunk.js} +1 -1
  116. package/dist/scripts/{5151-28b95c9098-lite.chunk.js → 4728-8837108457-lite.chunk.js} +1 -1
  117. package/dist/scripts/{4753-d8e01a7af9-lite.chunk.js → 4753-e9cd640ceb-lite.chunk.js} +1 -1
  118. package/dist/scripts/487-55f69c7d70-lite.chunk.js +2 -0
  119. package/dist/scripts/4956-b0840f1cfa-lite.chunk.js +1 -0
  120. package/dist/scripts/5041-2af2a2541f-lite.chunk.js +1 -0
  121. package/dist/scripts/{5143-56be0b0492-lite.chunk.js → 5143-8ad2cd9a86-lite.chunk.js} +1 -1
  122. package/dist/scripts/5177-ea01e21af3-lite.chunk.js +2 -0
  123. package/dist/scripts/5271-da40b4f079-lite.chunk.js +1 -1
  124. package/dist/scripts/528-8cfebb9254-lite.chunk.js +1 -0
  125. package/dist/scripts/5306-b25542939f-lite.chunk.js +1 -0
  126. package/dist/scripts/536-7c7970277a-lite.chunk.js +2 -0
  127. package/dist/scripts/5379-95b5e191fe-lite.chunk.js +1 -0
  128. package/dist/scripts/5442-82e8147edc-lite.chunk.js +2 -0
  129. package/dist/scripts/5940-875bf13577-lite.chunk.js +1 -0
  130. package/dist/scripts/5965-ba2cf10fc0-lite.chunk.js +1 -0
  131. package/dist/scripts/5974-9d5df057b3-lite.chunk.js +1 -0
  132. package/dist/scripts/5986-6f6b2bdf89-lite.chunk.js +1 -0
  133. package/dist/scripts/6086-642813efbe-lite.chunk.js +2 -0
  134. package/dist/scripts/615-20af1b2df5-lite.chunk.js +1 -0
  135. package/dist/scripts/{6274-f3769a7518-lite.chunk.js → 6274-7545674bdd-lite.chunk.js} +1 -1
  136. package/dist/scripts/6290-b8e7be07c0-lite.chunk.js +1 -0
  137. package/dist/scripts/6330-34349d1457-lite.chunk.js +1 -0
  138. package/dist/scripts/6347-5fa92cd82e-lite.chunk.js +1 -0
  139. package/dist/scripts/6368-91be19eabb-lite.chunk.js +1 -0
  140. package/dist/scripts/{6433-7b2bd48f40-lite.chunk.js → 6433-8a473c7c44-lite.chunk.js} +2 -2
  141. package/dist/scripts/6532-19e258fc3e-lite.chunk.js +1 -0
  142. package/dist/scripts/6572-d500d16bea-lite.chunk.js +1 -0
  143. package/dist/scripts/6683-6a53507e03-lite.chunk.js +2 -0
  144. package/dist/scripts/6746-a32d22602e-lite.chunk.js +1 -0
  145. package/dist/scripts/6801-30961910e4-lite.chunk.js +1 -0
  146. package/dist/scripts/6823-ca63f0d5eb-lite.chunk.js +2 -0
  147. package/dist/scripts/689-165a5a700c-lite.chunk.js +1 -0
  148. package/dist/scripts/6891-8f643cb84b-lite.chunk.js +1 -0
  149. package/dist/scripts/6896-e0f3a08bf2-lite.chunk.js +2 -0
  150. package/dist/scripts/6930-91a3463106-lite.chunk.js +1 -0
  151. package/dist/scripts/6998-43af06b2d9-lite.chunk.js +1 -0
  152. package/dist/scripts/7017-5eb39ba9d6-lite.chunk.js +2 -0
  153. package/dist/scripts/7052-aeeed6bc6d-lite.chunk.js +2 -0
  154. package/dist/scripts/7052-aeeed6bc6d-lite.chunk.js.LICENSE.txt +1 -0
  155. package/dist/scripts/{7056-6d3a7715c8-lite.chunk.js → 7056-b2c401e297-lite.chunk.js} +1 -1
  156. package/dist/scripts/{7072-e5581f0660-lite.chunk.js → 7072-1cf02994dd-lite.chunk.js} +2 -2
  157. package/dist/scripts/7072-1cf02994dd-lite.chunk.js.LICENSE.txt +1 -0
  158. package/dist/scripts/7112-02e4fa8fd1-lite.chunk.js +2 -0
  159. package/dist/scripts/7112-02e4fa8fd1-lite.chunk.js.LICENSE.txt +1 -0
  160. package/dist/scripts/7115-0b2f29dca8-lite.chunk.js +1 -0
  161. package/dist/scripts/7117-a7ffb9474e-lite.chunk.js +1 -0
  162. package/dist/scripts/714-bb31ad5ca8-lite.chunk.js +1 -0
  163. package/dist/scripts/7167-9a5391a56e-lite.chunk.js +1 -0
  164. package/dist/scripts/7178-d9ec32d7d3-lite.chunk.js +1 -0
  165. package/dist/scripts/7205-1852c97c81-lite.chunk.js +1 -0
  166. package/dist/scripts/{7221-d71ae05428-lite.chunk.js → 7221-f5d0743e30-lite.chunk.js} +2 -2
  167. package/dist/scripts/7221-f5d0743e30-lite.chunk.js.LICENSE.txt +1 -0
  168. package/dist/scripts/7288-3d3041485c-lite.chunk.js +1 -0
  169. package/dist/scripts/{7293-9edf8dab3b-lite.chunk.js → 7293-026c162545-lite.chunk.js} +1 -1
  170. package/dist/scripts/7506-75116824b9-lite.chunk.js +1 -0
  171. package/dist/scripts/{7540-2694a96451-lite.chunk.js → 7540-419fef286c-lite.chunk.js} +1 -1
  172. package/dist/scripts/{7555-3d6fa65b58-lite.chunk.js → 7555-e79e8614f1-lite.chunk.js} +1 -1
  173. package/dist/scripts/757-67c0765021-lite.chunk.js +1 -0
  174. package/dist/scripts/763-beed241551-lite.chunk.js +1 -0
  175. package/dist/scripts/{7701-3eb0dab472-lite.chunk.js → 7679-0155d80ba4-lite.chunk.js} +1 -1
  176. package/dist/scripts/{7703-58a0f0e91e-lite.chunk.js → 7703-2cc80445d8-lite.chunk.js} +1 -1
  177. package/dist/scripts/7726-6d5241cf36-lite.chunk.js +1 -0
  178. package/dist/scripts/7791-45cbec4cb9-lite.chunk.js +2 -0
  179. package/dist/scripts/7791-45cbec4cb9-lite.chunk.js.LICENSE.txt +1 -0
  180. package/dist/scripts/{7855-4598a122c5-lite.chunk.js → 7855-f51632f802-lite.chunk.js} +1 -1
  181. package/dist/scripts/7864-eb01ccb48c-lite.chunk.js +2 -0
  182. package/dist/scripts/7864-eb01ccb48c-lite.chunk.js.LICENSE.txt +1 -0
  183. package/dist/scripts/7877-b7427a8fc3-lite.chunk.js +2 -0
  184. package/dist/scripts/7877-b7427a8fc3-lite.chunk.js.LICENSE.txt +1 -0
  185. package/dist/scripts/8046-55ad30beea-lite.chunk.js +1 -0
  186. package/dist/scripts/8296-61fbedf389-lite.chunk.js +2 -0
  187. package/dist/scripts/8296-61fbedf389-lite.chunk.js.LICENSE.txt +1 -0
  188. package/dist/scripts/{8323-e7e2a0a948-lite.chunk.js → 8323-5d423659d5-lite.chunk.js} +1 -1
  189. package/dist/scripts/8323-5d423659d5-lite.chunk.js.LICENSE.txt +1 -0
  190. package/dist/scripts/{5171-4e637c7361-lite.chunk.js → 8364-7054d36da8-lite.chunk.js} +1 -1
  191. package/dist/scripts/8466-627dcf6218-lite.chunk.js +1 -0
  192. package/dist/scripts/{3987-8a8da439f0-lite.chunk.js → 8469-c872f52295-lite.chunk.js} +1 -1
  193. package/dist/scripts/{1781-a04e438477-lite.chunk.js → 8541-e93ccc1e65-lite.chunk.js} +1 -1
  194. package/dist/scripts/8759-46b3f7b560-lite.chunk.js +1 -0
  195. package/dist/scripts/8763-8fc868e00e-lite.chunk.js +1 -0
  196. package/dist/scripts/{8771-4530cc4e58-lite.chunk.js → 8771-fdb379457c-lite.chunk.js} +1 -1
  197. package/dist/scripts/8834-bb079c32a4-lite.chunk.js +1 -0
  198. package/dist/scripts/{8873-e305e24d04-lite.chunk.js → 8873-514feb8faa-lite.chunk.js} +1 -1
  199. package/dist/scripts/8905-7e47ba1360-lite.chunk.js +1 -0
  200. package/dist/scripts/{9016-e97d214ce1-lite.chunk.js → 9016-68a0088483-lite.chunk.js} +1 -1
  201. package/dist/scripts/9118-43d2bf9226-lite.chunk.js +1 -0
  202. package/dist/scripts/{6076-d0ab857b36-lite.chunk.js → 9133-d324adda28-lite.chunk.js} +1 -1
  203. package/dist/scripts/{9151-a4b1b99c42-lite.chunk.js → 9151-97d4bda2a9-lite.chunk.js} +1 -1
  204. package/dist/scripts/9226-81363cd855-lite.chunk.js +1 -0
  205. package/dist/scripts/9230-b5f75f4b25-lite.chunk.js +2 -0
  206. package/dist/scripts/9230-b5f75f4b25-lite.chunk.js.LICENSE.txt +1 -0
  207. package/dist/scripts/9242-02b00e644d-lite.chunk.js +1 -0
  208. package/dist/scripts/{3446-f4de03ea76-lite.chunk.js → 9251-c959bef104-lite.chunk.js} +1 -1
  209. package/dist/scripts/9433-17de94d578-lite.chunk.js +1 -0
  210. package/dist/scripts/{9478-6f19948322-lite.chunk.js → 9478-48fd914e48-lite.chunk.js} +2 -2
  211. package/dist/scripts/9478-48fd914e48-lite.chunk.js.LICENSE.txt +1 -0
  212. package/dist/scripts/9516-c47539c35b-lite.chunk.js +1 -0
  213. package/dist/scripts/9657-50adfc790f-lite.chunk.js +1 -0
  214. package/dist/scripts/9704-a3a54ec316-lite.chunk.js +1 -0
  215. package/dist/scripts/9719-c890a68331-lite.chunk.js +2 -0
  216. package/dist/scripts/9719-c890a68331-lite.chunk.js.LICENSE.txt +1 -0
  217. package/dist/scripts/{7484-f15261951b-lite.chunk.js → 9871-239c33690a-lite.chunk.js} +1 -1
  218. package/dist/scripts/{9894-1e493082b6-lite.chunk.js → 9894-0e66baa841-lite.chunk.js} +1 -1
  219. package/dist/scripts/9894-0e66baa841-lite.chunk.js.LICENSE.txt +1 -0
  220. package/dist/scripts/993-51d56e4686-lite.chunk.js +2 -0
  221. package/dist/scripts/993-51d56e4686-lite.chunk.js.LICENSE.txt +1 -0
  222. package/dist/scripts/bundle-0846da5fd2.min.js +2 -0
  223. package/jest.config.js +11 -11
  224. package/package.json +62 -61
  225. package/typings/libs/CVEvents.d.ts +12 -12
  226. package/typings/libs/CVLanguages.d.ts +24 -24
  227. package/typings/libs/cloneDeep.d.ts +4 -4
  228. package/typings/libs/cookiesjs.d.ts +25 -25
  229. package/typings/libs/draft-convert.d.ts +3 -3
  230. package/typings/libs/google-api.d.ts +93 -93
  231. package/typings/libs/intersection-observer.d.ts +82 -82
  232. package/typings/libs/microsoft-teams.d.ts +2 -2
  233. package/typings/libs/react-table-config.d.ts +138 -138
  234. package/typings/libs/trackjs.d.ts +2 -2
  235. package/typings/libs/videojs-contrib-quality-levels.d.ts +28 -28
  236. package/typings/utils/imports.d.ts +13 -13
  237. package/dist/css/109-lite-e638e5617a.chunk.css +0 -3
  238. package/dist/css/7178-lite-b4e4346f43.chunk.css +0 -3
  239. package/dist/css/8329-lite-1f86f27b10.chunk.css +0 -3
  240. package/dist/css/8978-lite-aa21368531.chunk.css +0 -3
  241. package/dist/scripts/109-c94f9ee532-lite.chunk.js +0 -1
  242. package/dist/scripts/1285-2d3299c556-lite.chunk.js +0 -1
  243. package/dist/scripts/1316-5123580c25-lite.chunk.js +0 -1
  244. package/dist/scripts/1366-e5b46ac15b-lite.chunk.js +0 -2
  245. package/dist/scripts/1517-9158f5a30a-lite.chunk.js +0 -1
  246. package/dist/scripts/1672-4ff30fe0d9-lite.chunk.js +0 -2
  247. package/dist/scripts/1820-d34eefdad4-lite.chunk.js +0 -1
  248. package/dist/scripts/1913-196e6dbf6e-lite.chunk.js +0 -1
  249. package/dist/scripts/1944-8faad6e742-lite.chunk.js +0 -1
  250. package/dist/scripts/209-03f1ffaa32-lite.chunk.js +0 -1
  251. package/dist/scripts/2208-8e54f2060f-lite.chunk.js +0 -1
  252. package/dist/scripts/2235-02fa6854c8-lite.chunk.js +0 -1
  253. package/dist/scripts/2269-48415bbc64-lite.chunk.js +0 -1
  254. package/dist/scripts/2279-02a72d36ec-lite.chunk.js +0 -1
  255. package/dist/scripts/2608-9d9eb7d113-lite.chunk.js +0 -1
  256. package/dist/scripts/2743-550d89b378-lite.chunk.js +0 -1
  257. package/dist/scripts/275-cfe76208a9-lite.chunk.js +0 -1
  258. package/dist/scripts/3012-cc96ee5265-lite.chunk.js +0 -1
  259. package/dist/scripts/3154-539a352006-lite.chunk.js +0 -1
  260. package/dist/scripts/3216-9caff8afdd-lite.chunk.js +0 -1
  261. package/dist/scripts/3371-bb9a674c07-lite.chunk.js +0 -1
  262. package/dist/scripts/3488-402969da0d-lite.chunk.js +0 -2
  263. package/dist/scripts/355-3eb0659bd4-lite.chunk.js +0 -1
  264. package/dist/scripts/3645-e68fabc894-lite.chunk.js +0 -2
  265. package/dist/scripts/3654-96999f107e-lite.chunk.js +0 -1
  266. package/dist/scripts/3667-289cb6db16-lite.chunk.js +0 -2
  267. package/dist/scripts/3706-e997fb8467-lite.chunk.js +0 -2
  268. package/dist/scripts/3728-8f767eeedd-lite.chunk.js +0 -1
  269. package/dist/scripts/3836-060f903a23-lite.chunk.js +0 -1
  270. package/dist/scripts/3848-a3b274c11c-lite.chunk.js +0 -1
  271. package/dist/scripts/3865-f7e73fec9c-lite.chunk.js +0 -1
  272. package/dist/scripts/3962-3dcedae047-lite.chunk.js +0 -1
  273. package/dist/scripts/3966-e4ad0f453d-lite.chunk.js +0 -1
  274. package/dist/scripts/4145-24137c0973-lite.chunk.js +0 -1
  275. package/dist/scripts/4373-d7d9c8effd-lite.chunk.js +0 -1
  276. package/dist/scripts/4393-bb6bbe6eb1-lite.chunk.js +0 -1
  277. package/dist/scripts/4417-1ef8363302-lite.chunk.js +0 -1
  278. package/dist/scripts/4436-b92639529d-lite.chunk.js +0 -1
  279. package/dist/scripts/4441-3d09d55849-lite.chunk.js +0 -2
  280. package/dist/scripts/4537-6383a3ea11-lite.chunk.js +0 -1
  281. package/dist/scripts/4612-cfc046e6e9-lite.chunk.js +0 -1
  282. package/dist/scripts/4617-94a4942af7-lite.chunk.js +0 -1
  283. package/dist/scripts/4632-ac71090d0d-lite.chunk.js +0 -1
  284. package/dist/scripts/5041-8e820ed93c-lite.chunk.js +0 -1
  285. package/dist/scripts/519-30f9dc5f0c-lite.chunk.js +0 -1
  286. package/dist/scripts/528-9a6deb93d3-lite.chunk.js +0 -1
  287. package/dist/scripts/5555-e3cdd91f35-lite.chunk.js +0 -1
  288. package/dist/scripts/5611-1eeee649ed-lite.chunk.js +0 -1
  289. package/dist/scripts/5659-176b355d0b-lite.chunk.js +0 -1
  290. package/dist/scripts/5974-8af9af8fae-lite.chunk.js +0 -1
  291. package/dist/scripts/5986-1e0b21c0d6-lite.chunk.js +0 -1
  292. package/dist/scripts/615-0322d641a3-lite.chunk.js +0 -1
  293. package/dist/scripts/6290-4f53628aac-lite.chunk.js +0 -1
  294. package/dist/scripts/6330-ff1a098eb1-lite.chunk.js +0 -1
  295. package/dist/scripts/6368-38cc77beda-lite.chunk.js +0 -1
  296. package/dist/scripts/6532-5bc872b460-lite.chunk.js +0 -1
  297. package/dist/scripts/6572-a77a3b657b-lite.chunk.js +0 -1
  298. package/dist/scripts/6609-5e0d55ee56-lite.chunk.js +0 -1
  299. package/dist/scripts/6725-6fe76436f5-lite.chunk.js +0 -1
  300. package/dist/scripts/6736-7223de888f-lite.chunk.js +0 -2
  301. package/dist/scripts/6801-fb5064f563-lite.chunk.js +0 -1
  302. package/dist/scripts/6823-b2eb2f9837-lite.chunk.js +0 -2
  303. package/dist/scripts/689-1c6a46496d-lite.chunk.js +0 -1
  304. package/dist/scripts/6896-8b4fc3fd6d-lite.chunk.js +0 -1
  305. package/dist/scripts/6930-9f739d475b-lite.chunk.js +0 -1
  306. package/dist/scripts/6957-691d6fbdc7-lite.chunk.js +0 -1
  307. package/dist/scripts/6998-1aa38379f3-lite.chunk.js +0 -1
  308. package/dist/scripts/7017-dc16719bf3-lite.chunk.js +0 -1
  309. package/dist/scripts/7052-d9ae572322-lite.chunk.js +0 -2
  310. package/dist/scripts/7112-25e9780c3f-lite.chunk.js +0 -2
  311. package/dist/scripts/7115-c73692fe3a-lite.chunk.js +0 -1
  312. package/dist/scripts/7117-1da2d8e101-lite.chunk.js +0 -1
  313. package/dist/scripts/714-676e0b469a-lite.chunk.js +0 -1
  314. package/dist/scripts/7164-9dec6a0e20-lite.chunk.js +0 -1
  315. package/dist/scripts/7178-a1115d825b-lite.chunk.js +0 -1
  316. package/dist/scripts/7205-20ace43ff9-lite.chunk.js +0 -1
  317. package/dist/scripts/7286-ba6c277af4-lite.chunk.js +0 -1
  318. package/dist/scripts/7288-8fca167593-lite.chunk.js +0 -1
  319. package/dist/scripts/7506-d91786f020-lite.chunk.js +0 -1
  320. package/dist/scripts/8046-1c2056961d-lite.chunk.js +0 -1
  321. package/dist/scripts/8095-ee8a101682-lite.chunk.js +0 -1
  322. package/dist/scripts/817-68aeef8671-lite.chunk.js +0 -1
  323. package/dist/scripts/8329-db3ca45cb6-lite.chunk.js +0 -2
  324. package/dist/scripts/8367-87790190cb-lite.chunk.js +0 -1
  325. package/dist/scripts/8466-2c58de04c4-lite.chunk.js +0 -1
  326. package/dist/scripts/8564-fbf34ea798-lite.chunk.js +0 -1
  327. package/dist/scripts/8759-d8e5c29a2e-lite.chunk.js +0 -1
  328. package/dist/scripts/8772-0cae662668-lite.chunk.js +0 -1
  329. package/dist/scripts/8905-039126dc2f-lite.chunk.js +0 -1
  330. package/dist/scripts/8978-2cb6319c36-lite.chunk.js +0 -2
  331. package/dist/scripts/9118-53bed185a5-lite.chunk.js +0 -1
  332. package/dist/scripts/9226-f59a8a5d53-lite.chunk.js +0 -1
  333. package/dist/scripts/9242-a9f54957c0-lite.chunk.js +0 -1
  334. package/dist/scripts/9581-41cb8eba5b-lite.chunk.js +0 -1
  335. package/dist/scripts/9714-f8d16adc4e-lite.chunk.js +0 -1
  336. package/dist/scripts/9869-601bc00f9b-lite.chunk.js +0 -2
  337. package/dist/scripts/bundle-6f143bc21b.min.js +0 -2
  338. /package/dist/css/{2743-lite-ab01f5dc3b.chunk.css → 1919-lite-ab01f5dc3b.chunk.css} +0 -0
  339. /package/dist/css/{6725-lite-db1dbcbd39.chunk.css → 414-lite-db1dbcbd39.chunk.css} +0 -0
  340. /package/dist/css/{3706-lite-8601f9a468.chunk.css → 5177-lite-8601f9a468.chunk.css} +0 -0
  341. /package/dist/css/{8367-lite-a3507f7491.chunk.css → 5940-lite-a3507f7491.chunk.css} +0 -0
  342. /package/dist/css/{3865-lite-a288188c68.chunk.css → 6891-lite-a288188c68.chunk.css} +0 -0
  343. /package/dist/css/{8772-lite-db1dbcbd39.chunk.css → 8763-lite-db1dbcbd39.chunk.css} +0 -0
  344. /package/dist/css/{6609-lite-08c053955f.chunk.css → 9657-lite-08c053955f.chunk.css} +0 -0
  345. /package/dist/scripts/{1366-e5b46ac15b-lite.chunk.js.LICENSE.txt → 1426-94857a953c-lite.chunk.js.LICENSE.txt} +0 -0
  346. /package/dist/scripts/{1672-4ff30fe0d9-lite.chunk.js.LICENSE.txt → 1672-9ae25f79a6-lite.chunk.js.LICENSE.txt} +0 -0
  347. /package/dist/scripts/{1725-082ef05b56-lite.chunk.js → 1725-0e284a32f3-lite.chunk.js} +0 -0
  348. /package/dist/scripts/{1750-dd4c1bf3fc-lite.chunk.js → 1750-82cf9361fb-lite.chunk.js} +0 -0
  349. /package/dist/scripts/{2118-4e769f5020-lite.chunk.js.LICENSE.txt → 1805-05413695af-lite.chunk.js.LICENSE.txt} +0 -0
  350. /package/dist/scripts/{1891-af9f943f4d-lite.chunk.js → 1891-dd253c3378-lite.chunk.js} +0 -0
  351. /package/dist/scripts/{3488-402969da0d-lite.chunk.js.LICENSE.txt → 2118-7741e69919-lite.chunk.js.LICENSE.txt} +0 -0
  352. /package/dist/scripts/{2452-446607a894-lite.chunk.js → 2452-f96e548d17-lite.chunk.js} +0 -0
  353. /package/dist/scripts/{3645-e68fabc894-lite.chunk.js.LICENSE.txt → 2703-b8b40c84ef-lite.chunk.js.LICENSE.txt} +0 -0
  354. /package/dist/scripts/{2767-5df93b7c43-lite.chunk.js → 2767-299f58bb17-lite.chunk.js} +0 -0
  355. /package/dist/scripts/{3667-289cb6db16-lite.chunk.js.LICENSE.txt → 2819-a949173a2e-lite.chunk.js.LICENSE.txt} +0 -0
  356. /package/dist/scripts/{3108-ae911e3d71-lite.chunk.js → 3108-86d4c73e29-lite.chunk.js} +0 -0
  357. /package/dist/scripts/{3171-663aa64cae-lite.chunk.js → 3171-9eda288c67-lite.chunk.js} +0 -0
  358. /package/dist/scripts/{3468-4d7076a979-lite.chunk.js → 3468-8926a9db70-lite.chunk.js} +0 -0
  359. /package/dist/scripts/{3706-e997fb8467-lite.chunk.js.LICENSE.txt → 3645-d1313ec6dc-lite.chunk.js.LICENSE.txt} +0 -0
  360. /package/dist/scripts/{4441-3d09d55849-lite.chunk.js.LICENSE.txt → 3667-6ce2b5b14a-lite.chunk.js.LICENSE.txt} +0 -0
  361. /package/dist/scripts/{389-e7037a0807-lite.chunk.js → 389-2ab260e7d2-lite.chunk.js} +0 -0
  362. /package/dist/scripts/{6433-7b2bd48f40-lite.chunk.js.LICENSE.txt → 407-1e3ffc6e32-lite.chunk.js.LICENSE.txt} +0 -0
  363. /package/dist/scripts/{4182-e9700be806-lite.chunk.js → 4182-6869dfda31-lite.chunk.js} +0 -0
  364. /package/dist/scripts/{6736-7223de888f-lite.chunk.js.LICENSE.txt → 4441-372ecffa04-lite.chunk.js.LICENSE.txt} +0 -0
  365. /package/dist/scripts/{4541-c08f765eab-lite.chunk.js → 4541-9ad274071e-lite.chunk.js} +0 -0
  366. /package/dist/scripts/{7052-d9ae572322-lite.chunk.js.LICENSE.txt → 4676-9295ffc870-lite.chunk.js.LICENSE.txt} +0 -0
  367. /package/dist/scripts/{482-8139ae4723-lite.chunk.js → 482-c9fd7b68d3-lite.chunk.js} +0 -0
  368. /package/dist/scripts/{7072-e5581f0660-lite.chunk.js.LICENSE.txt → 487-55f69c7d70-lite.chunk.js.LICENSE.txt} +0 -0
  369. /package/dist/scripts/{7112-25e9780c3f-lite.chunk.js.LICENSE.txt → 5177-ea01e21af3-lite.chunk.js.LICENSE.txt} +0 -0
  370. /package/dist/scripts/{5229-7329bd81e6-lite.chunk.js → 5229-fed729d13a-lite.chunk.js} +0 -0
  371. /package/dist/scripts/{7221-d71ae05428-lite.chunk.js.LICENSE.txt → 536-7c7970277a-lite.chunk.js.LICENSE.txt} +0 -0
  372. /package/dist/scripts/{5385-f53e603625-lite.chunk.js → 5385-2719aaaf84-lite.chunk.js} +0 -0
  373. /package/dist/scripts/{8323-e7e2a0a948-lite.chunk.js.LICENSE.txt → 5442-82e8147edc-lite.chunk.js.LICENSE.txt} +0 -0
  374. /package/dist/scripts/{5595-5ee4c1c5ed-lite.chunk.js → 5595-ed6e8d9ca0-lite.chunk.js} +0 -0
  375. /package/dist/scripts/{5606-404debcda3-lite.chunk.js → 5606-68f1afd060-lite.chunk.js} +0 -0
  376. /package/dist/scripts/{5877-d728cd98a7-lite.chunk.js → 5877-1dc9ca4f2d-lite.chunk.js} +0 -0
  377. /package/dist/scripts/{6057-a8b9812431-lite.chunk.js → 6057-3c43af21b1-lite.chunk.js} +0 -0
  378. /package/dist/scripts/{8329-db3ca45cb6-lite.chunk.js.LICENSE.txt → 6086-642813efbe-lite.chunk.js.LICENSE.txt} +0 -0
  379. /package/dist/scripts/{8978-2cb6319c36-lite.chunk.js.LICENSE.txt → 6433-8a473c7c44-lite.chunk.js.LICENSE.txt} +0 -0
  380. /package/dist/scripts/{6450-87b22756f6-lite.chunk.js → 6450-0bde4cef33-lite.chunk.js} +0 -0
  381. /package/dist/scripts/{6465-7a63bc80b6-lite.chunk.js → 6465-5b42f81416-lite.chunk.js} +0 -0
  382. /package/dist/scripts/{6480-3e17c41241-lite.chunk.js → 6480-93ab348bf1-lite.chunk.js} +0 -0
  383. /package/dist/scripts/{6604-19f0427fcc-lite.chunk.js → 6604-d331808398-lite.chunk.js} +0 -0
  384. /package/dist/scripts/{9478-6f19948322-lite.chunk.js.LICENSE.txt → 6683-6a53507e03-lite.chunk.js.LICENSE.txt} +0 -0
  385. /package/dist/scripts/{6689-ec5171ba5f-lite.chunk.js → 6689-65a1b86bb2-lite.chunk.js} +0 -0
  386. /package/dist/scripts/{6823-b2eb2f9837-lite.chunk.js.LICENSE.txt → 6823-ca63f0d5eb-lite.chunk.js.LICENSE.txt} +0 -0
  387. /package/dist/scripts/{6863-5dbc85c4b9-lite.chunk.js → 6863-d4f402b72e-lite.chunk.js} +0 -0
  388. /package/dist/scripts/{9869-601bc00f9b-lite.chunk.js.LICENSE.txt → 6896-e0f3a08bf2-lite.chunk.js.LICENSE.txt} +0 -0
  389. /package/dist/scripts/{9894-1e493082b6-lite.chunk.js.LICENSE.txt → 7017-5eb39ba9d6-lite.chunk.js.LICENSE.txt} +0 -0
  390. /package/dist/scripts/{7128-87b101d7b7-lite.chunk.js → 7128-bb219eed51-lite.chunk.js} +0 -0
  391. /package/dist/scripts/{7172-7dadcbf10c-lite.chunk.js → 7172-7710a90e85-lite.chunk.js} +0 -0
  392. /package/dist/scripts/{7338-e0306c666f-lite.chunk.js → 7338-a5d6a68d8e-lite.chunk.js} +0 -0
  393. /package/dist/scripts/{7432-337ec5be0e-lite.chunk.js → 7432-87ce1798ff-lite.chunk.js} +0 -0
  394. /package/dist/scripts/{7708-966b540945-lite.chunk.js → 7708-b642cddc03-lite.chunk.js} +0 -0
  395. /package/dist/scripts/{7715-b21edc60f0-lite.chunk.js → 7715-4f575c978b-lite.chunk.js} +0 -0
  396. /package/dist/scripts/{7818-c81c2d60b9-lite.chunk.js → 7818-a9ab33bdd4-lite.chunk.js} +0 -0
  397. /package/dist/scripts/{7925-c8cd8aace8-lite.chunk.js → 7925-29ca2fc37a-lite.chunk.js} +0 -0
  398. /package/dist/scripts/{8025-1982900b56-lite.chunk.js → 8025-0ef8f041ea-lite.chunk.js} +0 -0
  399. /package/dist/scripts/{8236-10fe50cf1f-lite.chunk.js → 8236-057a7f40db-lite.chunk.js} +0 -0
  400. /package/dist/scripts/{8830-16c2fd1319-lite.chunk.js → 8830-122c8ae807-lite.chunk.js} +0 -0
  401. /package/dist/scripts/{9016-e97d214ce1-lite.chunk.js.LICENSE.txt → 9016-68a0088483-lite.chunk.js.LICENSE.txt} +0 -0
  402. /package/dist/scripts/{9060-aea36d49b0-lite.chunk.js → 9060-c035711b40-lite.chunk.js} +0 -0
  403. /package/dist/scripts/{9455-283f477332-lite.chunk.js → 9455-c80c14ea98-lite.chunk.js} +0 -0
  404. /package/dist/scripts/{9674-25ccc9ee52-lite.chunk.js → 9674-f5e66f8c06-lite.chunk.js} +0 -0
  405. /package/dist/scripts/{9843-d084ed32bf-lite.chunk.js → 9843-07f0304cc4-lite.chunk.js} +0 -0
  406. /package/dist/scripts/{bundle-6f143bc21b.min.js.LICENSE.txt → bundle-0846da5fd2.min.js.LICENSE.txt} +0 -0
@@ -1,2 +0,0 @@
1
- /*! For license information please see 3706-e997fb8467-lite.chunk.js.LICENSE.txt */
2
- "use strict";(self.webpackChunk_clickview_lite=self.webpackChunk_clickview_lite||[]).push([[3706],{73758:(t,e,n)=>{function r(t){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},r(t)}function i(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,(void 0,o=function(t,e){if("object"!==r(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,"string");if("object"!==r(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(i.key),"symbol"===r(o)?o:String(o)),i)}var o}n.d(e,{n:()=>o});var o=new(function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.listeners={}}var e,n;return e=t,n=[{key:"subscribe",value:function(t,e){this.registerListener(t,e)}},{key:"subscribeOnce",value:function(t,e){this.registerListener(t,e,1)}},{key:"unsubscribe",value:function(t,e){this.deregisterListener(t,e)}},{key:"trigger",value:function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];this.triggerCallbacks(t,n)}},{key:"registerListener",value:function(t,e,n){var r;if("string"!=typeof t)throw new Error("Event name must be a string");if("function"!=typeof e)throw new Error("Event callback must be a function");if(n&&"number"!=typeof n)throw new Error("Execution limit must be a number or undefined");this.listeners[t]=null!==(r=this.listeners[t])&&void 0!==r?r:[],this.listeners[t].push({callback:e,executionLimit:n})}},{key:"deregisterListener",value:function(t,e){var n;if("string"!=typeof t)throw new Error("Event name must be a string");if(e&&"function"!=typeof e)throw new Error("Event callback must be a function");if(e){var r=null===(n=this.listeners[t])||void 0===n?void 0:n.findIndex((function(t){return t.callback===e}));"number"==typeof r&&-1!==r&&(this.listeners[t].splice(r,1),0===this.listeners[t].length&&delete this.listeners[t])}else this.listeners[t]=[]}},{key:"triggerCallbacks",value:function(t){for(var e=this,n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];if(this.listeners[t]){var o=[];this.listeners[t].forEach((function(t){var e,n;"number"==typeof t.executionLimit&&(t.executionCount=null!==(n=t.executionCount)&&void 0!==n?n:0,t.executionCount++,t.executionCount===t.executionLimit&&o.push(t.callback)),(e=t.callback).apply.apply(e,[null].concat(r))})),o.length&&o.forEach((function(n){return e.deregisterListener(t,n)}))}}}],n&&i(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),t}())},26733:(t,e,n)=>{n.d(e,{s:()=>P,R:()=>S});var r=n(32735),i=n(39202),o=n(97395),a=n(49985),s=n(65858),c=n(36848),u=n(78276),l=n(76177),f=n(71063),h=n(54610),p=n(4594),d=n(1164),y=n(79967),v=n(67453);const b={imageStyle:"I9E5O",item:"tqUFn",background:"s1dNr",thumbnailContainer:"EDiGi",teacherPack:"_tdVE",text:"g5NWS",hoverState:"xRYhX",atomGuide:"X39wU",studentActivity:"X9pMl",additionalMaterials:"qRVUo",userUploaded:"_18JaV",imageTypeResource:"KYtZL"};var g={width:200,resizeType:h.Nq.Cover};function m(t,e){var n,r,i;if("thumbnail"in e&&(null===(n=e.thumbnail)||void 0===n?void 0:n.url))return v.j.createUrl(null===(r=e.thumbnail)||void 0===r?void 0:r.url,Object.assign({},g));var a=o._.safeUrlConcat(t,"/v1/previews");return"metadata"in e?e.metadata.type===d.L.Pdf?v.j.createResourceImage(a,e.url,g):e.metadata.type===d.L.Image?v.j.createUrl(e.url,{size:h.h2.Medium,resizeType:h.Nq.Cover}):(null===(i=e.pdf)||void 0===i?void 0:i.url)?v.j.createResourceImage(a,e.pdf.url,g):(e.metadata.type,d.L.Zip,"/images/zip-resource.png"):v.j.createResourceImage(a,e.url,Object.assign({},g))}function w(t){var e;return"metadata"in t?t.metadata.type===d.L.Pdf?h.__.Pdf:t.metadata.type===d.L.Image?h.__.Thumbnails:(null===(e=t.pdf)||void 0===e?void 0:e.url)?h.__.Pdf:(t.metadata.type,d.L.Zip,h.__.Thumbnails):h.__.Link}function P(t){var e,n,i,o,a,c,f,h=null,p=0;"metadata"in t.data&&(h=t.data.metadata,p=null!==(i=null===(n=null===(e=t.data.thumbnail)||void 0===e?void 0:e.metadata)||void 0===n?void 0:n.rotation)&&void 0!==i?i:0);var y="".concat(null!==(a=null===(o=t.theme)||void 0===o?void 0:o.containerClass)&&void 0!==a?a:""," pt-3 px-3 rounded-3 d-flex flex-column align-items-center")+" justify-content-end ".concat(function(t){switch(t){case"atom-guide":return b.atomGuide;case"student-activity":return b.studentActivity;case"teacher-pack":return b.teacherPack;case"additional-materials":return b.additionalMaterials;default:return b.userUploaded}}(null==h?void 0:h.resourceType)," ").concat(b.background," ").concat(t.applyHoverState?b.hoverState:""," ");return r.createElement("div",{className:y},!t.hideHeading&&r.createElement(l.u,{title:t.data.name},r.createElement("h3",{className:"text-center text-break h5 mb-3 ".concat(b.text)},r.createElement("span",{className:"clamp-1"},t.data.name))),r.createElement("div",{className:"".concat(null!==(f=null===(c=t.theme)||void 0===c?void 0:c.thumbnailContainerClass)&&void 0!==f?f:""," w-75 overflow-hidden ").concat(b.thumbnailContainer," ").concat(b.imageStyle)},r.createElement(u.Z,{data:m(t.imageCdnUrl,t.data),imageType:w(t.data),imageStyle:{transform:"rotate(".concat(p,"deg)")},alt:t.data.name,analyticsOptions:{location:s.LZ.SlidingListItem},errorFallbackImageSrc:t.imageErrorFallbackUrl,imageClassName:(null==h?void 0:h.type)===d.L.Image?"".concat(b.imageTypeResource," ").concat(b.imageStyle):"",preload:t.preloadImage,preventLoad:!t.preloadImage})))}P.defaultProps={preloadImage:!0,actionBehaviour:"normal"};var S=r.memo((function(t){var e,n,o,u,l=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]])}return n}(t,[]),h=(e=t.data,n=t.actionBehaviour,u=(0,y.k)(),"public"===n||!u.xs&&!u.sm&&"resource"===e.type&&"metadata"in e&&(e.metadata.type===d.L.Image||(e.metadata.type===d.L.Pdf?!!e.url:!!(null===(o=e.pdf)||void 0===o?void 0:o.url)))),v=Object.assign(Object.assign({},t.analyticsData),t.data),g=Object.assign(Object.assign({},t.analyticsOptions),{actionType:s.Vw.Click,entity:t.data.typeId===p.E.Resource?s.py.Resource:s.py.Link});function m(){a.k.logUserAction(v,g)}var w,S=!!t.data.url;return l.applyHoverState=h||S,r.createElement("div",{className:"pt-1 px-1 flex-shrink-0 ".concat(b.item," ").concat(f.M.RESOURCE_ITEM_SELECTOR)},(w="d-block no-decoration","link"===t.data.type?r.createElement("a",{href:t.data.url,target:"_blank",className:w,onClick:m},r.createElement(P,Object.assign({},l))):h?"public"===t.actionBehaviour?r.createElement("div",{className:"".concat(w," cursor-pointer d-inline"),onClick:function(){m(),i.C$.trigger(t.getAppLink(t.data))}},r.createElement(P,Object.assign({},l))):r.createElement(c.F,{appLink:t.getAppLink(t.data),className:w,analyticsData:v,analyticsOptions:g},r.createElement(P,Object.assign({},l))):S?r.createElement("a",{href:t.data.url,className:w,onClick:m},r.createElement(P,Object.assign({},l))):r.createElement("div",{className:w},r.createElement(P,Object.assign({},l)))))}))},6274:(t,e,n)=>{n.r(e),n.d(e,{ClickViewPlayer:()=>er});var r=n(32735),i=n(51482),o=(n(16852),n(93861));function a(t){return a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},a(t)}function s(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,(void 0,i=function(t,e){if("object"!==a(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!==a(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(r.key),"symbol"===a(i)?i:String(i)),r)}var i}function c(){return c="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=l(t)););return t}(t,e);if(r){var i=Object.getOwnPropertyDescriptor(r,e);return i.get?i.get.call(arguments.length<3?t:n):i.value}},c.apply(this,arguments)}function u(t,e){return u=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},u(t,e)}function l(t){return l=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},l(t)}var f=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&u(t,e)}(f,t);var e,n,r,i,o=(r=f,i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=l(r);if(i){var n=l(this).constructor;t=Reflect.construct(e,arguments,n)}else t=e.apply(this,arguments);return function(t,e){if(e&&("object"===a(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(this,t)});function f(){var t;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,f),(t=o.apply(this,arguments)).alwaysCollapsed=!1,t.isCollapsed=!1,t.isCollabsible=!0,t}return e=f,(n=[{key:"buildCSSClass",value:function(){return"cv-create-clip-button"}},{key:"getCollabsibleName",value:function(){return this.controlText_}},{key:"getCollabsibleValue",value:function(){return""}},{key:"showInCollabsibleMenu",value:function(){return!0}},{key:"showCollapsibleMenu",value:function(){c(l(f.prototype),"handleClick",this).call(this,null)}}])&&s(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),f}(o.Z.getComponent("Button"));function h(t){return h="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},h(t)}function p(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,(void 0,i=function(t,e){if("object"!==h(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!==h(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(r.key),"symbol"===h(i)?i:String(i)),r)}var i}function d(t,e){return d=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},d(t,e)}function y(t){return y=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},y(t)}f.prototype.controlText_="Create Clip",o.Z.registerComponent("CreateClipButton",f);var v=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&d(t,e)}(a,t);var e,n,r,i,o=(r=a,i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=y(r);if(i){var n=y(this).constructor;t=Reflect.construct(e,arguments,n)}else t=e.apply(this,arguments);return function(t,e){if(e&&("object"===h(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(this,t)});function a(t,e){var n;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,a),(n=o.call(this,t,e)).options=e,t.ready((function(){return n.onReady()})),n}return e=a,(n=[{key:"onReady",value:function(){var t,e=this.player.getChild("collapserator"),n=null===(t=null==e?void 0:e.children())||void 0===t?void 0:t.findIndex((function(t){return"CustomControlSpacer"===t.name()}));n&&-1!==n&&e.addChild("CreateClipButton",{clickHandler:this.options.onClick},n+1)}}])&&p(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),a}(o.Z.getPlugin("plugin"));function b(t){return b="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},b(t)}function g(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,(void 0,i=function(t,e){if("object"!==b(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!==b(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(r.key),"symbol"===b(i)?i:String(i)),r)}var i}function m(t,e){return m=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},m(t,e)}function w(t){return w=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},w(t)}o.Z.registerPlugin("createClipButtonPlugin",v);var P=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&m(t,e)}(a,t);var e,n,r,i,o=(r=a,i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=w(r);if(i){var n=w(this).constructor;t=Reflect.construct(e,arguments,n)}else t=e.apply(this,arguments);return function(t,e){if(e&&("object"===b(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(this,t)});function a(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,a),o.apply(this,arguments)}return e=a,(n=[{key:"handlePictureInPictureEnabledChange",value:function(){this.enable()}}])&&g(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),a}(o.Z.getComponent("PictureInPictureToggle"));function S(t){return S="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},S(t)}function k(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,(void 0,i=function(t,e){if("object"!==S(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!==S(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(r.key),"symbol"===S(i)?i:String(i)),r)}var i}function O(){return O="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=E(t)););return t}(t,e);if(r){var i=Object.getOwnPropertyDescriptor(r,e);return i.get?i.get.call(arguments.length<3?t:n):i.value}},O.apply(this,arguments)}function j(t,e){return j=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},j(t,e)}function E(t){return E=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},E(t)}o.Z.registerComponent("PictureInPictureToggle",P);var C=o.Z.getComponent("PlayToggle"),x=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&j(t,e)}(a,t);var e,n,r,i,o=(r=a,i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=E(r);if(i){var n=E(this).constructor;t=Reflect.construct(e,arguments,n)}else t=e.apply(this,arguments);return function(t,e){if(e&&("object"===S(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(this,t)});function a(t,e){var n;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,a),(n=o.call(this,t,e)).pictureInPictureEnabled=!1,n.options=e,n.bindFunctions(),n}return e=a,(n=[{key:"bindFunctions",value:function(){this.requestPictureInPicture=this.requestPictureInPicture.bind(this),this.exitPictureInPicture=this.exitPictureInPicture.bind(this),this.onPlayerResize=this.onPlayerResize.bind(this),this.playerRequestPictureInPictureFn=this.player.requestPictureInPicture,this.playerExitPictureInPictureFn=this.player.exitPictureInPicture,this.player.requestPictureInPicture=this.requestPictureInPicture,this.player.exitPictureInPicture=this.exitPictureInPicture}},{key:"enablePictureInPicture",value:function(){var t=this;if(this.player.options_.fluid&&!this.pictureInPictureEnabled){var e=this.getToggleParentComponent();if(e){this.pictureInPictureEnabled=!0;var n=e.children().findIndex((function(t){var e;return"fullscreentoggle"===(null===(e=t.name())||void 0===e?void 0:e.toLowerCase())}));-1===n&&(n=e.children().length-1),e.addChild("pictureInPictureToggle",{},n);var r=e.getChild("pictureInPictureToggle");null==r||r.enable(),this.player.on("playerresize",this.onPlayerResize),this.player.on("dispose",(function(){var e;null===(e=t.player)||void 0===e||e.off("playerresize",t.onPlayerResize)}))}}}},{key:"disablePictureInPicture",value:function(){if(this.pictureInPictureEnabled){this.pictureInPictureEnabled=!1;var t=this.getToggleParentComponent(),e=null==t?void 0:t.getChild("pictureInPictureToggle");e&&t.removeChild(e),this.player.off("playerresize",this.onPlayerResize)}}},{key:"togglePictureInPicture",value:function(t){if(t!==this.player.isInPictureInPicture()){var e=t?"enterpictureinpicture":"leavepictureinpicture";this.player.isInPictureInPicture(t),this.player.trigger(e),t?this.addPipStyles():this.removePipStyles()}}},{key:"onPlayerResize",value:function(){if(!this.player.isInPictureInPicture()){var t=this.player.el().getBoundingClientRect();0!==t.width&&(t.width<800?this.disablePictureInPicture():this.enablePictureInPicture())}}},{key:"addPipStyles",value:function(){this.player.addClass("cv-picture-in-picture"),this.playToggle=new C(this.player),this.playToggle.addClass("cv-pip-play-toggle"),this.player.addChild(this.playToggle),this.player.paused()?this.playToggle.handlePause():this.playToggle.handlePlay()}},{key:"removePipStyles",value:function(){this.player.removeClass("cv-picture-in-picture"),this.player.removeChild(this.playToggle),delete this.playToggle}},{key:"requestPictureInPicture",value:function(){var t;this.pictureInPictureEnabled&&(this.togglePictureInPicture(!0),"function"==typeof(null===(t=this.options)||void 0===t?void 0:t.onRequestPictureInPicture)&&this.options.onRequestPictureInPicture(!0))}},{key:"exitPictureInPicture",value:function(){this.togglePictureInPicture(!1),this.options.onRequestPictureInPicture(!1),this.removePipStyles()}},{key:"getToggleParentComponent",value:function(){return this.player.getChild("collapserator")}},{key:"dispose",value:function(){this.player.requestPictureInPicture=this.playerRequestPictureInPictureFn,this.player.exitPictureInPicture=this.playerExitPictureInPictureFn,O(E(a.prototype),"dispose",this).call(this)}}])&&k(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),a}(o.Z.getPlugin("plugin"));o.Z.registerPlugin("pictureInPicture",x);var T=n(23035),_=n(42892),I=n(73758);function R(t){return R="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},R(t)}function L(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,(void 0,i=function(t,e){if("object"!==R(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!==R(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(r.key),"symbol"===R(i)?i:String(i)),r)}var i}function D(){return D="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=A(t)););return t}(t,e);if(r){var i=Object.getOwnPropertyDescriptor(r,e);return i.get?i.get.call(arguments.length<3?t:n):i.value}},D.apply(this,arguments)}function M(t,e){return M=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},M(t,e)}function N(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function A(t){return A=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},A(t)}var V=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&M(t,e)}(s,t);var e,n,r,i,a=(r=s,i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=A(r);if(i){var n=A(this).constructor;t=Reflect.construct(e,arguments,n)}else t=e.apply(this,arguments);return function(t,e){if(e&&("object"===R(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return N(t)}(this,t)});function s(t,e){var n;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,s),(n=a.call(this,t,e)).hasBuffered=!1,n.hasPlayed=!1,n.eventsService=I.n,n.pointOfInterest=e.pointOfInterest,n.onMouseOver=n.onMouseOver.bind(N(n)),n.onMouseLeave=n.onMouseLeave.bind(N(n)),n.onGlancePointOfInterestMouseEnter=n.onGlancePointOfInterestMouseEnter.bind(N(n)),n.onGlancePointOfInterestMouseLeave=n.onGlancePointOfInterestMouseLeave.bind(N(n)),n.initialize(),n}return e=s,(n=[{key:"initialize",value:function(){this.setPosition(),this.bindListeners()}},{key:"buildCSSClass",value:function(){return"cv-point-of-interest-indicator ".concat(D(A(s.prototype),"buildCSSClass",this).call(this))}},{key:"createEl",value:function(t,e,n){return D(A(s.prototype),"createEl",this).call(this,t,Object.assign(Object.assign({},e),{className:this.buildCSSClass()}),n)}},{key:"bindListeners",value:function(){this.on("mouseover",this.onMouseOver),this.on("mouseleave",this.onMouseLeave),this.eventsService.subscribe("glance:poi:mouseover",this.onGlancePointOfInterestMouseEnter),this.eventsService.subscribe("glance:poi:mouseleave",this.onGlancePointOfInterestMouseLeave)}},{key:"dispose",value:function(){this.eventsService.unsubscribe("glance:poi:mouseover",this.onGlancePointOfInterestMouseEnter),this.eventsService.unsubscribe("glance:poi:mouseleave",this.onGlancePointOfInterestMouseLeave)}},{key:"getPointOfInterestTime",value:function(){return this.pointOfInterest.startTime}},{key:"setPosition",value:function(){var t=this.player().duration();this.el_.style.left=this.getPointOfInterestTime()/t*100+"%"}},{key:"updateBuffered",value:function(t){var e=this.getPointOfInterestTime()<=t;if(e!==this.hasBuffered){this.hasBuffered=e;var n="cv-point-of-interest-indicator-buffered";this.hasBuffered?this.addClass(n):this.removeClass(n)}}},{key:"updatePlaybackProgress",value:function(t){var e=this.getPointOfInterestTime()<=t;if(e!==this.hasPlayed){this.hasPlayed=e;var n="cv-point-of-interest-indicator-played";e?this.addClass(n):this.removeClass(n)}}},{key:"toggleVisibility",value:function(t){var e="cv-point-of-interest-indicator-hidden";t?this.removeClass(e):this.addClass(e)}},{key:"onMouseOver",value:function(){this.setTimeTooltipText(),this.eventsService.trigger("player:poi:mouseover",this.pointOfInterest)}},{key:"onMouseLeave",value:function(){this.clearTimeTooltipText(),this.eventsService.trigger("player:poi:mouseleave")}},{key:"onGlancePointOfInterestMouseEnter",value:function(t){t.id===this.pointOfInterest.id&&(this.addClass("cv-point-of-interest-indicator-highlight"),this.setTimeTooltipTime(),this.setTimeTooltipText(),this.positionMouseTimeDisplay(),this.showMouseTimeDisplay())}},{key:"onGlancePointOfInterestMouseLeave",value:function(){this.removeClass("cv-point-of-interest-indicator-highlight"),this.hideMouseTimeDisplay()}},{key:"setTimeTooltipText",value:function(){var t;null===(t=this.getTimeTooltip())||void 0===t||t.setCustomChapterText(this.pointOfInterest.description)}},{key:"clearTimeTooltipText",value:function(){var t;null===(t=this.getTimeTooltip())||void 0===t||t.setCustomChapterText()}},{key:"setTimeTooltipTime",value:function(){var t=this.getTimeTooltip();null==t||t.updateTime(this.getPointOfInterestTime())}},{key:"positionMouseTimeDisplay",value:function(){var t,e,n=null===(t=this.getSeekBar())||void 0===t?void 0:t.el();if(n){var r=o.Z.dom.findPosition(n),i=this.getPointOfInterestTime()/this.player().duration();null===(e=this.getMouseTimeDisplay())||void 0===e||e.update(r,i)}}},{key:"showMouseTimeDisplay",value:function(){var t;null===(t=this.getMouseTimeDisplay())||void 0===t||t.forceShow()}},{key:"hideMouseTimeDisplay",value:function(){var t;null===(t=this.getMouseTimeDisplay())||void 0===t||t.removeForceShow()}},{key:"getSeekBar",value:function(){var t;return null===(t=this.player().controlBar.getChild("ProgressControl"))||void 0===t?void 0:t.getChild("SeekBar")}},{key:"getMouseTimeDisplay",value:function(){var t;return null===(t=this.getSeekBar())||void 0===t?void 0:t.getChild("MouseTimeDisplay")}},{key:"getTimeTooltip",value:function(){var t;return null===(t=this.getMouseTimeDisplay())||void 0===t?void 0:t.getChild("TimeTooltip")}}])&&L(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),s}(o.Z.getComponent("Component"));function F(t){return F="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},F(t)}function B(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,(void 0,i=function(t,e){if("object"!==F(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!==F(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(r.key),"symbol"===F(i)?i:String(i)),r)}var i}function U(){return U="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=Z(t)););return t}(t,e);if(r){var i=Object.getOwnPropertyDescriptor(r,e);return i.get?i.get.call(arguments.length<3?t:n):i.value}},U.apply(this,arguments)}function G(t,e){return G=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},G(t,e)}function Z(t){return Z=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Z(t)}var z=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&G(t,e)}(s,t);var e,n,r,i,a=(r=s,i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=Z(r);if(i){var n=Z(this).constructor;t=Reflect.construct(e,arguments,n)}else t=e.apply(this,arguments);return function(t,e){if(e&&("object"===F(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(this,t)});function s(t,e){var n;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,s),(n=a.call(this,t,e)).pointsOfInterestVisible=e.pointsOfInterestVisible,n.toggle(n.pointsOfInterestVisible),n}return e=s,(n=[{key:"handleToggle",value:function(){this.toggle(!this.pointsOfInterestVisible)}},{key:"toggle",value:function(t){t?this.toggleOn():this.toggleOff()}},{key:"toggleOn",value:function(){o.Z.dom.addClass(this.toggleEl,"on"),this.pointsOfInterestVisible=!0,this.player().pointsOfInterestPlugin().togglePointsOfInterest(this.pointsOfInterestVisible)}},{key:"toggleOff",value:function(){o.Z.dom.removeClass(this.toggleEl,"on"),this.pointsOfInterestVisible=!1,this.player().pointsOfInterestPlugin().togglePointsOfInterest(this.pointsOfInterestVisible)}},{key:"handleClick",value:function(t){t.stopImmediatePropagation()}},{key:"createEl",value:function(t,e,n){this.handlerBound||(this.handleToggle=this.handleToggle.bind(this),this.handlerBound=!0),this.toggleEl&&this.toggleEl.removeEventListener("click",this.handleToggle),this.toggleEl=o.Z.dom.createEl("div",{className:"custom-toggle toggle-option float-end",innerHTML:'<span class="handle"></span></div>'}),this.toggleEl.addEventListener("click",this.handleToggle);var r=U(Z(s.prototype),"createEl",this).call(this,t,{className:"vjs-menu-item cv-cog-menu-item",innerHTML:'\n <span class="vjs-menu-item-text">Points of Interest</span>\n <span class="cv-toggle-container"></span>'},n);return r.children[1].appendChild(this.toggleEl),r}}])&&B(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),s}(o.Z.getComponent("MenuItem"));function q(t){return q="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},q(t)}function H(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,(void 0,i=function(t,e){if("object"!==q(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!==q(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(r.key),"symbol"===q(i)?i:String(i)),r)}var i}function Y(t,e){return Y=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Y(t,e)}function W(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function $(t){return $=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},$(t)}o.Z.registerComponent("PointsOfInterestMenuItem",z);var Q=o.Z.getPlugin("plugin"),X="cvplayer-points-of-interest",J=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Y(t,e)}(a,t);var e,n,r,i,o=(r=a,i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=$(r);if(i){var n=$(this).constructor;t=Reflect.construct(e,arguments,n)}else t=e.apply(this,arguments);return function(t,e){if(e&&("object"===q(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return W(t)}(this,t)});function a(t,e){var n;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,a),(n=o.call(this,t)).pointOfInterestIndicators=[],n.enabled=!0,n.pointsOfInterest=null==e?void 0:e.pointsOfInterest,n.initialize=n.initialize.bind(W(n)),n.updateBuffered=n.updateBuffered.bind(W(n)),n.updatePlaybackProgress=n.updatePlaybackProgress.bind(W(n)),n.player.one("loadedmetadata",(function(){return n.player.ready(n.initialize)})),n}return e=a,(n=[{key:"initialize",value:function(){this.pointsOfInterest&&(_.S.hasLocalStorage()&&"false"===_.S.get(X)&&(this.enabled=!1),this.setupTrack(),this.createPointOfInterestIndicators(),this.addMenuItem(),this.bindListeners())}},{key:"bindListeners",value:function(){var t=this;this.player.on("progress",this.updateBuffered),this.player.on("timeupdate",this.updatePlaybackProgress),this.player.on("dispose",(function(){var e,n;null===(e=t.player)||void 0===e||e.off("progress",t.updateBuffered),null===(n=t.player)||void 0===n||n.off("timeupdate",t.updatePlaybackProgress)}))}},{key:"togglePointsOfInterest",value:function(t){_.S.set(X,t.toString()),this.pointOfInterestIndicators.forEach((function(e){return e.toggleVisibility(t)}))}},{key:"setupTrack",value:function(){var t=this.player.addTextTrack("metadata","pointsofinterest");this.pointsOfInterest.forEach((function(e){t.addCue({startTime:e.startTime,endTime:e.endTime,text:e.description})})),t.trigger({type:"loadeddata",target:t})}},{key:"createPointOfInterestIndicators",value:function(){var t,e=this,n=null===(t=this.player.controlBar.getChild("ProgressControl"))||void 0===t?void 0:t.getChild("SeekBar");this.pointsOfInterest.forEach((function(t){var r=new V(e.player,{pointOfInterest:t});e.pointOfInterestIndicators.push(r),n.addChild(r)}))}},{key:"addMenuItem",value:function(){var t;(null===(t=this.player.getChild("collapserator"))||void 0===t?void 0:t.getChild("cogButton")).addItem({index:0,ctor:z,name:"PointsOfInterestMenuItem",options:{pointsOfInterestVisible:this.enabled}})}},{key:"updateBuffered",value:function(){var t=this;this.pointOfInterestIndicators.forEach((function(e){return e.updateBuffered((0,T.b)(t.player))}))}},{key:"updatePlaybackProgress",value:function(){var t=this;this.pointOfInterestIndicators.forEach((function(e){return e.updatePlaybackProgress(t.player.currentTime())}))}}])&&H(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),a}(Q);o.Z.registerPlugin("pointsOfInterestPlugin",J),n(93262);var K,tt=n(65858),et=n(33937);function nt(t){var e="function"==typeof Map?new Map:void 0;return nt=function(t){if(null===t||!function(t){try{return-1!==Function.toString.call(t).indexOf("[native code]")}catch(e){return"function"==typeof t}}(t))return t;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(void 0!==e){if(e.has(t))return e.get(t);e.set(t,n)}function n(){return rt(t,arguments,at(this).constructor)}return n.prototype=Object.create(t.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),ot(n,t)},nt(t)}function rt(t,e,n){return rt=it()?Reflect.construct.bind():function(t,e,n){var r=[null];r.push.apply(r,e);var i=new(Function.bind.apply(t,r));return n&&ot(i,n.prototype),i},rt.apply(null,arguments)}function it(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}function ot(t,e){return ot=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},ot(t,e)}function at(t){return at=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},at(t)}function st(t){return st="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},st(t)}function ct(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function ut(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,(void 0,i=function(t,e){if("object"!==st(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!==st(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(r.key),"symbol"===st(i)?i:String(i)),r)}var i}function lt(t,e,n){return e&&ut(t.prototype,e),n&&ut(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}!function(t){t.AppleTv="apple-tv",t.Vivi="vivi"}(K||(K={}));var ft,ht,pt,dt=function(){function t(){ct(this,t),this.callbacks=[],this.predicates=[],this.controller=new AbortController,this.signal=this.controller.signal,this.trigger=this.trigger.bind(this),this.on=this.on.bind(this),this.one=this.one.bind(this),this.off=this.off.bind(this),this.dispose=this.dispose.bind(this),this.isDisposed=this.isDisposed.bind(this)}return lt(t,[{key:"trigger",value:function(t){var e=this;this.callbacks.forEach((function(n,r){var i=e.predicates[r];i&&!i(t)||n(t)}))}},{key:"on",value:function(t){var e=this;this.isDisposed()&&console.warn("This EventChannel instance been disposed - this is a no-op");var n=this.callbacks.length;this.callbacks[n]=t,this.predicates[n]=function(){return!0};var r=function(){e.off(t)};return{off:r,filter:function(t){return e.predicates[n]=t,r}}}},{key:"one",value:function(){var t,e=this,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:function(){return!0};return this.isDisposed()?yt.reject(new Error("This EventChannel instance has been disposed")):new yt((function(r,i){t=e.on((function(n){e.signal.removeEventListener("abort",o),t(),r(n)})).filter(n);var o=function(){t(),i(new Error("Aborted while waiting for message"))};e.signal.addEventListener("abort",o,{once:!0})}),(function(){t()}))}},{key:"off",value:function(t){var e=this.callbacks.indexOf(t);-1!==e&&(this.callbacks.splice(e,1),this.predicates.splice(e,1))}},{key:"dispose",value:function(){this.callbacks.length=0,this.predicates.length=0,this.controller.abort()}},{key:"isDisposed",value:function(){return this.signal.aborted}}]),t}(),yt=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&ot(t,e)}(i,t);var e,n,r=(e=i,n=it(),function(){var t,r=at(e);if(n){var i=at(this).constructor;t=Reflect.construct(r,arguments,i)}else t=r.apply(this,arguments);return function(t,e){if(e&&("object"===st(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(this,t)});function i(t,e){var n;return ct(this,i),(n=r.call(this,t)).onTimeout=e,n.bindFunctions(),n}return lt(i,[{key:"bindFunctions",value:function(){this.timeout=this.timeout.bind(this)}},{key:"timeout",value:function(t){var e=this;return new Promise((function(n,r){e.then(n).catch(r).finally((function(){return clearTimeout(i)}));var i=setTimeout((function(){var t;null===(t=e.onTimeout)||void 0===t||t.call(e),r(new Error("Promise timed out"))}),t)}))}}],[{key:"reject",value:function(t){return new i((function(e,n){return n(t)}))}}]),i}(nt(Promise)),vt=function(){function t(){ct(this,t),this.channels={},this.trigger=this.trigger.bind(this),this.on=this.on.bind(this),this.one=this.one.bind(this),this.off=this.off.bind(this),this.dispose=this.dispose.bind(this),this.getChannel=this.getChannel.bind(this)}return lt(t,[{key:"trigger",value:function(t,e){this.getChannel(t).trigger(e)}},{key:"on",value:function(t,e){return this.getChannel(t).on(e)}},{key:"one",value:function(t,e){return this.getChannel(t).one(e)}},{key:"off",value:function(t,e){this.getChannel(t).off(e)}},{key:"dispose",value:function(){this.trigger("dispose",bt.void),Object.values(this.channels).forEach((function(t){return t.dispose()})),this.channels={}}},{key:"getChannel",value:function(t){return this.channels[t]||(this.channels[t]=new dt),this.channels[t]}}]),t}(),bt={void:void 0},gt=n(95569),mt=function(t,e){return t._lastModified||(t._lastModified={}),new Proxy(t,{set:function(n,r,i,o){var a=t._lastModified[r.toString()];return!!(a&&Date.now()<a+e)||Reflect.set(n,r,i,o)}})},wt=function(t){return t._lastModified||(t._lastModified={}),new Proxy(t,{set:function(e,n,r,i){return t._lastModified[n.toString()]=Date.now(),Reflect.set(e,n,r,i)}})};function Pt(t){return Pt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Pt(t)}function St(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,(void 0,i=function(t,e){if("object"!==Pt(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!==Pt(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(r.key),"symbol"===Pt(i)?i:String(i)),r)}var i}function kt(t,e,n){return e&&St(t.prototype,e),n&&St(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}!function(t){t[t.Offline=0]="Offline",t[t.Online=1]="Online",t[t.Locked=2]="Locked",t[t.Suspended=3]="Suspended"}(ft||(ft={})),function(t){t[t.PlaybackStatusChange=0]="PlaybackStatusChange",t[t.PositionChange=1]="PositionChange"}(ht||(ht={})),function(t){t.Begin="BEGIN",t.Play="PLAY",t.Pause="PAUSE",t.Load="LOAD",t.Scan="SCAN",t.Stop="STOP"}(pt||(pt={}));var Ot=kt((function t(e,n){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.title=e,this.device=n,this.locked=!1,this.position=0,this.playbackStatus=pt.Load,this.debounced=mt(this,2e3),wt(this)}));function jt(t){return jt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},jt(t)}function Et(){Et=function(){return e};var t,e={},n=Object.prototype,r=n.hasOwnProperty,i=Object.defineProperty||function(t,e,n){t[e]=n.value},o="function"==typeof Symbol?Symbol:{},a=o.iterator||"@@iterator",s=o.asyncIterator||"@@asyncIterator",c=o.toStringTag||"@@toStringTag";function u(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{u({},"")}catch(t){u=function(t,e,n){return t[e]=n}}function l(t,e,n,r){var o=e&&e.prototype instanceof b?e:b,a=Object.create(o.prototype),s=new _(r||[]);return i(a,"_invoke",{value:E(t,n,s)}),a}function f(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}e.wrap=l;var h="suspendedStart",p="suspendedYield",d="executing",y="completed",v={};function b(){}function g(){}function m(){}var w={};u(w,a,(function(){return this}));var P=Object.getPrototypeOf,S=P&&P(P(I([])));S&&S!==n&&r.call(S,a)&&(w=S);var k=m.prototype=b.prototype=Object.create(w);function O(t){["next","throw","return"].forEach((function(e){u(t,e,(function(t){return this._invoke(e,t)}))}))}function j(t,e){function n(i,o,a,s){var c=f(t[i],t,o);if("throw"!==c.type){var u=c.arg,l=u.value;return l&&"object"==jt(l)&&r.call(l,"__await")?e.resolve(l.__await).then((function(t){n("next",t,a,s)}),(function(t){n("throw",t,a,s)})):e.resolve(l).then((function(t){u.value=t,a(u)}),(function(t){return n("throw",t,a,s)}))}s(c.arg)}var o;i(this,"_invoke",{value:function(t,r){function i(){return new e((function(e,i){n(t,r,e,i)}))}return o=o?o.then(i,i):i()}})}function E(e,n,r){var i=h;return function(o,a){if(i===d)throw new Error("Generator is already running");if(i===y){if("throw"===o)throw a;return{value:t,done:!0}}for(r.method=o,r.arg=a;;){var s=r.delegate;if(s){var c=C(s,r);if(c){if(c===v)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(i===h)throw i=y,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);i=d;var u=f(e,n,r);if("normal"===u.type){if(i=r.done?y:p,u.arg===v)continue;return{value:u.arg,done:r.done}}"throw"===u.type&&(i=y,r.method="throw",r.arg=u.arg)}}}function C(e,n){var r=n.method,i=e.iterator[r];if(i===t)return n.delegate=null,"throw"===r&&e.iterator.return&&(n.method="return",n.arg=t,C(e,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),v;var o=f(i,e.iterator,n.arg);if("throw"===o.type)return n.method="throw",n.arg=o.arg,n.delegate=null,v;var a=o.arg;return a?a.done?(n[e.resultName]=a.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,v):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,v)}function x(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function T(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function _(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(x,this),this.reset(!0)}function I(e){if(e||""===e){var n=e[a];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var i=-1,o=function n(){for(;++i<e.length;)if(r.call(e,i))return n.value=e[i],n.done=!1,n;return n.value=t,n.done=!0,n};return o.next=o}}throw new TypeError(jt(e)+" is not iterable")}return g.prototype=m,i(k,"constructor",{value:m,configurable:!0}),i(m,"constructor",{value:g,configurable:!0}),g.displayName=u(m,c,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===g||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,m):(t.__proto__=m,u(t,c,"GeneratorFunction")),t.prototype=Object.create(k),t},e.awrap=function(t){return{__await:t}},O(j.prototype),u(j.prototype,s,(function(){return this})),e.AsyncIterator=j,e.async=function(t,n,r,i,o){void 0===o&&(o=Promise);var a=new j(l(t,n,r,i),o);return e.isGeneratorFunction(n)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},O(k),u(k,c,"Generator"),u(k,a,(function(){return this})),u(k,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),n=[];for(var r in e)n.push(r);return n.reverse(),function t(){for(;n.length;){var r=n.pop();if(r in e)return t.value=r,t.done=!1,t}return t.done=!0,t}},e.values=I,_.prototype={constructor:_,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(T),!e)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var n=this;function i(r,i){return s.type="throw",s.arg=e,n.next=r,i&&(n.method="next",n.arg=t),!!i}for(var o=this.tryEntries.length-1;o>=0;--o){var a=this.tryEntries[o],s=a.completion;if("root"===a.tryLoc)return i("end");if(a.tryLoc<=this.prev){var c=r.call(a,"catchLoc"),u=r.call(a,"finallyLoc");if(c&&u){if(this.prev<a.catchLoc)return i(a.catchLoc,!0);if(this.prev<a.finallyLoc)return i(a.finallyLoc)}else if(c){if(this.prev<a.catchLoc)return i(a.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return i(a.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var o=i;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=t,a.arg=e,o?(this.method="next",this.next=o.finallyLoc,v):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),v},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),T(n),v}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var i=r.arg;T(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:I(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),v}},e}function Ct(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,(void 0,i=function(t,e){if("object"!==jt(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!==jt(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(r.key),"symbol"===jt(i)?i:String(i)),r)}var i}function xt(){return xt="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=_t(t)););return t}(t,e);if(r){var i=Object.getOwnPropertyDescriptor(r,e);return i.get?i.get.call(arguments.length<3?t:n):i.value}},xt.apply(this,arguments)}function Tt(t,e){return Tt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Tt(t,e)}function _t(t){return _t=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},_t(t)}var It=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Tt(t,e)}(a,t);var e,n,r,i,o=(r=a,i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=_t(r);if(i){var n=_t(this).constructor;t=Reflect.construct(e,arguments,n)}else t=e.apply(this,arguments);return function(t,e){if(e&&("object"===jt(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(this,t)});function a(t,e){var n;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,a),(n=o.call(this)).client=t,n.localState=new Ot(e.title,e.device),n.bindFunctions(),n.initialize(),n}return e=a,(n=[{key:"bindFunctions",value:function(){this.initialize=this.initialize.bind(this),this.dispose=this.dispose.bind(this),this.handleDisconnected=this.handleDisconnected.bind(this),this.handleAllVideoMessages=this.handleAllVideoMessages.bind(this),this.handlePlaybackChange=this.handlePlaybackChange.bind(this),this.handlePositionChange=this.handlePositionChange.bind(this),this.loadSource=this.loadSource.bind(this),this.play=this.play.bind(this),this.pause=this.pause.bind(this),this.seek=this.seek.bind(this),this.setVolume=this.setVolume.bind(this),this.isPlaying=this.isPlaying.bind(this),this.getPosition=this.getPosition.bind(this),this.getDuration=this.getDuration.bind(this),this.getVolume=this.getVolume.bind(this)}},{key:"initialize",value:function(){this.client.on("dispose",this.dispose),this.client.on("disconnected",this.handleDisconnected),this.client.on("message",this.handleAllVideoMessages)}},{key:"dispose",value:function(){this.client.off("dispose",this.dispose),this.client.off("disconnected",this.handleDisconnected),this.client.off("message",this.handleAllVideoMessages),this.client.stop(this.getDevice().id).catch((function(t){return console.error(t)})),xt(_t(a.prototype),"dispose",this).call(this)}},{key:"handleDisconnected",value:function(){this.trigger("error",new Error("The connection to the Apple TV has been lost and cannot be recovered"))}},{key:"handleAllVideoMessages",value:function(t){if(t.deviceId===this.getDevice().id){var e=this.localState.debounced;switch(t.event){case ht.PlaybackStatusChange:this.handlePlaybackChange(e,t);break;case ht.PositionChange:this.handlePositionChange(e,t)}}}},{key:"handlePlaybackChange",value:function(t,e){t.playbackStatus!==e.params.playbackStatus&&(t.playbackStatus=e.params.playbackStatus,this.trigger("playingchange",bt.void),t.playbackStatus===pt.Stop&&this.dispose())}},{key:"handlePositionChange",value:function(t,e){t.position!==e.params.position&&(t.position=e.params.position,this.trigger("positionchange",bt.void))}},{key:"loadSource",value:function(){return t=this,e=void 0,n=void 0,r=Et().mark((function t(){return Et().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(t.prev=0,!this.localState.locked){t.next=3;break}return t.abrupt("return");case 3:return t.next=5,this.client.lock(this.getDevice().id);case 5:return this.localState.locked=!0,t.next=8,this.client.loadVideo(this.getDevice().id);case 8:this.trigger("sourceloaded",bt.void),t.next=15;break;case 11:t.prev=11,t.t0=t.catch(0),console.error(t.t0),this.trigger("error",new Error("Could not load video on Apple TV device"));case 15:case"end":return t.stop()}}),t,this,[[0,11]])})),new(n||(n=Promise))((function(i,o){function a(t){try{c(r.next(t))}catch(t){o(t)}}function s(t){try{c(r.throw(t))}catch(t){o(t)}}function c(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}c((r=r.apply(t,e||[])).next())}));var t,e,n,r}},{key:"play",value:function(){this.localState.locked&&this.localState.playbackStatus!==pt.Play&&(this.localState.playbackStatus=pt.Play,this.client.play(this.getDevice().id),this.trigger("playingchange",bt.void))}},{key:"pause",value:function(){this.localState.locked&&this.localState.playbackStatus!==pt.Pause&&(this.localState.playbackStatus=pt.Pause,this.client.pause(this.getDevice().id),this.trigger("playingchange",bt.void))}},{key:"seek",value:function(t){this.localState.locked&&this.localState.position!==t&&(this.localState.position=t,this.client.seek(this.getDevice().id,t),this.trigger("positionchange",bt.void))}},{key:"setVolume",value:function(){console.info("Setting the volume is not supported on Apple TV")}},{key:"setMuted",value:function(){console.info("Muting is not supported on Apple TV")}},{key:"setSubtitles",value:function(){console.info("Subtitles are not supported on Apple TV")}},{key:"isPlaying",value:function(){return this.localState.playbackStatus===pt.Play||this.localState.playbackStatus===pt.Begin||this.localState.playbackStatus===pt.Load}},{key:"isPlaybackFinished",value:function(){return this.localState.playbackStatus===pt.Stop}},{key:"getPosition",value:function(){return this.localState.position}},{key:"getDuration",value:function(){}},{key:"getVolume",value:function(){return 1}},{key:"getMuted",value:function(){return!1}},{key:"getSubtitles",value:function(){}},{key:"getDevice",value:function(){return this.localState.device}},{key:"getTitle",value:function(){return this.localState.title}}])&&Ct(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),a}(vt);function Rt(t){return Rt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Rt(t)}function Lt(){Lt=function(){return e};var t,e={},n=Object.prototype,r=n.hasOwnProperty,i=Object.defineProperty||function(t,e,n){t[e]=n.value},o="function"==typeof Symbol?Symbol:{},a=o.iterator||"@@iterator",s=o.asyncIterator||"@@asyncIterator",c=o.toStringTag||"@@toStringTag";function u(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{u({},"")}catch(t){u=function(t,e,n){return t[e]=n}}function l(t,e,n,r){var o=e&&e.prototype instanceof b?e:b,a=Object.create(o.prototype),s=new _(r||[]);return i(a,"_invoke",{value:E(t,n,s)}),a}function f(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}e.wrap=l;var h="suspendedStart",p="suspendedYield",d="executing",y="completed",v={};function b(){}function g(){}function m(){}var w={};u(w,a,(function(){return this}));var P=Object.getPrototypeOf,S=P&&P(P(I([])));S&&S!==n&&r.call(S,a)&&(w=S);var k=m.prototype=b.prototype=Object.create(w);function O(t){["next","throw","return"].forEach((function(e){u(t,e,(function(t){return this._invoke(e,t)}))}))}function j(t,e){function n(i,o,a,s){var c=f(t[i],t,o);if("throw"!==c.type){var u=c.arg,l=u.value;return l&&"object"==Rt(l)&&r.call(l,"__await")?e.resolve(l.__await).then((function(t){n("next",t,a,s)}),(function(t){n("throw",t,a,s)})):e.resolve(l).then((function(t){u.value=t,a(u)}),(function(t){return n("throw",t,a,s)}))}s(c.arg)}var o;i(this,"_invoke",{value:function(t,r){function i(){return new e((function(e,i){n(t,r,e,i)}))}return o=o?o.then(i,i):i()}})}function E(e,n,r){var i=h;return function(o,a){if(i===d)throw new Error("Generator is already running");if(i===y){if("throw"===o)throw a;return{value:t,done:!0}}for(r.method=o,r.arg=a;;){var s=r.delegate;if(s){var c=C(s,r);if(c){if(c===v)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(i===h)throw i=y,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);i=d;var u=f(e,n,r);if("normal"===u.type){if(i=r.done?y:p,u.arg===v)continue;return{value:u.arg,done:r.done}}"throw"===u.type&&(i=y,r.method="throw",r.arg=u.arg)}}}function C(e,n){var r=n.method,i=e.iterator[r];if(i===t)return n.delegate=null,"throw"===r&&e.iterator.return&&(n.method="return",n.arg=t,C(e,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),v;var o=f(i,e.iterator,n.arg);if("throw"===o.type)return n.method="throw",n.arg=o.arg,n.delegate=null,v;var a=o.arg;return a?a.done?(n[e.resultName]=a.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,v):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,v)}function x(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function T(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function _(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(x,this),this.reset(!0)}function I(e){if(e||""===e){var n=e[a];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var i=-1,o=function n(){for(;++i<e.length;)if(r.call(e,i))return n.value=e[i],n.done=!1,n;return n.value=t,n.done=!0,n};return o.next=o}}throw new TypeError(Rt(e)+" is not iterable")}return g.prototype=m,i(k,"constructor",{value:m,configurable:!0}),i(m,"constructor",{value:g,configurable:!0}),g.displayName=u(m,c,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===g||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,m):(t.__proto__=m,u(t,c,"GeneratorFunction")),t.prototype=Object.create(k),t},e.awrap=function(t){return{__await:t}},O(j.prototype),u(j.prototype,s,(function(){return this})),e.AsyncIterator=j,e.async=function(t,n,r,i,o){void 0===o&&(o=Promise);var a=new j(l(t,n,r,i),o);return e.isGeneratorFunction(n)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},O(k),u(k,c,"Generator"),u(k,a,(function(){return this})),u(k,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),n=[];for(var r in e)n.push(r);return n.reverse(),function t(){for(;n.length;){var r=n.pop();if(r in e)return t.value=r,t.done=!1,t}return t.done=!0,t}},e.values=I,_.prototype={constructor:_,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(T),!e)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var n=this;function i(r,i){return s.type="throw",s.arg=e,n.next=r,i&&(n.method="next",n.arg=t),!!i}for(var o=this.tryEntries.length-1;o>=0;--o){var a=this.tryEntries[o],s=a.completion;if("root"===a.tryLoc)return i("end");if(a.tryLoc<=this.prev){var c=r.call(a,"catchLoc"),u=r.call(a,"finallyLoc");if(c&&u){if(this.prev<a.catchLoc)return i(a.catchLoc,!0);if(this.prev<a.finallyLoc)return i(a.finallyLoc)}else if(c){if(this.prev<a.catchLoc)return i(a.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return i(a.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var o=i;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=t,a.arg=e,o?(this.method="next",this.next=o.finallyLoc,v):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),v},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),T(n),v}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var i=r.arg;T(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:I(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),v}},e}function Dt(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,(void 0,i=function(t,e){if("object"!==Rt(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!==Rt(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(r.key),"symbol"===Rt(i)?i:String(i)),r)}var i}function Mt(){return Mt="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=At(t)););return t}(t,e);if(r){var i=Object.getOwnPropertyDescriptor(r,e);return i.get?i.get.call(arguments.length<3?t:n):i.value}},Mt.apply(this,arguments)}function Nt(t,e){return Nt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Nt(t,e)}function At(t){return At=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},At(t)}var Vt,Ft=function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function a(t){try{c(r.next(t))}catch(t){o(t)}}function s(t){try{c(r.throw(t))}catch(t){o(t)}}function c(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}c((r=r.apply(t,e||[])).next())}))};!function(t){t.DeviceList="DeviceList",t.DeviceStateChange="DeviceStateChange",t.Paired="Paired",t.Unpaired="Unpaired",t.PlayStatusChange="PlayStatusChange",t.TimeSync="TimeSync"}(Vt||(Vt={}));var Bt=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Nt(t,e)}(s,t);var e,n,r,i,o,a=(i=s,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=At(i);if(o){var n=At(this).constructor;t=Reflect.construct(e,arguments,n)}else t=e.apply(this,arguments);return function(t,e){if(e&&("object"===Rt(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(this,t)});function s(t){var e;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,s),(e=a.call(this)).options=t,e.accessToken="",e.devices=[],e.bindFunctions(),e.initialize(),e}return e=s,n=[{key:"bindFunctions",value:function(){this.initialize=this.initialize.bind(this),this.invoke=this.invoke.bind(this),this.invokeDebounced=(0,gt.Ds)(this.invoke,500,!0),this.dispose=this.dispose.bind(this),this.canCastToDevice=this.canCastToDevice.bind(this),this.getDevices=this.getDevices.bind(this),this.startCastSession=this.startCastSession.bind(this),this.handleDeviceList=this.handleDeviceList.bind(this),this.handleDeviceStateChange=this.handleDeviceStateChange.bind(this),this.handleDevicePaired=this.handleDevicePaired.bind(this),this.handleDeviceUnpaired=this.handleDeviceUnpaired.bind(this),this.handlePlayStatusChange=this.handlePlayStatusChange.bind(this),this.handleTimeSync=this.handleTimeSync.bind(this)}},{key:"initialize",value:function(){var t=this;this.connection=(0,et.OB)(this.options.url.toString(),{logging:!1}),this.hubProxy=this.connection.createHubProxy("DeviceUserHub"),this.hubProxy.on(Vt.DeviceList,this.handleDeviceList),this.hubProxy.on(Vt.DeviceStateChange,this.handleDeviceStateChange),this.hubProxy.on(Vt.Paired,this.handleDevicePaired),this.hubProxy.on(Vt.Paired,this.handleDeviceUnpaired),this.hubProxy.on(Vt.PlayStatusChange,this.handlePlayStatusChange),this.hubProxy.on(Vt.TimeSync,this.handleTimeSync),this.connection.start({jsonp:!1,withCredentials:!1}).done((function(){return Ft(t,void 0,void 0,Lt().mark((function t(){return Lt().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,this.options.fetchAccessToken();case 3:return this.accessToken=t.sent,t.next=6,this.invoke("Subscribe",this.accessToken);case 6:if(t.sent){t.next=9;break}throw new Error("The subscription request was rejected by Online API");case 9:this.trigger("connected",bt.void),t.next=16;break;case 12:t.prev=12,t.t0=t.catch(0),console.error(t.t0),this.trigger("error",new Error("Could not subscribe to Online API"));case 16:case"end":return t.stop()}}),t,this,[[0,12]])})))})).fail((function(){t.trigger("error",new Error("Could not connect to Online API"))})),this.connection.disconnected((function(){return t.trigger("disconnected",bt.void)}))}},{key:"invoke",value:function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];var i;return Ft(this,void 0,void 0,Lt().mark((function e(){var r;return Lt().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,null===(i=this.hubProxy)||void 0===i?void 0:(r=i).invoke.apply(r,[t].concat(n));case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e,this)})))}},{key:"dispose",value:function(){this.hubProxy.off(Vt.DeviceList,this.handleDeviceList),this.hubProxy.off(Vt.DeviceStateChange,this.handleDeviceStateChange),this.hubProxy.off(Vt.Paired,this.handleDevicePaired),this.hubProxy.off(Vt.Paired,this.handleDeviceUnpaired),this.hubProxy.off(Vt.PlayStatusChange,this.handlePlayStatusChange),this.hubProxy.off(Vt.TimeSync,this.handleTimeSync),this.hubProxy.connection.stop(!1,!0),Mt(At(s.prototype),"dispose",this).call(this)}},{key:"canCastToDevice",value:function(t){return t===K.AppleTv}},{key:"getDevices",value:function(){return this.devices}},{key:"startCastSession",value:function(t){return new It(this,t)}},{key:"lock",value:function(t){return Ft(this,void 0,void 0,Lt().mark((function e(){return Lt().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.invoke("lock",t,this.options.userId,this.options.username);case 2:if(e.sent){e.next=5;break}throw new Error("Could not lock device");case 5:case"end":return e.stop()}}),e,this)})))}},{key:"loadVideo",value:function(t){return Ft(this,void 0,void 0,Lt().mark((function e(){return Lt().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.invoke("command",{DeviceId:t,CommandType:pt.Play,Data:this.options.trackingCode});case 2:case"end":return e.stop()}}),e,this)})))}},{key:"play",value:function(t){return Ft(this,void 0,void 0,Lt().mark((function e(){return Lt().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.invoke("command",{DeviceId:t,CommandType:pt.Play});case 2:case"end":return e.stop()}}),e,this)})))}},{key:"pause",value:function(t){return Ft(this,void 0,void 0,Lt().mark((function e(){return Lt().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.invoke("command",{DeviceId:t,CommandType:pt.Pause});case 2:case"end":return e.stop()}}),e,this)})))}},{key:"seek",value:function(t,e){this.invokeDebounced("command",{DeviceId:t,CommandType:pt.Play,Params:"1,".concat(Math.trunc(e))})}},{key:"stop",value:function(t){return Ft(this,void 0,void 0,Lt().mark((function e(){return Lt().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.invoke("command",{DeviceId:t,CommandType:pt.Stop});case 2:case"end":return e.stop()}}),e,this)})))}},{key:"handleDeviceList",value:function(t){this.devices=t.map(s.convertToGenericDevice),this.trigger("deviceschange",bt.void)}},{key:"handleDeviceStateChange",value:function(t){var e=this.devices.findIndex((function(e){return e.id===t.deviceId}));e>=0&&(this.devices[e]=s.convertToGenericDevice(t),this.trigger("deviceschange",bt.void))}},{key:"handleDevicePaired",value:function(t){this.devices.push(s.convertToGenericDevice(t)),this.trigger("deviceschange",bt.void)}},{key:"handleDeviceUnpaired",value:function(t){this.devices=this.devices.filter((function(e){return e.id!==t})),this.trigger("deviceschange",bt.void)}},{key:"handlePlayStatusChange",value:function(t,e){this.trigger("message",{event:ht.PlaybackStatusChange,deviceId:t,params:{playbackStatus:e.commandType}})}},{key:"handleTimeSync",value:function(t,e){this.trigger("message",{event:ht.PositionChange,deviceId:t,params:{position:e}})}}],r=[{key:"convertToGenericDevice",value:function(t){return{id:t.deviceId,name:t.name,type:K.AppleTv,available:t.status===ft.Online}}}],n&&Dt(e.prototype,n),r&&Dt(e,r),Object.defineProperty(e,"prototype",{writable:!1}),s}(vt);function Ut(t){return Ut="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ut(t)}function Gt(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,(void 0,i=function(t,e){if("object"!==Ut(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!==Ut(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(r.key),"symbol"===Ut(i)?i:String(i)),r)}var i}var Zt=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.bindFunctions()}var e,n;return e=t,(n=[{key:"bindFunctions",value:function(){this.schedule=this.schedule.bind(this),this.every=this.every.bind(this),this.trigger=this.trigger.bind(this),this.start=this.start.bind(this),this.stop=this.stop.bind(this)}},{key:"schedule",value:function(t){return this.task=t,this}},{key:"every",value:function(t){return this.intervalInMilliseconds=t,this}},{key:"trigger",value:function(){var t;return null===(t=this.task)||void 0===t||t.call(this,this),this}},{key:"start",value:function(){var t=this;return this.intervalId||(this.intervalId=setInterval((function(){return t.trigger()}),this.intervalInMilliseconds)),this}},{key:"stop",value:function(){return this.intervalId&&(clearInterval(this.intervalId),this.intervalId=void 0),this}}])&&Gt(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),t}();function zt(t){return zt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},zt(t)}function qt(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,(void 0,i=function(t,e){if("object"!==zt(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!==zt(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(r.key),"symbol"===zt(i)?i:String(i)),r)}var i}var Ht={reconnectIntervalInMilliseconds:3e3,heartbeatEnabled:!1,heartbeatIntervalInMillseconds:1e4,heartbeatMessage:""},Yt=function(){function t(e){var n=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Ht;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.bindFunctions(),this.url=e,this.options=Object.assign(Object.assign({},Ht),r),this.webSocket=this.connect(),this.heartbeat=(new Zt).schedule((function(){return n.send(n.options.heartbeatMessage)})).every(this.options.heartbeatIntervalInMillseconds)}var e,n;return e=t,(n=[{key:"bindFunctions",value:function(){this.cleanup=this.cleanup.bind(this),this.handleOpen=this.handleOpen.bind(this),this.handleMessage=this.handleMessage.bind(this),this.handleClose=this.handleClose.bind(this),this.handleError=this.handleError.bind(this),this.connect=this.connect.bind(this),this.send=this.send.bind(this),this.dipose=this.dipose.bind(this)}},{key:"cleanup",value:function(){this.heartbeat.stop(),this.webSocket.removeEventListener("error",this.handleError),this.webSocket.removeEventListener("message",this.handleMessage),this.webSocket.removeEventListener("open",this.handleOpen),this.webSocket.removeEventListener("close",this.handleClose)}},{key:"handleOpen",value:function(t){var e;null===(e=this.onOpen)||void 0===e||e.call(this,t),this.options.heartbeatEnabled&&this.heartbeat.start()}},{key:"handleMessage",value:function(t){var e;null===(e=this.onMessage)||void 0===e||e.call(this,t)}},{key:"handleClose",value:function(t){var e,n=this;null===(e=this.onClose)||void 0===e||e.call(this,t),this.cleanup(),setTimeout((function(){n.webSocket=n.connect()}),this.options.reconnectIntervalInMilliseconds)}},{key:"handleError",value:function(t){var e;null===(e=this.onError)||void 0===e||e.call(this,t),this.handleClose()}},{key:"connect",value:function(){var t=new WebSocket(this.url);return t.addEventListener("open",this.handleOpen),t.addEventListener("message",this.handleMessage),t.addEventListener("close",this.handleClose),t.addEventListener("error",this.handleError),t}},{key:"send",value:function(t){this.webSocket.send(t)}},{key:"dipose",value:function(){this.cleanup(),this.webSocket.close()}}])&&qt(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),t}(),Wt=function(){var t,e;return null!==(e=null===(t=window.crypto)||void 0===t?void 0:t.randomUUID())&&void 0!==e?e:Math.random().toString()};function $t(t){return $t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},$t(t)}function Qt(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,(void 0,i=function(t,e){if("object"!==$t(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!==$t(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(r.key),"symbol"===$t(i)?i:String(i)),r)}var i}var Xt,Jt=function(){function t(e,n){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this._timerStartedAt=0,this.position=0,this.duration=void 0,this.playing=!1,this.mute=!1,this.videoSource="",this.subtitleSource="",this.subtitles=!1,this.volume=0,this.title=e,this.device=n,this.ready=!1,this.playbackFinished=!1,this.debounced=mt(this,2e3),wt(this)}var e,n;return e=t,(n=[{key:"position",get:function(){return this._position+this.getTimerDurationInSeconds()},set:function(t){this._position=t,this.restartTimer()}},{key:"playing",get:function(){return this._playing},set:function(t){this._playing=t,t?this.restartTimer():(this._position+=this.getTimerDurationInSeconds(),this.stopTimer())}},{key:"restartTimer",value:function(){this._timerStartedAt=Date.now()}},{key:"stopTimer",value:function(){this._timerStartedAt=0}},{key:"getTimerDurationInSeconds",value:function(){return this._timerStartedAt?(Date.now()-this._timerStartedAt)/1e3:0}}])&&Qt(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),t}();function Kt(t){return Kt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Kt(t)}function te(){te=function(){return e};var t,e={},n=Object.prototype,r=n.hasOwnProperty,i=Object.defineProperty||function(t,e,n){t[e]=n.value},o="function"==typeof Symbol?Symbol:{},a=o.iterator||"@@iterator",s=o.asyncIterator||"@@asyncIterator",c=o.toStringTag||"@@toStringTag";function u(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{u({},"")}catch(t){u=function(t,e,n){return t[e]=n}}function l(t,e,n,r){var o=e&&e.prototype instanceof b?e:b,a=Object.create(o.prototype),s=new _(r||[]);return i(a,"_invoke",{value:E(t,n,s)}),a}function f(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}e.wrap=l;var h="suspendedStart",p="suspendedYield",d="executing",y="completed",v={};function b(){}function g(){}function m(){}var w={};u(w,a,(function(){return this}));var P=Object.getPrototypeOf,S=P&&P(P(I([])));S&&S!==n&&r.call(S,a)&&(w=S);var k=m.prototype=b.prototype=Object.create(w);function O(t){["next","throw","return"].forEach((function(e){u(t,e,(function(t){return this._invoke(e,t)}))}))}function j(t,e){function n(i,o,a,s){var c=f(t[i],t,o);if("throw"!==c.type){var u=c.arg,l=u.value;return l&&"object"==Kt(l)&&r.call(l,"__await")?e.resolve(l.__await).then((function(t){n("next",t,a,s)}),(function(t){n("throw",t,a,s)})):e.resolve(l).then((function(t){u.value=t,a(u)}),(function(t){return n("throw",t,a,s)}))}s(c.arg)}var o;i(this,"_invoke",{value:function(t,r){function i(){return new e((function(e,i){n(t,r,e,i)}))}return o=o?o.then(i,i):i()}})}function E(e,n,r){var i=h;return function(o,a){if(i===d)throw new Error("Generator is already running");if(i===y){if("throw"===o)throw a;return{value:t,done:!0}}for(r.method=o,r.arg=a;;){var s=r.delegate;if(s){var c=C(s,r);if(c){if(c===v)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(i===h)throw i=y,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);i=d;var u=f(e,n,r);if("normal"===u.type){if(i=r.done?y:p,u.arg===v)continue;return{value:u.arg,done:r.done}}"throw"===u.type&&(i=y,r.method="throw",r.arg=u.arg)}}}function C(e,n){var r=n.method,i=e.iterator[r];if(i===t)return n.delegate=null,"throw"===r&&e.iterator.return&&(n.method="return",n.arg=t,C(e,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),v;var o=f(i,e.iterator,n.arg);if("throw"===o.type)return n.method="throw",n.arg=o.arg,n.delegate=null,v;var a=o.arg;return a?a.done?(n[e.resultName]=a.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,v):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,v)}function x(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function T(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function _(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(x,this),this.reset(!0)}function I(e){if(e||""===e){var n=e[a];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var i=-1,o=function n(){for(;++i<e.length;)if(r.call(e,i))return n.value=e[i],n.done=!1,n;return n.value=t,n.done=!0,n};return o.next=o}}throw new TypeError(Kt(e)+" is not iterable")}return g.prototype=m,i(k,"constructor",{value:m,configurable:!0}),i(m,"constructor",{value:g,configurable:!0}),g.displayName=u(m,c,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===g||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,m):(t.__proto__=m,u(t,c,"GeneratorFunction")),t.prototype=Object.create(k),t},e.awrap=function(t){return{__await:t}},O(j.prototype),u(j.prototype,s,(function(){return this})),e.AsyncIterator=j,e.async=function(t,n,r,i,o){void 0===o&&(o=Promise);var a=new j(l(t,n,r,i),o);return e.isGeneratorFunction(n)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},O(k),u(k,c,"Generator"),u(k,a,(function(){return this})),u(k,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),n=[];for(var r in e)n.push(r);return n.reverse(),function t(){for(;n.length;){var r=n.pop();if(r in e)return t.value=r,t.done=!1,t}return t.done=!0,t}},e.values=I,_.prototype={constructor:_,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(T),!e)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var n=this;function i(r,i){return s.type="throw",s.arg=e,n.next=r,i&&(n.method="next",n.arg=t),!!i}for(var o=this.tryEntries.length-1;o>=0;--o){var a=this.tryEntries[o],s=a.completion;if("root"===a.tryLoc)return i("end");if(a.tryLoc<=this.prev){var c=r.call(a,"catchLoc"),u=r.call(a,"finallyLoc");if(c&&u){if(this.prev<a.catchLoc)return i(a.catchLoc,!0);if(this.prev<a.finallyLoc)return i(a.finallyLoc)}else if(c){if(this.prev<a.catchLoc)return i(a.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return i(a.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var o=i;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=t,a.arg=e,o?(this.method="next",this.next=o.finallyLoc,v):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),v},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),T(n),v}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var i=r.arg;T(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:I(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),v}},e}function ee(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,(void 0,i=function(t,e){if("object"!==Kt(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!==Kt(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(r.key),"symbol"===Kt(i)?i:String(i)),r)}var i}function ne(){return ne="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=ie(t)););return t}(t,e);if(r){var i=Object.getOwnPropertyDescriptor(r,e);return i.get?i.get.call(arguments.length<3?t:n):i.value}},ne.apply(this,arguments)}function re(t,e){return re=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},re(t,e)}function ie(t){return ie=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},ie(t)}!function(t){t.Update="update",t.Volume="volume",t.Playing="playing",t.Paused="paused",t.NewChapter="new_chapter",t.Stopped="stopped",t.Ready="ready",t.Mute="mute",t.Finished="finished"}(Xt||(Xt={}));var oe=function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function a(t){try{c(r.next(t))}catch(t){o(t)}}function s(t){try{c(r.throw(t))}catch(t){o(t)}}function c(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}c((r=r.apply(t,e||[])).next())}))},ae=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&re(t,e)}(a,t);var e,n,r,i,o=(r=a,i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=ie(r);if(i){var n=ie(this).constructor;t=Reflect.construct(e,arguments,n)}else t=e.apply(this,arguments);return function(t,e){if(e&&("object"===Kt(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(this,t)});function a(t,e){var n;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,a),(n=o.call(this)).client=t,n.localState=new Jt(e.title,e.device),n.bindFunctions(),n.initialize(),n}return e=a,(n=[{key:"bindFunctions",value:function(){this.initialize=this.initialize.bind(this),this.dispose=this.dispose.bind(this),this.handleClientConnected=this.handleClientConnected.bind(this),this.handleDisconnectMessage=this.handleDisconnectMessage.bind(this),this.handleAllVideoMessages=this.handleAllVideoMessages.bind(this),this.handleUpdateMessage=this.handleUpdateMessage.bind(this),this.handleVolumeMessage=this.handleVolumeMessage.bind(this),this.handlePlayingMessage=this.handlePlayingMessage.bind(this),this.handlePausedMessage=this.handlePausedMessage.bind(this),this.handleFinishedMessage=this.handleFinishedMessage.bind(this),this.handleNewChapterMessage=this.handleNewChapterMessage.bind(this),this.handleStoppedMessage=this.handleStoppedMessage.bind(this),this.loadSource=this.loadSource.bind(this),this.play=this.play.bind(this),this.pause=this.pause.bind(this),this.seek=this.seek.bind(this),this.setVolume=this.setVolume.bind(this),this.isPlaying=this.isPlaying.bind(this),this.getPosition=this.getPosition.bind(this),this.getDuration=this.getDuration.bind(this),this.getVolume=this.getVolume.bind(this)}},{key:"initialize",value:function(){var t=this;this.client.on("dispose",this.dispose),this.client.on("connected",this.handleClientConnected),this.client.on("message",this.handleDisconnectMessage).filter((function(e){return e.source===t.getDevice().id&&"disconnect"===e.message.type})),this.client.on("message",this.handleAllVideoMessages).filter((function(e){return e.source===t.getDevice().id&&"video_event"===e.message.type}))}},{key:"dispose",value:function(){this.client.off("dispose",this.dispose),this.client.off("connected",this.handleClientConnected),this.client.off("message",this.handleDisconnectMessage),this.client.off("message",this.handleAllVideoMessages),this.client.stop(this.getDevice().id).catch((function(t){return console.error(t)})),ne(ie(a.prototype),"dispose",this).call(this)}},{key:"handleClientConnected",value:function(){return oe(this,void 0,void 0,te().mark((function t(){return te().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,this.client.joinRoom(this.getDevice().id);case 3:t.next=8;break;case 5:t.prev=5,t.t0=t.catch(0),this.trigger("error",t.t0);case 8:case"end":return t.stop()}}),t,this,[[0,5]])})))}},{key:"handleDisconnectMessage",value:function(){this.dispose()}},{key:"handleAllVideoMessages",value:function(t){var e=this.localState.debounced,n=t.message.payload.params||{};switch(t.message.payload.event){case Xt.Update:this.handleUpdateMessage(e,n);break;case Xt.NewChapter:this.handleNewChapterMessage(e,n);break;case Xt.Volume:this.handleVolumeMessage(e,n);break;case Xt.Playing:this.handlePlayingMessage(e);break;case Xt.Paused:this.handlePausedMessage(e);break;case Xt.Finished:this.handleFinishedMessage(e);break;case Xt.Stopped:this.handleStoppedMessage()}}},{key:"handleUpdateMessage",value:function(t,e){t.duration!==e.duration&&(t.duration=e.duration,this.trigger("durationchange",bt.void)),t.position!==e.position&&(t.position=e.position,this.trigger("positionchange",bt.void)),t.subtitles!==e.subtitles&&(t.subtitles=e.subtitles,this.trigger("subtitleschange",bt.void))}},{key:"handleVolumeMessage",value:function(t,e){t.volume!==e.level&&(t.volume=e.level,t.mute=0===e.level,this.trigger("volumechange",bt.void))}},{key:"handlePlayingMessage",value:function(t){!0!==t.playing&&(t.playing=!0,t.playbackFinished=!1,this.trigger("playingchange",bt.void))}},{key:"handlePausedMessage",value:function(t){!1!==t.playing&&(t.playing=!1,this.trigger("playingchange",bt.void))}},{key:"handleFinishedMessage",value:function(t){!0!==t.playbackFinished&&(t.playing=!1,t.playbackFinished=!0,this.trigger("playingchange",bt.void))}},{key:"handleNewChapterMessage",value:function(t,e){var n,r=(null!==(n=e.queue)&&void 0!==n?n:[]).find((function(e){return e.url===t.videoSource}));if(!r)return console.info("The device is no longer playing the source we loaded - disposing the session"),void this.dispose();t.subtitleSource!==r.suburl&&(t.subtitleSource=r.suburl,this.trigger("subtitleschange",bt.void))}},{key:"handleStoppedMessage",value:function(){this.dispose()}},{key:"loadSource",value:function(t,e){return oe(this,void 0,void 0,te().mark((function n(){var r,i;return te().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(this.localState.videoSource!==t||this.localState.subtitleSource!==e){n.next=2;break}return n.abrupt("return");case 2:return n.prev=2,r=this.getDevice().id,i=this.getPosition(),this.localState.videoSource=t,this.localState.subtitleSource=e,this.localState.ready=!1,n.next=10,this.client.joinRoom(r);case 10:return n.next=12,this.client.loadQueue({title:this.getTitle(),roomId:r,videoSource:t,subtitleSource:e});case 12:this.localState.ready=!0,this.trigger("sourceloaded",bt.void),i>0&&this.client.seek(r,i),n.next=21;break;case 17:n.prev=17,n.t0=n.catch(2),console.error(n.t0),this.trigger("error",new Error("Could not load video on Vivi device"));case 21:case"end":return n.stop()}}),n,this,[[2,17]])})))}},{key:"play",value:function(){this.localState.ready&&!0!==this.localState.playing&&(this.localState.playing=!0,this.client.play(this.getDevice().id),this.trigger("playingchange",bt.void))}},{key:"pause",value:function(){this.localState.ready&&!1!==this.localState.playing&&(this.localState.playing=!1,this.client.pause(this.getDevice().id),this.trigger("playingchange",bt.void))}},{key:"seek",value:function(t){this.localState.ready&&this.localState.position!==t&&(this.localState.position=t,this.client.seek(this.getDevice().id,t),this.trigger("positionchange",bt.void))}},{key:"setVolume",value:function(t){this.localState.ready&&this.localState.volume!==t&&(this.localState.volume=t,this.client.setVolume(this.getDevice().id,t),this.trigger("volumechange",bt.void))}},{key:"setMuted",value:function(t){this.localState.ready&&this.localState.mute!==t&&(this.localState.mute=t,this.client.setMuted(this.getDevice().id,t),this.trigger("volumechange",bt.void))}},{key:"setSubtitles",value:function(t){return oe(this,void 0,void 0,te().mark((function e(){var n;return te().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.localState.ready){e.next=2;break}return e.abrupt("return");case 2:if(!t){e.next=5;break}return e.next=5,this.loadSource(this.localState.videoSource,t);case 5:n=!!t,this.localState.subtitles!==n&&(this.localState.subtitles=n,this.client.setSubtitles(this.getDevice().id,n),this.trigger("subtitleschange",bt.void));case 7:case"end":return e.stop()}}),e,this)})))}},{key:"isPlaying",value:function(){return this.localState.playing}},{key:"isPlaybackFinished",value:function(){return this.localState.playbackFinished}},{key:"getPosition",value:function(){return this.localState.position}},{key:"getDuration",value:function(){return this.localState.duration}},{key:"getVolume",value:function(){return this.localState.volume}},{key:"getMuted",value:function(){return this.localState.mute}},{key:"getSubtitles",value:function(){if(this.localState.subtitles)return this.localState.subtitleSource}},{key:"getDevice",value:function(){return this.localState.device}},{key:"getTitle",value:function(){return this.localState.title}}])&&ee(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),a}(vt);function se(t){return se="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},se(t)}function ce(){ce=function(){return e};var t,e={},n=Object.prototype,r=n.hasOwnProperty,i=Object.defineProperty||function(t,e,n){t[e]=n.value},o="function"==typeof Symbol?Symbol:{},a=o.iterator||"@@iterator",s=o.asyncIterator||"@@asyncIterator",c=o.toStringTag||"@@toStringTag";function u(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{u({},"")}catch(t){u=function(t,e,n){return t[e]=n}}function l(t,e,n,r){var o=e&&e.prototype instanceof b?e:b,a=Object.create(o.prototype),s=new _(r||[]);return i(a,"_invoke",{value:E(t,n,s)}),a}function f(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}e.wrap=l;var h="suspendedStart",p="suspendedYield",d="executing",y="completed",v={};function b(){}function g(){}function m(){}var w={};u(w,a,(function(){return this}));var P=Object.getPrototypeOf,S=P&&P(P(I([])));S&&S!==n&&r.call(S,a)&&(w=S);var k=m.prototype=b.prototype=Object.create(w);function O(t){["next","throw","return"].forEach((function(e){u(t,e,(function(t){return this._invoke(e,t)}))}))}function j(t,e){function n(i,o,a,s){var c=f(t[i],t,o);if("throw"!==c.type){var u=c.arg,l=u.value;return l&&"object"==se(l)&&r.call(l,"__await")?e.resolve(l.__await).then((function(t){n("next",t,a,s)}),(function(t){n("throw",t,a,s)})):e.resolve(l).then((function(t){u.value=t,a(u)}),(function(t){return n("throw",t,a,s)}))}s(c.arg)}var o;i(this,"_invoke",{value:function(t,r){function i(){return new e((function(e,i){n(t,r,e,i)}))}return o=o?o.then(i,i):i()}})}function E(e,n,r){var i=h;return function(o,a){if(i===d)throw new Error("Generator is already running");if(i===y){if("throw"===o)throw a;return{value:t,done:!0}}for(r.method=o,r.arg=a;;){var s=r.delegate;if(s){var c=C(s,r);if(c){if(c===v)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(i===h)throw i=y,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);i=d;var u=f(e,n,r);if("normal"===u.type){if(i=r.done?y:p,u.arg===v)continue;return{value:u.arg,done:r.done}}"throw"===u.type&&(i=y,r.method="throw",r.arg=u.arg)}}}function C(e,n){var r=n.method,i=e.iterator[r];if(i===t)return n.delegate=null,"throw"===r&&e.iterator.return&&(n.method="return",n.arg=t,C(e,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),v;var o=f(i,e.iterator,n.arg);if("throw"===o.type)return n.method="throw",n.arg=o.arg,n.delegate=null,v;var a=o.arg;return a?a.done?(n[e.resultName]=a.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,v):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,v)}function x(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function T(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function _(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(x,this),this.reset(!0)}function I(e){if(e||""===e){var n=e[a];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var i=-1,o=function n(){for(;++i<e.length;)if(r.call(e,i))return n.value=e[i],n.done=!1,n;return n.value=t,n.done=!0,n};return o.next=o}}throw new TypeError(se(e)+" is not iterable")}return g.prototype=m,i(k,"constructor",{value:m,configurable:!0}),i(m,"constructor",{value:g,configurable:!0}),g.displayName=u(m,c,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===g||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,m):(t.__proto__=m,u(t,c,"GeneratorFunction")),t.prototype=Object.create(k),t},e.awrap=function(t){return{__await:t}},O(j.prototype),u(j.prototype,s,(function(){return this})),e.AsyncIterator=j,e.async=function(t,n,r,i,o){void 0===o&&(o=Promise);var a=new j(l(t,n,r,i),o);return e.isGeneratorFunction(n)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},O(k),u(k,c,"Generator"),u(k,a,(function(){return this})),u(k,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),n=[];for(var r in e)n.push(r);return n.reverse(),function t(){for(;n.length;){var r=n.pop();if(r in e)return t.value=r,t.done=!1,t}return t.done=!0,t}},e.values=I,_.prototype={constructor:_,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(T),!e)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var n=this;function i(r,i){return s.type="throw",s.arg=e,n.next=r,i&&(n.method="next",n.arg=t),!!i}for(var o=this.tryEntries.length-1;o>=0;--o){var a=this.tryEntries[o],s=a.completion;if("root"===a.tryLoc)return i("end");if(a.tryLoc<=this.prev){var c=r.call(a,"catchLoc"),u=r.call(a,"finallyLoc");if(c&&u){if(this.prev<a.catchLoc)return i(a.catchLoc,!0);if(this.prev<a.finallyLoc)return i(a.finallyLoc)}else if(c){if(this.prev<a.catchLoc)return i(a.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return i(a.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var o=i;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=t,a.arg=e,o?(this.method="next",this.next=o.finallyLoc,v):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),v},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),T(n),v}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var i=r.arg;T(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:I(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),v}},e}function ue(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,(void 0,i=function(t,e){if("object"!==se(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!==se(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(r.key),"symbol"===se(i)?i:String(i)),r)}var i}function le(){return le="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=he(t)););return t}(t,e);if(r){var i=Object.getOwnPropertyDescriptor(r,e);return i.get?i.get.call(arguments.length<3?t:n):i.value}},le.apply(this,arguments)}function fe(t,e){return fe=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},fe(t,e)}function he(t){return he=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},he(t)}var pe=function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function a(t){try{c(r.next(t))}catch(t){o(t)}}function s(t){try{c(r.throw(t))}catch(t){o(t)}}function c(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}c((r=r.apply(t,e||[])).next())}))},de=1e4,ye=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&fe(t,e)}(s,t);var e,n,r,i,o,a=(i=s,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=he(i);if(o){var n=he(this).constructor;t=Reflect.construct(e,arguments,n)}else t=e.apply(this,arguments);return function(t,e){if(e&&("object"===se(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(this,t)});function s(t){var e;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,s),(e=a.call(this)).options=t,e.accessToken="",e.devices=[],e.devicesFingerprint="",e.deviceDiscovery=new Zt,e.bindFunctions(),e.initialize(),e}return e=s,r=[{key:"createAckId",value:function(){return Wt()}},{key:"calculateFingerprint",value:function(t){return t.map((function(t){return t.id})).sort().join(",")}}],(n=[{key:"bindFunctions",value:function(){this.initialize=this.initialize.bind(this),this.sendMessage=this.sendMessage.bind(this),this.sendMessageDebounced=(0,gt.Ds)(this.sendMessage,500,!0),this.beginDeviceDiscovery=this.beginDeviceDiscovery.bind(this),this.dispose=this.dispose.bind(this),this.canCastToDevice=this.canCastToDevice.bind(this),this.getDevices=this.getDevices.bind(this),this.startCastSession=this.startCastSession.bind(this),this.authenticateWithVivi=this.authenticateWithVivi.bind(this),this.getRoomList=this.getRoomList.bind(this),this.joinRoom=this.joinRoom.bind(this),this.query=this.query.bind(this),this.loadQueue=this.loadQueue.bind(this),this.play=this.play.bind(this),this.pause=this.pause.bind(this),this.stop=this.stop.bind(this),this.seek=this.seek.bind(this),this.setVolume=this.setVolume.bind(this),this.setMuted=this.setMuted.bind(this),this.setSubtitles=this.setSubtitles.bind(this)}},{key:"initialize",value:function(){var t=this;this.webSocket=new Yt(this.options.url.toString()),this.webSocket.onMessage=function(e){return t.trigger("message",JSON.parse(e.data))},this.webSocket.onOpen=function(){return pe(t,void 0,void 0,ce().mark((function t(){return ce().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,this.options.fetchAccessToken();case 3:return this.accessToken=t.sent,t.next=6,this.authenticateWithVivi();case 6:this.beginDeviceDiscovery(),this.trigger("connected",bt.void),t.next=14;break;case 10:t.prev=10,t.t0=t.catch(0),console.error(t.t0),this.trigger("error",new Error("Could not connect to Vivi"));case 14:case"end":return t.stop()}}),t,this,[[0,10]])})))}}},{key:"sendMessage",value:function(t){var e;null===(e=this.webSocket)||void 0===e||e.send(JSON.stringify(t))}},{key:"beginDeviceDiscovery",value:function(){var t=this;this.deviceDiscovery.every(1e4).schedule((function(){return pe(t,void 0,void 0,ce().mark((function t(){var e,n;return ce().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,this.getRoomList();case 3:if(e=t.sent,(n=s.calculateFingerprint(e))!==this.devicesFingerprint){t.next=7;break}return t.abrupt("return");case 7:this.devices=e.map((function(t){return{id:t.id,name:t.name,type:K.Vivi,available:!0}})),this.devicesFingerprint=n,this.trigger("deviceschange",bt.void),t.next=15;break;case 12:t.prev=12,t.t0=t.catch(0),console.warn(t.t0);case 15:case"end":return t.stop()}}),t,this,[[0,12]])})))})).trigger().start()}},{key:"dispose",value:function(){var t;this.deviceDiscovery.stop(),null===(t=this.webSocket)||void 0===t||t.dipose(),le(he(s.prototype),"dispose",this).call(this)}},{key:"canCastToDevice",value:function(t){return t===K.Vivi}},{key:"getDevices",value:function(){return this.devices}},{key:"startCastSession",value:function(t){return new ae(this,t)}},{key:"authenticateWithVivi",value:function(){return pe(this,void 0,void 0,ce().mark((function t(){return ce().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this.sendMessage({destination:"relay",message:{token:this.accessToken,type:"identify_video_api"}}),t.next=3,this.one("message",(function(t){return"video_api_identified"===t.message.type})).timeout(de).catch((function(){throw new Error("Failed to authenticate with Vivi")}));case 3:case"end":return t.stop()}}),t,this)})))}},{key:"getRoomList",value:function(){return pe(this,void 0,void 0,ce().mark((function t(){var e;return ce().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this.sendMessage({destination:"relay",message:{type:"video_api_rooms"}}),t.next=3,this.one("message",(function(t){return"video_api_rooms"===t.message.type})).timeout(de).catch((function(){throw new Error("Failed to fetch rooms")}));case 3:return e=t.sent,t.abrupt("return",e.message.rooms||[]);case 5:case"end":return t.stop()}}),t,this)})))}},{key:"joinRoom",value:function(t){return pe(this,void 0,void 0,ce().mark((function e(){return ce().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.sendMessage({destination:"relay",message:{destination_type:"box",new_destination:t,token:this.accessToken,type:"connect"}}),e.next=3,this.one("message",(function(e){return e.source===t&&"connect"===e.message.type||"error"===e.message.type&&"already_connected"===e.message.error_type||void 0})).timeout(de).catch((function(){throw new Error("Failed to join room")}));case 3:case"end":return e.stop()}}),e,this)})))}},{key:"query",value:function(t){return pe(this,void 0,void 0,ce().mark((function e(){var n;return ce().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=s.createAckId(),this.sendMessage({destination:t,message:{type:"message_with_ack",ack_id:n,name:"query"}}),e.next=4,this.one("message",(function(t){return t.message.ack_id===n})).timeout(de).catch((function(){throw new Error("Failed to fetch query")}));case 4:return e.abrupt("return",e.sent);case 5:case"end":return e.stop()}}),e,this)})))}},{key:"loadQueue",value:function(t){var e=t.roomId,n=t.title,r=t.videoSource,i=t.subtitleSource;return pe(this,void 0,void 0,ce().mark((function t(){return ce().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this.sendMessage({destination:e,message:{type:"message_with_ack",ack_id:s.createAckId(),name:"queue_load",payload:{urls:[{title:n,url:r,suburl:i}]}}}),t.next=3,this.one("message",(function(t){var n;return t.source===e&&"ready"===(null===(n=t.message.payload)||void 0===n?void 0:n.event)})).timeout(de).catch((function(){throw new Error("Failed to load media")}));case 3:case"end":return t.stop()}}),t,this)})))}},{key:"play",value:function(t){return pe(this,void 0,void 0,ce().mark((function e(){return ce().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.sendMessage({destination:t,message:{type:"message",name:"video_play",payload:{}}}),e.next=3,this.one("message",(function(e){var n;return e.source===t&&"playing"===(null===(n=e.message.payload)||void 0===n?void 0:n.event)})).timeout(de).catch((function(){throw new Error("Failed to play video")}));case 3:case"end":return e.stop()}}),e,this)})))}},{key:"pause",value:function(t){return pe(this,void 0,void 0,ce().mark((function e(){return ce().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.sendMessage({destination:t,message:{type:"message",name:"video_pause"}}),e.next=3,this.one("message",(function(e){var n;return e.source===t&&"paused"===(null===(n=e.message.payload)||void 0===n?void 0:n.event)})).timeout(de).catch((function(){throw new Error("Failed to pause video")}));case 3:case"end":return e.stop()}}),e,this)})))}},{key:"stop",value:function(t){return pe(this,void 0,void 0,ce().mark((function e(){return ce().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.sendMessage({destination:t,message:{type:"message",name:"video_stop"}}),e.next=3,this.one("message",(function(e){var n;return e.source===t&&"stopped"===(null===(n=e.message.payload)||void 0===n?void 0:n.event)})).timeout(de).catch((function(){throw new Error("Failed to stop video")}));case 3:case"end":return e.stop()}}),e,this)})))}},{key:"seek",value:function(t,e){return pe(this,void 0,void 0,ce().mark((function n(){return ce().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(!this.sendMessageDebounced({destination:t,message:{type:"message",name:"video_seek",payload:{position:e}}})){n.next=4;break}return n.next=4,this.one("message",(function(e){var n;return e.source===t&&"playing"===(null===(n=e.message.payload)||void 0===n?void 0:n.event)})).timeout(de).catch((function(){throw new Error("Failed to seek video")}));case 4:case"end":return n.stop()}}),n,this)})))}},{key:"setVolume",value:function(t,e){return pe(this,void 0,void 0,ce().mark((function n(){return ce().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(!this.sendMessageDebounced({destination:t,message:{type:"message",name:"set_volume",payload:{volume:e}}})){n.next=4;break}return n.next=4,this.one("message",(function(e){var n;return e.source===t&&"volume"===(null===(n=e.message.payload)||void 0===n?void 0:n.event)})).timeout(de).catch((function(){throw new Error("Failed to set volume")}));case 4:case"end":return n.stop()}}),n,this)})))}},{key:"setMuted",value:function(t,e){return pe(this,void 0,void 0,ce().mark((function n(){return ce().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return this.sendMessage({destination:t,message:{type:"message",name:"set_mute",payload:{mute:e}}}),n.next=3,this.one("message",(function(e){var n;return e.source===t&&"mute"===(null===(n=e.message.payload)||void 0===n?void 0:n.event)})).timeout(de).catch((function(){throw new Error("Failed to set mute")}));case 3:case"end":return n.stop()}}),n,this)})))}},{key:"setSubtitles",value:function(t,e){return pe(this,void 0,void 0,ce().mark((function n(){var r;return ce().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return r=s.createAckId(),this.sendMessage({destination:t,message:{type:"message_with_ack",ack_id:r,name:"set_subtitles",payload:{subtitles:e}}}),n.next=4,this.one("message",(function(e){return e.source===t&&e.message.ack_id===r})).timeout(de).catch((function(){throw new Error("Failed to set subtitles")}));case 4:case"end":return n.stop()}}),n,this)})))}}])&&ue(e.prototype,n),r&&ue(e,r),Object.defineProperty(e,"prototype",{writable:!1}),s}(vt);function ve(t){return ve="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ve(t)}function be(t){return function(t){if(Array.isArray(t))return ge(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(t){if("string"==typeof t)return ge(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?ge(t,e):void 0}}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function ge(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function me(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,(void 0,i=function(t,e){if("object"!==ve(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!==ve(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(r.key),"symbol"===ve(i)?i:String(i)),r)}var i}function we(){return we="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=Se(t)););return t}(t,e);if(r){var i=Object.getOwnPropertyDescriptor(r,e);return i.get?i.get.call(arguments.length<3?t:n):i.value}},we.apply(this,arguments)}function Pe(t,e){return Pe=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Pe(t,e)}function Se(t){return Se=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Se(t)}var ke=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Pe(t,e)}(s,t);var e,n,r,i,o,a=(i=s,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=Se(i);if(o){var n=Se(this).constructor;t=Reflect.construct(e,arguments,n)}else t=e.apply(this,arguments);return function(t,e){if(e&&("object"===ve(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(this,t)});function s(t){var e;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,s),(e=a.call(this)).instanceId=t,e.clients=[],e.bindFunctions(),e}return e=s,r=[{key:"getOrCreateInstance",value:function(t){if(!t)throw new Error("instanceId is required");return this.instances[t]||(this.instances[t]=new s(t)),this.instances[t]}},{key:"disposeAndRemoveInstance",value:function(t){t.dispose(),delete this.instances[t.instanceId]}},{key:"isActive",value:function(){return Object.keys(this.instances).length>0}}],(n=[{key:"bindFunctions",value:function(){this.addClient=this.addClient.bind(this),this.hasInstanceOfClient=this.hasInstanceOfClient.bind(this),this.startCastSession=this.startCastSession.bind(this),this.gatherAndPublishDevices=this.gatherAndPublishDevices.bind(this),this.dispose=this.dispose.bind(this)}},{key:"addClient",value:function(t){var e=this;t.on("deviceschange",this.gatherAndPublishDevices),t.on("error",(function(t){return e.trigger("error",t)})),this.clients.push(t)}},{key:"hasInstanceOfClient",value:function(t){return this.clients.some((function(e){return e instanceof t}))}},{key:"startCastSession",value:function(t){var e=this;if(this.castSession){if(this.castSession.getDevice().id===t.device.id)return void console.info("A session with device ".concat(t.device.id," already exists - this is a no-op"));this.castSession.dispose()}var n=this.clients.find((function(e){return e.canCastToDevice(t.device.type)}));n&&(this.castSession=n.startCastSession(t),this.castSession.on("error",(function(t){e.castSession.dispose(),e.trigger("error",t)})),this.castSession.on("dispose",(function(){e.castSession=void 0,e.trigger("castsessionchange",void 0)})),this.trigger("castsessionchange",this.castSession))}},{key:"getCastSession",value:function(){return this.castSession}},{key:"gatherAndPublishDevices",value:function(){var t=this.clients.map((function(t){return t.getDevices()})).reduce((function(t,e){return[].concat(be(t),be(e))}),[]);this.trigger("deviceschange",t)}},{key:"dispose",value:function(){var t;null===(t=this.castSession)||void 0===t||t.dispose(),this.clients.forEach((function(t){return t.dispose()})),this.castSession=void 0,this.clients=[],we(Se(s.prototype),"dispose",this).call(this)}}])&&me(e.prototype,n),r&&me(e,r),Object.defineProperty(e,"prototype",{writable:!1}),s}(vt);ke.instances={};var Oe=n(30050),je=n(98115);function Ee(t){return Ee="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ee(t)}function Ce(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,(void 0,i=function(t,e){if("object"!==Ee(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!==Ee(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(r.key),"symbol"===Ee(i)?i:String(i)),r)}var i}function xe(){return xe="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=Ie(t)););return t}(t,e);if(r){var i=Object.getOwnPropertyDescriptor(r,e);return i.get?i.get.call(arguments.length<3?t:n):i.value}},xe.apply(this,arguments)}function Te(t,e){return Te=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Te(t,e)}function _e(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Ie(t){return Ie=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Ie(t)}var Re=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Te(t,e)}(a,t);var e,n,r,i,o=(r=a,i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=Ie(r);if(i){var n=Ie(this).constructor;t=Reflect.construct(e,arguments,n)}else t=e.apply(this,arguments);return function(t,e){if(e&&("object"===Ee(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return _e(t)}(this,t)});function a(t,e){var n;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,a),(n=o.call(this,t,e)).isVisible=n.isVisible.bind(_e(n)),n}return e=a,(n=[{key:"createEl",value:function(){return xe(Ie(a.prototype),"createEl",this).call(this,"li",{className:"vjs-menu-item cv-device-menu-item",innerHTML:'\n <span class="cv-device-icon '.concat({vivi:"cv-vivi-icon","apple-tv":"cv-apple-icon"}[this.options_.type],'"></span>\n <span class="vjs-menu-item-text">').concat(this.options_.label,"</span>\n ")})}},{key:"handleClick",value:function(){this.options_.onClick()}},{key:"show",value:function(){xe(Ie(a.prototype),"show",this).call(this)}},{key:"hide",value:function(){xe(Ie(a.prototype),"hide",this).call(this)}},{key:"isVisible",value:function(){return!xe(Ie(a.prototype),"hasClass",this).call(this,"vjs-hidden")}}])&&Ce(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),a}(o.Z.getComponent("MenuItem"));function Le(t){return Le="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Le(t)}function De(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,(void 0,i=function(t,e){if("object"!==Le(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!==Le(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(r.key),"symbol"===Le(i)?i:String(i)),r)}var i}function Me(){return Me="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=Ae(t)););return t}(t,e);if(r){var i=Object.getOwnPropertyDescriptor(r,e);return i.get?i.get.call(arguments.length<3?t:n):i.value}},Me.apply(this,arguments)}function Ne(t,e){return Ne=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Ne(t,e)}function Ae(t){return Ae=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Ae(t)}var Ve=o.Z.getComponent("MenuButton"),Fe=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Ne(t,e)}(a,t);var e,n,r,i,o=(r=a,i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=Ae(r);if(i){var n=Ae(this).constructor;t=Reflect.construct(e,arguments,n)}else t=e.apply(this,arguments);return function(t,e){if(e&&("object"===Le(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(this,t)});function a(t,e){var n;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,a),(n=o.call(this,t,e)).alwaysCollapsed=!1,n.isCollapsed=!1,n.isCollabsible=!0,n.className="cv-devices-menu-button",n.searchText="",n.devices=[],n.castSession=void 0,n.bindFunctions(),n.bindEventListeners(),n}return e=a,n=[{key:"bindFunctions",value:function(){this.bindEventListeners=this.bindEventListeners.bind(this),this.setDevices=this.setDevices.bind(this),this.setCastSession=this.setCastSession.bind(this),this.setSearchText=this.setSearchText.bind(this),this.getDeviceMenuItems=this.getDeviceMenuItems.bind(this),this.render=this.render.bind(this),this.removeMenuItems=this.removeMenuItems.bind(this),this.addMenuItemsForDevices=this.addMenuItemsForDevices.bind(this),this.shouldShowSearchInput=this.shouldShowSearchInput.bind(this),this.toggleSearchInput=this.toggleSearchInput.bind(this),this.toggleDeviceMenuItems=this.toggleDeviceMenuItems.bind(this),this.toggleEmptyStatePlaceholder=this.toggleEmptyStatePlaceholder.bind(this)}},{key:"bindEventListeners",value:function(){var t=this,e=this.$("button"),n=function(e){t.menu.handleBlur(e)};e.addEventListener("blur",n),this.one("dispose",(function(){e.removeEventListener("blur",n)}))}},{key:"createEl",value:function(){for(var t,e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return(t=Ve.prototype.createEl).apply.apply(t,[this].concat(n))}},{key:"buildWrapperCSSClass",value:function(){return"cv-menu-small cv-devices-button ".concat(Me(Ae(a.prototype),"buildWrapperCSSClass",this).call(this))}},{key:"createItems",value:function(){var t=this,e=[];return this.headingItem=new Oe.Z(this.player_,{label:this.localize("Select a device"),selectable:!1}),this.searchInputItem=new je.Z(this.player_,{menuButton:this,search:function(e){return t.setSearchText(e)},className:"cv-devices-search-input"}),this.emptyPlaceholder=new je.C(this.player_,{label:"No devices found",selected:!1,selectable:!1,multiSelectable:!1}),this.headingItem.show(),this.searchInputItem.hide(),this.emptyPlaceholder.show(),e.push(this.headingItem,this.searchInputItem,this.emptyPlaceholder),e}},{key:"pressButton",value:function(){var t;Me(Ae(a.prototype),"pressButton",this).call(this),this.shouldShowSearchInput()&&(null===(t=this.searchInputItem)||void 0===t||t.focus())}},{key:"setDevices",value:function(t){this.devices=t,this.render()}},{key:"setCastSession",value:function(t){this.castSession=t,this.render()}},{key:"setSearchText",value:function(t){this.searchText=t,this.render()}},{key:"getDeviceMenuItems",value:function(){return this.menu.children_.filter((function(t){return t instanceof Re}))}},{key:"render",value:function(){this.removeMenuItems(this.getDeviceMenuItems()),this.addMenuItemsForDevices(this.devices),this.toggleSearchInput(),this.toggleDeviceMenuItems(),this.toggleEmptyStatePlaceholder()}},{key:"removeMenuItems",value:function(t){var e=this;t.forEach((function(t){e.menu.removeChild(t),t.dispose()}))}},{key:"addMenuItemsForDevices",value:function(t){var e=this;t.sort((function(t,e){return"".concat(t.type,"-").concat(t.name).localeCompare("".concat(e.type,"-").concat(e.name))})).forEach((function(t){var n=new Re(e.player(),{id:t.id,label:t.name,selected:!1,multiSelectable:!1,selectable:!0,available:t.available,type:t.type,onClick:function(){e.options_.onDeviceMenuItemClick(n,t)}});e.menu.addItem(n)}))}},{key:"shouldShowSearchInput",value:function(){return this.getDeviceMenuItems().length>=20}},{key:"toggleSearchInput",value:function(){this.shouldShowSearchInput()?(this.headingItem.hide(),this.searchInputItem.show(),this.menu.addClass("vertical-fill")):(this.headingItem.show(),this.searchInputItem.hide(),this.menu.removeClass("vertical-fill"))}},{key:"toggleDeviceMenuItems",value:function(){var t=this,e=this.getDeviceMenuItems(),n=this.shouldShowSearchInput(),r=this.searchText.toLowerCase();e.forEach((function(e){var i,o=t.devices.find((function(t){return t.id===e.options_.id}));if(o){var a=o.available,s=!n||-1!==o.name.toLowerCase().indexOf(r),c=o.id===(null===(i=t.castSession)||void 0===i?void 0:i.getDevice().id);a?e.enable():e.disable(),s?e.show():e.hide(),c?e.selected(!0):e.selected(!1)}}))}},{key:"toggleEmptyStatePlaceholder",value:function(){var t=this.getDeviceMenuItems();t.filter((function(t){return t.isVisible()})).length?this.emptyPlaceholder.hide():this.emptyPlaceholder.show(),t.length?this.emptyPlaceholder.setLabel(this.localize("No matching results")):this.emptyPlaceholder.setLabel(this.localize("No devices found"))}},{key:"getCollabsibleName",value:function(){return this.controlText_}},{key:"getCollabsibleValue",value:function(){var t,e;return null!==(e=null===(t=this.castSession)||void 0===t?void 0:t.getDevice().name)&&void 0!==e?e:" "}},{key:"showInCollabsibleMenu",value:function(){return!0}},{key:"showCollapsibleMenu",value:function(){this.handleClick()}},{key:"handleClick",value:function(){Me(Ae(a.prototype),"handleClick",this).call(this,null),this.options_.onClick()}}],n&&De(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),a}(Ve);Fe.prototype.controlText_="Devices",o.Z.registerComponent("DevicesButton",Fe);var Be=n(10463);function Ue(t){return Ue="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ue(t)}function Ge(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,(void 0,i=function(t,e){if("object"!==Ue(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!==Ue(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(r.key),"symbol"===Ue(i)?i:String(i)),r)}var i}function Ze(){return Ze="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=qe(t)););return t}(t,e);if(r){var i=Object.getOwnPropertyDescriptor(r,e);return i.get?i.get.call(arguments.length<3?t:n):i.value}},Ze.apply(this,arguments)}function ze(t,e){return ze=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},ze(t,e)}function qe(t){return qe=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},qe(t)}var He=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&ze(t,e)}(a,t);var e,n,r,i,o=(r=a,i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=qe(r);if(i){var n=qe(this).constructor;t=Reflect.construct(e,arguments,n)}else t=e.apply(this,arguments);return function(t,e){if(e&&("object"===Ue(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(this,t)});function a(t){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,a),o.call(this,null,t)}return e=a,(n=[{key:"createEl",value:function(){return Ze(qe(a.prototype),"createEl",this).call(this,"div",{className:"cv-devices-tech"})}},{key:"setPoster",value:function(t){this.poster=t,this.update()}},{key:"setDevice",value:function(t){this.device=t,this.update()}},{key:"update",value:function(){var t,e,n,r,i=this;this.el_.innerHTML='\n <div class="cv-devices-content">\n <p>'.concat(this.localize("Currently playing on"),'</p>\n <h2><span class="cv-device-icon ').concat({vivi:"cv-vivi-icon","apple-tv":"cv-apple-icon"}[null!==(e=null===(t=this.device)||void 0===t?void 0:t.type)&&void 0!==e?e:K.Vivi],'"></span>').concat(null!==(r=null===(n=this.device)||void 0===n?void 0:n.name)&&void 0!==r?r:"",'</h2>\n </div>\n <div class="cv-devices-background" style="background-image: url(').concat(this.poster,')"></div>\n ');var o=document.createElement("button"),a=function(t){t.stopPropagation(),i.options_.onStopCasting()};o.onclick=a,o.ontouchstart=a,o.className="stop-casting-button",o.innerHTML=this.localize("Stop casting"),this.el_.querySelector(".cv-devices-content").appendChild(o)}},{key:"play",value:function(){}}])&&Ge(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),a}(o.Z.getComponent("Component"));function Ye(t){return Ye="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ye(t)}function We(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,(void 0,i=function(t,e){if("object"!==Ye(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!==Ye(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(r.key),"symbol"===Ye(i)?i:String(i)),r)}var i}function $e(){return $e="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=Xe(t)););return t}(t,e);if(r){var i=Object.getOwnPropertyDescriptor(r,e);return i.get?i.get.call(arguments.length<3?t:n):i.value}},$e.apply(this,arguments)}function Qe(t,e){return Qe=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Qe(t,e)}function Xe(t){return Xe=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Xe(t)}var Je=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Qe(t,e)}(c,t);var e,n,r,i,a,s=(i=c,a=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=Xe(i);if(a){var n=Xe(this).constructor;t=Reflect.construct(e,arguments,n)}else t=e.apply(this,arguments);return function(t,e){if(e&&("object"===Ye(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(this,t)});function c(t,e){var n;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,c),(n=s.call(this,t,e)).featuresVolumeControl=!0,n.featuresPlaybackRate=!1,n.movingMediaElementInDOM=!1,n.featuresFullscreenResize=!0,n.featuresTimeupdateEvents=!0,n.featuresProgressEvents=!1,n.featuresNativeTextTracks=!1,n.featuresNativeAudioTracks=!1,n.featuresNativeVideoTracks=!1,n.featuresMuteControl=!0,n.featuresSourceset=!1,n.videojsPlayer=(0,o.Z)(n.options_.playerId),n.bindFunctions(),n.bindEventListeners(),n.ready((function(){n.setSource(n.options_.source)})),n.triggerReady(),n}return e=c,r=[{key:"canPlayType",value:function(){return""}},{key:"canPlaySource",value:function(t,e){var n;return!!ke.getOrCreateInstance(null!==(n=null==e?void 0:e.instanceId)&&void 0!==n?n:"").getCastSession()}},{key:"isSupported",value:function(){return ke.isActive()}}],(n=[{key:"bindFunctions",value:function(){this.bindEventListeners=this.bindEventListeners.bind(this),this.onTextTrackChanged=this.onTextTrackChanged.bind(this),this.getSelectedTextTrack=this.getSelectedTextTrack.bind(this),this.setSelectedTextTrack=this.setSelectedTextTrack.bind(this),this.showUI=this.showUI.bind(this),this.hideUI=this.hideUI.bind(this),this.dispose=this.dispose.bind(this),this.setSource=this.setSource.bind(this),this.getCastSession=this.getCastSession.bind(this)}},{key:"bindEventListeners",value:function(){var t=this,e=this.getCastSession();e&&(this.textTracks().on("change",this.onTextTrackChanged),this.videojsPlayer.one("ended",(function(){e.dispose()})),e.on("durationchange",(function(){t.trigger("durationchange")})),e.on("dispose",(function(){t.trigger("ended"),t.hideUI()})),e.on("playingchange",(function(){e.isPlaying()?(t.trigger("play"),t.trigger("playing")):t.trigger("pause")})),e.on("volumechange",(function(){t.trigger("volumechange")})),e.on("sourceloaded",(function(){t.trigger("loadeddata")})),e.on("subtitleschange",(function(){t.setSelectedTextTrack(e.getSubtitles())})))}},{key:"onTextTrackChanged",value:function(){var t,e=this.getSelectedTextTrack();null===(t=this.getCastSession())||void 0===t||t.setSubtitles(null==e?void 0:e.src)}},{key:"getSelectedTextTrack",value:function(){return Be.O.findTrackByPredicate(this.videojsPlayer.player_,(function(t){return"showing"===t.mode&&!!t.src}))}},{key:"setSelectedTextTrack",value:function(t){Be.O.forEachTrack(this.videojsPlayer.player_,(function(e){e.src===t?e.mode="showing":e.mode="hidden"}))}},{key:"showUI",value:function(t){this.ui&&(this.ui.setPoster(this.options_.poster),this.ui.setDevice(t),this.ui.show())}},{key:"hideUI",value:function(){var t;null===(t=this.ui)||void 0===t||t.hide()}},{key:"dispose",value:function(){this.textTracks().off("change",this.onTextTrackChanged);var t=this.getCastSession();t&&t.dispose(),$e(Xe(c.prototype),"cleanupAutoTextTracks",this).call(this),$e(Xe(c.prototype),"dispose",this).call(this)}},{key:"createEl",value:function(){var t=this;return this.ui=this.ui||new He({onStopCasting:function(){var e;null===(e=t.getCastSession())||void 0===e||e.dispose()}}),this.ui.el()}},{key:"setSource",value:function(t){var e=this.getCastSession();if(e){this.showUI(e.getDevice()),this.trigger("loadstart");var n=this.getSelectedTextTrack();e.loadSource(t.src,null==n?void 0:n.src)}}},{key:"addRemoteTextTrack",value:function(t){return $e(Xe(c.prototype),"addRemoteTextTrack",this).call(this,t,!0)}},{key:"getCastSession",value:function(){var t;return ke.getOrCreateInstance(null!==(t=this.options_.instanceId)&&void 0!==t?t:"").getCastSession()}},{key:"play",value:function(){var t;null===(t=this.getCastSession())||void 0===t||t.play()}},{key:"pause",value:function(){var t;null===(t=this.getCastSession())||void 0===t||t.pause()}},{key:"paused",value:function(){var t;return!1===(null===(t=this.getCastSession())||void 0===t?void 0:t.isPlaying())}},{key:"ended",value:function(){var t,e;return null!==(e=null===(t=this.getCastSession())||void 0===t?void 0:t.isPlaybackFinished())&&void 0!==e&&e}},{key:"setCurrentTime",value:function(t){var e;null===(e=this.getCastSession())||void 0===e||e.seek(null!=t?t:0)}},{key:"currentTime",value:function(){var t,e;return null!==(e=null===(t=this.getCastSession())||void 0===t?void 0:t.getPosition())&&void 0!==e?e:0}},{key:"duration",value:function(){var t,e;return null!==(e=null===(t=this.getCastSession())||void 0===t?void 0:t.getDuration())&&void 0!==e?e:this.videojsPlayer.duration()}},{key:"volume",value:function(){var t,e;return null!==(e=null===(t=this.getCastSession())||void 0===t?void 0:t.getVolume())&&void 0!==e?e:1}},{key:"setVolume",value:function(t){var e;null===(e=this.getCastSession())||void 0===e||e.setVolume(t)}},{key:"muted",value:function(){var t,e;return null!==(e=null===(t=this.getCastSession())||void 0===t?void 0:t.getMuted())&&void 0!==e&&e}},{key:"setMuted",value:function(t){var e;null===(e=this.getCastSession())||void 0===e||e.setMuted(t)}},{key:"buffered",value:function(){}},{key:"seekable",value:function(){return o.Z.createTimeRanges(0,this.duration())}},{key:"playbackRate",value:function(){return 1}},{key:"readyState",value:function(){return 4}},{key:"controls",value:function(){return!1}},{key:"playsinline",value:function(){return!0}},{key:"supportsFullScreen",value:function(){return!0}},{key:"setAutoplay",value:function(){}},{key:"preload",value:function(){}},{key:"load",value:function(){}},{key:"setPlaybackRate",value:function(){}}])&&We(e.prototype,n),r&&We(e,r),Object.defineProperty(e,"prototype",{writable:!1}),c}(o.Z.getComponent("Tech"));function Ke(t){return Ke="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ke(t)}function tn(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,(void 0,i=function(t,e){if("object"!==Ke(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!==Ke(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(r.key),"symbol"===Ke(i)?i:String(i)),r)}var i}function en(){return en="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=rn(t)););return t}(t,e);if(r){var i=Object.getOwnPropertyDescriptor(r,e);return i.get?i.get.call(arguments.length<3?t:n):i.value}},en.apply(this,arguments)}function nn(t,e){return nn=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},nn(t,e)}function rn(t){return rn=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},rn(t)}o.Z.registerTech("devices",Je);var on=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&nn(t,e)}(a,t);var e,n,r,i,o=(r=a,i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=rn(r);if(i){var n=rn(this).constructor;t=Reflect.construct(e,arguments,n)}else t=e.apply(this,arguments);return function(t,e){if(e&&("object"===Ke(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(this,t)});function a(t,e){var n,r,i;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,a),(n=o.call(this,t,e)).options=e,n.instanceId=null!==(i=null===(r=n.player.options_.devices)||void 0===r?void 0:r.instanceId)&&void 0!==i?i:"",n.bindFunctions(),n.initialize(),n}return e=a,(n=[{key:"bindFunctions",value:function(){this.initialize=this.initialize.bind(this),this.onReady=this.onReady.bind(this),this.onDevicesChanged=this.onDevicesChanged.bind(this),this.onCastSessionChanged=this.onCastSessionChanged.bind(this),this.onDevicesError=this.onDevicesError.bind(this),this.addViviClient=this.addViviClient.bind(this),this.addAppleTvClient=this.addAppleTvClient.bind(this),this.reloadTech=this.reloadTech.bind(this),this.getSessionManager=this.getSessionManager.bind(this),this.dispose=this.dispose.bind(this)}},{key:"initialize",value:function(){this.player.ready(this.onReady)}},{key:"onReady",value:function(){var t=this,e=this.player.getChild("collapserator"),n=null==e?void 0:e.children().findIndex((function(t){return"CustomControlSpacer"===t.name()})),r=this.getSessionManager();if(e&&n&&-1!==n&&r){r.on("deviceschange",this.onDevicesChanged),r.on("castsessionchange",this.onCastSessionChanged),r.on("error",this.onDevicesError);var i={onClick:function(){t.addViviClient(r),t.addAppleTvClient(r)},onDeviceMenuItemClick:function(e,n){var i;r.startCastSession({device:n,title:t.options.title}),null===(i=t.options.analyticsService)||void 0===i||i.logUserAction({device:n},{actionType:tt.Vw.Play,workflowPhase:tt.eu.Complete,descriptor:tt.UX.CastToDevice})}};this.devicesButton=e.addChild("DevicesButton",i,n+1)}}},{key:"onDevicesChanged",value:function(t){var e;null===(e=this.devicesButton)||void 0===e||e.setDevices(t)}},{key:"onCastSessionChanged",value:function(t){var e;null===(e=this.devicesButton)||void 0===e||e.setCastSession(t),this.reloadTech(),t?(this.player.addClass("cv-device-casting"),this.player.addClass("cv-device-".concat(t.getDevice().type)),this.player.isFullscreen()&&this.player.exitFullscreen()):(this.player.removeClass("cv-device-casting"),this.player.removeClass("cv-device-".concat(K.AppleTv)),this.player.removeClass("cv-device-".concat(K.Vivi)))}},{key:"onDevicesError",value:function(t){this.player.error(t.message),this.player.pause()}},{key:"addViviClient",value:function(t){if(this.options.viviEnabled&&this.options.viviApi&&this.options.fetchViviAccessToken&&!t.hasInstanceOfClient(ye)){var e=new ye({url:this.options.viviApi,fetchAccessToken:this.options.fetchViviAccessToken});t.addClient(e)}}},{key:"addAppleTvClient",value:function(t){if(this.options.appleTvEnabled&&this.options.onlineApi&&this.options.fetchOnlineApiAccessToken&&this.options.trackingCode&&this.options.userId&&!t.hasInstanceOfClient(Bt)){var e=new Bt({url:this.options.onlineApi,fetchAccessToken:this.options.fetchOnlineApiAccessToken,trackingCode:this.options.trackingCode,userId:this.options.userId,username:""});t.addClient(e)}}},{key:"reloadTech",value:function(){var t=this.player,e=t.currentSources(),n=t.volume(),r=t.muted(),i=t.currentTime(),o=t.paused();t.src(e),t.one("playing",(function(){t.volume(n),t.muted(r),t.currentTime(i),o?t.pause():t.play()}))}},{key:"getSessionManager",value:function(){if(this.instanceId)return ke.getOrCreateInstance(this.instanceId)}},{key:"dispose",value:function(){var t=this.getSessionManager();t&&(t.off("deviceschange",this.onDevicesChanged),t.off("castsessionchange",this.onCastSessionChanged),t.off("error",this.onDevicesError),ke.disposeAndRemoveInstance(t),en(rn(a.prototype),"dispose",this).call(this))}}])&&tn(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),a}(o.Z.getPlugin("plugin"));function an(t){return an="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},an(t)}function sn(){sn=function(){return e};var t,e={},n=Object.prototype,r=n.hasOwnProperty,i=Object.defineProperty||function(t,e,n){t[e]=n.value},o="function"==typeof Symbol?Symbol:{},a=o.iterator||"@@iterator",s=o.asyncIterator||"@@asyncIterator",c=o.toStringTag||"@@toStringTag";function u(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{u({},"")}catch(t){u=function(t,e,n){return t[e]=n}}function l(t,e,n,r){var o=e&&e.prototype instanceof b?e:b,a=Object.create(o.prototype),s=new _(r||[]);return i(a,"_invoke",{value:E(t,n,s)}),a}function f(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}e.wrap=l;var h="suspendedStart",p="suspendedYield",d="executing",y="completed",v={};function b(){}function g(){}function m(){}var w={};u(w,a,(function(){return this}));var P=Object.getPrototypeOf,S=P&&P(P(I([])));S&&S!==n&&r.call(S,a)&&(w=S);var k=m.prototype=b.prototype=Object.create(w);function O(t){["next","throw","return"].forEach((function(e){u(t,e,(function(t){return this._invoke(e,t)}))}))}function j(t,e){function n(i,o,a,s){var c=f(t[i],t,o);if("throw"!==c.type){var u=c.arg,l=u.value;return l&&"object"==an(l)&&r.call(l,"__await")?e.resolve(l.__await).then((function(t){n("next",t,a,s)}),(function(t){n("throw",t,a,s)})):e.resolve(l).then((function(t){u.value=t,a(u)}),(function(t){return n("throw",t,a,s)}))}s(c.arg)}var o;i(this,"_invoke",{value:function(t,r){function i(){return new e((function(e,i){n(t,r,e,i)}))}return o=o?o.then(i,i):i()}})}function E(e,n,r){var i=h;return function(o,a){if(i===d)throw new Error("Generator is already running");if(i===y){if("throw"===o)throw a;return{value:t,done:!0}}for(r.method=o,r.arg=a;;){var s=r.delegate;if(s){var c=C(s,r);if(c){if(c===v)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(i===h)throw i=y,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);i=d;var u=f(e,n,r);if("normal"===u.type){if(i=r.done?y:p,u.arg===v)continue;return{value:u.arg,done:r.done}}"throw"===u.type&&(i=y,r.method="throw",r.arg=u.arg)}}}function C(e,n){var r=n.method,i=e.iterator[r];if(i===t)return n.delegate=null,"throw"===r&&e.iterator.return&&(n.method="return",n.arg=t,C(e,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),v;var o=f(i,e.iterator,n.arg);if("throw"===o.type)return n.method="throw",n.arg=o.arg,n.delegate=null,v;var a=o.arg;return a?a.done?(n[e.resultName]=a.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,v):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,v)}function x(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function T(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function _(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(x,this),this.reset(!0)}function I(e){if(e||""===e){var n=e[a];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var i=-1,o=function n(){for(;++i<e.length;)if(r.call(e,i))return n.value=e[i],n.done=!1,n;return n.value=t,n.done=!0,n};return o.next=o}}throw new TypeError(an(e)+" is not iterable")}return g.prototype=m,i(k,"constructor",{value:m,configurable:!0}),i(m,"constructor",{value:g,configurable:!0}),g.displayName=u(m,c,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===g||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,m):(t.__proto__=m,u(t,c,"GeneratorFunction")),t.prototype=Object.create(k),t},e.awrap=function(t){return{__await:t}},O(j.prototype),u(j.prototype,s,(function(){return this})),e.AsyncIterator=j,e.async=function(t,n,r,i,o){void 0===o&&(o=Promise);var a=new j(l(t,n,r,i),o);return e.isGeneratorFunction(n)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},O(k),u(k,c,"Generator"),u(k,a,(function(){return this})),u(k,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),n=[];for(var r in e)n.push(r);return n.reverse(),function t(){for(;n.length;){var r=n.pop();if(r in e)return t.value=r,t.done=!1,t}return t.done=!0,t}},e.values=I,_.prototype={constructor:_,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(T),!e)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var n=this;function i(r,i){return s.type="throw",s.arg=e,n.next=r,i&&(n.method="next",n.arg=t),!!i}for(var o=this.tryEntries.length-1;o>=0;--o){var a=this.tryEntries[o],s=a.completion;if("root"===a.tryLoc)return i("end");if(a.tryLoc<=this.prev){var c=r.call(a,"catchLoc"),u=r.call(a,"finallyLoc");if(c&&u){if(this.prev<a.catchLoc)return i(a.catchLoc,!0);if(this.prev<a.finallyLoc)return i(a.finallyLoc)}else if(c){if(this.prev<a.catchLoc)return i(a.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return i(a.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var o=i;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=t,a.arg=e,o?(this.method="next",this.next=o.finallyLoc,v):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),v},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),T(n),v}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var i=r.arg;T(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:I(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),v}},e}function cn(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function un(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,(void 0,i=function(t,e){if("object"!==an(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!==an(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(r.key),"symbol"===an(i)?i:String(i)),r)}var i}function ln(){return ln="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=hn(t)););return t}(t,e);if(r){var i=Object.getOwnPropertyDescriptor(r,e);return i.get?i.get.call(arguments.length<3?t:n):i.value}},ln.apply(this,arguments)}function fn(t,e){return fn=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},fn(t,e)}function hn(t){return hn=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},hn(t)}o.Z.registerPlugin("devicesPlugin",on);var pn=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&fn(t,e)}(a,t);var e,n,r,i,o=(r=a,i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=hn(r);if(i){var n=hn(this).constructor;t=Reflect.construct(e,arguments,n)}else t=e.apply(this,arguments);return function(t,e){if(e&&("object"===an(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(this,t)});function a(t,e){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,a),o.call(this,t,e)}return e=a,(n=[{key:"getPlayerOptions",value:function(){var t,e=ln(hn(a.prototype),"getPlayerOptions",this).call(this);return this.areDevicesEnabled()?Object.assign(Object.assign({},e),{techOrder:["devices"].concat((t=e.techOrder,function(t){if(Array.isArray(t))return cn(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(t){if("string"==typeof t)return cn(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?cn(t,e):void 0}}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}())),devices:{instanceId:Wt()}}):e}},{key:"configurePlugins",value:function(){var t;try{this.options.onClickCreateClip&&this.player.createClipButtonPlugin({onClick:this.options.onClickCreateClip}),this.options.onRequestPictureInPicture&&this.player.pictureInPicture({onRequestPictureInPicture:this.options.onRequestPictureInPicture}),(null===(t=this.options.pointsOfInterest)||void 0===t?void 0:t.length)&&this.player.pointsOfInterestPlugin({pointsOfInterest:this.options.pointsOfInterest})}catch(t){console.log("failed to register plugins",t)}}},{key:"setNextVideo",value:function(t,e,n){this.player.nextVideoPlugin&&this.player.nextVideoPlugin().setNextVideo(t,e,n)}},{key:"enablePictureInPicture",value:function(){var t=this.player.pictureInPicture();t&&t.enablePictureInPicture()}},{key:"disablePictureInPicture",value:function(){var t=this.player.pictureInPicture();t&&t.disablePictureInPicture()}},{key:"togglePictureInPicture",value:function(t){var e=this.player.pictureInPicture();e&&e.togglePictureInPicture(t)}},{key:"additionalSetup",value:function(t){var e,n,r,i,o,s,c,u,l,f,h,p=this,d=Object.create(null,{additionalSetup:{get:function(){return ln(hn(a.prototype),"additionalSetup",p)}}});return u=this,l=void 0,f=void 0,h=sn().mark((function a(){var u;return sn().wrap((function(a){for(;;)switch(a.prev=a.next){case 0:if(d.additionalSetup.call(this,t),this.options.showResources&&t.resources&&this.player.resourcesPlugin&&this.player.resourcesPlugin({resources:t.resources.list,imageCdnUrl:this.options.imageCdnUrl}),"MasterClip"!==t.mediaType){a.next=7;break}if(null!==(u=t.additionalData)){a.next=6;break}throw Error("Invalid clip data");case 6:this.player.clipPlugin({startTime:u.startTime,endTime:u.endTime});case 7:this.areDevicesEnabled()&&this.player.devicesPlugin({viviEnabled:null===(e=this.options.devicesConfig)||void 0===e?void 0:e.viviEnabled,viviApi:null===(n=this.options.devicesConfig)||void 0===n?void 0:n.viviApi,fetchViviAccessToken:null===(r=this.options.devicesConfig)||void 0===r?void 0:r.fetchViviAccessToken,appleTvEnabled:null===(i=this.options.devicesConfig)||void 0===i?void 0:i.appleTvEnabled,onlineApi:null===(o=this.options.devicesConfig)||void 0===o?void 0:o.onlineApi,fetchOnlineApiAccessToken:null===(s=this.options.devicesConfig)||void 0===s?void 0:s.fetchOnlineApiAccessToken,trackingCode:null===(c=this.options.devicesConfig)||void 0===c?void 0:c.trackingCode,userId:parseInt(t.viewerId),title:t.title,analyticsService:this.analyticsService});case 8:case"end":return a.stop()}}),a,this)})),new(f||(f=Promise))((function(t,e){function n(t){try{i(h.next(t))}catch(t){e(t)}}function r(t){try{i(h.throw(t))}catch(t){e(t)}}function i(e){var i;e.done?t(e.value):(i=e.value,i instanceof f?i:new f((function(t){t(i)}))).then(n,r)}i((h=h.apply(u,l||[])).next())}))}},{key:"setActivityStatus",value:function(t,e){this.player.activityStatusPlugin().setActivityStatus(t,e)}}])&&un(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),a}(i.r),dn=n(63816),yn=n(14735);function vn(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function bn(t){var e,n,i,o=r.useRef(t.player.duration()-t.player.currentTime()),a=(n=r.useState(o.current),i=2,function(t){if(Array.isArray(t))return t}(n)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,i,o,a,s=[],c=!0,u=!1;try{if(o=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=o.call(n)).done)&&(s.push(r.value),s.length!==e);c=!0);}catch(t){u=!0,i=t}finally{try{if(!c&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(u)throw i}}return s}}(n,i)||function(t,e){if(t){if("string"==typeof t)return vn(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?vn(t,e):void 0}}(n,i)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),s=a[0],c=a[1];function u(){var e=t.player.duration()-t.player.currentTime();c(e),e>o.current&&(o.current=e)}if(r.useEffect((function(){return t.player.on("timeupdate",u),function(){t.player.off("timeupdate",u)}}),[]),!t.nextVideo||!t.onPlayNext)return r.createElement(r.Fragment,null);var l=Math.ceil(s),f=1===l?"second":"seconds";return r.createElement(r.Fragment,null,r.createElement("div",{className:"cv-up-next-container"},r.createElement("div",{className:"cv-cancel-up-next cursor-pointer",role:"button",onClick:t.onCancel},"×"),r.createElement("div",{className:"cv-up-next-heading"},"Up next in ",l," ",f,":"),r.createElement("div",{className:"cv-up-next-image cursor-pointer",onClick:t.onPlayNext,style:{backgroundImage:"url(".concat(null===(e=t.nextVideo)||void 0===e?void 0:e.thumbnailUrl,")")}}),r.createElement("div",{className:"cv-up-next-title"},t.nextVideo.name)))}function gn(t){return gn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},gn(t)}function mn(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,(void 0,i=function(t,e){if("object"!==gn(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!==gn(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(r.key),"symbol"===gn(i)?i:String(i)),r)}var i}function wn(){return wn="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=Sn(t)););return t}(t,e);if(r){var i=Object.getOwnPropertyDescriptor(r,e);return i.get?i.get.call(arguments.length<3?t:n):i.value}},wn.apply(this,arguments)}function Pn(t,e){return Pn=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Pn(t,e)}function Sn(t){return Sn=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Sn(t)}o.Z.registerComponent("UpNext",(0,yn.Z)((function(t,e){return r.createElement(bn,Object.assign({player:t},e))})));var kn=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Pn(t,e)}(s,t);var e,n,r,i,a=(r=s,i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=Sn(r);if(i){var n=Sn(this).constructor;t=Reflect.construct(e,arguments,n)}else t=e.apply(this,arguments);return function(t,e){if(e&&("object"===gn(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(this,t)});function s(t,e){var n;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,s),(n=a.call(this,t,e)).playNext=t.nextVideoPlugin().getShouldPlayNext(),n.toggle(n.playNext),n}return e=s,(n=[{key:"handleToggle",value:function(){this.toggle(!this.playNext)}},{key:"toggle",value:function(t){t?this.toggleOn():this.toggleOff()}},{key:"toggleOn",value:function(){this.playNext=!0,o.Z.dom.addClass(this.toggleEl,"on"),this.player_.nextVideoPlugin().setShouldPlayNext(this.playNext,!0)}},{key:"toggleOff",value:function(){this.playNext=!1,o.Z.dom.removeClass(this.toggleEl,"on"),this.player_.nextVideoPlugin().setShouldPlayNext(this.playNext,!0)}},{key:"handleClick",value:function(t){t.stopImmediatePropagation()}},{key:"createEl",value:function(t,e,n){this.handlerBound||(this.handleToggle=this.handleToggle.bind(this),this.handlerBound=!0),this.toggleEl&&this.toggleEl.removeEventListener("click",this.handleToggle),this.toggleEl=o.Z.dom.createEl("div",{className:"custom-toggle toggle-option float-end",innerHTML:'<span class="handle"></span></div>'}),this.toggleEl.addEventListener("click",this.handleToggle);var r=wn(Sn(s.prototype),"createEl",this).call(this,t,{className:"vjs-menu-item cv-cog-menu-item",innerHTML:'\n <span class="vjs-menu-item-text">Play next video</span>\n <span class="cv-toggle-container"></span>'},n);return r.children[1].appendChild(this.toggleEl),r}}])&&mn(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),s}(o.Z.getComponent("MenuItem"));function On(t){return On="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},On(t)}function jn(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,(void 0,i=function(t,e){if("object"!==On(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!==On(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(r.key),"symbol"===On(i)?i:String(i)),r)}var i}function En(){return En="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=Tn(t)););return t}(t,e);if(r){var i=Object.getOwnPropertyDescriptor(r,e);return i.get?i.get.call(arguments.length<3?t:n):i.value}},En.apply(this,arguments)}function Cn(t,e){return Cn=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Cn(t,e)}function xn(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Tn(t){return Tn=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Tn(t)}o.Z.registerComponent("NextVideoMenuItem",kn);var _n="cv-persisttest",In="cv-play-next-video",Rn=o.Z.getPlugin("plugin"),Ln=(o.Z.getComponent("MenuItem"),o.Z.getComponent("NextVideoMenuItem")),Dn=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Cn(t,e)}(a,t);var e,n,r,i,o=(r=a,i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=Tn(r);if(i){var n=Tn(this).constructor;t=Reflect.construct(e,arguments,n)}else t=e.apply(this,arguments);return function(t,e){if(e&&("object"===On(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return xn(t)}(this,t)});function a(t){var e;if(function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,a),(e=o.call(this,t)).setShouldPlayNext=e.setShouldPlayNext.bind(xn(e)),e.getShouldPlayNext=e.getShouldPlayNext.bind(xn(e)),e.getChapterTrack=e.getChapterTrack.bind(xn(e)),e.onTimeUpdate=e.onTimeUpdate.bind(xn(e)),e.hasLocalStorage=e.testHasLocalStorage(),e.shouldPlayNextVideo=!1,e.hasLocalStorage){var n=window.localStorage.getItem(In);e.shouldPlayNextVideo="true"===n}return t.ready((function(){e.initialize()})),e}return e=a,(n=[{key:"initialize",value:function(){this.player.isDisposed()||this.bindListeners()}},{key:"getChapterTrack",value:function(){return Be.O.getTrack(this.player,"chapters",null)}},{key:"setNextVideo",value:function(t,e,n){var r;this.nextVideo=t,this.callback=n,e&&this.setShouldPlayNext(!0),(null===(r=this.player.getChild("collapserator"))||void 0===r?void 0:r.getChild("cogButton")).addItem({index:0,ctor:Ln,name:"NextVideoMenuItem"})}},{key:"getShouldPlayNext",value:function(){return this.shouldPlayNextVideo}},{key:"setShouldPlayNext",value:function(t,e){this.shouldPlayNextVideo=t,this.hasLocalStorage&&e&&window.localStorage.setItem(In,t.toString())}},{key:"bindListeners",value:function(){this.player.on("timeupdate",this.onTimeUpdate)}},{key:"dispose",value:function(){this.player.off("timeupdate",this.onTimeUpdate),this.hideUpNext(),En(Tn(a.prototype),"dispose",this).call(this)}},{key:"onTimeUpdate",value:function(){var t,e;if(!this.player.pictureInPicture||!this.player.isInPictureInPicture())if(this.getShouldPlayNext()){if(this.player.ended())return this.callback(),void this.hideUpNext();if(!(this.player.duration()<=0||this.upNextRendered&&this.player.currentTime()>this.upNextTimepoint)){var n=this.getChapterTrack(),r=(null===(t=null==n?void 0:n.activeCues)||void 0===t?void 0:t.length)&&n.activeCues[0];"credits"===(null===(e=null==r?void 0:r.text)||void 0===e?void 0:e.toLowerCase())||this.player.currentTime()>=this.player.duration()-5?this.showUpNext():this.hideUpNext()}}else this.hideUpNext()}},{key:"showUpNext",value:function(){var t=this;this.upNextRendered||(this.upNextRendered=!0,this.upNextTimepoint=this.player.currentTime(),this.player.addChild("UpNext",{nextVideo:this.nextVideo,onPlayNext:this.callback,onCancel:function(){t.hideUpNext(),t.setShouldPlayNext(!1)}}))}},{key:"hideUpNext",value:function(){if(this.upNextRendered){this.upNextRendered=!1,this.upNextTimepoint=null;var t=this.player.getChild("UpNext");t&&(this.player.removeChild(t),t.dispose())}}},{key:"testHasLocalStorage",value:function(){try{return window.localStorage.setItem(_n,"persistPlayNext"),window.localStorage.removeItem(_n),!0}catch(t){return!1}}}])&&jn(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),a}(Rn);o.Z.registerPlugin("nextVideoPlugin",Dn);var Mn=n(26733);function Nn(t){return Nn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Nn(t)}function An(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,(void 0,i=function(t,e){if("object"!==Nn(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!==Nn(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(r.key),"symbol"===Nn(i)?i:String(i)),r)}var i}function Vn(t,e){return Vn=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Vn(t,e)}function Fn(t){return Fn=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Fn(t)}function Bn(t){return r.createElement("div",{className:"cv-resource-item"},r.createElement(Mn.s,{data:t.resource,imageCdnUrl:t.imageCdnUrl}))}var Un=(0,yn.Z)((function(t,e){return r.createElement(Bn,Object.assign({},e))})),Gn=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Vn(t,e)}(s,t);var e,n,r,i,a=(r=s,i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=Fn(r);if(i){var n=Fn(this).constructor;t=Reflect.construct(e,arguments,n)}else t=e.apply(this,arguments);return function(t,e){if(e&&("object"===Nn(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(this,t)});function s(t,e){var n;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,s),n=a.call(this,t,e);var r=new Un(t,{resource:e.resource,imageCdnUrl:e.imageCdnUrl});return n.addChild(r),n}return e=s,(n=[{key:"createEl",value:function(){return o.Z.dom.createEl("div")}},{key:"handleClick",value:function(t){t.stopImmediatePropagation(),this.options_.downloadResource(this.options_.resource)}}])&&An(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),s}(o.Z.getComponent("ClickableComponent"));function Zn(t){return Zn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Zn(t)}function zn(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,(void 0,i=function(t,e){if("object"!==Zn(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!==Zn(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(r.key),"symbol"===Zn(i)?i:String(i)),r)}var i}function qn(){return qn="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=Yn(t)););return t}(t,e);if(r){var i=Object.getOwnPropertyDescriptor(r,e);return i.get?i.get.call(arguments.length<3?t:n):i.value}},qn.apply(this,arguments)}function Hn(t,e){return Hn=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Hn(t,e)}function Yn(t){return Yn=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Yn(t)}var Wn=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Hn(t,e)}(s,t);var e,n,r,i,a=(r=s,i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=Yn(r);if(i){var n=Yn(this).constructor;t=Reflect.construct(e,arguments,n)}else t=e.apply(this,arguments);return function(t,e){if(e&&("object"===Zn(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(this,t)});function s(){var t;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,s),(t=a.apply(this,arguments)).alwaysCollapsed=!1,t.isCollapsed=!1,t.isCollabsible=!0,t}return e=s,(n=[{key:"buildWrapperCSSClass",value:function(){return"cv-menu-small ".concat(qn(Yn(s.prototype),"buildWrapperCSSClass",this).call(this))}},{key:"buildCSSClass",value:function(){return"cv-resources-button ".concat(qn(Yn(s.prototype),"buildCSSClass",this).call(this))}},{key:"update",value:function(){qn(Yn(s.prototype),"update",this).call(this)}},{key:"createMenu",value:function(){return this.options_.title="Resources",qn(Yn(s.prototype),"createMenu",this).call(this)}},{key:"createItems",value:function(){var t=this,e=[];return this.options_.resources.forEach((function(n){var r=new Gn(t.player(),{resource:n,imageCdnUrl:t.options_.imageCdnUrl,downloadResource:function(e){return t.downloadResource(e)}});e.push(r)})),e}},{key:"downloadResource",value:function(t){this.getDownloadIframe().src=t.url}},{key:"getDownloadIframe",value:function(){return this.downloadIframe||(this.downloadIframe=o.Z.dom.createEl("iframe"),this.downloadIframe.style.display="none",o.Z.dom.appendContent(o.Z.dom.$("body"),this.downloadIframe)),this.downloadIframe}},{key:"getCollabsibleName",value:function(){return this.controlText_}},{key:"getCollabsibleValue",value:function(){return""}},{key:"showInCollabsibleMenu",value:function(){return!0}},{key:"showCollapsibleMenu",value:function(){qn(Yn(s.prototype),"handleClick",this).call(this,null)}}])&&zn(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),s}(o.Z.getComponent("MenuButton"));function $n(t){return $n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},$n(t)}function Qn(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,(void 0,i=function(t,e){if("object"!==$n(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!==$n(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(r.key),"symbol"===$n(i)?i:String(i)),r)}var i}function Xn(t,e){return Xn=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Xn(t,e)}function Jn(t){return Jn=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Jn(t)}Wn.prototype.controlText_="Resources",o.Z.registerComponent("ResourcesButton",Wn);var Kn=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Xn(t,e)}(a,t);var e,n,r,i,o=(r=a,i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=Jn(r);if(i){var n=Jn(this).constructor;t=Reflect.construct(e,arguments,n)}else t=e.apply(this,arguments);return function(t,e){if(e&&("object"===$n(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(this,t)});function a(t,e){var n;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,a),(n=o.call(this,t,e)).options=e,t.ready((function(){return n.onReady()})),n}return e=a,(n=[{key:"onReady",value:function(){if(this.options.resources.length){var t=this.player.getChild("collapserator");t.addChild("ResourcesButton",{resources:this.options.resources,imageCdnUrl:this.options.imageCdnUrl},t.children_.length-3)}}}])&&Qn(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),a}(o.Z.getPlugin("plugin"));o.Z.registerPlugin("resourcesPlugin",Kn);var tr=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]])}return n};function er(t){var e=t.className,n=void 0===e?"":e,i=t.playerApi,o=t.onReady,a=t.onDispose,s=tr(t,["className","playerApi","onReady","onDispose"]),c=r.useRef();return r.useEffect((function(){if(c){var t=new pn(c.current,Object.assign(Object.assign({},s),{playerApi:i}));return o&&t.ready((function(){o((0,dn.G)(t))})),a&&t.one("dispose",a),function(){null==t||t.dispose()}}}),[t.viewKey]),r.createElement("div",{ref:c,className:n})}}}]);
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunk_clickview_lite=self.webpackChunk_clickview_lite||[]).push([[3728],{49935:(e,a,t)=>{t.d(a,{Oo:()=>d,b2:()=>m});var n=t(32735),c=t(36848),r=t(86764),i=t(3747),o=t(5859),l=t(35223),u=t(83914),s=function(e){var a=e.breadcrumb,t=a.name,r=a.appLink,i=a.active,o=e.withBackIcon;return n.createElement("li",{className:"breadcrumb-item".concat(i?" active":"")},i?n.createElement("strong",null,t):n.createElement(c.F,{appLink:r},o&&n.createElement(u.x,{svgName:l.vn.ChevronLeft,size:u.S.Small}),n.createElement("span",{className:o?"ms-2":""},t)))},d=function(e){var a=e.breadcrumbs,t=(0,i.a)(r.r.XS),c=null==a?void 0:a.length;return!c||t&&c<2?n.createElement(n.Fragment,null):t?n.createElement("nav",{"aria-label":"breadcrumb"},n.createElement("ol",{className:"breadcrumb m-0 p-0"},n.createElement(s,{breadcrumb:a[c-2],withBackIcon:!0}))):n.createElement("nav",{"aria-label":"breadcrumb"},n.createElement("ol",{className:"breadcrumb m-0 p-0"},a.map((function(e,a){return n.createElement(s,{key:a,breadcrumb:e})}))))},m=n.memo((function(e){var a=e.numItems,t=void 0===a?3:a;return(0,i.a)(r.r.XS)?n.createElement("div",{className:"partial-loading-background",style:{height:"1.3125rem",width:"6rem"}}):n.createElement("nav",{"aria-label":"breadcrumb"},n.createElement("ol",{className:"breadcrumb m-0 p-0"},o.u.getPartialLoadingItems({numItems:t}).map((function(e,a){var t=e.width;return n.createElement("li",{key:a,className:"breadcrumb-item"},n.createElement("span",{className:"d-inline-block partial-loading-background",style:{width:t},dangerouslySetInnerHTML:{__html:"&nbsp"}}))}))))}))},5859:(e,a,t)=>{function n(e,a){(null==a||a>e.length)&&(a=e.length);for(var t=0,n=new Array(a);t<a;t++)n[t]=e[t];return n}t.d(a,{u:()=>r});var c={numItems:5,minWidth:50,maxWidth:100},r={getPartialLoadingItems:function(){var e,a=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=Object.assign(Object.assign({},c),a);return(e=Array(t.numItems),function(e){if(Array.isArray(e))return n(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,a){if(e){if("string"==typeof e)return n(e,a);var t=Object.prototype.toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?n(e,a):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()).map((function(){return{width:"".concat(Math.max(Math.floor(Math.random()*t.maxWidth),t.minWidth),"px")}}))}}},20342:(e,a,t)=>{t.d(a,{W:()=>E});var n=t(32735),c=t(82602),r=t(23481),i=t(36848),o=t(83345),l=t(76177),u=t(99742),s=t(14070),d=t(97291),m=t(19577);const v={status:"NXBdA"};function p(e){return p="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},p(e)}function f(e,a,t){return(a=function(e){var a=function(e,a){if("object"!==p(e)||null===e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!==p(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===p(a)?a:String(a)}(a))in e?Object.defineProperty(e,a,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[a]=t,e}var b="0001-01-01T00:00:00Z",h="settings.localCacheItem",y=r.T.encloseNamespace(h),g=f(f(f({},m._.Inactive,"offline"),m._.Active,"online"),m._.Updating,"updating");function k(e,a){return a===m._.Active?y("justNow"):e&&e!==b?(0,c.WU)(e):y("never")}function E(e){var a=e.localCache,t=e.canManage,c=e.minimal,r=a.status,p=a.deviceName,f=a.deviceId,b=a.lastSeen,E=r===m._.Inactive?u.W.LocalCache.OFFLINE:u.W.LocalCache.ONLINE,w=r===m._.Active?"bg-green":"bg-gray";return n.createElement("div",{className:"border rounded text-center ".concat(c?"py-3":"")},!c&&n.createElement("div",{className:"my-2 overflow-hidden"},n.createElement("h2",{className:"h6 text-truncate"},p)),n.createElement("img",{src:E,className:"img-fluid"}),n.createElement("div",{className:"pt-2 align-middle"},n.createElement("span",{className:"".concat(v.status," ").concat(w," d-inline-block rounded-circle align-middle me-1")}),n.createElement("span",{className:"align-middle"},n.createElement(l.u,{spanHack:!0,title:y("lastSeen",{time:k(b,r)}),spanHackClassName:""},n.createElement(o.x,{namespace:h,phrase:g[r]})))),!c&&(t?n.createElement(i.F,{appLink:{application:d.O.SETTINGS,action:s.e.Settings.LOCAL_CACHE,args:[f]},className:"btn btn-link text-info mb-1"},n.createElement(o.x,{namespace:h,phrase:"canManage"})):n.createElement("div",{className:"btn text-muted text-muted mb-1"},n.createElement(o.x,{namespace:h,phrase:"cantManage"}))))}},19577:(e,a,t)=>{var n;t.d(a,{_:()=>n}),function(e){e[e.Inactive=0]="Inactive",e[e.Active=1]="Active",e[e.Updating=2]="Updating"}(n||(n={}))},17923:(e,a,t)=>{t.d(a,{q:()=>o});var n=t(99940),c=t(97395),r=t(71995),i={namespace:"localcache",idAttribute:"deviceId"},o={devices:function(){return{url:"/api/localcache/v1/customers/devices",key:"localcache:devices",normalizeOptions:i}},device:function(e){return{url:"/api/localcache/v1/devices/".concat(e),key:"localcache:devices:".concat(e),normalizeOptions:i}},updateDevice:function(e,a,t,c,r){return{url:"/api/localcache/v1/devices/".concat(e),key:"localcache:devices:update",type:n.k.PUT,data:a,normalizeOptions:i,success:t,error:c,always:r}},deleteDevice:function(e,a,t,c){return{url:"/api/localcache/v1/devices/".concat(e),key:"localcache:devices:delete",type:n.k.DELETE,normalizeOptions:i,success:a,error:t,always:c}},updates:function(e){return{url:"/api/localcache/v1/devices/".concat(e,"/update"),key:"localcache:devices:".concat(e,":updates"),normalize:!1}},deviceUpdate:function(e){return{url:"/api/localcache/v1/devices/".concat(e,"/deviceupdate"),key:"localcache:devices:".concat(e,":deviceupdate"),normalize:!1}},update:function(e,a){return{url:"/api/localcache/v1/devices/".concat(e,"/update"),key:"localcache:update",type:n.k.POST,data:{versionString:a},normalize:!1,invalidationKeys:["localcache"]}},stats:function(e){var a={bytesDownloaded:"httpprovider.bytes_downloaded",bytesRead:"store.bytes_read",storageFree:"store.storage_free",storageUsed:"store.storage_used",count:"store.objects"},t={key:Object.values(a)};return{url:c._.urlBuilder("/api/localcache/v1/devices/".concat(e,"/stats/latest"),t),key:"localcache:devices:".concat(e,":stats"),normalize:!1,formatData:function(e){if(!e)return{};var t=e.reduce((function(e,a){return e[a.key]=a.value,e}),{});return Object.keys(a).reduce((function(e,n){return e[n]=t[a[n]],e}),{})}}},channels:function(e){return{url:"/api/localcache/v1/devices/".concat(e,"/channels"),key:"localcache:devices:".concat(e,":channels"),normalize:!1}},config:function(e){return{url:"/api/localcache/v1/configs/devices/".concat(e),key:"localcache:devices:".concat(e,":config"),normalize:!1,formatData:function(e){return null==e?void 0:e.configuration}}},updateConfig:function(e,a,t,c){var r={downloadQuality:a.downloadQuality,autoUpdate:a.autoUpdate,downloadTime:{start:a.downloadStartTime,end:a.downloadEndTime}};return{url:"/api/localcache/v1/configs/devices/".concat(e),key:"localcache:update:config",type:n.k.PUT,data:r,invalidationKeys:["localcache:devices:".concat(e,":config")],normalize:!1,success:t,error:c}},address:function(e){return{url:"/api/localcache/v1/devices/".concat(e,"/address"),key:"localcache:devices:".concat(e,":address"),normalize:!1}},ping:function(e,a){return{url:"".concat(a,"/ping"),key:"localcache:devices:".concat(e,":ping"),normalize:!1,expiryTime:r.f.SHORT}}}},82602:(e,a,t)=>{t.d(a,{WU:()=>u});var n=["second","minute","hour","day","week","month","year"],c=["秒","分钟","小时","天","周","个月","年"],r={},i=function(e,a){r[e]=a},o=[60,60,24,7,365/7/12,12];function l(e){return e instanceof Date?e:!isNaN(e)||/^\d+$/.test(e)?new Date(parseInt(e)):(e=(e||"").trim().replace(/\.\d+/,"").replace(/-/,"/").replace(/-/,"/").replace(/(\d)T(\d)/,"$1 $2").replace(/Z/," UTC").replace(/([+-]\d\d):?(\d\d)/," $1$2"),new Date(e))}var u=function(e,a,t){var n=function(e,a){return(+(a?l(a):new Date)-+l(e))/1e3}(e,t&&t.relativeDate);return function(e,a){for(var t=e<0?1:0,n=e=Math.abs(e),c=0;e>=o[c]&&c<o.length;c++)e/=o[c];return(e=Math.floor(e))>(0==(c*=2)?9:1)&&(c+=1),a(e,c,n)[t].replace("%s",e.toString())}(n,function(e){return r[e]||r.en_US}(a))};i("en_US",(function(e,a){if(0===a)return["just now","right now"];var t=n[Math.floor(a/2)];return e>1&&(t+="s"),[e+" "+t+" ago","in "+e+" "+t]})),i("zh_CN",(function(e,a){if(0===a)return["刚刚","片刻后"];var t=c[~~(a/2)];return[e+" "+t+"前",e+" "+t+"后"]}))}}]);
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunk_clickview_lite=self.webpackChunk_clickview_lite||[]).push([[3836,5041],{86877:(e,t,n)=>{n.d(t,{Z:()=>u});var r=n(23481);function o(e){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o(e)}function i(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,(void 0,i=function(e,t){if("object"!==o(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!==o(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(r.key),"symbol"===o(i)?i:String(i)),r)}var i}function a(e,t){return a=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},a(e,t)}function c(e){return c=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},c(e)}var u=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&a(e,t)}(f,e);var t,n,u,l,s=(u=f,l=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=c(u);if(l){var n=c(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return function(e,t){if(t&&("object"===o(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(this,e)});function f(e){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,f),s.call(this,e)}return t=f,(n=[{key:"name",get:function(){return"FileTypeError"}},{key:"lang",get:function(){return"upload.fileType"}},{key:"dialogOptions",get:function(){return{title:r.T.getPhrase(this.lang,"heading"),text:r.T.getPhrase(this.lang,"body"),buttons:[{text:r.T.getPhrase(this.lang,"okay"),className:"btn btn-dark",success:!0},{text:r.T.getPhrase(this.lang,"close"),className:"btn btn-link",close:!0}]}}}])&&i(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),f}(n(47663).S)},25041:(e,t,n)=>{n.r(t),n.d(t,{BaseVideoUploadService:()=>G,LearningResourceUploadService:()=>X,SubtitleUploadService:()=>$,UploadType:()=>W});var r,o=n(48088),i=n(39479),a=n(46865),c=n(79976),u=n(37433),l=n(54149),s=n(71365),f=n(23481),p=n(70794),d=n(81886),y=n(49985),h=n(65858),g=n(29555);!function(e){e[e.Permanent=0]="Permanent",e[e.Temporary=1]="Temporary"}(r||(r={}));var v=n(86877),b=n(6339),m=n(52003),O=n(60735),S=n(53301),w=n(47663);function P(e){return P="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},P(e)}function k(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,(void 0,o=function(e,t){if("object"!==P(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!==P(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(r.key),"symbol"===P(o)?o:String(o)),r)}var o}function U(e,t){return U=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},U(e,t)}function j(e){return j=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},j(e)}var E="upload.internetConnectivityError",T=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&U(e,t)}(a,e);var t,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=j(r);if(o){var n=j(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return function(e,t){if(t&&("object"===P(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(this,e)});function a(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),i.call(this,f.T.getPhrase(E,"title"))}return t=a,(n=[{key:"name",get:function(){return"InternetConnectivityError"}},{key:"dialogOptions",get:function(){return{title:f.T.getPhrase(E,"heading"),text:f.T.getPhrase(E,"body"),buttons:[{text:f.T.getPhrase(E,"okay"),className:"btn",success:!0}]}}}])&&k(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),a}(w.S),R=n(44331);function _(e){return _="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},_(e)}function I(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,(void 0,o=function(e,t){if("object"!==_(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!==_(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(r.key),"symbol"===_(o)?o:String(o)),r)}var o}function L(e,t){return L=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},L(e,t)}function C(e){return C=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},C(e)}var x=[],A=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&L(e,t)}(l,e);var t,n,r,a,c,u=(a=l,c=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=C(a);if(c){var n=C(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return function(e,t){if(t&&("object"===_(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(this,e)});function l(e){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,l),u.call(this,e)}return t=l,n=[{key:"name",get:function(){return"DropzoneWrapper"}},{key:"initialize",value:function(e){var t=this.options.loggingEnabled,n=o.Radio.channel(e.channelName),r=this;this.dropzone=new S(document.createElement("div"),{url:function(e){return e[0].cvUpload.ingestUrl},chunking:this.options.chunkingEnabled,chunkSize:this.options.chunkSize,forceChunking:!0,autoProcessQueue:!0,maxFilesize:this.options.maxFileSize,acceptedFiles:this.options.acceptedFiles,paramName:"content",init:function(){var e=this;t&&(i.each(x,(function(t){e.on(t,(function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];var o=n[0]instanceof File?n[0].name:n[0];console.info(t,o,n)}))})),this.on("uploadprogress",(function(e,t,o){var i=o/e.size*100;n.trigger("progress",r.getId(e),i,o)})),this.on("success",(function(e){var t=e.upload.chunks,r=i.last(t),o=r.xhr;o||(o=r.file.xhr);var a=JSON.parse(o.response);e.cvUpload.fileId=a.id,n.trigger("upload:success",e,a)})),this.on("error",(function(e,t,n){n&&0===n.status?d.Q.Ry.throw(new T):"canceled"!==e.status&&d.Q.Ry.throw(new R.n(f.T.getPhrase("upload.services","uploadError",{fileName:e.name,message:t.message})))})))},params:function(e,t,n){if(n)return{chunk_index:n.index,upload_length:n.file.size}},addedfile:function(){},thumbnail:function(){},uploadprogress:function(){}})}},{key:"getId",value:function(e){return e.upload.uuid}},{key:"addFile",value:function(e){this.dropzone.addFile(e)}},{key:"removeFile",value:function(e){this.dropzone.removeFile(e)}},{key:"start",value:function(){this.dropzone.processQueue()}},{key:"destroy",value:function(){this.dropzone.destroy()}}],r=[{key:"isValidFile",value:function(e,t){return S.isValidFile(e,t)}}],n&&I(t.prototype,n),r&&I(t,r),Object.defineProperty(t,"prototype",{writable:!1}),l}(d.Q.t6);function D(e){return D="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},D(e)}function F(e,t,n){return(t=B(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function V(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function N(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,B(r.key),r)}}function z(e,t,n){return t&&N(e.prototype,t),n&&N(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function B(e){var t=function(e,t){if("object"!==D(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!==D(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===D(t)?t:String(t)}function M(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Q(e,t)}function Q(e,t){return Q=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Q(e,t)}function q(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=Y(e);if(t){var o=Y(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return function(e,t){if(t&&("object"===D(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(this,n)}}function Y(e){return Y=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Y(e)}var W,Z=function(e){M(n,e);var t=q(n);function n(){var e;return V(this,n),(e=t.call(this,{dataProvider:s.u.getInstance(u.R.Ajax),cache:s.u.getInstance(a.p.Fifo),alertService:s.u.getInstance(c.P.ALERT)})).incrementingUploadId=0,e}return z(n,[{key:"name",get:function(){return"UploadDataService"}},{key:"channelName",get:function(){return"private:upload:data:service"}},{key:"requestUploads",value:function(e,t,n,r,o){var a=this,c=this.chain();i.each(t,(function(t){a.incrementingUploadId++,c.create({resource:e,eventPrefix:"request:upload:".concat(a.incrementingUploadId),data:a.getFileUploadRequest(t,n),callback:function(e){r(t,e)},errorHandler:a.alertService.error("Something went wrong while we were uploading your video. Please try again.")})})),c.func((function(){o()})).run()}},{key:"cancelUpload",value:function(e,t,n){this.create({resource:"/api/upload/cancel",eventPrefix:"cancel:upload",data:{uploadId:e,ingestUrl:t},callback:n})}},{key:"getFileUploadRequest",value:function(e,t){var n=e.name.split(".");return{name:n.join("."),extension:n.length>1?n.pop():"",fileSize:e.size,fileLifestyle:t}}},{key:"onDestroy",value:function(){s.u.releaseInstance(u.R.Ajax).releaseInstance(a.p.Fifo)}}]),n}(l.B);!function(e){e[e.Video=0]="Video",e[e.LearningResource=1]="LearningResource",e[e.Subtitle=2]="Subtitle"}(W||(W={}));var K=F(F(F({},W.Video,"video/*"),W.LearningResource,b.l.RESOURCES),W.Subtitle,b.l.SUBTITLES),H=F(F(F({},W.Video,m.Q4.VIDEO_UPLOAD),W.LearningResource,m.Q4.RESOURCE_UPLOAD),W.Subtitle,m.Q4.SUBTITLE_UPLOAD),J=function(e){M(n,e);var t=q(n);function n(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return V(this,n),t.call(this,Object.assign({uploadUrl:"/api/upload"},e))}return z(n,[{key:"initialize",value:function(){this.uploadDataService=new Z,this.progressViewModel=p.r.get("upload:progress:".concat(this.uploadType)),this.bindListeners()}},{key:"channelName",get:function(){return H[this.uploadType]}},{key:"lang",get:function(){return"uploadShared.services"}},{key:"initUploader",value:function(e,t){if(!this.uploader){var n=4194304;e&&n<e&&(n=e),t&&n>t&&(n=t),this.uploader=new A({chunkingEnabled:!0,loggingEnabled:!0,chunkSize:n,maxFileSize:53687091200,acceptedFiles:this.getAcceptedFiles(),channelName:this.channelName})}}},{key:"bindListeners",value:function(){this.listenTo(this.channelName,"progress",this.onProgress),this.listenTo(this.channelName,"upload:success",this.onSuccess)}},{key:"onProgress",value:function(e,t,n){var r=this.collection.get(e);r&&(r.set({progress:t>100?100:t,totalUploaded:n}),this.setOverallProgress())}},{key:"isUploading",value:function(){return!!this.getCollection().length}},{key:"getCollection",value:function(){return this.collection||(this.collection=new d.Q.FE),this.collection}},{key:"setOverallProgress",value:function(){var e=this,t=0,n=0,r=this.getCollection();if(r.length){r.each((function(e){t+=e.get("totalUploaded")||0,n+=e.get("file").size||0}));var o=t/n*100,i=o>=100,a=function(){e.progressViewModel.set({progress:i?100:o,done:i})};i?window.setTimeout(a,2e3):a()}else this.progressViewModel.set({progress:0})}},{key:"isValidFile",value:function(e){return A.isValidFile(e,this.getAcceptedFiles())}},{key:"addFiles",value:function(e,t){var n=this;i.any(e,(function(e){return!n.isValidFile(e)}))?d.Q.Ry.throw(new v.Z(f.T.getPhrase(this.lang,"invalidFileType"))):this.requestUploads(e,t)}},{key:"requestUploads",value:function(e,t){var n=this,r=this.isUploading(),i=this.getCollection();this.uploadDataService.requestUploads(this.options.uploadUrl,e,this.fileLifestyle,(function(e,t){n.initUploader(1024*t.minChunkSize,1024*t.maxChunkSize),e.cvUpload={uploadId:t.uploadId,ingestUrl:t.ingestUrl},n.uploader.addFile(e);var r=e.name;n.uploadType===W.Video&&(r=r.replace(/\.[^/.]+$/,"")),i.add(Object.assign({id:n.uploader.getId(e),file:e,name:r},n.getAdditionalFileInfo(e,t)),{at:i.length-1})}),(function(){t&&y.k.logUserAction({uploadCount:e.length},t),o.Radio.channel(n.channelName).trigger(g.S.FILES_ADDED,e,r)}))}},{key:"addFile",value:function(e,t){this.addFiles([e],t)}},{key:"cancelUpload",value:function(e){var t=this,n=this.getCollection(),r=n.get(e);if(r){var i=r.get("file");this.uploader.removeFile(i),n.remove(r),this.uploadDataService.cancelUpload(i.cvUpload.uploadId,i.cvUpload.ingestUrl,(function(){y.k.logUserAction(r.toJSON(),{entity:h.py.Video,actionType:h.Vw.Upload,workflowPhase:h.eu.Discard,descriptor:h.yh.Single,location:h.LZ.MyUploads}),o.Radio.channel(t.channelName).trigger(g.S.UPLOAD_CANCELLED)})),this.setOverallProgress()}}},{key:"onSuccess",value:function(e,t){var n=this.uploader.getId(e),r=this.getCollection().get(n);r.set("fileInfo",t),y.k.logUserAction({id:e.cvUpload.uploadId},{entity:h.py.Video,actionType:h.Vw.Upload,workflowPhase:h.eu.Complete,descriptor:h.yh.Single,location:h.LZ.VideoUpload}),o.Radio.channel(this.channelName).trigger(g.S.UPLOAD_COMPLETE,r)}},{key:"cancelAllUploads",value:function(){var e=this,t=this.getCollection().map((function(e){return e.get("id")}));i.each(t,(function(t){return e.cancelUpload(t)}))}},{key:"getAcceptedFiles",value:function(){return K[this.uploadType]}},{key:"getAdditionalFileInfo",value:function(e,t){return{}}}]),n}(d.Q.t6),G=function(e){M(n,e);var t=q(n);function n(){return V(this,n),t.apply(this,arguments)}return z(n,[{key:"uploadType",get:function(){return W.Video}},{key:"name",get:function(){return O.D.VideoUpload}},{key:"fileLifestyle",get:function(){return r.Temporary}}]),n}(J),$=function(e){M(n,e);var t=q(n);function n(){return V(this,n),t.apply(this,arguments)}return z(n,[{key:"uploadType",get:function(){return W.Subtitle}},{key:"name",get:function(){return O.D.SubtitleUpload}},{key:"fileLifestyle",get:function(){return r.Permanent}}]),n}(J),X=function(e){M(n,e);var t=q(n);function n(){return V(this,n),t.apply(this,arguments)}return z(n,[{key:"uploadType",get:function(){return W.LearningResource}},{key:"name",get:function(){return O.D.ResourceUpload}},{key:"fileLifestyle",get:function(){return r.Permanent}}]),n}(J)},6339:(e,t,n)=>{n.d(t,{l:()=>p,v:()=>d});var r=n(39479),o=["pdf"],i=["doc","docx","dotx","dot","rtf","docm","odt"],a=["csv","txt"],c=["xls","xlt","xlsx"],u=["jpg","tif","png","bmp","gif","jpeg"],l=["zip","rar"],s=["ppt","pot","pps","pptx"],f=["srt"],p={IMAGES:".".concat(u.join(",.")),RESOURCES:".".concat([].concat(i,c,s,o,a,u,l).join(",.")),SUBTITLES:".".concat(f.join(",."))},d={getResourceType:function(e){var t=e.toLowerCase();return r.contains(i,t)?"document":r.contains(c,t)?"excel":r.contains(s,t)?"powerpoint":r.contains(o,t)?"pdf":r.contains(a,t)?"text":r.contains(u,t)?"image":r.contains(l,t)?"archive":r.contains(f,t)?"subtitle":""}}},3836:(e,t,n)=>{n.r(t),n.d(t,{VideoUploadService:()=>U});var r,o=n(48088),i=n(79976),a=n(60139),c=n(71365),u=n(23481),l=n(29555),s=n(25041);!function(e){e[e.Upload=1]="Upload",e[e.Tv=2]="Tv"}(r||(r={}));var f,p,d=n(65728);!function(e){e[e.ExternalOnly=0]="ExternalOnly",e[e.EmbeddedOnly=1]="EmbeddedOnly"}(f||(f={})),function(e){e[e.IosApp=1]="IosApp",e[e.AndroidApp=2]="AndroidApp",e[e.WinApp=3]="WinApp",e[e.LibraryPublisher=4]="LibraryPublisher",e[e.ExchangeClient=5]="ExchangeClient",e[e.Online=6]="Online",e[e.Tinder=7]="Tinder",e[e.Cloud247=8]="Cloud247",e[e.Livestream=9]="Livestream",e[e.Curator=10]="Curator",e[e.LibraryEditor=11]="LibraryEditor",e[e.Lite=12]="Lite"}(p||(p={}));var y=n(75795),h=n(14070),g=n(97291),v=n(57322),b=n(16800);function m(e){return m="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},m(e)}function O(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,(void 0,o=function(e,t){if("object"!==m(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!==m(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(r.key),"symbol"===m(o)?o:String(o)),r)}var o}function S(){return S="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,n){var r=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=P(e)););return e}(e,t);if(r){var o=Object.getOwnPropertyDescriptor(r,t);return o.get?o.get.call(arguments.length<3?e:n):o.value}},S.apply(this,arguments)}function w(e,t){return w=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},w(e,t)}function P(e){return P=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},P(e)}var k=u.T.encloseNamespace("upload.services"),U=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&w(e,t)}(j,e);var t,n,u,s,U=(u=j,s=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=P(u);if(s){var n=P(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return function(e,t){if(t&&("object"===m(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(this,e)});function j(e){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,j),U.call(this,e)}return t=j,(n=[{key:"initialize",value:function(){S(P(j.prototype),"initialize",this).call(this),this.videoUploadDataService=c.u.getInstance(v.O.VideoUpload,this),this.pendingItemsService=c.u.getInstance(v.K.PendingItems,this),this.userDataService=c.u.getInstance(v.O.FlightUser,this),this.alertService=c.u.getInstance(i.P.ALERT,this),this.listenTo(this.channelName,l.S.FILES_ADDED,this.onUploadStart),this.listenTo(this.channelName,l.S.UPLOAD_COMPLETE,this.unlockNav),this.listenTo(this.channelName,l.S.UPLOAD_CANCELLED,this.unlockNav)}},{key:"onUploadStart",value:function(e){var t={type:a.NK.Success,heading:k("startUploadAlertHeading"),message:1===e.length?k("startUploadSingleAlertBody",{videoName:e[0].name}):k("startUploadMultipleAlertBody",{uploadCount:e.length})},n=y.O.getCurrentContext().appLink;!!b.Y.getMyVideosAppLinks().find((function(e){return n.application===e.application&&n.action===e.action}))||(t.appLinkText=k("startUploadAlertAppLinkText",{smartCount:e.length}),t.appLink={application:g.O.MY_VIDEOS,action:h.e.MyVideos.MY_VIDEOS},t.appLinkClassName="info-link"),this.alertService.createAlert(t)}},{key:"unlockNav",value:function(){this.getCollection().some((function(e){return e.get("progress")<100}))||o.Radio.channel(this.channelName).trigger(l.S.UNLOCK_NAV)}},{key:"getUpload",value:function(e){var t=this.uploader.getId(e);return this.getCollection().get(t)}},{key:"completeUpload",value:function(e,t){var n=this;e.set("sending",!0),this.userDataService.getCurrentUser((function(o){n.userDataService.getCustomerSettings(o.customerId,(function(i){n.userDataService.getWorkspace((function(a){n.videoUploadDataService.completeVideoUpload({id:e.get("id"),userId:o.id,customerId:o.customerId,libraryId:a.id,categoryId:e.get("categoryId")||null,pendingProcessOrigin:r.Upload,origin:p.Lite,fileId:t.id,subtitleOptions:{subtitleExtractOptions:f.EmbeddedOnly},video:{name:e.get("name"),description:e.get("description")},autoCaption:!!i[d.E.AutoCaptioning].value},(function(t){e.set("pendingProcessId",t.pendingProcessId),n.pendingItemsService.forceFetchPendingItems({resetTimeout:!0})}))}))}))}))}},{key:"onSuccess",value:function(e,t){var n=this;S(P(j.prototype),"onSuccess",this).call(this,e,t);var r=this.getUpload(e);r.get("editingMetadata")?this.listenToOnce(r,"change:editingMetadata",(function(){n.completeUpload(r,t)})):this.completeUpload(r,t)}},{key:"getAdditionalFileInfo",value:function(e,t){var n=y.O.getCurrentRoute().appLink;return n.application!==g.O.MY_VIDEOS||n.action!==h.e.MyVideos.MY_VIDEOS_FOLDER?{}:{categoryId:+n.args[0]}}}])&&O(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),j}(s.BaseVideoUploadService)}}]);