@clickview/lite 0.40.13 → 0.41.1-rc.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 (305) hide show
  1. package/dist/bundles.json +3 -3
  2. package/dist/css/{1204-lite-2a8f0c46bf.chunk.css → 1204-lite-6dc7215732.chunk.css} +1 -1
  3. package/dist/css/{140-lite-f8a5c5e19f.chunk.css → 140-lite-e9a20aeab2.chunk.css} +1 -1
  4. package/dist/css/{1437-lite-cec7d8a7f9.chunk.css → 1437-lite-c59c66ea91.chunk.css} +1 -1
  5. package/dist/css/{1544-lite-9c13284793.chunk.css → 1544-lite-47103cd747.chunk.css} +1 -1
  6. package/dist/css/{717-lite-85b49ea035.chunk.css → 1605-lite-6b63ac74ba.chunk.css} +1 -1
  7. package/dist/css/{1837-lite-8a694499e9.chunk.css → 1837-lite-db2ce76890.chunk.css} +1 -1
  8. package/dist/css/{1853-lite-ea987eac55.chunk.css → 1853-lite-57405d5422.chunk.css} +1 -1
  9. package/dist/css/{1895-lite-b49a03ad39.chunk.css → 1895-lite-c71c2c2318.chunk.css} +3 -3
  10. package/dist/css/{2258-lite-aeba523d8b.chunk.css → 2258-lite-63013c63e9.chunk.css} +1 -1
  11. package/dist/css/{2925-lite-6eb41c1bd9.chunk.css → 2669-lite-78061ae375.chunk.css} +1 -1
  12. package/dist/css/{2857-lite-402a65c227.chunk.css → 2857-lite-c7f65c4123.chunk.css} +1 -1
  13. package/dist/css/{2669-lite-6eb41c1bd9.chunk.css → 2925-lite-78061ae375.chunk.css} +1 -1
  14. package/dist/css/{298-lite-5e55d4ad59.chunk.css → 298-lite-fb84b77d49.chunk.css} +1 -1
  15. package/dist/css/{3067-lite-402a65c227.chunk.css → 3067-lite-c7f65c4123.chunk.css} +1 -1
  16. package/dist/css/{3095-lite-727d855b21.chunk.css → 3095-lite-a17ba7d401.chunk.css} +5 -5
  17. package/dist/css/{3545-lite-9d2b0294ad.chunk.css → 3545-lite-aac48ebf6e.chunk.css} +1 -1
  18. package/dist/css/{3715-lite-17e5c1e64f.chunk.css → 3715-lite-2000d11798.chunk.css} +1 -1
  19. package/dist/css/{7703-lite-5fde7c0a0d.chunk.css → 3866-lite-961b4c62eb.chunk.css} +0 -3
  20. package/dist/css/{2425-lite-65d64df834.chunk.css → 3867-lite-21d3044bb5.chunk.css} +8 -5
  21. package/dist/css/{4433-lite-2a8f0c46bf.chunk.css → 4433-lite-6dc7215732.chunk.css} +1 -1
  22. package/dist/css/{4448-lite-1c52af153d.chunk.css → 4448-lite-fa392bb8b0.chunk.css} +1 -1
  23. package/dist/css/{3091-lite-a7eb6e7dc7.chunk.css → 4456-lite-2e309e9281.chunk.css} +3 -3
  24. package/dist/css/4554-lite-759fd29ff7.chunk.css +3 -0
  25. package/dist/css/{4858-lite-24d9e93ce4.chunk.css → 4858-lite-d017650c10.chunk.css} +1 -1
  26. package/dist/css/{5236-lite-b94979db17.chunk.css → 5236-lite-7c636da5ec.chunk.css} +1 -1
  27. package/dist/css/{528-lite-4406ff9632.chunk.css → 528-lite-1721f616c8.chunk.css} +1 -1
  28. package/dist/css/{537-lite-4add8f83b7.chunk.css → 537-lite-1f0a40a58c.chunk.css} +3 -3
  29. package/dist/css/{5582-lite-ced3dbf86f.chunk.css → 5582-lite-0dec158033.chunk.css} +1 -1
  30. package/dist/css/{578-lite-2964dcb30d.chunk.css → 578-lite-f2de0cd84f.chunk.css} +1 -1
  31. package/dist/css/{5870-lite-0d4f49e3d7.chunk.css → 5870-lite-563429edd9.chunk.css} +1 -1
  32. package/dist/css/{2178-lite-afab1637fd.chunk.css → 6489-lite-bab22c35d3.chunk.css} +4 -3
  33. package/dist/css/6617-lite-467f605f74.chunk.css +2 -0
  34. package/dist/css/6954-lite-20677d0252.chunk.css +27 -0
  35. package/dist/css/{7381-lite-87886604f5.chunk.css → 7381-lite-e234e21b02.chunk.css} +1 -1
  36. package/dist/css/7402-lite-60accc9df9.chunk.css +6 -0
  37. package/dist/css/{9220-lite-b41247fc14.chunk.css → 766-lite-8d72eecc97.chunk.css} +1 -1
  38. package/dist/css/7670-lite-1020f1816b.chunk.css +4 -0
  39. package/dist/css/{7734-lite-c276e3e862.chunk.css → 7734-lite-8ab9b79dd1.chunk.css} +1 -1
  40. package/dist/css/{8091-lite-143b6cbcb9.chunk.css → 8091-lite-6f4357643d.chunk.css} +1 -1
  41. package/dist/css/{8142-lite-dc99ef3c5b.chunk.css → 8142-lite-cec3e3ceee.chunk.css} +1 -1
  42. package/dist/css/{800-lite-2f8c7555fe.chunk.css → 8199-lite-300c48d27b.chunk.css} +5 -4
  43. package/dist/css/{841-lite-cfba48b314.chunk.css → 841-lite-8c118416ae.chunk.css} +4 -4
  44. package/dist/css/{8581-lite-2e903f649e.chunk.css → 8581-lite-12c60b0ed8.chunk.css} +1 -1
  45. package/dist/css/{8591-lite-0d4f49e3d7.chunk.css → 8591-lite-563429edd9.chunk.css} +1 -1
  46. package/dist/css/{9038-lite-8a694499e9.chunk.css → 9038-lite-db2ce76890.chunk.css} +1 -1
  47. package/dist/css/9173-lite-b6115064f0.chunk.css +6 -0
  48. package/dist/css/{9496-lite-3715bc9dca.chunk.css → 9367-lite-1f62389eb4.chunk.css} +1 -3
  49. package/dist/css/{9620-lite-a56ecf8130.chunk.css → 9620-lite-1da8217b4c.chunk.css} +1 -1
  50. package/dist/css/{9873-lite-f6e6671a1f.chunk.css → 9873-lite-22424b9e45.chunk.css} +1 -1
  51. package/dist/css/{lite-app-d963cb909e.css → lite-app-11f61d7670.css} +5 -1
  52. package/dist/languages/en.json +1 -1
  53. package/dist/scripts/{1285-ed29f6d4d3-lite.chunk.js → 1285-e490441e6f-lite.chunk.js} +1 -1
  54. package/dist/scripts/{140-ab73c98574-lite.chunk.js → 140-4e826c6220-lite.chunk.js} +1 -1
  55. package/dist/scripts/1437-2f15dbca57-lite.chunk.js +1 -0
  56. package/dist/scripts/1466-8c87c52bac-lite.chunk.js +2 -0
  57. package/dist/scripts/{1544-7d5e3fb2fa-lite.chunk.js → 1544-bb997fec9d-lite.chunk.js} +1 -1
  58. package/dist/scripts/1605-d9b40fbd8b-lite.chunk.js +1 -0
  59. package/dist/scripts/{1617-4c9f8b8118-lite.chunk.js → 1617-131576ed64-lite.chunk.js} +1 -1
  60. package/dist/scripts/{1725-933800494d-lite.chunk.js → 1725-b6c4f32c58-lite.chunk.js} +1 -1
  61. package/dist/scripts/{1799-5010ae822c-lite.chunk.js → 1799-36f9674130-lite.chunk.js} +1 -1
  62. package/dist/scripts/{9657-8f19d3dc3d-lite.chunk.js → 1818-ba2ea75907-lite.chunk.js} +1 -1
  63. package/dist/scripts/{1853-76e4e4e5d0-lite.chunk.js → 1853-bab9a1eac4-lite.chunk.js} +1 -1
  64. package/dist/scripts/{1863-962c75c91e-lite.chunk.js → 1863-78cfe4c840-lite.chunk.js} +1 -1
  65. package/dist/scripts/1895-863b69f0d5-lite.chunk.js +2 -0
  66. package/dist/scripts/{2087-96f31a88be-lite.chunk.js → 2087-c4b134b21f-lite.chunk.js} +1 -1
  67. package/dist/scripts/{2118-d4641d37d3-lite.chunk.js → 2118-1f5b34ba30-lite.chunk.js} +1 -1
  68. package/dist/scripts/2137-d3ec723c07-lite.chunk.js +1 -0
  69. package/dist/scripts/2199-3bcf471e59-lite.chunk.js +1 -0
  70. package/dist/scripts/{2258-4cdc522e39-lite.chunk.js → 2258-8b04ba26ee-lite.chunk.js} +1 -1
  71. package/dist/scripts/{3012-d59c0bb050-lite.chunk.js → 3012-d34fee3745-lite.chunk.js} +1 -1
  72. package/dist/scripts/3095-263663f4ca-lite.chunk.js +2 -0
  73. package/dist/scripts/3285-23444ed70b-lite.chunk.js +1 -0
  74. package/dist/scripts/3297-51a8e447dc-lite.chunk.js +1 -0
  75. package/dist/scripts/3514-fb291c0ee8-lite.chunk.js +1 -0
  76. package/dist/scripts/{3533-d5c65fbe59-lite.chunk.js → 3533-c757a62648-lite.chunk.js} +1 -1
  77. package/dist/scripts/{3545-993f75e778-lite.chunk.js → 3545-518ee52548-lite.chunk.js} +1 -1
  78. package/dist/scripts/{355-a44230e534-lite.chunk.js → 355-0389718443-lite.chunk.js} +1 -1
  79. package/dist/scripts/{3645-c77cbf785e-lite.chunk.js → 3645-8dd5891bea-lite.chunk.js} +1 -1
  80. package/dist/scripts/{3667-007c9d1f02-lite.chunk.js → 3667-a6b2c192a3-lite.chunk.js} +1 -1
  81. package/dist/scripts/{3715-a4518839ea-lite.chunk.js → 3715-885e00afcd-lite.chunk.js} +1 -1
  82. package/dist/scripts/3866-6a1ebaf3c0-lite.chunk.js +1 -0
  83. package/dist/scripts/3867-5134bdab8c-lite.chunk.js +2 -0
  84. package/dist/scripts/{3879-cbfb00639f-lite.chunk.js → 3879-701f10ad1b-lite.chunk.js} +1 -1
  85. package/dist/scripts/3966-d8e95010bc-lite.chunk.js +1 -0
  86. package/dist/scripts/4343-5be11a3650-lite.chunk.js +1 -0
  87. package/dist/scripts/{4448-546e0f5869-lite.chunk.js → 4448-d71d3c0598-lite.chunk.js} +1 -1
  88. package/dist/scripts/4456-ca4c9a5cb4-lite.chunk.js +2 -0
  89. package/dist/scripts/4554-f814b95e78-lite.chunk.js +1 -0
  90. package/dist/scripts/4632-e42ff5baa2-lite.chunk.js +1 -0
  91. package/dist/scripts/{4942-afc968f530-lite.chunk.js → 4942-70d631baad-lite.chunk.js} +1 -1
  92. package/dist/scripts/{5236-0b271721cb-lite.chunk.js → 5236-379d0bee5d-lite.chunk.js} +1 -1
  93. package/dist/scripts/{5268-55d1c2794b-lite.chunk.js → 5268-1c8a1f1e0e-lite.chunk.js} +1 -1
  94. package/dist/scripts/537-0c5b3ae67e-lite.chunk.js +2 -0
  95. package/dist/scripts/5373-efa36674f8-lite.chunk.js +1 -0
  96. package/dist/scripts/5438-1b4ca0bda9-lite.chunk.js +1 -0
  97. package/dist/scripts/5446-243e51a26b-lite.chunk.js +1 -0
  98. package/dist/scripts/{3530-eeb569476f-lite.chunk.js → 5591-1542062e4c-lite.chunk.js} +1 -1
  99. package/dist/scripts/{5622-a61f1e54e6-lite.chunk.js → 5622-33d37fd24f-lite.chunk.js} +2 -2
  100. package/dist/scripts/{578-54a3e03281-lite.chunk.js → 578-fe4be0e9bf-lite.chunk.js} +1 -1
  101. package/dist/scripts/{5940-a5620a0c75-lite.chunk.js → 5940-da531ba9dc-lite.chunk.js} +1 -1
  102. package/dist/scripts/5956-3973b00a99-lite.chunk.js +1 -0
  103. package/dist/scripts/{5974-ac3cab53f3-lite.chunk.js → 5974-ad9644fec8-lite.chunk.js} +1 -1
  104. package/dist/scripts/6014-fd6988a88f-lite.chunk.js +1 -0
  105. package/dist/scripts/6086-119dd59a8c-lite.chunk.js +2 -0
  106. package/dist/scripts/{6102-4abd84bb82-lite.chunk.js → 6102-2959f323fb-lite.chunk.js} +2 -2
  107. package/dist/scripts/{6158-736e9ca3b7-lite.chunk.js → 6158-2284b2b4a5-lite.chunk.js} +1 -1
  108. package/dist/scripts/{5040-1c850ac6c0-lite.chunk.js → 6222-96aaa999aa-lite.chunk.js} +1 -1
  109. package/dist/scripts/{6274-440eadbb73-lite.chunk.js → 6274-565d64f00b-lite.chunk.js} +1 -1
  110. package/dist/scripts/6375-23a6447b44-lite.chunk.js +1 -0
  111. package/dist/scripts/{6433-f23dc696cb-lite.chunk.js → 6433-a6037155b0-lite.chunk.js} +2 -2
  112. package/dist/scripts/6489-c313e9c8f2-lite.chunk.js +2 -0
  113. package/dist/scripts/6617-9c4a14d7ec-lite.chunk.js +2 -0
  114. package/dist/scripts/6741-714df05335-lite.chunk.js +2 -0
  115. package/dist/scripts/6954-1310ddaf71-lite.chunk.js +1 -0
  116. package/dist/scripts/7052-a222efa57e-lite.chunk.js +2 -0
  117. package/dist/scripts/714-fd0f681746-lite.chunk.js +1 -0
  118. package/dist/scripts/7288-ef394bd5f1-lite.chunk.js +1 -0
  119. package/dist/scripts/{7293-f1f6413f7d-lite.chunk.js → 7293-61cdb1f653-lite.chunk.js} +1 -1
  120. package/dist/scripts/{7351-748f66b63a-lite.chunk.js → 7351-45bab52251-lite.chunk.js} +1 -1
  121. package/dist/scripts/{7381-c80ef1a6e4-lite.chunk.js → 7381-2f30be20cc-lite.chunk.js} +1 -1
  122. package/dist/scripts/7402-74f2a70ef1-lite.chunk.js +2 -0
  123. package/dist/scripts/7432-4b02802c11-lite.chunk.js +1 -0
  124. package/dist/scripts/{7540-d24ed19f2a-lite.chunk.js → 7540-1d46c755ba-lite.chunk.js} +1 -1
  125. package/dist/scripts/766-60efa0f621-lite.chunk.js +1 -0
  126. package/dist/scripts/7670-ac16764513-lite.chunk.js +2 -0
  127. package/dist/scripts/{7708-765c1230b2-lite.chunk.js → 7708-ef1267a3d9-lite.chunk.js} +1 -1
  128. package/dist/scripts/771-5cc0830c2e-lite.chunk.js +2 -0
  129. package/dist/scripts/{7734-25ea436ac3-lite.chunk.js → 7734-c7865a5a1b-lite.chunk.js} +1 -1
  130. package/dist/scripts/{7855-e855f566e8-lite.chunk.js → 7855-8d35ffa530-lite.chunk.js} +1 -1
  131. package/dist/scripts/7888-c0a2ddfc85-lite.chunk.js +1 -0
  132. package/dist/scripts/8091-d5846a813d-lite.chunk.js +1 -0
  133. package/dist/scripts/{8142-80fc28b5d3-lite.chunk.js → 8142-02e0759222-lite.chunk.js} +1 -1
  134. package/dist/scripts/{3237-a715654615-lite.chunk.js → 8176-b31ecfe1f8-lite.chunk.js} +1 -1
  135. package/dist/scripts/8199-bb53edb5f1-lite.chunk.js +2 -0
  136. package/dist/scripts/{8243-2019943c42-lite.chunk.js → 8243-c3b4781436-lite.chunk.js} +1 -1
  137. package/dist/scripts/{8323-fb81aa9c93-lite.chunk.js → 8323-9c6c6ea00f-lite.chunk.js} +1 -1
  138. package/dist/scripts/841-ae809f851d-lite.chunk.js +2 -0
  139. package/dist/scripts/{8935-903433f26a-lite.chunk.js → 8935-eb635219f2-lite.chunk.js} +1 -1
  140. package/dist/scripts/{9016-2e9e388f0f-lite.chunk.js → 9016-83362009ad-lite.chunk.js} +1 -1
  141. package/dist/scripts/{9151-d91e8c8b6e-lite.chunk.js → 9151-2fbfab2e35-lite.chunk.js} +1 -1
  142. package/dist/scripts/9173-dc7f87cdf5-lite.chunk.js +2 -0
  143. package/dist/scripts/{9230-d8754a3583-lite.chunk.js → 9230-ee9d176072-lite.chunk.js} +2 -2
  144. package/dist/scripts/{9254-adc0ab4f0f-lite.chunk.js → 9254-35c0478f1b-lite.chunk.js} +1 -1
  145. package/dist/scripts/9367-8563a20575-lite.chunk.js +1 -0
  146. package/dist/scripts/{9371-7458ffe944-lite.chunk.js → 9371-606ff795e1-lite.chunk.js} +2 -2
  147. package/dist/scripts/{9433-236ebb0d1f-lite.chunk.js → 9433-c2995bc661-lite.chunk.js} +1 -1
  148. package/dist/scripts/{9478-5d8f73174a-lite.chunk.js → 9478-9c89118ea8-lite.chunk.js} +2 -2
  149. package/dist/scripts/{9484-01bd4554aa-lite.chunk.js → 9484-b02ae66df4-lite.chunk.js} +1 -1
  150. package/dist/scripts/{9708-b1aad23a03-lite.chunk.js → 9708-6842c8c42e-lite.chunk.js} +1 -1
  151. package/dist/scripts/9843-f92794771a-lite.chunk.js +1 -0
  152. package/dist/scripts/{9894-048150c2f4-lite.chunk.js → 9894-7b79774dbb-lite.chunk.js} +2 -2
  153. package/dist/scripts/9918-cc79995e75-lite.chunk.js +2 -0
  154. package/dist/scripts/9918-cc79995e75-lite.chunk.js.LICENSE.txt +1 -0
  155. package/dist/scripts/bundle-3bccb10d43.min.js +2 -0
  156. package/dist/scripts/{polyfills-a424e31154.min.js → polyfills-2c9c32349a.min.js} +2 -2
  157. package/dist/scripts/polyfills-2c9c32349a.min.js.LICENSE.txt +1 -0
  158. package/package.json +1 -1
  159. package/dist/css/1890-lite-a05cab094a.chunk.css +0 -6
  160. package/dist/css/3331-lite-61d68ce5f6.chunk.css +0 -5
  161. package/dist/css/5649-lite-1df8fad6e4.chunk.css +0 -6
  162. package/dist/css/5759-lite-60a1816128.chunk.css +0 -7
  163. package/dist/css/7670-lite-d298d605ca.chunk.css +0 -4
  164. package/dist/scripts/1437-2c96697cfb-lite.chunk.js +0 -1
  165. package/dist/scripts/1890-5c789c3db3-lite.chunk.js +0 -2
  166. package/dist/scripts/1895-210dd84eb7-lite.chunk.js +0 -2
  167. package/dist/scripts/2137-691089bc12-lite.chunk.js +0 -1
  168. package/dist/scripts/2178-6e10ba5efc-lite.chunk.js +0 -2
  169. package/dist/scripts/2199-8669e14dda-lite.chunk.js +0 -1
  170. package/dist/scripts/2425-db96dab3b9-lite.chunk.js +0 -2
  171. package/dist/scripts/3091-2e1cac3ad0-lite.chunk.js +0 -2
  172. package/dist/scripts/3095-6273cd7e5a-lite.chunk.js +0 -2
  173. package/dist/scripts/3285-d879b23a22-lite.chunk.js +0 -1
  174. package/dist/scripts/3297-f0d89f016e-lite.chunk.js +0 -1
  175. package/dist/scripts/3331-19babc422f-lite.chunk.js +0 -2
  176. package/dist/scripts/3966-4207a5a415-lite.chunk.js +0 -1
  177. package/dist/scripts/4343-bc09351415-lite.chunk.js +0 -1
  178. package/dist/scripts/4632-eda8f81e57-lite.chunk.js +0 -1
  179. package/dist/scripts/4690-9837767325-lite.chunk.js +0 -1
  180. package/dist/scripts/537-8af041e1d0-lite.chunk.js +0 -2
  181. package/dist/scripts/5373-100cc1ebbe-lite.chunk.js +0 -1
  182. package/dist/scripts/5438-8a6d6510f6-lite.chunk.js +0 -1
  183. package/dist/scripts/5446-3aa3305aa3-lite.chunk.js +0 -1
  184. package/dist/scripts/5649-d0f0449762-lite.chunk.js +0 -2
  185. package/dist/scripts/5759-e2bb4fcc02-lite.chunk.js +0 -2
  186. package/dist/scripts/6086-f2dda1932e-lite.chunk.js +0 -2
  187. package/dist/scripts/6468-7fb18a4fcb-lite.chunk.js +0 -2
  188. package/dist/scripts/6572-5050835f07-lite.chunk.js +0 -1
  189. package/dist/scripts/689-d4c0f4be34-lite.chunk.js +0 -1
  190. package/dist/scripts/6891-bd7b27f0f9-lite.chunk.js +0 -1
  191. package/dist/scripts/7052-13af5c94cd-lite.chunk.js +0 -2
  192. package/dist/scripts/714-5ee3c48f4b-lite.chunk.js +0 -1
  193. package/dist/scripts/717-751bc3a8a2-lite.chunk.js +0 -1
  194. package/dist/scripts/7288-63fb53445f-lite.chunk.js +0 -1
  195. package/dist/scripts/7395-765bdd4423-lite.chunk.js +0 -1
  196. package/dist/scripts/7432-5c154e70d7-lite.chunk.js +0 -1
  197. package/dist/scripts/7670-9b9e7ae77c-lite.chunk.js +0 -2
  198. package/dist/scripts/7703-5a700f54be-lite.chunk.js +0 -1
  199. package/dist/scripts/7888-406f646c7b-lite.chunk.js +0 -1
  200. package/dist/scripts/800-d824f359c2-lite.chunk.js +0 -2
  201. package/dist/scripts/8091-7e2124cdf8-lite.chunk.js +0 -1
  202. package/dist/scripts/841-21378e7d52-lite.chunk.js +0 -2
  203. package/dist/scripts/8834-cbf2580708-lite.chunk.js +0 -1
  204. package/dist/scripts/9220-ea069e4ca8-lite.chunk.js +0 -1
  205. package/dist/scripts/9496-b26d0b0d24-lite.chunk.js +0 -1
  206. package/dist/scripts/9843-dcb167be15-lite.chunk.js +0 -1
  207. package/dist/scripts/bundle-f84245291c.min.js +0 -2
  208. /package/dist/css/{9657-lite-85c08e0392.chunk.css → 1818-lite-85c08e0392.chunk.css} +0 -0
  209. /package/dist/css/{6891-lite-a288188c68.chunk.css → 3514-lite-a288188c68.chunk.css} +0 -0
  210. /package/dist/css/{4690-lite-a4fdd7e61e.chunk.css → 5956-lite-a4fdd7e61e.chunk.css} +0 -0
  211. /package/dist/css/{7395-lite-ada697a796.chunk.css → 6741-lite-ada697a796.chunk.css} +0 -0
  212. /package/dist/scripts/{1204-bd4d6cb892-lite.chunk.js → 1204-77ff9b338e-lite.chunk.js} +0 -0
  213. /package/dist/scripts/{1890-5c789c3db3-lite.chunk.js.LICENSE.txt → 1466-8c87c52bac-lite.chunk.js.LICENSE.txt} +0 -0
  214. /package/dist/scripts/{1518-a5f1790d61-lite.chunk.js → 1518-16e55504cf-lite.chunk.js} +0 -0
  215. /package/dist/scripts/{1750-2ba63f679f-lite.chunk.js → 1750-1f8d21137d-lite.chunk.js} +0 -0
  216. /package/dist/scripts/{1837-36e4a7f9a8-lite.chunk.js → 1837-58695e09ae-lite.chunk.js} +0 -0
  217. /package/dist/scripts/{1891-587c3b9f20-lite.chunk.js → 1891-5dcf62aecb-lite.chunk.js} +0 -0
  218. /package/dist/scripts/{1895-210dd84eb7-lite.chunk.js.LICENSE.txt → 1895-863b69f0d5-lite.chunk.js.LICENSE.txt} +0 -0
  219. /package/dist/scripts/{2118-d4641d37d3-lite.chunk.js.LICENSE.txt → 2118-1f5b34ba30-lite.chunk.js.LICENSE.txt} +0 -0
  220. /package/dist/scripts/{2261-8338ff3b5f-lite.chunk.js → 2261-0dda0b5425-lite.chunk.js} +0 -0
  221. /package/dist/scripts/{2857-008bb7618b-lite.chunk.js → 2857-cddfa04dd1-lite.chunk.js} +0 -0
  222. /package/dist/scripts/{2925-eb7c5f9417-lite.chunk.js → 2925-da3f2e9429-lite.chunk.js} +0 -0
  223. /package/dist/scripts/{298-a52fa80326-lite.chunk.js → 298-4ec4d2fad7-lite.chunk.js} +0 -0
  224. /package/dist/scripts/{3020-42f8a22783-lite.chunk.js → 3020-4a2fb9003c-lite.chunk.js} +0 -0
  225. /package/dist/scripts/{3067-c97645c69e-lite.chunk.js → 3067-b5ea2df83b-lite.chunk.js} +0 -0
  226. /package/dist/scripts/{2178-6e10ba5efc-lite.chunk.js.LICENSE.txt → 3095-263663f4ca-lite.chunk.js.LICENSE.txt} +0 -0
  227. /package/dist/scripts/{3108-0ca7ccf906-lite.chunk.js → 3108-15ec707fa7-lite.chunk.js} +0 -0
  228. /package/dist/scripts/{3170-ed00595436-lite.chunk.js → 3170-b0396283ae-lite.chunk.js} +0 -0
  229. /package/dist/scripts/{3171-17f65b285f-lite.chunk.js → 3171-81d2900564-lite.chunk.js} +0 -0
  230. /package/dist/scripts/{3468-d0dbc5fe35-lite.chunk.js → 3468-1262bc39ae-lite.chunk.js} +0 -0
  231. /package/dist/scripts/{2425-db96dab3b9-lite.chunk.js.LICENSE.txt → 3645-8dd5891bea-lite.chunk.js.LICENSE.txt} +0 -0
  232. /package/dist/scripts/{3091-2e1cac3ad0-lite.chunk.js.LICENSE.txt → 3667-a6b2c192a3-lite.chunk.js.LICENSE.txt} +0 -0
  233. /package/dist/scripts/{3095-6273cd7e5a-lite.chunk.js.LICENSE.txt → 3867-5134bdab8c-lite.chunk.js.LICENSE.txt} +0 -0
  234. /package/dist/scripts/{389-2e6bcc3ee9-lite.chunk.js → 389-7cd9797e99-lite.chunk.js} +0 -0
  235. /package/dist/scripts/{4182-d41e2f3ece-lite.chunk.js → 4182-031df6501a-lite.chunk.js} +0 -0
  236. /package/dist/scripts/{4433-7b03f5b1b2-lite.chunk.js → 4433-684da4ef45-lite.chunk.js} +0 -0
  237. /package/dist/scripts/{3331-19babc422f-lite.chunk.js.LICENSE.txt → 4456-ca4c9a5cb4-lite.chunk.js.LICENSE.txt} +0 -0
  238. /package/dist/scripts/{4541-b85125f4c2-lite.chunk.js → 4541-bc86a7626f-lite.chunk.js} +0 -0
  239. /package/dist/scripts/{482-3fd089844f-lite.chunk.js → 482-aca85764e8-lite.chunk.js} +0 -0
  240. /package/dist/scripts/{4858-becf7357d4-lite.chunk.js → 4858-b0238d4405-lite.chunk.js} +0 -0
  241. /package/dist/scripts/{3645-c77cbf785e-lite.chunk.js.LICENSE.txt → 4942-70d631baad-lite.chunk.js.LICENSE.txt} +0 -0
  242. /package/dist/scripts/{5229-5ac7bb7b0f-lite.chunk.js → 5229-504bcc7747-lite.chunk.js} +0 -0
  243. /package/dist/scripts/{3667-007c9d1f02-lite.chunk.js.LICENSE.txt → 5236-379d0bee5d-lite.chunk.js.LICENSE.txt} +0 -0
  244. /package/dist/scripts/{4942-afc968f530-lite.chunk.js.LICENSE.txt → 5268-1c8a1f1e0e-lite.chunk.js.LICENSE.txt} +0 -0
  245. /package/dist/scripts/{528-b4f3763c55-lite.chunk.js → 528-e85fa6e55d-lite.chunk.js} +0 -0
  246. /package/dist/scripts/{5236-0b271721cb-lite.chunk.js.LICENSE.txt → 537-0c5b3ae67e-lite.chunk.js.LICENSE.txt} +0 -0
  247. /package/dist/scripts/{5385-b1c4bb4174-lite.chunk.js → 5385-f7e8700643-lite.chunk.js} +0 -0
  248. /package/dist/scripts/{5582-a14fa9d0de-lite.chunk.js → 5582-776496057e-lite.chunk.js} +0 -0
  249. /package/dist/scripts/{5595-60c857c938-lite.chunk.js → 5595-c259bda4d0-lite.chunk.js} +0 -0
  250. /package/dist/scripts/{5606-bfbee0ae2f-lite.chunk.js → 5606-5cccdb0326-lite.chunk.js} +0 -0
  251. /package/dist/scripts/{5268-55d1c2794b-lite.chunk.js.LICENSE.txt → 5622-33d37fd24f-lite.chunk.js.LICENSE.txt} +0 -0
  252. /package/dist/scripts/{5870-6c5315f526-lite.chunk.js → 5870-fb27d82c66-lite.chunk.js} +0 -0
  253. /package/dist/scripts/{5877-d8c2c45519-lite.chunk.js → 5877-79b358f14d-lite.chunk.js} +0 -0
  254. /package/dist/scripts/{537-8af041e1d0-lite.chunk.js.LICENSE.txt → 6086-119dd59a8c-lite.chunk.js.LICENSE.txt} +0 -0
  255. /package/dist/scripts/{5622-a61f1e54e6-lite.chunk.js.LICENSE.txt → 6102-2959f323fb-lite.chunk.js.LICENSE.txt} +0 -0
  256. /package/dist/scripts/{6285-5f67c936d7-lite.chunk.js → 6285-4bd1772853-lite.chunk.js} +0 -0
  257. /package/dist/scripts/{6290-acb5b6533d-lite.chunk.js → 6290-579768d51c-lite.chunk.js} +0 -0
  258. /package/dist/scripts/{6330-48c2e2fe88-lite.chunk.js → 6330-748f77531b-lite.chunk.js} +0 -0
  259. /package/dist/scripts/{5649-d0f0449762-lite.chunk.js.LICENSE.txt → 6433-a6037155b0-lite.chunk.js.LICENSE.txt} +0 -0
  260. /package/dist/scripts/{6450-65ce27d27e-lite.chunk.js → 6450-3d69f27d4a-lite.chunk.js} +0 -0
  261. /package/dist/scripts/{6465-53aa1bc42c-lite.chunk.js → 6465-222d004761-lite.chunk.js} +0 -0
  262. /package/dist/scripts/{6480-f92ce10d94-lite.chunk.js → 6480-c1da9df604-lite.chunk.js} +0 -0
  263. /package/dist/scripts/{5759-e2bb4fcc02-lite.chunk.js.LICENSE.txt → 6489-c313e9c8f2-lite.chunk.js.LICENSE.txt} +0 -0
  264. /package/dist/scripts/{6086-f2dda1932e-lite.chunk.js.LICENSE.txt → 6617-9c4a14d7ec-lite.chunk.js.LICENSE.txt} +0 -0
  265. /package/dist/scripts/{6689-c168b4b746-lite.chunk.js → 6689-41f2babb73-lite.chunk.js} +0 -0
  266. /package/dist/scripts/{6102-4abd84bb82-lite.chunk.js.LICENSE.txt → 6741-714df05335-lite.chunk.js.LICENSE.txt} +0 -0
  267. /package/dist/scripts/{6863-4813c48be3-lite.chunk.js → 6863-776600ada0-lite.chunk.js} +0 -0
  268. /package/dist/scripts/{6433-f23dc696cb-lite.chunk.js.LICENSE.txt → 7052-a222efa57e-lite.chunk.js.LICENSE.txt} +0 -0
  269. /package/dist/scripts/{7115-e68b195572-lite.chunk.js → 7115-cb79ea0c44-lite.chunk.js} +0 -0
  270. /package/dist/scripts/{7128-ed05452af9-lite.chunk.js → 7128-0fb3d40e9f-lite.chunk.js} +0 -0
  271. /package/dist/scripts/{7167-7a9f9edfd1-lite.chunk.js → 7167-c06f8a9da0-lite.chunk.js} +0 -0
  272. /package/dist/scripts/{7172-d2f617ea2b-lite.chunk.js → 7172-a74288ef51-lite.chunk.js} +0 -0
  273. /package/dist/scripts/{7338-7a5e87567f-lite.chunk.js → 7338-a9d72104b9-lite.chunk.js} +0 -0
  274. /package/dist/scripts/{6468-7fb18a4fcb-lite.chunk.js.LICENSE.txt → 7402-74f2a70ef1-lite.chunk.js.LICENSE.txt} +0 -0
  275. /package/dist/scripts/{7409-c218323366-lite.chunk.js → 7409-d4cc5058d5-lite.chunk.js} +0 -0
  276. /package/dist/scripts/{7052-13af5c94cd-lite.chunk.js.LICENSE.txt → 7670-ac16764513-lite.chunk.js.LICENSE.txt} +0 -0
  277. /package/dist/scripts/{7670-9b9e7ae77c-lite.chunk.js.LICENSE.txt → 771-5cc0830c2e-lite.chunk.js.LICENSE.txt} +0 -0
  278. /package/dist/scripts/{7715-5fc77174f4-lite.chunk.js → 7715-486cb2c98a-lite.chunk.js} +0 -0
  279. /package/dist/scripts/{7818-1926ce05b3-lite.chunk.js → 7818-90809174d8-lite.chunk.js} +0 -0
  280. /package/dist/scripts/{7925-467145a79b-lite.chunk.js → 7925-fbb2b17515-lite.chunk.js} +0 -0
  281. /package/dist/scripts/{7934-2e5ea400d8-lite.chunk.js → 7934-f0a2cc438d-lite.chunk.js} +0 -0
  282. /package/dist/scripts/{8025-5666d20de4-lite.chunk.js → 8025-96f1616dba-lite.chunk.js} +0 -0
  283. /package/dist/scripts/{800-d824f359c2-lite.chunk.js.LICENSE.txt → 8199-bb53edb5f1-lite.chunk.js.LICENSE.txt} +0 -0
  284. /package/dist/scripts/{8323-fb81aa9c93-lite.chunk.js.LICENSE.txt → 8323-9c6c6ea00f-lite.chunk.js.LICENSE.txt} +0 -0
  285. /package/dist/scripts/{841-21378e7d52-lite.chunk.js.LICENSE.txt → 841-ae809f851d-lite.chunk.js.LICENSE.txt} +0 -0
  286. /package/dist/scripts/{8581-9ee5720863-lite.chunk.js → 8581-b8595f0267-lite.chunk.js} +0 -0
  287. /package/dist/scripts/{8591-eeb7270659-lite.chunk.js → 8591-64b682611e-lite.chunk.js} +0 -0
  288. /package/dist/scripts/{8820-8b6150f22d-lite.chunk.js → 8820-6284bf6650-lite.chunk.js} +0 -0
  289. /package/dist/scripts/{8830-d6c6230211-lite.chunk.js → 8830-30cd7cd68f-lite.chunk.js} +0 -0
  290. /package/dist/scripts/{8935-903433f26a-lite.chunk.js.LICENSE.txt → 8935-eb635219f2-lite.chunk.js.LICENSE.txt} +0 -0
  291. /package/dist/scripts/{9016-2e9e388f0f-lite.chunk.js.LICENSE.txt → 9016-83362009ad-lite.chunk.js.LICENSE.txt} +0 -0
  292. /package/dist/scripts/{9038-44079f81d8-lite.chunk.js → 9038-25cce8bb4c-lite.chunk.js} +0 -0
  293. /package/dist/scripts/{9060-c44d18111b-lite.chunk.js → 9060-c1ca702772-lite.chunk.js} +0 -0
  294. /package/dist/scripts/{9230-d8754a3583-lite.chunk.js.LICENSE.txt → 9173-dc7f87cdf5-lite.chunk.js.LICENSE.txt} +0 -0
  295. /package/dist/scripts/{9226-c05154854b-lite.chunk.js → 9226-b5b13e36e8-lite.chunk.js} +0 -0
  296. /package/dist/scripts/{9371-7458ffe944-lite.chunk.js.LICENSE.txt → 9230-ee9d176072-lite.chunk.js.LICENSE.txt} +0 -0
  297. /package/dist/scripts/{9478-5d8f73174a-lite.chunk.js.LICENSE.txt → 9371-606ff795e1-lite.chunk.js.LICENSE.txt} +0 -0
  298. /package/dist/scripts/{9455-badcb93290-lite.chunk.js → 9455-f87c0d3adb-lite.chunk.js} +0 -0
  299. /package/dist/scripts/{9484-01bd4554aa-lite.chunk.js.LICENSE.txt → 9478-9c89118ea8-lite.chunk.js.LICENSE.txt} +0 -0
  300. /package/dist/scripts/{9894-048150c2f4-lite.chunk.js.LICENSE.txt → 9484-b02ae66df4-lite.chunk.js.LICENSE.txt} +0 -0
  301. /package/dist/scripts/{9620-67397c3161-lite.chunk.js → 9620-e2cab0d44d-lite.chunk.js} +0 -0
  302. /package/dist/scripts/{9674-190c1e053d-lite.chunk.js → 9674-b79b2faa3e-lite.chunk.js} +0 -0
  303. /package/dist/scripts/{9873-7e0bb4e37a-lite.chunk.js → 9873-426e66cc0d-lite.chunk.js} +0 -0
  304. /package/dist/scripts/{polyfills-a424e31154.min.js.LICENSE.txt → 9894-7b79774dbb-lite.chunk.js.LICENSE.txt} +0 -0
  305. /package/dist/scripts/{bundle-f84245291c.min.js.LICENSE.txt → bundle-3bccb10d43.min.js.LICENSE.txt} +0 -0
@@ -1,2 +0,0 @@
1
- /*! For license information please see 3091-2e1cac3ad0-lite.chunk.js.LICENSE.txt */
2
- "use strict";(self.webpackChunk_clickview_lite=self.webpackChunk_clickview_lite||[]).push([[3091],{73758:(e,t,n)=>{function r(e){return r="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},r(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,o(r.key),r)}}function o(e){var t=function(e,t){if("object"!=r(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var i=n.call(e,"string");if("object"!=r(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==r(t)?t:String(t)}n.d(t,{n:()=>a});var a=new(function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.listeners={}}var t,n;return t=e,n=[{key:"subscribe",value:function(e,t){this.registerListener(e,t)}},{key:"subscribeOnce",value:function(e,t){this.registerListener(e,t,1)}},{key:"unsubscribe",value:function(e,t){this.deregisterListener(e,t)}},{key:"trigger",value:function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];this.triggerCallbacks(e,n)}},{key:"registerListener",value:function(e,t,n){var r;if("string"!=typeof e)throw new Error("Event name must be a string");if("function"!=typeof t)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[e]=null!==(r=this.listeners[e])&&void 0!==r?r:[],this.listeners[e].push({callback:t,executionLimit:n})}},{key:"deregisterListener",value:function(e,t){var n;if("string"!=typeof e)throw new Error("Event name must be a string");if(t&&"function"!=typeof t)throw new Error("Event callback must be a function");if(t){var r=null===(n=this.listeners[e])||void 0===n?void 0:n.findIndex((function(e){return e.callback===t}));"number"==typeof r&&-1!==r&&(this.listeners[e].splice(r,1),0===this.listeners[e].length&&delete this.listeners[e])}else this.listeners[e]=[]}},{key:"triggerCallbacks",value:function(e){for(var t=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[e]){var o=[];this.listeners[e].forEach((function(e){var t,n;"number"==typeof e.executionLimit&&(e.executionCount=null!==(n=e.executionCount)&&void 0!==n?n:0,e.executionCount++,e.executionCount===e.executionLimit&&o.push(e.callback)),(t=e.callback).apply.apply(t,[null].concat(r))})),o.length&&o.forEach((function(n){return t.deregisterListener(e,n)}))}}}],n&&i(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),e}())},26733:(e,t,n)=>{n.d(t,{s:()=>O,R:()=>P});var r=n(32735),i=n(39202),o=n(97395),a=n(49985),s=n(65858),u=n(36848),c=n(75163),l=n(76177),f=n(71063),p=n(54610),h=n(4594),y=n(1164),d=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:p.Nq.Cover};function m(e,t){var n,r,i;if("thumbnail"in t&&(null===(n=t.thumbnail)||void 0===n?void 0:n.url))return v.j.createUrl(null===(r=t.thumbnail)||void 0===r?void 0:r.url,Object.assign({},g));var a=o._.safeUrlConcat(e,"/v1/previews");return"metadata"in t?t.metadata.type===y.L.Pdf?v.j.createResourceImage(a,t.url,g):t.metadata.type===y.L.Image?v.j.createUrl(t.url,{size:p.h2.Medium,resizeType:p.Nq.Cover}):(null===(i=t.pdf)||void 0===i?void 0:i.url)?v.j.createResourceImage(a,t.pdf.url,g):(t.metadata.type,y.L.Zip,"/images/zip-resource.png"):v.j.createResourceImage(a,t.url,Object.assign({},g))}function w(e){var t;return"metadata"in e?e.metadata.type===y.L.Pdf?p.__.Pdf:e.metadata.type===y.L.Image?p.__.Thumbnails:(null===(t=e.pdf)||void 0===t?void 0:t.url)?p.__.Pdf:(e.metadata.type,y.L.Zip,p.__.Thumbnails):p.__.Link}function O(e){var t,n,i,o,a,u,f,p=null,h=0;"metadata"in e.data&&(p=e.data.metadata,h=null!==(i=null===(n=null===(t=e.data.thumbnail)||void 0===t?void 0:t.metadata)||void 0===n?void 0:n.rotation)&&void 0!==i?i:0);var d="".concat(null!==(a=null===(o=e.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(e){switch(e){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==p?void 0:p.resourceType)," ").concat(b.background," ").concat(e.applyHoverState?b.hoverState:""," ");return r.createElement("div",{className:d},!e.hideHeading&&r.createElement(l.u,{title:e.data.name},r.createElement("h3",{className:"text-center text-break h5 mb-3 ".concat(b.text)},r.createElement("span",{className:"clamp-1"},e.data.name))),r.createElement("div",{className:"".concat(null!==(f=null===(u=e.theme)||void 0===u?void 0:u.thumbnailContainerClass)&&void 0!==f?f:""," w-75 overflow-hidden ").concat(b.thumbnailContainer," ").concat(b.imageStyle)},r.createElement(c.Z,{data:m(e.imageCdnUrl,e.data),imageType:w(e.data),imageStyle:{transform:"rotate(".concat(h,"deg)")},alt:e.data.name,analyticsOptions:{location:s.LZ.SlidingListItem},errorFallbackImageSrc:e.imageErrorFallbackUrl,imageClassName:(null==p?void 0:p.type)===y.L.Image?"".concat(b.imageTypeResource," ").concat(b.imageStyle):"",preload:e.preloadImage,preventLoad:!e.preloadImage})))}O.defaultProps={preloadImage:!0,actionBehaviour:"normal"};var P=r.memo((function(e){var t,n,o,c,l=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n}(e,[]),p=(t=e.data,n=e.actionBehaviour,c=(0,d.k)(),"public"===n||!c.xs&&!c.sm&&"resource"===t.type&&"metadata"in t&&(t.metadata.type===y.L.Image||(t.metadata.type===y.L.Pdf?!!t.url:!!(null===(o=t.pdf)||void 0===o?void 0:o.url)))),v=Object.assign(Object.assign({},e.analyticsData),e.data),g=Object.assign(Object.assign({},e.analyticsOptions),{actionType:s.Vw.Click,entity:e.data.typeId===h.E.Resource?s.py.Resource:s.py.Link});function m(){a.k.logUserAction(v,g)}var w,P=!!e.data.url;return l.applyHoverState=p||P,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"===e.data.type?r.createElement("a",{href:e.data.url,target:"_blank",className:w,onClick:m},r.createElement(O,Object.assign({},l))):p?"public"===e.actionBehaviour?r.createElement("div",{className:"".concat(w," cursor-pointer d-inline"),onClick:function(){m(),i.C$.trigger(e.getAppLink(e.data))}},r.createElement(O,Object.assign({},l))):r.createElement(u.F,{appLink:e.getAppLink(e.data),className:w,analyticsData:v,analyticsOptions:g},r.createElement(O,Object.assign({},l))):P?r.createElement("a",{href:e.data.url,className:w,onClick:m},r.createElement(O,Object.assign({},l))):r.createElement("div",{className:w},r.createElement(O,Object.assign({},l)))))}))},1914:(e,t,n)=>{n.r(t),n.d(t,{ClickViewPlayer:()=>hi});var r=n(32735),i=n(36527),o=(n(16852),n(93861));function a(e){return a="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},a(e)}function s(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,u(r.key),r)}}function u(e){var t=function(e,t){if("object"!=a(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=a(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==a(t)?t:String(t)}function c(e,t,n){return t=p(t),function(e,t){if(t&&("object"===a(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)}(e,l()?Reflect.construct(t,n||[],p(e).constructor):t.apply(e,n))}function l(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(l=function(){return!!e})()}function f(){return f="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 i=Object.getOwnPropertyDescriptor(r,t);return i.get?i.get.call(arguments.length<3?e:n):i.value}},f.apply(this,arguments)}function p(e){return p=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},p(e)}function h(e,t){return h=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},h(e,t)}var y=function(e){function t(){var e;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(e=c(this,t,arguments)).alwaysCollapsed=!1,e.isCollapsed=!1,e.isCollabsible=!0,e}var n,r;return 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&&h(e,t)}(t,e),n=t,(r=[{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(){f(p(t.prototype),"handleClick",this).call(this,null)}}])&&s(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),t}(o.Z.getComponent("Button"));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 v(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 b(e){var t=function(e,t){if("object"!=d(e)||!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 g(e,t,n){return t=w(t),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)}(e,m()?Reflect.construct(t,n||[],w(e).constructor):t.apply(e,n))}function m(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(m=function(){return!!e})()}function w(e){return w=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},w(e)}function O(e,t){return O=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},O(e,t)}y.prototype.controlText_="Create Clip",o.Z.registerComponent("CreateClipButton",y);var P=function(e){function t(e,n){var r;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(r=g(this,t,[e,n])).options=n,e.ready((function(){return r.onReady()})),r}var n,r;return 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&&O(e,t)}(t,e),n=t,(r=[{key:"onReady",value:function(){var e,t=this.player.getChild("collapserator"),n=null===(e=null==t?void 0:t.children())||void 0===e?void 0:e.findIndex((function(e){return"CustomControlSpacer"===e.name()}));n&&-1!==n&&t.addChild("CreateClipButton",{clickHandler:this.options.onClick},n+1)}}])&&v(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),t}(o.Z.getPlugin("plugin"));function S(e){return S="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},S(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,j(r.key),r)}}function j(e){var t=function(e,t){if("object"!=S(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=S(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==S(t)?t:String(t)}function C(e,t,n){return t=E(t),function(e,t){if(t&&("object"===S(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)}(e,T()?Reflect.construct(t,n||[],E(e).constructor):t.apply(e,n))}function T(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(T=function(){return!!e})()}function E(e){return E=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},E(e)}function _(e,t){return _=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},_(e,t)}o.Z.registerPlugin("createClipButtonPlugin",P);var I=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),C(this,t,arguments)}var n,r;return 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&&_(e,t)}(t,e),n=t,(r=[{key:"handlePictureInPictureEnabledChange",value:function(){this.enable()}}])&&k(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),t}(o.Z.getComponent("PictureInPictureToggle"));function x(e){return x="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},x(e)}function R(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,M(r.key),r)}}function M(e){var t=function(e,t){if("object"!=x(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=x(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==x(t)?t:String(t)}function L(e,t,n){return t=V(t),function(e,t){if(t&&("object"===x(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)}(e,D()?Reflect.construct(t,n||[],V(e).constructor):t.apply(e,n))}function D(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(D=function(){return!!e})()}function N(){return N="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=V(e)););return e}(e,t);if(r){var i=Object.getOwnPropertyDescriptor(r,t);return i.get?i.get.call(arguments.length<3?e:n):i.value}},N.apply(this,arguments)}function V(e){return V=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},V(e)}function B(e,t){return B=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},B(e,t)}o.Z.registerComponent("PictureInPictureToggle",I);var A=o.Z.getComponent("PlayToggle"),F=function(e){function t(e,n){var r;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(r=L(this,t,[e,n])).pictureInPictureEnabled=!1,r.options=n,r.bindFunctions(),r}var n,r;return 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&&B(e,t)}(t,e),n=t,(r=[{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 e=this;if(this.player.options_.fluid&&!this.pictureInPictureEnabled){var t=this.getToggleParentComponent();if(t){this.pictureInPictureEnabled=!0;var n=t.children().findIndex((function(e){var t;return"fullscreentoggle"===(null===(t=e.name())||void 0===t?void 0:t.toLowerCase())}));-1===n&&(n=t.children().length-1),t.addChild("pictureInPictureToggle",{},n);var r=t.getChild("pictureInPictureToggle");null==r||r.enable(),this.player.on("playerresize",this.onPlayerResize),this.player.on("dispose",(function(){var t;null===(t=e.player)||void 0===t||t.off("playerresize",e.onPlayerResize)}))}}}},{key:"disablePictureInPicture",value:function(){if(this.pictureInPictureEnabled){this.pictureInPictureEnabled=!1;var e=this.getToggleParentComponent(),t=null==e?void 0:e.getChild("pictureInPictureToggle");t&&e.removeChild(t),this.player.off("playerresize",this.onPlayerResize)}}},{key:"togglePictureInPicture",value:function(e){if(e!==this.player.isInPictureInPicture()){var t=e?"enterpictureinpicture":"leavepictureinpicture";this.player.isInPictureInPicture(e),this.player.trigger(t),e?this.addPipStyles():this.removePipStyles()}}},{key:"onPlayerResize",value:function(){if(!this.player.isInPictureInPicture()){var e=this.player.el().getBoundingClientRect();0!==e.width&&(e.width<800?this.disablePictureInPicture():this.enablePictureInPicture())}}},{key:"addPipStyles",value:function(){this.player.addClass("cv-picture-in-picture"),this.playToggle=new A(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 e;this.pictureInPictureEnabled&&(this.togglePictureInPicture(!0),"function"==typeof(null===(e=this.options)||void 0===e?void 0:e.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,N(V(t.prototype),"dispose",this).call(this)}}])&&R(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),t}(o.Z.getPlugin("plugin"));o.Z.registerPlugin("pictureInPicture",F);var U=n(23035),Z=n(42892),z=n(73758);function G(e){return G="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},G(e)}function q(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,H(r.key),r)}}function H(e){var t=function(e,t){if("object"!=G(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=G(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==G(t)?t:String(t)}function Y(e,t,n){return t=X(t),function(e,t){if(t&&("object"===G(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return $(e)}(e,W()?Reflect.construct(t,n||[],X(e).constructor):t.apply(e,n))}function W(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(W=function(){return!!e})()}function $(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Q(){return Q="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=X(e)););return e}(e,t);if(r){var i=Object.getOwnPropertyDescriptor(r,t);return i.get?i.get.call(arguments.length<3?e:n):i.value}},Q.apply(this,arguments)}function X(e){return X=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},X(e)}function J(e,t){return J=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},J(e,t)}var K=function(e){function t(e,n){var r;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(r=Y(this,t,[e,n])).hasBuffered=!1,r.hasPlayed=!1,r.eventsService=z.n,r.pointOfInterest=n.pointOfInterest,r.onMouseOver=r.onMouseOver.bind($(r)),r.onMouseLeave=r.onMouseLeave.bind($(r)),r.onGlancePointOfInterestMouseEnter=r.onGlancePointOfInterestMouseEnter.bind($(r)),r.onGlancePointOfInterestMouseLeave=r.onGlancePointOfInterestMouseLeave.bind($(r)),r.initialize(),r}var n,r;return 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&&J(e,t)}(t,e),n=t,(r=[{key:"initialize",value:function(){this.setPosition(),this.bindListeners()}},{key:"buildCSSClass",value:function(){return"cv-point-of-interest-indicator ".concat(Q(X(t.prototype),"buildCSSClass",this).call(this))}},{key:"createEl",value:function(e,n,r){return Q(X(t.prototype),"createEl",this).call(this,e,Object.assign(Object.assign({},n),{className:this.buildCSSClass()}),r)}},{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 e=this.player().duration();this.el_.style.left=this.getPointOfInterestTime()/e*100+"%"}},{key:"updateBuffered",value:function(e){var t=this.getPointOfInterestTime()<=e;if(t!==this.hasBuffered){this.hasBuffered=t;var n="cv-point-of-interest-indicator-buffered";this.hasBuffered?this.addClass(n):this.removeClass(n)}}},{key:"updatePlaybackProgress",value:function(e){var t=this.getPointOfInterestTime()<=e;if(t!==this.hasPlayed){this.hasPlayed=t;var n="cv-point-of-interest-indicator-played";t?this.addClass(n):this.removeClass(n)}}},{key:"toggleVisibility",value:function(e){var t="cv-point-of-interest-indicator-hidden";e?this.removeClass(t):this.addClass(t)}},{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(e){e.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 e;null===(e=this.getTimeTooltip())||void 0===e||e.setCustomChapterText(this.pointOfInterest.description)}},{key:"clearTimeTooltipText",value:function(){var e;null===(e=this.getTimeTooltip())||void 0===e||e.setCustomChapterText()}},{key:"setTimeTooltipTime",value:function(){var e=this.getTimeTooltip();null==e||e.updateTime(this.getPointOfInterestTime())}},{key:"positionMouseTimeDisplay",value:function(){var e,t,n=null===(e=this.getSeekBar())||void 0===e?void 0:e.el();if(n){var r=o.Z.dom.findPosition(n),i=this.getPointOfInterestTime()/this.player().duration();null===(t=this.getMouseTimeDisplay())||void 0===t||t.update(r,i)}}},{key:"showMouseTimeDisplay",value:function(){var e;null===(e=this.getMouseTimeDisplay())||void 0===e||e.forceShow()}},{key:"hideMouseTimeDisplay",value:function(){var e;null===(e=this.getMouseTimeDisplay())||void 0===e||e.removeForceShow()}},{key:"getSeekBar",value:function(){var e;return null===(e=this.player().controlBar.getChild("ProgressControl"))||void 0===e?void 0:e.getChild("SeekBar")}},{key:"getMouseTimeDisplay",value:function(){var e;return null===(e=this.getSeekBar())||void 0===e?void 0:e.getChild("MouseTimeDisplay")}},{key:"getTimeTooltip",value:function(){var e;return null===(e=this.getMouseTimeDisplay())||void 0===e?void 0:e.getChild("TimeTooltip")}}])&&q(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),t}(o.Z.getComponent("Component"));function ee(e){return ee="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},ee(e)}function te(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,ne(r.key),r)}}function ne(e){var t=function(e,t){if("object"!=ee(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=ee(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==ee(t)?t:String(t)}function re(e,t,n){return t=ae(t),function(e,t){if(t&&("object"===ee(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)}(e,ie()?Reflect.construct(t,n||[],ae(e).constructor):t.apply(e,n))}function ie(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(ie=function(){return!!e})()}function oe(){return oe="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=ae(e)););return e}(e,t);if(r){var i=Object.getOwnPropertyDescriptor(r,t);return i.get?i.get.call(arguments.length<3?e:n):i.value}},oe.apply(this,arguments)}function ae(e){return ae=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},ae(e)}function se(e,t){return se=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},se(e,t)}var ue=function(e){function t(e,n){var r;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(r=re(this,t,[e,n])).pointsOfInterestVisible=n.pointsOfInterestVisible,r.toggle(r.pointsOfInterestVisible),r}var n,r;return 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&&se(e,t)}(t,e),n=t,(r=[{key:"handleToggle",value:function(){this.toggle(!this.pointsOfInterestVisible)}},{key:"toggle",value:function(e){e?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(e){e.stopImmediatePropagation()}},{key:"createEl",value:function(e,n,r){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 i=oe(ae(t.prototype),"createEl",this).call(this,e,{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>'},r);return i.children[1].appendChild(this.toggleEl),i}}])&&te(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),t}(o.Z.getComponent("MenuItem"));function ce(e){return ce="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},ce(e)}function le(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,fe(r.key),r)}}function fe(e){var t=function(e,t){if("object"!=ce(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=ce(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==ce(t)?t:String(t)}function pe(e,t,n){return t=ye(t),function(e,t){if(t&&("object"===ce(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return de(e)}(e,he()?Reflect.construct(t,n||[],ye(e).constructor):t.apply(e,n))}function he(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(he=function(){return!!e})()}function ye(e){return ye=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},ye(e)}function de(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function ve(e,t){return ve=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},ve(e,t)}o.Z.registerComponent("PointsOfInterestMenuItem",ue);var be=o.Z.getPlugin("plugin"),ge="cvplayer-points-of-interest",me=function(e){function t(e,n){var r;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(r=pe(this,t,[e])).pointOfInterestIndicators=[],r.enabled=!0,r.pointsOfInterest=null==n?void 0:n.pointsOfInterest,r.initialize=r.initialize.bind(de(r)),r.updateBuffered=r.updateBuffered.bind(de(r)),r.updatePlaybackProgress=r.updatePlaybackProgress.bind(de(r)),r.player.one("loadedmetadata",(function(){return r.player.ready(r.initialize)})),r}var n,r;return 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&&ve(e,t)}(t,e),n=t,(r=[{key:"initialize",value:function(){this.pointsOfInterest&&(Z.S.hasLocalStorage()&&"false"===Z.S.get(ge)&&(this.enabled=!1),this.setupTrack(),this.createPointOfInterestIndicators(),this.addMenuItem(),this.bindListeners())}},{key:"bindListeners",value:function(){var e=this;this.player.on("progress",this.updateBuffered),this.player.on("timeupdate",this.updatePlaybackProgress),this.player.on("dispose",(function(){var t,n;null===(t=e.player)||void 0===t||t.off("progress",e.updateBuffered),null===(n=e.player)||void 0===n||n.off("timeupdate",e.updatePlaybackProgress)}))}},{key:"togglePointsOfInterest",value:function(e){Z.S.set(ge,e.toString()),this.pointOfInterestIndicators.forEach((function(t){return t.toggleVisibility(e)}))}},{key:"setupTrack",value:function(){var e=this.player.addTextTrack("metadata","pointsofinterest");this.pointsOfInterest.forEach((function(t){e.addCue({startTime:t.startTime,endTime:t.endTime,text:t.description})})),e.trigger({type:"loadeddata",target:e})}},{key:"createPointOfInterestIndicators",value:function(){var e,t=this,n=null===(e=this.player.controlBar.getChild("ProgressControl"))||void 0===e?void 0:e.getChild("SeekBar");this.pointsOfInterest.forEach((function(e){var r=new K(t.player,{pointOfInterest:e});t.pointOfInterestIndicators.push(r),n.addChild(r)}))}},{key:"addMenuItem",value:function(){var e;(null===(e=this.player.getChild("collapserator"))||void 0===e?void 0:e.getChild("cogButton")).addItem({index:0,ctor:ue,name:"PointsOfInterestMenuItem",options:{pointsOfInterestVisible:this.enabled}})}},{key:"updateBuffered",value:function(){var e=this;this.pointOfInterestIndicators.forEach((function(t){return t.updateBuffered((0,U.b)(e.player))}))}},{key:"updatePlaybackProgress",value:function(){var e=this;this.pointOfInterestIndicators.forEach((function(t){return t.updatePlaybackProgress(e.player.currentTime())}))}}])&&le(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),t}(be);function we(e){return we="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},we(e)}function Oe(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,Pe(r.key),r)}}function Pe(e){var t=function(e,t){if("object"!=we(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=we(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==we(t)?t:String(t)}function Se(e,t,n){return t=Ce(t),function(e,t){if(t&&("object"===we(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)}(e,ke()?Reflect.construct(t,n||[],Ce(e).constructor):t.apply(e,n))}function ke(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(ke=function(){return!!e})()}function je(){return je="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=Ce(e)););return e}(e,t);if(r){var i=Object.getOwnPropertyDescriptor(r,t);return i.get?i.get.call(arguments.length<3?e:n):i.value}},je.apply(this,arguments)}function Ce(e){return Ce=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Ce(e)}function Te(e,t){return Te=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Te(e,t)}o.Z.registerPlugin("pointsOfInterestPlugin",me),n(93262);var Ee=function(e){function t(e,n){var r;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(r=Se(this,t,[e,n])).initialize(),r}var n,r;return 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&&Te(e,t)}(t,e),n=t,(r=[{key:"initialize",value:function(){this.setPosition()}},{key:"buildCSSClass",value:function(){return"cv-range-indicator ".concat(je(Ce(t.prototype),"buildCSSClass",this).call(this))}},{key:"createEl",value:function(e,n,r){return je(Ce(t.prototype),"createEl",this).call(this,e,Object.assign(Object.assign({},n),{className:this.buildCSSClass()}),r)}},{key:"setPosition",value:function(){var e=this.player().duration();this.el_.style.left=this.options_.time/e*100+"%"}}])&&Oe(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),t}(o.Z.getComponent("Component"));function _e(e){return _e="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(e)}function Ie(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,xe(r.key),r)}}function xe(e){var t=function(e,t){if("object"!=_e(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=_e(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==_e(t)?t:String(t)}function Re(e,t,n){return t=De(t),function(e,t){if(t&&("object"===_e(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)}(e,Me()?Reflect.construct(t,n||[],De(e).constructor):t.apply(e,n))}function Me(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Me=function(){return!!e})()}function Le(){return Le="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=De(e)););return e}(e,t);if(r){var i=Object.getOwnPropertyDescriptor(r,t);return i.get?i.get.call(arguments.length<3?e:n):i.value}},Le.apply(this,arguments)}function De(e){return De=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},De(e)}function Ne(e,t){return Ne=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Ne(e,t)}var Ve=function(e){function t(e,n){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),Re(this,t,[e,n])}var n,r;return 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&&Ne(e,t)}(t,e),n=t,(r=[{key:"buildCSSClass",value:function(){return"cv-replay-view-button ".concat(Le(De(t.prototype),"buildCSSClass",this).call(this))}},{key:"createEl",value:function(e,n,r){return Le(De(t.prototype),"createEl",this).call(this,e,Object.assign(Object.assign({},n),{innerHTML:'<span class="'.concat(this.options_.iconClassName,'"></span><span>').concat(this.options_.label,"</span>"),className:this.buildCSSClass()}),r)}},{key:"handleClick",value:function(){this.options_.onPress()}}])&&Ie(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),t}(o.Z.getComponent("ClickableComponent"));function Be(e){return Be="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},Be(e)}function Ae(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,Fe(r.key),r)}}function Fe(e){var t=function(e,t){if("object"!=Be(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=Be(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Be(t)?t:String(t)}function Ue(e,t,n){return t=Ge(t),function(e,t){if(t&&("object"===Be(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)}(e,Ze()?Reflect.construct(t,n||[],Ge(e).constructor):t.apply(e,n))}function Ze(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Ze=function(){return!!e})()}function ze(){return ze="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=Ge(e)););return e}(e,t);if(r){var i=Object.getOwnPropertyDescriptor(r,t);return i.get?i.get.call(arguments.length<3?e:n):i.value}},ze.apply(this,arguments)}function Ge(e){return Ge=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Ge(e)}function qe(e,t){return qe=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},qe(e,t)}var He=function(e){function t(e,n){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),Ue(this,t,[e,n])}var n,r;return 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&&qe(e,t)}(t,e),n=t,(r=[{key:"buildCSSClass",value:function(){return"cv-replay-view ".concat(ze(Ge(t.prototype),"buildCSSClass",this).call(this))}},{key:"createEl",value:function(e,n,r){var i=ze(Ge(t.prototype),"createEl",this).call(this,e,Object.assign(Object.assign({},n),{className:this.buildCSSClass()}),r),a=o.Z.dom.createEl("h5",{innerHTML:this.localize("This clip has finished"),className:"cv-replay-heading"}),s=o.Z.dom.createEl("div",{className:"cv-button-container"}),u=new Ve(this.player_,{label:this.localize("Replay clip"),iconClassName:"cv-replay-icon",onPress:this.options_.onReplayPress}),c=new Ve(this.player_,{label:this.localize("Continue watching"),iconClassName:"cv-continue-icon",onPress:this.options_.onContinuePress});return i.appendChild(a),i.appendChild(s),s.appendChild(u.el()),s.appendChild(c.el()),i}}])&&Ae(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),t}(o.Z.getComponent("Component"));function Ye(e){return Ye="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},Ye(e)}function We(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,$e(r.key),r)}}function $e(e){var t=function(e,t){if("object"!=Ye(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=Ye(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Ye(t)?t:String(t)}function Qe(e,t,n){return t=Ke(t),function(e,t){if(t&&("object"===Ye(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)}(e,Xe()?Reflect.construct(t,n||[],Ke(e).constructor):t.apply(e,n))}function Xe(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Xe=function(){return!!e})()}function Je(){return Je="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=Ke(e)););return e}(e,t);if(r){var i=Object.getOwnPropertyDescriptor(r,t);return i.get?i.get.call(arguments.length<3?e:n):i.value}},Je.apply(this,arguments)}function Ke(e){return Ke=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Ke(e)}function et(e,t){return et=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},et(e,t)}var tt=function(e){function t(e,n){var r;if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(r=Qe(this,t,[e,n])).startTime=parseFloat(n.startTime.toPrecision(4)),r.endTime=parseFloat(n.endTime.toPrecision(4)),r.dismissed=!1,r.startTime>r.endTime)throw Error("Range start cannot be greater than range end");return r.bindFunctions(),r.initialize(),r}var n,r;return 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&&et(e,t)}(t,e),n=t,(r=[{key:"bindFunctions",value:function(){this.onReady=this.onReady.bind(this),this.onTimeUpdateOrSeeked=this.onTimeUpdateOrSeeked.bind(this),this.onReplayPress=this.onReplayPress.bind(this),this.onContinuePress=this.onContinuePress.bind(this)}},{key:"initialize",value:function(){var e=this;this.player.one("loadedmetadata",(function(){return e.player.ready(e.onReady)})),this.player.on("timeupdate",this.onTimeUpdateOrSeeked),this.player.on("seeked",this.onTimeUpdateOrSeeked)}},{key:"onReady",value:function(){this.addCssClasses(),this.showRangeIndicators()}},{key:"onTimeUpdateOrSeeked",value:function(){if(!this.dismissed){var e=this.player.currentTime();if(!(e<this.startTime))return e>this.endTime?(this.showReplayView(),this.disablePlayToggle(),this.player.pause(),void this.player.currentTime(this.endTime)):void 0;this.player.currentTime(this.startTime)}}},{key:"onReplayPress",value:function(){this.player.currentTime(this.startTime),this.player.play(),this.hideReplayView(),this.enablePlayToggle()}},{key:"onContinuePress",value:function(){this.dismissed=!0,this.player.play(),this.hideRangeIndicators(),this.hideReplayView(),this.enablePlayToggle(),this.removeCssClasses()}},{key:"showRangeIndicators",value:function(){var e,t=null===(e=this.player.controlBar.getChild("ProgressControl"))||void 0===e?void 0:e.getChild("SeekBar");this.startTimeIndicator||(this.startTimeIndicator=new Ee(this.player,{time:this.startTime}),null==t||t.addChild(this.startTimeIndicator)),this.endTimeIndicator||(this.endTimeIndicator=new Ee(this.player,{time:this.endTime}),null==t||t.addChild(this.endTimeIndicator))}},{key:"hideRangeIndicators",value:function(){var e,t;null===(e=this.startTimeIndicator)||void 0===e||e.hide(),null===(t=this.endTimeIndicator)||void 0===t||t.hide()}},{key:"showReplayView",value:function(){this.replayView||(this.replayView=new He(this.player,{onContinuePress:this.onContinuePress,onReplayPress:this.onReplayPress}),this.player.addChild(this.replayView)),this.replayView.show()}},{key:"hideReplayView",value:function(){var e;null===(e=this.replayView)||void 0===e||e.hide()}},{key:"getPlayToggle",value:function(){var e=this.player.getChild("collapserator");return null==e?void 0:e.getChild("PlayToggle")}},{key:"enablePlayToggle",value:function(){var e=this.getPlayToggle();e&&e.enable()}},{key:"disablePlayToggle",value:function(){var e=this.getPlayToggle();e&&e.disable()}},{key:"addCssClasses",value:function(){this.player.addClass("cv-range-indicator-plugin")}},{key:"removeCssClasses",value:function(){this.player.removeClass("cv-range-indicator-plugin")}},{key:"dispose",value:function(){var e,n,r;this.removeCssClasses(),this.player.off("timeupdate",this.onTimeUpdateOrSeeked),this.player.off("seeked",this.onTimeUpdateOrSeeked),null===(e=this.startTimeIndicator)||void 0===e||e.dispose(),null===(n=this.endTimeIndicator)||void 0===n||n.dispose(),null===(r=this.replayView)||void 0===r||r.dispose(),Je(Ke(t.prototype),"dispose",this).call(this)}}])&&We(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),t}(o.Z.getPlugin("plugin"));o.Z.registerPlugin("rangeIndicatorPlugin",tt);var nt=n(65858),rt=n(86086),it=n(12399),ot=n(6156);function at(e){return at="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},at(e)}function st(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,ut(r.key),r)}}function ut(e){var t=function(e,t){if("object"!=at(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=at(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==at(t)?t:String(t)}var ct=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.bindFunctions()}var t,n;return t=e,(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(e){return this.task=e,this}},{key:"every",value:function(e){return this.intervalInMilliseconds=e,this}},{key:"trigger",value:function(){var e;return null===(e=this.task)||void 0===e||e.call(this,this),this}},{key:"start",value:function(){var e=this;return this.intervalId||(this.intervalId=setInterval((function(){return e.trigger()}),this.intervalInMilliseconds)),this}},{key:"stop",value:function(){return this.intervalId&&(clearInterval(this.intervalId),this.intervalId=void 0),this}}])&&st(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),e}();function lt(e){return lt="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},lt(e)}function ft(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,pt(r.key),r)}}function pt(e){var t=function(e,t){if("object"!=lt(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=lt(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==lt(t)?t:String(t)}var ht={reconnectIntervalInMilliseconds:3e3,heartbeatEnabled:!1,heartbeatIntervalInMillseconds:1e4,heartbeatMessage:""},yt=function(){function e(t){var n=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:ht;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.bindFunctions(),this.url=t,this.options=Object.assign(Object.assign({},ht),r),this.webSocket=this.connect(),this.heartbeat=(new ct).schedule((function(){return n.send(n.options.heartbeatMessage)})).every(this.options.heartbeatIntervalInMillseconds)}var t,n;return t=e,(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(e){var t;null===(t=this.onOpen)||void 0===t||t.call(this,e),this.options.heartbeatEnabled&&this.heartbeat.start()}},{key:"handleMessage",value:function(e){var t;null===(t=this.onMessage)||void 0===t||t.call(this,e)}},{key:"handleClose",value:function(e){var t,n=this;null===(t=this.onClose)||void 0===t||t.call(this,e),this.cleanup(),setTimeout((function(){n.webSocket=n.connect()}),this.options.reconnectIntervalInMilliseconds)}},{key:"handleError",value:function(e){var t;null===(t=this.onError)||void 0===t||t.call(this,e),this.handleClose()}},{key:"connect",value:function(){var e=new WebSocket(this.url);return e.addEventListener("open",this.handleOpen),e.addEventListener("message",this.handleMessage),e.addEventListener("close",this.handleClose),e.addEventListener("error",this.handleError),e}},{key:"send",value:function(e){this.webSocket.send(e)}},{key:"dipose",value:function(){this.cleanup(),this.webSocket.close()}}])&&ft(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),e}(),dt=n(95569),vt=function(){var e,t;return null!==(t=null===(e=window.crypto)||void 0===e?void 0:e.randomUUID())&&void 0!==t?t:Math.random().toString()},bt=n(35884);function gt(e){return gt="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},gt(e)}function mt(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,wt(r.key),r)}}function wt(e){var t=function(e,t){if("object"!=gt(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=gt(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==gt(t)?t:String(t)}var Ot,Pt=function(){function e(t,n){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),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=t,this.device=n,this.ready=!1,this.playbackFinished=!1,this.debounced=bt.l.withDebouncedSetters(this,2e3),bt.l.withTimestampedSetters(this)}var t,n;return t=e,(n=[{key:"position",get:function(){return this._position+this.getTimerDurationInSeconds()},set:function(e){this._position=e,this.restartTimer()}},{key:"playing",get:function(){return this._playing},set:function(e){this._playing=e,e?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}}])&&mt(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),e}();function St(e){return St="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},St(e)}function kt(){kt=function(){return t};var e,t={},n=Object.prototype,r=n.hasOwnProperty,i=Object.defineProperty||function(e,t,n){e[t]=n.value},o="function"==typeof Symbol?Symbol:{},a=o.iterator||"@@iterator",s=o.asyncIterator||"@@asyncIterator",u=o.toStringTag||"@@toStringTag";function c(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{c({},"")}catch(e){c=function(e,t,n){return e[t]=n}}function l(e,t,n,r){var o=t&&t.prototype instanceof b?t:b,a=Object.create(o.prototype),s=new I(r||[]);return i(a,"_invoke",{value:C(e,n,s)}),a}function f(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}t.wrap=l;var p="suspendedStart",h="suspendedYield",y="executing",d="completed",v={};function b(){}function g(){}function m(){}var w={};c(w,a,(function(){return this}));var O=Object.getPrototypeOf,P=O&&O(O(x([])));P&&P!==n&&r.call(P,a)&&(w=P);var S=m.prototype=b.prototype=Object.create(w);function k(e){["next","throw","return"].forEach((function(t){c(e,t,(function(e){return this._invoke(t,e)}))}))}function j(e,t){function n(i,o,a,s){var u=f(e[i],e,o);if("throw"!==u.type){var c=u.arg,l=c.value;return l&&"object"==St(l)&&r.call(l,"__await")?t.resolve(l.__await).then((function(e){n("next",e,a,s)}),(function(e){n("throw",e,a,s)})):t.resolve(l).then((function(e){c.value=e,a(c)}),(function(e){return n("throw",e,a,s)}))}s(u.arg)}var o;i(this,"_invoke",{value:function(e,r){function i(){return new t((function(t,i){n(e,r,t,i)}))}return o=o?o.then(i,i):i()}})}function C(t,n,r){var i=p;return function(o,a){if(i===y)throw new Error("Generator is already running");if(i===d){if("throw"===o)throw a;return{value:e,done:!0}}for(r.method=o,r.arg=a;;){var s=r.delegate;if(s){var u=T(s,r);if(u){if(u===v)continue;return u}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(i===p)throw i=d,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);i=y;var c=f(t,n,r);if("normal"===c.type){if(i=r.done?d:h,c.arg===v)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(i=d,r.method="throw",r.arg=c.arg)}}}function T(t,n){var r=n.method,i=t.iterator[r];if(i===e)return n.delegate=null,"throw"===r&&t.iterator.return&&(n.method="return",n.arg=e,T(t,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,t.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[t.resultName]=a.value,n.next=t.nextLoc,"return"!==n.method&&(n.method="next",n.arg=e),n.delegate=null,v):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,v)}function E(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function _(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function I(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(E,this),this.reset(!0)}function x(t){if(t||""===t){var n=t[a];if(n)return n.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var i=-1,o=function n(){for(;++i<t.length;)if(r.call(t,i))return n.value=t[i],n.done=!1,n;return n.value=e,n.done=!0,n};return o.next=o}}throw new TypeError(St(t)+" is not iterable")}return g.prototype=m,i(S,"constructor",{value:m,configurable:!0}),i(m,"constructor",{value:g,configurable:!0}),g.displayName=c(m,u,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===g||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,m):(e.__proto__=m,c(e,u,"GeneratorFunction")),e.prototype=Object.create(S),e},t.awrap=function(e){return{__await:e}},k(j.prototype),c(j.prototype,s,(function(){return this})),t.AsyncIterator=j,t.async=function(e,n,r,i,o){void 0===o&&(o=Promise);var a=new j(l(e,n,r,i),o);return t.isGeneratorFunction(n)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},k(S),c(S,u,"Generator"),c(S,a,(function(){return this})),c(S,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),n=[];for(var r in t)n.push(r);return n.reverse(),function e(){for(;n.length;){var r=n.pop();if(r in t)return e.value=r,e.done=!1,e}return e.done=!0,e}},t.values=x,I.prototype={constructor:I,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(_),!t)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var n=this;function i(r,i){return s.type="throw",s.arg=t,n.next=r,i&&(n.method="next",n.arg=e),!!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 u=r.call(a,"catchLoc"),c=r.call(a,"finallyLoc");if(u&&c){if(this.prev<a.catchLoc)return i(a.catchLoc,!0);if(this.prev<a.finallyLoc)return i(a.finallyLoc)}else if(u){if(this.prev<a.catchLoc)return i(a.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return i(a.finallyLoc)}}}},abrupt:function(e,t){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"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=e,a.arg=t,o?(this.method="next",this.next=o.finallyLoc,v):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),v},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),_(n),v}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var i=r.arg;_(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(t,n,r){return this.delegate={iterator:x(t),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=e),v}},t}function jt(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,Ct(r.key),r)}}function Ct(e){var t=function(e,t){if("object"!=St(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=St(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==St(t)?t:String(t)}function Tt(e,t,n){return t=It(t),function(e,t){if(t&&("object"===St(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)}(e,Et()?Reflect.construct(t,n||[],It(e).constructor):t.apply(e,n))}function Et(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Et=function(){return!!e})()}function _t(){return _t="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=It(e)););return e}(e,t);if(r){var i=Object.getOwnPropertyDescriptor(r,t);return i.get?i.get.call(arguments.length<3?e:n):i.value}},_t.apply(this,arguments)}function It(e){return It=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},It(e)}function xt(e,t){return xt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},xt(e,t)}!function(e){e.Update="update",e.Volume="volume",e.Playing="playing",e.Paused="paused",e.NewChapter="new_chapter",e.Stopped="stopped",e.Ready="ready",e.Mute="mute",e.Finished="finished",e.Subtitles="subtitles"}(Ot||(Ot={}));var Rt=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{u(r.next(e))}catch(e){o(e)}}function s(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}u((r=r.apply(e,t||[])).next())}))},Mt=function(e){function t(e,n){var r;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(r=Tt(this,t)).client=e,r.localState=new Pt(n.title,n.device),r.bindFunctions(),r.initialize(),r}var n,r;return 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&&xt(e,t)}(t,e),n=t,(r=[{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 e=this;this.client.on("dispose",this.dispose),this.client.on("connected",this.handleClientConnected),this.client.on("message",this.handleDisconnectMessage).filter((function(t){return t.source===e.getDevice().id&&"disconnect"===t.message.type})),this.client.on("message",this.handleAllVideoMessages).filter((function(t){return t.source===e.getDevice().id&&"video_event"===t.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(e){return console.error(e)})),_t(It(t.prototype),"dispose",this).call(this)}},{key:"handleClientConnected",value:function(){return Rt(this,void 0,void 0,kt().mark((function e(){return kt().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,this.client.joinRoom(this.getDevice().id);case 3:e.next=8;break;case 5:e.prev=5,e.t0=e.catch(0),this.trigger("error",e.t0);case 8:case"end":return e.stop()}}),e,this,[[0,5]])})))}},{key:"handleDisconnectMessage",value:function(){this.dispose()}},{key:"handleAllVideoMessages",value:function(e){var t=this.localState.debounced,n=e.message.payload.params||{};switch(e.message.payload.event){case Ot.Update:this.handleUpdateMessage(t,n);break;case Ot.NewChapter:this.handleNewChapterMessage(t,n);break;case Ot.Volume:this.handleVolumeMessage(t,n);break;case Ot.Playing:this.handlePlayingMessage(t);break;case Ot.Paused:this.handlePausedMessage(t);break;case Ot.Finished:this.handleFinishedMessage(t);break;case Ot.Stopped:this.handleStoppedMessage()}}},{key:"handleUpdateMessage",value:function(e,t){e.duration!==t.duration&&(e.duration=t.duration,this.trigger("durationchange",ot.j.void)),e.position!==t.position&&(e.position=t.position,this.trigger("positionchange",ot.j.void)),e.subtitles!==t.subtitles&&(e.subtitles=t.subtitles,this.trigger("subtitleschange",ot.j.void))}},{key:"handleVolumeMessage",value:function(e,t){e.volume!==t.level&&(e.volume=t.level,e.mute=0===t.level,this.trigger("volumechange",ot.j.void))}},{key:"handlePlayingMessage",value:function(e){!0!==e.playing&&(e.playing=!0,e.playbackFinished=!1,this.trigger("playingchange",ot.j.void))}},{key:"handlePausedMessage",value:function(e){!1!==e.playing&&(e.playing=!1,this.trigger("playingchange",ot.j.void))}},{key:"handleFinishedMessage",value:function(e){!0!==e.playbackFinished&&(e.playing=!1,e.playbackFinished=!0,this.trigger("playingchange",ot.j.void))}},{key:"handleNewChapterMessage",value:function(e,t){var n,r=(null!==(n=t.queue)&&void 0!==n?n:[]).find((function(t){return t.url===e.videoSource}));if(!r)return console.info("The device is no longer playing the source we loaded - disposing the session"),void this.dispose();e.subtitleSource!==r.suburl&&(e.subtitleSource=r.suburl,this.trigger("subtitleschange",ot.j.void))}},{key:"handleStoppedMessage",value:function(){this.dispose()}},{key:"loadSource",value:function(e,t){return Rt(this,void 0,void 0,kt().mark((function n(){var r,i;return kt().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(this.localState.videoSource!==e||this.localState.subtitleSource!==t){n.next=2;break}return n.abrupt("return");case 2:return n.prev=2,r=this.getDevice().id,i=this.getPosition(),this.localState.videoSource=e,this.localState.subtitleSource=t,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:e,subtitleSource:t});case 12:this.localState.ready=!0,this.trigger("sourceloaded",ot.j.void),i>0&&this.seek(i),t&&this.setSubtitles(t),n.next=22;break;case 18:n.prev=18,n.t0=n.catch(2),console.error(n.t0),this.trigger("error",new Error("Could not load video on Vivi device"));case 22:case"end":return n.stop()}}),n,this,[[2,18]])})))}},{key:"play",value:function(){this.localState.ready&&!0!==this.localState.playing&&(this.localState.playing=!0,this.client.play(this.getDevice().id),this.trigger("playingchange",ot.j.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",ot.j.void))}},{key:"seek",value:function(e){this.localState.ready&&this.localState.position!==e&&(this.localState.position=e,this.client.seek(this.getDevice().id,e),this.trigger("positionchange",ot.j.void))}},{key:"setVolume",value:function(e){this.localState.ready&&this.localState.volume!==e&&(this.localState.volume=e,this.client.setVolume(this.getDevice().id,e),this.trigger("volumechange",ot.j.void))}},{key:"setMuted",value:function(e){this.localState.ready&&this.localState.mute!==e&&(this.localState.mute=e,this.client.setMuted(this.getDevice().id,e),this.trigger("volumechange",ot.j.void))}},{key:"setSubtitles",value:function(e){return Rt(this,void 0,void 0,kt().mark((function t(){var n;return kt().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(this.localState.ready){t.next=2;break}return t.abrupt("return");case 2:if(!e){t.next=5;break}return t.next=5,this.loadSource(this.localState.videoSource,e);case 5:n=!!e,this.localState.subtitles!==n&&(this.localState.subtitles=n,this.client.setSubtitles(this.getDevice().id,n),this.trigger("subtitleschange",ot.j.void));case 7:case"end":return t.stop()}}),t,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}}])&&jt(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),t}(ot.N);function Lt(e){return Lt="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},Lt(e)}function Dt(){Dt=function(){return t};var e,t={},n=Object.prototype,r=n.hasOwnProperty,i=Object.defineProperty||function(e,t,n){e[t]=n.value},o="function"==typeof Symbol?Symbol:{},a=o.iterator||"@@iterator",s=o.asyncIterator||"@@asyncIterator",u=o.toStringTag||"@@toStringTag";function c(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{c({},"")}catch(e){c=function(e,t,n){return e[t]=n}}function l(e,t,n,r){var o=t&&t.prototype instanceof b?t:b,a=Object.create(o.prototype),s=new I(r||[]);return i(a,"_invoke",{value:C(e,n,s)}),a}function f(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}t.wrap=l;var p="suspendedStart",h="suspendedYield",y="executing",d="completed",v={};function b(){}function g(){}function m(){}var w={};c(w,a,(function(){return this}));var O=Object.getPrototypeOf,P=O&&O(O(x([])));P&&P!==n&&r.call(P,a)&&(w=P);var S=m.prototype=b.prototype=Object.create(w);function k(e){["next","throw","return"].forEach((function(t){c(e,t,(function(e){return this._invoke(t,e)}))}))}function j(e,t){function n(i,o,a,s){var u=f(e[i],e,o);if("throw"!==u.type){var c=u.arg,l=c.value;return l&&"object"==Lt(l)&&r.call(l,"__await")?t.resolve(l.__await).then((function(e){n("next",e,a,s)}),(function(e){n("throw",e,a,s)})):t.resolve(l).then((function(e){c.value=e,a(c)}),(function(e){return n("throw",e,a,s)}))}s(u.arg)}var o;i(this,"_invoke",{value:function(e,r){function i(){return new t((function(t,i){n(e,r,t,i)}))}return o=o?o.then(i,i):i()}})}function C(t,n,r){var i=p;return function(o,a){if(i===y)throw new Error("Generator is already running");if(i===d){if("throw"===o)throw a;return{value:e,done:!0}}for(r.method=o,r.arg=a;;){var s=r.delegate;if(s){var u=T(s,r);if(u){if(u===v)continue;return u}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(i===p)throw i=d,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);i=y;var c=f(t,n,r);if("normal"===c.type){if(i=r.done?d:h,c.arg===v)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(i=d,r.method="throw",r.arg=c.arg)}}}function T(t,n){var r=n.method,i=t.iterator[r];if(i===e)return n.delegate=null,"throw"===r&&t.iterator.return&&(n.method="return",n.arg=e,T(t,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,t.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[t.resultName]=a.value,n.next=t.nextLoc,"return"!==n.method&&(n.method="next",n.arg=e),n.delegate=null,v):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,v)}function E(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function _(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function I(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(E,this),this.reset(!0)}function x(t){if(t||""===t){var n=t[a];if(n)return n.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var i=-1,o=function n(){for(;++i<t.length;)if(r.call(t,i))return n.value=t[i],n.done=!1,n;return n.value=e,n.done=!0,n};return o.next=o}}throw new TypeError(Lt(t)+" is not iterable")}return g.prototype=m,i(S,"constructor",{value:m,configurable:!0}),i(m,"constructor",{value:g,configurable:!0}),g.displayName=c(m,u,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===g||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,m):(e.__proto__=m,c(e,u,"GeneratorFunction")),e.prototype=Object.create(S),e},t.awrap=function(e){return{__await:e}},k(j.prototype),c(j.prototype,s,(function(){return this})),t.AsyncIterator=j,t.async=function(e,n,r,i,o){void 0===o&&(o=Promise);var a=new j(l(e,n,r,i),o);return t.isGeneratorFunction(n)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},k(S),c(S,u,"Generator"),c(S,a,(function(){return this})),c(S,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),n=[];for(var r in t)n.push(r);return n.reverse(),function e(){for(;n.length;){var r=n.pop();if(r in t)return e.value=r,e.done=!1,e}return e.done=!0,e}},t.values=x,I.prototype={constructor:I,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(_),!t)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var n=this;function i(r,i){return s.type="throw",s.arg=t,n.next=r,i&&(n.method="next",n.arg=e),!!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 u=r.call(a,"catchLoc"),c=r.call(a,"finallyLoc");if(u&&c){if(this.prev<a.catchLoc)return i(a.catchLoc,!0);if(this.prev<a.finallyLoc)return i(a.finallyLoc)}else if(u){if(this.prev<a.catchLoc)return i(a.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return i(a.finallyLoc)}}}},abrupt:function(e,t){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"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=e,a.arg=t,o?(this.method="next",this.next=o.finallyLoc,v):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),v},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),_(n),v}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var i=r.arg;_(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(t,n,r){return this.delegate={iterator:x(t),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=e),v}},t}function Nt(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,Vt(r.key),r)}}function Vt(e){var t=function(e,t){if("object"!=Lt(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=Lt(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Lt(t)?t:String(t)}function Bt(e,t,n){return t=Ut(t),function(e,t){if(t&&("object"===Lt(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)}(e,At()?Reflect.construct(t,n||[],Ut(e).constructor):t.apply(e,n))}function At(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(At=function(){return!!e})()}function Ft(){return Ft="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=Ut(e)););return e}(e,t);if(r){var i=Object.getOwnPropertyDescriptor(r,t);return i.get?i.get.call(arguments.length<3?e:n):i.value}},Ft.apply(this,arguments)}function Ut(e){return Ut=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Ut(e)}function Zt(e,t){return Zt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Zt(e,t)}var zt=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{u(r.next(e))}catch(e){o(e)}}function s(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}u((r=r.apply(e,t||[])).next())}))},Gt=1e4,qt=function(e){function t(e){var n;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(n=Bt(this,t)).options=e,n.accessToken="",n.devices=[],n.devicesFingerprint="",n.deviceDiscovery=new ct,n.bindFunctions(),n.initialize(),n}var n,r,i;return 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&&Zt(e,t)}(t,e),n=t,i=[{key:"createAckId",value:function(){return vt()}},{key:"calculateFingerprint",value:function(e){return e.map((function(e){return e.id})).sort().join(",")}}],(r=[{key:"bindFunctions",value:function(){this.initialize=this.initialize.bind(this),this.sendMessage=this.sendMessage.bind(this),this.sendMessageDebounced=(0,dt.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 e=this;this.webSocket=new yt(this.options.url.toString()),this.webSocket.onMessage=function(t){return e.trigger("message",JSON.parse(t.data))},this.webSocket.onOpen=function(){return zt(e,void 0,void 0,Dt().mark((function e(){return Dt().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,this.options.fetchAccessToken();case 3:return this.accessToken=e.sent,e.next=6,this.authenticateWithVivi();case 6:this.beginDeviceDiscovery(),this.trigger("connected",ot.j.void),e.next=14;break;case 10:e.prev=10,e.t0=e.catch(0),console.error(e.t0),this.trigger("error",new Error("Could not connect to Vivi"));case 14:case"end":return e.stop()}}),e,this,[[0,10]])})))}}},{key:"sendMessage",value:function(e){var t;null===(t=this.webSocket)||void 0===t||t.send(JSON.stringify(e))}},{key:"beginDeviceDiscovery",value:function(){var e=this;this.deviceDiscovery.every(1e4).schedule((function(){return zt(e,void 0,void 0,Dt().mark((function e(){var n,r;return Dt().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,this.getRoomList();case 3:if(n=e.sent,(r=t.calculateFingerprint(n))!==this.devicesFingerprint){e.next=7;break}return e.abrupt("return");case 7:this.devices=n.map((function(e){return{id:e.id,name:e.name,type:it.Y.Vivi,status:it.L.Available}})),this.devicesFingerprint=r,this.trigger("deviceschange",ot.j.void),e.next=15;break;case 12:e.prev=12,e.t0=e.catch(0),console.warn(e.t0);case 15:case"end":return e.stop()}}),e,this,[[0,12]])})))})).trigger().start()}},{key:"dispose",value:function(){var e;this.deviceDiscovery.stop(),null===(e=this.webSocket)||void 0===e||e.dipose(),Ft(Ut(t.prototype),"dispose",this).call(this)}},{key:"canCastToDevice",value:function(e){return e===it.Y.Vivi}},{key:"getDevices",value:function(){return this.devices}},{key:"startCastSession",value:function(e){return new Mt(this,e)}},{key:"authenticateWithVivi",value:function(){return zt(this,void 0,void 0,Dt().mark((function e(){return Dt().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.sendMessage({destination:"relay",message:{token:this.accessToken,type:"identify_video_api"}}),e.next=3,this.one("message",(function(e){return"video_api_identified"===e.message.type})).timeout(Gt).catch((function(){throw new Error("Failed to authenticate with Vivi")}));case 3:case"end":return e.stop()}}),e,this)})))}},{key:"getRoomList",value:function(){return zt(this,void 0,void 0,Dt().mark((function e(){var t;return Dt().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.sendMessage({destination:"relay",message:{type:"video_api_rooms"}}),e.next=3,this.one("message",(function(e){return"video_api_rooms"===e.message.type})).timeout(Gt).catch((function(){throw new Error("Failed to fetch rooms")}));case 3:return t=e.sent,e.abrupt("return",t.message.rooms||[]);case 5:case"end":return e.stop()}}),e,this)})))}},{key:"joinRoom",value:function(e){return zt(this,void 0,void 0,Dt().mark((function t(){return Dt().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this.sendMessage({destination:"relay",message:{destination_type:"box",new_destination:e,token:this.accessToken,type:"connect"}}),t.next=3,this.one("message",(function(t){return t.source===e&&"connect"===t.message.type||"error"===t.message.type&&"already_connected"===t.message.error_type||void 0})).timeout(Gt).catch((function(){throw new Error("Failed to join room")}));case 3:case"end":return t.stop()}}),t,this)})))}},{key:"query",value:function(e){return zt(this,void 0,void 0,Dt().mark((function n(){var r;return Dt().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return r=t.createAckId(),this.sendMessage({destination:e,message:{type:"message_with_ack",ack_id:r,name:"query"}}),n.next=4,this.one("message",(function(e){return e.message.ack_id===r})).timeout(Gt).catch((function(){throw new Error("Failed to fetch query")}));case 4:return n.abrupt("return",n.sent);case 5:case"end":return n.stop()}}),n,this)})))}},{key:"loadQueue",value:function(e){var n=e.roomId,r=e.title,i=e.videoSource,o=e.subtitleSource;return zt(this,void 0,void 0,Dt().mark((function e(){return Dt().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.sendMessage({destination:n,message:{type:"message_with_ack",ack_id:t.createAckId(),name:"queue_load",payload:{urls:[{title:r,url:i,suburl:o}]}}}),e.next=3,this.one("message",(function(e){var t;return e.source===n&&"ready"===(null===(t=e.message.payload)||void 0===t?void 0:t.event)})).timeout(Gt).catch((function(){throw new Error("Failed to load media")}));case 3:case"end":return e.stop()}}),e,this)})))}},{key:"play",value:function(e){return zt(this,void 0,void 0,Dt().mark((function t(){return Dt().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this.sendMessage({destination:e,message:{type:"message",name:"video_play",payload:{}}}),t.next=3,this.one("message",(function(t){var n;return t.source===e&&"playing"===(null===(n=t.message.payload)||void 0===n?void 0:n.event)})).timeout(Gt).catch((function(){throw new Error("Failed to play video")}));case 3:case"end":return t.stop()}}),t,this)})))}},{key:"pause",value:function(e){return zt(this,void 0,void 0,Dt().mark((function t(){return Dt().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this.sendMessage({destination:e,message:{type:"message",name:"video_pause"}}),t.next=3,this.one("message",(function(t){var n;return t.source===e&&"paused"===(null===(n=t.message.payload)||void 0===n?void 0:n.event)})).timeout(Gt).catch((function(){throw new Error("Failed to pause video")}));case 3:case"end":return t.stop()}}),t,this)})))}},{key:"stop",value:function(e){return zt(this,void 0,void 0,Dt().mark((function t(){return Dt().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this.sendMessage({destination:e,message:{type:"message",name:"video_stop"}}),t.next=3,this.one("message",(function(t){var n;return t.source===e&&"stopped"===(null===(n=t.message.payload)||void 0===n?void 0:n.event)})).timeout(Gt).catch((function(){throw new Error("Failed to stop video")}));case 3:case"end":return t.stop()}}),t,this)})))}},{key:"seek",value:function(e,t){return zt(this,void 0,void 0,Dt().mark((function n(){return Dt().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(!this.sendMessageDebounced({destination:e,message:{type:"message",name:"video_seek",payload:{position:t}}})){n.next=4;break}return n.next=4,this.one("message",(function(t){var n;return t.source===e&&"playing"===(null===(n=t.message.payload)||void 0===n?void 0:n.event)})).timeout(Gt).catch((function(){throw new Error("Failed to seek video")}));case 4:case"end":return n.stop()}}),n,this)})))}},{key:"setVolume",value:function(e,t){return zt(this,void 0,void 0,Dt().mark((function n(){return Dt().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(!this.sendMessageDebounced({destination:e,message:{type:"message",name:"set_volume",payload:{volume:t}}})){n.next=4;break}return n.next=4,this.one("message",(function(t){var n;return t.source===e&&"volume"===(null===(n=t.message.payload)||void 0===n?void 0:n.event)})).timeout(Gt).catch((function(){throw new Error("Failed to set volume")}));case 4:case"end":return n.stop()}}),n,this)})))}},{key:"setMuted",value:function(e,t){return zt(this,void 0,void 0,Dt().mark((function n(){return Dt().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return this.sendMessage({destination:e,message:{type:"message",name:"set_mute",payload:{mute:t}}}),n.next=3,this.one("message",(function(t){var n;return t.source===e&&"mute"===(null===(n=t.message.payload)||void 0===n?void 0:n.event)})).timeout(Gt).catch((function(){throw new Error("Failed to set mute")}));case 3:case"end":return n.stop()}}),n,this)})))}},{key:"setSubtitles",value:function(e,n){return zt(this,void 0,void 0,Dt().mark((function r(){var i;return Dt().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return i=t.createAckId(),this.sendMessage({destination:e,message:{type:"message_with_ack",ack_id:i,name:"set_subtitles",payload:{subtitles:n}}}),r.next=4,this.one("message",(function(t){var n;return t.source===e&&"subtitles"===(null===(n=t.message.payload)||void 0===n?void 0:n.event)})).timeout(Gt).catch((function(){throw new Error("Failed to set subtitles")}));case 4:case"end":return r.stop()}}),r,this)})))}}])&&Nt(n.prototype,r),i&&Nt(n,i),Object.defineProperty(n,"prototype",{writable:!1}),t}(ot.N);function Ht(e){return Ht="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},Ht(e)}function Yt(e){return function(e){if(Array.isArray(e))return Wt(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return Wt(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Wt(e,t):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.")}()}function Wt(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function $t(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,Qt(r.key),r)}}function Qt(e){var t=function(e,t){if("object"!=Ht(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=Ht(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Ht(t)?t:String(t)}function Xt(e,t,n){return t=en(t),function(e,t){if(t&&("object"===Ht(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)}(e,Jt()?Reflect.construct(t,n||[],en(e).constructor):t.apply(e,n))}function Jt(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Jt=function(){return!!e})()}function Kt(){return Kt="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=en(e)););return e}(e,t);if(r){var i=Object.getOwnPropertyDescriptor(r,t);return i.get?i.get.call(arguments.length<3?e:n):i.value}},Kt.apply(this,arguments)}function en(e){return en=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},en(e)}function tn(e,t){return tn=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},tn(e,t)}var nn=function(e){function t(e){var n;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(n=Xt(this,t)).instanceId=e,n.clients=[],n.bindFunctions(),n}var n,r,i;return 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&&tn(e,t)}(t,e),n=t,i=[{key:"getOrCreateInstance",value:function(e){if(!e)throw new Error("instanceId is required");return this.instances[e]||(this.instances[e]=new t(e)),this.instances[e]}},{key:"disposeAndRemoveInstance",value:function(e){e.dispose(),delete this.instances[e.instanceId]}},{key:"isActive",value:function(){return Object.keys(this.instances).length>0}}],(r=[{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(e){var t=this;e.on("deviceschange",this.gatherAndPublishDevices),e.on("error",(function(e){return t.trigger("error",e)})),this.clients.push(e)}},{key:"hasInstanceOfClient",value:function(e){return this.clients.some((function(t){return t instanceof e}))}},{key:"startCastSession",value:function(e){var t=this;if(this.castSession){if(this.castSession.getDevice().id===e.device.id)return void console.info("A session with device ".concat(e.device.id," already exists - this is a no-op"));this.castSession.dispose()}var n=this.clients.find((function(t){return t.canCastToDevice(e.device.type)}));n&&(this.castSession=n.startCastSession(e),this.castSession.on("error",(function(e){t.castSession.dispose(),t.trigger("error",e)})),this.castSession.on("dispose",(function(){t.castSession=void 0,t.trigger("castsessionchange",void 0)})),this.trigger("castsessionchange",this.castSession))}},{key:"getCastSession",value:function(){return this.castSession}},{key:"gatherAndPublishDevices",value:function(){var e=this.clients.map((function(e){return e.getDevices()})).reduce((function(e,t){return[].concat(Yt(e),Yt(t))}),[]);this.trigger("deviceschange",e)}},{key:"dispose",value:function(){var e;null===(e=this.castSession)||void 0===e||e.dispose(),this.clients.forEach((function(e){return e.dispose()})),this.castSession=void 0,this.clients=[],Kt(en(t.prototype),"dispose",this).call(this)}}])&&$t(n.prototype,r),i&&$t(n,i),Object.defineProperty(n,"prototype",{writable:!1}),t}(ot.N);nn.instances={};var rn=n(30050),on=n(98115);function an(e){return an="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},an(e)}function sn(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,un(r.key),r)}}function un(e){var t=function(e,t){if("object"!=an(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=an(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==an(t)?t:String(t)}function cn(e,t,n){return t=hn(t),function(e,t){if(t&&("object"===an(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return fn(e)}(e,ln()?Reflect.construct(t,n||[],hn(e).constructor):t.apply(e,n))}function ln(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(ln=function(){return!!e})()}function fn(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function pn(){return pn="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=hn(e)););return e}(e,t);if(r){var i=Object.getOwnPropertyDescriptor(r,t);return i.get?i.get.call(arguments.length<3?e:n):i.value}},pn.apply(this,arguments)}function hn(e){return hn=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},hn(e)}function yn(e,t){return yn=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},yn(e,t)}var dn=function(e){function t(e,n){var r;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(r=cn(this,t,[e,n])).isVisible=r.isVisible.bind(fn(r)),r}var n,r;return 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&&yn(e,t)}(t,e),n=t,(r=[{key:"createEl",value:function(){return pn(hn(t.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(){pn(hn(t.prototype),"show",this).call(this)}},{key:"hide",value:function(){pn(hn(t.prototype),"hide",this).call(this)}},{key:"isVisible",value:function(){return!pn(hn(t.prototype),"hasClass",this).call(this,"vjs-hidden")}}])&&sn(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),t}(o.Z.getComponent("MenuItem"));function vn(e){return vn="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},vn(e)}function bn(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,gn(r.key),r)}}function gn(e){var t=function(e,t){if("object"!=vn(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=vn(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==vn(t)?t:String(t)}function mn(e,t,n){return t=Pn(t),function(e,t){if(t&&("object"===vn(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)}(e,wn()?Reflect.construct(t,n||[],Pn(e).constructor):t.apply(e,n))}function wn(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(wn=function(){return!!e})()}function On(){return On="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=Pn(e)););return e}(e,t);if(r){var i=Object.getOwnPropertyDescriptor(r,t);return i.get?i.get.call(arguments.length<3?e:n):i.value}},On.apply(this,arguments)}function Pn(e){return Pn=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Pn(e)}function Sn(e,t){return Sn=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Sn(e,t)}var kn=o.Z.getComponent("MenuButton"),jn=function(e){function t(e,n){var r;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(r=mn(this,t,[e,n])).alwaysCollapsed=!1,r.isCollapsed=!1,r.isCollabsible=!0,r.className="cv-devices-menu-button",r.searchText="",r.devices=[],r.castSession=void 0,r.bindFunctions(),r.bindEventListeners(),r}var n,r;return 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&&Sn(e,t)}(t,e),n=t,r=[{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 e=this,t=this.$("button"),n=function(t){e.menu.handleBlur(t)};t.addEventListener("blur",n),this.one("dispose",(function(){t.removeEventListener("blur",n)}))}},{key:"createEl",value:function(){for(var e,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return(e=kn.prototype.createEl).apply.apply(e,[this].concat(n))}},{key:"buildWrapperCSSClass",value:function(){return"cv-menu-small cv-devices-button ".concat(On(Pn(t.prototype),"buildWrapperCSSClass",this).call(this))}},{key:"createItems",value:function(){var e=this,t=[];return this.headingItem=new rn.Z(this.player_,{label:this.localize("Select a device"),selectable:!1}),this.searchInputItem=new on.Z(this.player_,{menuButton:this,search:function(t){return e.setSearchText(t)},className:"cv-devices-search-input"}),this.emptyPlaceholder=new on.C(this.player_,{label:"No devices found",selected:!1,selectable:!1,multiSelectable:!1}),this.headingItem.show(),this.searchInputItem.hide(),this.emptyPlaceholder.show(),t.push(this.headingItem,this.searchInputItem,this.emptyPlaceholder),t}},{key:"pressButton",value:function(){var e;On(Pn(t.prototype),"pressButton",this).call(this),this.shouldShowSearchInput()&&(null===(e=this.searchInputItem)||void 0===e||e.focus())}},{key:"setDevices",value:function(e){this.devices=e,this.render()}},{key:"setCastSession",value:function(e){this.castSession=e,this.render()}},{key:"setSearchText",value:function(e){this.searchText=e,this.render()}},{key:"getDeviceMenuItems",value:function(){return this.menu.children_.filter((function(e){return e instanceof dn}))}},{key:"render",value:function(){this.removeMenuItems(this.getDeviceMenuItems()),this.addMenuItemsForDevices(this.devices),this.toggleSearchInput(),this.toggleDeviceMenuItems(),this.toggleEmptyStatePlaceholder()}},{key:"removeMenuItems",value:function(e){var t=this;e.forEach((function(e){t.menu.removeChild(e),e.dispose()}))}},{key:"addMenuItemsForDevices",value:function(e){var t=this;e.sort((function(e,t){return"".concat(e.type,"-").concat(e.name).localeCompare("".concat(t.type,"-").concat(t.name))})).forEach((function(e){var n=new dn(t.player(),{id:e.id,label:e.name,selected:!1,multiSelectable:!1,selectable:!0,available:e.status===it.L.Available,type:e.type,onClick:function(){t.options_.onDeviceMenuItemClick(n,e)}});t.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 e=this,t=this.getDeviceMenuItems(),n=this.shouldShowSearchInput(),r=this.searchText.toLowerCase();t.forEach((function(t){var i,o=e.devices.find((function(e){return e.id===t.options_.id}));if(o){var a=o.status===it.L.Available,s=!n||-1!==o.name.toLowerCase().indexOf(r),u=o.id===(null===(i=e.castSession)||void 0===i?void 0:i.getDevice().id);a?t.enable():t.disable(),s?t.show():t.hide(),u?t.selected(!0):t.selected(!1)}}))}},{key:"toggleEmptyStatePlaceholder",value:function(){var e=this.getDeviceMenuItems();e.filter((function(e){return e.isVisible()})).length?this.emptyPlaceholder.hide():this.emptyPlaceholder.show(),e.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 e,t;return null!==(t=null===(e=this.castSession)||void 0===e?void 0:e.getDevice().name)&&void 0!==t?t:" "}},{key:"showInCollabsibleMenu",value:function(){return!0}},{key:"showCollapsibleMenu",value:function(){this.handleClick()}},{key:"handleClick",value:function(){On(Pn(t.prototype),"handleClick",this).call(this,null),this.options_.onClick()}}],r&&bn(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),t}(kn);jn.prototype.controlText_="Devices",o.Z.registerComponent("DevicesButton",jn);var Cn=n(10463);function Tn(e){return Tn="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},Tn(e)}function En(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,_n(r.key),r)}}function _n(e){var t=function(e,t){if("object"!=Tn(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=Tn(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Tn(t)?t:String(t)}function In(e,t,n){return t=Mn(t),function(e,t){if(t&&("object"===Tn(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)}(e,xn()?Reflect.construct(t,n||[],Mn(e).constructor):t.apply(e,n))}function xn(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(xn=function(){return!!e})()}function Rn(){return Rn="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=Mn(e)););return e}(e,t);if(r){var i=Object.getOwnPropertyDescriptor(r,t);return i.get?i.get.call(arguments.length<3?e:n):i.value}},Rn.apply(this,arguments)}function Mn(e){return Mn=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Mn(e)}function Ln(e,t){return Ln=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Ln(e,t)}var Dn=function(e){function t(e){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),In(this,t,[null,e])}var n,r;return 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&&Ln(e,t)}(t,e),n=t,(r=[{key:"createEl",value:function(){return Rn(Mn(t.prototype),"createEl",this).call(this,"div",{className:"cv-devices-tech"})}},{key:"setPoster",value:function(e){this.poster=e,this.update()}},{key:"setDevice",value:function(e){this.device=e,this.update()}},{key:"update",value:function(){var e,t,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!==(t=null===(e=this.device)||void 0===e?void 0:e.type)&&void 0!==t?t:it.Y.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(e){e.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(){}}])&&En(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),t}(o.Z.getComponent("Component"));function Nn(e){return Nn="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},Nn(e)}function Vn(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,Bn(r.key),r)}}function Bn(e){var t=function(e,t){if("object"!=Nn(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=Nn(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Nn(t)?t:String(t)}function An(e,t,n){return t=Zn(t),function(e,t){if(t&&("object"===Nn(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)}(e,Fn()?Reflect.construct(t,n||[],Zn(e).constructor):t.apply(e,n))}function Fn(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Fn=function(){return!!e})()}function Un(){return Un="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=Zn(e)););return e}(e,t);if(r){var i=Object.getOwnPropertyDescriptor(r,t);return i.get?i.get.call(arguments.length<3?e:n):i.value}},Un.apply(this,arguments)}function Zn(e){return Zn=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Zn(e)}function zn(e,t){return zn=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},zn(e,t)}var Gn=function(e){function t(e,n){var r;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(r=An(this,t,[e,n])).featuresVolumeControl=!0,r.featuresPlaybackRate=!1,r.movingMediaElementInDOM=!1,r.featuresFullscreenResize=!0,r.featuresTimeupdateEvents=!0,r.featuresProgressEvents=!1,r.featuresNativeTextTracks=!1,r.featuresNativeAudioTracks=!1,r.featuresNativeVideoTracks=!1,r.featuresMuteControl=!0,r.featuresSourceset=!1,r.videojsPlayer=(0,o.Z)(r.options_.playerId),r.bindFunctions(),r.bindEventListeners(),r.ready((function(){r.setSource(r.options_.source)})),r.triggerReady(),r}var n,r,i;return 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&&zn(e,t)}(t,e),n=t,i=[{key:"canPlayType",value:function(){return""}},{key:"canPlaySource",value:function(e,t){var n;return!!nn.getOrCreateInstance(null!==(n=null==t?void 0:t.instanceId)&&void 0!==n?n:"").getCastSession()}},{key:"isSupported",value:function(){return nn.isActive()}}],(r=[{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 e=this,t=this.getCastSession();t&&(this.textTracks().on("change",this.onTextTrackChanged),this.videojsPlayer.one("ended",(function(){t.dispose()})),t.on("durationchange",(function(){e.trigger("durationchange")})),t.on("dispose",(function(){e.trigger("ended"),e.hideUI()})),t.on("playingchange",(function(){t.isPlaying()?(e.trigger("play"),e.trigger("playing")):e.trigger("pause")})),t.on("volumechange",(function(){e.trigger("volumechange")})),t.on("sourceloaded",(function(){e.trigger("loadeddata")})),t.on("subtitleschange",(function(){e.setSelectedTextTrack(t.getSubtitles())})))}},{key:"onTextTrackChanged",value:function(){var e,t=this.getSelectedTextTrack();null===(e=this.getCastSession())||void 0===e||e.setSubtitles(null==t?void 0:t.src)}},{key:"getSelectedTextTrack",value:function(){return Cn.O.findTrackByPredicate(this.videojsPlayer.player_,(function(e){return"showing"===e.mode&&!!e.src}))}},{key:"setSelectedTextTrack",value:function(e){Cn.O.forEachTrack(this.videojsPlayer.player_,(function(t){t.src===e?t.mode="showing":t.mode="hidden"}))}},{key:"showUI",value:function(e){this.ui&&(this.ui.setPoster(this.options_.poster),this.ui.setDevice(e),this.ui.show())}},{key:"hideUI",value:function(){var e;null===(e=this.ui)||void 0===e||e.hide()}},{key:"dispose",value:function(){this.textTracks().off("change",this.onTextTrackChanged);var e=this.getCastSession();e&&e.dispose(),Un(Zn(t.prototype),"cleanupAutoTextTracks",this).call(this),Un(Zn(t.prototype),"dispose",this).call(this)}},{key:"createEl",value:function(){var e=this;return this.ui=this.ui||new Dn({onStopCasting:function(){var t;null===(t=e.getCastSession())||void 0===t||t.dispose()}}),this.ui.el()}},{key:"setSource",value:function(e){var t=this.getCastSession();if(t){this.showUI(t.getDevice()),this.trigger("loadstart");var n=this.getSelectedTextTrack();t.loadSource(e.src,null==n?void 0:n.src)}}},{key:"addRemoteTextTrack",value:function(e){return Un(Zn(t.prototype),"addRemoteTextTrack",this).call(this,e,!0)}},{key:"getCastSession",value:function(){var e;return nn.getOrCreateInstance(null!==(e=this.options_.instanceId)&&void 0!==e?e:"").getCastSession()}},{key:"play",value:function(){var e;null===(e=this.getCastSession())||void 0===e||e.play()}},{key:"pause",value:function(){var e;null===(e=this.getCastSession())||void 0===e||e.pause()}},{key:"paused",value:function(){var e;return!1===(null===(e=this.getCastSession())||void 0===e?void 0:e.isPlaying())}},{key:"ended",value:function(){var e,t;return null!==(t=null===(e=this.getCastSession())||void 0===e?void 0:e.isPlaybackFinished())&&void 0!==t&&t}},{key:"setCurrentTime",value:function(e){var t;null===(t=this.getCastSession())||void 0===t||t.seek(null!=e?e:0)}},{key:"currentTime",value:function(){var e,t;return null!==(t=null===(e=this.getCastSession())||void 0===e?void 0:e.getPosition())&&void 0!==t?t:0}},{key:"duration",value:function(){var e,t;return null!==(t=null===(e=this.getCastSession())||void 0===e?void 0:e.getDuration())&&void 0!==t?t:this.videojsPlayer.duration()}},{key:"volume",value:function(){var e,t;return null!==(t=null===(e=this.getCastSession())||void 0===e?void 0:e.getVolume())&&void 0!==t?t:1}},{key:"setVolume",value:function(e){var t;null===(t=this.getCastSession())||void 0===t||t.setVolume(e)}},{key:"muted",value:function(){var e,t;return null!==(t=null===(e=this.getCastSession())||void 0===e?void 0:e.getMuted())&&void 0!==t&&t}},{key:"setMuted",value:function(e){var t;null===(t=this.getCastSession())||void 0===t||t.setMuted(e)}},{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(){}}])&&Vn(n.prototype,r),i&&Vn(n,i),Object.defineProperty(n,"prototype",{writable:!1}),t}(o.Z.getComponent("Tech"));function qn(e){return qn="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},qn(e)}function Hn(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,Yn(r.key),r)}}function Yn(e){var t=function(e,t){if("object"!=qn(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=qn(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==qn(t)?t:String(t)}function Wn(e,t,n){return t=Xn(t),function(e,t){if(t&&("object"===qn(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)}(e,$n()?Reflect.construct(t,n||[],Xn(e).constructor):t.apply(e,n))}function $n(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return($n=function(){return!!e})()}function Qn(){return Qn="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=Xn(e)););return e}(e,t);if(r){var i=Object.getOwnPropertyDescriptor(r,t);return i.get?i.get.call(arguments.length<3?e:n):i.value}},Qn.apply(this,arguments)}function Xn(e){return Xn=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Xn(e)}function Jn(e,t){return Jn=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Jn(e,t)}o.Z.registerTech("devices",Gn);var Kn=function(e){function t(e,n){var r,i,o;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(r=Wn(this,t,[e,n])).options=n,r.instanceId=null!==(o=null===(i=r.player.options_.devices)||void 0===i?void 0:i.instanceId)&&void 0!==o?o:"",r.bindFunctions(),r.initialize(),r}var n,r;return 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&&Jn(e,t)}(t,e),n=t,(r=[{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 e=this,t=this.player.getChild("collapserator"),n=null==t?void 0:t.children().findIndex((function(e){return"CustomControlSpacer"===e.name()})),r=this.getSessionManager();if(t&&n&&-1!==n&&r){r.on("deviceschange",this.onDevicesChanged),r.on("castsessionchange",this.onCastSessionChanged),r.on("error",this.onDevicesError);var i={onClick:function(){e.addViviClient(r),e.addAppleTvClient(r)},onDeviceMenuItemClick:function(t,n){var i;r.startCastSession({device:n,title:e.options.title}),null===(i=e.options.analyticsService)||void 0===i||i.logUserAction(n,{actionType:nt.Vw.Select,workflowPhase:nt.eu.Complete,descriptor:nt.UX.ChangeDevice,entity:nt.py.Device,eventVersion:nt.eq.V3})}};this.devicesButton=t.addChild("DevicesButton",i,n+1)}}},{key:"onDevicesChanged",value:function(e){var t;null===(t=this.devicesButton)||void 0===t||t.setDevices(e)}},{key:"onCastSessionChanged",value:function(e){var t;null===(t=this.devicesButton)||void 0===t||t.setCastSession(e),this.reloadTech(),e?(this.player.addClass("cv-device-casting"),this.player.addClass("cv-device-".concat(e.getDevice().type)),this.player.isFullscreen()&&this.player.exitFullscreen()):(this.player.removeClass("cv-device-casting"),this.player.removeClass("cv-device-".concat(it.Y.AppleTv)),this.player.removeClass("cv-device-".concat(it.Y.Vivi)))}},{key:"onDevicesError",value:function(e){this.player.error(e.message),this.player.pause()}},{key:"addViviClient",value:function(e){if(this.options.viviEnabled&&this.options.viviApi&&this.options.fetchViviAccessToken&&!e.hasInstanceOfClient(qt)){var t=new qt({url:this.options.viviApi,fetchAccessToken:this.options.fetchViviAccessToken});e.addClient(t)}}},{key:"addAppleTvClient",value:function(e){if(this.options.appleTvEnabled&&this.options.fetchOnlineApiAccessToken&&this.options.trackingCode&&this.options.userId&&!e.hasInstanceOfClient(rt.w)){var t=new rt.w({fetchAccessToken:this.options.fetchOnlineApiAccessToken,trackingCode:this.options.trackingCode,userId:this.options.userId});e.addClient(t)}}},{key:"reloadTech",value:function(){var e=this.player,t=e.currentSources(),n=e.volume(),r=e.muted(),i=e.currentTime(),o=e.paused();e.src(t),e.one("playing",(function(){e.volume(n),e.muted(r),e.currentTime(i),o?e.pause():e.play()}))}},{key:"getSessionManager",value:function(){if(this.instanceId)return nn.getOrCreateInstance(this.instanceId)}},{key:"dispose",value:function(){var e=this.getSessionManager();e&&(e.off("deviceschange",this.onDevicesChanged),e.off("castsessionchange",this.onCastSessionChanged),e.off("error",this.onDevicesError),nn.disposeAndRemoveInstance(e),Qn(Xn(t.prototype),"dispose",this).call(this))}}])&&Hn(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),t}(o.Z.getPlugin("plugin"));function er(e){return er="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},er(e)}function tr(){tr=function(){return t};var e,t={},n=Object.prototype,r=n.hasOwnProperty,i=Object.defineProperty||function(e,t,n){e[t]=n.value},o="function"==typeof Symbol?Symbol:{},a=o.iterator||"@@iterator",s=o.asyncIterator||"@@asyncIterator",u=o.toStringTag||"@@toStringTag";function c(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{c({},"")}catch(e){c=function(e,t,n){return e[t]=n}}function l(e,t,n,r){var o=t&&t.prototype instanceof b?t:b,a=Object.create(o.prototype),s=new I(r||[]);return i(a,"_invoke",{value:C(e,n,s)}),a}function f(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}t.wrap=l;var p="suspendedStart",h="suspendedYield",y="executing",d="completed",v={};function b(){}function g(){}function m(){}var w={};c(w,a,(function(){return this}));var O=Object.getPrototypeOf,P=O&&O(O(x([])));P&&P!==n&&r.call(P,a)&&(w=P);var S=m.prototype=b.prototype=Object.create(w);function k(e){["next","throw","return"].forEach((function(t){c(e,t,(function(e){return this._invoke(t,e)}))}))}function j(e,t){function n(i,o,a,s){var u=f(e[i],e,o);if("throw"!==u.type){var c=u.arg,l=c.value;return l&&"object"==er(l)&&r.call(l,"__await")?t.resolve(l.__await).then((function(e){n("next",e,a,s)}),(function(e){n("throw",e,a,s)})):t.resolve(l).then((function(e){c.value=e,a(c)}),(function(e){return n("throw",e,a,s)}))}s(u.arg)}var o;i(this,"_invoke",{value:function(e,r){function i(){return new t((function(t,i){n(e,r,t,i)}))}return o=o?o.then(i,i):i()}})}function C(t,n,r){var i=p;return function(o,a){if(i===y)throw new Error("Generator is already running");if(i===d){if("throw"===o)throw a;return{value:e,done:!0}}for(r.method=o,r.arg=a;;){var s=r.delegate;if(s){var u=T(s,r);if(u){if(u===v)continue;return u}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(i===p)throw i=d,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);i=y;var c=f(t,n,r);if("normal"===c.type){if(i=r.done?d:h,c.arg===v)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(i=d,r.method="throw",r.arg=c.arg)}}}function T(t,n){var r=n.method,i=t.iterator[r];if(i===e)return n.delegate=null,"throw"===r&&t.iterator.return&&(n.method="return",n.arg=e,T(t,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,t.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[t.resultName]=a.value,n.next=t.nextLoc,"return"!==n.method&&(n.method="next",n.arg=e),n.delegate=null,v):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,v)}function E(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function _(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function I(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(E,this),this.reset(!0)}function x(t){if(t||""===t){var n=t[a];if(n)return n.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var i=-1,o=function n(){for(;++i<t.length;)if(r.call(t,i))return n.value=t[i],n.done=!1,n;return n.value=e,n.done=!0,n};return o.next=o}}throw new TypeError(er(t)+" is not iterable")}return g.prototype=m,i(S,"constructor",{value:m,configurable:!0}),i(m,"constructor",{value:g,configurable:!0}),g.displayName=c(m,u,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===g||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,m):(e.__proto__=m,c(e,u,"GeneratorFunction")),e.prototype=Object.create(S),e},t.awrap=function(e){return{__await:e}},k(j.prototype),c(j.prototype,s,(function(){return this})),t.AsyncIterator=j,t.async=function(e,n,r,i,o){void 0===o&&(o=Promise);var a=new j(l(e,n,r,i),o);return t.isGeneratorFunction(n)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},k(S),c(S,u,"Generator"),c(S,a,(function(){return this})),c(S,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),n=[];for(var r in t)n.push(r);return n.reverse(),function e(){for(;n.length;){var r=n.pop();if(r in t)return e.value=r,e.done=!1,e}return e.done=!0,e}},t.values=x,I.prototype={constructor:I,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(_),!t)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var n=this;function i(r,i){return s.type="throw",s.arg=t,n.next=r,i&&(n.method="next",n.arg=e),!!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 u=r.call(a,"catchLoc"),c=r.call(a,"finallyLoc");if(u&&c){if(this.prev<a.catchLoc)return i(a.catchLoc,!0);if(this.prev<a.finallyLoc)return i(a.finallyLoc)}else if(u){if(this.prev<a.catchLoc)return i(a.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return i(a.finallyLoc)}}}},abrupt:function(e,t){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"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=e,a.arg=t,o?(this.method="next",this.next=o.finallyLoc,v):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),v},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),_(n),v}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var i=r.arg;_(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(t,n,r){return this.delegate={iterator:x(t),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=e),v}},t}function nr(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function rr(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,ir(r.key),r)}}function ir(e){var t=function(e,t){if("object"!=er(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=er(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==er(t)?t:String(t)}function or(e,t,n){return t=ur(t),function(e,t){if(t&&("object"===er(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)}(e,ar()?Reflect.construct(t,n||[],ur(e).constructor):t.apply(e,n))}function ar(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(ar=function(){return!!e})()}function sr(){return sr="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=ur(e)););return e}(e,t);if(r){var i=Object.getOwnPropertyDescriptor(r,t);return i.get?i.get.call(arguments.length<3?e:n):i.value}},sr.apply(this,arguments)}function ur(e){return ur=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},ur(e)}function cr(e,t){return cr=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},cr(e,t)}o.Z.registerPlugin("devicesPlugin",Kn);var lr=function(e){function t(e,n){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),or(this,t,[e,n])}var n,r;return 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&&cr(e,t)}(t,e),n=t,(r=[{key:"getPlayerOptions",value:function(){var e,n=sr(ur(t.prototype),"getPlayerOptions",this).call(this);return this.areDevicesEnabled()?Object.assign(Object.assign({},n),{techOrder:["devices"].concat((e=n.techOrder,function(e){if(Array.isArray(e))return nr(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return nr(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?nr(e,t):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.")}())),devices:{instanceId:vt()}}):n}},{key:"configurePlugins",value:function(){var e;try{this.options.onClickCreateClip&&this.player.createClipButtonPlugin({onClick:this.options.onClickCreateClip}),this.options.onRequestPictureInPicture&&this.player.pictureInPicture({onRequestPictureInPicture:this.options.onRequestPictureInPicture}),(null===(e=this.options.pointsOfInterest)||void 0===e?void 0:e.length)&&this.player.pointsOfInterestPlugin({pointsOfInterest:this.options.pointsOfInterest})}catch(e){console.log("failed to register plugins",e)}}},{key:"setNextVideo",value:function(e,t,n){this.player.nextVideoPlugin&&this.player.nextVideoPlugin().setNextVideo(e,t,n)}},{key:"enablePictureInPicture",value:function(){var e=this.player.pictureInPicture();e&&e.enablePictureInPicture()}},{key:"disablePictureInPicture",value:function(){var e=this.player.pictureInPicture();e&&e.disablePictureInPicture()}},{key:"togglePictureInPicture",value:function(e){var t=this.player.pictureInPicture();t&&t.togglePictureInPicture(e)}},{key:"additionalSetup",value:function(e){var n,r,i,o,a,s,u,c,l,f,p=this,h=Object.create(null,{additionalSetup:{get:function(){return sr(ur(t.prototype),"additionalSetup",p)}}});return u=this,c=void 0,l=void 0,f=tr().mark((function t(){var u;return tr().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(h.additionalSetup.call(this,e),this.options.showResources&&e.resources&&this.player.resourcesPlugin&&this.player.resourcesPlugin({resources:e.resources.list,imageCdnUrl:this.options.imageCdnUrl}),"MasterClip"!==e.mediaType){t.next=7;break}if(null!==(u=e.additionalData)){t.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===(n=this.options.devicesConfig)||void 0===n?void 0:n.viviEnabled,viviApi:null===(r=this.options.devicesConfig)||void 0===r?void 0:r.viviApi,fetchViviAccessToken:null===(i=this.options.devicesConfig)||void 0===i?void 0:i.fetchViviAccessToken,appleTvEnabled:null===(o=this.options.devicesConfig)||void 0===o?void 0:o.appleTvEnabled,fetchOnlineApiAccessToken:null===(a=this.options.devicesConfig)||void 0===a?void 0:a.fetchOnlineApiAccessToken,trackingCode:null===(s=this.options.devicesConfig)||void 0===s?void 0:s.trackingCode,userId:parseInt(e.viewerId),title:e.title,analyticsService:this.analyticsService}),"MasterVideo"===e.mediaType&&this.options.startTime&&this.options.endTime&&this.player.rangeIndicatorPlugin({startTime:this.options.startTime,endTime:this.options.endTime});case 9:case"end":return t.stop()}}),t,this)})),new(l||(l=Promise))((function(e,t){function n(e){try{i(f.next(e))}catch(e){t(e)}}function r(e){try{i(f.throw(e))}catch(e){t(e)}}function i(t){var i;t.done?e(t.value):(i=t.value,i instanceof l?i:new l((function(e){e(i)}))).then(n,r)}i((f=f.apply(u,c||[])).next())}))}},{key:"setActivityStatus",value:function(e,t){this.player.activityStatusPlugin().setActivityStatus(e,t)}}])&&rr(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),t}(i.r),fr=n(63816),pr=n(14735);function hr(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function yr(e){var t,n,i,o=r.useRef(e.player.duration()-e.player.currentTime()),a=(n=r.useState(o.current),i=2,function(e){if(Array.isArray(e))return e}(n)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,o,a,s=[],u=!0,c=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;u=!1}else for(;!(u=(r=o.call(n)).done)&&(s.push(r.value),s.length!==t);u=!0);}catch(e){c=!0,i=e}finally{try{if(!u&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw i}}return s}}(n,i)||function(e,t){if(e){if("string"==typeof e)return hr(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?hr(e,t):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],u=a[1];function c(){var t=e.player.duration()-e.player.currentTime();u(t),t>o.current&&(o.current=t)}if(r.useEffect((function(){return e.player.on("timeupdate",c),function(){e.player.off("timeupdate",c)}}),[]),!e.nextVideo||!e.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:e.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:e.onPlayNext,style:{backgroundImage:"url(".concat(null===(t=e.nextVideo)||void 0===t?void 0:t.thumbnailUrl,")")}}),r.createElement("div",{className:"cv-up-next-title"},e.nextVideo.name)))}function dr(e){return dr="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},dr(e)}function vr(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,br(r.key),r)}}function br(e){var t=function(e,t){if("object"!=dr(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=dr(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==dr(t)?t:String(t)}function gr(e,t,n){return t=Or(t),function(e,t){if(t&&("object"===dr(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)}(e,mr()?Reflect.construct(t,n||[],Or(e).constructor):t.apply(e,n))}function mr(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(mr=function(){return!!e})()}function wr(){return wr="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=Or(e)););return e}(e,t);if(r){var i=Object.getOwnPropertyDescriptor(r,t);return i.get?i.get.call(arguments.length<3?e:n):i.value}},wr.apply(this,arguments)}function Or(e){return Or=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Or(e)}function Pr(e,t){return Pr=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Pr(e,t)}o.Z.registerComponent("UpNext",(0,pr.Z)((function(e,t){return r.createElement(yr,Object.assign({player:e},t))})));var Sr=function(e){function t(e,n){var r;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(r=gr(this,t,[e,n])).playNext=e.nextVideoPlugin().getShouldPlayNext(),r.toggle(r.playNext),r}var n,r;return 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&&Pr(e,t)}(t,e),n=t,(r=[{key:"handleToggle",value:function(){this.toggle(!this.playNext)}},{key:"toggle",value:function(e){e?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(e){e.stopImmediatePropagation()}},{key:"createEl",value:function(e,n,r){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 i=wr(Or(t.prototype),"createEl",this).call(this,e,{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>'},r);return i.children[1].appendChild(this.toggleEl),i}}])&&vr(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),t}(o.Z.getComponent("MenuItem"));function kr(e){return kr="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},kr(e)}function jr(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,Cr(r.key),r)}}function Cr(e){var t=function(e,t){if("object"!=kr(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=kr(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==kr(t)?t:String(t)}function Tr(e,t,n){return t=xr(t),function(e,t){if(t&&("object"===kr(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return _r(e)}(e,Er()?Reflect.construct(t,n||[],xr(e).constructor):t.apply(e,n))}function Er(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Er=function(){return!!e})()}function _r(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Ir(){return Ir="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=xr(e)););return e}(e,t);if(r){var i=Object.getOwnPropertyDescriptor(r,t);return i.get?i.get.call(arguments.length<3?e:n):i.value}},Ir.apply(this,arguments)}function xr(e){return xr=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},xr(e)}function Rr(e,t){return Rr=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Rr(e,t)}o.Z.registerComponent("NextVideoMenuItem",Sr);var Mr="cv-persisttest",Lr="cv-play-next-video",Dr=o.Z.getPlugin("plugin"),Nr=(o.Z.getComponent("MenuItem"),o.Z.getComponent("NextVideoMenuItem")),Vr=function(e){function t(e){var n;if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(n=Tr(this,t,[e])).setShouldPlayNext=n.setShouldPlayNext.bind(_r(n)),n.getShouldPlayNext=n.getShouldPlayNext.bind(_r(n)),n.getChapterTrack=n.getChapterTrack.bind(_r(n)),n.onTimeUpdate=n.onTimeUpdate.bind(_r(n)),n.hasLocalStorage=n.testHasLocalStorage(),n.shouldPlayNextVideo=!1,n.hasLocalStorage){var r=window.localStorage.getItem(Lr);n.shouldPlayNextVideo="true"===r}return e.ready((function(){n.initialize()})),n}var n,r;return 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&&Rr(e,t)}(t,e),n=t,(r=[{key:"initialize",value:function(){this.player.isDisposed()||this.bindListeners()}},{key:"getChapterTrack",value:function(){return Cn.O.getTrack(this.player,"chapters",null)}},{key:"setNextVideo",value:function(e,t,n){var r;this.nextVideo=e,this.callback=n,t&&this.setShouldPlayNext(!0),(null===(r=this.player.getChild("collapserator"))||void 0===r?void 0:r.getChild("cogButton")).addItem({index:0,ctor:Nr,name:"NextVideoMenuItem"})}},{key:"getShouldPlayNext",value:function(){return this.shouldPlayNextVideo}},{key:"setShouldPlayNext",value:function(e,t){this.shouldPlayNextVideo=e,this.hasLocalStorage&&t&&window.localStorage.setItem(Lr,e.toString())}},{key:"bindListeners",value:function(){this.player.on("timeupdate",this.onTimeUpdate)}},{key:"dispose",value:function(){this.player.off("timeupdate",this.onTimeUpdate),this.hideUpNext(),Ir(xr(t.prototype),"dispose",this).call(this)}},{key:"onTimeUpdate",value:function(){var e,t;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===(e=null==n?void 0:n.activeCues)||void 0===e?void 0:e.length)&&n.activeCues[0];"credits"===(null===(t=null==r?void 0:r.text)||void 0===t?void 0:t.toLowerCase())||this.player.currentTime()>=this.player.duration()-5?this.showUpNext():this.hideUpNext()}}else this.hideUpNext()}},{key:"showUpNext",value:function(){var e=this;this.upNextRendered||(this.upNextRendered=!0,this.upNextTimepoint=this.player.currentTime(),this.player.addChild("UpNext",{nextVideo:this.nextVideo,onPlayNext:this.callback,onCancel:function(){e.hideUpNext(),e.setShouldPlayNext(!1)}}))}},{key:"hideUpNext",value:function(){if(this.upNextRendered){this.upNextRendered=!1,this.upNextTimepoint=null;var e=this.player.getChild("UpNext");e&&(this.player.removeChild(e),e.dispose())}}},{key:"testHasLocalStorage",value:function(){try{return window.localStorage.setItem(Mr,"persistPlayNext"),window.localStorage.removeItem(Mr),!0}catch(e){return!1}}}])&&jr(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),t}(Dr);o.Z.registerPlugin("nextVideoPlugin",Vr);var Br=n(26733);function Ar(e){return Ar="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},Ar(e)}function Fr(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,Ur(r.key),r)}}function Ur(e){var t=function(e,t){if("object"!=Ar(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=Ar(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Ar(t)?t:String(t)}function Zr(e,t,n){return t=Gr(t),function(e,t){if(t&&("object"===Ar(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)}(e,zr()?Reflect.construct(t,n||[],Gr(e).constructor):t.apply(e,n))}function zr(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(zr=function(){return!!e})()}function Gr(e){return Gr=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Gr(e)}function qr(e,t){return qr=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},qr(e,t)}function Hr(e){return r.createElement("div",{className:"cv-resource-item"},r.createElement(Br.s,{data:e.resource,imageCdnUrl:e.imageCdnUrl}))}var Yr=(0,pr.Z)((function(e,t){return r.createElement(Hr,Object.assign({},t))})),Wr=function(e){function t(e,n){var r;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),r=Zr(this,t,[e,n]);var i=new Yr(e,{resource:n.resource,imageCdnUrl:n.imageCdnUrl});return r.addChild(i),r}var n,r;return 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&&qr(e,t)}(t,e),n=t,(r=[{key:"createEl",value:function(){return o.Z.dom.createEl("div")}},{key:"handleClick",value:function(e){e.stopImmediatePropagation(),this.options_.downloadResource(this.options_.resource)}}])&&Fr(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),t}(o.Z.getComponent("ClickableComponent"));function $r(e){return $r="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},$r(e)}function Qr(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,Xr(r.key),r)}}function Xr(e){var t=function(e,t){if("object"!=$r(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=$r(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==$r(t)?t:String(t)}function Jr(e,t,n){return t=ti(t),function(e,t){if(t&&("object"===$r(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)}(e,Kr()?Reflect.construct(t,n||[],ti(e).constructor):t.apply(e,n))}function Kr(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Kr=function(){return!!e})()}function ei(){return ei="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=ti(e)););return e}(e,t);if(r){var i=Object.getOwnPropertyDescriptor(r,t);return i.get?i.get.call(arguments.length<3?e:n):i.value}},ei.apply(this,arguments)}function ti(e){return ti=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},ti(e)}function ni(e,t){return ni=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},ni(e,t)}var ri=function(e){function t(){var e;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(e=Jr(this,t,arguments)).alwaysCollapsed=!1,e.isCollapsed=!1,e.isCollabsible=!0,e}var n,r;return 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&&ni(e,t)}(t,e),n=t,(r=[{key:"buildWrapperCSSClass",value:function(){return"cv-menu-small ".concat(ei(ti(t.prototype),"buildWrapperCSSClass",this).call(this))}},{key:"buildCSSClass",value:function(){return"cv-resources-button ".concat(ei(ti(t.prototype),"buildCSSClass",this).call(this))}},{key:"update",value:function(){ei(ti(t.prototype),"update",this).call(this)}},{key:"createMenu",value:function(){return this.options_.title="Resources",ei(ti(t.prototype),"createMenu",this).call(this)}},{key:"createItems",value:function(){var e=this,t=[];return this.options_.resources.forEach((function(n){var r=new Wr(e.player(),{resource:n,imageCdnUrl:e.options_.imageCdnUrl,downloadResource:function(t){return e.downloadResource(t)}});t.push(r)})),t}},{key:"downloadResource",value:function(e){this.getDownloadIframe().src=e.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(){ei(ti(t.prototype),"handleClick",this).call(this,null)}}])&&Qr(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),t}(o.Z.getComponent("MenuButton"));function ii(e){return ii="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},ii(e)}function oi(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,ai(r.key),r)}}function ai(e){var t=function(e,t){if("object"!=ii(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=ii(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==ii(t)?t:String(t)}function si(e,t,n){return t=ci(t),function(e,t){if(t&&("object"===ii(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)}(e,ui()?Reflect.construct(t,n||[],ci(e).constructor):t.apply(e,n))}function ui(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(ui=function(){return!!e})()}function ci(e){return ci=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},ci(e)}function li(e,t){return li=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},li(e,t)}ri.prototype.controlText_="Resources",o.Z.registerComponent("ResourcesButton",ri);var fi=function(e){function t(e,n){var r;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(r=si(this,t,[e,n])).options=n,e.ready((function(){return r.onReady()})),r}var n,r;return 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&&li(e,t)}(t,e),n=t,(r=[{key:"onReady",value:function(){if(this.options.resources.length){var e=this.player.getChild("collapserator");e.addChild("ResourcesButton",{resources:this.options.resources,imageCdnUrl:this.options.imageCdnUrl},e.children_.length-3)}}}])&&oi(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),t}(o.Z.getPlugin("plugin"));o.Z.registerPlugin("resourcesPlugin",fi);var pi=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n};function hi(e){var t=e.className,n=void 0===t?"":t,i=e.playerApi,o=e.onReady,a=e.onDispose,s=pi(e,["className","playerApi","onReady","onDispose"]),u=r.useRef();return r.useEffect((function(){if(u){var e=new lr(u.current,Object.assign(Object.assign({},s),{playerApi:i}));return o&&e.ready((function(){o((0,fr.G)(e))})),a&&e.one("dispose",a),function(){null==e||e.dispose()}}}),[e.viewKey]),r.createElement("div",{ref:u,className:n})}}}]);
@@ -1,2 +0,0 @@
1
- /*! For license information please see 3095-6273cd7e5a-lite.chunk.js.LICENSE.txt */
2
- "use strict";(self.webpackChunk_clickview_lite=self.webpackChunk_clickview_lite||[]).push([[3095],{49602:(e,t,n)=>{var r;n.d(t,{b:()=>o}),function(e){e[e.None=0]="None",e[e.AllSubjects=1]="AllSubjects",e[e.AllLevels=2]="AllLevels",e[e.AllSubjectsAndAllLevels=3]="AllSubjectsAndAllLevels"}(r||(r={}));var a=n(25925),o={hasManyPresentationTypes:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=0,n=0;return null==e||e.forEach((function(e){e.type===a.R.Subject?t++:e.type===a.R.Curriculum&&n++})),{hasManySubjectPresentations:t>1,hasManyCurriculumPresentations:n>1}},getBulkPreferencesState:function(e){return e===r.AllSubjectsAndAllLevels?{levels:!0,subjects:!0}:{levels:e===r.AllLevels,subjects:e===r.AllSubjects}},hasBulkSelectedLevels:function(e){return e===r.AllLevels||e===r.AllSubjectsAndAllLevels},hasBulkSelectedTopics:function(e){return e===r.AllSubjects||e===r.AllSubjectsAndAllLevels},getNextBulkState:function(e,t){var n=r.None,a=r.AllSubjects,o=r.AllLevels,i=r.AllSubjectsAndAllLevels,c="topics"===t;switch(e){case n:default:return c?a:o;case a:return c?n:i;case o:return c?i:n;case i:return c?o:a}}}},80143:(e,t,n)=>{n.d(t,{n:()=>o});var r=n(32735),a=n(69454);function o(e,t){var n=r.useMemo((function(){return(null==e?void 0:e.length)&&t&&a.T.shouldShowAudiences(t)?a.T.getSortedPresentationAudiences(e,t):null}),[e]);return r.useMemo((function(){return(null==n?void 0:n.length)?a.T.getMergedPresentationAudienceString(n):null}),[n])}},69454:(e,t,n)=>{n.d(t,{T:()=>d});var r=n(75896),a=n(1048),o=n(55171);function i(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var c=/\d/,l=function(e){var t,n,a=r.m.first(e),o=r.m.last(e);return a.name===o.name?a.name:"Advanced"===o.name?"lower"===(t=a.name.split(" "),n=1,function(e){if(Array.isArray(e))return e}(t)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,a,o,i,c=[],l=!0,s=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=o.call(n)).done)&&(c.push(r.value),c.length!==t);l=!0);}catch(e){s=!0,a=e}finally{try{if(!l&&null!=n.return&&(i=n.return(),Object(i)!==i))return}finally{if(s)throw a}}return c}}(t,n)||function(e,t){if(e){if("string"==typeof e)return i(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?i(e,t):void 0}}(t,n)||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.")}())[0].toLowerCase()?"Lower Sec - Adv":"Upper Sec - Adv":"Lower - Upper Sec"},s=/([0-9]+)/gi,u=/\s|\+/gi,d={getSortedPresentationAudiences:function(e,t){var n=e.filter((function(e){return!!e})).map((function(e){return e.id.toString()}));return t.filter((function(e){return n.includes(e.masterId.toString())}))},getMergedPresentationAudienceString:function(e){var t,n,a,i="";switch(+r.m.first(e).presentationId){case o.e.PresentationIds.DEFAULT:case o.e.PresentationIds.AU_SECONDARY:case o.e.PresentationIds.US_ELEMENTARY:case o.e.PresentationIds.AU_PRIMARY:case o.e.PresentationIds.STREAMABLE_LEARNING:if(1===e.length)return e[0];i=function(e){var t=e.map((function(e){return e.name})).join(" "),n=t.split(" ").filter((function(e){return!isNaN(+e)})).map((function(e){return+e}))||[],r=t.split(" ").filter((function(e){return isNaN(+e)}))||[],a=e.find((function(e){return!c.test(e.name)})),o=r.find((function(e){return e!==(null==a?void 0:a.name)}));if(e.length>1&&(o+="s"),a&&n.length)return"".concat(o," ").concat(a.name.charAt(0)," - ").concat(n.pop());var i=function(e){var t,n,r,a,o=!1,i=[];for(e=e.sort((function(e,t){return e-t})),r=0;r<e.length;r++)a=r+1,o||(t=e[r]),n=e[a],e[r]+1===n?o=!0:o?(i.push("".concat(t," - ").concat(e[r])),o=!1):(i.push("".concat(e[r])),o=!1);return i}(n);return"".concat(o," ").concat(i.join(", "))}(e);break;case o.e.PresentationIds.SCOTLAND_PRIMARY:case o.e.PresentationIds.INTERNATIONAL_PRIMARY:case o.e.PresentationIds.INTERNATIONAL_SECONDARY:if(1===e.length)return e[0];i=function(e){var t=e.map((function(e){return e.name})),n={};t.forEach((function(e,t){if(0!==t){var r=e.split(" ");Object.keys(n).forEach((function(e){r.includes(e)||delete n[e]}))}else e.split(" ").forEach((function(e,t){n[e]=0===t?"start":"end"}))}));var r=Object.keys(n)[0],a=n[r];if(!r)return e[0].name;var o=e[0].name,i=e[e.length-1].name,c=function(e){return e.split(r)[0]},l="".concat(c(o)," - ").concat(c(i));return"start"===a?"".concat(r," ").concat(l):"".concat(l," ").concat(r)}(e);break;case o.e.PresentationIds.ENGLISH_SECONDARY:i=l(e);break;case o.e.PresentationIds.SCOTLAND_SECONDARY:t=e,n=r.m.first(t),a=r.m.last(t),i=n.name===a.name?n.name:"Senior Phase"===a.name?"".concat(n.name," - Senior"):"Third - Fourth Level";break;case o.e.PresentationIds.ENGLAND_PRIMARY:i=function(e){var t=r.m.first(e),n=r.m.last(e),a=r.m.first(t.name.split(" ")),o=r.m.first(n.name.split(" ")),i=t.name.split(" ").find((function(e){return!isNaN(+e)})),c=n.name.split(" ").find((function(e){return!isNaN(+e)}));if(t===n)return"Key"===a||"Reception"===a?t.name:"".concat(a," KS").concat(i);var l="",s="";return l="Reception"===a?"R":"KS".concat(i),s="KS".concat(c),"Lower"===a&&"Upper"===o?"L ".concat(l," - U ").concat(s):("Lower"===a&&(l="Lower ".concat(l)),"Upper"===o&&(s="Upper ".concat(s)),"Key"===o&&(s=n.name),"".concat(l," - ").concat(s))}(e);case o.e.PresentationIds.US_MIDDLE:case o.e.PresentationIds.US_HIGH:}return i?{name:i}:null},sortMembersWithDuplicateNamesByAudience:function(e){var t=function(e){return e.length?(e.forEach((function(e){var a=+r.m.first(e.name.match(s));if(!t)return t=e,void(n=a);a<n&&(t=e)})),t):null;var t,n},n={},a=[];return e.forEach((function(e){if(!n[e.name])return n[e.name]=1,void a.push(e);a.push(e),n[e.name]++;var r=a.splice(a.length-n[e.name]).sort((function(e,n){var r=t(e.subjectPresentationAudiences.data),a=t(n.subjectPresentationAudiences.data);if(!r&&a)return 1;if(!a)return-1;var o=r.name.localeCompare(a.name);return 0===o?o:o>0?-1:1}));a=a.concat(r)})),a},getActiveAudiencesFromParams:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(a.t.isObject(t)&&!a.t.isEmpty(t)&&e&&e.length&&d.shouldShowAudiences(e)){var n=t.a;if(n){"string"==typeof n&&(n=[n]);var r=function(e){return e.replace(u,"").toLowerCase()},o=n.reduce((function(e,t){return e[r(t)]=t,e}),{});return e.filter((function(e){return o[r(e.name)]}))}}},getAudienceParams:function(e){return(null==e?void 0:e.length)?{a:e.map((function(e){return e.name}))}:null},shouldShowAudiences:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return!!e&&e.length>1}}},12058:(e,t,n)=>{n.d(t,{X:()=>a});var r=n(32735);function a(e){return r.createElement("p",{className:e.className},e.children)}},75919:(e,t,n)=>{n.d(t,{N:()=>o});var r=n(32735);const a={annotation:"LkdHB",above:"ROdbm",below:"OzyHx",left:"W9EBF",right:"zhio2",divider:"cdR_p",imageContainer:"QZZMF"};function o(e){return r.createElement("div",{className:(t="d-flex align-items-center text-center position-relative w-100 ".concat(a.imageContainer),"center"===e.contentPosition&&(t+=" px-5 justify-content-center"),"right"===e.contentPosition&&(t+=" me-n5 justify-content-end"),t)},!!e.annotationUrl&&r.createElement("div",{className:function(){var t=a.annotation;switch(e.annotationPosition){case"top-left":t+=" ".concat(a.above," ").concat(a.left);break;case"top-right":t+=" ".concat(a.above," ").concat(a.right);break;case"bottom-left":t+=" ".concat(a.below," ").concat(a.left);break;case"bottom-right":t+=" ".concat(a.below," ").concat(a.right)}return e.annotationClassName&&(t+=" ".concat(e.annotationClassName)),t}()},r.createElement("img",{className:"img-fluid",src:e.annotationUrl})),e.children,"right"===e.contentPosition&&r.createElement("div",{className:a.divider}));var t}o.defaultProps={contentPosition:"center"}},63478:(e,t,n)=>{n.d(t,{B:()=>a});var r=n(32735);function a(e){return r.createElement("div",{className:"w-100 h-100 position-fixed bg-".concat(e.variant)},e.children)}},24250:(e,t,n)=>{n.d(t,{R:()=>u});var r=n(32735),a=n(75896),o=n(55171),i=n(54610),c=n(79967),l=n(67453);function s(e,t){return"mobile"===t?function(e){var t=e%10,n={top:"".concat(4*e,"%")};switch(t){case 0:return n.left="12.5%",n.animationDelay="0.5s",n;case 1:return n.right="7.5%",n.animationDelay="1s",n;case 2:return n.left="10%",n;case 3:return n.right="2.5%",n.animationDelay="0.5s",n;case 4:return n.left="2.5%",n.animationDelay="1.5s",n;case 5:return n.right="10%",n;case 6:return n.left="12.5%",n.animationDelay="1.5s",n;case 7:return n.right="7.5%",n.animationDelay="0.5s",n;case 8:return n.left="5%",n.animationDelay="1s",n;case 9:return n.right="2.5%",n.animationDelay="1s",n;default:return n.left="10%",n.animationDelay="1.5s",n}}(e):"50%"===t?function(e){var t=e%10,n={top:"".concat(4*e,"%")};switch(t){case 0:return n.left="25%",n.animationDelay="0.5s",n;case 1:return n.right="15%",n.animationDelay="1s",n;case 2:return n.left="20%",n;case 3:return n.right="5%",n.animationDelay="0.5s",n;case 4:return n.left="5%",n.animationDelay="1.5s",n;case 5:return n.right="20%",n;case 6:return n.left="25%",n.animationDelay="1.5s",n;case 7:return n.right="15%",n.animationDelay="0.5s",n;case 8:return n.left="10%",n.animationDelay="1s",n;case 9:return n.right="5%",n.animationDelay="1s",n;default:return n.left="20%",n.animationDelay="1.5s",n}}(e):function(e){var t=e%10,n={top:"".concat(4*e,"%")};switch(t){case 0:return n.left="25%",n.animationDelay="0.5s",n;case 1:return n.right="30%",n.animationDelay="1s",n;case 2:return n.left="40%",n;case 3:return n.right="10%",n.animationDelay="0.5s",n;case 4:return n.left="10%",n.animationDelay="1.5s",n;case 5:return n.right="40%",n;case 6:return n.left="30%",n.animationDelay="1.5s",n;case 7:return n.right="30%",n.animationDelay="0.5s",n;case 8:return n.left="10%",n.animationDelay="1s",n;case 9:return n.right="10%",n.animationDelay="1s",n;default:return n.left="40%",n.animationDelay="1.5s",n}}(e)}var u=r.memo((function(e){var t=a.m.shuffle(o.e.Onboarding.LOADING_THUMBNAILS),n=(0,c.k)();return r.createElement("div",{className:"".concat("n2Qe4"," ").concat("50%"===e.screenSize?"w-50":"w-100")},t.map((function(t,a){return r.createElement("div",{key:a,className:"".concat("ZlA2t"," position-absolute rounded-3 overflow-hidden"),style:s(a,n.xs?"mobile":e.screenSize)},!e.hideThumbnailMask&&r.createElement("div",{className:"".concat("jNop3"," ").concat("blue"===e.variant?"jVOWE":"YNfFq")}),r.createElement("img",{className:"img-fluid",src:l.j.createUrl(t,{size:i.h2.Small})}))})))}))},2248:(e,t,n)=>{n.d(t,{L:()=>v});var r=n(32735),a=n(60376),o=n(83914),i=n(2786),c=n(83345),l=n(72639),s=n(79967),u=n(35223),d=n(10144);const m={dot:"AlRQD",logo:"L42gR",blackBar:"ESCxm",topNav:"a3G_4",leftNav:"YxGVV",belowHeader:"jc_cg",leftNavIcon:"U6i6r",leftNavText:"LnYlW",presentationPlaceholderIcon:"Ljaju",presentationIcon:"QdwPq",presentationPlaceholderText:"af06V",curriculumIcon:"N7T4T",curriculumIconSmall:"_6xrUg",curriculumContainer:"Z65qX",iconPlaceholder:"CKOXL",shadow:"zygeJ",presentationName:"Oj7Dt"};var f="onboarding.mockLayout";function h(){return r.createElement("div",{className:"d-flex align-items-center justify-content-center mb-2 px-3"},r.createElement("div",{className:"".concat(m.leftNavIcon," rounded-circle")}),r.createElement("div",{className:"".concat(m.leftNavText," rounded-pill")}))}function v(e){var t,n,v=(0,s.k)();return r.createElement("div",{className:"border border-dark border-2 bg-white rounded-3 user-select-none overflow-hidden position-relative h-100 w-100"},!!e.editingCurriculum&&r.createElement("div",{className:"w-100 h-100 position-absolute ".concat(m.shadow)},r.createElement("div",{className:"d-flex align-items-center h-100 w-50 ".concat(m.curriculumContainer)},r.createElement("div",{className:"bg-white rounded-3 border p-3 w-100"},r.createElement("h2",{className:"h6 text-start"},r.createElement(c.x,{namespace:f,phrase:"curriculum"})),e.curriculum?r.createElement("div",{className:"d-flex align-items-center"},r.createElement("div",{className:"".concat(m.curriculumIcon," rounded-circle me-2 border")},r.createElement(a.f,{imageUrl:null===(t=e.curriculum.cover)||void 0===t?void 0:t.url})),r.createElement("div",{className:"text-start"},e.curriculum.name)):r.createElement("div",{className:"d-flex align-items-center text-muted"},r.createElement("div",{className:"me-2 rounded-circle p-1 ".concat(m.iconPlaceholder)},r.createElement(a.f,{svgSize:o.S.Large,textVariant:"secondary",svgName:u.vn.GraduationCap})),r.createElement(c.x,{namespace:f,phrase:"selectCurriculum"}))))),r.createElement("div",{className:"bg-dark d-flex px-3 py-2 ".concat(m.blackBar)},r.createElement("div",{className:"rounded-circle me-2 ".concat(m.dot)}),r.createElement("div",{className:"rounded-circle me-2 ".concat(m.dot)}),r.createElement("div",{className:"rounded-circle ".concat(m.dot)})),r.createElement("div",{className:"border-bottom px-3 py-2 d-flex align-items-center ".concat(m.topNav)},r.createElement("div",{className:"".concat(m.logo," me-4")},v.xs?r.createElement(i.bc,null):r.createElement(i.$S,null)),r.createElement("div",{className:"form-control w-75 d-flex justify-content-start"},r.createElement(o.x,{svgName:u.vn.Search})),!!e.curriculum&&r.createElement("div",{className:"".concat(m.curriculumIconSmall," rounded-circle ms-2 me-n1 border")},r.createElement(a.f,{imageUrl:null===(n=e.curriculum.cover)||void 0===n?void 0:n.url}))),r.createElement("div",{className:"d-flex ".concat(m.belowHeader)},r.createElement("div",{className:"".concat(m.leftNav," border-end")},r.createElement("div",{className:"d-flex flex-column pt-3 h-100"},r.createElement(h,null),r.createElement(h,null),r.createElement(h,null),r.createElement(h,null),r.createElement(h,null),r.createElement("div",{className:"d-flex align-items-end h-100 w-100"},r.createElement("div",{className:"border-top p-3 w-100"},r.createElement("div",{className:"d-flex align-items-center"},r.createElement("div",{className:"".concat(function(){if(!e.presentation)return m.presentationPlaceholderIcon;switch(d.i.getMappedPresentationLevel(e.presentation.learningLevel)){case l.p.Level_1:return"bg-indigo ".concat(m.presentationIcon);case l.p.Level_3:return"bg-blue ".concat(m.presentationIcon);default:case l.p.Level_2:return"bg-green ".concat(m.presentationIcon)}}()," text-white rounded")},r.createElement(o.x,{svgName:u.vn.School,size:o.S.Large})),e.presentation?r.createElement("span",{className:"fw-semibold text-truncate ".concat(m.presentationName)},e.presentation.name):r.createElement("div",{className:"".concat(m.presentationPlaceholderText," fw-semibold")},r.createElement(c.x,{namespace:f,phrase:"schoolLevel"}))))))),r.createElement("div",{className:"w-100 h-100 overflow-hidden"},e.children)))}},62007:(e,t,n)=>{n.d(t,{u:()=>u});var r=n(32735),a=n(5465),o=n(5438),i=n(54610),c=n(2248);const l={banner:"CQxNy",title:"NzV5V",description1:"kjCZi",description2:"cBeyJ",placeholder:"Ks_Tl",playlistName:"eFPqz",thumbnailCol:"dgCQ7",videoInfoCol:"pzfE2"};function s(e){return r.createElement("li",{className:"row mb-2"},r.createElement("div",{className:"col-lg-4 col-5 ".concat(l.thumbnailCol)},e.video?r.createElement(o.u,{video:e.video,type:"cosmetic",hideDuration:!0,imageOptions:{size:i.h2.Small}}):r.createElement(a.oy,{type:a.mS.Video,extraClasses:"position-relative rounded-3 ".concat(l.placeholder)})),r.createElement("div",{className:"col-lg-8 col-7 ".concat(l.videoInfoCol)},r.createElement("div",{className:"".concat(l.title," rounded-pill bg-grey mb-1")}),r.createElement("div",{className:"".concat(l.description1," rounded-pill bg-grey mb-1")}),r.createElement("div",{className:"".concat(l.description2," rounded-pill bg-grey mb-1")})))}function u(e){var t,n,a,o=e.hidePlaceholders?0:Math.max(6-(null!==(n=null===(t=e.videos)||void 0===t?void 0:t.length)&&void 0!==n?n:0),0);return r.createElement(c.L,{presentation:e.presentation,curriculum:e.curriculum},r.createElement("div",{className:"bg-teal ".concat(l.banner," position-relative")},e.name&&r.createElement("div",{className:"h5 text-white mb-0 ".concat(l.playlistName)},e.name)),r.createElement("ul",{className:"list-unstyled mb-0 w-100 p-2"},null===(a=e.videos)||void 0===a?void 0:a.map((function(e){return r.createElement(s,{key:e.id,video:e})})),new Array(o).fill(0).map((function(e,t){return r.createElement(s,{key:t})}))))}},14495:(e,t,n)=>{n.r(t),n.d(t,{OnboardingSelectVideosView:()=>X});var r=n(32735),a=n(57900),o=n(2948),i=n(20354),c=n(65858),l=n(83345),s=n(89454),u=n(79967),d=n(99742),m=n(86702),f=n(82817),h=n(86698),v=n(89682),p=n(11607),y=n(5438),g=n(54610),b=n(80143);const E={selected:"ZG5MR"};function N(e){var t,n=(0,b.n)(null===(t=e.video.subjectPresentationAudiences)||void 0===t?void 0:t.data,e.audiences);return r.createElement(p.L,{onClick:function(){return e.onSelectVideo(e.video)}},r.createElement(y.u,{type:"cosmetic",video:e.video,imageOptions:{size:g.h2.Medium},audience:n,checkMarkStatus:e.isSelected?v.h.Complete:v.h.Incomplete,setCheckMarkStatus:function(){return e.onSelectVideo(e.video),Promise.resolve()},extraClasses:"border border-2 rounded-3 overflow-hidden ".concat(e.isSelected?"border-success":"border-transparent"),imageClassName:e.isSelected?"".concat(E.selected):"",hideDuration:!0}))}function S(e){return r.createElement("ul",{className:"list-unstyled"},e.classificationVideosGrouping.map((function(t){return r.createElement("li",{key:t.classificationId,className:"pb-3"},r.createElement("h2",{className:"h6"},t.classificationName),r.createElement("ul",{className:"row list-unstyled g-2"},t.videos.map((function(n){return r.createElement("li",{key:n.id,className:"col-sm-6 col-md-4 col-lg-6 col-xl-6"},r.createElement(N,{video:n,onSelectVideo:function(n){return e.onSelectVideo(n,t.classificationId,t.classificationName)},audiences:e.audiences,isSelected:e.isSelected(n.id)}))}))))})))}var w=n(75359),A=n(12058),x=n(40695),L=n(75919),I=n(63478),j=n(24250),k=n(62007),O=n(75896),P=n(60736),C=n(49602),D=n(61699),_=n(1575),T=n(37802);function R(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,a,o,i,c=[],l=!0,s=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=o.call(n)).done)&&(c.push(r.value),c.length!==t);l=!0);}catch(e){s=!0,a=e}finally{try{if(!l&&null!=n.return&&(i=n.return(),Object(i)!==i))return}finally{if(s)throw a}}return c}}(e,t)||M(e,t)||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.")}()}function M(e,t){if(e){if("string"==typeof e)return V(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?V(e,t):void 0}}function V(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var B=n(73190),U=n(90815);const G={loaderText:"pg4Oj"};function z(e){return z="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},z(e)}function F(){F=function(){return t};var e,t={},n=Object.prototype,r=n.hasOwnProperty,a=Object.defineProperty||function(e,t,n){e[t]=n.value},o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",c=o.asyncIterator||"@@asyncIterator",l=o.toStringTag||"@@toStringTag";function s(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{s({},"")}catch(e){s=function(e,t,n){return e[t]=n}}function u(e,t,n,r){var o=t&&t.prototype instanceof y?t:y,i=Object.create(o.prototype),c=new O(r||[]);return a(i,"_invoke",{value:L(e,n,c)}),i}function d(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}t.wrap=u;var m="suspendedStart",f="suspendedYield",h="executing",v="completed",p={};function y(){}function g(){}function b(){}var E={};s(E,i,(function(){return this}));var N=Object.getPrototypeOf,S=N&&N(N(P([])));S&&S!==n&&r.call(S,i)&&(E=S);var w=b.prototype=y.prototype=Object.create(E);function A(e){["next","throw","return"].forEach((function(t){s(e,t,(function(e){return this._invoke(t,e)}))}))}function x(e,t){function n(a,o,i,c){var l=d(e[a],e,o);if("throw"!==l.type){var s=l.arg,u=s.value;return u&&"object"==z(u)&&r.call(u,"__await")?t.resolve(u.__await).then((function(e){n("next",e,i,c)}),(function(e){n("throw",e,i,c)})):t.resolve(u).then((function(e){s.value=e,i(s)}),(function(e){return n("throw",e,i,c)}))}c(l.arg)}var o;a(this,"_invoke",{value:function(e,r){function a(){return new t((function(t,a){n(e,r,t,a)}))}return o=o?o.then(a,a):a()}})}function L(t,n,r){var a=m;return function(o,i){if(a===h)throw new Error("Generator is already running");if(a===v){if("throw"===o)throw i;return{value:e,done:!0}}for(r.method=o,r.arg=i;;){var c=r.delegate;if(c){var l=I(c,r);if(l){if(l===p)continue;return l}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(a===m)throw a=v,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);a=h;var s=d(t,n,r);if("normal"===s.type){if(a=r.done?v:f,s.arg===p)continue;return{value:s.arg,done:r.done}}"throw"===s.type&&(a=v,r.method="throw",r.arg=s.arg)}}}function I(t,n){var r=n.method,a=t.iterator[r];if(a===e)return n.delegate=null,"throw"===r&&t.iterator.return&&(n.method="return",n.arg=e,I(t,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),p;var o=d(a,t.iterator,n.arg);if("throw"===o.type)return n.method="throw",n.arg=o.arg,n.delegate=null,p;var i=o.arg;return i?i.done?(n[t.resultName]=i.value,n.next=t.nextLoc,"return"!==n.method&&(n.method="next",n.arg=e),n.delegate=null,p):i:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,p)}function j(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function k(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function O(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(j,this),this.reset(!0)}function P(t){if(t||""===t){var n=t[i];if(n)return n.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var a=-1,o=function n(){for(;++a<t.length;)if(r.call(t,a))return n.value=t[a],n.done=!1,n;return n.value=e,n.done=!0,n};return o.next=o}}throw new TypeError(z(t)+" is not iterable")}return g.prototype=b,a(w,"constructor",{value:b,configurable:!0}),a(b,"constructor",{value:g,configurable:!0}),g.displayName=s(b,l,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===g||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,b):(e.__proto__=b,s(e,l,"GeneratorFunction")),e.prototype=Object.create(w),e},t.awrap=function(e){return{__await:e}},A(x.prototype),s(x.prototype,c,(function(){return this})),t.AsyncIterator=x,t.async=function(e,n,r,a,o){void 0===o&&(o=Promise);var i=new x(u(e,n,r,a),o);return t.isGeneratorFunction(n)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},A(w),s(w,l,"Generator"),s(w,i,(function(){return this})),s(w,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),n=[];for(var r in t)n.push(r);return n.reverse(),function e(){for(;n.length;){var r=n.pop();if(r in t)return e.value=r,e.done=!1,e}return e.done=!0,e}},t.values=P,O.prototype={constructor:O,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(k),!t)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var n=this;function a(r,a){return c.type="throw",c.arg=t,n.next=r,a&&(n.method="next",n.arg=e),!!a}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],c=i.completion;if("root"===i.tryLoc)return a("end");if(i.tryLoc<=this.prev){var l=r.call(i,"catchLoc"),s=r.call(i,"finallyLoc");if(l&&s){if(this.prev<i.catchLoc)return a(i.catchLoc,!0);if(this.prev<i.finallyLoc)return a(i.finallyLoc)}else if(l){if(this.prev<i.catchLoc)return a(i.catchLoc,!0)}else{if(!s)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return a(i.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var a=this.tryEntries[n];if(a.tryLoc<=this.prev&&r.call(a,"finallyLoc")&&this.prev<a.finallyLoc){var o=a;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=e,i.arg=t,o?(this.method="next",this.next=o.finallyLoc,p):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),p},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),k(n),p}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var a=r.arg;k(n)}return a}}throw new Error("illegal catch attempt")},delegateYield:function(t,n,r){return this.delegate={iterator:P(t),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=e),p}},t}function Y(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,a,o,i,c=[],l=!0,s=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=o.call(n)).done)&&(c.push(r.value),c.length!==t);l=!0);}catch(e){s=!0,a=e}finally{try{if(!l&&null!=n.return&&(i=n.return(),Object(i)!==i))return}finally{if(s)throw a}}return c}}(e,t)||H(e,t)||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.")}()}function H(e,t){if(e){if("string"==typeof e)return K(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?K(e,t):void 0}}function K(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var W=function(e,t,n,r){return new(n||(n=Promise))((function(a,o){function i(e){try{l(r.next(e))}catch(e){o(e)}}function c(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?a(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(i,c)}l((r=r.apply(e,t||[])).next())}))},Q=6e3,Z=3,q="onboarding.selectVideos";function X(){var e=(0,B.Q)(),t=e.onClickBack,n=e.exitOnboarding,v=e.completeStepAsync,p=e.onSaveError,y=(0,U.H)().logEvent,g=Y((0,o.D)(m.y.ONBOARDING_VIDEOS_V2,[],{storage:a.Z1.LocalStorage}),2),b=g[0],E=g[1],N=i.a.useBasicFetch(s.O.presentationAudiences()),z=(0,h.y)().preferredPresentation,X=(0,f.M)().activeCurriculum,$=function(){var e,t,n=(0,h.y)().preferredPresentation,r=(0,T.r)(null),a=r.bulkOnboardingPreferencesState,o=r.isLoadingSettings,c=i.a.useBasicFetch(D.o.mySubjectPreferences()),l=P.A[n.id]||{},s=Object.entries(l).reduce((function(e,t){var n=R(t,2),r=n[0],a=n[1].name;return e[r]=a,e}),{}),u=C.b.hasBulkSelectedTopics(a)?l:null!==(t=null===(e=c.data)||void 0===e?void 0:e.reduce((function(e,t){return l[t.id]?(e[t.id]=l[t.id],e):e}),{}))&&void 0!==t?t:{},d=[],m={};Object.entries(u).forEach((function(e){var t,n=R(e,2),r=n[0],a=n[1];d.push.apply(d,function(e){if(Array.isArray(e))return V(e)}(t=a.videoIds)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(t)||M(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.")}()),a.videoIds.forEach((function(e){m[e]||(m[e]=[]),m[e].push(r)}))}));var f=i.a.useBasicFetchAll(O.m.chunk(O.m.uniq(d),25).map((function(e){return _.R.videos(e)}))),v=O.m.flatten(f.data||[]),p={};return null==v||v.forEach((function(e){m[e.id].forEach((function(t){p[t]||(p[t]={classificationId:t,classificationName:s[t],videos:[]}),p[t].videos.push(e)}))})),{hasCompleted:c.hasCompleted&&f.hasCompleted&&!o,data:Object.values(p)}}(),J=Y(r.useState($.hasCompleted),2),ee=J[0],te=J[1],ne=(0,u.k)(),re=ne.lg||ne.xl||ne.xxl;r.useEffect((function(){var e=window.setTimeout((function(){te(!0)}),Q);return function(){window.clearTimeout(e)}}),[]);var ae=$.hasCompleted&&N.hasCompleted,oe=!ee||!ae,ie=oe?{hasCustomButtons:!0}:{hasCustomButtons:!1,onClickNext:function(){return W(this,void 0,void 0,F().mark((function e(){return F().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return y(c.Vw.Click,c.Ix.Next,{videos:b.map((function(e){var t;return{id:e.data.id,name:e.data.name,thumbnailUrl:null===(t=e.data.thumbnail)||void 0===t?void 0:t.url,videoSubjectId:e.classificationId,videoSubjectName:e.classificationName}})),presentationId:z.id,presentationName:z.name,presentationDescription:z.description}),e.prev=1,e.next=4,v();case 4:e.next=10;break;case 6:return e.prev=6,e.t0=e.catch(1),p(),e.abrupt("return",Promise.reject());case 10:case"end":return e.stop()}}),e,null,[[1,6]])})))},onClickBack:t,onClickComeBackLater:n,disableNext:b.length<Z};return oe&&!re?r.createElement(I.B,{variant:"dark-blue"},r.createElement("div",{className:"w-100 d-flex align-items-center px-4 text-center flex-column text-white ".concat(G.loaderText)},r.createElement("h1",{className:"h3 mb-4"},r.createElement(l.x,{namespace:q,phrase:"loadingHeading"})),r.createElement("p",{className:"h6"},r.createElement(l.x,{namespace:q,phrase:"searching"}))),r.createElement(j.R,{variant:"dark-blue",screenSize:"100%",hideThumbnailMask:!0})):r.createElement(x.z,{namespace:q},r.createElement(x.z.Left,{className:"bg-dark-blue d-flex flex-column align-items-end justify-content-center"},oe?r.createElement(j.R,{variant:"dark-blue",screenSize:"50%"}):r.createElement(L.N,{contentPosition:"right",annotationUrl:b.length>=Z?d.W.OnboardingV2.SelectVideos.LOOKING_GOOD:d.W.OnboardingV2.SelectVideos.BEFORE_SELECTION,annotationPosition:b.length>=Z?"bottom-left":"top-left"},r.createElement(k.u,{presentation:z,curriculum:X,videos:b.map((function(e){return e.data}))}))),r.createElement(x.z.Right,Object.assign({},ie),oe?r.createElement(r.Fragment,null,r.createElement(w.W,null,r.createElement(l.x,{phrase:"loadingHeading"})),r.createElement("p",null,r.createElement(l.x,{phrase:"searching"}))):r.createElement(r.Fragment,null,r.createElement(w.W,null,r.createElement(l.x,{phrase:"heading"})),r.createElement(A.X,null,r.createElement(l.x,{phrase:"info"})),r.createElement(S,{classificationVideosGrouping:$.data,onSelectVideo:function(e,t,n){var r;y(c.Vw.Select,c.Ix.SelectVideo,{videoId:e.id,videoName:e.name,videoSubjectId:t,videoSubjectName:n,presentationId:z.id,presentationName:z.name,presentationDescription:z.description}),b.some((function(t){return t.data.id.toString()===e.id.toString()}))?E(b.filter((function(t){return t.data.id.toString()!==e.id.toString()}))):E([].concat(function(e){if(Array.isArray(e))return K(e)}(r=b)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(r)||H(r)||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.")}(),[{data:e,classificationId:t,classificationName:n}]))},audiences:N.data,isSelected:function(e){return b.some((function(t){return t.data.id.toString()===e.toString()}))}}))))}}}]);
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunk_clickview_lite=self.webpackChunk_clickview_lite||[]).push([[3285],{94644:(e,t,a)=>{a.d(t,{r:()=>c});var n=a(50242),i=a(81886),r=a(67058),d=a(14553),o=a(49267),s=a(49075),u={notFound:r.d,forbidden:{rating:d.q,yearLevel:d.q,region:o.a,privacy:d.q},badRequest:s._};function c(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(e){var r;r="number"==typeof e?e:e.status;var d=Object.assign(Object.assign({},u),t);r&&i.Q.Ry.isStatusCodeError(r)&&(r!==n.o.NotFound?r!==n.o.Forbidden?a.badRequest||i.Q.Ry.throw(new d.badRequest):a.forbidden||i.Q.Ry.throw(new d.forbidden.privacy):a.notFound||i.Q.Ry.throw(new d.notFound))}}},91286:(e,t,a)=>{a.d(t,{v:()=>d});var n=a(32735),i=a(94644);function r(e){return e.map((function(e){return e.statusCode})).join(":")}function d(e,t,a){var d=Array.isArray(e)?e:[e];(0,n.useEffect)((function(){d.forEach((function(e){(0,i.r)(e.statusCode,t,a)}))}),[r(d),t,a])}},61995:(e,t,a)=>{a.d(t,{_:()=>d});var n=a(45593),i=a(21938),r=a(76867),d={notFound:i.W,forbidden:{rating:n.F,yearLevel:n.F,region:r.z,privacy:n.F},badRequest:r.z}},33285:(e,t,a)=>{a.r(t),a.d(t,{EmbeddedLcsVideoView:()=>C});var n=a(32735),i=a(81886),r=a(20354),d=a(60051),o=a(39151),s=a(47812),u=a(31949),c=a(1575),l=a(27995),v=a(91286),m=a(79612),f=a(14070),h=a(97291),p=a(49948),y=a(56017),b=a(33192),g=a(57245),F=a(45593),w=a(61995);function C(e){var t,a,C,q=r.a.useBasicFetch(u.N.currentUser()),E=r.a.useBasicFetch((null===(t=q.data)||void 0===t?void 0:t.isAuthenticated)&&c.R.video(e.id)),R=r.a.useBasicFetch(o.L.config()),k=r.a.useBasicFetch(s.k.createViewKey(e.id,d.f.MasterObject)),_=(0,p.l)((null===(a=q.data)||void 0===a?void 0:a.isAuthenticated)&&e.id);return(0,m.M)(y.C.getVideoMetadata({content:E.data,canonicalLink:b.f.getCanonicalLink({stripPresentationSlug:!0}),allowIndexing:!1})),(0,l.b)(E,{private:F.F}),(0,v.v)(E,w._),q.hasCompleted&&!q.data.isAuthenticated?(i.Q.C$.trigger({application:h.O.EMBED,action:f.e.Embed.LCS_LOGIN,args:[e.id],params:e.queryParams}),n.createElement(n.Fragment,null)):E.data&&q.hasCompleted&&R.hasCompleted&&k.hasCompleted&&_.hasCompleted?n.createElement(g._,{config:R.data,video:E.data,currentUser:q.data,viewKey:k.data,pointsOfInterest:_.items,embed:!0,showResources:!0,autoplay:"true"===e.queryParams.a,startTime:null!==(C=e.queryParams.t)&&void 0!==C?C:e.queryParams.startTime,endTime:e.queryParams.endTime}):n.createElement(n.Fragment,null)}}}]);
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunk_clickview_lite=self.webpackChunk_clickview_lite||[]).push([[3297],{92869:(e,t,a)=>{a.d(t,{t:()=>c});var n=a(48088),r=a(95846),c={preventScrollTop:function(){n.Radio.channel(r.G.SHELL).trigger("prevent:scroll:top")}}},75097:(e,t,a)=>{a.d(t,{U:()=>c});var n=a(32735),r=a(95245);function c(e){var t=e.count,a=void 0===t?6:t;return n.createElement("div",{className:"d-flex"},n.createElement("div",{className:"d-flex ps-1"},Array(a).fill(null).map((function(e,t){return n.createElement("div",{key:t,className:"".concat(r.Z.partialButton," partial-loading-background mx-1")})}))))}},49935:(e,t,a)=>{a.d(t,{Oo:()=>m,b2:()=>d});var n=a(32735),r=a(36848),c=a(86764),l=a(3747),o=a(5859),i=a(35223),s=a(83914),u=function(e){var t=e.breadcrumb,a=t.name,c=t.appLink,l=t.active,o=e.withBackIcon;return n.createElement("li",{className:"breadcrumb-item".concat(l?" active":"")},l?n.createElement("strong",null,a):n.createElement(r.F,{appLink:c},o&&n.createElement(s.x,{svgName:i.vn.ChevronLeft,size:s.S.Small}),n.createElement("span",{className:o?"ms-2":""},a)))},m=function(e){var t=e.breadcrumbs,a=(0,l.a)(c.r.XS),r=null==t?void 0:t.length;return!r||a&&r<2?n.createElement(n.Fragment,null):a?n.createElement("nav",{"aria-label":"breadcrumb"},n.createElement("ol",{className:"breadcrumb m-0 p-0"},n.createElement(u,{breadcrumb:t[r-2],withBackIcon:!0}))):n.createElement("nav",{"aria-label":"breadcrumb"},n.createElement("ol",{className:"breadcrumb m-0 p-0"},t.map((function(e,t){return n.createElement(u,{key:t,breadcrumb:e})}))))},d=n.memo((function(e){var t=e.numItems,a=void 0===t?3:t;return(0,l.a)(c.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:a}).map((function(e,t){var a=e.width;return n.createElement("li",{key:t,className:"breadcrumb-item"},n.createElement("span",{className:"d-inline-block partial-loading-background",style:{width:a},dangerouslySetInnerHTML:{__html:"&nbsp"}}))}))))}))},37395:(e,t,a)=>{a.d(t,{t:()=>m});var n=a(32735),r=a(98269),c=a(92869),l=a(49985),o=a(65858),i=a(36848),s=a(83345);function u(e,t,a){var n;if(!t)return null;var r=null!==(n=e.params)&&void 0!==n?n:{};return a?(null==r?void 0:r.previous)?{application:e.application,action:e.action,args:e.args,params:Object.assign(Object.assign({},r),{cursor:null==r?void 0:r.previous,previous:null})}:{application:e.application,action:e.action,args:e.args,params:Object.assign(Object.assign({},r),{cursor:null,previous:null})}:{application:e.application,action:e.action,args:e.args,params:Object.assign(Object.assign({},r),{cursor:t,previous:r.cursor})}}function m(e){var t=e.appLink,a=e.cursors,m=e.className,d=e.buttonVariant,p=e.prevHack,g=e.onClick;function v(e){t&&c.t.preventScrollTop(),l.k.logUserAction({page:e},{location:o.LZ.Pagination,entity:o.py.Pagination,actionType:o.Vw.Navigate}),g&&g(a[e])}return t?n.createElement(s.D.Provider,{value:"shared.pagination"},n.createElement("div",{className:m},n.createElement(i.F,{appLink:u(t,a.previous,p),className:"btn btn-".concat(d," me-1 ").concat(a.previous?"":"disabled"),onClick:function(){return v("previous")}},n.createElement(s.x,{phrase:"previous"})),n.createElement(i.F,{appLink:u(t,a.next),className:"btn btn-".concat(d," ").concat(a.next?"":"disabled"),onClick:function(){return v("next")}},n.createElement(s.x,{phrase:"next"})))):n.createElement(s.D.Provider,{value:"shared.pagination"},n.createElement("div",{className:m},n.createElement(r.Z,{variant:d,className:"me-1 ".concat(a.previous?"":"disabled"),onClick:function(){return v("previous")}},n.createElement(s.x,{phrase:"previous"})),n.createElement(r.Z,{variant:d,className:"btn ".concat(a.next?"":"disabled"),onClick:function(){return v("next")}},n.createElement(s.x,{phrase:"next"}))))}m.defaultProps={className:"py-2",buttonVariant:"secondary"}},16035:(e,t,a)=>{a.d(t,{z:()=>o});var n=a(32735),r=a(36848),c=a(44829),l=a(91807);function o(e){var t,a,o=e.tag,i=e.appLink,s=e.onClick,u=e.disabled,m=e.tagClass,d=void 0===m?"tag":m,p=o.name.toLowerCase(),g=null===(t=o.tagType)||void 0===t?void 0:t.toLowerCase(),v="rounded-pill py-1 px-2 my-1 me-1 ".concat(d," ").concat(function(e){switch(e){case c.Q.Pedagogy:case c.Q.Skill:return"pedagogy-tag text-white";case c.Q.Hidden:return"hidden-tag";case c.Q.Normal:default:return""}}(g)),b=g===c.Q.Normal&&!!(null===(a=e.themeColours)||void 0===a?void 0:a.secondary);b&&(v+=" text-white"),!i&&!s||u||(v+=" cursor-pointer"),u&&(v+=" "+l.Z.disabled),e.onRemove&&(v+=" "+l.Z.badge),i||(v+=" d-inline-block");var f=b?{backgroundColor:e.themeColours.secondary}:{};return i?n.createElement(r.F,{onClick:s,appLink:i,className:v,title:p,style:f},n.createElement("span",{className:"text-truncate text-nowrap"},p)):n.createElement("span",{onClick:s,className:v,title:p,style:f},n.createElement("span",{className:"text-truncate text-nowrap"},p,e.onRemove&&n.createElement("button",{onClick:e.onRemove,className:"".concat(l.Z.close," btn-close font-size-normal"),role:"button","aria-label":"Close"})))}},81514:(e,t,a)=>{a.d(t,{V:()=>c});var n=a(86764),r=a(3747);function c(){var e=(0,r.a)(n.r.XS),t=(0,r.a)(n.r.SM),a=(0,r.a)(n.r.MD),c=(0,r.a)(n.r.LG),l=(0,r.a)(n.r.XL),o=(0,r.a)(n.r.XXL),i=n.r.LG;return e&&(i=n.r.XS),t&&(i=n.r.SM),a&&(i=n.r.MD),c&&(i=n.r.LG),l&&(i=n.r.XL),o&&(i=n.r.XXL),i}},91286:(e,t,a)=>{a.d(t,{v:()=>l});var n=a(32735),r=a(94644);function c(e){return e.map((function(e){return e.statusCode})).join(":")}function l(e,t,a){var l=Array.isArray(e)?e:[e];(0,n.useEffect)((function(){l.forEach((function(e){(0,r.r)(e.statusCode,t,a)}))}),[c(l),t,a])}},299:(e,t,a)=>{a.d(t,{X:()=>l});var n=a(32735),r=a(69217),c=a(94631),l=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},a=t.idField,l=void 0===a?"id":a,o=t.persistNamespace,i=t.initialState?t.initialState:new Map,s=n.useRef(i),u=(0,r.N)(),m=(0,c.D)(e),d=(0,c.D)(o);function p(){s.current.clear(),u()}function g(e){return"number"==typeof e?e=e.toString():"string"!=typeof e&&(e=e[l].toString()),s.current.get(e)}function v(){return!!(null==e?void 0:e.length)&&e.every(g)}function b(e){e.forEach((function(e){s.current.set(e,!0)})),u()}return n.useEffect((function(){t.initialState||o&&d===o||(null==m?void 0:m.map((function(e){return e[l]})).join())!==(null==e?void 0:e.map((function(e){return e[l]})).join())&&p()}),[m,d,e,t.initialState]),n.useEffect((function(){var e;(null===(e=t.preselectedIds)||void 0===e?void 0:e.length)&&b(t.preselectedIds)}),[]),{onToggleBulk:function(){var t=!v();e.forEach((function(e){t?s.current.set(e[l].toString(),!0):s.current.delete(e[l].toString())})),u()},onToggleItem:function(e){var t=!s.current.get(e.toString());t?s.current.set(e.toString(),t):s.current.delete(e.toString()),u()},getSelected:function(){return Array.from(s.current.keys())},isChecked:g,bulkChecked:v(),deselectAll:function(){(null==e?void 0:e.length)&&(e.forEach((function(e){s.current.delete(e[l].toString())})),u())},hasSomeSelections:function(){return!!(null==e?void 0:e.length)&&!!e.find((function(e){return g(e)}))},setSelected:b,getSelectedCount:function(){return s.current.size},reset:p,getMap:function(){return s.current}}}},94631:(e,t,a)=>{a.d(t,{D:()=>r});var n=a(32735);function r(e){var t=n.useRef();return n.useEffect((function(){t.current=e})),t.current}},58418:(e,t,a)=>{a.r(t),a.d(t,{UserAuditLogView:()=>te});var n=a(32735),r=a(23481),c=a(57900),l=a(20354),o=a(75097),i=a(49935);const s={partialHeading:"rfiJl",partialJobCount:"h8k_u",partialCheckbox:"HkuOS",partialExportButton:"Iul7S",row:"mwigG",checkboxColumn:"Z5jLG",actionColumn:"rLxYh",usersColumn:"QZzab",dateColumn:"Wf_Jp",performedByColumn:"Ubtmj",seeMoreColumn:"XdP6u",heading:"kRMMH",action:"DvDvW",users:"goKpg",date:"ejYGb",performedBy:"NhjyL"};function u(){return n.createElement("div",{className:"d-flex striped-row rounded py-3 ".concat(s.row)},n.createElement("div",{className:"".concat(s.checkboxColumn," d-flex justify-content-center")},n.createElement("div",{className:"partial-loading-background ".concat(s.partialCheckbox," ms-0")})),n.createElement("div",{className:"".concat(s.actionColumn)},n.createElement("div",{className:"partial-loading-background ".concat(s.action)})),n.createElement("div",{className:"".concat(s.usersColumn)},n.createElement("div",{className:"partial-loading-background ".concat(s.users)})),n.createElement("div",{className:"".concat(s.dateColumn)},n.createElement("div",{className:"partial-loading-background ".concat(s.date)})),n.createElement("div",{className:"".concat(s.performedByColumn)},n.createElement("div",{className:"partial-loading-background ".concat(s.performedBy)})),n.createElement("div",{className:"".concat(s.seeMoreColumn)}," "))}function m(){return n.createElement("div",{className:"d-flex py-2 mb-1"},n.createElement("div",{className:"".concat(s.checkboxColumn)}," "),n.createElement("div",{className:"".concat(s.actionColumn)},n.createElement("div",{className:"partial-loading-background ".concat(s.heading)})),n.createElement("div",{className:"".concat(s.usersColumn)},n.createElement("div",{className:"partial-loading-background ".concat(s.heading)})),n.createElement("div",{className:"".concat(s.dateColumn)},n.createElement("div",{className:"partial-loading-background ".concat(s.heading)})),n.createElement("div",{className:"".concat(s.performedByColumn)},n.createElement("div",{className:"partial-loading-background ".concat(s.heading)})),n.createElement("div",{className:"".concat(s.seeMoreColumn)}," "))}function d(){return n.createElement(n.Fragment,null,n.createElement("div",{className:"mb-3 mt-n1"},n.createElement(m,null),n.createElement("div",{className:"striped-list no-full-width"},n.createElement(u,null),n.createElement(u,null),n.createElement(u,null),n.createElement(u,null),n.createElement(u,null),n.createElement(u,null),n.createElement(u,null),n.createElement(u,null),n.createElement(u,null),n.createElement(u,null),n.createElement(u,null),n.createElement(u,null))))}function p(){return n.createElement(n.Fragment,null,n.createElement("div",{className:"partial-loading-background mb-2 ".concat(s.partialHeading)}),n.createElement("div",{className:"pb-3"},n.createElement("div",{className:"d-flex justify-content-between"},n.createElement(i.b2,null),n.createElement("div",{className:"partial-loading-background ".concat(s.partialJobCount)}))),n.createElement("div",{className:"d-flex align-items-center pb-2"},n.createElement("div",{className:"partial-loading-background ".concat(s.partialCheckbox)}),n.createElement("div",{className:"ms-4 ps-3"},n.createElement(o.U,{count:3})),n.createElement("div",{className:"ms-auto partial-loading-background ".concat(s.partialExportButton)})),n.createElement(d,null))}var g=a(89422),v=a(89965),b=a(37395),f=a(2102),E=a(83345),y=a(76881),h=a(69883),k=a(299),N=a(75795),C=a(65858),w=a(83818),x=a(94605),S="userManager.userAuditLogFilters";function j(e){var t=[x.x$.SortBy([{id:"newest",name:r.T.getPhrase(S,"newest"),default:!0},{id:"oldest",name:r.T.getPhrase(S,"oldest")}]),x.x$.BulkActionType(),x.x$.UserType()];return n.createElement(w.J,{queryParams:e.queryParams,mainFilters:t,appLink:e.appLinks.auditLog,analyticsOptions:{entity:C.py.BatchJob,location:C.LZ.UserAuditLog},hideHeading:!0,hideDivider:!0,constantIndices:[]})}var L=a(69674),T=a(110),A=a(149),M=a(36848),O=a(89725),B=a(83914),I=a(86794);const P={seeMore:"uymuO"};function R(e,t){(null==t||t>e.length)&&(t=e.length);for(var a=0,n=new Array(t);a<t;a++)n[a]=e[a];return n}var U="userManager.userAuditLogTable",F=r.T.encloseNamespace(U),J={table:"striped-list no-full-width pb-3",header:"fw-semibold pb-1",headerCell:"px-2 py-1",row:"striped-row rounded audit-log-row",cell:"d-flex align-items-center py-3 px-2"};function _(e){var t,a,r,c,l=(t=e.jobs.data,a=e.isChecked,t.map((function(e){var t=T.O.format(e.dateCreated,"DD/MM/YYYY, hh:mmA");return{id:e.id,checked:a(e.id),actionType:A.b.mapJobTypeToName(e.type),userType:A.b.mapDataTypeToUserType(e.dataType),date:t,performedBy:{name:e.submitterName,submittedByClickView:e.submittedByClickView}}})));return n.createElement(L.i,{columns:(r=e.appLinks.bulkActionSummary,c=e.onToggleCheckbox,[{Header:"",id:"checkboxes",accessor:function(e){return{id:e.id,checked:e.checked}},Cell:function(e){return n.createElement("div",{className:"text-center mx-auto"},n.createElement(v.X,{id:e.value.id,checked:e.value.checked,onChange:function(){return c(e.value.id)}}))},width:10},{Header:F("action"),accessor:"actionType",id:"actionType",Cell:function(e){var t=e.value;return n.createElement("div",{className:"w-100"},t)},width:20},{Header:F("users"),accessor:"userType",id:"userType",Cell:function(e){var t=e.value;return n.createElement("div",{className:"w-100"},function(){switch(t){case y.Y.Learner:return F("students");case y.Y.Staff:return F("staff");case y.Y.Unknown:default:return F("unknown")}}())},width:10},{Header:F("date"),accessor:"date",id:"date",Cell:function(e){var t=e.value;return n.createElement("div",{className:"w-100"},t)},width:20},{Header:F("performedBy"),accessor:"performedBy",id:"performedBy",Cell:function(e){return n.createElement("div",{className:"w-100 d-flex align-items-center"},e.value.submittedByClickView&&n.createElement(I.b,{className:"me-1",size:B.S.Small},n.createElement(O.F,null)),e.value.name)},width:20},{Header:"",accessor:"id",id:"seeMore",Cell:function(e){var t,a,c=e.value;return n.createElement("div",{className:"w-100 d-flex justify-content-end"},n.createElement(M.F,{className:"info-link text-end me-3 ms-auto ".concat(P.seeMore),appLink:Object.assign(Object.assign({},r),{args:(null===(t=r.args)||void 0===t?void 0:t.length)?[].concat((a=r.args,function(e){if(Array.isArray(e))return R(e)}(a)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(a)||function(e,t){if(e){if("string"==typeof e)return R(e,t);var a=Object.prototype.toString.call(e).slice(8,-1);return"Object"===a&&e.constructor&&(a=e.constructor.name),"Map"===a||"Set"===a?Array.from(e):"Arguments"===a||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a)?R(e,t):void 0}}(a)||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.")}()),[c]):[c]})},n.createElement(E.x,{namespace:U,phrase:"seeMore"})))},width:30}]),data:l,theme:J})}var D=a(23232),H="userManager.auditLogEmptyState";function X(e){return n.createElement(D.u,null,n.createElement(D.u.Image,{src:e.imageUrl}),n.createElement(D.u.Heading,null,n.createElement(E.x,{namespace:H,phrase:"heading"})),n.createElement(D.u.Info,null,n.createElement(E.x,{namespace:H,phrase:"info"})))}const Y={bulkCheckbox:"NMw5T"};function G(e,t){(null==t||t>e.length)&&(t=e.length);for(var a=0,n=new Array(t);a<t;a++)n[a]=e[a];return n}var Z="userManager.auditLog",q=r.T.encloseNamespace(Z);function V(e){var t,a,r,l,o=c.SG.get(g.K.AUDIT_LOG_REFERRER_KEY),s=(r=n.useState(!1),l=2,function(e){if(Array.isArray(e))return e}(r)||function(e,t){var a=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=a){var n,r,c,l,o=[],i=!0,s=!1;try{if(c=(a=a.call(e)).next,0===t){if(Object(a)!==a)return;i=!1}else for(;!(i=(n=c.call(a)).done)&&(o.push(n.value),o.length!==t);i=!0);}catch(e){s=!0,r=e}finally{try{if(!i&&null!=a.return&&(l=a.return(),Object(l)!==l))return}finally{if(s)throw r}}return o}}(r,l)||function(e,t){if(e){if("string"==typeof e)return G(e,t);var a=Object.prototype.toString.call(e).slice(8,-1);return"Object"===a&&e.constructor&&(a=e.constructor.name),"Map"===a||"Set"===a?Array.from(e):"Arguments"===a||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a)?G(e,t):void 0}}(r,l)||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.")}()),u=s[0],m=s[1],d=(0,k.X)(e.jobs.data),p=(0,h.Z)();return n.createElement(n.Fragment,null,n.createElement("h1",{className:"h2"},n.createElement(E.x,{namespace:Z,phrase:"heading"})),n.createElement("div",{className:"pb-3"},n.createElement("div",{className:"d-flex justify-content-between"},n.createElement(i.Oo,{breadcrumbs:[{name:q("settingsBreadcrumb"),appLink:e.appLinks.settings},{name:q(o===y.Y.Learner?"studentManager":"staffManager"),appLink:e.appLinks.userManager},{name:q("heading"),active:!0}]}),n.createElement("p",{className:"mb-0 fw-semibold"},n.createElement(E.x,{namespace:Z,phrase:"totalJobs",options:{showing:e.jobs.data.length,smartCount:e.jobs.count}})))),n.createElement("div",{className:"d-flex align-items-center pb-2"},n.createElement(v.X,{className:Y.bulkCheckbox,id:"bulk-audit-log-checkbox",checked:d.bulkChecked,onChange:d.onToggleBulk,indeterminate:d.hasSomeSelections()}),n.createElement("div",{className:"ms-4 ps-1"},n.createElement(j,{queryParams:e.queryParams,appLinks:e.appLinks})),n.createElement(f.m,{variant:"dark",className:"ms-auto",onClick:function(){if(!u){m(!0);var t=d.getSelected();e.onClickExport(t).then((function(){return p.success(q("exportSuccess"))})).catch((function(){return p.error(q("exportError"))})).finally((function(){return m(!1)}))}},disabled:!d.hasSomeSelections()||u,showSpinner:u},n.createElement(E.x,{namespace:Z,phrase:"export"}))),(null===(t=e.jobs.data)||void 0===t?void 0:t.length)?n.createElement(_,{jobs:e.jobs,appLinks:e.appLinks,onToggleCheckbox:d.onToggleItem,isChecked:d.isChecked}):n.createElement(X,{imageUrl:e.emptyStateImageUrl}),!!(null===(a=e.jobs.pagination)||void 0===a?void 0:a.cursors)&&n.createElement(b.t,{className:"p-0 text-end pb-3",cursors:e.jobs.pagination.cursors,appLink:N.O.getCurrentRoute().appLink,buttonVariant:"outline-dark"}))}var z=a(91286),K=a(79612),Q=a(99742),$=a(29613),W=a(18087),ee="userManager.userAuditLogView";function te(e){var t=c.SG.get(g.K.AUDIT_LOG_REFERRER_KEY),a=l.a.useBasicFetch($.q.getJobs(e.queryParams));(0,z.v)(a),(0,K.M)({title:r.T.getPhrase(ee,"pageTitle")});var o=l.a.useGetFetchAsync(),i=(0,W.Y)(t);return a.hasCompleted?n.createElement("div",{className:"px-3"},n.createElement(V,{jobs:a.data,appLinks:i,queryParams:e.queryParams,onClickExport:function(e){return o($.q.sendJobReports(e))},emptyStateImageUrl:Q.W.EmptyStates.Search.RESULTS})):n.createElement("div",{className:"px-3"},n.createElement(p,null))}},29613:(e,t,a)=>{a.d(t,{q:()=>l});var n=a(99940),r=a(97395),c=a(149),l={createJob:function(e,t,a){return{url:"{gateway}/v1/batch/jobs",key:"create:job",type:n.k.POST,data:e,success:t,error:a}},getJobs:function(e){var t={},a=[],n=[];return e.cursor&&(t.cursor=e.cursor),e.sort&&("oldest"===e.sort?t.order="ASC":t.order="DESC"),e.bulkActionType?(a=Array.isArray(e.bulkActionType)?e.bulkActionType:[e.bulkActionType],t.type=a):t.type=c.O,e.userType&&(n=Array.isArray(e.userType)?e.userType:[e.userType],t.dataType=n),{url:r._.urlBuilder("{gateway}/v1/batch/jobs",t),key:"batch:jobs:".concat(e.cursor,":").concat(e.sort,":").concat(a.sort().join(":"),":").concat(n.sort().join(":"))}},getJob:function(e){return{url:"{gateway}/v1/batch/jobs/".concat(e),key:"job:".concat(e)}},getJobProgress:function(e,t,a){return{url:"{gateway}/v1/batch/jobs/".concat(e,"/progress"),key:"job:".concat(e,":progress"),invalidationKeys:"job:".concat(e,":progress"),success:t,error:a}},getJobResults:function(e,t,a,n,c){var l={status:t};return a&&(l.cursor=a),{url:r._.urlBuilder("{gateway}/v1/batch/jobs/".concat(e,"/results"),l),key:"job:".concat(e,":results:").concat(t,":").concat(a),success:n,error:c}},getYearGroupRolloverStatus:function(e){return{url:"{gateway}/v1/batch/validations/customers/".concat(e,"/year-group-roll-over"),key:"year:group:rollover:status"}},sendJobReports:function(e){return{url:"{gateway}/v1/batch/results/export",key:"send:job:reports:".concat(e.sort().join(":")),type:n.k.POST,data:{jobIds:e}}},getJobSummary:function(e){return{url:"{gateway}/v1/batch/jobs/".concat(e,"/summary"),key:"job:summary:".concat(e)}}}},91807:(e,t,a)=>{a.d(t,{Z:()=>n});const n={tagList:"Zw6d9",disabled:"jlL1c",partialTag:"too_N",badge:"OjtN8",close:"X9joI"}}}]);