@clickview/lite 0.32.5-dev.2 → 0.32.6-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 (318) hide show
  1. package/dist/bundles.json +2 -2
  2. package/dist/css/1316-lite-9ad8b46794.chunk.css +11 -0
  3. package/dist/css/{1366-lite-7a13bffe4a.chunk.css → 1366-lite-6f12312543.chunk.css} +1 -1
  4. package/dist/css/{1781-lite-028e7f49eb.chunk.css → 1781-lite-f09d44460a.chunk.css} +1 -1
  5. package/dist/css/1818-lite-08c053955f.chunk.css +3 -0
  6. package/dist/css/{1820-lite-2e8b8f3d56.chunk.css → 1820-lite-bfdd587934.chunk.css} +3 -1
  7. package/dist/css/{2199-lite-77065b1940.chunk.css → 2199-lite-824c77c7cb.chunk.css} +1 -1
  8. package/dist/css/{2469-lite-8f71b4a46d.chunk.css → 2469-lite-ce3c019eae.chunk.css} +1 -1
  9. package/dist/css/{275-lite-f1860ca39a.chunk.css → 275-lite-62b59223b1.chunk.css} +1 -1
  10. package/dist/css/{3091-lite-ea247cd3c7.chunk.css → 3091-lite-3a9ef7f2f7.chunk.css} +1 -1
  11. package/dist/css/{3446-lite-ded5e413ce.chunk.css → 3446-lite-cd6940eb5a.chunk.css} +1 -1
  12. package/dist/css/{3755-lite-19658f72e9.chunk.css → 3755-lite-6f3f0f2a8d.chunk.css} +1 -1
  13. package/dist/css/{4145-lite-419c7a3152.chunk.css → 4145-lite-1cb96b833b.chunk.css} +1 -1
  14. package/dist/css/{420-lite-898652e17b.chunk.css → 420-lite-7722827119.chunk.css} +1 -1
  15. package/dist/css/{2066-lite-c31f88668c.chunk.css → 4247-lite-b76d20bd63.chunk.css} +7 -1
  16. package/dist/css/{4373-lite-975f9b4d75.chunk.css → 4373-lite-f7cda08fb2.chunk.css} +1 -1
  17. package/dist/css/{8556-lite-1e4722df6b.chunk.css → 4380-lite-e4688ef686.chunk.css} +1 -1
  18. package/dist/css/{4874-lite-ebe3cdda84.chunk.css → 4405-lite-e41a479008.chunk.css} +4 -2
  19. package/dist/css/4423-lite-bb4ec49419.chunk.css +2 -0
  20. package/dist/css/{162-lite-2da1ee274f.chunk.css → 4441-lite-c7934b39ef.chunk.css} +1 -0
  21. package/dist/css/{4612-lite-3886475291.chunk.css → 4612-lite-b59f3b3265.chunk.css} +1 -1
  22. package/dist/css/{4705-lite-54b30399d3.chunk.css → 4705-lite-f011571fa4.chunk.css} +1 -1
  23. package/dist/css/{2729-lite-ebe3cdda84.chunk.css → 5151-lite-e41a479008.chunk.css} +4 -2
  24. package/dist/css/{5171-lite-bb5871d776.chunk.css → 5171-lite-72725120a3.chunk.css} +1 -1
  25. package/dist/css/{9133-lite-26e2a668b0.chunk.css → 5313-lite-3b29b667e1.chunk.css} +2 -1
  26. package/dist/css/{6302-lite-e5fccb8e92.chunk.css → 5406-lite-364b761033.chunk.css} +2 -1
  27. package/dist/css/{1064-lite-b3840e522e.chunk.css → 5555-lite-a0b3cf04dc.chunk.css} +4 -2
  28. package/dist/css/5595-lite-c07231bb2e.chunk.css +7 -0
  29. package/dist/css/5611-lite-a0b3cf04dc.chunk.css +31 -0
  30. package/dist/css/5659-lite-a0b3cf04dc.chunk.css +31 -0
  31. package/dist/css/{6154-lite-a0abd6b2f9.chunk.css → 6154-lite-5b46992519.chunk.css} +1 -1
  32. package/dist/css/{6159-lite-b462e7862d.chunk.css → 6159-lite-19c8fc320e.chunk.css} +1 -1
  33. package/dist/css/{6407-lite-2a91046512.chunk.css → 6407-lite-720e76a514.chunk.css} +1 -1
  34. package/dist/css/{6702-lite-285d18c247.chunk.css → 6702-lite-31d475bc5d.chunk.css} +1 -1
  35. package/dist/css/{6822-lite-c2527edca1.chunk.css → 6822-lite-e6009d7a35.chunk.css} +1 -1
  36. package/dist/css/{1592-lite-7471086af4.chunk.css → 6863-lite-16904ec0d1.chunk.css} +0 -1
  37. package/dist/css/{6957-lite-8d71b12aa5.chunk.css → 6957-lite-82cdc84d20.chunk.css} +1 -1
  38. package/dist/css/{7286-lite-5a6b3f32ab.chunk.css → 7286-lite-140c0a1d94.chunk.css} +1 -1
  39. package/dist/css/{7484-lite-1a3ccb3597.chunk.css → 7484-lite-ebedea81cd.chunk.css} +1 -1
  40. package/dist/css/{4052-lite-e96ead7ea1.chunk.css → 7564-lite-74c6e57468.chunk.css} +4 -2
  41. package/dist/css/{817-lite-665d49932b.chunk.css → 817-lite-b3b6e03570.chunk.css} +1 -1
  42. package/dist/css/{4380-lite-1e4722df6b.chunk.css → 8556-lite-e4688ef686.chunk.css} +1 -1
  43. package/dist/css/{9714-lite-72b0f59716.chunk.css → 9714-lite-5e35963ae2.chunk.css} +1 -1
  44. package/dist/css/{9744-lite-ea247cd3c7.chunk.css → 9744-lite-3a9ef7f2f7.chunk.css} +1 -1
  45. package/dist/css/{lite-app-3a1c9a1d2b.css → lite-app-855ceef79c.css} +2 -2
  46. package/dist/languages/en.json +1 -1
  47. package/dist/scripts/1316-178defa7c7-lite.chunk.js +1 -0
  48. package/dist/scripts/{1366-666ef709a1-lite.chunk.js → 1366-edb781eea5-lite.chunk.js} +1 -1
  49. package/dist/scripts/1517-05b0f4350a-lite.chunk.js +1 -0
  50. package/dist/scripts/{1518-c4881607ce-lite.chunk.js → 1518-7967c2115a-lite.chunk.js} +1 -1
  51. package/dist/scripts/{1750-4b785132ad-lite.chunk.js → 1750-dfa839cdf2-lite.chunk.js} +1 -1
  52. package/dist/scripts/1818-aba96da353-lite.chunk.js +1 -0
  53. package/dist/scripts/1820-6955a417a6-lite.chunk.js +1 -0
  54. package/dist/scripts/1830-8264488f9e-lite.chunk.js +1 -0
  55. package/dist/scripts/2199-d9ca47840a-lite.chunk.js +1 -0
  56. package/dist/scripts/2279-82f2a438b0-lite.chunk.js +1 -0
  57. package/dist/scripts/{2564-6030f21acd-lite.chunk.js → 2564-ec9dcdc626-lite.chunk.js} +1 -1
  58. package/dist/scripts/{275-0cd72590c8-lite.chunk.js → 275-b84920fdaa-lite.chunk.js} +1 -1
  59. package/dist/scripts/3091-2bc7ec2740-lite.chunk.js +1 -0
  60. package/dist/scripts/3371-18520521a7-lite.chunk.js +1 -0
  61. package/dist/scripts/3446-069b00d36d-lite.chunk.js +1 -0
  62. package/dist/scripts/3514-7b6fb85714-lite.chunk.js +1 -0
  63. package/dist/scripts/355-1eb9c5f791-lite.chunk.js +1 -0
  64. package/dist/scripts/{3645-86f0ed022f-lite.chunk.js → 3645-2683fa5003-lite.chunk.js} +1 -1
  65. package/dist/scripts/{3667-c5b8a096c2-lite.chunk.js → 3667-a97793c9f2-lite.chunk.js} +1 -1
  66. package/dist/scripts/3789-e3924e640f-lite.chunk.js +2 -0
  67. package/dist/scripts/3966-ea5ccf719b-lite.chunk.js +1 -0
  68. package/dist/scripts/4145-2759f40615-lite.chunk.js +1 -0
  69. package/dist/scripts/420-a72d8002a3-lite.chunk.js +1 -0
  70. package/dist/scripts/4247-0c20b31676-lite.chunk.js +2 -0
  71. package/dist/scripts/{4373-039b523832-lite.chunk.js → 4373-2c2d309a37-lite.chunk.js} +1 -1
  72. package/dist/scripts/4423-547e7ba89a-lite.chunk.js +1 -0
  73. package/dist/scripts/4436-fc7c6e1737-lite.chunk.js +1 -0
  74. package/dist/scripts/4441-a2d61b085f-lite.chunk.js +2 -0
  75. package/dist/scripts/{4612-2c0e7977a2-lite.chunk.js → 4612-689eb44d24-lite.chunk.js} +1 -1
  76. package/dist/scripts/{4617-591aee68e0-lite.chunk.js → 4617-633091c264-lite.chunk.js} +1 -1
  77. package/dist/scripts/4657-1533b19015-lite.chunk.js +2 -0
  78. package/dist/scripts/{4705-96be64b79d-lite.chunk.js → 4705-3aa7b071ec-lite.chunk.js} +1 -1
  79. package/dist/scripts/{5009-9e45034def-lite.chunk.js → 5009-93cd88833d-lite.chunk.js} +1 -1
  80. package/dist/scripts/{2729-feeb22f8a9-lite.chunk.js → 5151-52804fdb52-lite.chunk.js} +1 -1
  81. package/dist/scripts/519-bb930f9c4b-lite.chunk.js +1 -0
  82. package/dist/scripts/{5268-029905c5f0-lite.chunk.js → 5268-be0eb0d561-lite.chunk.js} +1 -1
  83. package/dist/scripts/5271-1df4d9d742-lite.chunk.js +1 -1
  84. package/dist/scripts/5313-32533937e5-lite.chunk.js +1 -0
  85. package/dist/scripts/5406-7771f9c0a4-lite.chunk.js +1 -0
  86. package/dist/scripts/5512-e7d65d5b6f-lite.chunk.js +1 -0
  87. package/dist/scripts/5555-985e251ee8-lite.chunk.js +1 -0
  88. package/dist/scripts/5595-c6cb52f09d-lite.chunk.js +1 -0
  89. package/dist/scripts/5611-5902f60b7a-lite.chunk.js +1 -0
  90. package/dist/scripts/5659-279cf2f5ac-lite.chunk.js +1 -0
  91. package/dist/scripts/5765-bffdda2690-lite.chunk.js +1 -0
  92. package/dist/scripts/5776-82adf0f1d1-lite.chunk.js +1 -0
  93. package/dist/scripts/5986-fdd928f458-lite.chunk.js +1 -0
  94. package/dist/scripts/{6117-fae9185071-lite.chunk.js → 6117-ceca22f598-lite.chunk.js} +1 -1
  95. package/dist/scripts/{6154-107ea02e45-lite.chunk.js → 6154-23f1a8b802-lite.chunk.js} +1 -1
  96. package/dist/scripts/6159-fee89fd7ad-lite.chunk.js +1 -0
  97. package/dist/scripts/{6407-651ccf60e3-lite.chunk.js → 6407-bac161c9bf-lite.chunk.js} +1 -1
  98. package/dist/scripts/{6480-126763c9bc-lite.chunk.js → 6480-e5afc3e0f1-lite.chunk.js} +1 -1
  99. package/dist/scripts/{6702-bbebb7030e-lite.chunk.js → 6702-90515cdd67-lite.chunk.js} +1 -1
  100. package/dist/scripts/{6801-d3cf047fb8-lite.chunk.js → 6801-fb5064f563-lite.chunk.js} +1 -1
  101. package/dist/scripts/6863-8cd402d9eb-lite.chunk.js +1 -0
  102. package/dist/scripts/{7030-041896252c-lite.chunk.js → 7030-7a8f86bff3-lite.chunk.js} +1 -1
  103. package/dist/scripts/7045-2d86063c1c-lite.chunk.js +1 -0
  104. package/dist/scripts/{7052-0a94f7b10e-lite.chunk.js → 7052-506fac0d7b-lite.chunk.js} +2 -2
  105. package/dist/scripts/{7112-ec1031994e-lite.chunk.js → 7112-f9195ea3ee-lite.chunk.js} +1 -1
  106. package/dist/scripts/{7178-7389623a5a-lite.chunk.js → 7178-7c23eb0ac4-lite.chunk.js} +1 -1
  107. package/dist/scripts/{7288-e945b5adc9-lite.chunk.js → 7288-394b622cce-lite.chunk.js} +1 -1
  108. package/dist/scripts/{7293-e20274d243-lite.chunk.js → 7293-19e2046720-lite.chunk.js} +1 -1
  109. package/dist/scripts/7422-b525ec20d3-lite.chunk.js +2 -0
  110. package/dist/scripts/7422-b525ec20d3-lite.chunk.js.LICENSE.txt +31 -0
  111. package/dist/scripts/7432-0edd706b57-lite.chunk.js +1 -0
  112. package/dist/scripts/7506-654a0a14fe-lite.chunk.js +1 -0
  113. package/dist/scripts/{4052-4548ee2a0c-lite.chunk.js → 7564-2ed47ddbc3-lite.chunk.js} +1 -1
  114. package/dist/scripts/{7708-f170b2ca80-lite.chunk.js → 7708-28536a9abd-lite.chunk.js} +1 -1
  115. package/dist/scripts/8056-da72c8b1d7-lite.chunk.js +1 -0
  116. package/dist/scripts/{817-19c50fb9e7-lite.chunk.js → 817-1373c64ee2-lite.chunk.js} +1 -1
  117. package/dist/scripts/{8236-06e2326d22-lite.chunk.js → 8236-b1ba6a195c-lite.chunk.js} +1 -1
  118. package/dist/scripts/{8323-aeb803ba70-lite.chunk.js → 8323-7043434ec0-lite.chunk.js} +1 -1
  119. package/dist/scripts/{8367-c2e291cfc2-lite.chunk.js → 8367-858b9e6ff8-lite.chunk.js} +1 -1
  120. package/dist/scripts/8564-d60ac4a886-lite.chunk.js +1 -0
  121. package/dist/scripts/{8681-da6e12f2d5-lite.chunk.js → 8681-7d0092afe1-lite.chunk.js} +1 -1
  122. package/dist/scripts/8873-d5bcff1f82-lite.chunk.js +1 -0
  123. package/dist/scripts/{8935-0d85df691f-lite.chunk.js → 8935-e3549617b8-lite.chunk.js} +1 -1
  124. package/dist/scripts/8955-93725cfefc-lite.chunk.js +1 -0
  125. package/dist/scripts/9338-2f21004cd0-lite.chunk.js +1 -0
  126. package/dist/scripts/{9478-fecaea6d54-lite.chunk.js → 9478-1978074e73-lite.chunk.js} +2 -2
  127. package/dist/scripts/{9484-312aa1531d-lite.chunk.js → 9484-1544749279-lite.chunk.js} +1 -1
  128. package/dist/scripts/9744-bdfe4cb49c-lite.chunk.js +1 -0
  129. package/dist/scripts/9843-137761f2e1-lite.chunk.js +1 -0
  130. package/dist/scripts/{9894-75159b2fc0-lite.chunk.js → 9894-9f2a3b2e92-lite.chunk.js} +2 -2
  131. package/dist/scripts/{9931-08cf05b177-lite.chunk.js → 9931-bc6b18ba05-lite.chunk.js} +1 -1
  132. package/dist/scripts/bundle-310abcca09.min.js +2 -0
  133. package/dist/scripts/{bundle-f87a30ceaf.min.js.LICENSE.txt → bundle-310abcca09.min.js.LICENSE.txt} +0 -20
  134. package/jest.config.js +11 -11
  135. package/package.json +3 -3
  136. package/typings/libs/CVEvents.d.ts +12 -12
  137. package/typings/libs/CVLanguages.d.ts +24 -24
  138. package/typings/libs/cloneDeep.d.ts +4 -4
  139. package/typings/libs/cookiesjs.d.ts +25 -25
  140. package/typings/libs/draft-convert.d.ts +3 -3
  141. package/typings/libs/google-api.d.ts +93 -93
  142. package/typings/libs/intersection-observer.d.ts +82 -82
  143. package/typings/libs/microsoft-teams.d.ts +2 -2
  144. package/typings/libs/react-table-config.d.ts +138 -138
  145. package/typings/libs/trackjs.d.ts +2 -2
  146. package/typings/libs/videojs-contrib-quality-levels.d.ts +28 -28
  147. package/typings/utils/imports.d.ts +13 -13
  148. package/dist/css/1818-lite-580340c188.chunk.css +0 -3
  149. package/dist/css/4423-lite-c96a8d00e8.chunk.css +0 -2
  150. package/dist/css/5590-lite-b3840e522e.chunk.css +0 -29
  151. package/dist/css/5595-lite-2e6f96854b.chunk.css +0 -5
  152. package/dist/css/5659-lite-b3840e522e.chunk.css +0 -29
  153. package/dist/css/9961-lite-ce6b57f21d.chunk.css +0 -10
  154. package/dist/scripts/1064-c89603c84c-lite.chunk.js +0 -1
  155. package/dist/scripts/1517-ba6874eca4-lite.chunk.js +0 -1
  156. package/dist/scripts/1592-aa2bc45d63-lite.chunk.js +0 -2
  157. package/dist/scripts/162-51e28f0e8d-lite.chunk.js +0 -2
  158. package/dist/scripts/1818-6e03769806-lite.chunk.js +0 -1
  159. package/dist/scripts/1820-8268536e88-lite.chunk.js +0 -1
  160. package/dist/scripts/1830-565ee5aa0c-lite.chunk.js +0 -1
  161. package/dist/scripts/2066-f1ee632b62-lite.chunk.js +0 -2
  162. package/dist/scripts/2199-d8e643d50d-lite.chunk.js +0 -1
  163. package/dist/scripts/2279-40f438c92d-lite.chunk.js +0 -1
  164. package/dist/scripts/3091-b372a6e5a8-lite.chunk.js +0 -1
  165. package/dist/scripts/3371-61857af54b-lite.chunk.js +0 -1
  166. package/dist/scripts/3446-cb79c1bff9-lite.chunk.js +0 -1
  167. package/dist/scripts/3514-4c7a73efac-lite.chunk.js +0 -1
  168. package/dist/scripts/355-43835ac290-lite.chunk.js +0 -1
  169. package/dist/scripts/3789-4cb6d829f6-lite.chunk.js +0 -2
  170. package/dist/scripts/3966-ea2b70c705-lite.chunk.js +0 -1
  171. package/dist/scripts/4145-bc7f5915d7-lite.chunk.js +0 -1
  172. package/dist/scripts/420-1d548d3b84-lite.chunk.js +0 -1
  173. package/dist/scripts/4423-3424b647e8-lite.chunk.js +0 -1
  174. package/dist/scripts/4436-843f23ed17-lite.chunk.js +0 -1
  175. package/dist/scripts/4657-da41ee610c-lite.chunk.js +0 -2
  176. package/dist/scripts/519-5dff99c40b-lite.chunk.js +0 -1
  177. package/dist/scripts/5512-82edf40ee3-lite.chunk.js +0 -1
  178. package/dist/scripts/5590-f5dbe096c3-lite.chunk.js +0 -1
  179. package/dist/scripts/5595-99e11127bb-lite.chunk.js +0 -1
  180. package/dist/scripts/5659-92c6bf622e-lite.chunk.js +0 -1
  181. package/dist/scripts/5776-27f15a637f-lite.chunk.js +0 -1
  182. package/dist/scripts/5986-d9b797867b-lite.chunk.js +0 -1
  183. package/dist/scripts/6159-2111108b27-lite.chunk.js +0 -1
  184. package/dist/scripts/6302-6690979e80-lite.chunk.js +0 -1
  185. package/dist/scripts/6532-04ba86364b-lite.chunk.js +0 -1
  186. package/dist/scripts/6662-0cdefe8716-lite.chunk.js +0 -1
  187. package/dist/scripts/7045-8f704951d9-lite.chunk.js +0 -1
  188. package/dist/scripts/7422-8f60c3028d-lite.chunk.js +0 -2
  189. package/dist/scripts/7422-8f60c3028d-lite.chunk.js.LICENSE.txt +0 -11
  190. package/dist/scripts/7432-d4e8bef2f4-lite.chunk.js +0 -1
  191. package/dist/scripts/7506-84f4593d4e-lite.chunk.js +0 -1
  192. package/dist/scripts/8056-0044639a66-lite.chunk.js +0 -1
  193. package/dist/scripts/8564-97a9548afd-lite.chunk.js +0 -1
  194. package/dist/scripts/8873-f8598046db-lite.chunk.js +0 -1
  195. package/dist/scripts/8955-9823de95f3-lite.chunk.js +0 -1
  196. package/dist/scripts/9133-1c2f07cd11-lite.chunk.js +0 -1
  197. package/dist/scripts/9744-49217aba0f-lite.chunk.js +0 -1
  198. package/dist/scripts/9843-9f510ac1c1-lite.chunk.js +0 -1
  199. package/dist/scripts/9931-08cf05b177-lite.chunk.js.LICENSE.txt +0 -1
  200. package/dist/scripts/9961-62c9f288a2-lite.chunk.js +0 -1
  201. package/dist/scripts/bundle-3796712273.min.js +0 -2
  202. package/dist/scripts/bundle-3796712273.min.js.LICENSE.txt +0 -129
  203. package/dist/scripts/bundle-88ea810319.min.js +0 -2
  204. package/dist/scripts/bundle-88ea810319.min.js.LICENSE.txt +0 -129
  205. package/dist/scripts/bundle-f87a30ceaf.min.js +0 -2
  206. /package/dist/scripts/{1285-6f221ec83e-lite.chunk.js → 1285-b295383b73-lite.chunk.js} +0 -0
  207. /package/dist/scripts/{1291-94108fc09a-lite.chunk.js → 1291-77b2beaf96-lite.chunk.js} +0 -0
  208. /package/dist/scripts/{1366-666ef709a1-lite.chunk.js.LICENSE.txt → 1366-edb781eea5-lite.chunk.js.LICENSE.txt} +0 -0
  209. /package/dist/scripts/{1475-c84cf7b8c7-lite.chunk.js → 1475-c3aad2020e-lite.chunk.js} +0 -0
  210. /package/dist/scripts/{1526-4b6226c3a3-lite.chunk.js → 1526-7d8b2f1eea-lite.chunk.js} +0 -0
  211. /package/dist/scripts/{1725-30a5110c8d-lite.chunk.js → 1725-642d830e51-lite.chunk.js} +0 -0
  212. /package/dist/scripts/{1726-3bd6a64ab2-lite.chunk.js → 1726-b57f78d9ea-lite.chunk.js} +0 -0
  213. /package/dist/scripts/{1781-40d8e94385-lite.chunk.js → 1781-946f4b8fb3-lite.chunk.js} +0 -0
  214. /package/dist/scripts/{1837-e6891957ae-lite.chunk.js → 1837-ae071254cb-lite.chunk.js} +0 -0
  215. /package/dist/scripts/{1863-47eef75488-lite.chunk.js → 1863-264162f8fa-lite.chunk.js} +0 -0
  216. /package/dist/scripts/{1891-20227a97bd-lite.chunk.js → 1891-4e1fc9cefe-lite.chunk.js} +0 -0
  217. /package/dist/scripts/{1913-6c98c0a34f-lite.chunk.js → 1913-1079234eae-lite.chunk.js} +0 -0
  218. /package/dist/scripts/{1943-cf609bd18b-lite.chunk.js → 1943-327b6fc1ce-lite.chunk.js} +0 -0
  219. /package/dist/scripts/{1958-6de295ac2f-lite.chunk.js → 1958-9e9dd407a4-lite.chunk.js} +0 -0
  220. /package/dist/scripts/{209-bea4fb3c22-lite.chunk.js → 209-d72934a489-lite.chunk.js} +0 -0
  221. /package/dist/scripts/{2095-498558805d-lite.chunk.js → 2095-57fb3b1431-lite.chunk.js} +0 -0
  222. /package/dist/scripts/{2175-1a9cac2654-lite.chunk.js → 2175-b78a706fa9-lite.chunk.js} +0 -0
  223. /package/dist/scripts/{2208-6320d5c5ec-lite.chunk.js → 2208-972ed3ac26-lite.chunk.js} +0 -0
  224. /package/dist/scripts/{2235-b9198e9674-lite.chunk.js → 2235-8a43816b16-lite.chunk.js} +0 -0
  225. /package/dist/scripts/{227-e81fa36f91-lite.chunk.js → 227-718366f73a-lite.chunk.js} +0 -0
  226. /package/dist/scripts/{2318-204c094444-lite.chunk.js → 2318-8e6a642d06-lite.chunk.js} +0 -0
  227. /package/dist/scripts/{2452-f96e548d17-lite.chunk.js → 2452-446607a894-lite.chunk.js} +0 -0
  228. /package/dist/scripts/{2469-8591c7a350-lite.chunk.js → 2469-c40964ecb6-lite.chunk.js} +0 -0
  229. /package/dist/scripts/{2608-e2b5d4de7a-lite.chunk.js → 2608-ca22e93183-lite.chunk.js} +0 -0
  230. /package/dist/scripts/{287-223a01d363-lite.chunk.js → 287-023c6d13b7-lite.chunk.js} +0 -0
  231. /package/dist/scripts/{2966-0a626741f2-lite.chunk.js → 2966-4e5b3e14e1-lite.chunk.js} +0 -0
  232. /package/dist/scripts/{3012-b64578f4b5-lite.chunk.js → 3012-0682e26229-lite.chunk.js} +0 -0
  233. /package/dist/scripts/{3020-b0fd4b4978-lite.chunk.js → 3020-f2ded2aebe-lite.chunk.js} +0 -0
  234. /package/dist/scripts/{3154-25535da78b-lite.chunk.js → 3154-87862ce1c7-lite.chunk.js} +0 -0
  235. /package/dist/scripts/{3200-3bbafd3e8a-lite.chunk.js → 3200-22b854d2bd-lite.chunk.js} +0 -0
  236. /package/dist/scripts/{3216-47d94fcff8-lite.chunk.js → 3216-3f6585c52b-lite.chunk.js} +0 -0
  237. /package/dist/scripts/{3285-85360362bb-lite.chunk.js → 3285-dd1d715265-lite.chunk.js} +0 -0
  238. /package/dist/scripts/{3378-205ec27cf3-lite.chunk.js → 3378-38ffdcffee-lite.chunk.js} +0 -0
  239. /package/dist/scripts/{3533-165a400f8a-lite.chunk.js → 3533-96f9230c25-lite.chunk.js} +0 -0
  240. /package/dist/scripts/{1592-aa2bc45d63-lite.chunk.js.LICENSE.txt → 3645-2683fa5003-lite.chunk.js.LICENSE.txt} +0 -0
  241. /package/dist/scripts/{3654-5344eb1cc5-lite.chunk.js → 3654-61b6155a78-lite.chunk.js} +0 -0
  242. /package/dist/scripts/{162-51e28f0e8d-lite.chunk.js.LICENSE.txt → 3667-a97793c9f2-lite.chunk.js.LICENSE.txt} +0 -0
  243. /package/dist/scripts/{3754-ad907b38cc-lite.chunk.js → 3754-978fa5935c-lite.chunk.js} +0 -0
  244. /package/dist/scripts/{3755-51bd37a5c6-lite.chunk.js → 3755-b9477924cc-lite.chunk.js} +0 -0
  245. /package/dist/scripts/{2066-f1ee632b62-lite.chunk.js.LICENSE.txt → 3789-e3924e640f-lite.chunk.js.LICENSE.txt} +0 -0
  246. /package/dist/scripts/{3849-b0db69d3db-lite.chunk.js → 3849-2304863f99-lite.chunk.js} +0 -0
  247. /package/dist/scripts/{389-fc8f4fcbf4-lite.chunk.js → 389-7ff8189cc3-lite.chunk.js} +0 -0
  248. /package/dist/scripts/{4032-279a38c349-lite.chunk.js → 4032-d903795887-lite.chunk.js} +0 -0
  249. /package/dist/scripts/{3645-86f0ed022f-lite.chunk.js.LICENSE.txt → 4247-0c20b31676-lite.chunk.js.LICENSE.txt} +0 -0
  250. /package/dist/scripts/{4326-af6113a1df-lite.chunk.js → 4326-1c0a5b768c-lite.chunk.js} +0 -0
  251. /package/dist/scripts/{4343-84cca94426-lite.chunk.js → 4343-c463efc266-lite.chunk.js} +0 -0
  252. /package/dist/scripts/{4380-719146155f-lite.chunk.js → 4380-7788844011-lite.chunk.js} +0 -0
  253. /package/dist/scripts/{4393-df6aadca06-lite.chunk.js → 4393-5f8b38156b-lite.chunk.js} +0 -0
  254. /package/dist/scripts/{3667-c5b8a096c2-lite.chunk.js.LICENSE.txt → 4441-a2d61b085f-lite.chunk.js.LICENSE.txt} +0 -0
  255. /package/dist/scripts/{4537-9c5fd00b48-lite.chunk.js → 4537-74306e1157-lite.chunk.js} +0 -0
  256. /package/dist/scripts/{3789-4cb6d829f6-lite.chunk.js.LICENSE.txt → 4657-1533b19015-lite.chunk.js.LICENSE.txt} +0 -0
  257. /package/dist/scripts/{4753-31e147c1a9-lite.chunk.js → 4753-4601f0e937-lite.chunk.js} +0 -0
  258. /package/dist/scripts/{4893-c04f7f4d32-lite.chunk.js → 4893-24a361eb0c-lite.chunk.js} +0 -0
  259. /package/dist/scripts/{4895-ab469a3b66-lite.chunk.js → 4895-e136f3e815-lite.chunk.js} +0 -0
  260. /package/dist/scripts/{4657-da41ee610c-lite.chunk.js.LICENSE.txt → 5009-93cd88833d-lite.chunk.js.LICENSE.txt} +0 -0
  261. /package/dist/scripts/{5143-d11346cce2-lite.chunk.js → 5143-b6763c5c3e-lite.chunk.js} +0 -0
  262. /package/dist/scripts/{5171-926c0772a6-lite.chunk.js → 5171-337dac49f0-lite.chunk.js} +0 -0
  263. /package/dist/scripts/{5009-9e45034def-lite.chunk.js.LICENSE.txt → 5268-be0eb0d561-lite.chunk.js.LICENSE.txt} +0 -0
  264. /package/dist/scripts/{528-bc970ef53c-lite.chunk.js → 528-2ab7c7a75c-lite.chunk.js} +0 -0
  265. /package/dist/scripts/{5606-486a41d299-lite.chunk.js → 5606-d48ee92b02-lite.chunk.js} +0 -0
  266. /package/dist/scripts/{5877-e318dacbf1-lite.chunk.js → 5877-0978d5d20d-lite.chunk.js} +0 -0
  267. /package/dist/scripts/{6057-dd865f2846-lite.chunk.js → 6057-607500eca5-lite.chunk.js} +0 -0
  268. /package/dist/scripts/{615-50555390cc-lite.chunk.js → 615-05a2f20874-lite.chunk.js} +0 -0
  269. /package/dist/scripts/{6158-4bdb28b41e-lite.chunk.js → 6158-dfa1d2379d-lite.chunk.js} +0 -0
  270. /package/dist/scripts/{6285-4808d8e6db-lite.chunk.js → 6285-0899c78c8c-lite.chunk.js} +0 -0
  271. /package/dist/scripts/{6290-8204f439c2-lite.chunk.js → 6290-40d12a27d7-lite.chunk.js} +0 -0
  272. /package/dist/scripts/{6368-8532bb9df5-lite.chunk.js → 6368-f3803b36c2-lite.chunk.js} +0 -0
  273. /package/dist/scripts/{6370-a15bddb981-lite.chunk.js → 6370-3f2b2925e3-lite.chunk.js} +0 -0
  274. /package/dist/scripts/{6689-bf6b056ced-lite.chunk.js → 6689-c68627805c-lite.chunk.js} +0 -0
  275. /package/dist/scripts/{6817-bed9ca6833-lite.chunk.js → 6817-965c88fe48-lite.chunk.js} +0 -0
  276. /package/dist/scripts/{6822-15e9977d1f-lite.chunk.js → 6822-5ca8d9e231-lite.chunk.js} +0 -0
  277. /package/dist/scripts/{6930-4c28b4f509-lite.chunk.js → 6930-5f0db0b02f-lite.chunk.js} +0 -0
  278. /package/dist/scripts/{6957-058e2001c4-lite.chunk.js → 6957-d653850dcb-lite.chunk.js} +0 -0
  279. /package/dist/scripts/{5268-029905c5f0-lite.chunk.js.LICENSE.txt → 7030-7a8f86bff3-lite.chunk.js.LICENSE.txt} +0 -0
  280. /package/dist/scripts/{7030-041896252c-lite.chunk.js.LICENSE.txt → 7052-506fac0d7b-lite.chunk.js.LICENSE.txt} +0 -0
  281. /package/dist/scripts/{7056-b5cd72d1b8-lite.chunk.js → 7056-9a2e82c180-lite.chunk.js} +0 -0
  282. /package/dist/scripts/{7108-0f6adbabf0-lite.chunk.js → 7108-2cc9a7b81d-lite.chunk.js} +0 -0
  283. /package/dist/scripts/{7052-0a94f7b10e-lite.chunk.js.LICENSE.txt → 7112-f9195ea3ee-lite.chunk.js.LICENSE.txt} +0 -0
  284. /package/dist/scripts/{7128-1ee42ef21c-lite.chunk.js → 7128-11e4f82a97-lite.chunk.js} +0 -0
  285. /package/dist/scripts/{714-7d4a73ae45-lite.chunk.js → 714-eaa48dfe1c-lite.chunk.js} +0 -0
  286. /package/dist/scripts/{7205-4c232d2ac0-lite.chunk.js → 7205-46991f09e4-lite.chunk.js} +0 -0
  287. /package/dist/scripts/{7286-cb1923e134-lite.chunk.js → 7286-7a854ab523-lite.chunk.js} +0 -0
  288. /package/dist/scripts/{7332-7bfaeba358-lite.chunk.js → 7332-e864c7f1f2-lite.chunk.js} +0 -0
  289. /package/dist/scripts/{7484-6bc5cab7dd-lite.chunk.js → 7484-be14810aa6-lite.chunk.js} +0 -0
  290. /package/dist/scripts/{7540-fabe7ac275-lite.chunk.js → 7540-4eb8dcae09-lite.chunk.js} +0 -0
  291. /package/dist/scripts/{7555-4d6b6eda04-lite.chunk.js → 7555-bd10f10890-lite.chunk.js} +0 -0
  292. /package/dist/scripts/{7767-3a6db3d0ec-lite.chunk.js → 7767-606d7f700d-lite.chunk.js} +0 -0
  293. /package/dist/scripts/{7818-4910db8536-lite.chunk.js → 7818-34eda6078f-lite.chunk.js} +0 -0
  294. /package/dist/scripts/{7888-e721ba550f-lite.chunk.js → 7888-db27bfa50b-lite.chunk.js} +0 -0
  295. /package/dist/scripts/{8025-ebb2a6e951-lite.chunk.js → 8025-292febade2-lite.chunk.js} +0 -0
  296. /package/dist/scripts/{8252-82ab60c504-lite.chunk.js → 8252-413339e753-lite.chunk.js} +0 -0
  297. /package/dist/scripts/{7112-ec1031994e-lite.chunk.js.LICENSE.txt → 8323-7043434ec0-lite.chunk.js.LICENSE.txt} +0 -0
  298. /package/dist/scripts/{8419-8ddf8d53f5-lite.chunk.js → 8419-79cd038e70-lite.chunk.js} +0 -0
  299. /package/dist/scripts/{8556-f6d1f3fe46-lite.chunk.js → 8556-c96b0b41cf-lite.chunk.js} +0 -0
  300. /package/dist/scripts/{8323-aeb803ba70-lite.chunk.js.LICENSE.txt → 8681-7d0092afe1-lite.chunk.js.LICENSE.txt} +0 -0
  301. /package/dist/scripts/{8763-30018c2eba-lite.chunk.js → 8763-c745ed1ebb-lite.chunk.js} +0 -0
  302. /package/dist/scripts/{8905-63f31e0b26-lite.chunk.js → 8905-65f92f2dec-lite.chunk.js} +0 -0
  303. /package/dist/scripts/{8681-da6e12f2d5-lite.chunk.js.LICENSE.txt → 8935-e3549617b8-lite.chunk.js.LICENSE.txt} +0 -0
  304. /package/dist/scripts/{8944-fa935f6ed4-lite.chunk.js → 8944-458e677ed3-lite.chunk.js} +0 -0
  305. /package/dist/scripts/{9005-7329883227-lite.chunk.js → 9005-ba82d0c5db-lite.chunk.js} +0 -0
  306. /package/dist/scripts/{9038-d071dd25ce-lite.chunk.js → 9038-f604ea49df-lite.chunk.js} +0 -0
  307. /package/dist/scripts/{9060-5cee4638c6-lite.chunk.js → 9060-c08573cb1a-lite.chunk.js} +0 -0
  308. /package/dist/scripts/{9118-948d6029d3-lite.chunk.js → 9118-9d165c070a-lite.chunk.js} +0 -0
  309. /package/dist/scripts/{9242-4b15b572db-lite.chunk.js → 9242-7f8ae811ef-lite.chunk.js} +0 -0
  310. /package/dist/scripts/{9264-c265dc4e08-lite.chunk.js → 9264-4e228ac39b-lite.chunk.js} +0 -0
  311. /package/dist/scripts/{9273-535bb6b083-lite.chunk.js → 9273-50b5ba5e78-lite.chunk.js} +0 -0
  312. /package/dist/scripts/{9455-cde3c093dc-lite.chunk.js → 9455-289e14d711-lite.chunk.js} +0 -0
  313. /package/dist/scripts/{8935-0d85df691f-lite.chunk.js.LICENSE.txt → 9478-1978074e73-lite.chunk.js.LICENSE.txt} +0 -0
  314. /package/dist/scripts/{9478-fecaea6d54-lite.chunk.js.LICENSE.txt → 9484-1544749279-lite.chunk.js.LICENSE.txt} +0 -0
  315. /package/dist/scripts/{9714-d0bcd64c24-lite.chunk.js → 9714-480c4a13e8-lite.chunk.js} +0 -0
  316. /package/dist/scripts/{9484-312aa1531d-lite.chunk.js.LICENSE.txt → 9894-9f2a3b2e92-lite.chunk.js.LICENSE.txt} +0 -0
  317. /package/dist/scripts/{9899-e695d8ad4c-lite.chunk.js → 9899-f0463a5a59-lite.chunk.js} +0 -0
  318. /package/dist/scripts/{9894-75159b2fc0-lite.chunk.js.LICENSE.txt → 9931-bc6b18ba05-lite.chunk.js.LICENSE.txt} +0 -0
@@ -1,2 +1,2 @@
1
- /*! For license information please see 3667-c5b8a096c2-lite.chunk.js.LICENSE.txt */
1
+ /*! For license information please see 3667-a97793c9f2-lite.chunk.js.LICENSE.txt */
2
2
  "use strict";(self.webpackChunk_clickview_lite=self.webpackChunk_clickview_lite||[]).push([[3667],{45541:(e,t,r)=>{r.d(t,{V:()=>s});var n=r(2948),a=r(38143),o=r(39739);function l(e){return l="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},l(e)}function i(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function c(e,t){return Object.keys(e||{}).reduce((function(r,n){return t[n]||(r[n]=e[n]),r}),{})}var s=function(){var e,t,r,s=(t=(0,n.D)(a.g.BULK_USER_UPLOAD),r=2,function(e){if(Array.isArray(e))return e}(t)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,a,o,l,i=[],c=!0,s=!1;try{if(o=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;c=!1}else for(;!(c=(n=o.call(r)).done)&&(i.push(n.value),i.length!==t);c=!0);}catch(e){s=!0,a=e}finally{try{if(!c&&null!=r.return&&(l=r.return(),Object(l)!==l))return}finally{if(s)throw a}}return i}}(t,r)||function(e,t){if(e){if("string"==typeof e)return i(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?i(e,t):void 0}}(t,r)||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],p=s[1];function d(e){var t=o.P.getNewDuplicates(e);p("duplicateSets",t)}return{users:null==u?void 0:u.users,invalidUsers:null==u?void 0:u.invalidUsers,hasValidatedUsers:!!(null==u?void 0:u.invalidUsers),existingUsersHash:(null==u?void 0:u.existingUsersHash)||{},hasExistingUsers:!!Object.keys((null==u?void 0:u.existingUsersHash)||{}).length,existingUserToAdd:null==u?void 0:u.existingUserToAdd,duplicateSets:null==u?void 0:u.duplicateSets,newUsers:(null===(e=null==u?void 0:u.users)||void 0===e?void 0:e.filter((function(e){var t;return!(null===(t=null==u?void 0:u.existingUsersHash)||void 0===t?void 0:t[e.lookupId])})))||[],setUsers:function(e){p({users:e,invalidUsers:null,existingUsersHash:null}),d(e)},setInvalidUsers:function(e){return p("invalidUsers",e)},setExistingUsers:function(e){return p("existingUsersHash",e)},updateUser:function(e){var t,r,n,a=u.users.map((function(t){return t.lookupId!==e.lookupId?t:e}));p({users:a,invalidUsers:c(null==u?void 0:u.invalidUsers,(t={},r=e.lookupId,n=!0,(r=function(e){var t=function(e,t){if("object"!==l(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!==l(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===l(t)?t:String(t)}(r))in t?Object.defineProperty(t,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[r]=n,t)),existingUsersHash:null==u?void 0:u.existingUsersHash}),d(a)},deleteUsers:function(e){var t,r=e.reduce((function(e,t){return e[t]=!0,e}),{}),n=u.users.filter((function(e){return!r[e.lookupId]}));p({users:n,invalidUsers:c(null==u?void 0:u.invalidUsers,r),existingUsersHash:c(null==u?void 0:u.existingUsersHash,r),existingUserToAdd:null===(t=null==u?void 0:u.existingUserToAdd)||void 0===t?void 0:t.filter((function(e){return!!(null==u?void 0:u.existingUsersHash[e.lookupId])}))}),d(n)}}}},38365:(e,t,r)=>{r.d(t,{n:()=>w,W:()=>S});var n=r(32735),a=r(80247),o=r(80130),l=r(92802),i=r(79014),c=r(1048),s=r(36848),u=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var a=0;for(n=Object.getOwnPropertySymbols(e);a<n.length;a++)t.indexOf(n[a])<0&&Object.prototype.propertyIsEnumerable.call(e,n[a])&&(r[n[a]]=e[n[a]])}return r};function p(e){var t=e.label,r=e.checkboxLabelClassName,a=e.checkboxLabelFontWeight,l=e.className,i=u(e,["label","checkboxLabelClassName","checkboxLabelFontWeight","className"]);return n.createElement(o.Z.Group,{className:"form-group"},n.createElement("div",{className:"form-check ".concat(l||"")},n.createElement(w,Object.assign({className:"form-check-input"},i)),n.createElement(o.Z.Label,{className:"form-check-label cursor-pointer ".concat("normal"===a?"fw-normal":""," \n ").concat(r),htmlFor:i.id},t),e.checkboxAppLink&&e.checkboxAppLinkText&&n.createElement(n.Fragment,null,n.createElement("span",null," "),n.createElement(s.F,{appLink:e.checkboxAppLink,className:"info-link"},e.checkboxAppLinkText))))}var d=r(83914),m=r(83345),f=r(73814),h=r(35223);function y(e){var t=(0,l.u6)().values[e.fieldName];return"string"!=typeof t?n.createElement(n.Fragment,null):n.createElement("div",{className:"float-end text-muted fw-normal"},t.length,"/",e.limit," characters")}const v={revealPassword:"jCfI0",passwordInput:"RBJnf",passwordContainer:"d78lK",passwordContainerDisabled:"asbVo",infoTooltip:"wzyOG",spinner:"CycFx"};function b(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var g=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var a=0;for(n=Object.getOwnPropertySymbols(e);a<n.length;a++)t.indexOf(n[a])<0&&Object.prototype.propertyIsEnumerable.call(e,n[a])&&(r[n[a]]=e[n[a]])}return r},E="shared.formField";function w(e){var t,r,o=e.children,s=e.showLoadingSpinner,u=g(e,["children","showLoadingSpinner"]),p=(t=n.useState(e.type),r=2,function(e){if(Array.isArray(e))return e}(t)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,a,o,l,i=[],c=!0,s=!1;try{if(o=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;c=!1}else for(;!(c=(n=o.call(r)).done)&&(i.push(n.value),i.length!==t);c=!0);}catch(e){s=!0,a=e}finally{try{if(!c&&null!=r.return&&(l=r.return(),Object(l)!==l))return}finally{if(s)throw a}}return i}}(t,r)||function(e,t){if(e){if("string"==typeof e)return b(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?b(e,t):void 0}}(t,r)||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.")}()),m=p[0],f=p[1],y=i.q.isFunction(o)?function(e){return o(e)}:n.Children.count(o)?o:null;if("password"!==u.type)return s?n.createElement("div",{className:"position-relative"},n.createElement(l.gN,Object.assign({},c.t.omit(u,["formSize"])),y),n.createElement("div",{className:v.spinner},n.createElement(a.Z,{animation:"border",size:"sm"}))):n.createElement(l.gN,Object.assign({},c.t.omit(u,["formSize"])),y);var E="position-relative ".concat(v.passwordContainer);return u.className&&(E+=" ".concat(u.className)),u.disabled&&(E+=" ".concat(v.passwordContainerDisabled)),n.createElement("div",{className:E},n.createElement(l.gN,Object.assign({},c.t.omit(u,["formSize","type","className"]),{type:m,className:"".concat(v.passwordInput," border-0 w-100 h-100 outline-none rounded")}),y),"password"===u.type&&n.createElement(d.x,{svgName:"password"===m?h.vn.VisibleOn:h.vn.VisibleOff,className:"svg-container cursor-pointer ".concat(v.revealPassword),onClick:function(){f("password"===m?"text":"password")}}))}function S(e){var t=e.label,r=e.className,a=e.showCharacterCounter,i=e.showRequiredStar,s=e.infoTooltip,u=e.infoTooltipPlacement,b=e.infoText,S=e.formSize,x=e.showOptionalLabel,k=g(e,["label","className","showCharacterCounter","showRequiredStar","infoTooltip","infoTooltipPlacement","infoText","formSize","showOptionalLabel"]),L=(0,l.u6)(),C=L.errors,O=L.touched,N=function(){};if("checkbox"===k.type){var j=c.t.omit(e,["formSize","infoTooltipPlacement"]);return e.disabled&&(j.onChange=N),n.createElement(p,Object.assign({},j))}var P=Object.assign(Object.assign({},k),{className:f.w.getCustomFormControlClassName(C,O,k.name,S,r,"string"==typeof e.as?e.as:null)});return e.disabled&&(P.onChange=N),n.createElement(o.Z.Group,{className:"form-group"},!!t&&n.createElement(o.Z.Label,{htmlFor:k.id,className:"d-flex align-items-center"},t,i&&n.createElement("span",{className:"text-danger"},"*"),s&&n.createElement(d.x,{className:"svg-container text-muted ".concat(v.infoTooltip),svgName:h.vn.Info,title:s,tooltipPlacement:u,tooltipSpanHack:!0}),x&&n.createElement("span",{className:"text-muted"}," ",n.createElement(m.x,{namespace:E,phrase:"optional"})),!!a&&!!k.maxLength&&n.createElement("div",{className:"ms-auto"},n.createElement(y,{fieldName:k.name,limit:k.maxLength}))),n.createElement(w,Object.assign({},P)),!!b&&n.createElement(o.Z.Text,{className:"text-muted"},b),n.createElement(l.Bc,{name:k.name},(function(e){return n.createElement(o.Z.Control.Feedback,{type:"invalid"},e)})))}w.defaultProps={autoComplete:"off"},S.defaultProps={autoComplete:"off",infoTooltipPlacement:"top"}},82644:(e,t,r)=>{r.d(t,{b:()=>u,n:()=>s});var n=r(32735),a=r(92802),o=r(79014),l=r(1048);function i(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var c=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var a=0;for(n=Object.getOwnPropertySymbols(e);a<n.length;a++)t.indexOf(n[a])<0&&Object.prototype.propertyIsEnumerable.call(e,n[a])&&(r[n[a]]=e[n[a]])}return r};function s(e){var t=e.castInitialValues,r=e.castValuesOnSubmit,s=e.initialValues,u=e.onSubmit,p=c(e,["castInitialValues","castValuesOnSubmit","initialValues","onSubmit"]),d=t&&e.validationSchema?e.validationSchema.cast(function(e){if(!e)return{};var t=l.t.deepClone(e);return function e(r){Object.keys(t).forEach((function(n){t.hasOwnProperty(n)&&(l.t.isObject(r[n])?e(r[n]):null===t[n]&&delete t[n])}))}(t),t}(s)):s,m={allowInitialSubmit:e.allowInitialSubmit};return n.createElement(a.J9,Object.assign({enableReinitialize:!0},p,{initialValues:d,onSubmit:function(t,n){var a=n.setSubmitting,o=n.resetForm,l=n.setFieldError,c=r&&e.validationSchema?e.validationSchema.cast(t):t;u(c,(function(){var e,t,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(r.reset&&o(),r.errors)for(var n=0,c=Object.entries(r.errors);n<c.length;n++){var s=(e=c[n],t=2,function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,a,o,l,i=[],c=!0,s=!1;try{if(o=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;c=!1}else for(;!(c=(n=o.call(r)).done)&&(i.push(n.value),i.length!==t);c=!0);}catch(e){s=!0,a=e}finally{try{if(!c&&null!=r.return&&(l=r.return(),Object(l)!==l))return}finally{if(s)throw a}}return i}}(e,t)||function(e,t){if(e){if("string"==typeof e)return i(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?i(e,t):void 0}}(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.")}()),u=s[0],p=s[1];l(u,p)}a(!1)}))},initialStatus:m}),o.q.isFunction(e.children)?function(t){return e.children(t)}:n.Children.count(e.children)?e.children:null)}function u(){return(0,a.u6)()}s.defaultProps={castInitialValues:!0,castValuesOnSubmit:!0}},73814:(e,t,r)=>{r.d(t,{w:()=>a});var n=r(92802),a={getCustomFormControlClassName:function(e,t,r,a,o,l){var i="";return i=function(e,t){var r="";return r="select"===e?"form-select":"form-control","sm"===t&&(r+=" ".concat(r,"-sm")),"lg"===t&&(r+=" ".concat(r,"-lg")),r}(l,a),(0,n.u9)(t,r)&&(0,n.u9)(e,r)&&(i+=" is-invalid"),o&&(i+=" ".concat(o)),i}}},73667:(e,t,r)=>{r.r(t),r.d(t,{BulkUserUploadPopupView:()=>ye});var n=r(32735),a=r(23481),o=r(81886),l=r(20354),i=r(48288),c=r(75896),s=r(83345),u=r(76881);const p={cell:"PZci6"};function d(e){var t=c.m.first(e.yearGroups),r=Math.floor((e.yearGroups.length-1)/2),a=e.yearGroups[r];return n.createElement(s.D.Provider,{value:"userManager.exampleUserSpreadsheet"},n.createElement("table",{cellPadding:5},n.createElement("tbody",null,n.createElement("tr",{className:"text-center bg-light"},n.createElement("td",{className:"text-nowrap border border-dark ".concat(p.cell)},n.createElement(s.x,{phrase:"a"})),n.createElement("td",{className:"text-nowrap border border-dark ".concat(p.cell)},n.createElement(s.x,{phrase:"b"})),n.createElement("td",{className:"text-nowrap border border-dark ".concat(p.cell)},n.createElement(s.x,{phrase:"c"})),n.createElement("td",{className:"text-nowrap border border-dark ".concat(p.cell)},n.createElement(s.x,{phrase:"d"})),e.userType===u.Y.Learner&&n.createElement("td",{className:"text-nowrap border border-dark ".concat(p.cell)},n.createElement(s.x,{phrase:"e"})),e.showPasswordColumn&&n.createElement("td",{className:"text-nowrap border border-dark ".concat(p.cell)},n.createElement(s.x,{phrase:"f"}))),n.createElement("tr",{className:"fw-semibold"},n.createElement("td",{className:"text-nowrap border border-dark ".concat(p.cell)},n.createElement(s.x,{phrase:"firstName"})),n.createElement("td",{className:"text-nowrap border border-dark ".concat(p.cell)},n.createElement(s.x,{phrase:"lastName"})),e.userType===u.Y.Learner&&n.createElement("td",{className:"text-nowrap border border-dark ".concat(p.cell)},n.createElement(s.x,{phrase:"yearGroup"})),n.createElement("td",{className:"text-nowrap border border-dark ".concat(p.cell)},n.createElement(s.x,{phrase:"email"})),n.createElement("td",{className:"text-nowrap border border-dark ".concat(p.cell)},n.createElement(s.x,{phrase:"username"})),e.showPasswordColumn&&n.createElement("td",{className:"text-nowrap border border-dark ".concat(p.cell)},n.createElement(s.x,{phrase:"password"}))),n.createElement("tr",null,n.createElement("td",{className:"text-nowrap border border-dark ".concat(p.cell)},n.createElement(s.x,{phrase:"maleFirstName"})),n.createElement("td",{className:"text-nowrap border border-dark ".concat(p.cell)},n.createElement(s.x,{phrase:"maleLastName"})),e.userType===u.Y.Learner&&n.createElement("td",{className:"text-nowrap border border-dark ".concat(p.cell)},t.name),n.createElement("td",{className:"text-nowrap border border-dark ".concat(p.cell)},n.createElement(s.x,{phrase:"maleEmail"})),n.createElement("td",{className:"text-nowrap border border-dark ".concat(p.cell)}),e.showPasswordColumn&&n.createElement("td",{className:"text-nowrap border border-dark ".concat(p.cell)},n.createElement(s.x,{phrase:"passwordExample"}))),n.createElement("tr",null,n.createElement("td",{className:"text-nowrap border border-dark ".concat(p.cell)},n.createElement(s.x,{phrase:"femaleFirstName"})),n.createElement("td",{className:"text-nowrap border border-dark ".concat(p.cell)},n.createElement(s.x,{phrase:"femaleLastName"})),e.userType===u.Y.Learner&&n.createElement("td",{className:"text-nowrap border border-dark ".concat(p.cell)},a.name),n.createElement("td",{className:"text-nowrap border border-dark ".concat(p.cell)},e.userType===u.Y.Staff?n.createElement(s.x,{phrase:"femaleEmail"}):""),n.createElement("td",{className:"text-nowrap border border-dark ".concat(p.cell)},n.createElement(s.x,{phrase:"femaleUsername"})),e.showPasswordColumn&&n.createElement("td",{className:"text-nowrap border border-dark ".concat(p.cell)})))))}function m(){return n.createElement("div",{className:"d-inline-block svg-container"},n.createElement("svg",{width:"49px",height:"67px",viewBox:"0 0 49 67"},n.createElement("defs",null,n.createElement("path",{d:"M29.5833333,0 L4.4375,0 C1.996875,0 0,1.996875 0,4.4375 L0,60.6458333 C0,63.0864583 1.996875,65.0833333 4.4375,65.0833333 L42.8958333,65.0833333 C45.3364583,65.0833333 47.3333333,63.0864583 47.3333333,60.6458333 L47.3333333,17.75 L29.5833333,0 Z",id:"path-1"}),n.createElement("path",{d:"M29.5833333,0 L4.4375,0 C1.996875,0 0,1.996875 0,4.4375 L0,60.6458333 C0,63.0864583 1.996875,65.0833333 4.4375,65.0833333 L42.8958333,65.0833333 C45.3364583,65.0833333 47.3333333,63.0864583 47.3333333,60.6458333 L47.3333333,17.75 L29.5833333,0 Z",id:"path-3"}),n.createElement("path",{d:"M29.5833333,0 L4.4375,0 C1.996875,0 0,1.996875 0,4.4375 L0,60.6458333 C0,63.0864583 1.996875,65.0833333 4.4375,65.0833333 L42.8958333,65.0833333 C45.3364583,65.0833333 47.3333333,63.0864583 47.3333333,60.6458333 L47.3333333,17.75 L29.5833333,0 Z",id:"path-5"}),n.createElement("linearGradient",{x1:"50.0053945%",y1:"8.58610612%",x2:"50.0053945%",y2:"100.013939%",id:"linearGradient-7"},n.createElement("stop",{stopColor:"#263238",stopOpacity:"0.2",offset:"0%"}),n.createElement("stop",{stopColor:"#263238",stopOpacity:"0.02",offset:"100%"})),n.createElement("path",{d:"M29.5833333,0 L4.4375,0 C1.996875,0 0,1.996875 0,4.4375 L0,60.6458333 C0,63.0864583 1.996875,65.0833333 4.4375,65.0833333 L42.8958333,65.0833333 C45.3364583,65.0833333 47.3333333,63.0864583 47.3333333,60.6458333 L47.3333333,17.75 L29.5833333,0 Z",id:"path-8"}),n.createElement("path",{d:"M29.5833333,0 L4.4375,0 C1.996875,0 0,1.996875 0,4.4375 L0,60.6458333 C0,63.0864583 1.996875,65.0833333 4.4375,65.0833333 L42.8958333,65.0833333 C45.3364583,65.0833333 47.3333333,63.0864583 47.3333333,60.6458333 L47.3333333,17.75 L29.5833333,0 Z",id:"path-10"}),n.createElement("path",{d:"M29.5833333,0 L4.4375,0 C1.996875,0 0,1.996875 0,4.4375 L0,60.6458333 C0,63.0864583 1.996875,65.0833333 4.4375,65.0833333 L42.8958333,65.0833333 C45.3364583,65.0833333 47.3333333,63.0864583 47.3333333,60.6458333 L47.3333333,17.75 L29.5833333,0 Z",id:"path-12"}),n.createElement("path",{d:"M29.5833333,0 L4.4375,0 C1.996875,0 0,1.996875 0,4.4375 L0,60.6458333 C0,63.0864583 1.996875,65.0833333 4.4375,65.0833333 L42.8958333,65.0833333 C45.3364583,65.0833333 47.3333333,63.0864583 47.3333333,60.6458333 L47.3333333,17.75 L29.5833333,0 Z",id:"path-14"}),n.createElement("radialGradient",{cx:"3.16804688%",cy:"2.71744318%",fx:"3.16804688%",fy:"2.71744318%",r:"161.248516%",gradientTransform:"translate(0.031680,0.027174),scale(1.000000,0.727273),translate(-0.031680,-0.027174)",id:"radialGradient-16"},n.createElement("stop",{stopColor:"#FFFFFF",stopOpacity:"0.1",offset:"0%"}),n.createElement("stop",{stopColor:"#FFFFFF",stopOpacity:"0",offset:"100%"}))),n.createElement("g",{id:"Page-1",stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd"},n.createElement("g",{id:"Consumer-Apps-Sheets-Large-VD-R8-",transform:"translate(-451.000000, -451.000000)"},n.createElement("g",{id:"Hero",transform:"translate(0.000000, 63.000000)"},n.createElement("g",{id:"Personal",transform:"translate(277.000000, 299.000000)"},n.createElement("g",{id:"Sheets-icon",transform:"translate(174.833333, 89.958333)"},n.createElement("g",{id:"Group"},n.createElement("g",{id:"Clipped"},n.createElement("mask",{id:"mask-2",fill:"white"},n.createElement("use",{xlinkHref:"#path-1"})),n.createElement("g",{id:"SVGID_1_"}),n.createElement("path",{d:"M29.5833333,0 L4.4375,0 C1.996875,0 0,1.996875 0,4.4375 L0,60.6458333 C0,63.0864583 1.996875,65.0833333 4.4375,65.0833333 L42.8958333,65.0833333 C45.3364583,65.0833333 47.3333333,63.0864583 47.3333333,60.6458333 L47.3333333,17.75 L36.9791667,10.3541667 L29.5833333,0 Z",id:"Path",fill:"#0F9D58",fillRule:"nonzero",mask:"url(#mask-2)"})),n.createElement("g",{id:"Clipped"},n.createElement("mask",{id:"mask-4",fill:"white"},n.createElement("use",{xlinkHref:"#path-3"})),n.createElement("g",{id:"SVGID_1_"}),n.createElement("path",{d:"M11.8333333,31.8020833 L11.8333333,53.25 L35.5,53.25 L35.5,31.8020833 L11.8333333,31.8020833 Z M22.1875,50.2916667 L14.7916667,50.2916667 L14.7916667,46.59375 L22.1875,46.59375 L22.1875,50.2916667 Z M22.1875,44.375 L14.7916667,44.375 L14.7916667,40.6770833 L22.1875,40.6770833 L22.1875,44.375 Z M22.1875,38.4583333 L14.7916667,38.4583333 L14.7916667,34.7604167 L22.1875,34.7604167 L22.1875,38.4583333 Z M32.5416667,50.2916667 L25.1458333,50.2916667 L25.1458333,46.59375 L32.5416667,46.59375 L32.5416667,50.2916667 Z M32.5416667,44.375 L25.1458333,44.375 L25.1458333,40.6770833 L32.5416667,40.6770833 L32.5416667,44.375 Z M32.5416667,38.4583333 L25.1458333,38.4583333 L25.1458333,34.7604167 L32.5416667,34.7604167 L32.5416667,38.4583333 Z",id:"Shape",fill:"#F1F1F1",fillRule:"nonzero",mask:"url(#mask-4)"})),n.createElement("g",{id:"Clipped"},n.createElement("mask",{id:"mask-6",fill:"white"},n.createElement("use",{xlinkHref:"#path-5"})),n.createElement("g",{id:"SVGID_1_"}),n.createElement("polygon",{id:"Path",fill:"url(#linearGradient-7)",fillRule:"nonzero",mask:"url(#mask-6)",points:"30.8813021 16.4520313 47.3333333 32.9003646 47.3333333 17.75"})),n.createElement("g",{id:"Clipped"},n.createElement("mask",{id:"mask-9",fill:"white"},n.createElement("use",{xlinkHref:"#path-8"})),n.createElement("g",{id:"SVGID_1_"}),n.createElement("g",{id:"Group",mask:"url(#mask-9)"},n.createElement("g",{transform:"translate(26.625000, -2.958333)"},n.createElement("path",{d:"M2.95833333,2.95833333 L2.95833333,16.2708333 C2.95833333,18.7225521 4.94411458,20.7083333 7.39583333,20.7083333 L20.7083333,20.7083333 L2.95833333,2.95833333 Z",id:"Path",fill:"#87CEAC",fillRule:"nonzero"})))),n.createElement("g",{id:"Clipped"},n.createElement("mask",{id:"mask-11",fill:"white"},n.createElement("use",{xlinkHref:"#path-10"})),n.createElement("g",{id:"SVGID_1_"}),n.createElement("path",{d:"M4.4375,0 C1.996875,0 0,1.996875 0,4.4375 L0,4.80729167 C0,2.36666667 1.996875,0.369791667 4.4375,0.369791667 L29.5833333,0.369791667 L29.5833333,0 L4.4375,0 Z",id:"Path",fillOpacity:"0.2",fill:"#FFFFFF",fillRule:"nonzero",mask:"url(#mask-11)"})),n.createElement("g",{id:"Clipped"},n.createElement("mask",{id:"mask-13",fill:"white"},n.createElement("use",{xlinkHref:"#path-12"})),n.createElement("g",{id:"SVGID_1_"}),n.createElement("path",{d:"M42.8958333,64.7135417 L4.4375,64.7135417 C1.996875,64.7135417 0,62.7166667 0,60.2760417 L0,60.6458333 C0,63.0864583 1.996875,65.0833333 4.4375,65.0833333 L42.8958333,65.0833333 C45.3364583,65.0833333 47.3333333,63.0864583 47.3333333,60.6458333 L47.3333333,60.2760417 C47.3333333,62.7166667 45.3364583,64.7135417 42.8958333,64.7135417 Z",id:"Path",fillOpacity:"0.2",fill:"#263238",fillRule:"nonzero",mask:"url(#mask-13)"})),n.createElement("g",{id:"Clipped"},n.createElement("mask",{id:"mask-15",fill:"white"},n.createElement("use",{xlinkHref:"#path-14"})),n.createElement("g",{id:"SVGID_1_"}),n.createElement("path",{d:"M34.0208333,17.75 C31.5691146,17.75 29.5833333,15.7642188 29.5833333,13.3125 L29.5833333,13.6822917 C29.5833333,16.1340104 31.5691146,18.1197917 34.0208333,18.1197917 L47.3333333,18.1197917 L47.3333333,17.75 L34.0208333,17.75 Z",id:"Path",fillOpacity:"0.1",fill:"#263238",fillRule:"nonzero",mask:"url(#mask-15)"}))),n.createElement("path",{d:"M29.5833333,0 L4.4375,0 C1.996875,0 0,1.996875 0,4.4375 L0,60.6458333 C0,63.0864583 1.996875,65.0833333 4.4375,65.0833333 L42.8958333,65.0833333 C45.3364583,65.0833333 47.3333333,63.0864583 47.3333333,60.6458333 L47.3333333,17.75 L29.5833333,0 Z",id:"Path",fill:"url(#radialGradient-16)",fillRule:"nonzero"}))))))))}var f=r(82644),h=r(50023);function y(e){return y="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},y(e)}function v(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,(void 0,a=function(e,t){if("object"!==y(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!==y(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(n.key),"symbol"===y(a)?a:String(a)),n)}var a}function b(e,t){return b=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},b(e,t)}function g(e){return g=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},g(e)}var E=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&b(e,t)}(i,e);var t,r,n,o,l=(n=i,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=g(n);if(o){var r=g(this).constructor;e=Reflect.construct(t,arguments,r)}else e=t.apply(this,arguments);return function(e,t){if(t&&("object"===y(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(this,e)});function i(e,t){var r;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,i),(r=l.call(this,e)).title=e,r.body=t,r}return t=i,(r=[{key:"name",get:function(){return"GoogleSheetsError"}},{key:"dialogOptions",get:function(){return{title:this.title,text:this.body,buttons:[{text:a.T.getPhrase("userManager.googleSheetsSelector","okay"),className:"btn btn-dark",success:!0}]}}}])&&v(t.prototype,r),Object.defineProperty(t,"prototype",{writable:!1}),i}(r(47663).S),w=r(92802),S=r(38365),x=r(13876),k="userManager.googleSheetsSelector",L=a.T.encloseNamespace(k);function C(e){var t,r=(0,f.b)();return n.useEffect((function(){e.spreadsheetSheets&&1===e.spreadsheetSheets.length&&r.setFieldValue("spreadsheetRange",c.m.first(e.spreadsheetSheets))}),[e.spreadsheetSheets]),n.createElement(w.l0,null,n.createElement(S.W,{as:"select",label:L("spreadsheetId"),name:"spreadsheetId",value:r.values.spreadsheetId,onChange:function(t){e.onSelectSpreadsheet(t.target.value),r.setFieldValue("spreadsheetId",t.target.value)}},n.createElement("option",{value:""},a.T.getPhrase(k,"selectSpreadsheetId")),e.spreadsheets.map((function(e){return n.createElement("option",{key:e.id,value:e.id},e.name)}))),n.createElement(S.W,{as:"select",label:L("spreadsheetRange"),name:"spreadsheetRange",value:r.values.spreadsheetRange,onChange:function(e){return r.setFieldValue("spreadsheetRange",e.target.value)},disabled:!(null===(t=e.spreadsheetSheets)||void 0===t?void 0:t.length)},n.createElement("option",{value:""},a.T.getPhrase(k,"selectSpreadsheetRange")),e.spreadsheetSheets.map((function(e){return n.createElement("option",{key:e,value:e},e)}))),n.createElement(x.u,null,n.createElement(x.u.Cancel,{onClick:e.onClickCancel}),n.createElement(x.u.Submit,{variant:"dark",text:L("upload")})))}var O=r(5173),N=a.T.encloseNamespace("userManager.googleSheetsSelector"),j=(0,O.Ry)().shape({spreadsheetId:(0,O.Z_)().required((function(){return N("spreadsheetIdRequired")})).default(""),spreadsheetRange:(0,O.Z_)().required((function(){return N("spreadsheetRangeRequired")})).default("")});function P(e){return P="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},P(e)}function T(){T=function(){return t};var e,t={},r=Object.prototype,n=r.hasOwnProperty,a=Object.defineProperty||function(e,t,r){e[t]=r.value},o="function"==typeof Symbol?Symbol:{},l=o.iterator||"@@iterator",i=o.asyncIterator||"@@asyncIterator",c=o.toStringTag||"@@toStringTag";function s(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{s({},"")}catch(e){s=function(e,t,r){return e[t]=r}}function u(e,t,r,n){var o=t&&t.prototype instanceof v?t:v,l=Object.create(o.prototype),i=new I(n||[]);return a(l,"_invoke",{value:C(e,r,i)}),l}function p(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}t.wrap=u;var d="suspendedStart",m="suspendedYield",f="executing",h="completed",y={};function v(){}function b(){}function g(){}var E={};s(E,l,(function(){return this}));var w=Object.getPrototypeOf,S=w&&w(w(U([])));S&&S!==r&&n.call(S,l)&&(E=S);var x=g.prototype=v.prototype=Object.create(E);function k(e){["next","throw","return"].forEach((function(t){s(e,t,(function(e){return this._invoke(t,e)}))}))}function L(e,t){function r(a,o,l,i){var c=p(e[a],e,o);if("throw"!==c.type){var s=c.arg,u=s.value;return u&&"object"==P(u)&&n.call(u,"__await")?t.resolve(u.__await).then((function(e){r("next",e,l,i)}),(function(e){r("throw",e,l,i)})):t.resolve(u).then((function(e){s.value=e,l(s)}),(function(e){return r("throw",e,l,i)}))}i(c.arg)}var o;a(this,"_invoke",{value:function(e,n){function a(){return new t((function(t,a){r(e,n,t,a)}))}return o=o?o.then(a,a):a()}})}function C(t,r,n){var a=d;return function(o,l){if(a===f)throw new Error("Generator is already running");if(a===h){if("throw"===o)throw l;return{value:e,done:!0}}for(n.method=o,n.arg=l;;){var i=n.delegate;if(i){var c=O(i,n);if(c){if(c===y)continue;return c}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(a===d)throw a=h,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);a=f;var s=p(t,r,n);if("normal"===s.type){if(a=n.done?h:m,s.arg===y)continue;return{value:s.arg,done:n.done}}"throw"===s.type&&(a=h,n.method="throw",n.arg=s.arg)}}}function O(t,r){var n=r.method,a=t.iterator[n];if(a===e)return r.delegate=null,"throw"===n&&t.iterator.return&&(r.method="return",r.arg=e,O(t,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),y;var o=p(a,t.iterator,r.arg);if("throw"===o.type)return r.method="throw",r.arg=o.arg,r.delegate=null,y;var l=o.arg;return l?l.done?(r[t.resultName]=l.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,y):l:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,y)}function N(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 j(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function I(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(N,this),this.reset(!0)}function U(t){if(t||""===t){var r=t[l];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var a=-1,o=function r(){for(;++a<t.length;)if(n.call(t,a))return r.value=t[a],r.done=!1,r;return r.value=e,r.done=!0,r};return o.next=o}}throw new TypeError(P(t)+" is not iterable")}return b.prototype=g,a(x,"constructor",{value:g,configurable:!0}),a(g,"constructor",{value:b,configurable:!0}),b.displayName=s(g,c,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===b||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,g):(e.__proto__=g,s(e,c,"GeneratorFunction")),e.prototype=Object.create(x),e},t.awrap=function(e){return{__await:e}},k(L.prototype),s(L.prototype,i,(function(){return this})),t.AsyncIterator=L,t.async=function(e,r,n,a,o){void 0===o&&(o=Promise);var l=new L(u(e,r,n,a),o);return t.isGeneratorFunction(r)?l:l.next().then((function(e){return e.done?e.value:l.next()}))},k(x),s(x,c,"Generator"),s(x,l,(function(){return this})),s(x,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},t.values=U,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(j),!t)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=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 r=this;function a(n,a){return i.type="throw",i.arg=t,r.next=n,a&&(r.method="next",r.arg=e),!!a}for(var o=this.tryEntries.length-1;o>=0;--o){var l=this.tryEntries[o],i=l.completion;if("root"===l.tryLoc)return a("end");if(l.tryLoc<=this.prev){var c=n.call(l,"catchLoc"),s=n.call(l,"finallyLoc");if(c&&s){if(this.prev<l.catchLoc)return a(l.catchLoc,!0);if(this.prev<l.finallyLoc)return a(l.finallyLoc)}else if(c){if(this.prev<l.catchLoc)return a(l.catchLoc,!0)}else{if(!s)throw new Error("try statement without catch or finally");if(this.prev<l.finallyLoc)return a(l.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var a=this.tryEntries[r];if(a.tryLoc<=this.prev&&n.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 l=o?o.completion:{};return l.type=e,l.arg=t,o?(this.method="next",this.next=o.finallyLoc,y):this.complete(l)},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),y},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),j(r),y}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var a=n.arg;j(r)}return a}}throw new Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:U(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),y}},t}function I(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,a,o,l,i=[],c=!0,s=!1;try{if(o=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;c=!1}else for(;!(c=(n=o.call(r)).done)&&(i.push(n.value),i.length!==t);c=!0);}catch(e){s=!0,a=e}finally{try{if(!c&&null!=r.return&&(l=r.return(),Object(l)!==l))return}finally{if(s)throw a}}return i}}(e,t)||function(e,t){if(e){if("string"==typeof e)return U(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?U(e,t):void 0}}(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 U(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var F=function(e,t,r,n){return new(r||(r=Promise))((function(a,o){function l(e){try{c(n.next(e))}catch(e){o(e)}}function i(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?a(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(l,i)}c((n=n.apply(e,t||[])).next())}))},A="userManager.googleSheetsSelector",_=a.T.encloseNamespace(A),M={spreadsheetId:"",spreadsheetRange:""},R={apiKey:"AIzaSyBqN38T3KYOCte1NGMv2i2Izsr3E5o_uyU",clientId:"963556877348-d70e06codundropau356uen98pbq3j7j.apps.googleusercontent.com",discoveryDocs:["https://www.googleapis.com/discovery/v1/apis/drive/v3/rest","https://sheets.googleapis.com/$discovery/rest?version=v4"],scope:"https://www.googleapis.com/auth/drive.readonly"};function G(e){var t=I(n.useState([]),2),r=t[0],a=t[1],l=I(n.useState([]),2),i=l[0],c=l[1],u=n.useRef(null),p=n.useRef(null);function d(){return F(this,void 0,void 0,T().mark((function t(){return T().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,u.current.signIn();case 3:if(u.current.currentUser.get().hasGrantedScopes(R.scope)){t.next=7;break}return y(_("rejectScopeTitle"),_("rejectScopeMessage")),t.abrupt("return");case 7:m(),t.next=14;break;case 10:t.prev=10,t.t0=t.catch(0),y(_("authErrorTitle"),_("authErrorMessage")),e.onClickCancel();case 14:case"end":return t.stop()}}),t,null,[[0,10]])})))}function m(){var e;return F(this,void 0,void 0,T().mark((function t(){var r,n;return T().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,gapi.client.drive.files.list({q:"mimeType='application/vnd.google-apps.spreadsheet'"});case 3:if(r=t.sent,n=null===(e=null==r?void 0:r.result)||void 0===e?void 0:e.files,Array.isArray(n)){t.next=8;break}return y(_("spreadsheetFetchErrorTitle"),_("spreadsheetFetchErrorMessage")),t.abrupt("return");case 8:if(n.length){t.next=11;break}return y(_("noSpreadsheetsErrorTitle"),_("noSpreadsheetsErrorMessage")),t.abrupt("return");case 11:a(n),t.next=17;break;case 14:t.prev=14,t.t0=t.catch(0),y(_("spreadsheetFetchErrorTitle"),_("spreadsheetFetchErrorMessage"));case 17:case"end":return t.stop()}}),t,null,[[0,14]])})))}function y(e,t){o.Q.Ry.throw(new E(e,t))}return n.useEffect((function(){var e=this;gapi.load("client:auth2",(function(){return F(e,void 0,void 0,T().mark((function e(){var t;return T().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,gapi.client.init(R);case 3:if(u.current=gapi.auth2.getAuthInstance(),(t=u.current.currentUser.get()).isSignedIn()){e.next=8;break}return d(),e.abrupt("return");case 8:if(p.current=u.current.isSignedIn.listen((function(e){e||y(_("authErrorTitle"),_("authErrorMessage"))})),t.hasGrantedScopes(R.scope)){e.next=12;break}return t.grant(R).then(m).catch((function(){return y(_("rejectScopeTitle"),_("rejectScopeMessage"))})),e.abrupt("return");case 12:m(),e.next=18;break;case 15:e.prev=15,e.t0=e.catch(0),y(_("authErrorTitle"),_("authErrorMessage"));case 18:case"end":return e.stop()}}),e,null,[[0,15]])})))}))}),[]),n.useEffect((function(){if(p.current)return function(){var e;null===(e=p.current)||void 0===e||e.remove()}}),[p.current]),r.length?n.createElement(f.n,{initialValues:M,validationSchema:j,onSubmit:function(t){var r;return F(this,void 0,void 0,T().mark((function n(){var a,o,l;return T().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(a=t.spreadsheetId,o=t.spreadsheetRange,a&&o){n.next=4;break}return y(_("spreadsheetConfirmErrorTitle"),_("spreadsheetConfirmErrorMessage")),n.abrupt("return");case 4:return n.prev=4,n.next=7,gapi.client.sheets.spreadsheets.values.get({spreadsheetId:a,range:o});case 7:l=n.sent,(null===(r=p.current)||void 0===r?void 0:r.remove)&&p.current.remove(),e.onSelectSpreadsheet(l.result.values),n.next=15;break;case 12:n.prev=12,n.t0=n.catch(4),y(_("spreadsheetConfirmErrorTitle"),_("spreadsheetConfirmErrorMessage"));case 15:case"end":return n.stop()}}),n,null,[[4,12]])})))}},n.createElement(C,{onClickCancel:e.onClickCancel,onSelectSpreadsheet:function(e){var t,r;return F(this,void 0,void 0,T().mark((function n(){var a,o;return T().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(e){n.next=3;break}return c([]),n.abrupt("return");case 3:return n.prev=3,n.next=6,gapi.client.sheets.spreadsheets.get({spreadsheetId:e});case 6:if(a=n.sent,null==(o=null===(r=null===(t=null==a?void 0:a.result)||void 0===t?void 0:t.sheets)||void 0===r?void 0:r.map((function(e){var t;return null===(t=null==e?void 0:e.properties)||void 0===t?void 0:t.title})))?void 0:o.length){n.next=11;break}return y(_("spreadsheetFetchErrorTitle"),_("spreadsheetFetchErrorMessage")),n.abrupt("return");case 11:c(o),n.next=17;break;case 14:n.prev=14,n.t0=n.catch(3),y(_("spreadsheetFetchErrorTitle"),_("spreadsheetFetchErrorMessage"));case 17:case"end":return n.stop()}}),n,null,[[3,14]])})))},spreadsheets:r,spreadsheetSheets:i})):n.createElement(n.Fragment,null,n.createElement(h.E,null),n.createElement("p",{className:"text-center mt-n4 pb-3"},n.createElement(s.x,{namespace:A,phrase:"authenticating"})))}var V,Z=r(89422),H=r(90911),D=r(41360),z=r(19717),Y=r(83914),q=r(35223);function B(e){return B="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},B(e)}function W(e,t){if(e){if("string"==typeof e)return $(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?$(e,t):void 0}}function $(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function K(e,t,r){return(t=function(e){var t=function(e,t){if("object"!==B(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!==B(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===B(t)?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var Q=(K(V={},u.Y.Learner,"userManager.uploadStudentSpreadsheet"),K(V,u.Y.Staff,"userManager.uploadStaffSpreadsheet"),K(V,u.Y.Unknown,""),V);function J(e){var t,r,a=(t=n.useState(!1),r=2,function(e){if(Array.isArray(e))return e}(t)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,a,o,l,i=[],c=!0,s=!1;try{if(o=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;c=!1}else for(;!(c=(n=o.call(r)).done)&&(i.push(n.value),i.length!==t);c=!0);}catch(e){s=!0,a=e}finally{try{if(!c&&null!=r.return&&(l=r.return(),Object(l)!==l))return}finally{if(s)throw a}}return i}}(t,r)||W(t,r)||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.")}()),l=a[0],c=a[1],u=Q[e.userType];function p(t){if(!z.b.validateEmptySpreadsheetData(t)){var r=function(e){return function(e){if(Array.isArray(e))return $(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||W(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.")}()}(t),n=r.shift(),a=z.b.validateUploadedSpreadsheet(n,e.userType,e.templateLink),l=a.isValid,i=a.errorMessage;if(l){var c=z.b.buildUsersFromSpreadsheet(r,e.userType,e.currentUser.customerId,e.yearGroups);c.length>Z.K.MAX_USER_SPREADSHEET_ROWS?o.Q.Ry.throw(new D._(Z.K.MAX_USER_SPREADSHEET_ROWS)):e.onSelectSpreadsheet(c)}else o.Q.Ry.throw(new H.d(i))}}return l?n.createElement(G,{onSelectSpreadsheet:p,onClickCancel:e.onClickCancel}):n.createElement(s.D.Provider,{value:u},n.createElement("div",{className:"pb-3"},n.createElement("div",{className:"h6"},n.createElement(s.x,{phrase:"downloadTemplateHeading"})),n.createElement("p",{className:"ms-n1 ps-3"},n.createElement(s.x,{phrase:"downloadTemplateInfo"})),n.createElement("div",{className:"ms-n1 ps-3"},n.createElement("a",{className:"btn btn-outline-dark mx-auto",download:!0,href:e.templateLink},n.createElement(Y.x,{svgName:q.vn.Download,className:"svg-container std me-1 ms-n1 align-middle"}),n.createElement("div",{className:"align-middle d-inline-block"},n.createElement(s.x,{phrase:"downloadBtn"}))))),n.createElement("div",{className:"pb-3"},n.createElement("div",{className:"h6"},n.createElement(s.x,{phrase:"addUsersHeading"})),n.createElement("p",{className:"ms-n1 ps-3"},n.createElement(s.x,{phrase:"addUsersInfo"})),n.createElement("div",{className:"mx-n1 px-3"},n.createElement(d,{userType:e.userType,yearGroups:e.yearGroups,showPasswordColumn:e.showPasswordColumn}))),n.createElement("div",null,n.createElement("div",{className:"h6"},n.createElement(s.x,{phrase:"uploadHeading"})),n.createElement("div",{className:"d-inline-block ms-n1 ps-3 mt-1"},!("joshua.taylor@clickview.com.au"!==e.currentUser.username)&&n.createElement("div",{className:"d-inline-block me-2"},n.createElement("button",{className:"btn btn-outline-dark d-flex align-items-center justify-content-center ps-1 mb-2 w-100",onClick:function(){return c(!0)}},n.createElement("div",{className:"me-1"},n.createElement(m,null)),n.createElement(s.x,{phrase:"googleSheets"}))),n.createElement("div",{className:"d-inline-block"},n.createElement(i.H,{onSelectSpreadsheet:p})))))}var X,ee=r(26055),te=r(43820),re=r(45541),ne=r(9111),ae=r(31949),oe=r(14070),le=r(97291);function ie(e){return ie="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},ie(e)}function ce(e,t,r){return(t=function(e){var t=function(e,t){if("object"!==ie(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!==ie(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===ie(t)?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var se=(ce(X={},u.Y.Learner,"/templates/Template_Students.csv"),ce(X,u.Y.Staff,"/templates/Template_Staff.csv"),ce(X,u.Y.Unknown,""),X),ue=r(47288);const pe={modalWidth:"olOSv"};var de;function me(e){return me="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},me(e)}function fe(e,t,r){return(t=function(e){var t=function(e,t){if("object"!==me(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!==me(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===me(t)?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var he=(fe(de={},u.Y.Learner,"userManager.bulkStudentUploadPopup"),fe(de,u.Y.Staff,"userManager.bulkStaffUploadPopup"),fe(de,u.Y.Unknown,""),de);function ye(e){var t=(0,re.V)().setUsers,r=l.a.useBasicFetch(ae.N.currentUser()),i=l.a.useBasicFetch(r.data&&ue.N.yearGroups(r.data.customerId)),c=!!r.data&&!!i.data;return n.createElement(ee.A.Provider,{value:te.a.Primary},n.createElement(ne.G,{closePopup:e.closePopup,title:a.T.getPhrase(he[e.userType],"heading"),showLoadingSpinner:!c,dialogClassName:pe.modalWidth},c&&n.createElement(J,{userType:e.userType,onSelectSpreadsheet:function(r){t(r),e.closePopup(),o.Q.C$.trigger({application:le.O.USER_MANAGER,action:oe.e.UserManager.USER_UPLOAD_REVIEW_ACCOUNTS,params:{userType:e.userType}})},onClickCancel:e.closePopup,templateLink:se[e.userType],currentUser:r.data,yearGroups:i.data,showPasswordColumn:e.userType===u.Y.Learner})))}}}]);
@@ -0,0 +1,2 @@
1
+ /*! For license information please see 3789-e3924e640f-lite.chunk.js.LICENSE.txt */
2
+ "use strict";(self.webpackChunk_clickview_lite=self.webpackChunk_clickview_lite||[]).push([[3789],{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 i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,(void 0,o=function(e,t){if("object"!==r(e)||null===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)}(i.key),"symbol"===r(o)?o:String(o)),i)}var o}n.d(t,{n:()=>o});var o=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:()=>P,R:()=>O});var r=n(32735),i=n(39202),o=n(97395),a=n(49985),s=n(65858),u=n(36848),c=n(78276),l=n(76177),f=n(71063),h=n(54610),p=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:h.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:h.h2.Medium,resizeType:h.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?h.__.Pdf:e.metadata.type===y.L.Image?h.__.Thumbnails:(null===(t=e.pdf)||void 0===t?void 0:t.url)?h.__.Pdf:(e.metadata.type,y.L.Zip,h.__.Thumbnails):h.__.Link}function P(e){var t,n,i,o,a,u,f,h=null,p=0;"metadata"in e.data&&(h=e.data.metadata,p=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==h?void 0:h.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(p,"deg)")},alt:e.data.name,analyticsOptions:{location:s.LZ.SlidingListItem},errorFallbackImageSrc:e.imageErrorFallbackUrl,imageClassName:(null==h?void 0:h.type)===y.L.Image?"".concat(b.imageTypeResource," ").concat(b.imageStyle):"",preload:e.preloadImage,preventLoad:!e.preloadImage})))}P.defaultProps={preloadImage:!0,actionBehaviour:"normal"};var O=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,[]),h=(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===p.E.Resource?s.py.Resource:s.py.Link});function m(){a.k.logUserAction(v,g)}var w,O=!!e.data.url;return l.applyHoverState=h||O,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(P,Object.assign({},l))):h?"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(P,Object.assign({},l))):r.createElement(u.F,{appLink:e.getAppLink(e.data),className:w,analyticsData:v,analyticsOptions:g},r.createElement(P,Object.assign({},l))):O?r.createElement("a",{href:e.data.url,className:w,onClick:m},r.createElement(P,Object.assign({},l))):r.createElement("div",{className:w},r.createElement(P,Object.assign({},l)))))}))},36:(e,t,n)=>{n.r(t),n.d(t,{ClickViewPlayer:()=>Cn});var r=n(32735),i=n(51482),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,(void 0,i=function(e,t){if("object"!==a(e)||null===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)}(r.key),"symbol"===a(i)?i:String(i)),r)}var i}function u(){return u="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=l(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}},u.apply(this,arguments)}function c(e,t){return c=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},c(e,t)}function l(e){return l=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},l(e)}var f=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&c(e,t)}(f,e);var t,n,r,i,o=(r=f,i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=l(r);if(i){var n=l(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return 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)}(this,e)});function f(){var e;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,f),(e=o.apply(this,arguments)).alwaysCollapsed=!1,e.isCollapsed=!1,e.isCollabsible=!0,e}return t=f,(n=[{key:"buildCSSClass",value:function(){return"cv-create-clip-button"}},{key:"getCollabsibleName",value:function(){return this.controlText_}},{key:"getCollabsibleValue",value:function(){return""}},{key:"showInCollabsibleMenu",value:function(){return!0}},{key:"showCollapsibleMenu",value:function(){u(l(f.prototype),"handleClick",this).call(this,null)}}])&&s(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),f}(o.Z.getComponent("Button"));function h(e){return h="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},h(e)}function p(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,(void 0,i=function(e,t){if("object"!==h(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!==h(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(r.key),"symbol"===h(i)?i:String(i)),r)}var i}function y(e,t){return y=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},y(e,t)}function d(e){return d=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},d(e)}f.prototype.controlText_="Create Clip",o.Z.registerComponent("CreateClipButton",f);var v=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&y(e,t)}(a,e);var t,n,r,i,o=(r=a,i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=d(r);if(i){var n=d(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return function(e,t){if(t&&("object"===h(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(this,e)});function a(e,t){var n;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),(n=o.call(this,e,t)).options=t,e.ready((function(){return n.onReady()})),n}return t=a,(n=[{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)}}])&&p(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),a}(o.Z.getPlugin("plugin"));function b(e){return b="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},b(e)}function g(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,(void 0,i=function(e,t){if("object"!==b(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!==b(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(r.key),"symbol"===b(i)?i:String(i)),r)}var i}function m(e,t){return m=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},m(e,t)}function w(e){return w=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},w(e)}o.Z.registerPlugin("createClipButtonPlugin",v);var P=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&m(e,t)}(a,e);var t,n,r,i,o=(r=a,i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=w(r);if(i){var n=w(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return function(e,t){if(t&&("object"===b(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(this,e)});function a(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),o.apply(this,arguments)}return t=a,(n=[{key:"handlePictureInPictureEnabledChange",value:function(){this.enable()}}])&&g(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),a}(o.Z.getComponent("PictureInPictureToggle"));function O(e){return O="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},O(e)}function 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,(void 0,i=function(e,t){if("object"!==O(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!==O(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(r.key),"symbol"===O(i)?i:String(i)),r)}var i}function k(){return k="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=E(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}},k.apply(this,arguments)}function j(e,t){return j=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},j(e,t)}function E(e){return E=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},E(e)}o.Z.registerComponent("PictureInPictureToggle",P);var C=o.Z.getComponent("PlayToggle"),T=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&j(e,t)}(a,e);var t,n,r,i,o=(r=a,i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=E(r);if(i){var n=E(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return function(e,t){if(t&&("object"===O(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(this,e)});function a(e,t){var n;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),(n=o.call(this,e,t)).pictureInPictureEnabled=!1,n.options=t,n.bindFunctions(),n}return t=a,(n=[{key:"bindFunctions",value:function(){this.requestPictureInPicture=this.requestPictureInPicture.bind(this),this.exitPictureInPicture=this.exitPictureInPicture.bind(this),this.onPlayerResize=this.onPlayerResize.bind(this),this.playerRequestPictureInPictureFn=this.player.requestPictureInPicture,this.playerExitPictureInPictureFn=this.player.exitPictureInPicture,this.player.requestPictureInPicture=this.requestPictureInPicture,this.player.exitPictureInPicture=this.exitPictureInPicture}},{key:"enablePictureInPicture",value:function(){var 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 C(this.player),this.playToggle.addClass("cv-pip-play-toggle"),this.player.addChild(this.playToggle),this.player.paused()?this.playToggle.handlePause():this.playToggle.handlePlay()}},{key:"removePipStyles",value:function(){this.player.removeClass("cv-picture-in-picture"),this.player.removeChild(this.playToggle),delete this.playToggle}},{key:"requestPictureInPicture",value:function(){var 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,k(E(a.prototype),"dispose",this).call(this)}}])&&S(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),a}(o.Z.getPlugin("plugin"));o.Z.registerPlugin("pictureInPicture",T);var x=n(23035),_=n(42892),I=n(73758);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 M(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,(void 0,i=function(e,t){if("object"!==R(e)||null===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)}(r.key),"symbol"===R(i)?i:String(i)),r)}var i}function L(){return L="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=B(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}},L.apply(this,arguments)}function D(e,t){return D=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},D(e,t)}function N(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function B(e){return B=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},B(e)}var F=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&D(e,t)}(s,e);var t,n,r,i,a=(r=s,i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=B(r);if(i){var n=B(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return 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 N(e)}(this,e)});function s(e,t){var n;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,s),(n=a.call(this,e,t)).hasBuffered=!1,n.hasPlayed=!1,n.eventsService=I.n,n.pointOfInterest=t.pointOfInterest,n.onMouseOver=n.onMouseOver.bind(N(n)),n.onMouseLeave=n.onMouseLeave.bind(N(n)),n.onGlancePointOfInterestMouseEnter=n.onGlancePointOfInterestMouseEnter.bind(N(n)),n.onGlancePointOfInterestMouseLeave=n.onGlancePointOfInterestMouseLeave.bind(N(n)),n.initialize(),n}return t=s,(n=[{key:"initialize",value:function(){this.setPosition(),this.bindListeners()}},{key:"buildCSSClass",value:function(){return"cv-point-of-interest-indicator ".concat(L(B(s.prototype),"buildCSSClass",this).call(this))}},{key:"createEl",value:function(e,t,n){return L(B(s.prototype),"createEl",this).call(this,e,Object.assign(Object.assign({},t),{className:this.buildCSSClass()}),n)}},{key:"bindListeners",value:function(){this.on("mouseover",this.onMouseOver),this.on("mouseleave",this.onMouseLeave),this.eventsService.subscribe("glance:poi:mouseover",this.onGlancePointOfInterestMouseEnter),this.eventsService.subscribe("glance:poi:mouseleave",this.onGlancePointOfInterestMouseLeave)}},{key:"dispose",value:function(){this.eventsService.unsubscribe("glance:poi:mouseover",this.onGlancePointOfInterestMouseEnter),this.eventsService.unsubscribe("glance:poi:mouseleave",this.onGlancePointOfInterestMouseLeave)}},{key:"getPointOfInterestTime",value:function(){return this.pointOfInterest.startTime}},{key:"setPosition",value:function(){var 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")}}])&&M(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),s}(o.Z.getComponent("Component"));function V(e){return V="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},V(e)}function A(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,(void 0,i=function(e,t){if("object"!==V(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!==V(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(r.key),"symbol"===V(i)?i:String(i)),r)}var i}function U(){return U="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=z(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}},U.apply(this,arguments)}function Z(e,t){return Z=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Z(e,t)}function z(e){return z=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},z(e)}var G=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Z(e,t)}(s,e);var t,n,r,i,a=(r=s,i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=z(r);if(i){var n=z(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return function(e,t){if(t&&("object"===V(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(this,e)});function s(e,t){var n;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,s),(n=a.call(this,e,t)).pointsOfInterestVisible=t.pointsOfInterestVisible,n.toggle(n.pointsOfInterestVisible),n}return t=s,(n=[{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,t,n){this.handlerBound||(this.handleToggle=this.handleToggle.bind(this),this.handlerBound=!0),this.toggleEl&&this.toggleEl.removeEventListener("click",this.handleToggle),this.toggleEl=o.Z.dom.createEl("div",{className:"custom-toggle toggle-option float-end",innerHTML:'<span class="handle"></span></div>'}),this.toggleEl.addEventListener("click",this.handleToggle);var r=U(z(s.prototype),"createEl",this).call(this,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>'},n);return r.children[1].appendChild(this.toggleEl),r}}])&&A(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),s}(o.Z.getComponent("MenuItem"));function q(e){return q="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},q(e)}function H(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,(void 0,i=function(e,t){if("object"!==q(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!==q(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(r.key),"symbol"===q(i)?i:String(i)),r)}var i}function W(e,t){return W=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},W(e,t)}function Y(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function $(e){return $=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},$(e)}o.Z.registerComponent("PointsOfInterestMenuItem",G);var Q=o.Z.getPlugin("plugin"),J="cvplayer-points-of-interest",X=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&W(e,t)}(a,e);var t,n,r,i,o=(r=a,i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=$(r);if(i){var n=$(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return function(e,t){if(t&&("object"===q(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return Y(e)}(this,e)});function a(e,t){var n;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),(n=o.call(this,e)).pointOfInterestIndicators=[],n.enabled=!0,n.pointsOfInterest=null==t?void 0:t.pointsOfInterest,n.initialize=n.initialize.bind(Y(n)),n.updateBuffered=n.updateBuffered.bind(Y(n)),n.updatePlaybackProgress=n.updatePlaybackProgress.bind(Y(n)),n.player.one("loadedmetadata",(function(){return n.player.ready(n.initialize)})),n}return t=a,(n=[{key:"initialize",value:function(){this.pointsOfInterest&&(_.S.hasLocalStorage()&&"false"===_.S.get(J)&&(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){_.S.set(J,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 F(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:G,name:"PointsOfInterestMenuItem",options:{pointsOfInterestVisible:this.enabled}})}},{key:"updateBuffered",value:function(){var e=this;this.pointOfInterestIndicators.forEach((function(t){return t.updateBuffered((0,x.b)(e.player))}))}},{key:"updatePlaybackProgress",value:function(){var e=this;this.pointOfInterestIndicators.forEach((function(t){return t.updatePlaybackProgress(e.player.currentTime())}))}}])&&H(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),a}(Q);o.Z.registerPlugin("pointsOfInterestPlugin",X),n(93262);var K=n(95569),ee=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()};function te(e){var t="function"==typeof Map?new Map:void 0;return te=function(e){if(null===e||!function(e){try{return-1!==Function.toString.call(e).indexOf("[native code]")}catch(t){return"function"==typeof e}}(e))return e;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,n)}function n(){return ne(e,arguments,oe(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),ie(n,e)},te(e)}function ne(e,t,n){return ne=re()?Reflect.construct.bind():function(e,t,n){var r=[null];r.push.apply(r,t);var i=new(Function.bind.apply(e,r));return n&&ie(i,n.prototype),i},ne.apply(null,arguments)}function re(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}function ie(e,t){return ie=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},ie(e,t)}function oe(e){return oe=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},oe(e)}function ae(e){return ae="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},ae(e)}function se(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function ue(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,(void 0,i=function(e,t){if("object"!==ae(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!==ae(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(r.key),"symbol"===ae(i)?i:String(i)),r)}var i}function ce(e,t,n){return t&&ue(e.prototype,t),n&&ue(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}var le=function(){function e(){se(this,e),this.callbacks=[],this.predicates=[],this.controller=new AbortController,this.signal=this.controller.signal,this.trigger=this.trigger.bind(this),this.on=this.on.bind(this),this.one=this.one.bind(this),this.off=this.off.bind(this),this.dispose=this.dispose.bind(this),this.isDisposed=this.isDisposed.bind(this)}return ce(e,[{key:"trigger",value:function(e){var t=this;this.callbacks.forEach((function(n,r){var i=t.predicates[r];i&&!i(e)||n(e)}))}},{key:"on",value:function(e){var t=this;this.isDisposed()&&console.warn("This EventChannel instance been disposed - this is a no-op");var n=this.callbacks.length;this.callbacks[n]=e,this.predicates[n]=function(){return!0};var r=function(){t.off(e)};return{off:r,filter:function(e){return t.predicates[n]=e,r}}}},{key:"one",value:function(){var e,t=this,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:function(){return!0};return this.isDisposed()?fe.reject(new Error("This EventChannel instance has been disposed")):new fe((function(r,i){e=t.on((function(n){t.signal.removeEventListener("abort",o),e(),r(n)})).filter(n);var o=function(){e(),i(new Error("Aborted while waiting for message"))};t.signal.addEventListener("abort",o,{once:!0})}),(function(){e()}))}},{key:"off",value:function(e){var t=this.callbacks.indexOf(e);-1!==t&&(this.callbacks.splice(t,1),this.predicates.splice(t,1))}},{key:"dispose",value:function(){this.callbacks.length=0,this.predicates.length=0,this.controller.abort()}},{key:"isDisposed",value:function(){return this.signal.aborted}}]),e}(),fe=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&ie(e,t)}(i,e);var t,n,r=(t=i,n=re(),function(){var e,r=oe(t);if(n){var i=oe(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return function(e,t){if(t&&("object"===ae(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(this,e)});function i(e,t){var n;return se(this,i),(n=r.call(this,e)).onTimeout=t,n.bindFunctions(),n}return ce(i,[{key:"bindFunctions",value:function(){this.timeout=this.timeout.bind(this)}},{key:"timeout",value:function(e){var t=this;return new Promise((function(n,r){t.then(n).catch(r).finally((function(){return clearTimeout(i)}));var i=setTimeout((function(){var e;null===(e=t.onTimeout)||void 0===e||e.call(t),r(new Error("Promise timed out"))}),e)}))}}],[{key:"reject",value:function(e){return new i((function(t,n){return n(e)}))}}]),i}(te(Promise)),he=function(){function e(){se(this,e),this.channels={},this.trigger=this.trigger.bind(this),this.on=this.on.bind(this),this.one=this.one.bind(this),this.off=this.off.bind(this),this.dispose=this.dispose.bind(this),this.getChannel=this.getChannel.bind(this)}return ce(e,[{key:"trigger",value:function(e,t){this.getChannel(e).trigger(t)}},{key:"on",value:function(e,t){return this.getChannel(e).on(t)}},{key:"one",value:function(e,t){return this.getChannel(e).one(t)}},{key:"off",value:function(e,t){this.getChannel(e).off(t)}},{key:"dispose",value:function(){this.trigger("dispose",pe.void),Object.values(this.channels).forEach((function(e){return e.dispose()})),this.channels={}}},{key:"getChannel",value:function(e){return this.channels[e]||(this.channels[e]=new le),this.channels[e]}}]),e}(),pe={void:void 0};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 de(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,(void 0,i=function(e,t){if("object"!==ye(e)||null===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)}(r.key),"symbol"===ye(i)?i:String(i)),r)}var i}var ve=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}}])&&de(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),e}();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 ge(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,(void 0,i=function(e,t){if("object"!==be(e)||null===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)}(r.key),"symbol"===be(i)?i:String(i)),r)}var i}var me,we={reconnectIntervalInMilliseconds:3e3,heartbeatEnabled:!1,heartbeatIntervalInMillseconds:1e4,heartbeatMessage:""},Pe=function(){function e(t){var n=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:we;!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({},we),r),this.webSocket=this.connect(),this.heartbeat=(new ve).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()}}])&&ge(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),e}();function Oe(e){return Oe="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},Oe(e)}function Se(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,(void 0,i=function(e,t){if("object"!==Oe(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!==Oe(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(r.key),"symbol"===Oe(i)?i:String(i)),r)}var i}!function(e){e.AppleTv="apple-tv",e.Vivi="vivi"}(me||(me={}));var ke=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._lastModified={},this.position=0,this.duration=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=this.withDebouncedSetters(),this.withTimestampedSetters()}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}},{key:"withDebouncedSetters",value:function(){var e=this;return new Proxy(this,{set:function(t,n,r,i){var o=e._lastModified[n.toString()];return!!(o&&Date.now()<o+2e3)||Reflect.set(t,n,r,i)}})}},{key:"withTimestampedSetters",value:function(){var e=this;return new Proxy(this,{set:function(t,n,r,i){return e._lastModified[n.toString()]=Date.now(),Reflect.set(t,n,r,i)}})}}])&&Se(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),e}();function je(e){return je="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},je(e)}function Ee(){Ee=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 _(r||[]);return i(a,"_invoke",{value:E(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 h="suspendedStart",p="suspendedYield",y="executing",d="completed",v={};function b(){}function g(){}function m(){}var w={};c(w,a,(function(){return this}));var P=Object.getPrototypeOf,O=P&&P(P(I([])));O&&O!==n&&r.call(O,a)&&(w=O);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"==je(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 E(t,n,r){var i=h;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=C(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===h)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:p,c.arg===v)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(i=d,r.method="throw",r.arg=c.arg)}}}function C(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,C(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 T(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 x(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function _(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(T,this),this.reset(!0)}function I(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(je(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=I,_.prototype={constructor:_,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(x),!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),x(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;x(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(t,n,r){return this.delegate={iterator:I(t),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=e),v}},t}function Ce(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,(void 0,i=function(e,t){if("object"!==je(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!==je(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(r.key),"symbol"===je(i)?i:String(i)),r)}var i}function Te(){return Te="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=_e(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}},Te.apply(this,arguments)}function xe(e,t){return xe=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},xe(e,t)}function _e(e){return _e=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},_e(e)}var Ie=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())}))},Re=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&xe(e,t)}(a,e);var t,n,r,i,o=(r=a,i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=_e(r);if(i){var n=_e(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return function(e,t){if(t&&("object"===je(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(this,e)});function a(e,t){var n;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),(n=o.call(this)).client=e,n.localState=new ke(t.title,t.device),n.bindFunctions(),n.initialize(),n}return t=a,(n=[{key:"bindFunctions",value:function(){this.initialize=this.initialize.bind(this),this.dispose=this.dispose.bind(this),this.handleClientConnected=this.handleClientConnected.bind(this),this.handleDisconnectMessage=this.handleDisconnectMessage.bind(this),this.handleAllVideoMessages=this.handleAllVideoMessages.bind(this),this.handleUpdateMessage=this.handleUpdateMessage.bind(this),this.handleVolumeMessage=this.handleVolumeMessage.bind(this),this.handlePlayingMessage=this.handlePlayingMessage.bind(this),this.handlePausedMessage=this.handlePausedMessage.bind(this),this.handleFinishedMessage=this.handleFinishedMessage.bind(this),this.handleNewChapterMessage=this.handleNewChapterMessage.bind(this),this.handleStoppedMessage=this.handleStoppedMessage.bind(this),this.loadSource=this.loadSource.bind(this),this.play=this.play.bind(this),this.pause=this.pause.bind(this),this.seek=this.seek.bind(this),this.setVolume=this.setVolume.bind(this),this.isPlaying=this.isPlaying.bind(this),this.getPosition=this.getPosition.bind(this),this.getDuration=this.getDuration.bind(this),this.getVolume=this.getVolume.bind(this)}},{key:"initialize",value:function(){var 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(K.ZT),Te(_e(a.prototype),"dispose",this).call(this)}},{key:"handleClientConnected",value:function(){return Ie(this,void 0,void 0,Ee().mark((function e(){return Ee().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={update:this.handleUpdateMessage,volume:this.handleVolumeMessage,playing:this.handlePlayingMessage,paused:this.handlePausedMessage,finished:this.handleFinishedMessage,new_chapter:this.handleNewChapterMessage,stopped:this.handleStoppedMessage}[e.message.payload.event];t&&t(this.localState.debounced,e.message.payload.params||{})}},{key:"handleUpdateMessage",value:function(e,t){e.duration!==t.duration&&(e.duration=t.duration,this.trigger("durationchange",pe.void)),e.position!==t.position&&(e.position=t.position,this.trigger("positionchange",pe.void)),e.subtitles!==t.subtitles&&(e.subtitles=t.subtitles,this.trigger("subtitleschange",pe.void))}},{key:"handleVolumeMessage",value:function(e,t){e.volume!==t.level&&(e.volume=t.level,e.mute=0===t.level,this.trigger("volumechange",pe.void))}},{key:"handlePlayingMessage",value:function(e){!0!==e.playing&&(e.playing=!0,e.playbackFinished=!1,this.trigger("playingchange",pe.void))}},{key:"handlePausedMessage",value:function(e){!1!==e.playing&&(e.playing=!1,this.trigger("playingchange",pe.void))}},{key:"handleFinishedMessage",value:function(e){!0!==e.playbackFinished&&(e.playing=!1,e.playbackFinished=!0,this.trigger("playingchange",pe.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",pe.void))}},{key:"handleStoppedMessage",value:function(){this.dispose()}},{key:"loadSource",value:function(e,t){return Ie(this,void 0,void 0,Ee().mark((function n(){var r,i;return Ee().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",pe.void),i>0&&this.client.seek(r,i),n.next=20;break;case 17:n.prev=17,n.t0=n.catch(2),this.trigger("error",n.t0);case 20:case"end":return n.stop()}}),n,this,[[2,17]])})))}},{key:"play",value:function(){this.localState.ready&&!0!==this.localState.playing&&(this.localState.playing=!0,this.client.play(this.getDevice().id),this.trigger("playingchange",pe.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",pe.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",pe.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",pe.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",pe.void))}},{key:"setSubtitles",value:function(e){return Ie(this,void 0,void 0,Ee().mark((function t(){var n;return Ee().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",pe.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}}])&&Ce(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),a}(he);function Me(e){return Me="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},Me(e)}function Le(){Le=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 _(r||[]);return i(a,"_invoke",{value:E(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 h="suspendedStart",p="suspendedYield",y="executing",d="completed",v={};function b(){}function g(){}function m(){}var w={};c(w,a,(function(){return this}));var P=Object.getPrototypeOf,O=P&&P(P(I([])));O&&O!==n&&r.call(O,a)&&(w=O);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"==Me(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 E(t,n,r){var i=h;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=C(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===h)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:p,c.arg===v)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(i=d,r.method="throw",r.arg=c.arg)}}}function C(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,C(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 T(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 x(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function _(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(T,this),this.reset(!0)}function I(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(Me(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=I,_.prototype={constructor:_,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(x),!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),x(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;x(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(t,n,r){return this.delegate={iterator:I(t),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=e),v}},t}function De(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,(void 0,i=function(e,t){if("object"!==Me(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!==Me(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(r.key),"symbol"===Me(i)?i:String(i)),r)}var i}function Ne(){return Ne="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=Fe(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}},Ne.apply(this,arguments)}function Be(e,t){return Be=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Be(e,t)}function Fe(e){return Fe=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Fe(e)}var Ve=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())}))},Ae=1e4,Ue=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Be(e,t)}(s,e);var t,n,r,i,o,a=(i=s,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=Fe(i);if(o){var n=Fe(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return function(e,t){if(t&&("object"===Me(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(this,e)});function s(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,s),(t=a.call(this)).options=e,t.accessToken="",t.devices=[],t.devicesFingerprint="",t.deviceDiscovery=new ve,t.bindFunctions(),t.initialize(),t}return t=s,r=[{key:"createAckId",value:function(){return ee()}},{key:"calculateFingerprint",value:function(e){return e.map((function(e){return e.id})).sort().join(",")}}],(n=[{key:"bindFunctions",value:function(){this.initialize=this.initialize.bind(this),this.beginDeviceDiscovery=this.beginDeviceDiscovery.bind(this),this.dispose=this.dispose.bind(this),this.sendMessage=this.sendMessage.bind(this),this.sendMessageDebounced=(0,K.Ds)(this.sendMessage,500,!0),this.getDevices=this.getDevices.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 Pe(this.options.url.toString()),this.webSocket.onMessage=function(t){return e.trigger("message",JSON.parse(t.data))},this.webSocket.onOpen=function(){return Ve(e,void 0,void 0,Le().mark((function e(){return Le().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",pe.void),e.next=13;break;case 10:e.prev=10,e.t0=e.catch(0),this.trigger("error",e.t0);case 13:case"end":return e.stop()}}),e,this,[[0,10]])})))}}},{key:"beginDeviceDiscovery",value:function(){var e=this;this.deviceDiscovery.every(1e4).schedule((function(){return Ve(e,void 0,void 0,Le().mark((function e(){var t,n;return Le().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,this.getRoomList();case 3:if(t=e.sent,(n=s.calculateFingerprint(t))!==this.devicesFingerprint){e.next=7;break}return e.abrupt("return");case 7:this.devices=t.map((function(e){return{id:e.id,name:e.name,type:me.Vivi,available:!0}})),this.devicesFingerprint=n,this.trigger("deviceschange",pe.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(),Ne(Fe(s.prototype),"dispose",this).call(this)}},{key:"sendMessage",value:function(e){var t;null===(t=this.webSocket)||void 0===t||t.send(JSON.stringify(e))}},{key:"canCastToDevice",value:function(e){return e===me.Vivi}},{key:"getDevices",value:function(){return this.devices}},{key:"startCastSession",value:function(e){return new Re(this,e)}},{key:"authenticateWithVivi",value:function(){return Ve(this,void 0,void 0,Le().mark((function e(){return Le().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(Ae).catch((function(){throw new Error("Failed to authenticate with Vivi")}));case 3:case"end":return e.stop()}}),e,this)})))}},{key:"getRoomList",value:function(){return Ve(this,void 0,void 0,Le().mark((function e(){var t;return Le().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(Ae).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 Ve(this,void 0,void 0,Le().mark((function t(){return Le().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(Ae).catch((function(){throw new Error("Failed to join room")}));case 3:case"end":return t.stop()}}),t,this)})))}},{key:"query",value:function(e){return Ve(this,void 0,void 0,Le().mark((function t(){var n;return Le().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=s.createAckId(),this.sendMessage({destination:e,message:{type:"message_with_ack",ack_id:n,name:"query"}}),t.next=4,this.one("message",(function(e){return e.message.ack_id===n})).timeout(Ae).catch((function(){throw new Error("Failed to fetch query")}));case 4:return t.abrupt("return",t.sent);case 5:case"end":return t.stop()}}),t,this)})))}},{key:"loadQueue",value:function(e){var t=e.roomId,n=e.title,r=e.videoSource,i=e.subtitleSource;return Ve(this,void 0,void 0,Le().mark((function e(){return Le().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.sendMessage({destination:t,message:{type:"message_with_ack",ack_id:s.createAckId(),name:"queue_load",payload:{urls:[{title:n,url:r,suburl:i}]}}}),e.next=3,this.one("message",(function(e){var n;return e.source===t&&"ready"===(null===(n=e.message.payload)||void 0===n?void 0:n.event)})).timeout(Ae).catch((function(){throw new Error("Failed to load media")}));case 3:case"end":return e.stop()}}),e,this)})))}},{key:"play",value:function(e){return Ve(this,void 0,void 0,Le().mark((function t(){return Le().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(Ae).catch((function(){throw new Error("Failed to play video")}));case 3:case"end":return t.stop()}}),t,this)})))}},{key:"pause",value:function(e){return Ve(this,void 0,void 0,Le().mark((function t(){return Le().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(Ae).catch((function(){throw new Error("Failed to pause video")}));case 3:case"end":return t.stop()}}),t,this)})))}},{key:"stop",value:function(e){return Ve(this,void 0,void 0,Le().mark((function t(){return Le().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(Ae).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 Ve(this,void 0,void 0,Le().mark((function n(){return Le().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(Ae).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 Ve(this,void 0,void 0,Le().mark((function n(){return Le().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(Ae).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 Ve(this,void 0,void 0,Le().mark((function n(){return Le().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(Ae).catch((function(){throw new Error("Failed to set mute")}));case 3:case"end":return n.stop()}}),n,this)})))}},{key:"setSubtitles",value:function(e,t){return Ve(this,void 0,void 0,Le().mark((function n(){var r;return Le().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return r=s.createAckId(),this.sendMessage({destination:e,message:{type:"message_with_ack",ack_id:r,name:"set_subtitles",payload:{subtitles:t}}}),n.next=4,this.one("message",(function(t){return t.source===e&&t.message.ack_id===r})).timeout(Ae).catch((function(){throw new Error("Failed to set subtitles")}));case 4:case"end":return n.stop()}}),n,this)})))}}])&&De(t.prototype,n),r&&De(t,r),Object.defineProperty(t,"prototype",{writable:!1}),s}(he);function Ze(e){return Ze="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},Ze(e)}function ze(e){return function(e){if(Array.isArray(e))return Ge(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 Ge(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)?Ge(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 Ge(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 qe(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,(void 0,i=function(e,t){if("object"!==Ze(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!==Ze(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(r.key),"symbol"===Ze(i)?i:String(i)),r)}var i}function He(){return He="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=Ye(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}},He.apply(this,arguments)}function We(e,t){return We=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},We(e,t)}function Ye(e){return Ye=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Ye(e)}var $e=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&We(e,t)}(s,e);var t,n,r,i,o,a=(i=s,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=Ye(i);if(o){var n=Ye(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return function(e,t){if(t&&("object"===Ze(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(this,e)});function s(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,s),(t=a.call(this)).instanceId=e,t.clients=[],t.bindFunctions(),t}return t=s,r=[{key:"getOrCreateInstance",value:function(e){if(!e)throw new Error("instanceId is required");return this.instances[e]||(this.instances[e]=new s(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}}],(n=[{key:"bindFunctions",value:function(){this.addClient=this.addClient.bind(this),this.hasInstanceOfClient=this.hasInstanceOfClient.bind(this),this.startCastSession=this.startCastSession.bind(this),this.gatherAndPublishDevices=this.gatherAndPublishDevices.bind(this),this.dispose=this.dispose.bind(this)}},{key:"addClient",value:function(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(ze(e),ze(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=[],He(Ye(s.prototype),"dispose",this).call(this)}}])&&qe(t.prototype,n),r&&qe(t,r),Object.defineProperty(t,"prototype",{writable:!1}),s}(he);$e.instances={};var Qe=n(30050),Je=n(98115);function Xe(e){return Xe="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},Xe(e)}function Ke(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,(void 0,i=function(e,t){if("object"!==Xe(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!==Xe(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(r.key),"symbol"===Xe(i)?i:String(i)),r)}var i}function et(){return et="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=rt(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}},et.apply(this,arguments)}function tt(e,t){return tt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},tt(e,t)}function nt(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function rt(e){return rt=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},rt(e)}var it=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&tt(e,t)}(a,e);var t,n,r,i,o=(r=a,i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=rt(r);if(i){var n=rt(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return function(e,t){if(t&&("object"===Xe(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return nt(e)}(this,e)});function a(e,t){var n;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),(n=o.call(this,e,t)).isVisible=n.isVisible.bind(nt(n)),n}return t=a,(n=[{key:"createEl",value:function(){return et(rt(a.prototype),"createEl",this).call(this,"li",{className:"vjs-menu-item cv-device-menu-item",innerHTML:'\n <span class="cv-device-icon '.concat({vivi:"cv-vivi-icon","apple-tv":"cv-apple-icon"}[this.options_.type],'"></span>\n <span class="vjs-menu-item-text">').concat(this.options_.label,"</span>\n ")})}},{key:"handleClick",value:function(){this.options_.onClick()}},{key:"show",value:function(){et(rt(a.prototype),"show",this).call(this)}},{key:"hide",value:function(){et(rt(a.prototype),"hide",this).call(this)}},{key:"isVisible",value:function(){return!et(rt(a.prototype),"hasClass",this).call(this,"vjs-hidden")}}])&&Ke(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),a}(o.Z.getComponent("MenuItem"));function ot(e){return ot="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},ot(e)}function at(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,(void 0,i=function(e,t){if("object"!==ot(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!==ot(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(r.key),"symbol"===ot(i)?i:String(i)),r)}var i}function st(){return st="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=ct(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}},st.apply(this,arguments)}function ut(e,t){return ut=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},ut(e,t)}function ct(e){return ct=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},ct(e)}var lt=o.Z.getComponent("MenuButton"),ft=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&ut(e,t)}(a,e);var t,n,r,i,o=(r=a,i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=ct(r);if(i){var n=ct(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return function(e,t){if(t&&("object"===ot(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(this,e)});function a(e,t){var n;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),(n=o.call(this,e,t)).alwaysCollapsed=!1,n.isCollapsed=!1,n.isCollabsible=!0,n.searchText="",n.devices=[],n.castSession=void 0,n.bindFunctions(),n.bindEventListeners(),n}return t=a,n=[{key:"bindFunctions",value:function(){this.bindEventListeners=this.bindEventListeners.bind(this),this.setDevices=this.setDevices.bind(this),this.setCastSession=this.setCastSession.bind(this),this.setSearchText=this.setSearchText.bind(this),this.getDeviceMenuItems=this.getDeviceMenuItems.bind(this),this.render=this.render.bind(this),this.removeMenuItems=this.removeMenuItems.bind(this),this.addMenuItemsForDevices=this.addMenuItemsForDevices.bind(this),this.shouldShowSearchInput=this.shouldShowSearchInput.bind(this),this.toggleSearchInput=this.toggleSearchInput.bind(this),this.toggleDeviceMenuItems=this.toggleDeviceMenuItems.bind(this),this.toggleEmptyStatePlaceholder=this.toggleEmptyStatePlaceholder.bind(this)}},{key:"bindEventListeners",value:function(){var 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=lt.prototype.createEl).apply.apply(e,[this].concat(n))}},{key:"buildWrapperCSSClass",value:function(){return"cv-menu-small cv-devices-button ".concat(st(ct(a.prototype),"buildWrapperCSSClass",this).call(this))}},{key:"createItems",value:function(){var e=this,t=[];return this.headingItem=new Qe.Z(this.player_,{label:this.localize("Select a device"),selectable:!1}),this.searchInputItem=new Je.Z(this.player_,{menuButton:this,search:function(t){return e.setSearchText(t)},className:"cv-devices-search-input"}),this.emptyPlaceholder=new Je.C(this.player_,{label:"No devices found",selected:!1,selectable:!1,multiSelectable:!1}),this.headingItem.show(),this.searchInputItem.hide(),this.emptyPlaceholder.show(),t.push(this.headingItem,this.searchInputItem,this.emptyPlaceholder),t}},{key:"pressButton",value:function(){var e;st(ct(a.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 it}))}},{key:"render",value:function(){var e=this.getDeviceMenuItems();this.removeMenuItems(e),this.addMenuItemsForDevices(this.devices),this.toggleSearchInput(),this.toggleDeviceMenuItems(),this.toggleEmptyStatePlaceholder()}},{key:"removeMenuItems",value:function(e){var t=this;e.forEach((function(e){return t.menu.removeChild(e)}))}},{key:"addMenuItemsForDevices",value:function(e){var t=this;e.forEach((function(e){var n=new it(t.player(),{id:e.id,label:e.name,selected:!1,multiSelectable:!1,selectable:e.available,available:e.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.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(){st(ct(a.prototype),"handleClick",this).call(this,null),this.options_.onClick()}}],n&&at(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),a}(lt);ft.prototype.controlText_="Devices",o.Z.registerComponent("DevicesButton",ft);var ht=n(10463);function pt(e){return pt="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},pt(e)}function yt(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,(void 0,i=function(e,t){if("object"!==pt(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!==pt(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(r.key),"symbol"===pt(i)?i:String(i)),r)}var i}function dt(){return dt="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=bt(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}},dt.apply(this,arguments)}function vt(e,t){return vt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},vt(e,t)}function bt(e){return bt=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},bt(e)}var gt=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&vt(e,t)}(a,e);var t,n,r,i,o=(r=a,i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=bt(r);if(i){var n=bt(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return function(e,t){if(t&&("object"===pt(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(this,e)});function a(e){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),o.call(this,null,e)}return t=a,(n=[{key:"createEl",value:function(){return dt(bt(a.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:me.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(){}}])&&yt(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),a}(o.Z.getComponent("Component"));function mt(e){return mt="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},mt(e)}function wt(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,(void 0,i=function(e,t){if("object"!==mt(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!==mt(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(r.key),"symbol"===mt(i)?i:String(i)),r)}var i}function Pt(){return Pt="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=St(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}},Pt.apply(this,arguments)}function Ot(e,t){return Ot=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Ot(e,t)}function St(e){return St=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},St(e)}var kt=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Ot(e,t)}(u,e);var t,n,r,i,a,s=(i=u,a=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=St(i);if(a){var n=St(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return function(e,t){if(t&&("object"===mt(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(this,e)});function u(e,t){var n;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,u),(n=s.call(this,e,t)).featuresVolumeControl=!0,n.featuresPlaybackRate=!1,n.movingMediaElementInDOM=!1,n.featuresFullscreenResize=!0,n.featuresTimeupdateEvents=!0,n.featuresProgressEvents=!1,n.featuresNativeTextTracks=!1,n.featuresNativeAudioTracks=!1,n.featuresNativeVideoTracks=!1,n.featuresMuteControl=!0,n.featuresSourceset=!1,n.videojsPlayer=(0,o.Z)(n.options_.playerId),n.bindFunctions(),n.bindEventListeners(),n.ready((function(){n.setSource(n.options_.source)})),n.triggerReady(),n}return t=u,r=[{key:"canPlayType",value:function(){return""}},{key:"canPlaySource",value:function(e,t){var n;return!!$e.getOrCreateInstance(null!==(n=null==t?void 0:t.instanceId)&&void 0!==n?n:"").getCastSession()}},{key:"isSupported",value:function(){return $e.isActive()}}],(n=[{key:"bindFunctions",value:function(){this.bindEventListeners=this.bindEventListeners.bind(this),this.onTextTrackChanged=this.onTextTrackChanged.bind(this),this.getSelectedTextTrack=this.getSelectedTextTrack.bind(this),this.setSelectedTextTrack=this.setSelectedTextTrack.bind(this),this.showUI=this.showUI.bind(this),this.hideUI=this.hideUI.bind(this),this.dispose=this.dispose.bind(this),this.setSource=this.setSource.bind(this),this.getCastSession=this.getCastSession.bind(this)}},{key:"bindEventListeners",value:function(){var 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 ht.O.findTrackByPredicate(this.videojsPlayer.player_,(function(e){return"showing"===e.mode&&!!e.src}))}},{key:"setSelectedTextTrack",value:function(e){ht.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(),Pt(St(u.prototype),"cleanupAutoTextTracks",this).call(this),Pt(St(u.prototype),"dispose",this).call(this)}},{key:"createEl",value:function(){var e=this;return this.ui=this.ui||new gt({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 Pt(St(u.prototype),"addRemoteTextTrack",this).call(this,e,!0)}},{key:"getCastSession",value:function(){var e;return $e.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:0}},{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(){}}])&&wt(t.prototype,n),r&&wt(t,r),Object.defineProperty(t,"prototype",{writable:!1}),u}(o.Z.getComponent("Tech"));function jt(e){return jt="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},jt(e)}function Et(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,(void 0,i=function(e,t){if("object"!==jt(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!==jt(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(r.key),"symbol"===jt(i)?i:String(i)),r)}var i}function Ct(){return Ct="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=xt(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}},Ct.apply(this,arguments)}function Tt(e,t){return Tt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Tt(e,t)}function xt(e){return xt=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},xt(e)}o.Z.registerTech("devices",kt);var _t=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Tt(e,t)}(a,e);var t,n,r,i,o=(r=a,i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=xt(r);if(i){var n=xt(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return function(e,t){if(t&&("object"===jt(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(this,e)});function a(e,t){var n,r,i;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),(n=o.call(this,e,t)).options=t,n.instanceId=null!==(i=null===(r=n.player.options_.devices)||void 0===r?void 0:r.instanceId)&&void 0!==i?i:"",n.bindFunctions(),n.initialize(),n}return t=a,(n=[{key:"bindFunctions",value:function(){this.initialize=this.initialize.bind(this),this.onReady=this.onReady.bind(this),this.onDevicesChanged=this.onDevicesChanged.bind(this),this.onCastSessionChanged=this.onCastSessionChanged.bind(this),this.onDevicesError=this.onDevicesError.bind(this),this.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(){if(e.options.viviApi&&e.options.fetchViviAccessToken&&!r.hasInstanceOfClient(Ue)){var t=new Ue({url:e.options.viviApi,fetchAccessToken:e.options.fetchViviAccessToken});r.addClient(t)}},onDeviceMenuItemClick:function(t,n){r.startCastSession({device:n,title:e.options.title})}};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.isFullscreen()&&this.player.exitFullscreen()):this.player.removeClass("cv-device-casting")}},{key:"onDevicesError",value:function(e){this.player.error(e.message),this.player.pause()}},{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 $e.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),$e.disposeAndRemoveInstance(e),Ct(xt(a.prototype),"dispose",this).call(this))}}])&&Et(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),a}(o.Z.getPlugin("plugin"));function It(e){return It="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},It(e)}function Rt(){Rt=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 _(r||[]);return i(a,"_invoke",{value:E(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 h="suspendedStart",p="suspendedYield",y="executing",d="completed",v={};function b(){}function g(){}function m(){}var w={};c(w,a,(function(){return this}));var P=Object.getPrototypeOf,O=P&&P(P(I([])));O&&O!==n&&r.call(O,a)&&(w=O);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"==It(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 E(t,n,r){var i=h;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=C(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===h)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:p,c.arg===v)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(i=d,r.method="throw",r.arg=c.arg)}}}function C(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,C(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 T(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 x(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function _(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(T,this),this.reset(!0)}function I(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(It(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=I,_.prototype={constructor:_,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(x),!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),x(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;x(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(t,n,r){return this.delegate={iterator:I(t),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=e),v}},t}function Mt(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 Lt(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,(void 0,i=function(e,t){if("object"!==It(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!==It(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(r.key),"symbol"===It(i)?i:String(i)),r)}var i}function Dt(){return Dt="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=Bt(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}},Dt.apply(this,arguments)}function Nt(e,t){return Nt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Nt(e,t)}function Bt(e){return Bt=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Bt(e)}o.Z.registerPlugin("devicesPlugin",_t);var Ft=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Nt(e,t)}(a,e);var t,n,r,i,o=(r=a,i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=Bt(r);if(i){var n=Bt(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return function(e,t){if(t&&("object"===It(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(this,e)});function a(e,t){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),o.call(this,e,t)}return t=a,(n=[{key:"getPlayerOptions",value:function(){var e,t=Dt(Bt(a.prototype),"getPlayerOptions",this).call(this);return t.enableDevices?Object.assign(Object.assign({},t),{techOrder:["devices"].concat((e=t.techOrder,function(e){if(Array.isArray(e))return Mt(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 Mt(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)?Mt(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:ee()}}):t}},{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 t,n,r,i,o=this,s=Object.create(null,{additionalSetup:{get:function(){return Dt(Bt(a.prototype),"additionalSetup",o)}}});return t=this,n=void 0,r=void 0,i=Rt().mark((function t(){var n;return Rt().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(s.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!==(n=e.additionalData)){t.next=6;break}throw Error("Invalid clip data");case 6:this.player.clipPlugin({startTime:n.startTime,endTime:n.endTime});case 7:this.options.enableDevices&&this.player.devicesPlugin({viviApi:this.options.viviApi,fetchViviAccessToken:this.options.fetchViviAccessToken,title:e.title});case 8:case"end":return t.stop()}}),t,this)})),new(r||(r=Promise))((function(e,o){function a(e){try{u(i.next(e))}catch(e){o(e)}}function s(e){try{u(i.throw(e))}catch(e){o(e)}}function u(t){var n;t.done?e(t.value):(n=t.value,n instanceof r?n:new r((function(e){e(n)}))).then(a,s)}u((i=i.apply(t,n||[])).next())}))}},{key:"setActivityStatus",value:function(e,t){this.player.activityStatusPlugin().setActivityStatus(e,t)}}])&&Lt(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),a}(i.r),Vt=n(63816),At=n(14735);function Ut(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 Zt(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 Ut(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)?Ut(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 zt(e){return zt="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},zt(e)}function Gt(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,(void 0,i=function(e,t){if("object"!==zt(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!==zt(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(r.key),"symbol"===zt(i)?i:String(i)),r)}var i}function qt(){return qt="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=Wt(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}},qt.apply(this,arguments)}function Ht(e,t){return Ht=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Ht(e,t)}function Wt(e){return Wt=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Wt(e)}o.Z.registerComponent("UpNext",(0,At.Z)((function(e,t){return r.createElement(Zt,Object.assign({player:e},t))})));var Yt=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Ht(e,t)}(s,e);var t,n,r,i,a=(r=s,i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=Wt(r);if(i){var n=Wt(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return function(e,t){if(t&&("object"===zt(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(this,e)});function s(e,t){var n;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,s),(n=a.call(this,e,t)).playNext=e.nextVideoPlugin().getShouldPlayNext(),n.toggle(n.playNext),n}return t=s,(n=[{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,t,n){this.handlerBound||(this.handleToggle=this.handleToggle.bind(this),this.handlerBound=!0),this.toggleEl&&this.toggleEl.removeEventListener("click",this.handleToggle),this.toggleEl=o.Z.dom.createEl("div",{className:"custom-toggle toggle-option float-end",innerHTML:'<span class="handle"></span></div>'}),this.toggleEl.addEventListener("click",this.handleToggle);var r=qt(Wt(s.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>'},n);return r.children[1].appendChild(this.toggleEl),r}}])&&Gt(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),s}(o.Z.getComponent("MenuItem"));function $t(e){return $t="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},$t(e)}function Qt(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,(void 0,i=function(e,t){if("object"!==$t(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!==$t(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(r.key),"symbol"===$t(i)?i:String(i)),r)}var i}function Jt(){return Jt="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}},Jt.apply(this,arguments)}function Xt(e,t){return Xt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Xt(e,t)}function Kt(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function en(e){return en=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},en(e)}o.Z.registerComponent("NextVideoMenuItem",Yt);var tn="cv-persisttest",nn="cv-play-next-video",rn=o.Z.getPlugin("plugin"),on=(o.Z.getComponent("MenuItem"),o.Z.getComponent("NextVideoMenuItem")),an=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Xt(e,t)}(a,e);var t,n,r,i,o=(r=a,i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=en(r);if(i){var n=en(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return function(e,t){if(t&&("object"===$t(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return Kt(e)}(this,e)});function a(e){var t;if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),(t=o.call(this,e)).setShouldPlayNext=t.setShouldPlayNext.bind(Kt(t)),t.getShouldPlayNext=t.getShouldPlayNext.bind(Kt(t)),t.getChapterTrack=t.getChapterTrack.bind(Kt(t)),t.onTimeUpdate=t.onTimeUpdate.bind(Kt(t)),t.hasLocalStorage=t.testHasLocalStorage(),t.shouldPlayNextVideo=!1,t.hasLocalStorage){var n=window.localStorage.getItem(nn);t.shouldPlayNextVideo="true"===n}return e.ready((function(){t.initialize()})),t}return t=a,(n=[{key:"initialize",value:function(){this.player.isDisposed()||this.bindListeners()}},{key:"getChapterTrack",value:function(){return ht.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:on,name:"NextVideoMenuItem"})}},{key:"getShouldPlayNext",value:function(){return this.shouldPlayNextVideo}},{key:"setShouldPlayNext",value:function(e,t){this.shouldPlayNextVideo=e,this.hasLocalStorage&&t&&window.localStorage.setItem(nn,e.toString())}},{key:"bindListeners",value:function(){this.player.on("timeupdate",this.onTimeUpdate)}},{key:"dispose",value:function(){this.player.off("timeupdate",this.onTimeUpdate),this.hideUpNext(),Jt(en(a.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(tn,"persistPlayNext"),window.localStorage.removeItem(tn),!0}catch(e){return!1}}}])&&Qt(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),a}(rn);o.Z.registerPlugin("nextVideoPlugin",an);var sn=n(26733);function un(e){return un="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},un(e)}function cn(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,(void 0,i=function(e,t){if("object"!==un(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!==un(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(r.key),"symbol"===un(i)?i:String(i)),r)}var i}function ln(e,t){return ln=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},ln(e,t)}function fn(e){return fn=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},fn(e)}function hn(e){return r.createElement("div",{className:"cv-resource-item"},r.createElement(sn.s,{data:e.resource,imageCdnUrl:e.imageCdnUrl}))}var pn=(0,At.Z)((function(e,t){return r.createElement(hn,Object.assign({},t))})),yn=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&ln(e,t)}(s,e);var t,n,r,i,a=(r=s,i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=fn(r);if(i){var n=fn(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return function(e,t){if(t&&("object"===un(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(this,e)});function s(e,t){var n;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,s),n=a.call(this,e,t);var r=new pn(e,{resource:t.resource,imageCdnUrl:t.imageCdnUrl});return n.addChild(r),n}return t=s,(n=[{key:"createEl",value:function(){return o.Z.dom.createEl("div")}},{key:"handleClick",value:function(e){e.stopImmediatePropagation(),this.options_.downloadResource(this.options_.resource)}}])&&cn(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),s}(o.Z.getComponent("ClickableComponent"));function dn(e){return dn="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},dn(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,(void 0,i=function(e,t){if("object"!==dn(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!==dn(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(r.key),"symbol"===dn(i)?i:String(i)),r)}var i}function bn(){return bn="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}},bn.apply(this,arguments)}function gn(e,t){return gn=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},gn(e,t)}function mn(e){return mn=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},mn(e)}var wn=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&gn(e,t)}(s,e);var t,n,r,i,a=(r=s,i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=mn(r);if(i){var n=mn(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return function(e,t){if(t&&("object"===dn(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(this,e)});function s(){var e;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,s),(e=a.apply(this,arguments)).alwaysCollapsed=!1,e.isCollapsed=!1,e.isCollabsible=!0,e}return t=s,(n=[{key:"buildWrapperCSSClass",value:function(){return"cv-menu-small ".concat(bn(mn(s.prototype),"buildWrapperCSSClass",this).call(this))}},{key:"buildCSSClass",value:function(){return"cv-resources-button ".concat(bn(mn(s.prototype),"buildCSSClass",this).call(this))}},{key:"update",value:function(){bn(mn(s.prototype),"update",this).call(this)}},{key:"createMenu",value:function(){return this.options_.title="Resources",bn(mn(s.prototype),"createMenu",this).call(this)}},{key:"createItems",value:function(){var e=this,t=[];return this.options_.resources.forEach((function(n){var r=new yn(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(){bn(mn(s.prototype),"handleClick",this).call(this,null)}}])&&vn(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),s}(o.Z.getComponent("MenuButton"));function Pn(e){return Pn="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},Pn(e)}function On(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,(void 0,i=function(e,t){if("object"!==Pn(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!==Pn(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(r.key),"symbol"===Pn(i)?i:String(i)),r)}var i}function Sn(e,t){return Sn=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Sn(e,t)}function kn(e){return kn=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},kn(e)}wn.prototype.controlText_="Resources",o.Z.registerComponent("ResourcesButton",wn);var jn=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Sn(e,t)}(a,e);var t,n,r,i,o=(r=a,i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=kn(r);if(i){var n=kn(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return function(e,t){if(t&&("object"===Pn(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(this,e)});function a(e,t){var n;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),(n=o.call(this,e,t)).options=t,e.ready((function(){return n.onReady()})),n}return t=a,(n=[{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)}}}])&&On(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),a}(o.Z.getPlugin("plugin"));o.Z.registerPlugin("resourcesPlugin",jn);var En=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 Cn(e){var t=e.className,n=void 0===t?"":t,i=e.playerApi,o=e.onReady,a=e.onDispose,s=En(e,["className","playerApi","onReady","onDispose"]),u=r.useRef();return r.useEffect((function(){if(u){var e=new Ft(u.current,Object.assign(Object.assign({},s),{playerApi:i}));return o&&e.ready((function(){o((0,Vt.G)(e))})),a&&e.one("dispose",a),function(){null==e||e.dispose()}}}),[e.viewKey]),r.createElement("div",{ref:u,className:n})}}}]);
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunk_clickview_lite=self.webpackChunk_clickview_lite||[]).push([[3966],{33966:(e,t,n)=>{n.r(t),n.d(t,{BrazeAnalyticsClient:()=>m});var r=n(63093),i=n(71365),o=n(49985),a=n(41268),u=n(65858),l=n(99504),c=n(97291),s=n(57322);function v(e){return v="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},v(e)}function y(e,t,n){return(t=p(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function f(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,p(r.key),r)}}function p(e){var t=function(e,t){if("object"!==v(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!==v(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===v(t)?t:String(t)}function d(e,t){return d=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},d(e,t)}function h(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function E(e){return E=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},E(e)}var m=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&d(e,t)}(b,e);var t,n,a,p,m,w=(p=b,m=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=E(p);if(m){var n=E(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return function(e,t){if(t&&("object"===v(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return h(e)}(this,e)});function b(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,b),(t=w.call(this,e)).client=i.u.getInstance(s.K.BrazeClient,h(t)),t}return t=b,a=[{key:"eventWhitelist",get:function(){var e;return y(e={},u.Vw.SendEmail,b.isInviteEvent),y(e,u.Vw.Download,b.isResourceDownloadEvent),y(e,u.Vw.Share,b.isShareEvent),y(e,u.Vw.Stream,b.isStreamEvent),y(e,u.Vw.Click,b.isSupportedClickEvent),y(e,u.Vw.PageView,b.isPageViewEvent),e}},{key:"isPageViewEvent",value:function(e){if(e.type!==u.Vw.PageView)return!1;var t=e.data;return!(null==t?void 0:t.isError)}},{key:"isSupportedClickEvent",value:function(e){return!!b.isExploreTopicsEvent(e)||!!b.isSearchClickThrough(e)||!!b.isBookACallEvent(e)}},{key:"isExploreTopicsEvent",value:function(e){return e.type===u.Vw.Click&&e.actionContext.entity===u.py.Classification}},{key:"isSearchClickThrough",value:function(e){var t;return e.type===u.Vw.Click&&e.actionContext.productArea===(0,o.c)(c.O.SEARCH)&&!Array.isArray(e.data)&&!!(null===(t=null==e?void 0:e.data)||void 0===t?void 0:t.search)}},{key:"isBookACallEvent",value:function(e){return e.type===u.Vw.Click&&e.actionContext.entity===u.py.Url&&e.actionContext.descriptor===u.HS.BookACall}},{key:"isStreamEvent",value:function(e){return e.type===u.Vw.Stream}},{key:"isShareEvent",value:function(e){return e.type===u.Vw.Share&&e.actionContext.workflowPhase!==u.eu.Start}},{key:"isResourceDownloadEvent",value:function(e){return e.type===u.Vw.Download&&e.actionContext.entity===u.py.Resource}},{key:"isInviteEvent",value:function(e){return e.type===u.Vw.SendEmail&&e.actionContext.descriptor===u.Yu.InviteColleague}}],(n=[{key:"name",get:function(){return"BrazeAnalyticsClient"}},{key:"initialize",value:function(e){(null==e?void 0:e.logUtmParameters)&&(this.utmParameters=l.F.getUtmParameters())}},{key:"shouldLog",value:function(e){if(!e)return!1;var t=b.eventWhitelist[e.type];return"function"==typeof t&&t(e)}},{key:"logEvent",value:function(e){if(this.utmParameters){var t=(null==e?void 0:e.data)||{};t.utms=this.utmParameters,e.data=t}this.client.logEvent(e)}},{key:"log",value:function(e){var t,n;if(this.client){var i=e.data;b.isPageViewEvent(e)?this.logEvent({type:r.PageEvent.PageView,data:{isAddressable:i.isAddressable,actionContext:null===(t=i.appLink)||void 0===t?void 0:t.action,url:i.url}}):b.isStreamEvent(e)?this.logEvent({type:r.ProductEvent.Stream,data:{id:null==i?void 0:i.id,entity:e.actionContext.entity,name:null==i?void 0:i.name}}):b.isExploreTopicsEvent(e)?this.logEvent({type:r.ProductEvent.ExploreTopics,data:{id:null==i?void 0:i.id,name:null==i?void 0:i.name}}):b.isSearchClickThrough(e)?this.logEvent({type:r.ProductEvent.SearchClickthrough,data:{query:null===(n=null==i?void 0:i.search)||void 0===n?void 0:n.query}}):b.isBookACallEvent(e)?this.logEvent({type:r.ProductEvent.ClickBookACall}):b.isShareEvent(e)?this.logEvent({type:r.ProductEvent.Share,data:{id:null==i?void 0:i.id,entity:e.actionContext.entity,name:null==i?void 0:i.name}}):b.isResourceDownloadEvent(e)?this.logEvent({type:r.ProductEvent.DownloadResource,data:{id:null==i?void 0:i.id,name:null==i?void 0:i.name,video_name:null==i?void 0:i.videoName}}):b.isInviteEvent(e)&&this.logEvent({type:r.ProductEvent.Invite,data:{user_count:null==i?void 0:i.emailCount}})}}},{key:"isType",value:function(e){return e===b.type}}])&&f(t.prototype,n),a&&f(t,a),Object.defineProperty(t,"prototype",{writable:!1}),b}(a.z);m.type="BrazeAnalyticsClient"}}]);