@clickview/exchange 0.43.1-dev.1 → 0.44.0-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 (218) hide show
  1. package/dist/bundles.json +2 -2
  2. package/dist/css/137-exchange-8c1b8716b3.chunk.css +25 -0
  3. package/dist/css/212-exchange-d71527fc65.chunk.css +1 -0
  4. package/dist/css/226-exchange-9ab9f14b3c.chunk.css +57 -0
  5. package/dist/css/291-exchange-be9d9f0cdb.chunk.css +11 -0
  6. package/dist/css/298-exchange-78ece5c7c5.chunk.css +37 -0
  7. package/dist/css/332-exchange-e4754ae27a.chunk.css +1 -0
  8. package/dist/css/494-exchange-02d7a0249c.chunk.css +2 -0
  9. package/dist/css/522-exchange-1387f35e92.chunk.css +14 -0
  10. package/dist/css/538-exchange-4cbfe56ba3.chunk.css +1 -0
  11. package/dist/css/589-exchange-fa098d9131.chunk.css +11 -0
  12. package/dist/css/611-exchange-cbf2bb5621.chunk.css +5 -0
  13. package/dist/css/669-exchange-e80e6c6649.chunk.css +10 -0
  14. package/dist/css/68-exchange-b5eaf8af44.chunk.css +35 -0
  15. package/dist/css/75-exchange-6d2304419c.chunk.css +5 -0
  16. package/dist/css/759-exchange-23bb5dd175.chunk.css +8 -0
  17. package/dist/css/777-exchange-6ecb1e7adc.chunk.css +85 -0
  18. package/dist/css/858-exchange-06944bdfa4.chunk.css +1 -0
  19. package/dist/css/904-exchange-0eab318199.chunk.css +40 -0
  20. package/dist/css/95-exchange-4cbfe56ba3.chunk.css +1 -0
  21. package/dist/css/lite-exchange-ed6bd260c5.css +14 -0
  22. package/dist/languages/en.json +1 -0
  23. package/dist/scripts/117-5eb5adc7a4-exchange.chunk.js +1 -0
  24. package/dist/scripts/127-6b0fb13bd1-exchange.chunk.js +1 -0
  25. package/dist/scripts/136-2395b8205f-exchange.chunk.js +2 -0
  26. package/dist/scripts/136-2395b8205f-exchange.chunk.js.LICENSE.txt +1 -0
  27. package/dist/scripts/137-86b96d7a66-exchange.chunk.js +1 -0
  28. package/dist/scripts/156-0b71dc58d7-exchange.chunk.js +1 -0
  29. package/dist/scripts/170-9db7c3b12e-exchange.chunk.js +1 -0
  30. package/dist/scripts/173-3668db114a-exchange.chunk.js +1 -0
  31. package/dist/scripts/212-a17cfb8fd5-exchange.chunk.js +1 -0
  32. package/dist/scripts/226-d5778b4bb6-exchange.chunk.js +1 -0
  33. package/dist/scripts/267-d7e70afb4a-exchange.chunk.js +1 -0
  34. package/dist/scripts/291-7e85a6e844-exchange.chunk.js +1 -0
  35. package/dist/scripts/298-ed8e8b8328-exchange.chunk.js +1 -0
  36. package/dist/scripts/312-69afcbbc39-exchange.chunk.js +1 -0
  37. package/dist/scripts/332-8947c93415-exchange.chunk.js +1 -0
  38. package/dist/scripts/414-567e121c75-exchange.chunk.js +2 -0
  39. package/dist/scripts/414-567e121c75-exchange.chunk.js.LICENSE.txt +60 -0
  40. package/dist/scripts/442-5d2a98f10d-exchange.chunk.js +1 -0
  41. package/dist/scripts/455-ceeb969c54-exchange.chunk.js +1 -0
  42. package/dist/scripts/484-f6ef46e4ac-exchange.chunk.js +1 -0
  43. package/dist/scripts/490-60822ea52f-exchange.chunk.js +1 -0
  44. package/dist/scripts/494-de9338a4bc-exchange.chunk.js +2 -0
  45. package/dist/scripts/494-de9338a4bc-exchange.chunk.js.LICENSE.txt +1 -0
  46. package/dist/scripts/507-95a1785c1b-exchange.chunk.js +1 -0
  47. package/dist/scripts/522-ea8fb704eb-exchange.chunk.js +2 -0
  48. package/dist/scripts/522-ea8fb704eb-exchange.chunk.js.LICENSE.txt +1 -0
  49. package/dist/scripts/536-b915864d5f-exchange.chunk.js +1 -0
  50. package/dist/scripts/538-37852629be-exchange.chunk.js +2 -0
  51. package/dist/scripts/538-37852629be-exchange.chunk.js.LICENSE.txt +1 -0
  52. package/dist/scripts/558-9180a10bab-exchange.chunk.js +1 -0
  53. package/dist/scripts/589-17d73ab116-exchange.chunk.js +1 -0
  54. package/dist/scripts/601-a3c22b0a9f-exchange.chunk.js +1 -0
  55. package/dist/scripts/611-d8bd3e98dc-exchange.chunk.js +1 -0
  56. package/dist/scripts/619-1abac6cb1d-exchange.chunk.js +1 -0
  57. package/dist/scripts/648-485af12c37-exchange.chunk.js +1 -0
  58. package/dist/scripts/659-e9ce44a428-exchange.chunk.js +1 -0
  59. package/dist/scripts/669-4a2b614ca9-exchange.chunk.js +1 -0
  60. package/dist/scripts/68-45fe6e7576-exchange.chunk.js +1 -0
  61. package/dist/scripts/725-64871f6063-exchange.chunk.js +1 -0
  62. package/dist/scripts/726-868a877381-exchange.chunk.js +1 -0
  63. package/dist/scripts/75-8efc5587e9-exchange.chunk.js +1 -0
  64. package/dist/scripts/759-f1a9db4868-exchange.chunk.js +1 -0
  65. package/dist/scripts/777-d35fa4eb89-exchange.chunk.js +2 -0
  66. package/dist/scripts/777-d35fa4eb89-exchange.chunk.js.LICENSE.txt +1 -0
  67. package/dist/scripts/782-518d95afbb-exchange.chunk.js +1 -0
  68. package/dist/scripts/831-8808647fc7-exchange.chunk.js +1 -0
  69. package/dist/scripts/851-df1d9024fc-exchange.chunk.js +2 -0
  70. package/dist/scripts/851-df1d9024fc-exchange.chunk.js.LICENSE.txt +1 -0
  71. package/dist/scripts/858-70085ed3b1-exchange.chunk.js +1 -0
  72. package/dist/scripts/866-14ce8a3a4d-exchange.chunk.js +1 -0
  73. package/dist/scripts/87-d569a1463e-exchange.chunk.js +1 -0
  74. package/dist/scripts/877-5b357aeb63-exchange.chunk.js +1 -0
  75. package/dist/scripts/904-bd1dfd39e0-exchange.chunk.js +1 -0
  76. package/dist/scripts/925-f70ee1c7f9-exchange.chunk.js +1 -0
  77. package/dist/scripts/937-2e1f1f330e-exchange.chunk.js +1 -0
  78. package/dist/scripts/95-b964a57082-exchange.chunk.js +2 -0
  79. package/dist/scripts/95-b964a57082-exchange.chunk.js.LICENSE.txt +1 -0
  80. package/dist/scripts/bundle-b4b395ca83.min.js +2 -0
  81. package/dist/scripts/bundle-b4b395ca83.min.js.LICENSE.txt +108 -0
  82. package/package.json +3 -12
  83. package/typings/utils/imports.d.ts +1 -1
  84. package/dist/css/Actions-BPdg7JW4.css +0 -1
  85. package/dist/css/AddToLibraryView-BBV1d-ZI.css +0 -1
  86. package/dist/css/Caret-C2R4QydJ.css +0 -1
  87. package/dist/css/ExchangeSearchBar-DL_jCfRl.css +0 -1
  88. package/dist/css/ExchangeSearchResultsView-fap4f8w8.css +0 -1
  89. package/dist/css/FormField-CY0yvCW4.css +0 -1
  90. package/dist/css/GiveFeedbackView-CifDVjr-.css +0 -1
  91. package/dist/css/IconCircle-jbMisi9r.css +0 -1
  92. package/dist/css/LazyImage-CC5F5C8O.css +0 -1
  93. package/dist/css/LinkifyHelper-DI4l_5OJ.css +0 -1
  94. package/dist/css/PillTabSelector-DlOtoSz0.css +0 -1
  95. package/dist/css/PreviewVideoDetails-CLoNhAp2.css +0 -1
  96. package/dist/css/ProgramType-B57G3PZD.css +0 -1
  97. package/dist/css/RestrictionHelper-BiRz4h1c.css +0 -1
  98. package/dist/css/SearchFilters-DKLFGlDI.css +0 -1
  99. package/dist/css/TagItem-DD13UQOa.css +0 -1
  100. package/dist/css/TvAdFreeBadge-DnhNnDZN.css +0 -1
  101. package/dist/css/TvAddView-fs02hBfZ.css +0 -1
  102. package/dist/css/TvAlreadyAddedView-Dkh6sNpi.css +0 -1
  103. package/dist/css/TvBroadcastContentView-CDiJwtuL.css +0 -1
  104. package/dist/css/TvChannelBadge-BDOTXlob.css +0 -1
  105. package/dist/css/TvChannelView-DRlDmMhN.css +0 -1
  106. package/dist/css/TvChannelsView-w4TLT4f5.css +0 -1
  107. package/dist/css/TvProgramTimeBadge-zFa1fH-z.css +0 -1
  108. package/dist/css/TvProgramsView-Bt3pBBLn.css +0 -1
  109. package/dist/css/TvSearchBar-Ci6HCTb5.css +0 -1
  110. package/dist/css/TvSearchResultsView-DGyCCqtO.css +0 -1
  111. package/dist/css/UseFetchAll-BIeUeS4h.css +0 -1
  112. package/dist/css/UseGetMediaQueryString-CrSv-tYo.css +0 -1
  113. package/dist/css/UseSelectAllPages-C7XoyEPr.css +0 -1
  114. package/dist/css/VideoList-DJ07F3NX.css +0 -1
  115. package/dist/css/app-B9KW71K5.css +0 -1
  116. package/dist/css/useBreakpoints-CCsCPLDG.css +0 -1
  117. package/dist/en.json +0 -1
  118. package/dist/scripts/Actions-DU6xcKNt.js +0 -1
  119. package/dist/scripts/AddToLibraryView-BbpiFnD1.js +0 -1
  120. package/dist/scripts/Badge-kRGAgSgq.js +0 -1
  121. package/dist/scripts/BadgeListContainer-B-qdl_Qj.js +0 -1
  122. package/dist/scripts/ButtonGroup-Pz8uSjml.js +0 -1
  123. package/dist/scripts/Caret-BRrDlj-2.js +0 -1
  124. package/dist/scripts/ChevronDownSvg-PWL_4rOb.js +0 -1
  125. package/dist/scripts/ClassNameHelper-C1RD6ZYU.js +0 -1
  126. package/dist/scripts/CloseSvg-MoBnROf1.js +0 -1
  127. package/dist/scripts/CurationStatus-BlDVEZsX.js +0 -1
  128. package/dist/scripts/DevErrorView-CK5-Rxy-.js +0 -1
  129. package/dist/scripts/DialogView-im7-qx9i.js +0 -1
  130. package/dist/scripts/DownloadHelper-tNp3R89-.js +0 -1
  131. package/dist/scripts/DownloadVideoView-Dcsxo22U.js +0 -1
  132. package/dist/scripts/DragDropMoveWrapper-Dsd-8vE3.js +0 -1
  133. package/dist/scripts/ExchangeAddView-CwHPqfoQ.js +0 -1
  134. package/dist/scripts/ExchangeFolderView-BpMNAmMQ.js +0 -1
  135. package/dist/scripts/ExchangeMostRecentView-DQH8FDqI.js +0 -1
  136. package/dist/scripts/ExchangeNotFoundView-BxjMr4v3.js +0 -1
  137. package/dist/scripts/ExchangePreviewView-Od2pV8fa.js +0 -1
  138. package/dist/scripts/ExchangeRequests-CaMKspLi.js +0 -1
  139. package/dist/scripts/ExchangeSearchBar-BetVWbNL.js +0 -1
  140. package/dist/scripts/ExchangeSearchResultsView-GbfK9RDh.js +0 -2
  141. package/dist/scripts/ExchangeSeriesView-b1ayep0S.js +0 -1
  142. package/dist/scripts/ExchangeSuggestEditView-3CoGs1xA.js +0 -1
  143. package/dist/scripts/ExchangeTabs-CQC3f-18.js +0 -1
  144. package/dist/scripts/ExchangeUtils-BXtQ6ui-.js +0 -1
  145. package/dist/scripts/ExchangeView-DCrYAO5x.js +0 -1
  146. package/dist/scripts/FormButtons-Bgi1UFwH.js +0 -1
  147. package/dist/scripts/FormFeedback-CSSo249E.js +0 -1
  148. package/dist/scripts/FormField-BefWo_kh.js +0 -5
  149. package/dist/scripts/GiveFeedbackView-C05VDJBO.js +0 -7
  150. package/dist/scripts/GroupSvg-CF5_JUEf.js +0 -1
  151. package/dist/scripts/HardCoded-NS2B_WZd.js +0 -1
  152. package/dist/scripts/HttpErrorHandlers-CXQ82gVO.js +0 -1
  153. package/dist/scripts/IconCircle-Bl2iLV5f.js +0 -1
  154. package/dist/scripts/InstanceRegion-CJ3oIQlG.js +0 -1
  155. package/dist/scripts/LazyImage-BuPwkT8t.js +0 -1
  156. package/dist/scripts/LibraryRequests-CIFsh_TC.js +0 -1
  157. package/dist/scripts/LinkifyHelper-DXhtCX0t.js +0 -4
  158. package/dist/scripts/MasterTypeHelper-C89Dh71u.js +0 -1
  159. package/dist/scripts/MediaQueries-_sYSSSUN.js +0 -1
  160. package/dist/scripts/PartialLoadingHelper-jX9dOBvb.js +0 -1
  161. package/dist/scripts/PermissionFilterOption-pkzD5BEm.js +0 -1
  162. package/dist/scripts/PillTabSelector-0Eg1sgXj.js +0 -14
  163. package/dist/scripts/PreviewVideoDetails-DYcfSG9C.js +0 -362
  164. package/dist/scripts/ProgramType-ClR23Av6.js +0 -1
  165. package/dist/scripts/RatingRequests-DE77YS3s.js +0 -1
  166. package/dist/scripts/RedirectView-Bd2ocWHW.js +0 -1
  167. package/dist/scripts/RestrictionHelper-FFW66EYt.js +0 -1
  168. package/dist/scripts/ScrollHelper-DdBBQJML.js +0 -1
  169. package/dist/scripts/SearchFilters-FlVReO0V.js +0 -1
  170. package/dist/scripts/SearchSvg-BVG6NbDK.js +0 -1
  171. package/dist/scripts/SharedSearchHelper-OTwt6mVX.js +0 -1
  172. package/dist/scripts/TagItem-D-T5Jgxc.js +0 -1
  173. package/dist/scripts/TvAdFreeBadge-CK6vQXKI.js +0 -1
  174. package/dist/scripts/TvAdFreeRequestView-DI72pb_f.js +0 -1
  175. package/dist/scripts/TvAddView-B1D9QlK5.js +0 -1
  176. package/dist/scripts/TvAlreadyAddedView-DFqGZwQO.js +0 -1
  177. package/dist/scripts/TvBroadcastContentView-BdIK-pK2.js +0 -1
  178. package/dist/scripts/TvChannelBadge-pBwnbFcb.js +0 -1
  179. package/dist/scripts/TvChannelView-fMD7YYjb.js +0 -1
  180. package/dist/scripts/TvChannelsView-eH68B1en.js +0 -1
  181. package/dist/scripts/TvGuideView-CTuQRLzy.js +0 -1
  182. package/dist/scripts/TvHomeView-B_wgL0pd.js +0 -1
  183. package/dist/scripts/TvPreviewView-DG7HOmV0.js +0 -1
  184. package/dist/scripts/TvProgramTimeBadge-spEPk9Ci.js +0 -1
  185. package/dist/scripts/TvProgramsView-CIGHzdBW.js +0 -1
  186. package/dist/scripts/TvRadioDownloadView-BBjF31yx.js +0 -1
  187. package/dist/scripts/TvRequestProgramView-D4tAgJGb.js +0 -1
  188. package/dist/scripts/TvRequests-DGpJhsk0.js +0 -1
  189. package/dist/scripts/TvSearchBar-DeJpQCLg.js +0 -1
  190. package/dist/scripts/TvSearchResultsView-C2maqf2-.js +0 -1
  191. package/dist/scripts/TvTabs-CwSo_jRg.js +0 -1
  192. package/dist/scripts/TypeHelper-B668bf5B.js +0 -1
  193. package/dist/scripts/UseAlerts-CvkkojNb.js +0 -1
  194. package/dist/scripts/UseFetchAll-gFCX5FgS.js +0 -1
  195. package/dist/scripts/UseGetMediaQueryString-CtMZxiJN.js +0 -1
  196. package/dist/scripts/UseHandleDialogError-DyBOBdQw.js +0 -1
  197. package/dist/scripts/UseHandleObjectError-BX2Mxo9Q.js +0 -1
  198. package/dist/scripts/UseHover-CvNCFvZV.js +0 -1
  199. package/dist/scripts/UseSelectAllPages-lGahuUoo.js +0 -1
  200. package/dist/scripts/VideoHelper-CCZMG1XL.js +0 -1
  201. package/dist/scripts/VideoList-DqqHxoXh.js +0 -49
  202. package/dist/scripts/VideoRequests-vwphYsR4.js +0 -1
  203. package/dist/scripts/VideoSortSelect-DVdIHmhA.js +0 -1
  204. package/dist/scripts/VisibleOnSvg-BuD3Reup.js +0 -1
  205. package/dist/scripts/app-Lrh8TPTe.js +0 -147
  206. package/dist/scripts/getRegionInfo-BBAErHX7.js +0 -1
  207. package/dist/scripts/index-C9eYzTFT.js +0 -1
  208. package/dist/scripts/toLocalTime-pPGBAyPL.js +0 -1
  209. package/dist/scripts/useBreakpoints-BALX55hP.js +0 -1
  210. package/dist/scripts/useGetExchangeActions-BtGC0q85.js +0 -1
  211. package/dist/scripts/useGetTvActions-Cx_DXvlg.js +0 -1
  212. package/dist/scripts/useHandleRegionError-CaGlG48W.js +0 -1
  213. package/dist/scripts/usePreviewContext-B5fK7PxW.js +0 -1
  214. package/dist/scripts/useSelectedRegion-h9Rl12Z2.js +0 -1
  215. package/dist/scripts/useVerifiedEmailRequiredErrorHandler-BON6gc7P.js +0 -1
  216. package/vite-bundle-manifest.ts +0 -41
  217. package/vite-i18n-plugin.ts +0 -113
  218. package/vite.config.ts +0 -74
@@ -1,362 +0,0 @@
1
- import{b1 as ri,y as Hi,b2 as EP,b3 as ft,T as wP,aq as uf,b4 as Gs,ad as fi,ac as Ai,b5 as Ry,b6 as kP,b7 as Fy,b8 as AP,ab as Ll,b9 as Lv,ba as Ce,bb as We,bc as aa,aa as Hl,bd as By,L as su,be as IP,q as PP,aD as DP,r as Ks,bf as NP,R as Pt,c as LP,j as ue,J as Ov,w as Ja,G as An,Q as Cg,a9 as as,aF as OP,F as MP,bg as Ju,aT as Zu,bh as _1,bi as RP,ar as Va,an as T1,bj as FP,ax as b1,aG as BP,ap as wc,M as kc,bk as UP,A as $P,ao as jP,ae as qP,B as Ol,bl as VP,X as HP}from"./app-Lrh8TPTe.js";import{r as S1,V as zP}from"./VisibleOnSvg-BuD3Reup.js";import{S as WP,l as GP}from"./index-C9eYzTFT.js";import{T as KP,b as XP,V as QP,L as YP}from"./LinkifyHelper-DXhtCX0t.js";import{c as JP}from"./ClassNameHelper-C1RD6ZYU.js";import{C as Mv}from"./CloseSvg-MoBnROf1.js";import{S as ZP}from"./SearchSvg-BVG6NbDK.js";import{C as eD}from"./ChevronDownSvg-PWL_4rOb.js";import{s as tD,c as iD,a as Uy}from"./TagItem-D-T5Jgxc.js";import{u as x1,a as rD}from"./UseHover-CvNCFvZV.js";import{D as nD,R as co,B as $y,a as jy}from"./Badge-kRGAgSgq.js";import{u as sD}from"./UseAlerts-CvkkojNb.js";import{D as aD}from"./DownloadHelper-tNp3R89-.js";import{M as zl}from"./MasterTypeHelper-C89Dh71u.js";import{B as oD,u as lD}from"./useBreakpoints-BALX55hP.js";import{A as uD}from"./Actions-DU6xcKNt.js";import{B as cD}from"./BadgeListContainer-B-qdl_Qj.js";import{T as qy}from"./TypeHelper-B668bf5B.js";import{b as hD}from"./ExchangeUtils-BXtQ6ui-.js";import{T as dD}from"./TvAdFreeBadge-CK6vQXKI.js";import{T as fD}from"./TvChannelBadge-pBwnbFcb.js";import{T as pD}from"./TvProgramTimeBadge-spEPk9Ci.js";var cf,Vy;function No(){if(Vy)return cf;Vy=1;var s;return typeof window<"u"?s=window:typeof ri<"u"?s=ri:typeof self<"u"?s=self:s={},cf=s,cf}var mD=No();const O=Hi(mD),gD={},vD=Object.freeze(Object.defineProperty({__proto__:null,default:gD},Symbol.toStringTag,{value:"Module"})),yD=EP(vD);var hf,Hy;function C1(){if(Hy)return hf;Hy=1;var s=typeof ri<"u"?ri:typeof window<"u"?window:{},e=yD,t;return typeof document<"u"?t=document:(t=s["__GLOBAL_DOCUMENT_CACHE@4"],t||(t=s["__GLOBAL_DOCUMENT_CACHE@4"]=e)),hf=t,hf}var _D=C1();const ce=Hi(_D);var ec={exports:{}},df,zy;function E1(){if(zy)return df;zy=1,df=e;var s=Object.prototype.toString;function e(t){if(!t)return!1;var i=s.call(t);return i==="[object Function]"||typeof t=="function"&&i!=="[object RegExp]"||typeof window<"u"&&(t===window.setTimeout||t===window.alert||t===window.confirm||t===window.prompt)}return df}var ff,Wy;function TD(){if(Wy)return ff;Wy=1;function s(r,n){var a=typeof Symbol<"u"&&r[Symbol.iterator]||r["@@iterator"];if(a)return(a=a.call(r)).next.bind(a);if(Array.isArray(r)||(a=e(r))||n){a&&(r=a);var o=0;return function(){return o>=r.length?{done:!0}:{done:!1,value:r[o++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
2
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function e(r,n){if(r){if(typeof r=="string")return t(r,n);var a=Object.prototype.toString.call(r).slice(8,-1);if(a==="Object"&&r.constructor&&(a=r.constructor.name),a==="Map"||a==="Set")return Array.from(r);if(a==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a))return t(r,n)}}function t(r,n){(n==null||n>r.length)&&(n=r.length);for(var a=0,o=new Array(n);a<n;a++)o[a]=r[a];return o}var i=function(){function r(){this.typeToInterceptorsMap_=new Map,this.enabled_=!1}var n=r.prototype;return n.getIsEnabled=function(){return this.enabled_},n.enable=function(){this.enabled_=!0},n.disable=function(){this.enabled_=!1},n.reset=function(){this.typeToInterceptorsMap_=new Map,this.enabled_=!1},n.addInterceptor=function(o,l){this.typeToInterceptorsMap_.has(o)||this.typeToInterceptorsMap_.set(o,new Set);var u=this.typeToInterceptorsMap_.get(o);return u.has(l)?!1:(u.add(l),!0)},n.removeInterceptor=function(o,l){var u=this.typeToInterceptorsMap_.get(o);return u&&u.has(l)?(u.delete(l),!0):!1},n.clearInterceptorsByType=function(o){var l=this.typeToInterceptorsMap_.get(o);return l?(this.typeToInterceptorsMap_.delete(o),this.typeToInterceptorsMap_.set(o,new Set),!0):!1},n.clear=function(){return this.typeToInterceptorsMap_.size?(this.typeToInterceptorsMap_=new Map,!0):!1},n.getForType=function(o){return this.typeToInterceptorsMap_.get(o)||new Set},n.execute=function(o,l){for(var u=this.getForType(o),c=s(u),h;!(h=c()).done;){var d=h.value;try{l=d(l)}catch{}}return l},r}();return ff=i,ff}var pf,Gy;function bD(){if(Gy)return pf;Gy=1;var s=function(){function t(){this.maxAttempts_=1,this.delayFactor_=.1,this.fuzzFactor_=.1,this.initialDelay_=1e3,this.enabled_=!1}var i=t.prototype;return i.getIsEnabled=function(){return this.enabled_},i.enable=function(){this.enabled_=!0},i.disable=function(){this.enabled_=!1},i.reset=function(){this.maxAttempts_=1,this.delayFactor_=.1,this.fuzzFactor_=.1,this.initialDelay_=1e3,this.enabled_=!1},i.getMaxAttempts=function(){return this.maxAttempts_},i.setMaxAttempts=function(n){this.maxAttempts_=n},i.getDelayFactor=function(){return this.delayFactor_},i.setDelayFactor=function(n){this.delayFactor_=n},i.getFuzzFactor=function(){return this.fuzzFactor_},i.setFuzzFactor=function(n){this.fuzzFactor_=n},i.getInitialDelay=function(){return this.initialDelay_},i.setInitialDelay=function(n){this.initialDelay_=n},i.createRetry=function(n){var a=n===void 0?{}:n,o=a.maxAttempts,l=a.delayFactor,u=a.fuzzFactor,c=a.initialDelay;return new e({maxAttempts:o||this.maxAttempts_,delayFactor:l||this.delayFactor_,fuzzFactor:u||this.fuzzFactor_,initialDelay:c||this.initialDelay_})},t}(),e=function(){function t(r){this.maxAttempts_=r.maxAttempts,this.delayFactor_=r.delayFactor,this.fuzzFactor_=r.fuzzFactor,this.currentDelay_=r.initialDelay,this.currentAttempt_=1}var i=t.prototype;return i.moveToNextAttempt=function(){this.currentAttempt_++;var n=this.currentDelay_*this.delayFactor_;this.currentDelay_=this.currentDelay_+n},i.shouldRetry=function(){return this.currentAttempt_<this.maxAttempts_},i.getCurrentDelay=function(){return this.currentDelay_},i.getCurrentMinPossibleDelay=function(){return(1-this.fuzzFactor_)*this.currentDelay_},i.getCurrentMaxPossibleDelay=function(){return(1+this.fuzzFactor_)*this.currentDelay_},i.getCurrentFuzzedDelay=function(){var n=this.getCurrentMinPossibleDelay(),a=this.getCurrentMaxPossibleDelay();return n+Math.random()*(a-n)},t}();return pf=s,pf}var mf,Ky;function SD(){if(Ky)return mf;Ky=1;var s=No(),e=function(r,n){return n===void 0&&(n=!1),function(a,o,l){if(a){r(a);return}if(o.statusCode>=400&&o.statusCode<=599){var u=l;if(n)if(s.TextDecoder){var c=t(o.headers&&o.headers["content-type"]);try{u=new TextDecoder(c).decode(l)}catch{}}else u=String.fromCharCode.apply(null,new Uint8Array(l));r({cause:u});return}r(null,l)}};function t(i){return i===void 0&&(i=""),i.toLowerCase().split(";").reduce(function(r,n){var a=n.split("="),o=a[0],l=a[1];return o.trim()==="charset"?l.trim():r},"utf-8")}return mf=e,mf}var Xy;function xD(){if(Xy)return ec.exports;Xy=1;var s=No(),e=S1(),t=E1(),i=TD(),r=bD();u.httpHandler=SD(),u.requestInterceptorsStorage=new i,u.responseInterceptorsStorage=new i,u.retryManager=new r;/**
3
- * @license
4
- * slighly modified parse-headers 2.0.2 <https://github.com/kesla/parse-headers/>
5
- * Copyright (c) 2014 David Björklund
6
- * Available under the MIT license
7
- * <https://github.com/kesla/parse-headers/blob/master/LICENCE>
8
- */var n=function(y){var p={};return y&&y.trim().split(`
9
- `).forEach(function(_){var k=_.indexOf(":"),A=_.slice(0,k).trim().toLowerCase(),N=_.slice(k+1).trim();typeof p[A]>"u"?p[A]=N:Array.isArray(p[A])?p[A].push(N):p[A]=[p[A],N]}),p};ec.exports=u,ec.exports.default=u,u.XMLHttpRequest=s.XMLHttpRequest||d,u.XDomainRequest="withCredentials"in new u.XMLHttpRequest?u.XMLHttpRequest:s.XDomainRequest,a(["get","put","post","patch","head","delete"],function(g){u[g==="delete"?"del":g]=function(y,p,_){return p=l(y,p,_),p.method=g.toUpperCase(),c(p)}});function a(g,y){for(var p=0;p<g.length;p++)y(g[p])}function o(g){for(var y in g)if(g.hasOwnProperty(y))return!1;return!0}function l(g,y,p){var _=g;return t(y)?(p=y,typeof g=="string"&&(_={uri:g})):_=e({},y,{uri:g}),_.callback=p,_}function u(g,y,p){return y=l(g,y,p),c(y)}function c(g){if(typeof g.callback>"u")throw new Error("callback argument missing");if(g.requestType&&u.requestInterceptorsStorage.getIsEnabled()){var y={uri:g.uri||g.url,headers:g.headers||{},body:g.body,metadata:g.metadata||{},retry:g.retry,timeout:g.timeout},p=u.requestInterceptorsStorage.execute(g.requestType,y);g.uri=p.uri,g.headers=p.headers,g.body=p.body,g.metadata=p.metadata,g.retry=p.retry,g.timeout=p.timeout}var _=!1,k=function(ne,oe,de){_||(_=!0,g.callback(ne,oe,de))};function A(){L.readyState===4&&!u.responseInterceptorsStorage.getIsEnabled()&&setTimeout(R,0)}function N(){var re=void 0;if(L.response?re=L.response:re=L.responseText||h(L),ie)try{re=JSON.parse(re)}catch{}return re}function $(re){if(clearTimeout(he),clearTimeout(g.retryTimeout),re instanceof Error||(re=new Error(""+(re||"Unknown XMLHttpRequest Error"))),re.statusCode=0,!B&&u.retryManager.getIsEnabled()&&g.retry&&g.retry.shouldRetry()){g.retryTimeout=setTimeout(function(){g.retry.moveToNextAttempt(),g.xhr=L,c(g)},g.retry.getCurrentFuzzedDelay());return}if(g.requestType&&u.responseInterceptorsStorage.getIsEnabled()){var ne={headers:fe.headers||{},body:fe.body,responseUrl:L.responseURL,responseType:L.responseType},oe=u.responseInterceptorsStorage.execute(g.requestType,ne);fe.body=oe.body,fe.headers=oe.headers}return k(re,fe)}function R(){if(!B){var re;clearTimeout(he),clearTimeout(g.retryTimeout),g.useXDR&&L.status===void 0?re=200:re=L.status===1223?204:L.status;var ne=fe,oe=null;if(re!==0?(ne={body:N(),statusCode:re,method:I,headers:{},url:C,rawRequest:L},L.getAllResponseHeaders&&(ne.headers=n(L.getAllResponseHeaders()))):oe=new Error("Internal XMLHttpRequest Error"),g.requestType&&u.responseInterceptorsStorage.getIsEnabled()){var de={headers:ne.headers||{},body:ne.body,responseUrl:L.responseURL,responseType:L.responseType},ve=u.responseInterceptorsStorage.execute(g.requestType,de);ne.body=ve.body,ne.headers=ve.headers}return k(oe,ne,ne.body)}}var L=g.xhr||null;L||(g.cors||g.useXDR?L=new u.XDomainRequest:L=new u.XMLHttpRequest);var F,B,C=L.url=g.uri||g.url,I=L.method=g.method||"GET",G=g.body||g.data,H=L.headers=g.headers||{},K=!!g.sync,ie=!1,he,fe={body:void 0,headers:{},statusCode:0,method:I,url:C,rawRequest:L};if("json"in g&&g.json!==!1&&(ie=!0,H.accept||H.Accept||(H.Accept="application/json"),I!=="GET"&&I!=="HEAD"&&(H["content-type"]||H["Content-Type"]||(H["Content-Type"]="application/json"),G=JSON.stringify(g.json===!0?G:g.json))),L.onreadystatechange=A,L.onload=R,L.onerror=$,L.onprogress=function(){},L.onabort=function(){B=!0,clearTimeout(g.retryTimeout)},L.ontimeout=$,L.open(I,C,!K,g.username,g.password),K||(L.withCredentials=!!g.withCredentials),!K&&g.timeout>0&&(he=setTimeout(function(){if(!B){B=!0,L.abort("timeout");var re=new Error("XMLHttpRequest timeout");re.code="ETIMEDOUT",$(re)}},g.timeout)),L.setRequestHeader)for(F in H)H.hasOwnProperty(F)&&L.setRequestHeader(F,H[F]);else if(g.headers&&!o(g.headers))throw new Error("Headers cannot be set on an XDomainRequest object");return"responseType"in g&&(L.responseType=g.responseType),"beforeSend"in g&&typeof g.beforeSend=="function"&&g.beforeSend(L),L.send(G||null),L}function h(g){try{if(g.responseType==="document")return g.responseXML;var y=g.responseXML&&g.responseXML.documentElement.nodeName==="parsererror";if(g.responseType===""&&!y)return g.responseXML}catch{}return null}function d(){}return ec.exports}var CD=xD();const w1=Hi(CD);var gf={exports:{}},vf,Qy;function ED(){if(Qy)return vf;Qy=1;var s=C1(),e=Object.create||function(){function C(){}return function(I){if(arguments.length!==1)throw new Error("Object.create shim only accepts one parameter.");return C.prototype=I,new C}}();function t(C,I){this.name="ParsingError",this.code=C.code,this.message=I||C.message}t.prototype=e(Error.prototype),t.prototype.constructor=t,t.Errors={BadSignature:{code:0,message:"Malformed WebVTT signature."},BadTimeStamp:{code:1,message:"Malformed time stamp."}};function i(C){function I(H,K,ie,he){return(H|0)*3600+(K|0)*60+(ie|0)+(he|0)/1e3}var G=C.match(/^(\d+):(\d{1,2})(:\d{1,2})?\.(\d{3})/);return G?G[3]?I(G[1],G[2],G[3].replace(":",""),G[4]):G[1]>59?I(G[1],G[2],0,G[4]):I(0,G[1],G[2],G[4]):null}function r(){this.values=e(null)}r.prototype={set:function(C,I){!this.get(C)&&I!==""&&(this.values[C]=I)},get:function(C,I,G){return G?this.has(C)?this.values[C]:I[G]:this.has(C)?this.values[C]:I},has:function(C){return C in this.values},alt:function(C,I,G){for(var H=0;H<G.length;++H)if(I===G[H]){this.set(C,I);break}},integer:function(C,I){/^-?\d+$/.test(I)&&this.set(C,parseInt(I,10))},percent:function(C,I){return I.match(/^([\d]{1,3})(\.[\d]*)?%$/)&&(I=parseFloat(I),I>=0&&I<=100)?(this.set(C,I),!0):!1}};function n(C,I,G,H){var K=H?C.split(H):[C];for(var ie in K)if(typeof K[ie]=="string"){var he=K[ie].split(G);if(he.length===2){var fe=he[0].trim(),re=he[1].trim();I(fe,re)}}}function a(C,I,G){var H=C;function K(){var fe=i(C);if(fe===null)throw new t(t.Errors.BadTimeStamp,"Malformed timestamp: "+H);return C=C.replace(/^[^\sa-zA-Z-]+/,""),fe}function ie(fe,re){var ne=new r;n(fe,function(oe,de){switch(oe){case"region":for(var ve=G.length-1;ve>=0;ve--)if(G[ve].id===de){ne.set(oe,G[ve].region);break}break;case"vertical":ne.alt(oe,de,["rl","lr"]);break;case"line":var ke=de.split(","),De=ke[0];ne.integer(oe,De),ne.percent(oe,De)&&ne.set("snapToLines",!1),ne.alt(oe,De,["auto"]),ke.length===2&&ne.alt("lineAlign",ke[1],["start","center","end"]);break;case"position":ke=de.split(","),ne.percent(oe,ke[0]),ke.length===2&&ne.alt("positionAlign",ke[1],["start","center","end"]);break;case"size":ne.percent(oe,de);break;case"align":ne.alt(oe,de,["start","center","end","left","right"]);break}},/:/,/\s/),re.region=ne.get("region",null),re.vertical=ne.get("vertical","");try{re.line=ne.get("line","auto")}catch{}re.lineAlign=ne.get("lineAlign","start"),re.snapToLines=ne.get("snapToLines",!0),re.size=ne.get("size",100);try{re.align=ne.get("align","center")}catch{re.align=ne.get("align","middle")}try{re.position=ne.get("position","auto")}catch{re.position=ne.get("position",{start:0,left:0,center:50,middle:50,end:100,right:100},re.align)}re.positionAlign=ne.get("positionAlign",{start:"start",left:"start",center:"center",middle:"center",end:"end",right:"end"},re.align)}function he(){C=C.replace(/^\s+/,"")}if(he(),I.startTime=K(),he(),C.substr(0,3)!=="-->")throw new t(t.Errors.BadTimeStamp,"Malformed time stamp (time stamps must be separated by '-->'): "+H);C=C.substr(3),he(),I.endTime=K(),he(),ie(C,I)}var o=s.createElement&&s.createElement("textarea"),l={c:"span",i:"i",b:"b",u:"u",ruby:"ruby",rt:"rt",v:"span",lang:"span"},u={white:"rgba(255,255,255,1)",lime:"rgba(0,255,0,1)",cyan:"rgba(0,255,255,1)",red:"rgba(255,0,0,1)",yellow:"rgba(255,255,0,1)",magenta:"rgba(255,0,255,1)",blue:"rgba(0,0,255,1)",black:"rgba(0,0,0,1)"},c={v:"title",lang:"lang"},h={rt:"ruby"};function d(C,I){function G(){if(!I)return null;function De(Ne){return I=I.substr(Ne.length),Ne}var Me=I.match(/^([^<]*)(<[^>]*>?)?/);return De(Me[1]?Me[1]:Me[2])}function H(De){return o.innerHTML=De,De=o.textContent,o.textContent="",De}function K(De,Me){return!h[Me.localName]||h[Me.localName]===De.localName}function ie(De,Me){var Ne=l[De];if(!Ne)return null;var Ye=C.document.createElement(Ne),Re=c[De];return Re&&Me&&(Ye[Re]=Me.trim()),Ye}for(var he=C.document.createElement("div"),fe=he,re,ne=[];(re=G())!==null;){if(re[0]==="<"){if(re[1]==="/"){ne.length&&ne[ne.length-1]===re.substr(2).replace(">","")&&(ne.pop(),fe=fe.parentNode);continue}var oe=i(re.substr(1,re.length-2)),de;if(oe){de=C.document.createProcessingInstruction("timestamp",oe),fe.appendChild(de);continue}var ve=re.match(/^<([^.\s/0-9>]+)(\.[^\s\\>]+)?([^>\\]+)?(\\?)>?$/);if(!ve||(de=ie(ve[1],ve[3]),!de)||!K(fe,de))continue;if(ve[2]){var ke=ve[2].split(".");ke.forEach(function(De){var Me=/^bg_/.test(De),Ne=Me?De.slice(3):De;if(u.hasOwnProperty(Ne)){var Ye=Me?"background-color":"color",Re=u[Ne];de.style[Ye]=Re}}),de.className=ke.join(" ")}ne.push(ve[1]),fe.appendChild(de),fe=de;continue}fe.appendChild(C.document.createTextNode(H(re)))}return he}var g=[[1470,1470],[1472,1472],[1475,1475],[1478,1478],[1488,1514],[1520,1524],[1544,1544],[1547,1547],[1549,1549],[1563,1563],[1566,1610],[1645,1647],[1649,1749],[1765,1766],[1774,1775],[1786,1805],[1807,1808],[1810,1839],[1869,1957],[1969,1969],[1984,2026],[2036,2037],[2042,2042],[2048,2069],[2074,2074],[2084,2084],[2088,2088],[2096,2110],[2112,2136],[2142,2142],[2208,2208],[2210,2220],[8207,8207],[64285,64285],[64287,64296],[64298,64310],[64312,64316],[64318,64318],[64320,64321],[64323,64324],[64326,64449],[64467,64829],[64848,64911],[64914,64967],[65008,65020],[65136,65140],[65142,65276],[67584,67589],[67592,67592],[67594,67637],[67639,67640],[67644,67644],[67647,67669],[67671,67679],[67840,67867],[67872,67897],[67903,67903],[67968,68023],[68030,68031],[68096,68096],[68112,68115],[68117,68119],[68121,68147],[68160,68167],[68176,68184],[68192,68223],[68352,68405],[68416,68437],[68440,68466],[68472,68479],[68608,68680],[126464,126467],[126469,126495],[126497,126498],[126500,126500],[126503,126503],[126505,126514],[126516,126519],[126521,126521],[126523,126523],[126530,126530],[126535,126535],[126537,126537],[126539,126539],[126541,126543],[126545,126546],[126548,126548],[126551,126551],[126553,126553],[126555,126555],[126557,126557],[126559,126559],[126561,126562],[126564,126564],[126567,126570],[126572,126578],[126580,126583],[126585,126588],[126590,126590],[126592,126601],[126603,126619],[126625,126627],[126629,126633],[126635,126651],[1114109,1114109]];function y(C){for(var I=0;I<g.length;I++){var G=g[I];if(C>=G[0]&&C<=G[1])return!0}return!1}function p(C){var I=[],G="",H;if(!C||!C.childNodes)return"ltr";function K(fe,re){for(var ne=re.childNodes.length-1;ne>=0;ne--)fe.push(re.childNodes[ne])}function ie(fe){if(!fe||!fe.length)return null;var re=fe.pop(),ne=re.textContent||re.innerText;if(ne){var oe=ne.match(/^.*(\n|\r)/);return oe?(fe.length=0,oe[0]):ne}if(re.tagName==="ruby")return ie(fe);if(re.childNodes)return K(fe,re),ie(fe)}for(K(I,C);G=ie(I);)for(var he=0;he<G.length;he++)if(H=G.charCodeAt(he),y(H))return"rtl";return"ltr"}function _(C){if(typeof C.line=="number"&&(C.snapToLines||C.line>=0&&C.line<=100))return C.line;if(!C.track||!C.track.textTrackList||!C.track.textTrackList.mediaElement)return-1;for(var I=C.track,G=I.textTrackList,H=0,K=0;K<G.length&&G[K]!==I;K++)G[K].mode==="showing"&&H++;return++H*-1}function k(){}k.prototype.applyStyles=function(C,I){I=I||this.div;for(var G in C)C.hasOwnProperty(G)&&(I.style[G]=C[G])},k.prototype.formatStyle=function(C,I){return C===0?0:C+I};function A(C,I,G){k.call(this),this.cue=I,this.cueDiv=d(C,I.text);var H={color:"rgba(255, 255, 255, 1)",backgroundColor:"rgba(0, 0, 0, 0.8)",position:"relative",left:0,right:0,top:0,bottom:0,display:"inline",writingMode:I.vertical===""?"horizontal-tb":I.vertical==="lr"?"vertical-lr":"vertical-rl",unicodeBidi:"plaintext"};this.applyStyles(H,this.cueDiv),this.div=C.document.createElement("div"),H={direction:p(this.cueDiv),writingMode:I.vertical===""?"horizontal-tb":I.vertical==="lr"?"vertical-lr":"vertical-rl",unicodeBidi:"plaintext",textAlign:I.align==="middle"?"center":I.align,font:G.font,whiteSpace:"pre-line",position:"absolute"},this.applyStyles(H),this.div.appendChild(this.cueDiv);var K=0;switch(I.positionAlign){case"start":case"line-left":K=I.position;break;case"center":K=I.position-I.size/2;break;case"end":case"line-right":K=I.position-I.size;break}I.vertical===""?this.applyStyles({left:this.formatStyle(K,"%"),width:this.formatStyle(I.size,"%")}):this.applyStyles({top:this.formatStyle(K,"%"),height:this.formatStyle(I.size,"%")}),this.move=function(ie){this.applyStyles({top:this.formatStyle(ie.top,"px"),bottom:this.formatStyle(ie.bottom,"px"),left:this.formatStyle(ie.left,"px"),right:this.formatStyle(ie.right,"px"),height:this.formatStyle(ie.height,"px"),width:this.formatStyle(ie.width,"px")})}}A.prototype=e(k.prototype),A.prototype.constructor=A;function N(C){var I,G,H,K;if(C.div){G=C.div.offsetHeight,H=C.div.offsetWidth,K=C.div.offsetTop;var ie=(ie=C.div.childNodes)&&(ie=ie[0])&&ie.getClientRects&&ie.getClientRects();C=C.div.getBoundingClientRect(),I=ie?Math.max(ie[0]&&ie[0].height||0,C.height/ie.length):0}this.left=C.left,this.right=C.right,this.top=C.top||K,this.height=C.height||G,this.bottom=C.bottom||K+(C.height||G),this.width=C.width||H,this.lineHeight=I!==void 0?I:C.lineHeight}N.prototype.move=function(C,I){switch(I=I!==void 0?I:this.lineHeight,C){case"+x":this.left+=I,this.right+=I;break;case"-x":this.left-=I,this.right-=I;break;case"+y":this.top+=I,this.bottom+=I;break;case"-y":this.top-=I,this.bottom-=I;break}},N.prototype.overlaps=function(C){return this.left<C.right&&this.right>C.left&&this.top<C.bottom&&this.bottom>C.top},N.prototype.overlapsAny=function(C){for(var I=0;I<C.length;I++)if(this.overlaps(C[I]))return!0;return!1},N.prototype.within=function(C){return this.top>=C.top&&this.bottom<=C.bottom&&this.left>=C.left&&this.right<=C.right},N.prototype.overlapsOppositeAxis=function(C,I){switch(I){case"+x":return this.left<C.left;case"-x":return this.right>C.right;case"+y":return this.top<C.top;case"-y":return this.bottom>C.bottom}},N.prototype.intersectPercentage=function(C){var I=Math.max(0,Math.min(this.right,C.right)-Math.max(this.left,C.left)),G=Math.max(0,Math.min(this.bottom,C.bottom)-Math.max(this.top,C.top)),H=I*G;return H/(this.height*this.width)},N.prototype.toCSSCompatValues=function(C){return{top:this.top-C.top,bottom:C.bottom-this.bottom,left:this.left-C.left,right:C.right-this.right,height:this.height,width:this.width}},N.getSimpleBoxPosition=function(C){var I=C.div?C.div.offsetHeight:C.tagName?C.offsetHeight:0,G=C.div?C.div.offsetWidth:C.tagName?C.offsetWidth:0,H=C.div?C.div.offsetTop:C.tagName?C.offsetTop:0;C=C.div?C.div.getBoundingClientRect():C.tagName?C.getBoundingClientRect():C;var K={left:C.left,right:C.right,top:C.top||H,height:C.height||I,bottom:C.bottom||H+(C.height||I),width:C.width||G};return K};function $(C,I,G,H){function K(Ne,Ye){for(var Re,Oe=new N(Ne),Ve=1,nt=0;nt<Ye.length;nt++){for(;Ne.overlapsOppositeAxis(G,Ye[nt])||Ne.within(G)&&Ne.overlapsAny(H);)Ne.move(Ye[nt]);if(Ne.within(G))return Ne;var _t=Ne.intersectPercentage(G);Ve>_t&&(Re=new N(Ne),Ve=_t),Ne=new N(Oe)}return Re||Oe}var ie=new N(I),he=I.cue,fe=_(he),re=[];if(he.snapToLines){var ne;switch(he.vertical){case"":re=["+y","-y"],ne="height";break;case"rl":re=["+x","-x"],ne="width";break;case"lr":re=["-x","+x"],ne="width";break}var oe=ie.lineHeight,de=oe*Math.round(fe),ve=G[ne]+oe,ke=re[0];Math.abs(de)>ve&&(de=de<0?-1:1,de*=Math.ceil(ve/oe)*oe),fe<0&&(de+=he.vertical===""?G.height:G.width,re=re.reverse()),ie.move(ke,de)}else{var De=ie.lineHeight/G.height*100;switch(he.lineAlign){case"center":fe-=De/2;break;case"end":fe-=De;break}switch(he.vertical){case"":I.applyStyles({top:I.formatStyle(fe,"%")});break;case"rl":I.applyStyles({left:I.formatStyle(fe,"%")});break;case"lr":I.applyStyles({right:I.formatStyle(fe,"%")});break}re=["+y","-x","+x","-y"],ie=new N(I)}var Me=K(ie,re);I.move(Me.toCSSCompatValues(G))}function R(){}R.StringDecoder=function(){return{decode:function(C){if(!C)return"";if(typeof C!="string")throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(C))}}},R.convertCueToDOMTree=function(C,I){return!C||!I?null:d(C,I)};var L=.05,F="sans-serif",B="1.5%";return R.processCues=function(C,I,G){if(!C||!I||!G)return null;for(;G.firstChild;)G.removeChild(G.firstChild);var H=C.document.createElement("div");H.style.position="absolute",H.style.left="0",H.style.right="0",H.style.top="0",H.style.bottom="0",H.style.margin=B,G.appendChild(H);function K(oe){for(var de=0;de<oe.length;de++)if(oe[de].hasBeenReset||!oe[de].displayState)return!0;return!1}if(!K(I)){for(var ie=0;ie<I.length;ie++)H.appendChild(I[ie].displayState);return}var he=[],fe=N.getSimpleBoxPosition(H),re=Math.round(fe.height*L*100)/100,ne={font:re+"px "+F};(function(){for(var oe,de,ve=0;ve<I.length;ve++)de=I[ve],oe=new A(C,de,ne),H.appendChild(oe.div),$(C,oe,fe,he),de.displayState=oe.div,he.push(N.getSimpleBoxPosition(oe))})()},R.Parser=function(C,I,G){G||(G=I,I={}),I||(I={}),this.window=C,this.vttjs=I,this.state="INITIAL",this.buffer="",this.decoder=G||new TextDecoder("utf8"),this.regionList=[]},R.Parser.prototype={reportOrThrowError:function(C){if(C instanceof t)this.onparsingerror&&this.onparsingerror(C);else throw C},parse:function(C){var I=this;C&&(I.buffer+=I.decoder.decode(C,{stream:!0}));function G(){for(var oe=I.buffer,de=0;de<oe.length&&oe[de]!=="\r"&&oe[de]!==`
10
- `;)++de;var ve=oe.substr(0,de);return oe[de]==="\r"&&++de,oe[de]===`
11
- `&&++de,I.buffer=oe.substr(de),ve}function H(oe){var de=new r;if(n(oe,function(ke,De){switch(ke){case"id":de.set(ke,De);break;case"width":de.percent(ke,De);break;case"lines":de.integer(ke,De);break;case"regionanchor":case"viewportanchor":var Me=De.split(",");if(Me.length!==2)break;var Ne=new r;if(Ne.percent("x",Me[0]),Ne.percent("y",Me[1]),!Ne.has("x")||!Ne.has("y"))break;de.set(ke+"X",Ne.get("x")),de.set(ke+"Y",Ne.get("y"));break;case"scroll":de.alt(ke,De,["up"]);break}},/=/,/\s/),de.has("id")){var ve=new(I.vttjs.VTTRegion||I.window.VTTRegion);ve.width=de.get("width",100),ve.lines=de.get("lines",3),ve.regionAnchorX=de.get("regionanchorX",0),ve.regionAnchorY=de.get("regionanchorY",100),ve.viewportAnchorX=de.get("viewportanchorX",0),ve.viewportAnchorY=de.get("viewportanchorY",100),ve.scroll=de.get("scroll",""),I.onregion&&I.onregion(ve),I.regionList.push({id:de.get("id"),region:ve})}}function K(oe){var de=new r;n(oe,function(ve,ke){switch(ve){case"MPEGT":de.integer(ve+"S",ke);break;case"LOCA":de.set(ve+"L",i(ke));break}},/[^\d]:/,/,/),I.ontimestampmap&&I.ontimestampmap({MPEGTS:de.get("MPEGTS"),LOCAL:de.get("LOCAL")})}function ie(oe){oe.match(/X-TIMESTAMP-MAP/)?n(oe,function(de,ve){switch(de){case"X-TIMESTAMP-MAP":K(ve);break}},/=/):n(oe,function(de,ve){switch(de){case"Region":H(ve);break}},/:/)}try{var he;if(I.state==="INITIAL"){if(!/\r\n|\n/.test(I.buffer))return this;he=G();var fe=he.match(/^WEBVTT([ \t].*)?$/);if(!fe||!fe[0])throw new t(t.Errors.BadSignature);I.state="HEADER"}for(var re=!1;I.buffer;){if(!/\r\n|\n/.test(I.buffer))return this;switch(re?re=!1:he=G(),I.state){case"HEADER":/:/.test(he)?ie(he):he||(I.state="ID");continue;case"NOTE":he||(I.state="ID");continue;case"ID":if(/^NOTE($|[ \t])/.test(he)){I.state="NOTE";break}if(!he)continue;I.cue=new(I.vttjs.VTTCue||I.window.VTTCue)(0,0,"");try{I.cue.align="center"}catch{I.cue.align="middle"}if(I.state="CUE",he.indexOf("-->")===-1){I.cue.id=he;continue}case"CUE":try{a(he,I.cue,I.regionList)}catch(oe){I.reportOrThrowError(oe),I.cue=null,I.state="BADCUE";continue}I.state="CUETEXT";continue;case"CUETEXT":var ne=he.indexOf("-->")!==-1;if(!he||ne&&(re=!0)){I.oncue&&I.oncue(I.cue),I.cue=null,I.state="ID";continue}I.cue.text&&(I.cue.text+=`
12
- `),I.cue.text+=he.replace(/\u2028/g,`
13
- `).replace(/u2029/g,`
14
- `);continue;case"BADCUE":he||(I.state="ID");continue}}}catch(oe){I.reportOrThrowError(oe),I.state==="CUETEXT"&&I.cue&&I.oncue&&I.oncue(I.cue),I.cue=null,I.state=I.state==="INITIAL"?"BADWEBVTT":"BADCUE"}return this},flush:function(){var C=this;try{if(C.buffer+=C.decoder.decode(),(C.cue||C.state==="HEADER")&&(C.buffer+=`
15
-
16
- `,C.parse()),C.state==="INITIAL")throw new t(t.Errors.BadSignature)}catch(I){C.reportOrThrowError(I)}return C.onflush&&C.onflush(),this}},vf=R,vf}var yf,Yy;function wD(){if(Yy)return yf;Yy=1;var s="auto",e={"":1,lr:1,rl:1},t={start:1,center:1,end:1,left:1,right:1,auto:1,"line-left":1,"line-right":1};function i(a){if(typeof a!="string")return!1;var o=e[a.toLowerCase()];return o?a.toLowerCase():!1}function r(a){if(typeof a!="string")return!1;var o=t[a.toLowerCase()];return o?a.toLowerCase():!1}function n(a,o,l){this.hasBeenReset=!1;var u="",c=!1,h=a,d=o,g=l,y=null,p="",_=!0,k="auto",A="start",N="auto",$="auto",R=100,L="center";Object.defineProperties(this,{id:{enumerable:!0,get:function(){return u},set:function(F){u=""+F}},pauseOnExit:{enumerable:!0,get:function(){return c},set:function(F){c=!!F}},startTime:{enumerable:!0,get:function(){return h},set:function(F){if(typeof F!="number")throw new TypeError("Start time must be set to a number.");h=F,this.hasBeenReset=!0}},endTime:{enumerable:!0,get:function(){return d},set:function(F){if(typeof F!="number")throw new TypeError("End time must be set to a number.");d=F,this.hasBeenReset=!0}},text:{enumerable:!0,get:function(){return g},set:function(F){g=""+F,this.hasBeenReset=!0}},region:{enumerable:!0,get:function(){return y},set:function(F){y=F,this.hasBeenReset=!0}},vertical:{enumerable:!0,get:function(){return p},set:function(F){var B=i(F);if(B===!1)throw new SyntaxError("Vertical: an invalid or illegal direction string was specified.");p=B,this.hasBeenReset=!0}},snapToLines:{enumerable:!0,get:function(){return _},set:function(F){_=!!F,this.hasBeenReset=!0}},line:{enumerable:!0,get:function(){return k},set:function(F){if(typeof F!="number"&&F!==s)throw new SyntaxError("Line: an invalid number or illegal string was specified.");k=F,this.hasBeenReset=!0}},lineAlign:{enumerable:!0,get:function(){return A},set:function(F){var B=r(F);B?(A=B,this.hasBeenReset=!0):console.warn("lineAlign: an invalid or illegal string was specified.")}},position:{enumerable:!0,get:function(){return N},set:function(F){if(F<0||F>100)throw new Error("Position must be between 0 and 100.");N=F,this.hasBeenReset=!0}},positionAlign:{enumerable:!0,get:function(){return $},set:function(F){var B=r(F);B?($=B,this.hasBeenReset=!0):console.warn("positionAlign: an invalid or illegal string was specified.")}},size:{enumerable:!0,get:function(){return R},set:function(F){if(F<0||F>100)throw new Error("Size must be between 0 and 100.");R=F,this.hasBeenReset=!0}},align:{enumerable:!0,get:function(){return L},set:function(F){var B=r(F);if(!B)throw new SyntaxError("align: an invalid or illegal alignment string was specified.");L=B,this.hasBeenReset=!0}}}),this.displayState=void 0}return n.prototype.getCueAsHTML=function(){return WebVTT.convertCueToDOMTree(window,this.text)},yf=n,yf}var _f,Jy;function kD(){if(Jy)return _f;Jy=1;var s={"":!0,up:!0};function e(r){if(typeof r!="string")return!1;var n=s[r.toLowerCase()];return n?r.toLowerCase():!1}function t(r){return typeof r=="number"&&r>=0&&r<=100}function i(){var r=100,n=3,a=0,o=100,l=0,u=100,c="";Object.defineProperties(this,{width:{enumerable:!0,get:function(){return r},set:function(h){if(!t(h))throw new Error("Width must be between 0 and 100.");r=h}},lines:{enumerable:!0,get:function(){return n},set:function(h){if(typeof h!="number")throw new TypeError("Lines must be set to a number.");n=h}},regionAnchorY:{enumerable:!0,get:function(){return o},set:function(h){if(!t(h))throw new Error("RegionAnchorX must be between 0 and 100.");o=h}},regionAnchorX:{enumerable:!0,get:function(){return a},set:function(h){if(!t(h))throw new Error("RegionAnchorY must be between 0 and 100.");a=h}},viewportAnchorY:{enumerable:!0,get:function(){return u},set:function(h){if(!t(h))throw new Error("ViewportAnchorY must be between 0 and 100.");u=h}},viewportAnchorX:{enumerable:!0,get:function(){return l},set:function(h){if(!t(h))throw new Error("ViewportAnchorX must be between 0 and 100.");l=h}},scroll:{enumerable:!0,get:function(){return c},set:function(h){var d=e(h);d===!1?console.warn("Scroll: an invalid or illegal string was specified."):c=d}}})}return _f=i,_f}var Zy;function AD(){if(Zy)return gf.exports;Zy=1;var s=No(),e=gf.exports={WebVTT:ED(),VTTCue:wD(),VTTRegion:kD()};s.vttjs=e,s.WebVTT=e.WebVTT;var t=e.VTTCue,i=e.VTTRegion,r=s.VTTCue,n=s.VTTRegion;return e.shim=function(){s.VTTCue=t,s.VTTRegion=i},e.restore=function(){s.VTTCue=r,s.VTTRegion=n},s.VTTCue||e.shim(),gf.exports}var ID=AD();const ho=Hi(ID);var e_="https://example.com",Fh=function(e,t){if(/^[a-z]+:/i.test(t))return t;/^data:/.test(e)&&(e=O.location&&O.location.href||"");var i=/^\/\//.test(e),r=!O.location&&!/\/\//i.test(e);e=new O.URL(e,O.location||e_);var n=new URL(t,e);return r?n.href.slice(e_.length):i?n.href.slice(n.protocol.length):n.href},Rv=function(){function s(){this.listeners={}}var e=s.prototype;return e.on=function(i,r){this.listeners[i]||(this.listeners[i]=[]),this.listeners[i].push(r)},e.off=function(i,r){if(!this.listeners[i])return!1;var n=this.listeners[i].indexOf(r);return this.listeners[i]=this.listeners[i].slice(0),this.listeners[i].splice(n,1),n>-1},e.trigger=function(i){var r=this.listeners[i];if(r)if(arguments.length===2)for(var n=r.length,a=0;a<n;++a)r[a].call(this,arguments[1]);else for(var o=Array.prototype.slice.call(arguments,1),l=r.length,u=0;u<l;++u)r[u].apply(this,o)},e.dispose=function(){this.listeners={}},e.pipe=function(i){this.on("data",function(r){i.push(r)})},s}(),PD=function(e){return O.atob?O.atob(e):Buffer.from(e,"base64").toString("binary")};function k1(s){for(var e=PD(s),t=new Uint8Array(e.length),i=0;i<e.length;i++)t[i]=e.charCodeAt(i);return t}/*! @name m3u8-parser @version 7.2.0 @license Apache-2.0 */let DD=class extends Rv{constructor(){super(),this.buffer=""}push(e){let t;for(this.buffer+=e,t=this.buffer.indexOf(`
17
- `);t>-1;t=this.buffer.indexOf(`
18
- `))this.trigger("data",this.buffer.substring(0,t)),this.buffer=this.buffer.substring(t+1)}};const ND=" ",Tf=function(s){const e=/([0-9.]*)?@?([0-9.]*)?/.exec(s||""),t={};return e[1]&&(t.length=parseInt(e[1],10)),e[2]&&(t.offset=parseInt(e[2],10)),t},LD=function(){const t="(?:"+"[^=]*"+")=(?:"+'"[^"]*"|[^,]*'+")";return new RegExp("(?:^|,)("+t+")")},xi=function(s){const e={};if(!s)return e;const t=s.split(LD());let i=t.length,r;for(;i--;)t[i]!==""&&(r=/([^=]*)=(.*)/.exec(t[i]).slice(1),r[0]=r[0].replace(/^\s+|\s+$/g,""),r[1]=r[1].replace(/^\s+|\s+$/g,""),r[1]=r[1].replace(/^['"](.*)['"]$/g,"$1"),e[r[0]]=r[1]);return e},t_=s=>{const e=s.split("x"),t={};return e[0]&&(t.width=parseInt(e[0],10)),e[1]&&(t.height=parseInt(e[1],10)),t};let OD=class extends Rv{constructor(){super(),this.customParsers=[],this.tagMappers=[]}push(e){let t,i;if(e=e.trim(),e.length===0)return;if(e[0]!=="#"){this.trigger("data",{type:"uri",uri:e});return}this.tagMappers.reduce((n,a)=>{const o=a(e);return o===e?n:n.concat([o])},[e]).forEach(n=>{for(let a=0;a<this.customParsers.length;a++)if(this.customParsers[a].call(this,n))return;if(n.indexOf("#EXT")!==0){this.trigger("data",{type:"comment",text:n.slice(1)});return}if(n=n.replace("\r",""),t=/^#EXTM3U/.exec(n),t){this.trigger("data",{type:"tag",tagType:"m3u"});return}if(t=/^#EXTINF:([0-9\.]*)?,?(.*)?$/.exec(n),t){i={type:"tag",tagType:"inf"},t[1]&&(i.duration=parseFloat(t[1])),t[2]&&(i.title=t[2]),this.trigger("data",i);return}if(t=/^#EXT-X-TARGETDURATION:([0-9.]*)?/.exec(n),t){i={type:"tag",tagType:"targetduration"},t[1]&&(i.duration=parseInt(t[1],10)),this.trigger("data",i);return}if(t=/^#EXT-X-VERSION:([0-9.]*)?/.exec(n),t){i={type:"tag",tagType:"version"},t[1]&&(i.version=parseInt(t[1],10)),this.trigger("data",i);return}if(t=/^#EXT-X-MEDIA-SEQUENCE:(\-?[0-9.]*)?/.exec(n),t){i={type:"tag",tagType:"media-sequence"},t[1]&&(i.number=parseInt(t[1],10)),this.trigger("data",i);return}if(t=/^#EXT-X-DISCONTINUITY-SEQUENCE:(\-?[0-9.]*)?/.exec(n),t){i={type:"tag",tagType:"discontinuity-sequence"},t[1]&&(i.number=parseInt(t[1],10)),this.trigger("data",i);return}if(t=/^#EXT-X-PLAYLIST-TYPE:(.*)?$/.exec(n),t){i={type:"tag",tagType:"playlist-type"},t[1]&&(i.playlistType=t[1]),this.trigger("data",i);return}if(t=/^#EXT-X-BYTERANGE:(.*)?$/.exec(n),t){i=ft(Tf(t[1]),{type:"tag",tagType:"byterange"}),this.trigger("data",i);return}if(t=/^#EXT-X-ALLOW-CACHE:(YES|NO)?/.exec(n),t){i={type:"tag",tagType:"allow-cache"},t[1]&&(i.allowed=!/NO/.test(t[1])),this.trigger("data",i);return}if(t=/^#EXT-X-MAP:(.*)$/.exec(n),t){if(i={type:"tag",tagType:"map"},t[1]){const a=xi(t[1]);a.URI&&(i.uri=a.URI),a.BYTERANGE&&(i.byterange=Tf(a.BYTERANGE))}this.trigger("data",i);return}if(t=/^#EXT-X-STREAM-INF:(.*)$/.exec(n),t){i={type:"tag",tagType:"stream-inf"},t[1]&&(i.attributes=xi(t[1]),i.attributes.RESOLUTION&&(i.attributes.RESOLUTION=t_(i.attributes.RESOLUTION)),i.attributes.BANDWIDTH&&(i.attributes.BANDWIDTH=parseInt(i.attributes.BANDWIDTH,10)),i.attributes["FRAME-RATE"]&&(i.attributes["FRAME-RATE"]=parseFloat(i.attributes["FRAME-RATE"])),i.attributes["PROGRAM-ID"]&&(i.attributes["PROGRAM-ID"]=parseInt(i.attributes["PROGRAM-ID"],10))),this.trigger("data",i);return}if(t=/^#EXT-X-MEDIA:(.*)$/.exec(n),t){i={type:"tag",tagType:"media"},t[1]&&(i.attributes=xi(t[1])),this.trigger("data",i);return}if(t=/^#EXT-X-ENDLIST/.exec(n),t){this.trigger("data",{type:"tag",tagType:"endlist"});return}if(t=/^#EXT-X-DISCONTINUITY/.exec(n),t){this.trigger("data",{type:"tag",tagType:"discontinuity"});return}if(t=/^#EXT-X-PROGRAM-DATE-TIME:(.*)$/.exec(n),t){i={type:"tag",tagType:"program-date-time"},t[1]&&(i.dateTimeString=t[1],i.dateTimeObject=new Date(t[1])),this.trigger("data",i);return}if(t=/^#EXT-X-KEY:(.*)$/.exec(n),t){i={type:"tag",tagType:"key"},t[1]&&(i.attributes=xi(t[1]),i.attributes.IV&&(i.attributes.IV.substring(0,2).toLowerCase()==="0x"&&(i.attributes.IV=i.attributes.IV.substring(2)),i.attributes.IV=i.attributes.IV.match(/.{8}/g),i.attributes.IV[0]=parseInt(i.attributes.IV[0],16),i.attributes.IV[1]=parseInt(i.attributes.IV[1],16),i.attributes.IV[2]=parseInt(i.attributes.IV[2],16),i.attributes.IV[3]=parseInt(i.attributes.IV[3],16),i.attributes.IV=new Uint32Array(i.attributes.IV))),this.trigger("data",i);return}if(t=/^#EXT-X-START:(.*)$/.exec(n),t){i={type:"tag",tagType:"start"},t[1]&&(i.attributes=xi(t[1]),i.attributes["TIME-OFFSET"]=parseFloat(i.attributes["TIME-OFFSET"]),i.attributes.PRECISE=/YES/.test(i.attributes.PRECISE)),this.trigger("data",i);return}if(t=/^#EXT-X-CUE-OUT-CONT:(.*)?$/.exec(n),t){i={type:"tag",tagType:"cue-out-cont"},t[1]?i.data=t[1]:i.data="",this.trigger("data",i);return}if(t=/^#EXT-X-CUE-OUT:(.*)?$/.exec(n),t){i={type:"tag",tagType:"cue-out"},t[1]?i.data=t[1]:i.data="",this.trigger("data",i);return}if(t=/^#EXT-X-CUE-IN:?(.*)?$/.exec(n),t){i={type:"tag",tagType:"cue-in"},t[1]?i.data=t[1]:i.data="",this.trigger("data",i);return}if(t=/^#EXT-X-SKIP:(.*)$/.exec(n),t&&t[1]){i={type:"tag",tagType:"skip"},i.attributes=xi(t[1]),i.attributes.hasOwnProperty("SKIPPED-SEGMENTS")&&(i.attributes["SKIPPED-SEGMENTS"]=parseInt(i.attributes["SKIPPED-SEGMENTS"],10)),i.attributes.hasOwnProperty("RECENTLY-REMOVED-DATERANGES")&&(i.attributes["RECENTLY-REMOVED-DATERANGES"]=i.attributes["RECENTLY-REMOVED-DATERANGES"].split(ND)),this.trigger("data",i);return}if(t=/^#EXT-X-PART:(.*)$/.exec(n),t&&t[1]){i={type:"tag",tagType:"part"},i.attributes=xi(t[1]),["DURATION"].forEach(function(a){i.attributes.hasOwnProperty(a)&&(i.attributes[a]=parseFloat(i.attributes[a]))}),["INDEPENDENT","GAP"].forEach(function(a){i.attributes.hasOwnProperty(a)&&(i.attributes[a]=/YES/.test(i.attributes[a]))}),i.attributes.hasOwnProperty("BYTERANGE")&&(i.attributes.byterange=Tf(i.attributes.BYTERANGE)),this.trigger("data",i);return}if(t=/^#EXT-X-SERVER-CONTROL:(.*)$/.exec(n),t&&t[1]){i={type:"tag",tagType:"server-control"},i.attributes=xi(t[1]),["CAN-SKIP-UNTIL","PART-HOLD-BACK","HOLD-BACK"].forEach(function(a){i.attributes.hasOwnProperty(a)&&(i.attributes[a]=parseFloat(i.attributes[a]))}),["CAN-SKIP-DATERANGES","CAN-BLOCK-RELOAD"].forEach(function(a){i.attributes.hasOwnProperty(a)&&(i.attributes[a]=/YES/.test(i.attributes[a]))}),this.trigger("data",i);return}if(t=/^#EXT-X-PART-INF:(.*)$/.exec(n),t&&t[1]){i={type:"tag",tagType:"part-inf"},i.attributes=xi(t[1]),["PART-TARGET"].forEach(function(a){i.attributes.hasOwnProperty(a)&&(i.attributes[a]=parseFloat(i.attributes[a]))}),this.trigger("data",i);return}if(t=/^#EXT-X-PRELOAD-HINT:(.*)$/.exec(n),t&&t[1]){i={type:"tag",tagType:"preload-hint"},i.attributes=xi(t[1]),["BYTERANGE-START","BYTERANGE-LENGTH"].forEach(function(a){if(i.attributes.hasOwnProperty(a)){i.attributes[a]=parseInt(i.attributes[a],10);const o=a==="BYTERANGE-LENGTH"?"length":"offset";i.attributes.byterange=i.attributes.byterange||{},i.attributes.byterange[o]=i.attributes[a],delete i.attributes[a]}}),this.trigger("data",i);return}if(t=/^#EXT-X-RENDITION-REPORT:(.*)$/.exec(n),t&&t[1]){i={type:"tag",tagType:"rendition-report"},i.attributes=xi(t[1]),["LAST-MSN","LAST-PART"].forEach(function(a){i.attributes.hasOwnProperty(a)&&(i.attributes[a]=parseInt(i.attributes[a],10))}),this.trigger("data",i);return}if(t=/^#EXT-X-DATERANGE:(.*)$/.exec(n),t&&t[1]){i={type:"tag",tagType:"daterange"},i.attributes=xi(t[1]),["ID","CLASS"].forEach(function(o){i.attributes.hasOwnProperty(o)&&(i.attributes[o]=String(i.attributes[o]))}),["START-DATE","END-DATE"].forEach(function(o){i.attributes.hasOwnProperty(o)&&(i.attributes[o]=new Date(i.attributes[o]))}),["DURATION","PLANNED-DURATION"].forEach(function(o){i.attributes.hasOwnProperty(o)&&(i.attributes[o]=parseFloat(i.attributes[o]))}),["END-ON-NEXT"].forEach(function(o){i.attributes.hasOwnProperty(o)&&(i.attributes[o]=/YES/i.test(i.attributes[o]))}),["SCTE35-CMD"," SCTE35-OUT","SCTE35-IN"].forEach(function(o){i.attributes.hasOwnProperty(o)&&(i.attributes[o]=i.attributes[o].toString(16))});const a=/^X-([A-Z]+-)+[A-Z]+$/;for(const o in i.attributes){if(!a.test(o))continue;const l=/[0-9A-Fa-f]{6}/g.test(i.attributes[o]),u=/^\d+(\.\d+)?$/.test(i.attributes[o]);i.attributes[o]=l?i.attributes[o].toString(16):u?parseFloat(i.attributes[o]):String(i.attributes[o])}this.trigger("data",i);return}if(t=/^#EXT-X-INDEPENDENT-SEGMENTS/.exec(n),t){this.trigger("data",{type:"tag",tagType:"independent-segments"});return}if(t=/^#EXT-X-I-FRAMES-ONLY/.exec(n),t){this.trigger("data",{type:"tag",tagType:"i-frames-only"});return}if(t=/^#EXT-X-CONTENT-STEERING:(.*)$/.exec(n),t){i={type:"tag",tagType:"content-steering"},i.attributes=xi(t[1]),this.trigger("data",i);return}if(t=/^#EXT-X-I-FRAME-STREAM-INF:(.*)$/.exec(n),t){i={type:"tag",tagType:"i-frame-playlist"},i.attributes=xi(t[1]),i.attributes.URI&&(i.uri=i.attributes.URI),i.attributes.BANDWIDTH&&(i.attributes.BANDWIDTH=parseInt(i.attributes.BANDWIDTH,10)),i.attributes.RESOLUTION&&(i.attributes.RESOLUTION=t_(i.attributes.RESOLUTION)),i.attributes["AVERAGE-BANDWIDTH"]&&(i.attributes["AVERAGE-BANDWIDTH"]=parseInt(i.attributes["AVERAGE-BANDWIDTH"],10)),i.attributes["FRAME-RATE"]&&(i.attributes["FRAME-RATE"]=parseFloat(i.attributes["FRAME-RATE"])),this.trigger("data",i);return}if(t=/^#EXT-X-DEFINE:(.*)$/.exec(n),t){i={type:"tag",tagType:"define"},i.attributes=xi(t[1]),this.trigger("data",i);return}this.trigger("data",{type:"tag",data:n.slice(4)})})}addParser({expression:e,customType:t,dataParser:i,segment:r}){typeof i!="function"&&(i=n=>n),this.customParsers.push(n=>{if(e.exec(n))return this.trigger("data",{type:"custom",data:i(n),customType:t,segment:r}),!0})}addTagMapper({expression:e,map:t}){const i=r=>e.test(r)?t(r):r;this.tagMappers.push(i)}};const MD=s=>s.toLowerCase().replace(/-(\w)/g,e=>e[1].toUpperCase()),Jn=function(s){const e={};return Object.keys(s).forEach(function(t){e[MD(t)]=s[t]}),e},bf=function(s){const{serverControl:e,targetDuration:t,partTargetDuration:i}=s;if(!e)return;const r="#EXT-X-SERVER-CONTROL",n="holdBack",a="partHoldBack",o=t&&t*3,l=i&&i*2;t&&!e.hasOwnProperty(n)&&(e[n]=o,this.trigger("info",{message:`${r} defaulting HOLD-BACK to targetDuration * 3 (${o}).`})),o&&e[n]<o&&(this.trigger("warn",{message:`${r} clamping HOLD-BACK (${e[n]}) to targetDuration * 3 (${o})`}),e[n]=o),i&&!e.hasOwnProperty(a)&&(e[a]=i*3,this.trigger("info",{message:`${r} defaulting PART-HOLD-BACK to partTargetDuration * 3 (${e[a]}).`})),i&&e[a]<l&&(this.trigger("warn",{message:`${r} clamping PART-HOLD-BACK (${e[a]}) to partTargetDuration * 2 (${l}).`}),e[a]=l)};let RD=class extends Rv{constructor(e={}){super(),this.lineStream=new DD,this.parseStream=new OD,this.lineStream.pipe(this.parseStream),this.mainDefinitions=e.mainDefinitions||{},this.params=new URL(e.uri,"https://a.com").searchParams,this.lastProgramDateTime=null;const t=this,i=[];let r={},n,a,o=!1;const l=function(){},u={AUDIO:{},VIDEO:{},"CLOSED-CAPTIONS":{},SUBTITLES:{}},c="urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed";let h=0;this.manifest={allowCache:!0,discontinuityStarts:[],dateRanges:[],iFramePlaylists:[],segments:[]};let d=0,g=0;const y={};this.on("end",()=>{r.uri||!r.parts&&!r.preloadHints||(!r.map&&n&&(r.map=n),!r.key&&a&&(r.key=a),!r.timeline&&typeof h=="number"&&(r.timeline=h),this.manifest.preloadSegment=r)}),this.parseStream.on("data",function(p){let _,k;if(t.manifest.definitions){for(const A in t.manifest.definitions)if(p.uri&&(p.uri=p.uri.replace(`{$${A}}`,t.manifest.definitions[A])),p.attributes)for(const N in p.attributes)typeof p.attributes[N]=="string"&&(p.attributes[N]=p.attributes[N].replace(`{$${A}}`,t.manifest.definitions[A]))}({tag(){({version(){p.version&&(this.manifest.version=p.version)},"allow-cache"(){this.manifest.allowCache=p.allowed,"allowed"in p||(this.trigger("info",{message:"defaulting allowCache to YES"}),this.manifest.allowCache=!0)},byterange(){const A={};"length"in p&&(r.byterange=A,A.length=p.length,"offset"in p||(p.offset=d)),"offset"in p&&(r.byterange=A,A.offset=p.offset),d=A.offset+A.length},endlist(){this.manifest.endList=!0},inf(){"mediaSequence"in this.manifest||(this.manifest.mediaSequence=0,this.trigger("info",{message:"defaulting media sequence to zero"})),"discontinuitySequence"in this.manifest||(this.manifest.discontinuitySequence=0,this.trigger("info",{message:"defaulting discontinuity sequence to zero"})),p.title&&(r.title=p.title),p.duration>0&&(r.duration=p.duration),p.duration===0&&(r.duration=.01,this.trigger("info",{message:"updating zero segment duration to a small value"})),this.manifest.segments=i},key(){if(!p.attributes){this.trigger("warn",{message:"ignoring key declaration without attribute list"});return}if(p.attributes.METHOD==="NONE"){a=null;return}if(!p.attributes.URI){this.trigger("warn",{message:"ignoring key declaration without URI"});return}if(p.attributes.KEYFORMAT==="com.apple.streamingkeydelivery"){this.manifest.contentProtection=this.manifest.contentProtection||{},this.manifest.contentProtection["com.apple.fps.1_0"]={attributes:p.attributes};return}if(p.attributes.KEYFORMAT==="com.microsoft.playready"){this.manifest.contentProtection=this.manifest.contentProtection||{},this.manifest.contentProtection["com.microsoft.playready"]={uri:p.attributes.URI};return}if(p.attributes.KEYFORMAT===c){if(["SAMPLE-AES","SAMPLE-AES-CTR","SAMPLE-AES-CENC"].indexOf(p.attributes.METHOD)===-1){this.trigger("warn",{message:"invalid key method provided for Widevine"});return}if(p.attributes.METHOD==="SAMPLE-AES-CENC"&&this.trigger("warn",{message:"SAMPLE-AES-CENC is deprecated, please use SAMPLE-AES-CTR instead"}),p.attributes.URI.substring(0,23)!=="data:text/plain;base64,"){this.trigger("warn",{message:"invalid key URI provided for Widevine"});return}if(!(p.attributes.KEYID&&p.attributes.KEYID.substring(0,2)==="0x")){this.trigger("warn",{message:"invalid key ID provided for Widevine"});return}this.manifest.contentProtection=this.manifest.contentProtection||{},this.manifest.contentProtection["com.widevine.alpha"]={attributes:{schemeIdUri:p.attributes.KEYFORMAT,keyId:p.attributes.KEYID.substring(2)},pssh:k1(p.attributes.URI.split(",")[1])};return}p.attributes.METHOD||this.trigger("warn",{message:"defaulting key method to AES-128"}),a={method:p.attributes.METHOD||"AES-128",uri:p.attributes.URI},typeof p.attributes.IV<"u"&&(a.iv=p.attributes.IV)},"media-sequence"(){if(!isFinite(p.number)){this.trigger("warn",{message:"ignoring invalid media sequence: "+p.number});return}this.manifest.mediaSequence=p.number},"discontinuity-sequence"(){if(!isFinite(p.number)){this.trigger("warn",{message:"ignoring invalid discontinuity sequence: "+p.number});return}this.manifest.discontinuitySequence=p.number,h=p.number},"playlist-type"(){if(!/VOD|EVENT/.test(p.playlistType)){this.trigger("warn",{message:"ignoring unknown playlist type: "+p.playlist});return}this.manifest.playlistType=p.playlistType},map(){n={},p.uri&&(n.uri=p.uri),p.byterange&&(n.byterange=p.byterange),a&&(n.key=a)},"stream-inf"(){if(this.manifest.playlists=i,this.manifest.mediaGroups=this.manifest.mediaGroups||u,!p.attributes){this.trigger("warn",{message:"ignoring empty stream-inf attributes"});return}r.attributes||(r.attributes={}),ft(r.attributes,p.attributes)},media(){if(this.manifest.mediaGroups=this.manifest.mediaGroups||u,!(p.attributes&&p.attributes.TYPE&&p.attributes["GROUP-ID"]&&p.attributes.NAME)){this.trigger("warn",{message:"ignoring incomplete or missing media group"});return}const A=this.manifest.mediaGroups[p.attributes.TYPE];A[p.attributes["GROUP-ID"]]=A[p.attributes["GROUP-ID"]]||{},_=A[p.attributes["GROUP-ID"]],k={default:/yes/i.test(p.attributes.DEFAULT)},k.default?k.autoselect=!0:k.autoselect=/yes/i.test(p.attributes.AUTOSELECT),p.attributes.LANGUAGE&&(k.language=p.attributes.LANGUAGE),p.attributes.URI&&(k.uri=p.attributes.URI),p.attributes["INSTREAM-ID"]&&(k.instreamId=p.attributes["INSTREAM-ID"]),p.attributes.CHARACTERISTICS&&(k.characteristics=p.attributes.CHARACTERISTICS),p.attributes.FORCED&&(k.forced=/yes/i.test(p.attributes.FORCED)),_[p.attributes.NAME]=k},discontinuity(){h+=1,r.discontinuity=!0,this.manifest.discontinuityStarts.push(i.length)},"program-date-time"(){typeof this.manifest.dateTimeString>"u"&&(this.manifest.dateTimeString=p.dateTimeString,this.manifest.dateTimeObject=p.dateTimeObject),r.dateTimeString=p.dateTimeString,r.dateTimeObject=p.dateTimeObject;const{lastProgramDateTime:A}=this;this.lastProgramDateTime=new Date(p.dateTimeString).getTime(),A===null&&this.manifest.segments.reduceRight((N,$)=>($.programDateTime=N-$.duration*1e3,$.programDateTime),this.lastProgramDateTime)},targetduration(){if(!isFinite(p.duration)||p.duration<0){this.trigger("warn",{message:"ignoring invalid target duration: "+p.duration});return}this.manifest.targetDuration=p.duration,bf.call(this,this.manifest)},start(){if(!p.attributes||isNaN(p.attributes["TIME-OFFSET"])){this.trigger("warn",{message:"ignoring start declaration without appropriate attribute list"});return}this.manifest.start={timeOffset:p.attributes["TIME-OFFSET"],precise:p.attributes.PRECISE}},"cue-out"(){r.cueOut=p.data},"cue-out-cont"(){r.cueOutCont=p.data},"cue-in"(){r.cueIn=p.data},skip(){this.manifest.skip=Jn(p.attributes),this.warnOnMissingAttributes_("#EXT-X-SKIP",p.attributes,["SKIPPED-SEGMENTS"])},part(){o=!0;const A=this.manifest.segments.length,N=Jn(p.attributes);r.parts=r.parts||[],r.parts.push(N),N.byterange&&(N.byterange.hasOwnProperty("offset")||(N.byterange.offset=g),g=N.byterange.offset+N.byterange.length);const $=r.parts.length-1;this.warnOnMissingAttributes_(`#EXT-X-PART #${$} for segment #${A}`,p.attributes,["URI","DURATION"]),this.manifest.renditionReports&&this.manifest.renditionReports.forEach((R,L)=>{R.hasOwnProperty("lastPart")||this.trigger("warn",{message:`#EXT-X-RENDITION-REPORT #${L} lacks required attribute(s): LAST-PART`})})},"server-control"(){const A=this.manifest.serverControl=Jn(p.attributes);A.hasOwnProperty("canBlockReload")||(A.canBlockReload=!1,this.trigger("info",{message:"#EXT-X-SERVER-CONTROL defaulting CAN-BLOCK-RELOAD to false"})),bf.call(this,this.manifest),A.canSkipDateranges&&!A.hasOwnProperty("canSkipUntil")&&this.trigger("warn",{message:"#EXT-X-SERVER-CONTROL lacks required attribute CAN-SKIP-UNTIL which is required when CAN-SKIP-DATERANGES is set"})},"preload-hint"(){const A=this.manifest.segments.length,N=Jn(p.attributes),$=N.type&&N.type==="PART";r.preloadHints=r.preloadHints||[],r.preloadHints.push(N),N.byterange&&(N.byterange.hasOwnProperty("offset")||(N.byterange.offset=$?g:0,$&&(g=N.byterange.offset+N.byterange.length)));const R=r.preloadHints.length-1;if(this.warnOnMissingAttributes_(`#EXT-X-PRELOAD-HINT #${R} for segment #${A}`,p.attributes,["TYPE","URI"]),!!N.type)for(let L=0;L<r.preloadHints.length-1;L++){const F=r.preloadHints[L];F.type&&F.type===N.type&&this.trigger("warn",{message:`#EXT-X-PRELOAD-HINT #${R} for segment #${A} has the same TYPE ${N.type} as preload hint #${L}`})}},"rendition-report"(){const A=Jn(p.attributes);this.manifest.renditionReports=this.manifest.renditionReports||[],this.manifest.renditionReports.push(A);const N=this.manifest.renditionReports.length-1,$=["LAST-MSN","URI"];o&&$.push("LAST-PART"),this.warnOnMissingAttributes_(`#EXT-X-RENDITION-REPORT #${N}`,p.attributes,$)},"part-inf"(){this.manifest.partInf=Jn(p.attributes),this.warnOnMissingAttributes_("#EXT-X-PART-INF",p.attributes,["PART-TARGET"]),this.manifest.partInf.partTarget&&(this.manifest.partTargetDuration=this.manifest.partInf.partTarget),bf.call(this,this.manifest)},daterange(){this.manifest.dateRanges.push(Jn(p.attributes));const A=this.manifest.dateRanges.length-1;this.warnOnMissingAttributes_(`#EXT-X-DATERANGE #${A}`,p.attributes,["ID","START-DATE"]);const N=this.manifest.dateRanges[A];N.endDate&&N.startDate&&new Date(N.endDate)<new Date(N.startDate)&&this.trigger("warn",{message:"EXT-X-DATERANGE END-DATE must be equal to or later than the value of the START-DATE"}),N.duration&&N.duration<0&&this.trigger("warn",{message:"EXT-X-DATERANGE DURATION must not be negative"}),N.plannedDuration&&N.plannedDuration<0&&this.trigger("warn",{message:"EXT-X-DATERANGE PLANNED-DURATION must not be negative"});const $=!!N.endOnNext;if($&&!N.class&&this.trigger("warn",{message:"EXT-X-DATERANGE with an END-ON-NEXT=YES attribute must have a CLASS attribute"}),$&&(N.duration||N.endDate)&&this.trigger("warn",{message:"EXT-X-DATERANGE with an END-ON-NEXT=YES attribute must not contain DURATION or END-DATE attributes"}),N.duration&&N.endDate){const L=N.startDate.getTime()+N.duration*1e3;this.manifest.dateRanges[A].endDate=new Date(L)}if(!y[N.id])y[N.id]=N;else{for(const L in y[N.id])if(N[L]&&JSON.stringify(y[N.id][L])!==JSON.stringify(N[L])){this.trigger("warn",{message:"EXT-X-DATERANGE tags with the same ID in a playlist must have the same attributes values"});break}const R=this.manifest.dateRanges.findIndex(L=>L.id===N.id);this.manifest.dateRanges[R]=ft(this.manifest.dateRanges[R],N),y[N.id]=ft(y[N.id],N),this.manifest.dateRanges.pop()}},"independent-segments"(){this.manifest.independentSegments=!0},"i-frames-only"(){this.manifest.iFramesOnly=!0,this.requiredCompatibilityversion(this.manifest.version,4)},"content-steering"(){this.manifest.contentSteering=Jn(p.attributes),this.warnOnMissingAttributes_("#EXT-X-CONTENT-STEERING",p.attributes,["SERVER-URI"])},define(){this.manifest.definitions=this.manifest.definitions||{};const A=(N,$)=>{if(N in this.manifest.definitions){this.trigger("error",{message:`EXT-X-DEFINE: Duplicate name ${N}`});return}this.manifest.definitions[N]=$};if("QUERYPARAM"in p.attributes){if("NAME"in p.attributes||"IMPORT"in p.attributes){this.trigger("error",{message:"EXT-X-DEFINE: Invalid attributes"});return}const N=this.params.get(p.attributes.QUERYPARAM);if(!N){this.trigger("error",{message:`EXT-X-DEFINE: No query param ${p.attributes.QUERYPARAM}`});return}A(p.attributes.QUERYPARAM,decodeURIComponent(N));return}if("NAME"in p.attributes){if("IMPORT"in p.attributes){this.trigger("error",{message:"EXT-X-DEFINE: Invalid attributes"});return}if(!("VALUE"in p.attributes)||typeof p.attributes.VALUE!="string"){this.trigger("error",{message:`EXT-X-DEFINE: No value for ${p.attributes.NAME}`});return}A(p.attributes.NAME,p.attributes.VALUE);return}if("IMPORT"in p.attributes){if(!this.mainDefinitions[p.attributes.IMPORT]){this.trigger("error",{message:`EXT-X-DEFINE: No value ${p.attributes.IMPORT} to import, or IMPORT used on main playlist`});return}A(p.attributes.IMPORT,this.mainDefinitions[p.attributes.IMPORT]);return}this.trigger("error",{message:"EXT-X-DEFINE: No attribute"})},"i-frame-playlist"(){this.manifest.iFramePlaylists.push({attributes:p.attributes,uri:p.uri,timeline:h}),this.warnOnMissingAttributes_("#EXT-X-I-FRAME-STREAM-INF",p.attributes,["BANDWIDTH","URI"])}}[p.tagType]||l).call(t)},uri(){r.uri=p.uri,i.push(r),this.manifest.targetDuration&&!("duration"in r)&&(this.trigger("warn",{message:"defaulting segment duration to the target duration"}),r.duration=this.manifest.targetDuration),a&&(r.key=a),r.timeline=h,n&&(r.map=n),g=0,this.lastProgramDateTime!==null&&(r.programDateTime=this.lastProgramDateTime,this.lastProgramDateTime+=r.duration*1e3),r={}},comment(){},custom(){p.segment?(r.custom=r.custom||{},r.custom[p.customType]=p.data):(this.manifest.custom=this.manifest.custom||{},this.manifest.custom[p.customType]=p.data)}})[p.type].call(t)})}requiredCompatibilityversion(e,t){(e<t||!e)&&this.trigger("warn",{message:`manifest must be at least version ${t}`})}warnOnMissingAttributes_(e,t,i){const r=[];i.forEach(function(n){t.hasOwnProperty(n)||r.push(n)}),r.length&&this.trigger("warn",{message:`${e} lacks required attribute(s): ${r.join(", ")}`})}push(e){this.lineStream.push(e)}end(){this.lineStream.push(`
19
- `),this.manifest.dateRanges.length&&this.lastProgramDateTime===null&&this.trigger("warn",{message:"A playlist with EXT-X-DATERANGE tag must contain atleast one EXT-X-PROGRAM-DATE-TIME tag"}),this.lastProgramDateTime=null,this.trigger("end")}addParser(e){this.parseStream.addParser(e)}addTagMapper(e){this.parseStream.addTagMapper(e)}};var Xs={mp4:/^(av0?1|avc0?[1234]|vp0?9|flac|opus|mp3|mp4a|mp4v|stpp.ttml.im1t)/,webm:/^(vp0?[89]|av0?1|opus|vorbis)/,ogg:/^(vp0?[89]|theora|flac|opus|vorbis)/,video:/^(av0?1|avc0?[1234]|vp0?[89]|hvc1|hev1|theora|mp4v)/,audio:/^(mp4a|flac|vorbis|opus|ac-[34]|ec-3|alac|mp3|speex|aac)/,text:/^(stpp.ttml.im1t)/,muxerVideo:/^(avc0?1)/,muxerAudio:/^(mp4a)/,muxerText:/a^/},FD=["video","audio","text"],i_=["Video","Audio","Text"],A1=function(e){return e&&e.replace(/avc1\.(\d+)\.(\d+)/i,function(t,i,r){var n=("00"+Number(i).toString(16)).slice(-2),a=("00"+Number(r).toString(16)).slice(-2);return"avc1."+n+"00"+a})},Vr=function(e){e===void 0&&(e="");var t=e.split(","),i=[];return t.forEach(function(r){r=r.trim();var n;FD.forEach(function(a){var o=Xs[a].exec(r.toLowerCase());if(!(!o||o.length<=1)){n=a;var l=r.substring(0,o[1].length),u=r.replace(l,"");i.push({type:l,details:u,mediaType:a})}}),n||i.push({type:r,details:"",mediaType:"unknown"})}),i},BD=function(e,t){if(!e.mediaGroups.AUDIO||!t)return null;var i=e.mediaGroups.AUDIO[t];if(!i)return null;for(var r in i){var n=i[r];if(n.default&&n.playlists)return Vr(n.playlists[0].attributes.CODECS)}return null},I1=function(e){return e===void 0&&(e=""),Xs.audio.test(e.trim().toLowerCase())},UD=function(e){return e===void 0&&(e=""),Xs.text.test(e.trim().toLowerCase())},fo=function(e){if(!(!e||typeof e!="string")){var t=e.toLowerCase().split(",").map(function(n){return A1(n.trim())}),i="video";t.length===1&&I1(t[0])?i="audio":t.length===1&&UD(t[0])&&(i="application");var r="mp4";return t.every(function(n){return Xs.mp4.test(n)})?r="mp4":t.every(function(n){return Xs.webm.test(n)})?r="webm":t.every(function(n){return Xs.ogg.test(n)})&&(r="ogg"),i+"/"+r+';codecs="'+e+'"'}},Ml=function(e,t){return e===void 0&&(e=""),t===void 0&&(t=!1),O.MediaSource&&O.MediaSource.isTypeSupported&&O.MediaSource.isTypeSupported(fo(e))||t&&O.ManagedMediaSource&&O.ManagedMediaSource.isTypeSupported&&O.ManagedMediaSource.isTypeSupported(fo(e))||!1},Sf=function(e){return e===void 0&&(e=""),e.toLowerCase().split(",").every(function(t){t=t.trim();for(var i=0;i<i_.length;i++){var r=i_[i];if(Xs["muxer"+r].test(t))return!0}return!1})},r_="mp4a.40.2",$D="avc1.4d400d",jD=/^(audio|video|application)\/(x-|vnd\.apple\.)?mpegurl/i,qD=/^application\/dash\+xml/i,P1=function(e){return jD.test(e)?"hls":qD.test(e)?"dash":e==="application/vnd.videojs.vhs+json"?"vhs-json":null},VD=function(e){return e.toString(2).length},HD=function(e){return Math.ceil(VD(e)/8)},D1=function(e){return ArrayBuffer.isView==="function"?ArrayBuffer.isView(e):e&&e.buffer instanceof ArrayBuffer},zD=function(e){return D1(e)},$e=function(e){return e instanceof Uint8Array?e:(!Array.isArray(e)&&!zD(e)&&!(e instanceof ArrayBuffer)&&(typeof e!="number"||typeof e=="number"&&e!==e?e=0:e=[e]),new Uint8Array(e&&e.buffer||e,e&&e.byteOffset||0,e&&e.byteLength||0))},ci=O.BigInt||Number,Eg=[ci("0x1"),ci("0x100"),ci("0x10000"),ci("0x1000000"),ci("0x100000000"),ci("0x10000000000"),ci("0x1000000000000"),ci("0x100000000000000"),ci("0x10000000000000000")];(function(){var s=new Uint16Array([65484]),e=new Uint8Array(s.buffer,s.byteOffset,s.byteLength);return e[0]===255?"big":e[0]===204?"little":"unknown"})();var WD=function(e,t){var i=t===void 0?{}:t,r=i.signed,n=r===void 0?!1:r,a=i.le,o=a===void 0?!1:a;e=$e(e);var l=o?"reduce":"reduceRight",u=e[l]?e[l]:Array.prototype[l],c=u.call(e,function(d,g,y){var p=o?y:Math.abs(y+1-e.length);return d+ci(g)*Eg[p]},ci(0));if(n){var h=Eg[e.length]/ci(2)-ci(1);c=ci(c),c>h&&(c-=h,c-=h,c-=ci(2))}return Number(c)},GD=function(e,t){var i={},r=i.le,n=r===void 0?!1:r;(typeof e!="bigint"&&typeof e!="number"||typeof e=="number"&&e!==e)&&(e=0),e=ci(e);for(var a=HD(e),o=new Uint8Array(new ArrayBuffer(a)),l=0;l<a;l++){var u=n?l:Math.abs(l+1-o.length);o[u]=Number(e/Eg[l]&ci(255)),e<0&&(o[u]=Math.abs(~o[u]),o[u]-=l===0?1:2)}return o},N1=function(e,t){if(typeof e!="string"&&e&&typeof e.toString=="function"&&(e=e.toString()),typeof e!="string")return new Uint8Array;t||(e=unescape(encodeURIComponent(e)));for(var i=new Uint8Array(e.length),r=0;r<e.length;r++)i[r]=e.charCodeAt(r);return i},KD=function(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];if(t=t.filter(function(o){return o&&(o.byteLength||o.length)&&typeof o!="string"}),t.length<=1)return $e(t[0]);var r=t.reduce(function(o,l,u){return o+(l.byteLength||l.length)},0),n=new Uint8Array(r),a=0;return t.forEach(function(o){o=$e(o),n.set(o,a),a+=o.byteLength}),n},At=function(e,t,i){var r=i===void 0?{}:i,n=r.offset,a=n===void 0?0:n,o=r.mask,l=o===void 0?[]:o;e=$e(e),t=$e(t);var u=t.every?t.every:Array.prototype.every;return t.length&&e.length-a>=t.length&&u.call(t,function(c,h){var d=l[h]?l[h]&e[a+h]:e[a+h];return c===d})},XD=function(e,t,i){t.forEach(function(r){for(var n in e.mediaGroups[r])for(var a in e.mediaGroups[r][n]){var o=e.mediaGroups[r][n][a];i(o,r,n,a)}})},pl={},bn={},Ls={},n_;function Bh(){if(n_)return Ls;n_=1;function s(n,a,o){if(o===void 0&&(o=Array.prototype),n&&typeof o.find=="function")return o.find.call(n,a);for(var l=0;l<n.length;l++)if(Object.prototype.hasOwnProperty.call(n,l)){var u=n[l];if(a.call(void 0,u,l,n))return u}}function e(n,a){return a===void 0&&(a=Object),a&&typeof a.freeze=="function"?a.freeze(n):n}function t(n,a){if(n===null||typeof n!="object")throw new TypeError("target is not an object");for(var o in a)Object.prototype.hasOwnProperty.call(a,o)&&(n[o]=a[o]);return n}var i=e({HTML:"text/html",isHTML:function(n){return n===i.HTML},XML_APPLICATION:"application/xml",XML_TEXT:"text/xml",XML_XHTML_APPLICATION:"application/xhtml+xml",XML_SVG_IMAGE:"image/svg+xml"}),r=e({HTML:"http://www.w3.org/1999/xhtml",isHTML:function(n){return n===r.HTML},SVG:"http://www.w3.org/2000/svg",XML:"http://www.w3.org/XML/1998/namespace",XMLNS:"http://www.w3.org/2000/xmlns/"});return Ls.assign=t,Ls.find=s,Ls.freeze=e,Ls.MIME_TYPE=i,Ls.NAMESPACE=r,Ls}var s_;function L1(){if(s_)return bn;s_=1;var s=Bh(),e=s.find,t=s.NAMESPACE;function i(q){return q!==""}function r(q){return q?q.split(/[\t\n\f\r ]+/).filter(i):[]}function n(q,V){return q.hasOwnProperty(V)||(q[V]=!0),q}function a(q){if(!q)return[];var V=r(q);return Object.keys(V.reduce(n,{}))}function o(q){return function(V){return q&&q.indexOf(V)!==-1}}function l(q,V){for(var ee in q)Object.prototype.hasOwnProperty.call(q,ee)&&(V[ee]=q[ee])}function u(q,V){var ee=q.prototype;if(!(ee instanceof V)){let pe=function(){};pe.prototype=V.prototype,pe=new pe,l(ee,pe),q.prototype=ee=pe}ee.constructor!=q&&(typeof q!="function"&&console.error("unknown Class:"+q),ee.constructor=q)}var c={},h=c.ELEMENT_NODE=1,d=c.ATTRIBUTE_NODE=2,g=c.TEXT_NODE=3,y=c.CDATA_SECTION_NODE=4,p=c.ENTITY_REFERENCE_NODE=5,_=c.ENTITY_NODE=6,k=c.PROCESSING_INSTRUCTION_NODE=7,A=c.COMMENT_NODE=8,N=c.DOCUMENT_NODE=9,$=c.DOCUMENT_TYPE_NODE=10,R=c.DOCUMENT_FRAGMENT_NODE=11,L=c.NOTATION_NODE=12,F={},B={};F.INDEX_SIZE_ERR=(B[1]="Index size error",1),F.DOMSTRING_SIZE_ERR=(B[2]="DOMString size error",2);var C=F.HIERARCHY_REQUEST_ERR=(B[3]="Hierarchy request error",3);F.WRONG_DOCUMENT_ERR=(B[4]="Wrong document",4),F.INVALID_CHARACTER_ERR=(B[5]="Invalid character",5),F.NO_DATA_ALLOWED_ERR=(B[6]="No data allowed",6),F.NO_MODIFICATION_ALLOWED_ERR=(B[7]="No modification allowed",7);var I=F.NOT_FOUND_ERR=(B[8]="Not found",8);F.NOT_SUPPORTED_ERR=(B[9]="Not supported",9);var G=F.INUSE_ATTRIBUTE_ERR=(B[10]="Attribute in use",10);F.INVALID_STATE_ERR=(B[11]="Invalid state",11),F.SYNTAX_ERR=(B[12]="Syntax error",12),F.INVALID_MODIFICATION_ERR=(B[13]="Invalid modification",13),F.NAMESPACE_ERR=(B[14]="Invalid namespace",14),F.INVALID_ACCESS_ERR=(B[15]="Invalid access",15);function H(q,V){if(V instanceof Error)var ee=V;else ee=this,Error.call(this,B[q]),this.message=B[q],Error.captureStackTrace&&Error.captureStackTrace(this,H);return ee.code=q,V&&(this.message=this.message+": "+V),ee}H.prototype=Error.prototype,l(F,H);function K(){}K.prototype={length:0,item:function(q){return q>=0&&q<this.length?this[q]:null},toString:function(q,V){for(var ee=[],pe=0;pe<this.length;pe++)Ki(this[pe],ee,q,V);return ee.join("")},filter:function(q){return Array.prototype.filter.call(this,q)},indexOf:function(q){return Array.prototype.indexOf.call(this,q)}};function ie(q,V){this._node=q,this._refresh=V,he(this)}function he(q){var V=q._node._inc||q._node.ownerDocument._inc;if(q._inc!==V){var ee=q._refresh(q._node);if(pa(q,"length",ee.length),!q.$$length||ee.length<q.$$length)for(var pe=ee.length;pe in q;pe++)Object.prototype.hasOwnProperty.call(q,pe)&&delete q[pe];l(ee,q),q._inc=V}}ie.prototype.item=function(q){return he(this),this[q]||null},u(ie,K);function fe(){}function re(q,V){for(var ee=q.length;ee--;)if(q[ee]===V)return ee}function ne(q,V,ee,pe){if(pe?V[re(V,pe)]=ee:V[V.length++]=ee,q){ee.ownerElement=q;var we=q.ownerDocument;we&&(pe&&Ye(we,q,pe),Ne(we,q,ee))}}function oe(q,V,ee){var pe=re(V,ee);if(pe>=0){for(var we=V.length-1;pe<we;)V[pe]=V[++pe];if(V.length=we,q){var qe=q.ownerDocument;qe&&(Ye(qe,q,ee),ee.ownerElement=null)}}else throw new H(I,new Error(q.tagName+"@"+ee))}fe.prototype={length:0,item:K.prototype.item,getNamedItem:function(q){for(var V=this.length;V--;){var ee=this[V];if(ee.nodeName==q)return ee}},setNamedItem:function(q){var V=q.ownerElement;if(V&&V!=this._ownerElement)throw new H(G);var ee=this.getNamedItem(q.nodeName);return ne(this._ownerElement,this,q,ee),ee},setNamedItemNS:function(q){var V=q.ownerElement,ee;if(V&&V!=this._ownerElement)throw new H(G);return ee=this.getNamedItemNS(q.namespaceURI,q.localName),ne(this._ownerElement,this,q,ee),ee},removeNamedItem:function(q){var V=this.getNamedItem(q);return oe(this._ownerElement,this,V),V},removeNamedItemNS:function(q,V){var ee=this.getNamedItemNS(q,V);return oe(this._ownerElement,this,ee),ee},getNamedItemNS:function(q,V){for(var ee=this.length;ee--;){var pe=this[ee];if(pe.localName==V&&pe.namespaceURI==q)return pe}return null}};function de(){}de.prototype={hasFeature:function(q,V){return!0},createDocument:function(q,V,ee){var pe=new Me;if(pe.implementation=this,pe.childNodes=new K,pe.doctype=ee||null,ee&&pe.appendChild(ee),V){var we=pe.createElementNS(q,V);pe.appendChild(we)}return pe},createDocumentType:function(q,V,ee){var pe=new Gi;return pe.name=q,pe.nodeName=q,pe.publicId=V||"",pe.systemId=ee||"",pe}};function ve(){}ve.prototype={firstChild:null,lastChild:null,previousSibling:null,nextSibling:null,attributes:null,parentNode:null,childNodes:null,ownerDocument:null,nodeValue:null,namespaceURI:null,prefix:null,localName:null,insertBefore:function(q,V){return Fe(this,q,V)},replaceChild:function(q,V){Fe(this,q,V,Be),V&&this.removeChild(V)},removeChild:function(q){return Oe(this,q)},appendChild:function(q){return this.insertBefore(q,null)},hasChildNodes:function(){return this.firstChild!=null},cloneNode:function(q){return ms(this.ownerDocument||this,this,q)},normalize:function(){for(var q=this.firstChild;q;){var V=q.nextSibling;V&&V.nodeType==g&&q.nodeType==g?(this.removeChild(V),q.appendData(V.data)):(q.normalize(),q=V)}},isSupported:function(q,V){return this.ownerDocument.implementation.hasFeature(q,V)},hasAttributes:function(){return this.attributes.length>0},lookupPrefix:function(q){for(var V=this;V;){var ee=V._nsMap;if(ee){for(var pe in ee)if(Object.prototype.hasOwnProperty.call(ee,pe)&&ee[pe]===q)return pe}V=V.nodeType==d?V.ownerDocument:V.parentNode}return null},lookupNamespaceURI:function(q){for(var V=this;V;){var ee=V._nsMap;if(ee&&Object.prototype.hasOwnProperty.call(ee,q))return ee[q];V=V.nodeType==d?V.ownerDocument:V.parentNode}return null},isDefaultNamespace:function(q){var V=this.lookupPrefix(q);return V==null}};function ke(q){return q=="<"&&"&lt;"||q==">"&&"&gt;"||q=="&"&&"&amp;"||q=='"'&&"&quot;"||"&#"+q.charCodeAt()+";"}l(c,ve),l(c,ve.prototype);function De(q,V){if(V(q))return!0;if(q=q.firstChild)do if(De(q,V))return!0;while(q=q.nextSibling)}function Me(){this.ownerDocument=this}function Ne(q,V,ee){q&&q._inc++;var pe=ee.namespaceURI;pe===t.XMLNS&&(V._nsMap[ee.prefix?ee.localName:""]=ee.value)}function Ye(q,V,ee,pe){q&&q._inc++;var we=ee.namespaceURI;we===t.XMLNS&&delete V._nsMap[ee.prefix?ee.localName:""]}function Re(q,V,ee){if(q&&q._inc){q._inc++;var pe=V.childNodes;if(ee)pe[pe.length++]=ee;else{for(var we=V.firstChild,qe=0;we;)pe[qe++]=we,we=we.nextSibling;pe.length=qe,delete pe[pe.length]}}}function Oe(q,V){var ee=V.previousSibling,pe=V.nextSibling;return ee?ee.nextSibling=pe:q.firstChild=pe,pe?pe.previousSibling=ee:q.lastChild=ee,V.parentNode=null,V.previousSibling=null,V.nextSibling=null,Re(q.ownerDocument,q),V}function Ve(q){return q&&(q.nodeType===ve.DOCUMENT_NODE||q.nodeType===ve.DOCUMENT_FRAGMENT_NODE||q.nodeType===ve.ELEMENT_NODE)}function nt(q){return q&&(Nt(q)||Mi(q)||_t(q)||q.nodeType===ve.DOCUMENT_FRAGMENT_NODE||q.nodeType===ve.COMMENT_NODE||q.nodeType===ve.PROCESSING_INSTRUCTION_NODE)}function _t(q){return q&&q.nodeType===ve.DOCUMENT_TYPE_NODE}function Nt(q){return q&&q.nodeType===ve.ELEMENT_NODE}function Mi(q){return q&&q.nodeType===ve.TEXT_NODE}function Ft(q,V){var ee=q.childNodes||[];if(e(ee,Nt)||_t(V))return!1;var pe=e(ee,_t);return!(V&&pe&&ee.indexOf(pe)>ee.indexOf(V))}function zi(q,V){var ee=q.childNodes||[];function pe(qe){return Nt(qe)&&qe!==V}if(e(ee,pe))return!1;var we=e(ee,_t);return!(V&&we&&ee.indexOf(we)>ee.indexOf(V))}function Te(q,V,ee){if(!Ve(q))throw new H(C,"Unexpected parent node type "+q.nodeType);if(ee&&ee.parentNode!==q)throw new H(I,"child not in parent");if(!nt(V)||_t(V)&&q.nodeType!==ve.DOCUMENT_NODE)throw new H(C,"Unexpected node type "+V.nodeType+" for parent node type "+q.nodeType)}function Ee(q,V,ee){var pe=q.childNodes||[],we=V.childNodes||[];if(V.nodeType===ve.DOCUMENT_FRAGMENT_NODE){var qe=we.filter(Nt);if(qe.length>1||e(we,Mi))throw new H(C,"More than one element or text in fragment");if(qe.length===1&&!Ft(q,ee))throw new H(C,"Element in fragment can not be inserted before doctype")}if(Nt(V)&&!Ft(q,ee))throw new H(C,"Only one element can be added and only after doctype");if(_t(V)){if(e(pe,_t))throw new H(C,"Only one doctype is allowed");var ut=e(pe,Nt);if(ee&&pe.indexOf(ut)<pe.indexOf(ee))throw new H(C,"Doctype can only be inserted before an element");if(!ee&&ut)throw new H(C,"Doctype can not be appended since element is present")}}function Be(q,V,ee){var pe=q.childNodes||[],we=V.childNodes||[];if(V.nodeType===ve.DOCUMENT_FRAGMENT_NODE){var qe=we.filter(Nt);if(qe.length>1||e(we,Mi))throw new H(C,"More than one element or text in fragment");if(qe.length===1&&!zi(q,ee))throw new H(C,"Element in fragment can not be inserted before doctype")}if(Nt(V)&&!zi(q,ee))throw new H(C,"Only one element can be added and only after doctype");if(_t(V)){if(e(pe,function(oi){return _t(oi)&&oi!==ee}))throw new H(C,"Only one doctype is allowed");var ut=e(pe,Nt);if(ee&&pe.indexOf(ut)<pe.indexOf(ee))throw new H(C,"Doctype can only be inserted before an element")}}function Fe(q,V,ee,pe){Te(q,V,ee),q.nodeType===ve.DOCUMENT_NODE&&(pe||Ee)(q,V,ee);var we=V.parentNode;if(we&&we.removeChild(V),V.nodeType===R){var qe=V.firstChild;if(qe==null)return V;var ut=V.lastChild}else qe=ut=V;var Yt=ee?ee.previousSibling:q.lastChild;qe.previousSibling=Yt,ut.nextSibling=ee,Yt?Yt.nextSibling=qe:q.firstChild=qe,ee==null?q.lastChild=ut:ee.previousSibling=ut;do qe.parentNode=q;while(qe!==ut&&(qe=qe.nextSibling));return Re(q.ownerDocument||q,q),V.nodeType==R&&(V.firstChild=V.lastChild=null),V}function Xe(q,V){return V.parentNode&&V.parentNode.removeChild(V),V.parentNode=q,V.previousSibling=q.lastChild,V.nextSibling=null,V.previousSibling?V.previousSibling.nextSibling=V:q.firstChild=V,q.lastChild=V,Re(q.ownerDocument,q,V),V}Me.prototype={nodeName:"#document",nodeType:N,doctype:null,documentElement:null,_inc:1,insertBefore:function(q,V){if(q.nodeType==R){for(var ee=q.firstChild;ee;){var pe=ee.nextSibling;this.insertBefore(ee,V),ee=pe}return q}return Fe(this,q,V),q.ownerDocument=this,this.documentElement===null&&q.nodeType===h&&(this.documentElement=q),q},removeChild:function(q){return this.documentElement==q&&(this.documentElement=null),Oe(this,q)},replaceChild:function(q,V){Fe(this,q,V,Be),q.ownerDocument=this,V&&this.removeChild(V),Nt(q)&&(this.documentElement=q)},importNode:function(q,V){return fa(this,q,V)},getElementById:function(q){var V=null;return De(this.documentElement,function(ee){if(ee.nodeType==h&&ee.getAttribute("id")==q)return V=ee,!0}),V},getElementsByClassName:function(q){var V=a(q);return new ie(this,function(ee){var pe=[];return V.length>0&&De(ee.documentElement,function(we){if(we!==ee&&we.nodeType===h){var qe=we.getAttribute("class");if(qe){var ut=q===qe;if(!ut){var Yt=a(qe);ut=V.every(o(Yt))}ut&&pe.push(we)}}}),pe})},createElement:function(q){var V=new Je;V.ownerDocument=this,V.nodeName=q,V.tagName=q,V.localName=q,V.childNodes=new K;var ee=V.attributes=new fe;return ee._ownerElement=V,V},createDocumentFragment:function(){var q=new Ze;return q.ownerDocument=this,q.childNodes=new K,q},createTextNode:function(q){var V=new Sr;return V.ownerDocument=this,V.appendData(q),V},createComment:function(q){var V=new xr;return V.ownerDocument=this,V.appendData(q),V},createCDATASection:function(q){var V=new cr;return V.ownerDocument=this,V.appendData(q),V},createProcessingInstruction:function(q,V){var ee=new st;return ee.ownerDocument=this,ee.tagName=ee.nodeName=ee.target=q,ee.nodeValue=ee.data=V,ee},createAttribute:function(q){var V=new Tt;return V.ownerDocument=this,V.name=q,V.nodeName=q,V.localName=q,V.specified=!0,V},createEntityReference:function(q){var V=new cn;return V.ownerDocument=this,V.nodeName=q,V},createElementNS:function(q,V){var ee=new Je,pe=V.split(":"),we=ee.attributes=new fe;return ee.childNodes=new K,ee.ownerDocument=this,ee.nodeName=V,ee.tagName=V,ee.namespaceURI=q,pe.length==2?(ee.prefix=pe[0],ee.localName=pe[1]):ee.localName=V,we._ownerElement=ee,ee},createAttributeNS:function(q,V){var ee=new Tt,pe=V.split(":");return ee.ownerDocument=this,ee.nodeName=V,ee.name=V,ee.namespaceURI=q,ee.specified=!0,pe.length==2?(ee.prefix=pe[0],ee.localName=pe[1]):ee.localName=V,ee}},u(Me,ve);function Je(){this._nsMap={}}Je.prototype={nodeType:h,hasAttribute:function(q){return this.getAttributeNode(q)!=null},getAttribute:function(q){var V=this.getAttributeNode(q);return V&&V.value||""},getAttributeNode:function(q){return this.attributes.getNamedItem(q)},setAttribute:function(q,V){var ee=this.ownerDocument.createAttribute(q);ee.value=ee.nodeValue=""+V,this.setAttributeNode(ee)},removeAttribute:function(q){var V=this.getAttributeNode(q);V&&this.removeAttributeNode(V)},appendChild:function(q){return q.nodeType===R?this.insertBefore(q,null):Xe(this,q)},setAttributeNode:function(q){return this.attributes.setNamedItem(q)},setAttributeNodeNS:function(q){return this.attributes.setNamedItemNS(q)},removeAttributeNode:function(q){return this.attributes.removeNamedItem(q.nodeName)},removeAttributeNS:function(q,V){var ee=this.getAttributeNodeNS(q,V);ee&&this.removeAttributeNode(ee)},hasAttributeNS:function(q,V){return this.getAttributeNodeNS(q,V)!=null},getAttributeNS:function(q,V){var ee=this.getAttributeNodeNS(q,V);return ee&&ee.value||""},setAttributeNS:function(q,V,ee){var pe=this.ownerDocument.createAttributeNS(q,V);pe.value=pe.nodeValue=""+ee,this.setAttributeNode(pe)},getAttributeNodeNS:function(q,V){return this.attributes.getNamedItemNS(q,V)},getElementsByTagName:function(q){return new ie(this,function(V){var ee=[];return De(V,function(pe){pe!==V&&pe.nodeType==h&&(q==="*"||pe.tagName==q)&&ee.push(pe)}),ee})},getElementsByTagNameNS:function(q,V){return new ie(this,function(ee){var pe=[];return De(ee,function(we){we!==ee&&we.nodeType===h&&(q==="*"||we.namespaceURI===q)&&(V==="*"||we.localName==V)&&pe.push(we)}),pe})}},Me.prototype.getElementsByTagName=Je.prototype.getElementsByTagName,Me.prototype.getElementsByTagNameNS=Je.prototype.getElementsByTagNameNS,u(Je,ve);function Tt(){}Tt.prototype.nodeType=d,u(Tt,ve);function Wi(){}Wi.prototype={data:"",substringData:function(q,V){return this.data.substring(q,q+V)},appendData:function(q){q=this.data+q,this.nodeValue=this.data=q,this.length=q.length},insertData:function(q,V){this.replaceData(q,0,V)},appendChild:function(q){throw new Error(B[C])},deleteData:function(q,V){this.replaceData(q,V,"")},replaceData:function(q,V,ee){var pe=this.data.substring(0,q),we=this.data.substring(q+V);ee=pe+ee+we,this.nodeValue=this.data=ee,this.length=ee.length}},u(Wi,ve);function Sr(){}Sr.prototype={nodeName:"#text",nodeType:g,splitText:function(q){var V=this.data,ee=V.substring(q);V=V.substring(0,q),this.data=this.nodeValue=V,this.length=V.length;var pe=this.ownerDocument.createTextNode(ee);return this.parentNode&&this.parentNode.insertBefore(pe,this.nextSibling),pe}},u(Sr,Wi);function xr(){}xr.prototype={nodeName:"#comment",nodeType:A},u(xr,Wi);function cr(){}cr.prototype={nodeName:"#cdata-section",nodeType:y},u(cr,Wi);function Gi(){}Gi.prototype.nodeType=$,u(Gi,ve);function un(){}un.prototype.nodeType=L,u(un,ve);function Fn(){}Fn.prototype.nodeType=_,u(Fn,ve);function cn(){}cn.prototype.nodeType=p,u(cn,ve);function Ze(){}Ze.prototype.nodeName="#document-fragment",Ze.prototype.nodeType=R,u(Ze,ve);function st(){}st.prototype.nodeType=k,u(st,ve);function ha(){}ha.prototype.serializeToString=function(q,V,ee){return hn.call(q,V,ee)},ve.prototype.toString=hn;function hn(q,V){var ee=[],pe=this.nodeType==9&&this.documentElement||this,we=pe.prefix,qe=pe.namespaceURI;if(qe&&we==null){var we=pe.lookupPrefix(qe);if(we==null)var ut=[{namespace:qe,prefix:null}]}return Ki(this,ee,q,V,ut),ee.join("")}function da(q,V,ee){var pe=q.prefix||"",we=q.namespaceURI;if(!we||pe==="xml"&&we===t.XML||we===t.XMLNS)return!1;for(var qe=ee.length;qe--;){var ut=ee[qe];if(ut.prefix===pe)return ut.namespace!==we}return!0}function ps(q,V,ee){q.push(" ",V,'="',ee.replace(/[<>&"\t\n\r]/g,ke),'"')}function Ki(q,V,ee,pe,we){if(we||(we=[]),pe)if(q=pe(q),q){if(typeof q=="string"){V.push(q);return}}else return;switch(q.nodeType){case h:var qe=q.attributes,ut=qe.length,bt=q.firstChild,Yt=q.tagName;ee=t.isHTML(q.namespaceURI)||ee;var oi=Yt;if(!ee&&!q.prefix&&q.namespaceURI){for(var kt,Xi=0;Xi<qe.length;Xi++)if(qe.item(Xi).name==="xmlns"){kt=qe.item(Xi).value;break}if(!kt)for(var hr=we.length-1;hr>=0;hr--){var pi=we[hr];if(pi.prefix===""&&pi.namespace===q.namespaceURI){kt=pi.namespace;break}}if(kt!==q.namespaceURI)for(var hr=we.length-1;hr>=0;hr--){var pi=we[hr];if(pi.namespace===q.namespaceURI){pi.prefix&&(oi=pi.prefix+":"+Yt);break}}}V.push("<",oi);for(var Bt=0;Bt<ut;Bt++){var ot=qe.item(Bt);ot.prefix=="xmlns"?we.push({prefix:ot.localName,namespace:ot.value}):ot.nodeName=="xmlns"&&we.push({prefix:"",namespace:ot.value})}for(var Bt=0;Bt<ut;Bt++){var ot=qe.item(Bt);if(da(ot,ee,we)){var it=ot.prefix||"",dn=ot.namespaceURI;ps(V,it?"xmlns:"+it:"xmlns",dn),we.push({prefix:it,namespace:dn})}Ki(ot,V,ee,pe,we)}if(Yt===oi&&da(q,ee,we)){var it=q.prefix||"",dn=q.namespaceURI;ps(V,it?"xmlns:"+it:"xmlns",dn),we.push({prefix:it,namespace:dn})}if(bt||ee&&!/^(?:meta|link|img|br|hr|input)$/i.test(Yt)){if(V.push(">"),ee&&/^script$/i.test(Yt))for(;bt;)bt.data?V.push(bt.data):Ki(bt,V,ee,pe,we.slice()),bt=bt.nextSibling;else for(;bt;)Ki(bt,V,ee,pe,we.slice()),bt=bt.nextSibling;V.push("</",oi,">")}else V.push("/>");return;case N:case R:for(var bt=q.firstChild;bt;)Ki(bt,V,ee,pe,we.slice()),bt=bt.nextSibling;return;case d:return ps(V,q.name,q.value);case g:return V.push(q.data.replace(/[<&>]/g,ke));case y:return V.push("<![CDATA[",q.data,"]]>");case A:return V.push("<!--",q.data,"-->");case $:var li=q.publicId,Qi=q.systemId;if(V.push("<!DOCTYPE ",q.name),li)V.push(" PUBLIC ",li),Qi&&Qi!="."&&V.push(" ",Qi),V.push(">");else if(Qi&&Qi!=".")V.push(" SYSTEM ",Qi,">");else{var tt=q.internalSubset;tt&&V.push(" [",tt,"]"),V.push(">")}return;case k:return V.push("<?",q.target," ",q.data,"?>");case p:return V.push("&",q.nodeName,";");default:V.push("??",q.nodeName)}}function fa(q,V,ee){var pe;switch(V.nodeType){case h:pe=V.cloneNode(!1),pe.ownerDocument=q;case R:break;case d:ee=!0;break}if(pe||(pe=V.cloneNode(!1)),pe.ownerDocument=q,pe.parentNode=null,ee)for(var we=V.firstChild;we;)pe.appendChild(fa(q,we,ee)),we=we.nextSibling;return pe}function ms(q,V,ee){var pe=new V.constructor;for(var we in V)if(Object.prototype.hasOwnProperty.call(V,we)){var qe=V[we];typeof qe!="object"&&qe!=pe[we]&&(pe[we]=qe)}switch(V.childNodes&&(pe.childNodes=new K),pe.ownerDocument=q,pe.nodeType){case h:var ut=V.attributes,Yt=pe.attributes=new fe,oi=ut.length;Yt._ownerElement=pe;for(var kt=0;kt<oi;kt++)pe.setAttributeNode(ms(q,ut.item(kt),!0));break;case d:ee=!0}if(ee)for(var Xi=V.firstChild;Xi;)pe.appendChild(ms(q,Xi,ee)),Xi=Xi.nextSibling;return pe}function pa(q,V,ee){q[V]=ee}try{if(Object.defineProperty){let q=function(V){switch(V.nodeType){case h:case R:var ee=[];for(V=V.firstChild;V;)V.nodeType!==7&&V.nodeType!==8&&ee.push(q(V)),V=V.nextSibling;return ee.join("");default:return V.nodeValue}};Object.defineProperty(ie.prototype,"length",{get:function(){return he(this),this.$$length}}),Object.defineProperty(ve.prototype,"textContent",{get:function(){return q(this)},set:function(V){switch(this.nodeType){case h:case R:for(;this.firstChild;)this.removeChild(this.firstChild);(V||String(V))&&this.appendChild(this.ownerDocument.createTextNode(V));break;default:this.data=V,this.value=V,this.nodeValue=V}}}),pa=function(V,ee,pe){V["$$"+ee]=pe}}}catch{}return bn.DocumentType=Gi,bn.DOMException=H,bn.DOMImplementation=de,bn.Element=Je,bn.Node=ve,bn.NodeList=K,bn.XMLSerializer=ha,bn}var ml={},xf={},a_;function QD(){return a_||(a_=1,function(s){var e=Bh().freeze;s.XML_ENTITIES=e({amp:"&",apos:"'",gt:">",lt:"<",quot:'"'}),s.HTML_ENTITIES=e({Aacute:"Á",aacute:"á",Abreve:"Ă",abreve:"ă",ac:"∾",acd:"∿",acE:"∾̳",Acirc:"Â",acirc:"â",acute:"´",Acy:"А",acy:"а",AElig:"Æ",aelig:"æ",af:"⁡",Afr:"𝔄",afr:"𝔞",Agrave:"À",agrave:"à",alefsym:"ℵ",aleph:"ℵ",Alpha:"Α",alpha:"α",Amacr:"Ā",amacr:"ā",amalg:"⨿",AMP:"&",amp:"&",And:"⩓",and:"∧",andand:"⩕",andd:"⩜",andslope:"⩘",andv:"⩚",ang:"∠",ange:"⦤",angle:"∠",angmsd:"∡",angmsdaa:"⦨",angmsdab:"⦩",angmsdac:"⦪",angmsdad:"⦫",angmsdae:"⦬",angmsdaf:"⦭",angmsdag:"⦮",angmsdah:"⦯",angrt:"∟",angrtvb:"⊾",angrtvbd:"⦝",angsph:"∢",angst:"Å",angzarr:"⍼",Aogon:"Ą",aogon:"ą",Aopf:"𝔸",aopf:"𝕒",ap:"≈",apacir:"⩯",apE:"⩰",ape:"≊",apid:"≋",apos:"'",ApplyFunction:"⁡",approx:"≈",approxeq:"≊",Aring:"Å",aring:"å",Ascr:"𝒜",ascr:"𝒶",Assign:"≔",ast:"*",asymp:"≈",asympeq:"≍",Atilde:"Ã",atilde:"ã",Auml:"Ä",auml:"ä",awconint:"∳",awint:"⨑",backcong:"≌",backepsilon:"϶",backprime:"‵",backsim:"∽",backsimeq:"⋍",Backslash:"∖",Barv:"⫧",barvee:"⊽",Barwed:"⌆",barwed:"⌅",barwedge:"⌅",bbrk:"⎵",bbrktbrk:"⎶",bcong:"≌",Bcy:"Б",bcy:"б",bdquo:"„",becaus:"∵",Because:"∵",because:"∵",bemptyv:"⦰",bepsi:"϶",bernou:"ℬ",Bernoullis:"ℬ",Beta:"Β",beta:"β",beth:"ℶ",between:"≬",Bfr:"𝔅",bfr:"𝔟",bigcap:"⋂",bigcirc:"◯",bigcup:"⋃",bigodot:"⨀",bigoplus:"⨁",bigotimes:"⨂",bigsqcup:"⨆",bigstar:"★",bigtriangledown:"▽",bigtriangleup:"△",biguplus:"⨄",bigvee:"⋁",bigwedge:"⋀",bkarow:"⤍",blacklozenge:"⧫",blacksquare:"▪",blacktriangle:"▴",blacktriangledown:"▾",blacktriangleleft:"◂",blacktriangleright:"▸",blank:"␣",blk12:"▒",blk14:"░",blk34:"▓",block:"█",bne:"=⃥",bnequiv:"≡⃥",bNot:"⫭",bnot:"⌐",Bopf:"𝔹",bopf:"𝕓",bot:"⊥",bottom:"⊥",bowtie:"⋈",boxbox:"⧉",boxDL:"╗",boxDl:"╖",boxdL:"╕",boxdl:"┐",boxDR:"╔",boxDr:"╓",boxdR:"╒",boxdr:"┌",boxH:"═",boxh:"─",boxHD:"╦",boxHd:"╤",boxhD:"╥",boxhd:"┬",boxHU:"╩",boxHu:"╧",boxhU:"╨",boxhu:"┴",boxminus:"⊟",boxplus:"⊞",boxtimes:"⊠",boxUL:"╝",boxUl:"╜",boxuL:"╛",boxul:"┘",boxUR:"╚",boxUr:"╙",boxuR:"╘",boxur:"└",boxV:"║",boxv:"│",boxVH:"╬",boxVh:"╫",boxvH:"╪",boxvh:"┼",boxVL:"╣",boxVl:"╢",boxvL:"╡",boxvl:"┤",boxVR:"╠",boxVr:"╟",boxvR:"╞",boxvr:"├",bprime:"‵",Breve:"˘",breve:"˘",brvbar:"¦",Bscr:"ℬ",bscr:"𝒷",bsemi:"⁏",bsim:"∽",bsime:"⋍",bsol:"\\",bsolb:"⧅",bsolhsub:"⟈",bull:"•",bullet:"•",bump:"≎",bumpE:"⪮",bumpe:"≏",Bumpeq:"≎",bumpeq:"≏",Cacute:"Ć",cacute:"ć",Cap:"⋒",cap:"∩",capand:"⩄",capbrcup:"⩉",capcap:"⩋",capcup:"⩇",capdot:"⩀",CapitalDifferentialD:"ⅅ",caps:"∩︀",caret:"⁁",caron:"ˇ",Cayleys:"ℭ",ccaps:"⩍",Ccaron:"Č",ccaron:"č",Ccedil:"Ç",ccedil:"ç",Ccirc:"Ĉ",ccirc:"ĉ",Cconint:"∰",ccups:"⩌",ccupssm:"⩐",Cdot:"Ċ",cdot:"ċ",cedil:"¸",Cedilla:"¸",cemptyv:"⦲",cent:"¢",CenterDot:"·",centerdot:"·",Cfr:"ℭ",cfr:"𝔠",CHcy:"Ч",chcy:"ч",check:"✓",checkmark:"✓",Chi:"Χ",chi:"χ",cir:"○",circ:"ˆ",circeq:"≗",circlearrowleft:"↺",circlearrowright:"↻",circledast:"⊛",circledcirc:"⊚",circleddash:"⊝",CircleDot:"⊙",circledR:"®",circledS:"Ⓢ",CircleMinus:"⊖",CirclePlus:"⊕",CircleTimes:"⊗",cirE:"⧃",cire:"≗",cirfnint:"⨐",cirmid:"⫯",cirscir:"⧂",ClockwiseContourIntegral:"∲",CloseCurlyDoubleQuote:"”",CloseCurlyQuote:"’",clubs:"♣",clubsuit:"♣",Colon:"∷",colon:":",Colone:"⩴",colone:"≔",coloneq:"≔",comma:",",commat:"@",comp:"∁",compfn:"∘",complement:"∁",complexes:"ℂ",cong:"≅",congdot:"⩭",Congruent:"≡",Conint:"∯",conint:"∮",ContourIntegral:"∮",Copf:"ℂ",copf:"𝕔",coprod:"∐",Coproduct:"∐",COPY:"©",copy:"©",copysr:"℗",CounterClockwiseContourIntegral:"∳",crarr:"↵",Cross:"⨯",cross:"✗",Cscr:"𝒞",cscr:"𝒸",csub:"⫏",csube:"⫑",csup:"⫐",csupe:"⫒",ctdot:"⋯",cudarrl:"⤸",cudarrr:"⤵",cuepr:"⋞",cuesc:"⋟",cularr:"↶",cularrp:"⤽",Cup:"⋓",cup:"∪",cupbrcap:"⩈",CupCap:"≍",cupcap:"⩆",cupcup:"⩊",cupdot:"⊍",cupor:"⩅",cups:"∪︀",curarr:"↷",curarrm:"⤼",curlyeqprec:"⋞",curlyeqsucc:"⋟",curlyvee:"⋎",curlywedge:"⋏",curren:"¤",curvearrowleft:"↶",curvearrowright:"↷",cuvee:"⋎",cuwed:"⋏",cwconint:"∲",cwint:"∱",cylcty:"⌭",Dagger:"‡",dagger:"†",daleth:"ℸ",Darr:"↡",dArr:"⇓",darr:"↓",dash:"‐",Dashv:"⫤",dashv:"⊣",dbkarow:"⤏",dblac:"˝",Dcaron:"Ď",dcaron:"ď",Dcy:"Д",dcy:"д",DD:"ⅅ",dd:"ⅆ",ddagger:"‡",ddarr:"⇊",DDotrahd:"⤑",ddotseq:"⩷",deg:"°",Del:"∇",Delta:"Δ",delta:"δ",demptyv:"⦱",dfisht:"⥿",Dfr:"𝔇",dfr:"𝔡",dHar:"⥥",dharl:"⇃",dharr:"⇂",DiacriticalAcute:"´",DiacriticalDot:"˙",DiacriticalDoubleAcute:"˝",DiacriticalGrave:"`",DiacriticalTilde:"˜",diam:"⋄",Diamond:"⋄",diamond:"⋄",diamondsuit:"♦",diams:"♦",die:"¨",DifferentialD:"ⅆ",digamma:"ϝ",disin:"⋲",div:"÷",divide:"÷",divideontimes:"⋇",divonx:"⋇",DJcy:"Ђ",djcy:"ђ",dlcorn:"⌞",dlcrop:"⌍",dollar:"$",Dopf:"𝔻",dopf:"𝕕",Dot:"¨",dot:"˙",DotDot:"⃜",doteq:"≐",doteqdot:"≑",DotEqual:"≐",dotminus:"∸",dotplus:"∔",dotsquare:"⊡",doublebarwedge:"⌆",DoubleContourIntegral:"∯",DoubleDot:"¨",DoubleDownArrow:"⇓",DoubleLeftArrow:"⇐",DoubleLeftRightArrow:"⇔",DoubleLeftTee:"⫤",DoubleLongLeftArrow:"⟸",DoubleLongLeftRightArrow:"⟺",DoubleLongRightArrow:"⟹",DoubleRightArrow:"⇒",DoubleRightTee:"⊨",DoubleUpArrow:"⇑",DoubleUpDownArrow:"⇕",DoubleVerticalBar:"∥",DownArrow:"↓",Downarrow:"⇓",downarrow:"↓",DownArrowBar:"⤓",DownArrowUpArrow:"⇵",DownBreve:"̑",downdownarrows:"⇊",downharpoonleft:"⇃",downharpoonright:"⇂",DownLeftRightVector:"⥐",DownLeftTeeVector:"⥞",DownLeftVector:"↽",DownLeftVectorBar:"⥖",DownRightTeeVector:"⥟",DownRightVector:"⇁",DownRightVectorBar:"⥗",DownTee:"⊤",DownTeeArrow:"↧",drbkarow:"⤐",drcorn:"⌟",drcrop:"⌌",Dscr:"𝒟",dscr:"𝒹",DScy:"Ѕ",dscy:"ѕ",dsol:"⧶",Dstrok:"Đ",dstrok:"đ",dtdot:"⋱",dtri:"▿",dtrif:"▾",duarr:"⇵",duhar:"⥯",dwangle:"⦦",DZcy:"Џ",dzcy:"џ",dzigrarr:"⟿",Eacute:"É",eacute:"é",easter:"⩮",Ecaron:"Ě",ecaron:"ě",ecir:"≖",Ecirc:"Ê",ecirc:"ê",ecolon:"≕",Ecy:"Э",ecy:"э",eDDot:"⩷",Edot:"Ė",eDot:"≑",edot:"ė",ee:"ⅇ",efDot:"≒",Efr:"𝔈",efr:"𝔢",eg:"⪚",Egrave:"È",egrave:"è",egs:"⪖",egsdot:"⪘",el:"⪙",Element:"∈",elinters:"⏧",ell:"ℓ",els:"⪕",elsdot:"⪗",Emacr:"Ē",emacr:"ē",empty:"∅",emptyset:"∅",EmptySmallSquare:"◻",emptyv:"∅",EmptyVerySmallSquare:"▫",emsp:" ",emsp13:" ",emsp14:" ",ENG:"Ŋ",eng:"ŋ",ensp:" ",Eogon:"Ę",eogon:"ę",Eopf:"𝔼",eopf:"𝕖",epar:"⋕",eparsl:"⧣",eplus:"⩱",epsi:"ε",Epsilon:"Ε",epsilon:"ε",epsiv:"ϵ",eqcirc:"≖",eqcolon:"≕",eqsim:"≂",eqslantgtr:"⪖",eqslantless:"⪕",Equal:"⩵",equals:"=",EqualTilde:"≂",equest:"≟",Equilibrium:"⇌",equiv:"≡",equivDD:"⩸",eqvparsl:"⧥",erarr:"⥱",erDot:"≓",Escr:"ℰ",escr:"ℯ",esdot:"≐",Esim:"⩳",esim:"≂",Eta:"Η",eta:"η",ETH:"Ð",eth:"ð",Euml:"Ë",euml:"ë",euro:"€",excl:"!",exist:"∃",Exists:"∃",expectation:"ℰ",ExponentialE:"ⅇ",exponentiale:"ⅇ",fallingdotseq:"≒",Fcy:"Ф",fcy:"ф",female:"♀",ffilig:"ffi",fflig:"ff",ffllig:"ffl",Ffr:"𝔉",ffr:"𝔣",filig:"fi",FilledSmallSquare:"◼",FilledVerySmallSquare:"▪",fjlig:"fj",flat:"♭",fllig:"fl",fltns:"▱",fnof:"ƒ",Fopf:"𝔽",fopf:"𝕗",ForAll:"∀",forall:"∀",fork:"⋔",forkv:"⫙",Fouriertrf:"ℱ",fpartint:"⨍",frac12:"½",frac13:"⅓",frac14:"¼",frac15:"⅕",frac16:"⅙",frac18:"⅛",frac23:"⅔",frac25:"⅖",frac34:"¾",frac35:"⅗",frac38:"⅜",frac45:"⅘",frac56:"⅚",frac58:"⅝",frac78:"⅞",frasl:"⁄",frown:"⌢",Fscr:"ℱ",fscr:"𝒻",gacute:"ǵ",Gamma:"Γ",gamma:"γ",Gammad:"Ϝ",gammad:"ϝ",gap:"⪆",Gbreve:"Ğ",gbreve:"ğ",Gcedil:"Ģ",Gcirc:"Ĝ",gcirc:"ĝ",Gcy:"Г",gcy:"г",Gdot:"Ġ",gdot:"ġ",gE:"≧",ge:"≥",gEl:"⪌",gel:"⋛",geq:"≥",geqq:"≧",geqslant:"⩾",ges:"⩾",gescc:"⪩",gesdot:"⪀",gesdoto:"⪂",gesdotol:"⪄",gesl:"⋛︀",gesles:"⪔",Gfr:"𝔊",gfr:"𝔤",Gg:"⋙",gg:"≫",ggg:"⋙",gimel:"ℷ",GJcy:"Ѓ",gjcy:"ѓ",gl:"≷",gla:"⪥",glE:"⪒",glj:"⪤",gnap:"⪊",gnapprox:"⪊",gnE:"≩",gne:"⪈",gneq:"⪈",gneqq:"≩",gnsim:"⋧",Gopf:"𝔾",gopf:"𝕘",grave:"`",GreaterEqual:"≥",GreaterEqualLess:"⋛",GreaterFullEqual:"≧",GreaterGreater:"⪢",GreaterLess:"≷",GreaterSlantEqual:"⩾",GreaterTilde:"≳",Gscr:"𝒢",gscr:"ℊ",gsim:"≳",gsime:"⪎",gsiml:"⪐",Gt:"≫",GT:">",gt:">",gtcc:"⪧",gtcir:"⩺",gtdot:"⋗",gtlPar:"⦕",gtquest:"⩼",gtrapprox:"⪆",gtrarr:"⥸",gtrdot:"⋗",gtreqless:"⋛",gtreqqless:"⪌",gtrless:"≷",gtrsim:"≳",gvertneqq:"≩︀",gvnE:"≩︀",Hacek:"ˇ",hairsp:" ",half:"½",hamilt:"ℋ",HARDcy:"Ъ",hardcy:"ъ",hArr:"⇔",harr:"↔",harrcir:"⥈",harrw:"↭",Hat:"^",hbar:"ℏ",Hcirc:"Ĥ",hcirc:"ĥ",hearts:"♥",heartsuit:"♥",hellip:"…",hercon:"⊹",Hfr:"ℌ",hfr:"𝔥",HilbertSpace:"ℋ",hksearow:"⤥",hkswarow:"⤦",hoarr:"⇿",homtht:"∻",hookleftarrow:"↩",hookrightarrow:"↪",Hopf:"ℍ",hopf:"𝕙",horbar:"―",HorizontalLine:"─",Hscr:"ℋ",hscr:"𝒽",hslash:"ℏ",Hstrok:"Ħ",hstrok:"ħ",HumpDownHump:"≎",HumpEqual:"≏",hybull:"⁃",hyphen:"‐",Iacute:"Í",iacute:"í",ic:"⁣",Icirc:"Î",icirc:"î",Icy:"И",icy:"и",Idot:"İ",IEcy:"Е",iecy:"е",iexcl:"¡",iff:"⇔",Ifr:"ℑ",ifr:"𝔦",Igrave:"Ì",igrave:"ì",ii:"ⅈ",iiiint:"⨌",iiint:"∭",iinfin:"⧜",iiota:"℩",IJlig:"IJ",ijlig:"ij",Im:"ℑ",Imacr:"Ī",imacr:"ī",image:"ℑ",ImaginaryI:"ⅈ",imagline:"ℐ",imagpart:"ℑ",imath:"ı",imof:"⊷",imped:"Ƶ",Implies:"⇒",in:"∈",incare:"℅",infin:"∞",infintie:"⧝",inodot:"ı",Int:"∬",int:"∫",intcal:"⊺",integers:"ℤ",Integral:"∫",intercal:"⊺",Intersection:"⋂",intlarhk:"⨗",intprod:"⨼",InvisibleComma:"⁣",InvisibleTimes:"⁢",IOcy:"Ё",iocy:"ё",Iogon:"Į",iogon:"į",Iopf:"𝕀",iopf:"𝕚",Iota:"Ι",iota:"ι",iprod:"⨼",iquest:"¿",Iscr:"ℐ",iscr:"𝒾",isin:"∈",isindot:"⋵",isinE:"⋹",isins:"⋴",isinsv:"⋳",isinv:"∈",it:"⁢",Itilde:"Ĩ",itilde:"ĩ",Iukcy:"І",iukcy:"і",Iuml:"Ï",iuml:"ï",Jcirc:"Ĵ",jcirc:"ĵ",Jcy:"Й",jcy:"й",Jfr:"𝔍",jfr:"𝔧",jmath:"ȷ",Jopf:"𝕁",jopf:"𝕛",Jscr:"𝒥",jscr:"𝒿",Jsercy:"Ј",jsercy:"ј",Jukcy:"Є",jukcy:"є",Kappa:"Κ",kappa:"κ",kappav:"ϰ",Kcedil:"Ķ",kcedil:"ķ",Kcy:"К",kcy:"к",Kfr:"𝔎",kfr:"𝔨",kgreen:"ĸ",KHcy:"Х",khcy:"х",KJcy:"Ќ",kjcy:"ќ",Kopf:"𝕂",kopf:"𝕜",Kscr:"𝒦",kscr:"𝓀",lAarr:"⇚",Lacute:"Ĺ",lacute:"ĺ",laemptyv:"⦴",lagran:"ℒ",Lambda:"Λ",lambda:"λ",Lang:"⟪",lang:"⟨",langd:"⦑",langle:"⟨",lap:"⪅",Laplacetrf:"ℒ",laquo:"«",Larr:"↞",lArr:"⇐",larr:"←",larrb:"⇤",larrbfs:"⤟",larrfs:"⤝",larrhk:"↩",larrlp:"↫",larrpl:"⤹",larrsim:"⥳",larrtl:"↢",lat:"⪫",lAtail:"⤛",latail:"⤙",late:"⪭",lates:"⪭︀",lBarr:"⤎",lbarr:"⤌",lbbrk:"❲",lbrace:"{",lbrack:"[",lbrke:"⦋",lbrksld:"⦏",lbrkslu:"⦍",Lcaron:"Ľ",lcaron:"ľ",Lcedil:"Ļ",lcedil:"ļ",lceil:"⌈",lcub:"{",Lcy:"Л",lcy:"л",ldca:"⤶",ldquo:"“",ldquor:"„",ldrdhar:"⥧",ldrushar:"⥋",ldsh:"↲",lE:"≦",le:"≤",LeftAngleBracket:"⟨",LeftArrow:"←",Leftarrow:"⇐",leftarrow:"←",LeftArrowBar:"⇤",LeftArrowRightArrow:"⇆",leftarrowtail:"↢",LeftCeiling:"⌈",LeftDoubleBracket:"⟦",LeftDownTeeVector:"⥡",LeftDownVector:"⇃",LeftDownVectorBar:"⥙",LeftFloor:"⌊",leftharpoondown:"↽",leftharpoonup:"↼",leftleftarrows:"⇇",LeftRightArrow:"↔",Leftrightarrow:"⇔",leftrightarrow:"↔",leftrightarrows:"⇆",leftrightharpoons:"⇋",leftrightsquigarrow:"↭",LeftRightVector:"⥎",LeftTee:"⊣",LeftTeeArrow:"↤",LeftTeeVector:"⥚",leftthreetimes:"⋋",LeftTriangle:"⊲",LeftTriangleBar:"⧏",LeftTriangleEqual:"⊴",LeftUpDownVector:"⥑",LeftUpTeeVector:"⥠",LeftUpVector:"↿",LeftUpVectorBar:"⥘",LeftVector:"↼",LeftVectorBar:"⥒",lEg:"⪋",leg:"⋚",leq:"≤",leqq:"≦",leqslant:"⩽",les:"⩽",lescc:"⪨",lesdot:"⩿",lesdoto:"⪁",lesdotor:"⪃",lesg:"⋚︀",lesges:"⪓",lessapprox:"⪅",lessdot:"⋖",lesseqgtr:"⋚",lesseqqgtr:"⪋",LessEqualGreater:"⋚",LessFullEqual:"≦",LessGreater:"≶",lessgtr:"≶",LessLess:"⪡",lesssim:"≲",LessSlantEqual:"⩽",LessTilde:"≲",lfisht:"⥼",lfloor:"⌊",Lfr:"𝔏",lfr:"𝔩",lg:"≶",lgE:"⪑",lHar:"⥢",lhard:"↽",lharu:"↼",lharul:"⥪",lhblk:"▄",LJcy:"Љ",ljcy:"љ",Ll:"⋘",ll:"≪",llarr:"⇇",llcorner:"⌞",Lleftarrow:"⇚",llhard:"⥫",lltri:"◺",Lmidot:"Ŀ",lmidot:"ŀ",lmoust:"⎰",lmoustache:"⎰",lnap:"⪉",lnapprox:"⪉",lnE:"≨",lne:"⪇",lneq:"⪇",lneqq:"≨",lnsim:"⋦",loang:"⟬",loarr:"⇽",lobrk:"⟦",LongLeftArrow:"⟵",Longleftarrow:"⟸",longleftarrow:"⟵",LongLeftRightArrow:"⟷",Longleftrightarrow:"⟺",longleftrightarrow:"⟷",longmapsto:"⟼",LongRightArrow:"⟶",Longrightarrow:"⟹",longrightarrow:"⟶",looparrowleft:"↫",looparrowright:"↬",lopar:"⦅",Lopf:"𝕃",lopf:"𝕝",loplus:"⨭",lotimes:"⨴",lowast:"∗",lowbar:"_",LowerLeftArrow:"↙",LowerRightArrow:"↘",loz:"◊",lozenge:"◊",lozf:"⧫",lpar:"(",lparlt:"⦓",lrarr:"⇆",lrcorner:"⌟",lrhar:"⇋",lrhard:"⥭",lrm:"‎",lrtri:"⊿",lsaquo:"‹",Lscr:"ℒ",lscr:"𝓁",Lsh:"↰",lsh:"↰",lsim:"≲",lsime:"⪍",lsimg:"⪏",lsqb:"[",lsquo:"‘",lsquor:"‚",Lstrok:"Ł",lstrok:"ł",Lt:"≪",LT:"<",lt:"<",ltcc:"⪦",ltcir:"⩹",ltdot:"⋖",lthree:"⋋",ltimes:"⋉",ltlarr:"⥶",ltquest:"⩻",ltri:"◃",ltrie:"⊴",ltrif:"◂",ltrPar:"⦖",lurdshar:"⥊",luruhar:"⥦",lvertneqq:"≨︀",lvnE:"≨︀",macr:"¯",male:"♂",malt:"✠",maltese:"✠",Map:"⤅",map:"↦",mapsto:"↦",mapstodown:"↧",mapstoleft:"↤",mapstoup:"↥",marker:"▮",mcomma:"⨩",Mcy:"М",mcy:"м",mdash:"—",mDDot:"∺",measuredangle:"∡",MediumSpace:" ",Mellintrf:"ℳ",Mfr:"𝔐",mfr:"𝔪",mho:"℧",micro:"µ",mid:"∣",midast:"*",midcir:"⫰",middot:"·",minus:"−",minusb:"⊟",minusd:"∸",minusdu:"⨪",MinusPlus:"∓",mlcp:"⫛",mldr:"…",mnplus:"∓",models:"⊧",Mopf:"𝕄",mopf:"𝕞",mp:"∓",Mscr:"ℳ",mscr:"𝓂",mstpos:"∾",Mu:"Μ",mu:"μ",multimap:"⊸",mumap:"⊸",nabla:"∇",Nacute:"Ń",nacute:"ń",nang:"∠⃒",nap:"≉",napE:"⩰̸",napid:"≋̸",napos:"ʼn",napprox:"≉",natur:"♮",natural:"♮",naturals:"ℕ",nbsp:" ",nbump:"≎̸",nbumpe:"≏̸",ncap:"⩃",Ncaron:"Ň",ncaron:"ň",Ncedil:"Ņ",ncedil:"ņ",ncong:"≇",ncongdot:"⩭̸",ncup:"⩂",Ncy:"Н",ncy:"н",ndash:"–",ne:"≠",nearhk:"⤤",neArr:"⇗",nearr:"↗",nearrow:"↗",nedot:"≐̸",NegativeMediumSpace:"​",NegativeThickSpace:"​",NegativeThinSpace:"​",NegativeVeryThinSpace:"​",nequiv:"≢",nesear:"⤨",nesim:"≂̸",NestedGreaterGreater:"≫",NestedLessLess:"≪",NewLine:`
20
- `,nexist:"∄",nexists:"∄",Nfr:"𝔑",nfr:"𝔫",ngE:"≧̸",nge:"≱",ngeq:"≱",ngeqq:"≧̸",ngeqslant:"⩾̸",nges:"⩾̸",nGg:"⋙̸",ngsim:"≵",nGt:"≫⃒",ngt:"≯",ngtr:"≯",nGtv:"≫̸",nhArr:"⇎",nharr:"↮",nhpar:"⫲",ni:"∋",nis:"⋼",nisd:"⋺",niv:"∋",NJcy:"Њ",njcy:"њ",nlArr:"⇍",nlarr:"↚",nldr:"‥",nlE:"≦̸",nle:"≰",nLeftarrow:"⇍",nleftarrow:"↚",nLeftrightarrow:"⇎",nleftrightarrow:"↮",nleq:"≰",nleqq:"≦̸",nleqslant:"⩽̸",nles:"⩽̸",nless:"≮",nLl:"⋘̸",nlsim:"≴",nLt:"≪⃒",nlt:"≮",nltri:"⋪",nltrie:"⋬",nLtv:"≪̸",nmid:"∤",NoBreak:"⁠",NonBreakingSpace:" ",Nopf:"ℕ",nopf:"𝕟",Not:"⫬",not:"¬",NotCongruent:"≢",NotCupCap:"≭",NotDoubleVerticalBar:"∦",NotElement:"∉",NotEqual:"≠",NotEqualTilde:"≂̸",NotExists:"∄",NotGreater:"≯",NotGreaterEqual:"≱",NotGreaterFullEqual:"≧̸",NotGreaterGreater:"≫̸",NotGreaterLess:"≹",NotGreaterSlantEqual:"⩾̸",NotGreaterTilde:"≵",NotHumpDownHump:"≎̸",NotHumpEqual:"≏̸",notin:"∉",notindot:"⋵̸",notinE:"⋹̸",notinva:"∉",notinvb:"⋷",notinvc:"⋶",NotLeftTriangle:"⋪",NotLeftTriangleBar:"⧏̸",NotLeftTriangleEqual:"⋬",NotLess:"≮",NotLessEqual:"≰",NotLessGreater:"≸",NotLessLess:"≪̸",NotLessSlantEqual:"⩽̸",NotLessTilde:"≴",NotNestedGreaterGreater:"⪢̸",NotNestedLessLess:"⪡̸",notni:"∌",notniva:"∌",notnivb:"⋾",notnivc:"⋽",NotPrecedes:"⊀",NotPrecedesEqual:"⪯̸",NotPrecedesSlantEqual:"⋠",NotReverseElement:"∌",NotRightTriangle:"⋫",NotRightTriangleBar:"⧐̸",NotRightTriangleEqual:"⋭",NotSquareSubset:"⊏̸",NotSquareSubsetEqual:"⋢",NotSquareSuperset:"⊐̸",NotSquareSupersetEqual:"⋣",NotSubset:"⊂⃒",NotSubsetEqual:"⊈",NotSucceeds:"⊁",NotSucceedsEqual:"⪰̸",NotSucceedsSlantEqual:"⋡",NotSucceedsTilde:"≿̸",NotSuperset:"⊃⃒",NotSupersetEqual:"⊉",NotTilde:"≁",NotTildeEqual:"≄",NotTildeFullEqual:"≇",NotTildeTilde:"≉",NotVerticalBar:"∤",npar:"∦",nparallel:"∦",nparsl:"⫽⃥",npart:"∂̸",npolint:"⨔",npr:"⊀",nprcue:"⋠",npre:"⪯̸",nprec:"⊀",npreceq:"⪯̸",nrArr:"⇏",nrarr:"↛",nrarrc:"⤳̸",nrarrw:"↝̸",nRightarrow:"⇏",nrightarrow:"↛",nrtri:"⋫",nrtrie:"⋭",nsc:"⊁",nsccue:"⋡",nsce:"⪰̸",Nscr:"𝒩",nscr:"𝓃",nshortmid:"∤",nshortparallel:"∦",nsim:"≁",nsime:"≄",nsimeq:"≄",nsmid:"∤",nspar:"∦",nsqsube:"⋢",nsqsupe:"⋣",nsub:"⊄",nsubE:"⫅̸",nsube:"⊈",nsubset:"⊂⃒",nsubseteq:"⊈",nsubseteqq:"⫅̸",nsucc:"⊁",nsucceq:"⪰̸",nsup:"⊅",nsupE:"⫆̸",nsupe:"⊉",nsupset:"⊃⃒",nsupseteq:"⊉",nsupseteqq:"⫆̸",ntgl:"≹",Ntilde:"Ñ",ntilde:"ñ",ntlg:"≸",ntriangleleft:"⋪",ntrianglelefteq:"⋬",ntriangleright:"⋫",ntrianglerighteq:"⋭",Nu:"Ν",nu:"ν",num:"#",numero:"№",numsp:" ",nvap:"≍⃒",nVDash:"⊯",nVdash:"⊮",nvDash:"⊭",nvdash:"⊬",nvge:"≥⃒",nvgt:">⃒",nvHarr:"⤄",nvinfin:"⧞",nvlArr:"⤂",nvle:"≤⃒",nvlt:"<⃒",nvltrie:"⊴⃒",nvrArr:"⤃",nvrtrie:"⊵⃒",nvsim:"∼⃒",nwarhk:"⤣",nwArr:"⇖",nwarr:"↖",nwarrow:"↖",nwnear:"⤧",Oacute:"Ó",oacute:"ó",oast:"⊛",ocir:"⊚",Ocirc:"Ô",ocirc:"ô",Ocy:"О",ocy:"о",odash:"⊝",Odblac:"Ő",odblac:"ő",odiv:"⨸",odot:"⊙",odsold:"⦼",OElig:"Œ",oelig:"œ",ofcir:"⦿",Ofr:"𝔒",ofr:"𝔬",ogon:"˛",Ograve:"Ò",ograve:"ò",ogt:"⧁",ohbar:"⦵",ohm:"Ω",oint:"∮",olarr:"↺",olcir:"⦾",olcross:"⦻",oline:"‾",olt:"⧀",Omacr:"Ō",omacr:"ō",Omega:"Ω",omega:"ω",Omicron:"Ο",omicron:"ο",omid:"⦶",ominus:"⊖",Oopf:"𝕆",oopf:"𝕠",opar:"⦷",OpenCurlyDoubleQuote:"“",OpenCurlyQuote:"‘",operp:"⦹",oplus:"⊕",Or:"⩔",or:"∨",orarr:"↻",ord:"⩝",order:"ℴ",orderof:"ℴ",ordf:"ª",ordm:"º",origof:"⊶",oror:"⩖",orslope:"⩗",orv:"⩛",oS:"Ⓢ",Oscr:"𝒪",oscr:"ℴ",Oslash:"Ø",oslash:"ø",osol:"⊘",Otilde:"Õ",otilde:"õ",Otimes:"⨷",otimes:"⊗",otimesas:"⨶",Ouml:"Ö",ouml:"ö",ovbar:"⌽",OverBar:"‾",OverBrace:"⏞",OverBracket:"⎴",OverParenthesis:"⏜",par:"∥",para:"¶",parallel:"∥",parsim:"⫳",parsl:"⫽",part:"∂",PartialD:"∂",Pcy:"П",pcy:"п",percnt:"%",period:".",permil:"‰",perp:"⊥",pertenk:"‱",Pfr:"𝔓",pfr:"𝔭",Phi:"Φ",phi:"φ",phiv:"ϕ",phmmat:"ℳ",phone:"☎",Pi:"Π",pi:"π",pitchfork:"⋔",piv:"ϖ",planck:"ℏ",planckh:"ℎ",plankv:"ℏ",plus:"+",plusacir:"⨣",plusb:"⊞",pluscir:"⨢",plusdo:"∔",plusdu:"⨥",pluse:"⩲",PlusMinus:"±",plusmn:"±",plussim:"⨦",plustwo:"⨧",pm:"±",Poincareplane:"ℌ",pointint:"⨕",Popf:"ℙ",popf:"𝕡",pound:"£",Pr:"⪻",pr:"≺",prap:"⪷",prcue:"≼",prE:"⪳",pre:"⪯",prec:"≺",precapprox:"⪷",preccurlyeq:"≼",Precedes:"≺",PrecedesEqual:"⪯",PrecedesSlantEqual:"≼",PrecedesTilde:"≾",preceq:"⪯",precnapprox:"⪹",precneqq:"⪵",precnsim:"⋨",precsim:"≾",Prime:"″",prime:"′",primes:"ℙ",prnap:"⪹",prnE:"⪵",prnsim:"⋨",prod:"∏",Product:"∏",profalar:"⌮",profline:"⌒",profsurf:"⌓",prop:"∝",Proportion:"∷",Proportional:"∝",propto:"∝",prsim:"≾",prurel:"⊰",Pscr:"𝒫",pscr:"𝓅",Psi:"Ψ",psi:"ψ",puncsp:" ",Qfr:"𝔔",qfr:"𝔮",qint:"⨌",Qopf:"ℚ",qopf:"𝕢",qprime:"⁗",Qscr:"𝒬",qscr:"𝓆",quaternions:"ℍ",quatint:"⨖",quest:"?",questeq:"≟",QUOT:'"',quot:'"',rAarr:"⇛",race:"∽̱",Racute:"Ŕ",racute:"ŕ",radic:"√",raemptyv:"⦳",Rang:"⟫",rang:"⟩",rangd:"⦒",range:"⦥",rangle:"⟩",raquo:"»",Rarr:"↠",rArr:"⇒",rarr:"→",rarrap:"⥵",rarrb:"⇥",rarrbfs:"⤠",rarrc:"⤳",rarrfs:"⤞",rarrhk:"↪",rarrlp:"↬",rarrpl:"⥅",rarrsim:"⥴",Rarrtl:"⤖",rarrtl:"↣",rarrw:"↝",rAtail:"⤜",ratail:"⤚",ratio:"∶",rationals:"ℚ",RBarr:"⤐",rBarr:"⤏",rbarr:"⤍",rbbrk:"❳",rbrace:"}",rbrack:"]",rbrke:"⦌",rbrksld:"⦎",rbrkslu:"⦐",Rcaron:"Ř",rcaron:"ř",Rcedil:"Ŗ",rcedil:"ŗ",rceil:"⌉",rcub:"}",Rcy:"Р",rcy:"р",rdca:"⤷",rdldhar:"⥩",rdquo:"”",rdquor:"”",rdsh:"↳",Re:"ℜ",real:"ℜ",realine:"ℛ",realpart:"ℜ",reals:"ℝ",rect:"▭",REG:"®",reg:"®",ReverseElement:"∋",ReverseEquilibrium:"⇋",ReverseUpEquilibrium:"⥯",rfisht:"⥽",rfloor:"⌋",Rfr:"ℜ",rfr:"𝔯",rHar:"⥤",rhard:"⇁",rharu:"⇀",rharul:"⥬",Rho:"Ρ",rho:"ρ",rhov:"ϱ",RightAngleBracket:"⟩",RightArrow:"→",Rightarrow:"⇒",rightarrow:"→",RightArrowBar:"⇥",RightArrowLeftArrow:"⇄",rightarrowtail:"↣",RightCeiling:"⌉",RightDoubleBracket:"⟧",RightDownTeeVector:"⥝",RightDownVector:"⇂",RightDownVectorBar:"⥕",RightFloor:"⌋",rightharpoondown:"⇁",rightharpoonup:"⇀",rightleftarrows:"⇄",rightleftharpoons:"⇌",rightrightarrows:"⇉",rightsquigarrow:"↝",RightTee:"⊢",RightTeeArrow:"↦",RightTeeVector:"⥛",rightthreetimes:"⋌",RightTriangle:"⊳",RightTriangleBar:"⧐",RightTriangleEqual:"⊵",RightUpDownVector:"⥏",RightUpTeeVector:"⥜",RightUpVector:"↾",RightUpVectorBar:"⥔",RightVector:"⇀",RightVectorBar:"⥓",ring:"˚",risingdotseq:"≓",rlarr:"⇄",rlhar:"⇌",rlm:"‏",rmoust:"⎱",rmoustache:"⎱",rnmid:"⫮",roang:"⟭",roarr:"⇾",robrk:"⟧",ropar:"⦆",Ropf:"ℝ",ropf:"𝕣",roplus:"⨮",rotimes:"⨵",RoundImplies:"⥰",rpar:")",rpargt:"⦔",rppolint:"⨒",rrarr:"⇉",Rrightarrow:"⇛",rsaquo:"›",Rscr:"ℛ",rscr:"𝓇",Rsh:"↱",rsh:"↱",rsqb:"]",rsquo:"’",rsquor:"’",rthree:"⋌",rtimes:"⋊",rtri:"▹",rtrie:"⊵",rtrif:"▸",rtriltri:"⧎",RuleDelayed:"⧴",ruluhar:"⥨",rx:"℞",Sacute:"Ś",sacute:"ś",sbquo:"‚",Sc:"⪼",sc:"≻",scap:"⪸",Scaron:"Š",scaron:"š",sccue:"≽",scE:"⪴",sce:"⪰",Scedil:"Ş",scedil:"ş",Scirc:"Ŝ",scirc:"ŝ",scnap:"⪺",scnE:"⪶",scnsim:"⋩",scpolint:"⨓",scsim:"≿",Scy:"С",scy:"с",sdot:"⋅",sdotb:"⊡",sdote:"⩦",searhk:"⤥",seArr:"⇘",searr:"↘",searrow:"↘",sect:"§",semi:";",seswar:"⤩",setminus:"∖",setmn:"∖",sext:"✶",Sfr:"𝔖",sfr:"𝔰",sfrown:"⌢",sharp:"♯",SHCHcy:"Щ",shchcy:"щ",SHcy:"Ш",shcy:"ш",ShortDownArrow:"↓",ShortLeftArrow:"←",shortmid:"∣",shortparallel:"∥",ShortRightArrow:"→",ShortUpArrow:"↑",shy:"­",Sigma:"Σ",sigma:"σ",sigmaf:"ς",sigmav:"ς",sim:"∼",simdot:"⩪",sime:"≃",simeq:"≃",simg:"⪞",simgE:"⪠",siml:"⪝",simlE:"⪟",simne:"≆",simplus:"⨤",simrarr:"⥲",slarr:"←",SmallCircle:"∘",smallsetminus:"∖",smashp:"⨳",smeparsl:"⧤",smid:"∣",smile:"⌣",smt:"⪪",smte:"⪬",smtes:"⪬︀",SOFTcy:"Ь",softcy:"ь",sol:"/",solb:"⧄",solbar:"⌿",Sopf:"𝕊",sopf:"𝕤",spades:"♠",spadesuit:"♠",spar:"∥",sqcap:"⊓",sqcaps:"⊓︀",sqcup:"⊔",sqcups:"⊔︀",Sqrt:"√",sqsub:"⊏",sqsube:"⊑",sqsubset:"⊏",sqsubseteq:"⊑",sqsup:"⊐",sqsupe:"⊒",sqsupset:"⊐",sqsupseteq:"⊒",squ:"□",Square:"□",square:"□",SquareIntersection:"⊓",SquareSubset:"⊏",SquareSubsetEqual:"⊑",SquareSuperset:"⊐",SquareSupersetEqual:"⊒",SquareUnion:"⊔",squarf:"▪",squf:"▪",srarr:"→",Sscr:"𝒮",sscr:"𝓈",ssetmn:"∖",ssmile:"⌣",sstarf:"⋆",Star:"⋆",star:"☆",starf:"★",straightepsilon:"ϵ",straightphi:"ϕ",strns:"¯",Sub:"⋐",sub:"⊂",subdot:"⪽",subE:"⫅",sube:"⊆",subedot:"⫃",submult:"⫁",subnE:"⫋",subne:"⊊",subplus:"⪿",subrarr:"⥹",Subset:"⋐",subset:"⊂",subseteq:"⊆",subseteqq:"⫅",SubsetEqual:"⊆",subsetneq:"⊊",subsetneqq:"⫋",subsim:"⫇",subsub:"⫕",subsup:"⫓",succ:"≻",succapprox:"⪸",succcurlyeq:"≽",Succeeds:"≻",SucceedsEqual:"⪰",SucceedsSlantEqual:"≽",SucceedsTilde:"≿",succeq:"⪰",succnapprox:"⪺",succneqq:"⪶",succnsim:"⋩",succsim:"≿",SuchThat:"∋",Sum:"∑",sum:"∑",sung:"♪",Sup:"⋑",sup:"⊃",sup1:"¹",sup2:"²",sup3:"³",supdot:"⪾",supdsub:"⫘",supE:"⫆",supe:"⊇",supedot:"⫄",Superset:"⊃",SupersetEqual:"⊇",suphsol:"⟉",suphsub:"⫗",suplarr:"⥻",supmult:"⫂",supnE:"⫌",supne:"⊋",supplus:"⫀",Supset:"⋑",supset:"⊃",supseteq:"⊇",supseteqq:"⫆",supsetneq:"⊋",supsetneqq:"⫌",supsim:"⫈",supsub:"⫔",supsup:"⫖",swarhk:"⤦",swArr:"⇙",swarr:"↙",swarrow:"↙",swnwar:"⤪",szlig:"ß",Tab:" ",target:"⌖",Tau:"Τ",tau:"τ",tbrk:"⎴",Tcaron:"Ť",tcaron:"ť",Tcedil:"Ţ",tcedil:"ţ",Tcy:"Т",tcy:"т",tdot:"⃛",telrec:"⌕",Tfr:"𝔗",tfr:"𝔱",there4:"∴",Therefore:"∴",therefore:"∴",Theta:"Θ",theta:"θ",thetasym:"ϑ",thetav:"ϑ",thickapprox:"≈",thicksim:"∼",ThickSpace:"  ",thinsp:" ",ThinSpace:" ",thkap:"≈",thksim:"∼",THORN:"Þ",thorn:"þ",Tilde:"∼",tilde:"˜",TildeEqual:"≃",TildeFullEqual:"≅",TildeTilde:"≈",times:"×",timesb:"⊠",timesbar:"⨱",timesd:"⨰",tint:"∭",toea:"⤨",top:"⊤",topbot:"⌶",topcir:"⫱",Topf:"𝕋",topf:"𝕥",topfork:"⫚",tosa:"⤩",tprime:"‴",TRADE:"™",trade:"™",triangle:"▵",triangledown:"▿",triangleleft:"◃",trianglelefteq:"⊴",triangleq:"≜",triangleright:"▹",trianglerighteq:"⊵",tridot:"◬",trie:"≜",triminus:"⨺",TripleDot:"⃛",triplus:"⨹",trisb:"⧍",tritime:"⨻",trpezium:"⏢",Tscr:"𝒯",tscr:"𝓉",TScy:"Ц",tscy:"ц",TSHcy:"Ћ",tshcy:"ћ",Tstrok:"Ŧ",tstrok:"ŧ",twixt:"≬",twoheadleftarrow:"↞",twoheadrightarrow:"↠",Uacute:"Ú",uacute:"ú",Uarr:"↟",uArr:"⇑",uarr:"↑",Uarrocir:"⥉",Ubrcy:"Ў",ubrcy:"ў",Ubreve:"Ŭ",ubreve:"ŭ",Ucirc:"Û",ucirc:"û",Ucy:"У",ucy:"у",udarr:"⇅",Udblac:"Ű",udblac:"ű",udhar:"⥮",ufisht:"⥾",Ufr:"𝔘",ufr:"𝔲",Ugrave:"Ù",ugrave:"ù",uHar:"⥣",uharl:"↿",uharr:"↾",uhblk:"▀",ulcorn:"⌜",ulcorner:"⌜",ulcrop:"⌏",ultri:"◸",Umacr:"Ū",umacr:"ū",uml:"¨",UnderBar:"_",UnderBrace:"⏟",UnderBracket:"⎵",UnderParenthesis:"⏝",Union:"⋃",UnionPlus:"⊎",Uogon:"Ų",uogon:"ų",Uopf:"𝕌",uopf:"𝕦",UpArrow:"↑",Uparrow:"⇑",uparrow:"↑",UpArrowBar:"⤒",UpArrowDownArrow:"⇅",UpDownArrow:"↕",Updownarrow:"⇕",updownarrow:"↕",UpEquilibrium:"⥮",upharpoonleft:"↿",upharpoonright:"↾",uplus:"⊎",UpperLeftArrow:"↖",UpperRightArrow:"↗",Upsi:"ϒ",upsi:"υ",upsih:"ϒ",Upsilon:"Υ",upsilon:"υ",UpTee:"⊥",UpTeeArrow:"↥",upuparrows:"⇈",urcorn:"⌝",urcorner:"⌝",urcrop:"⌎",Uring:"Ů",uring:"ů",urtri:"◹",Uscr:"𝒰",uscr:"𝓊",utdot:"⋰",Utilde:"Ũ",utilde:"ũ",utri:"▵",utrif:"▴",uuarr:"⇈",Uuml:"Ü",uuml:"ü",uwangle:"⦧",vangrt:"⦜",varepsilon:"ϵ",varkappa:"ϰ",varnothing:"∅",varphi:"ϕ",varpi:"ϖ",varpropto:"∝",vArr:"⇕",varr:"↕",varrho:"ϱ",varsigma:"ς",varsubsetneq:"⊊︀",varsubsetneqq:"⫋︀",varsupsetneq:"⊋︀",varsupsetneqq:"⫌︀",vartheta:"ϑ",vartriangleleft:"⊲",vartriangleright:"⊳",Vbar:"⫫",vBar:"⫨",vBarv:"⫩",Vcy:"В",vcy:"в",VDash:"⊫",Vdash:"⊩",vDash:"⊨",vdash:"⊢",Vdashl:"⫦",Vee:"⋁",vee:"∨",veebar:"⊻",veeeq:"≚",vellip:"⋮",Verbar:"‖",verbar:"|",Vert:"‖",vert:"|",VerticalBar:"∣",VerticalLine:"|",VerticalSeparator:"❘",VerticalTilde:"≀",VeryThinSpace:" ",Vfr:"𝔙",vfr:"𝔳",vltri:"⊲",vnsub:"⊂⃒",vnsup:"⊃⃒",Vopf:"𝕍",vopf:"𝕧",vprop:"∝",vrtri:"⊳",Vscr:"𝒱",vscr:"𝓋",vsubnE:"⫋︀",vsubne:"⊊︀",vsupnE:"⫌︀",vsupne:"⊋︀",Vvdash:"⊪",vzigzag:"⦚",Wcirc:"Ŵ",wcirc:"ŵ",wedbar:"⩟",Wedge:"⋀",wedge:"∧",wedgeq:"≙",weierp:"℘",Wfr:"𝔚",wfr:"𝔴",Wopf:"𝕎",wopf:"𝕨",wp:"℘",wr:"≀",wreath:"≀",Wscr:"𝒲",wscr:"𝓌",xcap:"⋂",xcirc:"◯",xcup:"⋃",xdtri:"▽",Xfr:"𝔛",xfr:"𝔵",xhArr:"⟺",xharr:"⟷",Xi:"Ξ",xi:"ξ",xlArr:"⟸",xlarr:"⟵",xmap:"⟼",xnis:"⋻",xodot:"⨀",Xopf:"𝕏",xopf:"𝕩",xoplus:"⨁",xotime:"⨂",xrArr:"⟹",xrarr:"⟶",Xscr:"𝒳",xscr:"𝓍",xsqcup:"⨆",xuplus:"⨄",xutri:"△",xvee:"⋁",xwedge:"⋀",Yacute:"Ý",yacute:"ý",YAcy:"Я",yacy:"я",Ycirc:"Ŷ",ycirc:"ŷ",Ycy:"Ы",ycy:"ы",yen:"¥",Yfr:"𝔜",yfr:"𝔶",YIcy:"Ї",yicy:"ї",Yopf:"𝕐",yopf:"𝕪",Yscr:"𝒴",yscr:"𝓎",YUcy:"Ю",yucy:"ю",Yuml:"Ÿ",yuml:"ÿ",Zacute:"Ź",zacute:"ź",Zcaron:"Ž",zcaron:"ž",Zcy:"З",zcy:"з",Zdot:"Ż",zdot:"ż",zeetrf:"ℨ",ZeroWidthSpace:"​",Zeta:"Ζ",zeta:"ζ",Zfr:"ℨ",zfr:"𝔷",ZHcy:"Ж",zhcy:"ж",zigrarr:"⇝",Zopf:"ℤ",zopf:"𝕫",Zscr:"𝒵",zscr:"𝓏",zwj:"‍",zwnj:"‌"}),s.entityMap=s.HTML_ENTITIES}(xf)),xf}var tc={},o_;function YD(){if(o_)return tc;o_=1;var s=Bh().NAMESPACE,e=/[A-Z_a-z\xC0-\xD6\xD8-\xF6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,t=new RegExp("[\\-\\.0-9"+e.source.slice(1,-1)+"\\u00B7\\u0300-\\u036F\\u203F-\\u2040]"),i=new RegExp("^"+e.source+t.source+"*(?::"+e.source+t.source+"*)?$"),r=0,n=1,a=2,o=3,l=4,u=5,c=6,h=7;function d(C,I){this.message=C,this.locator=I,Error.captureStackTrace&&Error.captureStackTrace(this,d)}d.prototype=new Error,d.prototype.name=d.name;function g(){}g.prototype={parse:function(C,I,G){var H=this.domBuilder;H.startDocument(),$(I,I={}),y(C,I,G,H,this.errorHandler),H.endDocument()}};function y(C,I,G,H,K){function ie(Je){if(Je>65535){Je-=65536;var Tt=55296+(Je>>10),Wi=56320+(Je&1023);return String.fromCharCode(Tt,Wi)}else return String.fromCharCode(Je)}function he(Je){var Tt=Je.slice(1,-1);return Object.hasOwnProperty.call(G,Tt)?G[Tt]:Tt.charAt(0)==="#"?ie(parseInt(Tt.substr(1).replace("x","0x"))):(K.error("entity not found:"+Je),Je)}function fe(Je){if(Je>Me){var Tt=C.substring(Me,Je).replace(/&#?\w+;/g,he);ve&&re(Me),H.characters(Tt,0,Je-Me),Me=Je}}function re(Je,Tt){for(;Je>=oe&&(Tt=de.exec(C));)ne=Tt.index,oe=ne+Tt[0].length,ve.lineNumber++;ve.columnNumber=Je-ne+1}for(var ne=0,oe=0,de=/.*(?:\r\n?|\n)|.*$/g,ve=H.locator,ke=[{currentNSMap:I}],De={},Me=0;;){try{var Ne=C.indexOf("<",Me);if(Ne<0){if(!C.substr(Me).match(/^\s*$/)){var Ye=H.doc,Re=Ye.createTextNode(C.substr(Me));Ye.appendChild(Re),H.currentElement=Re}return}switch(Ne>Me&&fe(Ne),C.charAt(Ne+1)){case"/":var Te=C.indexOf(">",Ne+3),Oe=C.substring(Ne+2,Te).replace(/[ \t\n\r]+$/g,""),Ve=ke.pop();Te<0?(Oe=C.substring(Ne+2).replace(/[\s<].*/,""),K.error("end tag name: "+Oe+" is not complete:"+Ve.tagName),Te=Ne+1+Oe.length):Oe.match(/\s</)&&(Oe=Oe.replace(/[\s<].*/,""),K.error("end tag name: "+Oe+" maybe not complete"),Te=Ne+1+Oe.length);var nt=Ve.localNSMap,_t=Ve.tagName==Oe,Nt=_t||Ve.tagName&&Ve.tagName.toLowerCase()==Oe.toLowerCase();if(Nt){if(H.endElement(Ve.uri,Ve.localName,Oe),nt)for(var Mi in nt)Object.prototype.hasOwnProperty.call(nt,Mi)&&H.endPrefixMapping(Mi);_t||K.fatalError("end tag name: "+Oe+" is not match the current start tagName:"+Ve.tagName)}else ke.push(Ve);Te++;break;case"?":ve&&re(Ne),Te=L(C,Ne,H);break;case"!":ve&&re(Ne),Te=R(C,Ne,H,K);break;default:ve&&re(Ne);var Ft=new F,zi=ke[ke.length-1].currentNSMap,Te=_(C,Ne,Ft,zi,he,K),Ee=Ft.length;if(!Ft.closed&&N(C,Te,Ft.tagName,De)&&(Ft.closed=!0,G.nbsp||K.warning("unclosed xml attribute")),ve&&Ee){for(var Be=p(ve,{}),Fe=0;Fe<Ee;Fe++){var Xe=Ft[Fe];re(Xe.offset),Xe.locator=p(ve,{})}H.locator=Be,k(Ft,H,zi)&&ke.push(Ft),H.locator=ve}else k(Ft,H,zi)&&ke.push(Ft);s.isHTML(Ft.uri)&&!Ft.closed?Te=A(C,Te,Ft.tagName,he,H):Te++}}catch(Je){if(Je instanceof d)throw Je;K.error("element parse error: "+Je),Te=-1}Te>Me?Me=Te:fe(Math.max(Ne,Me)+1)}}function p(C,I){return I.lineNumber=C.lineNumber,I.columnNumber=C.columnNumber,I}function _(C,I,G,H,K,ie){function he(ve,ke,De){G.attributeNames.hasOwnProperty(ve)&&ie.fatalError("Attribute "+ve+" redefined"),G.addValue(ve,ke.replace(/[\t\n\r]/g," ").replace(/&#?\w+;/g,K),De)}for(var fe,re,ne=++I,oe=r;;){var de=C.charAt(ne);switch(de){case"=":if(oe===n)fe=C.slice(I,ne),oe=o;else if(oe===a)oe=o;else throw new Error("attribute equal must after attrName");break;case"'":case'"':if(oe===o||oe===n)if(oe===n&&(ie.warning('attribute value must after "="'),fe=C.slice(I,ne)),I=ne+1,ne=C.indexOf(de,I),ne>0)re=C.slice(I,ne),he(fe,re,I-1),oe=u;else throw new Error("attribute value no end '"+de+"' match");else if(oe==l)re=C.slice(I,ne),he(fe,re,I),ie.warning('attribute "'+fe+'" missed start quot('+de+")!!"),I=ne+1,oe=u;else throw new Error('attribute value must after "="');break;case"/":switch(oe){case r:G.setTagName(C.slice(I,ne));case u:case c:case h:oe=h,G.closed=!0;case l:case n:break;case a:G.closed=!0;break;default:throw new Error("attribute invalid close char('/')")}break;case"":return ie.error("unexpected end of input"),oe==r&&G.setTagName(C.slice(I,ne)),ne;case">":switch(oe){case r:G.setTagName(C.slice(I,ne));case u:case c:case h:break;case l:case n:re=C.slice(I,ne),re.slice(-1)==="/"&&(G.closed=!0,re=re.slice(0,-1));case a:oe===a&&(re=fe),oe==l?(ie.warning('attribute "'+re+'" missed quot(")!'),he(fe,re,I)):((!s.isHTML(H[""])||!re.match(/^(?:disabled|checked|selected)$/i))&&ie.warning('attribute "'+re+'" missed value!! "'+re+'" instead!!'),he(re,re,I));break;case o:throw new Error("attribute value missed!!")}return ne;case"€":de=" ";default:if(de<=" ")switch(oe){case r:G.setTagName(C.slice(I,ne)),oe=c;break;case n:fe=C.slice(I,ne),oe=a;break;case l:var re=C.slice(I,ne);ie.warning('attribute "'+re+'" missed quot(")!!'),he(fe,re,I);case u:oe=c;break}else switch(oe){case a:G.tagName,(!s.isHTML(H[""])||!fe.match(/^(?:disabled|checked|selected)$/i))&&ie.warning('attribute "'+fe+'" missed value!! "'+fe+'" instead2!!'),he(fe,fe,I),I=ne,oe=n;break;case u:ie.warning('attribute space is required"'+fe+'"!!');case c:oe=n,I=ne;break;case o:oe=l,I=ne;break;case h:throw new Error("elements closed character '/' and '>' must be connected to")}}ne++}}function k(C,I,G){for(var H=C.tagName,K=null,de=C.length;de--;){var ie=C[de],he=ie.qName,fe=ie.value,ve=he.indexOf(":");if(ve>0)var re=ie.prefix=he.slice(0,ve),ne=he.slice(ve+1),oe=re==="xmlns"&&ne;else ne=he,re=null,oe=he==="xmlns"&&"";ie.localName=ne,oe!==!1&&(K==null&&(K={},$(G,G={})),G[oe]=K[oe]=fe,ie.uri=s.XMLNS,I.startPrefixMapping(oe,fe))}for(var de=C.length;de--;){ie=C[de];var re=ie.prefix;re&&(re==="xml"&&(ie.uri=s.XML),re!=="xmlns"&&(ie.uri=G[re||""]))}var ve=H.indexOf(":");ve>0?(re=C.prefix=H.slice(0,ve),ne=C.localName=H.slice(ve+1)):(re=null,ne=C.localName=H);var ke=C.uri=G[re||""];if(I.startElement(ke,ne,H,C),C.closed){if(I.endElement(ke,ne,H),K)for(re in K)Object.prototype.hasOwnProperty.call(K,re)&&I.endPrefixMapping(re)}else return C.currentNSMap=G,C.localNSMap=K,!0}function A(C,I,G,H,K){if(/^(?:script|textarea)$/i.test(G)){var ie=C.indexOf("</"+G+">",I),he=C.substring(I+1,ie);if(/[&<]/.test(he))return/^script$/i.test(G)?(K.characters(he,0,he.length),ie):(he=he.replace(/&#?\w+;/g,H),K.characters(he,0,he.length),ie)}return I+1}function N(C,I,G,H){var K=H[G];return K==null&&(K=C.lastIndexOf("</"+G+">"),K<I&&(K=C.lastIndexOf("</"+G)),H[G]=K),K<I}function $(C,I){for(var G in C)Object.prototype.hasOwnProperty.call(C,G)&&(I[G]=C[G])}function R(C,I,G,H){var K=C.charAt(I+2);switch(K){case"-":if(C.charAt(I+3)==="-"){var ie=C.indexOf("-->",I+4);return ie>I?(G.comment(C,I+4,ie-I-4),ie+3):(H.error("Unclosed comment"),-1)}else return-1;default:if(C.substr(I+3,6)=="CDATA["){var ie=C.indexOf("]]>",I+9);return G.startCDATA(),G.characters(C,I+9,ie-I-9),G.endCDATA(),ie+3}var he=B(C,I),fe=he.length;if(fe>1&&/!doctype/i.test(he[0][0])){var re=he[1][0],ne=!1,oe=!1;fe>3&&(/^public$/i.test(he[2][0])?(ne=he[3][0],oe=fe>4&&he[4][0]):/^system$/i.test(he[2][0])&&(oe=he[3][0]));var de=he[fe-1];return G.startDTD(re,ne,oe),G.endDTD(),de.index+de[0].length}}return-1}function L(C,I,G){var H=C.indexOf("?>",I);if(H){var K=C.substring(I,H).match(/^<\?(\S*)\s*([\s\S]*?)\s*$/);return K?(K[0].length,G.processingInstruction(K[1],K[2]),H+2):-1}return-1}function F(){this.attributeNames={}}F.prototype={setTagName:function(C){if(!i.test(C))throw new Error("invalid tagName:"+C);this.tagName=C},addValue:function(C,I,G){if(!i.test(C))throw new Error("invalid attribute:"+C);this.attributeNames[C]=this.length,this[this.length++]={qName:C,value:I,offset:G}},length:0,getLocalName:function(C){return this[C].localName},getLocator:function(C){return this[C].locator},getQName:function(C){return this[C].qName},getURI:function(C){return this[C].uri},getValue:function(C){return this[C].value}};function B(C,I){var G,H=[],K=/'[^']+'|"[^"]+"|[^\s<>\/=]+=?|(\/?\s*>|<)/g;for(K.lastIndex=I,K.exec(C);G=K.exec(C);)if(H.push(G),G[1])return H}return tc.XMLReader=g,tc.ParseError=d,tc}var l_;function JD(){if(l_)return ml;l_=1;var s=Bh(),e=L1(),t=QD(),i=YD(),r=e.DOMImplementation,n=s.NAMESPACE,a=i.ParseError,o=i.XMLReader;function l(_){return _.replace(/\r[\n\u0085]/g,`
21
- `).replace(/[\r\u0085\u2028]/g,`
22
- `)}function u(_){this.options=_||{locator:{}}}u.prototype.parseFromString=function(_,k){var A=this.options,N=new o,$=A.domBuilder||new h,R=A.errorHandler,L=A.locator,F=A.xmlns||{},B=/\/x?html?$/.test(k),C=B?t.HTML_ENTITIES:t.XML_ENTITIES;L&&$.setDocumentLocator(L),N.errorHandler=c(R,$,L),N.domBuilder=A.domBuilder||$,B&&(F[""]=n.HTML),F.xml=F.xml||n.XML;var I=A.normalizeLineEndings||l;return _&&typeof _=="string"?N.parse(I(_),F,C):N.errorHandler.error("invalid doc source"),$.doc};function c(_,k,A){if(!_){if(k instanceof h)return k;_=k}var N={},$=_ instanceof Function;A=A||{};function R(L){var F=_[L];!F&&$&&(F=_.length==2?function(B){_(L,B)}:_),N[L]=F&&function(B){F("[xmldom "+L+"] "+B+g(A))}||function(){}}return R("warning"),R("error"),R("fatalError"),N}function h(){this.cdata=!1}function d(_,k){k.lineNumber=_.lineNumber,k.columnNumber=_.columnNumber}h.prototype={startDocument:function(){this.doc=new r().createDocument(null,null,null),this.locator&&(this.doc.documentURI=this.locator.systemId)},startElement:function(_,k,A,N){var $=this.doc,R=$.createElementNS(_,A||k),L=N.length;p(this,R),this.currentElement=R,this.locator&&d(this.locator,R);for(var F=0;F<L;F++){var _=N.getURI(F),B=N.getValue(F),A=N.getQName(F),C=$.createAttributeNS(_,A);this.locator&&d(N.getLocator(F),C),C.value=C.nodeValue=B,R.setAttributeNode(C)}},endElement:function(_,k,A){var N=this.currentElement;N.tagName,this.currentElement=N.parentNode},startPrefixMapping:function(_,k){},endPrefixMapping:function(_){},processingInstruction:function(_,k){var A=this.doc.createProcessingInstruction(_,k);this.locator&&d(this.locator,A),p(this,A)},ignorableWhitespace:function(_,k,A){},characters:function(_,k,A){if(_=y.apply(this,arguments),_){if(this.cdata)var N=this.doc.createCDATASection(_);else var N=this.doc.createTextNode(_);this.currentElement?this.currentElement.appendChild(N):/^\s*$/.test(_)&&this.doc.appendChild(N),this.locator&&d(this.locator,N)}},skippedEntity:function(_){},endDocument:function(){this.doc.normalize()},setDocumentLocator:function(_){(this.locator=_)&&(_.lineNumber=0)},comment:function(_,k,A){_=y.apply(this,arguments);var N=this.doc.createComment(_);this.locator&&d(this.locator,N),p(this,N)},startCDATA:function(){this.cdata=!0},endCDATA:function(){this.cdata=!1},startDTD:function(_,k,A){var N=this.doc.implementation;if(N&&N.createDocumentType){var $=N.createDocumentType(_,k,A);this.locator&&d(this.locator,$),p(this,$),this.doc.doctype=$}},warning:function(_){console.warn("[xmldom warning] "+_,g(this.locator))},error:function(_){console.error("[xmldom error] "+_,g(this.locator))},fatalError:function(_){throw new a(_,this.locator)}};function g(_){if(_)return`
23
- @`+(_.systemId||"")+"#[line:"+_.lineNumber+",col:"+_.columnNumber+"]"}function y(_,k,A){return typeof _=="string"?_.substr(k,A):_.length>=k+A||k?new java.lang.String(_,k,A)+"":_}"endDTD,startEntity,endEntity,attributeDecl,elementDecl,externalEntityDecl,internalEntityDecl,resolveEntity,getExternalSubset,notationDecl,unparsedEntityDecl".replace(/\w+/g,function(_){h.prototype[_]=function(){return null}});function p(_,k){_.currentElement?_.currentElement.appendChild(k):_.doc.appendChild(k)}return ml.__DOMHandler=h,ml.normalizeLineEndings=l,ml.DOMParser=u,ml}var u_;function ZD(){if(u_)return pl;u_=1;var s=L1();return pl.DOMImplementation=s.DOMImplementation,pl.XMLSerializer=s.XMLSerializer,pl.DOMParser=JD().DOMParser,pl}var O1=ZD();/*! @name mpd-parser @version 1.3.1 @license Apache-2.0 */const c_=s=>!!s&&typeof s=="object",ii=(...s)=>s.reduce((e,t)=>(typeof t!="object"||Object.keys(t).forEach(i=>{Array.isArray(e[i])&&Array.isArray(t[i])?e[i]=e[i].concat(t[i]):c_(e[i])&&c_(t[i])?e[i]=ii(e[i],t[i]):e[i]=t[i]}),e),{}),M1=s=>Object.keys(s).map(e=>s[e]),eN=(s,e)=>{const t=[];for(let i=s;i<e;i++)t.push(i);return t},po=s=>s.reduce((e,t)=>e.concat(t),[]),R1=s=>{if(!s.length)return[];const e=[];for(let t=0;t<s.length;t++)e.push(s[t]);return e},tN=(s,e)=>s.reduce((t,i,r)=>(i[e]&&t.push(r),t),[]),iN=(s,e)=>M1(s.reduce((t,i)=>(i.forEach(r=>{t[e(r)]=r}),t),{}));var mo={INVALID_NUMBER_OF_PERIOD:"INVALID_NUMBER_OF_PERIOD",DASH_EMPTY_MANIFEST:"DASH_EMPTY_MANIFEST",DASH_INVALID_XML:"DASH_INVALID_XML",NO_BASE_URL:"NO_BASE_URL",SEGMENT_TIME_UNSPECIFIED:"SEGMENT_TIME_UNSPECIFIED",UNSUPPORTED_UTC_TIMING_SCHEME:"UNSUPPORTED_UTC_TIMING_SCHEME"};const Wl=({baseUrl:s="",source:e="",range:t="",indexRange:i=""})=>{const r={uri:e,resolvedUri:Fh(s||"",e)};if(t||i){const a=(t||i).split("-");let o=O.BigInt?O.BigInt(a[0]):parseInt(a[0],10),l=O.BigInt?O.BigInt(a[1]):parseInt(a[1],10);o<Number.MAX_SAFE_INTEGER&&typeof o=="bigint"&&(o=Number(o)),l<Number.MAX_SAFE_INTEGER&&typeof l=="bigint"&&(l=Number(l));let u;typeof l=="bigint"||typeof o=="bigint"?u=O.BigInt(l)-O.BigInt(o)+O.BigInt(1):u=l-o+1,typeof u=="bigint"&&u<Number.MAX_SAFE_INTEGER&&(u=Number(u)),r.byterange={length:u,offset:o}}return r},rN=s=>{let e;return typeof s.offset=="bigint"||typeof s.length=="bigint"?e=O.BigInt(s.offset)+O.BigInt(s.length)-O.BigInt(1):e=s.offset+s.length-1,`${s.offset}-${e}`},h_=s=>(s&&typeof s!="number"&&(s=parseInt(s,10)),isNaN(s)?null:s),nN={static(s){const{duration:e,timescale:t=1,sourceDuration:i,periodDuration:r}=s,n=h_(s.endNumber),a=e/t;return typeof n=="number"?{start:0,end:n}:typeof r=="number"?{start:0,end:r/a}:{start:0,end:i/a}},dynamic(s){const{NOW:e,clientOffset:t,availabilityStartTime:i,timescale:r=1,duration:n,periodStart:a=0,minimumUpdatePeriod:o=0,timeShiftBufferDepth:l=1/0}=s,u=h_(s.endNumber),c=(e+t)/1e3,h=i+a,g=c+o-h,y=Math.ceil(g*r/n),p=Math.floor((c-h-l)*r/n),_=Math.floor((c-h)*r/n);return{start:Math.max(0,p),end:typeof u=="number"?u:Math.min(y,_)}}},sN=s=>e=>{const{duration:t,timescale:i=1,periodStart:r,startNumber:n=1}=s;return{number:n+e,duration:t/i,timeline:r,time:e*t}},Fv=s=>{const{type:e,duration:t,timescale:i=1,periodDuration:r,sourceDuration:n}=s,{start:a,end:o}=nN[e](s),l=eN(a,o).map(sN(s));if(e==="static"){const u=l.length-1,c=typeof r=="number"?r:n;l[u].duration=c-t/i*u}return l},F1=s=>{const{baseUrl:e,initialization:t={},sourceDuration:i,indexRange:r="",periodStart:n,presentationTime:a,number:o=0,duration:l}=s;if(!e)throw new Error(mo.NO_BASE_URL);const u=Wl({baseUrl:e,source:t.sourceURL,range:t.range}),c=Wl({baseUrl:e,source:e,indexRange:r});if(c.map=u,l){const h=Fv(s);h.length&&(c.duration=h[0].duration,c.timeline=h[0].timeline)}else i&&(c.duration=i,c.timeline=n);return c.presentationTime=a||n,c.number=o,[c]},Bv=(s,e,t)=>{const i=s.sidx.map?s.sidx.map:null,r=s.sidx.duration,n=s.timeline||0,a=s.sidx.byterange,o=a.offset+a.length,l=e.timescale,u=e.references.filter(_=>_.referenceType!==1),c=[],h=s.endList?"static":"dynamic",d=s.sidx.timeline;let g=d,y=s.mediaSequence||0,p;typeof e.firstOffset=="bigint"?p=O.BigInt(o)+e.firstOffset:p=o+e.firstOffset;for(let _=0;_<u.length;_++){const k=e.references[_],A=k.referencedSize,N=k.subsegmentDuration;let $;typeof p=="bigint"?$=p+O.BigInt(A)-O.BigInt(1):$=p+A-1;const R=`${p}-${$}`,F=F1({baseUrl:t,timescale:l,timeline:n,periodStart:d,presentationTime:g,number:y,duration:N,sourceDuration:r,indexRange:R,type:h})[0];i&&(F.map=i),c.push(F),typeof p=="bigint"?p+=O.BigInt(A):p+=A,g+=N/l,y++}return s.segments=c,s},aN=["AUDIO","SUBTITLES"],oN=1/60,B1=s=>iN(s,({timeline:e})=>e).sort((e,t)=>e.timeline>t.timeline?1:-1),lN=(s,e)=>{for(let t=0;t<s.length;t++)if(s[t].attributes.NAME===e)return s[t];return null},d_=s=>{let e=[];return XD(s,aN,(t,i,r,n)=>{e=e.concat(t.playlists||[])}),e},f_=({playlist:s,mediaSequence:e})=>{s.mediaSequence=e,s.segments.forEach((t,i)=>{t.number=s.mediaSequence+i})},uN=({oldPlaylists:s,newPlaylists:e,timelineStarts:t})=>{e.forEach(i=>{i.discontinuitySequence=t.findIndex(function({timeline:l}){return l===i.timeline});const r=lN(s,i.attributes.NAME);if(!r||i.sidx)return;const n=i.segments[0],a=r.segments.findIndex(function(l){return Math.abs(l.presentationTime-n.presentationTime)<oN});if(a===-1){f_({playlist:i,mediaSequence:r.mediaSequence+r.segments.length}),i.segments[0].discontinuity=!0,i.discontinuityStarts.unshift(0),(!r.segments.length&&i.timeline>r.timeline||r.segments.length&&i.timeline>r.segments[r.segments.length-1].timeline)&&i.discontinuitySequence--;return}r.segments[a].discontinuity&&!n.discontinuity&&(n.discontinuity=!0,i.discontinuityStarts.unshift(0),i.discontinuitySequence--),f_({playlist:i,mediaSequence:r.segments[a].number})})},cN=({oldManifest:s,newManifest:e})=>{const t=s.playlists.concat(d_(s)),i=e.playlists.concat(d_(e));return e.timelineStarts=B1([s.timelineStarts,e.timelineStarts]),uN({oldPlaylists:t,newPlaylists:i,timelineStarts:e.timelineStarts}),e},Uh=s=>s&&s.uri+"-"+rN(s.byterange),Cf=s=>{const e=s.reduce(function(i,r){return i[r.attributes.baseUrl]||(i[r.attributes.baseUrl]=[]),i[r.attributes.baseUrl].push(r),i},{});let t=[];return Object.values(e).forEach(i=>{const r=M1(i.reduce((n,a)=>{const o=a.attributes.id+(a.attributes.lang||"");return n[o]?(a.segments&&(a.segments[0]&&(a.segments[0].discontinuity=!0),n[o].segments.push(...a.segments)),a.attributes.contentProtection&&(n[o].attributes.contentProtection=a.attributes.contentProtection)):(n[o]=a,n[o].attributes.timelineStarts=[]),n[o].attributes.timelineStarts.push({start:a.attributes.periodStart,timeline:a.attributes.periodStart}),n},{}));t=t.concat(r)}),t.map(i=>(i.discontinuityStarts=tN(i.segments||[],"discontinuity"),i))},Uv=(s,e)=>{const t=Uh(s.sidx),i=t&&e[t]&&e[t].sidx;return i&&Bv(s,i,s.sidx.resolvedUri),s},hN=(s,e={})=>{if(!Object.keys(e).length)return s;for(const t in s)s[t]=Uv(s[t],e);return s},dN=({attributes:s,segments:e,sidx:t,mediaSequence:i,discontinuitySequence:r,discontinuityStarts:n},a)=>{const o={attributes:{NAME:s.id,BANDWIDTH:s.bandwidth,CODECS:s.codecs,"PROGRAM-ID":1},uri:"",endList:s.type==="static",timeline:s.periodStart,resolvedUri:s.baseUrl||"",targetDuration:s.duration,discontinuitySequence:r,discontinuityStarts:n,timelineStarts:s.timelineStarts,mediaSequence:i,segments:e};return s.contentProtection&&(o.contentProtection=s.contentProtection),s.serviceLocation&&(o.attributes.serviceLocation=s.serviceLocation),t&&(o.sidx=t),a&&(o.attributes.AUDIO="audio",o.attributes.SUBTITLES="subs"),o},fN=({attributes:s,segments:e,mediaSequence:t,discontinuityStarts:i,discontinuitySequence:r})=>{typeof e>"u"&&(e=[{uri:s.baseUrl,timeline:s.periodStart,resolvedUri:s.baseUrl||"",duration:s.sourceDuration,number:0}],s.duration=s.sourceDuration);const n={NAME:s.id,BANDWIDTH:s.bandwidth,"PROGRAM-ID":1};s.codecs&&(n.CODECS=s.codecs);const a={attributes:n,uri:"",endList:s.type==="static",timeline:s.periodStart,resolvedUri:s.baseUrl||"",targetDuration:s.duration,timelineStarts:s.timelineStarts,discontinuityStarts:i,discontinuitySequence:r,mediaSequence:t,segments:e};return s.serviceLocation&&(a.attributes.serviceLocation=s.serviceLocation),a},pN=(s,e={},t=!1)=>{let i;const r=s.reduce((n,a)=>{const o=a.attributes.role&&a.attributes.role.value||"",l=a.attributes.lang||"";let u=a.attributes.label||"main";if(l&&!a.attributes.label){const h=o?` (${o})`:"";u=`${a.attributes.lang}${h}`}n[u]||(n[u]={language:l,autoselect:!0,default:o==="main",playlists:[],uri:""});const c=Uv(dN(a,t),e);return n[u].playlists.push(c),typeof i>"u"&&o==="main"&&(i=a,i.default=!0),n},{});if(!i){const n=Object.keys(r)[0];r[n].default=!0}return r},mN=(s,e={})=>s.reduce((t,i)=>{const r=i.attributes.label||i.attributes.lang||"text",n=i.attributes.lang||"und";return t[r]||(t[r]={language:n,default:!1,autoselect:!1,playlists:[],uri:""}),t[r].playlists.push(Uv(fN(i),e)),t},{}),gN=s=>s.reduce((e,t)=>(t&&t.forEach(i=>{const{channel:r,language:n}=i;e[n]={autoselect:!1,default:!1,instreamId:r,language:n},i.hasOwnProperty("aspectRatio")&&(e[n].aspectRatio=i.aspectRatio),i.hasOwnProperty("easyReader")&&(e[n].easyReader=i.easyReader),i.hasOwnProperty("3D")&&(e[n]["3D"]=i["3D"])}),e),{}),vN=({attributes:s,segments:e,sidx:t,discontinuityStarts:i})=>{const r={attributes:{NAME:s.id,AUDIO:"audio",SUBTITLES:"subs",RESOLUTION:{width:s.width,height:s.height},CODECS:s.codecs,BANDWIDTH:s.bandwidth,"PROGRAM-ID":1},uri:"",endList:s.type==="static",timeline:s.periodStart,resolvedUri:s.baseUrl||"",targetDuration:s.duration,discontinuityStarts:i,timelineStarts:s.timelineStarts,segments:e};return s.frameRate&&(r.attributes["FRAME-RATE"]=s.frameRate),s.contentProtection&&(r.contentProtection=s.contentProtection),s.serviceLocation&&(r.attributes.serviceLocation=s.serviceLocation),t&&(r.sidx=t),r},yN=({attributes:s})=>s.mimeType==="video/mp4"||s.mimeType==="video/webm"||s.contentType==="video",_N=({attributes:s})=>s.mimeType==="audio/mp4"||s.mimeType==="audio/webm"||s.contentType==="audio",TN=({attributes:s})=>s.mimeType==="text/vtt"||s.contentType==="text",bN=(s,e)=>{s.forEach(t=>{t.mediaSequence=0,t.discontinuitySequence=e.findIndex(function({timeline:i}){return i===t.timeline}),t.segments&&t.segments.forEach((i,r)=>{i.number=r})})},p_=s=>s?Object.keys(s).reduce((e,t)=>{const i=s[t];return e.concat(i.playlists)},[]):[],SN=({dashPlaylists:s,locations:e,contentSteering:t,sidxMapping:i={},previousManifest:r,eventStream:n})=>{if(!s.length)return{};const{sourceDuration:a,type:o,suggestedPresentationDelay:l,minimumUpdatePeriod:u}=s[0].attributes,c=Cf(s.filter(yN)).map(vN),h=Cf(s.filter(_N)),d=Cf(s.filter(TN)),g=s.map($=>$.attributes.captionServices).filter(Boolean),y={allowCache:!0,discontinuityStarts:[],segments:[],endList:!0,mediaGroups:{AUDIO:{},VIDEO:{},"CLOSED-CAPTIONS":{},SUBTITLES:{}},uri:"",duration:a,playlists:hN(c,i)};u>=0&&(y.minimumUpdatePeriod=u*1e3),e&&(y.locations=e),t&&(y.contentSteering=t),o==="dynamic"&&(y.suggestedPresentationDelay=l),n&&n.length>0&&(y.eventStream=n);const p=y.playlists.length===0,_=h.length?pN(h,i,p):null,k=d.length?mN(d,i):null,A=c.concat(p_(_),p_(k)),N=A.map(({timelineStarts:$})=>$);return y.timelineStarts=B1(N),bN(A,y.timelineStarts),_&&(y.mediaGroups.AUDIO.audio=_),k&&(y.mediaGroups.SUBTITLES.subs=k),g.length&&(y.mediaGroups["CLOSED-CAPTIONS"].cc=gN(g)),r?cN({oldManifest:r,newManifest:y}):y},xN=(s,e,t)=>{const{NOW:i,clientOffset:r,availabilityStartTime:n,timescale:a=1,periodStart:o=0,minimumUpdatePeriod:l=0}=s,u=(i+r)/1e3,c=n+o,d=u+l-c;return Math.ceil((d*a-e)/t)},U1=(s,e)=>{const{type:t,minimumUpdatePeriod:i=0,media:r="",sourceDuration:n,timescale:a=1,startNumber:o=1,periodStart:l}=s,u=[];let c=-1;for(let h=0;h<e.length;h++){const d=e[h],g=d.d,y=d.r||0,p=d.t||0;c<0&&(c=p),p&&p>c&&(c=p);let _;if(y<0){const N=h+1;N===e.length?t==="dynamic"&&i>0&&r.indexOf("$Number$")>0?_=xN(s,c,g):_=(n*a-c)/g:_=(e[N].t-c)/g}else _=y+1;const k=o+u.length+_;let A=o+u.length;for(;A<k;)u.push({number:A,duration:g/a,time:c,timeline:l}),c+=g,A++}return u},CN=/\$([A-z]*)(?:(%0)([0-9]+)d)?\$/g,EN=s=>(e,t,i,r)=>{if(e==="$$")return"$";if(typeof s[t]>"u")return e;const n=""+s[t];return t==="RepresentationID"||(i?r=parseInt(r,10):r=1,n.length>=r)?n:`${new Array(r-n.length+1).join("0")}${n}`},m_=(s,e)=>s.replace(CN,EN(e)),wN=(s,e)=>!s.duration&&!e?[{number:s.startNumber||1,duration:s.sourceDuration,time:0,timeline:s.periodStart}]:s.duration?Fv(s):U1(s,e),kN=(s,e)=>{const t={RepresentationID:s.id,Bandwidth:s.bandwidth||0},{initialization:i={sourceURL:"",range:""}}=s,r=Wl({baseUrl:s.baseUrl,source:m_(i.sourceURL,t),range:i.range});return wN(s,e).map(a=>{t.Number=a.number,t.Time=a.time;const o=m_(s.media||"",t),l=s.timescale||1,u=s.presentationTimeOffset||0,c=s.periodStart+(a.time-u)/l;return{uri:o,timeline:a.timeline,duration:a.duration,resolvedUri:Fh(s.baseUrl||"",o),map:r,number:a.number,presentationTime:c}})},AN=(s,e)=>{const{baseUrl:t,initialization:i={}}=s,r=Wl({baseUrl:t,source:i.sourceURL,range:i.range}),n=Wl({baseUrl:t,source:e.media,range:e.mediaRange});return n.map=r,n},IN=(s,e)=>{const{duration:t,segmentUrls:i=[],periodStart:r}=s;if(!t&&!e||t&&e)throw new Error(mo.SEGMENT_TIME_UNSPECIFIED);const n=i.map(l=>AN(s,l));let a;return t&&(a=Fv(s)),e&&(a=U1(s,e)),a.map((l,u)=>{if(n[u]){const c=n[u],h=s.timescale||1,d=s.presentationTimeOffset||0;return c.timeline=l.timeline,c.duration=l.duration,c.number=l.number,c.presentationTime=r+(l.time-d)/h,c}}).filter(l=>l)},PN=({attributes:s,segmentInfo:e})=>{let t,i;e.template?(i=kN,t=ii(s,e.template)):e.base?(i=F1,t=ii(s,e.base)):e.list&&(i=IN,t=ii(s,e.list));const r={attributes:s};if(!i)return r;const n=i(t,e.segmentTimeline);if(t.duration){const{duration:a,timescale:o=1}=t;t.duration=a/o}else n.length?t.duration=n.reduce((a,o)=>Math.max(a,Math.ceil(o.duration)),0):t.duration=0;return r.attributes=t,r.segments=n,e.base&&t.indexRange&&(r.sidx=n[0],r.segments=[]),r},DN=s=>s.map(PN),Dt=(s,e)=>R1(s.childNodes).filter(({tagName:t})=>t===e),au=s=>s.textContent.trim(),NN=s=>parseFloat(s.split("/").reduce((e,t)=>e/t)),Oa=s=>{const o=/P(?:(\d*)Y)?(?:(\d*)M)?(?:(\d*)D)?(?:T(?:(\d*)H)?(?:(\d*)M)?(?:([\d.]*)S)?)?/.exec(s);if(!o)return 0;const[l,u,c,h,d,g]=o.slice(1);return parseFloat(l||0)*31536e3+parseFloat(u||0)*2592e3+parseFloat(c||0)*86400+parseFloat(h||0)*3600+parseFloat(d||0)*60+parseFloat(g||0)},LN=s=>(/^\d+-\d+-\d+T\d+:\d+:\d+(\.\d+)?$/.test(s)&&(s+="Z"),Date.parse(s)),g_={mediaPresentationDuration(s){return Oa(s)},availabilityStartTime(s){return LN(s)/1e3},minimumUpdatePeriod(s){return Oa(s)},suggestedPresentationDelay(s){return Oa(s)},type(s){return s},timeShiftBufferDepth(s){return Oa(s)},start(s){return Oa(s)},width(s){return parseInt(s,10)},height(s){return parseInt(s,10)},bandwidth(s){return parseInt(s,10)},frameRate(s){return NN(s)},startNumber(s){return parseInt(s,10)},timescale(s){return parseInt(s,10)},presentationTimeOffset(s){return parseInt(s,10)},duration(s){const e=parseInt(s,10);return isNaN(e)?Oa(s):e},d(s){return parseInt(s,10)},t(s){return parseInt(s,10)},r(s){return parseInt(s,10)},presentationTime(s){return parseInt(s,10)},DEFAULT(s){return s}},Wt=s=>s&&s.attributes?R1(s.attributes).reduce((e,t)=>{const i=g_[t.name]||g_.DEFAULT;return e[t.name]=i(t.value),e},{}):{},ON={"urn:uuid:1077efec-c0b2-4d02-ace3-3c1e52e2fb4b":"org.w3.clearkey","urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed":"com.widevine.alpha","urn:uuid:9a04f079-9840-4286-ab92-e65be0885f95":"com.microsoft.playready","urn:uuid:f239e769-efa3-4850-9c16-a903c6932efb":"com.adobe.primetime","urn:mpeg:dash:mp4protection:2011":"mp4protection"},$h=(s,e)=>e.length?po(s.map(function(t){return e.map(function(i){const r=au(i),n=Fh(t.baseUrl,r),a=ii(Wt(i),{baseUrl:n});return n!==r&&!a.serviceLocation&&t.serviceLocation&&(a.serviceLocation=t.serviceLocation),a})})):s,$v=s=>{const e=Dt(s,"SegmentTemplate")[0],t=Dt(s,"SegmentList")[0],i=t&&Dt(t,"SegmentURL").map(h=>ii({tag:"SegmentURL"},Wt(h))),r=Dt(s,"SegmentBase")[0],n=t||e,a=n&&Dt(n,"SegmentTimeline")[0],o=t||r||e,l=o&&Dt(o,"Initialization")[0],u=e&&Wt(e);u&&l?u.initialization=l&&Wt(l):u&&u.initialization&&(u.initialization={sourceURL:u.initialization});const c={template:u,segmentTimeline:a&&Dt(a,"S").map(h=>Wt(h)),list:t&&ii(Wt(t),{segmentUrls:i,initialization:Wt(l)}),base:r&&ii(Wt(r),{initialization:Wt(l)})};return Object.keys(c).forEach(h=>{c[h]||delete c[h]}),c},MN=(s,e,t)=>i=>{const r=Dt(i,"BaseURL"),n=$h(e,r),a=ii(s,Wt(i)),o=$v(i);return n.map(l=>({segmentInfo:ii(t,o),attributes:ii(a,l)}))},RN=s=>s.reduce((e,t)=>{const i=Wt(t);i.schemeIdUri&&(i.schemeIdUri=i.schemeIdUri.toLowerCase());const r=ON[i.schemeIdUri];if(r){e[r]={attributes:i};const n=Dt(t,"cenc:pssh")[0];if(n){const a=au(n);e[r].pssh=a&&k1(a)}}return e},{}),FN=s=>{if(s.schemeIdUri==="urn:scte:dash:cc:cea-608:2015")return(typeof s.value!="string"?[]:s.value.split(";")).map(t=>{let i,r;return r=t,/^CC\d=/.test(t)?[i,r]=t.split("="):/^CC\d$/.test(t)&&(i=t),{channel:i,language:r}});if(s.schemeIdUri==="urn:scte:dash:cc:cea-708:2015")return(typeof s.value!="string"?[]:s.value.split(";")).map(t=>{const i={channel:void 0,language:void 0,aspectRatio:1,easyReader:0,"3D":0};if(/=/.test(t)){const[r,n=""]=t.split("=");i.channel=r,i.language=t,n.split(",").forEach(a=>{const[o,l]=a.split(":");o==="lang"?i.language=l:o==="er"?i.easyReader=Number(l):o==="war"?i.aspectRatio=Number(l):o==="3D"&&(i["3D"]=Number(l))})}else i.language=t;return i.channel&&(i.channel="SERVICE"+i.channel),i})},BN=s=>po(Dt(s.node,"EventStream").map(e=>{const t=Wt(e),i=t.schemeIdUri;return Dt(e,"Event").map(r=>{const n=Wt(r),a=n.presentationTime||0,o=t.timescale||1,l=n.duration||0,u=a/o+s.attributes.start;return{schemeIdUri:i,value:t.value,id:n.id,start:u,end:u+l/o,messageData:au(r)||n.messageData,contentEncoding:t.contentEncoding,presentationTimeOffset:t.presentationTimeOffset||0}})})),UN=(s,e,t)=>i=>{const r=Wt(i),n=$h(e,Dt(i,"BaseURL")),a=Dt(i,"Role")[0],o={role:Wt(a)};let l=ii(s,r,o);const u=Dt(i,"Accessibility")[0],c=FN(Wt(u));c&&(l=ii(l,{captionServices:c}));const h=Dt(i,"Label")[0];if(h&&h.childNodes.length){const _=h.childNodes[0].nodeValue.trim();l=ii(l,{label:_})}const d=RN(Dt(i,"ContentProtection"));Object.keys(d).length&&(l=ii(l,{contentProtection:d}));const g=$v(i),y=Dt(i,"Representation"),p=ii(t,g);return po(y.map(MN(l,n,p)))},$N=(s,e)=>(t,i)=>{const r=$h(e,Dt(t.node,"BaseURL")),n=ii(s,{periodStart:t.attributes.start});typeof t.attributes.duration=="number"&&(n.periodDuration=t.attributes.duration);const a=Dt(t.node,"AdaptationSet"),o=$v(t.node);return po(a.map(UN(n,r,o)))},jN=(s,e)=>{if(s.length>1&&e({type:"warn",message:"The MPD manifest should contain no more than one ContentSteering tag"}),!s.length)return null;const t=ii({serverURL:au(s[0])},Wt(s[0]));return t.queryBeforeStart=t.queryBeforeStart==="true",t},qN=({attributes:s,priorPeriodAttributes:e,mpdType:t})=>typeof s.start=="number"?s.start:e&&typeof e.start=="number"&&typeof e.duration=="number"?e.start+e.duration:!e&&t==="static"?0:null,VN=(s,e={})=>{const{manifestUri:t="",NOW:i=Date.now(),clientOffset:r=0,eventHandler:n=function(){}}=e,a=Dt(s,"Period");if(!a.length)throw new Error(mo.INVALID_NUMBER_OF_PERIOD);const o=Dt(s,"Location"),l=Wt(s),u=$h([{baseUrl:t}],Dt(s,"BaseURL")),c=Dt(s,"ContentSteering");l.type=l.type||"static",l.sourceDuration=l.mediaPresentationDuration||0,l.NOW=i,l.clientOffset=r,o.length&&(l.locations=o.map(au));const h=[];return a.forEach((d,g)=>{const y=Wt(d),p=h[g-1];y.start=qN({attributes:y,priorPeriodAttributes:p?p.attributes:null,mpdType:l.type}),h.push({node:d,attributes:y})}),{locations:l.locations,contentSteeringInfo:jN(c,n),representationInfo:po(h.map($N(l,u))),eventStream:po(h.map(BN))}},$1=s=>{if(s==="")throw new Error(mo.DASH_EMPTY_MANIFEST);const e=new O1.DOMParser;let t,i;try{t=e.parseFromString(s,"application/xml"),i=t&&t.documentElement.tagName==="MPD"?t.documentElement:null}catch{}if(!i||i&&i.getElementsByTagName("parsererror").length>0)throw new Error(mo.DASH_INVALID_XML);return i},HN=s=>{const e=Dt(s,"UTCTiming")[0];if(!e)return null;const t=Wt(e);switch(t.schemeIdUri){case"urn:mpeg:dash:utc:http-head:2014":case"urn:mpeg:dash:utc:http-head:2012":t.method="HEAD";break;case"urn:mpeg:dash:utc:http-xsdate:2014":case"urn:mpeg:dash:utc:http-iso:2014":case"urn:mpeg:dash:utc:http-xsdate:2012":case"urn:mpeg:dash:utc:http-iso:2012":t.method="GET";break;case"urn:mpeg:dash:utc:direct:2014":case"urn:mpeg:dash:utc:direct:2012":t.method="DIRECT",t.value=Date.parse(t.value);break;case"urn:mpeg:dash:utc:http-ntp:2014":case"urn:mpeg:dash:utc:ntp:2014":case"urn:mpeg:dash:utc:sntp:2014":default:throw new Error(mo.UNSUPPORTED_UTC_TIMING_SCHEME)}return t},zN=(s,e={})=>{const t=VN($1(s),e),i=DN(t.representationInfo);return SN({dashPlaylists:i,locations:t.locations,contentSteering:t.contentSteeringInfo,sidxMapping:e.sidxMapping,previousManifest:e.previousManifest,eventStream:t.eventStream})},WN=s=>HN($1(s));var Ef,v_;function GN(){if(v_)return Ef;v_=1;var s=Math.pow(2,32),e=function(t){var i=new DataView(t.buffer,t.byteOffset,t.byteLength),r;return i.getBigUint64?(r=i.getBigUint64(0),r<Number.MAX_SAFE_INTEGER?Number(r):r):i.getUint32(0)*s+i.getUint32(4)};return Ef={getUint64:e,MAX_UINT32:s},Ef}var wf,y_;function KN(){if(y_)return wf;y_=1;var s=GN().getUint64,e=function(t){var i=new DataView(t.buffer,t.byteOffset,t.byteLength),r={version:t[0],flags:new Uint8Array(t.subarray(1,4)),references:[],referenceId:i.getUint32(4),timescale:i.getUint32(8)},n=12;r.version===0?(r.earliestPresentationTime=i.getUint32(n),r.firstOffset=i.getUint32(n+4),n+=8):(r.earliestPresentationTime=s(t.subarray(n)),r.firstOffset=s(t.subarray(n+8)),n+=16),n+=2;var a=i.getUint16(n);for(n+=2;a>0;n+=12,a--)r.references.push({referenceType:(t[n]&128)>>>7,referencedSize:i.getUint32(n)&2147483647,subsegmentDuration:i.getUint32(n+4),startsWithSap:!!(t[n+8]&128),sapType:(t[n+8]&112)>>>4,sapDeltaTime:i.getUint32(n+8)&268435455});return r};return wf=e,wf}var XN=KN();const QN=Hi(XN);var YN=$e([73,68,51]),JN=function(e,t){t===void 0&&(t=0),e=$e(e);var i=e[t+5],r=e[t+6]<<21|e[t+7]<<14|e[t+8]<<7|e[t+9],n=(i&16)>>4;return n?r+20:r+10},wl=function s(e,t){return t===void 0&&(t=0),e=$e(e),e.length-t<10||!At(e,YN,{offset:t})?t:(t+=JN(e,t),s(e,t))},__=function(e){return typeof e=="string"?N1(e):e},ZN=function(e){return Array.isArray(e)?e.map(function(t){return __(t)}):[__(e)]},eL=function s(e,t,i){i===void 0&&(i=!1),t=ZN(t),e=$e(e);var r=[];if(!t.length)return r;for(var n=0;n<e.length;){var a=(e[n]<<24|e[n+1]<<16|e[n+2]<<8|e[n+3])>>>0,o=e.subarray(n+4,n+8);if(a===0)break;var l=n+a;if(l>e.length){if(i)break;l=e.length}var u=e.subarray(n+8,l);At(o,t[0])&&(t.length===1?r.push(u):r.push.apply(r,s(u,t.slice(1),i))),n=l}return r},ic={EBML:$e([26,69,223,163]),DocType:$e([66,130]),Segment:$e([24,83,128,103]),SegmentInfo:$e([21,73,169,102]),Tracks:$e([22,84,174,107]),Track:$e([174]),TrackNumber:$e([215]),DefaultDuration:$e([35,227,131]),TrackEntry:$e([174]),TrackType:$e([131]),FlagDefault:$e([136]),CodecID:$e([134]),CodecPrivate:$e([99,162]),VideoTrack:$e([224]),AudioTrack:$e([225]),Cluster:$e([31,67,182,117]),Timestamp:$e([231]),TimestampScale:$e([42,215,177]),BlockGroup:$e([160]),BlockDuration:$e([155]),Block:$e([161]),SimpleBlock:$e([163])},wg=[128,64,32,16,8,4,2,1],tL=function(e){for(var t=1,i=0;i<wg.length&&!(e&wg[i]);i++)t++;return t},jc=function(e,t,i,r){i===void 0&&(i=!0),r===void 0&&(r=!1);var n=tL(e[t]),a=e.subarray(t,t+n);return i&&(a=Array.prototype.slice.call(e,t,t+n),a[0]^=wg[n-1]),{length:n,value:WD(a,{signed:r}),bytes:a}},T_=function s(e){return typeof e=="string"?e.match(/.{1,2}/g).map(function(t){return s(t)}):typeof e=="number"?GD(e):e},iL=function(e){return Array.isArray(e)?e.map(function(t){return T_(t)}):[T_(e)]},rL=function s(e,t,i){if(i>=t.length)return t.length;var r=jc(t,i,!1);if(At(e.bytes,r.bytes))return i;var n=jc(t,i+r.length);return s(e,t,i+n.length+n.value+r.length)},b_=function s(e,t){t=iL(t),e=$e(e);var i=[];if(!t.length)return i;for(var r=0;r<e.length;){var n=jc(e,r,!1),a=jc(e,r+n.length),o=r+n.length+a.length;a.value===127&&(a.value=rL(n,e,o),a.value!==e.length&&(a.value-=o));var l=o+a.value>e.length?e.length:o+a.value,u=e.subarray(o,l);At(t[0],n.bytes)&&(t.length===1?i.push(u):i=i.concat(s(u,t.slice(1))));var c=n.length+a.length+u.length;r+=c}return i},nL=$e([0,0,0,1]),sL=$e([0,0,1]),aL=$e([0,0,3]),oL=function(e){for(var t=[],i=1;i<e.length-2;)At(e.subarray(i,i+3),aL)&&(t.push(i+2),i++),i++;if(t.length===0)return e;var r=e.length-t.length,n=new Uint8Array(r),a=0;for(i=0;i<r;a++,i++)a===t[0]&&(a++,t.shift()),n[i]=e[a];return n},j1=function(e,t,i,r){e=$e(e),i=[].concat(i);for(var n=0,a,o=0;n<e.length&&(o<r||a);){var l=void 0;if(At(e.subarray(n),nL)?l=4:At(e.subarray(n),sL)&&(l=3),!l){n++;continue}if(o++,a)return oL(e.subarray(a,n));var u=void 0;t==="h264"?u=e[n+l]&31:t==="h265"&&(u=e[n+l]>>1&63),i.indexOf(u)!==-1&&(a=n+l),n+=l+(t==="h264"?1:2)}return e.subarray(0,0)},lL=function(e,t,i){return j1(e,"h264",t,i)},uL=function(e,t,i){return j1(e,"h265",t,i)},Ci={webm:$e([119,101,98,109]),matroska:$e([109,97,116,114,111,115,107,97]),flac:$e([102,76,97,67]),ogg:$e([79,103,103,83]),ac3:$e([11,119]),riff:$e([82,73,70,70]),avi:$e([65,86,73]),wav:$e([87,65,86,69]),"3gp":$e([102,116,121,112,51,103]),mp4:$e([102,116,121,112]),fmp4:$e([115,116,121,112]),mov:$e([102,116,121,112,113,116]),moov:$e([109,111,111,118]),moof:$e([109,111,111,102])},go={aac:function(e){var t=wl(e);return At(e,[255,16],{offset:t,mask:[255,22]})},mp3:function(e){var t=wl(e);return At(e,[255,2],{offset:t,mask:[255,6]})},webm:function(e){var t=b_(e,[ic.EBML,ic.DocType])[0];return At(t,Ci.webm)},mkv:function(e){var t=b_(e,[ic.EBML,ic.DocType])[0];return At(t,Ci.matroska)},mp4:function(e){if(go["3gp"](e)||go.mov(e))return!1;if(At(e,Ci.mp4,{offset:4})||At(e,Ci.fmp4,{offset:4})||At(e,Ci.moof,{offset:4})||At(e,Ci.moov,{offset:4}))return!0},mov:function(e){return At(e,Ci.mov,{offset:4})},"3gp":function(e){return At(e,Ci["3gp"],{offset:4})},ac3:function(e){var t=wl(e);return At(e,Ci.ac3,{offset:t})},ts:function(e){if(e.length<189&&e.length>=1)return e[0]===71;for(var t=0;t+188<e.length&&t<188;){if(e[t]===71&&e[t+188]===71)return!0;t+=1}return!1},flac:function(e){var t=wl(e);return At(e,Ci.flac,{offset:t})},ogg:function(e){return At(e,Ci.ogg)},avi:function(e){return At(e,Ci.riff)&&At(e,Ci.avi,{offset:8})},wav:function(e){return At(e,Ci.riff)&&At(e,Ci.wav,{offset:8})},h264:function(e){return lL(e,7,3).length},h265:function(e){return uL(e,[32,33],3).length}},kg=Object.keys(go).filter(function(s){return s!=="ts"&&s!=="h264"&&s!=="h265"}).concat(["ts","h264","h265"]);kg.forEach(function(s){var e=go[s];go[s]=function(t){return e($e(t))}});var cL=go,jv=function(e){e=$e(e);for(var t=0;t<kg.length;t++){var i=kg[t];if(cL[i](e))return i}return""},hL=function(e){return eL(e,["moof"]).length>0},kf,S_;function dL(){if(S_)return kf;S_=1;var s=9e4,e,t,i,r,n,a,o;return e=function(l){return l*s},t=function(l,u){return l*u},i=function(l){return l/s},r=function(l,u){return l/u},n=function(l,u){return e(r(l,u))},a=function(l,u){return t(i(l),u)},o=function(l,u,c){return i(c?l:l-u)},kf={ONE_SECOND_IN_TS:s,secondsToVideoTs:e,secondsToAudioTs:t,videoTsToSeconds:i,audioTsToSeconds:r,audioTsToVideoTs:n,videoTsToAudioTs:a,metadataTsToSeconds:o},kf}var qs=dL();/**
24
- * @license
25
- * Video.js 8.20.0 <http://videojs.com/>
26
- * Copyright Brightcove, Inc. <https://www.brightcove.com/>
27
- * Available under Apache License Version 2.0
28
- * <https://github.com/videojs/video.js/blob/main/LICENSE>
29
- *
30
- * Includes vtt.js <https://github.com/mozilla/vtt.js>
31
- * Available under Apache License Version 2.0
32
- * <https://github.com/mozilla/vtt.js/blob/main/LICENSE>
33
- */var Ag="8.20.0";const Cn={},os=function(s,e){return Cn[s]=Cn[s]||[],e&&(Cn[s]=Cn[s].concat(e)),Cn[s]},fL=function(s,e){os(s,e)},q1=function(s,e){const t=os(s).indexOf(e);return t<=-1?!1:(Cn[s]=Cn[s].slice(),Cn[s].splice(t,1),!0)},pL=function(s,e){os(s,[].concat(e).map(t=>{const i=(...r)=>(q1(s,i),t(...r));return i}))},qc={prefixed:!0},Ac=[["requestFullscreen","exitFullscreen","fullscreenElement","fullscreenEnabled","fullscreenchange","fullscreenerror","fullscreen"],["webkitRequestFullscreen","webkitExitFullscreen","webkitFullscreenElement","webkitFullscreenEnabled","webkitfullscreenchange","webkitfullscreenerror","-webkit-full-screen"]],x_=Ac[0];let kl;for(let s=0;s<Ac.length;s++)if(Ac[s][1]in ce){kl=Ac[s];break}if(kl){for(let s=0;s<kl.length;s++)qc[x_[s]]=kl[s];qc.prefixed=kl[0]!==x_[0]}let Ui=[];const mL=(s,e,t)=>(i,r,n)=>{const a=e.levels[r],o=new RegExp(`^(${a})$`);let l=s;if(i!=="log"&&n.unshift(i.toUpperCase()+":"),t&&(l=`%c${s}`,n.unshift(t)),n.unshift(l+":"),Ui){Ui.push([].concat(n));const c=Ui.length-1e3;Ui.splice(0,c>0?c:0)}if(!O.console)return;let u=O.console[i];!u&&i==="debug"&&(u=O.console.info||O.console.log),!(!u||!a||!o.test(i))&&u[Array.isArray(n)?"apply":"call"](O.console,n)};function Ig(s,e=":",t=""){let i="info",r;function n(...a){r("log",i,a)}return r=mL(s,n,t),n.createLogger=(a,o,l)=>{const u=o!==void 0?o:e,c=l!==void 0?l:t,h=`${s} ${u} ${a}`;return Ig(h,u,c)},n.createNewLogger=(a,o,l)=>Ig(a,o,l),n.levels={all:"debug|log|warn|error",off:"",debug:"debug|log|warn|error",info:"log|warn|error",warn:"warn|error",error:"error",DEFAULT:i},n.level=a=>{if(typeof a=="string"){if(!n.levels.hasOwnProperty(a))throw new Error(`"${a}" in not a valid log level`);i=a}return i},n.history=()=>Ui?[].concat(Ui):[],n.history.filter=a=>(Ui||[]).filter(o=>new RegExp(`.*${a}.*`).test(o[0])),n.history.clear=()=>{Ui&&(Ui.length=0)},n.history.disable=()=>{Ui!==null&&(Ui.length=0,Ui=null)},n.history.enable=()=>{Ui===null&&(Ui=[])},n.error=(...a)=>r("error",i,a),n.warn=(...a)=>r("warn",i,a),n.debug=(...a)=>r("debug",i,a),n}const et=Ig("VIDEOJS"),V1=et.createLogger,gL=Object.prototype.toString,H1=function(s){return en(s)?Object.keys(s):[]};function Za(s,e){H1(s).forEach(t=>e(s[t],t))}function z1(s,e,t=0){return H1(s).reduce((i,r)=>e(i,s[r],r),t)}function en(s){return!!s&&typeof s=="object"}function vo(s){return en(s)&&gL.call(s)==="[object Object]"&&s.constructor===Object}function gt(...s){const e={};return s.forEach(t=>{t&&Za(t,(i,r)=>{if(!vo(i)){e[r]=i;return}vo(e[r])||(e[r]={}),e[r]=gt(e[r],i)})}),e}function W1(s={}){const e=[];for(const t in s)if(s.hasOwnProperty(t)){const i=s[t];e.push(i)}return e}function jh(s,e,t,i=!0){const r=a=>Object.defineProperty(s,e,{value:a,enumerable:!0,writable:!0}),n={configurable:!0,enumerable:!0,get(){const a=t();return r(a),a}};return i&&(n.set=r),Object.defineProperty(s,e,n)}var vL=Object.freeze({__proto__:null,each:Za,reduce:z1,isObject:en,isPlain:vo,merge:gt,values:W1,defineLazyProperty:jh});let qv=!1,G1=null,tn=!1,K1,X1=!1,eo=!1,to=!1,rn=!1,Vv=null,qh=null;const yL=!!(O.cast&&O.cast.framework&&O.cast.framework.CastReceiverContext);let Q1=null,Vc=!1,Vh=!1,Hc=!1,Hh=!1,zc=!1,Wc=!1,Gc=!1;const Gl=!!(Lo()&&("ontouchstart"in O||O.navigator.maxTouchPoints||O.DocumentTouch&&O.document instanceof O.DocumentTouch)),Zn=O.navigator&&O.navigator.userAgentData;Zn&&Zn.platform&&Zn.brands&&(tn=Zn.platform==="Android",eo=!!Zn.brands.find(s=>s.brand==="Microsoft Edge"),to=!!Zn.brands.find(s=>s.brand==="Chromium"),rn=!eo&&to,Vv=qh=(Zn.brands.find(s=>s.brand==="Chromium")||{}).version||null,Vh=Zn.platform==="Windows");if(!to){const s=O.navigator&&O.navigator.userAgent||"";qv=/iPod/i.test(s),G1=function(){const e=s.match(/OS (\d+)_/i);return e&&e[1]?e[1]:null}(),tn=/Android/i.test(s),K1=function(){const e=s.match(/Android (\d+)(?:\.(\d+))?(?:\.(\d+))*/i);if(!e)return null;const t=e[1]&&parseFloat(e[1]),i=e[2]&&parseFloat(e[2]);return t&&i?parseFloat(e[1]+"."+e[2]):t||null}(),X1=/Firefox/i.test(s),eo=/Edg/i.test(s),to=/Chrome/i.test(s)||/CriOS/i.test(s),rn=!eo&&to,Vv=qh=function(){const e=s.match(/(Chrome|CriOS)\/(\d+)/);return e&&e[2]?parseFloat(e[2]):null}(),Q1=function(){const e=/MSIE\s(\d+)\.\d/.exec(s);let t=e&&parseFloat(e[1]);return!t&&/Trident\/7.0/i.test(s)&&/rv:11.0/.test(s)&&(t=11),t}(),zc=/Tizen/i.test(s),Wc=/Web0S/i.test(s),Gc=zc||Wc,Vc=/Safari/i.test(s)&&!rn&&!tn&&!eo&&!Gc,Vh=/Windows/i.test(s),Hc=/iPad/i.test(s)||Vc&&Gl&&!/iPhone/i.test(s),Hh=/iPhone/i.test(s)&&!Hc}const Li=Hh||Hc||qv,zh=(Vc||Li)&&!rn;var Y1=Object.freeze({__proto__:null,get IS_IPOD(){return qv},get IOS_VERSION(){return G1},get IS_ANDROID(){return tn},get ANDROID_VERSION(){return K1},get IS_FIREFOX(){return X1},get IS_EDGE(){return eo},get IS_CHROMIUM(){return to},get IS_CHROME(){return rn},get CHROMIUM_VERSION(){return Vv},get CHROME_VERSION(){return qh},IS_CHROMECAST_RECEIVER:yL,get IE_VERSION(){return Q1},get IS_SAFARI(){return Vc},get IS_WINDOWS(){return Vh},get IS_IPAD(){return Hc},get IS_IPHONE(){return Hh},get IS_TIZEN(){return zc},get IS_WEBOS(){return Wc},get IS_SMART_TV(){return Gc},TOUCH_ENABLED:Gl,IS_IOS:Li,IS_ANY_SAFARI:zh});function C_(s){return typeof s=="string"&&!!s.trim()}function _L(s){if(s.indexOf(" ")>=0)throw new Error("class has illegal whitespace characters")}function Lo(){return ce===O.document}function Oo(s){return en(s)&&s.nodeType===1}function J1(){try{return O.parent!==O.self}catch{return!0}}function Z1(s){return function(e,t){if(!C_(e))return ce[s](null);C_(t)&&(t=ce.querySelector(t));const i=Oo(t)?t:ce;return i[s]&&i[s](e)}}function He(s="div",e={},t={},i){const r=ce.createElement(s);return Object.getOwnPropertyNames(e).forEach(function(n){const a=e[n];n==="textContent"?ds(r,a):(r[n]!==a||n==="tabIndex")&&(r[n]=a)}),Object.getOwnPropertyNames(t).forEach(function(n){r.setAttribute(n,t[n])}),i&&Hv(r,i),r}function ds(s,e){return typeof s.textContent>"u"?s.innerText=e:s.textContent=e,s}function Pg(s,e){e.firstChild?e.insertBefore(s,e.firstChild):e.appendChild(s)}function Rl(s,e){return _L(e),s.classList.contains(e)}function Qs(s,...e){return s.classList.add(...e.reduce((t,i)=>t.concat(i.split(/\s+/)),[])),s}function Wh(s,...e){return s?(s.classList.remove(...e.reduce((t,i)=>t.concat(i.split(/\s+/)),[])),s):(et.warn("removeClass was called with an element that doesn't exist"),null)}function eE(s,e,t){return typeof t=="function"&&(t=t(s,e)),typeof t!="boolean"&&(t=void 0),e.split(/\s+/).forEach(i=>s.classList.toggle(i,t)),s}function tE(s,e){Object.getOwnPropertyNames(e).forEach(function(t){const i=e[t];i===null||typeof i>"u"||i===!1?s.removeAttribute(t):s.setAttribute(t,i===!0?"":i)})}function ns(s){const e={},t=["autoplay","controls","playsinline","loop","muted","default","defaultMuted"];if(s&&s.attributes&&s.attributes.length>0){const i=s.attributes;for(let r=i.length-1;r>=0;r--){const n=i[r].name;let a=i[r].value;t.includes(n)&&(a=a!==null),e[n]=a}}return e}function iE(s,e){return s.getAttribute(e)}function yo(s,e,t){s.setAttribute(e,t)}function Gh(s,e){s.removeAttribute(e)}function rE(){ce.body.focus(),ce.onselectstart=function(){return!1}}function nE(){ce.onselectstart=function(){return!0}}function _o(s){if(s&&s.getBoundingClientRect&&s.parentNode){const e=s.getBoundingClientRect(),t={};return["bottom","height","left","right","top","width"].forEach(i=>{e[i]!==void 0&&(t[i]=e[i])}),t.height||(t.height=parseFloat(To(s,"height"))),t.width||(t.width=parseFloat(To(s,"width"))),t}}function Kl(s){if(!s||s&&!s.offsetParent)return{left:0,top:0,width:0,height:0};const e=s.offsetWidth,t=s.offsetHeight;let i=0,r=0;for(;s.offsetParent&&s!==ce[qc.fullscreenElement];)i+=s.offsetLeft,r+=s.offsetTop,s=s.offsetParent;return{left:i,top:r,width:e,height:t}}function Kh(s,e){const t={x:0,y:0};if(Li){let c=s;for(;c&&c.nodeName.toLowerCase()!=="html";){const h=To(c,"transform");if(/^matrix/.test(h)){const d=h.slice(7,-1).split(/,\s/).map(Number);t.x+=d[4],t.y+=d[5]}else if(/^matrix3d/.test(h)){const d=h.slice(9,-1).split(/,\s/).map(Number);t.x+=d[12],t.y+=d[13]}if(c.assignedSlot&&c.assignedSlot.parentElement&&O.WebKitCSSMatrix){const d=O.getComputedStyle(c.assignedSlot.parentElement).transform,g=new O.WebKitCSSMatrix(d);t.x+=g.m41,t.y+=g.m42}c=c.parentNode||c.host}}const i={},r=Kl(e.target),n=Kl(s),a=n.width,o=n.height;let l=e.offsetY-(n.top-r.top),u=e.offsetX-(n.left-r.left);return e.changedTouches&&(u=e.changedTouches[0].pageX-n.left,l=e.changedTouches[0].pageY+n.top,Li&&(u-=t.x,l-=t.y)),i.y=1-Math.max(0,Math.min(1,l/o)),i.x=Math.max(0,Math.min(1,u/a)),i}function sE(s){return en(s)&&s.nodeType===3}function Xh(s){for(;s.firstChild;)s.removeChild(s.firstChild);return s}function aE(s){return typeof s=="function"&&(s=s()),(Array.isArray(s)?s:[s]).map(e=>{if(typeof e=="function"&&(e=e()),Oo(e)||sE(e))return e;if(typeof e=="string"&&/\S/.test(e))return ce.createTextNode(e)}).filter(e=>e)}function Hv(s,e){return aE(e).forEach(t=>s.appendChild(t)),s}function oE(s,e){return Hv(Xh(s),e)}function Xl(s){return s.button===void 0&&s.buttons===void 0||s.button===0&&s.buttons===void 0||s.type==="mouseup"&&s.button===0&&s.buttons===0||s.type==="mousedown"&&s.button===0&&s.buttons===0?!0:!(s.button!==0||s.buttons!==1)}const ls=Z1("querySelector"),lE=Z1("querySelectorAll");function To(s,e){if(!s||!e)return"";if(typeof O.getComputedStyle=="function"){let t;try{t=O.getComputedStyle(s)}catch{return""}return t?t.getPropertyValue(e)||t[e]:""}return""}function uE(s){[...ce.styleSheets].forEach(e=>{try{const t=[...e.cssRules].map(r=>r.cssText).join(""),i=ce.createElement("style");i.textContent=t,s.document.head.appendChild(i)}catch{const i=ce.createElement("link");i.rel="stylesheet",i.type=e.type,i.media=e.media.mediaText,i.href=e.href,s.document.head.appendChild(i)}})}var cE=Object.freeze({__proto__:null,isReal:Lo,isEl:Oo,isInFrame:J1,createEl:He,textContent:ds,prependTo:Pg,hasClass:Rl,addClass:Qs,removeClass:Wh,toggleClass:eE,setAttributes:tE,getAttributes:ns,getAttribute:iE,setAttribute:yo,removeAttribute:Gh,blockTextSelection:rE,unblockTextSelection:nE,getBoundingClientRect:_o,findPosition:Kl,getPointerPosition:Kh,isTextNode:sE,emptyEl:Xh,normalizeContent:aE,appendContent:Hv,insertContent:oE,isSingleLeftClick:Xl,$:ls,$$:lE,computedStyle:To,copyStyleSheetsToWindow:uE});let hE=!1,Dg;const TL=function(){if(Dg.options.autoSetup===!1)return;const s=Array.prototype.slice.call(ce.getElementsByTagName("video")),e=Array.prototype.slice.call(ce.getElementsByTagName("audio")),t=Array.prototype.slice.call(ce.getElementsByTagName("video-js")),i=s.concat(e,t);if(i&&i.length>0)for(let r=0,n=i.length;r<n;r++){const a=i[r];if(a&&a.getAttribute)a.player===void 0&&a.getAttribute("data-setup")!==null&&Dg(a);else{Ng(1);break}}else hE||Ng(1)};function Ng(s,e){Lo()&&(e&&(Dg=e),O.setTimeout(TL,s))}function Lg(){hE=!0,O.removeEventListener("load",Lg)}Lo()&&(ce.readyState==="complete"?Lg():O.addEventListener("load",Lg));const dE=function(s){const e=ce.createElement("style");return e.className=s,e},fE=function(s,e){s.styleSheet?s.styleSheet.cssText=e:s.textContent=e};var Ii=new WeakMap;const bL=3;let SL=bL;function yr(){return SL++}function E_(s,e){if(!Ii.has(s))return;const t=Ii.get(s);t.handlers[e].length===0&&(delete t.handlers[e],s.removeEventListener?s.removeEventListener(e,t.dispatcher,!1):s.detachEvent&&s.detachEvent("on"+e,t.dispatcher)),Object.getOwnPropertyNames(t.handlers).length<=0&&(delete t.handlers,delete t.dispatcher,delete t.disabled),Object.getOwnPropertyNames(t).length===0&&Ii.delete(s)}function zv(s,e,t,i){t.forEach(function(r){s(e,r,i)})}function Qh(s){if(s.fixed_)return s;function e(){return!0}function t(){return!1}if(!s||!s.isPropagationStopped||!s.isImmediatePropagationStopped){const i=s||O.event;s={};const r=["layerX","layerY","keyLocation","path","webkitMovementX","webkitMovementY","mozPressure","mozInputSource"];for(const n in i)r.includes(n)||n==="returnValue"&&i.preventDefault||(s[n]=i[n]);if(s.target||(s.target=s.srcElement||ce),s.relatedTarget||(s.relatedTarget=s.fromElement===s.target?s.toElement:s.fromElement),s.preventDefault=function(){i.preventDefault&&i.preventDefault(),s.returnValue=!1,i.returnValue=!1,s.defaultPrevented=!0},s.defaultPrevented=!1,s.stopPropagation=function(){i.stopPropagation&&i.stopPropagation(),s.cancelBubble=!0,i.cancelBubble=!0,s.isPropagationStopped=e},s.isPropagationStopped=t,s.stopImmediatePropagation=function(){i.stopImmediatePropagation&&i.stopImmediatePropagation(),s.isImmediatePropagationStopped=e,s.stopPropagation()},s.isImmediatePropagationStopped=t,s.clientX!==null&&s.clientX!==void 0){const n=ce.documentElement,a=ce.body;s.pageX=s.clientX+(n&&n.scrollLeft||a&&a.scrollLeft||0)-(n&&n.clientLeft||a&&a.clientLeft||0),s.pageY=s.clientY+(n&&n.scrollTop||a&&a.scrollTop||0)-(n&&n.clientTop||a&&a.clientTop||0)}s.which=s.charCode||s.keyCode,s.button!==null&&s.button!==void 0&&(s.button=s.button&1?0:s.button&4?1:s.button&2?2:0)}return s.fixed_=!0,s}let rc;const xL=function(){if(typeof rc!="boolean"){rc=!1;try{const s=Object.defineProperty({},"passive",{get(){rc=!0}});O.addEventListener("test",null,s),O.removeEventListener("test",null,s)}catch{}}return rc},CL=["touchstart","touchmove"];function sr(s,e,t){if(Array.isArray(e))return zv(sr,s,e,t);Ii.has(s)||Ii.set(s,{});const i=Ii.get(s);if(i.handlers||(i.handlers={}),i.handlers[e]||(i.handlers[e]=[]),t.guid||(t.guid=yr()),i.handlers[e].push(t),i.dispatcher||(i.disabled=!1,i.dispatcher=function(r,n){if(i.disabled)return;r=Qh(r);const a=i.handlers[r.type];if(a){const o=a.slice(0);for(let l=0,u=o.length;l<u&&!r.isImmediatePropagationStopped();l++)try{o[l].call(s,r,n)}catch(c){et.error(c)}}}),i.handlers[e].length===1)if(s.addEventListener){let r=!1;xL()&&CL.indexOf(e)>-1&&(r={passive:!0}),s.addEventListener(e,i.dispatcher,r)}else s.attachEvent&&s.attachEvent("on"+e,i.dispatcher)}function yi(s,e,t){if(!Ii.has(s))return;const i=Ii.get(s);if(!i.handlers)return;if(Array.isArray(e))return zv(yi,s,e,t);const r=function(a,o){i.handlers[o]=[],E_(a,o)};if(e===void 0){for(const a in i.handlers)Object.prototype.hasOwnProperty.call(i.handlers||{},a)&&r(s,a);return}const n=i.handlers[e];if(n){if(!t){r(s,e);return}if(t.guid)for(let a=0;a<n.length;a++)n[a].guid===t.guid&&n.splice(a--,1);E_(s,e)}}function Mo(s,e,t){const i=Ii.has(s)?Ii.get(s):{},r=s.parentNode||s.ownerDocument;if(typeof e=="string"?e={type:e,target:s}:e.target||(e.target=s),e=Qh(e),i.dispatcher&&i.dispatcher.call(s,e,t),r&&!e.isPropagationStopped()&&e.bubbles===!0)Mo.call(null,r,e,t);else if(!r&&!e.defaultPrevented&&e.target&&e.target[e.type]){Ii.has(e.target)||Ii.set(e.target,{});const n=Ii.get(e.target);e.target[e.type]&&(n.disabled=!0,typeof e.target[e.type]=="function"&&e.target[e.type](),n.disabled=!1)}return!e.defaultPrevented}function Yh(s,e,t){if(Array.isArray(e))return zv(Yh,s,e,t);const i=function(){yi(s,e,i),t.apply(this,arguments)};i.guid=t.guid=t.guid||yr(),sr(s,e,i)}function Wv(s,e,t){const i=function(){yi(s,e,i),t.apply(this,arguments)};i.guid=t.guid=t.guid||yr(),sr(s,e,i)}var EL=Object.freeze({__proto__:null,fixEvent:Qh,on:sr,off:yi,trigger:Mo,one:Yh,any:Wv});const _r=30,St=function(s,e,t){e.guid||(e.guid=yr());const i=e.bind(s);return i.guid=t?t+"_"+e.guid:e.guid,i},nn=function(s,e){let t=O.performance.now();return function(...r){const n=O.performance.now();n-t>=e&&(s(...r),t=n)}},pE=function(s,e,t,i=O){let r;const n=()=>{i.clearTimeout(r),r=null},a=function(){const o=this,l=arguments;let u=function(){r=null,u=null,t||s.apply(o,l)};!r&&t&&s.apply(o,l),i.clearTimeout(r),r=i.setTimeout(u,e)};return a.cancel=n,a};var wL=Object.freeze({__proto__:null,UPDATE_REFRESH_INTERVAL:_r,bind_:St,throttle:nn,debounce:pE});let gl,ar=class{on(e,t){const i=this.addEventListener;this.addEventListener=()=>{},sr(this,e,t),this.addEventListener=i}off(e,t){yi(this,e,t)}one(e,t){const i=this.addEventListener;this.addEventListener=()=>{},Yh(this,e,t),this.addEventListener=i}any(e,t){const i=this.addEventListener;this.addEventListener=()=>{},Wv(this,e,t),this.addEventListener=i}trigger(e){const t=e.type||e;typeof e=="string"&&(e={type:t}),e=Qh(e),this.allowedEvents_[t]&&this["on"+t]&&this["on"+t](e),Mo(this,e)}queueTrigger(e){gl||(gl=new Map);const t=e.type||e;let i=gl.get(this);i||(i=new Map,gl.set(this,i));const r=i.get(t);i.delete(t),O.clearTimeout(r);const n=O.setTimeout(()=>{i.delete(t),i.size===0&&(i=null,gl.delete(this)),this.trigger(e)},0);i.set(t,n)}};ar.prototype.allowedEvents_={};ar.prototype.addEventListener=ar.prototype.on;ar.prototype.removeEventListener=ar.prototype.off;ar.prototype.dispatchEvent=ar.prototype.trigger;const Jh=s=>typeof s.name=="function"?s.name():typeof s.name=="string"?s.name:s.name_?s.name_:s.constructor&&s.constructor.name?s.constructor.name:typeof s,In=s=>s instanceof ar||!!s.eventBusEl_&&["on","one","off","trigger"].every(e=>typeof s[e]=="function"),kL=(s,e)=>{In(s)?e():(s.eventedCallbacks||(s.eventedCallbacks=[]),s.eventedCallbacks.push(e))},Og=s=>typeof s=="string"&&/\S/.test(s)||Array.isArray(s)&&!!s.length,Kc=(s,e,t)=>{if(!s||!s.nodeName&&!In(s))throw new Error(`Invalid target for ${Jh(e)}#${t}; must be a DOM node or evented object.`)},mE=(s,e,t)=>{if(!Og(s))throw new Error(`Invalid event type for ${Jh(e)}#${t}; must be a non-empty string or array.`)},gE=(s,e,t)=>{if(typeof s!="function")throw new Error(`Invalid listener for ${Jh(e)}#${t}; must be a function.`)},Af=(s,e,t)=>{const i=e.length<3||e[0]===s||e[0]===s.eventBusEl_;let r,n,a;return i?(r=s.eventBusEl_,e.length>=3&&e.shift(),[n,a]=e):(r=e[0],n=e[1],a=e[2]),Kc(r,s,t),mE(n,s,t),gE(a,s,t),a=St(s,a),{isTargetingSelf:i,target:r,type:n,listener:a}},Os=(s,e,t,i)=>{Kc(s,s,e),s.nodeName?EL[e](s,t,i):s[e](t,i)},AL={on(...s){const{isTargetingSelf:e,target:t,type:i,listener:r}=Af(this,s,"on");if(Os(t,"on",i,r),!e){const n=()=>this.off(t,i,r);n.guid=r.guid;const a=()=>this.off("dispose",n);a.guid=r.guid,Os(this,"on","dispose",n),Os(t,"on","dispose",a)}},one(...s){const{isTargetingSelf:e,target:t,type:i,listener:r}=Af(this,s,"one");if(e)Os(t,"one",i,r);else{const n=(...a)=>{this.off(t,i,n),r.apply(null,a)};n.guid=r.guid,Os(t,"one",i,n)}},any(...s){const{isTargetingSelf:e,target:t,type:i,listener:r}=Af(this,s,"any");if(e)Os(t,"any",i,r);else{const n=(...a)=>{this.off(t,i,n),r.apply(null,a)};n.guid=r.guid,Os(t,"any",i,n)}},off(s,e,t){if(!s||Og(s))yi(this.eventBusEl_,s,e);else{const i=s,r=e;Kc(i,this,"off"),mE(r,this,"off"),gE(t,this,"off"),t=St(this,t),this.off("dispose",t),i.nodeName?(yi(i,r,t),yi(i,"dispose",t)):In(i)&&(i.off(r,t),i.off("dispose",t))}},trigger(s,e){Kc(this.eventBusEl_,this,"trigger");const t=s&&typeof s!="string"?s.type:s;if(!Og(t))throw new Error(`Invalid event type for ${Jh(this)}#trigger; must be a non-empty string or object with a type key that has a non-empty value.`);return Mo(this.eventBusEl_,s,e)}};function Gv(s,e={}){const{eventBusKey:t}=e;if(t){if(!s[t].nodeName)throw new Error(`The eventBusKey "${t}" does not refer to an element.`);s.eventBusEl_=s[t]}else s.eventBusEl_=He("span",{className:"vjs-event-bus"});return Object.assign(s,AL),s.eventedCallbacks&&s.eventedCallbacks.forEach(i=>{i()}),s.on("dispose",()=>{s.off(),[s,s.el_,s.eventBusEl_].forEach(function(i){i&&Ii.has(i)&&Ii.delete(i)}),O.setTimeout(()=>{s.eventBusEl_=null},0)}),s}const IL={state:{},setState(s){typeof s=="function"&&(s=s());let e;return Za(s,(t,i)=>{this.state[i]!==t&&(e=e||{},e[i]={from:this.state[i],to:t}),this.state[i]=t}),e&&In(this)&&this.trigger({changes:e,type:"statechanged"}),e}};function vE(s,e){return Object.assign(s,IL),s.state=Object.assign({},s.state,e),typeof s.handleStateChanged=="function"&&In(s)&&s.on("statechanged",s.handleStateChanged),s}const Fl=function(s){return typeof s!="string"?s:s.replace(/./,e=>e.toLowerCase())},qt=function(s){return typeof s!="string"?s:s.replace(/./,e=>e.toUpperCase())},yE=function(s,e){return qt(s)===qt(e)};var PL=Object.freeze({__proto__:null,toLowerCase:Fl,toTitleCase:qt,titleCaseEquals:yE});let _e=class Bi{constructor(e,t,i){if(!e&&this.play?this.player_=e=this:this.player_=e,this.isDisposed_=!1,this.parentComponent_=null,this.options_=gt({},this.options_),t=this.options_=gt(this.options_,t),this.id_=t.id||t.el&&t.el.id,!this.id_){const r=e&&e.id&&e.id()||"no_player";this.id_=`${r}_component_${yr()}`}this.name_=t.name||null,t.el?this.el_=t.el:t.createEl!==!1&&(this.el_=this.createEl()),t.className&&this.el_&&t.className.split(" ").forEach(r=>this.addClass(r)),["on","off","one","any","trigger"].forEach(r=>{this[r]=void 0}),t.evented!==!1&&(Gv(this,{eventBusKey:this.el_?"el_":null}),this.handleLanguagechange=this.handleLanguagechange.bind(this),this.on(this.player_,"languagechange",this.handleLanguagechange)),vE(this,this.constructor.defaultState),this.children_=[],this.childIndex_={},this.childNameIndex_={},this.setTimeoutIds_=new Set,this.setIntervalIds_=new Set,this.rafIds_=new Set,this.namedRafs_=new Map,this.clearingTimersOnDispose_=!1,t.initChildren!==!1&&this.initChildren(),this.ready(i),t.reportTouchActivity!==!1&&this.enableTouchActivity()}dispose(e={}){if(!this.isDisposed_){if(this.readyQueue_&&(this.readyQueue_.length=0),this.trigger({type:"dispose",bubbles:!1}),this.isDisposed_=!0,this.children_)for(let t=this.children_.length-1;t>=0;t--)this.children_[t].dispose&&this.children_[t].dispose();this.children_=null,this.childIndex_=null,this.childNameIndex_=null,this.parentComponent_=null,this.el_&&(this.el_.parentNode&&(e.restoreEl?this.el_.parentNode.replaceChild(e.restoreEl,this.el_):this.el_.parentNode.removeChild(this.el_)),this.el_=null),this.player_=null}}isDisposed(){return!!this.isDisposed_}player(){return this.player_}options(e){return e?(this.options_=gt(this.options_,e),this.options_):this.options_}el(){return this.el_}createEl(e,t,i){return He(e,t,i)}localize(e,t,i=e){const r=this.player_.language&&this.player_.language(),n=this.player_.languages&&this.player_.languages(),a=n&&n[r],o=r&&r.split("-")[0],l=n&&n[o];let u=i;return a&&a[e]?u=a[e]:l&&l[e]&&(u=l[e]),t&&(u=u.replace(/\{(\d+)\}/g,function(c,h){const d=t[h-1];let g=d;return typeof d>"u"&&(g=c),g})),u}handleLanguagechange(){}contentEl(){return this.contentEl_||this.el_}id(){return this.id_}name(){return this.name_}children(){return this.children_}getChildById(e){return this.childIndex_[e]}getChild(e){if(e)return this.childNameIndex_[e]}getDescendant(...e){e=e.reduce((i,r)=>i.concat(r),[]);let t=this;for(let i=0;i<e.length;i++)if(t=t.getChild(e[i]),!t||!t.getChild)return;return t}setIcon(e,t=this.el()){if(!this.player_.options_.experimentalSvgIcons)return;const i="http://www.w3.org/2000/svg",r=He("span",{className:"vjs-icon-placeholder vjs-svg-icon"},{"aria-hidden":"true"}),n=ce.createElementNS(i,"svg");n.setAttributeNS(null,"viewBox","0 0 512 512");const a=ce.createElementNS(i,"use");return n.appendChild(a),a.setAttributeNS(null,"href",`#vjs-icon-${e}`),r.appendChild(n),this.iconIsSet_?t.replaceChild(r,t.querySelector(".vjs-icon-placeholder")):t.appendChild(r),this.iconIsSet_=!0,r}addChild(e,t={},i=this.children_.length){let r,n;if(typeof e=="string"){n=qt(e);const a=t.componentClass||n;t.name=n;const o=Bi.getComponent(a);if(!o)throw new Error(`Component ${a} does not exist`);if(typeof o!="function")return null;r=new o(this.player_||this,t)}else r=e;if(r.parentComponent_&&r.parentComponent_.removeChild(r),this.children_.splice(i,0,r),r.parentComponent_=this,typeof r.id=="function"&&(this.childIndex_[r.id()]=r),n=n||r.name&&qt(r.name()),n&&(this.childNameIndex_[n]=r,this.childNameIndex_[Fl(n)]=r),typeof r.el=="function"&&r.el()){let a=null;this.children_[i+1]&&(this.children_[i+1].el_?a=this.children_[i+1].el_:Oo(this.children_[i+1])&&(a=this.children_[i+1])),this.contentEl().insertBefore(r.el(),a)}return r}removeChild(e){if(typeof e=="string"&&(e=this.getChild(e)),!e||!this.children_)return;let t=!1;for(let r=this.children_.length-1;r>=0;r--)if(this.children_[r]===e){t=!0,this.children_.splice(r,1);break}if(!t)return;e.parentComponent_=null,this.childIndex_[e.id()]=null,this.childNameIndex_[qt(e.name())]=null,this.childNameIndex_[Fl(e.name())]=null;const i=e.el();i&&i.parentNode===this.contentEl()&&this.contentEl().removeChild(e.el())}initChildren(){const e=this.options_.children;if(e){const t=this.options_,i=a=>{const o=a.name;let l=a.opts;if(t[o]!==void 0&&(l=t[o]),l===!1)return;l===!0&&(l={}),l.playerOptions=this.options_.playerOptions;const u=this.addChild(o,l);u&&(this[o]=u)};let r;const n=Bi.getComponent("Tech");Array.isArray(e)?r=e:r=Object.keys(e),r.concat(Object.keys(this.options_).filter(function(a){return!r.some(function(o){return typeof o=="string"?a===o:a===o.name})})).map(a=>{let o,l;return typeof a=="string"?(o=a,l=e[o]||this.options_[o]||{}):(o=a.name,l=a),{name:o,opts:l}}).filter(a=>{const o=Bi.getComponent(a.opts.componentClass||qt(a.name));return o&&!n.isTech(o)}).forEach(i)}}buildCSSClass(){return""}ready(e,t=!1){if(e){if(!this.isReady_){this.readyQueue_=this.readyQueue_||[],this.readyQueue_.push(e);return}t?e.call(this):this.setTimeout(e,1)}}triggerReady(){this.isReady_=!0,this.setTimeout(function(){const e=this.readyQueue_;this.readyQueue_=[],e&&e.length>0&&e.forEach(function(t){t.call(this)},this),this.trigger("ready")},1)}$(e,t){return ls(e,t||this.contentEl())}$$(e,t){return lE(e,t||this.contentEl())}hasClass(e){return Rl(this.el_,e)}addClass(...e){Qs(this.el_,...e)}removeClass(...e){Wh(this.el_,...e)}toggleClass(e,t){eE(this.el_,e,t)}show(){this.removeClass("vjs-hidden")}hide(){this.addClass("vjs-hidden")}lockShowing(){this.addClass("vjs-lock-showing")}unlockShowing(){this.removeClass("vjs-lock-showing")}getAttribute(e){return iE(this.el_,e)}setAttribute(e,t){yo(this.el_,e,t)}removeAttribute(e){Gh(this.el_,e)}width(e,t){return this.dimension("width",e,t)}height(e,t){return this.dimension("height",e,t)}dimensions(e,t){this.width(e,!0),this.height(t)}dimension(e,t,i){if(t!==void 0){(t===null||t!==t)&&(t=0),(""+t).indexOf("%")!==-1||(""+t).indexOf("px")!==-1?this.el_.style[e]=t:t==="auto"?this.el_.style[e]="":this.el_.style[e]=t+"px",i||this.trigger("componentresize");return}if(!this.el_)return 0;const r=this.el_.style[e],n=r.indexOf("px");return parseInt(n!==-1?r.slice(0,n):this.el_["offset"+qt(e)],10)}currentDimension(e){let t=0;if(e!=="width"&&e!=="height")throw new Error("currentDimension only accepts width or height value");if(t=To(this.el_,e),t=parseFloat(t),t===0||isNaN(t)){const i=`offset${qt(e)}`;t=this.el_[i]}return t}currentDimensions(){return{width:this.currentDimension("width"),height:this.currentDimension("height")}}currentWidth(){return this.currentDimension("width")}currentHeight(){return this.currentDimension("height")}getPositions(){const e=this.el_.getBoundingClientRect(),t={x:e.x,y:e.y,width:e.width,height:e.height,top:e.top,right:e.right,bottom:e.bottom,left:e.left},i={x:e.left+e.width/2,y:e.top+e.height/2,width:0,height:0,top:e.top+e.height/2,right:e.left+e.width/2,bottom:e.top+e.height/2,left:e.left+e.width/2};return{boundingClientRect:t,center:i}}focus(){this.el_.focus()}blur(){this.el_.blur()}handleKeyDown(e){this.player_&&(e.key!=="Tab"&&!(this.player_.options_.playerOptions.spatialNavigation&&this.player_.options_.playerOptions.spatialNavigation.enabled)&&e.stopPropagation(),this.player_.handleKeyDown(e))}handleKeyPress(e){this.handleKeyDown(e)}emitTapEvents(){let e=0,t=null;const i=10,r=200;let n;this.on("touchstart",function(o){o.touches.length===1&&(t={pageX:o.touches[0].pageX,pageY:o.touches[0].pageY},e=O.performance.now(),n=!0)}),this.on("touchmove",function(o){if(o.touches.length>1)n=!1;else if(t){const l=o.touches[0].pageX-t.pageX,u=o.touches[0].pageY-t.pageY;Math.sqrt(l*l+u*u)>i&&(n=!1)}});const a=function(){n=!1};this.on("touchleave",a),this.on("touchcancel",a),this.on("touchend",function(o){t=null,n===!0&&O.performance.now()-e<r&&(o.preventDefault(),this.trigger("tap"))})}enableTouchActivity(){if(!this.player()||!this.player().reportUserActivity)return;const e=St(this.player(),this.player().reportUserActivity);let t;this.on("touchstart",function(){e(),this.clearInterval(t),t=this.setInterval(e,250)});const i=function(r){e(),this.clearInterval(t)};this.on("touchmove",e),this.on("touchend",i),this.on("touchcancel",i)}setTimeout(e,t){var i;return e=St(this,e),this.clearTimersOnDispose_(),i=O.setTimeout(()=>{this.setTimeoutIds_.has(i)&&this.setTimeoutIds_.delete(i),e()},t),this.setTimeoutIds_.add(i),i}clearTimeout(e){return this.setTimeoutIds_.has(e)&&(this.setTimeoutIds_.delete(e),O.clearTimeout(e)),e}setInterval(e,t){e=St(this,e),this.clearTimersOnDispose_();const i=O.setInterval(e,t);return this.setIntervalIds_.add(i),i}clearInterval(e){return this.setIntervalIds_.has(e)&&(this.setIntervalIds_.delete(e),O.clearInterval(e)),e}requestAnimationFrame(e){this.clearTimersOnDispose_();var t;return e=St(this,e),t=O.requestAnimationFrame(()=>{this.rafIds_.has(t)&&this.rafIds_.delete(t),e()}),this.rafIds_.add(t),t}requestNamedAnimationFrame(e,t){this.namedRafs_.has(e)&&this.cancelNamedAnimationFrame(e),this.clearTimersOnDispose_(),t=St(this,t);const i=this.requestAnimationFrame(()=>{t(),this.namedRafs_.has(e)&&this.namedRafs_.delete(e)});return this.namedRafs_.set(e,i),e}cancelNamedAnimationFrame(e){this.namedRafs_.has(e)&&(this.cancelAnimationFrame(this.namedRafs_.get(e)),this.namedRafs_.delete(e))}cancelAnimationFrame(e){return this.rafIds_.has(e)&&(this.rafIds_.delete(e),O.cancelAnimationFrame(e)),e}clearTimersOnDispose_(){this.clearingTimersOnDispose_||(this.clearingTimersOnDispose_=!0,this.one("dispose",()=>{[["namedRafs_","cancelNamedAnimationFrame"],["rafIds_","cancelAnimationFrame"],["setTimeoutIds_","clearTimeout"],["setIntervalIds_","clearInterval"]].forEach(([e,t])=>{this[e].forEach((i,r)=>this[t](r))}),this.clearingTimersOnDispose_=!1}))}getIsDisabled(){return!!this.el_.disabled}getIsExpresslyInert(){return this.el_.inert&&!this.el_.ownerDocument.documentElement.inert}getIsFocusable(e){return(e||this.el_).tabIndex>=0&&!(this.getIsDisabled()||this.getIsExpresslyInert())}getIsAvailableToBeFocused(e){function t(n){const a=O.getComputedStyle(n,null),o=a.getPropertyValue("visibility");return a.getPropertyValue("display")!=="none"&&!["hidden","collapse"].includes(o)}function i(n){return!(!t(n.parentElement)||!t(n)||n.style.opacity==="0"||O.getComputedStyle(n).height==="0px"||O.getComputedStyle(n).width==="0px")}function r(n){if(n.offsetWidth+n.offsetHeight+n.getBoundingClientRect().height+n.getBoundingClientRect().width===0)return!1;const a={x:n.getBoundingClientRect().left+n.offsetWidth/2,y:n.getBoundingClientRect().top+n.offsetHeight/2};if(a.x<0||a.x>(ce.documentElement.clientWidth||O.innerWidth)||a.y<0||a.y>(ce.documentElement.clientHeight||O.innerHeight))return!1;let o=ce.elementFromPoint(a.x,a.y);for(;o;){if(o===n)return!0;if(o.parentNode)o=o.parentNode;else return!1}}return e||(e=this.el()),!!(r(e)&&i(e)&&(!e.parentElement||e.tabIndex>=0))}static registerComponent(e,t){if(typeof e!="string"||!e)throw new Error(`Illegal component name, "${e}"; must be a non-empty string.`);const i=Bi.getComponent("Tech"),r=i&&i.isTech(t),n=Bi===t||Bi.prototype.isPrototypeOf(t.prototype);if(r||!n){let o;throw r?o="techs must be registered using Tech.registerTech()":o="must be a Component subclass",new Error(`Illegal component, "${e}"; ${o}.`)}e=qt(e),Bi.components_||(Bi.components_={});const a=Bi.getComponent("Player");if(e==="Player"&&a&&a.players){const o=a.players,l=Object.keys(o);if(o&&l.length>0&&l.map(u=>o[u]).every(Boolean))throw new Error("Can not register Player component after player has been created.")}return Bi.components_[e]=t,Bi.components_[Fl(e)]=t,t}static getComponent(e){if(!(!e||!Bi.components_))return Bi.components_[e]}};_e.registerComponent("Component",_e);function DL(s,e,t){if(typeof e!="number"||e<0||e>t)throw new Error(`Failed to execute '${s}' on 'TimeRanges': The index provided (${e}) is non-numeric or out of bounds (0-${t}).`)}function w_(s,e,t,i){return DL(s,i,t.length-1),t[i][e]}function If(s){let e;return s===void 0||s.length===0?e={length:0,start(){throw new Error("This TimeRanges object is empty")},end(){throw new Error("This TimeRanges object is empty")}}:e={length:s.length,start:w_.bind(null,"start",0,s),end:w_.bind(null,"end",1,s)},O.Symbol&&O.Symbol.iterator&&(e[O.Symbol.iterator]=()=>(s||[]).values()),e}function Dr(s,e){return Array.isArray(s)?If(s):s===void 0||e===void 0?If():If([[s,e]])}const _E=function(s,e){s=s<0?0:s;let t=Math.floor(s%60),i=Math.floor(s/60%60),r=Math.floor(s/3600);const n=Math.floor(e/60%60),a=Math.floor(e/3600);return(isNaN(s)||s===1/0)&&(r=i=t="-"),r=r>0||a>0?r+":":"",i=((r||n>=10)&&i<10?"0"+i:i)+":",t=t<10?"0"+t:t,r+i+t};let Kv=_E;function TE(s){Kv=s}function bE(){Kv=_E}function oa(s,e=s){return Kv(s,e)}var NL=Object.freeze({__proto__:null,createTimeRanges:Dr,createTimeRange:Dr,setFormatTime:TE,resetFormatTime:bE,formatTime:oa});function SE(s,e){let t=0,i,r;if(!e)return 0;(!s||!s.length)&&(s=Dr(0,0));for(let n=0;n<s.length;n++)i=s.start(n),r=s.end(n),r>e&&(r=e),t+=r-i;return t/e}function Rt(s){if(s instanceof Rt)return s;typeof s=="number"?this.code=s:typeof s=="string"?this.message=s:en(s)&&(typeof s.code=="number"&&(this.code=s.code),Object.assign(this,s)),this.message||(this.message=Rt.defaultMessages[this.code]||"")}Rt.prototype.code=0;Rt.prototype.message="";Rt.prototype.status=null;Rt.prototype.metadata=null;Rt.errorTypes=["MEDIA_ERR_CUSTOM","MEDIA_ERR_ABORTED","MEDIA_ERR_NETWORK","MEDIA_ERR_DECODE","MEDIA_ERR_SRC_NOT_SUPPORTED","MEDIA_ERR_ENCRYPTED"];Rt.defaultMessages={1:"You aborted the media playback",2:"A network error caused the media download to fail part-way.",3:"The media playback was aborted due to a corruption problem or because the media used features your browser did not support.",4:"The media could not be loaded, either because the server or network failed or because the format is not supported.",5:"The media is encrypted and we do not have the keys to decrypt it."};Rt.MEDIA_ERR_CUSTOM=0;Rt.prototype.MEDIA_ERR_CUSTOM=0;Rt.MEDIA_ERR_ABORTED=1;Rt.prototype.MEDIA_ERR_ABORTED=1;Rt.MEDIA_ERR_NETWORK=2;Rt.prototype.MEDIA_ERR_NETWORK=2;Rt.MEDIA_ERR_DECODE=3;Rt.prototype.MEDIA_ERR_DECODE=3;Rt.MEDIA_ERR_SRC_NOT_SUPPORTED=4;Rt.prototype.MEDIA_ERR_SRC_NOT_SUPPORTED=4;Rt.MEDIA_ERR_ENCRYPTED=5;Rt.prototype.MEDIA_ERR_ENCRYPTED=5;function Bl(s){return s!=null&&typeof s.then=="function"}function Gr(s){Bl(s)&&s.then(null,e=>{})}const Mg=function(s){return["kind","label","language","id","inBandMetadataTrackDispatchType","mode","src"].reduce((t,i,r)=>(s[i]&&(t[i]=s[i]),t),{cues:s.cues&&Array.prototype.map.call(s.cues,function(t){return{startTime:t.startTime,endTime:t.endTime,text:t.text,id:t.id}})})},LL=function(s){const e=s.$$("track"),t=Array.prototype.map.call(e,r=>r.track);return Array.prototype.map.call(e,function(r){const n=Mg(r.track);return r.src&&(n.src=r.src),n}).concat(Array.prototype.filter.call(s.textTracks(),function(r){return t.indexOf(r)===-1}).map(Mg))},OL=function(s,e){return s.forEach(function(t){const i=e.addRemoteTextTrack(t).track;!t.src&&t.cues&&t.cues.forEach(r=>i.addCue(r))}),e.textTracks()};var k_={textTracksToJson:LL,jsonToTextTracks:OL,trackToJson_:Mg};const Pf="vjs-modal-dialog";let Ro=class extends _e{constructor(e,t){super(e,t),this.handleKeyDown_=i=>this.handleKeyDown(i),this.close_=i=>this.close(i),this.opened_=this.hasBeenOpened_=this.hasBeenFilled_=!1,this.closeable(!this.options_.uncloseable),this.content(this.options_.content),this.contentEl_=He("div",{className:`${Pf}-content`},{role:"document"}),this.descEl_=He("p",{className:`${Pf}-description vjs-control-text`,id:this.el().getAttribute("aria-describedby")}),ds(this.descEl_,this.description()),this.el_.appendChild(this.descEl_),this.el_.appendChild(this.contentEl_)}createEl(){return super.createEl("div",{className:this.buildCSSClass(),tabIndex:-1},{"aria-describedby":`${this.id()}_description`,"aria-hidden":"true","aria-label":this.label(),role:"dialog","aria-live":"polite"})}dispose(){this.contentEl_=null,this.descEl_=null,this.previouslyActiveEl_=null,super.dispose()}buildCSSClass(){return`${Pf} vjs-hidden ${super.buildCSSClass()}`}label(){return this.localize(this.options_.label||"Modal Window")}description(){let e=this.options_.description||this.localize("This is a modal window.");return this.closeable()&&(e+=" "+this.localize("This modal can be closed by pressing the Escape key or activating the close button.")),e}open(){if(this.opened_){this.options_.fillAlways&&this.fill();return}const e=this.player();this.trigger("beforemodalopen"),this.opened_=!0,(this.options_.fillAlways||!this.hasBeenOpened_&&!this.hasBeenFilled_)&&this.fill(),this.wasPlaying_=!e.paused(),this.options_.pauseOnOpen&&this.wasPlaying_&&e.pause(),this.on("keydown",this.handleKeyDown_),this.hadControls_=e.controls(),e.controls(!1),this.show(),this.conditionalFocus_(),this.el().setAttribute("aria-hidden","false"),this.trigger("modalopen"),this.hasBeenOpened_=!0}opened(e){return typeof e=="boolean"&&this[e?"open":"close"](),this.opened_}close(){if(!this.opened_)return;const e=this.player();this.trigger("beforemodalclose"),this.opened_=!1,this.wasPlaying_&&this.options_.pauseOnOpen&&e.play(),this.off("keydown",this.handleKeyDown_),this.hadControls_&&e.controls(!0),this.hide(),this.el().setAttribute("aria-hidden","true"),this.trigger({type:"modalclose",bubbles:!0}),this.conditionalBlur_(),this.options_.temporary&&this.dispose()}closeable(e){if(typeof e=="boolean"){const t=this.closeable_=!!e;let i=this.getChild("closeButton");if(t&&!i){const r=this.contentEl_;this.contentEl_=this.el_,i=this.addChild("closeButton",{controlText:"Close Modal Dialog"}),this.contentEl_=r,this.on(i,"close",this.close_)}!t&&i&&(this.off(i,"close",this.close_),this.removeChild(i),i.dispose())}return this.closeable_}fill(){this.fillWith(this.content())}fillWith(e){const t=this.contentEl(),i=t.parentNode,r=t.nextSibling;this.trigger("beforemodalfill"),this.hasBeenFilled_=!0,i.removeChild(t),this.empty(),oE(t,e),this.trigger("modalfill"),r?i.insertBefore(t,r):i.appendChild(t);const n=this.getChild("closeButton");n&&i.appendChild(n.el_),this.trigger("aftermodalfill")}empty(){this.trigger("beforemodalempty"),Xh(this.contentEl()),this.trigger("modalempty")}content(e){return typeof e<"u"&&(this.content_=e),this.content_}conditionalFocus_(){const e=ce.activeElement,t=this.player_.el_;this.previouslyActiveEl_=null,(t.contains(e)||t===e)&&(this.previouslyActiveEl_=e,this.focus())}conditionalBlur_(){this.previouslyActiveEl_&&(this.previouslyActiveEl_.focus(),this.previouslyActiveEl_=null)}handleKeyDown(e){if(this.trigger({type:"modalKeydown",originalEvent:e,target:this,bubbles:!0}),e.stopPropagation(),e.key==="Escape"&&this.closeable()){e.preventDefault(),this.close();return}if(e.key!=="Tab")return;const t=this.focusableEls_(),i=this.el_.querySelector(":focus");let r;for(let n=0;n<t.length;n++)if(i===t[n]){r=n;break}ce.activeElement===this.el_&&(r=0),e.shiftKey&&r===0?(t[t.length-1].focus(),e.preventDefault()):!e.shiftKey&&r===t.length-1&&(t[0].focus(),e.preventDefault())}focusableEls_(){const e=this.el_.querySelectorAll("*");return Array.prototype.filter.call(e,t=>(t instanceof O.HTMLAnchorElement||t instanceof O.HTMLAreaElement)&&t.hasAttribute("href")||(t instanceof O.HTMLInputElement||t instanceof O.HTMLSelectElement||t instanceof O.HTMLTextAreaElement||t instanceof O.HTMLButtonElement)&&!t.hasAttribute("disabled")||t instanceof O.HTMLIFrameElement||t instanceof O.HTMLObjectElement||t instanceof O.HTMLEmbedElement||t.hasAttribute("tabindex")&&t.getAttribute("tabindex")!==-1||t.hasAttribute("contenteditable"))}};Ro.prototype.options_={pauseOnOpen:!0,temporary:!0};_e.registerComponent("ModalDialog",Ro);let bo=class extends ar{constructor(e=[]){super(),this.tracks_=[],Object.defineProperty(this,"length",{get(){return this.tracks_.length}});for(let t=0;t<e.length;t++)this.addTrack(e[t])}addTrack(e){const t=this.tracks_.length;""+t in this||Object.defineProperty(this,t,{get(){return this.tracks_[t]}}),this.tracks_.indexOf(e)===-1&&(this.tracks_.push(e),this.trigger({track:e,type:"addtrack",target:this})),e.labelchange_=()=>{this.trigger({track:e,type:"labelchange",target:this})},In(e)&&e.addEventListener("labelchange",e.labelchange_)}removeTrack(e){let t;for(let i=0,r=this.length;i<r;i++)if(this[i]===e){t=this[i],t.off&&t.off(),this.tracks_.splice(i,1);break}t&&this.trigger({track:t,type:"removetrack",target:this})}getTrackById(e){let t=null;for(let i=0,r=this.length;i<r;i++){const n=this[i];if(n.id===e){t=n;break}}return t}};bo.prototype.allowedEvents_={change:"change",addtrack:"addtrack",removetrack:"removetrack",labelchange:"labelchange"};for(const s in bo.prototype.allowedEvents_)bo.prototype["on"+s]=null;const Df=function(s,e){for(let t=0;t<s.length;t++)!Object.keys(s[t]).length||e.id===s[t].id||(s[t].enabled=!1)};let ML=class extends bo{constructor(e=[]){for(let t=e.length-1;t>=0;t--)if(e[t].enabled){Df(e,e[t]);break}super(e),this.changing_=!1}addTrack(e){e.enabled&&Df(this,e),super.addTrack(e),e.addEventListener&&(e.enabledChange_=()=>{this.changing_||(this.changing_=!0,Df(this,e),this.changing_=!1,this.trigger("change"))},e.addEventListener("enabledchange",e.enabledChange_))}removeTrack(e){super.removeTrack(e),e.removeEventListener&&e.enabledChange_&&(e.removeEventListener("enabledchange",e.enabledChange_),e.enabledChange_=null)}};const Nf=function(s,e){for(let t=0;t<s.length;t++)!Object.keys(s[t]).length||e.id===s[t].id||(s[t].selected=!1)};let RL=class extends bo{constructor(e=[]){for(let t=e.length-1;t>=0;t--)if(e[t].selected){Nf(e,e[t]);break}super(e),this.changing_=!1,Object.defineProperty(this,"selectedIndex",{get(){for(let t=0;t<this.length;t++)if(this[t].selected)return t;return-1},set(){}})}addTrack(e){e.selected&&Nf(this,e),super.addTrack(e),e.addEventListener&&(e.selectedChange_=()=>{this.changing_||(this.changing_=!0,Nf(this,e),this.changing_=!1,this.trigger("change"))},e.addEventListener("selectedchange",e.selectedChange_))}removeTrack(e){super.removeTrack(e),e.removeEventListener&&e.selectedChange_&&(e.removeEventListener("selectedchange",e.selectedChange_),e.selectedChange_=null)}},xE=class extends bo{addTrack(e){super.addTrack(e),this.queueChange_||(this.queueChange_=()=>this.queueTrigger("change")),this.triggerSelectedlanguagechange||(this.triggerSelectedlanguagechange_=()=>this.trigger("selectedlanguagechange")),e.addEventListener("modechange",this.queueChange_),["metadata","chapters"].indexOf(e.kind)===-1&&e.addEventListener("modechange",this.triggerSelectedlanguagechange_)}removeTrack(e){super.removeTrack(e),e.removeEventListener&&(this.queueChange_&&e.removeEventListener("modechange",this.queueChange_),this.selectedlanguagechange_&&e.removeEventListener("modechange",this.triggerSelectedlanguagechange_))}},FL=class{constructor(e=[]){this.trackElements_=[],Object.defineProperty(this,"length",{get(){return this.trackElements_.length}});for(let t=0,i=e.length;t<i;t++)this.addTrackElement_(e[t])}addTrackElement_(e){const t=this.trackElements_.length;""+t in this||Object.defineProperty(this,t,{get(){return this.trackElements_[t]}}),this.trackElements_.indexOf(e)===-1&&this.trackElements_.push(e)}getTrackElementByTrack_(e){let t;for(let i=0,r=this.trackElements_.length;i<r;i++)if(e===this.trackElements_[i].track){t=this.trackElements_[i];break}return t}removeTrackElement_(e){for(let t=0,i=this.trackElements_.length;t<i;t++)if(e===this.trackElements_[t]){this.trackElements_[t].track&&typeof this.trackElements_[t].track.off=="function"&&this.trackElements_[t].track.off(),typeof this.trackElements_[t].off=="function"&&this.trackElements_[t].off(),this.trackElements_.splice(t,1);break}}},A_=class CE{constructor(e){CE.prototype.setCues_.call(this,e),Object.defineProperty(this,"length",{get(){return this.length_}})}setCues_(e){const t=this.length||0;let i=0;const r=e.length;this.cues_=e,this.length_=e.length;const n=function(a){""+a in this||Object.defineProperty(this,""+a,{get(){return this.cues_[a]}})};if(t<r)for(i=t;i<r;i++)n.call(this,i)}getCueById(e){let t=null;for(let i=0,r=this.length;i<r;i++){const n=this[i];if(n.id===e){t=n;break}}return t}};const BL={alternative:"alternative",captions:"captions",main:"main",sign:"sign",subtitles:"subtitles",commentary:"commentary"},UL={alternative:"alternative",descriptions:"descriptions",main:"main","main-desc":"main-desc",translation:"translation",commentary:"commentary"},$L={subtitles:"subtitles",captions:"captions",descriptions:"descriptions",chapters:"chapters",metadata:"metadata"},I_={disabled:"disabled",hidden:"hidden",showing:"showing"};let Xv=class extends ar{constructor(e={}){super();const t={id:e.id||"vjs_track_"+yr(),kind:e.kind||"",language:e.language||""};let i=e.label||"";for(const r in t)Object.defineProperty(this,r,{get(){return t[r]},set(){}});Object.defineProperty(this,"label",{get(){return i},set(r){r!==i&&(i=r,this.trigger("labelchange"))}})}};const Qv=function(s){return new URL(s,ce.baseURI)},EE=function(s){return new URL(s,ce.baseURI).href},Yv=function(s){if(typeof s=="string"){const t=/^(\/?)([\s\S]*?)((?:\.{1,2}|[^\/]+?)(\.([^\.\/\?]+)))(?:[\/]*|[\?].*)$/.exec(s);if(t)return t.pop().toLowerCase()}return""},Zh=function(s,e=O.location){return Qv(s).origin!==e.origin};var jL=Object.freeze({__proto__:null,parseUrl:Qv,getAbsoluteURL:EE,getFileExtension:Yv,isCrossOrigin:Zh});const P_=function(s,e){const t=new O.WebVTT.Parser(O,O.vttjs,O.WebVTT.StringDecoder()),i=[];t.oncue=function(r){e.addCue(r)},t.onparsingerror=function(r){i.push(r)},t.onflush=function(){e.trigger({type:"loadeddata",target:e})},t.parse(s),i.length>0&&(O.console&&O.console.groupCollapsed&&O.console.groupCollapsed(`Text Track parsing errors for ${e.src}`),i.forEach(r=>et.error(r)),O.console&&O.console.groupEnd&&O.console.groupEnd()),t.flush()},D_=function(s,e){const t={uri:s},i=Zh(s);i&&(t.cors=i);const r=e.tech_.crossOrigin()==="use-credentials";r&&(t.withCredentials=r),w1(t,St(this,function(n,a,o){if(n)return et.error(n,a);e.loaded_=!0,typeof O.WebVTT!="function"?e.tech_&&e.tech_.any(["vttjsloaded","vttjserror"],l=>{if(l.type==="vttjserror"){et.error(`vttjs failed to load, stopping trying to process ${e.src}`);return}return P_(o,e)}):P_(o,e)}))};let ou=class extends Xv{constructor(e={}){if(!e.tech)throw new Error("A tech was not provided.");const t=gt(e,{kind:$L[e.kind]||"subtitles",language:e.language||e.srclang||""});let i=I_[t.mode]||"disabled";const r=t.default;(t.kind==="metadata"||t.kind==="chapters")&&(i="hidden"),super(t),this.tech_=t.tech,this.cues_=[],this.activeCues_=[],this.preload_=this.tech_.preloadTextTracks!==!1;const n=new A_(this.cues_),a=new A_(this.activeCues_);let o=!1;this.timeupdateHandler=St(this,function(u={}){if(!this.tech_.isDisposed()){if(!this.tech_.isReady_){u.type!=="timeupdate"&&(this.rvf_=this.tech_.requestVideoFrameCallback(this.timeupdateHandler));return}this.activeCues=this.activeCues,o&&(this.trigger("cuechange"),o=!1),u.type!=="timeupdate"&&(this.rvf_=this.tech_.requestVideoFrameCallback(this.timeupdateHandler))}});const l=()=>{this.stopTracking()};this.tech_.one("dispose",l),i!=="disabled"&&this.startTracking(),Object.defineProperties(this,{default:{get(){return r},set(){}},mode:{get(){return i},set(u){I_[u]&&i!==u&&(i=u,!this.preload_&&i!=="disabled"&&this.cues.length===0&&D_(this.src,this),this.stopTracking(),i!=="disabled"&&this.startTracking(),this.trigger("modechange"))}},cues:{get(){return this.loaded_?n:null},set(){}},activeCues:{get(){if(!this.loaded_)return null;if(this.cues.length===0)return a;const u=this.tech_.currentTime(),c=[];for(let h=0,d=this.cues.length;h<d;h++){const g=this.cues[h];g.startTime<=u&&g.endTime>=u&&c.push(g)}if(o=!1,c.length!==this.activeCues_.length)o=!0;else for(let h=0;h<c.length;h++)this.activeCues_.indexOf(c[h])===-1&&(o=!0);return this.activeCues_=c,a.setCues_(this.activeCues_),a},set(){}}}),t.src?(this.src=t.src,this.preload_||(this.loaded_=!0),(this.preload_||t.kind!=="subtitles"&&t.kind!=="captions")&&D_(this.src,this)):this.loaded_=!0}startTracking(){this.rvf_=this.tech_.requestVideoFrameCallback(this.timeupdateHandler),this.tech_.on("timeupdate",this.timeupdateHandler)}stopTracking(){this.rvf_&&(this.tech_.cancelVideoFrameCallback(this.rvf_),this.rvf_=void 0),this.tech_.off("timeupdate",this.timeupdateHandler)}addCue(e){let t=e;if(!("getCueAsHTML"in t)){t=new O.vttjs.VTTCue(e.startTime,e.endTime,e.text);for(const r in e)r in t||(t[r]=e[r]);t.id=e.id,t.originalCue_=e}const i=this.tech_.textTracks();for(let r=0;r<i.length;r++)i[r]!==this&&i[r].removeCue(t);this.cues_.push(t),this.cues.setCues_(this.cues_)}removeCue(e){let t=this.cues_.length;for(;t--;){const i=this.cues_[t];if(i===e||i.originalCue_&&i.originalCue_===e){this.cues_.splice(t,1),this.cues.setCues_(this.cues_);break}}}};ou.prototype.allowedEvents_={cuechange:"cuechange"};let wE=class extends Xv{constructor(e={}){const t=gt(e,{kind:UL[e.kind]||""});super(t);let i=!1;Object.defineProperty(this,"enabled",{get(){return i},set(r){typeof r!="boolean"||r===i||(i=r,this.trigger("enabledchange"))}}),t.enabled&&(this.enabled=t.enabled),this.loaded_=!0}},kE=class extends Xv{constructor(e={}){const t=gt(e,{kind:BL[e.kind]||""});super(t);let i=!1;Object.defineProperty(this,"selected",{get(){return i},set(r){typeof r!="boolean"||r===i||(i=r,this.trigger("selectedchange"))}}),t.selected&&(this.selected=t.selected)}},Fo=class Rg extends ar{constructor(e={}){super();let t;const i=new ou(e);this.kind=i.kind,this.src=i.src,this.srclang=i.language,this.label=i.label,this.default=i.default,Object.defineProperties(this,{readyState:{get(){return t}},track:{get(){return i}}}),t=Rg.NONE,i.addEventListener("loadeddata",()=>{t=Rg.LOADED,this.trigger({type:"load",target:this})})}};Fo.prototype.allowedEvents_={load:"load"};Fo.NONE=0;Fo.LOADING=1;Fo.LOADED=2;Fo.ERROR=3;const gr={audio:{ListClass:ML,TrackClass:wE,capitalName:"Audio"},video:{ListClass:RL,TrackClass:kE,capitalName:"Video"},text:{ListClass:xE,TrackClass:ou,capitalName:"Text"}};Object.keys(gr).forEach(function(s){gr[s].getterName=`${s}Tracks`,gr[s].privateName=`${s}Tracks_`});const So={remoteText:{ListClass:xE,TrackClass:ou,capitalName:"RemoteText",getterName:"remoteTextTracks",privateName:"remoteTextTracks_"},remoteTextEl:{ListClass:FL,TrackClass:Fo,capitalName:"RemoteTextTrackEls",getterName:"remoteTextTrackEls",privateName:"remoteTextTrackEls_"}},wi=Object.assign({},gr,So);So.names=Object.keys(So);gr.names=Object.keys(gr);wi.names=[].concat(So.names).concat(gr.names);function qL(s,e,t,i,r={}){const n=s.textTracks();r.kind=e,t&&(r.label=t),i&&(r.language=i),r.tech=s;const a=new wi.text.TrackClass(r);return n.addTrack(a),a}let vt=class mi extends _e{constructor(e={},t=function(){}){e.reportTouchActivity=!1,super(null,e,t),this.onDurationChange_=i=>this.onDurationChange(i),this.trackProgress_=i=>this.trackProgress(i),this.trackCurrentTime_=i=>this.trackCurrentTime(i),this.stopTrackingCurrentTime_=i=>this.stopTrackingCurrentTime(i),this.disposeSourceHandler_=i=>this.disposeSourceHandler(i),this.queuedHanders_=new Set,this.hasStarted_=!1,this.on("playing",function(){this.hasStarted_=!0}),this.on("loadstart",function(){this.hasStarted_=!1}),wi.names.forEach(i=>{const r=wi[i];e&&e[r.getterName]&&(this[r.privateName]=e[r.getterName])}),this.featuresProgressEvents||this.manualProgressOn(),this.featuresTimeupdateEvents||this.manualTimeUpdatesOn(),["Text","Audio","Video"].forEach(i=>{e[`native${i}Tracks`]===!1&&(this[`featuresNative${i}Tracks`]=!1)}),e.nativeCaptions===!1||e.nativeTextTracks===!1?this.featuresNativeTextTracks=!1:(e.nativeCaptions===!0||e.nativeTextTracks===!0)&&(this.featuresNativeTextTracks=!0),this.featuresNativeTextTracks||this.emulateTextTracks(),this.preloadTextTracks=e.preloadTextTracks!==!1,this.autoRemoteTextTracks_=new wi.text.ListClass,this.initTrackListeners(),e.nativeControlsForTouch||this.emitTapEvents(),this.constructor&&(this.name_=this.constructor.name||"Unknown Tech")}triggerSourceset(e){this.isReady_||this.one("ready",()=>this.setTimeout(()=>this.triggerSourceset(e),1)),this.trigger({src:e,type:"sourceset"})}manualProgressOn(){this.on("durationchange",this.onDurationChange_),this.manualProgress=!0,this.one("ready",this.trackProgress_)}manualProgressOff(){this.manualProgress=!1,this.stopTrackingProgress(),this.off("durationchange",this.onDurationChange_)}trackProgress(e){this.stopTrackingProgress(),this.progressInterval=this.setInterval(St(this,function(){const t=this.bufferedPercent();this.bufferedPercent_!==t&&this.trigger("progress"),this.bufferedPercent_=t,t===1&&this.stopTrackingProgress()}),500)}onDurationChange(e){this.duration_=this.duration()}buffered(){return Dr(0,0)}bufferedPercent(){return SE(this.buffered(),this.duration_)}stopTrackingProgress(){this.clearInterval(this.progressInterval)}manualTimeUpdatesOn(){this.manualTimeUpdates=!0,this.on("play",this.trackCurrentTime_),this.on("pause",this.stopTrackingCurrentTime_)}manualTimeUpdatesOff(){this.manualTimeUpdates=!1,this.stopTrackingCurrentTime(),this.off("play",this.trackCurrentTime_),this.off("pause",this.stopTrackingCurrentTime_)}trackCurrentTime(){this.currentTimeInterval&&this.stopTrackingCurrentTime(),this.currentTimeInterval=this.setInterval(function(){this.trigger({type:"timeupdate",target:this,manuallyTriggered:!0})},250)}stopTrackingCurrentTime(){this.clearInterval(this.currentTimeInterval),this.trigger({type:"timeupdate",target:this,manuallyTriggered:!0})}dispose(){this.clearTracks(gr.names),this.manualProgress&&this.manualProgressOff(),this.manualTimeUpdates&&this.manualTimeUpdatesOff(),super.dispose()}clearTracks(e){e=[].concat(e),e.forEach(t=>{const i=this[`${t}Tracks`]()||[];let r=i.length;for(;r--;){const n=i[r];t==="text"&&this.removeRemoteTextTrack(n),i.removeTrack(n)}})}cleanupAutoTextTracks(){const e=this.autoRemoteTextTracks_||[];let t=e.length;for(;t--;){const i=e[t];this.removeRemoteTextTrack(i)}}reset(){}crossOrigin(){}setCrossOrigin(){}error(e){return e!==void 0&&(this.error_=new Rt(e),this.trigger("error")),this.error_}played(){return this.hasStarted_?Dr(0,0):Dr()}play(){}setScrubbing(e){}scrubbing(){}setCurrentTime(e){this.manualTimeUpdates&&this.trigger({type:"timeupdate",target:this,manuallyTriggered:!0})}initTrackListeners(){gr.names.forEach(e=>{const t=gr[e],i=()=>{this.trigger(`${e}trackchange`)},r=this[t.getterName]();r.addEventListener("removetrack",i),r.addEventListener("addtrack",i),this.on("dispose",()=>{r.removeEventListener("removetrack",i),r.removeEventListener("addtrack",i)})})}addWebVttScript_(){if(!O.WebVTT)if(ce.body.contains(this.el())){if(!this.options_["vtt.js"]&&vo(ho)&&Object.keys(ho).length>0){this.trigger("vttjsloaded");return}const e=ce.createElement("script");e.src=this.options_["vtt.js"]||"https://vjs.zencdn.net/vttjs/0.14.1/vtt.min.js",e.onload=()=>{this.trigger("vttjsloaded")},e.onerror=()=>{this.trigger("vttjserror")},this.on("dispose",()=>{e.onload=null,e.onerror=null}),O.WebVTT=!0,this.el().parentNode.appendChild(e)}else this.ready(this.addWebVttScript_)}emulateTextTracks(){const e=this.textTracks(),t=this.remoteTextTracks(),i=o=>e.addTrack(o.track),r=o=>e.removeTrack(o.track);t.on("addtrack",i),t.on("removetrack",r),this.addWebVttScript_();const n=()=>this.trigger("texttrackchange"),a=()=>{n();for(let o=0;o<e.length;o++){const l=e[o];l.removeEventListener("cuechange",n),l.mode==="showing"&&l.addEventListener("cuechange",n)}};a(),e.addEventListener("change",a),e.addEventListener("addtrack",a),e.addEventListener("removetrack",a),this.on("dispose",function(){t.off("addtrack",i),t.off("removetrack",r),e.removeEventListener("change",a),e.removeEventListener("addtrack",a),e.removeEventListener("removetrack",a);for(let o=0;o<e.length;o++)e[o].removeEventListener("cuechange",n)})}addTextTrack(e,t,i){if(!e)throw new Error("TextTrack kind is required but was not provided");return qL(this,e,t,i)}createRemoteTextTrack(e){const t=gt(e,{tech:this});return new So.remoteTextEl.TrackClass(t)}addRemoteTextTrack(e={},t){const i=this.createRemoteTextTrack(e);return typeof t!="boolean"&&(t=!1),this.remoteTextTrackEls().addTrackElement_(i),this.remoteTextTracks().addTrack(i.track),t===!1&&this.ready(()=>this.autoRemoteTextTracks_.addTrack(i.track)),i}removeRemoteTextTrack(e){const t=this.remoteTextTrackEls().getTrackElementByTrack_(e);this.remoteTextTrackEls().removeTrackElement_(t),this.remoteTextTracks().removeTrack(e),this.autoRemoteTextTracks_.removeTrack(e)}getVideoPlaybackQuality(){return{}}requestPictureInPicture(){return Promise.reject()}disablePictureInPicture(){return!0}setDisablePictureInPicture(){}requestVideoFrameCallback(e){const t=yr();return!this.isReady_||this.paused()?(this.queuedHanders_.add(t),this.one("playing",()=>{this.queuedHanders_.has(t)&&(this.queuedHanders_.delete(t),e())})):this.requestNamedAnimationFrame(t,e),t}cancelVideoFrameCallback(e){this.queuedHanders_.has(e)?this.queuedHanders_.delete(e):this.cancelNamedAnimationFrame(e)}setPoster(){}playsinline(){}setPlaysinline(){}overrideNativeAudioTracks(e){}overrideNativeVideoTracks(e){}canPlayType(e){return""}static canPlayType(e){return""}static canPlaySource(e,t){return mi.canPlayType(e.type)}static isTech(e){return e.prototype instanceof mi||e instanceof mi||e===mi}static registerTech(e,t){if(mi.techs_||(mi.techs_={}),!mi.isTech(t))throw new Error(`Tech ${e} must be a Tech`);if(!mi.canPlayType)throw new Error("Techs must have a static canPlayType method on them");if(!mi.canPlaySource)throw new Error("Techs must have a static canPlaySource method on them");return e=qt(e),mi.techs_[e]=t,mi.techs_[Fl(e)]=t,e!=="Tech"&&mi.defaultTechOrder_.push(e),t}static getTech(e){if(e){if(mi.techs_&&mi.techs_[e])return mi.techs_[e];if(e=qt(e),O&&O.videojs&&O.videojs[e])return et.warn(`The ${e} tech was added to the videojs object when it should be registered using videojs.registerTech(name, tech)`),O.videojs[e]}}};wi.names.forEach(function(s){const e=wi[s];vt.prototype[e.getterName]=function(){return this[e.privateName]=this[e.privateName]||new e.ListClass,this[e.privateName]}});vt.prototype.featuresVolumeControl=!0;vt.prototype.featuresMuteControl=!0;vt.prototype.featuresFullscreenResize=!1;vt.prototype.featuresPlaybackRate=!1;vt.prototype.featuresProgressEvents=!1;vt.prototype.featuresSourceset=!1;vt.prototype.featuresTimeupdateEvents=!1;vt.prototype.featuresNativeTextTracks=!1;vt.prototype.featuresVideoFrameCallback=!1;vt.withSourceHandlers=function(s){s.registerSourceHandler=function(t,i){let r=s.sourceHandlers;r||(r=s.sourceHandlers=[]),i===void 0&&(i=r.length),r.splice(i,0,t)},s.canPlayType=function(t){const i=s.sourceHandlers||[];let r;for(let n=0;n<i.length;n++)if(r=i[n].canPlayType(t),r)return r;return""},s.selectSourceHandler=function(t,i){const r=s.sourceHandlers||[];let n;for(let a=0;a<r.length;a++)if(n=r[a].canHandleSource(t,i),n)return r[a];return null},s.canPlaySource=function(t,i){const r=s.selectSourceHandler(t,i);return r?r.canHandleSource(t,i):""},["seekable","seeking","duration"].forEach(function(t){const i=this[t];typeof i=="function"&&(this[t]=function(){return this.sourceHandler_&&this.sourceHandler_[t]?this.sourceHandler_[t].apply(this.sourceHandler_,arguments):i.apply(this,arguments)})},s.prototype),s.prototype.setSource=function(t){let i=s.selectSourceHandler(t,this.options_);i||(s.nativeSourceHandler?i=s.nativeSourceHandler:et.error("No source handler found for the current source.")),this.disposeSourceHandler(),this.off("dispose",this.disposeSourceHandler_),i!==s.nativeSourceHandler&&(this.currentSource_=t),this.sourceHandler_=i.handleSource(t,this,this.options_),this.one("dispose",this.disposeSourceHandler_)},s.prototype.disposeSourceHandler=function(){this.currentSource_&&(this.clearTracks(["audio","video"]),this.currentSource_=null),this.cleanupAutoTextTracks(),this.sourceHandler_&&(this.sourceHandler_.dispose&&this.sourceHandler_.dispose(),this.sourceHandler_=null)}};_e.registerComponent("Tech",vt);vt.registerTech("Tech",vt);vt.defaultTechOrder_=[];const Ys={},Xc={},Qc={};function VL(s,e){Ys[s]=Ys[s]||[],Ys[s].push(e)}function HL(s,e,t){s.setTimeout(()=>Rs(e,Ys[e.type],t,s),1)}function zL(s,e){s.forEach(t=>t.setTech&&t.setTech(e))}function WL(s,e,t){return s.reduceRight(Jv(t),e[t]())}function GL(s,e,t,i){return e[t](s.reduce(Jv(t),i))}function N_(s,e,t,i=null){const r="call"+qt(t),n=s.reduce(Jv(r),i),a=n===Qc,o=a?null:e[t](n);return QL(s,t,o,a),o}const KL={buffered:1,currentTime:1,duration:1,muted:1,played:1,paused:1,seekable:1,volume:1,ended:1},XL={setCurrentTime:1,setMuted:1,setVolume:1},L_={play:1,pause:1};function Jv(s){return(e,t)=>e===Qc?Qc:t[s]?t[s](e):e}function QL(s,e,t,i){for(let r=s.length-1;r>=0;r--){const n=s[r];n[e]&&n[e](i,t)}}function YL(s){Xc.hasOwnProperty(s.id())&&delete Xc[s.id()]}function JL(s,e){const t=Xc[s.id()];let i=null;if(t==null)return i=e(s),Xc[s.id()]=[[e,i]],i;for(let r=0;r<t.length;r++){const[n,a]=t[r];n===e&&(i=a)}return i===null&&(i=e(s),t.push([e,i])),i}function Rs(s={},e=[],t,i,r=[],n=!1){const[a,...o]=e;if(typeof a=="string")Rs(s,Ys[a],t,i,r,n);else if(a){const l=JL(i,a);if(!l.setSource)return r.push(l),Rs(s,o,t,i,r,n);l.setSource(Object.assign({},s),function(u,c){if(u)return Rs(s,o,t,i,r,n);r.push(l),Rs(c,s.type===c.type?o:Ys[c.type],t,i,r,n)})}else o.length?Rs(s,o,t,i,r,n):n?t(s,r):Rs(s,Ys["*"],t,i,r,!0)}const ZL={opus:"video/ogg",ogv:"video/ogg",mp4:"video/mp4",mov:"video/mp4",m4v:"video/mp4",mkv:"video/x-matroska",m4a:"audio/mp4",mp3:"audio/mpeg",aac:"audio/aac",caf:"audio/x-caf",flac:"audio/flac",oga:"audio/ogg",wav:"audio/wav",m3u8:"application/x-mpegURL",mpd:"application/dash+xml",jpg:"image/jpeg",jpeg:"image/jpeg",gif:"image/gif",png:"image/png",svg:"image/svg+xml",webp:"image/webp"},Yc=function(s=""){const e=Yv(s);return ZL[e.toLowerCase()]||""},eO=(s,e)=>{if(!e)return"";if(s.cache_.source.src===e&&s.cache_.source.type)return s.cache_.source.type;const t=s.cache_.sources.filter(r=>r.src===e);if(t.length)return t[0].type;const i=s.$$("source");for(let r=0;r<i.length;r++){const n=i[r];if(n.type&&n.src&&n.src===e)return n.type}return Yc(e)},AE=function(s){if(Array.isArray(s)){let e=[];s.forEach(function(t){t=AE(t),Array.isArray(t)?e=e.concat(t):en(t)&&e.push(t)}),s=e}else typeof s=="string"&&s.trim()?s=[O_({src:s})]:en(s)&&typeof s.src=="string"&&s.src&&s.src.trim()?s=[O_(s)]:s=[];return s};function O_(s){if(!s.type){const e=Yc(s.src);e&&(s.type=e)}return s}var tO=`<svg xmlns="http://www.w3.org/2000/svg">
34
- <defs>
35
- <symbol viewBox="0 0 48 48" id="vjs-icon-play">
36
- <path d="M16 10v28l22-14z"></path>
37
- </symbol>
38
- <symbol viewBox="0 0 48 48" id="vjs-icon-pause">
39
- <path d="M12 38h8V10h-8v28zm16-28v28h8V10h-8z"></path>
40
- </symbol>
41
- <symbol viewBox="0 0 48 48" id="vjs-icon-audio">
42
- <path d="M24 2C14.06 2 6 10.06 6 20v14c0 3.31 2.69 6 6 6h6V24h-8v-4c0-7.73 6.27-14 14-14s14 6.27 14 14v4h-8v16h6c3.31 0 6-2.69 6-6V20c0-9.94-8.06-18-18-18z"></path>
43
- </symbol>
44
- <symbol viewBox="0 0 48 48" id="vjs-icon-captions">
45
- <path d="M38 8H10c-2.21 0-4 1.79-4 4v24c0 2.21 1.79 4 4 4h28c2.21 0 4-1.79 4-4V12c0-2.21-1.79-4-4-4zM22 22h-3v-1h-4v6h4v-1h3v2a2 2 0 0 1-2 2h-6a2 2 0 0 1-2-2v-8a2 2 0 0 1 2-2h6a2 2 0 0 1 2 2v2zm14 0h-3v-1h-4v6h4v-1h3v2a2 2 0 0 1-2 2h-6a2 2 0 0 1-2-2v-8a2 2 0 0 1 2-2h6a2 2 0 0 1 2 2v2z"></path>
46
- </symbol>
47
- <symbol viewBox="0 0 48 48" id="vjs-icon-subtitles">
48
- <path d="M40 8H8c-2.21 0-4 1.79-4 4v24c0 2.21 1.79 4 4 4h32c2.21 0 4-1.79 4-4V12c0-2.21-1.79-4-4-4zM8 24h8v4H8v-4zm20 12H8v-4h20v4zm12 0h-8v-4h8v4zm0-8H20v-4h20v4z"></path>
49
- </symbol>
50
- <symbol viewBox="0 0 48 48" id="vjs-icon-fullscreen-enter">
51
- <path d="M14 28h-4v10h10v-4h-6v-6zm-4-8h4v-6h6v-4H10v10zm24 14h-6v4h10V28h-4v6zm-6-24v4h6v6h4V10H28z"></path>
52
- </symbol>
53
- <symbol viewBox="0 0 48 48" id="vjs-icon-fullscreen-exit">
54
- <path d="M10 32h6v6h4V28H10v4zm6-16h-6v4h10V10h-4v6zm12 22h4v-6h6v-4H28v10zm4-22v-6h-4v10h10v-4h-6z"></path>
55
- </symbol>
56
- <symbol viewBox="0 0 48 48" id="vjs-icon-play-circle">
57
- <path d="M20 33l12-9-12-9v18zm4-29C12.95 4 4 12.95 4 24s8.95 20 20 20 20-8.95 20-20S35.05 4 24 4zm0 36c-8.82 0-16-7.18-16-16S15.18 8 24 8s16 7.18 16 16-7.18 16-16 16z"></path>
58
- </symbol>
59
- <symbol viewBox="0 0 48 48" id="vjs-icon-volume-mute">
60
- <path d="M33 24c0-3.53-2.04-6.58-5-8.05v4.42l4.91 4.91c.06-.42.09-.85.09-1.28zm5 0c0 1.88-.41 3.65-1.08 5.28l3.03 3.03C41.25 29.82 42 27 42 24c0-8.56-5.99-15.72-14-17.54v4.13c5.78 1.72 10 7.07 10 13.41zM8.55 6L6 8.55 15.45 18H6v12h8l10 10V26.55l8.51 8.51c-1.34 1.03-2.85 1.86-4.51 2.36v4.13a17.94 17.94 0 0 0 7.37-3.62L39.45 42 42 39.45l-18-18L8.55 6zM24 8l-4.18 4.18L24 16.36V8z"></path>
61
- </symbol>
62
- <symbol viewBox="0 0 48 48" id="vjs-icon-volume-low">
63
- <path d="M14 18v12h8l10 10V8L22 18h-8z"></path>
64
- </symbol>
65
- <symbol viewBox="0 0 48 48" id="vjs-icon-volume-medium">
66
- <path d="M37 24c0-3.53-2.04-6.58-5-8.05v16.11c2.96-1.48 5-4.53 5-8.06zm-27-6v12h8l10 10V8L18 18h-8z"></path>
67
- </symbol>
68
- <symbol viewBox="0 0 48 48" id="vjs-icon-volume-high">
69
- <path d="M6 18v12h8l10 10V8L14 18H6zm27 6c0-3.53-2.04-6.58-5-8.05v16.11c2.96-1.48 5-4.53 5-8.06zM28 6.46v4.13c5.78 1.72 10 7.07 10 13.41s-4.22 11.69-10 13.41v4.13c8.01-1.82 14-8.97 14-17.54S36.01 8.28 28 6.46z"></path>
70
- </symbol>
71
- <symbol viewBox="0 0 48 48" id="vjs-icon-spinner">
72
- <path d="M18.8 21l9.53-16.51C26.94 4.18 25.49 4 24 4c-4.8 0-9.19 1.69-12.64 4.51l7.33 12.69.11-.2zm24.28-3c-1.84-5.85-6.3-10.52-11.99-12.68L23.77 18h19.31zm.52 2H28.62l.58 1 9.53 16.5C41.99 33.94 44 29.21 44 24c0-1.37-.14-2.71-.4-4zm-26.53 4l-7.8-13.5C6.01 14.06 4 18.79 4 24c0 1.37.14 2.71.4 4h14.98l-2.31-4zM4.92 30c1.84 5.85 6.3 10.52 11.99 12.68L24.23 30H4.92zm22.54 0l-7.8 13.51c1.4.31 2.85.49 4.34.49 4.8 0 9.19-1.69 12.64-4.51L29.31 26.8 27.46 30z"></path>
73
- </symbol>
74
- <symbol viewBox="0 0 24 24" id="vjs-icon-hd">
75
- <path d="M19 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm-8 12H9.5v-2h-2v2H6V9h1.5v2.5h2V9H11v6zm2-6h4c.55 0 1 .45 1 1v4c0 .55-.45 1-1 1h-4V9zm1.5 4.5h2v-3h-2v3z"></path>
76
- </symbol>
77
- <symbol viewBox="0 0 48 48" id="vjs-icon-chapters">
78
- <path d="M6 26h4v-4H6v4zm0 8h4v-4H6v4zm0-16h4v-4H6v4zm8 8h28v-4H14v4zm0 8h28v-4H14v4zm0-20v4h28v-4H14z"></path>
79
- </symbol>
80
- <symbol viewBox="0 0 40 40" id="vjs-icon-downloading">
81
- <path d="M18.208 36.875q-3.208-.292-5.979-1.729-2.771-1.438-4.812-3.729-2.042-2.292-3.188-5.229-1.146-2.938-1.146-6.23 0-6.583 4.334-11.416 4.333-4.834 10.833-5.5v3.166q-5.167.75-8.583 4.646Q6.25 14.75 6.25 19.958q0 5.209 3.396 9.104 3.396 3.896 8.562 4.646zM20 28.417L11.542 20l2.083-2.083 4.917 4.916v-11.25h2.916v11.25l4.875-4.916L28.417 20zm1.792 8.458v-3.167q1.833-.25 3.541-.958 1.709-.708 3.167-1.875l2.333 2.292q-1.958 1.583-4.25 2.541-2.291.959-4.791 1.167zm6.791-27.792q-1.541-1.125-3.25-1.854-1.708-.729-3.541-1.021V3.042q2.5.25 4.77 1.208 2.271.958 4.271 2.5zm4.584 21.584l-2.25-2.25q1.166-1.5 1.854-3.209.687-1.708.937-3.541h3.209q-.292 2.5-1.229 4.791-.938 2.292-2.521 4.209zm.541-12.417q-.291-1.833-.958-3.562-.667-1.73-1.833-3.188l2.375-2.208q1.541 1.916 2.458 4.208.917 2.292 1.167 4.75z"></path>
82
- </symbol>
83
- <symbol viewBox="0 0 48 48" id="vjs-icon-file-download">
84
- <path d="M10.8 40.55q-1.35 0-2.375-1T7.4 37.15v-7.7h3.4v7.7h26.35v-7.7h3.4v7.7q0 1.4-1 2.4t-2.4 1zM24 32.1L13.9 22.05l2.45-2.45 5.95 5.95V7.15h3.4v18.4l5.95-5.95 2.45 2.45z"></path>
85
- </symbol>
86
- <symbol viewBox="0 0 48 48" id="vjs-icon-file-download-done">
87
- <path d="M9.8 40.5v-3.45h28.4v3.45zm9.2-9.05L7.4 19.85l2.45-2.35L19 26.65l19.2-19.2 2.4 2.4z"></path>
88
- </symbol>
89
- <symbol viewBox="0 0 48 48" id="vjs-icon-file-download-off">
90
- <path d="M4.9 4.75L43.25 43.1 41 45.3l-4.75-4.75q-.05.05-.075.025-.025-.025-.075-.025H10.8q-1.35 0-2.375-1T7.4 37.15v-7.7h3.4v7.7h22.05l-7-7-1.85 1.8L13.9 21.9l1.85-1.85L2.7 7zm26.75 14.7l2.45 2.45-3.75 3.8-2.45-2.5zM25.7 7.15V21.1l-3.4-3.45V7.15z"></path>
91
- </symbol>
92
- <symbol viewBox="0 0 48 48" id="vjs-icon-share">
93
- <path d="M36 32.17c-1.52 0-2.89.59-3.93 1.54L17.82 25.4c.11-.45.18-.92.18-1.4s-.07-.95-.18-1.4l14.1-8.23c1.07 1 2.5 1.62 4.08 1.62 3.31 0 6-2.69 6-6s-2.69-6-6-6-6 2.69-6 6c0 .48.07.95.18 1.4l-14.1 8.23c-1.07-1-2.5-1.62-4.08-1.62-3.31 0-6 2.69-6 6s2.69 6 6 6c1.58 0 3.01-.62 4.08-1.62l14.25 8.31c-.1.42-.16.86-.16 1.31A5.83 5.83 0 1 0 36 32.17z"></path>
94
- </symbol>
95
- <symbol viewBox="0 0 48 48" id="vjs-icon-cog">
96
- <path d="M38.86 25.95c.08-.64.14-1.29.14-1.95s-.06-1.31-.14-1.95l4.23-3.31c.38-.3.49-.84.24-1.28l-4-6.93c-.25-.43-.77-.61-1.22-.43l-4.98 2.01c-1.03-.79-2.16-1.46-3.38-1.97L29 4.84c-.09-.47-.5-.84-1-.84h-8c-.5 0-.91.37-.99.84l-.75 5.3a14.8 14.8 0 0 0-3.38 1.97L9.9 10.1a1 1 0 0 0-1.22.43l-4 6.93c-.25.43-.14.97.24 1.28l4.22 3.31C9.06 22.69 9 23.34 9 24s.06 1.31.14 1.95l-4.22 3.31c-.38.3-.49.84-.24 1.28l4 6.93c.25.43.77.61 1.22.43l4.98-2.01c1.03.79 2.16 1.46 3.38 1.97l.75 5.3c.08.47.49.84.99.84h8c.5 0 .91-.37.99-.84l.75-5.3a14.8 14.8 0 0 0 3.38-1.97l4.98 2.01a1 1 0 0 0 1.22-.43l4-6.93c.25-.43.14-.97-.24-1.28l-4.22-3.31zM24 31c-3.87 0-7-3.13-7-7s3.13-7 7-7 7 3.13 7 7-3.13 7-7 7z"></path>
97
- </symbol>
98
- <symbol viewBox="0 0 48 48" id="vjs-icon-square">
99
- <path d="M36 8H12c-2.21 0-4 1.79-4 4v24c0 2.21 1.79 4 4 4h24c2.21 0 4-1.79 4-4V12c0-2.21-1.79-4-4-4zm0 28H12V12h24v24z"></path>
100
- </symbol>
101
- <symbol viewBox="0 0 48 48" id="vjs-icon-circle">
102
- <circle cx="24" cy="24" r="20"></circle>
103
- </symbol>
104
- <symbol viewBox="0 0 48 48" id="vjs-icon-circle-outline">
105
- <path d="M24 4C12.95 4 4 12.95 4 24s8.95 20 20 20 20-8.95 20-20S35.05 4 24 4zm0 36c-8.82 0-16-7.18-16-16S15.18 8 24 8s16 7.18 16 16-7.18 16-16 16z"></path>
106
- </symbol>
107
- <symbol viewBox="0 0 48 48" id="vjs-icon-circle-inner-circle">
108
- <path d="M24 4C12.97 4 4 12.97 4 24s8.97 20 20 20 20-8.97 20-20S35.03 4 24 4zm0 36c-8.82 0-16-7.18-16-16S15.18 8 24 8s16 7.18 16 16-7.18 16-16 16zm6-16c0 3.31-2.69 6-6 6s-6-2.69-6-6 2.69-6 6-6 6 2.69 6 6z"></path>
109
- </symbol>
110
- <symbol viewBox="0 0 48 48" id="vjs-icon-cancel">
111
- <path d="M24 4C12.95 4 4 12.95 4 24s8.95 20 20 20 20-8.95 20-20S35.05 4 24 4zm10 27.17L31.17 34 24 26.83 16.83 34 14 31.17 21.17 24 14 16.83 16.83 14 24 21.17 31.17 14 34 16.83 26.83 24 34 31.17z"></path>
112
- </symbol>
113
- <symbol viewBox="0 0 48 48" id="vjs-icon-replay">
114
- <path d="M24 10V2L14 12l10 10v-8c6.63 0 12 5.37 12 12s-5.37 12-12 12-12-5.37-12-12H8c0 8.84 7.16 16 16 16s16-7.16 16-16-7.16-16-16-16z"></path>
115
- </symbol>
116
- <symbol viewBox="0 0 48 48" id="vjs-icon-repeat">
117
- <path d="M14 14h20v6l8-8-8-8v6H10v12h4v-8zm20 20H14v-6l-8 8 8 8v-6h24V26h-4v8z"></path>
118
- </symbol>
119
- <symbol viewBox="0 96 48 48" id="vjs-icon-replay-5">
120
- <path d="M17.689 98l-8.697 8.696 8.697 8.697 2.486-2.485-4.32-4.319h1.302c4.93 0 9.071 1.722 12.424 5.165 3.352 3.443 5.029 7.638 5.029 12.584h3.55c0-2.958-.553-5.73-1.658-8.313-1.104-2.583-2.622-4.841-4.555-6.774-1.932-1.932-4.19-3.45-6.773-4.555-2.584-1.104-5.355-1.657-8.313-1.657H15.5l4.615-4.615zm-8.08 21.659v13.861h11.357v5.008H9.609V143h12.7c.834 0 1.55-.298 2.146-.894.596-.597.895-1.31.895-2.145v-7.781c0-.835-.299-1.55-.895-2.147a2.929 2.929 0 0 0-2.147-.894h-8.227v-5.096H25.35v-4.384z"></path>
121
- </symbol>
122
- <symbol viewBox="0 96 48 48" id="vjs-icon-replay-10">
123
- <path d="M42.315 125.63c0-4.997-1.694-9.235-5.08-12.713-3.388-3.479-7.571-5.218-12.552-5.218h-1.315l4.363 4.363-2.51 2.51-8.787-8.786L25.221 97l2.45 2.45-4.662 4.663h1.375c2.988 0 5.788.557 8.397 1.673 2.61 1.116 4.892 2.65 6.844 4.602 1.953 1.953 3.487 4.234 4.602 6.844 1.116 2.61 1.674 5.41 1.674 8.398zM8.183 142v-19.657H3.176V117.8h9.643V142zm13.63 0c-1.156 0-2.127-.393-2.912-1.178-.778-.778-1.168-1.746-1.168-2.902v-16.04c0-1.156.393-2.127 1.178-2.912.779-.779 1.746-1.168 2.902-1.168h7.696c1.156 0 2.126.392 2.911 1.177.779.78 1.168 1.747 1.168 2.903v16.04c0 1.156-.392 2.127-1.177 2.912-.779.779-1.746 1.168-2.902 1.168zm.556-4.636h6.583v-15.02H22.37z"></path>
124
- </symbol>
125
- <symbol viewBox="0 96 48 48" id="vjs-icon-replay-30">
126
- <path d="M26.047 97l-8.733 8.732 8.733 8.733 2.496-2.494-4.336-4.338h1.307c4.95 0 9.108 1.73 12.474 5.187 3.367 3.458 5.051 7.668 5.051 12.635h3.565c0-2.97-.556-5.751-1.665-8.346-1.109-2.594-2.633-4.862-4.574-6.802-1.94-1.941-4.208-3.466-6.803-4.575-2.594-1.109-5.375-1.664-8.345-1.664H23.85l4.634-4.634zM2.555 117.531v4.688h10.297v5.25H5.873v4.687h6.979v5.156H2.555V142H13.36c1.061 0 1.95-.395 2.668-1.186.718-.79 1.076-1.772 1.076-2.94v-16.218c0-1.168-.358-2.149-1.076-2.94-.717-.79-1.607-1.185-2.668-1.185zm22.482.14c-1.149 0-2.11.39-2.885 1.165-.78.78-1.172 1.744-1.172 2.893v15.943c0 1.149.388 2.11 1.163 2.885.78.78 1.745 1.172 2.894 1.172h7.649c1.148 0 2.11-.388 2.884-1.163.78-.78 1.17-1.745 1.17-2.894v-15.943c0-1.15-.386-2.111-1.16-2.885-.78-.78-1.746-1.172-2.894-1.172zm.553 4.518h6.545v14.93H25.59z"></path>
127
- </symbol>
128
- <symbol viewBox="0 96 48 48" id="vjs-icon-forward-5">
129
- <path d="M29.508 97l-2.431 2.43 4.625 4.625h-1.364c-2.965 0-5.742.554-8.332 1.66-2.589 1.107-4.851 2.629-6.788 4.566-1.937 1.937-3.458 4.2-4.565 6.788-1.107 2.59-1.66 5.367-1.66 8.331h3.557c0-4.957 1.68-9.16 5.04-12.611 3.36-3.45 7.51-5.177 12.451-5.177h1.304l-4.326 4.33 2.49 2.49 8.715-8.716zm-9.783 21.61v13.89h11.382v5.018H19.725V142h12.727a2.93 2.93 0 0 0 2.15-.896 2.93 2.93 0 0 0 .896-2.15v-7.798c0-.837-.299-1.554-.896-2.152a2.93 2.93 0 0 0-2.15-.896h-8.245V123h11.29v-4.392z"></path>
130
- </symbol>
131
- <symbol viewBox="0 96 48 48" id="vjs-icon-forward-10">
132
- <path d="M23.119 97l-2.386 2.383 4.538 4.538h-1.339c-2.908 0-5.633.543-8.173 1.63-2.54 1.085-4.76 2.577-6.66 4.478-1.9 1.9-3.392 4.12-4.478 6.66-1.085 2.54-1.629 5.264-1.629 8.172h3.49c0-4.863 1.648-8.986 4.944-12.372 3.297-3.385 7.368-5.078 12.216-5.078h1.279l-4.245 4.247 2.443 2.442 8.55-8.55zm-9.52 21.45v4.42h4.871V142h4.513v-23.55zm18.136 0c-1.125 0-2.066.377-2.824 1.135-.764.764-1.148 1.709-1.148 2.834v15.612c0 1.124.38 2.066 1.139 2.824.764.764 1.708 1.145 2.833 1.145h7.489c1.125 0 2.066-.378 2.824-1.136.764-.764 1.145-1.709 1.145-2.833v-15.612c0-1.125-.378-2.067-1.136-2.825-.764-.764-1.708-1.145-2.833-1.145zm.54 4.42h6.408v14.617h-6.407z"></path>
133
- </symbol>
134
- <symbol viewBox="0 96 48 48" id="vjs-icon-forward-30">
135
- <path d="M25.549 97l-2.437 2.434 4.634 4.635H26.38c-2.97 0-5.753.555-8.347 1.664-2.594 1.109-4.861 2.633-6.802 4.574-1.94 1.94-3.465 4.207-4.574 6.802-1.109 2.594-1.664 5.377-1.664 8.347h3.565c0-4.967 1.683-9.178 5.05-12.636 3.366-3.458 7.525-5.187 12.475-5.187h1.307l-4.335 4.338 2.495 2.494 8.732-8.732zm-11.553 20.53v4.689h10.297v5.249h-6.978v4.688h6.978v5.156H13.996V142h10.808c1.06 0 1.948-.395 2.666-1.186.718-.79 1.077-1.771 1.077-2.94v-16.217c0-1.169-.36-2.15-1.077-2.94-.718-.79-1.605-1.186-2.666-1.186zm21.174.168c-1.149 0-2.11.389-2.884 1.163-.78.78-1.172 1.745-1.172 2.894v15.942c0 1.15.388 2.11 1.162 2.885.78.78 1.745 1.17 2.894 1.17h7.649c1.149 0 2.11-.386 2.885-1.16.78-.78 1.17-1.746 1.17-2.895v-15.942c0-1.15-.387-2.11-1.161-2.885-.78-.78-1.745-1.172-2.894-1.172zm.552 4.516h6.542v14.931h-6.542z"></path>
136
- </symbol>
137
- <symbol viewBox="0 0 512 512" id="vjs-icon-audio-description">
138
- <g fill-rule="evenodd"><path d="M227.29 381.351V162.993c50.38-1.017 89.108-3.028 117.631 17.126 27.374 19.342 48.734 56.965 44.89 105.325-4.067 51.155-41.335 94.139-89.776 98.475-24.085 2.155-71.972 0-71.972 0s-.84-1.352-.773-2.568m48.755-54.804c31.43 1.26 53.208-16.633 56.495-45.386 4.403-38.51-21.188-63.552-58.041-60.796v103.612c-.036 1.466.575 2.22 1.546 2.57"></path><path d="M383.78 381.328c13.336 3.71 17.387-11.06 23.215-21.408 12.722-22.571 22.294-51.594 22.445-84.774.221-47.594-18.343-82.517-35.6-106.182h-8.51c-.587 3.874 2.226 7.315 3.865 10.276 13.166 23.762 25.367 56.553 25.54 94.194.2 43.176-14.162 79.278-30.955 107.894"></path><path d="M425.154 381.328c13.336 3.71 17.384-11.061 23.215-21.408 12.721-22.571 22.291-51.594 22.445-84.774.221-47.594-18.343-82.517-35.6-106.182h-8.511c-.586 3.874 2.226 7.315 3.866 10.276 13.166 23.762 25.367 56.553 25.54 94.194.2 43.176-14.162 79.278-30.955 107.894"></path><path d="M466.26 381.328c13.337 3.71 17.385-11.061 23.216-21.408 12.722-22.571 22.292-51.594 22.445-84.774.221-47.594-18.343-82.517-35.6-106.182h-8.51c-.587 3.874 2.225 7.315 3.865 10.276 13.166 23.762 25.367 56.553 25.54 94.194.2 43.176-14.162 79.278-30.955 107.894M4.477 383.005H72.58l18.573-28.484 64.169-.135s.065 19.413.065 28.62h48.756V160.307h-58.816c-5.653 9.537-140.85 222.697-140.85 222.697zm152.667-145.282v71.158l-40.453-.27 40.453-70.888z"></path></g>
139
- </symbol>
140
- <symbol viewBox="0 0 48 48" id="vjs-icon-next-item">
141
- <path d="M12 36l17-12-17-12v24zm20-24v24h4V12h-4z"></path>
142
- </symbol>
143
- <symbol viewBox="0 0 48 48" id="vjs-icon-previous-item">
144
- <path d="M12 12h4v24h-4zm7 12l17 12V12z"></path>
145
- </symbol>
146
- <symbol viewBox="0 0 48 48" id="vjs-icon-shuffle">
147
- <path d="M21.17 18.34L10.83 8 8 10.83l10.34 10.34 2.83-2.83zM29 8l4.09 4.09L8 37.17 10.83 40l25.09-25.09L40 19V8H29zm.66 18.83l-2.83 2.83 6.26 6.26L29 40h11V29l-4.09 4.09-6.25-6.26z"></path>
148
- </symbol>
149
- <symbol viewBox="0 0 48 48" id="vjs-icon-cast">
150
- <path d="M42 6H6c-2.21 0-4 1.79-4 4v6h4v-6h36v28H28v4h14c2.21 0 4-1.79 4-4V10c0-2.21-1.79-4-4-4zM2 36v6h6c0-3.31-2.69-6-6-6zm0-8v4c5.52 0 10 4.48 10 10h4c0-7.73-6.27-14-14-14zm0-8v4c9.94 0 18 8.06 18 18h4c0-12.15-9.85-22-22-22z"></path>
151
- </symbol>
152
- <symbol viewBox="0 0 48 48" id="vjs-icon-picture-in-picture-enter">
153
- <path d="M38 22H22v11.99h16V22zm8 16V9.96C46 7.76 44.2 6 42 6H6C3.8 6 2 7.76 2 9.96V38c0 2.2 1.8 4 4 4h36c2.2 0 4-1.8 4-4zm-4 .04H6V9.94h36v28.1z"></path>
154
- </symbol>
155
- <symbol viewBox="0 0 22 18" id="vjs-icon-picture-in-picture-exit">
156
- <path d="M18 4H4v10h14V4zm4 12V1.98C22 .88 21.1 0 20 0H2C.9 0 0 .88 0 1.98V16c0 1.1.9 2 2 2h18c1.1 0 2-.9 2-2zm-2 .02H2V1.97h18v14.05z"></path>
157
- <path fill="none" d="M-1-3h24v24H-1z"></path>
158
- </symbol>
159
- <symbol viewBox="0 0 1792 1792" id="vjs-icon-facebook">
160
- <path d="M1343 12v264h-157q-86 0-116 36t-30 108v189h293l-39 296h-254v759H734V905H479V609h255V391q0-186 104-288.5T1115 0q147 0 228 12z"></path>
161
- </symbol>
162
- <symbol viewBox="0 0 1792 1792" id="vjs-icon-linkedin">
163
- <path d="M477 625v991H147V625h330zm21-306q1 73-50.5 122T312 490h-2q-82 0-132-49t-50-122q0-74 51.5-122.5T314 148t133 48.5T498 319zm1166 729v568h-329v-530q0-105-40.5-164.5T1168 862q-63 0-105.5 34.5T999 982q-11 30-11 81v553H659q2-399 2-647t-1-296l-1-48h329v144h-2q20-32 41-56t56.5-52 87-43.5T1285 602q171 0 275 113.5t104 332.5z"></path>
164
- </symbol>
165
- <symbol viewBox="0 0 1200 1227" id="vjs-icon-twitter">
166
- <path d="M714.163 519.284L1160.89 0H1055.03L667.137 450.887L357.328 0H0L468.492 681.821L0 1226.37H105.866L515.491 750.218L842.672 1226.37H1200L714.137 519.284H714.163ZM569.165 687.828L521.697 619.934L144.011 79.6944H306.615L611.412 515.685L658.88 583.579L1055.08 1150.3H892.476L569.165 687.854V687.828Z"/>
167
- </symbol>
168
- <symbol viewBox="0 0 1792 1792" id="vjs-icon-tumblr">
169
- <path d="M1328 1329l80 237q-23 35-111 66t-177 32q-104 2-190.5-26T787 1564t-95-106-55.5-120-16.5-118V676H452V461q72-26 129-69.5t91-90 58-102 34-99T779 12q1-5 4.5-8.5T791 0h244v424h333v252h-334v518q0 30 6.5 56t22.5 52.5 49.5 41.5 81.5 14q78-2 134-29z"></path>
170
- </symbol>
171
- <symbol viewBox="0 0 1792 1792" id="vjs-icon-pinterest">
172
- <path d="M1664 896q0 209-103 385.5T1281.5 1561 896 1664q-111 0-218-32 59-93 78-164 9-34 54-211 20 39 73 67.5t114 28.5q121 0 216-68.5t147-188.5 52-270q0-114-59.5-214T1180 449t-255-63q-105 0-196 29t-154.5 77-109 110.5-67 129.5T377 866q0 104 40 183t117 111q30 12 38-20 2-7 8-31t8-30q6-23-11-43-51-61-51-151 0-151 104.5-259.5T904 517q151 0 235.5 82t84.5 213q0 170-68.5 289T980 1220q-61 0-98-43.5T859 1072q8-35 26.5-93.5t30-103T927 800q0-50-27-83t-77-33q-62 0-105 57t-43 142q0 73 25 122l-99 418q-17 70-13 177-206-91-333-281T128 896q0-209 103-385.5T510.5 231 896 128t385.5 103T1561 510.5 1664 896z"></path>
173
- </symbol>
174
- </defs>
175
- </svg>`;const M_=zc?10009:Wc?461:8,Ma={codes:{play:415,pause:19,ff:417,rw:412,back:M_},names:{415:"play",19:"pause",417:"ff",412:"rw",[M_]:"back"},isEventKey(s,e){return e=e.toLowerCase(),!!(this.names[s.keyCode]&&this.names[s.keyCode]===e)},getEventName(s){if(this.names[s.keyCode])return this.names[s.keyCode];if(this.codes[s.code]){const e=this.codes[s.code];return this.names[e]}return null}},R_=5;class iO extends ar{constructor(e){super(),this.player_=e,this.focusableComponents=[],this.isListening_=!1,this.isPaused_=!1,this.onKeyDown_=this.onKeyDown_.bind(this),this.lastFocusedComponent_=null}start(){this.isListening_||(this.player_.on("keydown",this.onKeyDown_),this.player_.on("modalKeydown",this.onKeyDown_),this.player_.on("loadedmetadata",()=>{this.focus(this.updateFocusableComponents()[0])}),this.player_.on("modalclose",()=>{this.refocusComponent()}),this.player_.on("focusin",this.handlePlayerFocus_.bind(this)),this.player_.on("focusout",this.handlePlayerBlur_.bind(this)),this.isListening_=!0,this.player_.errorDisplay&&this.player_.errorDisplay.on("aftermodalfill",()=>{this.updateFocusableComponents(),this.focusableComponents.length&&(this.focusableComponents.length>1?this.focusableComponents[1].focus():this.focusableComponents[0].focus())}))}stop(){this.player_.off("keydown",this.onKeyDown_),this.isListening_=!1}onKeyDown_(e){const t=e.originalEvent?e.originalEvent:e;if(["ArrowLeft","ArrowRight","ArrowUp","ArrowDown"].includes(t.key)){if(this.isPaused_)return;t.preventDefault();const i=t.key.substring(5).toLowerCase();this.move(i)}else if(Ma.isEventKey(t,"play")||Ma.isEventKey(t,"pause")||Ma.isEventKey(t,"ff")||Ma.isEventKey(t,"rw")){t.preventDefault();const i=Ma.getEventName(t);this.performMediaAction_(i)}else Ma.isEventKey(t,"Back")&&e.target&&typeof e.target.closeable=="function"&&e.target.closeable()&&(t.preventDefault(),e.target.close())}performMediaAction_(e){if(this.player_)switch(e){case"play":this.player_.paused()&&this.player_.play();break;case"pause":this.player_.paused()||this.player_.pause();break;case"ff":this.userSeek_(this.player_.currentTime()+R_);break;case"rw":this.userSeek_(this.player_.currentTime()-R_);break}}userSeek_(e){this.player_.liveTracker&&this.player_.liveTracker.isLive()&&this.player_.liveTracker.nextSeekedFromUser(),this.player_.currentTime(e)}pause(){this.isPaused_=!0}resume(){this.isPaused_=!1}handlePlayerBlur_(e){const t=e.relatedTarget;let i=null;const r=this.getCurrentComponent(e.target);t&&(i=!!t.closest(".video-js"),t.classList.contains("vjs-text-track-settings")&&!this.isPaused_&&this.searchForTrackSelect_()),(!e.currentTarget.contains(e.relatedTarget)&&!i||!t)&&(r&&r.name()==="CloseButton"?this.refocusComponent():(this.pause(),r&&r.el()&&(this.lastFocusedComponent_=r)))}handlePlayerFocus_(){this.getCurrentComponent()&&this.getCurrentComponent().getIsFocusable()&&this.resume()}updateFocusableComponents(){const e=this.player_,t=[];function i(r){for(const n of r)n.hasOwnProperty("el_")&&n.getIsFocusable()&&n.getIsAvailableToBeFocused(n.el())&&t.push(n),n.hasOwnProperty("children_")&&n.children_.length>0&&i(n.children_)}return e.children_.forEach(r=>{if(r.hasOwnProperty("el_"))if(r.getIsFocusable&&r.getIsAvailableToBeFocused&&r.getIsFocusable()&&r.getIsAvailableToBeFocused(r.el())){t.push(r);return}else r.hasOwnProperty("children_")&&r.children_.length>0?i(r.children_):r.hasOwnProperty("items")&&r.items.length>0?i(r.items):this.findSuitableDOMChild(r)&&t.push(r);if(r.name_==="ErrorDisplay"&&r.opened_){const n=r.el_.querySelector(".vjs-errors-ok-button-container");n&&n.querySelectorAll("button").forEach((o,l)=>{t.push({name:()=>"ModalButton"+(l+1),el:()=>o,getPositions:()=>{const u=o.getBoundingClientRect(),c={x:u.x,y:u.y,width:u.width,height:u.height,top:u.top,right:u.right,bottom:u.bottom,left:u.left},h={x:u.left+u.width/2,y:u.top+u.height/2,width:0,height:0,top:u.top+u.height/2,right:u.left+u.width/2,bottom:u.top+u.height/2,left:u.left+u.width/2};return{boundingClientRect:c,center:h}},getIsAvailableToBeFocused:()=>!0,getIsFocusable:u=>!0,focus:()=>o.focus()})})}}),this.focusableComponents=t,this.focusableComponents}findSuitableDOMChild(e){function t(i){if(e.getIsFocusable(i)&&e.getIsAvailableToBeFocused(i))return i;for(let r=0;r<i.children.length;r++){const n=i.children[r],a=t(n);if(a)return a}return null}return e.el()?t(e.el()):null}getCurrentComponent(e){this.updateFocusableComponents();const t=e||document.activeElement;if(this.focusableComponents.length){for(const i of this.focusableComponents)if(i.el()===t)return i}}add(e){const t=[...this.focusableComponents];e.hasOwnProperty("el_")&&e.getIsFocusable()&&e.getIsAvailableToBeFocused(e.el())&&t.push(e),this.focusableComponents=t,this.trigger({type:"focusableComponentsChanged",focusableComponents:this.focusableComponents})}remove(e){for(let t=0;t<this.focusableComponents.length;t++)if(this.focusableComponents[t].name()===e.name()){this.focusableComponents.splice(t,1),this.trigger({type:"focusableComponentsChanged",focusableComponents:this.focusableComponents});return}}clear(){this.focusableComponents.length>0&&(this.focusableComponents=[],this.trigger({type:"focusableComponentsChanged",focusableComponents:this.focusableComponents}))}move(e){const t=this.getCurrentComponent();if(!t)return;const i=t.getPositions(),r=this.focusableComponents.filter(a=>a!==t&&this.isInDirection_(i.boundingClientRect,a.getPositions().boundingClientRect,e)),n=this.findBestCandidate_(i.center,r,e);n?this.focus(n):this.trigger({type:"endOfFocusableComponents",direction:e,focusedComponent:t})}findBestCandidate_(e,t,i){let r=1/0,n=null;for(const a of t){const o=a.getPositions().center,l=this.calculateDistance_(e,o,i);l<r&&(r=l,n=a)}return n}isInDirection_(e,t,i){switch(i){case"right":return t.left>=e.right;case"left":return t.right<=e.left;case"down":return t.top>=e.bottom;case"up":return t.bottom<=e.top;default:return!1}}refocusComponent(){if(this.lastFocusedComponent_){this.player_.userActive()||this.player_.userActive(!0),this.updateFocusableComponents();for(let e=0;e<this.focusableComponents.length;e++)if(this.focusableComponents[e].name()===this.lastFocusedComponent_.name()){this.focus(this.focusableComponents[e]);return}}else this.focus(this.updateFocusableComponents()[0])}focus(e){typeof e=="object"&&(e.getIsAvailableToBeFocused(e.el())?e.focus():this.findSuitableDOMChild(e)&&this.findSuitableDOMChild(e).focus())}calculateDistance_(e,t,i){const r=Math.abs(e.x-t.x),n=Math.abs(e.y-t.y);let a;switch(i){case"right":case"left":a=r+n*100;break;case"up":a=n*2+r*.5;break;case"down":a=n*5+r;break;default:a=r+n}return a}searchForTrackSelect_(){const e=this;for(const t of e.updateFocusableComponents())if(t.constructor.name==="TextTrackSelect"){e.focus(t);break}}}let rO=class extends _e{constructor(e,t,i){const r=gt({createEl:!1},t);if(super(e,r,i),!t.playerOptions.sources||t.playerOptions.sources.length===0)for(let n=0,a=t.playerOptions.techOrder;n<a.length;n++){const o=qt(a[n]);let l=vt.getTech(o);if(o||(l=_e.getComponent(o)),l&&l.isSupported()){e.loadTech_(o);break}}else e.src(t.playerOptions.sources)}};_e.registerComponent("MediaLoader",rO);let ed=class extends _e{constructor(e,t){super(e,t),this.options_.controlText&&this.controlText(this.options_.controlText),this.handleMouseOver_=i=>this.handleMouseOver(i),this.handleMouseOut_=i=>this.handleMouseOut(i),this.handleClick_=i=>this.handleClick(i),this.handleKeyDown_=i=>this.handleKeyDown(i),this.emitTapEvents(),this.enable()}createEl(e="div",t={},i={}){t=Object.assign({className:this.buildCSSClass(),tabIndex:0},t),e==="button"&&et.error(`Creating a ClickableComponent with an HTML element of ${e} is not supported; use a Button instead.`),i=Object.assign({role:"button"},i),this.tabIndex_=t.tabIndex;const r=He(e,t,i);return this.player_.options_.experimentalSvgIcons||r.appendChild(He("span",{className:"vjs-icon-placeholder"},{"aria-hidden":!0})),this.createControlTextEl(r),r}dispose(){this.controlTextEl_=null,super.dispose()}createControlTextEl(e){return this.controlTextEl_=He("span",{className:"vjs-control-text"},{"aria-live":"polite"}),e&&e.appendChild(this.controlTextEl_),this.controlText(this.controlText_,e),this.controlTextEl_}controlText(e,t=this.el()){if(e===void 0)return this.controlText_||"Need Text";const i=this.localize(e);this.controlText_=e,ds(this.controlTextEl_,i),!this.nonIconControl&&!this.player_.options_.noUITitleAttributes&&t.setAttribute("title",i)}buildCSSClass(){return`vjs-control vjs-button ${super.buildCSSClass()}`}enable(){this.enabled_||(this.enabled_=!0,this.removeClass("vjs-disabled"),this.el_.setAttribute("aria-disabled","false"),typeof this.tabIndex_<"u"&&this.el_.setAttribute("tabIndex",this.tabIndex_),this.on(["tap","click"],this.handleClick_),this.on("keydown",this.handleKeyDown_))}disable(){this.enabled_=!1,this.addClass("vjs-disabled"),this.el_.setAttribute("aria-disabled","true"),typeof this.tabIndex_<"u"&&this.el_.removeAttribute("tabIndex"),this.off("mouseover",this.handleMouseOver_),this.off("mouseout",this.handleMouseOut_),this.off(["tap","click"],this.handleClick_),this.off("keydown",this.handleKeyDown_)}handleLanguagechange(){this.controlText(this.controlText_)}handleClick(e){this.options_.clickHandler&&this.options_.clickHandler.call(this,arguments)}handleKeyDown(e){e.key===" "||e.key==="Enter"?(e.preventDefault(),e.stopPropagation(),this.trigger("click")):super.handleKeyDown(e)}};_e.registerComponent("ClickableComponent",ed);let Fg=class extends ed{constructor(e,t){super(e,t),this.update(),this.update_=i=>this.update(i),e.on("posterchange",this.update_)}dispose(){this.player().off("posterchange",this.update_),super.dispose()}createEl(){return He("div",{className:"vjs-poster"})}crossOrigin(e){if(typeof e>"u")return this.$("img")?this.$("img").crossOrigin:this.player_.tech_&&this.player_.tech_.isReady_?this.player_.crossOrigin():this.player_.options_.crossOrigin||this.player_.options_.crossorigin||null;if(e!==null&&e!=="anonymous"&&e!=="use-credentials"){this.player_.log.warn(`crossOrigin must be null, "anonymous" or "use-credentials", given "${e}"`);return}this.$("img")&&(this.$("img").crossOrigin=e)}update(e){const t=this.player().poster();this.setSrc(t),t?this.show():this.hide()}setSrc(e){if(!e){this.el_.textContent="";return}this.$("img")||this.el_.appendChild(He("picture",{className:"vjs-poster",tabIndex:-1},{},He("img",{loading:"lazy",crossOrigin:this.crossOrigin()},{alt:""}))),this.$("img").src=e}handleClick(e){this.player_.controls()&&(this.player_.tech(!0)&&this.player_.tech(!0).focus(),this.player_.paused()?Gr(this.player_.play()):this.player_.pause())}};Fg.prototype.crossorigin=Fg.prototype.crossOrigin;_e.registerComponent("PosterImage",Fg);const fr="#222",F_="#ccc",nO={monospace:"monospace",sansSerif:"sans-serif",serif:"serif",monospaceSansSerif:'"Andale Mono", "Lucida Console", monospace',monospaceSerif:'"Courier New", monospace',proportionalSansSerif:"sans-serif",proportionalSerif:"serif",casual:'"Comic Sans MS", Impact, fantasy',script:'"Monotype Corsiva", cursive',smallcaps:'"Andale Mono", "Lucida Console", monospace, sans-serif'};function Lf(s,e){let t;if(s.length===4)t=s[1]+s[1]+s[2]+s[2]+s[3]+s[3];else if(s.length===7)t=s.slice(1);else throw new Error("Invalid color code provided, "+s+"; must be formatted as e.g. #f0e or #f604e2.");return"rgba("+parseInt(t.slice(0,2),16)+","+parseInt(t.slice(2,4),16)+","+parseInt(t.slice(4,6),16)+","+e+")"}function qr(s,e,t){try{s.style[e]=t}catch{return}}function B_(s){return s?`${s}px`:""}let sO=class extends _e{constructor(e,t,i){super(e,t,i);const r=a=>this.updateDisplay(a),n=a=>{this.updateDisplayOverlay(),this.updateDisplay(a)};e.on("loadstart",a=>this.toggleDisplay(a)),e.on("texttrackchange",r),e.on("loadedmetadata",a=>{this.updateDisplayOverlay(),this.preselectTrack(a)}),e.ready(St(this,function(){if(e.tech_&&e.tech_.featuresNativeTextTracks){this.hide();return}e.on("fullscreenchange",n),e.on("playerresize",n);const a=O.screen.orientation||O,o=O.screen.orientation?"change":"orientationchange";a.addEventListener(o,n),e.on("dispose",()=>a.removeEventListener(o,n));const l=this.options_.playerOptions.tracks||[];for(let u=0;u<l.length;u++)this.player_.addRemoteTextTrack(l[u],!0);this.preselectTrack()}))}preselectTrack(){const e={captions:1,subtitles:1},t=this.player_.textTracks(),i=this.player_.cache_.selectedLanguage;let r,n,a;for(let o=0;o<t.length;o++){const l=t[o];i&&i.enabled&&i.language&&i.language===l.language&&l.kind in e?l.kind===i.kind?a=l:a||(a=l):i&&!i.enabled?(a=null,r=null,n=null):l.default&&(l.kind==="descriptions"&&!r?r=l:l.kind in e&&!n&&(n=l))}a?a.mode="showing":n?n.mode="showing":r&&(r.mode="showing")}toggleDisplay(){this.player_.tech_&&this.player_.tech_.featuresNativeTextTracks?this.hide():this.show()}createEl(){return super.createEl("div",{className:"vjs-text-track-display"},{translate:"yes","aria-live":"off","aria-atomic":"true"})}clearDisplay(){typeof O.WebVTT=="function"&&O.WebVTT.processCues(O,[],this.el_)}updateDisplay(){const e=this.player_.textTracks(),t=this.options_.allowMultipleShowingTracks;if(this.clearDisplay(),t){const a=[];for(let o=0;o<e.length;++o){const l=e[o];l.mode==="showing"&&a.push(l)}this.updateForTrack(a);return}let i=null,r=null,n=e.length;for(;n--;){const a=e[n];a.mode==="showing"&&(a.kind==="descriptions"?i=a:r=a)}if(r?(this.getAttribute("aria-live")!=="off"&&this.setAttribute("aria-live","off"),this.updateForTrack(r)):i&&(this.getAttribute("aria-live")!=="assertive"&&this.setAttribute("aria-live","assertive"),this.updateForTrack(i)),!O.CSS.supports("inset","10px")){const a=this.el_,o=a.querySelectorAll(".vjs-text-track-cue"),l=this.player_.controlBar.el_.getBoundingClientRect().height,u=this.player_.el_.getBoundingClientRect().height;a.style="",qr(a,"position","relative"),qr(a,"height",u-l+"px"),qr(a,"top","unset"),Gc?qr(a,"bottom",u+"px"):qr(a,"bottom","0px"),o.length>0&&o.forEach(c=>{if(c.style.inset){const h=c.style.inset.split(" ");h.length===3&&Object.assign(c.style,{top:h[0],right:h[1],bottom:h[2],left:"unset"})}})}}updateDisplayOverlay(){if(!this.player_.videoHeight()||!O.CSS.supports("inset-inline: 10px"))return;const e=this.player_.currentWidth(),t=this.player_.currentHeight(),i=e/t,r=this.player_.videoWidth()/this.player_.videoHeight();let n=0,a=0;Math.abs(i-r)>.1&&(i>r?n=Math.round((e-t*r)/2):a=Math.round((t-e/r)/2)),qr(this.el_,"insetInline",B_(n)),qr(this.el_,"insetBlock",B_(a))}updateDisplayState(e){const t=this.player_.textTrackSettings.getValues(),i=e.activeCues;let r=i.length;for(;r--;){const n=i[r];if(!n)continue;const a=n.displayState;if(t.color&&(a.firstChild.style.color=t.color),t.textOpacity&&qr(a.firstChild,"color",Lf(t.color||"#fff",t.textOpacity)),t.backgroundColor&&(a.firstChild.style.backgroundColor=t.backgroundColor),t.backgroundOpacity&&qr(a.firstChild,"backgroundColor",Lf(t.backgroundColor||"#000",t.backgroundOpacity)),t.windowColor&&(t.windowOpacity?qr(a,"backgroundColor",Lf(t.windowColor,t.windowOpacity)):a.style.backgroundColor=t.windowColor),t.edgeStyle&&(t.edgeStyle==="dropshadow"?a.firstChild.style.textShadow=`2px 2px 3px ${fr}, 2px 2px 4px ${fr}, 2px 2px 5px ${fr}`:t.edgeStyle==="raised"?a.firstChild.style.textShadow=`1px 1px ${fr}, 2px 2px ${fr}, 3px 3px ${fr}`:t.edgeStyle==="depressed"?a.firstChild.style.textShadow=`1px 1px ${F_}, 0 1px ${F_}, -1px -1px ${fr}, 0 -1px ${fr}`:t.edgeStyle==="uniform"&&(a.firstChild.style.textShadow=`0 0 4px ${fr}, 0 0 4px ${fr}, 0 0 4px ${fr}, 0 0 4px ${fr}`)),t.fontPercent&&t.fontPercent!==1){const o=O.parseFloat(a.style.fontSize);a.style.fontSize=o*t.fontPercent+"px",a.style.height="auto",a.style.top="auto"}t.fontFamily&&t.fontFamily!=="default"&&(t.fontFamily==="small-caps"?a.firstChild.style.fontVariant="small-caps":a.firstChild.style.fontFamily=nO[t.fontFamily])}}updateForTrack(e){if(Array.isArray(e)||(e=[e]),typeof O.WebVTT!="function"||e.every(i=>!i.activeCues))return;const t=[];for(let i=0;i<e.length;++i){const r=e[i];for(let n=0;n<r.activeCues.length;++n)t.push(r.activeCues[n])}O.WebVTT.processCues(O,t,this.el_);for(let i=0;i<e.length;++i){const r=e[i];for(let n=0;n<r.activeCues.length;++n){const a=r.activeCues[n].displayState;Qs(a,"vjs-text-track-cue","vjs-text-track-cue-"+(r.language?r.language:i)),r.language&&yo(a,"lang",r.language)}this.player_.textTrackSettings&&this.updateDisplayState(r)}}};_e.registerComponent("TextTrackDisplay",sO);let aO=class extends _e{createEl(){const e=this.player_.isAudio(),t=this.localize(e?"Audio Player":"Video Player"),i=He("span",{className:"vjs-control-text",textContent:this.localize("{1} is loading.",[t])}),r=super.createEl("div",{className:"vjs-loading-spinner",dir:"ltr"});return r.appendChild(i),r}handleLanguagechange(){this.$(".vjs-control-text").textContent=this.localize("{1} is loading.",[this.player_.isAudio()?"Audio Player":"Video Player"])}};_e.registerComponent("LoadingSpinner",aO);let _i=class extends ed{createEl(e,t={},i={}){e="button",t=Object.assign({className:this.buildCSSClass()},t),i=Object.assign({type:"button"},i);const r=He(e,t,i);return this.player_.options_.experimentalSvgIcons||r.appendChild(He("span",{className:"vjs-icon-placeholder"},{"aria-hidden":!0})),this.createControlTextEl(r),r}addChild(e,t={}){const i=this.constructor.name;return et.warn(`Adding an actionable (user controllable) child to a Button (${i}) is not supported; use a ClickableComponent instead.`),_e.prototype.addChild.call(this,e,t)}enable(){super.enable(),this.el_.removeAttribute("disabled")}disable(){super.disable(),this.el_.setAttribute("disabled","disabled")}handleKeyDown(e){if(e.key===" "||e.key==="Enter"){e.stopPropagation();return}super.handleKeyDown(e)}};_e.registerComponent("Button",_i);let IE=class extends _i{constructor(e,t){super(e,t),this.mouseused_=!1,this.setIcon("play"),this.on("mousedown",i=>this.handleMouseDown(i))}buildCSSClass(){return"vjs-big-play-button"}handleClick(e){const t=this.player_.play();if(this.mouseused_&&"clientX"in e&&"clientY"in e){Gr(t),this.player_.tech(!0)&&this.player_.tech(!0).focus();return}const i=this.player_.getChild("controlBar"),r=i&&i.getChild("playToggle");if(!r){this.player_.tech(!0).focus();return}const n=()=>r.focus();Bl(t)?t.then(n,()=>{}):this.setTimeout(n,1)}handleKeyDown(e){this.mouseused_=!1,super.handleKeyDown(e)}handleMouseDown(e){this.mouseused_=!0}};IE.prototype.controlText_="Play Video";_e.registerComponent("BigPlayButton",IE);let oO=class extends _i{constructor(e,t){super(e,t),this.setIcon("cancel"),this.controlText(t&&t.controlText||this.localize("Close"))}buildCSSClass(){return`vjs-close-button ${super.buildCSSClass()}`}handleClick(e){this.trigger({type:"close",bubbles:!1})}handleKeyDown(e){e.key==="Escape"?(e.preventDefault(),e.stopPropagation(),this.trigger("click")):super.handleKeyDown(e)}};_e.registerComponent("CloseButton",oO);let PE=class extends _i{constructor(e,t={}){super(e,t),t.replay=t.replay===void 0||t.replay,this.setIcon("play"),this.on(e,"play",i=>this.handlePlay(i)),this.on(e,"pause",i=>this.handlePause(i)),t.replay&&this.on(e,"ended",i=>this.handleEnded(i))}buildCSSClass(){return`vjs-play-control ${super.buildCSSClass()}`}handleClick(e){this.player_.paused()?Gr(this.player_.play()):this.player_.pause()}handleSeeked(e){this.removeClass("vjs-ended"),this.player_.paused()?this.handlePause(e):this.handlePlay(e)}handlePlay(e){this.removeClass("vjs-ended","vjs-paused"),this.addClass("vjs-playing"),this.setIcon("pause"),this.controlText("Pause")}handlePause(e){this.removeClass("vjs-playing"),this.addClass("vjs-paused"),this.setIcon("play"),this.controlText("Play")}handleEnded(e){this.removeClass("vjs-playing"),this.addClass("vjs-ended"),this.setIcon("replay"),this.controlText("Replay"),this.one(this.player_,"seeked",t=>this.handleSeeked(t))}};PE.prototype.controlText_="Play";_e.registerComponent("PlayToggle",PE);let Bo=class extends _e{constructor(e,t){super(e,t),this.on(e,["timeupdate","ended","seeking"],i=>this.update(i)),this.updateTextNode_()}createEl(){const e=this.buildCSSClass(),t=super.createEl("div",{className:`${e} vjs-time-control vjs-control`}),i=He("span",{className:"vjs-control-text",textContent:`${this.localize(this.labelText_)} `},{role:"presentation"});return t.appendChild(i),this.contentEl_=He("span",{className:`${e}-display`},{role:"presentation"}),t.appendChild(this.contentEl_),t}dispose(){this.contentEl_=null,this.textNode_=null,super.dispose()}update(e){!this.player_.options_.enableSmoothSeeking&&e.type==="seeking"||this.updateContent(e)}updateTextNode_(e=0){e=oa(e),this.formattedTime_!==e&&(this.formattedTime_=e,this.requestNamedAnimationFrame("TimeDisplay#updateTextNode_",()=>{if(!this.contentEl_)return;let t=this.textNode_;t&&this.contentEl_.firstChild!==t&&(t=null,et.warn("TimeDisplay#updateTextnode_: Prevented replacement of text node element since it was no longer a child of this node. Appending a new node instead.")),this.textNode_=ce.createTextNode(this.formattedTime_),this.textNode_&&(t?this.contentEl_.replaceChild(this.textNode_,t):this.contentEl_.appendChild(this.textNode_))}))}updateContent(e){}};Bo.prototype.labelText_="Time";Bo.prototype.controlText_="Time";_e.registerComponent("TimeDisplay",Bo);let Zv=class extends Bo{buildCSSClass(){return"vjs-current-time"}updateContent(e){let t;this.player_.ended()?t=this.player_.duration():t=this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime(),this.updateTextNode_(t)}};Zv.prototype.labelText_="Current Time";Zv.prototype.controlText_="Current Time";_e.registerComponent("CurrentTimeDisplay",Zv);let e0=class extends Bo{constructor(e,t){super(e,t);const i=r=>this.updateContent(r);this.on(e,"durationchange",i),this.on(e,"loadstart",i),this.on(e,"loadedmetadata",i)}buildCSSClass(){return"vjs-duration"}updateContent(e){const t=this.player_.duration();this.updateTextNode_(t)}};e0.prototype.labelText_="Duration";e0.prototype.controlText_="Duration";_e.registerComponent("DurationDisplay",e0);let lO=class extends _e{createEl(){const e=super.createEl("div",{className:"vjs-time-control vjs-time-divider"},{"aria-hidden":!0}),t=super.createEl("div"),i=super.createEl("span",{textContent:"/"});return t.appendChild(i),e.appendChild(t),e}};_e.registerComponent("TimeDivider",lO);let t0=class extends Bo{constructor(e,t){super(e,t),this.on(e,"durationchange",i=>this.updateContent(i))}buildCSSClass(){return"vjs-remaining-time"}createEl(){const e=super.createEl();return this.options_.displayNegative!==!1&&e.insertBefore(He("span",{},{"aria-hidden":!0},"-"),this.contentEl_),e}updateContent(e){if(typeof this.player_.duration()!="number")return;let t;this.player_.ended()?t=0:this.player_.remainingTimeDisplay?t=this.player_.remainingTimeDisplay():t=this.player_.remainingTime(),this.updateTextNode_(t)}};t0.prototype.labelText_="Remaining Time";t0.prototype.controlText_="Remaining Time";_e.registerComponent("RemainingTimeDisplay",t0);let uO=class extends _e{constructor(e,t){super(e,t),this.updateShowing(),this.on(this.player(),"durationchange",i=>this.updateShowing(i))}createEl(){const e=super.createEl("div",{className:"vjs-live-control vjs-control"});return this.contentEl_=He("div",{className:"vjs-live-display"},{"aria-live":"off"}),this.contentEl_.appendChild(He("span",{className:"vjs-control-text",textContent:`${this.localize("Stream Type")} `})),this.contentEl_.appendChild(ce.createTextNode(this.localize("LIVE"))),e.appendChild(this.contentEl_),e}dispose(){this.contentEl_=null,super.dispose()}updateShowing(e){this.player().duration()===1/0?this.show():this.hide()}};_e.registerComponent("LiveDisplay",uO);let DE=class extends _i{constructor(e,t){super(e,t),this.updateLiveEdgeStatus(),this.player_.liveTracker&&(this.updateLiveEdgeStatusHandler_=i=>this.updateLiveEdgeStatus(i),this.on(this.player_.liveTracker,"liveedgechange",this.updateLiveEdgeStatusHandler_))}createEl(){const e=super.createEl("button",{className:"vjs-seek-to-live-control vjs-control"});return this.setIcon("circle",e),this.textEl_=He("span",{className:"vjs-seek-to-live-text",textContent:this.localize("LIVE")},{"aria-hidden":"true"}),e.appendChild(this.textEl_),e}updateLiveEdgeStatus(){!this.player_.liveTracker||this.player_.liveTracker.atLiveEdge()?(this.setAttribute("aria-disabled",!0),this.addClass("vjs-at-live-edge"),this.controlText("Seek to live, currently playing live")):(this.setAttribute("aria-disabled",!1),this.removeClass("vjs-at-live-edge"),this.controlText("Seek to live, currently behind live"))}handleClick(){this.player_.liveTracker.seekToLiveEdge()}dispose(){this.player_.liveTracker&&this.off(this.player_.liveTracker,"liveedgechange",this.updateLiveEdgeStatusHandler_),this.textEl_=null,super.dispose()}};DE.prototype.controlText_="Seek to live, currently playing live";_e.registerComponent("SeekToLive",DE);function lu(s,e,t){return s=Number(s),Math.min(t,Math.max(e,isNaN(s)?e:s))}var cO=Object.freeze({__proto__:null,clamp:lu});let i0=class extends _e{constructor(e,t){super(e,t),this.handleMouseDown_=i=>this.handleMouseDown(i),this.handleMouseUp_=i=>this.handleMouseUp(i),this.handleKeyDown_=i=>this.handleKeyDown(i),this.handleClick_=i=>this.handleClick(i),this.handleMouseMove_=i=>this.handleMouseMove(i),this.update_=i=>this.update(i),this.bar=this.getChild(this.options_.barName),this.vertical(!!this.options_.vertical),this.enable()}enabled(){return this.enabled_}enable(){this.enabled()||(this.on("mousedown",this.handleMouseDown_),this.on("touchstart",this.handleMouseDown_),this.on("keydown",this.handleKeyDown_),this.on("click",this.handleClick_),this.on(this.player_,"controlsvisible",this.update),this.playerEvent&&this.on(this.player_,this.playerEvent,this.update),this.removeClass("disabled"),this.setAttribute("tabindex",0),this.enabled_=!0)}disable(){if(!this.enabled())return;const e=this.bar.el_.ownerDocument;this.off("mousedown",this.handleMouseDown_),this.off("touchstart",this.handleMouseDown_),this.off("keydown",this.handleKeyDown_),this.off("click",this.handleClick_),this.off(this.player_,"controlsvisible",this.update_),this.off(e,"mousemove",this.handleMouseMove_),this.off(e,"mouseup",this.handleMouseUp_),this.off(e,"touchmove",this.handleMouseMove_),this.off(e,"touchend",this.handleMouseUp_),this.removeAttribute("tabindex"),this.addClass("disabled"),this.playerEvent&&this.off(this.player_,this.playerEvent,this.update),this.enabled_=!1}createEl(e,t={},i={}){return t.className=t.className+" vjs-slider",t=Object.assign({tabIndex:0},t),i=Object.assign({role:"slider","aria-valuenow":0,"aria-valuemin":0,"aria-valuemax":100},i),super.createEl(e,t,i)}handleMouseDown(e){const t=this.bar.el_.ownerDocument;e.type==="mousedown"&&e.preventDefault(),e.type==="touchstart"&&!rn&&e.preventDefault(),rE(),this.addClass("vjs-sliding"),this.trigger("slideractive"),this.on(t,"mousemove",this.handleMouseMove_),this.on(t,"mouseup",this.handleMouseUp_),this.on(t,"touchmove",this.handleMouseMove_),this.on(t,"touchend",this.handleMouseUp_),this.handleMouseMove(e,!0)}handleMouseMove(e){}handleMouseUp(e){const t=this.bar.el_.ownerDocument;nE(),this.removeClass("vjs-sliding"),this.trigger("sliderinactive"),this.off(t,"mousemove",this.handleMouseMove_),this.off(t,"mouseup",this.handleMouseUp_),this.off(t,"touchmove",this.handleMouseMove_),this.off(t,"touchend",this.handleMouseUp_),this.update()}update(){if(!this.el_||!this.bar)return;const e=this.getProgress();return e===this.progress_||(this.progress_=e,this.requestNamedAnimationFrame("Slider#update",()=>{const t=this.vertical()?"height":"width";this.bar.el().style[t]=(e*100).toFixed(2)+"%"})),e}getProgress(){return Number(lu(this.getPercent(),0,1).toFixed(4))}calculateDistance(e){const t=Kh(this.el_,e);return this.vertical()?t.y:t.x}handleKeyDown(e){const t=this.options_.playerOptions.spatialNavigation,i=t&&t.enabled,r=t&&t.horizontalSeek;i?r&&e.key==="ArrowLeft"||!r&&e.key==="ArrowDown"?(e.preventDefault(),e.stopPropagation(),this.stepBack()):r&&e.key==="ArrowRight"||!r&&e.key==="ArrowUp"?(e.preventDefault(),e.stopPropagation(),this.stepForward()):super.handleKeyDown(e):e.key==="ArrowLeft"||e.key==="ArrowDown"?(e.preventDefault(),e.stopPropagation(),this.stepBack()):e.key==="ArrowUp"||e.key==="ArrowRight"?(e.preventDefault(),e.stopPropagation(),this.stepForward()):super.handleKeyDown(e)}handleClick(e){e.stopPropagation(),e.preventDefault()}vertical(e){if(e===void 0)return this.vertical_||!1;this.vertical_=!!e,this.vertical_?this.addClass("vjs-slider-vertical"):this.addClass("vjs-slider-horizontal")}};_e.registerComponent("Slider",i0);const Of=(s,e)=>lu(s/e*100,0,100).toFixed(2)+"%";let hO=class extends _e{constructor(e,t){super(e,t),this.partEls_=[],this.on(e,"progress",i=>this.update(i))}createEl(){const e=super.createEl("div",{className:"vjs-load-progress"}),t=He("span",{className:"vjs-control-text"}),i=He("span",{textContent:this.localize("Loaded")}),r=ce.createTextNode(": ");return this.percentageEl_=He("span",{className:"vjs-control-text-loaded-percentage",textContent:"0%"}),e.appendChild(t),t.appendChild(i),t.appendChild(r),t.appendChild(this.percentageEl_),e}dispose(){this.partEls_=null,this.percentageEl_=null,super.dispose()}update(e){this.requestNamedAnimationFrame("LoadProgressBar#update",()=>{const t=this.player_.liveTracker,i=this.player_.buffered(),r=t&&t.isLive()?t.seekableEnd():this.player_.duration(),n=this.player_.bufferedEnd(),a=this.partEls_,o=Of(n,r);this.percent_!==o&&(this.el_.style.width=o,ds(this.percentageEl_,o),this.percent_=o);for(let l=0;l<i.length;l++){const u=i.start(l),c=i.end(l);let h=a[l];h||(h=this.el_.appendChild(He()),a[l]=h),!(h.dataset.start===u&&h.dataset.end===c)&&(h.dataset.start=u,h.dataset.end=c,h.style.left=Of(u,n),h.style.width=Of(c-u,n))}for(let l=a.length;l>i.length;l--)this.el_.removeChild(a[l-1]);a.length=i.length})}};_e.registerComponent("LoadProgressBar",hO);let dO=class extends _e{constructor(e,t){super(e,t),this.update=nn(St(this,this.update),_r)}createEl(){return super.createEl("div",{className:"vjs-time-tooltip"},{"aria-hidden":"true"})}update(e,t,i){const r=Kl(this.el_),n=_o(this.player_.el()),a=e.width*t;if(!n||!r)return;let o=e.left-n.left+a,l=e.width-a+(n.right-e.right);l||(l=e.width-a,o=a);let u=r.width/2;o<u?u+=u-o:l<u&&(u=l),u<0?u=0:u>r.width&&(u=r.width),u=Math.round(u),this.el_.style.right=`-${u}px`,this.write(i)}write(e){ds(this.el_,e)}updateTime(e,t,i,r){this.requestNamedAnimationFrame("TimeTooltip#updateTime",()=>{let n;const a=this.player_.duration();if(this.player_.liveTracker&&this.player_.liveTracker.isLive()){const o=this.player_.liveTracker.liveWindow(),l=o-t*o;n=(l<1?"":"-")+oa(l,o)}else n=oa(i,a);this.update(e,t,n),r&&r()})}};_e.registerComponent("TimeTooltip",dO);let r0=class extends _e{constructor(e,t){super(e,t),this.setIcon("circle"),this.update=nn(St(this,this.update),_r)}createEl(){return super.createEl("div",{className:"vjs-play-progress vjs-slider-bar"},{"aria-hidden":"true"})}update(e,t){const i=this.getChild("timeTooltip");if(!i)return;const r=this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime();i.updateTime(e,t,r)}};r0.prototype.options_={children:[]};!Li&&!tn&&r0.prototype.options_.children.push("timeTooltip");_e.registerComponent("PlayProgressBar",r0);let NE=class extends _e{constructor(e,t){super(e,t),this.update=nn(St(this,this.update),_r)}createEl(){return super.createEl("div",{className:"vjs-mouse-display"})}update(e,t){const i=t*this.player_.duration();this.getChild("timeTooltip").updateTime(e,t,i,()=>{this.el_.style.left=`${e.width*t}px`})}};NE.prototype.options_={children:["timeTooltip"]};_e.registerComponent("MouseTimeDisplay",NE);const nc=5,U_=12;let n0=class extends i0{constructor(e,t){super(e,t),this.setEventHandlers_()}setEventHandlers_(){this.update_=St(this,this.update),this.update=nn(this.update_,_r),this.on(this.player_,["durationchange","timeupdate"],this.update),this.on(this.player_,["ended"],this.update_),this.player_.liveTracker&&this.on(this.player_.liveTracker,"liveedgechange",this.update),this.updateInterval=null,this.enableIntervalHandler_=e=>this.enableInterval_(e),this.disableIntervalHandler_=e=>this.disableInterval_(e),this.on(this.player_,["playing"],this.enableIntervalHandler_),this.on(this.player_,["ended","pause","waiting"],this.disableIntervalHandler_),"hidden"in ce&&"visibilityState"in ce&&this.on(ce,"visibilitychange",this.toggleVisibility_)}toggleVisibility_(e){ce.visibilityState==="hidden"?(this.cancelNamedAnimationFrame("SeekBar#update"),this.cancelNamedAnimationFrame("Slider#update"),this.disableInterval_(e)):(!this.player_.ended()&&!this.player_.paused()&&this.enableInterval_(),this.update())}enableInterval_(){this.updateInterval||(this.updateInterval=this.setInterval(this.update,_r))}disableInterval_(e){this.player_.liveTracker&&this.player_.liveTracker.isLive()&&e&&e.type!=="ended"||this.updateInterval&&(this.clearInterval(this.updateInterval),this.updateInterval=null)}createEl(){return super.createEl("div",{className:"vjs-progress-holder"},{"aria-label":this.localize("Progress Bar")})}update(e){if(ce.visibilityState==="hidden")return;const t=super.update();return this.requestNamedAnimationFrame("SeekBar#update",()=>{const i=this.player_.ended()?this.player_.duration():this.getCurrentTime_(),r=this.player_.liveTracker;let n=this.player_.duration();r&&r.isLive()&&(n=this.player_.liveTracker.liveCurrentTime()),this.percent_!==t&&(this.el_.setAttribute("aria-valuenow",(t*100).toFixed(2)),this.percent_=t),(this.currentTime_!==i||this.duration_!==n)&&(this.el_.setAttribute("aria-valuetext",this.localize("progress bar timing: currentTime={1} duration={2}",[oa(i,n),oa(n,n)],"{1} of {2}")),this.currentTime_=i,this.duration_=n),this.bar&&this.bar.update(_o(this.el()),this.getProgress())}),t}userSeek_(e){this.player_.liveTracker&&this.player_.liveTracker.isLive()&&this.player_.liveTracker.nextSeekedFromUser(),this.player_.currentTime(e)}getCurrentTime_(){return this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime()}getPercent(){const e=this.getCurrentTime_();let t;const i=this.player_.liveTracker;return i&&i.isLive()?(t=(e-i.seekableStart())/i.liveWindow(),i.atLiveEdge()&&(t=1)):t=e/this.player_.duration(),t}handleMouseDown(e){Xl(e)&&(e.stopPropagation(),this.videoWasPlaying=!this.player_.paused(),this.player_.pause(),super.handleMouseDown(e))}handleMouseMove(e,t=!1){if(!Xl(e)||isNaN(this.player_.duration()))return;!t&&!this.player_.scrubbing()&&this.player_.scrubbing(!0);let i;const r=this.calculateDistance(e),n=this.player_.liveTracker;if(!n||!n.isLive())i=r*this.player_.duration(),i===this.player_.duration()&&(i=i-.1);else{if(r>=.99){n.seekToLiveEdge();return}const a=n.seekableStart(),o=n.liveCurrentTime();if(i=a+r*n.liveWindow(),i>=o&&(i=o),i<=a&&(i=a+.1),i===1/0)return}this.userSeek_(i),this.player_.options_.enableSmoothSeeking&&this.update()}enable(){super.enable();const e=this.getChild("mouseTimeDisplay");e&&e.show()}disable(){super.disable();const e=this.getChild("mouseTimeDisplay");e&&e.hide()}handleMouseUp(e){super.handleMouseUp(e),e&&e.stopPropagation(),this.player_.scrubbing(!1),this.player_.trigger({type:"timeupdate",target:this,manuallyTriggered:!0}),this.videoWasPlaying?Gr(this.player_.play()):this.update_()}stepForward(){this.userSeek_(this.player_.currentTime()+nc)}stepBack(){this.userSeek_(this.player_.currentTime()-nc)}handleAction(e){this.player_.paused()?this.player_.play():this.player_.pause()}handleKeyDown(e){const t=this.player_.liveTracker;if(e.key===" "||e.key==="Enter")e.preventDefault(),e.stopPropagation(),this.handleAction(e);else if(e.key==="Home")e.preventDefault(),e.stopPropagation(),this.userSeek_(0);else if(e.key==="End")e.preventDefault(),e.stopPropagation(),t&&t.isLive()?this.userSeek_(t.liveCurrentTime()):this.userSeek_(this.player_.duration());else if(/^[0-9]$/.test(e.key)){e.preventDefault(),e.stopPropagation();const i=parseInt(e.key,10)*.1;t&&t.isLive()?this.userSeek_(t.seekableStart()+t.liveWindow()*i):this.userSeek_(this.player_.duration()*i)}else e.key==="PageDown"?(e.preventDefault(),e.stopPropagation(),this.userSeek_(this.player_.currentTime()-nc*U_)):e.key==="PageUp"?(e.preventDefault(),e.stopPropagation(),this.userSeek_(this.player_.currentTime()+nc*U_)):super.handleKeyDown(e)}dispose(){this.disableInterval_(),this.off(this.player_,["durationchange","timeupdate"],this.update),this.off(this.player_,["ended"],this.update_),this.player_.liveTracker&&this.off(this.player_.liveTracker,"liveedgechange",this.update),this.off(this.player_,["playing"],this.enableIntervalHandler_),this.off(this.player_,["ended","pause","waiting"],this.disableIntervalHandler_),"hidden"in ce&&"visibilityState"in ce&&this.off(ce,"visibilitychange",this.toggleVisibility_),super.dispose()}};n0.prototype.options_={children:["loadProgressBar","playProgressBar"],barName:"playProgressBar"};!Li&&!tn&&n0.prototype.options_.children.splice(1,0,"mouseTimeDisplay");_e.registerComponent("SeekBar",n0);let LE=class extends _e{constructor(e,t){super(e,t),this.handleMouseMove=nn(St(this,this.handleMouseMove),_r),this.throttledHandleMouseSeek=nn(St(this,this.handleMouseSeek),_r),this.handleMouseUpHandler_=i=>this.handleMouseUp(i),this.handleMouseDownHandler_=i=>this.handleMouseDown(i),this.enable()}createEl(){return super.createEl("div",{className:"vjs-progress-control vjs-control"})}handleMouseMove(e){const t=this.getChild("seekBar");if(!t)return;const i=t.getChild("playProgressBar"),r=t.getChild("mouseTimeDisplay");if(!i&&!r)return;const n=t.el(),a=Kl(n);let o=Kh(n,e).x;o=lu(o,0,1),r&&r.update(a,o),i&&i.update(a,t.getProgress())}handleMouseSeek(e){const t=this.getChild("seekBar");t&&t.handleMouseMove(e)}enabled(){return this.enabled_}disable(){if(this.children().forEach(e=>e.disable&&e.disable()),!!this.enabled()&&(this.off(["mousedown","touchstart"],this.handleMouseDownHandler_),this.off(this.el_,"mousemove",this.handleMouseMove),this.removeListenersAddedOnMousedownAndTouchstart(),this.addClass("disabled"),this.enabled_=!1,this.player_.scrubbing())){const e=this.getChild("seekBar");this.player_.scrubbing(!1),e.videoWasPlaying&&Gr(this.player_.play())}}enable(){this.children().forEach(e=>e.enable&&e.enable()),!this.enabled()&&(this.on(["mousedown","touchstart"],this.handleMouseDownHandler_),this.on(this.el_,"mousemove",this.handleMouseMove),this.removeClass("disabled"),this.enabled_=!0)}removeListenersAddedOnMousedownAndTouchstart(){const e=this.el_.ownerDocument;this.off(e,"mousemove",this.throttledHandleMouseSeek),this.off(e,"touchmove",this.throttledHandleMouseSeek),this.off(e,"mouseup",this.handleMouseUpHandler_),this.off(e,"touchend",this.handleMouseUpHandler_)}handleMouseDown(e){const t=this.el_.ownerDocument,i=this.getChild("seekBar");i&&i.handleMouseDown(e),this.on(t,"mousemove",this.throttledHandleMouseSeek),this.on(t,"touchmove",this.throttledHandleMouseSeek),this.on(t,"mouseup",this.handleMouseUpHandler_),this.on(t,"touchend",this.handleMouseUpHandler_)}handleMouseUp(e){const t=this.getChild("seekBar");t&&t.handleMouseUp(e),this.removeListenersAddedOnMousedownAndTouchstart()}};LE.prototype.options_={children:["seekBar"]};_e.registerComponent("ProgressControl",LE);let OE=class extends _i{constructor(e,t){super(e,t),this.setIcon("picture-in-picture-enter"),this.on(e,["enterpictureinpicture","leavepictureinpicture"],i=>this.handlePictureInPictureChange(i)),this.on(e,["disablepictureinpicturechanged","loadedmetadata"],i=>this.handlePictureInPictureEnabledChange(i)),this.on(e,["loadedmetadata","audioonlymodechange","audiopostermodechange"],()=>this.handlePictureInPictureAudioModeChange()),this.disable()}buildCSSClass(){return`vjs-picture-in-picture-control vjs-hidden ${super.buildCSSClass()}`}handlePictureInPictureAudioModeChange(){if(!(this.player_.currentType().substring(0,5)==="audio"||this.player_.audioPosterMode()||this.player_.audioOnlyMode())){this.show();return}this.player_.isInPictureInPicture()&&this.player_.exitPictureInPicture(),this.hide()}handlePictureInPictureEnabledChange(){ce.pictureInPictureEnabled&&this.player_.disablePictureInPicture()===!1||this.player_.options_.enableDocumentPictureInPicture&&"documentPictureInPicture"in O?this.enable():this.disable()}handlePictureInPictureChange(e){this.player_.isInPictureInPicture()?(this.setIcon("picture-in-picture-exit"),this.controlText("Exit Picture-in-Picture")):(this.setIcon("picture-in-picture-enter"),this.controlText("Picture-in-Picture")),this.handlePictureInPictureEnabledChange()}handleClick(e){this.player_.isInPictureInPicture()?this.player_.exitPictureInPicture():this.player_.requestPictureInPicture()}show(){typeof ce.exitPictureInPicture=="function"&&super.show()}};OE.prototype.controlText_="Picture-in-Picture";_e.registerComponent("PictureInPictureToggle",OE);let ME=class extends _i{constructor(e,t){super(e,t),this.setIcon("fullscreen-enter"),this.on(e,"fullscreenchange",i=>this.handleFullscreenChange(i)),ce[e.fsApi_.fullscreenEnabled]===!1&&this.disable()}buildCSSClass(){return`vjs-fullscreen-control ${super.buildCSSClass()}`}handleFullscreenChange(e){this.player_.isFullscreen()?(this.controlText("Exit Fullscreen"),this.setIcon("fullscreen-exit")):(this.controlText("Fullscreen"),this.setIcon("fullscreen-enter"))}handleClick(e){this.player_.isFullscreen()?this.player_.exitFullscreen():this.player_.requestFullscreen()}};ME.prototype.controlText_="Fullscreen";_e.registerComponent("FullscreenToggle",ME);const fO=function(s,e){e.tech_&&!e.tech_.featuresVolumeControl&&s.addClass("vjs-hidden"),s.on(e,"loadstart",function(){e.tech_.featuresVolumeControl?s.removeClass("vjs-hidden"):s.addClass("vjs-hidden")})};let pO=class extends _e{createEl(){const e=super.createEl("div",{className:"vjs-volume-level"});return this.setIcon("circle",e),e.appendChild(super.createEl("span",{className:"vjs-control-text"})),e}};_e.registerComponent("VolumeLevel",pO);let mO=class extends _e{constructor(e,t){super(e,t),this.update=nn(St(this,this.update),_r)}createEl(){return super.createEl("div",{className:"vjs-volume-tooltip"},{"aria-hidden":"true"})}update(e,t,i,r){if(!i){const n=_o(this.el_),a=_o(this.player_.el()),o=e.width*t;if(!a||!n)return;const l=e.left-a.left+o,u=e.width-o+(a.right-e.right);let c=n.width/2;l<c?c+=c-l:u<c&&(c=u),c<0?c=0:c>n.width&&(c=n.width),this.el_.style.right=`-${c}px`}this.write(`${r}%`)}write(e){ds(this.el_,e)}updateVolume(e,t,i,r,n){this.requestNamedAnimationFrame("VolumeLevelTooltip#updateVolume",()=>{this.update(e,t,i,r.toFixed(0)),n&&n()})}};_e.registerComponent("VolumeLevelTooltip",mO);let RE=class extends _e{constructor(e,t){super(e,t),this.update=nn(St(this,this.update),_r)}createEl(){return super.createEl("div",{className:"vjs-mouse-display"})}update(e,t,i){const r=100*t;this.getChild("volumeLevelTooltip").updateVolume(e,t,i,r,()=>{i?this.el_.style.bottom=`${e.height*t}px`:this.el_.style.left=`${e.width*t}px`})}};RE.prototype.options_={children:["volumeLevelTooltip"]};_e.registerComponent("MouseVolumeLevelDisplay",RE);let td=class extends i0{constructor(e,t){super(e,t),this.on("slideractive",i=>this.updateLastVolume_(i)),this.on(e,"volumechange",i=>this.updateARIAAttributes(i)),e.ready(()=>this.updateARIAAttributes())}createEl(){return super.createEl("div",{className:"vjs-volume-bar vjs-slider-bar"},{"aria-label":this.localize("Volume Level"),"aria-live":"polite"})}handleMouseDown(e){Xl(e)&&super.handleMouseDown(e)}handleMouseMove(e){const t=this.getChild("mouseVolumeLevelDisplay");if(t){const i=this.el(),r=_o(i),n=this.vertical();let a=Kh(i,e);a=n?a.y:a.x,a=lu(a,0,1),t.update(r,a,n)}Xl(e)&&(this.checkMuted(),this.player_.volume(this.calculateDistance(e)))}checkMuted(){this.player_.muted()&&this.player_.muted(!1)}getPercent(){return this.player_.muted()?0:this.player_.volume()}stepForward(){this.checkMuted(),this.player_.volume(this.player_.volume()+.1)}stepBack(){this.checkMuted(),this.player_.volume(this.player_.volume()-.1)}updateARIAAttributes(e){const t=this.player_.muted()?0:this.volumeAsPercentage_();this.el_.setAttribute("aria-valuenow",t),this.el_.setAttribute("aria-valuetext",t+"%")}volumeAsPercentage_(){return Math.round(this.player_.volume()*100)}updateLastVolume_(){const e=this.player_.volume();this.one("sliderinactive",()=>{this.player_.volume()===0&&this.player_.lastVolume_(e)})}};td.prototype.options_={children:["volumeLevel"],barName:"volumeLevel"};!Li&&!tn&&td.prototype.options_.children.splice(0,0,"mouseVolumeLevelDisplay");td.prototype.playerEvent="volumechange";_e.registerComponent("VolumeBar",td);let FE=class extends _e{constructor(e,t={}){t.vertical=t.vertical||!1,(typeof t.volumeBar>"u"||vo(t.volumeBar))&&(t.volumeBar=t.volumeBar||{},t.volumeBar.vertical=t.vertical),super(e,t),fO(this,e),this.throttledHandleMouseMove=nn(St(this,this.handleMouseMove),_r),this.handleMouseUpHandler_=i=>this.handleMouseUp(i),this.on("mousedown",i=>this.handleMouseDown(i)),this.on("touchstart",i=>this.handleMouseDown(i)),this.on("mousemove",i=>this.handleMouseMove(i)),this.on(this.volumeBar,["focus","slideractive"],()=>{this.volumeBar.addClass("vjs-slider-active"),this.addClass("vjs-slider-active"),this.trigger("slideractive")}),this.on(this.volumeBar,["blur","sliderinactive"],()=>{this.volumeBar.removeClass("vjs-slider-active"),this.removeClass("vjs-slider-active"),this.trigger("sliderinactive")})}createEl(){let e="vjs-volume-horizontal";return this.options_.vertical&&(e="vjs-volume-vertical"),super.createEl("div",{className:`vjs-volume-control vjs-control ${e}`})}handleMouseDown(e){const t=this.el_.ownerDocument;this.on(t,"mousemove",this.throttledHandleMouseMove),this.on(t,"touchmove",this.throttledHandleMouseMove),this.on(t,"mouseup",this.handleMouseUpHandler_),this.on(t,"touchend",this.handleMouseUpHandler_)}handleMouseUp(e){const t=this.el_.ownerDocument;this.off(t,"mousemove",this.throttledHandleMouseMove),this.off(t,"touchmove",this.throttledHandleMouseMove),this.off(t,"mouseup",this.handleMouseUpHandler_),this.off(t,"touchend",this.handleMouseUpHandler_)}handleMouseMove(e){this.volumeBar.handleMouseMove(e)}};FE.prototype.options_={children:["volumeBar"]};_e.registerComponent("VolumeControl",FE);const gO=function(s,e){e.tech_&&!e.tech_.featuresMuteControl&&s.addClass("vjs-hidden"),s.on(e,"loadstart",function(){e.tech_.featuresMuteControl?s.removeClass("vjs-hidden"):s.addClass("vjs-hidden")})};let BE=class extends _i{constructor(e,t){super(e,t),gO(this,e),this.on(e,["loadstart","volumechange"],i=>this.update(i))}buildCSSClass(){return`vjs-mute-control ${super.buildCSSClass()}`}handleClick(e){const t=this.player_.volume(),i=this.player_.lastVolume_();if(t===0){const r=i<.1?.1:i;this.player_.volume(r),this.player_.muted(!1)}else this.player_.muted(!this.player_.muted())}update(e){this.updateIcon_(),this.updateControlText_()}updateIcon_(){const e=this.player_.volume();let t=3;this.setIcon("volume-high"),Li&&this.player_.tech_&&this.player_.tech_.el_&&this.player_.muted(this.player_.tech_.el_.muted),e===0||this.player_.muted()?(this.setIcon("volume-mute"),t=0):e<.33?(this.setIcon("volume-low"),t=1):e<.67&&(this.setIcon("volume-medium"),t=2),Wh(this.el_,[0,1,2,3].reduce((i,r)=>i+`${r?" ":""}vjs-vol-${r}`,"")),Qs(this.el_,`vjs-vol-${t}`)}updateControlText_(){const t=this.player_.muted()||this.player_.volume()===0?"Unmute":"Mute";this.controlText()!==t&&this.controlText(t)}};BE.prototype.controlText_="Mute";_e.registerComponent("MuteToggle",BE);let UE=class extends _e{constructor(e,t={}){typeof t.inline<"u"?t.inline=t.inline:t.inline=!0,(typeof t.volumeControl>"u"||vo(t.volumeControl))&&(t.volumeControl=t.volumeControl||{},t.volumeControl.vertical=!t.inline),super(e,t),this.handleKeyPressHandler_=i=>this.handleKeyPress(i),this.on(e,["loadstart"],i=>this.volumePanelState_(i)),this.on(this.muteToggle,"keyup",i=>this.handleKeyPress(i)),this.on(this.volumeControl,"keyup",i=>this.handleVolumeControlKeyUp(i)),this.on("keydown",i=>this.handleKeyPress(i)),this.on("mouseover",i=>this.handleMouseOver(i)),this.on("mouseout",i=>this.handleMouseOut(i)),this.on(this.volumeControl,["slideractive"],this.sliderActive_),this.on(this.volumeControl,["sliderinactive"],this.sliderInactive_)}sliderActive_(){this.addClass("vjs-slider-active")}sliderInactive_(){this.removeClass("vjs-slider-active")}volumePanelState_(){this.volumeControl.hasClass("vjs-hidden")&&this.muteToggle.hasClass("vjs-hidden")&&this.addClass("vjs-hidden"),this.volumeControl.hasClass("vjs-hidden")&&!this.muteToggle.hasClass("vjs-hidden")&&this.addClass("vjs-mute-toggle-only")}createEl(){let e="vjs-volume-panel-horizontal";return this.options_.inline||(e="vjs-volume-panel-vertical"),super.createEl("div",{className:`vjs-volume-panel vjs-control ${e}`})}dispose(){this.handleMouseOut(),super.dispose()}handleVolumeControlKeyUp(e){e.key==="Escape"&&this.muteToggle.focus()}handleMouseOver(e){this.addClass("vjs-hover"),sr(ce,"keyup",this.handleKeyPressHandler_)}handleMouseOut(e){this.removeClass("vjs-hover"),yi(ce,"keyup",this.handleKeyPressHandler_)}handleKeyPress(e){e.key==="Escape"&&this.handleMouseOut()}};UE.prototype.options_={children:["muteToggle","volumeControl"]};_e.registerComponent("VolumePanel",UE);class $E extends _i{constructor(e,t){super(e,t),this.validOptions=[5,10,30],this.skipTime=this.getSkipForwardTime(),this.skipTime&&this.validOptions.includes(this.skipTime)?(this.setIcon(`forward-${this.skipTime}`),this.controlText(this.localize("Skip forward {1} seconds",[this.skipTime.toLocaleString(e.language())])),this.show()):this.hide()}getSkipForwardTime(){const e=this.options_.playerOptions;return e.controlBar&&e.controlBar.skipButtons&&e.controlBar.skipButtons.forward}buildCSSClass(){return`vjs-skip-forward-${this.getSkipForwardTime()} ${super.buildCSSClass()}`}handleClick(e){if(isNaN(this.player_.duration()))return;const t=this.player_.currentTime(),i=this.player_.liveTracker,r=i&&i.isLive()?i.seekableEnd():this.player_.duration();let n;t+this.skipTime<=r?n=t+this.skipTime:n=r,this.player_.currentTime(n)}handleLanguagechange(){this.controlText(this.localize("Skip forward {1} seconds",[this.skipTime]))}}$E.prototype.controlText_="Skip Forward";_e.registerComponent("SkipForward",$E);class jE extends _i{constructor(e,t){super(e,t),this.validOptions=[5,10,30],this.skipTime=this.getSkipBackwardTime(),this.skipTime&&this.validOptions.includes(this.skipTime)?(this.setIcon(`replay-${this.skipTime}`),this.controlText(this.localize("Skip backward {1} seconds",[this.skipTime.toLocaleString(e.language())])),this.show()):this.hide()}getSkipBackwardTime(){const e=this.options_.playerOptions;return e.controlBar&&e.controlBar.skipButtons&&e.controlBar.skipButtons.backward}buildCSSClass(){return`vjs-skip-backward-${this.getSkipBackwardTime()} ${super.buildCSSClass()}`}handleClick(e){const t=this.player_.currentTime(),i=this.player_.liveTracker,r=i&&i.isLive()&&i.seekableStart();let n;r&&t-this.skipTime<=r?n=r:t>=this.skipTime?n=t-this.skipTime:n=0,this.player_.currentTime(n)}handleLanguagechange(){this.controlText(this.localize("Skip backward {1} seconds",[this.skipTime]))}}jE.prototype.controlText_="Skip Backward";_e.registerComponent("SkipBackward",jE);let qE=class extends _e{constructor(e,t){super(e,t),t&&(this.menuButton_=t.menuButton),this.focusedChild_=-1,this.on("keydown",i=>this.handleKeyDown(i)),this.boundHandleBlur_=i=>this.handleBlur(i),this.boundHandleTapClick_=i=>this.handleTapClick(i)}addEventListenerForItem(e){e instanceof _e&&(this.on(e,"blur",this.boundHandleBlur_),this.on(e,["tap","click"],this.boundHandleTapClick_))}removeEventListenerForItem(e){e instanceof _e&&(this.off(e,"blur",this.boundHandleBlur_),this.off(e,["tap","click"],this.boundHandleTapClick_))}removeChild(e){typeof e=="string"&&(e=this.getChild(e)),this.removeEventListenerForItem(e),super.removeChild(e)}addItem(e){const t=this.addChild(e);t&&this.addEventListenerForItem(t)}createEl(){const e=this.options_.contentElType||"ul";this.contentEl_=He(e,{className:"vjs-menu-content"}),this.contentEl_.setAttribute("role","menu");const t=super.createEl("div",{append:this.contentEl_,className:"vjs-menu"});return t.appendChild(this.contentEl_),sr(t,"click",function(i){i.preventDefault(),i.stopImmediatePropagation()}),t}dispose(){this.contentEl_=null,this.boundHandleBlur_=null,this.boundHandleTapClick_=null,super.dispose()}handleBlur(e){const t=e.relatedTarget||ce.activeElement;if(!this.children().some(i=>i.el()===t)){const i=this.menuButton_;i&&i.buttonPressed_&&t!==i.el().firstChild&&i.unpressButton()}}handleTapClick(e){if(this.menuButton_){this.menuButton_.unpressButton();const t=this.children();if(!Array.isArray(t))return;const i=t.filter(r=>r.el()===e.target)[0];if(!i)return;i.name()!=="CaptionSettingsMenuItem"&&this.menuButton_.focus()}}handleKeyDown(e){e.key==="ArrowLeft"||e.key==="ArrowDown"?(e.preventDefault(),e.stopPropagation(),this.stepForward()):(e.key==="ArrowRight"||e.key==="ArrowUp")&&(e.preventDefault(),e.stopPropagation(),this.stepBack())}stepForward(){let e=0;this.focusedChild_!==void 0&&(e=this.focusedChild_+1),this.focus(e)}stepBack(){let e=0;this.focusedChild_!==void 0&&(e=this.focusedChild_-1),this.focus(e)}focus(e=0){const t=this.children().slice();t.length&&t[0].hasClass("vjs-menu-title")&&t.shift(),t.length>0&&(e<0?e=0:e>=t.length&&(e=t.length-1),this.focusedChild_=e,t[e].el_.focus())}};_e.registerComponent("Menu",qE);let s0=class extends _e{constructor(e,t={}){super(e,t),this.menuButton_=new _i(e,t),this.menuButton_.controlText(this.controlText_),this.menuButton_.el_.setAttribute("aria-haspopup","true");const i=_i.prototype.buildCSSClass();this.menuButton_.el_.className=this.buildCSSClass()+" "+i,this.menuButton_.removeClass("vjs-control"),this.addChild(this.menuButton_),this.update(),this.enabled_=!0;const r=n=>this.handleClick(n);this.handleMenuKeyUp_=n=>this.handleMenuKeyUp(n),this.on(this.menuButton_,"tap",r),this.on(this.menuButton_,"click",r),this.on(this.menuButton_,"keydown",n=>this.handleKeyDown(n)),this.on(this.menuButton_,"mouseenter",()=>{this.addClass("vjs-hover"),this.menu.show(),sr(ce,"keyup",this.handleMenuKeyUp_)}),this.on("mouseleave",n=>this.handleMouseLeave(n)),this.on("keydown",n=>this.handleSubmenuKeyDown(n))}update(){const e=this.createMenu();this.menu&&(this.menu.dispose(),this.removeChild(this.menu)),this.menu=e,this.addChild(e),this.buttonPressed_=!1,this.menuButton_.el_.setAttribute("aria-expanded","false"),this.items&&this.items.length<=this.hideThreshold_?(this.hide(),this.menu.contentEl_.removeAttribute("role")):(this.show(),this.menu.contentEl_.setAttribute("role","menu"))}createMenu(){const e=new qE(this.player_,{menuButton:this});if(this.hideThreshold_=0,this.options_.title){const t=He("li",{className:"vjs-menu-title",textContent:qt(this.options_.title),tabIndex:-1}),i=new _e(this.player_,{el:t});e.addItem(i)}if(this.items=this.createItems(),this.items)for(let t=0;t<this.items.length;t++)e.addItem(this.items[t]);return e}createItems(){}createEl(){return super.createEl("div",{className:this.buildWrapperCSSClass()},{})}setIcon(e){super.setIcon(e,this.menuButton_.el_)}buildWrapperCSSClass(){let e="vjs-menu-button";this.options_.inline===!0?e+="-inline":e+="-popup";const t=_i.prototype.buildCSSClass();return`vjs-menu-button ${e} ${t} ${super.buildCSSClass()}`}buildCSSClass(){let e="vjs-menu-button";return this.options_.inline===!0?e+="-inline":e+="-popup",`vjs-menu-button ${e} ${super.buildCSSClass()}`}controlText(e,t=this.menuButton_.el()){return this.menuButton_.controlText(e,t)}dispose(){this.handleMouseLeave(),super.dispose()}handleClick(e){this.buttonPressed_?this.unpressButton():this.pressButton()}handleMouseLeave(e){this.removeClass("vjs-hover"),yi(ce,"keyup",this.handleMenuKeyUp_)}focus(){this.menuButton_.focus()}blur(){this.menuButton_.blur()}handleKeyDown(e){e.key==="Escape"||e.key==="Tab"?(this.buttonPressed_&&this.unpressButton(),!e.key==="Tab"&&(e.preventDefault(),this.menuButton_.focus())):(e.key==="Up"||e.key==="Down"&&!(this.player_.options_.playerOptions.spatialNavigation&&this.player_.options_.playerOptions.spatialNavigation.enabled))&&(this.buttonPressed_||(e.preventDefault(),this.pressButton()))}handleMenuKeyUp(e){(e.key==="Escape"||e.key==="Tab")&&this.removeClass("vjs-hover")}handleSubmenuKeyPress(e){this.handleSubmenuKeyDown(e)}handleSubmenuKeyDown(e){(e.key==="Escape"||e.key==="Tab")&&(this.buttonPressed_&&this.unpressButton(),!e.key==="Tab"&&(e.preventDefault(),this.menuButton_.focus()))}pressButton(){if(this.enabled_){if(this.buttonPressed_=!0,this.menu.show(),this.menu.lockShowing(),this.menuButton_.el_.setAttribute("aria-expanded","true"),Li&&J1())return;this.menu.focus()}}unpressButton(){this.enabled_&&(this.buttonPressed_=!1,this.menu.unlockShowing(),this.menu.hide(),this.menuButton_.el_.setAttribute("aria-expanded","false"))}disable(){this.unpressButton(),this.enabled_=!1,this.addClass("vjs-disabled"),this.menuButton_.disable()}enable(){this.enabled_=!0,this.removeClass("vjs-disabled"),this.menuButton_.enable()}};_e.registerComponent("MenuButton",s0);let a0=class extends s0{constructor(e,t){const i=t.tracks;if(super(e,t),this.items.length<=1&&this.hide(),!i)return;const r=St(this,this.update);i.addEventListener("removetrack",r),i.addEventListener("addtrack",r),i.addEventListener("labelchange",r),this.player_.on("ready",r),this.player_.on("dispose",function(){i.removeEventListener("removetrack",r),i.removeEventListener("addtrack",r),i.removeEventListener("labelchange",r)})}};_e.registerComponent("TrackButton",a0);let uu=class extends ed{constructor(e,t){super(e,t),this.selectable=t.selectable,this.isSelected_=t.selected||!1,this.multiSelectable=t.multiSelectable,this.selected(this.isSelected_),this.selectable?this.multiSelectable?this.el_.setAttribute("role","menuitemcheckbox"):this.el_.setAttribute("role","menuitemradio"):this.el_.setAttribute("role","menuitem")}createEl(e,t,i){this.nonIconControl=!0;const r=super.createEl("li",Object.assign({className:"vjs-menu-item",tabIndex:-1},t),i),n=He("span",{className:"vjs-menu-item-text",textContent:this.localize(this.options_.label)});return this.player_.options_.experimentalSvgIcons?r.appendChild(n):r.replaceChild(n,r.querySelector(".vjs-icon-placeholder")),r}handleKeyDown(e){["Tab","Escape","ArrowUp","ArrowLeft","ArrowRight","ArrowDown"].includes(e.key)||super.handleKeyDown(e)}handleClick(e){this.selected(!0)}selected(e){this.selectable&&(e?(this.addClass("vjs-selected"),this.el_.setAttribute("aria-checked","true"),this.controlText(", selected"),this.isSelected_=!0):(this.removeClass("vjs-selected"),this.el_.setAttribute("aria-checked","false"),this.controlText(""),this.isSelected_=!1))}};_e.registerComponent("MenuItem",uu);let cu=class extends uu{constructor(e,t){const i=t.track,r=e.textTracks();t.label=i.label||i.language||"Unknown",t.selected=i.mode==="showing",super(e,t),this.track=i,this.kinds=(t.kinds||[t.kind||this.track.kind]).filter(Boolean);const n=(...o)=>{this.handleTracksChange.apply(this,o)},a=(...o)=>{this.handleSelectedLanguageChange.apply(this,o)};if(e.on(["loadstart","texttrackchange"],n),r.addEventListener("change",n),r.addEventListener("selectedlanguagechange",a),this.on("dispose",function(){e.off(["loadstart","texttrackchange"],n),r.removeEventListener("change",n),r.removeEventListener("selectedlanguagechange",a)}),r.onchange===void 0){let o;this.on(["tap","click"],function(){if(typeof O.Event!="object")try{o=new O.Event("change")}catch{}o||(o=ce.createEvent("Event"),o.initEvent("change",!0,!0)),r.dispatchEvent(o)})}this.handleTracksChange()}handleClick(e){const t=this.track,i=this.player_.textTracks();if(super.handleClick(e),!!i)for(let r=0;r<i.length;r++){const n=i[r];this.kinds.indexOf(n.kind)!==-1&&(n===t?n.mode!=="showing"&&(n.mode="showing"):n.mode!=="disabled"&&(n.mode="disabled"))}}handleTracksChange(e){const t=this.track.mode==="showing";t!==this.isSelected_&&this.selected(t)}handleSelectedLanguageChange(e){if(this.track.mode==="showing"){const t=this.player_.cache_.selectedLanguage;if(t&&t.enabled&&t.language===this.track.language&&t.kind!==this.track.kind)return;this.player_.cache_.selectedLanguage={enabled:!0,language:this.track.language,kind:this.track.kind}}}dispose(){this.track=null,super.dispose()}};_e.registerComponent("TextTrackMenuItem",cu);let VE=class extends cu{constructor(e,t){t.track={player:e,kind:t.kind,kinds:t.kinds,default:!1,mode:"disabled"},t.kinds||(t.kinds=[t.kind]),t.label?t.track.label=t.label:t.track.label=t.kinds.join(" and ")+" off",t.selectable=!0,t.multiSelectable=!1,super(e,t)}handleTracksChange(e){const t=this.player().textTracks();let i=!0;for(let r=0,n=t.length;r<n;r++){const a=t[r];if(this.options_.kinds.indexOf(a.kind)>-1&&a.mode==="showing"){i=!1;break}}i!==this.isSelected_&&this.selected(i)}handleSelectedLanguageChange(e){const t=this.player().textTracks();let i=!0;for(let r=0,n=t.length;r<n;r++){const a=t[r];if(["captions","descriptions","subtitles"].indexOf(a.kind)>-1&&a.mode==="showing"){i=!1;break}}i&&(this.player_.cache_.selectedLanguage={enabled:!1})}handleLanguagechange(){this.$(".vjs-menu-item-text").textContent=this.player_.localize(this.options_.label),super.handleLanguagechange()}};_e.registerComponent("OffTextTrackMenuItem",VE);let Uo=class extends a0{constructor(e,t={}){t.tracks=e.textTracks(),super(e,t)}createItems(e=[],t=cu){let i;this.label_&&(i=`${this.label_} off`),e.push(new VE(this.player_,{kinds:this.kinds_,kind:this.kind_,label:i})),this.hideThreshold_+=1;const r=this.player_.textTracks();Array.isArray(this.kinds_)||(this.kinds_=[this.kind_]);for(let n=0;n<r.length;n++){const a=r[n];if(this.kinds_.indexOf(a.kind)>-1){const o=new t(this.player_,{track:a,kinds:this.kinds_,kind:this.kind_,selectable:!0,multiSelectable:!1});o.addClass(`vjs-${a.kind}-menu-item`),e.push(o)}}return e}};_e.registerComponent("TextTrackButton",Uo);let HE=class extends uu{constructor(e,t){const i=t.track,r=t.cue,n=e.currentTime();t.selectable=!0,t.multiSelectable=!1,t.label=r.text,t.selected=r.startTime<=n&&n<r.endTime,super(e,t),this.track=i,this.cue=r}handleClick(e){super.handleClick(),this.player_.currentTime(this.cue.startTime)}};_e.registerComponent("ChaptersTrackMenuItem",HE);let o0=class extends Uo{constructor(e,t,i){super(e,t,i),this.setIcon("chapters"),this.selectCurrentItem_=()=>{this.items.forEach(r=>{r.selected(this.track_.activeCues[0]===r.cue)})}}buildCSSClass(){return`vjs-chapters-button ${super.buildCSSClass()}`}buildWrapperCSSClass(){return`vjs-chapters-button ${super.buildWrapperCSSClass()}`}update(e){if(e&&e.track&&e.track.kind!=="chapters")return;const t=this.findChaptersTrack();t!==this.track_?(this.setTrack(t),super.update()):(!this.items||t&&t.cues&&t.cues.length!==this.items.length)&&super.update()}setTrack(e){if(this.track_!==e){if(this.updateHandler_||(this.updateHandler_=this.update.bind(this)),this.track_){const t=this.player_.remoteTextTrackEls().getTrackElementByTrack_(this.track_);t&&t.removeEventListener("load",this.updateHandler_),this.track_.removeEventListener("cuechange",this.selectCurrentItem_),this.track_=null}if(this.track_=e,this.track_){this.track_.mode="hidden";const t=this.player_.remoteTextTrackEls().getTrackElementByTrack_(this.track_);t&&t.addEventListener("load",this.updateHandler_),this.track_.addEventListener("cuechange",this.selectCurrentItem_)}}}findChaptersTrack(){const e=this.player_.textTracks()||[];for(let t=e.length-1;t>=0;t--){const i=e[t];if(i.kind===this.kind_)return i}}getMenuCaption(){return this.track_&&this.track_.label?this.track_.label:this.localize(qt(this.kind_))}createMenu(){return this.options_.title=this.getMenuCaption(),super.createMenu()}createItems(){const e=[];if(!this.track_)return e;const t=this.track_.cues;if(!t)return e;for(let i=0,r=t.length;i<r;i++){const n=t[i],a=new HE(this.player_,{track:this.track_,cue:n});e.push(a)}return e}};o0.prototype.kind_="chapters";o0.prototype.controlText_="Chapters";_e.registerComponent("ChaptersButton",o0);let l0=class extends Uo{constructor(e,t,i){super(e,t,i),this.setIcon("audio-description");const r=e.textTracks(),n=St(this,this.handleTracksChange);r.addEventListener("change",n),this.on("dispose",function(){r.removeEventListener("change",n)})}handleTracksChange(e){const t=this.player().textTracks();let i=!1;for(let r=0,n=t.length;r<n;r++){const a=t[r];if(a.kind!==this.kind_&&a.mode==="showing"){i=!0;break}}i?this.disable():this.enable()}buildCSSClass(){return`vjs-descriptions-button ${super.buildCSSClass()}`}buildWrapperCSSClass(){return`vjs-descriptions-button ${super.buildWrapperCSSClass()}`}};l0.prototype.kind_="descriptions";l0.prototype.controlText_="Descriptions";_e.registerComponent("DescriptionsButton",l0);let u0=class extends Uo{constructor(e,t,i){super(e,t,i),this.setIcon("subtitles")}buildCSSClass(){return`vjs-subtitles-button ${super.buildCSSClass()}`}buildWrapperCSSClass(){return`vjs-subtitles-button ${super.buildWrapperCSSClass()}`}};u0.prototype.kind_="subtitles";u0.prototype.controlText_="Subtitles";_e.registerComponent("SubtitlesButton",u0);let c0=class extends cu{constructor(e,t){t.track={player:e,kind:t.kind,label:t.kind+" settings",selectable:!1,default:!1,mode:"disabled"},t.selectable=!1,t.name="CaptionSettingsMenuItem",super(e,t),this.addClass("vjs-texttrack-settings"),this.controlText(", opens "+t.kind+" settings dialog")}handleClick(e){this.player().getChild("textTrackSettings").open()}handleLanguagechange(){this.$(".vjs-menu-item-text").textContent=this.player_.localize(this.options_.kind+" settings"),super.handleLanguagechange()}};_e.registerComponent("CaptionSettingsMenuItem",c0);let h0=class extends Uo{constructor(e,t,i){super(e,t,i),this.setIcon("captions")}buildCSSClass(){return`vjs-captions-button ${super.buildCSSClass()}`}buildWrapperCSSClass(){return`vjs-captions-button ${super.buildWrapperCSSClass()}`}createItems(){const e=[];return!(this.player().tech_&&this.player().tech_.featuresNativeTextTracks)&&this.player().getChild("textTrackSettings")&&(e.push(new c0(this.player_,{kind:this.kind_})),this.hideThreshold_+=1),super.createItems(e)}};h0.prototype.kind_="captions";h0.prototype.controlText_="Captions";_e.registerComponent("CaptionsButton",h0);let zE=class extends cu{createEl(e,t,i){const r=super.createEl(e,t,i),n=r.querySelector(".vjs-menu-item-text");return this.options_.track.kind==="captions"&&(this.player_.options_.experimentalSvgIcons?this.setIcon("captions",r):n.appendChild(He("span",{className:"vjs-icon-placeholder"},{"aria-hidden":!0})),n.appendChild(He("span",{className:"vjs-control-text",textContent:` ${this.localize("Captions")}`}))),r}};_e.registerComponent("SubsCapsMenuItem",zE);let d0=class extends Uo{constructor(e,t={}){super(e,t),this.label_="subtitles",this.setIcon("subtitles"),["en","en-us","en-ca","fr-ca"].indexOf(this.player_.language_)>-1&&(this.label_="captions",this.setIcon("captions")),this.menuButton_.controlText(qt(this.label_))}buildCSSClass(){return`vjs-subs-caps-button ${super.buildCSSClass()}`}buildWrapperCSSClass(){return`vjs-subs-caps-button ${super.buildWrapperCSSClass()}`}createItems(){let e=[];return!(this.player().tech_&&this.player().tech_.featuresNativeTextTracks)&&this.player().getChild("textTrackSettings")&&(e.push(new c0(this.player_,{kind:this.label_})),this.hideThreshold_+=1),e=super.createItems(e,zE),e}};d0.prototype.kinds_=["captions","subtitles"];d0.prototype.controlText_="Subtitles";_e.registerComponent("SubsCapsButton",d0);let WE=class extends uu{constructor(e,t){const i=t.track,r=e.audioTracks();t.label=i.label||i.language||"Unknown",t.selected=i.enabled,super(e,t),this.track=i,this.addClass(`vjs-${i.kind}-menu-item`);const n=(...a)=>{this.handleTracksChange.apply(this,a)};r.addEventListener("change",n),this.on("dispose",()=>{r.removeEventListener("change",n)})}createEl(e,t,i){const r=super.createEl(e,t,i),n=r.querySelector(".vjs-menu-item-text");return["main-desc","descriptions"].indexOf(this.options_.track.kind)>=0&&(n.appendChild(He("span",{className:"vjs-icon-placeholder"},{"aria-hidden":!0})),n.appendChild(He("span",{className:"vjs-control-text",textContent:" "+this.localize("Descriptions")}))),r}handleClick(e){if(super.handleClick(e),this.track.enabled=!0,this.player_.tech_.featuresNativeAudioTracks){const t=this.player_.audioTracks();for(let i=0;i<t.length;i++){const r=t[i];r!==this.track&&(r.enabled=r===this.track)}}}handleTracksChange(e){this.selected(this.track.enabled)}};_e.registerComponent("AudioTrackMenuItem",WE);let GE=class extends a0{constructor(e,t={}){t.tracks=e.audioTracks(),super(e,t),this.setIcon("audio")}buildCSSClass(){return`vjs-audio-button ${super.buildCSSClass()}`}buildWrapperCSSClass(){return`vjs-audio-button ${super.buildWrapperCSSClass()}`}createItems(e=[]){this.hideThreshold_=1;const t=this.player_.audioTracks();for(let i=0;i<t.length;i++){const r=t[i];e.push(new WE(this.player_,{track:r,selectable:!0,multiSelectable:!1}))}return e}};GE.prototype.controlText_="Audio Track";_e.registerComponent("AudioTrackButton",GE);let f0=class extends uu{constructor(e,t){const i=t.rate,r=parseFloat(i,10);t.label=i,t.selected=r===e.playbackRate(),t.selectable=!0,t.multiSelectable=!1,super(e,t),this.label=i,this.rate=r,this.on(e,"ratechange",n=>this.update(n))}handleClick(e){super.handleClick(),this.player().playbackRate(this.rate)}update(e){this.selected(this.player().playbackRate()===this.rate)}};f0.prototype.contentElType="button";_e.registerComponent("PlaybackRateMenuItem",f0);let KE=class extends s0{constructor(e,t){super(e,t),this.menuButton_.el_.setAttribute("aria-describedby",this.labelElId_),this.updateVisibility(),this.updateLabel(),this.on(e,"loadstart",i=>this.updateVisibility(i)),this.on(e,"ratechange",i=>this.updateLabel(i)),this.on(e,"playbackrateschange",i=>this.handlePlaybackRateschange(i))}createEl(){const e=super.createEl();return this.labelElId_="vjs-playback-rate-value-label-"+this.id_,this.labelEl_=He("div",{className:"vjs-playback-rate-value",id:this.labelElId_,textContent:"1x"}),e.appendChild(this.labelEl_),e}dispose(){this.labelEl_=null,super.dispose()}buildCSSClass(){return`vjs-playback-rate ${super.buildCSSClass()}`}buildWrapperCSSClass(){return`vjs-playback-rate ${super.buildWrapperCSSClass()}`}createItems(){const e=this.playbackRates(),t=[];for(let i=e.length-1;i>=0;i--)t.push(new f0(this.player(),{rate:e[i]+"x"}));return t}handlePlaybackRateschange(e){this.update()}playbackRates(){const e=this.player();return e.playbackRates&&e.playbackRates()||[]}playbackRateSupported(){return this.player().tech_&&this.player().tech_.featuresPlaybackRate&&this.playbackRates()&&this.playbackRates().length>0}updateVisibility(e){this.playbackRateSupported()?this.removeClass("vjs-hidden"):this.addClass("vjs-hidden")}updateLabel(e){this.playbackRateSupported()&&(this.labelEl_.textContent=this.player().playbackRate()+"x")}};KE.prototype.controlText_="Playback Rate";_e.registerComponent("PlaybackRateMenuButton",KE);let XE=class extends _e{buildCSSClass(){return`vjs-spacer ${super.buildCSSClass()}`}createEl(e="div",t={},i={}){return t.className||(t.className=this.buildCSSClass()),super.createEl(e,t,i)}};_e.registerComponent("Spacer",XE);let vO=class extends XE{buildCSSClass(){return`vjs-custom-control-spacer ${super.buildCSSClass()}`}createEl(){return super.createEl("div",{className:this.buildCSSClass(),textContent:" "})}};_e.registerComponent("CustomControlSpacer",vO);let QE=class extends _e{createEl(){return super.createEl("div",{className:"vjs-control-bar",dir:"ltr"})}};QE.prototype.options_={children:["playToggle","skipBackward","skipForward","volumePanel","currentTimeDisplay","timeDivider","durationDisplay","progressControl","liveDisplay","seekToLive","remainingTimeDisplay","customControlSpacer","playbackRateMenuButton","chaptersButton","descriptionsButton","subsCapsButton","audioTrackButton","pictureInPictureToggle","fullscreenToggle"]};_e.registerComponent("ControlBar",QE);let YE=class extends Ro{constructor(e,t){super(e,t),this.on(e,"error",i=>{this.open(i)})}buildCSSClass(){return`vjs-error-display ${super.buildCSSClass()}`}content(){const e=this.player().error();return e?this.localize(e.message):""}};YE.prototype.options_=Object.assign({},Ro.prototype.options_,{pauseOnOpen:!1,fillAlways:!0,temporary:!1,uncloseable:!0});_e.registerComponent("ErrorDisplay",YE);class JE extends _e{constructor(e,t={}){super(e,t),this.el_.setAttribute("aria-labelledby",this.selectLabelledbyIds)}createEl(){return this.selectLabelledbyIds=[this.options_.legendId,this.options_.labelId].join(" ").trim(),He("select",{id:this.options_.id},{},this.options_.SelectOptions.map(t=>{const i=(this.options_.labelId?this.options_.labelId:`vjs-track-option-${yr()}`)+"-"+t[1].replace(/\W+/g,""),r=He("option",{id:i,value:this.localize(t[0]),textContent:this.localize(t[1])});return r.setAttribute("aria-labelledby",`${this.selectLabelledbyIds} ${i}`),r}))}}_e.registerComponent("TextTrackSelect",JE);class Js extends _e{constructor(e,t={}){super(e,t);const i=He("legend",{textContent:this.localize(this.options_.legendText),id:this.options_.legendId});this.el().appendChild(i);const r=this.options_.selects;for(const n of r){const a=this.options_.selectConfigs[n],o=a.className,l=a.id.replace("%s",this.options_.id_);let u=null;const c=`vjs_select_${yr()}`;if(this.options_.type==="colors"){u=He("span",{className:o});const d=He("label",{id:l,className:"vjs-label",textContent:this.localize(a.label)});d.setAttribute("for",c),u.appendChild(d)}const h=new JE(e,{SelectOptions:a.options,legendId:this.options_.legendId,id:c,labelId:l});this.addChild(h),this.options_.type==="colors"&&(u.appendChild(h.el()),this.el().appendChild(u))}}createEl(){return He("fieldset",{className:this.options_.className})}}_e.registerComponent("TextTrackFieldset",Js);class ZE extends _e{constructor(e,t={}){super(e,t);const i=this.options_.textTrackComponentid,r=new Js(e,{id_:i,legendId:`captions-text-legend-${i}`,legendText:this.localize("Text"),className:"vjs-fg vjs-track-setting",selects:this.options_.fieldSets[0],selectConfigs:this.options_.selectConfigs,type:"colors"});this.addChild(r);const n=new Js(e,{id_:i,legendId:`captions-background-${i}`,legendText:this.localize("Text Background"),className:"vjs-bg vjs-track-setting",selects:this.options_.fieldSets[1],selectConfigs:this.options_.selectConfigs,type:"colors"});this.addChild(n);const a=new Js(e,{id_:i,legendId:`captions-window-${i}`,legendText:this.localize("Caption Area Background"),className:"vjs-window vjs-track-setting",selects:this.options_.fieldSets[2],selectConfigs:this.options_.selectConfigs,type:"colors"});this.addChild(a)}createEl(){return He("div",{className:"vjs-track-settings-colors"})}}_e.registerComponent("TextTrackSettingsColors",ZE);class e2 extends _e{constructor(e,t={}){super(e,t);const i=this.options_.textTrackComponentid,r=new Js(e,{id_:i,legendId:`captions-font-size-${i}`,legendText:"Font Size",className:"vjs-font-percent vjs-track-setting",selects:this.options_.fieldSets[0],selectConfigs:this.options_.selectConfigs,type:"font"});this.addChild(r);const n=new Js(e,{id_:i,legendId:`captions-edge-style-${i}`,legendText:this.localize("Text Edge Style"),className:"vjs-edge-style vjs-track-setting",selects:this.options_.fieldSets[1],selectConfigs:this.options_.selectConfigs,type:"font"});this.addChild(n);const a=new Js(e,{id_:i,legendId:`captions-font-family-${i}`,legendText:this.localize("Font Family"),className:"vjs-font-family vjs-track-setting",selects:this.options_.fieldSets[2],selectConfigs:this.options_.selectConfigs,type:"font"});this.addChild(a)}createEl(){return He("div",{className:"vjs-track-settings-font"})}}_e.registerComponent("TextTrackSettingsFont",e2);class t2 extends _e{constructor(e,t={}){super(e,t);const i=this.localize("restore all settings to the default values"),r=new _i(e,{controlText:i,className:"vjs-default-button"});r.el().classList.remove("vjs-control","vjs-button"),r.el().textContent=this.localize("Reset"),this.addChild(r);const n=new _i(e,{controlText:i,className:"vjs-done-button"});n.el().classList.remove("vjs-control","vjs-button"),n.el().textContent=this.localize("Done"),this.addChild(n)}createEl(){return He("div",{className:"vjs-track-settings-controls"})}}_e.registerComponent("TrackSettingsControls",t2);const Mf="vjs-text-track-settings",$_=["#000","Black"],j_=["#00F","Blue"],q_=["#0FF","Cyan"],V_=["#0F0","Green"],H_=["#F0F","Magenta"],z_=["#F00","Red"],W_=["#FFF","White"],G_=["#FF0","Yellow"],Rf=["1","Opaque"],Ff=["0.5","Semi-Transparent"],K_=["0","Transparent"],ss={backgroundColor:{selector:".vjs-bg-color > select",id:"captions-background-color-%s",label:"Color",options:[$_,W_,z_,V_,j_,G_,H_,q_],className:"vjs-bg-color"},backgroundOpacity:{selector:".vjs-bg-opacity > select",id:"captions-background-opacity-%s",label:"Opacity",options:[Rf,Ff,K_],className:"vjs-bg-opacity vjs-opacity"},color:{selector:".vjs-text-color > select",id:"captions-foreground-color-%s",label:"Color",options:[W_,$_,z_,V_,j_,G_,H_,q_],className:"vjs-text-color"},edgeStyle:{selector:".vjs-edge-style > select",id:"",label:"Text Edge Style",options:[["none","None"],["raised","Raised"],["depressed","Depressed"],["uniform","Uniform"],["dropshadow","Drop shadow"]]},fontFamily:{selector:".vjs-font-family > select",id:"",label:"Font Family",options:[["proportionalSansSerif","Proportional Sans-Serif"],["monospaceSansSerif","Monospace Sans-Serif"],["proportionalSerif","Proportional Serif"],["monospaceSerif","Monospace Serif"],["casual","Casual"],["script","Script"],["small-caps","Small Caps"]]},fontPercent:{selector:".vjs-font-percent > select",id:"",label:"Font Size",options:[["0.50","50%"],["0.75","75%"],["1.00","100%"],["1.25","125%"],["1.50","150%"],["1.75","175%"],["2.00","200%"],["3.00","300%"],["4.00","400%"]],default:2,parser:s=>s==="1.00"?null:Number(s)},textOpacity:{selector:".vjs-text-opacity > select",id:"captions-foreground-opacity-%s",label:"Opacity",options:[Rf,Ff],className:"vjs-text-opacity vjs-opacity"},windowColor:{selector:".vjs-window-color > select",id:"captions-window-color-%s",label:"Color",className:"vjs-window-color"},windowOpacity:{selector:".vjs-window-opacity > select",id:"captions-window-opacity-%s",label:"Opacity",options:[K_,Ff,Rf],className:"vjs-window-opacity vjs-opacity"}};ss.windowColor.options=ss.backgroundColor.options;function i2(s,e){if(e&&(s=e(s)),s&&s!=="none")return s}function yO(s,e){const t=s.options[s.options.selectedIndex].value;return i2(t,e)}function _O(s,e,t){if(e){for(let i=0;i<s.options.length;i++)if(i2(s.options[i].value,t)===e){s.selectedIndex=i;break}}}let TO=class extends Ro{constructor(e,t){t.temporary=!1,super(e,t),this.updateDisplay=this.updateDisplay.bind(this),this.fill(),this.hasBeenOpened_=this.hasBeenFilled_=!0,this.renderModalComponents(e),this.endDialog=He("p",{className:"vjs-control-text",textContent:this.localize("End of dialog window.")}),this.el().appendChild(this.endDialog),this.setDefaults(),t.persistTextTrackSettings===void 0&&(this.options_.persistTextTrackSettings=this.options_.playerOptions.persistTextTrackSettings),this.bindFunctionsToSelectsAndButtons(),this.options_.persistTextTrackSettings&&this.restoreSettings()}renderModalComponents(e){const t=new ZE(e,{textTrackComponentid:this.id_,selectConfigs:ss,fieldSets:[["color","textOpacity"],["backgroundColor","backgroundOpacity"],["windowColor","windowOpacity"]]});this.addChild(t);const i=new e2(e,{textTrackComponentid:this.id_,selectConfigs:ss,fieldSets:[["fontPercent"],["edgeStyle"],["fontFamily"]]});this.addChild(i);const r=new t2(e);this.addChild(r)}bindFunctionsToSelectsAndButtons(){this.on(this.$(".vjs-done-button"),["click","tap"],()=>{this.saveSettings(),this.close()}),this.on(this.$(".vjs-default-button"),["click","tap"],()=>{this.setDefaults(),this.updateDisplay()}),Za(ss,e=>{this.on(this.$(e.selector),"change",this.updateDisplay)})}dispose(){this.endDialog=null,super.dispose()}label(){return this.localize("Caption Settings Dialog")}description(){return this.localize("Beginning of dialog window. Escape will cancel and close the window.")}buildCSSClass(){return super.buildCSSClass()+" vjs-text-track-settings"}getValues(){return z1(ss,(e,t,i)=>{const r=yO(this.$(t.selector),t.parser);return r!==void 0&&(e[i]=r),e},{})}setValues(e){Za(ss,(t,i)=>{_O(this.$(t.selector),e[i],t.parser)})}setDefaults(){Za(ss,e=>{const t=e.hasOwnProperty("default")?e.default:0;this.$(e.selector).selectedIndex=t})}restoreSettings(){let e;try{e=JSON.parse(O.localStorage.getItem(Mf))}catch(t){et.warn(t)}e&&this.setValues(e)}saveSettings(){if(!this.options_.persistTextTrackSettings)return;const e=this.getValues();try{Object.keys(e).length?O.localStorage.setItem(Mf,JSON.stringify(e)):O.localStorage.removeItem(Mf)}catch(t){et.warn(t)}}updateDisplay(){const e=this.player_.getChild("textTrackDisplay");e&&e.updateDisplay()}handleLanguagechange(){this.fill(),this.renderModalComponents(this.player_),this.bindFunctionsToSelectsAndButtons()}};_e.registerComponent("TextTrackSettings",TO);let bO=class extends _e{constructor(e,t){let i=t.ResizeObserver||O.ResizeObserver;t.ResizeObserver===null&&(i=!1);const r=gt({createEl:!i,reportTouchActivity:!1},t);super(e,r),this.ResizeObserver=t.ResizeObserver||O.ResizeObserver,this.loadListener_=null,this.resizeObserver_=null,this.debouncedHandler_=pE(()=>{this.resizeHandler()},100,!1,this),i?(this.resizeObserver_=new this.ResizeObserver(this.debouncedHandler_),this.resizeObserver_.observe(e.el())):(this.loadListener_=()=>{if(!this.el_||!this.el_.contentWindow)return;const n=this.debouncedHandler_;let a=this.unloadListener_=function(){yi(this,"resize",n),yi(this,"unload",a),a=null};sr(this.el_.contentWindow,"unload",a),sr(this.el_.contentWindow,"resize",n)},this.one("load",this.loadListener_))}createEl(){return super.createEl("iframe",{className:"vjs-resize-manager",tabIndex:-1,title:this.localize("No content")},{"aria-hidden":"true"})}resizeHandler(){!this.player_||!this.player_.trigger||this.player_.trigger("playerresize")}dispose(){this.debouncedHandler_&&this.debouncedHandler_.cancel(),this.resizeObserver_&&(this.player_.el()&&this.resizeObserver_.unobserve(this.player_.el()),this.resizeObserver_.disconnect()),this.loadListener_&&this.off("load",this.loadListener_),this.el_&&this.el_.contentWindow&&this.unloadListener_&&this.unloadListener_.call(this.el_.contentWindow),this.ResizeObserver=null,this.resizeObserver=null,this.debouncedHandler_=null,this.loadListener_=null,super.dispose()}};_e.registerComponent("ResizeManager",bO);const SO={trackingThreshold:20,liveTolerance:15};let xO=class extends _e{constructor(e,t){const i=gt(SO,t,{createEl:!1});super(e,i),this.trackLiveHandler_=()=>this.trackLive_(),this.handlePlay_=r=>this.handlePlay(r),this.handleFirstTimeupdate_=r=>this.handleFirstTimeupdate(r),this.handleSeeked_=r=>this.handleSeeked(r),this.seekToLiveEdge_=r=>this.seekToLiveEdge(r),this.reset_(),this.on(this.player_,"durationchange",r=>this.handleDurationchange(r)),this.on(this.player_,"canplay",()=>this.toggleTracking())}trackLive_(){const e=this.player_.seekable();if(!e||!e.length)return;const t=Number(O.performance.now().toFixed(4)),i=this.lastTime_===-1?0:(t-this.lastTime_)/1e3;this.lastTime_=t,this.pastSeekEnd_=this.pastSeekEnd()+i;const r=this.liveCurrentTime(),n=this.player_.currentTime();let a=this.player_.paused()||this.seekedBehindLive_||Math.abs(r-n)>this.options_.liveTolerance;(!this.timeupdateSeen_||r===1/0)&&(a=!1),a!==this.behindLiveEdge_&&(this.behindLiveEdge_=a,this.trigger("liveedgechange"))}handleDurationchange(){this.toggleTracking()}toggleTracking(){this.player_.duration()===1/0&&this.liveWindow()>=this.options_.trackingThreshold?(this.player_.options_.liveui&&this.player_.addClass("vjs-liveui"),this.startTracking()):(this.player_.removeClass("vjs-liveui"),this.stopTracking())}startTracking(){this.isTracking()||(this.timeupdateSeen_||(this.timeupdateSeen_=this.player_.hasStarted()),this.trackingInterval_=this.setInterval(this.trackLiveHandler_,_r),this.trackLive_(),this.on(this.player_,["play","pause"],this.trackLiveHandler_),this.timeupdateSeen_?this.on(this.player_,"seeked",this.handleSeeked_):(this.one(this.player_,"play",this.handlePlay_),this.one(this.player_,"timeupdate",this.handleFirstTimeupdate_)))}handleFirstTimeupdate(){this.timeupdateSeen_=!0,this.on(this.player_,"seeked",this.handleSeeked_)}handleSeeked(){const e=Math.abs(this.liveCurrentTime()-this.player_.currentTime());this.seekedBehindLive_=this.nextSeekedFromUser_&&e>2,this.nextSeekedFromUser_=!1,this.trackLive_()}handlePlay(){this.one(this.player_,"timeupdate",this.seekToLiveEdge_)}reset_(){this.lastTime_=-1,this.pastSeekEnd_=0,this.lastSeekEnd_=-1,this.behindLiveEdge_=!0,this.timeupdateSeen_=!1,this.seekedBehindLive_=!1,this.nextSeekedFromUser_=!1,this.clearInterval(this.trackingInterval_),this.trackingInterval_=null,this.off(this.player_,["play","pause"],this.trackLiveHandler_),this.off(this.player_,"seeked",this.handleSeeked_),this.off(this.player_,"play",this.handlePlay_),this.off(this.player_,"timeupdate",this.handleFirstTimeupdate_),this.off(this.player_,"timeupdate",this.seekToLiveEdge_)}nextSeekedFromUser(){this.nextSeekedFromUser_=!0}stopTracking(){this.isTracking()&&(this.reset_(),this.trigger("liveedgechange"))}seekableEnd(){const e=this.player_.seekable(),t=[];let i=e?e.length:0;for(;i--;)t.push(e.end(i));return t.length?t.sort()[t.length-1]:1/0}seekableStart(){const e=this.player_.seekable(),t=[];let i=e?e.length:0;for(;i--;)t.push(e.start(i));return t.length?t.sort()[0]:0}liveWindow(){const e=this.liveCurrentTime();return e===1/0?0:e-this.seekableStart()}isLive(){return this.isTracking()}atLiveEdge(){return!this.behindLiveEdge()}liveCurrentTime(){return this.pastSeekEnd()+this.seekableEnd()}pastSeekEnd(){const e=this.seekableEnd();return this.lastSeekEnd_!==-1&&e!==this.lastSeekEnd_&&(this.pastSeekEnd_=0),this.lastSeekEnd_=e,this.pastSeekEnd_}behindLiveEdge(){return this.behindLiveEdge_}isTracking(){return typeof this.trackingInterval_=="number"}seekToLiveEdge(){this.seekedBehindLive_=!1,!this.atLiveEdge()&&(this.nextSeekedFromUser_=!1,this.player_.currentTime(this.liveCurrentTime()))}dispose(){this.stopTracking(),super.dispose()}};_e.registerComponent("LiveTracker",xO);class CO extends _e{constructor(e,t){super(e,t),this.on("statechanged",i=>this.updateDom_()),this.updateDom_()}createEl(){return this.els={title:He("div",{className:"vjs-title-bar-title",id:`vjs-title-bar-title-${yr()}`}),description:He("div",{className:"vjs-title-bar-description",id:`vjs-title-bar-description-${yr()}`})},He("div",{className:"vjs-title-bar"},{},W1(this.els))}updateDom_(){const e=this.player_.tech_,t=e&&e.el_,i={title:"aria-labelledby",description:"aria-describedby"};["title","description"].forEach(r=>{const n=this.state[r],a=this.els[r],o=i[r];Xh(a),n&&ds(a,n),t&&(t.removeAttribute(o),n&&t.setAttribute(o,a.id))}),this.state.title||this.state.description?this.show():this.hide()}update(e){this.setState(e)}dispose(){const e=this.player_.tech_,t=e&&e.el_;t&&(t.removeAttribute("aria-labelledby"),t.removeAttribute("aria-describedby")),super.dispose(),this.els=null}}_e.registerComponent("TitleBar",CO);const EO={initialDisplay:4e3,position:[],takeFocus:!1};class wO extends _i{constructor(e,t){t=gt(EO,t),super(e,t),this.controlText(t.controlText),this.hide(),this.on(this.player_,["useractive","userinactive"],i=>{this.removeClass("force-display")})}buildCSSClass(){return`vjs-transient-button focus-visible ${this.options_.position.map(e=>`vjs-${e}`).join(" ")}`}createEl(){const e=He("button",{},{type:"button",class:this.buildCSSClass()},He("span"));return this.controlTextEl_=e.querySelector("span"),e}show(){super.show(),this.addClass("force-display"),this.options_.takeFocus&&this.el().focus({preventScroll:!0}),this.forceDisplayTimeout=this.player_.setTimeout(()=>{this.removeClass("force-display")},this.options_.initialDisplay)}hide(){this.removeClass("force-display"),super.hide()}dispose(){this.player_.clearTimeout(this.forceDisplayTimeout),super.dispose()}}_e.registerComponent("TransientButton",wO);const Bg=s=>{const e=s.el();if(e.hasAttribute("src"))return s.triggerSourceset(e.src),!0;const t=s.$$("source"),i=[];let r="";if(!t.length)return!1;for(let n=0;n<t.length;n++){const a=t[n].src;a&&i.indexOf(a)===-1&&i.push(a)}return i.length?(i.length===1&&(r=i[0]),s.triggerSourceset(r),!0):!1},kO=Object.defineProperty({},"innerHTML",{get(){return this.cloneNode(!0).innerHTML},set(s){const e=ce.createElement(this.nodeName.toLowerCase());e.innerHTML=s;const t=ce.createDocumentFragment();for(;e.childNodes.length;)t.appendChild(e.childNodes[0]);return this.innerText="",O.Element.prototype.appendChild.call(this,t),this.innerHTML}}),r2=(s,e)=>{let t={};for(let i=0;i<s.length&&(t=Object.getOwnPropertyDescriptor(s[i],e),!(t&&t.set&&t.get));i++);return t.enumerable=!0,t.configurable=!0,t},AO=s=>r2([s.el(),O.HTMLMediaElement.prototype,O.Element.prototype,kO],"innerHTML"),X_=function(s){const e=s.el();if(e.resetSourceWatch_)return;const t={},i=AO(s),r=n=>(...a)=>{const o=n.apply(e,a);return Bg(s),o};["append","appendChild","insertAdjacentHTML"].forEach(n=>{e[n]&&(t[n]=e[n],e[n]=r(t[n]))}),Object.defineProperty(e,"innerHTML",gt(i,{set:r(i.set)})),e.resetSourceWatch_=()=>{e.resetSourceWatch_=null,Object.keys(t).forEach(n=>{e[n]=t[n]}),Object.defineProperty(e,"innerHTML",i)},s.one("sourceset",e.resetSourceWatch_)},IO=Object.defineProperty({},"src",{get(){return this.hasAttribute("src")?EE(O.Element.prototype.getAttribute.call(this,"src")):""},set(s){return O.Element.prototype.setAttribute.call(this,"src",s),s}}),PO=s=>r2([s.el(),O.HTMLMediaElement.prototype,IO],"src"),DO=function(s){if(!s.featuresSourceset)return;const e=s.el();if(e.resetSourceset_)return;const t=PO(s),i=e.setAttribute,r=e.load;Object.defineProperty(e,"src",gt(t,{set:n=>{const a=t.set.call(e,n);return s.triggerSourceset(e.src),a}})),e.setAttribute=(n,a)=>{const o=i.call(e,n,a);return/src/i.test(n)&&s.triggerSourceset(e.src),o},e.load=()=>{const n=r.call(e);return Bg(s)||(s.triggerSourceset(""),X_(s)),n},e.currentSrc?s.triggerSourceset(e.currentSrc):Bg(s)||X_(s),e.resetSourceset_=()=>{e.resetSourceset_=null,e.load=r,e.setAttribute=i,Object.defineProperty(e,"src",t),e.resetSourceWatch_&&e.resetSourceWatch_()}};let Le=class Ic extends vt{constructor(e,t){super(e,t);const i=e.source;let r=!1;if(this.featuresVideoFrameCallback=this.featuresVideoFrameCallback&&this.el_.tagName==="VIDEO",i&&(this.el_.currentSrc!==i.src||e.tag&&e.tag.initNetworkState_===3)?this.setSource(i):this.handleLateInit_(this.el_),e.enableSourceset&&this.setupSourcesetHandling_(),this.isScrubbing_=!1,this.el_.hasChildNodes()){const n=this.el_.childNodes;let a=n.length;const o=[];for(;a--;){const l=n[a];l.nodeName.toLowerCase()==="track"&&(this.featuresNativeTextTracks?(this.remoteTextTrackEls().addTrackElement_(l),this.remoteTextTracks().addTrack(l.track),this.textTracks().addTrack(l.track),!r&&!this.el_.hasAttribute("crossorigin")&&Zh(l.src)&&(r=!0)):o.push(l))}for(let l=0;l<o.length;l++)this.el_.removeChild(o[l])}this.proxyNativeTracks_(),this.featuresNativeTextTracks&&r&&et.warn(`Text Tracks are being loaded from another origin but the crossorigin attribute isn't used.
176
- This may prevent text tracks from loading.`),this.restoreMetadataTracksInIOSNativePlayer_(),(Gl||Hh)&&e.nativeControlsForTouch===!0&&this.setControls(!0),this.proxyWebkitFullscreen_(),this.triggerReady()}dispose(){this.el_&&this.el_.resetSourceset_&&this.el_.resetSourceset_(),Ic.disposeMediaElement(this.el_),this.options_=null,super.dispose()}setupSourcesetHandling_(){DO(this)}restoreMetadataTracksInIOSNativePlayer_(){const e=this.textTracks();let t;const i=()=>{t=[];for(let n=0;n<e.length;n++){const a=e[n];a.kind==="metadata"&&t.push({track:a,storedMode:a.mode})}};i(),e.addEventListener("change",i),this.on("dispose",()=>e.removeEventListener("change",i));const r=()=>{for(let n=0;n<t.length;n++){const a=t[n];a.track.mode==="disabled"&&a.track.mode!==a.storedMode&&(a.track.mode=a.storedMode)}e.removeEventListener("change",r)};this.on("webkitbeginfullscreen",()=>{e.removeEventListener("change",i),e.removeEventListener("change",r),e.addEventListener("change",r)}),this.on("webkitendfullscreen",()=>{e.removeEventListener("change",i),e.addEventListener("change",i),e.removeEventListener("change",r)})}overrideNative_(e,t){if(t!==this[`featuresNative${e}Tracks`])return;const i=e.toLowerCase();this[`${i}TracksListeners_`]&&Object.keys(this[`${i}TracksListeners_`]).forEach(r=>{this.el()[`${i}Tracks`].removeEventListener(r,this[`${i}TracksListeners_`][r])}),this[`featuresNative${e}Tracks`]=!t,this[`${i}TracksListeners_`]=null,this.proxyNativeTracksForType_(i)}overrideNativeAudioTracks(e){this.overrideNative_("Audio",e)}overrideNativeVideoTracks(e){this.overrideNative_("Video",e)}proxyNativeTracksForType_(e){const t=gr[e],i=this.el()[t.getterName],r=this[t.getterName]();if(!this[`featuresNative${t.capitalName}Tracks`]||!i||!i.addEventListener)return;const n={change:o=>{const l={type:"change",target:r,currentTarget:r,srcElement:r};r.trigger(l),e==="text"&&this[So.remoteText.getterName]().trigger(l)},addtrack(o){r.addTrack(o.track)},removetrack(o){r.removeTrack(o.track)}},a=function(){const o=[];for(let l=0;l<r.length;l++){let u=!1;for(let c=0;c<i.length;c++)if(i[c]===r[l]){u=!0;break}u||o.push(r[l])}for(;o.length;)r.removeTrack(o.shift())};this[t.getterName+"Listeners_"]=n,Object.keys(n).forEach(o=>{const l=n[o];i.addEventListener(o,l),this.on("dispose",u=>i.removeEventListener(o,l))}),this.on("loadstart",a),this.on("dispose",o=>this.off("loadstart",a))}proxyNativeTracks_(){gr.names.forEach(e=>{this.proxyNativeTracksForType_(e)})}createEl(){let e=this.options_.tag;if(!e||!(this.options_.playerElIngest||this.movingMediaElementInDOM)){if(e){const i=e.cloneNode(!0);e.parentNode&&e.parentNode.insertBefore(i,e),Ic.disposeMediaElement(e),e=i}else{e=ce.createElement("video");const i=this.options_.tag&&ns(this.options_.tag),r=gt({},i);(!Gl||this.options_.nativeControlsForTouch!==!0)&&delete r.controls,tE(e,Object.assign(r,{id:this.options_.techId,class:"vjs-tech"}))}e.playerId=this.options_.playerId}typeof this.options_.preload<"u"&&yo(e,"preload",this.options_.preload),this.options_.disablePictureInPicture!==void 0&&(e.disablePictureInPicture=this.options_.disablePictureInPicture);const t=["loop","muted","playsinline","autoplay"];for(let i=0;i<t.length;i++){const r=t[i],n=this.options_[r];typeof n<"u"&&(n?yo(e,r,r):Gh(e,r),e[r]=n)}return e}handleLateInit_(e){if(e.networkState===0||e.networkState===3)return;if(e.readyState===0){let i=!1;const r=function(){i=!0};this.on("loadstart",r);const n=function(){i||this.trigger("loadstart")};this.on("loadedmetadata",n),this.ready(function(){this.off("loadstart",r),this.off("loadedmetadata",n),i||this.trigger("loadstart")});return}const t=["loadstart"];t.push("loadedmetadata"),e.readyState>=2&&t.push("loadeddata"),e.readyState>=3&&t.push("canplay"),e.readyState>=4&&t.push("canplaythrough"),this.ready(function(){t.forEach(function(i){this.trigger(i)},this)})}setScrubbing(e){this.isScrubbing_=e}scrubbing(){return this.isScrubbing_}setCurrentTime(e){try{this.isScrubbing_&&this.el_.fastSeek&&zh?this.el_.fastSeek(e):this.el_.currentTime=e}catch(t){et(t,"Video is not ready. (Video.js)")}}duration(){if(this.el_.duration===1/0&&tn&&rn&&this.el_.currentTime===0){const e=()=>{this.el_.currentTime>0&&(this.el_.duration===1/0&&this.trigger("durationchange"),this.off("timeupdate",e))};return this.on("timeupdate",e),NaN}return this.el_.duration||NaN}width(){return this.el_.offsetWidth}height(){return this.el_.offsetHeight}proxyWebkitFullscreen_(){if(!("webkitDisplayingFullscreen"in this.el_))return;const e=function(){this.trigger("fullscreenchange",{isFullscreen:!1}),this.el_.controls&&!this.options_.nativeControlsForTouch&&this.controls()&&(this.el_.controls=!1)},t=function(){"webkitPresentationMode"in this.el_&&this.el_.webkitPresentationMode!=="picture-in-picture"&&(this.one("webkitendfullscreen",e),this.trigger("fullscreenchange",{isFullscreen:!0,nativeIOSFullscreen:!0}))};this.on("webkitbeginfullscreen",t),this.on("dispose",()=>{this.off("webkitbeginfullscreen",t),this.off("webkitendfullscreen",e)})}supportsFullScreen(){return typeof this.el_.webkitEnterFullScreen=="function"}enterFullScreen(){const e=this.el_;if(e.paused&&e.networkState<=e.HAVE_METADATA)Gr(this.el_.play()),this.setTimeout(function(){e.pause();try{e.webkitEnterFullScreen()}catch(t){this.trigger("fullscreenerror",t)}},0);else try{e.webkitEnterFullScreen()}catch(t){this.trigger("fullscreenerror",t)}}exitFullScreen(){if(!this.el_.webkitDisplayingFullscreen){this.trigger("fullscreenerror",new Error("The video is not fullscreen"));return}this.el_.webkitExitFullScreen()}requestPictureInPicture(){return this.el_.requestPictureInPicture()}requestVideoFrameCallback(e){return this.featuresVideoFrameCallback&&!this.el_.webkitKeys?this.el_.requestVideoFrameCallback(e):super.requestVideoFrameCallback(e)}cancelVideoFrameCallback(e){this.featuresVideoFrameCallback&&!this.el_.webkitKeys?this.el_.cancelVideoFrameCallback(e):super.cancelVideoFrameCallback(e)}src(e){if(e===void 0)return this.el_.src;this.setSrc(e)}addSourceElement(e,t){if(!e)return et.error("Invalid source URL."),!1;const i={src:e};t&&(i.type=t);const r=He("source",{},i);return this.el_.appendChild(r),!0}removeSourceElement(e){if(!e)return et.error("Source URL is required to remove the source element."),!1;const t=this.el_.querySelectorAll("source");for(const i of t)if(i.src===e)return this.el_.removeChild(i),!0;return et.warn(`No matching source element found with src: ${e}`),!1}reset(){Ic.resetMediaElement(this.el_)}currentSrc(){return this.currentSource_?this.currentSource_.src:this.el_.currentSrc}setControls(e){this.el_.controls=!!e}addTextTrack(e,t,i){return this.featuresNativeTextTracks?this.el_.addTextTrack(e,t,i):super.addTextTrack(e,t,i)}createRemoteTextTrack(e){if(!this.featuresNativeTextTracks)return super.createRemoteTextTrack(e);const t=ce.createElement("track");return e.kind&&(t.kind=e.kind),e.label&&(t.label=e.label),(e.language||e.srclang)&&(t.srclang=e.language||e.srclang),e.default&&(t.default=e.default),e.id&&(t.id=e.id),e.src&&(t.src=e.src),t}addRemoteTextTrack(e,t){const i=super.addRemoteTextTrack(e,t);return this.featuresNativeTextTracks&&this.el().appendChild(i),i}removeRemoteTextTrack(e){if(super.removeRemoteTextTrack(e),this.featuresNativeTextTracks){const t=this.$$("track");let i=t.length;for(;i--;)(e===t[i]||e===t[i].track)&&this.el().removeChild(t[i])}}getVideoPlaybackQuality(){if(typeof this.el().getVideoPlaybackQuality=="function")return this.el().getVideoPlaybackQuality();const e={};return typeof this.el().webkitDroppedFrameCount<"u"&&typeof this.el().webkitDecodedFrameCount<"u"&&(e.droppedVideoFrames=this.el().webkitDroppedFrameCount,e.totalVideoFrames=this.el().webkitDecodedFrameCount),O.performance&&(e.creationTime=O.performance.now()),e}};jh(Le,"TEST_VID",function(){if(!Lo())return;const s=ce.createElement("video"),e=ce.createElement("track");return e.kind="captions",e.srclang="en",e.label="English",s.appendChild(e),s});Le.isSupported=function(){try{Le.TEST_VID.volume=.5}catch{return!1}return!!(Le.TEST_VID&&Le.TEST_VID.canPlayType)};Le.canPlayType=function(s){return Le.TEST_VID.canPlayType(s)};Le.canPlaySource=function(s,e){return Le.canPlayType(s.type)};Le.canControlVolume=function(){try{const s=Le.TEST_VID.volume;Le.TEST_VID.volume=s/2+.1;const e=s!==Le.TEST_VID.volume;return e&&Li?(O.setTimeout(()=>{Le&&Le.prototype&&(Le.prototype.featuresVolumeControl=s!==Le.TEST_VID.volume)}),!1):e}catch{return!1}};Le.canMuteVolume=function(){try{const s=Le.TEST_VID.muted;return Le.TEST_VID.muted=!s,Le.TEST_VID.muted?yo(Le.TEST_VID,"muted","muted"):Gh(Le.TEST_VID,"muted","muted"),s!==Le.TEST_VID.muted}catch{return!1}};Le.canControlPlaybackRate=function(){if(tn&&rn&&qh<58)return!1;try{const s=Le.TEST_VID.playbackRate;return Le.TEST_VID.playbackRate=s/2+.1,s!==Le.TEST_VID.playbackRate}catch{return!1}};Le.canOverrideAttributes=function(){try{const s=()=>{};Object.defineProperty(ce.createElement("video"),"src",{get:s,set:s}),Object.defineProperty(ce.createElement("audio"),"src",{get:s,set:s}),Object.defineProperty(ce.createElement("video"),"innerHTML",{get:s,set:s}),Object.defineProperty(ce.createElement("audio"),"innerHTML",{get:s,set:s})}catch{return!1}return!0};Le.supportsNativeTextTracks=function(){return zh||Li&&rn};Le.supportsNativeVideoTracks=function(){return!!(Le.TEST_VID&&Le.TEST_VID.videoTracks)};Le.supportsNativeAudioTracks=function(){return!!(Le.TEST_VID&&Le.TEST_VID.audioTracks)};Le.Events=["loadstart","suspend","abort","error","emptied","stalled","loadedmetadata","loadeddata","canplay","canplaythrough","playing","waiting","seeking","seeked","ended","durationchange","timeupdate","progress","play","pause","ratechange","resize","volumechange"];[["featuresMuteControl","canMuteVolume"],["featuresPlaybackRate","canControlPlaybackRate"],["featuresSourceset","canOverrideAttributes"],["featuresNativeTextTracks","supportsNativeTextTracks"],["featuresNativeVideoTracks","supportsNativeVideoTracks"],["featuresNativeAudioTracks","supportsNativeAudioTracks"]].forEach(function([s,e]){jh(Le.prototype,s,()=>Le[e](),!0)});Le.prototype.featuresVolumeControl=Le.canControlVolume();Le.prototype.movingMediaElementInDOM=!Li;Le.prototype.featuresFullscreenResize=!0;Le.prototype.featuresProgressEvents=!0;Le.prototype.featuresTimeupdateEvents=!0;Le.prototype.featuresVideoFrameCallback=!!(Le.TEST_VID&&Le.TEST_VID.requestVideoFrameCallback);Le.disposeMediaElement=function(s){if(s){for(s.parentNode&&s.parentNode.removeChild(s);s.hasChildNodes();)s.removeChild(s.firstChild);s.removeAttribute("src"),typeof s.load=="function"&&function(){try{s.load()}catch{}}()}};Le.resetMediaElement=function(s){if(!s)return;const e=s.querySelectorAll("source");let t=e.length;for(;t--;)s.removeChild(e[t]);s.removeAttribute("src"),typeof s.load=="function"&&function(){try{s.load()}catch{}}()};["muted","defaultMuted","autoplay","controls","loop","playsinline"].forEach(function(s){Le.prototype[s]=function(){return this.el_[s]||this.el_.hasAttribute(s)}});["muted","defaultMuted","autoplay","loop","playsinline"].forEach(function(s){Le.prototype["set"+qt(s)]=function(e){this.el_[s]=e,e?this.el_.setAttribute(s,s):this.el_.removeAttribute(s)}});["paused","currentTime","buffered","volume","poster","preload","error","seeking","seekable","ended","playbackRate","defaultPlaybackRate","disablePictureInPicture","played","networkState","readyState","videoWidth","videoHeight","crossOrigin"].forEach(function(s){Le.prototype[s]=function(){return this.el_[s]}});["volume","src","poster","preload","playbackRate","defaultPlaybackRate","disablePictureInPicture","crossOrigin"].forEach(function(s){Le.prototype["set"+qt(s)]=function(e){this.el_[s]=e}});["pause","load","play"].forEach(function(s){Le.prototype[s]=function(){return this.el_[s]()}});vt.withSourceHandlers(Le);Le.nativeSourceHandler={};Le.nativeSourceHandler.canPlayType=function(s){try{return Le.TEST_VID.canPlayType(s)}catch{return""}};Le.nativeSourceHandler.canHandleSource=function(s,e){if(s.type)return Le.nativeSourceHandler.canPlayType(s.type);if(s.src){const t=Yv(s.src);return Le.nativeSourceHandler.canPlayType(`video/${t}`)}return""};Le.nativeSourceHandler.handleSource=function(s,e,t){e.setSrc(s.src)};Le.nativeSourceHandler.dispose=function(){};Le.registerSourceHandler(Le.nativeSourceHandler);vt.registerTech("Html5",Le);const n2=["progress","abort","suspend","emptied","stalled","loadedmetadata","loadeddata","timeupdate","resize","volumechange","texttrackchange"],Bf={canplay:"CanPlay",canplaythrough:"CanPlayThrough",playing:"Playing",seeked:"Seeked"},Ug=["tiny","xsmall","small","medium","large","xlarge","huge"],Pc={};Ug.forEach(s=>{const e=s.charAt(0)==="x"?`x-${s.substring(1)}`:s;Pc[s]=`vjs-layout-${e}`});const NO={tiny:210,xsmall:320,small:425,medium:768,large:1440,xlarge:2560,huge:1/0};let Xt=class Ha extends _e{constructor(e,t,i){if(e.id=e.id||t.id||`vjs_video_${yr()}`,t=Object.assign(Ha.getTagSettings(e),t),t.initChildren=!1,t.createEl=!1,t.evented=!1,t.reportTouchActivity=!1,!t.language){const a=e.closest("[lang]");a&&(t.language=a.getAttribute("lang"))}if(super(null,t,i),this.boundDocumentFullscreenChange_=a=>this.documentFullscreenChange_(a),this.boundFullWindowOnEscKey_=a=>this.fullWindowOnEscKey(a),this.boundUpdateStyleEl_=a=>this.updateStyleEl_(a),this.boundApplyInitTime_=a=>this.applyInitTime_(a),this.boundUpdateCurrentBreakpoint_=a=>this.updateCurrentBreakpoint_(a),this.boundHandleTechClick_=a=>this.handleTechClick_(a),this.boundHandleTechDoubleClick_=a=>this.handleTechDoubleClick_(a),this.boundHandleTechTouchStart_=a=>this.handleTechTouchStart_(a),this.boundHandleTechTouchMove_=a=>this.handleTechTouchMove_(a),this.boundHandleTechTouchEnd_=a=>this.handleTechTouchEnd_(a),this.boundHandleTechTap_=a=>this.handleTechTap_(a),this.boundUpdatePlayerHeightOnAudioOnlyMode_=a=>this.updatePlayerHeightOnAudioOnlyMode_(a),this.isFullscreen_=!1,this.log=V1(this.id_),this.fsApi_=qc,this.isPosterFromTech_=!1,this.queuedCallbacks_=[],this.isReady_=!1,this.hasStarted_=!1,this.userActive_=!1,this.debugEnabled_=!1,this.audioOnlyMode_=!1,this.audioPosterMode_=!1,this.audioOnlyCache_={controlBarHeight:null,playerHeight:null,hiddenChildren:[]},!this.options_||!this.options_.techOrder||!this.options_.techOrder.length)throw new Error("No techOrder specified. Did you overwrite videojs.options instead of just changing the properties you want to override?");if(this.tag=e,this.tagAttributes=e&&ns(e),this.language(this.options_.language),t.languages){const a={};Object.getOwnPropertyNames(t.languages).forEach(function(o){a[o.toLowerCase()]=t.languages[o]}),this.languages_=a}else this.languages_=Ha.prototype.options_.languages;this.resetCache_(),this.poster_=t.poster||"",this.controls_=!!t.controls,e.controls=!1,e.removeAttribute("controls"),this.changingSrc_=!1,this.playCallbacks_=[],this.playTerminatedQueue_=[],e.hasAttribute("autoplay")?this.autoplay(!0):this.autoplay(this.options_.autoplay),t.plugins&&Object.keys(t.plugins).forEach(a=>{if(typeof this[a]!="function")throw new Error(`plugin "${a}" does not exist`)}),this.scrubbing_=!1,this.el_=this.createEl(),Gv(this,{eventBusKey:"el_"}),this.fsApi_.requestFullscreen&&(sr(ce,this.fsApi_.fullscreenchange,this.boundDocumentFullscreenChange_),this.on(this.fsApi_.fullscreenchange,this.boundDocumentFullscreenChange_)),this.fluid_&&this.on(["playerreset","resize"],this.boundUpdateStyleEl_);const r=gt(this.options_);if(t.plugins&&Object.keys(t.plugins).forEach(a=>{this[a](t.plugins[a])}),t.debug&&this.debug(!0),this.options_.playerOptions=r,this.middleware_=[],this.playbackRates(t.playbackRates),t.experimentalSvgIcons){const o=new O.DOMParser().parseFromString(tO,"image/svg+xml");if(o.querySelector("parsererror"))et.warn("Failed to load SVG Icons. Falling back to Font Icons."),this.options_.experimentalSvgIcons=null;else{const u=o.documentElement;u.style.display="none",this.el_.appendChild(u),this.addClass("vjs-svg-icons-enabled")}}this.initChildren(),this.isAudio(e.nodeName.toLowerCase()==="audio"),this.controls()?this.addClass("vjs-controls-enabled"):this.addClass("vjs-controls-disabled"),this.el_.setAttribute("role","region"),this.isAudio()?this.el_.setAttribute("aria-label",this.localize("Audio Player")):this.el_.setAttribute("aria-label",this.localize("Video Player")),this.isAudio()&&this.addClass("vjs-audio"),t.spatialNavigation&&t.spatialNavigation.enabled&&(this.spatialNavigation=new iO(this),this.addClass("vjs-spatial-navigation-enabled")),Gl&&this.addClass("vjs-touch-enabled"),Li||this.addClass("vjs-workinghover"),Ha.players[this.id_]=this;const n=Ag.split(".")[0];this.addClass(`vjs-v${n}`),this.userActive(!0),this.reportUserActivity(),this.one("play",a=>this.listenForUserActivity_(a)),this.on("keydown",a=>this.handleKeyDown(a)),this.on("languagechange",a=>this.handleLanguagechange(a)),this.breakpoints(this.options_.breakpoints),this.responsive(this.options_.responsive),this.on("ready",()=>{this.audioPosterMode(this.options_.audioPosterMode),this.audioOnlyMode(this.options_.audioOnlyMode)})}dispose(){this.trigger("dispose"),this.off("dispose"),yi(ce,this.fsApi_.fullscreenchange,this.boundDocumentFullscreenChange_),yi(ce,"keydown",this.boundFullWindowOnEscKey_),this.styleEl_&&this.styleEl_.parentNode&&(this.styleEl_.parentNode.removeChild(this.styleEl_),this.styleEl_=null),Ha.players[this.id_]=null,this.tag&&this.tag.player&&(this.tag.player=null),this.el_&&this.el_.player&&(this.el_.player=null),this.tech_&&(this.tech_.dispose(),this.isPosterFromTech_=!1,this.poster_=""),this.playerElIngest_&&(this.playerElIngest_=null),this.tag&&(this.tag=null),YL(this),wi.names.forEach(e=>{const t=wi[e],i=this[t.getterName]();i&&i.off&&i.off()}),super.dispose({restoreEl:this.options_.restoreEl})}createEl(){let e=this.tag,t,i=this.playerElIngest_=e.parentNode&&e.parentNode.hasAttribute&&e.parentNode.hasAttribute("data-vjs-player");const r=this.tag.tagName.toLowerCase()==="video-js";i?t=this.el_=e.parentNode:r||(t=this.el_=super.createEl("div"));const n=ns(e);if(r){for(t=this.el_=e,e=this.tag=ce.createElement("video");t.children.length;)e.appendChild(t.firstChild);Rl(t,"video-js")||Qs(t,"video-js"),t.appendChild(e),i=this.playerElIngest_=t,Object.keys(t).forEach(l=>{try{e[l]=t[l]}catch{}})}e.setAttribute("tabindex","-1"),n.tabindex="-1",rn&&Vh&&(e.setAttribute("role","application"),n.role="application"),e.removeAttribute("width"),e.removeAttribute("height"),"width"in n&&delete n.width,"height"in n&&delete n.height,Object.getOwnPropertyNames(n).forEach(function(l){r&&l==="class"||t.setAttribute(l,n[l]),r&&e.setAttribute(l,n[l])}),e.playerId=e.id,e.id+="_html5_api",e.className="vjs-tech",e.player=t.player=this,this.addClass("vjs-paused");const a=["IS_SMART_TV","IS_TIZEN","IS_WEBOS","IS_ANDROID","IS_IPAD","IS_IPHONE","IS_CHROMECAST_RECEIVER"].filter(l=>Y1[l]).map(l=>"vjs-device-"+l.substring(3).toLowerCase().replace(/\_/g,"-"));if(this.addClass(...a),O.VIDEOJS_NO_DYNAMIC_STYLE!==!0){this.styleEl_=dE("vjs-styles-dimensions");const l=ls(".vjs-styles-defaults"),u=ls("head");u.insertBefore(this.styleEl_,l?l.nextSibling:u.firstChild)}this.fill_=!1,this.fluid_=!1,this.width(this.options_.width),this.height(this.options_.height),this.fill(this.options_.fill),this.fluid(this.options_.fluid),this.aspectRatio(this.options_.aspectRatio),this.crossOrigin(this.options_.crossOrigin||this.options_.crossorigin);const o=e.getElementsByTagName("a");for(let l=0;l<o.length;l++){const u=o.item(l);Qs(u,"vjs-hidden"),u.setAttribute("hidden","hidden")}return e.initNetworkState_=e.networkState,e.parentNode&&!i&&e.parentNode.insertBefore(t,e),Pg(e,t),this.children_.unshift(e),this.el_.setAttribute("lang",this.language_),this.el_.setAttribute("translate","no"),this.el_=t,t}crossOrigin(e){if(typeof e>"u")return this.techGet_("crossOrigin");if(e!==null&&e!=="anonymous"&&e!=="use-credentials"){et.warn(`crossOrigin must be null, "anonymous" or "use-credentials", given "${e}"`);return}this.techCall_("setCrossOrigin",e),this.posterImage&&this.posterImage.crossOrigin(e)}width(e){return this.dimension("width",e)}height(e){return this.dimension("height",e)}dimension(e,t){const i=e+"_";if(t===void 0)return this[i]||0;if(t===""||t==="auto"){this[i]=void 0,this.updateStyleEl_();return}const r=parseFloat(t);if(isNaN(r)){et.error(`Improper value "${t}" supplied for for ${e}`);return}this[i]=r,this.updateStyleEl_()}fluid(e){if(e===void 0)return!!this.fluid_;this.fluid_=!!e,In(this)&&this.off(["playerreset","resize"],this.boundUpdateStyleEl_),e?(this.addClass("vjs-fluid"),this.fill(!1),kL(this,()=>{this.on(["playerreset","resize"],this.boundUpdateStyleEl_)})):this.removeClass("vjs-fluid"),this.updateStyleEl_()}fill(e){if(e===void 0)return!!this.fill_;this.fill_=!!e,e?(this.addClass("vjs-fill"),this.fluid(!1)):this.removeClass("vjs-fill")}aspectRatio(e){if(e===void 0)return this.aspectRatio_;if(!/^\d+\:\d+$/.test(e))throw new Error("Improper value supplied for aspect ratio. The format should be width:height, for example 16:9.");this.aspectRatio_=e,this.fluid(!0),this.updateStyleEl_()}updateStyleEl_(){if(O.VIDEOJS_NO_DYNAMIC_STYLE===!0){const o=typeof this.width_=="number"?this.width_:this.options_.width,l=typeof this.height_=="number"?this.height_:this.options_.height,u=this.tech_&&this.tech_.el();u&&(o>=0&&(u.width=o),l>=0&&(u.height=l));return}let e,t,i,r;this.aspectRatio_!==void 0&&this.aspectRatio_!=="auto"?i=this.aspectRatio_:this.videoWidth()>0?i=this.videoWidth()+":"+this.videoHeight():i="16:9";const n=i.split(":"),a=n[1]/n[0];this.width_!==void 0?e=this.width_:this.height_!==void 0?e=this.height_/a:e=this.videoWidth()||300,this.height_!==void 0?t=this.height_:t=e*a,/^[^a-zA-Z]/.test(this.id())?r="dimensions-"+this.id():r=this.id()+"-dimensions",this.addClass(r),fE(this.styleEl_,`
177
- .${r} {
178
- width: ${e}px;
179
- height: ${t}px;
180
- }
181
-
182
- .${r}.vjs-fluid:not(.vjs-audio-only-mode) {
183
- padding-top: ${a*100}%;
184
- }
185
- `)}loadTech_(e,t){this.tech_&&this.unloadTech_();const i=qt(e),r=e.charAt(0).toLowerCase()+e.slice(1);i!=="Html5"&&this.tag&&(vt.getTech("Html5").disposeMediaElement(this.tag),this.tag.player=null,this.tag=null),this.techName_=i,this.isReady_=!1;let n=this.autoplay();(typeof this.autoplay()=="string"||this.autoplay()===!0&&this.options_.normalizeAutoplay)&&(n=!1);const a={source:t,autoplay:n,nativeControlsForTouch:this.options_.nativeControlsForTouch,playerId:this.id(),techId:`${this.id()}_${r}_api`,playsinline:this.options_.playsinline,preload:this.options_.preload,loop:this.options_.loop,disablePictureInPicture:this.options_.disablePictureInPicture,muted:this.options_.muted,poster:this.poster(),language:this.language(),playerElIngest:this.playerElIngest_||!1,"vtt.js":this.options_["vtt.js"],canOverridePoster:!!this.options_.techCanOverridePoster,enableSourceset:this.options_.enableSourceset};wi.names.forEach(l=>{const u=wi[l];a[u.getterName]=this[u.privateName]}),Object.assign(a,this.options_[i]),Object.assign(a,this.options_[r]),Object.assign(a,this.options_[e.toLowerCase()]),this.tag&&(a.tag=this.tag),t&&t.src===this.cache_.src&&this.cache_.currentTime>0&&(a.startTime=this.cache_.currentTime);const o=vt.getTech(e);if(!o)throw new Error(`No Tech named '${i}' exists! '${i}' should be registered using videojs.registerTech()'`);this.tech_=new o(a),this.tech_.ready(St(this,this.handleTechReady_),!0),k_.jsonToTextTracks(this.textTracksJson_||[],this.tech_),n2.forEach(l=>{this.on(this.tech_,l,u=>this[`handleTech${qt(l)}_`](u))}),Object.keys(Bf).forEach(l=>{this.on(this.tech_,l,u=>{if(this.tech_.playbackRate()===0&&this.tech_.seeking()){this.queuedCallbacks_.push({callback:this[`handleTech${Bf[l]}_`].bind(this),event:u});return}this[`handleTech${Bf[l]}_`](u)})}),this.on(this.tech_,"loadstart",l=>this.handleTechLoadStart_(l)),this.on(this.tech_,"sourceset",l=>this.handleTechSourceset_(l)),this.on(this.tech_,"waiting",l=>this.handleTechWaiting_(l)),this.on(this.tech_,"ended",l=>this.handleTechEnded_(l)),this.on(this.tech_,"seeking",l=>this.handleTechSeeking_(l)),this.on(this.tech_,"play",l=>this.handleTechPlay_(l)),this.on(this.tech_,"pause",l=>this.handleTechPause_(l)),this.on(this.tech_,"durationchange",l=>this.handleTechDurationChange_(l)),this.on(this.tech_,"fullscreenchange",(l,u)=>this.handleTechFullscreenChange_(l,u)),this.on(this.tech_,"fullscreenerror",(l,u)=>this.handleTechFullscreenError_(l,u)),this.on(this.tech_,"enterpictureinpicture",l=>this.handleTechEnterPictureInPicture_(l)),this.on(this.tech_,"leavepictureinpicture",l=>this.handleTechLeavePictureInPicture_(l)),this.on(this.tech_,"error",l=>this.handleTechError_(l)),this.on(this.tech_,"posterchange",l=>this.handleTechPosterChange_(l)),this.on(this.tech_,"textdata",l=>this.handleTechTextData_(l)),this.on(this.tech_,"ratechange",l=>this.handleTechRateChange_(l)),this.on(this.tech_,"loadedmetadata",this.boundUpdateStyleEl_),this.usingNativeControls(this.techGet_("controls")),this.controls()&&!this.usingNativeControls()&&this.addTechControlsListeners_(),this.tech_.el().parentNode!==this.el()&&(i!=="Html5"||!this.tag)&&Pg(this.tech_.el(),this.el()),this.tag&&(this.tag.player=null,this.tag=null)}unloadTech_(){wi.names.forEach(e=>{const t=wi[e];this[t.privateName]=this[t.getterName]()}),this.textTracksJson_=k_.textTracksToJson(this.tech_),this.isReady_=!1,this.tech_.dispose(),this.tech_=!1,this.isPosterFromTech_&&(this.poster_="",this.trigger("posterchange")),this.isPosterFromTech_=!1}tech(e){return e===void 0&&et.warn(`Using the tech directly can be dangerous. I hope you know what you're doing.
186
- See https://github.com/videojs/video.js/issues/2617 for more info.
187
- `),this.tech_}version(){return{"video.js":Ag}}addTechControlsListeners_(){this.removeTechControlsListeners_(),this.on(this.tech_,"click",this.boundHandleTechClick_),this.on(this.tech_,"dblclick",this.boundHandleTechDoubleClick_),this.on(this.tech_,"touchstart",this.boundHandleTechTouchStart_),this.on(this.tech_,"touchmove",this.boundHandleTechTouchMove_),this.on(this.tech_,"touchend",this.boundHandleTechTouchEnd_),this.on(this.tech_,"tap",this.boundHandleTechTap_)}removeTechControlsListeners_(){this.off(this.tech_,"tap",this.boundHandleTechTap_),this.off(this.tech_,"touchstart",this.boundHandleTechTouchStart_),this.off(this.tech_,"touchmove",this.boundHandleTechTouchMove_),this.off(this.tech_,"touchend",this.boundHandleTechTouchEnd_),this.off(this.tech_,"click",this.boundHandleTechClick_),this.off(this.tech_,"dblclick",this.boundHandleTechDoubleClick_)}handleTechReady_(){this.triggerReady(),this.cache_.volume&&this.techCall_("setVolume",this.cache_.volume),this.handleTechPosterChange_(),this.handleTechDurationChange_()}handleTechLoadStart_(){this.removeClass("vjs-ended","vjs-seeking"),this.error(null),this.handleTechDurationChange_(),this.paused()?(this.hasStarted(!1),this.trigger("loadstart")):this.trigger("loadstart"),this.manualAutoplay_(this.autoplay()===!0&&this.options_.normalizeAutoplay?"play":this.autoplay())}manualAutoplay_(e){if(!this.tech_||typeof e!="string")return;const t=()=>{const r=this.muted();this.muted(!0);const n=()=>{this.muted(r)};this.playTerminatedQueue_.push(n);const a=this.play();if(Bl(a))return a.catch(o=>{throw n(),new Error(`Rejection at manualAutoplay. Restoring muted value. ${o||""}`)})};let i;if(e==="any"&&!this.muted()?(i=this.play(),Bl(i)&&(i=i.catch(t))):e==="muted"&&!this.muted()?i=t():i=this.play(),!!Bl(i))return i.then(()=>{this.trigger({type:"autoplay-success",autoplay:e})}).catch(()=>{this.trigger({type:"autoplay-failure",autoplay:e})})}updateSourceCaches_(e=""){let t=e,i="";typeof t!="string"&&(t=e.src,i=e.type),this.cache_.source=this.cache_.source||{},this.cache_.sources=this.cache_.sources||[],t&&!i&&(i=eO(this,t)),this.cache_.source=gt({},e,{src:t,type:i});const r=this.cache_.sources.filter(l=>l.src&&l.src===t),n=[],a=this.$$("source"),o=[];for(let l=0;l<a.length;l++){const u=ns(a[l]);n.push(u),u.src&&u.src===t&&o.push(u.src)}o.length&&!r.length?this.cache_.sources=n:r.length||(this.cache_.sources=[this.cache_.source]),this.cache_.src=t}handleTechSourceset_(e){if(!this.changingSrc_){let t=n=>this.updateSourceCaches_(n);const i=this.currentSource().src,r=e.src;i&&!/^blob:/.test(i)&&/^blob:/.test(r)&&(!this.lastSource_||this.lastSource_.tech!==r&&this.lastSource_.player!==i)&&(t=()=>{}),t(r),e.src||this.tech_.any(["sourceset","loadstart"],n=>{if(n.type==="sourceset")return;const a=this.techGet_("currentSrc");this.lastSource_.tech=a,this.updateSourceCaches_(a)})}this.lastSource_={player:this.currentSource().src,tech:e.src},this.trigger({src:e.src,type:"sourceset"})}hasStarted(e){if(e===void 0)return this.hasStarted_;e!==this.hasStarted_&&(this.hasStarted_=e,this.hasStarted_?this.addClass("vjs-has-started"):this.removeClass("vjs-has-started"))}handleTechPlay_(){this.removeClass("vjs-ended","vjs-paused"),this.addClass("vjs-playing"),this.hasStarted(!0),this.trigger("play")}handleTechRateChange_(){this.tech_.playbackRate()>0&&this.cache_.lastPlaybackRate===0&&(this.queuedCallbacks_.forEach(e=>e.callback(e.event)),this.queuedCallbacks_=[]),this.cache_.lastPlaybackRate=this.tech_.playbackRate(),this.trigger("ratechange")}handleTechWaiting_(){this.addClass("vjs-waiting"),this.trigger("waiting");const e=this.currentTime(),t=()=>{e!==this.currentTime()&&(this.removeClass("vjs-waiting"),this.off("timeupdate",t))};this.on("timeupdate",t)}handleTechCanPlay_(){this.removeClass("vjs-waiting"),this.trigger("canplay")}handleTechCanPlayThrough_(){this.removeClass("vjs-waiting"),this.trigger("canplaythrough")}handleTechPlaying_(){this.removeClass("vjs-waiting"),this.trigger("playing")}handleTechSeeking_(){this.addClass("vjs-seeking"),this.trigger("seeking")}handleTechSeeked_(){this.removeClass("vjs-seeking","vjs-ended"),this.trigger("seeked")}handleTechPause_(){this.removeClass("vjs-playing"),this.addClass("vjs-paused"),this.trigger("pause")}handleTechEnded_(){this.addClass("vjs-ended"),this.removeClass("vjs-waiting"),this.options_.loop?(this.currentTime(0),this.play()):this.paused()||this.pause(),this.trigger("ended")}handleTechDurationChange_(){this.duration(this.techGet_("duration"))}handleTechClick_(e){this.controls_&&(this.options_===void 0||this.options_.userActions===void 0||this.options_.userActions.click===void 0||this.options_.userActions.click!==!1)&&(this.options_!==void 0&&this.options_.userActions!==void 0&&typeof this.options_.userActions.click=="function"?this.options_.userActions.click.call(this,e):this.paused()?Gr(this.play()):this.pause())}handleTechDoubleClick_(e){if(!this.controls_)return;Array.prototype.some.call(this.$$(".vjs-control-bar, .vjs-modal-dialog"),i=>i.contains(e.target))||(this.options_===void 0||this.options_.userActions===void 0||this.options_.userActions.doubleClick===void 0||this.options_.userActions.doubleClick!==!1)&&(this.options_!==void 0&&this.options_.userActions!==void 0&&typeof this.options_.userActions.doubleClick=="function"?this.options_.userActions.doubleClick.call(this,e):this.isInPictureInPicture()&&!ce.pictureInPictureElement?this.exitPictureInPicture():this.isFullscreen()?this.exitFullscreen():this.requestFullscreen())}handleTechTap_(){this.userActive(!this.userActive())}handleTechTouchStart_(){this.userWasActive=this.userActive()}handleTechTouchMove_(){this.userWasActive&&this.reportUserActivity()}handleTechTouchEnd_(e){e.cancelable&&e.preventDefault()}toggleFullscreenClass_(){this.isFullscreen()?this.addClass("vjs-fullscreen"):this.removeClass("vjs-fullscreen")}documentFullscreenChange_(e){const t=e.target.player;if(t&&t!==this)return;const i=this.el();let r=ce[this.fsApi_.fullscreenElement]===i;!r&&i.matches&&(r=i.matches(":"+this.fsApi_.fullscreen)),this.isFullscreen(r)}handleTechFullscreenChange_(e,t){t&&(t.nativeIOSFullscreen&&(this.addClass("vjs-ios-native-fs"),this.tech_.one("webkitendfullscreen",()=>{this.removeClass("vjs-ios-native-fs")})),this.isFullscreen(t.isFullscreen))}handleTechFullscreenError_(e,t){this.trigger("fullscreenerror",t)}togglePictureInPictureClass_(){this.isInPictureInPicture()?this.addClass("vjs-picture-in-picture"):this.removeClass("vjs-picture-in-picture")}handleTechEnterPictureInPicture_(e){this.isInPictureInPicture(!0)}handleTechLeavePictureInPicture_(e){this.isInPictureInPicture(!1)}handleTechError_(){const e=this.tech_.error();e&&this.error(e)}handleTechTextData_(){let e=null;arguments.length>1&&(e=arguments[1]),this.trigger("textdata",e)}getCache(){return this.cache_}resetCache_(){this.cache_={currentTime:0,initTime:0,inactivityTimeout:this.options_.inactivityTimeout,duration:NaN,lastVolume:1,lastPlaybackRate:this.defaultPlaybackRate(),media:null,src:"",source:{},sources:[],playbackRates:[],volume:1}}techCall_(e,t){this.ready(function(){if(e in XL)return GL(this.middleware_,this.tech_,e,t);if(e in L_)return N_(this.middleware_,this.tech_,e,t);try{this.tech_&&this.tech_[e](t)}catch(i){throw et(i),i}},!0)}techGet_(e){if(!(!this.tech_||!this.tech_.isReady_)){if(e in KL)return WL(this.middleware_,this.tech_,e);if(e in L_)return N_(this.middleware_,this.tech_,e);try{return this.tech_[e]()}catch(t){throw this.tech_[e]===void 0?(et(`Video.js: ${e} method not defined for ${this.techName_} playback technology.`,t),t):t.name==="TypeError"?(et(`Video.js: ${e} unavailable on ${this.techName_} playback technology element.`,t),this.tech_.isReady_=!1,t):(et(t),t)}}}play(){return new Promise(e=>{this.play_(e)})}play_(e=Gr){this.playCallbacks_.push(e);const t=!!(!this.changingSrc_&&(this.src()||this.currentSrc())),i=!!(zh||Li);if(this.waitToPlay_&&(this.off(["ready","loadstart"],this.waitToPlay_),this.waitToPlay_=null),!this.isReady_||!t){this.waitToPlay_=a=>{this.play_()},this.one(["ready","loadstart"],this.waitToPlay_),!t&&i&&this.load();return}const r=this.techGet_("play");i&&this.hasClass("vjs-ended")&&this.resetProgressBar_(),r===null?this.runPlayTerminatedQueue_():this.runPlayCallbacks_(r)}runPlayTerminatedQueue_(){const e=this.playTerminatedQueue_.slice(0);this.playTerminatedQueue_=[],e.forEach(function(t){t()})}runPlayCallbacks_(e){const t=this.playCallbacks_.slice(0);this.playCallbacks_=[],this.playTerminatedQueue_=[],t.forEach(function(i){i(e)})}pause(){this.techCall_("pause")}paused(){return this.techGet_("paused")!==!1}played(){return this.techGet_("played")||Dr(0,0)}scrubbing(e){if(typeof e>"u")return this.scrubbing_;this.scrubbing_=!!e,this.techCall_("setScrubbing",this.scrubbing_),e?this.addClass("vjs-scrubbing"):this.removeClass("vjs-scrubbing")}currentTime(e){if(e===void 0)return this.cache_.currentTime=this.techGet_("currentTime")||0,this.cache_.currentTime;if(e<0&&(e=0),!this.isReady_||this.changingSrc_||!this.tech_||!this.tech_.isReady_){this.cache_.initTime=e,this.off("canplay",this.boundApplyInitTime_),this.one("canplay",this.boundApplyInitTime_);return}this.techCall_("setCurrentTime",e),this.cache_.initTime=0,isFinite(e)&&(this.cache_.currentTime=Number(e))}applyInitTime_(){this.currentTime(this.cache_.initTime)}duration(e){if(e===void 0)return this.cache_.duration!==void 0?this.cache_.duration:NaN;e=parseFloat(e),e<0&&(e=1/0),e!==this.cache_.duration&&(this.cache_.duration=e,e===1/0?this.addClass("vjs-live"):this.removeClass("vjs-live"),isNaN(e)||this.trigger("durationchange"))}remainingTime(){return this.duration()-this.currentTime()}remainingTimeDisplay(){return Math.floor(this.duration())-Math.floor(this.currentTime())}buffered(){let e=this.techGet_("buffered");return(!e||!e.length)&&(e=Dr(0,0)),e}seekable(){let e=this.techGet_("seekable");return(!e||!e.length)&&(e=Dr(0,0)),e}seeking(){return this.techGet_("seeking")}ended(){return this.techGet_("ended")}networkState(){return this.techGet_("networkState")}readyState(){return this.techGet_("readyState")}bufferedPercent(){return SE(this.buffered(),this.duration())}bufferedEnd(){const e=this.buffered(),t=this.duration();let i=e.end(e.length-1);return i>t&&(i=t),i}volume(e){let t;if(e!==void 0){t=Math.max(0,Math.min(1,e)),this.cache_.volume=t,this.techCall_("setVolume",t),t>0&&this.lastVolume_(t);return}return t=parseFloat(this.techGet_("volume")),isNaN(t)?1:t}muted(e){if(e!==void 0){this.techCall_("setMuted",e);return}return this.techGet_("muted")||!1}defaultMuted(e){return e!==void 0&&this.techCall_("setDefaultMuted",e),this.techGet_("defaultMuted")||!1}lastVolume_(e){if(e!==void 0&&e!==0){this.cache_.lastVolume=e;return}return this.cache_.lastVolume}supportsFullScreen(){return this.techGet_("supportsFullScreen")||!1}isFullscreen(e){if(e!==void 0){const t=this.isFullscreen_;this.isFullscreen_=!!e,this.isFullscreen_!==t&&this.fsApi_.prefixed&&this.trigger("fullscreenchange"),this.toggleFullscreenClass_();return}return this.isFullscreen_}requestFullscreen(e){this.isInPictureInPicture()&&this.exitPictureInPicture();const t=this;return new Promise((i,r)=>{function n(){t.off("fullscreenerror",o),t.off("fullscreenchange",a)}function a(){n(),i()}function o(u,c){n(),r(c)}t.one("fullscreenchange",a),t.one("fullscreenerror",o);const l=t.requestFullscreenHelper_(e);l&&(l.then(n,n),l.then(i,r))})}requestFullscreenHelper_(e){let t;if(this.fsApi_.prefixed||(t=this.options_.fullscreen&&this.options_.fullscreen.options||{},e!==void 0&&(t=e)),this.fsApi_.requestFullscreen){const i=this.el_[this.fsApi_.requestFullscreen](t);return i&&i.then(()=>this.isFullscreen(!0),()=>this.isFullscreen(!1)),i}else this.tech_.supportsFullScreen()&&!this.options_.preferFullWindow?this.techCall_("enterFullScreen"):this.enterFullWindow()}exitFullscreen(){const e=this;return new Promise((t,i)=>{function r(){e.off("fullscreenerror",a),e.off("fullscreenchange",n)}function n(){r(),t()}function a(l,u){r(),i(u)}e.one("fullscreenchange",n),e.one("fullscreenerror",a);const o=e.exitFullscreenHelper_();o&&(o.then(r,r),o.then(t,i))})}exitFullscreenHelper_(){if(this.fsApi_.requestFullscreen){const e=ce[this.fsApi_.exitFullscreen]();return e&&Gr(e.then(()=>this.isFullscreen(!1))),e}else this.tech_.supportsFullScreen()&&!this.options_.preferFullWindow?this.techCall_("exitFullScreen"):this.exitFullWindow()}enterFullWindow(){this.isFullscreen(!0),this.isFullWindow=!0,this.docOrigOverflow=ce.documentElement.style.overflow,sr(ce,"keydown",this.boundFullWindowOnEscKey_),ce.documentElement.style.overflow="hidden",Qs(ce.body,"vjs-full-window"),this.trigger("enterFullWindow")}fullWindowOnEscKey(e){e.key==="Escape"&&this.isFullscreen()===!0&&(this.isFullWindow?this.exitFullWindow():this.exitFullscreen())}exitFullWindow(){this.isFullscreen(!1),this.isFullWindow=!1,yi(ce,"keydown",this.boundFullWindowOnEscKey_),ce.documentElement.style.overflow=this.docOrigOverflow,Wh(ce.body,"vjs-full-window"),this.trigger("exitFullWindow")}disablePictureInPicture(e){if(e===void 0)return this.techGet_("disablePictureInPicture");this.techCall_("setDisablePictureInPicture",e),this.options_.disablePictureInPicture=e,this.trigger("disablepictureinpicturechanged")}isInPictureInPicture(e){if(e!==void 0){this.isInPictureInPicture_=!!e,this.togglePictureInPictureClass_();return}return!!this.isInPictureInPicture_}requestPictureInPicture(){if(this.options_.enableDocumentPictureInPicture&&O.documentPictureInPicture){const e=ce.createElement(this.el().tagName);return e.classList=this.el().classList,e.classList.add("vjs-pip-container"),this.posterImage&&e.appendChild(this.posterImage.el().cloneNode(!0)),this.titleBar&&e.appendChild(this.titleBar.el().cloneNode(!0)),e.appendChild(He("p",{className:"vjs-pip-text"},{},this.localize("Playing in picture-in-picture"))),O.documentPictureInPicture.requestWindow({width:this.videoWidth(),height:this.videoHeight()}).then(t=>(uE(t),this.el_.parentNode.insertBefore(e,this.el_),t.document.body.appendChild(this.el_),t.document.body.classList.add("vjs-pip-window"),this.player_.isInPictureInPicture(!0),this.player_.trigger({type:"enterpictureinpicture",pipWindow:t}),t.addEventListener("pagehide",i=>{const r=i.target.querySelector(".video-js");e.parentNode.replaceChild(r,e),this.player_.isInPictureInPicture(!1),this.player_.trigger("leavepictureinpicture")}),t))}return"pictureInPictureEnabled"in ce&&this.disablePictureInPicture()===!1?this.techGet_("requestPictureInPicture"):Promise.reject("No PiP mode is available")}exitPictureInPicture(){if(O.documentPictureInPicture&&O.documentPictureInPicture.window)return O.documentPictureInPicture.window.close(),Promise.resolve();if("pictureInPictureEnabled"in ce)return ce.exitPictureInPicture()}handleKeyDown(e){const{userActions:t}=this.options_;!t||!t.hotkeys||(r=>{const n=r.tagName.toLowerCase();if(r.isContentEditable)return!0;const a=["button","checkbox","hidden","radio","reset","submit"];return n==="input"?a.indexOf(r.type)===-1:["textarea"].indexOf(n)!==-1})(this.el_.ownerDocument.activeElement)||(typeof t.hotkeys=="function"?t.hotkeys.call(this,e):this.handleHotkeys(e))}handleHotkeys(e){const t=this.options_.userActions?this.options_.userActions.hotkeys:{},{fullscreenKey:i=a=>e.key.toLowerCase()==="f",muteKey:r=a=>e.key.toLowerCase()==="m",playPauseKey:n=a=>e.key.toLowerCase()==="k"||e.key.toLowerCase()===" "}=t;if(i.call(this,e)){e.preventDefault(),e.stopPropagation();const a=_e.getComponent("FullscreenToggle");ce[this.fsApi_.fullscreenEnabled]!==!1&&a.prototype.handleClick.call(this,e)}else r.call(this,e)?(e.preventDefault(),e.stopPropagation(),_e.getComponent("MuteToggle").prototype.handleClick.call(this,e)):n.call(this,e)&&(e.preventDefault(),e.stopPropagation(),_e.getComponent("PlayToggle").prototype.handleClick.call(this,e))}canPlayType(e){let t;for(let i=0,r=this.options_.techOrder;i<r.length;i++){const n=r[i];let a=vt.getTech(n);if(a||(a=_e.getComponent(n)),!a){et.error(`The "${n}" tech is undefined. Skipped browser support check for that tech.`);continue}if(a.isSupported()&&(t=a.canPlayType(e),t))return t}return""}selectSource(e){const t=this.options_.techOrder.map(o=>[o,vt.getTech(o)]).filter(([o,l])=>l?l.isSupported():(et.error(`The "${o}" tech is undefined. Skipped browser support check for that tech.`),!1)),i=function(o,l,u){let c;return o.some(h=>l.some(d=>{if(c=u(h,d),c)return!0})),c};let r;const n=o=>(l,u)=>o(u,l),a=([o,l],u)=>{if(l.canPlaySource(u,this.options_[o.toLowerCase()]))return{source:u,tech:o}};return this.options_.sourceOrder?r=i(e,t,n(a)):r=i(t,e,a),r||!1}handleSrc_(e,t){if(typeof e>"u")return this.cache_.src||"";this.resetRetryOnError_&&this.resetRetryOnError_();const i=AE(e);if(!i.length){this.setTimeout(function(){this.error({code:4,message:this.options_.notSupportedMessage})},0);return}if(this.changingSrc_=!0,t||(this.cache_.sources=i),this.updateSourceCaches_(i[0]),HL(this,i[0],(r,n)=>{if(this.middleware_=n,t||(this.cache_.sources=i),this.updateSourceCaches_(r),this.src_(r)){if(i.length>1)return this.handleSrc_(i.slice(1));this.changingSrc_=!1,this.setTimeout(function(){this.error({code:4,message:this.options_.notSupportedMessage})},0),this.triggerReady();return}zL(n,this.tech_)}),i.length>1){const r=()=>{this.error(null),this.handleSrc_(i.slice(1),!0)},n=()=>{this.off("error",r)};this.one("error",r),this.one("playing",n),this.resetRetryOnError_=()=>{this.off("error",r),this.off("playing",n)}}}src(e){return this.handleSrc_(e,!1)}src_(e){const t=this.selectSource([e]);return t?yE(t.tech,this.techName_)?(this.ready(function(){this.tech_.constructor.prototype.hasOwnProperty("setSource")?this.techCall_("setSource",e):this.techCall_("src",e.src),this.changingSrc_=!1},!0),!1):(this.changingSrc_=!0,this.loadTech_(t.tech,t.source),this.tech_.ready(()=>{this.changingSrc_=!1}),!1):!0}addSourceElement(e,t){return this.tech_?this.tech_.addSourceElement(e,t):!1}removeSourceElement(e){return this.tech_?this.tech_.removeSourceElement(e):!1}load(){if(this.tech_&&this.tech_.vhs){this.src(this.currentSource());return}this.techCall_("load")}reset(){if(this.paused())this.doReset_();else{const e=this.play();Gr(e.then(()=>this.doReset_()))}}doReset_(){this.tech_&&this.tech_.clearTracks("text"),this.removeClass("vjs-playing"),this.addClass("vjs-paused"),this.resetCache_(),this.poster(""),this.loadTech_(this.options_.techOrder[0],null),this.techCall_("reset"),this.resetControlBarUI_(),this.error(null),this.titleBar&&this.titleBar.update({title:void 0,description:void 0}),In(this)&&this.trigger("playerreset")}resetControlBarUI_(){this.resetProgressBar_(),this.resetPlaybackRate_(),this.resetVolumeBar_()}resetProgressBar_(){this.currentTime(0);const{currentTimeDisplay:e,durationDisplay:t,progressControl:i,remainingTimeDisplay:r}=this.controlBar||{},{seekBar:n}=i||{};e&&e.updateContent(),t&&t.updateContent(),r&&r.updateContent(),n&&(n.update(),n.loadProgressBar&&n.loadProgressBar.update())}resetPlaybackRate_(){this.playbackRate(this.defaultPlaybackRate()),this.handleTechRateChange_()}resetVolumeBar_(){this.volume(1),this.trigger("volumechange")}currentSources(){const e=this.currentSource(),t=[];return Object.keys(e).length!==0&&t.push(e),this.cache_.sources||t}currentSource(){return this.cache_.source||{}}currentSrc(){return this.currentSource()&&this.currentSource().src||""}currentType(){return this.currentSource()&&this.currentSource().type||""}preload(e){if(e!==void 0){this.techCall_("setPreload",e),this.options_.preload=e;return}return this.techGet_("preload")}autoplay(e){if(e===void 0)return this.options_.autoplay||!1;let t;typeof e=="string"&&/(any|play|muted)/.test(e)||e===!0&&this.options_.normalizeAutoplay?(this.options_.autoplay=e,this.manualAutoplay_(typeof e=="string"?e:"play"),t=!1):e?this.options_.autoplay=!0:this.options_.autoplay=!1,t=typeof t>"u"?this.options_.autoplay:t,this.tech_&&this.techCall_("setAutoplay",t)}playsinline(e){return e!==void 0&&(this.techCall_("setPlaysinline",e),this.options_.playsinline=e),this.techGet_("playsinline")}loop(e){if(e!==void 0){this.techCall_("setLoop",e),this.options_.loop=e;return}return this.techGet_("loop")}poster(e){if(e===void 0)return this.poster_;e||(e=""),e!==this.poster_&&(this.poster_=e,this.techCall_("setPoster",e),this.isPosterFromTech_=!1,this.trigger("posterchange"))}handleTechPosterChange_(){if((!this.poster_||this.options_.techCanOverridePoster)&&this.tech_&&this.tech_.poster){const e=this.tech_.poster()||"";e!==this.poster_&&(this.poster_=e,this.isPosterFromTech_=!0,this.trigger("posterchange"))}}controls(e){if(e===void 0)return!!this.controls_;e=!!e,this.controls_!==e&&(this.controls_=e,this.usingNativeControls()&&this.techCall_("setControls",e),this.controls_?(this.removeClass("vjs-controls-disabled"),this.addClass("vjs-controls-enabled"),this.trigger("controlsenabled"),this.usingNativeControls()||this.addTechControlsListeners_()):(this.removeClass("vjs-controls-enabled"),this.addClass("vjs-controls-disabled"),this.trigger("controlsdisabled"),this.usingNativeControls()||this.removeTechControlsListeners_()))}usingNativeControls(e){if(e===void 0)return!!this.usingNativeControls_;e=!!e,this.usingNativeControls_!==e&&(this.usingNativeControls_=e,this.usingNativeControls_?(this.addClass("vjs-using-native-controls"),this.trigger("usingnativecontrols")):(this.removeClass("vjs-using-native-controls"),this.trigger("usingcustomcontrols")))}error(e){if(e===void 0)return this.error_||null;if(os("beforeerror").forEach(t=>{const i=t(this,e);if(!(en(i)&&!Array.isArray(i)||typeof i=="string"||typeof i=="number"||i===null)){this.log.error("please return a value that MediaError expects in beforeerror hooks");return}e=i}),this.options_.suppressNotSupportedError&&e&&e.code===4){const t=function(){this.error(e)};this.options_.suppressNotSupportedError=!1,this.any(["click","touchstart"],t),this.one("loadstart",function(){this.off(["click","touchstart"],t)});return}if(e===null){this.error_=null,this.removeClass("vjs-error"),this.errorDisplay&&this.errorDisplay.close();return}this.error_=new Rt(e),this.addClass("vjs-error"),et.error(`(CODE:${this.error_.code} ${Rt.errorTypes[this.error_.code]})`,this.error_.message,this.error_),this.trigger("error"),os("error").forEach(t=>t(this,this.error_))}reportUserActivity(e){this.userActivity_=!0}userActive(e){if(e===void 0)return this.userActive_;if(e=!!e,e!==this.userActive_){if(this.userActive_=e,this.userActive_){this.userActivity_=!0,this.removeClass("vjs-user-inactive"),this.addClass("vjs-user-active"),this.trigger("useractive");return}this.tech_&&this.tech_.one("mousemove",function(t){t.stopPropagation(),t.preventDefault()}),this.userActivity_=!1,this.removeClass("vjs-user-active"),this.addClass("vjs-user-inactive"),this.trigger("userinactive")}}listenForUserActivity_(){let e,t,i;const r=St(this,this.reportUserActivity),n=function(h){(h.screenX!==t||h.screenY!==i)&&(t=h.screenX,i=h.screenY,r())},a=function(){r(),this.clearInterval(e),e=this.setInterval(r,250)},o=function(h){r(),this.clearInterval(e)};this.on("mousedown",a),this.on("mousemove",n),this.on("mouseup",o),this.on("mouseleave",o);const l=this.getChild("controlBar");l&&!Li&&!tn&&(l.on("mouseenter",function(h){this.player().options_.inactivityTimeout!==0&&(this.player().cache_.inactivityTimeout=this.player().options_.inactivityTimeout),this.player().options_.inactivityTimeout=0}),l.on("mouseleave",function(h){this.player().options_.inactivityTimeout=this.player().cache_.inactivityTimeout})),this.on("keydown",r),this.on("keyup",r);let u;const c=function(){if(!this.userActivity_)return;this.userActivity_=!1,this.userActive(!0),this.clearTimeout(u);const h=this.options_.inactivityTimeout;h<=0||(u=this.setTimeout(function(){this.userActivity_||this.userActive(!1)},h))};this.setInterval(c,250)}playbackRate(e){if(e!==void 0){this.techCall_("setPlaybackRate",e);return}return this.tech_&&this.tech_.featuresPlaybackRate?this.cache_.lastPlaybackRate||this.techGet_("playbackRate"):1}defaultPlaybackRate(e){return e!==void 0?this.techCall_("setDefaultPlaybackRate",e):this.tech_&&this.tech_.featuresPlaybackRate?this.techGet_("defaultPlaybackRate"):1}isAudio(e){if(e!==void 0){this.isAudio_=!!e;return}return!!this.isAudio_}updatePlayerHeightOnAudioOnlyMode_(){const e=this.getChild("ControlBar");!e||this.audioOnlyCache_.controlBarHeight===e.currentHeight()||(this.audioOnlyCache_.controlBarHeight=e.currentHeight(),this.height(this.audioOnlyCache_.controlBarHeight))}enableAudioOnlyUI_(){this.addClass("vjs-audio-only-mode");const e=this.children(),t=this.getChild("ControlBar"),i=t&&t.currentHeight();e.forEach(r=>{r!==t&&r.el_&&!r.hasClass("vjs-hidden")&&(r.hide(),this.audioOnlyCache_.hiddenChildren.push(r))}),this.audioOnlyCache_.playerHeight=this.currentHeight(),this.audioOnlyCache_.controlBarHeight=i,this.on("playerresize",this.boundUpdatePlayerHeightOnAudioOnlyMode_),this.height(i),this.trigger("audioonlymodechange")}disableAudioOnlyUI_(){this.removeClass("vjs-audio-only-mode"),this.off("playerresize",this.boundUpdatePlayerHeightOnAudioOnlyMode_),this.audioOnlyCache_.hiddenChildren.forEach(e=>e.show()),this.height(this.audioOnlyCache_.playerHeight),this.trigger("audioonlymodechange")}audioOnlyMode(e){if(typeof e!="boolean"||e===this.audioOnlyMode_)return this.audioOnlyMode_;if(this.audioOnlyMode_=e,e){const t=[];return this.isInPictureInPicture()&&t.push(this.exitPictureInPicture()),this.isFullscreen()&&t.push(this.exitFullscreen()),this.audioPosterMode()&&t.push(this.audioPosterMode(!1)),Promise.all(t).then(()=>this.enableAudioOnlyUI_())}return Promise.resolve().then(()=>this.disableAudioOnlyUI_())}enablePosterModeUI_(){(this.tech_&&this.tech_).hide(),this.addClass("vjs-audio-poster-mode"),this.trigger("audiopostermodechange")}disablePosterModeUI_(){(this.tech_&&this.tech_).show(),this.removeClass("vjs-audio-poster-mode"),this.trigger("audiopostermodechange")}audioPosterMode(e){return typeof e!="boolean"||e===this.audioPosterMode_?this.audioPosterMode_:(this.audioPosterMode_=e,e?this.audioOnlyMode()?this.audioOnlyMode(!1).then(()=>{this.enablePosterModeUI_()}):Promise.resolve().then(()=>{this.enablePosterModeUI_()}):Promise.resolve().then(()=>{this.disablePosterModeUI_()}))}addTextTrack(e,t,i){if(this.tech_)return this.tech_.addTextTrack(e,t,i)}addRemoteTextTrack(e,t){if(this.tech_)return this.tech_.addRemoteTextTrack(e,t)}removeRemoteTextTrack(e={}){let{track:t}=e;if(t||(t=e),this.tech_)return this.tech_.removeRemoteTextTrack(t)}getVideoPlaybackQuality(){return this.techGet_("getVideoPlaybackQuality")}videoWidth(){return this.tech_&&this.tech_.videoWidth&&this.tech_.videoWidth()||0}videoHeight(){return this.tech_&&this.tech_.videoHeight&&this.tech_.videoHeight()||0}language(e){if(e===void 0)return this.language_;this.language_!==String(e).toLowerCase()&&(this.language_=String(e).toLowerCase(),In(this)&&this.trigger("languagechange"))}languages(){return gt(Ha.prototype.options_.languages,this.languages_)}toJSON(){const e=gt(this.options_),t=e.tracks;e.tracks=[];for(let i=0;i<t.length;i++){let r=t[i];r=gt(r),r.player=void 0,e.tracks[i]=r}return e}createModal(e,t){t=t||{},t.content=e||"";const i=new Ro(this,t);return this.addChild(i),i.on("dispose",()=>{this.removeChild(i)}),i.open(),i}updateCurrentBreakpoint_(){if(!this.responsive())return;const e=this.currentBreakpoint(),t=this.currentWidth();for(let i=0;i<Ug.length;i++){const r=Ug[i],n=this.breakpoints_[r];if(t<=n){if(e===r)return;e&&this.removeClass(Pc[e]),this.addClass(Pc[r]),this.breakpoint_=r;break}}}removeCurrentBreakpoint_(){const e=this.currentBreakpointClass();this.breakpoint_="",e&&this.removeClass(e)}breakpoints(e){return e===void 0?Object.assign(this.breakpoints_):(this.breakpoint_="",this.breakpoints_=Object.assign({},NO,e),this.updateCurrentBreakpoint_(),Object.assign(this.breakpoints_))}responsive(e){if(e===void 0)return this.responsive_;e=!!e;const t=this.responsive_;if(e!==t)return this.responsive_=e,e?(this.on("playerresize",this.boundUpdateCurrentBreakpoint_),this.updateCurrentBreakpoint_()):(this.off("playerresize",this.boundUpdateCurrentBreakpoint_),this.removeCurrentBreakpoint_()),e}currentBreakpoint(){return this.breakpoint_}currentBreakpointClass(){return Pc[this.breakpoint_]||""}loadMedia(e,t){if(!e||typeof e!="object")return;const i=this.crossOrigin();this.reset(),this.cache_.media=gt(e);const{artist:r,artwork:n,description:a,poster:o,src:l,textTracks:u,title:c}=this.cache_.media;!n&&o&&(this.cache_.media.artwork=[{src:o,type:Yc(o)}]),i&&this.crossOrigin(i),l&&this.src(l),o&&this.poster(o),Array.isArray(u)&&u.forEach(h=>this.addRemoteTextTrack(h,!1)),this.titleBar&&this.titleBar.update({title:c,description:a||r||""}),this.ready(t)}getMedia(){if(!this.cache_.media){const e=this.poster(),t=this.currentSources(),i=Array.prototype.map.call(this.remoteTextTracks(),n=>({kind:n.kind,label:n.label,language:n.language,src:n.src})),r={src:t,textTracks:i};return e&&(r.poster=e,r.artwork=[{src:r.poster,type:Yc(r.poster)}]),r}return gt(this.cache_.media)}static getTagSettings(e){const t={sources:[],tracks:[]},i=ns(e),r=i["data-setup"];if(Rl(e,"vjs-fill")&&(i.fill=!0),Rl(e,"vjs-fluid")&&(i.fluid=!0),r!==null)try{Object.assign(i,JSON.parse(r||"{}"))}catch(n){et.error("data-setup",n)}if(Object.assign(t,i),e.hasChildNodes()){const n=e.childNodes;for(let a=0,o=n.length;a<o;a++){const l=n[a],u=l.nodeName.toLowerCase();u==="source"?t.sources.push(ns(l)):u==="track"&&t.tracks.push(ns(l))}}return t}debug(e){if(e===void 0)return this.debugEnabled_;e?(this.trigger("debugon"),this.previousLogLevel_=this.log.level,this.log.level("debug"),this.debugEnabled_=!0):(this.trigger("debugoff"),this.log.level(this.previousLogLevel_),this.previousLogLevel_=void 0,this.debugEnabled_=!1)}playbackRates(e){if(e===void 0)return this.cache_.playbackRates;Array.isArray(e)&&e.every(t=>typeof t=="number")&&(this.cache_.playbackRates=e,this.trigger("playbackrateschange"))}};wi.names.forEach(function(s){const e=wi[s];Xt.prototype[e.getterName]=function(){return this.tech_?this.tech_[e.getterName]():(this[e.privateName]=this[e.privateName]||new e.ListClass,this[e.privateName])}});Xt.prototype.crossorigin=Xt.prototype.crossOrigin;Xt.players={};const vl=O.navigator;Xt.prototype.options_={techOrder:vt.defaultTechOrder_,html5:{},enableSourceset:!0,inactivityTimeout:2e3,playbackRates:[],liveui:!1,children:["mediaLoader","posterImage","titleBar","textTrackDisplay","loadingSpinner","bigPlayButton","liveTracker","controlBar","errorDisplay","textTrackSettings","resizeManager"],language:vl&&(vl.languages&&vl.languages[0]||vl.userLanguage||vl.language)||"en",languages:{},notSupportedMessage:"No compatible source was found for this media.",normalizeAutoplay:!1,fullscreen:{options:{navigationUI:"hide"}},breakpoints:{},responsive:!1,audioOnlyMode:!1,audioPosterMode:!1,spatialNavigation:{enabled:!1,horizontalSeek:!1},enableSmoothSeeking:!1};n2.forEach(function(s){Xt.prototype[`handleTech${qt(s)}_`]=function(){return this.trigger(s)}});_e.registerComponent("Player",Xt);const Jc="plugin",io="activePlugins_",Wa={},Zc=s=>Wa.hasOwnProperty(s),Dc=s=>Zc(s)?Wa[s]:void 0,s2=(s,e)=>{s[io]=s[io]||{},s[io][e]=!0},eh=(s,e,t)=>{const i=(t?"before":"")+"pluginsetup";s.trigger(i,e),s.trigger(i+":"+e.name,e)},LO=function(s,e){const t=function(){eh(this,{name:s,plugin:e,instance:null},!0);const i=e.apply(this,arguments);return s2(this,s),eh(this,{name:s,plugin:e,instance:i}),i};return Object.keys(e).forEach(function(i){t[i]=e[i]}),t},Q_=(s,e)=>(e.prototype.name=s,function(...t){eh(this,{name:s,plugin:e,instance:null},!0);const i=new e(this,...t);return this[s]=()=>i,eh(this,i.getEventHash()),i});let sn=class Nc{constructor(e){if(this.constructor===Nc)throw new Error("Plugin must be sub-classed; not directly instantiated.");this.player=e,this.log||(this.log=this.player.log.createLogger(this.name)),Gv(this),delete this.trigger,vE(this,this.constructor.defaultState),s2(e,this.name),this.dispose=this.dispose.bind(this),e.on("dispose",this.dispose)}version(){return this.constructor.VERSION}getEventHash(e={}){return e.name=this.name,e.plugin=this.constructor,e.instance=this,e}trigger(e,t={}){return Mo(this.eventBusEl_,e,this.getEventHash(t))}handleStateChanged(e){}dispose(){const{name:e,player:t}=this;this.trigger("dispose"),this.off(),t.off("dispose",this.dispose),t[io][e]=!1,this.player=this.state=null,t[e]=Q_(e,Wa[e])}static isBasic(e){const t=typeof e=="string"?Dc(e):e;return typeof t=="function"&&!Nc.prototype.isPrototypeOf(t.prototype)}static registerPlugin(e,t){if(typeof e!="string")throw new Error(`Illegal plugin name, "${e}", must be a string, was ${typeof e}.`);if(Zc(e))et.warn(`A plugin named "${e}" already exists. You may want to avoid re-registering plugins!`);else if(Xt.prototype.hasOwnProperty(e))throw new Error(`Illegal plugin name, "${e}", cannot share a name with an existing player method!`);if(typeof t!="function")throw new Error(`Illegal plugin for "${e}", must be a function, was ${typeof t}.`);return Wa[e]=t,e!==Jc&&(Nc.isBasic(t)?Xt.prototype[e]=LO(e,t):Xt.prototype[e]=Q_(e,t)),t}static deregisterPlugin(e){if(e===Jc)throw new Error("Cannot de-register base plugin.");Zc(e)&&(delete Wa[e],delete Xt.prototype[e])}static getPlugins(e=Object.keys(Wa)){let t;return e.forEach(i=>{const r=Dc(i);r&&(t=t||{},t[i]=r)}),t}static getPluginVersion(e){const t=Dc(e);return t&&t.VERSION||""}};sn.getPlugin=Dc;sn.BASE_PLUGIN_NAME=Jc;sn.registerPlugin(Jc,sn);Xt.prototype.usingPlugin=function(s){return!!this[io]&&this[io][s]===!0};Xt.prototype.hasPlugin=function(s){return!!Zc(s)};function OO(s,e){let t=!1;return function(...i){return t||et.warn(s),t=!0,e.apply(this,i)}}function Or(s,e,t,i){return OO(`${e} is deprecated and will be removed in ${s}.0; please use ${t} instead.`,i)}var MO={NetworkBadStatus:"networkbadstatus",NetworkRequestFailed:"networkrequestfailed",NetworkRequestAborted:"networkrequestaborted",NetworkRequestTimeout:"networkrequesttimeout",NetworkBodyParserFailed:"networkbodyparserfailed",StreamingHlsPlaylistParserError:"streaminghlsplaylistparsererror",StreamingDashManifestParserError:"streamingdashmanifestparsererror",StreamingContentSteeringParserError:"streamingcontentsteeringparsererror",StreamingVttParserError:"streamingvttparsererror",StreamingFailedToSelectNextSegment:"streamingfailedtoselectnextsegment",StreamingFailedToDecryptSegment:"streamingfailedtodecryptsegment",StreamingFailedToTransmuxSegment:"streamingfailedtotransmuxsegment",StreamingFailedToAppendSegment:"streamingfailedtoappendsegment",StreamingCodecsChangeError:"streamingcodecschangeerror"};const a2=s=>s.indexOf("#")===0?s.slice(1):s;function U(s,e,t){let i=U.getPlayer(s);if(i)return e&&et.warn(`Player "${s}" is already initialised. Options will not be applied.`),t&&i.ready(t),i;const r=typeof s=="string"?ls("#"+a2(s)):s;if(!Oo(r))throw new TypeError("The element or ID supplied is not valid. (videojs)");const a=("getRootNode"in r?r.getRootNode()instanceof O.ShadowRoot:!1)?r.getRootNode():r.ownerDocument.body;(!r.ownerDocument.defaultView||!a.contains(r))&&et.warn("The element supplied is not included in the DOM"),e=e||{},e.restoreEl===!0&&(e.restoreEl=(r.parentNode&&r.parentNode.hasAttribute&&r.parentNode.hasAttribute("data-vjs-player")?r.parentNode:r).cloneNode(!0)),os("beforesetup").forEach(l=>{const u=l(r,gt(e));if(!en(u)||Array.isArray(u)){et.error("please return an object in beforesetup hooks");return}e=gt(e,u)});const o=_e.getComponent("Player");return i=new o(r,e,t),os("setup").forEach(l=>l(i)),i}U.hooks_=Cn;U.hooks=os;U.hook=fL;U.hookOnce=pL;U.removeHook=q1;if(O.VIDEOJS_NO_DYNAMIC_STYLE!==!0&&Lo()){let s=ls(".vjs-styles-defaults");if(!s){s=dE("vjs-styles-defaults");const e=ls("head");e&&e.insertBefore(s,e.firstChild),fE(s,`
188
- .video-js {
189
- width: 300px;
190
- height: 150px;
191
- }
192
-
193
- .vjs-fluid:not(.vjs-audio-only-mode) {
194
- padding-top: 56.25%
195
- }
196
- `)}}Ng(1,U);U.VERSION=Ag;U.options=Xt.prototype.options_;U.getPlayers=()=>Xt.players;U.getPlayer=s=>{const e=Xt.players;let t;if(typeof s=="string"){const i=a2(s),r=e[i];if(r)return r;t=ls("#"+i)}else t=s;if(Oo(t)){const{player:i,playerId:r}=t;if(i||e[r])return i||e[r]}};U.getAllPlayers=()=>Object.keys(Xt.players).map(s=>Xt.players[s]).filter(Boolean);U.players=Xt.players;U.getComponent=_e.getComponent;U.registerComponent=(s,e)=>(vt.isTech(e)&&et.warn(`The ${s} tech was registered as a component. It should instead be registered using videojs.registerTech(name, tech)`),_e.registerComponent.call(_e,s,e));U.getTech=vt.getTech;U.registerTech=vt.registerTech;U.use=VL;Object.defineProperty(U,"middleware",{value:{},writeable:!1,enumerable:!0});Object.defineProperty(U.middleware,"TERMINATOR",{value:Qc,writeable:!1,enumerable:!0});U.browser=Y1;U.obj=vL;U.mergeOptions=Or(9,"videojs.mergeOptions","videojs.obj.merge",gt);U.defineLazyProperty=Or(9,"videojs.defineLazyProperty","videojs.obj.defineLazyProperty",jh);U.bind=Or(9,"videojs.bind","native Function.prototype.bind",St);U.registerPlugin=sn.registerPlugin;U.deregisterPlugin=sn.deregisterPlugin;U.plugin=(s,e)=>(et.warn("videojs.plugin() is deprecated; use videojs.registerPlugin() instead"),sn.registerPlugin(s,e));U.getPlugins=sn.getPlugins;U.getPlugin=sn.getPlugin;U.getPluginVersion=sn.getPluginVersion;U.addLanguage=function(s,e){return s=(""+s).toLowerCase(),U.options.languages=gt(U.options.languages,{[s]:e}),U.options.languages[s]};U.log=et;U.createLogger=V1;U.time=NL;U.createTimeRange=Or(9,"videojs.createTimeRange","videojs.time.createTimeRanges",Dr);U.createTimeRanges=Or(9,"videojs.createTimeRanges","videojs.time.createTimeRanges",Dr);U.formatTime=Or(9,"videojs.formatTime","videojs.time.formatTime",oa);U.setFormatTime=Or(9,"videojs.setFormatTime","videojs.time.setFormatTime",TE);U.resetFormatTime=Or(9,"videojs.resetFormatTime","videojs.time.resetFormatTime",bE);U.parseUrl=Or(9,"videojs.parseUrl","videojs.url.parseUrl",Qv);U.isCrossOrigin=Or(9,"videojs.isCrossOrigin","videojs.url.isCrossOrigin",Zh);U.EventTarget=ar;U.any=Wv;U.on=sr;U.one=Yh;U.off=yi;U.trigger=Mo;U.xhr=w1;U.TextTrack=ou;U.AudioTrack=wE;U.VideoTrack=kE;["isEl","isTextNode","createEl","hasClass","addClass","removeClass","toggleClass","setAttributes","getAttributes","emptyEl","appendContent","insertContent"].forEach(s=>{U[s]=function(){return et.warn(`videojs.${s}() is deprecated; use videojs.dom.${s}() instead`),cE[s].apply(null,arguments)}});U.computedStyle=Or(9,"videojs.computedStyle","videojs.dom.computedStyle",To);U.dom=cE;U.fn=wL;U.num=cO;U.str=PL;U.url=jL;U.Error=MO;/*! @name videojs-contrib-quality-levels @version 4.1.0 @license Apache-2.0 */let RO=class{constructor(e){let t=this;return t.id=e.id,t.label=t.id,t.width=e.width,t.height=e.height,t.bitrate=e.bandwidth,t.frameRate=e.frameRate,t.enabled_=e.enabled,Object.defineProperty(t,"enabled",{get(){return t.enabled_()},set(i){t.enabled_(i)}}),t}},th=class extends U.EventTarget{constructor(){super();let e=this;return e.levels_=[],e.selectedIndex_=-1,Object.defineProperty(e,"selectedIndex",{get(){return e.selectedIndex_}}),Object.defineProperty(e,"length",{get(){return e.levels_.length}}),e[Symbol.iterator]=()=>e.levels_.values(),e}addQualityLevel(e){let t=this.getQualityLevelById(e.id);if(t)return t;const i=this.levels_.length;return t=new RO(e),""+i in this||Object.defineProperty(this,i,{get(){return this.levels_[i]}}),this.levels_.push(t),this.trigger({qualityLevel:t,type:"addqualitylevel"}),t}removeQualityLevel(e){let t=null;for(let i=0,r=this.length;i<r;i++)if(this[i]===e){t=this.levels_.splice(i,1)[0],this.selectedIndex_===i?this.selectedIndex_=-1:this.selectedIndex_>i&&this.selectedIndex_--;break}return t&&this.trigger({qualityLevel:e,type:"removequalitylevel"}),t}getQualityLevelById(e){for(let t=0,i=this.length;t<i;t++){const r=this[t];if(r.id===e)return r}return null}dispose(){this.selectedIndex_=-1,this.levels_.length=0}};th.prototype.allowedEvents_={change:"change",addqualitylevel:"addqualitylevel",removequalitylevel:"removequalitylevel"};for(const s in th.prototype.allowedEvents_)th.prototype["on"+s]=null;var o2="4.1.0";const FO=function(s,e){const t=s.qualityLevels,i=new th,r=function(){i.dispose(),s.qualityLevels=t,s.off("dispose",r)};return s.on("dispose",r),s.qualityLevels=()=>i,s.qualityLevels.VERSION=o2,i},l2=function(s){return FO(this,U.obj.merge({},s))};U.registerPlugin("qualityLevels",l2);l2.VERSION=o2;/*! @name @videojs/http-streaming @version 3.16.0 @license Apache-2.0 */const ji=Fh,ih=(s,e)=>e&&e.responseURL&&s!==e.responseURL?e.responseURL:s,Tr=s=>U.log.debug?U.log.debug.bind(U,"VHS:",`${s} >`):function(){};function lt(...s){const e=U.obj||U;return(e.merge||e.mergeOptions).apply(e,s)}function ni(...s){const e=U.time||U;return(e.createTimeRanges||e.createTimeRanges).apply(e,s)}function BO(s){if(s.length===0)return"Buffered Ranges are empty";let e=`Buffered Ranges:
197
- `;for(let t=0;t<s.length;t++){const i=s.start(t),r=s.end(t);e+=`${i} --> ${r}. Duration (${r-i})
198
- `}return e}const Kr=1/30,Xr=Kr*3,u2=function(s,e){const t=[];let i;if(s&&s.length)for(i=0;i<s.length;i++)e(s.start(i),s.end(i))&&t.push([s.start(i),s.end(i)]);return ni(t)},Ga=function(s,e){return u2(s,function(t,i){return t-Xr<=e&&i+Xr>=e})},sc=function(s,e){return u2(s,function(t){return t-Kr>=e})},UO=function(s){if(s.length<2)return ni();const e=[];for(let t=1;t<s.length;t++){const i=s.end(t-1),r=s.start(t);e.push([i,r])}return ni(e)},$O=function(s,e){let t=null,i=null,r=0;const n=[],a=[];if(!s||!s.length||!e||!e.length)return ni();let o=s.length;for(;o--;)n.push({time:s.start(o),type:"start"}),n.push({time:s.end(o),type:"end"});for(o=e.length;o--;)n.push({time:e.start(o),type:"start"}),n.push({time:e.end(o),type:"end"});for(n.sort(function(l,u){return l.time-u.time}),o=0;o<n.length;o++)n[o].type==="start"?(r++,r===2&&(t=n[o].time)):n[o].type==="end"&&(r--,r===1&&(i=n[o].time)),t!==null&&i!==null&&(a.push([t,i]),t=null,i=null);return ni(a)},c2=s=>{const e=[];if(!s||!s.length)return"";for(let t=0;t<s.length;t++)e.push(s.start(t)+" => "+s.end(t));return e.join(", ")},jO=function(s,e,t=1){return((s.length?s.end(s.length-1):0)-e)/t},Vs=s=>{const e=[];for(let t=0;t<s.length;t++)e.push({start:s.start(t),end:s.end(t)});return e},qO=function(s,e){if(s===e)return!1;if(!s&&e||!e&&s||s.length!==e.length)return!0;for(let t=0;t<s.length;t++)if(s.start(t)!==e.start(t)||s.end(t)!==e.end(t))return!0;return!1},Uf=function(s){if(!(!s||!s.length||!s.end))return s.end(s.length-1)},p0=function(s,e){let t=0;if(!s||!s.length)return t;for(let i=0;i<s.length;i++){const r=s.start(i),n=s.end(i);if(!(e>n)){if(e>r&&e<=n){t+=n-e;continue}t+=n-r}}return t},m0=(s,e)=>{if(!e.preload)return e.duration;let t=0;return(e.parts||[]).forEach(function(i){t+=i.duration}),(e.preloadHints||[]).forEach(function(i){i.type==="PART"&&(t+=s.partTargetDuration)}),t},$g=s=>(s.segments||[]).reduce((e,t,i)=>(t.parts?t.parts.forEach(function(r,n){e.push({duration:r.duration,segmentIndex:i,partIndex:n,part:r,segment:t})}):e.push({duration:t.duration,segmentIndex:i,partIndex:null,segment:t,part:null}),e),[]),h2=s=>{const e=s.segments&&s.segments.length&&s.segments[s.segments.length-1];return e&&e.parts||[]},d2=({preloadSegment:s})=>{if(!s)return;const{parts:e,preloadHints:t}=s;let i=(t||[]).reduce((r,n)=>r+(n.type==="PART"?1:0),0);return i+=e&&e.length?e.length:0,i},f2=(s,e)=>{if(e.endList)return 0;if(s&&s.suggestedPresentationDelay)return s.suggestedPresentationDelay;const t=h2(e).length>0;return t&&e.serverControl&&e.serverControl.partHoldBack?e.serverControl.partHoldBack:t&&e.partTargetDuration?e.partTargetDuration*3:e.serverControl&&e.serverControl.holdBack?e.serverControl.holdBack:e.targetDuration?e.targetDuration*3:0},VO=function(s,e){let t=0,i=e-s.mediaSequence,r=s.segments[i];if(r){if(typeof r.start<"u")return{result:r.start,precise:!0};if(typeof r.end<"u")return{result:r.end-r.duration,precise:!0}}for(;i--;){if(r=s.segments[i],typeof r.end<"u")return{result:t+r.end,precise:!0};if(t+=m0(s,r),typeof r.start<"u")return{result:t+r.start,precise:!0}}return{result:t,precise:!1}},HO=function(s,e){let t=0,i,r=e-s.mediaSequence;for(;r<s.segments.length;r++){if(i=s.segments[r],typeof i.start<"u")return{result:i.start-t,precise:!0};if(t+=m0(s,i),typeof i.end<"u")return{result:i.end-t,precise:!0}}return{result:-1,precise:!1}},p2=function(s,e,t){if(typeof e>"u"&&(e=s.mediaSequence+s.segments.length),e<s.mediaSequence)return 0;const i=VO(s,e);if(i.precise)return i.result;const r=HO(s,e);return r.precise?r.result:i.result+t},m2=function(s,e,t){if(!s)return 0;if(typeof t!="number"&&(t=0),typeof e>"u"){if(s.totalDuration)return s.totalDuration;if(!s.endList)return O.Infinity}return p2(s,e,t)},Ul=function({defaultDuration:s,durationList:e,startIndex:t,endIndex:i}){let r=0;if(t>i&&([t,i]=[i,t]),t<0){for(let n=t;n<Math.min(0,i);n++)r+=s;t=0}for(let n=t;n<i;n++)r+=e[n].duration;return r},g2=function(s,e,t,i){if(!s||!s.segments)return null;if(s.endList)return m2(s);if(e===null)return null;e=e||0;let r=p2(s,s.mediaSequence+s.segments.length,e);return t&&(i=typeof i=="number"?i:f2(null,s),r-=i),Math.max(0,r)},zO=function(s,e,t){const r=e||0;let n=g2(s,e,!0,t);return n===null?ni():(n<r&&(n=r),ni(r,n))},WO=function({playlist:s,currentTime:e,startingSegmentIndex:t,startingPartIndex:i,startTime:r,exactManifestTimings:n}){let a=e-r;const o=$g(s);let l=0;for(let u=0;u<o.length;u++){const c=o[u];if(t===c.segmentIndex&&!(typeof i=="number"&&typeof c.partIndex=="number"&&i!==c.partIndex)){l=u;break}}if(a<0){if(l>0)for(let u=l-1;u>=0;u--){const c=o[u];if(a+=c.duration,n){if(a<0)continue}else if(a+Kr<=0)continue;return{partIndex:c.partIndex,segmentIndex:c.segmentIndex,startTime:r-Ul({defaultDuration:s.targetDuration,durationList:o,startIndex:l,endIndex:u})}}return{partIndex:o[0]&&o[0].partIndex||null,segmentIndex:o[0]&&o[0].segmentIndex||0,startTime:e}}if(l<0){for(let u=l;u<0;u++)if(a-=s.targetDuration,a<0)return{partIndex:o[0]&&o[0].partIndex||null,segmentIndex:o[0]&&o[0].segmentIndex||0,startTime:e};l=0}for(let u=l;u<o.length;u++){const c=o[u];a-=c.duration;const h=c.duration>Kr,d=a===0,g=h&&a+Kr>=0;if(!((d||g)&&u!==o.length-1)){if(n){if(a>0)continue}else if(a-Kr>=0)continue;return{partIndex:c.partIndex,segmentIndex:c.segmentIndex,startTime:r+Ul({defaultDuration:s.targetDuration,durationList:o,startIndex:l,endIndex:u})}}}return{segmentIndex:o[o.length-1].segmentIndex,partIndex:o[o.length-1].partIndex,startTime:e}},v2=function(s){return s.excludeUntil&&s.excludeUntil>Date.now()},g0=function(s){return s.excludeUntil&&s.excludeUntil===1/0},id=function(s){const e=v2(s);return!s.disabled&&!e},GO=function(s){return s.disabled},KO=function(s){for(let e=0;e<s.segments.length;e++)if(s.segments[e].key)return!0;return!1},y2=function(s,e){return e.attributes&&e.attributes[s]},XO=function(s,e,t,i=0){return y2("BANDWIDTH",t)?(s*t.attributes.BANDWIDTH-i*8)/e:NaN},jg=(s,e)=>{if(s.playlists.length===1)return!0;const t=e.attributes.BANDWIDTH||Number.MAX_VALUE;return s.playlists.filter(i=>id(i)?(i.attributes.BANDWIDTH||0)<t:!1).length===0},v0=(s,e)=>!s&&!e||!s&&e||s&&!e?!1:!!(s===e||s.id&&e.id&&s.id===e.id||s.resolvedUri&&e.resolvedUri&&s.resolvedUri===e.resolvedUri||s.uri&&e.uri&&s.uri===e.uri),Y_=function(s,e){const t=s&&s.mediaGroups&&s.mediaGroups.AUDIO||{};let i=!1;for(const r in t){for(const n in t[r])if(i=e(t[r][n]),i)break;if(i)break}return!!i},hu=s=>{if(!s||!s.playlists||!s.playlists.length)return Y_(s,t=>t.playlists&&t.playlists.length||t.uri);for(let e=0;e<s.playlists.length;e++){const t=s.playlists[e],i=t.attributes&&t.attributes.CODECS;if(!(i&&i.split(",").every(n=>I1(n))||Y_(s,n=>v0(t,n))))return!1}return!0};var qi={liveEdgeDelay:f2,duration:m2,seekable:zO,getMediaInfoForTime:WO,isEnabled:id,isDisabled:GO,isExcluded:v2,isIncompatible:g0,playlistEnd:g2,isAes:KO,hasAttribute:y2,estimateSegmentRequestTime:XO,isLowestEnabledRendition:jg,isAudioOnly:hu,playlistMatch:v0,segmentDurationWithParts:m0};const{log:_2}=U,ro=(s,e)=>`${s}-${e}`,T2=(s,e,t)=>`placeholder-uri-${s}-${e}-${t}`,QO=({onwarn:s,oninfo:e,manifestString:t,customTagParsers:i=[],customTagMappers:r=[],llhls:n})=>{const a=new RD;s&&a.on("warn",s),e&&a.on("info",e),i.forEach(u=>a.addParser(u)),r.forEach(u=>a.addTagMapper(u)),a.push(t),a.end();const o=a.manifest;if(n||(["preloadSegment","skip","serverControl","renditionReports","partInf","partTargetDuration"].forEach(function(u){o.hasOwnProperty(u)&&delete o[u]}),o.segments&&o.segments.forEach(function(u){["parts","preloadHints"].forEach(function(c){u.hasOwnProperty(c)&&delete u[c]})})),!o.targetDuration){let u=10;o.segments&&o.segments.length&&(u=o.segments.reduce((c,h)=>Math.max(c,h.duration),0)),s&&s({message:`manifest has no targetDuration defaulting to ${u}`}),o.targetDuration=u}const l=h2(o);if(l.length&&!o.partTargetDuration){const u=l.reduce((c,h)=>Math.max(c,h.duration),0);s&&(s({message:`manifest has no partTargetDuration defaulting to ${u}`}),_2.error("LL-HLS manifest has parts but lacks required #EXT-X-PART-INF:PART-TARGET value. See https://datatracker.ietf.org/doc/html/draft-pantos-hls-rfc8216bis-09#section-4.4.3.7. Playback is not guaranteed.")),o.partTargetDuration=u}return o},$o=(s,e)=>{s.mediaGroups&&["AUDIO","SUBTITLES"].forEach(t=>{if(s.mediaGroups[t])for(const i in s.mediaGroups[t])for(const r in s.mediaGroups[t][i]){const n=s.mediaGroups[t][i][r];e(n,t,i,r)}})},b2=({playlist:s,uri:e,id:t})=>{s.id=t,s.playlistErrors_=0,e&&(s.uri=e),s.attributes=s.attributes||{}},YO=s=>{let e=s.playlists.length;for(;e--;){const t=s.playlists[e];b2({playlist:t,id:ro(e,t.uri)}),t.resolvedUri=ji(s.uri,t.uri),s.playlists[t.id]=t,s.playlists[t.uri]=t,t.attributes.BANDWIDTH||_2.warn("Invalid playlist STREAM-INF detected. Missing BANDWIDTH attribute.")}},JO=s=>{$o(s,e=>{e.uri&&(e.resolvedUri=ji(s.uri,e.uri))})},ZO=(s,e)=>{const t=ro(0,e),i={mediaGroups:{AUDIO:{},VIDEO:{},"CLOSED-CAPTIONS":{},SUBTITLES:{}},uri:O.location.href,resolvedUri:O.location.href,playlists:[{uri:e,id:t,resolvedUri:e,attributes:{}}]};return i.playlists[t]=i.playlists[0],i.playlists[e]=i.playlists[0],i},S2=(s,e,t=T2)=>{s.uri=e;for(let r=0;r<s.playlists.length;r++)if(!s.playlists[r].uri){const n=`placeholder-uri-${r}`;s.playlists[r].uri=n}const i=hu(s);$o(s,(r,n,a,o)=>{if(!r.playlists||!r.playlists.length){if(i&&n==="AUDIO"&&!r.uri)for(let l=0;l<s.playlists.length;l++){const u=s.playlists[l];if(u.attributes&&u.attributes.AUDIO&&u.attributes.AUDIO===a)return}r.playlists=[ft({},r)]}r.playlists.forEach(function(l,u){const c=t(n,a,o,l),h=ro(u,c);l.uri?l.resolvedUri=l.resolvedUri||ji(s.uri,l.uri):(l.uri=u===0?c:h,l.resolvedUri=l.uri),l.id=l.id||h,l.attributes=l.attributes||{},s.playlists[l.id]=l,s.playlists[l.uri]=l})}),YO(s),JO(s)};class J_{constructor(){this.offset_=null,this.pendingDateRanges_=new Map,this.processedDateRanges_=new Map}setOffset(e=[]){if(this.offset_!==null||!e.length)return;const[t]=e;t.programDateTime!==void 0&&(this.offset_=t.programDateTime/1e3)}setPendingDateRanges(e=[]){if(!e.length)return;const[t]=e,i=t.startDate.getTime();this.trimProcessedDateRanges_(i),this.pendingDateRanges_=e.reduce((r,n)=>(r.set(n.id,n),r),new Map)}processDateRange(e){this.pendingDateRanges_.delete(e.id),this.processedDateRanges_.set(e.id,e)}getDateRangesToProcess(){if(this.offset_===null)return[];const e={},t=[];this.pendingDateRanges_.forEach((i,r)=>{if(!this.processedDateRanges_.has(r)&&(i.startTime=i.startDate.getTime()/1e3-this.offset_,i.processDateRange=()=>this.processDateRange(i),t.push(i),!!i.class))if(e[i.class]){const n=e[i.class].push(i);i.classListIndex=n-1}else e[i.class]=[i],i.classListIndex=0});for(const i of t){const r=e[i.class]||[];i.endDate?i.endTime=i.endDate.getTime()/1e3-this.offset_:i.endOnNext&&r[i.classListIndex+1]?i.endTime=r[i.classListIndex+1].startTime:i.duration?i.endTime=i.startTime+i.duration:i.plannedDuration?i.endTime=i.startTime+i.plannedDuration:i.endTime=i.startTime}return t}trimProcessedDateRanges_(e){new Map(this.processedDateRanges_).forEach((i,r)=>{i.startDate.getTime()<e&&this.processedDateRanges_.delete(r)})}}const x2=22,Zs=({requestType:s,request:e,error:t,parseFailure:i})=>{const r=e.status<200||e.status>299,n=e.status>=400&&e.status<=499,a={uri:e.uri,requestType:s},o=r&&!n||i;if(t&&n)a.error=ft({},t),a.errorType=U.Error.NetworkRequestFailed;else if(e.aborted)a.errorType=U.Error.NetworkRequestAborted;else if(e.timedout)a.erroType=U.Error.NetworkRequestTimeout;else if(o){const l=i?U.Error.NetworkBodyParserFailed:U.Error.NetworkBadStatus;a.errorType=l,a.status=e.status,a.headers=e.headers}return a},{EventTarget:eM}=U,tM=(s,e)=>{if(e.endList||!e.serverControl)return s;const t={};if(e.serverControl.canBlockReload){const{preloadSegment:i}=e;let r=e.mediaSequence+e.segments.length;if(i){const n=i.parts||[],a=d2(e)-1;a>-1&&a!==n.length-1&&(t._HLS_part=a),(a>-1||n.length)&&r--}t._HLS_msn=r}if(e.serverControl&&e.serverControl.canSkipUntil&&(t._HLS_skip=e.serverControl.canSkipDateranges?"v2":"YES"),Object.keys(t).length){const i=new O.URL(s);["_HLS_skip","_HLS_msn","_HLS_part"].forEach(function(r){t.hasOwnProperty(r)&&i.searchParams.set(r,t[r])}),s=i.toString()}return s},iM=(s,e)=>{if(!s)return e;const t=lt(s,e);if(s.preloadHints&&!e.preloadHints&&delete t.preloadHints,s.parts&&!e.parts)delete t.parts;else if(s.parts&&e.parts)for(let i=0;i<e.parts.length;i++)s.parts&&s.parts[i]&&(t.parts[i]=lt(s.parts[i],e.parts[i]));return!s.skipped&&e.skipped&&(t.skipped=!1),s.preload&&!e.preload&&(t.preload=!1),t},rM=(s,e,t)=>{const i=s.slice(),r=e.slice();t=t||0;const n=[];let a;for(let o=0;o<r.length;o++){const l=i[o+t],u=r[o];l?(a=l.map||a,n.push(iM(l,u))):(a&&!u.map&&(u.map=a),n.push(u))}return n},C2=(s,e)=>{!s.resolvedUri&&s.uri&&(s.resolvedUri=ji(e,s.uri)),s.key&&!s.key.resolvedUri&&(s.key.resolvedUri=ji(e,s.key.uri)),s.map&&!s.map.resolvedUri&&(s.map.resolvedUri=ji(e,s.map.uri)),s.map&&s.map.key&&!s.map.key.resolvedUri&&(s.map.key.resolvedUri=ji(e,s.map.key.uri)),s.parts&&s.parts.length&&s.parts.forEach(t=>{t.resolvedUri||(t.resolvedUri=ji(e,t.uri))}),s.preloadHints&&s.preloadHints.length&&s.preloadHints.forEach(t=>{t.resolvedUri||(t.resolvedUri=ji(e,t.uri))})},E2=function(s){const e=s.segments||[],t=s.preloadSegment;if(t&&t.parts&&t.parts.length){if(t.preloadHints){for(let i=0;i<t.preloadHints.length;i++)if(t.preloadHints[i].type==="MAP")return e}t.duration=s.targetDuration,t.preload=!0,e.push(t)}return e},w2=(s,e)=>s===e||s.segments&&e.segments&&s.segments.length===e.segments.length&&s.endList===e.endList&&s.mediaSequence===e.mediaSequence&&s.preloadSegment===e.preloadSegment,qg=(s,e,t=w2)=>{const i=lt(s,{}),r=i.playlists[e.id];if(!r||t(r,e))return null;e.segments=E2(e);const n=lt(r,e);if(n.preloadSegment&&!e.preloadSegment&&delete n.preloadSegment,r.segments){if(e.skip){e.segments=e.segments||[];for(let a=0;a<e.skip.skippedSegments;a++)e.segments.unshift({skipped:!0})}n.segments=rM(r.segments,e.segments,e.mediaSequence-r.mediaSequence)}n.segments.forEach(a=>{C2(a,n.resolvedUri)});for(let a=0;a<i.playlists.length;a++)i.playlists[a].id===e.id&&(i.playlists[a]=n);return i.playlists[e.id]=n,i.playlists[e.uri]=n,$o(s,(a,o,l,u)=>{if(a.playlists)for(let c=0;c<a.playlists.length;c++)e.id===a.playlists[c].id&&(a.playlists[c]=n)}),i},Vg=(s,e)=>{const t=s.segments||[],i=t[t.length-1],r=i&&i.parts&&i.parts[i.parts.length-1],n=r&&r.duration||i&&i.duration;return e&&n?n*1e3:(s.partTargetDuration||s.targetDuration||10)*500},Z_=(s,e,t)=>{if(!s)return;const i=[];return s.forEach(r=>{if(!r.attributes)return;const{BANDWIDTH:n,RESOLUTION:a,CODECS:o}=r.attributes;i.push({id:r.id,bandwidth:n,resolution:a,codecs:o})}),{type:e,isLive:t,renditions:i}};let Ka=class extends eM{constructor(e,t,i={}){if(super(),!e)throw new Error("A non-empty playlist URL or object is required");this.logger_=Tr("PlaylistLoader");const{withCredentials:r=!1}=i;this.src=e,this.vhs_=t,this.withCredentials=r,this.addDateRangesToTextTrack_=i.addDateRangesToTextTrack;const n=t.options_;this.customTagParsers=n&&n.customTagParsers||[],this.customTagMappers=n&&n.customTagMappers||[],this.llhls=n&&n.llhls,this.dateRangesStorage_=new J_,this.state="HAVE_NOTHING",this.handleMediaupdatetimeout_=this.handleMediaupdatetimeout_.bind(this),this.on("mediaupdatetimeout",this.handleMediaupdatetimeout_),this.on("loadedplaylist",this.handleLoadedPlaylist_.bind(this))}handleLoadedPlaylist_(){const e=this.media();if(!e)return;this.dateRangesStorage_.setOffset(e.segments),this.dateRangesStorage_.setPendingDateRanges(e.dateRanges);const t=this.dateRangesStorage_.getDateRangesToProcess();!t.length||!this.addDateRangesToTextTrack_||this.addDateRangesToTextTrack_(t)}handleMediaupdatetimeout_(){if(this.state!=="HAVE_METADATA")return;const e=this.media();let t=ji(this.main.uri,e.uri);this.llhls&&(t=tM(t,e)),this.state="HAVE_CURRENT_METADATA",this.request=this.vhs_.xhr({uri:t,withCredentials:this.withCredentials,requestType:"hls-playlist"},(i,r)=>{if(this.request){if(i)return this.playlistRequestError(this.request,this.media(),"HAVE_METADATA");this.haveMetadata({playlistString:this.request.responseText,url:this.media().uri,id:this.media().id})}})}playlistRequestError(e,t,i){const{uri:r,id:n}=t;this.request=null,i&&(this.state=i),this.error={playlist:this.main.playlists[n],status:e.status,message:`HLS playlist request error at URL: ${r}.`,responseText:e.responseText,code:e.status>=500?4:2,metadata:Zs({requestType:e.requestType,request:e,error:e.error})},this.trigger("error")}parseManifest_({url:e,manifestString:t}){try{return QO({onwarn:({message:i})=>this.logger_(`m3u8-parser warn for ${e}: ${i}`),oninfo:({message:i})=>this.logger_(`m3u8-parser info for ${e}: ${i}`),manifestString:t,customTagParsers:this.customTagParsers,customTagMappers:this.customTagMappers,llhls:this.llhls})}catch(i){this.error=i,this.error.metadata={errorType:U.Error.StreamingHlsPlaylistParserError,error:i}}}haveMetadata({playlistString:e,playlistObject:t,url:i,id:r}){this.request=null,this.state="HAVE_METADATA";const n={playlistInfo:{type:"media",uri:i}};this.trigger({type:"playlistparsestart",metadata:n});const a=t||this.parseManifest_({url:i,manifestString:e});a.lastRequest=Date.now(),b2({playlist:a,uri:i,id:r});const o=qg(this.main,a);this.targetDuration=a.partTargetDuration||a.targetDuration,this.pendingMedia_=null,o?(this.main=o,this.media_=this.main.playlists[r]):this.trigger("playlistunchanged"),this.updateMediaUpdateTimeout_(Vg(this.media(),!!o)),n.parsedPlaylist=Z_(this.main.playlists,n.playlistInfo.type,!this.media_.endList),this.trigger({type:"playlistparsecomplete",metadata:n}),this.trigger("loadedplaylist")}dispose(){this.trigger("dispose"),this.stopRequest(),O.clearTimeout(this.mediaUpdateTimeout),O.clearTimeout(this.finalRenditionTimeout),this.dateRangesStorage_=new J_,this.off()}stopRequest(){if(this.request){const e=this.request;this.request=null,e.onreadystatechange=null,e.abort()}}media(e,t){if(!e)return this.media_;if(this.state==="HAVE_NOTHING")throw new Error("Cannot switch media playlist from "+this.state);if(typeof e=="string"){if(!this.main.playlists[e])throw new Error("Unknown playlist URI: "+e);e=this.main.playlists[e]}if(O.clearTimeout(this.finalRenditionTimeout),t){const o=(e.partTargetDuration||e.targetDuration)/2*1e3||5e3;this.finalRenditionTimeout=O.setTimeout(this.media.bind(this,e,!1),o);return}const i=this.state,r=!this.media_||e.id!==this.media_.id,n=this.main.playlists[e.id];if(n&&n.endList||e.endList&&e.segments.length){this.request&&(this.request.onreadystatechange=null,this.request.abort(),this.request=null),this.state="HAVE_METADATA",this.media_=e,r&&(this.trigger("mediachanging"),i==="HAVE_MAIN_MANIFEST"?this.trigger("loadedmetadata"):this.trigger("mediachange"));return}if(this.updateMediaUpdateTimeout_(Vg(e,!0)),!r)return;if(this.state="SWITCHING_MEDIA",this.request){if(e.resolvedUri===this.request.url)return;this.request.onreadystatechange=null,this.request.abort(),this.request=null}this.media_&&this.trigger("mediachanging"),this.pendingMedia_=e;const a={playlistInfo:{type:"media",uri:e.uri}};this.trigger({type:"playlistrequeststart",metadata:a}),this.request=this.vhs_.xhr({uri:e.resolvedUri,withCredentials:this.withCredentials,requestType:"hls-playlist"},(o,l)=>{if(this.request){if(e.lastRequest=Date.now(),e.resolvedUri=ih(e.resolvedUri,l),o)return this.playlistRequestError(this.request,e,i);this.trigger({type:"playlistrequestcomplete",metadata:a}),this.haveMetadata({playlistString:l.responseText,url:e.uri,id:e.id}),i==="HAVE_MAIN_MANIFEST"?this.trigger("loadedmetadata"):this.trigger("mediachange")}})}pause(){this.mediaUpdateTimeout&&(O.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null),this.stopRequest(),this.state==="HAVE_NOTHING"&&(this.started=!1),this.state==="SWITCHING_MEDIA"?this.media_?this.state="HAVE_METADATA":this.state="HAVE_MAIN_MANIFEST":this.state==="HAVE_CURRENT_METADATA"&&(this.state="HAVE_METADATA")}load(e){this.mediaUpdateTimeout&&(O.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null);const t=this.media();if(e){const i=t?(t.partTargetDuration||t.targetDuration)/2*1e3:5e3;this.mediaUpdateTimeout=O.setTimeout(()=>{this.mediaUpdateTimeout=null,this.load()},i);return}if(!this.started){this.start();return}t&&!t.endList?this.trigger("mediaupdatetimeout"):this.trigger("loadedplaylist")}updateMediaUpdateTimeout_(e){this.mediaUpdateTimeout&&(O.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null),!(!this.media()||this.media().endList)&&(this.mediaUpdateTimeout=O.setTimeout(()=>{this.mediaUpdateTimeout=null,this.trigger("mediaupdatetimeout"),this.updateMediaUpdateTimeout_(e)},e))}start(){if(this.started=!0,typeof this.src=="object"){this.src.uri||(this.src.uri=O.location.href),this.src.resolvedUri=this.src.uri,setTimeout(()=>{this.setupInitialPlaylist(this.src)},0);return}const e={playlistInfo:{type:"multivariant",uri:this.src}};this.trigger({type:"playlistrequeststart",metadata:e}),this.request=this.vhs_.xhr({uri:this.src,withCredentials:this.withCredentials,requestType:"hls-playlist"},(t,i)=>{if(!this.request)return;if(this.request=null,t)return this.error={status:i.status,message:`HLS playlist request error at URL: ${this.src}.`,responseText:i.responseText,code:2,metadata:Zs({requestType:i.requestType,request:i,error:t})},this.state==="HAVE_NOTHING"&&(this.started=!1),this.trigger("error");this.trigger({type:"playlistrequestcomplete",metadata:e}),this.src=ih(this.src,i),this.trigger({type:"playlistparsestart",metadata:e});const r=this.parseManifest_({manifestString:i.responseText,url:this.src});e.parsedPlaylist=Z_(r.playlists,e.playlistInfo.type,!1),this.trigger({type:"playlistparsecomplete",metadata:e}),this.setupInitialPlaylist(r)})}srcUri(){return typeof this.src=="string"?this.src:this.src.uri}setupInitialPlaylist(e){if(this.state="HAVE_MAIN_MANIFEST",e.playlists){this.main=e,S2(this.main,this.srcUri()),e.playlists.forEach(i=>{i.segments=E2(i),i.segments.forEach(r=>{C2(r,i.resolvedUri)})}),this.trigger("loadedplaylist"),this.request||this.media(this.main.playlists[0]);return}const t=this.srcUri()||O.location.href;this.main=ZO(e,t),this.haveMetadata({playlistObject:e,url:t,id:this.main.playlists[0].id}),this.trigger("loadedmetadata")}updateOrDeleteClone(e,t){const i=this.main,r=e.ID;let n=i.playlists.length;for(;n--;){const a=i.playlists[n];if(a.attributes["PATHWAY-ID"]===r){const o=a.resolvedUri,l=a.id;if(t){const u=this.createCloneURI_(a.resolvedUri,e),c=ro(r,u),h=this.createCloneAttributes_(r,a.attributes),d=this.createClonePlaylist_(a,c,e,h);i.playlists[n]=d,i.playlists[c]=d,i.playlists[u]=d}else i.playlists.splice(n,1);delete i.playlists[l],delete i.playlists[o]}}this.updateOrDeleteCloneMedia(e,t)}updateOrDeleteCloneMedia(e,t){const i=this.main,r=e.ID;["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(n=>{if(!(!i.mediaGroups[n]||!i.mediaGroups[n][r])){for(const a in i.mediaGroups[n])if(a===r){for(const o in i.mediaGroups[n][a])i.mediaGroups[n][a][o].playlists.forEach((u,c)=>{const h=i.playlists[u.id],d=h.id,g=h.resolvedUri;delete i.playlists[d],delete i.playlists[g]});delete i.mediaGroups[n][a]}}}),t&&this.createClonedMediaGroups_(e)}addClonePathway(e,t={}){const i=this.main,r=i.playlists.length,n=this.createCloneURI_(t.resolvedUri,e),a=ro(e.ID,n),o=this.createCloneAttributes_(e.ID,t.attributes),l=this.createClonePlaylist_(t,a,e,o);i.playlists[r]=l,i.playlists[a]=l,i.playlists[n]=l,this.createClonedMediaGroups_(e)}createClonedMediaGroups_(e){const t=e.ID,i=e["BASE-ID"],r=this.main;["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(n=>{if(!(!r.mediaGroups[n]||r.mediaGroups[n][t]))for(const a in r.mediaGroups[n]){if(a===i)r.mediaGroups[n][t]={};else continue;for(const o in r.mediaGroups[n][a]){const l=r.mediaGroups[n][a][o];r.mediaGroups[n][t][o]=ft({},l);const u=r.mediaGroups[n][t][o],c=this.createCloneURI_(l.resolvedUri,e);u.resolvedUri=c,u.uri=c,u.playlists=[],l.playlists.forEach((h,d)=>{const g=r.playlists[h.id],y=T2(n,t,o),p=ro(t,y);if(g&&!r.playlists[p]){const _=this.createClonePlaylist_(g,p,e),k=_.resolvedUri;r.playlists[p]=_,r.playlists[k]=_}u.playlists[d]=this.createClonePlaylist_(h,p,e)})}}})}createClonePlaylist_(e,t,i,r){const n=this.createCloneURI_(e.resolvedUri,i),a={resolvedUri:n,uri:n,id:t};return e.segments&&(a.segments=[]),r&&(a.attributes=r),lt(e,a)}createCloneURI_(e,t){const i=new URL(e);i.hostname=t["URI-REPLACEMENT"].HOST;const r=t["URI-REPLACEMENT"].PARAMS;for(const n of Object.keys(r))i.searchParams.set(n,r[n]);return i.href}createCloneAttributes_(e,t){const i={"PATHWAY-ID":e};return["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(r=>{t[r]&&(i[r]=e)}),i}getKeyIdSet(e){if(e.contentProtection){const t=new Set;for(const i in e.contentProtection){const r=e.contentProtection[i].attributes.keyId;r&&t.add(r.toLowerCase())}return t}}};const Hg=function(s,e,t,i){const r=s.responseType==="arraybuffer"?s.response:s.responseText;!e&&r&&(s.responseTime=Date.now(),s.roundTripTime=s.responseTime-s.requestTime,s.bytesReceived=r.byteLength||r.length,s.bandwidth||(s.bandwidth=Math.floor(s.bytesReceived/s.roundTripTime*8*1e3))),t.headers&&(s.responseHeaders=t.headers),e&&e.code==="ETIMEDOUT"&&(s.timedout=!0),!e&&!s.aborted&&t.statusCode!==200&&t.statusCode!==206&&t.statusCode!==0&&(e=new Error("XHR Failed with a response of: "+(s&&(r||s.responseText)))),i(e,s)},nM=(s,e)=>{if(!s||!s.size)return;let t=e;return s.forEach(i=>{t=i(t)}),t},sM=(s,e,t,i)=>{!s||!s.size||s.forEach(r=>{r(e,t,i)})},k2=function(){const s=function e(t,i){t=lt({timeout:45e3},t);const r=e.beforeRequest||U.Vhs.xhr.beforeRequest,n=e._requestCallbackSet||U.Vhs.xhr._requestCallbackSet||new Set,a=e._responseCallbackSet||U.Vhs.xhr._responseCallbackSet;r&&typeof r=="function"&&(U.log.warn("beforeRequest is deprecated, use onRequest instead."),n.add(r));const o=U.Vhs.xhr.original===!0?U.xhr:U.Vhs.xhr,l=nM(n,t);n.delete(r);const u=o(l||t,function(h,d){return sM(a,u,h,d),Hg(u,h,d,i)}),c=u.abort;return u.abort=function(){return u.aborted=!0,c.apply(u,arguments)},u.uri=t.uri,u.requestType=t.requestType,u.requestTime=Date.now(),u};return s.original=!0,s},aM=function(s){let e;const t=s.offset;return typeof s.offset=="bigint"||typeof s.length=="bigint"?e=O.BigInt(s.offset)+O.BigInt(s.length)-O.BigInt(1):e=s.offset+s.length-1,"bytes="+t+"-"+e},zg=function(s){const e={};return s.byterange&&(e.Range=aM(s.byterange)),e},oM=function(s,e){return s.start(e)+"-"+s.end(e)},lM=function(s,e){const t=s.toString(16);return"00".substring(0,2-t.length)+t+(e%2?" ":"")},uM=function(s){return s>=32&&s<126?String.fromCharCode(s):"."},A2=function(s){const e={};return Object.keys(s).forEach(t=>{const i=s[t];D1(i)?e[t]={bytes:i.buffer,byteOffset:i.byteOffset,byteLength:i.byteLength}:e[t]=i}),e},rh=function(s){const e=s.byterange||{length:1/0,offset:0};return[e.length,e.offset,s.resolvedUri].join(",")},I2=function(s){return s.resolvedUri},P2=s=>{const e=Array.prototype.slice.call(s),t=16;let i="",r,n;for(let a=0;a<e.length/t;a++)r=e.slice(a*t,a*t+t).map(lM).join(""),n=e.slice(a*t,a*t+t).map(uM).join(""),i+=r+" "+n+`
199
- `;return i},cM=({bytes:s})=>P2(s),hM=s=>{let e="",t;for(t=0;t<s.length;t++)e+=oM(s,t)+" ";return e};var dM=Object.freeze({__proto__:null,createTransferableMessage:A2,initSegmentId:rh,segmentKeyId:I2,hexDump:P2,tagDump:cM,textRanges:hM});const D2=.25,fM=(s,e)=>{if(!e.dateTimeObject)return null;const t=e.videoTimingInfo.transmuxerPrependedSeconds,r=e.videoTimingInfo.transmuxedPresentationStart+t,n=s-r;return new Date(e.dateTimeObject.getTime()+n*1e3)},pM=s=>s.transmuxedPresentationEnd-s.transmuxedPresentationStart-s.transmuxerPrependedSeconds,mM=(s,e)=>{let t;try{t=new Date(s)}catch{return null}if(!e||!e.segments||e.segments.length===0)return null;let i=e.segments[0];if(t<new Date(i.dateTimeObject))return null;for(let l=0;l<e.segments.length-1;l++){i=e.segments[l];const u=new Date(e.segments[l+1].dateTimeObject);if(t<u)break}const r=e.segments[e.segments.length-1],n=r.dateTimeObject,a=r.videoTimingInfo?pM(r.videoTimingInfo):r.duration+r.duration*D2,o=new Date(n.getTime()+a*1e3);return t>o?null:(t>new Date(n)&&(i=r),{segment:i,estimatedStart:i.videoTimingInfo?i.videoTimingInfo.transmuxedPresentationStart:qi.duration(e,e.mediaSequence+e.segments.indexOf(i)),type:i.videoTimingInfo?"accurate":"estimate"})},gM=(s,e)=>{if(!e||!e.segments||e.segments.length===0)return null;let t=0,i;for(let n=0;n<e.segments.length&&(i=e.segments[n],t=i.videoTimingInfo?i.videoTimingInfo.transmuxedPresentationEnd:t+i.duration,!(s<=t));n++);const r=e.segments[e.segments.length-1];if(r.videoTimingInfo&&r.videoTimingInfo.transmuxedPresentationEnd<s)return null;if(s>t){if(s>t+r.duration*D2)return null;i=r}return{segment:i,estimatedStart:i.videoTimingInfo?i.videoTimingInfo.transmuxedPresentationStart:t-i.duration,type:i.videoTimingInfo?"accurate":"estimate"}},vM=(s,e)=>{let t,i;try{t=new Date(s),i=new Date(e)}catch{}const r=t.getTime();return(i.getTime()-r)/1e3},yM=s=>{if(!s.segments||s.segments.length===0)return!1;for(let e=0;e<s.segments.length;e++)if(!s.segments[e].dateTimeObject)return!1;return!0},_M=({playlist:s,time:e=void 0,callback:t})=>{if(!t)throw new Error("getProgramTime: callback must be provided");if(!s||e===void 0)return t({message:"getProgramTime: playlist and time must be provided"});const i=gM(e,s);if(!i)return t({message:"valid programTime was not found"});if(i.type==="estimate")return t({message:"Accurate programTime could not be determined. Please seek to e.seekTime and try again",seekTime:i.estimatedStart});const r={mediaSeconds:e},n=fM(e,i.segment);return n&&(r.programDateTime=n.toISOString()),t(null,r)},N2=({programTime:s,playlist:e,retryCount:t=2,seekTo:i,pauseAfterSeek:r=!0,tech:n,callback:a})=>{if(!a)throw new Error("seekToProgramTime: callback must be provided");if(typeof s>"u"||!e||!i)return a({message:"seekToProgramTime: programTime, seekTo and playlist must be provided"});if(!e.endList&&!n.hasStarted_)return a({message:"player must be playing a live stream to start buffering"});if(!yM(e))return a({message:"programDateTime tags must be provided in the manifest "+e.resolvedUri});const o=mM(s,e);if(!o)return a({message:`${s} was not found in the stream`});const l=o.segment,u=vM(l.dateTimeObject,s);if(o.type==="estimate"){if(t===0)return a({message:`${s} is not buffered yet. Try again`});i(o.estimatedStart+u),n.one("seeked",()=>{N2({programTime:s,playlist:e,retryCount:t-1,seekTo:i,pauseAfterSeek:r,tech:n,callback:a})});return}const c=l.start+u,h=()=>a(null,n.currentTime());n.one("seeked",h),r&&n.pause(),i(c)},$f=(s,e)=>{if(s.readyState===4)return e()},TM=(s,e,t,i)=>{let r=[],n,a=!1;const o=function(h,d,g,y){return d.abort(),a=!0,t(h,d,g,y)},l=function(h,d){if(a)return;if(h)return h.metadata=Zs({requestType:i,request:d,error:h}),o(h,d,"",r);const g=d.responseText.substring(r&&r.byteLength||0,d.responseText.length);if(r=KD(r,N1(g,!0)),n=n||wl(r),r.length<10||n&&r.length<n+2)return $f(d,()=>o(h,d,"",r));const y=jv(r);return y==="ts"&&r.length<188?$f(d,()=>o(h,d,"",r)):!y&&r.length<376?$f(d,()=>o(h,d,"",r)):o(null,d,y,r)},c=e({uri:s,beforeSend(h){h.overrideMimeType("text/plain; charset=x-user-defined"),h.addEventListener("progress",function({total:d,loaded:g}){return Hg(h,null,{statusCode:h.status},l)})}},function(h,d){return Hg(c,h,d,l)});return c},{EventTarget:bM}=U,eT=function(s,e){if(!w2(s,e)||s.sidx&&e.sidx&&(s.sidx.offset!==e.sidx.offset||s.sidx.length!==e.sidx.length))return!1;if(!s.sidx&&e.sidx||s.sidx&&!e.sidx||s.segments&&!e.segments||!s.segments&&e.segments)return!1;if(!s.segments&&!e.segments)return!0;for(let t=0;t<s.segments.length;t++){const i=s.segments[t],r=e.segments[t];if(i.uri!==r.uri)return!1;if(!i.byterange&&!r.byterange)continue;const n=i.byterange,a=r.byterange;if(n&&!a||!n&&a||n.offset!==a.offset||n.length!==a.length)return!1}return!0},SM=(s,e,t,i)=>{const r=i.attributes.NAME||t;return`placeholder-uri-${s}-${e}-${r}`},xM=({mainXml:s,srcUrl:e,clientOffset:t,sidxMapping:i,previousManifest:r})=>{const n=zN(s,{manifestUri:e,clientOffset:t,sidxMapping:i,previousManifest:r});return S2(n,e,SM),n},CM=(s,e)=>{$o(s,(t,i,r,n)=>{(!e.mediaGroups[i][r]||!(n in e.mediaGroups[i][r]))&&delete s.mediaGroups[i][r][n]})},EM=(s,e,t)=>{let i=!0,r=lt(s,{duration:e.duration,minimumUpdatePeriod:e.minimumUpdatePeriod,timelineStarts:e.timelineStarts});for(let n=0;n<e.playlists.length;n++){const a=e.playlists[n];if(a.sidx){const l=Uh(a.sidx);t&&t[l]&&t[l].sidx&&Bv(a,t[l].sidx,a.sidx.resolvedUri)}const o=qg(r,a,eT);o&&(r=o,i=!1)}return $o(e,(n,a,o,l)=>{if(n.playlists&&n.playlists.length){const u=n.playlists[0].id,c=qg(r,n.playlists[0],eT);c&&(r=c,l in r.mediaGroups[a][o]||(r.mediaGroups[a][o][l]=n),r.mediaGroups[a][o][l].playlists[0]=r.playlists[u],i=!1)}}),CM(r,e),e.minimumUpdatePeriod!==s.minimumUpdatePeriod&&(i=!1),i?null:r},wM=(s,e)=>(!s.map&&!e.map||!!(s.map&&e.map&&s.map.byterange.offset===e.map.byterange.offset&&s.map.byterange.length===e.map.byterange.length))&&s.uri===e.uri&&s.byterange.offset===e.byterange.offset&&s.byterange.length===e.byterange.length,tT=(s,e)=>{const t={};for(const i in s){const n=s[i].sidx;if(n){const a=Uh(n);if(!e[a])break;const o=e[a].sidxInfo;wM(o,n)&&(t[a]=e[a])}}return t},kM=(s,e)=>{let i=tT(s.playlists,e);return $o(s,(r,n,a,o)=>{if(r.playlists&&r.playlists.length){const l=r.playlists;i=lt(i,tT(l,e))}}),i};let Wg=class extends bM{constructor(e,t,i={},r){super(),this.mainPlaylistLoader_=r||this,r||(this.isMain_=!0);const{withCredentials:n=!1}=i;if(this.vhs_=t,this.withCredentials=n,this.addMetadataToTextTrack=i.addMetadataToTextTrack,!e)throw new Error("A non-empty playlist URL or object is required");this.on("minimumUpdatePeriod",()=>{this.refreshXml_()}),this.on("mediaupdatetimeout",()=>{this.refreshMedia_(this.media().id)}),this.state="HAVE_NOTHING",this.loadedPlaylists_={},this.logger_=Tr("DashPlaylistLoader"),this.isMain_?(this.mainPlaylistLoader_.srcUrl=e,this.mainPlaylistLoader_.sidxMapping_={}):this.childPlaylist_=e}requestErrored_(e,t,i){if(!this.request)return!0;if(this.request=null,e)return this.error=typeof e=="object"&&!(e instanceof Error)?e:{status:t.status,message:"DASH request error at URL: "+t.uri,response:t.response,code:2,metadata:e.metadata},i&&(this.state=i),this.trigger("error"),!0}addSidxSegments_(e,t,i){const r=e.sidx&&Uh(e.sidx);if(!e.sidx||!r||this.mainPlaylistLoader_.sidxMapping_[r]){this.mediaRequest_=O.setTimeout(()=>i(!1),0);return}const n=ih(e.sidx.resolvedUri),a=(l,u)=>{if(this.requestErrored_(l,u,t))return;const c=this.mainPlaylistLoader_.sidxMapping_,{requestType:h}=u;let d;try{d=QN($e(u.response).subarray(8))}catch(g){g.metadata=Zs({requestType:h,request:u,parseFailure:!0}),this.requestErrored_(g,u,t);return}return c[r]={sidxInfo:e.sidx,sidx:d},Bv(e,d,e.sidx.resolvedUri),i(!0)},o="dash-sidx";this.request=TM(n,this.vhs_.xhr,(l,u,c,h)=>{if(l)return a(l,u);if(!c||c!=="mp4"){const y=c||"unknown";return a({status:u.status,message:`Unsupported ${y} container type for sidx segment at URL: ${n}`,response:"",playlist:e,internal:!0,playlistExclusionDuration:1/0,code:2},u)}const{offset:d,length:g}=e.sidx.byterange;if(h.length>=g+d)return a(l,{response:h.subarray(d,d+g),status:u.status,uri:u.uri});this.request=this.vhs_.xhr({uri:n,responseType:"arraybuffer",requestType:"dash-sidx",headers:zg({byterange:e.sidx.byterange})},a)},o)}dispose(){this.trigger("dispose"),this.stopRequest(),this.loadedPlaylists_={},O.clearTimeout(this.minimumUpdatePeriodTimeout_),O.clearTimeout(this.mediaRequest_),O.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null,this.mediaRequest_=null,this.minimumUpdatePeriodTimeout_=null,this.mainPlaylistLoader_.createMupOnMedia_&&(this.off("loadedmetadata",this.mainPlaylistLoader_.createMupOnMedia_),this.mainPlaylistLoader_.createMupOnMedia_=null),this.off()}hasPendingRequest(){return this.request||this.mediaRequest_}stopRequest(){if(this.request){const e=this.request;this.request=null,e.onreadystatechange=null,e.abort()}}media(e){if(!e)return this.media_;if(this.state==="HAVE_NOTHING")throw new Error("Cannot switch media playlist from "+this.state);const t=this.state;if(typeof e=="string"){if(!this.mainPlaylistLoader_.main.playlists[e])throw new Error("Unknown playlist URI: "+e);e=this.mainPlaylistLoader_.main.playlists[e]}const i=!this.media_||e.id!==this.media_.id;if(i&&this.loadedPlaylists_[e.id]&&this.loadedPlaylists_[e.id].endList){this.state="HAVE_METADATA",this.media_=e,i&&(this.trigger("mediachanging"),this.trigger("mediachange"));return}i&&(this.media_&&this.trigger("mediachanging"),this.addSidxSegments_(e,t,r=>{this.haveMetadata({startingState:t,playlist:e})}))}haveMetadata({startingState:e,playlist:t}){this.state="HAVE_METADATA",this.loadedPlaylists_[t.id]=t,this.mediaRequest_=null,this.refreshMedia_(t.id),e==="HAVE_MAIN_MANIFEST"?this.trigger("loadedmetadata"):this.trigger("mediachange")}pause(){this.mainPlaylistLoader_.createMupOnMedia_&&(this.off("loadedmetadata",this.mainPlaylistLoader_.createMupOnMedia_),this.mainPlaylistLoader_.createMupOnMedia_=null),this.stopRequest(),O.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null,this.isMain_&&(O.clearTimeout(this.mainPlaylistLoader_.minimumUpdatePeriodTimeout_),this.mainPlaylistLoader_.minimumUpdatePeriodTimeout_=null),this.state==="HAVE_NOTHING"&&(this.started=!1)}load(e){O.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null;const t=this.media();if(e){const i=t?t.targetDuration/2*1e3:5e3;this.mediaUpdateTimeout=O.setTimeout(()=>this.load(),i);return}if(!this.started){this.start();return}t&&!t.endList?(this.isMain_&&!this.minimumUpdatePeriodTimeout_&&(this.trigger("minimumUpdatePeriod"),this.updateMinimumUpdatePeriodTimeout_()),this.trigger("mediaupdatetimeout")):this.trigger("loadedplaylist")}start(){if(this.started=!0,!this.isMain_){this.mediaRequest_=O.setTimeout(()=>this.haveMain_(),0);return}this.requestMain_((e,t)=>{this.haveMain_(),!this.hasPendingRequest()&&!this.media_&&this.media(this.mainPlaylistLoader_.main.playlists[0])})}requestMain_(e){const t={manifestInfo:{uri:this.mainPlaylistLoader_.srcUrl}};this.trigger({type:"manifestrequeststart",metadata:t}),this.request=this.vhs_.xhr({uri:this.mainPlaylistLoader_.srcUrl,withCredentials:this.withCredentials,requestType:"dash-manifest"},(i,r)=>{if(i){const{requestType:a}=r;i.metadata=Zs({requestType:a,request:r,error:i})}if(this.requestErrored_(i,r)){this.state==="HAVE_NOTHING"&&(this.started=!1);return}this.trigger({type:"manifestrequestcomplete",metadata:t});const n=r.responseText!==this.mainPlaylistLoader_.mainXml_;if(this.mainPlaylistLoader_.mainXml_=r.responseText,r.responseHeaders&&r.responseHeaders.date?this.mainLoaded_=Date.parse(r.responseHeaders.date):this.mainLoaded_=Date.now(),this.mainPlaylistLoader_.srcUrl=ih(this.mainPlaylistLoader_.srcUrl,r),n){this.handleMain_(),this.syncClientServerClock_(()=>e(r,n));return}return e(r,n)})}syncClientServerClock_(e){const t=WN(this.mainPlaylistLoader_.mainXml_);if(t===null)return this.mainPlaylistLoader_.clientOffset_=this.mainLoaded_-Date.now(),e();if(t.method==="DIRECT")return this.mainPlaylistLoader_.clientOffset_=t.value-Date.now(),e();this.request=this.vhs_.xhr({uri:ji(this.mainPlaylistLoader_.srcUrl,t.value),method:t.method,withCredentials:this.withCredentials,requestType:"dash-clock-sync"},(i,r)=>{if(!this.request)return;if(i){const{requestType:a}=r;return this.error.metadata=Zs({requestType:a,request:r,error:i}),this.mainPlaylistLoader_.clientOffset_=this.mainLoaded_-Date.now(),e()}let n;t.method==="HEAD"?!r.responseHeaders||!r.responseHeaders.date?n=this.mainLoaded_:n=Date.parse(r.responseHeaders.date):n=Date.parse(r.responseText),this.mainPlaylistLoader_.clientOffset_=n-Date.now(),e()})}haveMain_(){this.state="HAVE_MAIN_MANIFEST",this.isMain_?this.trigger("loadedplaylist"):this.media_||this.media(this.childPlaylist_)}handleMain_(){this.mediaRequest_=null;const e=this.mainPlaylistLoader_.main,t={manifestInfo:{uri:this.mainPlaylistLoader_.srcUrl}};this.trigger({type:"manifestparsestart",metadata:t});let i;try{i=xM({mainXml:this.mainPlaylistLoader_.mainXml_,srcUrl:this.mainPlaylistLoader_.srcUrl,clientOffset:this.mainPlaylistLoader_.clientOffset_,sidxMapping:this.mainPlaylistLoader_.sidxMapping_,previousManifest:e})}catch(n){this.error=n,this.error.metadata={errorType:U.Error.StreamingDashManifestParserError,error:n},this.trigger("error")}e&&(i=EM(e,i,this.mainPlaylistLoader_.sidxMapping_)),this.mainPlaylistLoader_.main=i||e;const r=this.mainPlaylistLoader_.main.locations&&this.mainPlaylistLoader_.main.locations[0];if(r&&r!==this.mainPlaylistLoader_.srcUrl&&(this.mainPlaylistLoader_.srcUrl=r),(!e||i&&i.minimumUpdatePeriod!==e.minimumUpdatePeriod)&&this.updateMinimumUpdatePeriodTimeout_(),this.addEventStreamToMetadataTrack_(i),i){const{duration:n,endList:a}=i,o=[];i.playlists.forEach(u=>{o.push({id:u.id,bandwidth:u.attributes.BANDWIDTH,resolution:u.attributes.RESOLUTION,codecs:u.attributes.CODECS})});const l={duration:n,isLive:!a,renditions:o};t.parsedManifest=l,this.trigger({type:"manifestparsecomplete",metadata:t})}return!!i}updateMinimumUpdatePeriodTimeout_(){const e=this.mainPlaylistLoader_;e.createMupOnMedia_&&(e.off("loadedmetadata",e.createMupOnMedia_),e.createMupOnMedia_=null),e.minimumUpdatePeriodTimeout_&&(O.clearTimeout(e.minimumUpdatePeriodTimeout_),e.minimumUpdatePeriodTimeout_=null);let t=e.main&&e.main.minimumUpdatePeriod;if(t===0&&(e.media()?t=e.media().targetDuration*1e3:(e.createMupOnMedia_=e.updateMinimumUpdatePeriodTimeout_,e.one("loadedmetadata",e.createMupOnMedia_))),typeof t!="number"||t<=0){t<0&&this.logger_(`found invalid minimumUpdatePeriod of ${t}, not setting a timeout`);return}this.createMUPTimeout_(t)}createMUPTimeout_(e){const t=this.mainPlaylistLoader_;t.minimumUpdatePeriodTimeout_=O.setTimeout(()=>{t.minimumUpdatePeriodTimeout_=null,t.trigger("minimumUpdatePeriod"),t.createMUPTimeout_(e)},e)}refreshXml_(){this.requestMain_((e,t)=>{t&&(this.media_&&(this.media_=this.mainPlaylistLoader_.main.playlists[this.media_.id]),this.mainPlaylistLoader_.sidxMapping_=kM(this.mainPlaylistLoader_.main,this.mainPlaylistLoader_.sidxMapping_),this.addSidxSegments_(this.media(),this.state,i=>{this.refreshMedia_(this.media().id)}))})}refreshMedia_(e){if(!e)throw new Error("refreshMedia_ must take a media id");this.media_&&this.isMain_&&this.handleMain_();const t=this.mainPlaylistLoader_.main.playlists,i=!this.media_||this.media_!==t[e];if(i?this.media_=t[e]:this.trigger("playlistunchanged"),!this.mediaUpdateTimeout){const r=()=>{this.media().endList||(this.mediaUpdateTimeout=O.setTimeout(()=>{this.trigger("mediaupdatetimeout"),r()},Vg(this.media(),!!i)))};r()}this.trigger("loadedplaylist")}addEventStreamToMetadataTrack_(e){if(e&&this.mainPlaylistLoader_.main.eventStream){const t=this.mainPlaylistLoader_.main.eventStream.map(i=>({cueTime:i.start,frames:[{data:i.messageData}]}));this.addMetadataToTextTrack("EventStream",t,this.mainPlaylistLoader_.main.duration)}}getKeyIdSet(e){if(e.contentProtection){const t=new Set;for(const i in e.contentProtection){const r=e.contentProtection[i].attributes["cenc:default_KID"];r&&t.add(r.replace(/-/g,"").toLowerCase())}return t}}};var ei={GOAL_BUFFER_LENGTH:30,MAX_GOAL_BUFFER_LENGTH:60,BACK_BUFFER_LENGTH:30,GOAL_BUFFER_LENGTH_RATE:1,INITIAL_BANDWIDTH:4194304,BANDWIDTH_VARIANCE:1.2,BUFFER_LOW_WATER_LINE:0,MAX_BUFFER_LOW_WATER_LINE:30,EXPERIMENTAL_MAX_BUFFER_LOW_WATER_LINE:16,BUFFER_LOW_WATER_LINE_RATE:1,BUFFER_HIGH_WATER_LINE:30};const AM=s=>{const e=new Uint8Array(new ArrayBuffer(s.length));for(let t=0;t<s.length;t++)e[t]=s.charCodeAt(t);return e.buffer},L2=function(s){return s.on=s.addEventListener,s.off=s.removeEventListener,s},IM=function(s){try{return URL.createObjectURL(new Blob([s],{type:"application/javascript"}))}catch{const t=new BlobBuilder;return t.append(s),URL.createObjectURL(t.getBlob())}},O2=function(s){return function(){const e=IM(s),t=L2(new Worker(e));t.objURL=e;const i=t.terminate;return t.on=t.addEventListener,t.off=t.removeEventListener,t.terminate=function(){return URL.revokeObjectURL(e),i.call(this)},t}},M2=function(s){return`var browserWorkerPolyFill = ${L2.toString()};
200
- browserWorkerPolyFill(self);
201
- `+s},R2=function(s){return s.toString().replace(/^function.+?{/,"").slice(0,-1)},PM=M2(R2(function(){var s=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},e=function(){this.init=function(){var f={};this.on=function(v,S){f[v]||(f[v]=[]),f[v]=f[v].concat(S)},this.off=function(v,S){var b;return f[v]?(b=f[v].indexOf(S),f[v]=f[v].slice(),f[v].splice(b,1),b>-1):!1},this.trigger=function(v){var S,b,w,D;if(S=f[v],!!S)if(arguments.length===2)for(w=S.length,b=0;b<w;++b)S[b].call(this,arguments[1]);else{for(D=[],b=arguments.length,b=1;b<arguments.length;++b)D.push(arguments[b]);for(w=S.length,b=0;b<w;++b)S[b].apply(this,D)}},this.dispose=function(){f={}}}};e.prototype.pipe=function(f){return this.on("data",function(v){f.push(v)}),this.on("done",function(v){f.flush(v)}),this.on("partialdone",function(v){f.partialFlush(v)}),this.on("endedtimeline",function(v){f.endTimeline(v)}),this.on("reset",function(v){f.reset(v)}),f},e.prototype.push=function(f){this.trigger("data",f)},e.prototype.flush=function(f){this.trigger("done",f)},e.prototype.partialFlush=function(f){this.trigger("partialdone",f)},e.prototype.endTimeline=function(f){this.trigger("endedtimeline",f)},e.prototype.reset=function(f){this.trigger("reset",f)};var t=e,i=Math.pow(2,32),r=function(f){var v=new DataView(f.buffer,f.byteOffset,f.byteLength),S;return v.getBigUint64?(S=v.getBigUint64(0),S<Number.MAX_SAFE_INTEGER?Number(S):S):v.getUint32(0)*i+v.getUint32(4)},n={getUint64:r,MAX_UINT32:i},a=n.MAX_UINT32,o,l,u,c,h,d,g,y,p,_,k,A,N,$,R,L,F,B,C,I,G,H,K,ie,he,fe,re,ne,oe,de,ve,ke,De,Me,Ne,Ye;(function(){var f;if(K={avc1:[],avcC:[],btrt:[],dinf:[],dref:[],esds:[],ftyp:[],hdlr:[],mdat:[],mdhd:[],mdia:[],mfhd:[],minf:[],moof:[],moov:[],mp4a:[],mvex:[],mvhd:[],pasp:[],sdtp:[],smhd:[],stbl:[],stco:[],stsc:[],stsd:[],stsz:[],stts:[],styp:[],tfdt:[],tfhd:[],traf:[],trak:[],trun:[],trex:[],tkhd:[],vmhd:[]},!(typeof Uint8Array>"u")){for(f in K)K.hasOwnProperty(f)&&(K[f]=[f.charCodeAt(0),f.charCodeAt(1),f.charCodeAt(2),f.charCodeAt(3)]);ie=new Uint8Array([105,115,111,109]),fe=new Uint8Array([97,118,99,49]),he=new Uint8Array([0,0,0,1]),re=new Uint8Array([0,0,0,0,0,0,0,0,118,105,100,101,0,0,0,0,0,0,0,0,0,0,0,0,86,105,100,101,111,72,97,110,100,108,101,114,0]),ne=new Uint8Array([0,0,0,0,0,0,0,0,115,111,117,110,0,0,0,0,0,0,0,0,0,0,0,0,83,111,117,110,100,72,97,110,100,108,101,114,0]),oe={video:re,audio:ne},ke=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),ve=new Uint8Array([0,0,0,0,0,0,0,0]),De=new Uint8Array([0,0,0,0,0,0,0,0]),Me=De,Ne=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),Ye=De,de=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0])}})(),o=function(f){var v=[],S=0,b,w,D;for(b=1;b<arguments.length;b++)v.push(arguments[b]);for(b=v.length;b--;)S+=v[b].byteLength;for(w=new Uint8Array(S+8),D=new DataView(w.buffer,w.byteOffset,w.byteLength),D.setUint32(0,w.byteLength),w.set(f,4),b=0,S=8;b<v.length;b++)w.set(v[b],S),S+=v[b].byteLength;return w},l=function(){return o(K.dinf,o(K.dref,ke))},u=function(f){return o(K.esds,new Uint8Array([0,0,0,0,3,25,0,0,0,4,17,64,21,0,6,0,0,0,218,192,0,0,218,192,5,2,f.audioobjecttype<<3|f.samplingfrequencyindex>>>1,f.samplingfrequencyindex<<7|f.channelcount<<3,6,1,2]))},c=function(){return o(K.ftyp,ie,he,ie,fe)},L=function(f){return o(K.hdlr,oe[f])},h=function(f){return o(K.mdat,f)},R=function(f){var v=new Uint8Array([0,0,0,0,0,0,0,2,0,0,0,3,0,1,95,144,f.duration>>>24&255,f.duration>>>16&255,f.duration>>>8&255,f.duration&255,85,196,0,0]);return f.samplerate&&(v[12]=f.samplerate>>>24&255,v[13]=f.samplerate>>>16&255,v[14]=f.samplerate>>>8&255,v[15]=f.samplerate&255),o(K.mdhd,v)},$=function(f){return o(K.mdia,R(f),L(f.type),g(f))},d=function(f){return o(K.mfhd,new Uint8Array([0,0,0,0,(f&4278190080)>>24,(f&16711680)>>16,(f&65280)>>8,f&255]))},g=function(f){return o(K.minf,f.type==="video"?o(K.vmhd,de):o(K.smhd,ve),l(),B(f))},y=function(f,v){for(var S=[],b=v.length;b--;)S[b]=I(v[b]);return o.apply(null,[K.moof,d(f)].concat(S))},p=function(f){for(var v=f.length,S=[];v--;)S[v]=A(f[v]);return o.apply(null,[K.moov,k(4294967295)].concat(S).concat(_(f)))},_=function(f){for(var v=f.length,S=[];v--;)S[v]=G(f[v]);return o.apply(null,[K.mvex].concat(S))},k=function(f){var v=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,2,0,1,95,144,(f&4278190080)>>24,(f&16711680)>>16,(f&65280)>>8,f&255,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255]);return o(K.mvhd,v)},F=function(f){var v=f.samples||[],S=new Uint8Array(4+v.length),b,w;for(w=0;w<v.length;w++)b=v[w].flags,S[w+4]=b.dependsOn<<4|b.isDependedOn<<2|b.hasRedundancy;return o(K.sdtp,S)},B=function(f){return o(K.stbl,C(f),o(K.stts,Ye),o(K.stsc,Me),o(K.stsz,Ne),o(K.stco,De))},function(){var f,v;C=function(S){return o(K.stsd,new Uint8Array([0,0,0,0,0,0,0,1]),S.type==="video"?f(S):v(S))},f=function(S){var b=S.sps||[],w=S.pps||[],D=[],W=[],X,Y;for(X=0;X<b.length;X++)D.push((b[X].byteLength&65280)>>>8),D.push(b[X].byteLength&255),D=D.concat(Array.prototype.slice.call(b[X]));for(X=0;X<w.length;X++)W.push((w[X].byteLength&65280)>>>8),W.push(w[X].byteLength&255),W=W.concat(Array.prototype.slice.call(w[X]));if(Y=[K.avc1,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,(S.width&65280)>>8,S.width&255,(S.height&65280)>>8,S.height&255,0,72,0,0,0,72,0,0,0,0,0,0,0,1,19,118,105,100,101,111,106,115,45,99,111,110,116,114,105,98,45,104,108,115,0,0,0,0,0,0,0,0,0,0,0,0,0,24,17,17]),o(K.avcC,new Uint8Array([1,S.profileIdc,S.profileCompatibility,S.levelIdc,255].concat([b.length],D,[w.length],W))),o(K.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192]))],S.sarRatio){var J=S.sarRatio[0],le=S.sarRatio[1];Y.push(o(K.pasp,new Uint8Array([(J&4278190080)>>24,(J&16711680)>>16,(J&65280)>>8,J&255,(le&4278190080)>>24,(le&16711680)>>16,(le&65280)>>8,le&255])))}return o.apply(null,Y)},v=function(S){return o(K.mp4a,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,(S.channelcount&65280)>>8,S.channelcount&255,(S.samplesize&65280)>>8,S.samplesize&255,0,0,0,0,(S.samplerate&65280)>>8,S.samplerate&255,0,0]),u(S))}}(),N=function(f){var v=new Uint8Array([0,0,0,7,0,0,0,0,0,0,0,0,(f.id&4278190080)>>24,(f.id&16711680)>>16,(f.id&65280)>>8,f.id&255,0,0,0,0,(f.duration&4278190080)>>24,(f.duration&16711680)>>16,(f.duration&65280)>>8,f.duration&255,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,(f.width&65280)>>8,f.width&255,0,0,(f.height&65280)>>8,f.height&255,0,0]);return o(K.tkhd,v)},I=function(f){var v,S,b,w,D,W,X;return v=o(K.tfhd,new Uint8Array([0,0,0,58,(f.id&4278190080)>>24,(f.id&16711680)>>16,(f.id&65280)>>8,f.id&255,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0])),W=Math.floor(f.baseMediaDecodeTime/a),X=Math.floor(f.baseMediaDecodeTime%a),S=o(K.tfdt,new Uint8Array([1,0,0,0,W>>>24&255,W>>>16&255,W>>>8&255,W&255,X>>>24&255,X>>>16&255,X>>>8&255,X&255])),D=92,f.type==="audio"?(b=H(f,D),o(K.traf,v,S,b)):(w=F(f),b=H(f,w.length+D),o(K.traf,v,S,b,w))},A=function(f){return f.duration=f.duration||4294967295,o(K.trak,N(f),$(f))},G=function(f){var v=new Uint8Array([0,0,0,0,(f.id&4278190080)>>24,(f.id&16711680)>>16,(f.id&65280)>>8,f.id&255,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]);return f.type!=="video"&&(v[v.length-1]=0),o(K.trex,v)},function(){var f,v,S;S=function(b,w){var D=0,W=0,X=0,Y=0;return b.length&&(b[0].duration!==void 0&&(D=1),b[0].size!==void 0&&(W=2),b[0].flags!==void 0&&(X=4),b[0].compositionTimeOffset!==void 0&&(Y=8)),[0,0,D|W|X|Y,1,(b.length&4278190080)>>>24,(b.length&16711680)>>>16,(b.length&65280)>>>8,b.length&255,(w&4278190080)>>>24,(w&16711680)>>>16,(w&65280)>>>8,w&255]},v=function(b,w){var D,W,X,Y,J,le;for(Y=b.samples||[],w+=20+16*Y.length,X=S(Y,w),W=new Uint8Array(X.length+Y.length*16),W.set(X),D=X.length,le=0;le<Y.length;le++)J=Y[le],W[D++]=(J.duration&4278190080)>>>24,W[D++]=(J.duration&16711680)>>>16,W[D++]=(J.duration&65280)>>>8,W[D++]=J.duration&255,W[D++]=(J.size&4278190080)>>>24,W[D++]=(J.size&16711680)>>>16,W[D++]=(J.size&65280)>>>8,W[D++]=J.size&255,W[D++]=J.flags.isLeading<<2|J.flags.dependsOn,W[D++]=J.flags.isDependedOn<<6|J.flags.hasRedundancy<<4|J.flags.paddingValue<<1|J.flags.isNonSyncSample,W[D++]=J.flags.degradationPriority&61440,W[D++]=J.flags.degradationPriority&15,W[D++]=(J.compositionTimeOffset&4278190080)>>>24,W[D++]=(J.compositionTimeOffset&16711680)>>>16,W[D++]=(J.compositionTimeOffset&65280)>>>8,W[D++]=J.compositionTimeOffset&255;return o(K.trun,W)},f=function(b,w){var D,W,X,Y,J,le;for(Y=b.samples||[],w+=20+8*Y.length,X=S(Y,w),D=new Uint8Array(X.length+Y.length*8),D.set(X),W=X.length,le=0;le<Y.length;le++)J=Y[le],D[W++]=(J.duration&4278190080)>>>24,D[W++]=(J.duration&16711680)>>>16,D[W++]=(J.duration&65280)>>>8,D[W++]=J.duration&255,D[W++]=(J.size&4278190080)>>>24,D[W++]=(J.size&16711680)>>>16,D[W++]=(J.size&65280)>>>8,D[W++]=J.size&255;return o(K.trun,D)},H=function(b,w){return b.type==="audio"?f(b,w):v(b,w)}}();var Re={ftyp:c,mdat:h,moof:y,moov:p,initSegment:function(f){var v=c(),S=p(f),b;return b=new Uint8Array(v.byteLength+S.byteLength),b.set(v),b.set(S,v.byteLength),b}},Oe=function(f){var v,S,b=[],w=[];for(w.byteLength=0,w.nalCount=0,w.duration=0,b.byteLength=0,v=0;v<f.length;v++)S=f[v],S.nalUnitType==="access_unit_delimiter_rbsp"?(b.length&&(b.duration=S.dts-b.dts,w.byteLength+=b.byteLength,w.nalCount+=b.length,w.duration+=b.duration,w.push(b)),b=[S],b.byteLength=S.data.byteLength,b.pts=S.pts,b.dts=S.dts):(S.nalUnitType==="slice_layer_without_partitioning_rbsp_idr"&&(b.keyFrame=!0),b.duration=S.dts-b.dts,b.byteLength+=S.data.byteLength,b.push(S));return w.length&&(!b.duration||b.duration<=0)&&(b.duration=w[w.length-1].duration),w.byteLength+=b.byteLength,w.nalCount+=b.length,w.duration+=b.duration,w.push(b),w},Ve=function(f){var v,S,b=[],w=[];for(b.byteLength=0,b.nalCount=0,b.duration=0,b.pts=f[0].pts,b.dts=f[0].dts,w.byteLength=0,w.nalCount=0,w.duration=0,w.pts=f[0].pts,w.dts=f[0].dts,v=0;v<f.length;v++)S=f[v],S.keyFrame?(b.length&&(w.push(b),w.byteLength+=b.byteLength,w.nalCount+=b.nalCount,w.duration+=b.duration),b=[S],b.nalCount=S.length,b.byteLength=S.byteLength,b.pts=S.pts,b.dts=S.dts,b.duration=S.duration):(b.duration+=S.duration,b.nalCount+=S.length,b.byteLength+=S.byteLength,b.push(S));return w.length&&b.duration<=0&&(b.duration=w[w.length-1].duration),w.byteLength+=b.byteLength,w.nalCount+=b.nalCount,w.duration+=b.duration,w.push(b),w},nt=function(f){var v;return!f[0][0].keyFrame&&f.length>1&&(v=f.shift(),f.byteLength-=v.byteLength,f.nalCount-=v.nalCount,f[0][0].dts=v.dts,f[0][0].pts=v.pts,f[0][0].duration+=v.duration),f},_t=function(){return{size:0,flags:{isLeading:0,dependsOn:1,isDependedOn:0,hasRedundancy:0,degradationPriority:0,isNonSyncSample:1}}},Nt=function(f,v){var S=_t();return S.dataOffset=v,S.compositionTimeOffset=f.pts-f.dts,S.duration=f.duration,S.size=4*f.length,S.size+=f.byteLength,f.keyFrame&&(S.flags.dependsOn=2,S.flags.isNonSyncSample=0),S},Mi=function(f,v){var S,b,w,D,W,X=v||0,Y=[];for(S=0;S<f.length;S++)for(D=f[S],b=0;b<D.length;b++)W=D[b],w=Nt(W,X),X+=w.size,Y.push(w);return Y},Ft=function(f){var v,S,b,w,D,W,X=0,Y=f.byteLength,J=f.nalCount,le=Y+4*J,me=new Uint8Array(le),Ae=new DataView(me.buffer);for(v=0;v<f.length;v++)for(w=f[v],S=0;S<w.length;S++)for(D=w[S],b=0;b<D.length;b++)W=D[b],Ae.setUint32(X,W.data.byteLength),X+=4,me.set(W.data,X),X+=W.data.byteLength;return me},zi=function(f,v){var S,b=v||0,w=[];return S=Nt(f,b),w.push(S),w},Te=function(f){var v,S,b=0,w=f.byteLength,D=f.length,W=w+4*D,X=new Uint8Array(W),Y=new DataView(X.buffer);for(v=0;v<f.length;v++)S=f[v],Y.setUint32(b,S.data.byteLength),b+=4,X.set(S.data,b),b+=S.data.byteLength;return X},Ee={groupNalsIntoFrames:Oe,groupFramesIntoGops:Ve,extendFirstKeyFrame:nt,generateSampleTable:Mi,concatenateNalData:Ft,generateSampleTableForFrame:zi,concatenateNalDataForFrame:Te},Be=[33,16,5,32,164,27],Fe=[33,65,108,84,1,2,4,8,168,2,4,8,17,191,252],Xe=function(f){for(var v=[];f--;)v.push(0);return v},Je=function(f){return Object.keys(f).reduce(function(v,S){return v[S]=new Uint8Array(f[S].reduce(function(b,w){return b.concat(w)},[])),v},{})},Tt,Wi=function(){if(!Tt){var f={96e3:[Be,[227,64],Xe(154),[56]],88200:[Be,[231],Xe(170),[56]],64e3:[Be,[248,192],Xe(240),[56]],48e3:[Be,[255,192],Xe(268),[55,148,128],Xe(54),[112]],44100:[Be,[255,192],Xe(268),[55,163,128],Xe(84),[112]],32e3:[Be,[255,192],Xe(268),[55,234],Xe(226),[112]],24e3:[Be,[255,192],Xe(268),[55,255,128],Xe(268),[111,112],Xe(126),[224]],16e3:[Be,[255,192],Xe(268),[55,255,128],Xe(268),[111,255],Xe(269),[223,108],Xe(195),[1,192]],12e3:[Fe,Xe(268),[3,127,248],Xe(268),[6,255,240],Xe(268),[13,255,224],Xe(268),[27,253,128],Xe(259),[56]],11025:[Fe,Xe(268),[3,127,248],Xe(268),[6,255,240],Xe(268),[13,255,224],Xe(268),[27,255,192],Xe(268),[55,175,128],Xe(108),[112]],8e3:[Fe,Xe(268),[3,121,16],Xe(47),[7]]};Tt=Je(f)}return Tt},Sr=9e4,xr,cr,Gi,un,Fn,cn,Ze;xr=function(f){return f*Sr},cr=function(f,v){return f*v},Gi=function(f){return f/Sr},un=function(f,v){return f/v},Fn=function(f,v){return xr(un(f,v))},cn=function(f,v){return cr(Gi(f),v)},Ze=function(f,v,S){return Gi(S?f:f-v)};var st={ONE_SECOND_IN_TS:Sr,secondsToVideoTs:xr,secondsToAudioTs:cr,videoTsToSeconds:Gi,audioTsToSeconds:un,audioTsToVideoTs:Fn,videoTsToAudioTs:cn,metadataTsToSeconds:Ze},ha=Wi,hn=st,da=function(f){var v,S,b=0;for(v=0;v<f.length;v++)S=f[v],b+=S.data.byteLength;return b},ps=function(f,v,S,b){var w,D=0,W=0,X=0,Y=0,J,le,me;if(v.length&&(w=hn.audioTsToVideoTs(f.baseMediaDecodeTime,f.samplerate),D=Math.ceil(hn.ONE_SECOND_IN_TS/(f.samplerate/1024)),S&&b&&(W=w-Math.max(S,b),X=Math.floor(W/D),Y=X*D),!(X<1||Y>hn.ONE_SECOND_IN_TS/2))){for(J=ha()[f.samplerate],J||(J=v[0].data),le=0;le<X;le++)me=v[0],v.splice(0,0,{data:J,dts:me.dts-D,pts:me.pts-D});return f.baseMediaDecodeTime-=Math.floor(hn.videoTsToAudioTs(Y,f.samplerate)),Y}},Ki=function(f,v,S){return v.minSegmentDts>=S?f:(v.minSegmentDts=1/0,f.filter(function(b){return b.dts>=S?(v.minSegmentDts=Math.min(v.minSegmentDts,b.dts),v.minSegmentPts=v.minSegmentDts,!0):!1}))},fa=function(f){var v,S,b=[];for(v=0;v<f.length;v++)S=f[v],b.push({size:S.data.byteLength,duration:1024});return b},ms=function(f){var v,S,b=0,w=new Uint8Array(da(f));for(v=0;v<f.length;v++)S=f[v],w.set(S.data,b),b+=S.data.byteLength;return w},pa={prefixWithSilence:ps,trimAdtsFramesByEarliestDts:Ki,generateSampleTable:fa,concatenateFrameData:ms},q=st.ONE_SECOND_IN_TS,V=function(f,v){typeof v.pts=="number"&&(f.timelineStartInfo.pts===void 0&&(f.timelineStartInfo.pts=v.pts),f.minSegmentPts===void 0?f.minSegmentPts=v.pts:f.minSegmentPts=Math.min(f.minSegmentPts,v.pts),f.maxSegmentPts===void 0?f.maxSegmentPts=v.pts:f.maxSegmentPts=Math.max(f.maxSegmentPts,v.pts)),typeof v.dts=="number"&&(f.timelineStartInfo.dts===void 0&&(f.timelineStartInfo.dts=v.dts),f.minSegmentDts===void 0?f.minSegmentDts=v.dts:f.minSegmentDts=Math.min(f.minSegmentDts,v.dts),f.maxSegmentDts===void 0?f.maxSegmentDts=v.dts:f.maxSegmentDts=Math.max(f.maxSegmentDts,v.dts))},ee=function(f){delete f.minSegmentDts,delete f.maxSegmentDts,delete f.minSegmentPts,delete f.maxSegmentPts},pe=function(f,v){var S,b,w=f.minSegmentDts;return v||(w-=f.timelineStartInfo.dts),S=f.timelineStartInfo.baseMediaDecodeTime,S+=w,S=Math.max(0,S),f.type==="audio"&&(b=f.samplerate/q,S*=b,S=Math.floor(S)),S},we={clearDtsInfo:ee,calculateTrackBaseMediaDecodeTime:pe,collectDtsInfo:V},qe=4,ut=128,Yt=function(f){for(var v=0,S={payloadType:-1,payloadSize:0},b=0,w=0;v<f.byteLength&&f[v]!==ut;){for(;f[v]===255;)b+=255,v++;for(b+=f[v++];f[v]===255;)w+=255,v++;if(w+=f[v++],!S.payload&&b===qe){var D=String.fromCharCode(f[v+3],f[v+4],f[v+5],f[v+6]);if(D==="GA94"){S.payloadType=b,S.payloadSize=w,S.payload=f.subarray(v,v+w);break}else S.payload=void 0}v+=w,b=0,w=0}return S},oi=function(f){return f.payload[0]!==181||(f.payload[1]<<8|f.payload[2])!==49||String.fromCharCode(f.payload[3],f.payload[4],f.payload[5],f.payload[6])!=="GA94"||f.payload[7]!==3?null:f.payload.subarray(8,f.payload.length-1)},kt=function(f,v){var S=[],b,w,D,W;if(!(v[0]&64))return S;for(w=v[0]&31,b=0;b<w;b++)D=b*3,W={type:v[D+2]&3,pts:f},v[D+2]&4&&(W.ccData=v[D+3]<<8|v[D+4],S.push(W));return S},Xi=function(f){for(var v=f.byteLength,S=[],b=1,w,D;b<v-2;)f[b]===0&&f[b+1]===0&&f[b+2]===3?(S.push(b+2),b+=2):b++;if(S.length===0)return f;w=v-S.length,D=new Uint8Array(w);var W=0;for(b=0;b<w;W++,b++)W===S[0]&&(W++,S.shift()),D[b]=f[W];return D},hr={parseSei:Yt,parseUserData:oi,parseCaptionPackets:kt,discardEmulationPreventionBytes:Xi,USER_DATA_REGISTERED_ITU_T_T35:qe},pi=t,Bt=hr,ot=function(f){f=f||{},ot.prototype.init.call(this),this.parse708captions_=typeof f.parse708captions=="boolean"?f.parse708captions:!0,this.captionPackets_=[],this.ccStreams_=[new pt(0,0),new pt(0,1),new pt(1,0),new pt(1,1)],this.parse708captions_&&(this.cc708Stream_=new tt({captionServices:f.captionServices})),this.reset(),this.ccStreams_.forEach(function(v){v.on("data",this.trigger.bind(this,"data")),v.on("partialdone",this.trigger.bind(this,"partialdone")),v.on("done",this.trigger.bind(this,"done"))},this),this.parse708captions_&&(this.cc708Stream_.on("data",this.trigger.bind(this,"data")),this.cc708Stream_.on("partialdone",this.trigger.bind(this,"partialdone")),this.cc708Stream_.on("done",this.trigger.bind(this,"done")))};ot.prototype=new pi,ot.prototype.push=function(f){var v,S,b;if(f.nalUnitType==="sei_rbsp"&&(v=Bt.parseSei(f.escapedRBSP),!!v.payload&&v.payloadType===Bt.USER_DATA_REGISTERED_ITU_T_T35&&(S=Bt.parseUserData(v),!!S))){if(f.dts<this.latestDts_){this.ignoreNextEqualDts_=!0;return}else if(f.dts===this.latestDts_&&this.ignoreNextEqualDts_){this.numSameDts_--,this.numSameDts_||(this.ignoreNextEqualDts_=!1);return}b=Bt.parseCaptionPackets(f.pts,S),this.captionPackets_=this.captionPackets_.concat(b),this.latestDts_!==f.dts&&(this.numSameDts_=0),this.numSameDts_++,this.latestDts_=f.dts}},ot.prototype.flushCCStreams=function(f){this.ccStreams_.forEach(function(v){return f==="flush"?v.flush():v.partialFlush()},this)},ot.prototype.flushStream=function(f){if(!this.captionPackets_.length){this.flushCCStreams(f);return}this.captionPackets_.forEach(function(v,S){v.presortIndex=S}),this.captionPackets_.sort(function(v,S){return v.pts===S.pts?v.presortIndex-S.presortIndex:v.pts-S.pts}),this.captionPackets_.forEach(function(v){v.type<2?this.dispatchCea608Packet(v):this.dispatchCea708Packet(v)},this),this.captionPackets_.length=0,this.flushCCStreams(f)},ot.prototype.flush=function(){return this.flushStream("flush")},ot.prototype.partialFlush=function(){return this.flushStream("partialFlush")},ot.prototype.reset=function(){this.latestDts_=null,this.ignoreNextEqualDts_=!1,this.numSameDts_=0,this.activeCea608Channel_=[null,null],this.ccStreams_.forEach(function(f){f.reset()})},ot.prototype.dispatchCea608Packet=function(f){this.setsTextOrXDSActive(f)?this.activeCea608Channel_[f.type]=null:this.setsChannel1Active(f)?this.activeCea608Channel_[f.type]=0:this.setsChannel2Active(f)&&(this.activeCea608Channel_[f.type]=1),this.activeCea608Channel_[f.type]!==null&&this.ccStreams_[(f.type<<1)+this.activeCea608Channel_[f.type]].push(f)},ot.prototype.setsChannel1Active=function(f){return(f.ccData&30720)===4096},ot.prototype.setsChannel2Active=function(f){return(f.ccData&30720)===6144},ot.prototype.setsTextOrXDSActive=function(f){return(f.ccData&28928)===256||(f.ccData&30974)===4138||(f.ccData&30974)===6186},ot.prototype.dispatchCea708Packet=function(f){this.parse708captions_&&this.cc708Stream_.push(f)};var it={127:9834,4128:32,4129:160,4133:8230,4138:352,4140:338,4144:9608,4145:8216,4146:8217,4147:8220,4148:8221,4149:8226,4153:8482,4154:353,4156:339,4157:8480,4159:376,4214:8539,4215:8540,4216:8541,4217:8542,4218:9168,4219:9124,4220:9123,4221:9135,4222:9126,4223:9121,4256:12600},dn=function(f){var v=it[f]||f;return f&4096&&f===v?"":String.fromCharCode(v)},bt=function(f){return 32<=f&&f<=127||160<=f&&f<=255},li=function(f){this.windowNum=f,this.reset()};li.prototype.reset=function(){this.clearText(),this.pendingNewLine=!1,this.winAttr={},this.penAttr={},this.penLoc={},this.penColor={},this.visible=0,this.rowLock=0,this.columnLock=0,this.priority=0,this.relativePositioning=0,this.anchorVertical=0,this.anchorHorizontal=0,this.anchorPoint=0,this.rowCount=1,this.virtualRowCount=this.rowCount+1,this.columnCount=41,this.windowStyle=0,this.penStyle=0},li.prototype.getText=function(){return this.rows.join(`
202
- `)},li.prototype.clearText=function(){this.rows=[""],this.rowIdx=0},li.prototype.newLine=function(f){for(this.rows.length>=this.virtualRowCount&&typeof this.beforeRowOverflow=="function"&&this.beforeRowOverflow(f),this.rows.length>0&&(this.rows.push(""),this.rowIdx++);this.rows.length>this.virtualRowCount;)this.rows.shift(),this.rowIdx--},li.prototype.isEmpty=function(){return this.rows.length===0?!0:this.rows.length===1?this.rows[0]==="":!1},li.prototype.addText=function(f){this.rows[this.rowIdx]+=f},li.prototype.backspace=function(){if(!this.isEmpty()){var f=this.rows[this.rowIdx];this.rows[this.rowIdx]=f.substr(0,f.length-1)}};var Qi=function(f,v,S){this.serviceNum=f,this.text="",this.currentWindow=new li(-1),this.windows=[],this.stream=S,typeof v=="string"&&this.createTextDecoder(v)};Qi.prototype.init=function(f,v){this.startPts=f;for(var S=0;S<8;S++)this.windows[S]=new li(S),typeof v=="function"&&(this.windows[S].beforeRowOverflow=v)},Qi.prototype.setCurrentWindow=function(f){this.currentWindow=this.windows[f]},Qi.prototype.createTextDecoder=function(f){if(typeof TextDecoder>"u")this.stream.trigger("log",{level:"warn",message:"The `encoding` option is unsupported without TextDecoder support"});else try{this.textDecoder_=new TextDecoder(f)}catch(v){this.stream.trigger("log",{level:"warn",message:"TextDecoder could not be created with "+f+" encoding. "+v})}};var tt=function(f){f=f||{},tt.prototype.init.call(this);var v=this,S=f.captionServices||{},b={},w;Object.keys(S).forEach(D=>{w=S[D],/^SERVICE/.test(D)&&(b[D]=w.encoding)}),this.serviceEncodings=b,this.current708Packet=null,this.services={},this.push=function(D){D.type===3?(v.new708Packet(),v.add708Bytes(D)):(v.current708Packet===null&&v.new708Packet(),v.add708Bytes(D))}};tt.prototype=new pi,tt.prototype.new708Packet=function(){this.current708Packet!==null&&this.push708Packet(),this.current708Packet={data:[],ptsVals:[]}},tt.prototype.add708Bytes=function(f){var v=f.ccData,S=v>>>8,b=v&255;this.current708Packet.ptsVals.push(f.pts),this.current708Packet.data.push(S),this.current708Packet.data.push(b)},tt.prototype.push708Packet=function(){var f=this.current708Packet,v=f.data,S=null,b=null,w=0,D=v[w++];for(f.seq=D>>6,f.sizeCode=D&63;w<v.length;w++)D=v[w++],S=D>>5,b=D&31,S===7&&b>0&&(D=v[w++],S=D),this.pushServiceBlock(S,w,b),b>0&&(w+=b-1)},tt.prototype.pushServiceBlock=function(f,v,S){var b,w=v,D=this.current708Packet.data,W=this.services[f];for(W||(W=this.initService(f,w));w<v+S&&w<D.length;w++)b=D[w],bt(b)?w=this.handleText(w,W):b===24?w=this.multiByteCharacter(w,W):b===16?w=this.extendedCommands(w,W):128<=b&&b<=135?w=this.setCurrentWindow(w,W):152<=b&&b<=159?w=this.defineWindow(w,W):b===136?w=this.clearWindows(w,W):b===140?w=this.deleteWindows(w,W):b===137?w=this.displayWindows(w,W):b===138?w=this.hideWindows(w,W):b===139?w=this.toggleWindows(w,W):b===151?w=this.setWindowAttributes(w,W):b===144?w=this.setPenAttributes(w,W):b===145?w=this.setPenColor(w,W):b===146?w=this.setPenLocation(w,W):b===143?W=this.reset(w,W):b===8?W.currentWindow.backspace():b===12?W.currentWindow.clearText():b===13?W.currentWindow.pendingNewLine=!0:b===14?W.currentWindow.clearText():b===141&&w++},tt.prototype.extendedCommands=function(f,v){var S=this.current708Packet.data,b=S[++f];return bt(b)&&(f=this.handleText(f,v,{isExtended:!0})),f},tt.prototype.getPts=function(f){return this.current708Packet.ptsVals[Math.floor(f/2)]},tt.prototype.initService=function(f,v){var b="SERVICE"+f,S=this,b,w;return b in this.serviceEncodings&&(w=this.serviceEncodings[b]),this.services[f]=new Qi(f,w,S),this.services[f].init(this.getPts(v),function(D){S.flushDisplayed(D,S.services[f])}),this.services[f]},tt.prototype.handleText=function(f,v,S){var b=S&&S.isExtended,w=S&&S.isMultiByte,D=this.current708Packet.data,W=b?4096:0,X=D[f],Y=D[f+1],J=v.currentWindow,le,me;function Ae(ye){return ye.map(Ue=>("0"+(Ue&255).toString(16)).slice(-2)).join("")}if(w?(me=[X,Y],f++):me=[X],v.textDecoder_&&!b)le=v.textDecoder_.decode(new Uint8Array(me));else if(w){const ye=Ae(me);le=String.fromCharCode(parseInt(ye,16))}else le=dn(W|X);return J.pendingNewLine&&!J.isEmpty()&&J.newLine(this.getPts(f)),J.pendingNewLine=!1,J.addText(le),f},tt.prototype.multiByteCharacter=function(f,v){var S=this.current708Packet.data,b=S[f+1],w=S[f+2];return bt(b)&&bt(w)&&(f=this.handleText(++f,v,{isMultiByte:!0})),f},tt.prototype.setCurrentWindow=function(f,v){var S=this.current708Packet.data,b=S[f],w=b&7;return v.setCurrentWindow(w),f},tt.prototype.defineWindow=function(f,v){var S=this.current708Packet.data,b=S[f],w=b&7;v.setCurrentWindow(w);var D=v.currentWindow;return b=S[++f],D.visible=(b&32)>>5,D.rowLock=(b&16)>>4,D.columnLock=(b&8)>>3,D.priority=b&7,b=S[++f],D.relativePositioning=(b&128)>>7,D.anchorVertical=b&127,b=S[++f],D.anchorHorizontal=b,b=S[++f],D.anchorPoint=(b&240)>>4,D.rowCount=b&15,b=S[++f],D.columnCount=b&63,b=S[++f],D.windowStyle=(b&56)>>3,D.penStyle=b&7,D.virtualRowCount=D.rowCount+1,f},tt.prototype.setWindowAttributes=function(f,v){var S=this.current708Packet.data,b=S[f],w=v.currentWindow.winAttr;return b=S[++f],w.fillOpacity=(b&192)>>6,w.fillRed=(b&48)>>4,w.fillGreen=(b&12)>>2,w.fillBlue=b&3,b=S[++f],w.borderType=(b&192)>>6,w.borderRed=(b&48)>>4,w.borderGreen=(b&12)>>2,w.borderBlue=b&3,b=S[++f],w.borderType+=(b&128)>>5,w.wordWrap=(b&64)>>6,w.printDirection=(b&48)>>4,w.scrollDirection=(b&12)>>2,w.justify=b&3,b=S[++f],w.effectSpeed=(b&240)>>4,w.effectDirection=(b&12)>>2,w.displayEffect=b&3,f},tt.prototype.flushDisplayed=function(f,v){for(var S=[],b=0;b<8;b++)v.windows[b].visible&&!v.windows[b].isEmpty()&&S.push(v.windows[b].getText());v.endPts=f,v.text=S.join(`
203
-
204
- `),this.pushCaption(v),v.startPts=f},tt.prototype.pushCaption=function(f){f.text!==""&&(this.trigger("data",{startPts:f.startPts,endPts:f.endPts,text:f.text,stream:"cc708_"+f.serviceNum}),f.text="",f.startPts=f.endPts)},tt.prototype.displayWindows=function(f,v){var S=this.current708Packet.data,b=S[++f],w=this.getPts(f);this.flushDisplayed(w,v);for(var D=0;D<8;D++)b&1<<D&&(v.windows[D].visible=1);return f},tt.prototype.hideWindows=function(f,v){var S=this.current708Packet.data,b=S[++f],w=this.getPts(f);this.flushDisplayed(w,v);for(var D=0;D<8;D++)b&1<<D&&(v.windows[D].visible=0);return f},tt.prototype.toggleWindows=function(f,v){var S=this.current708Packet.data,b=S[++f],w=this.getPts(f);this.flushDisplayed(w,v);for(var D=0;D<8;D++)b&1<<D&&(v.windows[D].visible^=1);return f},tt.prototype.clearWindows=function(f,v){var S=this.current708Packet.data,b=S[++f],w=this.getPts(f);this.flushDisplayed(w,v);for(var D=0;D<8;D++)b&1<<D&&v.windows[D].clearText();return f},tt.prototype.deleteWindows=function(f,v){var S=this.current708Packet.data,b=S[++f],w=this.getPts(f);this.flushDisplayed(w,v);for(var D=0;D<8;D++)b&1<<D&&v.windows[D].reset();return f},tt.prototype.setPenAttributes=function(f,v){var S=this.current708Packet.data,b=S[f],w=v.currentWindow.penAttr;return b=S[++f],w.textTag=(b&240)>>4,w.offset=(b&12)>>2,w.penSize=b&3,b=S[++f],w.italics=(b&128)>>7,w.underline=(b&64)>>6,w.edgeType=(b&56)>>3,w.fontStyle=b&7,f},tt.prototype.setPenColor=function(f,v){var S=this.current708Packet.data,b=S[f],w=v.currentWindow.penColor;return b=S[++f],w.fgOpacity=(b&192)>>6,w.fgRed=(b&48)>>4,w.fgGreen=(b&12)>>2,w.fgBlue=b&3,b=S[++f],w.bgOpacity=(b&192)>>6,w.bgRed=(b&48)>>4,w.bgGreen=(b&12)>>2,w.bgBlue=b&3,b=S[++f],w.edgeRed=(b&48)>>4,w.edgeGreen=(b&12)>>2,w.edgeBlue=b&3,f},tt.prototype.setPenLocation=function(f,v){var S=this.current708Packet.data,b=S[f],w=v.currentWindow.penLoc;return v.currentWindow.pendingNewLine=!0,b=S[++f],w.row=b&15,b=S[++f],w.column=b&63,f},tt.prototype.reset=function(f,v){var S=this.getPts(f);return this.flushDisplayed(S,v),this.initService(v.serviceNum,f)};var xt={42:225,92:233,94:237,95:243,96:250,123:231,124:247,125:209,126:241,127:9608,304:174,305:176,306:189,307:191,308:8482,309:162,310:163,311:9834,312:224,313:160,314:232,315:226,316:234,317:238,318:244,319:251,544:193,545:201,546:211,547:218,548:220,549:252,550:8216,551:161,552:42,553:39,554:8212,555:169,556:8480,557:8226,558:8220,559:8221,560:192,561:194,562:199,563:200,564:202,565:203,566:235,567:206,568:207,569:239,570:212,571:217,572:249,573:219,574:171,575:187,800:195,801:227,802:205,803:204,804:236,805:210,806:242,807:213,808:245,809:123,810:125,811:92,812:94,813:95,814:124,815:126,816:196,817:228,818:214,819:246,820:223,821:165,822:164,823:9474,824:197,825:229,826:216,827:248,828:9484,829:9488,830:9492,831:9496},fn=function(f){return f===null?"":(f=xt[f]||f,String.fromCharCode(f))},Ut=14,wd=[4352,4384,4608,4640,5376,5408,5632,5664,5888,5920,4096,4864,4896,5120,5152],pn=function(){for(var f=[],v=Ut+1;v--;)f.push({text:"",indent:0,offset:0});return f},pt=function(f,v){pt.prototype.init.call(this),this.field_=f||0,this.dataChannel_=v||0,this.name_="CC"+((this.field_<<1|this.dataChannel_)+1),this.setConstants(),this.reset(),this.push=function(S){var b,w,D,W,X;if(b=S.ccData&32639,b===this.lastControlCode_){this.lastControlCode_=null;return}if((b&61440)===4096?this.lastControlCode_=b:b!==this.PADDING_&&(this.lastControlCode_=null),D=b>>>8,W=b&255,b!==this.PADDING_)if(b===this.RESUME_CAPTION_LOADING_)this.mode_="popOn";else if(b===this.END_OF_CAPTION_)this.mode_="popOn",this.clearFormatting(S.pts),this.flushDisplayed(S.pts),w=this.displayed_,this.displayed_=this.nonDisplayed_,this.nonDisplayed_=w,this.startPts_=S.pts;else if(b===this.ROLL_UP_2_ROWS_)this.rollUpRows_=2,this.setRollUp(S.pts);else if(b===this.ROLL_UP_3_ROWS_)this.rollUpRows_=3,this.setRollUp(S.pts);else if(b===this.ROLL_UP_4_ROWS_)this.rollUpRows_=4,this.setRollUp(S.pts);else if(b===this.CARRIAGE_RETURN_)this.clearFormatting(S.pts),this.flushDisplayed(S.pts),this.shiftRowsUp_(),this.startPts_=S.pts;else if(b===this.BACKSPACE_)this.mode_==="popOn"?this.nonDisplayed_[this.row_].text=this.nonDisplayed_[this.row_].text.slice(0,-1):this.displayed_[this.row_].text=this.displayed_[this.row_].text.slice(0,-1);else if(b===this.ERASE_DISPLAYED_MEMORY_)this.flushDisplayed(S.pts),this.displayed_=pn();else if(b===this.ERASE_NON_DISPLAYED_MEMORY_)this.nonDisplayed_=pn();else if(b===this.RESUME_DIRECT_CAPTIONING_)this.mode_!=="paintOn"&&(this.flushDisplayed(S.pts),this.displayed_=pn()),this.mode_="paintOn",this.startPts_=S.pts;else if(this.isSpecialCharacter(D,W))D=(D&3)<<8,X=fn(D|W),this[this.mode_](S.pts,X),this.column_++;else if(this.isExtCharacter(D,W))this.mode_==="popOn"?this.nonDisplayed_[this.row_].text=this.nonDisplayed_[this.row_].text.slice(0,-1):this.displayed_[this.row_].text=this.displayed_[this.row_].text.slice(0,-1),D=(D&3)<<8,X=fn(D|W),this[this.mode_](S.pts,X),this.column_++;else if(this.isMidRowCode(D,W))this.clearFormatting(S.pts),this[this.mode_](S.pts," "),this.column_++,(W&14)===14&&this.addFormatting(S.pts,["i"]),(W&1)===1&&this.addFormatting(S.pts,["u"]);else if(this.isOffsetControlCode(D,W)){const J=W&3;this.nonDisplayed_[this.row_].offset=J,this.column_+=J}else if(this.isPAC(D,W)){var Y=wd.indexOf(b&7968);if(this.mode_==="rollUp"&&(Y-this.rollUpRows_+1<0&&(Y=this.rollUpRows_-1),this.setRollUp(S.pts,Y)),Y!==this.row_&&Y>=0&&Y<=14&&(this.clearFormatting(S.pts),this.row_=Y),W&1&&this.formatting_.indexOf("u")===-1&&this.addFormatting(S.pts,["u"]),(b&16)===16){const J=(b&14)>>1;this.column_=J*4,this.nonDisplayed_[this.row_].indent+=J}this.isColorPAC(W)&&(W&14)===14&&this.addFormatting(S.pts,["i"])}else this.isNormalChar(D)&&(W===0&&(W=null),X=fn(D),X+=fn(W),this[this.mode_](S.pts,X),this.column_+=X.length)}};pt.prototype=new pi,pt.prototype.flushDisplayed=function(f){const v=b=>{this.trigger("log",{level:"warn",message:"Skipping a malformed 608 caption at index "+b+"."})},S=[];this.displayed_.forEach((b,w)=>{if(b&&b.text&&b.text.length){try{b.text=b.text.trim()}catch{v(w)}b.text.length&&S.push({text:b.text,line:w+1,position:10+Math.min(70,b.indent*10)+b.offset*2.5})}else b==null&&v(w)}),S.length&&this.trigger("data",{startPts:this.startPts_,endPts:f,content:S,stream:this.name_})},pt.prototype.reset=function(){this.mode_="popOn",this.topRow_=0,this.startPts_=0,this.displayed_=pn(),this.nonDisplayed_=pn(),this.lastControlCode_=null,this.column_=0,this.row_=Ut,this.rollUpRows_=2,this.formatting_=[]},pt.prototype.setConstants=function(){this.dataChannel_===0?(this.BASE_=16,this.EXT_=17,this.CONTROL_=(20|this.field_)<<8,this.OFFSET_=23):this.dataChannel_===1&&(this.BASE_=24,this.EXT_=25,this.CONTROL_=(28|this.field_)<<8,this.OFFSET_=31),this.PADDING_=0,this.RESUME_CAPTION_LOADING_=this.CONTROL_|32,this.END_OF_CAPTION_=this.CONTROL_|47,this.ROLL_UP_2_ROWS_=this.CONTROL_|37,this.ROLL_UP_3_ROWS_=this.CONTROL_|38,this.ROLL_UP_4_ROWS_=this.CONTROL_|39,this.CARRIAGE_RETURN_=this.CONTROL_|45,this.RESUME_DIRECT_CAPTIONING_=this.CONTROL_|41,this.BACKSPACE_=this.CONTROL_|33,this.ERASE_DISPLAYED_MEMORY_=this.CONTROL_|44,this.ERASE_NON_DISPLAYED_MEMORY_=this.CONTROL_|46},pt.prototype.isSpecialCharacter=function(f,v){return f===this.EXT_&&v>=48&&v<=63},pt.prototype.isExtCharacter=function(f,v){return(f===this.EXT_+1||f===this.EXT_+2)&&v>=32&&v<=63},pt.prototype.isMidRowCode=function(f,v){return f===this.EXT_&&v>=32&&v<=47},pt.prototype.isOffsetControlCode=function(f,v){return f===this.OFFSET_&&v>=33&&v<=35},pt.prototype.isPAC=function(f,v){return f>=this.BASE_&&f<this.BASE_+8&&v>=64&&v<=127},pt.prototype.isColorPAC=function(f){return f>=64&&f<=79||f>=96&&f<=127},pt.prototype.isNormalChar=function(f){return f>=32&&f<=127},pt.prototype.setRollUp=function(f,v){if(this.mode_!=="rollUp"&&(this.row_=Ut,this.mode_="rollUp",this.flushDisplayed(f),this.nonDisplayed_=pn(),this.displayed_=pn()),v!==void 0&&v!==this.row_)for(var S=0;S<this.rollUpRows_;S++)this.displayed_[v-S]=this.displayed_[this.row_-S],this.displayed_[this.row_-S]={text:"",indent:0,offset:0};v===void 0&&(v=this.row_),this.topRow_=v-this.rollUpRows_+1},pt.prototype.addFormatting=function(f,v){this.formatting_=this.formatting_.concat(v);var S=v.reduce(function(b,w){return b+"<"+w+">"},"");this[this.mode_](f,S)},pt.prototype.clearFormatting=function(f){if(this.formatting_.length){var v=this.formatting_.reverse().reduce(function(S,b){return S+"</"+b+">"},"");this.formatting_=[],this[this.mode_](f,v)}},pt.prototype.popOn=function(f,v){var S=this.nonDisplayed_[this.row_].text;S+=v,this.nonDisplayed_[this.row_].text=S},pt.prototype.rollUp=function(f,v){var S=this.displayed_[this.row_].text;S+=v,this.displayed_[this.row_].text=S},pt.prototype.shiftRowsUp_=function(){var f;for(f=0;f<this.topRow_;f++)this.displayed_[f]={text:"",indent:0,offset:0};for(f=this.row_+1;f<Ut+1;f++)this.displayed_[f]={text:"",indent:0,offset:0};for(f=this.topRow_;f<this.row_;f++)this.displayed_[f]=this.displayed_[f+1];this.displayed_[this.row_]={text:"",indent:0,offset:0}},pt.prototype.paintOn=function(f,v){var S=this.displayed_[this.row_].text;S+=v,this.displayed_[this.row_].text=S};var ma={CaptionStream:ot,Cea608Stream:pt,Cea708Stream:tt},gs={H264_STREAM_TYPE:27,ADTS_STREAM_TYPE:15,METADATA_STREAM_TYPE:21},Cu=t,Eu=8589934592,ga=4294967296,wu="shared",Bn=function(f,v){var S=1;for(f>v&&(S=-1);Math.abs(v-f)>ga;)f+=S*Eu;return f},va=function(f){var v,S;va.prototype.init.call(this),this.type_=f||wu,this.push=function(b){if(b.type==="metadata"){this.trigger("data",b);return}this.type_!==wu&&b.type!==this.type_||(S===void 0&&(S=b.dts),b.dts=Bn(b.dts,S),b.pts=Bn(b.pts,S),v=b.dts,this.trigger("data",b))},this.flush=function(){S=v,this.trigger("done")},this.endTimeline=function(){this.flush(),this.trigger("endedtimeline")},this.discontinuity=function(){S=void 0,v=void 0},this.reset=function(){this.discontinuity(),this.trigger("reset")}};va.prototype=new Cu;var vs={TimestampRolloverStream:va,handleRollover:Bn},kd=(f,v,S)=>{if(!f)return-1;for(var b=S;b<f.length;b++)if(f[b]===v)return b;return-1},Ad={typedArrayIndexOf:kd},mn=Ad.typedArrayIndexOf,Br={Utf8:3},ys=function(f,v,S){var b,w="";for(b=v;b<S;b++)w+="%"+("00"+f[b].toString(16)).slice(-2);return w},dr=function(f,v,S){return decodeURIComponent(ys(f,v,S))},gn=function(f,v,S){return unescape(ys(f,v,S))},Un=function(f){return f[0]<<21|f[1]<<14|f[2]<<7|f[3]},vn={APIC:function(f){var v=1,S,b,w="-->";f.data[0]===Br.Utf8&&(S=mn(f.data,0,v),!(S<0)&&(f.mimeType=gn(f.data,v,S),v=S+1,f.pictureType=f.data[v],v++,b=mn(f.data,0,v),!(b<0)&&(f.description=dr(f.data,v,b),v=b+1,f.mimeType===w?f.url=gn(f.data,v,f.data.length):f.pictureData=f.data.subarray(v,f.data.length))))},"T*":function(f){f.data[0]===Br.Utf8&&(f.value=dr(f.data,1,f.data.length).replace(/\0*$/,""),f.values=f.value.split("\0"))},TXXX:function(f){var v;f.data[0]===Br.Utf8&&(v=mn(f.data,0,1),v!==-1&&(f.description=dr(f.data,1,v),f.value=dr(f.data,v+1,f.data.length).replace(/\0*$/,""),f.data=f.value))},"W*":function(f){f.url=gn(f.data,0,f.data.length).replace(/\0.*$/,"")},WXXX:function(f){var v;f.data[0]===Br.Utf8&&(v=mn(f.data,0,1),v!==-1&&(f.description=dr(f.data,1,v),f.url=gn(f.data,v+1,f.data.length).replace(/\0.*$/,"")))},PRIV:function(f){var v;for(v=0;v<f.data.length;v++)if(f.data[v]===0){f.owner=gn(f.data,0,v);break}f.privateData=f.data.subarray(v+1),f.data=f.privateData}},Cr=function(f){var v,S,b=10,w=0,D=[];if(!(f.length<10||f[0]!==73||f[1]!==68||f[2]!==51)){w=Un(f.subarray(6,10)),w+=10;var W=f[5]&64;W&&(b+=4,b+=Un(f.subarray(10,14)),w-=Un(f.subarray(16,20)));do{if(v=Un(f.subarray(b+4,b+8)),v<1)break;S=String.fromCharCode(f[b],f[b+1],f[b+2],f[b+3]);var X={id:S,data:f.subarray(b+10,b+v+10)};X.key=X.id,vn[X.id]?vn[X.id](X):X.id[0]==="T"?vn["T*"](X):X.id[0]==="W"&&vn["W*"](X),D.push(X),b+=10,b+=v}while(b<w);return D}},ku={parseId3Frames:Cr,parseSyncSafeInteger:Un,frameParsers:vn},ya=t,Au=gs,Er=ku,_s;_s=function(f){var v={descriptor:f&&f.descriptor},S=0,b=[],w=0,D;if(_s.prototype.init.call(this),this.dispatchType=Au.METADATA_STREAM_TYPE.toString(16),v.descriptor)for(D=0;D<v.descriptor.length;D++)this.dispatchType+=("00"+v.descriptor[D].toString(16)).slice(-2);this.push=function(W){var X,Y,J,le,me,Ae;if(W.type==="timed-metadata"){if(W.dataAlignmentIndicator&&(w=0,b.length=0),b.length===0&&(W.data.length<10||W.data[0]!==73||W.data[1]!==68||W.data[2]!==51)){this.trigger("log",{level:"warn",message:"Skipping unrecognized metadata packet"});return}if(b.push(W),w+=W.data.byteLength,b.length===1&&(S=Er.parseSyncSafeInteger(W.data.subarray(6,10)),S+=10),!(w<S)){for(X={data:new Uint8Array(S),frames:[],pts:b[0].pts,dts:b[0].dts},me=0;me<S;)X.data.set(b[0].data.subarray(0,S-me),me),me+=b[0].data.byteLength,w-=b[0].data.byteLength,b.shift();Y=10,X.data[5]&64&&(Y+=4,Y+=Er.parseSyncSafeInteger(X.data.subarray(10,14)),S-=Er.parseSyncSafeInteger(X.data.subarray(16,20)));do{if(J=Er.parseSyncSafeInteger(X.data.subarray(Y+4,Y+8)),J<1){this.trigger("log",{level:"warn",message:"Malformed ID3 frame encountered. Skipping remaining metadata parsing."});break}if(Ae=String.fromCharCode(X.data[Y],X.data[Y+1],X.data[Y+2],X.data[Y+3]),le={id:Ae,data:X.data.subarray(Y+10,Y+J+10)},le.key=le.id,Er.frameParsers[le.id]?Er.frameParsers[le.id](le):le.id[0]==="T"?Er.frameParsers["T*"](le):le.id[0]==="W"&&Er.frameParsers["W*"](le),le.owner==="com.apple.streaming.transportStreamTimestamp"){var ye=le.data,Ue=(ye[3]&1)<<30|ye[4]<<22|ye[5]<<14|ye[6]<<6|ye[7]>>>2;Ue*=4,Ue+=ye[7]&3,le.timeStamp=Ue,X.pts===void 0&&X.dts===void 0&&(X.pts=le.timeStamp,X.dts=le.timeStamp),this.trigger("timestamp",le)}X.frames.push(le),Y+=10,Y+=J}while(Y<S);this.trigger("data",X)}}}},_s.prototype=new ya;var Id=_s,$n=t,jn=ma,Ri=gs,Pd=vs.TimestampRolloverStream,_a,qn,Ta,Vn=188,ba=71;_a=function(){var f=new Uint8Array(Vn),v=0;_a.prototype.init.call(this),this.push=function(S){var b=0,w=Vn,D;for(v?(D=new Uint8Array(S.byteLength+v),D.set(f.subarray(0,v)),D.set(S,v),v=0):D=S;w<D.byteLength;){if(D[b]===ba&&D[w]===ba){this.trigger("data",D.subarray(b,w)),b+=Vn,w+=Vn;continue}b++,w++}b<D.byteLength&&(f.set(D.subarray(b),0),v=D.byteLength-b)},this.flush=function(){v===Vn&&f[0]===ba&&(this.trigger("data",f),v=0),this.trigger("done")},this.endTimeline=function(){this.flush(),this.trigger("endedtimeline")},this.reset=function(){v=0,this.trigger("reset")}},_a.prototype=new $n,qn=function(){var f,v,S,b;qn.prototype.init.call(this),b=this,this.packetsWaitingForPmt=[],this.programMapTable=void 0,f=function(w,D){var W=0;D.payloadUnitStartIndicator&&(W+=w[W]+1),D.type==="pat"?v(w.subarray(W),D):S(w.subarray(W),D)},v=function(w,D){D.section_number=w[7],D.last_section_number=w[8],b.pmtPid=(w[10]&31)<<8|w[11],D.pmtPid=b.pmtPid},S=function(w,D){var W,X,Y,J;if(w[5]&1){for(b.programMapTable={video:null,audio:null,"timed-metadata":{}},W=(w[1]&15)<<8|w[2],X=3+W-4,Y=(w[10]&15)<<8|w[11],J=12+Y;J<X;){var le=w[J],me=(w[J+1]&31)<<8|w[J+2];le===Ri.H264_STREAM_TYPE&&b.programMapTable.video===null?b.programMapTable.video=me:le===Ri.ADTS_STREAM_TYPE&&b.programMapTable.audio===null?b.programMapTable.audio=me:le===Ri.METADATA_STREAM_TYPE&&(b.programMapTable["timed-metadata"][me]=le),J+=((w[J+3]&15)<<8|w[J+4])+5}D.programMapTable=b.programMapTable}},this.push=function(w){var D={},W=4;if(D.payloadUnitStartIndicator=!!(w[1]&64),D.pid=w[1]&31,D.pid<<=8,D.pid|=w[2],(w[3]&48)>>>4>1&&(W+=w[W]+1),D.pid===0)D.type="pat",f(w.subarray(W),D),this.trigger("data",D);else if(D.pid===this.pmtPid)for(D.type="pmt",f(w.subarray(W),D),this.trigger("data",D);this.packetsWaitingForPmt.length;)this.processPes_.apply(this,this.packetsWaitingForPmt.shift());else this.programMapTable===void 0?this.packetsWaitingForPmt.push([w,W,D]):this.processPes_(w,W,D)},this.processPes_=function(w,D,W){W.pid===this.programMapTable.video?W.streamType=Ri.H264_STREAM_TYPE:W.pid===this.programMapTable.audio?W.streamType=Ri.ADTS_STREAM_TYPE:W.streamType=this.programMapTable["timed-metadata"][W.pid],W.type="pes",W.data=w.subarray(D),this.trigger("data",W)}},qn.prototype=new $n,qn.STREAM_TYPES={h264:27,adts:15},Ta=function(){var f=this,v=!1,S={data:[],size:0},b={data:[],size:0},w={data:[],size:0},D,W=function(Y,J){var le;const me=Y[0]<<16|Y[1]<<8|Y[2];J.data=new Uint8Array,me===1&&(J.packetLength=6+(Y[4]<<8|Y[5]),J.dataAlignmentIndicator=(Y[6]&4)!==0,le=Y[7],le&192&&(J.pts=(Y[9]&14)<<27|(Y[10]&255)<<20|(Y[11]&254)<<12|(Y[12]&255)<<5|(Y[13]&254)>>>3,J.pts*=4,J.pts+=(Y[13]&6)>>>1,J.dts=J.pts,le&64&&(J.dts=(Y[14]&14)<<27|(Y[15]&255)<<20|(Y[16]&254)<<12|(Y[17]&255)<<5|(Y[18]&254)>>>3,J.dts*=4,J.dts+=(Y[18]&6)>>>1)),J.data=Y.subarray(9+Y[8]))},X=function(Y,J,le){var me=new Uint8Array(Y.size),Ae={type:J},ye=0,Ue=0,Ke=!1,Zt;if(!(!Y.data.length||Y.size<9)){for(Ae.trackId=Y.data[0].pid,ye=0;ye<Y.data.length;ye++)Zt=Y.data[ye],me.set(Zt.data,Ue),Ue+=Zt.data.byteLength;W(me,Ae),Ke=J==="video"||Ae.packetLength<=Y.size,(le||Ke)&&(Y.size=0,Y.data.length=0),Ke&&f.trigger("data",Ae)}};Ta.prototype.init.call(this),this.push=function(Y){({pat:function(){},pes:function(){var J,le;switch(Y.streamType){case Ri.H264_STREAM_TYPE:J=S,le="video";break;case Ri.ADTS_STREAM_TYPE:J=b,le="audio";break;case Ri.METADATA_STREAM_TYPE:J=w,le="timed-metadata";break;default:return}Y.payloadUnitStartIndicator&&X(J,le,!0),J.data.push(Y),J.size+=Y.data.byteLength},pmt:function(){var J={type:"metadata",tracks:[]};D=Y.programMapTable,D.video!==null&&J.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+D.video,codec:"avc",type:"video"}),D.audio!==null&&J.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+D.audio,codec:"adts",type:"audio"}),v=!0,f.trigger("data",J)}})[Y.type]()},this.reset=function(){S.size=0,S.data.length=0,b.size=0,b.data.length=0,this.trigger("reset")},this.flushStreams_=function(){X(S,"video"),X(b,"audio"),X(w,"timed-metadata")},this.flush=function(){if(!v&&D){var Y={type:"metadata",tracks:[]};D.video!==null&&Y.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+D.video,codec:"avc",type:"video"}),D.audio!==null&&Y.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+D.audio,codec:"adts",type:"audio"}),f.trigger("data",Y)}v=!1,this.flushStreams_(),this.trigger("done")}},Ta.prototype=new $n;var Iu={PAT_PID:0,MP2T_PACKET_LENGTH:Vn,TransportPacketStream:_a,TransportParseStream:qn,ElementaryStream:Ta,TimestampRolloverStream:Pd,CaptionStream:jn.CaptionStream,Cea608Stream:jn.Cea608Stream,Cea708Stream:jn.Cea708Stream,MetadataStream:Id};for(var el in Ri)Ri.hasOwnProperty(el)&&(Iu[el]=Ri[el]);var Dd=Iu,Nd=t,Ld=st.ONE_SECOND_IN_TS,Sa,Ts=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350];Sa=function(f){var v,S=0;Sa.prototype.init.call(this),this.skipWarn_=function(b,w){this.trigger("log",{level:"warn",message:`adts skiping bytes ${b} to ${w} in frame ${S} outside syncword`})},this.push=function(b){var w=0,D,W,X,Y,J;if(f||(S=0),b.type==="audio"){v&&v.length?(X=v,v=new Uint8Array(X.byteLength+b.data.byteLength),v.set(X),v.set(b.data,X.byteLength)):v=b.data;for(var le;w+7<v.length;){if(v[w]!==255||(v[w+1]&246)!==240){typeof le!="number"&&(le=w),w++;continue}if(typeof le=="number"&&(this.skipWarn_(le,w),le=null),W=(~v[w+1]&1)*2,D=(v[w+3]&3)<<11|v[w+4]<<3|(v[w+5]&224)>>5,Y=((v[w+6]&3)+1)*1024,J=Y*Ld/Ts[(v[w+2]&60)>>>2],v.byteLength-w<D)break;this.trigger("data",{pts:b.pts+S*J,dts:b.dts+S*J,sampleCount:Y,audioobjecttype:(v[w+2]>>>6&3)+1,channelcount:(v[w+2]&1)<<2|(v[w+3]&192)>>>6,samplerate:Ts[(v[w+2]&60)>>>2],samplingfrequencyindex:(v[w+2]&60)>>>2,samplesize:16,data:v.subarray(w+7+W,w+D)}),S++,w+=D}typeof le=="number"&&(this.skipWarn_(le,w),le=null),v=v.subarray(w)}},this.flush=function(){S=0,this.trigger("done")},this.reset=function(){v=void 0,this.trigger("reset")},this.endTimeline=function(){v=void 0,this.trigger("endedtimeline")}},Sa.prototype=new Nd;var xa=Sa,Pu;Pu=function(f){var v=f.byteLength,S=0,b=0;this.length=function(){return 8*v},this.bitsAvailable=function(){return 8*v+b},this.loadWord=function(){var w=f.byteLength-v,D=new Uint8Array(4),W=Math.min(4,v);if(W===0)throw new Error("no bytes available");D.set(f.subarray(w,w+W)),S=new DataView(D.buffer).getUint32(0),b=W*8,v-=W},this.skipBits=function(w){var D;b>w?(S<<=w,b-=w):(w-=b,D=Math.floor(w/8),w-=D*8,v-=D,this.loadWord(),S<<=w,b-=w)},this.readBits=function(w){var D=Math.min(b,w),W=S>>>32-D;return b-=D,b>0?S<<=D:v>0&&this.loadWord(),D=w-D,D>0?W<<D|this.readBits(D):W},this.skipLeadingZeros=function(){var w;for(w=0;w<b;++w)if((S&2147483648>>>w)!==0)return S<<=w,b-=w,w;return this.loadWord(),w+this.skipLeadingZeros()},this.skipUnsignedExpGolomb=function(){this.skipBits(1+this.skipLeadingZeros())},this.skipExpGolomb=function(){this.skipBits(1+this.skipLeadingZeros())},this.readUnsignedExpGolomb=function(){var w=this.skipLeadingZeros();return this.readBits(w+1)-1},this.readExpGolomb=function(){var w=this.readUnsignedExpGolomb();return 1&w?1+w>>>1:-1*(w>>>1)},this.readBoolean=function(){return this.readBits(1)===1},this.readUnsignedByte=function(){return this.readBits(8)},this.loadWord()};var Od=Pu,tl=t,Md=Od,bs,Ca,Du;Ca=function(){var f=0,v,S;Ca.prototype.init.call(this),this.push=function(b){var w;S?(w=new Uint8Array(S.byteLength+b.data.byteLength),w.set(S),w.set(b.data,S.byteLength),S=w):S=b.data;for(var D=S.byteLength;f<D-3;f++)if(S[f+2]===1){v=f+5;break}for(;v<D;)switch(S[v]){case 0:if(S[v-1]!==0){v+=2;break}else if(S[v-2]!==0){v++;break}f+3!==v-2&&this.trigger("data",S.subarray(f+3,v-2));do v++;while(S[v]!==1&&v<D);f=v-2,v+=3;break;case 1:if(S[v-1]!==0||S[v-2]!==0){v+=3;break}this.trigger("data",S.subarray(f+3,v-2)),f=v-2,v+=3;break;default:v+=3;break}S=S.subarray(f),v-=f,f=0},this.reset=function(){S=null,f=0,this.trigger("reset")},this.flush=function(){S&&S.byteLength>3&&this.trigger("data",S.subarray(f+3)),S=null,f=0,this.trigger("done")},this.endTimeline=function(){this.flush(),this.trigger("endedtimeline")}},Ca.prototype=new tl,Du={100:!0,110:!0,122:!0,244:!0,44:!0,83:!0,86:!0,118:!0,128:!0,138:!0,139:!0,134:!0},bs=function(){var f=new Ca,v,S,b,w,D,W,X;bs.prototype.init.call(this),v=this,this.push=function(Y){Y.type==="video"&&(S=Y.trackId,b=Y.pts,w=Y.dts,f.push(Y))},f.on("data",function(Y){var J={trackId:S,pts:b,dts:w,data:Y,nalUnitTypeCode:Y[0]&31};switch(J.nalUnitTypeCode){case 5:J.nalUnitType="slice_layer_without_partitioning_rbsp_idr";break;case 6:J.nalUnitType="sei_rbsp",J.escapedRBSP=D(Y.subarray(1));break;case 7:J.nalUnitType="seq_parameter_set_rbsp",J.escapedRBSP=D(Y.subarray(1)),J.config=W(J.escapedRBSP);break;case 8:J.nalUnitType="pic_parameter_set_rbsp";break;case 9:J.nalUnitType="access_unit_delimiter_rbsp";break}v.trigger("data",J)}),f.on("done",function(){v.trigger("done")}),f.on("partialdone",function(){v.trigger("partialdone")}),f.on("reset",function(){v.trigger("reset")}),f.on("endedtimeline",function(){v.trigger("endedtimeline")}),this.flush=function(){f.flush()},this.partialFlush=function(){f.partialFlush()},this.reset=function(){f.reset()},this.endTimeline=function(){f.endTimeline()},X=function(Y,J){var le=8,me=8,Ae,ye;for(Ae=0;Ae<Y;Ae++)me!==0&&(ye=J.readExpGolomb(),me=(le+ye+256)%256),le=me===0?le:me},D=function(Y){for(var J=Y.byteLength,le=[],me=1,Ae,ye;me<J-2;)Y[me]===0&&Y[me+1]===0&&Y[me+2]===3?(le.push(me+2),me+=2):me++;if(le.length===0)return Y;Ae=J-le.length,ye=new Uint8Array(Ae);var Ue=0;for(me=0;me<Ae;Ue++,me++)Ue===le[0]&&(Ue++,le.shift()),ye[me]=Y[Ue];return ye},W=function(Y){var J=0,le=0,me=0,Ae=0,ye,Ue,Ke,Zt,Zi,Yn,ul,cl,hl,dl,Yu,Ct=[1,1],fl,Ar;if(ye=new Md(Y),Ue=ye.readUnsignedByte(),Zt=ye.readUnsignedByte(),Ke=ye.readUnsignedByte(),ye.skipUnsignedExpGolomb(),Du[Ue]&&(Zi=ye.readUnsignedExpGolomb(),Zi===3&&ye.skipBits(1),ye.skipUnsignedExpGolomb(),ye.skipUnsignedExpGolomb(),ye.skipBits(1),ye.readBoolean()))for(Yu=Zi!==3?8:12,Ar=0;Ar<Yu;Ar++)ye.readBoolean()&&(Ar<6?X(16,ye):X(64,ye));if(ye.skipUnsignedExpGolomb(),Yn=ye.readUnsignedExpGolomb(),Yn===0)ye.readUnsignedExpGolomb();else if(Yn===1)for(ye.skipBits(1),ye.skipExpGolomb(),ye.skipExpGolomb(),ul=ye.readUnsignedExpGolomb(),Ar=0;Ar<ul;Ar++)ye.skipExpGolomb();if(ye.skipUnsignedExpGolomb(),ye.skipBits(1),cl=ye.readUnsignedExpGolomb(),hl=ye.readUnsignedExpGolomb(),dl=ye.readBits(1),dl===0&&ye.skipBits(1),ye.skipBits(1),ye.readBoolean()&&(J=ye.readUnsignedExpGolomb(),le=ye.readUnsignedExpGolomb(),me=ye.readUnsignedExpGolomb(),Ae=ye.readUnsignedExpGolomb()),ye.readBoolean()&&ye.readBoolean()){switch(fl=ye.readUnsignedByte(),fl){case 1:Ct=[1,1];break;case 2:Ct=[12,11];break;case 3:Ct=[10,11];break;case 4:Ct=[16,11];break;case 5:Ct=[40,33];break;case 6:Ct=[24,11];break;case 7:Ct=[20,11];break;case 8:Ct=[32,11];break;case 9:Ct=[80,33];break;case 10:Ct=[18,11];break;case 11:Ct=[15,11];break;case 12:Ct=[64,33];break;case 13:Ct=[160,99];break;case 14:Ct=[4,3];break;case 15:Ct=[3,2];break;case 16:Ct=[2,1];break;case 255:{Ct=[ye.readUnsignedByte()<<8|ye.readUnsignedByte(),ye.readUnsignedByte()<<8|ye.readUnsignedByte()];break}}Ct&&Ct[0]/Ct[1]}return{profileIdc:Ue,levelIdc:Ke,profileCompatibility:Zt,width:(cl+1)*16-J*2-le*2,height:(2-dl)*(hl+1)*16-me*2-Ae*2,sarRatio:Ct}}},bs.prototype=new tl;var Rd={H264Stream:bs},Ea=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350],Hn=function(f,v){var S=f[v+6]<<21|f[v+7]<<14|f[v+8]<<7|f[v+9],b=f[v+5],w=(b&16)>>4;return S=S>=0?S:0,w?S+20:S+10},Ss=function(f,v){return f.length-v<10||f[v]!==73||f[v+1]!==68||f[v+2]!==51?v:(v+=Hn(f,v),Ss(f,v))},yn=function(f){var v=Ss(f,0);return f.length>=v+2&&(f[v]&255)===255&&(f[v+1]&240)===240&&(f[v+1]&22)===16},Nu=function(f){return f[0]<<21|f[1]<<14|f[2]<<7|f[3]},Lu=function(f,v,S){var b,w="";for(b=v;b<S;b++)w+="%"+("00"+f[b].toString(16)).slice(-2);return w},Ou=function(f,v,S){return unescape(Lu(f,v,S))},Mu=function(f,v){var S=(f[v+5]&224)>>5,b=f[v+4]<<3,w=f[v+3]&6144;return w|b|S},Fd=function(f,v){return f[v]===73&&f[v+1]===68&&f[v+2]===51?"timed-metadata":f[v]&!0&&(f[v+1]&240)===240?"audio":null},Bd=function(f){for(var v=0;v+5<f.length;){if(f[v]!==255||(f[v+1]&246)!==240){v++;continue}return Ea[(f[v+2]&60)>>>2]}return null},Ud=function(f){var v,S,b,w;v=10,f[5]&64&&(v+=4,v+=Nu(f.subarray(10,14)));do{if(S=Nu(f.subarray(v+4,v+8)),S<1)return null;if(w=String.fromCharCode(f[v],f[v+1],f[v+2],f[v+3]),w==="PRIV"){b=f.subarray(v+10,v+S+10);for(var D=0;D<b.byteLength;D++)if(b[D]===0){var W=Ou(b,0,D);if(W==="com.apple.streaming.transportStreamTimestamp"){var X=b.subarray(D+1),Y=(X[3]&1)<<30|X[4]<<22|X[5]<<14|X[6]<<6|X[7]>>>2;return Y*=4,Y+=X[7]&3,Y}break}}v+=10,v+=S}while(v<f.byteLength);return null},zn={isLikelyAacData:yn,parseId3TagSize:Hn,parseAdtsSize:Mu,parseType:Fd,parseSampleRate:Bd,parseAacTimestamp:Ud},$d=t,Ur=zn,wa;wa=function(){var f=new Uint8Array,v=0;wa.prototype.init.call(this),this.setTimestamp=function(S){v=S},this.push=function(S){var b=0,w=0,D,W,X,Y;for(f.length?(Y=f.length,f=new Uint8Array(S.byteLength+Y),f.set(f.subarray(0,Y)),f.set(S,Y)):f=S;f.length-w>=3;){if(f[w]===73&&f[w+1]===68&&f[w+2]===51){if(f.length-w<10||(b=Ur.parseId3TagSize(f,w),w+b>f.length))break;W={type:"timed-metadata",data:f.subarray(w,w+b)},this.trigger("data",W),w+=b;continue}else if((f[w]&255)===255&&(f[w+1]&240)===240){if(f.length-w<7||(b=Ur.parseAdtsSize(f,w),w+b>f.length))break;X={type:"audio",data:f.subarray(w,w+b),pts:v,dts:v},this.trigger("data",X),w+=b;continue}w++}D=f.length-w,D>0?f=f.subarray(w):f=new Uint8Array},this.reset=function(){f=new Uint8Array,this.trigger("reset")},this.endTimeline=function(){f=new Uint8Array,this.trigger("endedtimeline")}},wa.prototype=new $d;var jd=wa,mt=["audioobjecttype","channelcount","samplerate","samplingfrequencyindex","samplesize"],qd=mt,Vd=["width","height","profileIdc","levelIdc","profileCompatibility","sarRatio"],Hd=Vd,xs=t,Cs=Re,Wn=Ee,ka=pa,Fi=we,wr=Dd,Es=st,il=xa,ws=Rd.H264Stream,ks=jd,zd=zn.isLikelyAacData,Wd=st.ONE_SECOND_IN_TS,Ru=qd,Fu=Hd,Aa,As,Ia,_n,Gd=function(f,v){v.stream=f,this.trigger("log",v)},Is=function(f,v){for(var S=Object.keys(v),b=0;b<S.length;b++){var w=S[b];w==="headOfPipeline"||!v[w].on||v[w].on("log",Gd.bind(f,w))}},Gn=function(f,v){var S;if(f.length!==v.length)return!1;for(S=0;S<f.length;S++)if(f[S]!==v[S])return!1;return!0},Bu=function(f,v,S,b,w,D){var W=S-v,X=b-v,Y=w-S;return{start:{dts:f,pts:f+W},end:{dts:f+X,pts:f+Y},prependedContentDuration:D,baseMediaDecodeTime:f}};As=function(f,v){var S=[],b,w=0,D=0,W=1/0;v=v||{},b=v.firstSequenceNumber||0,As.prototype.init.call(this),this.push=function(X){Fi.collectDtsInfo(f,X),f&&Ru.forEach(function(Y){f[Y]=X[Y]}),S.push(X)},this.setEarliestDts=function(X){w=X},this.setVideoBaseMediaDecodeTime=function(X){W=X},this.setAudioAppendStart=function(X){D=X},this.flush=function(){var X,Y,J,le,me,Ae,ye;if(S.length===0){this.trigger("done","AudioSegmentStream");return}X=ka.trimAdtsFramesByEarliestDts(S,f,w),f.baseMediaDecodeTime=Fi.calculateTrackBaseMediaDecodeTime(f,v.keepOriginalTimestamps),ye=ka.prefixWithSilence(f,X,D,W),f.samples=ka.generateSampleTable(X),J=Cs.mdat(ka.concatenateFrameData(X)),S=[],Y=Cs.moof(b,[f]),le=new Uint8Array(Y.byteLength+J.byteLength),b++,le.set(Y),le.set(J,Y.byteLength),Fi.clearDtsInfo(f),me=Math.ceil(Wd*1024/f.samplerate),X.length&&(Ae=X.length*me,this.trigger("segmentTimingInfo",Bu(Es.audioTsToVideoTs(f.baseMediaDecodeTime,f.samplerate),X[0].dts,X[0].pts,X[0].dts+Ae,X[0].pts+Ae,ye||0)),this.trigger("timingInfo",{start:X[0].pts,end:X[0].pts+Ae})),this.trigger("data",{track:f,boxes:le}),this.trigger("done","AudioSegmentStream")},this.reset=function(){Fi.clearDtsInfo(f),S=[],this.trigger("reset")}},As.prototype=new xs,Aa=function(f,v){var S,b=[],w=[],D,W;v=v||{},S=v.firstSequenceNumber||0,Aa.prototype.init.call(this),delete f.minPTS,this.gopCache_=[],this.push=function(X){Fi.collectDtsInfo(f,X),X.nalUnitType==="seq_parameter_set_rbsp"&&!D&&(D=X.config,f.sps=[X.data],Fu.forEach(function(Y){f[Y]=D[Y]},this)),X.nalUnitType==="pic_parameter_set_rbsp"&&!W&&(W=X.data,f.pps=[X.data]),b.push(X)},this.flush=function(){for(var X,Y,J,le,me,Ae,ye=0,Ue,Ke;b.length&&b[0].nalUnitType!=="access_unit_delimiter_rbsp";)b.shift();if(b.length===0){this.resetStream_(),this.trigger("done","VideoSegmentStream");return}if(X=Wn.groupNalsIntoFrames(b),J=Wn.groupFramesIntoGops(X),J[0][0].keyFrame||(Y=this.getGopForFusion_(b[0],f),Y?(ye=Y.duration,J.unshift(Y),J.byteLength+=Y.byteLength,J.nalCount+=Y.nalCount,J.pts=Y.pts,J.dts=Y.dts,J.duration+=Y.duration):J=Wn.extendFirstKeyFrame(J)),w.length){var Zt;if(v.alignGopsAtEnd?Zt=this.alignGopsAtEnd_(J):Zt=this.alignGopsAtStart_(J),!Zt){this.gopCache_.unshift({gop:J.pop(),pps:f.pps,sps:f.sps}),this.gopCache_.length=Math.min(6,this.gopCache_.length),b=[],this.resetStream_(),this.trigger("done","VideoSegmentStream");return}Fi.clearDtsInfo(f),J=Zt}Fi.collectDtsInfo(f,J),f.samples=Wn.generateSampleTable(J),me=Cs.mdat(Wn.concatenateNalData(J)),f.baseMediaDecodeTime=Fi.calculateTrackBaseMediaDecodeTime(f,v.keepOriginalTimestamps),this.trigger("processedGopsInfo",J.map(function(Zi){return{pts:Zi.pts,dts:Zi.dts,byteLength:Zi.byteLength}})),Ue=J[0],Ke=J[J.length-1],this.trigger("segmentTimingInfo",Bu(f.baseMediaDecodeTime,Ue.dts,Ue.pts,Ke.dts+Ke.duration,Ke.pts+Ke.duration,ye)),this.trigger("timingInfo",{start:J[0].pts,end:J[J.length-1].pts+J[J.length-1].duration}),this.gopCache_.unshift({gop:J.pop(),pps:f.pps,sps:f.sps}),this.gopCache_.length=Math.min(6,this.gopCache_.length),b=[],this.trigger("baseMediaDecodeTime",f.baseMediaDecodeTime),this.trigger("timelineStartInfo",f.timelineStartInfo),le=Cs.moof(S,[f]),Ae=new Uint8Array(le.byteLength+me.byteLength),S++,Ae.set(le),Ae.set(me,le.byteLength),this.trigger("data",{track:f,boxes:Ae}),this.resetStream_(),this.trigger("done","VideoSegmentStream")},this.reset=function(){this.resetStream_(),b=[],this.gopCache_.length=0,w.length=0,this.trigger("reset")},this.resetStream_=function(){Fi.clearDtsInfo(f),D=void 0,W=void 0},this.getGopForFusion_=function(X){var Y=45e3,J=1/0,le,me,Ae,ye,Ue;for(Ue=0;Ue<this.gopCache_.length;Ue++)ye=this.gopCache_[Ue],Ae=ye.gop,!(!(f.pps&&Gn(f.pps[0],ye.pps[0]))||!(f.sps&&Gn(f.sps[0],ye.sps[0])))&&(Ae.dts<f.timelineStartInfo.dts||(le=X.dts-Ae.dts-Ae.duration,le>=-1e4&&le<=Y&&(!me||J>le)&&(me=ye,J=le)));return me?me.gop:null},this.alignGopsAtStart_=function(X){var Y,J,le,me,Ae,ye,Ue,Ke;for(Ae=X.byteLength,ye=X.nalCount,Ue=X.duration,Y=J=0;Y<w.length&&J<X.length&&(le=w[Y],me=X[J],le.pts!==me.pts);){if(me.pts>le.pts){Y++;continue}J++,Ae-=me.byteLength,ye-=me.nalCount,Ue-=me.duration}return J===0?X:J===X.length?null:(Ke=X.slice(J),Ke.byteLength=Ae,Ke.duration=Ue,Ke.nalCount=ye,Ke.pts=Ke[0].pts,Ke.dts=Ke[0].dts,Ke)},this.alignGopsAtEnd_=function(X){var Y,J,le,me,Ae,ye;for(Y=w.length-1,J=X.length-1,Ae=null,ye=!1;Y>=0&&J>=0;){if(le=w[Y],me=X[J],le.pts===me.pts){ye=!0;break}if(le.pts>me.pts){Y--;continue}Y===w.length-1&&(Ae=J),J--}if(!ye&&Ae===null)return null;var Ue;if(ye?Ue=J:Ue=Ae,Ue===0)return X;var Ke=X.slice(Ue),Zt=Ke.reduce(function(Zi,Yn){return Zi.byteLength+=Yn.byteLength,Zi.duration+=Yn.duration,Zi.nalCount+=Yn.nalCount,Zi},{byteLength:0,duration:0,nalCount:0});return Ke.byteLength=Zt.byteLength,Ke.duration=Zt.duration,Ke.nalCount=Zt.nalCount,Ke.pts=Ke[0].pts,Ke.dts=Ke[0].dts,Ke},this.alignGopsWith=function(X){w=X}},Aa.prototype=new xs,_n=function(f,v){this.numberOfTracks=0,this.metadataStream=v,f=f||{},typeof f.remux<"u"?this.remuxTracks=!!f.remux:this.remuxTracks=!0,typeof f.keepOriginalTimestamps=="boolean"?this.keepOriginalTimestamps=f.keepOriginalTimestamps:this.keepOriginalTimestamps=!1,this.pendingTracks=[],this.videoTrack=null,this.pendingBoxes=[],this.pendingCaptions=[],this.pendingMetadata=[],this.pendingBytes=0,this.emittedTracks=0,_n.prototype.init.call(this),this.push=function(S){if(S.content||S.text)return this.pendingCaptions.push(S);if(S.frames)return this.pendingMetadata.push(S);this.pendingTracks.push(S.track),this.pendingBytes+=S.boxes.byteLength,S.track.type==="video"&&(this.videoTrack=S.track,this.pendingBoxes.push(S.boxes)),S.track.type==="audio"&&(this.audioTrack=S.track,this.pendingBoxes.unshift(S.boxes))}},_n.prototype=new xs,_n.prototype.flush=function(f){var v=0,S={captions:[],captionStreams:{},metadata:[],info:{}},b,w,D,W=0,X;if(this.pendingTracks.length<this.numberOfTracks){if(f!=="VideoSegmentStream"&&f!=="AudioSegmentStream")return;if(this.remuxTracks)return;if(this.pendingTracks.length===0){this.emittedTracks++,this.emittedTracks>=this.numberOfTracks&&(this.trigger("done"),this.emittedTracks=0);return}}if(this.videoTrack?(W=this.videoTrack.timelineStartInfo.pts,Fu.forEach(function(Y){S.info[Y]=this.videoTrack[Y]},this)):this.audioTrack&&(W=this.audioTrack.timelineStartInfo.pts,Ru.forEach(function(Y){S.info[Y]=this.audioTrack[Y]},this)),this.videoTrack||this.audioTrack){for(this.pendingTracks.length===1?S.type=this.pendingTracks[0].type:S.type="combined",this.emittedTracks+=this.pendingTracks.length,D=Cs.initSegment(this.pendingTracks),S.initSegment=new Uint8Array(D.byteLength),S.initSegment.set(D),S.data=new Uint8Array(this.pendingBytes),X=0;X<this.pendingBoxes.length;X++)S.data.set(this.pendingBoxes[X],v),v+=this.pendingBoxes[X].byteLength;for(X=0;X<this.pendingCaptions.length;X++)b=this.pendingCaptions[X],b.startTime=Es.metadataTsToSeconds(b.startPts,W,this.keepOriginalTimestamps),b.endTime=Es.metadataTsToSeconds(b.endPts,W,this.keepOriginalTimestamps),S.captionStreams[b.stream]=!0,S.captions.push(b);for(X=0;X<this.pendingMetadata.length;X++)w=this.pendingMetadata[X],w.cueTime=Es.metadataTsToSeconds(w.pts,W,this.keepOriginalTimestamps),S.metadata.push(w);for(S.metadata.dispatchType=this.metadataStream.dispatchType,this.pendingTracks.length=0,this.videoTrack=null,this.pendingBoxes.length=0,this.pendingCaptions.length=0,this.pendingBytes=0,this.pendingMetadata.length=0,this.trigger("data",S),X=0;X<S.captions.length;X++)b=S.captions[X],this.trigger("caption",b);for(X=0;X<S.metadata.length;X++)w=S.metadata[X],this.trigger("id3Frame",w)}this.emittedTracks>=this.numberOfTracks&&(this.trigger("done"),this.emittedTracks=0)},_n.prototype.setRemux=function(f){this.remuxTracks=f},Ia=function(f){var v=this,S=!0,b,w;Ia.prototype.init.call(this),f=f||{},this.baseMediaDecodeTime=f.baseMediaDecodeTime||0,this.transmuxPipeline_={},this.setupAacPipeline=function(){var D={};this.transmuxPipeline_=D,D.type="aac",D.metadataStream=new wr.MetadataStream,D.aacStream=new ks,D.audioTimestampRolloverStream=new wr.TimestampRolloverStream("audio"),D.timedMetadataTimestampRolloverStream=new wr.TimestampRolloverStream("timed-metadata"),D.adtsStream=new il,D.coalesceStream=new _n(f,D.metadataStream),D.headOfPipeline=D.aacStream,D.aacStream.pipe(D.audioTimestampRolloverStream).pipe(D.adtsStream),D.aacStream.pipe(D.timedMetadataTimestampRolloverStream).pipe(D.metadataStream).pipe(D.coalesceStream),D.metadataStream.on("timestamp",function(W){D.aacStream.setTimestamp(W.timeStamp)}),D.aacStream.on("data",function(W){W.type!=="timed-metadata"&&W.type!=="audio"||D.audioSegmentStream||(w=w||{timelineStartInfo:{baseMediaDecodeTime:v.baseMediaDecodeTime},codec:"adts",type:"audio"},D.coalesceStream.numberOfTracks++,D.audioSegmentStream=new As(w,f),D.audioSegmentStream.on("log",v.getLogTrigger_("audioSegmentStream")),D.audioSegmentStream.on("timingInfo",v.trigger.bind(v,"audioTimingInfo")),D.adtsStream.pipe(D.audioSegmentStream).pipe(D.coalesceStream),v.trigger("trackinfo",{hasAudio:!!w,hasVideo:!!b}))}),D.coalesceStream.on("data",this.trigger.bind(this,"data")),D.coalesceStream.on("done",this.trigger.bind(this,"done")),Is(this,D)},this.setupTsPipeline=function(){var D={};this.transmuxPipeline_=D,D.type="ts",D.metadataStream=new wr.MetadataStream,D.packetStream=new wr.TransportPacketStream,D.parseStream=new wr.TransportParseStream,D.elementaryStream=new wr.ElementaryStream,D.timestampRolloverStream=new wr.TimestampRolloverStream,D.adtsStream=new il,D.h264Stream=new ws,D.captionStream=new wr.CaptionStream(f),D.coalesceStream=new _n(f,D.metadataStream),D.headOfPipeline=D.packetStream,D.packetStream.pipe(D.parseStream).pipe(D.elementaryStream).pipe(D.timestampRolloverStream),D.timestampRolloverStream.pipe(D.h264Stream),D.timestampRolloverStream.pipe(D.adtsStream),D.timestampRolloverStream.pipe(D.metadataStream).pipe(D.coalesceStream),D.h264Stream.pipe(D.captionStream).pipe(D.coalesceStream),D.elementaryStream.on("data",function(W){var X;if(W.type==="metadata"){for(X=W.tracks.length;X--;)!b&&W.tracks[X].type==="video"?(b=W.tracks[X],b.timelineStartInfo.baseMediaDecodeTime=v.baseMediaDecodeTime):!w&&W.tracks[X].type==="audio"&&(w=W.tracks[X],w.timelineStartInfo.baseMediaDecodeTime=v.baseMediaDecodeTime);b&&!D.videoSegmentStream&&(D.coalesceStream.numberOfTracks++,D.videoSegmentStream=new Aa(b,f),D.videoSegmentStream.on("log",v.getLogTrigger_("videoSegmentStream")),D.videoSegmentStream.on("timelineStartInfo",function(Y){w&&!f.keepOriginalTimestamps&&(w.timelineStartInfo=Y,D.audioSegmentStream.setEarliestDts(Y.dts-v.baseMediaDecodeTime))}),D.videoSegmentStream.on("processedGopsInfo",v.trigger.bind(v,"gopInfo")),D.videoSegmentStream.on("segmentTimingInfo",v.trigger.bind(v,"videoSegmentTimingInfo")),D.videoSegmentStream.on("baseMediaDecodeTime",function(Y){w&&D.audioSegmentStream.setVideoBaseMediaDecodeTime(Y)}),D.videoSegmentStream.on("timingInfo",v.trigger.bind(v,"videoTimingInfo")),D.h264Stream.pipe(D.videoSegmentStream).pipe(D.coalesceStream)),w&&!D.audioSegmentStream&&(D.coalesceStream.numberOfTracks++,D.audioSegmentStream=new As(w,f),D.audioSegmentStream.on("log",v.getLogTrigger_("audioSegmentStream")),D.audioSegmentStream.on("timingInfo",v.trigger.bind(v,"audioTimingInfo")),D.audioSegmentStream.on("segmentTimingInfo",v.trigger.bind(v,"audioSegmentTimingInfo")),D.adtsStream.pipe(D.audioSegmentStream).pipe(D.coalesceStream)),v.trigger("trackinfo",{hasAudio:!!w,hasVideo:!!b})}}),D.coalesceStream.on("data",this.trigger.bind(this,"data")),D.coalesceStream.on("id3Frame",function(W){W.dispatchType=D.metadataStream.dispatchType,v.trigger("id3Frame",W)}),D.coalesceStream.on("caption",this.trigger.bind(this,"caption")),D.coalesceStream.on("done",this.trigger.bind(this,"done")),Is(this,D)},this.setBaseMediaDecodeTime=function(D){var W=this.transmuxPipeline_;f.keepOriginalTimestamps||(this.baseMediaDecodeTime=D),w&&(w.timelineStartInfo.dts=void 0,w.timelineStartInfo.pts=void 0,Fi.clearDtsInfo(w),W.audioTimestampRolloverStream&&W.audioTimestampRolloverStream.discontinuity()),b&&(W.videoSegmentStream&&(W.videoSegmentStream.gopCache_=[]),b.timelineStartInfo.dts=void 0,b.timelineStartInfo.pts=void 0,Fi.clearDtsInfo(b),W.captionStream.reset()),W.timestampRolloverStream&&W.timestampRolloverStream.discontinuity()},this.setAudioAppendStart=function(D){w&&this.transmuxPipeline_.audioSegmentStream.setAudioAppendStart(D)},this.setRemux=function(D){var W=this.transmuxPipeline_;f.remux=D,W&&W.coalesceStream&&W.coalesceStream.setRemux(D)},this.alignGopsWith=function(D){b&&this.transmuxPipeline_.videoSegmentStream&&this.transmuxPipeline_.videoSegmentStream.alignGopsWith(D)},this.getLogTrigger_=function(D){var W=this;return function(X){X.stream=D,W.trigger("log",X)}},this.push=function(D){if(S){var W=zd(D);W&&this.transmuxPipeline_.type!=="aac"?this.setupAacPipeline():!W&&this.transmuxPipeline_.type!=="ts"&&this.setupTsPipeline(),S=!1}this.transmuxPipeline_.headOfPipeline.push(D)},this.flush=function(){S=!0,this.transmuxPipeline_.headOfPipeline.flush()},this.endTimeline=function(){this.transmuxPipeline_.headOfPipeline.endTimeline()},this.reset=function(){this.transmuxPipeline_.headOfPipeline&&this.transmuxPipeline_.headOfPipeline.reset()},this.resetCaptions=function(){this.transmuxPipeline_.captionStream&&this.transmuxPipeline_.captionStream.reset()}},Ia.prototype=new xs;var Uu={Transmuxer:Ia},$u=function(f){return f>>>0},ju=function(f){return("00"+f.toString(16)).slice(-2)},Ps={toUnsigned:$u,toHexString:ju},qu=function(f){var v="";return v+=String.fromCharCode(f[0]),v+=String.fromCharCode(f[1]),v+=String.fromCharCode(f[2]),v+=String.fromCharCode(f[3]),v},Pa=qu,Vu=Ps.toUnsigned,Hu=Pa,Ds=function(f,v){var S=[],b,w,D,W,X;if(!v.length)return null;for(b=0;b<f.byteLength;)w=Vu(f[b]<<24|f[b+1]<<16|f[b+2]<<8|f[b+3]),D=Hu(f.subarray(b+4,b+8)),W=w>1?b+w:f.byteLength,D===v[0]&&(v.length===1?S.push(f.subarray(b+8,W)):(X=Ds(f.subarray(b+8,W),v.slice(1)),X.length&&(S=S.concat(X)))),b=W;return S},Kn=Ds,Kd=Ps.toUnsigned,Xd=n.getUint64,Qd=function(f){var v={version:f[0],flags:new Uint8Array(f.subarray(1,4))};return v.version===1?v.baseMediaDecodeTime=Xd(f.subarray(4)):v.baseMediaDecodeTime=Kd(f[4]<<24|f[5]<<16|f[6]<<8|f[7]),v},rl=Qd,Yd=function(f){var v=new DataView(f.buffer,f.byteOffset,f.byteLength),S={version:f[0],flags:new Uint8Array(f.subarray(1,4)),trackId:v.getUint32(4)},b=S.flags[2]&1,w=S.flags[2]&2,D=S.flags[2]&8,W=S.flags[2]&16,X=S.flags[2]&32,Y=S.flags[0]&65536,J=S.flags[0]&131072,le;return le=8,b&&(le+=4,S.baseDataOffset=v.getUint32(12),le+=4),w&&(S.sampleDescriptionIndex=v.getUint32(le),le+=4),D&&(S.defaultSampleDuration=v.getUint32(le),le+=4),W&&(S.defaultSampleSize=v.getUint32(le),le+=4),X&&(S.defaultSampleFlags=v.getUint32(le)),Y&&(S.durationIsEmpty=!0),!b&&J&&(S.baseDataOffsetIsMoof=!0),S},Da=Yd,Jd=function(f){return{isLeading:(f[0]&12)>>>2,dependsOn:f[0]&3,isDependedOn:(f[1]&192)>>>6,hasRedundancy:(f[1]&48)>>>4,paddingValue:(f[1]&14)>>>1,isNonSyncSample:f[1]&1,degradationPriority:f[2]<<8|f[3]}},Zd=Jd,Tn=Zd,at=function(f){var v={version:f[0],flags:new Uint8Array(f.subarray(1,4)),samples:[]},S=new DataView(f.buffer,f.byteOffset,f.byteLength),b=v.flags[2]&1,w=v.flags[2]&4,D=v.flags[1]&1,W=v.flags[1]&2,X=v.flags[1]&4,Y=v.flags[1]&8,J=S.getUint32(4),le=8,me;for(b&&(v.dataOffset=S.getInt32(le),le+=4),w&&J&&(me={flags:Tn(f.subarray(le,le+4))},le+=4,D&&(me.duration=S.getUint32(le),le+=4),W&&(me.size=S.getUint32(le),le+=4),Y&&(v.version===1?me.compositionTimeOffset=S.getInt32(le):me.compositionTimeOffset=S.getUint32(le),le+=4),v.samples.push(me),J--);J--;)me={},D&&(me.duration=S.getUint32(le),le+=4),W&&(me.size=S.getUint32(le),le+=4),X&&(me.flags=Tn(f.subarray(le,le+4)),le+=4),Y&&(v.version===1?me.compositionTimeOffset=S.getInt32(le):me.compositionTimeOffset=S.getUint32(le),le+=4),v.samples.push(me);return v},$r=at,Jt={tfdt:rl,trun:$r},Yi={parseTfdt:Jt.tfdt,parseTrun:Jt.trun},ef=function(f){for(var v=0,S=String.fromCharCode(f[v]),b="";S!=="\0";)b+=S,v++,S=String.fromCharCode(f[v]);return b+=S,b},zu={uint8ToCString:ef},Na=zu.uint8ToCString,tf=n.getUint64,rf=function(f){var v=4,S=f[0],b,w,D,W,X,Y,J,le;if(S===0){b=Na(f.subarray(v)),v+=b.length,w=Na(f.subarray(v)),v+=w.length;var me=new DataView(f.buffer);D=me.getUint32(v),v+=4,X=me.getUint32(v),v+=4,Y=me.getUint32(v),v+=4,J=me.getUint32(v),v+=4}else if(S===1){var me=new DataView(f.buffer);D=me.getUint32(v),v+=4,W=tf(f.subarray(v)),v+=8,Y=me.getUint32(v),v+=4,J=me.getUint32(v),v+=4,b=Na(f.subarray(v)),v+=b.length,w=Na(f.subarray(v)),v+=w.length}le=new Uint8Array(f.subarray(v,f.byteLength));var Ae={scheme_id_uri:b,value:w,timescale:D||1,presentation_time:W,presentation_time_delta:X,event_duration:Y,id:J,message_data:le};return sf(S,Ae)?Ae:void 0},nf=function(f,v,S,b){return f||f===0?f/v:b+S/v},sf=function(f,v){var S=v.scheme_id_uri!=="\0",b=f===0&&Wu(v.presentation_time_delta)&&S,w=f===1&&Wu(v.presentation_time)&&S;return!(f>1)&&b||w},Wu=function(f){return f!==void 0||f!==null},af={parseEmsgBox:rf,scaleTime:nf},Xn;typeof window<"u"?Xn=window:typeof s<"u"?Xn=s:typeof self<"u"?Xn=self:Xn={};var j=Xn,m=Ps.toUnsigned,x=Ps.toHexString,T=Kn,E=Pa,P=af,M=Da,z=$r,Q=rl,te=n.getUint64,Z,se,ge,xe,Pe,Se,ze,Lt=j,ui=ku.parseId3Frames;Z=function(f){var v={},S=T(f,["moov","trak"]);return S.reduce(function(b,w){var D,W,X,Y,J;return D=T(w,["tkhd"])[0],!D||(W=D[0],X=W===0?12:20,Y=m(D[X]<<24|D[X+1]<<16|D[X+2]<<8|D[X+3]),J=T(w,["mdia","mdhd"])[0],!J)?null:(W=J[0],X=W===0?12:20,b[Y]=m(J[X]<<24|J[X+1]<<16|J[X+2]<<8|J[X+3]),b)},v)},se=function(f,v){var S;S=T(v,["moof","traf"]);var b=S.reduce(function(w,D){var W=T(D,["tfhd"])[0],X=m(W[4]<<24|W[5]<<16|W[6]<<8|W[7]),Y=f[X]||9e4,J=T(D,["tfdt"])[0],le=new DataView(J.buffer,J.byteOffset,J.byteLength),me;J[0]===1?me=te(J.subarray(4,12)):me=le.getUint32(4);let Ae;return typeof me=="bigint"?Ae=me/Lt.BigInt(Y):typeof me=="number"&&!isNaN(me)&&(Ae=me/Y),Ae<Number.MAX_SAFE_INTEGER&&(Ae=Number(Ae)),Ae<w&&(w=Ae),w},1/0);return typeof b=="bigint"||isFinite(b)?b:0},ge=function(f,v){var S=T(v,["moof","traf"]),b=0,w=0,D;if(S&&S.length){var W=T(S[0],["tfhd"])[0],X=T(S[0],["trun"])[0],Y=T(S[0],["tfdt"])[0];if(W){var J=M(W);D=J.trackId}if(Y){var le=Q(Y);b=le.baseMediaDecodeTime}if(X){var me=z(X);me.samples&&me.samples.length&&(w=me.samples[0].compositionTimeOffset||0)}}var Ae=f[D]||9e4;typeof b=="bigint"&&(w=Lt.BigInt(w),Ae=Lt.BigInt(Ae));var ye=(b+w)/Ae;return typeof ye=="bigint"&&ye<Number.MAX_SAFE_INTEGER&&(ye=Number(ye)),ye},xe=function(f){var v=T(f,["moov","trak"]),S=[];return v.forEach(function(b){var w=T(b,["mdia","hdlr"]),D=T(b,["tkhd"]);w.forEach(function(W,X){var Y=E(W.subarray(8,12)),J=D[X],le,me,Ae;Y==="vide"&&(le=new DataView(J.buffer,J.byteOffset,J.byteLength),me=le.getUint8(0),Ae=me===0?le.getUint32(12):le.getUint32(20),S.push(Ae))})}),S},Se=function(f){var v=f[0],S=v===0?12:20;return m(f[S]<<24|f[S+1]<<16|f[S+2]<<8|f[S+3])},Pe=function(f){var v=T(f,["moov","trak"]),S=[];return v.forEach(function(b){var w={},D=T(b,["tkhd"])[0],W,X;D&&(W=new DataView(D.buffer,D.byteOffset,D.byteLength),X=W.getUint8(0),w.id=X===0?W.getUint32(12):W.getUint32(20));var Y=T(b,["mdia","hdlr"])[0];if(Y){var J=E(Y.subarray(8,12));J==="vide"?w.type="video":J==="soun"?w.type="audio":w.type=J}var le=T(b,["mdia","minf","stbl","stsd"])[0];if(le){var me=le.subarray(8);w.codec=E(me.subarray(4,8));var Ae=T(me,[w.codec])[0],ye,Ue;Ae&&(/^[asm]vc[1-9]$/i.test(w.codec)?(ye=Ae.subarray(78),Ue=E(ye.subarray(4,8)),Ue==="avcC"&&ye.length>11?(w.codec+=".",w.codec+=x(ye[9]),w.codec+=x(ye[10]),w.codec+=x(ye[11])):w.codec="avc1.4d400d"):/^mp4[a,v]$/i.test(w.codec)?(ye=Ae.subarray(28),Ue=E(ye.subarray(4,8)),Ue==="esds"&&ye.length>20&&ye[19]!==0?(w.codec+="."+x(ye[19]),w.codec+="."+x(ye[20]>>>2&63).replace(/^0/,"")):w.codec="mp4a.40.2"):w.codec=w.codec.toLowerCase())}var Ke=T(b,["mdia","mdhd"])[0];Ke&&(w.timescale=Se(Ke)),S.push(w)}),S},ze=function(f,v=0){var S=T(f,["emsg"]);return S.map(b=>{var w=P.parseEmsgBox(new Uint8Array(b)),D=ui(w.message_data);return{cueTime:P.scaleTime(w.presentation_time,w.timescale,w.presentation_time_delta,v),duration:P.scaleTime(w.event_duration,w.timescale),frames:D}})};var Ji={findBox:T,parseType:E,timescale:Z,startTime:se,compositionStartTime:ge,videoTrackIds:xe,tracks:Pe,getTimescaleFromMediaHeader:Se,getEmsgID3:ze};const{parseTrun:nl}=Yi,{findBox:sl}=Ji;var al=j,Gu=function(f){var v=sl(f,["moof","traf"]),S=sl(f,["mdat"]),b=[];return S.forEach(function(w,D){var W=v[D];b.push({mdat:w,traf:W})}),b},ol=function(f,v,S){var b=v,w=S.defaultSampleDuration||0,D=S.defaultSampleSize||0,W=S.trackId,X=[];return f.forEach(function(Y){var J=nl(Y),le=J.samples;le.forEach(function(me){me.duration===void 0&&(me.duration=w),me.size===void 0&&(me.size=D),me.trackId=W,me.dts=b,me.compositionTimeOffset===void 0&&(me.compositionTimeOffset=0),typeof b=="bigint"?(me.pts=b+al.BigInt(me.compositionTimeOffset),b+=al.BigInt(me.duration)):(me.pts=b+me.compositionTimeOffset,b+=me.duration)}),X=X.concat(le)}),X},ll={getMdatTrafPairs:Gu,parseSamples:ol},Ot=hr.discardEmulationPreventionBytes,Ku=ma.CaptionStream,kr=Kn,QI=rl,YI=Da,{getMdatTrafPairs:JI,parseSamples:ZI}=ll,eP=function(f,v){for(var S=f,b=0;b<v.length;b++){var w=v[b];if(S<w.size)return w;S-=w.size}return null},tP=function(f,v,S){var b=new DataView(f.buffer,f.byteOffset,f.byteLength),w={logs:[],seiNals:[]},D,W,X,Y;for(W=0;W+4<f.length;W+=X)if(X=b.getUint32(W),W+=4,!(X<=0))switch(f[W]&31){case 6:var J=f.subarray(W+1,W+1+X),le=eP(W,v);if(D={nalUnitType:"sei_rbsp",size:X,data:J,escapedRBSP:Ot(J),trackId:S},le)D.pts=le.pts,D.dts=le.dts,Y=le;else if(Y)D.pts=Y.pts,D.dts=Y.dts;else{w.logs.push({level:"warn",message:"We've encountered a nal unit without data at "+W+" for trackId "+S+". See mux.js#223."});break}w.seiNals.push(D);break}return w},iP=function(f,v){var S={},b=JI(f);return b.forEach(function(w){var D=w.mdat,W=w.traf,X=kr(W,["tfhd"]),Y=YI(X[0]),J=Y.trackId,le=kr(W,["tfdt"]),me=le.length>0?QI(le[0]).baseMediaDecodeTime:0,Ae=kr(W,["trun"]),ye,Ue;v===J&&Ae.length>0&&(ye=ZI(Ae,me,Y),Ue=tP(D,ye,J),S[J]||(S[J]={seiNals:[],logs:[]}),S[J].seiNals=S[J].seiNals.concat(Ue.seiNals),S[J].logs=S[J].logs.concat(Ue.logs))}),S},rP=function(f,v,S){var b;if(v===null)return null;b=iP(f,v);var w=b[v]||{};return{seiNals:w.seiNals,logs:w.logs,timescale:S}},nP=function(){var f=!1,v,S,b,w,D,W;this.isInitialized=function(){return f},this.init=function(X){v=new Ku,f=!0,W=X?X.isPartial:!1,v.on("data",function(Y){Y.startTime=Y.startPts/w,Y.endTime=Y.endPts/w,D.captions.push(Y),D.captionStreams[Y.stream]=!0}),v.on("log",function(Y){D.logs.push(Y)})},this.isNewInit=function(X,Y){return X&&X.length===0||Y&&typeof Y=="object"&&Object.keys(Y).length===0?!1:b!==X[0]||w!==Y[b]},this.parse=function(X,Y,J){var le;if(this.isInitialized()){if(!Y||!J)return null;if(this.isNewInit(Y,J))b=Y[0],w=J[b];else if(b===null||!w)return S.push(X),null}else return null;for(;S.length>0;){var me=S.shift();this.parse(me,Y,J)}return le=rP(X,b,w),le&&le.logs&&(D.logs=D.logs.concat(le.logs)),le===null||!le.seiNals?D.logs.length?{logs:D.logs,captions:[],captionStreams:[]}:null:(this.pushNals(le.seiNals),this.flushStream(),D)},this.pushNals=function(X){if(!this.isInitialized()||!X||X.length===0)return null;X.forEach(function(Y){v.push(Y)})},this.flushStream=function(){if(!this.isInitialized())return null;W?v.partialFlush():v.flush()},this.clearParsedCaptions=function(){D.captions=[],D.captionStreams={},D.logs=[]},this.resetCaptionStream=function(){if(!this.isInitialized())return null;v.reset()},this.clearAllCaptions=function(){this.clearParsedCaptions(),this.resetCaptionStream()},this.reset=function(){S=[],b=null,w=null,D?this.clearParsedCaptions():D={captions:[],captionStreams:{},logs:[]},this.resetCaptionStream()},this.reset()},sP=nP;const{parseTfdt:aP}=Yi,Qn=Kn,{getTimescaleFromMediaHeader:oP}=Ji,{parseSamples:lP,getMdatTrafPairs:uP}=ll;var Dy=function(){let f=9e4;this.init=function(v){const S=Qn(v,["moov","trak","mdia","mdhd"])[0];S&&(f=oP(S))},this.parseSegment=function(v){const S=[],b=uP(v);let w=0;return b.forEach(function(D){const W=D.mdat,X=D.traf,Y=Qn(X,["tfdt"])[0],J=Qn(X,["tfhd"])[0],le=Qn(X,["trun"]);if(Y&&(w=aP(Y).baseMediaDecodeTime),le.length&&J){const me=lP(le,w,J);let Ae=0;me.forEach(function(ye){const Ue="utf-8",Ke=new TextDecoder(Ue),Zt=W.slice(Ae,Ae+ye.size);if(Qn(Zt,["vtte"])[0]){Ae+=ye.size;return}Qn(Zt,["vttc"]).forEach(function(ul){const cl=Qn(ul,["payl"])[0],hl=Qn(ul,["sttg"])[0],dl=ye.pts/f,Yu=(ye.pts+ye.duration)/f;let Ct,fl;if(cl)try{Ct=Ke.decode(cl)}catch(Ar){console.error(Ar)}if(hl)try{fl=Ke.decode(hl)}catch(Ar){console.error(Ar)}ye.duration&&Ct&&S.push({cueText:Ct,start:dl,end:Yu,settings:fl})}),Ae+=ye.size})}}),S}},of=gs,Ny=function(f){var v=f[1]&31;return v<<=8,v|=f[2],v},Xu=function(f){return!!(f[1]&64)},Qu=function(f){var v=0;return(f[3]&48)>>>4>1&&(v+=f[4]+1),v},cP=function(f,v){var S=Ny(f);return S===0?"pat":S===v?"pmt":v?"pes":null},hP=function(f){var v=Xu(f),S=4+Qu(f);return v&&(S+=f[S]+1),(f[S+10]&31)<<8|f[S+11]},dP=function(f){var v={},S=Xu(f),b=4+Qu(f);if(S&&(b+=f[b]+1),!!(f[b+5]&1)){var w,D,W;w=(f[b+1]&15)<<8|f[b+2],D=3+w-4,W=(f[b+10]&15)<<8|f[b+11];for(var X=12+W;X<D;){var Y=b+X;v[(f[Y+1]&31)<<8|f[Y+2]]=f[Y],X+=((f[Y+3]&15)<<8|f[Y+4])+5}return v}},fP=function(f,v){var S=Ny(f),b=v[S];switch(b){case of.H264_STREAM_TYPE:return"video";case of.ADTS_STREAM_TYPE:return"audio";case of.METADATA_STREAM_TYPE:return"timed-metadata";default:return null}},pP=function(f){var v=Xu(f);if(!v)return null;var S=4+Qu(f);if(S>=f.byteLength)return null;var b=null,w;return w=f[S+7],w&192&&(b={},b.pts=(f[S+9]&14)<<27|(f[S+10]&255)<<20|(f[S+11]&254)<<12|(f[S+12]&255)<<5|(f[S+13]&254)>>>3,b.pts*=4,b.pts+=(f[S+13]&6)>>>1,b.dts=b.pts,w&64&&(b.dts=(f[S+14]&14)<<27|(f[S+15]&255)<<20|(f[S+16]&254)<<12|(f[S+17]&255)<<5|(f[S+18]&254)>>>3,b.dts*=4,b.dts+=(f[S+18]&6)>>>1)),b},lf=function(f){switch(f){case 5:return"slice_layer_without_partitioning_rbsp_idr";case 6:return"sei_rbsp";case 7:return"seq_parameter_set_rbsp";case 8:return"pic_parameter_set_rbsp";case 9:return"access_unit_delimiter_rbsp";default:return null}},mP=function(f){for(var v=4+Qu(f),S=f.subarray(v),b=0,w=0,D=!1,W;w<S.byteLength-3;w++)if(S[w+2]===1){b=w+5;break}for(;b<S.byteLength;)switch(S[b]){case 0:if(S[b-1]!==0){b+=2;break}else if(S[b-2]!==0){b++;break}w+3!==b-2&&(W=lf(S[w+3]&31),W==="slice_layer_without_partitioning_rbsp_idr"&&(D=!0));do b++;while(S[b]!==1&&b<S.length);w=b-2,b+=3;break;case 1:if(S[b-1]!==0||S[b-2]!==0){b+=3;break}W=lf(S[w+3]&31),W==="slice_layer_without_partitioning_rbsp_idr"&&(D=!0),w=b-2,b+=3;break;default:b+=3;break}return S=S.subarray(w),b-=w,w=0,S&&S.byteLength>3&&(W=lf(S[w+3]&31),W==="slice_layer_without_partitioning_rbsp_idr"&&(D=!0)),D},gP={parseType:cP,parsePat:hP,parsePmt:dP,parsePayloadUnitStartIndicator:Xu,parsePesType:fP,parsePesTime:pP,videoPacketContainsKeyFrame:mP},Ly=gs,La=vs.handleRollover,ct={};ct.ts=gP,ct.aac=zn;var Ns=st.ONE_SECOND_IN_TS,Si=188,jr=71,vP=function(f,v){for(var S=0,b=Si,w,D;b<f.byteLength;){if(f[S]===jr&&f[b]===jr){switch(w=f.subarray(S,b),D=ct.ts.parseType(w,v.pid),D){case"pat":v.pid=ct.ts.parsePat(w);break;case"pmt":var W=ct.ts.parsePmt(w);v.table=v.table||{},Object.keys(W).forEach(function(X){v.table[X]=W[X]});break}S+=Si,b+=Si;continue}S++,b++}},Oy=function(f,v,S){for(var b=0,w=Si,D,W,X,Y,J,le=!1;w<=f.byteLength;){if(f[b]===jr&&(f[w]===jr||w===f.byteLength)){switch(D=f.subarray(b,w),W=ct.ts.parseType(D,v.pid),W){case"pes":X=ct.ts.parsePesType(D,v.table),Y=ct.ts.parsePayloadUnitStartIndicator(D),X==="audio"&&Y&&(J=ct.ts.parsePesTime(D),J&&(J.type="audio",S.audio.push(J),le=!0));break}if(le)break;b+=Si,w+=Si;continue}b++,w++}for(w=f.byteLength,b=w-Si,le=!1;b>=0;){if(f[b]===jr&&(f[w]===jr||w===f.byteLength)){switch(D=f.subarray(b,w),W=ct.ts.parseType(D,v.pid),W){case"pes":X=ct.ts.parsePesType(D,v.table),Y=ct.ts.parsePayloadUnitStartIndicator(D),X==="audio"&&Y&&(J=ct.ts.parsePesTime(D),J&&(J.type="audio",S.audio.push(J),le=!0));break}if(le)break;b-=Si,w-=Si;continue}b--,w--}},yP=function(f,v,S){for(var b=0,w=Si,D,W,X,Y,J,le,me,Ae,ye=!1,Ue={data:[],size:0};w<f.byteLength;){if(f[b]===jr&&f[w]===jr){switch(D=f.subarray(b,w),W=ct.ts.parseType(D,v.pid),W){case"pes":if(X=ct.ts.parsePesType(D,v.table),Y=ct.ts.parsePayloadUnitStartIndicator(D),X==="video"&&(Y&&!ye&&(J=ct.ts.parsePesTime(D),J&&(J.type="video",S.video.push(J),ye=!0)),!S.firstKeyFrame)){if(Y&&Ue.size!==0){for(le=new Uint8Array(Ue.size),me=0;Ue.data.length;)Ae=Ue.data.shift(),le.set(Ae,me),me+=Ae.byteLength;if(ct.ts.videoPacketContainsKeyFrame(le)){var Ke=ct.ts.parsePesTime(le);Ke?(S.firstKeyFrame=Ke,S.firstKeyFrame.type="video"):console.warn("Failed to extract PTS/DTS from PES at first keyframe. This could be an unusual TS segment, or else mux.js did not parse your TS segment correctly. If you know your TS segments do contain PTS/DTS on keyframes please file a bug report! You can try ffprobe to double check for yourself.")}Ue.size=0}Ue.data.push(D),Ue.size+=D.byteLength}break}if(ye&&S.firstKeyFrame)break;b+=Si,w+=Si;continue}b++,w++}for(w=f.byteLength,b=w-Si,ye=!1;b>=0;){if(f[b]===jr&&f[w]===jr){switch(D=f.subarray(b,w),W=ct.ts.parseType(D,v.pid),W){case"pes":X=ct.ts.parsePesType(D,v.table),Y=ct.ts.parsePayloadUnitStartIndicator(D),X==="video"&&Y&&(J=ct.ts.parsePesTime(D),J&&(J.type="video",S.video.push(J),ye=!0));break}if(ye)break;b-=Si,w-=Si;continue}b--,w--}},_P=function(f,v){if(f.audio&&f.audio.length){var S=v;(typeof S>"u"||isNaN(S))&&(S=f.audio[0].dts),f.audio.forEach(function(D){D.dts=La(D.dts,S),D.pts=La(D.pts,S),D.dtsTime=D.dts/Ns,D.ptsTime=D.pts/Ns})}if(f.video&&f.video.length){var b=v;if((typeof b>"u"||isNaN(b))&&(b=f.video[0].dts),f.video.forEach(function(D){D.dts=La(D.dts,b),D.pts=La(D.pts,b),D.dtsTime=D.dts/Ns,D.ptsTime=D.pts/Ns}),f.firstKeyFrame){var w=f.firstKeyFrame;w.dts=La(w.dts,b),w.pts=La(w.pts,b),w.dtsTime=w.dts/Ns,w.ptsTime=w.pts/Ns}}},TP=function(f){for(var v=!1,S=0,b=null,w=null,D=0,W=0,X;f.length-W>=3;){var Y=ct.aac.parseType(f,W);switch(Y){case"timed-metadata":if(f.length-W<10){v=!0;break}if(D=ct.aac.parseId3TagSize(f,W),D>f.length){v=!0;break}w===null&&(X=f.subarray(W,W+D),w=ct.aac.parseAacTimestamp(X)),W+=D;break;case"audio":if(f.length-W<7){v=!0;break}if(D=ct.aac.parseAdtsSize(f,W),D>f.length){v=!0;break}b===null&&(X=f.subarray(W,W+D),b=ct.aac.parseSampleRate(X)),S++,W+=D;break;default:W++;break}if(v)return null}if(b===null||w===null)return null;var J=Ns/b,le={audio:[{type:"audio",dts:w,pts:w},{type:"audio",dts:w+S*1024*J,pts:w+S*1024*J}]};return le},bP=function(f){var v={pid:null,table:null},S={};vP(f,v);for(var b in v.table)if(v.table.hasOwnProperty(b)){var w=v.table[b];switch(w){case Ly.H264_STREAM_TYPE:S.video=[],yP(f,v,S),S.video.length===0&&delete S.video;break;case Ly.ADTS_STREAM_TYPE:S.audio=[],Oy(f,v,S),S.audio.length===0&&delete S.audio;break}}return S},SP=function(f,v){var S=ct.aac.isLikelyAacData(f),b;return S?b=TP(f):b=bP(f),!b||!b.audio&&!b.video?null:(_P(b,v),b)},xP={inspect:SP,parseAudioPes_:Oy};const CP=function(f,v){v.on("data",function(S){const b=S.initSegment;S.initSegment={data:b.buffer,byteOffset:b.byteOffset,byteLength:b.byteLength};const w=S.data;S.data=w.buffer,f.postMessage({action:"data",segment:S,byteOffset:w.byteOffset,byteLength:w.byteLength},[S.data])}),v.on("done",function(S){f.postMessage({action:"done"})}),v.on("gopInfo",function(S){f.postMessage({action:"gopInfo",gopInfo:S})}),v.on("videoSegmentTimingInfo",function(S){const b={start:{decode:st.videoTsToSeconds(S.start.dts),presentation:st.videoTsToSeconds(S.start.pts)},end:{decode:st.videoTsToSeconds(S.end.dts),presentation:st.videoTsToSeconds(S.end.pts)},baseMediaDecodeTime:st.videoTsToSeconds(S.baseMediaDecodeTime)};S.prependedContentDuration&&(b.prependedContentDuration=st.videoTsToSeconds(S.prependedContentDuration)),f.postMessage({action:"videoSegmentTimingInfo",videoSegmentTimingInfo:b})}),v.on("audioSegmentTimingInfo",function(S){const b={start:{decode:st.videoTsToSeconds(S.start.dts),presentation:st.videoTsToSeconds(S.start.pts)},end:{decode:st.videoTsToSeconds(S.end.dts),presentation:st.videoTsToSeconds(S.end.pts)},baseMediaDecodeTime:st.videoTsToSeconds(S.baseMediaDecodeTime)};S.prependedContentDuration&&(b.prependedContentDuration=st.videoTsToSeconds(S.prependedContentDuration)),f.postMessage({action:"audioSegmentTimingInfo",audioSegmentTimingInfo:b})}),v.on("id3Frame",function(S){f.postMessage({action:"id3Frame",id3Frame:S})}),v.on("caption",function(S){f.postMessage({action:"caption",caption:S})}),v.on("trackinfo",function(S){f.postMessage({action:"trackinfo",trackInfo:S})}),v.on("audioTimingInfo",function(S){f.postMessage({action:"audioTimingInfo",audioTimingInfo:{start:st.videoTsToSeconds(S.start),end:st.videoTsToSeconds(S.end)}})}),v.on("videoTimingInfo",function(S){f.postMessage({action:"videoTimingInfo",videoTimingInfo:{start:st.videoTsToSeconds(S.start),end:st.videoTsToSeconds(S.end)}})}),v.on("log",function(S){f.postMessage({action:"log",log:S})})};class My{constructor(v,S){this.options=S||{},this.self=v,this.init()}init(){this.transmuxer&&this.transmuxer.dispose(),this.transmuxer=new Uu.Transmuxer(this.options),CP(this.self,this.transmuxer)}pushMp4Captions(v){this.captionParser||(this.captionParser=new sP,this.captionParser.init());const S=new Uint8Array(v.data,v.byteOffset,v.byteLength),b=this.captionParser.parse(S,v.trackIds,v.timescales);this.self.postMessage({action:"mp4Captions",captions:b&&b.captions||[],logs:b&&b.logs||[],data:S.buffer},[S.buffer])}initMp4WebVttParser(v){this.webVttParser||(this.webVttParser=new Dy);const S=new Uint8Array(v.data,v.byteOffset,v.byteLength);this.webVttParser.init(S)}getMp4WebVttText(v){this.webVttParser||(this.webVttParser=new Dy);const S=new Uint8Array(v.data,v.byteOffset,v.byteLength),b=this.webVttParser.parseSegment(S);this.self.postMessage({action:"getMp4WebVttText",mp4VttCues:b||[],data:S.buffer},[S.buffer])}probeMp4StartTime({timescales:v,data:S}){const b=Ji.startTime(v,S);this.self.postMessage({action:"probeMp4StartTime",startTime:b,data:S},[S.buffer])}probeMp4Tracks({data:v}){const S=Ji.tracks(v);this.self.postMessage({action:"probeMp4Tracks",tracks:S,data:v},[v.buffer])}probeEmsgID3({data:v,offset:S}){const b=Ji.getEmsgID3(v,S);this.self.postMessage({action:"probeEmsgID3",id3Frames:b,emsgData:v},[v.buffer])}probeTs({data:v,baseStartTime:S}){const b=typeof S=="number"&&!isNaN(S)?S*st.ONE_SECOND_IN_TS:void 0,w=xP.inspect(v,b);let D=null;w&&(D={hasVideo:w.video&&w.video.length===2||!1,hasAudio:w.audio&&w.audio.length===2||!1},D.hasVideo&&(D.videoStart=w.video[0].ptsTime),D.hasAudio&&(D.audioStart=w.audio[0].ptsTime)),this.self.postMessage({action:"probeTs",result:D,data:v},[v.buffer])}clearAllMp4Captions(){this.captionParser&&this.captionParser.clearAllCaptions()}clearParsedMp4Captions(){this.captionParser&&this.captionParser.clearParsedCaptions()}push(v){const S=new Uint8Array(v.data,v.byteOffset,v.byteLength);this.transmuxer.push(S)}reset(){this.transmuxer.reset()}setTimestampOffset(v){const S=v.timestampOffset||0;this.transmuxer.setBaseMediaDecodeTime(Math.round(st.secondsToVideoTs(S)))}setAudioAppendStart(v){this.transmuxer.setAudioAppendStart(Math.ceil(st.secondsToVideoTs(v.appendStart)))}setRemux(v){this.transmuxer.setRemux(v.remux)}flush(v){this.transmuxer.flush(),self.postMessage({action:"done",type:"transmuxed"})}endTimeline(){this.transmuxer.endTimeline(),self.postMessage({action:"endedtimeline",type:"transmuxed"})}alignGopsWith(v){this.transmuxer.alignGopsWith(v.gopsToAlignWith.slice())}}self.onmessage=function(f){if(f.data.action==="init"&&f.data.options){this.messageHandlers=new My(self,f.data.options);return}this.messageHandlers||(this.messageHandlers=new My(self)),f.data&&f.data.action&&f.data.action!=="init"&&this.messageHandlers[f.data.action]&&this.messageHandlers[f.data.action](f.data)}}));var DM=O2(PM);const NM=(s,e,t)=>{const{type:i,initSegment:r,captions:n,captionStreams:a,metadata:o,videoFrameDtsTime:l,videoFramePtsTime:u}=s.data.segment;e.buffer.push({captions:n,captionStreams:a,metadata:o});const c=s.data.segment.boxes||{data:s.data.segment.data},h={type:i,data:new Uint8Array(c.data,c.data.byteOffset,c.data.byteLength),initSegment:new Uint8Array(r.data,r.byteOffset,r.byteLength)};typeof l<"u"&&(h.videoFrameDtsTime=l),typeof u<"u"&&(h.videoFramePtsTime=u),t(h)},LM=({transmuxedData:s,callback:e})=>{s.buffer=[],e(s)},OM=(s,e)=>{e.gopInfo=s.data.gopInfo},F2=s=>{const{transmuxer:e,bytes:t,audioAppendStart:i,gopsToAlignWith:r,remux:n,onData:a,onTrackInfo:o,onAudioTimingInfo:l,onVideoTimingInfo:u,onVideoSegmentTimingInfo:c,onAudioSegmentTimingInfo:h,onId3:d,onCaptions:g,onDone:y,onEndedTimeline:p,onTransmuxerLog:_,isEndOfTimeline:k,segment:A,triggerSegmentEventFn:N}=s,$={buffer:[]};let R=k;const L=B=>{e.currentTransmux===s&&(B.data.action==="data"&&NM(B,$,a),B.data.action==="trackinfo"&&o(B.data.trackInfo),B.data.action==="gopInfo"&&OM(B,$),B.data.action==="audioTimingInfo"&&l(B.data.audioTimingInfo),B.data.action==="videoTimingInfo"&&u(B.data.videoTimingInfo),B.data.action==="videoSegmentTimingInfo"&&c(B.data.videoSegmentTimingInfo),B.data.action==="audioSegmentTimingInfo"&&h(B.data.audioSegmentTimingInfo),B.data.action==="id3Frame"&&d([B.data.id3Frame],B.data.id3Frame.dispatchType),B.data.action==="caption"&&g(B.data.caption),B.data.action==="endedtimeline"&&(R=!1,p()),B.data.action==="log"&&_(B.data.log),B.data.type==="transmuxed"&&(R||(e.onmessage=null,LM({transmuxedData:$,callback:y}),B2(e))))},F=()=>{const B={message:"Received an error message from the transmuxer worker",metadata:{errorType:U.Error.StreamingFailedToTransmuxSegment,segmentInfo:Us({segment:A})}};y(null,B)};if(e.onmessage=L,e.onerror=F,i&&e.postMessage({action:"setAudioAppendStart",appendStart:i}),Array.isArray(r)&&e.postMessage({action:"alignGopsWith",gopsToAlignWith:r}),typeof n<"u"&&e.postMessage({action:"setRemux",remux:n}),t.byteLength){const B=t instanceof ArrayBuffer?t:t.buffer,C=t instanceof ArrayBuffer?0:t.byteOffset;N({type:"segmenttransmuxingstart",segment:A}),e.postMessage({action:"push",data:B,byteOffset:C,byteLength:t.byteLength},[B])}k&&e.postMessage({action:"endTimeline"}),e.postMessage({action:"flush"})},B2=s=>{s.currentTransmux=null,s.transmuxQueue.length&&(s.currentTransmux=s.transmuxQueue.shift(),typeof s.currentTransmux=="function"?s.currentTransmux():F2(s.currentTransmux))},iT=(s,e)=>{s.postMessage({action:e}),B2(s)},U2=(s,e)=>{if(!e.currentTransmux){e.currentTransmux=s,iT(e,s);return}e.transmuxQueue.push(iT.bind(null,e,s))},MM=s=>{U2("reset",s)},RM=s=>{U2("endTimeline",s)},$2=s=>{if(!s.transmuxer.currentTransmux){s.transmuxer.currentTransmux=s,F2(s);return}s.transmuxer.transmuxQueue.push(s)},FM=s=>{const e=new DM;e.currentTransmux=null,e.transmuxQueue=[];const t=e.terminate;return e.terminate=()=>(e.currentTransmux=null,e.transmuxQueue.length=0,t.call(e)),e.postMessage({action:"init",options:s}),e};var jf={reset:MM,endTimeline:RM,transmux:$2,createTransmuxer:FM};const no=function(s){const e=s.transmuxer,t=s.endAction||s.action,i=s.callback,r=ft({},s,{endAction:null,transmuxer:null,callback:null}),n=a=>{a.data.action===t&&(e.removeEventListener("message",n),a.data.data&&(a.data.data=new Uint8Array(a.data.data,s.byteOffset||0,s.byteLength||a.data.data.byteLength),s.data&&(s.data=a.data.data)),i(a.data))};if(e.addEventListener("message",n),s.data){const a=s.data instanceof ArrayBuffer;r.byteOffset=a?0:s.data.byteOffset,r.byteLength=s.data.byteLength;const o=[a?s.data:s.data.buffer];e.postMessage(r,o)}else e.postMessage(r)},Qr={FAILURE:2,TIMEOUT:-101,ABORTED:-102},j2="wvtt",Gg=s=>{s.forEach(e=>{e.abort()})},BM=s=>({bandwidth:s.bandwidth,bytesReceived:s.bytesReceived||0,roundTripTime:s.roundTripTime||0}),UM=s=>{const e=s.target,i={bandwidth:1/0,bytesReceived:0,roundTripTime:Date.now()-e.requestTime||0};return i.bytesReceived=s.loaded,i.bandwidth=Math.floor(i.bytesReceived/i.roundTripTime*8*1e3),i},y0=(s,e)=>{const{requestType:t}=e,i=Zs({requestType:t,request:e,error:s});return e.timedout?{status:e.status,message:"HLS request timed-out at URL: "+e.uri,code:Qr.TIMEOUT,xhr:e,metadata:i}:e.aborted?{status:e.status,message:"HLS request aborted at URL: "+e.uri,code:Qr.ABORTED,xhr:e,metadata:i}:s?{status:e.status,message:"HLS request errored at URL: "+e.uri,code:Qr.FAILURE,xhr:e,metadata:i}:e.responseType==="arraybuffer"&&e.response.byteLength===0?{status:e.status,message:"Empty HLS response at URL: "+e.uri,code:Qr.FAILURE,xhr:e,metadata:i}:null},rT=(s,e,t,i)=>(r,n)=>{const a=n.response,o=y0(r,n);if(o)return t(o,s);if(a.byteLength!==16)return t({status:n.status,message:"Invalid HLS key at URL: "+n.uri,code:Qr.FAILURE,xhr:n},s);const l=new DataView(a),u=new Uint32Array([l.getUint32(0),l.getUint32(4),l.getUint32(8),l.getUint32(12)]);for(let h=0;h<e.length;h++)e[h].bytes=u;const c={uri:n.uri};return i({type:"segmentkeyloadcomplete",segment:s,keyInfo:c}),t(null,s)},$M=(s,e)=>{e===j2&&s.transmuxer.postMessage({action:"initMp4WebVttParser",data:s.map.bytes})},jM=(s,e,t)=>{e===j2&&no({action:"getMp4WebVttText",data:s.bytes,transmuxer:s.transmuxer,callback:({data:i,mp4VttCues:r})=>{s.bytes=i,t(null,s,{mp4VttCues:r})}})},q2=(s,e)=>{const t=jv(s.map.bytes);if(t!=="mp4"){const i=s.map.resolvedUri||s.map.uri,r=t||"unknown";return e({internal:!0,message:`Found unsupported ${r} container for initialization segment at URL: ${i}`,code:Qr.FAILURE,metadata:{mediaType:r}})}no({action:"probeMp4Tracks",data:s.map.bytes,transmuxer:s.transmuxer,callback:({tracks:i,data:r})=>(s.map.bytes=r,i.forEach(function(n){s.map.tracks=s.map.tracks||{},!s.map.tracks[n.type]&&(s.map.tracks[n.type]=n,typeof n.id=="number"&&n.timescale&&(s.map.timescales=s.map.timescales||{},s.map.timescales[n.id]=n.timescale),n.type==="text"&&$M(s,n.codec))}),e(null))})},qM=({segment:s,finishProcessingFn:e,triggerSegmentEventFn:t})=>(i,r)=>{const n=y0(i,r);if(n)return e(n,s);const a=new Uint8Array(r.response);if(t({type:"segmentloaded",segment:s}),s.map.key)return s.map.encryptedBytes=a,e(null,s);s.map.bytes=a,q2(s,function(o){if(o)return o.xhr=r,o.status=r.status,e(o,s);e(null,s)})},VM=({segment:s,finishProcessingFn:e,responseType:t,triggerSegmentEventFn:i})=>(r,n)=>{const a=y0(r,n);if(a)return e(a,s);i({type:"segmentloaded",segment:s});const o=t==="arraybuffer"||!n.responseText?n.response:AM(n.responseText.substring(s.lastReachedChar||0));return s.stats=BM(n),s.key?s.encryptedBytes=new Uint8Array(o):s.bytes=new Uint8Array(o),e(null,s)},HM=({segment:s,bytes:e,trackInfoFn:t,timingInfoFn:i,videoSegmentTimingInfoFn:r,audioSegmentTimingInfoFn:n,id3Fn:a,captionsFn:o,isEndOfTimeline:l,endedTimelineFn:u,dataFn:c,doneFn:h,onTransmuxerLog:d,triggerSegmentEventFn:g})=>{const y=s.map&&s.map.tracks||{},p=!!(y.audio&&y.video);let _=i.bind(null,s,"audio","start");const k=i.bind(null,s,"audio","end");let A=i.bind(null,s,"video","start");const N=i.bind(null,s,"video","end"),$=()=>$2({bytes:e,transmuxer:s.transmuxer,audioAppendStart:s.audioAppendStart,gopsToAlignWith:s.gopsToAlignWith,remux:p,onData:R=>{R.type=R.type==="combined"?"video":R.type,c(s,R)},onTrackInfo:R=>{t&&(p&&(R.isMuxed=!0),t(s,R))},onAudioTimingInfo:R=>{_&&typeof R.start<"u"&&(_(R.start),_=null),k&&typeof R.end<"u"&&k(R.end)},onVideoTimingInfo:R=>{A&&typeof R.start<"u"&&(A(R.start),A=null),N&&typeof R.end<"u"&&N(R.end)},onVideoSegmentTimingInfo:R=>{const L={pts:{start:R.start.presentation,end:R.end.presentation},dts:{start:R.start.decode,end:R.end.decode}};g({type:"segmenttransmuxingtiminginfoavailable",segment:s,timingInfo:L}),r(R)},onAudioSegmentTimingInfo:R=>{const L={pts:{start:R.start.pts,end:R.end.pts},dts:{start:R.start.dts,end:R.end.dts}};g({type:"segmenttransmuxingtiminginfoavailable",segment:s,timingInfo:L}),n(R)},onId3:(R,L)=>{a(s,R,L)},onCaptions:R=>{o(s,[R])},isEndOfTimeline:l,onEndedTimeline:()=>{u()},onTransmuxerLog:d,onDone:(R,L)=>{h&&(R.type=R.type==="combined"?"video":R.type,g({type:"segmenttransmuxingcomplete",segment:s}),h(L,s,R))},segment:s,triggerSegmentEventFn:g});no({action:"probeTs",transmuxer:s.transmuxer,data:e,baseStartTime:s.baseStartTime,callback:R=>{s.bytes=e=R.data;const L=R.result;L&&(t(s,{hasAudio:L.hasAudio,hasVideo:L.hasVideo,isMuxed:p}),t=null),$()}})},V2=({segment:s,bytes:e,trackInfoFn:t,timingInfoFn:i,videoSegmentTimingInfoFn:r,audioSegmentTimingInfoFn:n,id3Fn:a,captionsFn:o,isEndOfTimeline:l,endedTimelineFn:u,dataFn:c,doneFn:h,onTransmuxerLog:d,triggerSegmentEventFn:g})=>{let y=new Uint8Array(e);if(hL(y)){s.isFmp4=!0;const{tracks:p}=s.map;if(p.text&&(!p.audio||!p.video)){c(s,{data:y,type:"text"}),jM(s,p.text.codec,h);return}const k={isFmp4:!0,hasVideo:!!p.video,hasAudio:!!p.audio};p.audio&&p.audio.codec&&p.audio.codec!=="enca"&&(k.audioCodec=p.audio.codec),p.video&&p.video.codec&&p.video.codec!=="encv"&&(k.videoCodec=p.video.codec),p.video&&p.audio&&(k.isMuxed=!0),t(s,k);const A=(N,$)=>{c(s,{data:y,type:k.hasAudio&&!k.isMuxed?"audio":"video"}),$&&$.length&&a(s,$),N&&N.length&&o(s,N),h(null,s,{})};no({action:"probeMp4StartTime",timescales:s.map.timescales,data:y,transmuxer:s.transmuxer,callback:({data:N,startTime:$})=>{e=N.buffer,s.bytes=y=N,k.hasAudio&&!k.isMuxed&&i(s,"audio","start",$),k.hasVideo&&i(s,"video","start",$),no({action:"probeEmsgID3",data:y,transmuxer:s.transmuxer,offset:$,callback:({emsgData:R,id3Frames:L})=>{if(e=R.buffer,s.bytes=y=R,!p.video||!R.byteLength||!s.transmuxer){A(void 0,L);return}no({action:"pushMp4Captions",endAction:"mp4Captions",transmuxer:s.transmuxer,data:y,timescales:s.map.timescales,trackIds:[p.video.id],callback:F=>{e=F.data.buffer,s.bytes=y=F.data,F.logs.forEach(function(B){d(lt(B,{stream:"mp4CaptionParser"}))}),A(F.captions,L)}})}})}});return}if(!s.transmuxer){h(null,s,{});return}if(typeof s.container>"u"&&(s.container=jv(y)),s.container!=="ts"&&s.container!=="aac"){t(s,{hasAudio:!1,hasVideo:!1}),h(null,s,{});return}HM({segment:s,bytes:e,trackInfoFn:t,timingInfoFn:i,videoSegmentTimingInfoFn:r,audioSegmentTimingInfoFn:n,id3Fn:a,captionsFn:o,isEndOfTimeline:l,endedTimelineFn:u,dataFn:c,doneFn:h,onTransmuxerLog:d,triggerSegmentEventFn:g})},H2=function({id:s,key:e,encryptedBytes:t,decryptionWorker:i,segment:r,doneFn:n},a){const o=u=>{if(u.data.source===s){i.removeEventListener("message",o);const c=u.data.decrypted;a(new Uint8Array(c.bytes,c.byteOffset,c.byteLength))}};i.onerror=()=>{const u="An error occurred in the decryption worker",c=Us({segment:r}),h={message:u,metadata:{error:new Error(u),errorType:U.Error.StreamingFailedToDecryptSegment,segmentInfo:c,keyInfo:{uri:r.key.resolvedUri||r.map.key.resolvedUri}}};n(h,r)},i.addEventListener("message",o);let l;e.bytes.slice?l=e.bytes.slice():l=new Uint32Array(Array.prototype.slice.call(e.bytes)),i.postMessage(A2({source:s,encrypted:t,key:l,iv:e.iv}),[t.buffer,l.buffer])},zM=({decryptionWorker:s,segment:e,trackInfoFn:t,timingInfoFn:i,videoSegmentTimingInfoFn:r,audioSegmentTimingInfoFn:n,id3Fn:a,captionsFn:o,isEndOfTimeline:l,endedTimelineFn:u,dataFn:c,doneFn:h,onTransmuxerLog:d,triggerSegmentEventFn:g})=>{g({type:"segmentdecryptionstart"}),H2({id:e.requestId,key:e.key,encryptedBytes:e.encryptedBytes,decryptionWorker:s,segment:e,doneFn:h},y=>{e.bytes=y,g({type:"segmentdecryptioncomplete",segment:e}),V2({segment:e,bytes:e.bytes,trackInfoFn:t,timingInfoFn:i,videoSegmentTimingInfoFn:r,audioSegmentTimingInfoFn:n,id3Fn:a,captionsFn:o,isEndOfTimeline:l,endedTimelineFn:u,dataFn:c,doneFn:h,onTransmuxerLog:d,triggerSegmentEventFn:g})})},WM=({activeXhrs:s,decryptionWorker:e,trackInfoFn:t,timingInfoFn:i,videoSegmentTimingInfoFn:r,audioSegmentTimingInfoFn:n,id3Fn:a,captionsFn:o,isEndOfTimeline:l,endedTimelineFn:u,dataFn:c,doneFn:h,onTransmuxerLog:d,triggerSegmentEventFn:g})=>{let y=0,p=!1;return(_,k)=>{if(!p){if(_)return p=!0,Gg(s),h(_,k);if(y+=1,y===s.length){const A=function(){if(k.encryptedBytes)return zM({decryptionWorker:e,segment:k,trackInfoFn:t,timingInfoFn:i,videoSegmentTimingInfoFn:r,audioSegmentTimingInfoFn:n,id3Fn:a,captionsFn:o,isEndOfTimeline:l,endedTimelineFn:u,dataFn:c,doneFn:h,onTransmuxerLog:d,triggerSegmentEventFn:g});V2({segment:k,bytes:k.bytes,trackInfoFn:t,timingInfoFn:i,videoSegmentTimingInfoFn:r,audioSegmentTimingInfoFn:n,id3Fn:a,captionsFn:o,isEndOfTimeline:l,endedTimelineFn:u,dataFn:c,doneFn:h,onTransmuxerLog:d,triggerSegmentEventFn:g})};if(k.endOfAllRequests=Date.now(),k.map&&k.map.encryptedBytes&&!k.map.bytes)return g({type:"segmentdecryptionstart",segment:k}),H2({decryptionWorker:e,id:k.requestId+"-init",encryptedBytes:k.map.encryptedBytes,key:k.map.key,segment:k,doneFn:h},N=>{k.map.bytes=N,g({type:"segmentdecryptioncomplete",segment:k}),q2(k,$=>{if($)return Gg(s),h($,k);A()})});A()}}}},GM=({loadendState:s,abortFn:e})=>t=>{t.target.aborted&&e&&!s.calledAbortFn&&(e(),s.calledAbortFn=!0)},KM=({segment:s,progressFn:e,trackInfoFn:t,timingInfoFn:i,videoSegmentTimingInfoFn:r,audioSegmentTimingInfoFn:n,id3Fn:a,captionsFn:o,isEndOfTimeline:l,endedTimelineFn:u,dataFn:c})=>h=>{if(!h.target.aborted)return s.stats=lt(s.stats,UM(h)),!s.stats.firstBytesReceivedAt&&s.stats.bytesReceived&&(s.stats.firstBytesReceivedAt=Date.now()),e(h,s)},XM=({xhr:s,xhrOptions:e,decryptionWorker:t,segment:i,abortFn:r,progressFn:n,trackInfoFn:a,timingInfoFn:o,videoSegmentTimingInfoFn:l,audioSegmentTimingInfoFn:u,id3Fn:c,captionsFn:h,isEndOfTimeline:d,endedTimelineFn:g,dataFn:y,doneFn:p,onTransmuxerLog:_,triggerSegmentEventFn:k})=>{const A=[],N=WM({activeXhrs:A,decryptionWorker:t,trackInfoFn:a,timingInfoFn:o,videoSegmentTimingInfoFn:l,audioSegmentTimingInfoFn:u,id3Fn:c,captionsFn:h,isEndOfTimeline:d,endedTimelineFn:g,dataFn:y,doneFn:p,onTransmuxerLog:_,triggerSegmentEventFn:k});if(i.key&&!i.key.bytes){const B=[i.key];i.map&&!i.map.bytes&&i.map.key&&i.map.key.resolvedUri===i.key.resolvedUri&&B.push(i.map.key);const C=lt(e,{uri:i.key.resolvedUri,responseType:"arraybuffer",requestType:"segment-key"}),I=rT(i,B,N,k),G={uri:i.key.resolvedUri};k({type:"segmentkeyloadstart",segment:i,keyInfo:G});const H=s(C,I);A.push(H)}if(i.map&&!i.map.bytes){if(i.map.key&&(!i.key||i.key.resolvedUri!==i.map.key.resolvedUri)){const H=lt(e,{uri:i.map.key.resolvedUri,responseType:"arraybuffer",requestType:"segment-key"}),K=rT(i,[i.map.key],N,k),ie={uri:i.map.key.resolvedUri};k({type:"segmentkeyloadstart",segment:i,keyInfo:ie});const he=s(H,K);A.push(he)}const C=lt(e,{uri:i.map.resolvedUri,responseType:"arraybuffer",headers:zg(i.map),requestType:"segment-media-initialization"}),I=qM({segment:i,finishProcessingFn:N,triggerSegmentEventFn:k});k({type:"segmentloadstart",segment:i});const G=s(C,I);A.push(G)}const $=lt(e,{uri:i.part&&i.part.resolvedUri||i.resolvedUri,responseType:"arraybuffer",headers:zg(i),requestType:"segment"}),R=VM({segment:i,finishProcessingFn:N,responseType:$.responseType,triggerSegmentEventFn:k});k({type:"segmentloadstart",segment:i});const L=s($,R);L.addEventListener("progress",KM({segment:i,progressFn:n,trackInfoFn:a,timingInfoFn:o,videoSegmentTimingInfoFn:l,audioSegmentTimingInfoFn:u,id3Fn:c,captionsFn:h,isEndOfTimeline:d,endedTimelineFn:g,dataFn:y})),A.push(L);const F={};return A.forEach(B=>{B.addEventListener("loadend",GM({loadendState:F,abortFn:r}))}),()=>Gg(A)},QM=Tr("CodecUtils"),YM=function(s){const e=s.attributes||{};if(e.CODECS)return Vr(e.CODECS)},z2=(s,e)=>{const t=e.attributes||{};return s&&s.mediaGroups&&s.mediaGroups.AUDIO&&t.AUDIO&&s.mediaGroups.AUDIO[t.AUDIO]},JM=(s,e)=>{if(!z2(s,e))return!0;const t=e.attributes||{},i=s.mediaGroups.AUDIO[t.AUDIO];for(const r in i)if(!i[r].uri&&!i[r].playlists)return!0;return!1},nh=function(s){const e={};return s.forEach(({mediaType:t,type:i,details:r})=>{e[t]=e[t]||[],e[t].push(A1(`${i}${r}`))}),Object.keys(e).forEach(function(t){if(e[t].length>1){QM(`multiple ${t} codecs found as attributes: ${e[t].join(", ")}. Setting playlist codecs to null so that we wait for mux.js to probe segments for real codecs.`),e[t]=null;return}e[t]=e[t][0]}),e},nT=function(s){let e=0;return s.audio&&e++,s.video&&e++,e},$l=function(s,e){const t=e.attributes||{},i=nh(YM(e)||[]);if(z2(s,e)&&!i.audio&&!JM(s,e)){const r=nh(BD(s,t.AUDIO)||[]);r.audio&&(i.audio=r.audio)}return i},ac=Tr("PlaylistSelector"),sT=function(s){if(!s||!s.playlist)return;const e=s.playlist;return JSON.stringify({id:e.id,bandwidth:s.bandwidth,width:s.width,height:s.height,codecs:e.attributes&&e.attributes.CODECS||""})},sh=function(s,e){if(!s)return"";const t=O.getComputedStyle(s);return t?t[e]:""},so=function(s,e){const t=s.slice();s.sort(function(i,r){const n=e(i,r);return n===0?t.indexOf(i)-t.indexOf(r):n})},_0=function(s,e){let t,i;return s.attributes.BANDWIDTH&&(t=s.attributes.BANDWIDTH),t=t||O.Number.MAX_VALUE,e.attributes.BANDWIDTH&&(i=e.attributes.BANDWIDTH),i=i||O.Number.MAX_VALUE,t-i},ZM=function(s,e){let t,i;return s.attributes.RESOLUTION&&s.attributes.RESOLUTION.width&&(t=s.attributes.RESOLUTION.width),t=t||O.Number.MAX_VALUE,e.attributes.RESOLUTION&&e.attributes.RESOLUTION.width&&(i=e.attributes.RESOLUTION.width),i=i||O.Number.MAX_VALUE,t===i&&s.attributes.BANDWIDTH&&e.attributes.BANDWIDTH?s.attributes.BANDWIDTH-e.attributes.BANDWIDTH:t-i};let W2=function(s,e,t,i,r,n){if(!s)return;const a={bandwidth:e,width:t,height:i,limitRenditionByPlayerDimensions:r};let o=s.playlists;qi.isAudioOnly(s)&&(o=n.getAudioTrackPlaylists_(),a.audioOnly=!0);let l=o.map(R=>{let L;const F=R.attributes&&R.attributes.RESOLUTION&&R.attributes.RESOLUTION.width,B=R.attributes&&R.attributes.RESOLUTION&&R.attributes.RESOLUTION.height;return L=R.attributes&&R.attributes.BANDWIDTH,L=L||O.Number.MAX_VALUE,{bandwidth:L,width:F,height:B,playlist:R}});so(l,(R,L)=>R.bandwidth-L.bandwidth),l=l.filter(R=>!qi.isIncompatible(R.playlist));let u=l.filter(R=>qi.isEnabled(R.playlist));u.length||(u=l.filter(R=>!qi.isDisabled(R.playlist)));const c=u.filter(R=>R.bandwidth*ei.BANDWIDTH_VARIANCE<e);let h=c[c.length-1];const d=c.filter(R=>R.bandwidth===h.bandwidth)[0];if(r===!1){const R=d||u[0]||l[0];if(R&&R.playlist){let L="sortedPlaylistReps";return d&&(L="bandwidthBestRep"),u[0]&&(L="enabledPlaylistReps"),ac(`choosing ${sT(R)} using ${L} with options`,a),R.playlist}return ac("could not choose a playlist with options",a),null}const g=c.filter(R=>R.width&&R.height);so(g,(R,L)=>R.width-L.width);const y=g.filter(R=>R.width===t&&R.height===i);h=y[y.length-1];const p=y.filter(R=>R.bandwidth===h.bandwidth)[0];let _,k,A;p||(_=g.filter(R=>R.width>t||R.height>i),k=_.filter(R=>R.width===_[0].width&&R.height===_[0].height),h=k[k.length-1],A=k.filter(R=>R.bandwidth===h.bandwidth)[0]);let N;if(n.leastPixelDiffSelector){const R=g.map(L=>(L.pixelDiff=Math.abs(L.width-t)+Math.abs(L.height-i),L));so(R,(L,F)=>L.pixelDiff===F.pixelDiff?F.bandwidth-L.bandwidth:L.pixelDiff-F.pixelDiff),N=R[0]}const $=N||A||p||d||u[0]||l[0];if($&&$.playlist){let R="sortedPlaylistReps";return N?R="leastPixelDiffRep":A?R="resolutionPlusOneRep":p?R="resolutionBestRep":d?R="bandwidthBestRep":u[0]&&(R="enabledPlaylistReps"),ac(`choosing ${sT($)} using ${R} with options`,a),$.playlist}return ac("could not choose a playlist with options",a),null};const aT=function(){let s=this.useDevicePixelRatio&&O.devicePixelRatio||1;return isNaN(this.customPixelRatio)||(s=this.customPixelRatio),W2(this.playlists.main,this.systemBandwidth,parseInt(sh(this.tech_.el(),"width"),10)*s,parseInt(sh(this.tech_.el(),"height"),10)*s,this.limitRenditionByPlayerDimensions,this.playlistController_)},eR=function(s){let e=-1,t=-1;if(s<0||s>1)throw new Error("Moving average bandwidth decay must be between 0 and 1.");return function(){let i=this.useDevicePixelRatio&&O.devicePixelRatio||1;return isNaN(this.customPixelRatio)||(i=this.customPixelRatio),e<0&&(e=this.systemBandwidth,t=this.systemBandwidth),this.systemBandwidth>0&&this.systemBandwidth!==t&&(e=s*this.systemBandwidth+(1-s)*e,t=this.systemBandwidth),W2(this.playlists.main,e,parseInt(sh(this.tech_.el(),"width"),10)*i,parseInt(sh(this.tech_.el(),"height"),10)*i,this.limitRenditionByPlayerDimensions,this.playlistController_)}},tR=function(s){const{main:e,currentTime:t,bandwidth:i,duration:r,segmentDuration:n,timeUntilRebuffer:a,currentTimeline:o,syncController:l}=s,u=e.playlists.filter(y=>!qi.isIncompatible(y));let c=u.filter(qi.isEnabled);c.length||(c=u.filter(y=>!qi.isDisabled(y)));const d=c.filter(qi.hasAttribute.bind(null,"BANDWIDTH")).map(y=>{const _=l.getSyncPoint(y,r,o,t)?1:2,A=qi.estimateSegmentRequestTime(n,i,y)*_-a;return{playlist:y,rebufferingImpact:A}}),g=d.filter(y=>y.rebufferingImpact<=0);return so(g,(y,p)=>_0(p.playlist,y.playlist)),g.length?g[0]:(so(d,(y,p)=>y.rebufferingImpact-p.rebufferingImpact),d[0]||null)},iR=function(){const s=this.playlists.main.playlists.filter(qi.isEnabled);return so(s,(t,i)=>_0(t,i)),s.filter(t=>!!$l(this.playlists.main,t).video)[0]||null},rR=s=>{let e=0,t;return s.bytes&&(t=new Uint8Array(s.bytes),s.segments.forEach(i=>{t.set(i,e),e+=i.byteLength})),t};function G2(s){try{return new URL(s).pathname.split("/").slice(-2).join("/")}catch{return""}}const nR=function(s,e,t){if(!s[t]){e.trigger({type:"usage",name:"vhs-608"});let i=t;/^cc708_/.test(t)&&(i="SERVICE"+t.split("_")[1]);const r=e.textTracks().getTrackById(i);if(r)s[t]=r;else{const n=e.options_.vhs&&e.options_.vhs.captionServices||{};let a=t,o=t,l=!1;const u=n[i];u&&(a=u.label,o=u.language,l=u.default),s[t]=e.addRemoteTextTrack({kind:"captions",id:i,default:l,label:a,language:o},!1).track}}},sR=function({inbandTextTracks:s,captionArray:e,timestampOffset:t}){if(!e)return;const i=O.WebKitDataCue||O.VTTCue;e.forEach(r=>{const n=r.stream;r.content?r.content.forEach(a=>{const o=new i(r.startTime+t,r.endTime+t,a.text);o.line=a.line,o.align="left",o.position=a.position,o.positionAlign="line-left",s[n].addCue(o)}):s[n].addCue(new i(r.startTime+t,r.endTime+t,r.text))})},aR=function(s){Object.defineProperties(s.frame,{id:{get(){return U.log.warn("cue.frame.id is deprecated. Use cue.value.key instead."),s.value.key}},value:{get(){return U.log.warn("cue.frame.value is deprecated. Use cue.value.data instead."),s.value.data}},privateData:{get(){return U.log.warn("cue.frame.privateData is deprecated. Use cue.value.data instead."),s.value.data}}})},oR=({inbandTextTracks:s,metadataArray:e,timestampOffset:t,videoDuration:i})=>{if(!e)return;const r=O.WebKitDataCue||O.VTTCue,n=s.metadataTrack_;if(!n||(e.forEach(c=>{const h=c.cueTime+t;typeof h!="number"||O.isNaN(h)||h<0||!(h<1/0)||!c.frames||!c.frames.length||c.frames.forEach(d=>{const g=new r(h,h,d.value||d.url||d.data||"");g.frame=d,g.value=d,aR(g),n.addCue(g)})}),!n.cues||!n.cues.length))return;const a=n.cues,o=[];for(let c=0;c<a.length;c++)a[c]&&o.push(a[c]);const l=o.reduce((c,h)=>{const d=c[h.startTime]||[];return d.push(h),c[h.startTime]=d,c},{}),u=Object.keys(l).sort((c,h)=>Number(c)-Number(h));u.forEach((c,h)=>{const d=l[c],g=isFinite(i)?i:c,y=Number(u[h+1])||g;d.forEach(p=>{p.endTime=y})})},lR={id:"ID",class:"CLASS",startDate:"START-DATE",duration:"DURATION",endDate:"END-DATE",endOnNext:"END-ON-NEXT",plannedDuration:"PLANNED-DURATION",scte35Out:"SCTE35-OUT",scte35In:"SCTE35-IN"},uR=new Set(["id","class","startDate","duration","endDate","endOnNext","startTime","endTime","processDateRange"]),cR=({inbandTextTracks:s,dateRanges:e})=>{const t=s.metadataTrack_;if(!t)return;const i=O.WebKitDataCue||O.VTTCue;e.forEach(r=>{for(const n of Object.keys(r)){if(uR.has(n))continue;const a=new i(r.startTime,r.endTime,"");a.id=r.id,a.type="com.apple.quicktime.HLS",a.value={key:lR[n],data:r[n]},(n==="scte35Out"||n==="scte35In")&&(a.value.data=new Uint8Array(a.value.data.match(/[\da-f]{2}/gi)).buffer),t.addCue(a)}r.processDateRange()})},oT=(s,e,t)=>{s.metadataTrack_||(s.metadataTrack_=t.addRemoteTextTrack({kind:"metadata",label:"Timed Metadata"},!1).track,U.browser.IS_ANY_SAFARI||(s.metadataTrack_.inBandMetadataTrackDispatchType=e))},Al=function(s,e,t){let i,r;if(t&&t.cues)for(i=t.cues.length;i--;)r=t.cues[i],r.startTime>=s&&r.endTime<=e&&t.removeCue(r)},hR=function(s){const e=s.cues;if(!e)return;const t={};for(let i=e.length-1;i>=0;i--){const r=e[i],n=`${r.startTime}-${r.endTime}-${r.text}`;t[n]?s.removeCue(r):t[n]=r}},dR=(s,e,t)=>{if(typeof e>"u"||e===null||!s.length)return[];const i=Math.ceil((e-t+3)*qs.ONE_SECOND_IN_TS);let r;for(r=0;r<s.length&&!(s[r].pts>i);r++);return s.slice(r)},fR=(s,e,t)=>{if(!e.length)return s;if(t)return e.slice();const i=e[0].pts;let r=0;for(r;r<s.length&&!(s[r].pts>=i);r++);return s.slice(0,r).concat(e)},pR=(s,e,t,i)=>{const r=Math.ceil((e-i)*qs.ONE_SECOND_IN_TS),n=Math.ceil((t-i)*qs.ONE_SECOND_IN_TS),a=s.slice();let o=s.length;for(;o--&&!(s[o].pts<=n););if(o===-1)return a;let l=o+1;for(;l--&&!(s[l].pts<=r););return l=Math.max(l,0),a.splice(l,o-l+1),a},mR=function(s,e){if(!s&&!e||!s&&e||s&&!e)return!1;if(s===e)return!0;const t=Object.keys(s).sort(),i=Object.keys(e).sort();if(t.length!==i.length)return!1;for(let r=0;r<t.length;r++){const n=t[r];if(n!==i[r]||s[n]!==e[n])return!1}return!0},gR=function(s,e,t){e=e||[];const i=[];let r=0;for(let n=0;n<e.length;n++){const a=e[n];if(s===a.timeline&&(i.push(n),r+=a.duration,r>t))return n}return i.length===0?0:i[i.length-1]},yl=1,vR=500,lT=s=>typeof s=="number"&&isFinite(s),oc=1/60,yR=(s,e,t)=>s!=="main"||!e||!t?null:!t.hasAudio&&!t.hasVideo?"Neither audio nor video found in segment.":e.hasVideo&&!t.hasVideo?"Only audio found in segment when we expected video. We can't switch to audio only from a stream that had video. To get rid of this message, please add codec information to the manifest.":!e.hasVideo&&t.hasVideo?"Video found in segment when we expected only audio. We can't switch to a stream with video from an audio only stream. To get rid of this message, please add codec information to the manifest.":null,_R=(s,e,t)=>{let i=e-ei.BACK_BUFFER_LENGTH;s.length&&(i=Math.max(i,s.start(0)));const r=e-t;return Math.min(r,i)},Ra=s=>{const{startOfSegment:e,duration:t,segment:i,part:r,playlist:{mediaSequence:n,id:a,segments:o=[]},mediaIndex:l,partIndex:u,timeline:c}=s,h=o.length-1;let d="mediaIndex/partIndex increment";s.getMediaInfoForTime?d=`getMediaInfoForTime (${s.getMediaInfoForTime})`:s.isSyncRequest&&(d="getSyncSegmentCandidate (isSyncRequest)"),s.independent&&(d+=` with independent ${s.independent}`);const g=typeof u=="number",y=s.segment.uri?"segment":"pre-segment",p=g?d2({preloadSegment:i})-1:0;return`${y} [${n+l}/${n+h}]`+(g?` part [${u}/${p}]`:"")+` segment start/end [${i.start} => ${i.end}]`+(g?` part start/end [${r.start} => ${r.end}]`:"")+` startOfSegment [${e}] duration [${t}] timeline [${c}] selected by [${d}] playlist [${a}]`},uT=s=>`${s}TimingInfo`,TR=({segmentTimeline:s,currentTimeline:e,startOfSegment:t,buffered:i,overrideCheck:r})=>!r&&s===e?null:s<e?t:i.length?i.end(i.length-1):t,Kg=({timelineChangeController:s,currentTimeline:e,segmentTimeline:t,loaderType:i,audioDisabled:r})=>{if(e===t)return!1;if(i==="audio"){const n=s.lastTimelineChange({type:"main"});return!n||n.to!==t}if(i==="main"&&r){const n=s.pendingTimelineChange({type:"audio"});return!(n&&n.to===t)}return!1},bR=s=>{if(!s)return!1;const e=s.pendingTimelineChange({type:"audio"}),t=s.pendingTimelineChange({type:"main"}),i=e&&t,r=i&&e.to!==t.to;return!!(i&&e.from!==-1&&t.from!==-1&&r)},SR=s=>{s&&(s.pause(),s.resetEverything(),s.load())},xR=s=>{const e=s.timelineChangeController_.pendingTimelineChange({type:"audio"}),t=s.timelineChangeController_.pendingTimelineChange({type:"main"});return e&&t&&e.to<t.to},es=s=>{const e=s.pendingSegment_;if(!e)return;if(Kg({timelineChangeController:s.timelineChangeController_,currentTimeline:s.currentTimeline_,segmentTimeline:e.timeline,loaderType:s.loaderType_,audioDisabled:s.audioDisabled_})&&bR(s.timelineChangeController_)){if(xR(s)){s.timelineChangeController_.trigger("audioTimelineBehind");return}SR(s)}},CR=s=>{let e=0;return["video","audio"].forEach(function(t){const i=s[`${t}TimingInfo`];if(!i)return;const{start:r,end:n}=i;let a;typeof r=="bigint"||typeof n=="bigint"?a=O.BigInt(n)-O.BigInt(r):typeof r=="number"&&typeof n=="number"&&(a=n-r),typeof a<"u"&&a>e&&(e=a)}),typeof e=="bigint"&&e<Number.MAX_SAFE_INTEGER&&(e=Number(e)),e},cT=({segmentDuration:s,maxDuration:e})=>s?Math.round(s)>e+Kr:!1,ER=(s,e)=>{if(e!=="hls")return null;const t=CR({audioTimingInfo:s.audioTimingInfo,videoTimingInfo:s.videoTimingInfo});if(!t)return null;const i=s.playlist.targetDuration,r=cT({segmentDuration:t,maxDuration:i*2}),n=cT({segmentDuration:t,maxDuration:i}),a=`Segment with index ${s.mediaIndex} from playlist ${s.playlist.id} has a duration of ${t} when the reported duration is ${s.duration} and the target duration is ${i}. For HLS content, a duration in excess of the target duration may result in playback issues. See the HLS specification section on EXT-X-TARGETDURATION for more details: https://tools.ietf.org/html/draft-pantos-http-live-streaming-23#section-4.3.3.1`;return r||n?{severity:r?"warn":"info",message:a}:null},Us=({type:s,segment:e})=>{if(!e)return;const t=!!(e.key||e.map&&e.map.ke),i=!!(e.map&&!e.map.bytes),r=e.startOfSegment===void 0?e.start:e.startOfSegment;return{type:s||e.type,uri:e.resolvedUri||e.uri,start:r,duration:e.duration,isEncrypted:t,isMediaInitialization:i}};let Xg=class extends U.EventTarget{constructor(e,t={}){if(super(),!e)throw new TypeError("Initialization settings are required");if(typeof e.currentTime!="function")throw new TypeError("No currentTime getter specified");if(!e.mediaSource)throw new TypeError("No MediaSource specified");this.bandwidth=e.bandwidth,this.throughput={rate:0,count:0},this.roundTrip=NaN,this.resetStats_(),this.mediaIndex=null,this.partIndex=null,this.hasPlayed_=e.hasPlayed,this.currentTime_=e.currentTime,this.seekable_=e.seekable,this.seeking_=e.seeking,this.duration_=e.duration,this.mediaSource_=e.mediaSource,this.vhs_=e.vhs,this.loaderType_=e.loaderType,this.currentMediaInfo_=void 0,this.startingMediaInfo_=void 0,this.segmentMetadataTrack_=e.segmentMetadataTrack,this.goalBufferLength_=e.goalBufferLength,this.sourceType_=e.sourceType,this.sourceUpdater_=e.sourceUpdater,this.inbandTextTracks_=e.inbandTextTracks,this.state_="INIT",this.timelineChangeController_=e.timelineChangeController,this.shouldSaveSegmentTimingInfo_=!0,this.parse708captions_=e.parse708captions,this.useDtsForTimestampOffset_=e.useDtsForTimestampOffset,this.captionServices_=e.captionServices,this.exactManifestTimings=e.exactManifestTimings,this.addMetadataToTextTrack=e.addMetadataToTextTrack,this.checkBufferTimeout_=null,this.error_=void 0,this.currentTimeline_=-1,this.shouldForceTimestampOffsetAfterResync_=!1,this.pendingSegment_=null,this.xhrOptions_=null,this.pendingSegments_=[],this.audioDisabled_=!1,this.isPendingTimestampOffset_=!1,this.gopBuffer_=[],this.timeMapping_=0,this.safeAppend_=!1,this.appendInitSegment_={audio:!0,video:!0},this.playlistOfLastInitSegment_={audio:null,video:null},this.callQueue_=[],this.loadQueue_=[],this.metadataQueue_={id3:[],caption:[]},this.waitingOnRemove_=!1,this.quotaExceededErrorRetryTimeout_=null,this.activeInitSegmentId_=null,this.initSegments_={},this.cacheEncryptionKeys_=e.cacheEncryptionKeys,this.keyCache_={},this.decrypter_=e.decrypter,this.syncController_=e.syncController,this.syncPoint_={segmentIndex:0,time:0},this.transmuxer_=this.createTransmuxer_(),this.triggerSyncInfoUpdate_=()=>this.trigger("syncinfoupdate"),this.syncController_.on("syncinfoupdate",this.triggerSyncInfoUpdate_),this.mediaSource_.addEventListener("sourceopen",()=>{this.isEndOfStream_()||(this.ended_=!1)}),this.fetchAtBuffer_=!1,this.logger_=Tr(`SegmentLoader[${this.loaderType_}]`),Object.defineProperty(this,"state",{get(){return this.state_},set(i){i!==this.state_&&(this.logger_(`${this.state_} -> ${i}`),this.state_=i,this.trigger("statechange"))}}),this.sourceUpdater_.on("ready",()=>{this.hasEnoughInfoToAppend_()?this.processCallQueue_():es(this)}),this.sourceUpdater_.on("codecschange",i=>{this.trigger(ft({type:"codecschange"},i))}),this.loaderType_==="main"&&this.timelineChangeController_.on("pendingtimelinechange",()=>{this.hasEnoughInfoToAppend_()?this.processCallQueue_():es(this)}),this.loaderType_==="audio"&&this.timelineChangeController_.on("timelinechange",i=>{this.trigger(ft({type:"timelinechange"},i)),this.hasEnoughInfoToLoad_()?this.processLoadQueue_():es(this),this.hasEnoughInfoToAppend_()?this.processCallQueue_():es(this)})}get mediaSequenceSync_(){return this.syncController_.getMediaSequenceSync(this.loaderType_)}createTransmuxer_(){return jf.createTransmuxer({remux:!1,alignGopsAtEnd:this.safeAppend_,keepOriginalTimestamps:!0,parse708captions:this.parse708captions_,captionServices:this.captionServices_})}resetStats_(){this.mediaBytesTransferred=0,this.mediaRequests=0,this.mediaRequestsAborted=0,this.mediaRequestsTimedout=0,this.mediaRequestsErrored=0,this.mediaTransferDuration=0,this.mediaSecondsLoaded=0,this.mediaAppends=0}dispose(){this.trigger("dispose"),this.state="DISPOSED",this.pause(),this.abort_(),this.transmuxer_&&this.transmuxer_.terminate(),this.resetStats_(),this.checkBufferTimeout_&&O.clearTimeout(this.checkBufferTimeout_),this.syncController_&&this.triggerSyncInfoUpdate_&&this.syncController_.off("syncinfoupdate",this.triggerSyncInfoUpdate_),this.off()}setAudio(e){this.audioDisabled_=!e,e?this.appendInitSegment_.audio=!0:this.sourceUpdater_.removeAudio(0,this.duration_())}abort(){if(this.state!=="WAITING"){this.pendingSegment_&&(this.pendingSegment_=null);return}this.abort_(),this.state="READY",this.paused()||this.monitorBuffer_()}abort_(){this.pendingSegment_&&this.pendingSegment_.abortRequests&&this.pendingSegment_.abortRequests(),this.pendingSegment_=null,this.callQueue_=[],this.loadQueue_=[],this.metadataQueue_.id3=[],this.metadataQueue_.caption=[],this.timelineChangeController_.clearPendingTimelineChange(this.loaderType_),this.waitingOnRemove_=!1,O.clearTimeout(this.quotaExceededErrorRetryTimeout_),this.quotaExceededErrorRetryTimeout_=null}checkForAbort_(e){return this.state==="APPENDING"&&!this.pendingSegment_?(this.state="READY",!0):!this.pendingSegment_||this.pendingSegment_.requestId!==e}error(e){return typeof e<"u"&&(this.logger_("error occurred:",e),this.error_=e),this.pendingSegment_=null,this.error_}endOfStream(){this.ended_=!0,this.transmuxer_&&jf.reset(this.transmuxer_),this.gopBuffer_.length=0,this.pause(),this.trigger("ended")}buffered_(){const e=this.getMediaInfo_();if(!this.sourceUpdater_||!e)return ni();if(this.loaderType_==="main"){const{hasAudio:t,hasVideo:i,isMuxed:r}=e;if(i&&t&&!this.audioDisabled_&&!r)return this.sourceUpdater_.buffered();if(i)return this.sourceUpdater_.videoBuffered()}return this.sourceUpdater_.audioBuffered()}initSegmentForMap(e,t=!1){if(!e)return null;const i=rh(e);let r=this.initSegments_[i];return t&&!r&&e.bytes&&(this.initSegments_[i]=r={resolvedUri:e.resolvedUri,byterange:e.byterange,bytes:e.bytes,tracks:e.tracks,timescales:e.timescales}),r||e}segmentKey(e,t=!1){if(!e)return null;const i=I2(e);let r=this.keyCache_[i];this.cacheEncryptionKeys_&&t&&!r&&e.bytes&&(this.keyCache_[i]=r={resolvedUri:e.resolvedUri,bytes:e.bytes});const n={resolvedUri:(r||e).resolvedUri};return r&&(n.bytes=r.bytes),n}couldBeginLoading_(){return this.playlist_&&!this.paused()}load(){if(this.monitorBuffer_(),!!this.playlist_){if(this.state==="INIT"&&this.couldBeginLoading_())return this.init_();!this.couldBeginLoading_()||this.state!=="READY"&&this.state!=="INIT"||(this.state="READY")}}init_(){return this.state="READY",this.resetEverything(),this.monitorBuffer_()}playlist(e,t={}){if(!e)return;const i=this.playlist_,r=this.pendingSegment_;this.playlist_=e,this.xhrOptions_=t,this.state==="INIT"&&(e.syncInfo={mediaSequence:e.mediaSequence,time:0},this.loaderType_==="main"&&this.syncController_.setDateTimeMappingForStart(e));let n=null;if(i&&(i.id?n=i.id:i.uri&&(n=i.uri)),this.logger_(`playlist update [${n} => ${e.id||e.uri}]`),this.mediaSequenceSync_&&(this.mediaSequenceSync_.update(e,this.currentTime_()),this.logger_(`Playlist update:
205
- currentTime: ${this.currentTime_()}
206
- bufferedEnd: ${Uf(this.buffered_())}
207
- `,this.mediaSequenceSync_.diagnostics)),this.trigger("syncinfoupdate"),this.state==="INIT"&&this.couldBeginLoading_())return this.init_();if(!i||i.uri!==e.uri){this.mediaIndex!==null&&(!e.endList&&typeof e.partTargetDuration=="number"?this.resetLoader():this.resyncLoader()),this.currentMediaInfo_=void 0,this.trigger("playlistupdate");return}const a=e.mediaSequence-i.mediaSequence;if(this.logger_(`live window shift [${a}]`),this.mediaIndex!==null)if(this.mediaIndex-=a,this.mediaIndex<0)this.mediaIndex=null,this.partIndex=null;else{const o=this.playlist_.segments[this.mediaIndex];if(this.partIndex&&(!o.parts||!o.parts.length||!o.parts[this.partIndex])){const l=this.mediaIndex;this.logger_(`currently processing part (index ${this.partIndex}) no longer exists.`),this.resetLoader(),this.mediaIndex=l}}r&&(r.mediaIndex-=a,r.mediaIndex<0?(r.mediaIndex=null,r.partIndex=null):(r.mediaIndex>=0&&(r.segment=e.segments[r.mediaIndex]),r.partIndex>=0&&r.segment.parts&&(r.part=r.segment.parts[r.partIndex]))),this.syncController_.saveExpiredSegmentInfo(i,e)}pause(){this.checkBufferTimeout_&&(O.clearTimeout(this.checkBufferTimeout_),this.checkBufferTimeout_=null)}paused(){return this.checkBufferTimeout_===null}resetEverything(e){this.ended_=!1,this.activeInitSegmentId_=null,this.appendInitSegment_={audio:!0,video:!0},this.resetLoader(),this.remove(0,1/0,e),this.transmuxer_&&(this.transmuxer_.postMessage({action:"clearAllMp4Captions"}),this.transmuxer_.postMessage({action:"reset"}))}resetLoader(){this.fetchAtBuffer_=!1,this.mediaSequenceSync_&&this.mediaSequenceSync_.resetAppendedStatus(),this.resyncLoader()}resyncLoader(){this.transmuxer_&&jf.reset(this.transmuxer_),this.mediaIndex=null,this.partIndex=null,this.syncPoint_=null,this.isPendingTimestampOffset_=!1;const e=this.currentMediaInfo_&&this.currentMediaInfo_.isFmp4;this.sourceType_==="hls"&&!e&&(this.shouldForceTimestampOffsetAfterResync_=!0),this.callQueue_=[],this.loadQueue_=[],this.metadataQueue_.id3=[],this.metadataQueue_.caption=[],this.abort(),this.transmuxer_&&this.transmuxer_.postMessage({action:"clearParsedMp4Captions"})}remove(e,t,i=()=>{},r=!1){if(t===1/0&&(t=this.duration_()),t<=e){this.logger_("skipping remove because end ${end} is <= start ${start}");return}if(!this.sourceUpdater_||!this.getMediaInfo_()){this.logger_("skipping remove because no source updater or starting media info");return}let n=1;const a=()=>{n--,n===0&&i()};(r||!this.audioDisabled_)&&(n++,this.sourceUpdater_.removeAudio(e,t,a)),(r||this.loaderType_==="main")&&(this.gopBuffer_=pR(this.gopBuffer_,e,t,this.timeMapping_),n++,this.sourceUpdater_.removeVideo(e,t,a));for(const o in this.inbandTextTracks_)Al(e,t,this.inbandTextTracks_[o]);Al(e,t,this.segmentMetadataTrack_),a()}monitorBuffer_(){this.checkBufferTimeout_&&O.clearTimeout(this.checkBufferTimeout_),this.checkBufferTimeout_=O.setTimeout(this.monitorBufferTick_.bind(this),1)}monitorBufferTick_(){this.state==="READY"&&this.fillBuffer_(),this.checkBufferTimeout_&&O.clearTimeout(this.checkBufferTimeout_),this.checkBufferTimeout_=O.setTimeout(this.monitorBufferTick_.bind(this),vR)}fillBuffer_(){if(this.sourceUpdater_.updating())return;const e=this.chooseNextRequest_();if(!e)return;const t={segmentInfo:Us({type:this.loaderType_,segment:e})};this.trigger({type:"segmentselected",metadata:t}),typeof e.timestampOffset=="number"&&(this.isPendingTimestampOffset_=!1,this.timelineChangeController_.pendingTimelineChange({type:this.loaderType_,from:this.currentTimeline_,to:e.timeline})),this.loadSegment_(e)}isEndOfStream_(e=this.mediaIndex,t=this.playlist_,i=this.partIndex){if(!t||!this.mediaSource_)return!1;const r=typeof e=="number"&&t.segments[e],n=e+1===t.segments.length,a=!r||!r.parts||i+1===r.parts.length;return t.endList&&this.mediaSource_.readyState==="open"&&n&&a}chooseNextRequest_(){const e=this.buffered_(),t=Uf(e)||0,i=p0(e,this.currentTime_()),r=!this.hasPlayed_()&&i>=1,n=i>=this.goalBufferLength_(),a=this.playlist_.segments;if(!a.length||r||n)return null;this.syncPoint_=this.syncPoint_||this.syncController_.getSyncPoint(this.playlist_,this.duration_(),this.currentTimeline_,this.currentTime_(),this.loaderType_);const o={partIndex:null,mediaIndex:null,startOfSegment:null,playlist:this.playlist_,isSyncRequest:!this.syncPoint_};if(o.isSyncRequest)o.mediaIndex=gR(this.currentTimeline_,a,t),this.logger_(`choose next request. Can not find sync point. Fallback to media Index: ${o.mediaIndex}`);else if(this.mediaIndex!==null){const d=a[this.mediaIndex],g=typeof this.partIndex=="number"?this.partIndex:-1;o.startOfSegment=d.end?d.end:t,d.parts&&d.parts[g+1]?(o.mediaIndex=this.mediaIndex,o.partIndex=g+1):o.mediaIndex=this.mediaIndex+1}else{let d,g,y;const p=this.fetchAtBuffer_?t:this.currentTime_();if(this.mediaSequenceSync_&&this.logger_(`chooseNextRequest_ request after Quality Switch:
208
- For TargetTime: ${p}.
209
- CurrentTime: ${this.currentTime_()}
210
- BufferedEnd: ${t}
211
- Fetch At Buffer: ${this.fetchAtBuffer_}
212
- `,this.mediaSequenceSync_.diagnostics),this.mediaSequenceSync_&&this.mediaSequenceSync_.isReliable){const _=this.getSyncInfoFromMediaSequenceSync_(p);if(!_){const k="No sync info found while using media sequence sync";return this.error({message:k,metadata:{errorType:U.Error.StreamingFailedToSelectNextSegment,error:new Error(k)}}),this.logger_("chooseNextRequest_ - no sync info found using media sequence sync"),null}this.logger_(`chooseNextRequest_ mediaSequence syncInfo (${_.start} --> ${_.end})`),d=_.segmentIndex,g=_.partIndex,y=_.start}else{this.logger_("chooseNextRequest_ - fallback to a regular segment selection algorithm, based on a syncPoint.");const _=qi.getMediaInfoForTime({exactManifestTimings:this.exactManifestTimings,playlist:this.playlist_,currentTime:p,startingPartIndex:this.syncPoint_.partIndex,startingSegmentIndex:this.syncPoint_.segmentIndex,startTime:this.syncPoint_.time});d=_.segmentIndex,g=_.partIndex,y=_.startTime}o.getMediaInfoForTime=this.fetchAtBuffer_?`bufferedEnd ${p}`:`currentTime ${p}`,o.mediaIndex=d,o.startOfSegment=y,o.partIndex=g,this.logger_(`choose next request. Playlist switched and we have a sync point. Media Index: ${o.mediaIndex} `)}const l=a[o.mediaIndex];let u=l&&typeof o.partIndex=="number"&&l.parts&&l.parts[o.partIndex];if(!l||typeof o.partIndex=="number"&&!u)return null;typeof o.partIndex!="number"&&l.parts&&(o.partIndex=0,u=l.parts[0]);const c=this.vhs_.playlists&&this.vhs_.playlists.main&&this.vhs_.playlists.main.independentSegments||this.playlist_.independentSegments;if(!i&&u&&!c&&!u.independent)if(o.partIndex===0){const d=a[o.mediaIndex-1],g=d.parts&&d.parts.length&&d.parts[d.parts.length-1];g&&g.independent&&(o.mediaIndex-=1,o.partIndex=d.parts.length-1,o.independent="previous segment")}else l.parts[o.partIndex-1].independent&&(o.partIndex-=1,o.independent="previous part");const h=this.mediaSource_&&this.mediaSource_.readyState==="ended";return o.mediaIndex>=a.length-1&&h&&!this.seeking_()?null:(this.shouldForceTimestampOffsetAfterResync_&&(this.shouldForceTimestampOffsetAfterResync_=!1,o.forceTimestampOffset=!0,this.logger_("choose next request. Force timestamp offset after loader resync")),this.generateSegmentInfo_(o))}getSyncInfoFromMediaSequenceSync_(e){if(!this.mediaSequenceSync_)return null;const t=Math.max(e,this.mediaSequenceSync_.start);e!==t&&this.logger_(`getSyncInfoFromMediaSequenceSync_. Pulled target time from ${e} to ${t}`);const i=this.mediaSequenceSync_.getSyncInfoForTime(t);if(!i)return null;if(!i.isAppended)return i;const r=this.mediaSequenceSync_.getSyncInfoForTime(i.end);return r?(r.isAppended&&this.logger_("getSyncInfoFromMediaSequenceSync_: We encounter unexpected scenario where next media sequence sync info is also appended!"),r):null}generateSegmentInfo_(e){const{independent:t,playlist:i,mediaIndex:r,startOfSegment:n,isSyncRequest:a,partIndex:o,forceTimestampOffset:l,getMediaInfoForTime:u}=e,c=i.segments[r],h=typeof o=="number"&&c.parts[o],d={requestId:"segment-loader-"+Math.random(),uri:h&&h.resolvedUri||c.resolvedUri,mediaIndex:r,partIndex:h?o:null,isSyncRequest:a,startOfSegment:n,playlist:i,bytes:null,encryptedBytes:null,timestampOffset:null,timeline:c.timeline,duration:h&&h.duration||c.duration,segment:c,part:h,byteLength:0,transmuxer:this.transmuxer_,getMediaInfoForTime:u,independent:t},g=typeof l<"u"?l:this.isPendingTimestampOffset_;d.timestampOffset=this.timestampOffsetForSegment_({segmentTimeline:c.timeline,currentTimeline:this.currentTimeline_,startOfSegment:n,buffered:this.buffered_(),overrideCheck:g});const y=Uf(this.sourceUpdater_.audioBuffered());return typeof y=="number"&&(d.audioAppendStart=y-this.sourceUpdater_.audioTimestampOffset()),this.sourceUpdater_.videoBuffered().length&&(d.gopsToAlignWith=dR(this.gopBuffer_,this.currentTime_()-this.sourceUpdater_.videoTimestampOffset(),this.timeMapping_)),d}timestampOffsetForSegment_(e){return TR(e)}earlyAbortWhenNeeded_(e){if(this.vhs_.tech_.paused()||!this.xhrOptions_.timeout||!this.playlist_.attributes.BANDWIDTH||Date.now()-(e.firstBytesReceivedAt||Date.now())<1e3)return;const t=this.currentTime_(),i=e.bandwidth,r=this.pendingSegment_.duration,n=qi.estimateSegmentRequestTime(r,i,this.playlist_,e.bytesReceived),a=jO(this.buffered_(),t,this.vhs_.tech_.playbackRate())-1;if(n<=a)return;const o=tR({main:this.vhs_.playlists.main,currentTime:t,bandwidth:i,duration:this.duration_(),segmentDuration:r,timeUntilRebuffer:a,currentTimeline:this.currentTimeline_,syncController:this.syncController_});if(!o)return;const u=n-a-o.rebufferingImpact;let c=.5;a<=Kr&&(c=1),!(!o.playlist||o.playlist.uri===this.playlist_.uri||u<c)&&(this.bandwidth=o.playlist.attributes.BANDWIDTH*ei.BANDWIDTH_VARIANCE+1,this.trigger("earlyabort"))}handleAbort_(e){this.logger_(`Aborting ${Ra(e)}`),this.mediaRequestsAborted+=1}handleProgress_(e,t){this.earlyAbortWhenNeeded_(t.stats),!this.checkForAbort_(t.requestId)&&this.trigger("progress")}handleTrackInfo_(e,t){const{hasAudio:i,hasVideo:r}=t,n={segmentInfo:Us({type:this.loaderType_,segment:e}),trackInfo:{hasAudio:i,hasVideo:r}};this.trigger({type:"segmenttransmuxingtrackinfoavailable",metadata:n}),this.earlyAbortWhenNeeded_(e.stats),!this.checkForAbort_(e.requestId)&&(this.checkForIllegalMediaSwitch(t)||(t=t||{},mR(this.currentMediaInfo_,t)||(this.appendInitSegment_={audio:!0,video:!0},this.startingMediaInfo_=t,this.currentMediaInfo_=t,this.logger_("trackinfo update",t),this.trigger("trackinfo")),!this.checkForAbort_(e.requestId)&&(this.pendingSegment_.trackInfo=t,this.hasEnoughInfoToAppend_()?this.processCallQueue_():es(this))))}handleTimingInfo_(e,t,i,r){if(this.earlyAbortWhenNeeded_(e.stats),this.checkForAbort_(e.requestId))return;const n=this.pendingSegment_,a=uT(t);n[a]=n[a]||{},n[a][i]=r,this.logger_(`timinginfo: ${t} - ${i} - ${r}`),this.hasEnoughInfoToAppend_()?this.processCallQueue_():es(this)}handleCaptions_(e,t){if(this.earlyAbortWhenNeeded_(e.stats),this.checkForAbort_(e.requestId))return;if(t.length===0){this.logger_("SegmentLoader received no captions from a caption event");return}if(!this.pendingSegment_.hasAppendedData_){this.metadataQueue_.caption.push(this.handleCaptions_.bind(this,e,t));return}const r=this.sourceUpdater_.videoTimestampOffset()===null?this.sourceUpdater_.audioTimestampOffset():this.sourceUpdater_.videoTimestampOffset(),n={};t.forEach(a=>{n[a.stream]=n[a.stream]||{startTime:1/0,captions:[],endTime:0};const o=n[a.stream];o.startTime=Math.min(o.startTime,a.startTime+r),o.endTime=Math.max(o.endTime,a.endTime+r),o.captions.push(a)}),Object.keys(n).forEach(a=>{const{startTime:o,endTime:l,captions:u}=n[a],c=this.inbandTextTracks_;this.logger_(`adding cues from ${o} -> ${l} for ${a}`),nR(c,this.vhs_.tech_,a),Al(o,l,c[a]),sR({captionArray:u,inbandTextTracks:c,timestampOffset:r})}),this.transmuxer_&&this.transmuxer_.postMessage({action:"clearParsedMp4Captions"})}handleId3_(e,t,i){if(this.earlyAbortWhenNeeded_(e.stats),this.checkForAbort_(e.requestId))return;if(!this.pendingSegment_.hasAppendedData_){this.metadataQueue_.id3.push(this.handleId3_.bind(this,e,t,i));return}this.addMetadataToTextTrack(i,t,this.duration_())}processMetadataQueue_(){this.metadataQueue_.id3.forEach(e=>e()),this.metadataQueue_.caption.forEach(e=>e()),this.metadataQueue_.id3=[],this.metadataQueue_.caption=[]}processCallQueue_(){const e=this.callQueue_;this.callQueue_=[],e.forEach(t=>t())}processLoadQueue_(){const e=this.loadQueue_;this.loadQueue_=[],e.forEach(t=>t())}hasEnoughInfoToLoad_(){if(this.loaderType_!=="audio")return!0;const e=this.pendingSegment_;return e?this.getCurrentMediaInfo_()?!Kg({timelineChangeController:this.timelineChangeController_,currentTimeline:this.currentTimeline_,segmentTimeline:e.timeline,loaderType:this.loaderType_,audioDisabled:this.audioDisabled_}):!0:!1}getCurrentMediaInfo_(e=this.pendingSegment_){return e&&e.trackInfo||this.currentMediaInfo_}getMediaInfo_(e=this.pendingSegment_){return this.getCurrentMediaInfo_(e)||this.startingMediaInfo_}getPendingSegmentPlaylist(){return this.pendingSegment_?this.pendingSegment_.playlist:null}hasEnoughInfoToAppend_(){if(!this.sourceUpdater_.ready()||this.waitingOnRemove_||this.quotaExceededErrorRetryTimeout_)return!1;const e=this.pendingSegment_,t=this.getCurrentMediaInfo_();if(!e||!t)return!1;const{hasAudio:i,hasVideo:r,isMuxed:n}=t;return!(r&&!e.videoTimingInfo||i&&!this.audioDisabled_&&!n&&!e.audioTimingInfo||Kg({timelineChangeController:this.timelineChangeController_,currentTimeline:this.currentTimeline_,segmentTimeline:e.timeline,loaderType:this.loaderType_,audioDisabled:this.audioDisabled_}))}handleData_(e,t){if(this.earlyAbortWhenNeeded_(e.stats),this.checkForAbort_(e.requestId))return;if(this.callQueue_.length||!this.hasEnoughInfoToAppend_()){es(this),this.callQueue_.push(this.handleData_.bind(this,e,t));return}const i=this.pendingSegment_;if(this.setTimeMapping_(i.timeline),this.updateMediaSecondsLoaded_(i.part||i.segment),this.mediaSource_.readyState!=="closed"){if(e.map&&(e.map=this.initSegmentForMap(e.map,!0),i.segment.map=e.map),e.key&&this.segmentKey(e.key,!0),i.isFmp4=e.isFmp4,i.timingInfo=i.timingInfo||{},i.isFmp4)this.trigger("fmp4"),i.timingInfo.start=i[uT(t.type)].start;else{const r=this.getCurrentMediaInfo_(),n=this.loaderType_==="main"&&r&&r.hasVideo;let a;n&&(a=i.videoTimingInfo.start),i.timingInfo.start=this.trueSegmentStart_({currentStart:i.timingInfo.start,playlist:i.playlist,mediaIndex:i.mediaIndex,currentVideoTimestampOffset:this.sourceUpdater_.videoTimestampOffset(),useVideoTimingInfo:n,firstVideoFrameTimeForData:a,videoTimingInfo:i.videoTimingInfo,audioTimingInfo:i.audioTimingInfo})}if(this.updateAppendInitSegmentStatus(i,t.type),this.updateSourceBufferTimestampOffset_(i),i.isSyncRequest){this.updateTimingInfoEnd_(i),this.syncController_.saveSegmentTimingInfo({segmentInfo:i,shouldSaveTimelineMapping:this.loaderType_==="main"});const r=this.chooseNextRequest_();if(r.mediaIndex!==i.mediaIndex||r.partIndex!==i.partIndex){this.logger_("sync segment was incorrect, not appending");return}this.logger_("sync segment was correct, appending")}i.hasAppendedData_=!0,this.processMetadataQueue_(),this.appendData_(i,t)}}updateAppendInitSegmentStatus(e,t){this.loaderType_==="main"&&typeof e.timestampOffset=="number"&&!e.changedTimestampOffset&&(this.appendInitSegment_={audio:!0,video:!0}),this.playlistOfLastInitSegment_[t]!==e.playlist&&(this.appendInitSegment_[t]=!0)}getInitSegmentAndUpdateState_({type:e,initSegment:t,map:i,playlist:r}){if(i){const n=rh(i);if(this.activeInitSegmentId_===n)return null;t=this.initSegmentForMap(i,!0).bytes,this.activeInitSegmentId_=n}return t&&this.appendInitSegment_[e]?(this.playlistOfLastInitSegment_[e]=r,this.appendInitSegment_[e]=!1,this.activeInitSegmentId_=null,t):null}handleQuotaExceededError_({segmentInfo:e,type:t,bytes:i},r){const n=this.sourceUpdater_.audioBuffered(),a=this.sourceUpdater_.videoBuffered();n.length>1&&this.logger_("On QUOTA_EXCEEDED_ERR, found gaps in the audio buffer: "+Vs(n).join(", ")),a.length>1&&this.logger_("On QUOTA_EXCEEDED_ERR, found gaps in the video buffer: "+Vs(a).join(", "));const o=n.length?n.start(0):0,l=n.length?n.end(n.length-1):0,u=a.length?a.start(0):0,c=a.length?a.end(a.length-1):0;if(l-o<=yl&&c-u<=yl){this.logger_(`On QUOTA_EXCEEDED_ERR, single segment too large to append to buffer, triggering an error. Appended byte length: ${i.byteLength}, audio buffer: ${Vs(n).join(", ")}, video buffer: ${Vs(a).join(", ")}, `),this.error({message:"Quota exceeded error with append of a single segment of content",excludeUntil:1/0}),this.trigger("error");return}this.waitingOnRemove_=!0,this.callQueue_.push(this.appendToSourceBuffer_.bind(this,{segmentInfo:e,type:t,bytes:i}));const d=this.currentTime_()-yl;this.logger_(`On QUOTA_EXCEEDED_ERR, removing audio/video from 0 to ${d}`),this.remove(0,d,()=>{this.logger_(`On QUOTA_EXCEEDED_ERR, retrying append in ${yl}s`),this.waitingOnRemove_=!1,this.quotaExceededErrorRetryTimeout_=O.setTimeout(()=>{this.logger_("On QUOTA_EXCEEDED_ERR, re-processing call queue"),this.quotaExceededErrorRetryTimeout_=null,this.processCallQueue_()},yl*1e3)},!0)}handleAppendError_({segmentInfo:e,type:t,bytes:i},r){if(r){if(r.code===x2){this.handleQuotaExceededError_({segmentInfo:e,type:t,bytes:i});return}this.logger_("Received non QUOTA_EXCEEDED_ERR on append",r),this.error({message:`${t} append of ${i.length}b failed for segment #${e.mediaIndex} in playlist ${e.playlist.id}`,metadata:{errorType:U.Error.StreamingFailedToAppendSegment}}),this.trigger("appenderror")}}appendToSourceBuffer_({segmentInfo:e,type:t,initSegment:i,data:r,bytes:n}){if(!n){const o=[r];let l=r.byteLength;i&&(o.unshift(i),l+=i.byteLength),n=rR({bytes:l,segments:o})}const a={segmentInfo:Us({type:this.loaderType_,segment:e})};this.trigger({type:"segmentappendstart",metadata:a}),this.sourceUpdater_.appendBuffer({segmentInfo:e,type:t,bytes:n},this.handleAppendError_.bind(this,{segmentInfo:e,type:t,bytes:n}))}handleSegmentTimingInfo_(e,t,i){if(!this.pendingSegment_||t!==this.pendingSegment_.requestId)return;const r=this.pendingSegment_.segment,n=`${e}TimingInfo`;r[n]||(r[n]={}),r[n].transmuxerPrependedSeconds=i.prependedContentDuration||0,r[n].transmuxedPresentationStart=i.start.presentation,r[n].transmuxedDecodeStart=i.start.decode,r[n].transmuxedPresentationEnd=i.end.presentation,r[n].transmuxedDecodeEnd=i.end.decode,r[n].baseMediaDecodeTime=i.baseMediaDecodeTime}appendData_(e,t){const{type:i,data:r}=t;if(!r||!r.byteLength||i==="audio"&&this.audioDisabled_)return;const n=this.getInitSegmentAndUpdateState_({type:i,initSegment:t.initSegment,playlist:e.playlist,map:e.isFmp4?e.segment.map:null});this.appendToSourceBuffer_({segmentInfo:e,type:i,initSegment:n,data:r})}loadSegment_(e){if(this.state="WAITING",this.pendingSegment_=e,this.trimBackBuffer_(e),typeof e.timestampOffset=="number"&&this.transmuxer_&&this.transmuxer_.postMessage({action:"clearAllMp4Captions"}),!this.hasEnoughInfoToLoad_()){es(this),this.loadQueue_.push(()=>{const t=ft({},e,{forceTimestampOffset:!0});ft(e,this.generateSegmentInfo_(t)),this.isPendingTimestampOffset_=!1,this.updateTransmuxerAndRequestSegment_(e)});return}this.updateTransmuxerAndRequestSegment_(e)}updateTransmuxerAndRequestSegment_(e){this.shouldUpdateTransmuxerTimestampOffset_(e.timestampOffset)&&(this.gopBuffer_.length=0,e.gopsToAlignWith=[],this.timeMapping_=0,this.transmuxer_.postMessage({action:"reset"}),this.transmuxer_.postMessage({action:"setTimestampOffset",timestampOffset:e.timestampOffset}));const t=this.createSimplifiedSegmentObj_(e),i=this.isEndOfStream_(e.mediaIndex,e.playlist,e.partIndex),r=this.mediaIndex!==null,n=e.timeline!==this.currentTimeline_&&e.timeline>0,a=i||r&&n;this.logger_(`Requesting
213
- ${G2(e.uri)}
214
- ${Ra(e)}`),t.map&&!t.map.bytes&&(this.logger_("going to request init segment."),this.appendInitSegment_={video:!0,audio:!0}),e.abortRequests=XM({xhr:this.vhs_.xhr,xhrOptions:this.xhrOptions_,decryptionWorker:this.decrypter_,segment:t,abortFn:this.handleAbort_.bind(this,e),progressFn:this.handleProgress_.bind(this),trackInfoFn:this.handleTrackInfo_.bind(this),timingInfoFn:this.handleTimingInfo_.bind(this),videoSegmentTimingInfoFn:this.handleSegmentTimingInfo_.bind(this,"video",e.requestId),audioSegmentTimingInfoFn:this.handleSegmentTimingInfo_.bind(this,"audio",e.requestId),captionsFn:this.handleCaptions_.bind(this),isEndOfTimeline:a,endedTimelineFn:()=>{this.logger_("received endedtimeline callback")},id3Fn:this.handleId3_.bind(this),dataFn:this.handleData_.bind(this),doneFn:this.segmentRequestFinished_.bind(this),onTransmuxerLog:({message:o,level:l,stream:u})=>{this.logger_(`${Ra(e)} logged from transmuxer stream ${u} as a ${l}: ${o}`)},triggerSegmentEventFn:({type:o,segment:l,keyInfo:u,trackInfo:c,timingInfo:h})=>{const g={segmentInfo:Us({segment:l})};u&&(g.keyInfo=u),c&&(g.trackInfo=c),h&&(g.timingInfo=h),this.trigger({type:o,metadata:g})}})}trimBackBuffer_(e){const t=_R(this.seekable_(),this.currentTime_(),this.playlist_.targetDuration||10);t>0&&this.remove(0,t)}createSimplifiedSegmentObj_(e){const t=e.segment,i=e.part,r=e.segment.key||e.segment.map&&e.segment.map.key,n=e.segment.map&&!e.segment.map.bytes,a={resolvedUri:i?i.resolvedUri:t.resolvedUri,byterange:i?i.byterange:t.byterange,requestId:e.requestId,transmuxer:e.transmuxer,audioAppendStart:e.audioAppendStart,gopsToAlignWith:e.gopsToAlignWith,part:e.part,type:this.loaderType_,start:e.startOfSegment,duration:e.duration,isEncrypted:r,isMediaInitialization:n},o=e.playlist.segments[e.mediaIndex-1];if(o&&o.timeline===t.timeline&&(o.videoTimingInfo?a.baseStartTime=o.videoTimingInfo.transmuxedDecodeEnd:o.audioTimingInfo&&(a.baseStartTime=o.audioTimingInfo.transmuxedDecodeEnd)),t.key){const l=t.key.iv||new Uint32Array([0,0,0,e.mediaIndex+e.playlist.mediaSequence]);a.key=this.segmentKey(t.key),a.key.iv=l}return t.map&&(a.map=this.initSegmentForMap(t.map)),a}saveTransferStats_(e){this.mediaRequests+=1,e&&(this.mediaBytesTransferred+=e.bytesReceived,this.mediaTransferDuration+=e.roundTripTime)}saveBandwidthRelatedStats_(e,t){if(this.pendingSegment_.byteLength=t.bytesReceived,e<oc){this.logger_(`Ignoring segment's bandwidth because its duration of ${e} is less than the min to record ${oc}`);return}const i={bandwidthInfo:{from:this.bandwidth,to:t.bandwidth}};this.trigger({type:"bandwidthupdated",metadata:i}),this.bandwidth=t.bandwidth,this.roundTrip=t.roundTripTime}handleTimeout_(){this.mediaRequestsTimedout+=1,this.bandwidth=1,this.roundTrip=NaN,this.trigger("bandwidthupdate"),this.trigger("timeout")}segmentRequestFinished_(e,t,i){if(this.callQueue_.length){this.callQueue_.push(this.segmentRequestFinished_.bind(this,e,t,i));return}if(this.saveTransferStats_(t.stats),!this.pendingSegment_||t.requestId!==this.pendingSegment_.requestId)return;if(e){if(this.pendingSegment_=null,this.state="READY",e.code===Qr.ABORTED)return;if(this.pause(),e.code===Qr.TIMEOUT){this.handleTimeout_();return}this.mediaRequestsErrored+=1,this.error(e),this.trigger("error");return}const r=this.pendingSegment_;this.saveBandwidthRelatedStats_(r.duration,t.stats),r.endOfAllRequests=t.endOfAllRequests,i.gopInfo&&(this.gopBuffer_=fR(this.gopBuffer_,i.gopInfo,this.safeAppend_)),this.state="APPENDING",this.trigger("appending"),this.waitForAppendsToComplete_(r)}setTimeMapping_(e){const t=this.syncController_.mappingForTimeline(e);t!==null&&(this.timeMapping_=t)}updateMediaSecondsLoaded_(e){typeof e.start=="number"&&typeof e.end=="number"?this.mediaSecondsLoaded+=e.end-e.start:this.mediaSecondsLoaded+=e.duration}shouldUpdateTransmuxerTimestampOffset_(e){return e===null?!1:this.loaderType_==="main"&&e!==this.sourceUpdater_.videoTimestampOffset()||!this.audioDisabled_&&e!==this.sourceUpdater_.audioTimestampOffset()}trueSegmentStart_({currentStart:e,playlist:t,mediaIndex:i,firstVideoFrameTimeForData:r,currentVideoTimestampOffset:n,useVideoTimingInfo:a,videoTimingInfo:o,audioTimingInfo:l}){if(typeof e<"u")return e;if(!a)return l.start;const u=t.segments[i-1];return i===0||!u||typeof u.start>"u"||u.end!==r+n?r:o.start}waitForAppendsToComplete_(e){const t=this.getCurrentMediaInfo_(e);if(!t){this.error({message:"No starting media returned, likely due to an unsupported media format.",playlistExclusionDuration:1/0}),this.trigger("error");return}const{hasAudio:i,hasVideo:r,isMuxed:n}=t,a=this.loaderType_==="main"&&r,o=!this.audioDisabled_&&i&&!n;if(e.waitingOnAppends=0,!e.hasAppendedData_){!e.timingInfo&&typeof e.timestampOffset=="number"&&(this.isPendingTimestampOffset_=!0),e.timingInfo={start:0},e.waitingOnAppends++,this.isPendingTimestampOffset_||(this.updateSourceBufferTimestampOffset_(e),this.processMetadataQueue_()),this.checkAppendsDone_(e);return}a&&e.waitingOnAppends++,o&&e.waitingOnAppends++,a&&this.sourceUpdater_.videoQueueCallback(this.checkAppendsDone_.bind(this,e)),o&&this.sourceUpdater_.audioQueueCallback(this.checkAppendsDone_.bind(this,e))}checkAppendsDone_(e){this.checkForAbort_(e.requestId)||(e.waitingOnAppends--,e.waitingOnAppends===0&&this.handleAppendsDone_())}checkForIllegalMediaSwitch(e){const t=yR(this.loaderType_,this.getCurrentMediaInfo_(),e);return t?(this.error({message:t,playlistExclusionDuration:1/0}),this.trigger("error"),!0):!1}updateSourceBufferTimestampOffset_(e){if(e.timestampOffset===null||typeof e.timingInfo.start!="number"||e.changedTimestampOffset||this.loaderType_!=="main")return;let t=!1;e.timestampOffset-=this.getSegmentStartTimeForTimestampOffsetCalculation_({videoTimingInfo:e.segment.videoTimingInfo,audioTimingInfo:e.segment.audioTimingInfo,timingInfo:e.timingInfo}),e.changedTimestampOffset=!0,e.timestampOffset!==this.sourceUpdater_.videoTimestampOffset()&&(this.sourceUpdater_.videoTimestampOffset(e.timestampOffset),t=!0),e.timestampOffset!==this.sourceUpdater_.audioTimestampOffset()&&(this.sourceUpdater_.audioTimestampOffset(e.timestampOffset),t=!0),t&&this.trigger("timestampoffset")}getSegmentStartTimeForTimestampOffsetCalculation_({videoTimingInfo:e,audioTimingInfo:t,timingInfo:i}){return this.useDtsForTimestampOffset_?e&&typeof e.transmuxedDecodeStart=="number"?e.transmuxedDecodeStart:t&&typeof t.transmuxedDecodeStart=="number"?t.transmuxedDecodeStart:i.start:i.start}updateTimingInfoEnd_(e){e.timingInfo=e.timingInfo||{};const t=this.getMediaInfo_(),r=this.loaderType_==="main"&&t&&t.hasVideo&&e.videoTimingInfo?e.videoTimingInfo:e.audioTimingInfo;r&&(e.timingInfo.end=typeof r.end=="number"?r.end:r.start+e.duration)}handleAppendsDone_(){if(this.pendingSegment_){const l={segmentInfo:Us({type:this.loaderType_,segment:this.pendingSegment_})};this.trigger({type:"appendsdone",metadata:l})}if(!this.pendingSegment_){this.state="READY",this.paused()||this.monitorBuffer_();return}const e=this.pendingSegment_;e.part&&e.part.syncInfo?e.part.syncInfo.markAppended():e.segment.syncInfo&&e.segment.syncInfo.markAppended(),this.updateTimingInfoEnd_(e),this.shouldSaveSegmentTimingInfo_&&this.syncController_.saveSegmentTimingInfo({segmentInfo:e,shouldSaveTimelineMapping:this.loaderType_==="main"});const t=ER(e,this.sourceType_);if(t&&(t.severity==="warn"?U.log.warn(t.message):this.logger_(t.message)),this.recordThroughput_(e),this.pendingSegment_=null,this.state="READY",e.isSyncRequest&&(this.trigger("syncinfoupdate"),!e.hasAppendedData_)){this.logger_(`Throwing away un-appended sync request ${Ra(e)}`);return}this.logger_(`Appended ${Ra(e)}`),this.addSegmentMetadataCue_(e),this.fetchAtBuffer_=!0,this.currentTimeline_!==e.timeline&&(this.timelineChangeController_.lastTimelineChange({type:this.loaderType_,from:this.currentTimeline_,to:e.timeline}),this.loaderType_==="main"&&!this.audioDisabled_&&this.timelineChangeController_.lastTimelineChange({type:"audio",from:this.currentTimeline_,to:e.timeline})),this.currentTimeline_=e.timeline,this.trigger("syncinfoupdate");const i=e.segment,r=e.part,n=i.end&&this.currentTime_()-i.end>e.playlist.targetDuration*3,a=r&&r.end&&this.currentTime_()-r.end>e.playlist.partTargetDuration*3;if(n||a){this.logger_(`bad ${n?"segment":"part"} ${Ra(e)}`),this.resetEverything();return}this.mediaIndex!==null&&this.trigger("bandwidthupdate"),this.trigger("progress"),this.mediaIndex=e.mediaIndex,this.partIndex=e.partIndex,this.isEndOfStream_(e.mediaIndex,e.playlist,e.partIndex)&&this.endOfStream(),this.trigger("appended"),e.hasAppendedData_&&this.mediaAppends++,this.paused()||this.monitorBuffer_()}recordThroughput_(e){if(e.duration<oc){this.logger_(`Ignoring segment's throughput because its duration of ${e.duration} is less than the min to record ${oc}`);return}const t=this.throughput.rate,i=Date.now()-e.endOfAllRequests+1,r=Math.floor(e.byteLength/i*8*1e3);this.throughput.rate+=(r-t)/++this.throughput.count}addSegmentMetadataCue_(e){if(!this.segmentMetadataTrack_)return;const t=e.segment,i=t.start,r=t.end;if(!lT(i)||!lT(r))return;Al(i,r,this.segmentMetadataTrack_);const n=O.WebKitDataCue||O.VTTCue,a={custom:t.custom,dateTimeObject:t.dateTimeObject,dateTimeString:t.dateTimeString,programDateTime:t.programDateTime,bandwidth:e.playlist.attributes.BANDWIDTH,resolution:e.playlist.attributes.RESOLUTION,codecs:e.playlist.attributes.CODECS,byteLength:e.byteLength,uri:e.uri,timeline:e.timeline,playlist:e.playlist.id,start:i,end:r},o=JSON.stringify(a),l=new n(i,r,o);l.value=a,this.segmentMetadataTrack_.addCue(l)}};function En(){}const K2=function(s){return typeof s!="string"?s:s.replace(/./,e=>e.toUpperCase())},wR=["video","audio"],Qg=(s,e)=>{const t=e[`${s}Buffer`];return t&&t.updating||e.queuePending[s]},kR=(s,e)=>{for(let t=0;t<e.length;t++){const i=e[t];if(i.type==="mediaSource")return null;if(i.type===s)return t}return null},ao=(s,e)=>{if(e.queue.length===0)return;let t=0,i=e.queue[t];if(i.type==="mediaSource"){!e.updating()&&e.mediaSource.readyState!=="closed"&&(e.queue.shift(),i.action(e),i.doneFn&&i.doneFn(),ao("audio",e),ao("video",e));return}if(s!=="mediaSource"&&!(!e.ready()||e.mediaSource.readyState==="closed"||Qg(s,e))){if(i.type!==s){if(t=kR(s,e.queue),t===null)return;i=e.queue[t]}if(e.queue.splice(t,1),e.queuePending[s]=i,i.action(s,e),!i.doneFn){e.queuePending[s]=null,ao(s,e);return}}},X2=(s,e)=>{const t=e[`${s}Buffer`],i=K2(s);t&&(t.removeEventListener("updateend",e[`on${i}UpdateEnd_`]),t.removeEventListener("error",e[`on${i}Error_`]),e.codecs[s]=null,e[`${s}Buffer`]=null)},zr=(s,e)=>s&&e&&Array.prototype.indexOf.call(s.sourceBuffers,e)!==-1,er={appendBuffer:(s,e,t)=>(i,r)=>{const n=r[`${i}Buffer`];if(zr(r.mediaSource,n)){r.logger_(`Appending segment ${e.mediaIndex}'s ${s.length} bytes to ${i}Buffer`);try{n.appendBuffer(s)}catch(a){r.logger_(`Error with code ${a.code} `+(a.code===x2?"(QUOTA_EXCEEDED_ERR) ":"")+`when appending segment ${e.mediaIndex} to ${i}Buffer`),r.queuePending[i]=null,t(a)}}},remove:(s,e)=>(t,i)=>{const r=i[`${t}Buffer`];if(zr(i.mediaSource,r)){i.logger_(`Removing ${s} to ${e} from ${t}Buffer`);try{r.remove(s,e)}catch{i.logger_(`Remove ${s} to ${e} from ${t}Buffer failed`)}}},timestampOffset:s=>(e,t)=>{const i=t[`${e}Buffer`];zr(t.mediaSource,i)&&(t.logger_(`Setting ${e}timestampOffset to ${s}`),i.timestampOffset=s)},callback:s=>(e,t)=>{s()},endOfStream:s=>e=>{if(e.mediaSource.readyState==="open"){e.logger_(`Calling mediaSource endOfStream(${s||""})`);try{e.mediaSource.endOfStream(s)}catch(t){U.log.warn("Failed to call media source endOfStream",t)}}},duration:s=>e=>{e.logger_(`Setting mediaSource duration to ${s}`);try{e.mediaSource.duration=s}catch(t){U.log.warn("Failed to set media source duration",t)}},abort:()=>(s,e)=>{if(e.mediaSource.readyState!=="open")return;const t=e[`${s}Buffer`];if(zr(e.mediaSource,t)){e.logger_(`calling abort on ${s}Buffer`);try{t.abort()}catch(i){U.log.warn(`Failed to abort on ${s}Buffer`,i)}}},addSourceBuffer:(s,e)=>t=>{const i=K2(s),r=fo(e);t.logger_(`Adding ${s}Buffer with codec ${e} to mediaSource`);const n=t.mediaSource.addSourceBuffer(r);n.addEventListener("updateend",t[`on${i}UpdateEnd_`]),n.addEventListener("error",t[`on${i}Error_`]),t.codecs[s]=e,t[`${s}Buffer`]=n},removeSourceBuffer:s=>e=>{const t=e[`${s}Buffer`];if(X2(s,e),!!zr(e.mediaSource,t)){e.logger_(`Removing ${s}Buffer with codec ${e.codecs[s]} from mediaSource`);try{e.mediaSource.removeSourceBuffer(t)}catch(i){U.log.warn(`Failed to removeSourceBuffer ${s}Buffer`,i)}}},changeType:s=>(e,t)=>{const i=t[`${e}Buffer`],r=fo(s);if(!zr(t.mediaSource,i))return;const n=s.substring(0,s.indexOf(".")),a=t.codecs[e];if(a.substring(0,a.indexOf("."))===n)return;const l={codecsChangeInfo:{from:a,to:s}};t.trigger({type:"codecschange",metadata:l}),t.logger_(`changing ${e}Buffer codec from ${a} to ${s}`);try{i.changeType(r),t.codecs[e]=s}catch(u){l.errorType=U.Error.StreamingCodecsChangeError,l.error=u,u.metadata=l,t.error_=u,t.trigger("error"),U.log.warn(`Failed to changeType on ${e}Buffer`,u)}}},tr=({type:s,sourceUpdater:e,action:t,doneFn:i,name:r})=>{e.queue.push({type:s,action:t,doneFn:i,name:r}),ao(s,e)},hT=(s,e)=>t=>{const i=e[`${s}Buffered`](),r=BO(i);if(e.logger_(`received "updateend" event for ${s} Source Buffer: `,r),e.queuePending[s]){const n=e.queuePending[s].doneFn;e.queuePending[s]=null,n&&n(e[`${s}Error_`])}ao(s,e)};let Q2=class extends U.EventTarget{constructor(e){super(),this.mediaSource=e,this.sourceopenListener_=()=>ao("mediaSource",this),this.mediaSource.addEventListener("sourceopen",this.sourceopenListener_),this.logger_=Tr("SourceUpdater"),this.audioTimestampOffset_=0,this.videoTimestampOffset_=0,this.queue=[],this.queuePending={audio:null,video:null},this.delayedAudioAppendQueue_=[],this.videoAppendQueued_=!1,this.codecs={},this.onVideoUpdateEnd_=hT("video",this),this.onAudioUpdateEnd_=hT("audio",this),this.onVideoError_=t=>{this.videoError_=t},this.onAudioError_=t=>{this.audioError_=t},this.createdSourceBuffers_=!1,this.initializedEme_=!1,this.triggeredReady_=!1}initializedEme(){this.initializedEme_=!0,this.triggerReady()}hasCreatedSourceBuffers(){return this.createdSourceBuffers_}hasInitializedAnyEme(){return this.initializedEme_}ready(){return this.hasCreatedSourceBuffers()&&this.hasInitializedAnyEme()}createSourceBuffers(e){this.hasCreatedSourceBuffers()||(this.addOrChangeSourceBuffers(e),this.createdSourceBuffers_=!0,this.trigger("createdsourcebuffers"),this.triggerReady())}triggerReady(){this.ready()&&!this.triggeredReady_&&(this.triggeredReady_=!0,this.trigger("ready"))}addSourceBuffer(e,t){tr({type:"mediaSource",sourceUpdater:this,action:er.addSourceBuffer(e,t),name:"addSourceBuffer"})}abort(e){tr({type:e,sourceUpdater:this,action:er.abort(e),name:"abort"})}removeSourceBuffer(e){if(!this.canRemoveSourceBuffer()){U.log.error("removeSourceBuffer is not supported!");return}tr({type:"mediaSource",sourceUpdater:this,action:er.removeSourceBuffer(e),name:"removeSourceBuffer"})}canRemoveSourceBuffer(){return!U.browser.IS_FIREFOX&&O.MediaSource&&O.MediaSource.prototype&&typeof O.MediaSource.prototype.removeSourceBuffer=="function"}static canChangeType(){return O.SourceBuffer&&O.SourceBuffer.prototype&&typeof O.SourceBuffer.prototype.changeType=="function"}canChangeType(){return this.constructor.canChangeType()}changeType(e,t){if(!this.canChangeType()){U.log.error("changeType is not supported!");return}tr({type:e,sourceUpdater:this,action:er.changeType(t),name:"changeType"})}addOrChangeSourceBuffers(e){if(!e||typeof e!="object"||Object.keys(e).length===0)throw new Error("Cannot addOrChangeSourceBuffers to undefined codecs");Object.keys(e).forEach(t=>{const i=e[t];if(!this.hasCreatedSourceBuffers())return this.addSourceBuffer(t,i);this.canChangeType()&&this.changeType(t,i)})}appendBuffer(e,t){const{segmentInfo:i,type:r,bytes:n}=e;if(this.processedAppend_=!0,r==="audio"&&this.videoBuffer&&!this.videoAppendQueued_){this.delayedAudioAppendQueue_.push([e,t]),this.logger_(`delayed audio append of ${n.length} until video append`);return}const a=t;if(tr({type:r,sourceUpdater:this,action:er.appendBuffer(n,i||{mediaIndex:-1},a),doneFn:t,name:"appendBuffer"}),r==="video"){if(this.videoAppendQueued_=!0,!this.delayedAudioAppendQueue_.length)return;const o=this.delayedAudioAppendQueue_.slice();this.logger_(`queuing delayed audio ${o.length} appendBuffers`),this.delayedAudioAppendQueue_.length=0,o.forEach(l=>{this.appendBuffer.apply(this,l)})}}audioBuffered(){return zr(this.mediaSource,this.audioBuffer)&&this.audioBuffer.buffered?this.audioBuffer.buffered:ni()}videoBuffered(){return zr(this.mediaSource,this.videoBuffer)&&this.videoBuffer.buffered?this.videoBuffer.buffered:ni()}buffered(){const e=zr(this.mediaSource,this.videoBuffer)?this.videoBuffer:null,t=zr(this.mediaSource,this.audioBuffer)?this.audioBuffer:null;return t&&!e?this.audioBuffered():e&&!t?this.videoBuffered():$O(this.audioBuffered(),this.videoBuffered())}setDuration(e,t=En){tr({type:"mediaSource",sourceUpdater:this,action:er.duration(e),name:"duration",doneFn:t})}endOfStream(e=null,t=En){typeof e!="string"&&(e=void 0),tr({type:"mediaSource",sourceUpdater:this,action:er.endOfStream(e),name:"endOfStream",doneFn:t})}removeAudio(e,t,i=En){if(!this.audioBuffered().length||this.audioBuffered().end(0)===0){i();return}tr({type:"audio",sourceUpdater:this,action:er.remove(e,t),doneFn:i,name:"remove"})}removeVideo(e,t,i=En){if(!this.videoBuffered().length||this.videoBuffered().end(0)===0){i();return}tr({type:"video",sourceUpdater:this,action:er.remove(e,t),doneFn:i,name:"remove"})}updating(){return!!(Qg("audio",this)||Qg("video",this))}audioTimestampOffset(e){return typeof e<"u"&&this.audioBuffer&&this.audioTimestampOffset_!==e&&(tr({type:"audio",sourceUpdater:this,action:er.timestampOffset(e),name:"timestampOffset"}),this.audioTimestampOffset_=e),this.audioTimestampOffset_}videoTimestampOffset(e){return typeof e<"u"&&this.videoBuffer&&this.videoTimestampOffset_!==e&&(tr({type:"video",sourceUpdater:this,action:er.timestampOffset(e),name:"timestampOffset"}),this.videoTimestampOffset_=e),this.videoTimestampOffset_}audioQueueCallback(e){this.audioBuffer&&tr({type:"audio",sourceUpdater:this,action:er.callback(e),name:"callback"})}videoQueueCallback(e){this.videoBuffer&&tr({type:"video",sourceUpdater:this,action:er.callback(e),name:"callback"})}dispose(){this.trigger("dispose"),wR.forEach(e=>{this.abort(e),this.canRemoveSourceBuffer()?this.removeSourceBuffer(e):this[`${e}QueueCallback`](()=>X2(e,this))}),this.videoAppendQueued_=!1,this.delayedAudioAppendQueue_.length=0,this.sourceopenListener_&&this.mediaSource.removeEventListener("sourceopen",this.sourceopenListener_),this.off()}};const dT=s=>decodeURIComponent(escape(String.fromCharCode.apply(null,s))),AR=s=>{const e=new Uint8Array(s);return Array.from(e).map(t=>t.toString(16).padStart(2,"0")).join("")},fT=new Uint8Array(`
215
-
216
- `.split("").map(s=>s.charCodeAt(0)));let IR=class extends Error{constructor(){super("Trying to parse received VTT cues, but there is no WebVTT. Make sure vtt.js is loaded.")}},PR=class extends Xg{constructor(e,t={}){super(e,t),this.mediaSource_=null,this.subtitlesTrack_=null,this.featuresNativeTextTracks_=e.featuresNativeTextTracks,this.loadVttJs=e.loadVttJs,this.shouldSaveSegmentTimingInfo_=!1}buffered_(){if(!this.subtitlesTrack_||!this.subtitlesTrack_.cues||!this.subtitlesTrack_.cues.length)return ni();const e=this.subtitlesTrack_.cues,t=e[0].startTime,i=e[e.length-1].startTime;return ni([[t,i]])}initSegmentForMap(e,t=!1){if(!e)return null;const i=rh(e);let r=this.initSegments_[i];if(t&&!r&&e.bytes){const n=fT.byteLength+e.bytes.byteLength,a=new Uint8Array(n);a.set(e.bytes),a.set(fT,e.bytes.byteLength),this.initSegments_[i]=r={resolvedUri:e.resolvedUri,byterange:e.byterange,bytes:a}}return r||e}couldBeginLoading_(){return this.playlist_&&this.subtitlesTrack_&&!this.paused()}init_(){return this.state="READY",this.resetEverything(),this.monitorBuffer_()}track(e){return typeof e>"u"?this.subtitlesTrack_:(this.subtitlesTrack_=e,this.state==="INIT"&&this.couldBeginLoading_()&&this.init_(),this.subtitlesTrack_)}remove(e,t){Al(e,t,this.subtitlesTrack_)}fillBuffer_(){const e=this.chooseNextRequest_();if(e){if(this.syncController_.timestampOffsetForTimeline(e.timeline)===null){const t=()=>{this.state="READY",this.paused()||this.monitorBuffer_()};this.syncController_.one("timestampoffset",t),this.state="WAITING_ON_TIMELINE";return}this.loadSegment_(e)}}timestampOffsetForSegment_(){return null}chooseNextRequest_(){return this.skipEmptySegments_(super.chooseNextRequest_())}skipEmptySegments_(e){for(;e&&e.segment.empty;){if(e.mediaIndex+1>=e.playlist.segments.length){e=null;break}e=this.generateSegmentInfo_({playlist:e.playlist,mediaIndex:e.mediaIndex+1,startOfSegment:e.startOfSegment+e.duration,isSyncRequest:e.isSyncRequest})}return e}stopForError(e){this.error(e),this.state="READY",this.pause(),this.trigger("error")}segmentRequestFinished_(e,t,i){if(!this.subtitlesTrack_){this.state="READY";return}if(this.saveTransferStats_(t.stats),!this.pendingSegment_){this.state="READY",this.mediaRequestsAborted+=1;return}if(e){e.code===Qr.TIMEOUT&&this.handleTimeout_(),e.code===Qr.ABORTED?this.mediaRequestsAborted+=1:this.mediaRequestsErrored+=1,this.stopForError(e);return}const r=this.pendingSegment_,n=i.mp4VttCues&&i.mp4VttCues.length;n&&(r.mp4VttCues=i.mp4VttCues),this.saveBandwidthRelatedStats_(r.duration,t.stats),t.key&&this.segmentKey(t.key,!0),this.state="APPENDING",this.trigger("appending");const a=r.segment;if(a.map&&(a.map.bytes=t.map.bytes),r.bytes=t.bytes,typeof O.WebVTT!="function"&&typeof this.loadVttJs=="function"){this.state="WAITING_ON_VTTJS",this.loadVttJs().then(()=>this.segmentRequestFinished_(e,t,i),()=>this.stopForError({message:"Error loading vtt.js"}));return}a.requested=!0;try{this.parseVTTCues_(r)}catch(o){this.stopForError({message:o.message,metadata:{errorType:U.Error.StreamingVttParserError,error:o}});return}if(n||this.updateTimeMapping_(r,this.syncController_.timelines[r.timeline],this.playlist_),r.cues.length?r.timingInfo={start:r.cues[0].startTime,end:r.cues[r.cues.length-1].endTime}:r.timingInfo={start:r.startOfSegment,end:r.startOfSegment+r.duration},r.isSyncRequest){this.trigger("syncinfoupdate"),this.pendingSegment_=null,this.state="READY";return}r.byteLength=r.bytes.byteLength,this.mediaSecondsLoaded+=a.duration,r.cues.forEach(o=>{this.subtitlesTrack_.addCue(this.featuresNativeTextTracks_?new O.VTTCue(o.startTime,o.endTime,o.text):o)}),hR(this.subtitlesTrack_),this.handleAppendsDone_()}handleData_(e,t){const i=e&&e.type==="vtt",r=t&&t.type==="text";i&&r&&super.handleData_(e,t)}updateTimingInfoEnd_(){}parseMp4VttCues_(e){const t=this.sourceUpdater_.videoTimestampOffset()===null?this.sourceUpdater_.audioTimestampOffset():this.sourceUpdater_.videoTimestampOffset();e.mp4VttCues.forEach(i=>{const r=i.start+t,n=i.end+t,a=new O.VTTCue(r,n,i.cueText);i.settings&&i.settings.split(" ").forEach(o=>{const l=o.split(":"),u=l[0],c=l[1];a[u]=isNaN(c)?c:Number(c)}),e.cues.push(a)})}parseVTTCues_(e){let t,i=!1;if(typeof O.WebVTT!="function")throw new IR;if(e.cues=[],e.timestampmap={MPEGTS:0,LOCAL:0},e.mp4VttCues){this.parseMp4VttCues_(e);return}typeof O.TextDecoder=="function"?t=new O.TextDecoder("utf8"):(t=O.WebVTT.StringDecoder(),i=!0);const r=new O.WebVTT.Parser(O,O.vttjs,t);if(r.oncue=e.cues.push.bind(e.cues),r.ontimestampmap=a=>{e.timestampmap=a},r.onparsingerror=a=>{U.log.warn("Error encountered when parsing cues: "+a.message)},e.segment.map){let a=e.segment.map.bytes;i&&(a=dT(a)),r.parse(a)}let n=e.bytes;i&&(n=dT(n)),r.parse(n),r.flush()}updateTimeMapping_(e,t,i){const r=e.segment;if(!t)return;if(!e.cues.length){r.empty=!0;return}const{MPEGTS:n,LOCAL:a}=e.timestampmap,l=n/qs.ONE_SECOND_IN_TS-a+t.mapping;if(e.cues.forEach(u=>{const c=u.endTime-u.startTime,h=this.handleRollover_(u.startTime+l,t.time);u.startTime=Math.max(h,0),u.endTime=Math.max(h+c,0)}),!i.syncInfo){const u=e.cues[0].startTime,c=e.cues[e.cues.length-1].startTime;i.syncInfo={mediaSequence:i.mediaSequence+e.mediaIndex,time:Math.min(u,c-r.duration)}}}handleRollover_(e,t){if(t===null)return e;let i=e*qs.ONE_SECOND_IN_TS;const r=t*qs.ONE_SECOND_IN_TS;let n;for(r<i?n=-8589934592:n=8589934592;Math.abs(i-r)>4294967296;)i+=n;return i/qs.ONE_SECOND_IN_TS}};const DR=function(s,e){const t=s.cues;for(let i=0;i<t.length;i++){const r=t[i];if(e>=r.adStartTime&&e<=r.adEndTime)return r}return null},NR=function(s,e,t=0){if(!s.segments)return;let i=t,r;for(let n=0;n<s.segments.length;n++){const a=s.segments[n];if(r||(r=DR(e,i+a.duration/2)),r){if("cueIn"in a){r.endTime=i,r.adEndTime=i,i+=a.duration,r=null;continue}if(i<r.endTime){i+=a.duration;continue}r.endTime+=a.duration}else if("cueOut"in a&&(r=new O.VTTCue(i,i+a.duration,a.cueOut),r.adStartTime=i,r.adEndTime=i+parseFloat(a.cueOut),e.addCue(r)),"cueOutCont"in a){const[o,l]=a.cueOutCont.split("/").map(parseFloat);r=new O.VTTCue(i,i+a.duration,""),r.adStartTime=i-o,r.adEndTime=r.adStartTime+l,e.addCue(r)}i+=a.duration}};class pT{constructor({start:e,end:t,segmentIndex:i,partIndex:r=null,appended:n=!1}){this.start_=e,this.end_=t,this.segmentIndex_=i,this.partIndex_=r,this.appended_=n}isInRange(e){return e>=this.start&&e<this.end}markAppended(){this.appended_=!0}resetAppendedStatus(){this.appended_=!1}get isAppended(){return this.appended_}get start(){return this.start_}get end(){return this.end_}get segmentIndex(){return this.segmentIndex_}get partIndex(){return this.partIndex_}}class LR{constructor(e,t=[]){this.segmentSyncInfo_=e,this.partsSyncInfo_=t}get segmentSyncInfo(){return this.segmentSyncInfo_}get partsSyncInfo(){return this.partsSyncInfo_}get hasPartsSyncInfo(){return this.partsSyncInfo_.length>0}resetAppendStatus(){this.segmentSyncInfo_.resetAppendedStatus(),this.partsSyncInfo_.forEach(e=>e.resetAppendedStatus())}}class Y2{constructor(){this.storage_=new Map,this.diagnostics_="",this.isReliable_=!1,this.start_=-1/0,this.end_=1/0}get start(){return this.start_}get end(){return this.end_}get diagnostics(){return this.diagnostics_}get isReliable(){return this.isReliable_}resetAppendedStatus(){this.storage_.forEach(e=>e.resetAppendStatus())}update(e,t){const{mediaSequence:i,segments:r}=e;if(this.isReliable_=this.isReliablePlaylist_(i,r),!!this.isReliable_)return this.updateStorage_(r,i,this.calculateBaseTime_(i,r,t))}getSyncInfoForTime(e){for(const{segmentSyncInfo:t,partsSyncInfo:i}of this.storage_.values())if(i.length){for(const r of i)if(r.isInRange(e))return r}else if(t.isInRange(e))return t;return null}getSyncInfoForMediaSequence(e){return this.storage_.get(e)}updateStorage_(e,t,i){const r=new Map;let n=`
217
- `,a=i,o=t;this.start_=a,e.forEach((l,u)=>{const c=this.storage_.get(o),h=a,d=h+l.duration,g=!!(c&&c.segmentSyncInfo&&c.segmentSyncInfo.isAppended),y=new pT({start:h,end:d,appended:g,segmentIndex:u});l.syncInfo=y;let p=a;const _=(l.parts||[]).map((k,A)=>{const N=p,$=p+k.duration,R=!!(c&&c.partsSyncInfo&&c.partsSyncInfo[A]&&c.partsSyncInfo[A].isAppended),L=new pT({start:N,end:$,appended:R,segmentIndex:u,partIndex:A});return p=$,n+=`Media Sequence: ${o}.${A} | Range: ${N} --> ${$} | Appended: ${R}
218
- `,k.syncInfo=L,L});r.set(o,new LR(y,_)),n+=`${G2(l.resolvedUri)} | Media Sequence: ${o} | Range: ${h} --> ${d} | Appended: ${g}
219
- `,o++,a=d}),this.end_=a,this.storage_=r,this.diagnostics_=n}calculateBaseTime_(e,t,i){if(!this.storage_.size)return 0;if(this.storage_.has(e))return this.storage_.get(e).segmentSyncInfo.start;const r=Math.min(...this.storage_.keys());if(e<r){const n=r-e;let a=this.storage_.get(r).segmentSyncInfo.start;for(let o=0;o<n;o++){const l=t[o];a-=l.duration}return a}return i}isReliablePlaylist_(e,t){return e!=null&&Array.isArray(t)&&t.length}}class mT extends Y2{constructor(e){super(),this.parent_=e}calculateBaseTime_(e,t,i){if(!this.storage_.size){const r=this.parent_.getSyncInfoForMediaSequence(e);return r?r.segmentSyncInfo.start:0}return super.calculateBaseTime_(e,t,i)}}const OR=86400,qf=[{name:"VOD",run:(s,e,t,i,r)=>t!==1/0?{time:0,segmentIndex:0,partIndex:null}:null},{name:"MediaSequence",run:(s,e,t,i,r,n)=>{const a=s.getMediaSequenceSync(n);if(!a||!a.isReliable)return null;const o=a.getSyncInfoForTime(r);return o?{time:o.start,partIndex:o.partIndex,segmentIndex:o.segmentIndex}:null}},{name:"ProgramDateTime",run:(s,e,t,i,r)=>{if(!Object.keys(s.timelineToDatetimeMappings).length)return null;let n=null,a=null;const o=$g(e);r=r||0;for(let l=0;l<o.length;l++){const u=e.endList||r===0?l:o.length-(l+1),c=o[u],h=c.segment,d=s.timelineToDatetimeMappings[h.timeline];if(!d||!h.dateTimeObject)continue;let y=h.dateTimeObject.getTime()/1e3+d;if(h.parts&&typeof c.partIndex=="number")for(let _=0;_<c.partIndex;_++)y+=h.parts[_].duration;const p=Math.abs(r-y);if(a!==null&&(p===0||a<p))break;a=p,n={time:y,segmentIndex:c.segmentIndex,partIndex:c.partIndex}}return n}},{name:"Segment",run:(s,e,t,i,r)=>{let n=null,a=null;r=r||0;const o=$g(e);for(let l=0;l<o.length;l++){const u=e.endList||r===0?l:o.length-(l+1),c=o[u],h=c.segment,d=c.part&&c.part.start||h&&h.start;if(h.timeline===i&&typeof d<"u"){const g=Math.abs(r-d);if(a!==null&&a<g)break;(!n||a===null||a>=g)&&(a=g,n={time:d,segmentIndex:c.segmentIndex,partIndex:c.partIndex})}}return n}},{name:"Discontinuity",run:(s,e,t,i,r)=>{let n=null;if(r=r||0,e.discontinuityStarts&&e.discontinuityStarts.length){let a=null;for(let o=0;o<e.discontinuityStarts.length;o++){const l=e.discontinuityStarts[o],u=e.discontinuitySequence+o+1,c=s.discontinuities[u];if(c){const h=Math.abs(r-c.time);if(a!==null&&a<h)break;(!n||a===null||a>=h)&&(a=h,n={time:c.time,segmentIndex:l,partIndex:null})}}}return n}},{name:"Playlist",run:(s,e,t,i,r)=>e.syncInfo?{time:e.syncInfo.time,segmentIndex:e.syncInfo.mediaSequence-e.mediaSequence,partIndex:null}:null}];let MR=class extends U.EventTarget{constructor(e={}){super(),this.timelines=[],this.discontinuities=[],this.timelineToDatetimeMappings={};const t=new Y2,i=new mT(t),r=new mT(t);this.mediaSequenceStorage_={main:t,audio:i,vtt:r},this.logger_=Tr("SyncController")}getMediaSequenceSync(e){return this.mediaSequenceStorage_[e]||null}getSyncPoint(e,t,i,r,n){if(t!==1/0)return qf.find(({name:l})=>l==="VOD").run(this,e,t);const a=this.runStrategies_(e,t,i,r,n);if(!a.length)return null;for(const o of a){const{syncPoint:l,strategy:u}=o,{segmentIndex:c,time:h}=l;if(c<0)continue;const d=e.segments[c],g=h,y=g+d.duration;if(this.logger_(`Strategy: ${u}. Current time: ${r}. selected segment: ${c}. Time: [${g} -> ${y}]}`),r>=g&&r<y)return this.logger_("Found sync point with exact match: ",l),l}return this.selectSyncPoint_(a,{key:"time",value:r})}getExpiredTime(e,t){if(!e||!e.segments)return null;const i=this.runStrategies_(e,t,e.discontinuitySequence,0);if(!i.length)return null;const r=this.selectSyncPoint_(i,{key:"segmentIndex",value:0});return r.segmentIndex>0&&(r.time*=-1),Math.abs(r.time+Ul({defaultDuration:e.targetDuration,durationList:e.segments,startIndex:r.segmentIndex,endIndex:0}))}runStrategies_(e,t,i,r,n){const a=[];for(let o=0;o<qf.length;o++){const l=qf[o],u=l.run(this,e,t,i,r,n);u&&(u.strategy=l.name,a.push({strategy:l.name,syncPoint:u}))}return a}selectSyncPoint_(e,t){let i=e[0].syncPoint,r=Math.abs(e[0].syncPoint[t.key]-t.value),n=e[0].strategy;for(let a=1;a<e.length;a++){const o=Math.abs(e[a].syncPoint[t.key]-t.value);o<r&&(r=o,i=e[a].syncPoint,n=e[a].strategy)}return this.logger_(`syncPoint for [${t.key}: ${t.value}] chosen with strategy [${n}]: [time:${i.time}, segmentIndex:${i.segmentIndex}`+(typeof i.partIndex=="number"?`,partIndex:${i.partIndex}`:"")+"]"),i}saveExpiredSegmentInfo(e,t){const i=t.mediaSequence-e.mediaSequence;if(i>OR){U.log.warn(`Not saving expired segment info. Media sequence gap ${i} is too large.`);return}for(let r=i-1;r>=0;r--){const n=e.segments[r];if(n&&typeof n.start<"u"){t.syncInfo={mediaSequence:e.mediaSequence+r,time:n.start},this.logger_(`playlist refresh sync: [time:${t.syncInfo.time}, mediaSequence: ${t.syncInfo.mediaSequence}]`),this.trigger("syncinfoupdate");break}}}setDateTimeMappingForStart(e){if(this.timelineToDatetimeMappings={},e.segments&&e.segments.length&&e.segments[0].dateTimeObject){const t=e.segments[0],i=t.dateTimeObject.getTime()/1e3;this.timelineToDatetimeMappings[t.timeline]=-i}}saveSegmentTimingInfo({segmentInfo:e,shouldSaveTimelineMapping:t}){const i=this.calculateSegmentTimeMapping_(e,e.timingInfo,t),r=e.segment;i&&(this.saveDiscontinuitySyncInfo_(e),e.playlist.syncInfo||(e.playlist.syncInfo={mediaSequence:e.playlist.mediaSequence+e.mediaIndex,time:r.start}));const n=r.dateTimeObject;r.discontinuity&&t&&n&&(this.timelineToDatetimeMappings[r.timeline]=-(n.getTime()/1e3))}timestampOffsetForTimeline(e){return typeof this.timelines[e]>"u"?null:this.timelines[e].time}mappingForTimeline(e){return typeof this.timelines[e]>"u"?null:this.timelines[e].mapping}calculateSegmentTimeMapping_(e,t,i){const r=e.segment,n=e.part;let a=this.timelines[e.timeline],o,l;if(typeof e.timestampOffset=="number")a={time:e.startOfSegment,mapping:e.startOfSegment-t.start},i&&(this.timelines[e.timeline]=a,this.trigger("timestampoffset"),this.logger_(`time mapping for timeline ${e.timeline}: [time: ${a.time}] [mapping: ${a.mapping}]`)),o=e.startOfSegment,l=t.end+a.mapping;else if(a)o=t.start+a.mapping,l=t.end+a.mapping;else return!1;return n&&(n.start=o,n.end=l),(!r.start||o<r.start)&&(r.start=o),r.end=l,!0}saveDiscontinuitySyncInfo_(e){const t=e.playlist,i=e.segment;if(i.discontinuity)this.discontinuities[i.timeline]={time:i.start,accuracy:0};else if(t.discontinuityStarts&&t.discontinuityStarts.length)for(let r=0;r<t.discontinuityStarts.length;r++){const n=t.discontinuityStarts[r],a=t.discontinuitySequence+r+1,o=n-e.mediaIndex,l=Math.abs(o);if(!this.discontinuities[a]||this.discontinuities[a].accuracy>l){let u;o<0?u=i.start-Ul({defaultDuration:t.targetDuration,durationList:t.segments,startIndex:e.mediaIndex,endIndex:n}):u=i.end+Ul({defaultDuration:t.targetDuration,durationList:t.segments,startIndex:e.mediaIndex+1,endIndex:n}),this.discontinuities[a]={time:u,accuracy:l}}}}dispose(){this.trigger("dispose"),this.off()}},RR=class extends U.EventTarget{constructor(){super(),this.pendingTimelineChanges_={},this.lastTimelineChanges_={}}clearPendingTimelineChange(e){this.pendingTimelineChanges_[e]=null,this.trigger("pendingtimelinechange")}pendingTimelineChange({type:e,from:t,to:i}){return typeof t=="number"&&typeof i=="number"&&(this.pendingTimelineChanges_[e]={type:e,from:t,to:i},this.trigger("pendingtimelinechange")),this.pendingTimelineChanges_[e]}lastTimelineChange({type:e,from:t,to:i}){if(typeof t=="number"&&typeof i=="number"){this.lastTimelineChanges_[e]={type:e,from:t,to:i},delete this.pendingTimelineChanges_[e];const r={timelineChangeInfo:{from:t,to:i}};this.trigger({type:"timelinechange",metadata:r})}return this.lastTimelineChanges_[e]}dispose(){this.trigger("dispose"),this.pendingTimelineChanges_={},this.lastTimelineChanges_={},this.off()}};const FR=M2(R2(function(){var s=function(){function p(){this.listeners={}}var _=p.prototype;return _.on=function(A,N){this.listeners[A]||(this.listeners[A]=[]),this.listeners[A].push(N)},_.off=function(A,N){if(!this.listeners[A])return!1;var $=this.listeners[A].indexOf(N);return this.listeners[A]=this.listeners[A].slice(0),this.listeners[A].splice($,1),$>-1},_.trigger=function(A){var N=this.listeners[A];if(N)if(arguments.length===2)for(var $=N.length,R=0;R<$;++R)N[R].call(this,arguments[1]);else for(var L=Array.prototype.slice.call(arguments,1),F=N.length,B=0;B<F;++B)N[B].apply(this,L)},_.dispose=function(){this.listeners={}},_.pipe=function(A){this.on("data",function(N){A.push(N)})},p}();/*! @name pkcs7 @version 1.0.4 @license Apache-2.0 */function e(p){return p.subarray(0,p.byteLength-p[p.byteLength-1])}/*! @name aes-decrypter @version 4.0.2 @license Apache-2.0 */const t=function(){const p=[[[],[],[],[],[]],[[],[],[],[],[]]],_=p[0],k=p[1],A=_[4],N=k[4];let $,R,L;const F=[],B=[];let C,I,G,H,K,ie;for($=0;$<256;$++)B[(F[$]=$<<1^($>>7)*283)^$]=$;for(R=L=0;!A[R];R^=C||1,L=B[L]||1)for(H=L^L<<1^L<<2^L<<3^L<<4,H=H>>8^H&255^99,A[R]=H,N[H]=R,G=F[I=F[C=F[R]]],ie=G*16843009^I*65537^C*257^R*16843008,K=F[H]*257^H*16843008,$=0;$<4;$++)_[$][R]=K=K<<24^K>>>8,k[$][H]=ie=ie<<24^ie>>>8;for($=0;$<5;$++)_[$]=_[$].slice(0),k[$]=k[$].slice(0);return p};let i=null;class r{constructor(_){i||(i=t()),this._tables=[[i[0][0].slice(),i[0][1].slice(),i[0][2].slice(),i[0][3].slice(),i[0][4].slice()],[i[1][0].slice(),i[1][1].slice(),i[1][2].slice(),i[1][3].slice(),i[1][4].slice()]];let k,A,N;const $=this._tables[0][4],R=this._tables[1],L=_.length;let F=1;if(L!==4&&L!==6&&L!==8)throw new Error("Invalid aes key size");const B=_.slice(0),C=[];for(this._key=[B,C],k=L;k<4*L+28;k++)N=B[k-1],(k%L===0||L===8&&k%L===4)&&(N=$[N>>>24]<<24^$[N>>16&255]<<16^$[N>>8&255]<<8^$[N&255],k%L===0&&(N=N<<8^N>>>24^F<<24,F=F<<1^(F>>7)*283)),B[k]=B[k-L]^N;for(A=0;k;A++,k--)N=B[A&3?k:k-4],k<=4||A<4?C[A]=N:C[A]=R[0][$[N>>>24]]^R[1][$[N>>16&255]]^R[2][$[N>>8&255]]^R[3][$[N&255]]}decrypt(_,k,A,N,$,R){const L=this._key[1];let F=_^L[0],B=N^L[1],C=A^L[2],I=k^L[3],G,H,K;const ie=L.length/4-2;let he,fe=4;const re=this._tables[1],ne=re[0],oe=re[1],de=re[2],ve=re[3],ke=re[4];for(he=0;he<ie;he++)G=ne[F>>>24]^oe[B>>16&255]^de[C>>8&255]^ve[I&255]^L[fe],H=ne[B>>>24]^oe[C>>16&255]^de[I>>8&255]^ve[F&255]^L[fe+1],K=ne[C>>>24]^oe[I>>16&255]^de[F>>8&255]^ve[B&255]^L[fe+2],I=ne[I>>>24]^oe[F>>16&255]^de[B>>8&255]^ve[C&255]^L[fe+3],fe+=4,F=G,B=H,C=K;for(he=0;he<4;he++)$[(3&-he)+R]=ke[F>>>24]<<24^ke[B>>16&255]<<16^ke[C>>8&255]<<8^ke[I&255]^L[fe++],G=F,F=B,B=C,C=I,I=G}}class n extends s{constructor(){super(s),this.jobs=[],this.delay=1,this.timeout_=null}processJob_(){this.jobs.shift()(),this.jobs.length?this.timeout_=setTimeout(this.processJob_.bind(this),this.delay):this.timeout_=null}push(_){this.jobs.push(_),this.timeout_||(this.timeout_=setTimeout(this.processJob_.bind(this),this.delay))}}const a=function(p){return p<<24|(p&65280)<<8|(p&16711680)>>8|p>>>24},o=function(p,_,k){const A=new Int32Array(p.buffer,p.byteOffset,p.byteLength>>2),N=new r(Array.prototype.slice.call(_)),$=new Uint8Array(p.byteLength),R=new Int32Array($.buffer);let L,F,B,C,I,G,H,K,ie;for(L=k[0],F=k[1],B=k[2],C=k[3],ie=0;ie<A.length;ie+=4)I=a(A[ie]),G=a(A[ie+1]),H=a(A[ie+2]),K=a(A[ie+3]),N.decrypt(I,G,H,K,R,ie),R[ie]=a(R[ie]^L),R[ie+1]=a(R[ie+1]^F),R[ie+2]=a(R[ie+2]^B),R[ie+3]=a(R[ie+3]^C),L=I,F=G,B=H,C=K;return $};class l{constructor(_,k,A,N){const $=l.STEP,R=new Int32Array(_.buffer),L=new Uint8Array(_.byteLength);let F=0;for(this.asyncStream_=new n,this.asyncStream_.push(this.decryptChunk_(R.subarray(F,F+$),k,A,L)),F=$;F<R.length;F+=$)A=new Uint32Array([a(R[F-4]),a(R[F-3]),a(R[F-2]),a(R[F-1])]),this.asyncStream_.push(this.decryptChunk_(R.subarray(F,F+$),k,A,L));this.asyncStream_.push(function(){N(null,e(L))})}static get STEP(){return 32e3}decryptChunk_(_,k,A,N){return function(){const $=o(_,k,A);N.set($,_.byteOffset)}}}var u=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},c;typeof window<"u"?c=window:typeof u<"u"?c=u:typeof self<"u"?c=self:c={};var h=c,d=function(_){return ArrayBuffer.isView==="function"?ArrayBuffer.isView(_):_&&_.buffer instanceof ArrayBuffer},g=h.BigInt||Number;g("0x1"),g("0x100"),g("0x10000"),g("0x1000000"),g("0x100000000"),g("0x10000000000"),g("0x1000000000000"),g("0x100000000000000"),g("0x10000000000000000"),function(){var p=new Uint16Array([65484]),_=new Uint8Array(p.buffer,p.byteOffset,p.byteLength);return _[0]===255?"big":_[0]===204?"little":"unknown"}();const y=function(p){const _={};return Object.keys(p).forEach(k=>{const A=p[k];d(A)?_[k]={bytes:A.buffer,byteOffset:A.byteOffset,byteLength:A.byteLength}:_[k]=A}),_};self.onmessage=function(p){const _=p.data,k=new Uint8Array(_.encrypted.bytes,_.encrypted.byteOffset,_.encrypted.byteLength),A=new Uint32Array(_.key.bytes,_.key.byteOffset,_.key.byteLength/4),N=new Uint32Array(_.iv.bytes,_.iv.byteOffset,_.iv.byteLength/4);new l(k,A,N,function($,R){self.postMessage(y({source:_.source,decrypted:R}),[R.buffer])})}}));var BR=O2(FR);const UR=s=>{let e=s.default?"main":"alternative";return s.characteristics&&s.characteristics.indexOf("public.accessibility.describes-video")>=0&&(e="main-desc"),e},J2=(s,e)=>{s.abort(),s.pause(),e&&e.activePlaylistLoader&&(e.activePlaylistLoader.pause(),e.activePlaylistLoader=null)},Yg=(s,e)=>{e.activePlaylistLoader=s,s.load()},$R=(s,e)=>()=>{const{segmentLoaders:{[s]:t,main:i},mediaTypes:{[s]:r}}=e,n=r.activeTrack(),a=r.getActiveGroup(),o=r.activePlaylistLoader,l=r.lastGroup_;if(!(a&&l&&a.id===l.id)&&(r.lastGroup_=a,r.lastTrack_=n,J2(t,r),!(!a||a.isMainPlaylist))){if(!a.playlistLoader){o&&i.resetEverything();return}t.resyncLoader(),Yg(a.playlistLoader,r)}},jR=(s,e)=>()=>{const{segmentLoaders:{[s]:t},mediaTypes:{[s]:i}}=e;i.lastGroup_=null,t.abort(),t.pause()},qR=(s,e)=>()=>{const{mainPlaylistLoader:t,segmentLoaders:{[s]:i,main:r},mediaTypes:{[s]:n}}=e,a=n.activeTrack(),o=n.getActiveGroup(),l=n.activePlaylistLoader,u=n.lastTrack_;if(!(u&&a&&u.id===a.id)&&(n.lastGroup_=o,n.lastTrack_=a,J2(i,n),!!o)){if(o.isMainPlaylist){if(!a||!u||a.id===u.id)return;const c=e.vhs.playlistController_,h=c.selectPlaylist();if(c.media()===h)return;n.logger_(`track change. Switching main audio from ${u.id} to ${a.id}`),t.pause(),r.resetEverything(),c.fastQualityChange_(h);return}if(s==="AUDIO"){if(!o.playlistLoader){r.setAudio(!0),r.resetEverything();return}i.setAudio(!0),r.setAudio(!1)}if(l===o.playlistLoader){Yg(o.playlistLoader,n);return}i.track&&i.track(a),i.resetEverything(),Yg(o.playlistLoader,n)}},ah={AUDIO:(s,e)=>()=>{const{mediaTypes:{[s]:t},excludePlaylist:i}=e,r=t.activeTrack(),n=t.activeGroup(),a=(n.filter(l=>l.default)[0]||n[0]).id,o=t.tracks[a];if(r===o){i({error:{message:"Problem encountered loading the default audio track."}});return}U.log.warn("Problem encountered loading the alternate audio track.Switching back to default.");for(const l in t.tracks)t.tracks[l].enabled=t.tracks[l]===o;t.onTrackChanged()},SUBTITLES:(s,e)=>()=>{const{mediaTypes:{[s]:t}}=e;U.log.warn("Problem encountered loading the subtitle track.Disabling subtitle track.");const i=t.activeTrack();i&&(i.mode="disabled"),t.onTrackChanged()}},gT={AUDIO:(s,e,t)=>{if(!e)return;const{tech:i,requestOptions:r,segmentLoaders:{[s]:n}}=t;e.on("loadedmetadata",()=>{const a=e.media();n.playlist(a,r),(!i.paused()||a.endList&&i.preload()!=="none")&&n.load()}),e.on("loadedplaylist",()=>{n.playlist(e.media(),r),i.paused()||n.load()}),e.on("error",ah[s](s,t))},SUBTITLES:(s,e,t)=>{const{tech:i,requestOptions:r,segmentLoaders:{[s]:n},mediaTypes:{[s]:a}}=t;e.on("loadedmetadata",()=>{const o=e.media();n.playlist(o,r),n.track(a.activeTrack()),(!i.paused()||o.endList&&i.preload()!=="none")&&n.load()}),e.on("loadedplaylist",()=>{n.playlist(e.media(),r),i.paused()||n.load()}),e.on("error",ah[s](s,t))}},VR={AUDIO:(s,e)=>{const{vhs:t,sourceType:i,segmentLoaders:{[s]:r},requestOptions:n,main:{mediaGroups:a},mediaTypes:{[s]:{groups:o,tracks:l,logger_:u}},mainPlaylistLoader:c}=e,h=hu(c.main);(!a[s]||Object.keys(a[s]).length===0)&&(a[s]={main:{default:{default:!0}}},h&&(a[s].main.default.playlists=c.main.playlists));for(const d in a[s]){o[d]||(o[d]=[]);for(const g in a[s][d]){let y=a[s][d][g],p;if(h?(u(`AUDIO group '${d}' label '${g}' is a main playlist`),y.isMainPlaylist=!0,p=null):i==="vhs-json"&&y.playlists?p=new Ka(y.playlists[0],t,n):y.resolvedUri?p=new Ka(y.resolvedUri,t,n):y.playlists&&i==="dash"?p=new Wg(y.playlists[0],t,n,c):p=null,y=lt({id:g,playlistLoader:p},y),gT[s](s,y.playlistLoader,e),o[d].push(y),typeof l[g]>"u"){const _=new U.AudioTrack({id:g,kind:UR(y),enabled:!1,language:y.language,default:y.default,label:g});l[g]=_}}}r.on("error",ah[s](s,e))},SUBTITLES:(s,e)=>{const{tech:t,vhs:i,sourceType:r,segmentLoaders:{[s]:n},requestOptions:a,main:{mediaGroups:o},mediaTypes:{[s]:{groups:l,tracks:u}},mainPlaylistLoader:c}=e;for(const h in o[s]){l[h]||(l[h]=[]);for(const d in o[s][h]){if(!i.options_.useForcedSubtitles&&o[s][h][d].forced)continue;let g=o[s][h][d],y;if(r==="hls")y=new Ka(g.resolvedUri,i,a);else if(r==="dash"){if(!g.playlists.filter(_=>_.excludeUntil!==1/0).length)return;y=new Wg(g.playlists[0],i,a,c)}else r==="vhs-json"&&(y=new Ka(g.playlists?g.playlists[0]:g.resolvedUri,i,a));if(g=lt({id:d,playlistLoader:y},g),gT[s](s,g.playlistLoader,e),l[h].push(g),typeof u[d]>"u"){const p=t.addRemoteTextTrack({id:d,kind:"subtitles",default:g.default&&g.autoselect,language:g.language,label:d},!1).track;u[d]=p}}}n.on("error",ah[s](s,e))},"CLOSED-CAPTIONS":(s,e)=>{const{tech:t,main:{mediaGroups:i},mediaTypes:{[s]:{groups:r,tracks:n}}}=e;for(const a in i[s]){r[a]||(r[a]=[]);for(const o in i[s][a]){const l=i[s][a][o];if(!/^(?:CC|SERVICE)/.test(l.instreamId))continue;const u=t.options_.vhs&&t.options_.vhs.captionServices||{};let c={label:o,language:l.language,instreamId:l.instreamId,default:l.default&&l.autoselect};if(u[c.instreamId]&&(c=lt(c,u[c.instreamId])),c.default===void 0&&delete c.default,r[a].push(lt({id:o},l)),typeof n[o]>"u"){const h=t.addRemoteTextTrack({id:c.instreamId,kind:"captions",default:c.default,language:c.language,label:c.label},!1).track;n[o]=h}}}}},Z2=(s,e)=>{for(let t=0;t<s.length;t++)if(v0(e,s[t])||s[t].playlists&&Z2(s[t].playlists,e))return!0;return!1},HR=(s,e)=>t=>{const{mainPlaylistLoader:i,mediaTypes:{[s]:{groups:r}}}=e,n=i.media();if(!n)return null;let a=null;n.attributes[s]&&(a=r[n.attributes[s]]);const o=Object.keys(r);if(!a)if(s==="AUDIO"&&o.length>1&&hu(e.main))for(let l=0;l<o.length;l++){const u=r[o[l]];if(Z2(u,n)){a=u;break}}else r.main?a=r.main:o.length===1&&(a=r[o[0]]);return typeof t>"u"?a:t===null||!a?null:a.filter(l=>l.id===t.id)[0]||null},zR={AUDIO:(s,e)=>()=>{const{mediaTypes:{[s]:{tracks:t}}}=e;for(const i in t)if(t[i].enabled)return t[i];return null},SUBTITLES:(s,e)=>()=>{const{mediaTypes:{[s]:{tracks:t}}}=e;for(const i in t)if(t[i].mode==="showing"||t[i].mode==="hidden")return t[i];return null}},WR=(s,{mediaTypes:e})=>()=>{const t=e[s].activeTrack();return t?e[s].activeGroup(t):null},GR=s=>{["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(u=>{VR[u](u,s)});const{mediaTypes:e,mainPlaylistLoader:t,tech:i,vhs:r,segmentLoaders:{["AUDIO"]:n,main:a}}=s;["AUDIO","SUBTITLES"].forEach(u=>{e[u].activeGroup=HR(u,s),e[u].activeTrack=zR[u](u,s),e[u].onGroupChanged=$R(u,s),e[u].onGroupChanging=jR(u,s),e[u].onTrackChanged=qR(u,s),e[u].getActiveGroup=WR(u,s)});const o=e.AUDIO.activeGroup();if(o){const u=(o.filter(h=>h.default)[0]||o[0]).id;e.AUDIO.tracks[u].enabled=!0,e.AUDIO.onGroupChanged(),e.AUDIO.onTrackChanged(),e.AUDIO.getActiveGroup().playlistLoader?(a.setAudio(!1),n.setAudio(!0)):a.setAudio(!0)}t.on("mediachange",()=>{["AUDIO","SUBTITLES"].forEach(u=>e[u].onGroupChanged())}),t.on("mediachanging",()=>{["AUDIO","SUBTITLES"].forEach(u=>e[u].onGroupChanging())});const l=()=>{e.AUDIO.onTrackChanged(),i.trigger({type:"usage",name:"vhs-audio-change"})};i.audioTracks().addEventListener("change",l),i.remoteTextTracks().addEventListener("change",e.SUBTITLES.onTrackChanged),r.on("dispose",()=>{i.audioTracks().removeEventListener("change",l),i.remoteTextTracks().removeEventListener("change",e.SUBTITLES.onTrackChanged)}),i.clearTracks("audio");for(const u in e.AUDIO.tracks)i.audioTracks().addTrack(e.AUDIO.tracks[u])},KR=()=>{const s={};return["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(e=>{s[e]={groups:{},tracks:{},activePlaylistLoader:null,activeGroup:En,activeTrack:En,getActiveGroup:En,onGroupChanged:En,onTrackChanged:En,lastTrack_:null,logger_:Tr(`MediaGroups[${e}]`)}}),s};class vT{constructor(){this.priority_=[],this.pathwayClones_=new Map}set version(e){e===1&&(this.version_=e)}set ttl(e){this.ttl_=e||300}set reloadUri(e){e&&(this.reloadUri_=ji(this.reloadUri_,e))}set priority(e){e&&e.length&&(this.priority_=e)}set pathwayClones(e){e&&e.length&&(this.pathwayClones_=new Map(e.map(t=>[t.ID,t])))}get version(){return this.version_}get ttl(){return this.ttl_}get reloadUri(){return this.reloadUri_}get priority(){return this.priority_}get pathwayClones(){return this.pathwayClones_}}class XR extends U.EventTarget{constructor(e,t){super(),this.currentPathway=null,this.defaultPathway=null,this.queryBeforeStart=!1,this.availablePathways_=new Set,this.steeringManifest=new vT,this.proxyServerUrl_=null,this.manifestType_=null,this.ttlTimeout_=null,this.request_=null,this.currentPathwayClones=new Map,this.nextPathwayClones=new Map,this.excludedSteeringManifestURLs=new Set,this.logger_=Tr("Content Steering"),this.xhr_=e,this.getBandwidth_=t}assignTagProperties(e,t){this.manifestType_=t.serverUri?"HLS":"DASH";const i=t.serverUri||t.serverURL;if(!i){this.logger_(`steering manifest URL is ${i}, cannot request steering manifest.`),this.trigger("error");return}if(i.startsWith("data:")){this.decodeDataUriManifest_(i.substring(i.indexOf(",")+1));return}this.steeringManifest.reloadUri=ji(e,i),this.defaultPathway=t.pathwayId||t.defaultServiceLocation,this.queryBeforeStart=t.queryBeforeStart,this.proxyServerUrl_=t.proxyServerURL,this.defaultPathway&&!this.queryBeforeStart&&this.trigger("content-steering")}requestSteeringManifest(e){const t=this.steeringManifest.reloadUri;if(!t)return;const i=e?t:this.getRequestURI(t);if(!i){this.logger_("No valid content steering manifest URIs. Stopping content steering."),this.trigger("error"),this.dispose();return}const r={contentSteeringInfo:{uri:i}};this.trigger({type:"contentsteeringloadstart",metadata:r}),this.request_=this.xhr_({uri:i,requestType:"content-steering-manifest"},(n,a)=>{if(n){if(a.status===410){this.logger_(`manifest request 410 ${n}.`),this.logger_(`There will be no more content steering requests to ${i} this session.`),this.excludedSteeringManifestURLs.add(i);return}if(a.status===429){const u=a.responseHeaders["retry-after"];this.logger_(`manifest request 429 ${n}.`),this.logger_(`content steering will retry in ${u} seconds.`),this.startTTLTimeout_(parseInt(u,10));return}this.logger_(`manifest failed to load ${n}.`),this.startTTLTimeout_();return}this.trigger({type:"contentsteeringloadcomplete",metadata:r});let o;try{o=JSON.parse(this.request_.responseText)}catch(u){const c={errorType:U.Error.StreamingContentSteeringParserError,error:u};this.trigger({type:"error",metadata:c})}this.assignSteeringProperties_(o);const l={contentSteeringInfo:r.contentSteeringInfo,contentSteeringManifest:{version:this.steeringManifest.version,reloadUri:this.steeringManifest.reloadUri,priority:this.steeringManifest.priority}};this.trigger({type:"contentsteeringparsed",metadata:l}),this.startTTLTimeout_()})}setProxyServerUrl_(e){const t=new O.URL(e),i=new O.URL(this.proxyServerUrl_);return i.searchParams.set("url",encodeURI(t.toString())),this.setSteeringParams_(i.toString())}decodeDataUriManifest_(e){const t=JSON.parse(O.atob(e));this.assignSteeringProperties_(t)}setSteeringParams_(e){const t=new O.URL(e),i=this.getPathway(),r=this.getBandwidth_();if(i){const n=`_${this.manifestType_}_pathway`;t.searchParams.set(n,i)}if(r){const n=`_${this.manifestType_}_throughput`;t.searchParams.set(n,r)}return t.toString()}assignSteeringProperties_(e){if(this.steeringManifest.version=e.VERSION,!this.steeringManifest.version){this.logger_(`manifest version is ${e.VERSION}, which is not supported.`),this.trigger("error");return}this.steeringManifest.ttl=e.TTL,this.steeringManifest.reloadUri=e["RELOAD-URI"],this.steeringManifest.priority=e["PATHWAY-PRIORITY"]||e["SERVICE-LOCATION-PRIORITY"],this.steeringManifest.pathwayClones=e["PATHWAY-CLONES"],this.nextPathwayClones=this.steeringManifest.pathwayClones,this.availablePathways_.size||(this.logger_("There are no available pathways for content steering. Ending content steering."),this.trigger("error"),this.dispose());const i=(r=>{for(const n of r)if(this.availablePathways_.has(n))return n;return[...this.availablePathways_][0]})(this.steeringManifest.priority);this.currentPathway!==i&&(this.currentPathway=i,this.trigger("content-steering"))}getPathway(){return this.currentPathway||this.defaultPathway}getRequestURI(e){if(!e)return null;const t=r=>this.excludedSteeringManifestURLs.has(r);if(this.proxyServerUrl_){const r=this.setProxyServerUrl_(e);if(!t(r))return r}const i=this.setSteeringParams_(e);return t(i)?null:i}startTTLTimeout_(e=this.steeringManifest.ttl){const t=e*1e3;this.ttlTimeout_=O.setTimeout(()=>{this.requestSteeringManifest()},t)}clearTTLTimeout_(){O.clearTimeout(this.ttlTimeout_),this.ttlTimeout_=null}abort(){this.request_&&this.request_.abort(),this.request_=null}dispose(){this.off("content-steering"),this.off("error"),this.abort(),this.clearTTLTimeout_(),this.currentPathway=null,this.defaultPathway=null,this.queryBeforeStart=null,this.proxyServerUrl_=null,this.manifestType_=null,this.ttlTimeout_=null,this.request_=null,this.excludedSteeringManifestURLs=new Set,this.availablePathways_=new Set,this.steeringManifest=new vT}addAvailablePathway(e){e&&this.availablePathways_.add(e)}clearAvailablePathways(){this.availablePathways_.clear()}excludePathway(e){return this.availablePathways_.delete(e)}didDASHTagChange(e,t){return!t&&this.steeringManifest.reloadUri||t&&(ji(e,t.serverURL)!==this.steeringManifest.reloadUri||t.defaultServiceLocation!==this.defaultPathway||t.queryBeforeStart!==this.queryBeforeStart||t.proxyServerURL!==this.proxyServerUrl_)}getAvailablePathways(){return this.availablePathways_}}const QR=10;let ts;const YR=["mediaRequests","mediaRequestsAborted","mediaRequestsTimedout","mediaRequestsErrored","mediaTransferDuration","mediaBytesTransferred","mediaAppends"],JR=function(s){return this.audioSegmentLoader_[s]+this.mainSegmentLoader_[s]},ZR=function({currentPlaylist:s,buffered:e,currentTime:t,nextPlaylist:i,bufferLowWaterLine:r,bufferHighWaterLine:n,duration:a,bufferBasedABR:o,log:l}){if(!i)return U.log.warn("We received no playlist to switch to. Please check your stream."),!1;const u=`allowing switch ${s&&s.id||"null"} -> ${i.id}`;if(!s)return l(`${u} as current playlist is not set`),!0;if(i.id===s.id)return!1;const c=!!Ga(e,t).length;if(!s.endList)return!c&&typeof s.partTargetDuration=="number"?(l(`not ${u} as current playlist is live llhls, but currentTime isn't in buffered.`),!1):(l(`${u} as current playlist is live`),!0);const h=p0(e,t),d=o?ei.EXPERIMENTAL_MAX_BUFFER_LOW_WATER_LINE:ei.MAX_BUFFER_LOW_WATER_LINE;if(a<d)return l(`${u} as duration < max low water line (${a} < ${d})`),!0;const g=i.attributes.BANDWIDTH,y=s.attributes.BANDWIDTH;if(g<y&&(!o||h<n)){let p=`${u} as next bandwidth < current bandwidth (${g} < ${y})`;return o&&(p+=` and forwardBuffer < bufferHighWaterLine (${h} < ${n})`),l(p),!0}if((!o||g>y)&&h>=r){let p=`${u} as forwardBuffer >= bufferLowWaterLine (${h} >= ${r})`;return o&&(p+=` and next bandwidth > current bandwidth (${g} > ${y})`),l(p),!0}return l(`not ${u} as no switching criteria met`),!1};class e3 extends U.EventTarget{constructor(e){super();const{src:t,withCredentials:i,tech:r,bandwidth:n,externVhs:a,useCueTags:o,playlistExclusionDuration:l,enableLowInitialPlaylist:u,sourceType:c,cacheEncryptionKeys:h,bufferBasedABR:d,leastPixelDiffSelector:g,captionServices:y,experimentalUseMMS:p}=e;if(!t)throw new Error("A non-empty playlist URL or JSON manifest string is required");let{maxPlaylistRetries:_}=e;(_===null||typeof _>"u")&&(_=1/0),ts=a,this.bufferBasedABR=!!d,this.leastPixelDiffSelector=!!g,this.withCredentials=i,this.tech_=r,this.vhs_=r.vhs,this.player_=e.player_,this.sourceType_=c,this.useCueTags_=o,this.playlistExclusionDuration=l,this.maxPlaylistRetries=_,this.enableLowInitialPlaylist=u,this.useCueTags_&&(this.cueTagsTrack_=this.tech_.addTextTrack("metadata","ad-cues"),this.cueTagsTrack_.inBandMetadataTrackDispatchType=""),this.requestOptions_={withCredentials:i,maxPlaylistRetries:_,timeout:null},this.on("error",this.pauseLoading),this.mediaTypes_=KR(),p&&O.ManagedMediaSource?(this.tech_.el_.disableRemotePlayback=!0,this.mediaSource=new O.ManagedMediaSource,U.log("Using ManagedMediaSource")):O.MediaSource&&(this.mediaSource=new O.MediaSource),this.handleDurationChange_=this.handleDurationChange_.bind(this),this.handleSourceOpen_=this.handleSourceOpen_.bind(this),this.handleSourceEnded_=this.handleSourceEnded_.bind(this),this.load=this.load.bind(this),this.pause=this.pause.bind(this),this.mediaSource.addEventListener("durationchange",this.handleDurationChange_),this.mediaSource.addEventListener("sourceopen",this.handleSourceOpen_),this.mediaSource.addEventListener("sourceended",this.handleSourceEnded_),this.mediaSource.addEventListener("startstreaming",this.load),this.mediaSource.addEventListener("endstreaming",this.pause),this.seekable_=ni(),this.hasPlayed_=!1,this.syncController_=new MR(e),this.segmentMetadataTrack_=r.addRemoteTextTrack({kind:"metadata",label:"segment-metadata"},!1).track,this.decrypter_=new BR,this.sourceUpdater_=new Q2(this.mediaSource),this.inbandTextTracks_={},this.timelineChangeController_=new RR,this.keyStatusMap_=new Map;const k={vhs:this.vhs_,parse708captions:e.parse708captions,useDtsForTimestampOffset:e.useDtsForTimestampOffset,captionServices:y,mediaSource:this.mediaSource,currentTime:this.tech_.currentTime.bind(this.tech_),seekable:()=>this.seekable(),seeking:()=>this.tech_.seeking(),duration:()=>this.duration(),hasPlayed:()=>this.hasPlayed_,goalBufferLength:()=>this.goalBufferLength(),bandwidth:n,syncController:this.syncController_,decrypter:this.decrypter_,sourceType:this.sourceType_,inbandTextTracks:this.inbandTextTracks_,cacheEncryptionKeys:h,sourceUpdater:this.sourceUpdater_,timelineChangeController:this.timelineChangeController_,exactManifestTimings:e.exactManifestTimings,addMetadataToTextTrack:this.addMetadataToTextTrack.bind(this)};this.mainPlaylistLoader_=this.sourceType_==="dash"?new Wg(t,this.vhs_,lt(this.requestOptions_,{addMetadataToTextTrack:this.addMetadataToTextTrack.bind(this)})):new Ka(t,this.vhs_,lt(this.requestOptions_,{addDateRangesToTextTrack:this.addDateRangesToTextTrack_.bind(this)})),this.setupMainPlaylistLoaderListeners_(),this.mainSegmentLoader_=new Xg(lt(k,{segmentMetadataTrack:this.segmentMetadataTrack_,loaderType:"main"}),e),this.audioSegmentLoader_=new Xg(lt(k,{loaderType:"audio"}),e),this.subtitleSegmentLoader_=new PR(lt(k,{loaderType:"vtt",featuresNativeTextTracks:this.tech_.featuresNativeTextTracks,loadVttJs:()=>new Promise(($,R)=>{function L(){r.off("vttjserror",F),$()}function F(){r.off("vttjsloaded",L),R()}r.one("vttjsloaded",L),r.one("vttjserror",F),r.addWebVttScript_()})}),e);const A=()=>this.mainSegmentLoader_.bandwidth;this.contentSteeringController_=new XR(this.vhs_.xhr,A),this.setupSegmentLoaderListeners_(),this.bufferBasedABR&&(this.mainPlaylistLoader_.one("loadedplaylist",()=>this.startABRTimer_()),this.tech_.on("pause",()=>this.stopABRTimer_()),this.tech_.on("play",()=>this.startABRTimer_())),YR.forEach($=>{this[$+"_"]=JR.bind(this,$)}),this.logger_=Tr("pc"),this.triggeredFmp4Usage=!1,this.tech_.preload()==="none"?(this.loadOnPlay_=()=>{this.loadOnPlay_=null,this.mainPlaylistLoader_.load()},this.tech_.one("play",this.loadOnPlay_)):this.mainPlaylistLoader_.load(),this.timeToLoadedData__=-1,this.mainAppendsToLoadedData__=-1,this.audioAppendsToLoadedData__=-1;const N=this.tech_.preload()==="none"?"play":"loadstart";this.tech_.one(N,()=>{const $=Date.now();this.tech_.one("loadeddata",()=>{this.timeToLoadedData__=Date.now()-$,this.mainAppendsToLoadedData__=this.mainSegmentLoader_.mediaAppends,this.audioAppendsToLoadedData__=this.audioSegmentLoader_.mediaAppends})})}mainAppendsToLoadedData_(){return this.mainAppendsToLoadedData__}audioAppendsToLoadedData_(){return this.audioAppendsToLoadedData__}appendsToLoadedData_(){const e=this.mainAppendsToLoadedData_(),t=this.audioAppendsToLoadedData_();return e===-1||t===-1?-1:e+t}timeToLoadedData_(){return this.timeToLoadedData__}checkABR_(e="abr"){const t=this.selectPlaylist();t&&this.shouldSwitchToMedia_(t)&&this.switchMedia_(t,e)}switchMedia_(e,t,i){const r=this.media(),n=r&&(r.id||r.uri),a=e&&(e.id||e.uri);if(n&&n!==a){this.logger_(`switch media ${n} -> ${a} from ${t}`);const o={renditionInfo:{id:a,bandwidth:e.attributes.BANDWIDTH,resolution:e.attributes.RESOLUTION,codecs:e.attributes.CODECS},cause:t};this.trigger({type:"renditionselected",metadata:o}),this.tech_.trigger({type:"usage",name:`vhs-rendition-change-${t}`})}this.mainPlaylistLoader_.media(e,i)}switchMediaForDASHContentSteering_(){["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(e=>{const t=this.mediaTypes_[e],i=t?t.activeGroup():null,r=this.contentSteeringController_.getPathway();if(i&&r){const a=(i.length?i[0].playlists:i.playlists).filter(o=>o.attributes.serviceLocation===r);a.length&&this.mediaTypes_[e].activePlaylistLoader.media(a[0])}})}startABRTimer_(){this.stopABRTimer_(),this.abrTimer_=O.setInterval(()=>this.checkABR_(),250)}stopABRTimer_(){this.tech_.scrubbing&&this.tech_.scrubbing()||(O.clearInterval(this.abrTimer_),this.abrTimer_=null)}getAudioTrackPlaylists_(){const e=this.main(),t=e&&e.playlists||[];if(!e||!e.mediaGroups||!e.mediaGroups.AUDIO)return t;const i=e.mediaGroups.AUDIO,r=Object.keys(i);let n;if(Object.keys(this.mediaTypes_.AUDIO.groups).length)n=this.mediaTypes_.AUDIO.activeTrack();else{const o=i.main||r.length&&i[r[0]];for(const l in o)if(o[l].default){n={label:l};break}}if(!n)return t;const a=[];for(const o in i)if(i[o][n.label]){const l=i[o][n.label];if(l.playlists&&l.playlists.length)a.push.apply(a,l.playlists);else if(l.uri)a.push(l);else if(e.playlists.length)for(let u=0;u<e.playlists.length;u++){const c=e.playlists[u];c.attributes&&c.attributes.AUDIO&&c.attributes.AUDIO===o&&a.push(c)}}return a.length?a:t}setupMainPlaylistLoaderListeners_(){this.mainPlaylistLoader_.on("loadedmetadata",()=>{const t=this.mainPlaylistLoader_.media(),i=t.targetDuration*1.5*1e3;jg(this.mainPlaylistLoader_.main,this.mainPlaylistLoader_.media())?this.requestOptions_.timeout=0:this.requestOptions_.timeout=i,t.endList&&this.tech_.preload()!=="none"&&(this.mainSegmentLoader_.playlist(t,this.requestOptions_),this.mainSegmentLoader_.load()),GR({sourceType:this.sourceType_,segmentLoaders:{AUDIO:this.audioSegmentLoader_,SUBTITLES:this.subtitleSegmentLoader_,main:this.mainSegmentLoader_},tech:this.tech_,requestOptions:this.requestOptions_,mainPlaylistLoader:this.mainPlaylistLoader_,vhs:this.vhs_,main:this.main(),mediaTypes:this.mediaTypes_,excludePlaylist:this.excludePlaylist.bind(this)}),this.triggerPresenceUsage_(this.main(),t),this.setupFirstPlay(),!this.mediaTypes_.AUDIO.activePlaylistLoader||this.mediaTypes_.AUDIO.activePlaylistLoader.media()?this.trigger("selectedinitialmedia"):this.mediaTypes_.AUDIO.activePlaylistLoader.one("loadedmetadata",()=>{this.trigger("selectedinitialmedia")})}),this.mainPlaylistLoader_.on("loadedplaylist",()=>{this.loadOnPlay_&&this.tech_.off("play",this.loadOnPlay_);let t=this.mainPlaylistLoader_.media();if(!t){this.attachContentSteeringListeners_(),this.initContentSteeringController_(),this.excludeUnsupportedVariants_();let i;if(this.enableLowInitialPlaylist&&(i=this.selectInitialPlaylist()),i||(i=this.selectPlaylist()),!i||!this.shouldSwitchToMedia_(i)||(this.initialMedia_=i,this.switchMedia_(this.initialMedia_,"initial"),!(this.sourceType_==="vhs-json"&&this.initialMedia_.segments)))return;t=this.initialMedia_}this.handleUpdatedMediaPlaylist(t)}),this.mainPlaylistLoader_.on("error",()=>{const t=this.mainPlaylistLoader_.error;this.excludePlaylist({playlistToExclude:t.playlist,error:t})}),this.mainPlaylistLoader_.on("mediachanging",()=>{this.mainSegmentLoader_.abort(),this.mainSegmentLoader_.pause()}),this.mainPlaylistLoader_.on("mediachange",()=>{const t=this.mainPlaylistLoader_.media(),i=t.targetDuration*1.5*1e3;jg(this.mainPlaylistLoader_.main,this.mainPlaylistLoader_.media())?this.requestOptions_.timeout=0:this.requestOptions_.timeout=i,this.sourceType_==="dash"&&this.mainPlaylistLoader_.load(),this.mainSegmentLoader_.pause(),this.mainSegmentLoader_.playlist(t,this.requestOptions_),this.waitingForFastQualityPlaylistReceived_?this.runFastQualitySwitch_():this.mainSegmentLoader_.load(),this.tech_.trigger({type:"mediachange",bubbles:!0})}),this.mainPlaylistLoader_.on("playlistunchanged",()=>{const t=this.mainPlaylistLoader_.media();if(t.lastExcludeReason_==="playlist-unchanged")return;this.stuckAtPlaylistEnd_(t)&&(this.excludePlaylist({error:{message:"Playlist no longer updating.",reason:"playlist-unchanged"}}),this.tech_.trigger("playliststuck"))}),this.mainPlaylistLoader_.on("renditiondisabled",()=>{this.tech_.trigger({type:"usage",name:"vhs-rendition-disabled"})}),this.mainPlaylistLoader_.on("renditionenabled",()=>{this.tech_.trigger({type:"usage",name:"vhs-rendition-enabled"})}),["manifestrequeststart","manifestrequestcomplete","manifestparsestart","manifestparsecomplete","playlistrequeststart","playlistrequestcomplete","playlistparsestart","playlistparsecomplete","renditiondisabled","renditionenabled"].forEach(t=>{this.mainPlaylistLoader_.on(t,i=>{this.player_.trigger(ft({},i))})})}handleUpdatedMediaPlaylist(e){this.useCueTags_&&this.updateAdCues_(e),this.mainSegmentLoader_.pause(),this.mainSegmentLoader_.playlist(e,this.requestOptions_),this.waitingForFastQualityPlaylistReceived_&&this.runFastQualitySwitch_(),this.updateDuration(!e.endList),this.tech_.paused()||(this.mainSegmentLoader_.load(),this.audioSegmentLoader_&&this.audioSegmentLoader_.load())}triggerPresenceUsage_(e,t){const i=e.mediaGroups||{};let r=!0;const n=Object.keys(i.AUDIO);for(const a in i.AUDIO)for(const o in i.AUDIO[a])i.AUDIO[a][o].uri||(r=!1);r&&this.tech_.trigger({type:"usage",name:"vhs-demuxed"}),Object.keys(i.SUBTITLES).length&&this.tech_.trigger({type:"usage",name:"vhs-webvtt"}),ts.Playlist.isAes(t)&&this.tech_.trigger({type:"usage",name:"vhs-aes"}),n.length&&Object.keys(i.AUDIO[n[0]]).length>1&&this.tech_.trigger({type:"usage",name:"vhs-alternate-audio"}),this.useCueTags_&&this.tech_.trigger({type:"usage",name:"vhs-playlist-cue-tags"})}shouldSwitchToMedia_(e){const t=this.mainPlaylistLoader_.media()||this.mainPlaylistLoader_.pendingMedia_,i=this.tech_.currentTime(),r=this.bufferLowWaterLine(),n=this.bufferHighWaterLine(),a=this.tech_.buffered();return ZR({buffered:a,currentTime:i,currentPlaylist:t,nextPlaylist:e,bufferLowWaterLine:r,bufferHighWaterLine:n,duration:this.duration(),bufferBasedABR:this.bufferBasedABR,log:this.logger_})}setupSegmentLoaderListeners_(){this.mainSegmentLoader_.on("bandwidthupdate",()=>{this.checkABR_("bandwidthupdate"),this.tech_.trigger("bandwidthupdate")}),this.mainSegmentLoader_.on("timeout",()=>{this.bufferBasedABR&&this.mainSegmentLoader_.load()}),this.bufferBasedABR||this.mainSegmentLoader_.on("progress",()=>{this.trigger("progress")}),this.mainSegmentLoader_.on("error",()=>{const i=this.mainSegmentLoader_.error();this.excludePlaylist({playlistToExclude:i.playlist,error:i})}),this.mainSegmentLoader_.on("appenderror",()=>{this.error=this.mainSegmentLoader_.error_,this.trigger("error")}),this.mainSegmentLoader_.on("syncinfoupdate",()=>{this.onSyncInfoUpdate_()}),this.mainSegmentLoader_.on("timestampoffset",()=>{this.tech_.trigger({type:"usage",name:"vhs-timestamp-offset"})}),this.audioSegmentLoader_.on("syncinfoupdate",()=>{this.onSyncInfoUpdate_()}),this.audioSegmentLoader_.on("appenderror",()=>{this.error=this.audioSegmentLoader_.error_,this.trigger("error")}),this.mainSegmentLoader_.on("ended",()=>{this.logger_("main segment loader ended"),this.onEndOfStream()}),this.timelineChangeController_.on("audioTimelineBehind",()=>{const i=this.audioSegmentLoader_.pendingSegment_;if(!i||!i.segment||!i.segment.syncInfo)return;const r=i.segment.syncInfo.end+.01;this.tech_.setCurrentTime(r)}),this.mainSegmentLoader_.on("earlyabort",i=>{this.bufferBasedABR||(this.delegateLoaders_("all",["abort"]),this.excludePlaylist({error:{message:"Aborted early because there isn't enough bandwidth to complete the request without rebuffering."},playlistExclusionDuration:QR}))});const e=()=>{if(!this.sourceUpdater_.hasCreatedSourceBuffers())return this.tryToCreateSourceBuffers_();const i=this.getCodecsOrExclude_();i&&this.sourceUpdater_.addOrChangeSourceBuffers(i)};this.mainSegmentLoader_.on("trackinfo",e),this.audioSegmentLoader_.on("trackinfo",e),this.mainSegmentLoader_.on("fmp4",()=>{this.triggeredFmp4Usage||(this.tech_.trigger({type:"usage",name:"vhs-fmp4"}),this.triggeredFmp4Usage=!0)}),this.audioSegmentLoader_.on("fmp4",()=>{this.triggeredFmp4Usage||(this.tech_.trigger({type:"usage",name:"vhs-fmp4"}),this.triggeredFmp4Usage=!0)}),this.audioSegmentLoader_.on("ended",()=>{this.logger_("audioSegmentLoader ended"),this.onEndOfStream()}),["segmentselected","segmentloadstart","segmentloaded","segmentkeyloadstart","segmentkeyloadcomplete","segmentdecryptionstart","segmentdecryptioncomplete","segmenttransmuxingstart","segmenttransmuxingcomplete","segmenttransmuxingtrackinfoavailable","segmenttransmuxingtiminginfoavailable","segmentappendstart","appendsdone","bandwidthupdated","timelinechange","codecschange"].forEach(i=>{this.mainSegmentLoader_.on(i,r=>{this.player_.trigger(ft({},r))}),this.audioSegmentLoader_.on(i,r=>{this.player_.trigger(ft({},r))}),this.subtitleSegmentLoader_.on(i,r=>{this.player_.trigger(ft({},r))})})}mediaSecondsLoaded_(){return Math.max(this.audioSegmentLoader_.mediaSecondsLoaded+this.mainSegmentLoader_.mediaSecondsLoaded)}load(){this.mainSegmentLoader_.load(),this.mediaTypes_.AUDIO.activePlaylistLoader&&this.audioSegmentLoader_.load(),this.mediaTypes_.SUBTITLES.activePlaylistLoader&&this.subtitleSegmentLoader_.load()}pause(){this.mainSegmentLoader_.pause(),this.mediaTypes_.AUDIO.activePlaylistLoader&&this.audioSegmentLoader_.pause(),this.mediaTypes_.SUBTITLES.activePlaylistLoader&&this.subtitleSegmentLoader_.pause()}fastQualityChange_(e=this.selectPlaylist()){if(e&&e===this.mainPlaylistLoader_.media()){this.logger_("skipping fastQualityChange because new media is same as old");return}this.switchMedia_(e,"fast-quality"),this.waitingForFastQualityPlaylistReceived_=!0}runFastQualitySwitch_(){this.waitingForFastQualityPlaylistReceived_=!1,this.mainSegmentLoader_.pause(),this.mainSegmentLoader_.resetEverything(()=>{this.mainSegmentLoader_.load()})}play(){if(this.setupFirstPlay())return;this.tech_.ended()&&this.tech_.setCurrentTime(0),this.hasPlayed_&&this.load();const e=this.tech_.seekable();if(this.tech_.duration()===1/0&&this.tech_.currentTime()<e.start(0))return this.tech_.setCurrentTime(e.end(e.length-1))}setupFirstPlay(){const e=this.mainPlaylistLoader_.media();if(!e||this.tech_.paused()||this.hasPlayed_)return!1;if(!e.endList||e.start){const t=this.seekable();if(!t.length)return!1;const i=t.end(0);let r=i;if(e.start){const n=e.start.timeOffset;n<0?r=Math.max(i+n,t.start(0)):r=Math.min(i,n)}this.trigger("firstplay"),this.tech_.setCurrentTime(r)}return this.hasPlayed_=!0,this.load(),!0}handleSourceOpen_(){if(this.tryToCreateSourceBuffers_(),this.tech_.autoplay()){const e=this.tech_.play();typeof e<"u"&&typeof e.then=="function"&&e.then(null,t=>{})}this.trigger("sourceopen")}handleSourceEnded_(){if(!this.inbandTextTracks_.metadataTrack_)return;const e=this.inbandTextTracks_.metadataTrack_.cues;if(!e||!e.length)return;const t=this.duration();e[e.length-1].endTime=isNaN(t)||Math.abs(t)===1/0?Number.MAX_VALUE:t}handleDurationChange_(){this.tech_.trigger("durationchange")}onEndOfStream(){let e=this.mainSegmentLoader_.ended_;if(this.mediaTypes_.AUDIO.activePlaylistLoader){const t=this.mainSegmentLoader_.getCurrentMediaInfo_();!t||t.hasVideo?e=e&&this.audioSegmentLoader_.ended_:e=this.audioSegmentLoader_.ended_}e&&(this.stopABRTimer_(),this.sourceUpdater_.endOfStream())}stuckAtPlaylistEnd_(e){if(!this.seekable().length)return!1;const i=this.syncController_.getExpiredTime(e,this.duration());if(i===null)return!1;const r=ts.Playlist.playlistEnd(e,i),n=this.tech_.currentTime(),a=this.tech_.buffered();if(!a.length)return r-n<=Xr;const o=a.end(a.length-1);return o-n<=Xr&&r-o<=Xr}excludePlaylist({playlistToExclude:e=this.mainPlaylistLoader_.media(),error:t={},playlistExclusionDuration:i}){if(e=e||this.mainPlaylistLoader_.media(),i=i||t.playlistExclusionDuration||this.playlistExclusionDuration,!e){this.error=t,this.mediaSource.readyState!=="open"?this.trigger("error"):this.sourceUpdater_.endOfStream("network");return}e.playlistErrors_++;const r=this.mainPlaylistLoader_.main.playlists,n=r.filter(id),a=n.length===1&&n[0]===e;if(r.length===1&&i!==1/0)return U.log.warn(`Problem encountered with playlist ${e.id}. Trying again since it is the only playlist.`),this.tech_.trigger("retryplaylist"),this.mainPlaylistLoader_.load(a);if(a){if(this.main().contentSteering){const y=this.pathwayAttribute_(e),p=this.contentSteeringController_.steeringManifest.ttl*1e3;this.contentSteeringController_.excludePathway(y),this.excludeThenChangePathway_(),setTimeout(()=>{this.contentSteeringController_.addAvailablePathway(y)},p);return}let g=!1;r.forEach(y=>{if(y===e)return;const p=y.excludeUntil;typeof p<"u"&&p!==1/0&&(g=!0,delete y.excludeUntil)}),g&&(U.log.warn("Removing other playlists from the exclusion list because the last rendition is about to be excluded."),this.tech_.trigger("retryplaylist"))}let o;e.playlistErrors_>this.maxPlaylistRetries?o=1/0:o=Date.now()+i*1e3,e.excludeUntil=o,t.reason&&(e.lastExcludeReason_=t.reason),this.tech_.trigger("excludeplaylist"),this.tech_.trigger({type:"usage",name:"vhs-rendition-excluded"});const l=this.selectPlaylist();if(!l){this.error="Playback cannot continue. No available working or supported playlists.",this.trigger("error");return}const u=t.internal?this.logger_:U.log.warn,c=t.message?" "+t.message:"";u(`${t.internal?"Internal problem":"Problem"} encountered with playlist ${e.id}.${c} Switching to playlist ${l.id}.`),l.attributes.AUDIO!==e.attributes.AUDIO&&this.delegateLoaders_("audio",["abort","pause"]),l.attributes.SUBTITLES!==e.attributes.SUBTITLES&&this.delegateLoaders_("subtitle",["abort","pause"]),this.delegateLoaders_("main",["abort","pause"]);const h=l.targetDuration/2*1e3||5*1e3,d=typeof l.lastRequest=="number"&&Date.now()-l.lastRequest<=h;return this.switchMedia_(l,"exclude",a||d)}pauseLoading(){this.delegateLoaders_("all",["abort","pause"]),this.stopABRTimer_()}delegateLoaders_(e,t){const i=[],r=e==="all";(r||e==="main")&&i.push(this.mainPlaylistLoader_);const n=[];(r||e==="audio")&&n.push("AUDIO"),(r||e==="subtitle")&&(n.push("CLOSED-CAPTIONS"),n.push("SUBTITLES")),n.forEach(a=>{const o=this.mediaTypes_[a]&&this.mediaTypes_[a].activePlaylistLoader;o&&i.push(o)}),["main","audio","subtitle"].forEach(a=>{const o=this[`${a}SegmentLoader_`];o&&(e===a||e==="all")&&i.push(o)}),i.forEach(a=>t.forEach(o=>{typeof a[o]=="function"&&a[o]()}))}setCurrentTime(e){const t=Ga(this.tech_.buffered(),e);if(!(this.mainPlaylistLoader_&&this.mainPlaylistLoader_.media())||!this.mainPlaylistLoader_.media().segments)return 0;if(t&&t.length)return e;this.mainSegmentLoader_.pause(),this.mainSegmentLoader_.resetEverything(),this.mediaTypes_.AUDIO.activePlaylistLoader&&(this.audioSegmentLoader_.pause(),this.audioSegmentLoader_.resetEverything()),this.mediaTypes_.SUBTITLES.activePlaylistLoader&&(this.subtitleSegmentLoader_.pause(),this.subtitleSegmentLoader_.resetEverything()),this.load()}duration(){if(!this.mainPlaylistLoader_)return 0;const e=this.mainPlaylistLoader_.media();return e?e.endList?this.mediaSource?this.mediaSource.duration:ts.Playlist.duration(e):1/0:0}seekable(){return this.seekable_}getSeekableRange_(e,t){const i=e.media();if(!i)return null;const r=this.syncController_.getMediaSequenceSync(t);if(r&&r.isReliable){const o=r.start,l=r.end;if(!isFinite(o)||!isFinite(l))return null;const u=ts.Playlist.liveEdgeDelay(this.mainPlaylistLoader_.main,i),c=Math.max(0,l-u);return c<o?null:ni([[o,c]])}const n=this.syncController_.getExpiredTime(i,this.duration());if(n===null)return null;const a=ts.Playlist.seekable(i,n,ts.Playlist.liveEdgeDelay(this.mainPlaylistLoader_.main,i));return a.length?a:null}computeFinalSeekable_(e,t){if(!t)return e;const i=e.start(0),r=e.end(0),n=t.start(0),a=t.end(0);return n>r||i>a?e:ni([[Math.max(i,n),Math.min(r,a)]])}onSyncInfoUpdate_(){if(!this.mainPlaylistLoader_)return;const e=this.getSeekableRange_(this.mainPlaylistLoader_,"main");if(!e)return;let t;if(this.mediaTypes_.AUDIO.activePlaylistLoader&&(t=this.getSeekableRange_(this.mediaTypes_.AUDIO.activePlaylistLoader,"audio"),!t))return;const i=this.seekable_;if(this.seekable_=this.computeFinalSeekable_(e,t),!this.seekable_||i&&i.length&&this.seekable_.length&&i.start(0)===this.seekable_.start(0)&&i.end(0)===this.seekable_.end(0))return;this.logger_(`seekable updated [${c2(this.seekable_)}]`);const r={seekableRanges:this.seekable_};this.trigger({type:"seekablerangeschanged",metadata:r}),this.tech_.trigger("seekablechanged")}updateDuration(e){if(this.updateDuration_&&(this.mediaSource.removeEventListener("sourceopen",this.updateDuration_),this.updateDuration_=null),this.mediaSource.readyState!=="open"){this.updateDuration_=this.updateDuration.bind(this,e),this.mediaSource.addEventListener("sourceopen",this.updateDuration_);return}if(e){const r=this.seekable();if(!r.length)return;(isNaN(this.mediaSource.duration)||this.mediaSource.duration<r.end(r.length-1))&&this.sourceUpdater_.setDuration(r.end(r.length-1));return}const t=this.tech_.buffered();let i=ts.Playlist.duration(this.mainPlaylistLoader_.media());t.length>0&&(i=Math.max(i,t.end(t.length-1))),this.mediaSource.duration!==i&&this.sourceUpdater_.setDuration(i)}dispose(){this.trigger("dispose"),this.decrypter_.terminate(),this.mainPlaylistLoader_.dispose(),this.mainSegmentLoader_.dispose(),this.contentSteeringController_.dispose(),this.keyStatusMap_.clear(),this.loadOnPlay_&&this.tech_.off("play",this.loadOnPlay_),["AUDIO","SUBTITLES"].forEach(e=>{const t=this.mediaTypes_[e].groups;for(const i in t)t[i].forEach(r=>{r.playlistLoader&&r.playlistLoader.dispose()})}),this.audioSegmentLoader_.dispose(),this.subtitleSegmentLoader_.dispose(),this.sourceUpdater_.dispose(),this.timelineChangeController_.dispose(),this.stopABRTimer_(),this.updateDuration_&&this.mediaSource.removeEventListener("sourceopen",this.updateDuration_),this.mediaSource.removeEventListener("durationchange",this.handleDurationChange_),this.mediaSource.removeEventListener("sourceopen",this.handleSourceOpen_),this.mediaSource.removeEventListener("sourceended",this.handleSourceEnded_),this.off()}main(){return this.mainPlaylistLoader_.main}media(){return this.mainPlaylistLoader_.media()||this.initialMedia_}areMediaTypesKnown_(){const e=!!this.mediaTypes_.AUDIO.activePlaylistLoader,t=!!this.mainSegmentLoader_.getCurrentMediaInfo_(),i=e?!!this.audioSegmentLoader_.getCurrentMediaInfo_():!0;return!(!t||!i)}getCodecsOrExclude_(){const e={main:this.mainSegmentLoader_.getCurrentMediaInfo_()||{},audio:this.audioSegmentLoader_.getCurrentMediaInfo_()||{}},t=this.mainSegmentLoader_.getPendingSegmentPlaylist()||this.media();e.video=e.main;const i=$l(this.main(),t),r={},n=!!this.mediaTypes_.AUDIO.activePlaylistLoader;if(e.main.hasVideo&&(r.video=i.video||e.main.videoCodec||$D),e.main.isMuxed&&(r.video+=`,${i.audio||e.main.audioCodec||r_}`),(e.main.hasAudio&&!e.main.isMuxed||e.audio.hasAudio||n)&&(r.audio=i.audio||e.main.audioCodec||e.audio.audioCodec||r_,e.audio.isFmp4=e.main.hasAudio&&!e.main.isMuxed?e.main.isFmp4:e.audio.isFmp4),!r.audio&&!r.video){this.excludePlaylist({playlistToExclude:t,error:{message:"Could not determine codecs for playlist."},playlistExclusionDuration:1/0});return}const a=(u,c)=>u?Ml(c):Sf(c),o={};let l;if(["video","audio"].forEach(function(u){if(r.hasOwnProperty(u)&&!a(e[u].isFmp4,r[u])){const c=e[u].isFmp4?"browser":"muxer";o[c]=o[c]||[],o[c].push(r[u]),u==="audio"&&(l=c)}}),n&&l&&t.attributes.AUDIO){const u=t.attributes.AUDIO;this.main().playlists.forEach(c=>{(c.attributes&&c.attributes.AUDIO)===u&&c!==t&&(c.excludeUntil=1/0)}),this.logger_(`excluding audio group ${u} as ${l} does not support codec(s): "${r.audio}"`)}if(Object.keys(o).length){const u=Object.keys(o).reduce((c,h)=>(c&&(c+=", "),c+=`${h} does not support codec(s): "${o[h].join(",")}"`,c),"")+".";this.excludePlaylist({playlistToExclude:t,error:{internal:!0,message:u},playlistExclusionDuration:1/0});return}if(this.sourceUpdater_.hasCreatedSourceBuffers()&&!this.sourceUpdater_.canChangeType()){const u=[];if(["video","audio"].forEach(c=>{const h=(Vr(this.sourceUpdater_.codecs[c]||"")[0]||{}).type,d=(Vr(r[c]||"")[0]||{}).type;h&&d&&h.toLowerCase()!==d.toLowerCase()&&u.push(`"${this.sourceUpdater_.codecs[c]}" -> "${r[c]}"`)}),u.length){this.excludePlaylist({playlistToExclude:t,error:{message:`Codec switching not supported: ${u.join(", ")}.`,internal:!0},playlistExclusionDuration:1/0});return}}return r}tryToCreateSourceBuffers_(){if(this.mediaSource.readyState!=="open"||this.sourceUpdater_.hasCreatedSourceBuffers()||!this.areMediaTypesKnown_())return;const e=this.getCodecsOrExclude_();if(!e)return;this.sourceUpdater_.createSourceBuffers(e);const t=[e.video,e.audio].filter(Boolean).join(",");this.excludeIncompatibleVariants_(t)}excludeUnsupportedVariants_(){const e=this.main().playlists,t=[];Object.keys(e).forEach(i=>{const r=e[i];if(t.indexOf(r.id)!==-1)return;t.push(r.id);const n=$l(this.main,r),a=[];n.audio&&!Sf(n.audio)&&!Ml(n.audio)&&a.push(`audio codec ${n.audio}`),n.video&&!Sf(n.video)&&!Ml(n.video)&&a.push(`video codec ${n.video}`),n.text&&n.text==="stpp.ttml.im1t"&&a.push(`text codec ${n.text}`),a.length&&(r.excludeUntil=1/0,this.logger_(`excluding ${r.id} for unsupported: ${a.join(", ")}`))})}excludeIncompatibleVariants_(e){const t=[],i=this.main().playlists,r=nh(Vr(e)),n=nT(r),a=r.video&&Vr(r.video)[0]||null,o=r.audio&&Vr(r.audio)[0]||null;Object.keys(i).forEach(l=>{const u=i[l];if(t.indexOf(u.id)!==-1||u.excludeUntil===1/0)return;t.push(u.id);const c=[],h=$l(this.mainPlaylistLoader_.main,u),d=nT(h);if(!(!h.audio&&!h.video)){if(d!==n&&c.push(`codec count "${d}" !== "${n}"`),!this.sourceUpdater_.canChangeType()){const g=h.video&&Vr(h.video)[0]||null,y=h.audio&&Vr(h.audio)[0]||null;g&&a&&g.type.toLowerCase()!==a.type.toLowerCase()&&c.push(`video codec "${g.type}" !== "${a.type}"`),y&&o&&y.type.toLowerCase()!==o.type.toLowerCase()&&c.push(`audio codec "${y.type}" !== "${o.type}"`)}c.length&&(u.excludeUntil=1/0,this.logger_(`excluding ${u.id}: ${c.join(" && ")}`))}})}updateAdCues_(e){let t=0;const i=this.seekable();i.length&&(t=i.start(0)),NR(e,this.cueTagsTrack_,t)}goalBufferLength(){const e=this.tech_.currentTime(),t=ei.GOAL_BUFFER_LENGTH,i=ei.GOAL_BUFFER_LENGTH_RATE,r=Math.max(t,ei.MAX_GOAL_BUFFER_LENGTH);return Math.min(t+e*i,r)}bufferLowWaterLine(){const e=this.tech_.currentTime(),t=ei.BUFFER_LOW_WATER_LINE,i=ei.BUFFER_LOW_WATER_LINE_RATE,r=Math.max(t,ei.MAX_BUFFER_LOW_WATER_LINE),n=Math.max(t,ei.EXPERIMENTAL_MAX_BUFFER_LOW_WATER_LINE);return Math.min(t+e*i,this.bufferBasedABR?n:r)}bufferHighWaterLine(){return ei.BUFFER_HIGH_WATER_LINE}addDateRangesToTextTrack_(e){oT(this.inbandTextTracks_,"com.apple.streaming",this.tech_),cR({inbandTextTracks:this.inbandTextTracks_,dateRanges:e})}addMetadataToTextTrack(e,t,i){const r=this.sourceUpdater_.videoBuffer?this.sourceUpdater_.videoTimestampOffset():this.sourceUpdater_.audioTimestampOffset();oT(this.inbandTextTracks_,e,this.tech_),oR({inbandTextTracks:this.inbandTextTracks_,metadataArray:t,timestampOffset:r,videoDuration:i})}pathwayAttribute_(e){return e.attributes["PATHWAY-ID"]||e.attributes.serviceLocation}initContentSteeringController_(){const e=this.main();if(e.contentSteering){for(const t of e.playlists)this.contentSteeringController_.addAvailablePathway(this.pathwayAttribute_(t));if(this.contentSteeringController_.assignTagProperties(e.uri,e.contentSteering),this.contentSteeringController_.queryBeforeStart){this.contentSteeringController_.requestSteeringManifest(!0);return}this.tech_.one("canplay",()=>{this.contentSteeringController_.requestSteeringManifest()})}}resetContentSteeringController_(){this.contentSteeringController_.clearAvailablePathways(),this.contentSteeringController_.dispose(),this.initContentSteeringController_()}attachContentSteeringListeners_(){this.contentSteeringController_.on("content-steering",this.excludeThenChangePathway_.bind(this)),["contentsteeringloadstart","contentsteeringloadcomplete","contentsteeringparsed"].forEach(t=>{this.contentSteeringController_.on(t,i=>{this.trigger(ft({},i))})}),this.sourceType_==="dash"&&this.mainPlaylistLoader_.on("loadedplaylist",()=>{const t=this.main();(this.contentSteeringController_.didDASHTagChange(t.uri,t.contentSteering)||(()=>{const n=this.contentSteeringController_.getAvailablePathways(),a=[];for(const o of t.playlists){const l=o.attributes.serviceLocation;if(l&&(a.push(l),!n.has(l)))return!0}return!!(!a.length&&n.size)})())&&this.resetContentSteeringController_()})}excludeThenChangePathway_(){const e=this.contentSteeringController_.getPathway();if(!e)return;this.handlePathwayClones_();const i=this.main().playlists,r=new Set;let n=!1;Object.keys(i).forEach(a=>{const o=i[a],l=this.pathwayAttribute_(o),u=l&&e!==l;o.excludeUntil===1/0&&o.lastExcludeReason_==="content-steering"&&!u&&(delete o.excludeUntil,delete o.lastExcludeReason_,n=!0);const h=!o.excludeUntil&&o.excludeUntil!==1/0;!r.has(o.id)&&u&&h&&(r.add(o.id),o.excludeUntil=1/0,o.lastExcludeReason_="content-steering",this.logger_(`excluding ${o.id} for ${o.lastExcludeReason_}`))}),this.contentSteeringController_.manifestType_==="DASH"&&Object.keys(this.mediaTypes_).forEach(a=>{const o=this.mediaTypes_[a];if(o.activePlaylistLoader){const l=o.activePlaylistLoader.media_;l&&l.attributes.serviceLocation!==e&&(n=!0)}}),n&&this.changeSegmentPathway_()}handlePathwayClones_(){const t=this.main().playlists,i=this.contentSteeringController_.currentPathwayClones,r=this.contentSteeringController_.nextPathwayClones;if(i&&i.size||r&&r.size){for(const[a,o]of i.entries())r.get(a)||(this.mainPlaylistLoader_.updateOrDeleteClone(o),this.contentSteeringController_.excludePathway(a));for(const[a,o]of r.entries()){const l=i.get(a);if(!l){t.filter(c=>c.attributes["PATHWAY-ID"]===o["BASE-ID"]).forEach(c=>{this.mainPlaylistLoader_.addClonePathway(o,c)}),this.contentSteeringController_.addAvailablePathway(a);continue}this.equalPathwayClones_(l,o)||(this.mainPlaylistLoader_.updateOrDeleteClone(o,!0),this.contentSteeringController_.addAvailablePathway(a))}this.contentSteeringController_.currentPathwayClones=new Map(JSON.parse(JSON.stringify([...r])))}}equalPathwayClones_(e,t){if(e["BASE-ID"]!==t["BASE-ID"]||e.ID!==t.ID||e["URI-REPLACEMENT"].HOST!==t["URI-REPLACEMENT"].HOST)return!1;const i=e["URI-REPLACEMENT"].PARAMS,r=t["URI-REPLACEMENT"].PARAMS;for(const n in i)if(i[n]!==r[n])return!1;for(const n in r)if(i[n]!==r[n])return!1;return!0}changeSegmentPathway_(){const e=this.selectPlaylist();this.pauseLoading(),this.contentSteeringController_.manifestType_==="DASH"&&this.switchMediaForDASHContentSteering_(),this.switchMedia_(e,"content-steering")}excludeNonUsablePlaylistsByKeyId_(){if(!this.mainPlaylistLoader_||!this.mainPlaylistLoader_.main)return;let e=0;const t="non-usable";this.mainPlaylistLoader_.main.playlists.forEach(i=>{const r=this.mainPlaylistLoader_.getKeyIdSet(i);!r||!r.size||r.forEach(n=>{const a="usable",o=this.keyStatusMap_.has(n)&&this.keyStatusMap_.get(n)===a,l=i.lastExcludeReason_===t&&i.excludeUntil===1/0;o?o&&l&&(delete i.excludeUntil,delete i.lastExcludeReason_,this.logger_(`enabling playlist ${i.id} because key ID ${n} is ${a}`)):(i.excludeUntil!==1/0&&i.lastExcludeReason_!==t&&(i.excludeUntil=1/0,i.lastExcludeReason_=t,this.logger_(`excluding playlist ${i.id} because the key ID ${n} doesn't exist in the keyStatusMap or is not ${a}`)),e++)})}),e>=this.mainPlaylistLoader_.main.playlists.length&&this.mainPlaylistLoader_.main.playlists.forEach(i=>{const r=i&&i.attributes&&i.attributes.RESOLUTION&&i.attributes.RESOLUTION.height<720,n=i.excludeUntil===1/0&&i.lastExcludeReason_===t;r&&n&&(delete i.excludeUntil,U.log.warn(`enabling non-HD playlist ${i.id} because all playlists were excluded due to ${t} key IDs`))})}addKeyStatus_(e,t){const n=(typeof e=="string"?e:AR(e)).slice(0,32).toLowerCase();this.logger_(`KeyStatus '${t}' with key ID ${n} added to the keyStatusMap`),this.keyStatusMap_.set(n,t)}updatePlaylistByKeyStatus(e,t){this.addKeyStatus_(e,t),this.waitingForFastQualityPlaylistReceived_||this.excludeNonUsableThenChangePlaylist_(),this.mainPlaylistLoader_.off("loadedplaylist",this.excludeNonUsableThenChangePlaylist_.bind(this)),this.mainPlaylistLoader_.on("loadedplaylist",this.excludeNonUsableThenChangePlaylist_.bind(this))}excludeNonUsableThenChangePlaylist_(){this.excludeNonUsablePlaylistsByKeyId_(),this.fastQualityChange_()}}const t3=(s,e,t)=>i=>{const r=s.main.playlists[e],n=g0(r),a=id(r);if(typeof i>"u")return a;i?delete r.disabled:r.disabled=!0;const o={renditionInfo:{id:e,bandwidth:r.attributes.BANDWIDTH,resolution:r.attributes.RESOLUTION,codecs:r.attributes.CODECS},cause:"fast-quality"};return i!==a&&!n&&(t(r),i?s.trigger({type:"renditionenabled",metadata:o}):s.trigger({type:"renditiondisabled",metadata:o})),i};let i3=class{constructor(e,t,i){const{playlistController_:r}=e,n=r.fastQualityChange_.bind(r);if(t.attributes){const a=t.attributes.RESOLUTION;this.width=a&&a.width,this.height=a&&a.height,this.bandwidth=t.attributes.BANDWIDTH,this.frameRate=t.attributes["FRAME-RATE"]}this.codecs=$l(r.main(),t),this.playlist=t,this.id=i,this.enabled=t3(e.playlists,t.id,n)}};const r3=function(s){s.representations=()=>{const e=s.playlistController_.main(),t=hu(e)?s.playlistController_.getAudioTrackPlaylists_():e.playlists;return t?t.filter(i=>!g0(i)).map((i,r)=>new i3(s,i,i.id)):[]}},yT=["seeking","seeked","pause","playing","error"];let n3=class extends U.EventTarget{constructor(e){super(),this.playlistController_=e.playlistController,this.tech_=e.tech,this.seekable=e.seekable,this.allowSeeksWithinUnsafeLiveWindow=e.allowSeeksWithinUnsafeLiveWindow,this.liveRangeSafeTimeDelta=e.liveRangeSafeTimeDelta,this.media=e.media,this.playedRanges_=[],this.consecutiveUpdates=0,this.lastRecordedTime=null,this.checkCurrentTimeTimeout_=null,this.logger_=Tr("PlaybackWatcher"),this.logger_("initialize");const t=()=>this.monitorCurrentTime_(),i=()=>this.monitorCurrentTime_(),r=()=>this.techWaiting_(),n=()=>this.resetTimeUpdate_(),a=this.playlistController_,o=["main","subtitle","audio"],l={};o.forEach(c=>{l[c]={reset:()=>this.resetSegmentDownloads_(c),updateend:()=>this.checkSegmentDownloads_(c)},a[`${c}SegmentLoader_`].on("appendsdone",l[c].updateend),a[`${c}SegmentLoader_`].on("playlistupdate",l[c].reset),this.tech_.on(["seeked","seeking"],l[c].reset)});const u=c=>{["main","audio"].forEach(h=>{a[`${h}SegmentLoader_`][c]("appended",this.seekingAppendCheck_)})};this.seekingAppendCheck_=()=>{this.fixesBadSeeks_()&&(this.consecutiveUpdates=0,this.lastRecordedTime=this.tech_.currentTime(),u("off"))},this.clearSeekingAppendCheck_=()=>u("off"),this.watchForBadSeeking_=()=>{this.clearSeekingAppendCheck_(),u("on")},this.tech_.on("seeked",this.clearSeekingAppendCheck_),this.tech_.on("seeking",this.watchForBadSeeking_),this.tech_.on("waiting",r),this.tech_.on(yT,n),this.tech_.on("canplay",i),this.tech_.one("play",t),this.dispose=()=>{this.clearSeekingAppendCheck_(),this.logger_("dispose"),this.tech_.off("waiting",r),this.tech_.off(yT,n),this.tech_.off("canplay",i),this.tech_.off("play",t),this.tech_.off("seeking",this.watchForBadSeeking_),this.tech_.off("seeked",this.clearSeekingAppendCheck_),o.forEach(c=>{a[`${c}SegmentLoader_`].off("appendsdone",l[c].updateend),a[`${c}SegmentLoader_`].off("playlistupdate",l[c].reset),this.tech_.off(["seeked","seeking"],l[c].reset)}),this.checkCurrentTimeTimeout_&&O.clearTimeout(this.checkCurrentTimeTimeout_),this.resetTimeUpdate_()}}monitorCurrentTime_(){this.checkCurrentTime_(),this.checkCurrentTimeTimeout_&&O.clearTimeout(this.checkCurrentTimeTimeout_),this.checkCurrentTimeTimeout_=O.setTimeout(this.monitorCurrentTime_.bind(this),250)}resetSegmentDownloads_(e){const t=this.playlistController_[`${e}SegmentLoader_`];this[`${e}StalledDownloads_`]>0&&this.logger_(`resetting possible stalled download count for ${e} loader`),this[`${e}StalledDownloads_`]=0,this[`${e}Buffered_`]=t.buffered_()}checkSegmentDownloads_(e){const t=this.playlistController_,i=t[`${e}SegmentLoader_`],r=i.buffered_(),n=qO(this[`${e}Buffered_`],r);if(this[`${e}Buffered_`]=r,n){const a={bufferedRanges:r};t.trigger({type:"bufferedrangeschanged",metadata:a}),this.resetSegmentDownloads_(e);return}this[`${e}StalledDownloads_`]++,this.logger_(`found #${this[`${e}StalledDownloads_`]} ${e} appends that did not increase buffer (possible stalled download)`,{playlistId:i.playlist_&&i.playlist_.id,buffered:Vs(r)}),!(this[`${e}StalledDownloads_`]<10)&&(this.logger_(`${e} loader stalled download exclusion`),this.resetSegmentDownloads_(e),this.tech_.trigger({type:"usage",name:`vhs-${e}-download-exclusion`}),e!=="subtitle"&&t.excludePlaylist({error:{message:`Excessive ${e} segment downloading detected.`},playlistExclusionDuration:1/0}))}checkCurrentTime_(){if(this.tech_.paused()||this.tech_.seeking())return;const e=this.tech_.currentTime(),t=this.tech_.buffered();if(this.lastRecordedTime===e&&(!t.length||e+Xr>=t.end(t.length-1)))return this.techWaiting_();if(this.consecutiveUpdates>=5&&e===this.lastRecordedTime)this.consecutiveUpdates++,this.waiting_();else if(e===this.lastRecordedTime)this.consecutiveUpdates++;else{this.playedRanges_.push(ni([this.lastRecordedTime,e]));const i={playedRanges:this.playedRanges_};this.playlistController_.trigger({type:"playedrangeschanged",metadata:i}),this.consecutiveUpdates=0,this.lastRecordedTime=e}}resetTimeUpdate_(){this.consecutiveUpdates=0}fixesBadSeeks_(){if(!this.tech_.seeking())return!1;const t=this.seekable(),i=this.tech_.currentTime(),r=this.afterSeekableWindow_(t,i,this.media(),this.allowSeeksWithinUnsafeLiveWindow);let n;if(r&&(n=t.end(t.length-1)),this.beforeSeekableWindow_(t,i)){const y=t.start(0);n=y+(y===t.end(0)?0:Xr)}if(typeof n<"u")return this.logger_(`Trying to seek outside of seekable at time ${i} with seekable range ${c2(t)}. Seeking to ${n}.`),this.tech_.setCurrentTime(n),!0;const a=this.playlistController_.sourceUpdater_,o=this.tech_.buffered(),l=a.audioBuffer?a.audioBuffered():null,u=a.videoBuffer?a.videoBuffered():null,c=this.media(),h=c.partTargetDuration?c.partTargetDuration:(c.targetDuration-Kr)*2,d=[l,u];for(let y=0;y<d.length;y++){if(!d[y])continue;if(p0(d[y],i)<h)return!1}const g=sc(o,i);return g.length===0?!1:(n=g.start(0)+Xr,this.logger_(`Buffered region starts (${g.start(0)}) just beyond seek point (${i}). Seeking to ${n}.`),this.tech_.setCurrentTime(n),!0)}waiting_(){if(this.techWaiting_())return;const e=this.tech_.currentTime(),t=this.tech_.buffered(),i=Ga(t,e);if(i.length&&e+3<=i.end(0)){this.resetTimeUpdate_(),this.tech_.setCurrentTime(e),this.logger_(`Stopped at ${e} while inside a buffered region [${i.start(0)} -> ${i.end(0)}]. Attempting to resume playback by seeking to the current time.`),this.tech_.trigger({type:"usage",name:"vhs-unknown-waiting"});return}}techWaiting_(){const e=this.seekable(),t=this.tech_.currentTime();if(this.tech_.seeking())return!0;if(this.beforeSeekableWindow_(e,t)){const o=e.end(e.length-1);return this.logger_(`Fell out of live window at time ${t}. Seeking to live point (seekable end) ${o}`),this.resetTimeUpdate_(),this.tech_.setCurrentTime(o),this.tech_.trigger({type:"usage",name:"vhs-live-resync"}),!0}const i=this.tech_.vhs.playlistController_.sourceUpdater_,r=this.tech_.buffered();if(this.videoUnderflow_({audioBuffered:i.audioBuffered(),videoBuffered:i.videoBuffered(),currentTime:t}))return this.resetTimeUpdate_(),this.tech_.setCurrentTime(t),this.tech_.trigger({type:"usage",name:"vhs-video-underflow"}),!0;const a=sc(r,t);return a.length>0?(this.logger_(`Stopped at ${t} and seeking to ${a.start(0)}`),this.resetTimeUpdate_(),this.skipTheGap_(t),!0):!1}afterSeekableWindow_(e,t,i,r=!1){if(!e.length)return!1;let n=e.end(e.length-1)+Xr;const a=!i.endList,o=typeof i.partTargetDuration=="number";return a&&(o||r)&&(n=e.end(e.length-1)+i.targetDuration*3),t>n}beforeSeekableWindow_(e,t){return!!(e.length&&e.start(0)>0&&t<e.start(0)-this.liveRangeSafeTimeDelta)}videoUnderflow_({videoBuffered:e,audioBuffered:t,currentTime:i}){if(!e)return;let r;if(e.length&&t.length){const n=Ga(e,i-3),a=Ga(e,i),o=Ga(t,i);o.length&&!a.length&&n.length&&(r={start:n.end(0),end:o.end(0)})}else sc(e,i).length||(r=this.gapFromVideoUnderflow_(e,i));return r?(this.logger_(`Encountered a gap in video from ${r.start} to ${r.end}. Seeking to current time ${i}`),!0):!1}skipTheGap_(e){const t=this.tech_.buffered(),i=this.tech_.currentTime(),r=sc(t,i);if(this.resetTimeUpdate_(),r.length===0||i!==e)return;this.logger_("skipTheGap_:","currentTime:",i,"scheduled currentTime:",e,"nextRange start:",r.start(0)),this.tech_.setCurrentTime(r.start(0)+Kr);const n={gapInfo:{from:i,to:r.start(0)}};this.playlistController_.trigger({type:"gapjumped",metadata:n}),this.tech_.trigger({type:"usage",name:"vhs-gap-skip"})}gapFromVideoUnderflow_(e,t){const i=UO(e);for(let r=0;r<i.length;r++){const n=i.start(r),a=i.end(r);if(t-n<4&&t-n>2)return{start:n,end:a}}return null}};const s3={errorInterval:30,getSource(s){const t=this.tech({IWillNotUseThisInPlugins:!0}).currentSource_||this.currentSource();return s(t)}},ew=function(s,e){let t=0,i=0;const r=lt(s3,e);s.ready(()=>{s.trigger({type:"usage",name:"vhs-error-reload-initialized"})});const n=function(){i&&s.currentTime(i)},a=function(c){c!=null&&(i=s.duration()!==1/0&&s.currentTime()||0,s.one("loadedmetadata",n),s.src(c),s.trigger({type:"usage",name:"vhs-error-reload"}),s.play())},o=function(){if(Date.now()-t<r.errorInterval*1e3){s.trigger({type:"usage",name:"vhs-error-reload-canceled"});return}if(!r.getSource||typeof r.getSource!="function"){U.log.error("ERROR: reloadSourceOnError - The option getSource must be a function!");return}return t=Date.now(),r.getSource.call(s,a)},l=function(){s.off("loadedmetadata",n),s.off("error",o),s.off("dispose",l)},u=function(c){l(),ew(s,c)};s.on("error",o),s.on("dispose",l),s.reloadSourceOnError=u},a3=function(s){ew(this,s)};var tw="3.16.0",o3="7.1.0",l3="1.3.1",u3="7.2.0",c3="4.0.2";const Mt={PlaylistLoader:Ka,Playlist:qi,utils:dM,STANDARD_PLAYLIST_SELECTOR:aT,INITIAL_PLAYLIST_SELECTOR:iR,lastBandwidthSelector:aT,movingAverageBandwidthSelector:eR,comparePlaylistBandwidth:_0,comparePlaylistResolution:ZM,xhr:k2()};Object.keys(ei).forEach(s=>{Object.defineProperty(Mt,s,{get(){return U.log.warn(`using Vhs.${s} is UNSAFE be sure you know what you are doing`),ei[s]},set(e){if(U.log.warn(`using Vhs.${s} is UNSAFE be sure you know what you are doing`),typeof e!="number"||e<0){U.log.warn(`value of Vhs.${s} must be greater than or equal to 0`);return}ei[s]=e}})});const iw="videojs-vhs",rw=function(s,e){const t=e.media();let i=-1;for(let r=0;r<s.length;r++)if(s[r].id===t.id){i=r;break}s.selectedIndex_=i,s.trigger({selectedIndex:i,type:"change"})},h3=function(s,e){e.representations().forEach(t=>{s.addQualityLevel(t)}),rw(s,e.playlists)};Mt.canPlaySource=function(){return U.log.warn("VHS is no longer a tech. Please remove it from your player's techOrder.")};const d3=(s,e,t)=>{if(!s)return s;let i={};e&&e.attributes&&e.attributes.CODECS&&(i=nh(Vr(e.attributes.CODECS))),t&&t.attributes&&t.attributes.CODECS&&(i.audio=t.attributes.CODECS);const r=fo(i.video),n=fo(i.audio),a={};for(const o in s)a[o]={},n&&(a[o].audioContentType=n),r&&(a[o].videoContentType=r),e.contentProtection&&e.contentProtection[o]&&e.contentProtection[o].pssh&&(a[o].pssh=e.contentProtection[o].pssh),typeof s[o]=="string"&&(a[o].url=s[o]);return lt(s,a)},f3=(s,e)=>s.reduce((t,i)=>{if(!i.contentProtection)return t;const r=e.reduce((n,a)=>{const o=i.contentProtection[a];return o&&o.pssh&&(n[a]={pssh:o.pssh}),n},{});return Object.keys(r).length&&t.push(r),t},[]),p3=({player:s,sourceKeySystems:e,audioMedia:t,mainPlaylists:i})=>{if(!s.eme.initializeMediaKeys)return Promise.resolve();const r=t?i.concat([t]):i,n=f3(r,Object.keys(e)),a=[],o=[];return n.forEach(l=>{o.push(new Promise((u,c)=>{s.tech_.one("keysessioncreated",u)})),a.push(new Promise((u,c)=>{s.eme.initializeMediaKeys({keySystems:l},h=>{if(h){c(h);return}u()})}))}),Promise.race([Promise.all(a),Promise.race(o)])},m3=({player:s,sourceKeySystems:e,media:t,audioMedia:i})=>{const r=d3(e,t,i);return r?(s.currentSource().keySystems=r,r&&!s.eme?(U.log.warn("DRM encrypted source cannot be decrypted without a DRM plugin"),!1):!0):!1},nw=()=>{if(!O.localStorage)return null;const s=O.localStorage.getItem(iw);if(!s)return null;try{return JSON.parse(s)}catch{return null}},g3=s=>{if(!O.localStorage)return!1;let e=nw();e=e?lt(e,s):s;try{O.localStorage.setItem(iw,JSON.stringify(e))}catch{return!1}return e},v3=s=>s.toLowerCase().indexOf("data:application/vnd.videojs.vhs+json,")===0?JSON.parse(s.substring(s.indexOf(",")+1)):s,sw=(s,e)=>{s._requestCallbackSet||(s._requestCallbackSet=new Set),s._requestCallbackSet.add(e)},aw=(s,e)=>{s._responseCallbackSet||(s._responseCallbackSet=new Set),s._responseCallbackSet.add(e)},ow=(s,e)=>{s._requestCallbackSet&&(s._requestCallbackSet.delete(e),s._requestCallbackSet.size||delete s._requestCallbackSet)},lw=(s,e)=>{s._responseCallbackSet&&(s._responseCallbackSet.delete(e),s._responseCallbackSet.size||delete s._responseCallbackSet)};Mt.supportsNativeHls=function(){if(!ce||!ce.createElement)return!1;const s=ce.createElement("video");return U.getTech("Html5").isSupported()?["application/vnd.apple.mpegurl","audio/mpegurl","audio/x-mpegurl","application/x-mpegurl","video/x-mpegurl","video/mpegurl","application/mpegurl"].some(function(t){return/maybe|probably/i.test(s.canPlayType(t))}):!1}();Mt.supportsNativeDash=function(){return!ce||!ce.createElement||!U.getTech("Html5").isSupported()?!1:/maybe|probably/i.test(ce.createElement("video").canPlayType("application/dash+xml"))}();Mt.supportsTypeNatively=s=>s==="hls"?Mt.supportsNativeHls:s==="dash"?Mt.supportsNativeDash:!1;Mt.isSupported=function(){return U.log.warn("VHS is no longer a tech. Please remove it from your player's techOrder.")};Mt.xhr.onRequest=function(s){sw(Mt.xhr,s)};Mt.xhr.onResponse=function(s){aw(Mt.xhr,s)};Mt.xhr.offRequest=function(s){ow(Mt.xhr,s)};Mt.xhr.offResponse=function(s){lw(Mt.xhr,s)};const y3=U.getComponent("Component");let uw=class extends y3{constructor(e,t,i){if(super(t,i.vhs),typeof i.initialBandwidth=="number"&&(this.options_.bandwidth=i.initialBandwidth),this.logger_=Tr("VhsHandler"),t.options_&&t.options_.playerId){const r=U.getPlayer(t.options_.playerId);this.player_=r}if(this.tech_=t,this.source_=e,this.stats={},this.ignoreNextSeekingEvent_=!1,this.setOptions_(),this.options_.overrideNative&&t.overrideNativeAudioTracks&&t.overrideNativeVideoTracks)t.overrideNativeAudioTracks(!0),t.overrideNativeVideoTracks(!0);else if(this.options_.overrideNative&&(t.featuresNativeVideoTracks||t.featuresNativeAudioTracks))throw new Error("Overriding native VHS requires emulated tracks. See https://git.io/vMpjB");this.on(ce,["fullscreenchange","webkitfullscreenchange","mozfullscreenchange","MSFullscreenChange"],r=>{const n=ce.fullscreenElement||ce.webkitFullscreenElement||ce.mozFullScreenElement||ce.msFullscreenElement;n&&n.contains(this.tech_.el())?this.playlistController_.fastQualityChange_():this.playlistController_.checkABR_()}),this.on(this.tech_,"seeking",function(){if(this.ignoreNextSeekingEvent_){this.ignoreNextSeekingEvent_=!1;return}this.setCurrentTime(this.tech_.currentTime())}),this.on(this.tech_,"error",function(){this.tech_.error()&&this.playlistController_&&this.playlistController_.pauseLoading()}),this.on(this.tech_,"play",this.play)}setOptions_(e={}){if(this.options_=lt(this.options_,e),this.options_.withCredentials=this.options_.withCredentials||!1,this.options_.limitRenditionByPlayerDimensions=this.options_.limitRenditionByPlayerDimensions!==!1,this.options_.useDevicePixelRatio=this.options_.useDevicePixelRatio||!1,this.options_.useBandwidthFromLocalStorage=typeof this.source_.useBandwidthFromLocalStorage<"u"?this.source_.useBandwidthFromLocalStorage:this.options_.useBandwidthFromLocalStorage||!1,this.options_.useForcedSubtitles=this.options_.useForcedSubtitles||!1,this.options_.useNetworkInformationApi=this.options_.useNetworkInformationApi||!1,this.options_.useDtsForTimestampOffset=this.options_.useDtsForTimestampOffset||!1,this.options_.customTagParsers=this.options_.customTagParsers||[],this.options_.customTagMappers=this.options_.customTagMappers||[],this.options_.cacheEncryptionKeys=this.options_.cacheEncryptionKeys||!1,this.options_.llhls=this.options_.llhls!==!1,this.options_.bufferBasedABR=this.options_.bufferBasedABR||!1,typeof this.options_.playlistExclusionDuration!="number"&&(this.options_.playlistExclusionDuration=60),typeof this.options_.bandwidth!="number"&&this.options_.useBandwidthFromLocalStorage){const i=nw();i&&i.bandwidth&&(this.options_.bandwidth=i.bandwidth,this.tech_.trigger({type:"usage",name:"vhs-bandwidth-from-local-storage"})),i&&i.throughput&&(this.options_.throughput=i.throughput,this.tech_.trigger({type:"usage",name:"vhs-throughput-from-local-storage"}))}typeof this.options_.bandwidth!="number"&&(this.options_.bandwidth=ei.INITIAL_BANDWIDTH),this.options_.enableLowInitialPlaylist=this.options_.enableLowInitialPlaylist&&this.options_.bandwidth===ei.INITIAL_BANDWIDTH,["withCredentials","useDevicePixelRatio","customPixelRatio","limitRenditionByPlayerDimensions","bandwidth","customTagParsers","customTagMappers","cacheEncryptionKeys","playlistSelector","initialPlaylistSelector","bufferBasedABR","liveRangeSafeTimeDelta","llhls","useForcedSubtitles","useNetworkInformationApi","useDtsForTimestampOffset","exactManifestTimings","leastPixelDiffSelector"].forEach(i=>{typeof this.source_[i]<"u"&&(this.options_[i]=this.source_[i])}),this.limitRenditionByPlayerDimensions=this.options_.limitRenditionByPlayerDimensions,this.useDevicePixelRatio=this.options_.useDevicePixelRatio;const t=this.options_.customPixelRatio;typeof t=="number"&&t>=0&&(this.customPixelRatio=t)}setOptions(e={}){this.setOptions_(e)}src(e,t){if(!e)return;this.setOptions_(),this.options_.src=v3(this.source_.src),this.options_.tech=this.tech_,this.options_.externVhs=Mt,this.options_.sourceType=P1(t),this.options_.seekTo=n=>{this.tech_.setCurrentTime(n)},this.options_.player_=this.player_,this.playlistController_=new e3(this.options_);const i=lt({liveRangeSafeTimeDelta:Xr},this.options_,{seekable:()=>this.seekable(),media:()=>this.playlistController_.media(),playlistController:this.playlistController_});this.playbackWatcher_=new n3(i),this.attachStreamingEventListeners_(),this.playlistController_.on("error",()=>{const n=U.players[this.tech_.options_.playerId];let a=this.playlistController_.error;typeof a=="object"&&!a.code?a.code=3:typeof a=="string"&&(a={message:a,code:3}),n.error(a)});const r=this.options_.bufferBasedABR?Mt.movingAverageBandwidthSelector(.55):Mt.STANDARD_PLAYLIST_SELECTOR;this.playlistController_.selectPlaylist=this.selectPlaylist?this.selectPlaylist.bind(this):r.bind(this),this.playlistController_.selectInitialPlaylist=Mt.INITIAL_PLAYLIST_SELECTOR.bind(this),this.playlists=this.playlistController_.mainPlaylistLoader_,this.mediaSource=this.playlistController_.mediaSource,Object.defineProperties(this,{selectPlaylist:{get(){return this.playlistController_.selectPlaylist},set(n){this.playlistController_.selectPlaylist=n.bind(this)}},throughput:{get(){return this.playlistController_.mainSegmentLoader_.throughput.rate},set(n){this.playlistController_.mainSegmentLoader_.throughput.rate=n,this.playlistController_.mainSegmentLoader_.throughput.count=1}},bandwidth:{get(){let n=this.playlistController_.mainSegmentLoader_.bandwidth;const a=O.navigator.connection||O.navigator.mozConnection||O.navigator.webkitConnection,o=1e7;if(this.options_.useNetworkInformationApi&&a){const l=a.downlink*1e3*1e3;l>=o&&n>=o?n=Math.max(n,l):n=l}return n},set(n){this.playlistController_.mainSegmentLoader_.bandwidth=n,this.playlistController_.mainSegmentLoader_.throughput={rate:0,count:0}}},systemBandwidth:{get(){const n=1/(this.bandwidth||1);let a;return this.throughput>0?a=1/this.throughput:a=0,Math.floor(1/(n+a))},set(){U.log.error('The "systemBandwidth" property is read-only')}}}),this.options_.bandwidth&&(this.bandwidth=this.options_.bandwidth),this.options_.throughput&&(this.throughput=this.options_.throughput),Object.defineProperties(this.stats,{bandwidth:{get:()=>this.bandwidth||0,enumerable:!0},mediaRequests:{get:()=>this.playlistController_.mediaRequests_()||0,enumerable:!0},mediaRequestsAborted:{get:()=>this.playlistController_.mediaRequestsAborted_()||0,enumerable:!0},mediaRequestsTimedout:{get:()=>this.playlistController_.mediaRequestsTimedout_()||0,enumerable:!0},mediaRequestsErrored:{get:()=>this.playlistController_.mediaRequestsErrored_()||0,enumerable:!0},mediaTransferDuration:{get:()=>this.playlistController_.mediaTransferDuration_()||0,enumerable:!0},mediaBytesTransferred:{get:()=>this.playlistController_.mediaBytesTransferred_()||0,enumerable:!0},mediaSecondsLoaded:{get:()=>this.playlistController_.mediaSecondsLoaded_()||0,enumerable:!0},mediaAppends:{get:()=>this.playlistController_.mediaAppends_()||0,enumerable:!0},mainAppendsToLoadedData:{get:()=>this.playlistController_.mainAppendsToLoadedData_()||0,enumerable:!0},audioAppendsToLoadedData:{get:()=>this.playlistController_.audioAppendsToLoadedData_()||0,enumerable:!0},appendsToLoadedData:{get:()=>this.playlistController_.appendsToLoadedData_()||0,enumerable:!0},timeToLoadedData:{get:()=>this.playlistController_.timeToLoadedData_()||0,enumerable:!0},buffered:{get:()=>Vs(this.tech_.buffered()),enumerable:!0},currentTime:{get:()=>this.tech_.currentTime(),enumerable:!0},currentSource:{get:()=>this.tech_.currentSource_,enumerable:!0},currentTech:{get:()=>this.tech_.name_,enumerable:!0},duration:{get:()=>this.tech_.duration(),enumerable:!0},main:{get:()=>this.playlists.main,enumerable:!0},playerDimensions:{get:()=>this.tech_.currentDimensions(),enumerable:!0},seekable:{get:()=>Vs(this.tech_.seekable()),enumerable:!0},timestamp:{get:()=>Date.now(),enumerable:!0},videoPlaybackQuality:{get:()=>this.tech_.getVideoPlaybackQuality(),enumerable:!0}}),this.tech_.one("canplay",this.playlistController_.setupFirstPlay.bind(this.playlistController_)),this.tech_.on("bandwidthupdate",()=>{this.options_.useBandwidthFromLocalStorage&&g3({bandwidth:this.bandwidth,throughput:Math.round(this.throughput)})}),this.playlistController_.on("selectedinitialmedia",()=>{r3(this)}),this.playlistController_.sourceUpdater_.on("createdsourcebuffers",()=>{this.setupEme_()}),this.on(this.playlistController_,"progress",function(){this.tech_.trigger("progress")}),this.on(this.playlistController_,"firstplay",function(){this.ignoreNextSeekingEvent_=!0}),this.setupQualityLevels_(),this.tech_.el()&&(this.mediaSourceUrl_=O.URL.createObjectURL(this.playlistController_.mediaSource),(U.browser.IS_ANY_SAFARI||U.browser.IS_IOS)&&this.options_.overrideNative&&this.options_.sourceType==="hls"&&typeof this.tech_.addSourceElement=="function"?(this.tech_.addSourceElement(this.mediaSourceUrl_),this.tech_.addSourceElement(this.source_.src)):this.tech_.src(this.mediaSourceUrl_))}createKeySessions_(){const e=this.playlistController_.mediaTypes_.AUDIO.activePlaylistLoader;this.logger_("waiting for EME key session creation"),p3({player:this.player_,sourceKeySystems:this.source_.keySystems,audioMedia:e&&e.media(),mainPlaylists:this.playlists.main.playlists}).then(()=>{this.logger_("created EME key session"),this.playlistController_.sourceUpdater_.initializedEme()}).catch(t=>{this.logger_("error while creating EME key session",t),this.player_.error({message:"Failed to initialize media keys for EME",code:3})})}handleWaitingForKey_(){this.logger_("waitingforkey fired, attempting to create any new key sessions"),this.createKeySessions_()}setupEme_(){const e=this.playlistController_.mediaTypes_.AUDIO.activePlaylistLoader,t=m3({player:this.player_,sourceKeySystems:this.source_.keySystems,media:this.playlists.media(),audioMedia:e&&e.media()});if(this.player_.tech_.on("keystatuschange",i=>{this.playlistController_.updatePlaylistByKeyStatus(i.keyId,i.status)}),this.handleWaitingForKey_=this.handleWaitingForKey_.bind(this),this.player_.tech_.on("waitingforkey",this.handleWaitingForKey_),!t){this.playlistController_.sourceUpdater_.initializedEme();return}this.createKeySessions_()}setupQualityLevels_(){const e=U.players[this.tech_.options_.playerId];!e||!e.qualityLevels||this.qualityLevels_||(this.qualityLevels_=e.qualityLevels(),this.playlistController_.on("selectedinitialmedia",()=>{h3(this.qualityLevels_,this)}),this.playlists.on("mediachange",()=>{rw(this.qualityLevels_,this.playlists)}))}static version(){return{"@videojs/http-streaming":tw,"mux.js":o3,"mpd-parser":l3,"m3u8-parser":u3,"aes-decrypter":c3}}version(){return this.constructor.version()}canChangeType(){return Q2.canChangeType()}play(){this.playlistController_.play()}setCurrentTime(e){this.playlistController_.setCurrentTime(e)}duration(){return this.playlistController_.duration()}seekable(){return this.playlistController_.seekable()}dispose(){this.playbackWatcher_&&this.playbackWatcher_.dispose(),this.playlistController_&&this.playlistController_.dispose(),this.qualityLevels_&&this.qualityLevels_.dispose(),this.tech_&&this.tech_.vhs&&delete this.tech_.vhs,this.mediaSourceUrl_&&O.URL.revokeObjectURL&&(O.URL.revokeObjectURL(this.mediaSourceUrl_),this.mediaSourceUrl_=null),this.tech_&&this.tech_.off("waitingforkey",this.handleWaitingForKey_),super.dispose()}convertToProgramTime(e,t){return _M({playlist:this.playlistController_.media(),time:e,callback:t})}seekToProgramTime(e,t,i=!0,r=2){return N2({programTime:e,playlist:this.playlistController_.media(),retryCount:r,pauseAfterSeek:i,seekTo:this.options_.seekTo,tech:this.options_.tech,callback:t})}setupXhrHooks_(){this.xhr.onRequest=e=>{sw(this.xhr,e)},this.xhr.onResponse=e=>{aw(this.xhr,e)},this.xhr.offRequest=e=>{ow(this.xhr,e)},this.xhr.offResponse=e=>{lw(this.xhr,e)},this.player_.trigger("xhr-hooks-ready")}attachStreamingEventListeners_(){const e=["seekablerangeschanged","bufferedrangeschanged","contentsteeringloadstart","contentsteeringloadcomplete","contentsteeringparsed"],t=["gapjumped","playedrangeschanged"];e.forEach(i=>{this.playlistController_.on(i,r=>{this.player_.trigger(ft({},r))})}),t.forEach(i=>{this.playbackWatcher_.on(i,r=>{this.player_.trigger(ft({},r))})})}};const oh={name:"videojs-http-streaming",VERSION:tw,canHandleSource(s,e={}){const t=lt(U.options,e);return!t.vhs.experimentalUseMMS&&!Ml("avc1.4d400d,mp4a.40.2",!1)?!1:oh.canPlayType(s.type,t)},handleSource(s,e,t={}){const i=lt(U.options,t);return e.vhs=new uw(s,e,i),e.vhs.xhr=k2(),e.vhs.setupXhrHooks_(),e.vhs.src(s.src,s.type),e.vhs},canPlayType(s,e){const t=P1(s);if(!t)return"";const i=oh.getOverrideNative(e);return!Mt.supportsTypeNatively(t)||i?"maybe":""},getOverrideNative(s={}){const{vhs:e={}}=s,t=!(U.browser.IS_ANY_SAFARI||U.browser.IS_IOS),{overrideNative:i=t}=e;return i}},_3=()=>Ml("avc1.4d400d,mp4a.40.2",!0);_3()&&U.getTech("Html5").registerSourceHandler(oh,0);U.VhsHandler=uw;U.VhsSourceHandler=oh;U.Vhs=Mt;U.use||U.registerComponent("Vhs",Mt);U.options.vhs=U.options.vhs||{};(!U.getPlugin||!U.getPlugin("reloadSourceOnError"))&&U.registerPlugin("reloadSourceOnError",a3);const T3=U.getComponent("MenuItem");class b3 extends T3{constructor(e,t){super(e,t)}handleClick(e){super.handleClick(e),this.requestAnimationFrame(()=>{this.options_.item.showCollapsibleMenu()})}createEl(e,t,i){if(!this.options_.item)return super.createEl(e,t,i);const r=this.options_.item.getCollabsibleName(),n=this.options_.item.getCollabsibleValue(),a=this.options_.item.className,o=`<span class="vjs-menu-item-text">${r}</span>`;this.valueHolder_=U.dom.createEl("span",{innerHTML:n});const l=super.createEl(e,{className:`vjs-menu-item cv-cog-menu-item ${n?"cv-has-cog-value":""} ${a||""}`.trim(),innerHTML:o},i);return l.appendChild(this.valueHolder_),l}updateCollapsibleValue(){this.valueHolder_.innerHTML=this.options_.item.getCollabsibleValue()}}const S3=U.getComponent("MenuButton");class x3 extends S3{constructor(e,t){super(e,t),this.controlText("Settings")}buildWrapperCSSClass(){return`cv-menu-small cv-cog-menu-button ${super.buildWrapperCSSClass()}`}buildCSSClass(){return`cv-cog-button ${super.buildCSSClass()}`}pressButton(){if(this.player_.options_.deferMenus){this.player_.deferMenusPlugin().deferMenu();return}this.menu.children_.forEach(e=>{e.updateCollapsibleValue&&e.updateCollapsibleValue()}),super.pressButton()}createItems(){var t;const e=[];for(let i=0;i<this.options_.items.length;i++){const r=this.options_.items[i];r.isCollabsible&&r.showInCollabsibleMenu()&&r.isCollapsed&&e.push(new b3(this.player_,{item:r}))}return(t=this.additionalItems)!=null&&t.length&&this.additionalItems.forEach(i=>{const r=new i.ctor(this.player_,{...this.options_,...i.options??{}});e.splice(i.index,0,r)}),e}update(){super.update(),this.player_.trigger("resizemenus")}addItem(e){this.additionalItems||(this.additionalItems=[]),!this.additionalItems.some(t=>t.name===e.name)&&(this.additionalItems.push(e),this.update())}}U.registerComponent("cogButton",x3);const C3=U.getComponent("MenuItem");class la extends C3{constructor(e,t){super(e,t)}createEl(){return U.dom.createEl("li",{className:"vjs-menu-item cv-collapsible-menu-heading cv-divider-after-menu-item",innerHTML:`<span class="vjs-menu-item-text">${this.localize(this.options_.label)}</span>`,tabIndex:-1})}handleClick(e){if(super.handleClick(e),this.options_.onClickBack){this.options_.onClickBack();return}this.requestAnimationFrame(()=>{this.player_.getChild("collapserator").getChild("cogButton").pressButton()})}}const E3=U.getComponent("MenuItem"),_T=U.getComponent("MenuButton"),w3=["large","medium","small"];let k3=class extends E3{constructor(e,t){super(e,t)}handleClick(){this.player_.textTrackSettings.setSizeSetting(this.options_.value)}};class A3 extends _T{constructor(e,t){super(e,t),this.alwaysCollapsed=!0,this.isCollapsed=!1,this.isCollabsible=!0,this.player_.ready(()=>{this.update()})}createItems(){const e=this.player_.textTrackSettings;if(!e)return;const t=e.getSizeSetting(),i=[new la(this.player_,{label:"Caption Text Size",onClickBack:()=>{this.requestAnimationFrame(()=>{this.player_.getChild("collapserator").getChild("subsCapsButton").pressButton()})}})];return w3.map(r=>{i.push(new k3(this.player_,{label:r.charAt(0).toUpperCase()+r.substring(1),selectable:!0,multiSelectable:!1,selected:r===t,value:r}))}),i}buildWrapperCSSClass(){return`cv-menu-small cv-has-left-icons ${super.buildWrapperCSSClass()}`}getCollabsibleName(){return"Subtitle Size"}getCollabsibleValue(){return""}showInCollabsibleMenu(){return!1}showCollapsibleMenu(){_T.prototype.handleClick.apply(this)}}U.registerComponent("SubtitleSizeButton",A3);function T0(s,e,t,i){if(!s.length)return[];const r=[];for(let n=s.length-1;n>=0;n--){const a=s[n];if(a.kind===e){if(t&&a.label!==t||i&&a.language!==i)continue;r.push(a)}}return r}function lh(s,e,t,i,r){if(s.kind===e&&!(t&&s.label!==t)&&!(r&&s.language!==r)){if(s.loaded_){i(s);return}s.one("loadeddata",()=>{i(s)})}}function TT(s){if(s!=null&&s.cues.length)for(let e=0;e<s.cues.length;e++){const t=s.cues[e];t!=null&&t.text&&(t.text=wP.sanitize(t.text))}}function bT(s,e,t,i,r){const n=s.textTracks(),a=T0(n,e,t,r)[0];if(a){lh(a,e,t,i);return}const o=l=>{lh(l.track,e,t,i),n.removeEventListener("addtrack",o)};n.addEventListener("addtrack",o),s.one("dispose",()=>{n.removeEventListener("addtrack",o)})}function ST(s,e,t,i,r){const n=s.textTracks(),a=T0(n,e,t,r);a.length&&a.forEach(l=>lh(l,e,t,i,r));const o=l=>{lh(l.track,e,t,i,r)};n.addEventListener("addtrack",o),s.one("dispose",()=>{n.removeEventListener("addtrack",o)})}const Qt={getTrack(s,e,t,i){const r=s.textTracks();return T0(r,e,t,i)[0]},useChapters(s,e){bT(s,"chapters",null,e)},useMetadataTrack(s,e,t){bT(s,"metadata",e,t,null)},useMetadataTracks(s,e,t,i){ST(s,"metadata",e,t,i)},useSubtitles(s,e,t){ST(s,"subtitles",null,e,t)},getCurrentTextTrack(s){return this.findTrackByPredicate(s,e=>e.mode==="showing")},findTrackByPredicate(s,e){if(!s)return null;const t=s.textTracks();for(let i=0;i<t.length;i++){const r=t[i];if(e(r))return r}return null},forEachTrack(s,e){if(!s)return;const t=s.textTracks();for(let i=0;i<t.length;i++){const r=t[i];e(r)}},sanitizeTrack(s,e){if(!s||!e)return;if(s.loaded){TT(s);return}const t=()=>TT(s);s.addEventListener("loadeddata",t),e.one("dispose",()=>{s.removeEventListener("loadeddata",t)})},activeTextTrack(s){s.mode==="disabled"&&s.kind==="subtitles"&&(s.mode="hidden")}},I3=function(s,e){let t=window.performance.now();return function(...r){const n=window.performance.now();n-t>=e&&(s(...r),t=n)}},du=function(s,e,t,i=window){let r;const n=()=>{i.clearTimeout(r),r=null},a=(...o)=>{let l=!1,u=function(){r=null,u=null,s.apply(this,o)};return!r&&t&&(s.apply(this,o),l=!0),i.clearTimeout(r),r=i.setTimeout(u,e),l};return a.cancel=n,a},cw=U.getComponent("MenuItem");class b0 extends cw{constructor(e,t){super(e,t),this.onChange=du(this.onChange,100,!1,this),this.bindEventListeners()}createEl(){const e=this.localize("Search");return super.createEl("li",{className:`vjs-menu-item cv-search-input-menu-item-container ${this.options_.className||""}`.trim(),innerHTML:`
220
- <div class="cv-search-input-menu-item">
221
- <span class="cv-search-icon">
222
- <svg viewBox="0 0 24 24">
223
- <path d="M15.803 14.306l3.917 3.954a1 1 0 0 1-.007 1.417l-.018.018-.018.018a.997.997 0 0 1-1.41 0l-3.918-3.953-.3.214c-1.14.713-2.323 1.07-3.549 1.07-1.796 0-3.328-.642-4.597-1.925C4.634 13.836 4 12.296 4 10.5c0-1.796.634-3.328 1.903-4.597C7.172 4.634 8.704 4 10.5 4c1.796 0 3.329.634 4.597 1.903 1.27 1.269 1.904 2.801 1.904 4.597a6.447 6.447 0 0 1-1.027 3.507l-.17.3zM10.5 5.368c-1.425 0-2.637.5-3.635 1.497-.998.998-1.497 2.21-1.497 3.635 0 1.426.5 2.637 1.497 3.635.998.998 2.21 1.497 3.635 1.497 1.426 0 2.637-.499 3.635-1.497 1.027-1.026 1.54-2.238 1.54-3.635 0-1.397-.513-2.608-1.54-3.635-.998-.998-2.21-1.497-3.635-1.497z"/>
224
- </svg>
225
- </span><input placeholder="${e}" type="text" autocomplete="off" spellcheck="false" aria-label="${e}" />
226
- </div>
227
- `})}focus(){this.$("input").focus()}handleClick(e){e.stopImmediatePropagation(),this.$("input").focus()}handleKeyDown(){this.focus()}bindEventListeners(){const e=this.$("input");this.onChange=this.onChange.bind(this),e.addEventListener("keyup",this.onChange),e.addEventListener("blur",t=>{this.options_.menuButton.menu.handleBlur(t)})}onChange(e){const t=e.target;this.options_.search(t.value)}}U.registerComponent("SearchInputMenuItem",b0);class S0 extends cw{createEl(e,t,i){return super.createEl(e,{...t,className:"vjs-menu-item cv-no-results"},i)}setLabel(e){const t=this.$(".vjs-menu-item-text");t&&(t.innerHTML=e)}}U.registerComponent("NoMatchingResultsMenuItem",S0);const P3=U.getComponent("MenuItem");class D3 extends P3{constructor(e,t){super(e,t)}update(e,t){if(!(e!=null&&e.length)){this.el().innerHTML=`<span class="vjs-menu-item-text">${this.options_.label}</span>`;return}const i=[];let r=0;e.forEach(n=>{const a=this.options_.label.substr(r,n);a&&i.push(a),i.push('<span class="cv-highlight">'),i.push(this.options_.label.substr(n,t)),i.push("</span>"),r=n+t}),i.push(this.options_.label.substring(r,this.options_.label.length)),this.el().innerHTML=`<span class="vjs-menu-item-text">${i.join("")}</span>`}handleClick(e){e.stopImmediatePropagation(),this.player_.currentTime(this.options_.cue.startTime)}}const xT=U.getComponent("MenuButton");class N3 extends xT{constructor(e,t){super(e,t),this.alwaysCollapsed=!0,this.isCollapsed=!1,this.isCollabsible=!0,this.update=this.update.bind(this),this.search=this.search.bind(this),this.player_.textTracks().addEventListener("selectedlanguagechange",this.update)}bindTrackEvents(e){e.removeEventListener("loadeddata",this.update),e.addEventListener("loadeddata",this.update),this.player_.one("dispose",()=>{e.removeEventListener("loadeddata",this.update)})}createItems(){var r;const e=Qt.getCurrentTextTrack(this.player_);if(!e)return;if(!((r=e.cues)!=null&&r.length)){this.bindTrackEvents(e);return}const t=[new b0(this.player_,{menuButton:this,search:this.search})];for(let n=0;n<e.cues.length;n++){const a=e.cues[n];t.push(new D3(this.player_,{cue:a,label:a.text,selected:!1,multiSelectable:!1}))}const i=new S0(this.player_,{label:"No matching results",selected:!1,selectable:!1,multiSelectable:!1});return i.hide(),t.push(i),t}search(e){var r;e=e.trim();const t=Qt.getCurrentTextTrack(this.player_);if(!((r=t==null?void 0:t.cues)!=null&&r.length))return;const i=this.findMatches(e,t);this.toggleItemVisibility(e,i),this.toggleNoResults(e,i)}findMatches(e,t){const i={};if(!e)return i;const r=new RegExp(e,"gi");for(let n=0;n<t.cues.length;n++){const o=t.cues[n].text,l=[];let u;for(;u=r.exec(o);)l.push(u.index);l.length&&(i[n]=l)}return i}toggleItemVisibility(e,t){this.menu.children_.slice(1,this.menu.children_.length-1).forEach((r,n)=>{!e||t[n]?r.show():r.hide(),r.update(t[n],e.length)})}toggleNoResults(e,t){const i=this.menu.children_[this.menu.children_.length-1];!e||Object.keys(t).length?i.hide():i.show()}buildWrapperCSSClass(){return`cv-menu-big cv-subtitle-search-button ${super.buildWrapperCSSClass()}`}update(){super.update(),this.player_.trigger("resizemenus")}pressButton(){super.pressButton();const e=this.menu.children_[0];e!=null&&e.focus&&(e==null||e.focus())}getCollabsibleName(){return"Subtitle Size"}getCollabsibleValue(){return""}showInCollabsibleMenu(){return!1}showCollapsibleMenu(){xT.prototype.handleClick.apply(this)}}U.registerComponent("subtitleSearchButton",N3);const L3=U.getComponent("MenuItem"),CT=U.getComponent("MenuButton"),O3=[{label:"Play / Pause",type:"play-pause"},{label:"Volume",type:"volume"},{label:"Mute",type:"mute"},{label:"Toggle fullscreen",type:"fullscreen"},{label:"Exit fullscreen",type:"exit-fullscreen"},{label:"Toggle theatre mode",type:"theatre-mode"}];class M3 extends L3{constructor(e,t){super(e,t)}createEl(){return U.dom.createEl("li",{className:"vjs-menu-item",tabIndex:-1,innerHTML:`
228
- <span class="vjs-menu-item-text">${this.options_.label}</span>
229
- <span>${this.getDisplayHtml(this.options_.type)}
230
- `})}getDisplayHtml(e){switch(e){case"play-pause":return'<span class="cv-keyboard-button">Spacebar</span>';case"volume":return`<span class="cv-keyboard-button">Shift</span> +
231
- <span class="cv-keyboard-button cv-single-key">&uArr;</span> /
232
- <span class="cv-keyboard-button">Shift</span> +
233
- <span class="cv-keyboard-button cv-single-key">&dArr;</span>`;case"mute":return'<span class="cv-keyboard-button cv-single-key">m</span>';case"fullscreen":return'<span class="cv-keyboard-button cv-single-key">f</span>';case"exit-fullscreen":return'<span class="cv-keyboard-button cv-single-key">esc</span>';case"theatre-mode":return'<span class="cv-keyboard-button cv-single-key">t</span>'}return""}}class R3 extends CT{constructor(){super(...arguments),this.alwaysCollapsed=!0,this.isCollapsed=!1,this.isCollabsible=!0}createItems(){const e=[];return e.push(new la(this.player_,{label:"Keyboard shortcuts"})),O3.forEach(t=>{e.push(new M3(this.player_,t))}),e}buildWrapperCSSClass(){return`cv-menu-small cv-keyboard-shortcuts ${super.buildWrapperCSSClass()}`}getCollabsibleName(){return"Keyboard shortcuts"}getCollabsibleValue(){return""}showInCollabsibleMenu(){return!this.player_.options_.mobile}showCollapsibleMenu(){CT.prototype.handleClick.apply(this)}}U.registerComponent("KeyboardShortcutsButton",R3);const F3=600,B3=1200,Vf="cv-collapsed",U3=U.getComponent("Component");class $3 extends U3{constructor(e,t){super(e,t),this.addChild("cogButton",{items:this.children_},this.children_.length-1),this.update=this.update.bind(this),this.player_.on("cv-updatecog",this.update),this.player_.on("playerresize",this.update),this.player_.one("play",this.update),this.player_.on("dispose",()=>{this.player_.off("cv-updatecog",this.update),this.player_.off("playerresize",this.update),this.player_.off("play",this.update)})}toggleHidden(e){for(let t=0;t<this.children_.length;t++){const i=this.children_[t];if(i.isCollabsible){if(i.alwaysCollapsed){i.isCollapsed=!0,i.addClass(Vf);continue}e?(i.isCollapsed=!0,i.addClass(Vf)):(i.isCollapsed=!1,i.removeClass(Vf))}}this.getChild("cogButton").update()}update(){const e=this.player_.isFullscreen(),t=this.player_.whiteboardModePlugin().side,i=this.player_.el().getBoundingClientRect(),r=e&&(t==="left"||t==="right")?i.height:i.width;if(!r)return;this.addClass("cv-collapsorator-ready");let a=r<(e&&(t==="left"||t==="right"||t==="top")?B3:F3);this.player_.options_.deferMenus&&(a=!0),this.toggleHidden(a)}buildCSSClass(){return`cv-collapsorator ${super.buildCSSClass()}`}createEl(e,t,i){return super.createEl(e,{...t,className:this.buildCSSClass()},i)}}U.registerComponent("collapserator",$3);const j3=["playToggle","volumePanel","customControlSpacer","playbackRateMenuButton","chaptersButton","qualityButton","keyboardShortcutsButton","subsCapsButton","whiteboardModeButton","subtitleSizeButton","subtitleSearchButton","fullscreenToggle"];class q3{constructor(e){this.options=e,this.initialize()}logStream(){const e=`v:${this.options.videoId}`;uf.cacheExists(e)||(this.collectionApiClient.log({type:fi.WebPlayerStream,actionContext:this.getActionContext(),data:this.getAnalyticsData(),eventVersion:Gs.V3}),uf&&uf.cacheSet(e,null,300))}logVideoProgress(e){const t=this.getAnalyticsData();this.collectionApiClient.log(e.map(i=>({type:fi.StreamProgress,actionContext:this.getActionContext(),data:{...t,progress:i},eventVersion:Gs.V2})))}logUserAction(e,t){const i={...this.getAnalyticsData(),...e},r={...this.getActionContext(),...t};this.collectionApiClient.log({type:t.actionType,data:i,actionContext:r,eventVersion:t.eventVersion||Gs.V2})}getAnalyticsData(){const e={video:{id:this.options.videoId},flags:{isUsingLocalCache:this.options.isUsingLocalCache},...this.options.additionalAnalyticsData||{}};this.options.shareId&&(e.video.shareId=this.options.shareId);const t=this.getEntityType();return t===Ai.Interactive?e.interactive={id:+this.options.mediaId}:t===Ai.Clip&&(e.clip={id:+this.options.mediaId}),e}initialize(){this.setupCollectionApiClient(),Ry.lockWindowSession(),this.options.player.one("dispose",()=>Ry.unlockWindowSession())}setupCollectionApiClient(){this.collectionApiClient=new kP({productName:"player.web",productVersion:this.options.productVersion,regionName:this.options.regionName,collectionApiUrls:this.options.collectionApiUrls,collectionApiClientId:this.options.collectionApiClientId,getUser:()=>this.getCurrentUser(),shouldLog:Fy.shouldLog,formatData:Fy.formatData})}async getCurrentUser(){return{id:this.options.userId,customerId:this.options.customerId,sessionId:this.options.authSessionId}}getActionContext(){return{entity:this.getEntityType(),location:this.getLocationContext(),productArea:void 0,descriptor:this.options.isEmbedded?AP.Embedded:void 0,workflowPhase:void 0}}getEntityType(){switch(this.options.mediaType){case"MasterVideo":return Ai.Video;case"MasterInteractive":return Ai.Interactive;case"MasterClip":return Ai.Clip}}getLocationContext(){switch(this.options.playerType){case"player":return Ll.Player;case"interactive-player":return Ll.InteractivePlayer;case"create-clip-player":return Ll.CreateClipPlayer}}}class Jg extends Error{constructor(e,t){super((t==null?void 0:t.title)||"Ajax error"),this.url=e,this.response=t}}class V3{constructor(){this.tokens={gateway:null}}async get(e,t){return await this.parseResponse(await fetch(e,{method:"GET",mode:"cors",headers:this.getHeaders(t)}))}async delete(e,t){await fetch(e,{method:"DELETE",headers:this.getHeaders(t)})}async post(e,t,i,r=!0){const n=await fetch(e,{method:"POST",headers:this.getHeaders(i),body:t,mode:"cors"});if(r)return await this.parseResponse(n)}async put(e,t,i,r=!0){const n=await fetch(e,{method:"PUT",headers:this.getHeaders(i),body:t,mode:"cors"});if(r)return await this.parseResponse(n)}setToken(e,t){this.tokens[e]=t}getHeaders(e={}){const t={"Content-Type":"application/json"};return this.tokens[e.tokenName]&&(t.authorization=`Bearer ${this.tokens[e.tokenName]}`),t}async parseResponse(e){if(e.status===404)return null;if(!e.ok){let i;try{i=await e.json()}catch{throw new Jg(e.url)}finally{throw new Jg(e.url,i)}}return await e.json()}}const Zg=new V3;var lc={exports:{}},ET;function H3(){return ET||(ET=1,function(s,e){function t(l){if(l&&typeof l=="object"){var u=l.which||l.keyCode||l.charCode;u&&(l=u)}if(typeof l=="number")return a[l];var c=String(l),h=i[c.toLowerCase()];if(h)return h;var h=r[c.toLowerCase()];if(h)return h;if(c.length===1)return c.charCodeAt(0)}t.isEventKey=function(u,c){if(u&&typeof u=="object"){var h=u.which||u.keyCode||u.charCode;if(h==null)return!1;if(typeof c=="string"){var d=i[c.toLowerCase()];if(d)return d===h;var d=r[c.toLowerCase()];if(d)return d===h}else if(typeof c=="number")return c===h;return!1}},e=s.exports=t;var i=e.code=e.codes={backspace:8,tab:9,enter:13,shift:16,ctrl:17,alt:18,"pause/break":19,"caps lock":20,esc:27,space:32,"page up":33,"page down":34,end:35,home:36,left:37,up:38,right:39,down:40,insert:45,delete:46,command:91,"left command":91,"right command":93,"numpad *":106,"numpad +":107,"numpad -":109,"numpad .":110,"numpad /":111,"num lock":144,"scroll lock":145,"my computer":182,"my calculator":183,";":186,"=":187,",":188,"-":189,".":190,"/":191,"`":192,"[":219,"\\":220,"]":221,"'":222},r=e.aliases={windows:91,"⇧":16,"⌥":18,"⌃":17,"⌘":91,ctl:17,control:17,option:18,pause:19,break:19,caps:20,return:13,escape:27,spc:32,spacebar:32,pgup:33,pgdn:34,ins:45,del:46,cmd:91};/*!
234
- * Programatically add the following
235
- */for(n=97;n<123;n++)i[String.fromCharCode(n)]=n-32;for(var n=48;n<58;n++)i[n-48]=n;for(n=1;n<13;n++)i["f"+n]=n+111;for(n=0;n<10;n++)i["numpad "+n]=n+96;var a=e.names=e.title={};for(n in i)a[i[n]]=n;for(var o in r)i[o]=r[o]}(lc,lc.exports)),lc.exports}var z3=H3();const Ge=Hi(z3);function W3(s){document[s.fsApi_.fullscreenEnabled]&&(s.isFullscreen()?s.exitFullscreen():s.requestFullscreen())}function G3(s){const e=s.theatreModePlugin().getTheatreMode();s.theatreModePlugin().toggleTheatreMode(!e,{shouldLog:!0})}function K3(s){const e=s.volume(),t=s.lastVolume_();if(e===0){const i=t<.1?.1:t;s.volume(i),s.muted(!1)}else s.muted(!s.muted())}function wT(s){s.paused()?s.play():s.pause()}function uc(s,e){s.currentTime(s.currentTime()+e)}function kT(s,e){s.volume(s.volume()+e)}function X3(s){const e=s.target,t=["video-js","vjs-tech"];return e.tagName.toLowerCase()==="video"||!!t.find(i=>e.classList.contains(i))}const AT={f:W3,m:K3,k:wT,space:wT,t:G3,left:s=>uc(s,-5),right:s=>uc(s,5),j:s=>uc(s,-10),l:s=>uc(s,10),up:s=>kT(s,.05),down:s=>kT(s,-.05)};function Q3(s,e,t){if(s.ctrlKey||s.metaKey||s.altKey||s.shiftKey)return;const i=Ge(s);if(i==="t"&&!t.allowTheatreMode||i==="f"&&!t.allowFullscreen||!AT[i])return;AT[i](e,s);const r=X3(s),n=["space"].includes(i);(r||n)&&(s.preventDefault(),s.stopPropagation())}var hw=(s=>(s.PhysicallyChapteredVideo="physically-chaptered-video",s))(hw||{});const Y3="1.36.0",J3={version:Y3};var Hf,IT;function Z3(){if(IT)return Hf;IT=1,Hf=s;function s(e,t){var i,r=null;try{i=JSON.parse(e,t)}catch(n){r=n}return[r,i]}return Hf}var eF=Z3();const tF=Hi(eF);var cc={exports:{}},zf,PT;function iF(){if(PT)return zf;PT=1;var s=No(),e=function(r,n){return n===void 0&&(n=!1),function(a,o,l){if(a){r(a);return}if(o.statusCode>=400&&o.statusCode<=599){var u=l;if(n)if(s.TextDecoder){var c=t(o.headers&&o.headers["content-type"]);try{u=new TextDecoder(c).decode(l)}catch{}}else u=String.fromCharCode.apply(null,new Uint8Array(l));r({cause:u});return}r(null,l)}};function t(i){return i===void 0&&(i=""),i.toLowerCase().split(";").reduce(function(r,n){var a=n.split("="),o=a[0],l=a[1];return o.trim()==="charset"?l.trim():r},"utf-8")}return zf=e,zf}var DT;function rF(){if(DT)return cc.exports;DT=1;var s=No(),e=S1(),t=E1();o.httpHandler=iF();/**
236
- * @license
237
- * slighly modified parse-headers 2.0.2 <https://github.com/kesla/parse-headers/>
238
- * Copyright (c) 2014 David Björklund
239
- * Available under the MIT license
240
- * <https://github.com/kesla/parse-headers/blob/master/LICENCE>
241
- */var i=function(d){var g={};return d&&d.trim().split(`
242
- `).forEach(function(y){var p=y.indexOf(":"),_=y.slice(0,p).trim().toLowerCase(),k=y.slice(p+1).trim();typeof g[_]>"u"?g[_]=k:Array.isArray(g[_])?g[_].push(k):g[_]=[g[_],k]}),g};cc.exports=o,cc.exports.default=o,o.XMLHttpRequest=s.XMLHttpRequest||c,o.XDomainRequest="withCredentials"in new o.XMLHttpRequest?o.XMLHttpRequest:s.XDomainRequest,r(["get","put","post","patch","head","delete"],function(h){o[h==="delete"?"del":h]=function(d,g,y){return g=a(d,g,y),g.method=h.toUpperCase(),l(g)}});function r(h,d){for(var g=0;g<h.length;g++)d(h[g])}function n(h){for(var d in h)if(h.hasOwnProperty(d))return!1;return!0}function a(h,d,g){var y=h;return t(d)?(g=d,typeof h=="string"&&(y={uri:h})):y=e({},d,{uri:h}),y.callback=g,y}function o(h,d,g){return d=a(h,d,g),l(d)}function l(h){if(typeof h.callback>"u")throw new Error("callback argument missing");var d=!1,g=function(ie,he,fe){d||(d=!0,h.callback(ie,he,fe))};function y(){A.readyState===4&&setTimeout(k,0)}function p(){var K=void 0;if(A.response?K=A.response:K=A.responseText||u(A),I)try{K=JSON.parse(K)}catch{}return K}function _(K){return clearTimeout(G),K instanceof Error||(K=new Error(""+(K||"Unknown XMLHttpRequest Error"))),K.statusCode=0,g(K,H)}function k(){if(!$){var K;clearTimeout(G),h.useXDR&&A.status===void 0?K=200:K=A.status===1223?204:A.status;var ie=H,he=null;return K!==0?(ie={body:p(),statusCode:K,method:L,headers:{},url:R,rawRequest:A},A.getAllResponseHeaders&&(ie.headers=i(A.getAllResponseHeaders()))):he=new Error("Internal XMLHttpRequest Error"),g(he,ie,ie.body)}}var A=h.xhr||null;A||(h.cors||h.useXDR?A=new o.XDomainRequest:A=new o.XMLHttpRequest);var N,$,R=A.url=h.uri||h.url,L=A.method=h.method||"GET",F=h.body||h.data,B=A.headers=h.headers||{},C=!!h.sync,I=!1,G,H={body:void 0,headers:{},statusCode:0,method:L,url:R,rawRequest:A};if("json"in h&&h.json!==!1&&(I=!0,B.accept||B.Accept||(B.Accept="application/json"),L!=="GET"&&L!=="HEAD"&&(B["content-type"]||B["Content-Type"]||(B["Content-Type"]="application/json"),F=JSON.stringify(h.json===!0?F:h.json))),A.onreadystatechange=y,A.onload=k,A.onerror=_,A.onprogress=function(){},A.onabort=function(){$=!0},A.ontimeout=_,A.open(L,R,!C,h.username,h.password),C||(A.withCredentials=!!h.withCredentials),!C&&h.timeout>0&&(G=setTimeout(function(){if(!$){$=!0,A.abort("timeout");var K=new Error("XMLHttpRequest timeout");K.code="ETIMEDOUT",_(K)}},h.timeout)),A.setRequestHeader)for(N in B)B.hasOwnProperty(N)&&A.setRequestHeader(N,B[N]);else if(h.headers&&!n(h.headers))throw new Error("Headers cannot be set on an XDomainRequest object");return"responseType"in h&&(A.responseType=h.responseType),"beforeSend"in h&&typeof h.beforeSend=="function"&&h.beforeSend(A),A.send(F||null),A}function u(h){try{if(h.responseType==="document")return h.responseXML;var d=h.responseXML&&h.responseXML.documentElement.nodeName==="parsererror";if(h.responseType===""&&!d)return h.responseXML}catch{}return null}function c(){}return cc.exports}var nF=rF();const dw=Hi(nF);function fw(){try{var s=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(fw=function(){return!!s})()}function pw(s,e,t){if(fw())return Reflect.construct.apply(null,arguments);var i=[null];i.push.apply(i,e);var r=new(s.bind.apply(s,i));return t&&Lv(r,t.prototype),r}function sF(s,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");s.prototype=Object.create(e&&e.prototype,{constructor:{value:s,writable:!0,configurable:!0}}),Object.defineProperty(s,"prototype",{writable:!1}),e&&Lv(s,e)}var Wf={exports:{}},NT;function aF(){return NT||(NT=1,function(s,e){(function(t){var i=/^(?=((?:[a-zA-Z0-9+\-.]+:)?))\1(?=((?:\/\/[^\/?#]*)?))\2(?=((?:(?:[^?#\/]*\/)*[^;?#\/]*)?))\3((?:;[^?#]*)?)(\?[^#]*)?(#[^]*)?$/,r=/^(?=([^\/?#]*))\1([^]*)$/,n=/(?:\/|^)\.(?=\/)/g,a=/(?:\/|^)\.\.\/(?!\.\.\/)[^\/]*(?=\/)/g,o={buildAbsoluteURL:function(l,u,c){if(c=c||{},l=l.trim(),u=u.trim(),!u){if(!c.alwaysNormalize)return l;var h=o.parseURL(l);if(!h)throw new Error("Error trying to parse base URL.");return h.path=o.normalizePath(h.path),o.buildURLFromParts(h)}var d=o.parseURL(u);if(!d)throw new Error("Error trying to parse relative URL.");if(d.scheme)return c.alwaysNormalize?(d.path=o.normalizePath(d.path),o.buildURLFromParts(d)):u;var g=o.parseURL(l);if(!g)throw new Error("Error trying to parse base URL.");if(!g.netLoc&&g.path&&g.path[0]!=="/"){var y=r.exec(g.path);g.netLoc=y[1],g.path=y[2]}g.netLoc&&!g.path&&(g.path="/");var p={scheme:g.scheme,netLoc:d.netLoc,path:null,params:d.params,query:d.query,fragment:d.fragment};if(!d.netLoc&&(p.netLoc=g.netLoc,d.path[0]!=="/"))if(!d.path)p.path=g.path,d.params||(p.params=g.params,d.query||(p.query=g.query));else{var _=g.path,k=_.substring(0,_.lastIndexOf("/")+1)+d.path;p.path=o.normalizePath(k)}return p.path===null&&(p.path=c.alwaysNormalize?o.normalizePath(d.path):d.path),o.buildURLFromParts(p)},parseURL:function(l){var u=i.exec(l);return u?{scheme:u[1]||"",netLoc:u[2]||"",path:u[3]||"",params:u[4]||"",query:u[5]||"",fragment:u[6]||""}:null},normalizePath:function(l){for(l=l.split("").reverse().join("").replace(n,"");l.length!==(l=l.replace(a,"")).length;);return l.split("").reverse().join("")},buildURLFromParts:function(l){return l.scheme+l.netLoc+l.path+l.params+l.query+l.fragment}};s.exports=o})()}(Wf)),Wf.exports}var oF=aF();const LT=Hi(oF);var OT="http://example.com",rd=function(e,t){if(/^[a-z]+:/i.test(t))return t;/^data:/.test(e)&&(e=O.location&&O.location.href||"");var i=typeof O.URL=="function",r=/^\/\//.test(e),n=!O.location&&!/\/\//i.test(e);if(i?e=new O.URL(e,O.location||OT):/\/\//i.test(e)||(e=LT.buildAbsoluteURL(O.location&&O.location.href||"",e)),i){var a=new URL(t,e);return n?a.href.slice(OT.length):r?a.href.slice(a.protocol.length):a.href}return LT.buildAbsoluteURL(e,t)},x0=function(){function s(){this.listeners={}}var e=s.prototype;return e.on=function(i,r){this.listeners[i]||(this.listeners[i]=[]),this.listeners[i].push(r)},e.off=function(i,r){if(!this.listeners[i])return!1;var n=this.listeners[i].indexOf(r);return this.listeners[i]=this.listeners[i].slice(0),this.listeners[i].splice(n,1),n>-1},e.trigger=function(i){var r=this.listeners[i];if(r)if(arguments.length===2)for(var n=r.length,a=0;a<n;++a)r[a].call(this,arguments[1]);else for(var o=Array.prototype.slice.call(arguments,1),l=r.length,u=0;u<l;++u)r[u].apply(this,o)},e.dispose=function(){this.listeners={}},e.pipe=function(i){this.on("data",function(r){i.push(r)})},s}(),lF=function(e){return O.atob?O.atob(e):Buffer.from(e,"base64").toString("binary")};function mw(s){for(var e=lF(s),t=new Uint8Array(e.length),i=0;i<e.length;i++)t[i]=e.charCodeAt(i);return t}/*! @name m3u8-parser @version 4.8.0 @license Apache-2.0 */var uF=function(s){Ce(e,s);function e(){var i;return i=s.call(this)||this,i.buffer="",i}var t=e.prototype;return t.push=function(r){var n;for(this.buffer+=r,n=this.buffer.indexOf(`
243
- `);n>-1;n=this.buffer.indexOf(`
244
- `))this.trigger("data",this.buffer.substring(0,n)),this.buffer=this.buffer.substring(n+1)},e}(x0),cF=" ",Gf=function(e){var t=/([0-9.]*)?@?([0-9.]*)?/.exec(e||""),i={};return t[1]&&(i.length=parseInt(t[1],10)),t[2]&&(i.offset=parseInt(t[2],10)),i},hF=function(){var e="[^=]*",t='"[^"]*"|[^,]*',i="(?:"+e+")=(?:"+t+")";return new RegExp("(?:^|,)("+i+")")},Ir=function(e){for(var t=e.split(hF()),i={},r=t.length,n;r--;)t[r]!==""&&(n=/([^=]*)=(.*)/.exec(t[r]).slice(1),n[0]=n[0].replace(/^\s+|\s+$/g,""),n[1]=n[1].replace(/^\s+|\s+$/g,""),n[1]=n[1].replace(/^['"](.*)['"]$/g,"$1"),i[n[0]]=n[1]);return i},dF=function(s){Ce(e,s);function e(){var i;return i=s.call(this)||this,i.customParsers=[],i.tagMappers=[],i}var t=e.prototype;return t.push=function(r){var n=this,a,o;if(r=r.trim(),r.length!==0){if(r[0]!=="#"){this.trigger("data",{type:"uri",uri:r});return}var l=this.tagMappers.reduce(function(u,c){var h=c(r);return h===r?u:u.concat([h])},[r]);l.forEach(function(u){for(var c=0;c<n.customParsers.length;c++)if(n.customParsers[c].call(n,u))return;if(u.indexOf("#EXT")!==0){n.trigger("data",{type:"comment",text:u.slice(1)});return}if(u=u.replace("\r",""),a=/^#EXTM3U/.exec(u),a){n.trigger("data",{type:"tag",tagType:"m3u"});return}if(a=/^#EXTINF:?([0-9\.]*)?,?(.*)?$/.exec(u),a){o={type:"tag",tagType:"inf"},a[1]&&(o.duration=parseFloat(a[1])),a[2]&&(o.title=a[2]),n.trigger("data",o);return}if(a=/^#EXT-X-TARGETDURATION:?([0-9.]*)?/.exec(u),a){o={type:"tag",tagType:"targetduration"},a[1]&&(o.duration=parseInt(a[1],10)),n.trigger("data",o);return}if(a=/^#EXT-X-VERSION:?([0-9.]*)?/.exec(u),a){o={type:"tag",tagType:"version"},a[1]&&(o.version=parseInt(a[1],10)),n.trigger("data",o);return}if(a=/^#EXT-X-MEDIA-SEQUENCE:?(\-?[0-9.]*)?/.exec(u),a){o={type:"tag",tagType:"media-sequence"},a[1]&&(o.number=parseInt(a[1],10)),n.trigger("data",o);return}if(a=/^#EXT-X-DISCONTINUITY-SEQUENCE:?(\-?[0-9.]*)?/.exec(u),a){o={type:"tag",tagType:"discontinuity-sequence"},a[1]&&(o.number=parseInt(a[1],10)),n.trigger("data",o);return}if(a=/^#EXT-X-PLAYLIST-TYPE:?(.*)?$/.exec(u),a){o={type:"tag",tagType:"playlist-type"},a[1]&&(o.playlistType=a[1]),n.trigger("data",o);return}if(a=/^#EXT-X-BYTERANGE:?(.*)?$/.exec(u),a){o=ft(Gf(a[1]),{type:"tag",tagType:"byterange"}),n.trigger("data",o);return}if(a=/^#EXT-X-ALLOW-CACHE:?(YES|NO)?/.exec(u),a){o={type:"tag",tagType:"allow-cache"},a[1]&&(o.allowed=!/NO/.test(a[1])),n.trigger("data",o);return}if(a=/^#EXT-X-MAP:?(.*)$/.exec(u),a){if(o={type:"tag",tagType:"map"},a[1]){var h=Ir(a[1]);h.URI&&(o.uri=h.URI),h.BYTERANGE&&(o.byterange=Gf(h.BYTERANGE))}n.trigger("data",o);return}if(a=/^#EXT-X-STREAM-INF:?(.*)$/.exec(u),a){if(o={type:"tag",tagType:"stream-inf"},a[1]){if(o.attributes=Ir(a[1]),o.attributes.RESOLUTION){var d=o.attributes.RESOLUTION.split("x"),g={};d[0]&&(g.width=parseInt(d[0],10)),d[1]&&(g.height=parseInt(d[1],10)),o.attributes.RESOLUTION=g}o.attributes.BANDWIDTH&&(o.attributes.BANDWIDTH=parseInt(o.attributes.BANDWIDTH,10)),o.attributes["FRAME-RATE"]&&(o.attributes["FRAME-RATE"]=parseFloat(o.attributes["FRAME-RATE"])),o.attributes["PROGRAM-ID"]&&(o.attributes["PROGRAM-ID"]=parseInt(o.attributes["PROGRAM-ID"],10))}n.trigger("data",o);return}if(a=/^#EXT-X-MEDIA:?(.*)$/.exec(u),a){o={type:"tag",tagType:"media"},a[1]&&(o.attributes=Ir(a[1])),n.trigger("data",o);return}if(a=/^#EXT-X-ENDLIST/.exec(u),a){n.trigger("data",{type:"tag",tagType:"endlist"});return}if(a=/^#EXT-X-DISCONTINUITY/.exec(u),a){n.trigger("data",{type:"tag",tagType:"discontinuity"});return}if(a=/^#EXT-X-PROGRAM-DATE-TIME:?(.*)$/.exec(u),a){o={type:"tag",tagType:"program-date-time"},a[1]&&(o.dateTimeString=a[1],o.dateTimeObject=new Date(a[1])),n.trigger("data",o);return}if(a=/^#EXT-X-KEY:?(.*)$/.exec(u),a){o={type:"tag",tagType:"key"},a[1]&&(o.attributes=Ir(a[1]),o.attributes.IV&&(o.attributes.IV.substring(0,2).toLowerCase()==="0x"&&(o.attributes.IV=o.attributes.IV.substring(2)),o.attributes.IV=o.attributes.IV.match(/.{8}/g),o.attributes.IV[0]=parseInt(o.attributes.IV[0],16),o.attributes.IV[1]=parseInt(o.attributes.IV[1],16),o.attributes.IV[2]=parseInt(o.attributes.IV[2],16),o.attributes.IV[3]=parseInt(o.attributes.IV[3],16),o.attributes.IV=new Uint32Array(o.attributes.IV))),n.trigger("data",o);return}if(a=/^#EXT-X-START:?(.*)$/.exec(u),a){o={type:"tag",tagType:"start"},a[1]&&(o.attributes=Ir(a[1]),o.attributes["TIME-OFFSET"]=parseFloat(o.attributes["TIME-OFFSET"]),o.attributes.PRECISE=/YES/.test(o.attributes.PRECISE)),n.trigger("data",o);return}if(a=/^#EXT-X-CUE-OUT-CONT:?(.*)?$/.exec(u),a){o={type:"tag",tagType:"cue-out-cont"},a[1]?o.data=a[1]:o.data="",n.trigger("data",o);return}if(a=/^#EXT-X-CUE-OUT:?(.*)?$/.exec(u),a){o={type:"tag",tagType:"cue-out"},a[1]?o.data=a[1]:o.data="",n.trigger("data",o);return}if(a=/^#EXT-X-CUE-IN:?(.*)?$/.exec(u),a){o={type:"tag",tagType:"cue-in"},a[1]?o.data=a[1]:o.data="",n.trigger("data",o);return}if(a=/^#EXT-X-SKIP:(.*)$/.exec(u),a&&a[1]){o={type:"tag",tagType:"skip"},o.attributes=Ir(a[1]),o.attributes.hasOwnProperty("SKIPPED-SEGMENTS")&&(o.attributes["SKIPPED-SEGMENTS"]=parseInt(o.attributes["SKIPPED-SEGMENTS"],10)),o.attributes.hasOwnProperty("RECENTLY-REMOVED-DATERANGES")&&(o.attributes["RECENTLY-REMOVED-DATERANGES"]=o.attributes["RECENTLY-REMOVED-DATERANGES"].split(cF)),n.trigger("data",o);return}if(a=/^#EXT-X-PART:(.*)$/.exec(u),a&&a[1]){o={type:"tag",tagType:"part"},o.attributes=Ir(a[1]),["DURATION"].forEach(function(y){o.attributes.hasOwnProperty(y)&&(o.attributes[y]=parseFloat(o.attributes[y]))}),["INDEPENDENT","GAP"].forEach(function(y){o.attributes.hasOwnProperty(y)&&(o.attributes[y]=/YES/.test(o.attributes[y]))}),o.attributes.hasOwnProperty("BYTERANGE")&&(o.attributes.byterange=Gf(o.attributes.BYTERANGE)),n.trigger("data",o);return}if(a=/^#EXT-X-SERVER-CONTROL:(.*)$/.exec(u),a&&a[1]){o={type:"tag",tagType:"server-control"},o.attributes=Ir(a[1]),["CAN-SKIP-UNTIL","PART-HOLD-BACK","HOLD-BACK"].forEach(function(y){o.attributes.hasOwnProperty(y)&&(o.attributes[y]=parseFloat(o.attributes[y]))}),["CAN-SKIP-DATERANGES","CAN-BLOCK-RELOAD"].forEach(function(y){o.attributes.hasOwnProperty(y)&&(o.attributes[y]=/YES/.test(o.attributes[y]))}),n.trigger("data",o);return}if(a=/^#EXT-X-PART-INF:(.*)$/.exec(u),a&&a[1]){o={type:"tag",tagType:"part-inf"},o.attributes=Ir(a[1]),["PART-TARGET"].forEach(function(y){o.attributes.hasOwnProperty(y)&&(o.attributes[y]=parseFloat(o.attributes[y]))}),n.trigger("data",o);return}if(a=/^#EXT-X-PRELOAD-HINT:(.*)$/.exec(u),a&&a[1]){o={type:"tag",tagType:"preload-hint"},o.attributes=Ir(a[1]),["BYTERANGE-START","BYTERANGE-LENGTH"].forEach(function(y){if(o.attributes.hasOwnProperty(y)){o.attributes[y]=parseInt(o.attributes[y],10);var p=y==="BYTERANGE-LENGTH"?"length":"offset";o.attributes.byterange=o.attributes.byterange||{},o.attributes.byterange[p]=o.attributes[y],delete o.attributes[y]}}),n.trigger("data",o);return}if(a=/^#EXT-X-RENDITION-REPORT:(.*)$/.exec(u),a&&a[1]){o={type:"tag",tagType:"rendition-report"},o.attributes=Ir(a[1]),["LAST-MSN","LAST-PART"].forEach(function(y){o.attributes.hasOwnProperty(y)&&(o.attributes[y]=parseInt(o.attributes[y],10))}),n.trigger("data",o);return}n.trigger("data",{type:"tag",data:u.slice(4)})})}},t.addParser=function(r){var n=this,a=r.expression,o=r.customType,l=r.dataParser,u=r.segment;typeof l!="function"&&(l=function(h){return h}),this.customParsers.push(function(c){var h=a.exec(c);if(h)return n.trigger("data",{type:"custom",data:l(c),customType:o,segment:u}),!0})},t.addTagMapper=function(r){var n=r.expression,a=r.map,o=function(u){return n.test(u)?a(u):u};this.tagMappers.push(o)},e}(x0),fF=function(e){return e.toLowerCase().replace(/-(\w)/g,function(t){return t[1].toUpperCase()})},Fa=function(e){var t={};return Object.keys(e).forEach(function(i){t[fF(i)]=e[i]}),t},Kf=function(e){var t=e.serverControl,i=e.targetDuration,r=e.partTargetDuration;if(t){var n="#EXT-X-SERVER-CONTROL",a="holdBack",o="partHoldBack",l=i&&i*3,u=r&&r*2;i&&!t.hasOwnProperty(a)&&(t[a]=l,this.trigger("info",{message:n+" defaulting HOLD-BACK to targetDuration * 3 ("+l+")."})),l&&t[a]<l&&(this.trigger("warn",{message:n+" clamping HOLD-BACK ("+t[a]+") to targetDuration * 3 ("+l+")"}),t[a]=l),r&&!t.hasOwnProperty(o)&&(t[o]=r*3,this.trigger("info",{message:n+" defaulting PART-HOLD-BACK to partTargetDuration * 3 ("+t[o]+")."})),r&&t[o]<u&&(this.trigger("warn",{message:n+" clamping PART-HOLD-BACK ("+t[o]+") to partTargetDuration * 2 ("+u+")."}),t[o]=u)}},pF=function(s){Ce(e,s);function e(){var i;i=s.call(this)||this,i.lineStream=new uF,i.parseStream=new dF,i.lineStream.pipe(i.parseStream);var r=We(i),n=[],a={},o,l,u=!1,c=function(){},h={AUDIO:{},VIDEO:{},"CLOSED-CAPTIONS":{},SUBTITLES:{}},d="urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed",g=0;i.manifest={allowCache:!0,discontinuityStarts:[],segments:[]};var y=0,p=0;return i.on("end",function(){a.uri||!a.parts&&!a.preloadHints||(!a.map&&o&&(a.map=o),!a.key&&l&&(a.key=l),!a.timeline&&typeof g=="number"&&(a.timeline=g),i.manifest.preloadSegment=a)}),i.parseStream.on("data",function(_){var k,A;({tag:function(){({version:function(){_.version&&(this.manifest.version=_.version)},"allow-cache":function(){this.manifest.allowCache=_.allowed,"allowed"in _||(this.trigger("info",{message:"defaulting allowCache to YES"}),this.manifest.allowCache=!0)},byterange:function(){var R={};"length"in _&&(a.byterange=R,R.length=_.length,"offset"in _||(_.offset=y)),"offset"in _&&(a.byterange=R,R.offset=_.offset),y=R.offset+R.length},endlist:function(){this.manifest.endList=!0},inf:function(){"mediaSequence"in this.manifest||(this.manifest.mediaSequence=0,this.trigger("info",{message:"defaulting media sequence to zero"})),"discontinuitySequence"in this.manifest||(this.manifest.discontinuitySequence=0,this.trigger("info",{message:"defaulting discontinuity sequence to zero"})),_.duration>0&&(a.duration=_.duration),_.duration===0&&(a.duration=.01,this.trigger("info",{message:"updating zero segment duration to a small value"})),this.manifest.segments=n},key:function(){if(!_.attributes){this.trigger("warn",{message:"ignoring key declaration without attribute list"});return}if(_.attributes.METHOD==="NONE"){l=null;return}if(!_.attributes.URI){this.trigger("warn",{message:"ignoring key declaration without URI"});return}if(_.attributes.KEYFORMAT==="com.apple.streamingkeydelivery"){this.manifest.contentProtection=this.manifest.contentProtection||{},this.manifest.contentProtection["com.apple.fps.1_0"]={attributes:_.attributes};return}if(_.attributes.KEYFORMAT==="com.microsoft.playready"){this.manifest.contentProtection=this.manifest.contentProtection||{},this.manifest.contentProtection["com.microsoft.playready"]={uri:_.attributes.URI};return}if(_.attributes.KEYFORMAT===d){var R=["SAMPLE-AES","SAMPLE-AES-CTR","SAMPLE-AES-CENC"];if(R.indexOf(_.attributes.METHOD)===-1){this.trigger("warn",{message:"invalid key method provided for Widevine"});return}if(_.attributes.METHOD==="SAMPLE-AES-CENC"&&this.trigger("warn",{message:"SAMPLE-AES-CENC is deprecated, please use SAMPLE-AES-CTR instead"}),_.attributes.URI.substring(0,23)!=="data:text/plain;base64,"){this.trigger("warn",{message:"invalid key URI provided for Widevine"});return}if(!(_.attributes.KEYID&&_.attributes.KEYID.substring(0,2)==="0x")){this.trigger("warn",{message:"invalid key ID provided for Widevine"});return}this.manifest.contentProtection=this.manifest.contentProtection||{},this.manifest.contentProtection["com.widevine.alpha"]={attributes:{schemeIdUri:_.attributes.KEYFORMAT,keyId:_.attributes.KEYID.substring(2)},pssh:mw(_.attributes.URI.split(",")[1])};return}_.attributes.METHOD||this.trigger("warn",{message:"defaulting key method to AES-128"}),l={method:_.attributes.METHOD||"AES-128",uri:_.attributes.URI},typeof _.attributes.IV<"u"&&(l.iv=_.attributes.IV)},"media-sequence":function(){if(!isFinite(_.number)){this.trigger("warn",{message:"ignoring invalid media sequence: "+_.number});return}this.manifest.mediaSequence=_.number},"discontinuity-sequence":function(){if(!isFinite(_.number)){this.trigger("warn",{message:"ignoring invalid discontinuity sequence: "+_.number});return}this.manifest.discontinuitySequence=_.number,g=_.number},"playlist-type":function(){if(!/VOD|EVENT/.test(_.playlistType)){this.trigger("warn",{message:"ignoring unknown playlist type: "+_.playlist});return}this.manifest.playlistType=_.playlistType},map:function(){o={},_.uri&&(o.uri=_.uri),_.byterange&&(o.byterange=_.byterange),l&&(o.key=l)},"stream-inf":function(){if(this.manifest.playlists=n,this.manifest.mediaGroups=this.manifest.mediaGroups||h,!_.attributes){this.trigger("warn",{message:"ignoring empty stream-inf attributes"});return}a.attributes||(a.attributes={}),ft(a.attributes,_.attributes)},media:function(){if(this.manifest.mediaGroups=this.manifest.mediaGroups||h,!(_.attributes&&_.attributes.TYPE&&_.attributes["GROUP-ID"]&&_.attributes.NAME)){this.trigger("warn",{message:"ignoring incomplete or missing media group"});return}var R=this.manifest.mediaGroups[_.attributes.TYPE];R[_.attributes["GROUP-ID"]]=R[_.attributes["GROUP-ID"]]||{},k=R[_.attributes["GROUP-ID"]],A={default:/yes/i.test(_.attributes.DEFAULT)},A.default?A.autoselect=!0:A.autoselect=/yes/i.test(_.attributes.AUTOSELECT),_.attributes.LANGUAGE&&(A.language=_.attributes.LANGUAGE),_.attributes.URI&&(A.uri=_.attributes.URI),_.attributes["INSTREAM-ID"]&&(A.instreamId=_.attributes["INSTREAM-ID"]),_.attributes.CHARACTERISTICS&&(A.characteristics=_.attributes.CHARACTERISTICS),_.attributes.FORCED&&(A.forced=/yes/i.test(_.attributes.FORCED)),k[_.attributes.NAME]=A},discontinuity:function(){g+=1,a.discontinuity=!0,this.manifest.discontinuityStarts.push(n.length)},"program-date-time":function(){typeof this.manifest.dateTimeString>"u"&&(this.manifest.dateTimeString=_.dateTimeString,this.manifest.dateTimeObject=_.dateTimeObject),a.dateTimeString=_.dateTimeString,a.dateTimeObject=_.dateTimeObject},targetduration:function(){if(!isFinite(_.duration)||_.duration<0){this.trigger("warn",{message:"ignoring invalid target duration: "+_.duration});return}this.manifest.targetDuration=_.duration,Kf.call(this,this.manifest)},start:function(){if(!_.attributes||isNaN(_.attributes["TIME-OFFSET"])){this.trigger("warn",{message:"ignoring start declaration without appropriate attribute list"});return}this.manifest.start={timeOffset:_.attributes["TIME-OFFSET"],precise:_.attributes.PRECISE}},"cue-out":function(){a.cueOut=_.data},"cue-out-cont":function(){a.cueOutCont=_.data},"cue-in":function(){a.cueIn=_.data},skip:function(){this.manifest.skip=Fa(_.attributes),this.warnOnMissingAttributes_("#EXT-X-SKIP",_.attributes,["SKIPPED-SEGMENTS"])},part:function(){var R=this;u=!0;var L=this.manifest.segments.length,F=Fa(_.attributes);a.parts=a.parts||[],a.parts.push(F),F.byterange&&(F.byterange.hasOwnProperty("offset")||(F.byterange.offset=p),p=F.byterange.offset+F.byterange.length);var B=a.parts.length-1;this.warnOnMissingAttributes_("#EXT-X-PART #"+B+" for segment #"+L,_.attributes,["URI","DURATION"]),this.manifest.renditionReports&&this.manifest.renditionReports.forEach(function(C,I){C.hasOwnProperty("lastPart")||R.trigger("warn",{message:"#EXT-X-RENDITION-REPORT #"+I+" lacks required attribute(s): LAST-PART"})})},"server-control":function(){var R=this.manifest.serverControl=Fa(_.attributes);R.hasOwnProperty("canBlockReload")||(R.canBlockReload=!1,this.trigger("info",{message:"#EXT-X-SERVER-CONTROL defaulting CAN-BLOCK-RELOAD to false"})),Kf.call(this,this.manifest),R.canSkipDateranges&&!R.hasOwnProperty("canSkipUntil")&&this.trigger("warn",{message:"#EXT-X-SERVER-CONTROL lacks required attribute CAN-SKIP-UNTIL which is required when CAN-SKIP-DATERANGES is set"})},"preload-hint":function(){var R=this.manifest.segments.length,L=Fa(_.attributes),F=L.type&&L.type==="PART";a.preloadHints=a.preloadHints||[],a.preloadHints.push(L),L.byterange&&(L.byterange.hasOwnProperty("offset")||(L.byterange.offset=F?p:0,F&&(p=L.byterange.offset+L.byterange.length)));var B=a.preloadHints.length-1;if(this.warnOnMissingAttributes_("#EXT-X-PRELOAD-HINT #"+B+" for segment #"+R,_.attributes,["TYPE","URI"]),!!L.type)for(var C=0;C<a.preloadHints.length-1;C++){var I=a.preloadHints[C];I.type&&I.type===L.type&&this.trigger("warn",{message:"#EXT-X-PRELOAD-HINT #"+B+" for segment #"+R+" has the same TYPE "+L.type+" as preload hint #"+C})}},"rendition-report":function(){var R=Fa(_.attributes);this.manifest.renditionReports=this.manifest.renditionReports||[],this.manifest.renditionReports.push(R);var L=this.manifest.renditionReports.length-1,F=["LAST-MSN","URI"];u&&F.push("LAST-PART"),this.warnOnMissingAttributes_("#EXT-X-RENDITION-REPORT #"+L,_.attributes,F)},"part-inf":function(){this.manifest.partInf=Fa(_.attributes),this.warnOnMissingAttributes_("#EXT-X-PART-INF",_.attributes,["PART-TARGET"]),this.manifest.partInf.partTarget&&(this.manifest.partTargetDuration=this.manifest.partInf.partTarget),Kf.call(this,this.manifest)}}[_.tagType]||c).call(r)},uri:function(){a.uri=_.uri,n.push(a),this.manifest.targetDuration&&!("duration"in a)&&(this.trigger("warn",{message:"defaulting segment duration to the target duration"}),a.duration=this.manifest.targetDuration),l&&(a.key=l),a.timeline=g,o&&(a.map=o),p=0,a={}},comment:function(){},custom:function(){_.segment?(a.custom=a.custom||{},a.custom[_.customType]=_.data):(this.manifest.custom=this.manifest.custom||{},this.manifest.custom[_.customType]=_.data)}})[_.type].call(r)}),i}var t=e.prototype;return t.warnOnMissingAttributes_=function(r,n,a){var o=[];a.forEach(function(l){n.hasOwnProperty(l)||o.push(l)}),o.length&&this.trigger("warn",{message:r+" lacks required attribute(s): "+o.join(", ")})},t.push=function(r){this.lineStream.push(r)},t.end=function(){this.lineStream.push(`
245
- `),this.trigger("end")},t.addParser=function(r){this.parseStream.addParser(r)},t.addTagMapper=function(r){this.parseStream.addTagMapper(r)},e}(x0),ea={mp4:/^(av0?1|avc0?[1234]|vp0?9|flac|opus|mp3|mp4a|mp4v|stpp.ttml.im1t)/,webm:/^(vp0?[89]|av0?1|opus|vorbis)/,ogg:/^(vp0?[89]|theora|flac|opus|vorbis)/,video:/^(av0?1|avc0?[1234]|vp0?[89]|hvc1|hev1|theora|mp4v)/,audio:/^(mp4a|flac|vorbis|opus|ac-[34]|ec-3|alac|mp3|speex|aac)/,text:/^(stpp.ttml.im1t)/,muxerVideo:/^(avc0?1)/,muxerAudio:/^(mp4a)/,muxerText:/a^/},mF=["video","audio","text"],MT=["Video","Audio","Text"],gw=function(e){return e&&e.replace(/avc1\.(\d+)\.(\d+)/i,function(t,i,r){var n=("00"+Number(i).toString(16)).slice(-2),a=("00"+Number(r).toString(16)).slice(-2);return"avc1."+n+"00"+a})},Hr=function(e){e===void 0&&(e="");var t=e.split(","),i=[];return t.forEach(function(r){r=r.trim();var n;mF.forEach(function(a){var o=ea[a].exec(r.toLowerCase());if(!(!o||o.length<=1)){n=a;var l=r.substring(0,o[1].length),u=r.replace(l,"");i.push({type:l,details:u,mediaType:a})}}),n||i.push({type:r,details:"",mediaType:"unknown"})}),i},gF=function(e,t){if(!e.mediaGroups.AUDIO||!t)return null;var i=e.mediaGroups.AUDIO[t];if(!i)return null;for(var r in i){var n=i[r];if(n.default&&n.playlists)return Hr(n.playlists[0].attributes.CODECS)}return null},vw=function(e){return e===void 0&&(e=""),ea.audio.test(e.trim().toLowerCase())},vF=function(e){return e===void 0&&(e=""),ea.text.test(e.trim().toLowerCase())},Ql=function(e){if(!(!e||typeof e!="string")){var t=e.toLowerCase().split(",").map(function(n){return gw(n.trim())}),i="video";t.length===1&&vw(t[0])?i="audio":t.length===1&&vF(t[0])&&(i="application");var r="mp4";return t.every(function(n){return ea.mp4.test(n)})?r="mp4":t.every(function(n){return ea.webm.test(n)})?r="webm":t.every(function(n){return ea.ogg.test(n)})&&(r="ogg"),i+"/"+r+';codecs="'+e+'"'}},Lc=function(e){return e===void 0&&(e=""),O.MediaSource&&O.MediaSource.isTypeSupported&&O.MediaSource.isTypeSupported(Ql(e))||!1},Xf=function(e){return e===void 0&&(e=""),e.toLowerCase().split(",").every(function(t){t=t.trim();for(var i=0;i<MT.length;i++){var r=MT[i];if(ea["muxer"+r].test(t))return!0}return!1})},RT="mp4a.40.2",yF="avc1.4d400d",_F=/^(audio|video|application)\/(x-|vnd\.apple\.)?mpegurl/i,TF=/^application\/dash\+xml/i,yw=function(e){return _F.test(e)?"hls":TF.test(e)?"dash":e==="application/vnd.videojs.vhs+json"?"vhs-json":null},bF=function(e){return e.toString(2).length},SF=function(e){return Math.ceil(bF(e)/8)},_w=function(e){return ArrayBuffer.isView==="function"?ArrayBuffer.isView(e):e&&e.buffer instanceof ArrayBuffer},xF=function(e){return _w(e)},je=function(e){return e instanceof Uint8Array?e:(!Array.isArray(e)&&!xF(e)&&!(e instanceof ArrayBuffer)&&(typeof e!="number"||typeof e=="number"&&e!==e?e=0:e=[e]),new Uint8Array(e&&e.buffer||e,e&&e.byteOffset||0,e&&e.byteLength||0))},hi=O.BigInt||Number,ev=[hi("0x1"),hi("0x100"),hi("0x10000"),hi("0x1000000"),hi("0x100000000"),hi("0x10000000000"),hi("0x1000000000000"),hi("0x100000000000000"),hi("0x10000000000000000")];(function(){var s=new Uint16Array([65484]),e=new Uint8Array(s.buffer,s.byteOffset,s.byteLength);return e[0]===255?"big":e[0]===204?"little":"unknown"})();var CF=function(e,t){var i=t===void 0?{}:t,r=i.signed,n=r===void 0?!1:r,a=i.le,o=a===void 0?!1:a;e=je(e);var l=o?"reduce":"reduceRight",u=e[l]?e[l]:Array.prototype[l],c=u.call(e,function(d,g,y){var p=o?y:Math.abs(y+1-e.length);return d+hi(g)*ev[p]},hi(0));if(n){var h=ev[e.length]/hi(2)-hi(1);c=hi(c),c>h&&(c-=h,c-=h,c-=hi(2))}return Number(c)},EF=function(e,t){var i={},r=i.le,n=r===void 0?!1:r;(typeof e!="bigint"&&typeof e!="number"||typeof e=="number"&&e!==e)&&(e=0),e=hi(e);for(var a=SF(e),o=new Uint8Array(new ArrayBuffer(a)),l=0;l<a;l++){var u=n?l:Math.abs(l+1-o.length);o[u]=Number(e/ev[l]&hi(255)),e<0&&(o[u]=Math.abs(~o[u]),o[u]-=l===0?1:2)}return o},Tw=function(e,t){if(typeof e!="string"&&e&&typeof e.toString=="function"&&(e=e.toString()),typeof e!="string")return new Uint8Array;t||(e=unescape(encodeURIComponent(e)));for(var i=new Uint8Array(e.length),r=0;r<e.length;r++)i[r]=e.charCodeAt(r);return i},wF=function(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];if(t=t.filter(function(o){return o&&(o.byteLength||o.length)&&typeof o!="string"}),t.length<=1)return je(t[0]);var r=t.reduce(function(o,l,u){return o+(l.byteLength||l.length)},0),n=new Uint8Array(r),a=0;return t.forEach(function(o){o=je(o),n.set(o,a),a+=o.byteLength}),n},It=function(e,t,i){var r=i===void 0?{}:i,n=r.offset,a=n===void 0?0:n,o=r.mask,l=o===void 0?[]:o;e=je(e),t=je(t);var u=t.every?t.every:Array.prototype.every;return t.length&&e.length-a>=t.length&&u.call(t,function(c,h){var d=l[h]?l[h]&e[a+h]:e[a+h];return c===d})},kF=function(e,t,i){t.forEach(function(r){for(var n in e.mediaGroups[r])for(var a in e.mediaGroups[r][n]){var o=e.mediaGroups[r][n][a];i(o,r,n,a)}})};/*! @name mpd-parser @version 0.22.1 @license Apache-2.0 */var FT=function(e){return!!e&&typeof e=="object"},Pi=function s(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];return t.reduce(function(r,n){return typeof n!="object"||Object.keys(n).forEach(function(a){Array.isArray(r[a])&&Array.isArray(n[a])?r[a]=r[a].concat(n[a]):FT(r[a])&&FT(n[a])?r[a]=s(r[a],n[a]):r[a]=n[a]}),r},{})},bw=function(e){return Object.keys(e).map(function(t){return e[t]})},AF=function(e,t){for(var i=[],r=e;r<t;r++)i.push(r);return i},nd=function(e){return e.reduce(function(t,i){return t.concat(i)},[])},Sw=function(e){if(!e.length)return[];for(var t=[],i=0;i<e.length;i++)t.push(e[i]);return t},IF=function(e,t){return e.reduce(function(i,r,n){return r[t]&&i.push(n),i},[])},tv=function(e,t){for(var i=0;i<e.length;i++)if(t(e[i]))return i;return-1},PF=function(e,t){return bw(e.reduce(function(i,r){return r.forEach(function(n){i[t(n)]=n}),i},{}))},xo={INVALID_NUMBER_OF_PERIOD:"INVALID_NUMBER_OF_PERIOD",DASH_EMPTY_MANIFEST:"DASH_EMPTY_MANIFEST",DASH_INVALID_XML:"DASH_INVALID_XML",NO_BASE_URL:"NO_BASE_URL",SEGMENT_TIME_UNSPECIFIED:"SEGMENT_TIME_UNSPECIFIED",UNSUPPORTED_UTC_TIMING_SCHEME:"UNSUPPORTED_UTC_TIMING_SCHEME"},Yl=function(e){var t=e.baseUrl,i=t===void 0?"":t,r=e.source,n=r===void 0?"":r,a=e.range,o=a===void 0?"":a,l=e.indexRange,u=l===void 0?"":l,c={uri:n,resolvedUri:rd(i||"",n)};if(o||u){var h=o||u,d=h.split("-"),g=O.BigInt?O.BigInt(d[0]):parseInt(d[0],10),y=O.BigInt?O.BigInt(d[1]):parseInt(d[1],10);g<Number.MAX_SAFE_INTEGER&&typeof g=="bigint"&&(g=Number(g)),y<Number.MAX_SAFE_INTEGER&&typeof y=="bigint"&&(y=Number(y));var p;typeof y=="bigint"||typeof g=="bigint"?p=O.BigInt(y)-O.BigInt(g)+O.BigInt(1):p=y-g+1,typeof p=="bigint"&&p<Number.MAX_SAFE_INTEGER&&(p=Number(p)),c.byterange={length:p,offset:g}}return c},DF=function(e){var t;return typeof e.offset=="bigint"||typeof e.length=="bigint"?t=O.BigInt(e.offset)+O.BigInt(e.length)-O.BigInt(1):t=e.offset+e.length-1,e.offset+"-"+t},BT=function(e){return e&&typeof e!="number"&&(e=parseInt(e,10)),isNaN(e)?null:e},NF={static:function(e){var t=e.duration,i=e.timescale,r=i===void 0?1:i,n=e.sourceDuration,a=e.periodDuration,o=BT(e.endNumber),l=t/r;return typeof o=="number"?{start:0,end:o}:typeof a=="number"?{start:0,end:a/l}:{start:0,end:n/l}},dynamic:function(e){var t=e.NOW,i=e.clientOffset,r=e.availabilityStartTime,n=e.timescale,a=n===void 0?1:n,o=e.duration,l=e.periodStart,u=l===void 0?0:l,c=e.minimumUpdatePeriod,h=c===void 0?0:c,d=e.timeShiftBufferDepth,g=d===void 0?1/0:d,y=BT(e.endNumber),p=(t+i)/1e3,_=r+u,k=p+h,A=k-_,N=Math.ceil(A*a/o),$=Math.floor((p-_-g)*a/o),R=Math.floor((p-_)*a/o);return{start:Math.max(0,$),end:typeof y=="number"?y:Math.min(N,R)}}},LF=function(e){return function(t){var i=e.duration,r=e.timescale,n=r===void 0?1:r,a=e.periodStart,o=e.startNumber,l=o===void 0?1:o;return{number:l+t,duration:i/n,timeline:a,time:t*i}}},C0=function(e){var t=e.type,i=e.duration,r=e.timescale,n=r===void 0?1:r,a=e.periodDuration,o=e.sourceDuration,l=NF[t](e),u=l.start,c=l.end,h=AF(u,c).map(LF(e));if(t==="static"){var d=h.length-1,g=typeof a=="number"?a:o;h[d].duration=g-i/n*d}return h},xw=function(e){var t=e.baseUrl,i=e.initialization,r=i===void 0?{}:i,n=e.sourceDuration,a=e.indexRange,o=a===void 0?"":a,l=e.periodStart,u=e.presentationTime,c=e.number,h=c===void 0?0:c,d=e.duration;if(!t)throw new Error(xo.NO_BASE_URL);var g=Yl({baseUrl:t,source:r.sourceURL,range:r.range}),y=Yl({baseUrl:t,source:t,indexRange:o});if(y.map=g,d){var p=C0(e);p.length&&(y.duration=p[0].duration,y.timeline=p[0].timeline)}else n&&(y.duration=n,y.timeline=l);return y.presentationTime=u||l,y.number=h,[y]},E0=function(e,t,i){var r=e.sidx.map?e.sidx.map:null,n=e.sidx.duration,a=e.timeline||0,o=e.sidx.byterange,l=o.offset+o.length,u=t.timescale,c=t.references.filter(function(C){return C.referenceType!==1}),h=[],d=e.endList?"static":"dynamic",g=e.sidx.timeline,y=g,p=e.mediaSequence||0,_;typeof t.firstOffset=="bigint"?_=O.BigInt(l)+t.firstOffset:_=l+t.firstOffset;for(var k=0;k<c.length;k++){var A=t.references[k],N=A.referencedSize,$=A.subsegmentDuration,R=void 0;typeof _=="bigint"?R=_+O.BigInt(N)-O.BigInt(1):R=_+N-1;var L=_+"-"+R,F={baseUrl:i,timescale:u,timeline:a,periodStart:g,presentationTime:y,number:p,duration:$,sourceDuration:n,indexRange:L,type:d},B=xw(F)[0];r&&(B.map=r),h.push(B),typeof _=="bigint"?_+=O.BigInt(N):_+=N,y+=$/u,p++}return e.segments=h,e},OF=["AUDIO","SUBTITLES"],MF=1/60,Cw=function(e){return PF(e,function(t){var i=t.timeline;return i}).sort(function(t,i){return t.timeline>i.timeline?1:-1})},RF=function(e,t){for(var i=0;i<e.length;i++)if(e[i].attributes.NAME===t)return e[i];return null},UT=function(e){var t=[];return kF(e,OF,function(i,r,n,a){t=t.concat(i.playlists||[])}),t},$T=function(e){var t=e.playlist,i=e.mediaSequence;t.mediaSequence=i,t.segments.forEach(function(r,n){r.number=t.mediaSequence+n})},FF=function(e){var t=e.oldPlaylists,i=e.newPlaylists,r=e.timelineStarts;i.forEach(function(n){n.discontinuitySequence=tv(r,function(c){var h=c.timeline;return h===n.timeline});var a=RF(t,n.attributes.NAME);if(a&&!n.sidx){var o=n.segments[0],l=tv(a.segments,function(c){return Math.abs(c.presentationTime-o.presentationTime)<MF});if(l===-1){$T({playlist:n,mediaSequence:a.mediaSequence+a.segments.length}),n.segments[0].discontinuity=!0,n.discontinuityStarts.unshift(0),(!a.segments.length&&n.timeline>a.timeline||a.segments.length&&n.timeline>a.segments[a.segments.length-1].timeline)&&n.discontinuitySequence--;return}var u=a.segments[l];u.discontinuity&&!o.discontinuity&&(o.discontinuity=!0,n.discontinuityStarts.unshift(0),n.discontinuitySequence--),$T({playlist:n,mediaSequence:a.segments[l].number})}})},BF=function(e){var t=e.oldManifest,i=e.newManifest,r=t.playlists.concat(UT(t)),n=i.playlists.concat(UT(i));return i.timelineStarts=Cw([t.timelineStarts,i.timelineStarts]),FF({oldPlaylists:r,newPlaylists:n,timelineStarts:i.timelineStarts}),i},sd=function(e){return e&&e.uri+"-"+DF(e.byterange)},Qf=function(e){var t=bw(e.reduce(function(i,r){var n=r.attributes.id+(r.attributes.lang||"");if(!i[n])i[n]=r,i[n].attributes.timelineStarts=[];else{if(r.segments){var a;r.segments[0]&&(r.segments[0].discontinuity=!0),(a=i[n].segments).push.apply(a,r.segments)}r.attributes.contentProtection&&(i[n].attributes.contentProtection=r.attributes.contentProtection)}return i[n].attributes.timelineStarts.push({start:r.attributes.periodStart,timeline:r.attributes.periodStart}),i},{}));return t.map(function(i){return i.discontinuityStarts=IF(i.segments||[],"discontinuity"),i})},w0=function(e,t){var i=sd(e.sidx),r=i&&t[i]&&t[i].sidx;return r&&E0(e,r,e.sidx.resolvedUri),e},UF=function(e,t){if(t===void 0&&(t={}),!Object.keys(t).length)return e;for(var i in e)e[i]=w0(e[i],t);return e},$F=function(e,t){var i,r=e.attributes,n=e.segments,a=e.sidx,o=e.mediaSequence,l=e.discontinuitySequence,u=e.discontinuityStarts,c={attributes:(i={NAME:r.id,BANDWIDTH:r.bandwidth,CODECS:r.codecs},i["PROGRAM-ID"]=1,i),uri:"",endList:r.type==="static",timeline:r.periodStart,resolvedUri:"",targetDuration:r.duration,discontinuitySequence:l,discontinuityStarts:u,timelineStarts:r.timelineStarts,mediaSequence:o,segments:n};return r.contentProtection&&(c.contentProtection=r.contentProtection),a&&(c.sidx=a),t&&(c.attributes.AUDIO="audio",c.attributes.SUBTITLES="subs"),c},jF=function(e){var t,i=e.attributes,r=e.segments,n=e.mediaSequence,a=e.discontinuityStarts,o=e.discontinuitySequence;typeof r>"u"&&(r=[{uri:i.baseUrl,timeline:i.periodStart,resolvedUri:i.baseUrl||"",duration:i.sourceDuration,number:0}],i.duration=i.sourceDuration);var l=(t={NAME:i.id,BANDWIDTH:i.bandwidth},t["PROGRAM-ID"]=1,t);return i.codecs&&(l.CODECS=i.codecs),{attributes:l,uri:"",endList:i.type==="static",timeline:i.periodStart,resolvedUri:i.baseUrl||"",targetDuration:i.duration,timelineStarts:i.timelineStarts,discontinuityStarts:a,discontinuitySequence:o,mediaSequence:n,segments:r}},qF=function(e,t,i){t===void 0&&(t={}),i===void 0&&(i=!1);var r,n=e.reduce(function(o,l){var u=l.attributes.role&&l.attributes.role.value||"",c=l.attributes.lang||"",h=l.attributes.label||"main";if(c&&!l.attributes.label){var d=u?" ("+u+")":"";h=""+l.attributes.lang+d}o[h]||(o[h]={language:c,autoselect:!0,default:u==="main",playlists:[],uri:""});var g=w0($F(l,i),t);return o[h].playlists.push(g),typeof r>"u"&&u==="main"&&(r=l,r.default=!0),o},{});if(!r){var a=Object.keys(n)[0];n[a].default=!0}return n},VF=function(e,t){return t===void 0&&(t={}),e.reduce(function(i,r){var n=r.attributes.lang||"text";return i[n]||(i[n]={language:n,default:!1,autoselect:!1,playlists:[],uri:""}),i[n].playlists.push(w0(jF(r),t)),i},{})},HF=function(e){return e.reduce(function(t,i){return i&&i.forEach(function(r){var n=r.channel,a=r.language;t[a]={autoselect:!1,default:!1,instreamId:n,language:a},r.hasOwnProperty("aspectRatio")&&(t[a].aspectRatio=r.aspectRatio),r.hasOwnProperty("easyReader")&&(t[a].easyReader=r.easyReader),r.hasOwnProperty("3D")&&(t[a]["3D"]=r["3D"])}),t},{})},zF=function(e){var t,i=e.attributes,r=e.segments,n=e.sidx,a=e.discontinuityStarts,o={attributes:(t={NAME:i.id,AUDIO:"audio",SUBTITLES:"subs",RESOLUTION:{width:i.width,height:i.height},CODECS:i.codecs,BANDWIDTH:i.bandwidth},t["PROGRAM-ID"]=1,t),uri:"",endList:i.type==="static",timeline:i.periodStart,resolvedUri:"",targetDuration:i.duration,discontinuityStarts:a,timelineStarts:i.timelineStarts,segments:r};return i.frameRate&&(o.attributes["FRAME-RATE"]=i.frameRate),i.contentProtection&&(o.contentProtection=i.contentProtection),n&&(o.sidx=n),o},WF=function(e){var t=e.attributes;return t.mimeType==="video/mp4"||t.mimeType==="video/webm"||t.contentType==="video"},GF=function(e){var t=e.attributes;return t.mimeType==="audio/mp4"||t.mimeType==="audio/webm"||t.contentType==="audio"},KF=function(e){var t=e.attributes;return t.mimeType==="text/vtt"||t.contentType==="text"},XF=function(e,t){e.forEach(function(i){i.mediaSequence=0,i.discontinuitySequence=tv(t,function(r){var n=r.timeline;return n===i.timeline}),i.segments&&i.segments.forEach(function(r,n){r.number=n})})},jT=function(e){return e?Object.keys(e).reduce(function(t,i){var r=e[i];return t.concat(r.playlists)},[]):[]},QF=function(e){var t,i=e.dashPlaylists,r=e.locations,n=e.sidxMapping,a=n===void 0?{}:n,o=e.previousManifest;if(!i.length)return{};var l=i[0].attributes,u=l.sourceDuration,c=l.type,h=l.suggestedPresentationDelay,d=l.minimumUpdatePeriod,g=Qf(i.filter(WF)).map(zF),y=Qf(i.filter(GF)),p=Qf(i.filter(KF)),_=i.map(function(F){return F.attributes.captionServices}).filter(Boolean),k={allowCache:!0,discontinuityStarts:[],segments:[],endList:!0,mediaGroups:(t={AUDIO:{},VIDEO:{}},t["CLOSED-CAPTIONS"]={},t.SUBTITLES={},t),uri:"",duration:u,playlists:UF(g,a)};d>=0&&(k.minimumUpdatePeriod=d*1e3),r&&(k.locations=r),c==="dynamic"&&(k.suggestedPresentationDelay=h);var A=k.playlists.length===0,N=y.length?qF(y,a,A):null,$=p.length?VF(p,a):null,R=g.concat(jT(N),jT($)),L=R.map(function(F){var B=F.timelineStarts;return B});return k.timelineStarts=Cw(L),XF(R,k.timelineStarts),N&&(k.mediaGroups.AUDIO.audio=N),$&&(k.mediaGroups.SUBTITLES.subs=$),_.length&&(k.mediaGroups["CLOSED-CAPTIONS"].cc=HF(_)),o?BF({oldManifest:o,newManifest:k}):k},YF=function(e,t,i){var r=e.NOW,n=e.clientOffset,a=e.availabilityStartTime,o=e.timescale,l=o===void 0?1:o,u=e.periodStart,c=u===void 0?0:u,h=e.minimumUpdatePeriod,d=h===void 0?0:h,g=(r+n)/1e3,y=a+c,p=g+d,_=p-y;return Math.ceil((_*l-t)/i)},Ew=function(e,t){for(var i=e.type,r=e.minimumUpdatePeriod,n=r===void 0?0:r,a=e.media,o=a===void 0?"":a,l=e.sourceDuration,u=e.timescale,c=u===void 0?1:u,h=e.startNumber,d=h===void 0?1:h,g=e.periodStart,y=[],p=-1,_=0;_<t.length;_++){var k=t[_],A=k.d,N=k.r||0,$=k.t||0;p<0&&(p=$),$&&$>p&&(p=$);var R=void 0;if(N<0){var L=_+1;L===t.length?i==="dynamic"&&n>0&&o.indexOf("$Number$")>0?R=YF(e,p,A):R=(l*c-p)/A:R=(t[L].t-p)/A}else R=N+1;for(var F=d+y.length+R,B=d+y.length;B<F;)y.push({number:B,duration:A/c,time:p,timeline:g}),p+=A,B++}return y},JF=/\$([A-z]*)(?:(%0)([0-9]+)d)?\$/g,ZF=function(e){return function(t,i,r,n){if(t==="$$")return"$";if(typeof e[i]>"u")return t;var a=""+e[i];return i==="RepresentationID"||(r?n=parseInt(n,10):n=1,a.length>=n)?a:""+new Array(n-a.length+1).join("0")+a}},qT=function(e,t){return e.replace(JF,ZF(t))},eB=function(e,t){return!e.duration&&!t?[{number:e.startNumber||1,duration:e.sourceDuration,time:0,timeline:e.periodStart}]:e.duration?C0(e):Ew(e,t)},tB=function(e,t){var i={RepresentationID:e.id,Bandwidth:e.bandwidth||0},r=e.initialization,n=r===void 0?{sourceURL:"",range:""}:r,a=Yl({baseUrl:e.baseUrl,source:qT(n.sourceURL,i),range:n.range}),o=eB(e,t);return o.map(function(l){i.Number=l.number,i.Time=l.time;var u=qT(e.media||"",i),c=e.timescale||1,h=e.presentationTimeOffset||0,d=e.periodStart+(l.time-h)/c,g={uri:u,timeline:l.timeline,duration:l.duration,resolvedUri:rd(e.baseUrl||"",u),map:a,number:l.number,presentationTime:d};return g})},iB=function(e,t){var i=e.baseUrl,r=e.initialization,n=r===void 0?{}:r,a=Yl({baseUrl:i,source:n.sourceURL,range:n.range}),o=Yl({baseUrl:i,source:t.media,range:t.mediaRange});return o.map=a,o},rB=function(e,t){var i=e.duration,r=e.segmentUrls,n=r===void 0?[]:r,a=e.periodStart;if(!i&&!t||i&&t)throw new Error(xo.SEGMENT_TIME_UNSPECIFIED);var o=n.map(function(c){return iB(e,c)}),l;i&&(l=C0(e)),t&&(l=Ew(e,t));var u=l.map(function(c,h){if(o[h]){var d=o[h],g=e.timescale||1,y=e.presentationTimeOffset||0;return d.timeline=c.timeline,d.duration=c.duration,d.number=c.number,d.presentationTime=a+(c.time-y)/g,d}}).filter(function(c){return c});return u},nB=function(e){var t=e.attributes,i=e.segmentInfo,r,n;i.template?(n=tB,r=Pi(t,i.template)):i.base?(n=xw,r=Pi(t,i.base)):i.list&&(n=rB,r=Pi(t,i.list));var a={attributes:t};if(!n)return a;var o=n(r,i.segmentTimeline);if(r.duration){var l=r,u=l.duration,c=l.timescale,h=c===void 0?1:c;r.duration=u/h}else o.length?r.duration=o.reduce(function(d,g){return Math.max(d,Math.ceil(g.duration))},0):r.duration=0;return a.attributes=r,a.segments=o,i.base&&r.indexRange&&(a.sidx=o[0],a.segments=[]),a},sB=function(e){return e.map(nB)},Ht=function(e,t){return Sw(e.childNodes).filter(function(i){var r=i.tagName;return r===t})},k0=function(e){return e.textContent.trim()},aB=function(e){return parseFloat(e.split("/").reduce(function(t,i){return t/i}))},Ba=function(e){var t=31536e3,i=30*24*60*60,r=24*60*60,n=60*60,a=60,o=/P(?:(\d*)Y)?(?:(\d*)M)?(?:(\d*)D)?(?:T(?:(\d*)H)?(?:(\d*)M)?(?:([\d.]*)S)?)?/,l=o.exec(e);if(!l)return 0;var u=l.slice(1),c=u[0],h=u[1],d=u[2],g=u[3],y=u[4],p=u[5];return parseFloat(c||0)*t+parseFloat(h||0)*i+parseFloat(d||0)*r+parseFloat(g||0)*n+parseFloat(y||0)*a+parseFloat(p||0)},oB=function(e){var t=/^\d+-\d+-\d+T\d+:\d+:\d+(\.\d+)?$/;return t.test(e)&&(e+="Z"),Date.parse(e)},VT={mediaPresentationDuration:function(e){return Ba(e)},availabilityStartTime:function(e){return oB(e)/1e3},minimumUpdatePeriod:function(e){return Ba(e)},suggestedPresentationDelay:function(e){return Ba(e)},type:function(e){return e},timeShiftBufferDepth:function(e){return Ba(e)},start:function(e){return Ba(e)},width:function(e){return parseInt(e,10)},height:function(e){return parseInt(e,10)},bandwidth:function(e){return parseInt(e,10)},frameRate:function(e){return aB(e)},startNumber:function(e){return parseInt(e,10)},timescale:function(e){return parseInt(e,10)},presentationTimeOffset:function(e){return parseInt(e,10)},duration:function(e){var t=parseInt(e,10);return isNaN(t)?Ba(e):t},d:function(e){return parseInt(e,10)},t:function(e){return parseInt(e,10)},r:function(e){return parseInt(e,10)},DEFAULT:function(e){return e}},vi=function(e){return e&&e.attributes?Sw(e.attributes).reduce(function(t,i){var r=VT[i.name]||VT.DEFAULT;return t[i.name]=r(i.value),t},{}):{}},lB={"urn:uuid:1077efec-c0b2-4d02-ace3-3c1e52e2fb4b":"org.w3.clearkey","urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed":"com.widevine.alpha","urn:uuid:9a04f079-9840-4286-ab92-e65be0885f95":"com.microsoft.playready","urn:uuid:f239e769-efa3-4850-9c16-a903c6932efb":"com.adobe.primetime"},ad=function(e,t){return t.length?nd(e.map(function(i){return t.map(function(r){return rd(i,k0(r))})})):e},A0=function(e){var t=Ht(e,"SegmentTemplate")[0],i=Ht(e,"SegmentList")[0],r=i&&Ht(i,"SegmentURL").map(function(d){return Pi({tag:"SegmentURL"},vi(d))}),n=Ht(e,"SegmentBase")[0],a=i||t,o=a&&Ht(a,"SegmentTimeline")[0],l=i||n||t,u=l&&Ht(l,"Initialization")[0],c=t&&vi(t);c&&u?c.initialization=u&&vi(u):c&&c.initialization&&(c.initialization={sourceURL:c.initialization});var h={template:c,segmentTimeline:o&&Ht(o,"S").map(function(d){return vi(d)}),list:i&&Pi(vi(i),{segmentUrls:r,initialization:vi(u)}),base:n&&Pi(vi(n),{initialization:vi(u)})};return Object.keys(h).forEach(function(d){h[d]||delete h[d]}),h},uB=function(e,t,i){return function(r){var n=Ht(r,"BaseURL"),a=ad(t,n),o=Pi(e,vi(r)),l=A0(r);return a.map(function(u){return{segmentInfo:Pi(i,l),attributes:Pi(o,{baseUrl:u})}})}},cB=function(e){return e.reduce(function(t,i){var r=vi(i);r.schemeIdUri&&(r.schemeIdUri=r.schemeIdUri.toLowerCase());var n=lB[r.schemeIdUri];if(n){t[n]={attributes:r};var a=Ht(i,"cenc:pssh")[0];if(a){var o=k0(a);t[n].pssh=o&&mw(o)}}return t},{})},hB=function(e){if(e.schemeIdUri==="urn:scte:dash:cc:cea-608:2015"){var t=typeof e.value!="string"?[]:e.value.split(";");return t.map(function(r){var n,a;if(a=r,/^CC\d=/.test(r)){var o=r.split("=");n=o[0],a=o[1]}else/^CC\d$/.test(r)&&(n=r);return{channel:n,language:a}})}else if(e.schemeIdUri==="urn:scte:dash:cc:cea-708:2015"){var i=typeof e.value!="string"?[]:e.value.split(";");return i.map(function(r){var n={channel:void 0,language:void 0,aspectRatio:1,easyReader:0,"3D":0};if(/=/.test(r)){var a=r.split("="),o=a[0],l=a[1],u=l===void 0?"":l;n.channel=o,n.language=r,u.split(",").forEach(function(c){var h=c.split(":"),d=h[0],g=h[1];d==="lang"?n.language=g:d==="er"?n.easyReader=Number(g):d==="war"?n.aspectRatio=Number(g):d==="3D"&&(n["3D"]=Number(g))})}else n.language=r;return n.channel&&(n.channel="SERVICE"+n.channel),n})}},dB=function(e,t,i){return function(r){var n=vi(r),a=ad(t,Ht(r,"BaseURL")),o=Ht(r,"Role")[0],l={role:vi(o)},u=Pi(e,n,l),c=Ht(r,"Accessibility")[0],h=hB(vi(c));h&&(u=Pi(u,{captionServices:h}));var d=Ht(r,"Label")[0];if(d&&d.childNodes.length){var g=d.childNodes[0].nodeValue.trim();u=Pi(u,{label:g})}var y=cB(Ht(r,"ContentProtection"));Object.keys(y).length&&(u=Pi(u,{contentProtection:y}));var p=A0(r),_=Ht(r,"Representation"),k=Pi(i,p);return nd(_.map(uB(u,a,k)))}},fB=function(e,t){return function(i,r){var n=ad(t,Ht(i.node,"BaseURL")),a=Pi(e,{periodStart:i.attributes.start});typeof i.attributes.duration=="number"&&(a.periodDuration=i.attributes.duration);var o=Ht(i.node,"AdaptationSet"),l=A0(i.node);return nd(o.map(dB(a,n,l)))}},pB=function(e){var t=e.attributes,i=e.priorPeriodAttributes,r=e.mpdType;return typeof t.start=="number"?t.start:i&&typeof i.start=="number"&&typeof i.duration=="number"?i.start+i.duration:!i&&r==="static"?0:null},mB=function(e,t){t===void 0&&(t={});var i=t,r=i.manifestUri,n=r===void 0?"":r,a=i.NOW,o=a===void 0?Date.now():a,l=i.clientOffset,u=l===void 0?0:l,c=Ht(e,"Period");if(!c.length)throw new Error(xo.INVALID_NUMBER_OF_PERIOD);var h=Ht(e,"Location"),d=vi(e),g=ad([n],Ht(e,"BaseURL"));d.type=d.type||"static",d.sourceDuration=d.mediaPresentationDuration||0,d.NOW=o,d.clientOffset=u,h.length&&(d.locations=h.map(k0));var y=[];return c.forEach(function(p,_){var k=vi(p),A=y[_-1];k.start=pB({attributes:k,priorPeriodAttributes:A?A.attributes:null,mpdType:d.type}),y.push({node:p,attributes:k})}),{locations:d.locations,representationInfo:nd(y.map(fB(d,g)))}},ww=function(e){if(e==="")throw new Error(xo.DASH_EMPTY_MANIFEST);var t=new O1.DOMParser,i,r;try{i=t.parseFromString(e,"application/xml"),r=i&&i.documentElement.tagName==="MPD"?i.documentElement:null}catch{}if(!r||r&&r.getElementsByTagName("parsererror").length>0)throw new Error(xo.DASH_INVALID_XML);return r},gB=function(e){var t=Ht(e,"UTCTiming")[0];if(!t)return null;var i=vi(t);switch(i.schemeIdUri){case"urn:mpeg:dash:utc:http-head:2014":case"urn:mpeg:dash:utc:http-head:2012":i.method="HEAD";break;case"urn:mpeg:dash:utc:http-xsdate:2014":case"urn:mpeg:dash:utc:http-iso:2014":case"urn:mpeg:dash:utc:http-xsdate:2012":case"urn:mpeg:dash:utc:http-iso:2012":i.method="GET";break;case"urn:mpeg:dash:utc:direct:2014":case"urn:mpeg:dash:utc:direct:2012":i.method="DIRECT",i.value=Date.parse(i.value);break;case"urn:mpeg:dash:utc:http-ntp:2014":case"urn:mpeg:dash:utc:ntp:2014":case"urn:mpeg:dash:utc:sntp:2014":default:throw new Error(xo.UNSUPPORTED_UTC_TIMING_SCHEME)}return i},vB=function(e,t){t===void 0&&(t={});var i=mB(ww(e),t),r=sB(i.representationInfo);return QF({dashPlaylists:r,locations:i.locations,sidxMapping:t.sidxMapping,previousManifest:t.previousManifest})},yB=function(e){return gB(ww(e))},Yf,HT;function _B(){if(HT)return Yf;HT=1;var s=Math.pow(2,32),e=function(t){var i=new DataView(t.buffer,t.byteOffset,t.byteLength),r;return i.getBigUint64?(r=i.getBigUint64(0),r<Number.MAX_SAFE_INTEGER?Number(r):r):i.getUint32(0)*s+i.getUint32(4)};return Yf={getUint64:e,MAX_UINT32:s},Yf}var Jf,zT;function TB(){if(zT)return Jf;zT=1;var s=_B().getUint64,e=function(t){var i=new DataView(t.buffer,t.byteOffset,t.byteLength),r={version:t[0],flags:new Uint8Array(t.subarray(1,4)),references:[],referenceId:i.getUint32(4),timescale:i.getUint32(8)},n=12;r.version===0?(r.earliestPresentationTime=i.getUint32(n),r.firstOffset=i.getUint32(n+4),n+=8):(r.earliestPresentationTime=s(t.subarray(n)),r.firstOffset=s(t.subarray(n+8)),n+=16),n+=2;var a=i.getUint16(n);for(n+=2;a>0;n+=12,a--)r.references.push({referenceType:(t[n]&128)>>>7,referencedSize:i.getUint32(n)&2147483647,subsegmentDuration:i.getUint32(n+4),startsWithSap:!!(t[n+8]&128),sapType:(t[n+8]&112)>>>4,sapDeltaTime:i.getUint32(n+8)&268435455});return r};return Jf=e,Jf}var bB=TB();const SB=Hi(bB);var xB=je([73,68,51]),CB=function(e,t){t===void 0&&(t=0),e=je(e);var i=e[t+5],r=e[t+6]<<21|e[t+7]<<14|e[t+8]<<7|e[t+9],n=(i&16)>>4;return n?r+20:r+10},Il=function s(e,t){return t===void 0&&(t=0),e=je(e),e.length-t<10||!It(e,xB,{offset:t})?t:(t+=CB(e,t),s(e,t))},WT=function(e){return typeof e=="string"?Tw(e):e},EB=function(e){return Array.isArray(e)?e.map(function(t){return WT(t)}):[WT(e)]},wB=function s(e,t,i){i===void 0&&(i=!1),t=EB(t),e=je(e);var r=[];if(!t.length)return r;for(var n=0;n<e.length;){var a=(e[n]<<24|e[n+1]<<16|e[n+2]<<8|e[n+3])>>>0,o=e.subarray(n+4,n+8);if(a===0)break;var l=n+a;if(l>e.length){if(i)break;l=e.length}var u=e.subarray(n+8,l);It(o,t[0])&&(t.length===1?r.push(u):r.push.apply(r,s(u,t.slice(1),i))),n=l}return r},hc={EBML:je([26,69,223,163]),DocType:je([66,130]),Segment:je([24,83,128,103]),SegmentInfo:je([21,73,169,102]),Tracks:je([22,84,174,107]),Track:je([174]),TrackNumber:je([215]),DefaultDuration:je([35,227,131]),TrackEntry:je([174]),TrackType:je([131]),FlagDefault:je([136]),CodecID:je([134]),CodecPrivate:je([99,162]),VideoTrack:je([224]),AudioTrack:je([225]),Cluster:je([31,67,182,117]),Timestamp:je([231]),TimestampScale:je([42,215,177]),BlockGroup:je([160]),BlockDuration:je([155]),Block:je([161]),SimpleBlock:je([163])},iv=[128,64,32,16,8,4,2,1],kB=function(e){for(var t=1,i=0;i<iv.length&&!(e&iv[i]);i++)t++;return t},uh=function(e,t,i,r){i===void 0&&(i=!0),r===void 0&&(r=!1);var n=kB(e[t]),a=e.subarray(t,t+n);return i&&(a=Array.prototype.slice.call(e,t,t+n),a[0]^=iv[n-1]),{length:n,value:CF(a,{signed:r}),bytes:a}},GT=function s(e){return typeof e=="string"?e.match(/.{1,2}/g).map(function(t){return s(t)}):typeof e=="number"?EF(e):e},AB=function(e){return Array.isArray(e)?e.map(function(t){return GT(t)}):[GT(e)]},IB=function s(e,t,i){if(i>=t.length)return t.length;var r=uh(t,i,!1);if(It(e.bytes,r.bytes))return i;var n=uh(t,i+r.length);return s(e,t,i+n.length+n.value+r.length)},KT=function s(e,t){t=AB(t),e=je(e);var i=[];if(!t.length)return i;for(var r=0;r<e.length;){var n=uh(e,r,!1),a=uh(e,r+n.length),o=r+n.length+a.length;a.value===127&&(a.value=IB(n,e,o),a.value!==e.length&&(a.value-=o));var l=o+a.value>e.length?e.length:o+a.value,u=e.subarray(o,l);It(t[0],n.bytes)&&(t.length===1?i.push(u):i=i.concat(s(u,t.slice(1))));var c=n.length+a.length+u.length;r+=c}return i},PB=je([0,0,0,1]),DB=je([0,0,1]),NB=je([0,0,3]),LB=function(e){for(var t=[],i=1;i<e.length-2;)It(e.subarray(i,i+3),NB)&&(t.push(i+2),i++),i++;if(t.length===0)return e;var r=e.length-t.length,n=new Uint8Array(r),a=0;for(i=0;i<r;a++,i++)a===t[0]&&(a++,t.shift()),n[i]=e[a];return n},kw=function(e,t,i,r){e=je(e),i=[].concat(i);for(var n=0,a,o=0;n<e.length&&(o<r||a);){var l=void 0;if(It(e.subarray(n),PB)?l=4:It(e.subarray(n),DB)&&(l=3),!l){n++;continue}if(o++,a)return LB(e.subarray(a,n));var u=void 0;t==="h264"?u=e[n+l]&31:t==="h265"&&(u=e[n+l]>>1&63),i.indexOf(u)!==-1&&(a=n+l),n+=l+(t==="h264"?1:2)}return e.subarray(0,0)},OB=function(e,t,i){return kw(e,"h264",t,i)},MB=function(e,t,i){return kw(e,"h265",t,i)},Ei={webm:je([119,101,98,109]),matroska:je([109,97,116,114,111,115,107,97]),flac:je([102,76,97,67]),ogg:je([79,103,103,83]),ac3:je([11,119]),riff:je([82,73,70,70]),avi:je([65,86,73]),wav:je([87,65,86,69]),"3gp":je([102,116,121,112,51,103]),mp4:je([102,116,121,112]),fmp4:je([115,116,121,112]),mov:je([102,116,121,112,113,116]),moov:je([109,111,111,118]),moof:je([109,111,111,102])},Co={aac:function(e){var t=Il(e);return It(e,[255,16],{offset:t,mask:[255,22]})},mp3:function(e){var t=Il(e);return It(e,[255,2],{offset:t,mask:[255,6]})},webm:function(e){var t=KT(e,[hc.EBML,hc.DocType])[0];return It(t,Ei.webm)},mkv:function(e){var t=KT(e,[hc.EBML,hc.DocType])[0];return It(t,Ei.matroska)},mp4:function(e){if(Co["3gp"](e)||Co.mov(e))return!1;if(It(e,Ei.mp4,{offset:4})||It(e,Ei.fmp4,{offset:4})||It(e,Ei.moof,{offset:4})||It(e,Ei.moov,{offset:4}))return!0},mov:function(e){return It(e,Ei.mov,{offset:4})},"3gp":function(e){return It(e,Ei["3gp"],{offset:4})},ac3:function(e){var t=Il(e);return It(e,Ei.ac3,{offset:t})},ts:function(e){if(e.length<189&&e.length>=1)return e[0]===71;for(var t=0;t+188<e.length&&t<188;){if(e[t]===71&&e[t+188]===71)return!0;t+=1}return!1},flac:function(e){var t=Il(e);return It(e,Ei.flac,{offset:t})},ogg:function(e){return It(e,Ei.ogg)},avi:function(e){return It(e,Ei.riff)&&It(e,Ei.avi,{offset:8})},wav:function(e){return It(e,Ei.riff)&&It(e,Ei.wav,{offset:8})},h264:function(e){return OB(e,7,3).length},h265:function(e){return MB(e,[32,33],3).length}},rv=Object.keys(Co).filter(function(s){return s!=="ts"&&s!=="h264"&&s!=="h265"}).concat(["ts","h264","h265"]);rv.forEach(function(s){var e=Co[s];Co[s]=function(t){return e(je(t))}});var RB=Co,I0=function(e){e=je(e);for(var t=0;t<rv.length;t++){var i=rv[t];if(RB[i](e))return i}return""},FB=function(e){return wB(e,["moof"]).length>0},Zf,XT;function BB(){if(XT)return Zf;XT=1;var s=9e4,e,t,i,r,n,a,o;return e=function(l){return l*s},t=function(l,u){return l*u},i=function(l){return l/s},r=function(l,u){return l/u},n=function(l,u){return e(r(l,u))},a=function(l,u){return t(i(l),u)},o=function(l,u,c){return i(c?l:l-u)},Zf={ONE_SECOND_IN_TS:s,secondsToVideoTs:e,secondsToAudioTs:t,videoTsToSeconds:i,audioTsToSeconds:r,audioTsToVideoTs:n,videoTsToAudioTs:a,metadataTsToSeconds:o},Zf}var ch=BB();function nv(s){return nv=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},nv(s)}function UB(s){try{return Function.toString.call(s).indexOf("[native code]")!==-1}catch{return typeof s=="function"}}function sv(s){var e=typeof Map=="function"?new Map:void 0;return sv=function(i){if(i===null||!UB(i))return i;if(typeof i!="function")throw new TypeError("Super expression must either be null or a function");if(e!==void 0){if(e.has(i))return e.get(i);e.set(i,r)}function r(){return pw(i,arguments,nv(this).constructor)}return r.prototype=Object.create(i.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),Lv(r,i)},sv(s)}/**
246
- * @license
247
- * Video.js 7.21.7 <http://videojs.com/>
248
- * Copyright Brightcove, Inc. <https://www.brightcove.com/>
249
- * Available under Apache License Version 2.0
250
- * <https://github.com/videojs/video.js/blob/main/LICENSE>
251
- *
252
- * Includes vtt.js <https://github.com/mozilla/vtt.js>
253
- * Available under Apache License Version 2.0
254
- * <https://github.com/mozilla/vtt.js/blob/main/LICENSE>
255
- */var Aw="7.21.7",wn={},us=function(e,t){return wn[e]=wn[e]||[],t&&(wn[e]=wn[e].concat(t)),wn[e]},$B=function(e,t){us(e,t)},Iw=function(e,t){var i=us(e).indexOf(t);return i<=-1?!1:(wn[e]=wn[e].slice(),wn[e].splice(i,1),!0)},jB=function(e,t){us(e,[].concat(t).map(function(i){var r=function n(){return Iw(e,n),i.apply(void 0,arguments)};return r}))},hh={prefixed:!0},Oc=[["requestFullscreen","exitFullscreen","fullscreenElement","fullscreenEnabled","fullscreenchange","fullscreenerror","fullscreen"],["webkitRequestFullscreen","webkitExitFullscreen","webkitFullscreenElement","webkitFullscreenEnabled","webkitfullscreenchange","webkitfullscreenerror","-webkit-full-screen"],["mozRequestFullScreen","mozCancelFullScreen","mozFullScreenElement","mozFullScreenEnabled","mozfullscreenchange","mozfullscreenerror","-moz-full-screen"],["msRequestFullscreen","msExitFullscreen","msFullscreenElement","msFullscreenEnabled","MSFullscreenChange","MSFullscreenError","-ms-fullscreen"]],QT=Oc[0],Pl;for(var dc=0;dc<Oc.length;dc++)if(Oc[dc][1]in ce){Pl=Oc[dc];break}if(Pl){for(var fc=0;fc<Pl.length;fc++)hh[QT[fc]]=Pl[fc];hh.prefixed=Pl[0]!==QT[0]}var $i=[],qB=function(e,t){return function(i,r,n){var a=t.levels[r],o=new RegExp("^("+a+")$");if(i!=="log"&&n.unshift(i.toUpperCase()+":"),n.unshift(e+":"),$i){$i.push([].concat(n));var l=$i.length-1e3;$i.splice(0,l>0?l:0)}if(O.console){var u=O.console[i];!u&&i==="debug"&&(u=O.console.info||O.console.log),!(!u||!a||!o.test(i))&&u[Array.isArray(n)?"apply":"call"](O.console,n)}}};function Pw(s){var e="info",t,i=function(){for(var n=arguments.length,a=new Array(n),o=0;o<n;o++)a[o]=arguments[o];t("log",e,a)};return t=qB(s,i),i.createLogger=function(r){return Pw(s+": "+r)},i.levels={all:"debug|log|warn|error",off:"",debug:"debug|log|warn|error",info:"log|warn|error",warn:"warn|error",error:"error",DEFAULT:e},i.level=function(r){if(typeof r=="string"){if(!i.levels.hasOwnProperty(r))throw new Error('"'+r+'" in not a valid log level');e=r}return e},i.history=function(){return $i?[].concat($i):[]},i.history.filter=function(r){return($i||[]).filter(function(n){return new RegExp(".*"+r+".*").test(n[0])})},i.history.clear=function(){$i&&($i.length=0)},i.history.disable=function(){$i!==null&&($i.length=0,$i=null)},i.history.enable=function(){$i===null&&($i=[])},i.error=function(){for(var r=arguments.length,n=new Array(r),a=0;a<r;a++)n[a]=arguments[a];return t("error",e,n)},i.warn=function(){for(var r=arguments.length,n=new Array(r),a=0;a<r;a++)n[a]=arguments[a];return t("warn",e,n)},i.debug=function(){for(var r=arguments.length,n=new Array(r),a=0;a<r;a++)n[a]=arguments[a];return t("debug",e,n)},i}var Qe=Pw("VIDEOJS"),Dw=Qe.createLogger,VB=Object.prototype.toString,Nw=function(e){return Nn(e)?Object.keys(e):[]};function oo(s,e){Nw(s).forEach(function(t){return e(s[t],t)})}function HB(s,e,t){return t===void 0&&(t=0),Nw(s).reduce(function(i,r){return e(i,s[r],r)},t)}function jt(s){for(var e=arguments.length,t=new Array(e>1?e-1:0),i=1;i<e;i++)t[i-1]=arguments[i];return Object.assign?ft.apply(void 0,[s].concat(t)):(t.forEach(function(r){r&&oo(r,function(n,a){s[a]=n})}),s)}function Nn(s){return!!s&&typeof s=="object"}function Jl(s){return Nn(s)&&VB.call(s)==="[object Object]"&&s.constructor===Object}function Zl(s,e){if(!s||!e)return"";if(typeof O.getComputedStyle=="function"){var t;try{t=O.getComputedStyle(s)}catch{return""}return t?t.getPropertyValue(e)||t[e]:""}return""}var si=O.navigator&&O.navigator.userAgent||"",YT=/AppleWebKit\/([\d.]+)/i.exec(si),zB=YT?parseFloat(YT.pop()):null,Lw=/iPod/i.test(si),WB=function(){var s=si.match(/OS (\d+)_/i);return s&&s[1]?s[1]:null}(),On=/Android/i.test(si),P0=function(){var s=si.match(/Android (\d+)(?:\.(\d+))?(?:\.(\d+))*/i);if(!s)return null;var e=s[1]&&parseFloat(s[1]),t=s[2]&&parseFloat(s[2]);return e&&t?parseFloat(s[1]+"."+s[2]):e||null}(),Ow=On&&P0<5&&zB<537,Mw=/Firefox/i.test(si),fu=/Edg/i.test(si),Mn=!fu&&(/Chrome/i.test(si)||/CriOS/i.test(si)),Rw=function(){var s=si.match(/(Chrome|CriOS)\/(\d+)/);return s&&s[2]?parseFloat(s[2]):null}(),pu=function(){var s=/MSIE\s(\d+)\.\d/.exec(si),e=s&&parseFloat(s[1]);return!e&&/Trident\/7.0/i.test(si)&&/rv:11.0/.test(si)&&(e=11),e}(),D0=/Safari/i.test(si)&&!Mn&&!On&&!fu,Fw=/Windows/i.test(si),Eo=!!(jo()&&("ontouchstart"in O||O.navigator.maxTouchPoints||O.DocumentTouch&&O.document instanceof O.DocumentTouch)),N0=/iPad/i.test(si)||D0&&Eo&&!/iPhone/i.test(si),L0=/iPhone/i.test(si)&&!N0,Oi=L0||N0||Lw,od=(D0||Oi)&&!Mn,GB=Object.freeze({__proto__:null,IS_IPOD:Lw,IOS_VERSION:WB,IS_ANDROID:On,ANDROID_VERSION:P0,IS_NATIVE_ANDROID:Ow,IS_FIREFOX:Mw,IS_EDGE:fu,IS_CHROME:Mn,CHROME_VERSION:Rw,IE_VERSION:pu,IS_SAFARI:D0,IS_WINDOWS:Fw,TOUCH_ENABLED:Eo,IS_IPAD:N0,IS_IPHONE:L0,IS_IOS:Oi,IS_ANY_SAFARI:od});function JT(s){return typeof s=="string"&&!!s.trim()}function Bw(s){if(s.indexOf(" ")>=0)throw new Error("class has illegal whitespace characters")}function KB(s){return new RegExp("(^|\\s)"+s+"($|\\s)")}function jo(){return ce===O.document}function qo(s){return Nn(s)&&s.nodeType===1}function Uw(){try{return O.parent!==O.self}catch{return!0}}function $w(s){return function(e,t){if(!JT(e))return ce[s](null);JT(t)&&(t=ce.querySelector(t));var i=qo(t)?t:ce;return i[s]&&i[s](e)}}function rt(s,e,t,i){s===void 0&&(s="div"),e===void 0&&(e={}),t===void 0&&(t={});var r=ce.createElement(s);return Object.getOwnPropertyNames(e).forEach(function(n){var a=e[n];n.indexOf("aria-")!==-1||n==="role"||n==="type"?(Qe.warn(`Setting attributes in the second argument of createEl()
256
- has been deprecated. Use the third argument instead.
257
- `+("createEl(type, properties, attributes). Attempting to set "+n+" to "+a+".")),r.setAttribute(n,a)):n==="textContent"?ua(r,a):(r[n]!==a||n==="tabIndex")&&(r[n]=a)}),Object.getOwnPropertyNames(t).forEach(function(n){r.setAttribute(n,t[n])}),i&&M0(r,i),r}function ua(s,e){return typeof s.textContent>"u"?s.innerText=e:s.textContent=e,s}function av(s,e){e.firstChild?e.insertBefore(s,e.firstChild):e.appendChild(s)}function ta(s,e){return Bw(e),s.classList?s.classList.contains(e):KB(e).test(s.className)}function Pn(s,e){return s.classList?s.classList.add(e):ta(s,e)||(s.className=(s.className+" "+e).trim()),s}function mu(s,e){return s?(s.classList?s.classList.remove(e):(Bw(e),s.className=s.className.split(/\s+/).filter(function(t){return t!==e}).join(" ")),s):(Qe.warn("removeClass was called with an element that doesn't exist"),null)}function jw(s,e,t){var i=ta(s,e);if(typeof t=="function"&&(t=t(s,e)),typeof t!="boolean"&&(t=!i),t!==i)return t?Pn(s,e):mu(s,e),s}function qw(s,e){Object.getOwnPropertyNames(e).forEach(function(t){var i=e[t];i===null||typeof i>"u"||i===!1?s.removeAttribute(t):s.setAttribute(t,i===!0?"":i)})}function xn(s){var e={},t=",autoplay,controls,playsinline,loop,muted,default,defaultMuted,";if(s&&s.attributes&&s.attributes.length>0)for(var i=s.attributes,r=i.length-1;r>=0;r--){var n=i[r].name,a=i[r].value;(typeof s[n]=="boolean"||t.indexOf(","+n+",")!==-1)&&(a=a!==null),e[n]=a}return e}function Vw(s,e){return s.getAttribute(e)}function wo(s,e,t){s.setAttribute(e,t)}function ld(s,e){s.removeAttribute(e)}function Hw(){ce.body.focus(),ce.onselectstart=function(){return!1}}function zw(){ce.onselectstart=function(){return!0}}function ko(s){if(s&&s.getBoundingClientRect&&s.parentNode){var e=s.getBoundingClientRect(),t={};return["bottom","height","left","right","top","width"].forEach(function(i){e[i]!==void 0&&(t[i]=e[i])}),t.height||(t.height=parseFloat(Zl(s,"height"))),t.width||(t.width=parseFloat(Zl(s,"width"))),t}}function eu(s){if(!s||s&&!s.offsetParent)return{left:0,top:0,width:0,height:0};for(var e=s.offsetWidth,t=s.offsetHeight,i=0,r=0;s.offsetParent&&s!==ce[hh.fullscreenElement];)i+=s.offsetLeft,r+=s.offsetTop,s=s.offsetParent;return{left:i,top:r,width:e,height:t}}function ud(s,e){var t={x:0,y:0};if(Oi)for(var i=s;i&&i.nodeName.toLowerCase()!=="html";){var r=Zl(i,"transform");if(/^matrix/.test(r)){var n=r.slice(7,-1).split(/,\s/).map(Number);t.x+=n[4],t.y+=n[5]}else if(/^matrix3d/.test(r)){var a=r.slice(9,-1).split(/,\s/).map(Number);t.x+=a[12],t.y+=a[13]}i=i.parentNode}var o={},l=eu(e.target),u=eu(s),c=u.width,h=u.height,d=e.offsetY-(u.top-l.top),g=e.offsetX-(u.left-l.left);return e.changedTouches&&(g=e.changedTouches[0].pageX-u.left,d=e.changedTouches[0].pageY+u.top,Oi&&(g-=t.x,d-=t.y)),o.y=1-Math.max(0,Math.min(1,d/h)),o.x=Math.max(0,Math.min(1,g/c)),o}function Ww(s){return Nn(s)&&s.nodeType===3}function O0(s){for(;s.firstChild;)s.removeChild(s.firstChild);return s}function Gw(s){return typeof s=="function"&&(s=s()),(Array.isArray(s)?s:[s]).map(function(e){if(typeof e=="function"&&(e=e()),qo(e)||Ww(e))return e;if(typeof e=="string"&&/\S/.test(e))return ce.createTextNode(e)}).filter(function(e){return e})}function M0(s,e){return Gw(e).forEach(function(t){return s.appendChild(t)}),s}function Kw(s,e){return M0(O0(s),e)}function tu(s){return s.button===void 0&&s.buttons===void 0||s.button===0&&s.buttons===void 0||s.type==="mouseup"&&s.button===0&&s.buttons===0?!0:!(s.button!==0||s.buttons!==1)}var cs=$w("querySelector"),Xw=$w("querySelectorAll"),Qw=Object.freeze({__proto__:null,isReal:jo,isEl:qo,isInFrame:Uw,createEl:rt,textContent:ua,prependTo:av,hasClass:ta,addClass:Pn,removeClass:mu,toggleClass:jw,setAttributes:qw,getAttributes:xn,getAttribute:Vw,setAttribute:wo,removeAttribute:ld,blockTextSelection:Hw,unblockTextSelection:zw,getBoundingClientRect:ko,findPosition:eu,getPointerPosition:ud,isTextNode:Ww,emptyEl:O0,normalizeContent:Gw,appendContent:M0,insertContent:Kw,isSingleLeftClick:tu,$:cs,$$:Xw}),Yw=!1,ov,XB=function(){if(ov.options.autoSetup!==!1){var e=Array.prototype.slice.call(ce.getElementsByTagName("video")),t=Array.prototype.slice.call(ce.getElementsByTagName("audio")),i=Array.prototype.slice.call(ce.getElementsByTagName("video-js")),r=e.concat(t,i);if(r&&r.length>0)for(var n=0,a=r.length;n<a;n++){var o=r[n];if(o&&o.getAttribute){if(o.player===void 0){var l=o.getAttribute("data-setup");l!==null&&ov(o)}}else{lv(1);break}}else Yw||lv(1)}};function lv(s,e){jo()&&(e&&(ov=e),O.setTimeout(XB,s))}function uv(){Yw=!0,O.removeEventListener("load",uv)}jo()&&(ce.readyState==="complete"?uv():O.addEventListener("load",uv));var Jw=function(e){var t=ce.createElement("style");return t.className=e,t},Zw=function(e,t){e.styleSheet?e.styleSheet.cssText=t:e.textContent=t},QB=3,YB=QB;function Rn(){return YB++}var ek;O.WeakMap||(ek=function(){function s(){this.vdata="vdata"+Math.floor(O.performance&&O.performance.now()||Date.now()),this.data={}}var e=s.prototype;return e.set=function(i,r){var n=i[this.vdata]||Rn();return i[this.vdata]||(i[this.vdata]=n),this.data[n]=r,this},e.get=function(i){var r=i[this.vdata];if(r)return this.data[r];Qe("We have no data for this element",i)},e.has=function(i){var r=i[this.vdata];return r in this.data},e.delete=function(i){var r=i[this.vdata];r&&(delete this.data[r],delete i[this.vdata])},s}());var Di=O.WeakMap?new WeakMap:new ek;function ZT(s,e){if(Di.has(s)){var t=Di.get(s);t.handlers[e].length===0&&(delete t.handlers[e],s.removeEventListener?s.removeEventListener(e,t.dispatcher,!1):s.detachEvent&&s.detachEvent("on"+e,t.dispatcher)),Object.getOwnPropertyNames(t.handlers).length<=0&&(delete t.handlers,delete t.dispatcher,delete t.disabled),Object.getOwnPropertyNames(t).length===0&&Di.delete(s)}}function R0(s,e,t,i){t.forEach(function(r){s(e,r,i)})}function cd(s){if(s.fixed_)return s;function e(){return!0}function t(){return!1}if(!s||!s.isPropagationStopped||!s.isImmediatePropagationStopped){var i=s||O.event;s={};for(var r in i)r!=="layerX"&&r!=="layerY"&&r!=="keyLocation"&&r!=="webkitMovementX"&&r!=="webkitMovementY"&&r!=="path"&&(r==="returnValue"&&i.preventDefault||(s[r]=i[r]));if(s.target||(s.target=s.srcElement||ce),s.relatedTarget||(s.relatedTarget=s.fromElement===s.target?s.toElement:s.fromElement),s.preventDefault=function(){i.preventDefault&&i.preventDefault(),s.returnValue=!1,i.returnValue=!1,s.defaultPrevented=!0},s.defaultPrevented=!1,s.stopPropagation=function(){i.stopPropagation&&i.stopPropagation(),s.cancelBubble=!0,i.cancelBubble=!0,s.isPropagationStopped=e},s.isPropagationStopped=t,s.stopImmediatePropagation=function(){i.stopImmediatePropagation&&i.stopImmediatePropagation(),s.isImmediatePropagationStopped=e,s.stopPropagation()},s.isImmediatePropagationStopped=t,s.clientX!==null&&s.clientX!==void 0){var n=ce.documentElement,a=ce.body;s.pageX=s.clientX+(n&&n.scrollLeft||a&&a.scrollLeft||0)-(n&&n.clientLeft||a&&a.clientLeft||0),s.pageY=s.clientY+(n&&n.scrollTop||a&&a.scrollTop||0)-(n&&n.clientTop||a&&a.clientTop||0)}s.which=s.charCode||s.keyCode,s.button!==null&&s.button!==void 0&&(s.button=s.button&1?0:s.button&4?1:s.button&2?2:0)}return s.fixed_=!0,s}var pc,JB=function(){if(typeof pc!="boolean"){pc=!1;try{var e=Object.defineProperty({},"passive",{get:function(){pc=!0}});O.addEventListener("test",null,e),O.removeEventListener("test",null,e)}catch{}}return pc},ZB=["touchstart","touchmove"];function or(s,e,t){if(Array.isArray(e))return R0(or,s,e,t);Di.has(s)||Di.set(s,{});var i=Di.get(s);if(i.handlers||(i.handlers={}),i.handlers[e]||(i.handlers[e]=[]),t.guid||(t.guid=Rn()),i.handlers[e].push(t),i.dispatcher||(i.disabled=!1,i.dispatcher=function(n,a){if(!i.disabled){n=cd(n);var o=i.handlers[n.type];if(o)for(var l=o.slice(0),u=0,c=l.length;u<c&&!n.isImmediatePropagationStopped();u++)try{l[u].call(s,n,a)}catch(h){Qe.error(h)}}}),i.handlers[e].length===1)if(s.addEventListener){var r=!1;JB()&&ZB.indexOf(e)>-1&&(r={passive:!0}),s.addEventListener(e,i.dispatcher,r)}else s.attachEvent&&s.attachEvent("on"+e,i.dispatcher)}function Ti(s,e,t){if(Di.has(s)){var i=Di.get(s);if(i.handlers){if(Array.isArray(e))return R0(Ti,s,e,t);var r=function(u,c){i.handlers[c]=[],ZT(u,c)};if(e===void 0){for(var n in i.handlers)Object.prototype.hasOwnProperty.call(i.handlers||{},n)&&r(s,n);return}var a=i.handlers[e];if(a){if(!t){r(s,e);return}if(t.guid)for(var o=0;o<a.length;o++)a[o].guid===t.guid&&a.splice(o--,1);ZT(s,e)}}}}function Vo(s,e,t){var i=Di.has(s)?Di.get(s):{},r=s.parentNode||s.ownerDocument;if(typeof e=="string"?e={type:e,target:s}:e.target||(e.target=s),e=cd(e),i.dispatcher&&i.dispatcher.call(s,e,t),r&&!e.isPropagationStopped()&&e.bubbles===!0)Vo.call(null,r,e,t);else if(!r&&!e.defaultPrevented&&e.target&&e.target[e.type]){Di.has(e.target)||Di.set(e.target,{});var n=Di.get(e.target);e.target[e.type]&&(n.disabled=!0,typeof e.target[e.type]=="function"&&e.target[e.type](),n.disabled=!1)}return!e.defaultPrevented}function hd(s,e,t){if(Array.isArray(e))return R0(hd,s,e,t);var i=function r(){Ti(s,e,r),t.apply(this,arguments)};i.guid=t.guid=t.guid||Rn(),or(s,e,i)}function tk(s,e,t){var i=function r(){Ti(s,e,r),t.apply(this,arguments)};i.guid=t.guid=t.guid||Rn(),or(s,e,i)}var e4=Object.freeze({__proto__:null,fixEvent:cd,on:or,off:Ti,trigger:Vo,one:hd,any:tk}),Lr=30,wt=function(e,t,i){t.guid||(t.guid=Rn());var r=t.bind(e);return r.guid=i?i+"_"+t.guid:t.guid,r},Ln=function(e,t){var i=O.performance.now(),r=function(){var a=O.performance.now();a-i>=t&&(e.apply(void 0,arguments),i=a)};return r},t4=function(e,t,i,r){r===void 0&&(r=O);var n,a=function(){r.clearTimeout(n),n=null},o=function(){var u=this,c=arguments,h=function(){n=null,h=null,e.apply(u,c)};r.clearTimeout(n),n=r.setTimeout(h,t)};return o.cancel=a,o},ai=function(){};ai.prototype.allowedEvents_={};ai.prototype.on=function(s,e){var t=this.addEventListener;this.addEventListener=function(){},or(this,s,e),this.addEventListener=t};ai.prototype.addEventListener=ai.prototype.on;ai.prototype.off=function(s,e){Ti(this,s,e)};ai.prototype.removeEventListener=ai.prototype.off;ai.prototype.one=function(s,e){var t=this.addEventListener;this.addEventListener=function(){},hd(this,s,e),this.addEventListener=t};ai.prototype.any=function(s,e){var t=this.addEventListener;this.addEventListener=function(){},tk(this,s,e),this.addEventListener=t};ai.prototype.trigger=function(s){var e=s.type||s;typeof s=="string"&&(s={type:e}),s=cd(s),this.allowedEvents_[e]&&this["on"+e]&&this["on"+e](s),Vo(this,s)};ai.prototype.dispatchEvent=ai.prototype.trigger;var _l;ai.prototype.queueTrigger=function(s){var e=this;_l||(_l=new Map);var t=s.type||s,i=_l.get(this);i||(i=new Map,_l.set(this,i));var r=i.get(t);i.delete(t),O.clearTimeout(r);var n=O.setTimeout(function(){i.delete(t),i.size===0&&(i=null,_l.delete(e)),e.trigger(s)},0);i.set(t,n)};var dd=function(e){return typeof e.name=="function"?e.name():typeof e.name=="string"?e.name:e.name_?e.name_:e.constructor&&e.constructor.name?e.constructor.name:typeof e},Dn=function(e){return e instanceof ai||!!e.eventBusEl_&&["on","one","off","trigger"].every(function(t){return typeof e[t]=="function"})},i4=function(e,t){Dn(e)?t():(e.eventedCallbacks||(e.eventedCallbacks=[]),e.eventedCallbacks.push(t))},cv=function(e){return typeof e=="string"&&/\S/.test(e)||Array.isArray(e)&&!!e.length},dh=function(e,t,i){if(!e||!e.nodeName&&!Dn(e))throw new Error("Invalid target for "+dd(t)+"#"+i+"; must be a DOM node or evented object.")},ik=function(e,t,i){if(!cv(e))throw new Error("Invalid event type for "+dd(t)+"#"+i+"; must be a non-empty string or array.")},rk=function(e,t,i){if(typeof e!="function")throw new Error("Invalid listener for "+dd(t)+"#"+i+"; must be a function.")},ep=function(e,t,i){var r=t.length<3||t[0]===e||t[0]===e.eventBusEl_,n,a,o;return r?(n=e.eventBusEl_,t.length>=3&&t.shift(),a=t[0],o=t[1]):(n=t[0],a=t[1],o=t[2]),dh(n,e,i),ik(a,e,i),rk(o,e,i),o=wt(e,o),{isTargetingSelf:r,target:n,type:a,listener:o}},Ms=function(e,t,i,r){dh(e,e,t),e.nodeName?e4[t](e,i,r):e[t](i,r)},r4={on:function(){for(var e=this,t=arguments.length,i=new Array(t),r=0;r<t;r++)i[r]=arguments[r];var n=ep(this,i,"on"),a=n.isTargetingSelf,o=n.target,l=n.type,u=n.listener;if(Ms(o,"on",l,u),!a){var c=function(){return e.off(o,l,u)};c.guid=u.guid;var h=function(){return e.off("dispose",c)};h.guid=u.guid,Ms(this,"on","dispose",c),Ms(o,"on","dispose",h)}},one:function(){for(var e=this,t=arguments.length,i=new Array(t),r=0;r<t;r++)i[r]=arguments[r];var n=ep(this,i,"one"),a=n.isTargetingSelf,o=n.target,l=n.type,u=n.listener;if(a)Ms(o,"one",l,u);else{var c=function h(){e.off(o,l,h);for(var d=arguments.length,g=new Array(d),y=0;y<d;y++)g[y]=arguments[y];u.apply(null,g)};c.guid=u.guid,Ms(o,"one",l,c)}},any:function(){for(var e=this,t=arguments.length,i=new Array(t),r=0;r<t;r++)i[r]=arguments[r];var n=ep(this,i,"any"),a=n.isTargetingSelf,o=n.target,l=n.type,u=n.listener;if(a)Ms(o,"any",l,u);else{var c=function h(){e.off(o,l,h);for(var d=arguments.length,g=new Array(d),y=0;y<d;y++)g[y]=arguments[y];u.apply(null,g)};c.guid=u.guid,Ms(o,"any",l,c)}},off:function(e,t,i){if(!e||cv(e))Ti(this.eventBusEl_,e,t);else{var r=e,n=t;dh(r,this,"off"),ik(n,this,"off"),rk(i,this,"off"),i=wt(this,i),this.off("dispose",i),r.nodeName?(Ti(r,n,i),Ti(r,"dispose",i)):Dn(r)&&(r.off(n,i),r.off("dispose",i))}},trigger:function(e,t){dh(this.eventBusEl_,this,"trigger");var i=e&&typeof e!="string"?e.type:e;if(!cv(i)){var r="Invalid event type for "+dd(this)+"#trigger; must be a non-empty string or object with a type key that has a non-empty value.";if(e)(this.log||Qe).error(r);else throw new Error(r)}return Vo(this.eventBusEl_,e,t)}};function F0(s,e){e===void 0&&(e={});var t=e,i=t.eventBusKey;if(i){if(!s[i].nodeName)throw new Error('The eventBusKey "'+i+'" does not refer to an element.');s.eventBusEl_=s[i]}else s.eventBusEl_=rt("span",{className:"vjs-event-bus"});return jt(s,r4),s.eventedCallbacks&&s.eventedCallbacks.forEach(function(r){r()}),s.on("dispose",function(){s.off(),[s,s.el_,s.eventBusEl_].forEach(function(r){r&&Di.has(r)&&Di.delete(r)}),O.setTimeout(function(){s.eventBusEl_=null},0)}),s}var n4={state:{},setState:function(e){var t=this;typeof e=="function"&&(e=e());var i;return oo(e,function(r,n){t.state[n]!==r&&(i=i||{},i[n]={from:t.state[n],to:r}),t.state[n]=r}),i&&Dn(this)&&this.trigger({changes:i,type:"statechanged"}),i}};function nk(s,e){return jt(s,n4),s.state=jt({},s.state,e),typeof s.handleStateChanged=="function"&&Dn(s)&&s.on("statechanged",s.handleStateChanged),s}var Mc=function(e){return typeof e!="string"?e:e.replace(/./,function(t){return t.toLowerCase()})},zt=function(e){return typeof e!="string"?e:e.replace(/./,function(t){return t.toUpperCase()})},s4=function(e,t){return zt(e)===zt(t)};function Et(){for(var s={},e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];return t.forEach(function(r){r&&oo(r,function(n,a){if(!Jl(n)){s[a]=n;return}Jl(s[a])||(s[a]={}),s[a]=Et(s[a],n)})}),s}var a4=function(){function s(){this.map_={}}var e=s.prototype;return e.has=function(i){return i in this.map_},e.delete=function(i){var r=this.has(i);return delete this.map_[i],r},e.set=function(i,r){return this.map_[i]=r,this},e.forEach=function(i,r){for(var n in this.map_)i.call(r,this.map_[n],n,this)},s}(),o4=O.Map?O.Map:a4,l4=function(){function s(){this.set_={}}var e=s.prototype;return e.has=function(i){return i in this.set_},e.delete=function(i){var r=this.has(i);return delete this.set_[i],r},e.add=function(i){return this.set_[i]=1,this},e.forEach=function(i,r){for(var n in this.set_)i.call(r,n,n,this)},s}(),tp=O.Set?O.Set:l4,be=function(){function s(t,i,r){var n=this;if(!t&&this.play?this.player_=t=this:this.player_=t,this.isDisposed_=!1,this.parentComponent_=null,this.options_=Et({},this.options_),i=this.options_=Et(this.options_,i),this.id_=i.id||i.el&&i.el.id,!this.id_){var a=t&&t.id&&t.id()||"no_player";this.id_=a+"_component_"+Rn()}this.name_=i.name||null,i.el?this.el_=i.el:i.createEl!==!1&&(this.el_=this.createEl()),i.className&&this.el_&&i.className.split(" ").forEach(function(o){return n.addClass(o)}),i.evented!==!1&&(F0(this,{eventBusKey:this.el_?"el_":null}),this.handleLanguagechange=this.handleLanguagechange.bind(this),this.on(this.player_,"languagechange",this.handleLanguagechange)),nk(this,this.constructor.defaultState),this.children_=[],this.childIndex_={},this.childNameIndex_={},this.setTimeoutIds_=new tp,this.setIntervalIds_=new tp,this.rafIds_=new tp,this.namedRafs_=new o4,this.clearingTimersOnDispose_=!1,i.initChildren!==!1&&this.initChildren(),this.ready(r),i.reportTouchActivity!==!1&&this.enableTouchActivity()}var e=s.prototype;return e.dispose=function(i){if(i===void 0&&(i={}),!this.isDisposed_){if(this.readyQueue_&&(this.readyQueue_.length=0),this.trigger({type:"dispose",bubbles:!1}),this.isDisposed_=!0,this.children_)for(var r=this.children_.length-1;r>=0;r--)this.children_[r].dispose&&this.children_[r].dispose();this.children_=null,this.childIndex_=null,this.childNameIndex_=null,this.parentComponent_=null,this.el_&&(this.el_.parentNode&&(i.restoreEl?this.el_.parentNode.replaceChild(i.restoreEl,this.el_):this.el_.parentNode.removeChild(this.el_)),this.el_=null),this.player_=null}},e.isDisposed=function(){return!!this.isDisposed_},e.player=function(){return this.player_},e.options=function(i){return i?(this.options_=Et(this.options_,i),this.options_):this.options_},e.el=function(){return this.el_},e.createEl=function(i,r,n){return rt(i,r,n)},e.localize=function(i,r,n){n===void 0&&(n=i);var a=this.player_.language&&this.player_.language(),o=this.player_.languages&&this.player_.languages(),l=o&&o[a],u=a&&a.split("-")[0],c=o&&o[u],h=n;return l&&l[i]?h=l[i]:c&&c[i]&&(h=c[i]),r&&(h=h.replace(/\{(\d+)\}/g,function(d,g){var y=r[g-1],p=y;return typeof y>"u"&&(p=d),p})),h},e.handleLanguagechange=function(){},e.contentEl=function(){return this.contentEl_||this.el_},e.id=function(){return this.id_},e.name=function(){return this.name_},e.children=function(){return this.children_},e.getChildById=function(i){return this.childIndex_[i]},e.getChild=function(i){if(i)return this.childNameIndex_[i]},e.getDescendant=function(){for(var i=arguments.length,r=new Array(i),n=0;n<i;n++)r[n]=arguments[n];r=r.reduce(function(l,u){return l.concat(u)},[]);for(var a=this,o=0;o<r.length;o++)if(a=a.getChild(r[o]),!a||!a.getChild)return;return a},e.addChild=function(i,r,n){r===void 0&&(r={}),n===void 0&&(n=this.children_.length);var a,o;if(typeof i=="string"){o=zt(i);var l=r.componentClass||o;r.name=o;var u=s.getComponent(l);if(!u)throw new Error("Component "+l+" does not exist");if(typeof u!="function")return null;a=new u(this.player_||this,r)}else a=i;if(a.parentComponent_&&a.parentComponent_.removeChild(a),this.children_.splice(n,0,a),a.parentComponent_=this,typeof a.id=="function"&&(this.childIndex_[a.id()]=a),o=o||a.name&&zt(a.name()),o&&(this.childNameIndex_[o]=a,this.childNameIndex_[Mc(o)]=a),typeof a.el=="function"&&a.el()){var c=null;this.children_[n+1]&&(this.children_[n+1].el_?c=this.children_[n+1].el_:qo(this.children_[n+1])&&(c=this.children_[n+1])),this.contentEl().insertBefore(a.el(),c)}return a},e.removeChild=function(i){if(typeof i=="string"&&(i=this.getChild(i)),!(!i||!this.children_)){for(var r=!1,n=this.children_.length-1;n>=0;n--)if(this.children_[n]===i){r=!0,this.children_.splice(n,1);break}if(r){i.parentComponent_=null,this.childIndex_[i.id()]=null,this.childNameIndex_[zt(i.name())]=null,this.childNameIndex_[Mc(i.name())]=null;var a=i.el();a&&a.parentNode===this.contentEl()&&this.contentEl().removeChild(i.el())}}},e.initChildren=function(){var i=this,r=this.options_.children;if(r){var n=this.options_,a=function(c){var h=c.name,d=c.opts;if(n[h]!==void 0&&(d=n[h]),d!==!1){d===!0&&(d={}),d.playerOptions=i.options_.playerOptions;var g=i.addChild(h,d);g&&(i[h]=g)}},o,l=s.getComponent("Tech");Array.isArray(r)?o=r:o=Object.keys(r),o.concat(Object.keys(this.options_).filter(function(u){return!o.some(function(c){return typeof c=="string"?u===c:u===c.name})})).map(function(u){var c,h;return typeof u=="string"?(c=u,h=r[c]||i.options_[c]||{}):(c=u.name,h=u),{name:c,opts:h}}).filter(function(u){var c=s.getComponent(u.opts.componentClass||zt(u.name));return c&&!l.isTech(c)}).forEach(a)}},e.buildCSSClass=function(){return""},e.ready=function(i,r){if(r===void 0&&(r=!1),!!i){if(!this.isReady_){this.readyQueue_=this.readyQueue_||[],this.readyQueue_.push(i);return}r?i.call(this):this.setTimeout(i,1)}},e.triggerReady=function(){this.isReady_=!0,this.setTimeout(function(){var i=this.readyQueue_;this.readyQueue_=[],i&&i.length>0&&i.forEach(function(r){r.call(this)},this),this.trigger("ready")},1)},e.$=function(i,r){return cs(i,r||this.contentEl())},e.$$=function(i,r){return Xw(i,r||this.contentEl())},e.hasClass=function(i){return ta(this.el_,i)},e.addClass=function(i){Pn(this.el_,i)},e.removeClass=function(i){mu(this.el_,i)},e.toggleClass=function(i,r){jw(this.el_,i,r)},e.show=function(){this.removeClass("vjs-hidden")},e.hide=function(){this.addClass("vjs-hidden")},e.lockShowing=function(){this.addClass("vjs-lock-showing")},e.unlockShowing=function(){this.removeClass("vjs-lock-showing")},e.getAttribute=function(i){return Vw(this.el_,i)},e.setAttribute=function(i,r){wo(this.el_,i,r)},e.removeAttribute=function(i){ld(this.el_,i)},e.width=function(i,r){return this.dimension("width",i,r)},e.height=function(i,r){return this.dimension("height",i,r)},e.dimensions=function(i,r){this.width(i,!0),this.height(r)},e.dimension=function(i,r,n){if(r!==void 0){(r===null||r!==r)&&(r=0),(""+r).indexOf("%")!==-1||(""+r).indexOf("px")!==-1?this.el_.style[i]=r:r==="auto"?this.el_.style[i]="":this.el_.style[i]=r+"px",n||this.trigger("componentresize");return}if(!this.el_)return 0;var a=this.el_.style[i],o=a.indexOf("px");return parseInt(o!==-1?a.slice(0,o):this.el_["offset"+zt(i)],10)},e.currentDimension=function(i){var r=0;if(i!=="width"&&i!=="height")throw new Error("currentDimension only accepts width or height value");if(r=Zl(this.el_,i),r=parseFloat(r),r===0||isNaN(r)){var n="offset"+zt(i);r=this.el_[n]}return r},e.currentDimensions=function(){return{width:this.currentDimension("width"),height:this.currentDimension("height")}},e.currentWidth=function(){return this.currentDimension("width")},e.currentHeight=function(){return this.currentDimension("height")},e.focus=function(){this.el_.focus()},e.blur=function(){this.el_.blur()},e.handleKeyDown=function(i){this.player_&&(Ge.isEventKey(i,"Tab")||i.stopPropagation(),this.player_.handleKeyDown(i))},e.handleKeyPress=function(i){this.handleKeyDown(i)},e.emitTapEvents=function(){var i=0,r=null,n=10,a=200,o;this.on("touchstart",function(u){u.touches.length===1&&(r={pageX:u.touches[0].pageX,pageY:u.touches[0].pageY},i=O.performance.now(),o=!0)}),this.on("touchmove",function(u){if(u.touches.length>1)o=!1;else if(r){var c=u.touches[0].pageX-r.pageX,h=u.touches[0].pageY-r.pageY,d=Math.sqrt(c*c+h*h);d>n&&(o=!1)}});var l=function(){o=!1};this.on("touchleave",l),this.on("touchcancel",l),this.on("touchend",function(u){if(r=null,o===!0){var c=O.performance.now()-i;c<a&&(u.preventDefault(),this.trigger("tap"))}})},e.enableTouchActivity=function(){if(!(!this.player()||!this.player().reportUserActivity)){var i=wt(this.player(),this.player().reportUserActivity),r;this.on("touchstart",function(){i(),this.clearInterval(r),r=this.setInterval(i,250)});var n=function(o){i(),this.clearInterval(r)};this.on("touchmove",i),this.on("touchend",n),this.on("touchcancel",n)}},e.setTimeout=function(i,r){var n=this,a;return i=wt(this,i),this.clearTimersOnDispose_(),a=O.setTimeout(function(){n.setTimeoutIds_.has(a)&&n.setTimeoutIds_.delete(a),i()},r),this.setTimeoutIds_.add(a),a},e.clearTimeout=function(i){return this.setTimeoutIds_.has(i)&&(this.setTimeoutIds_.delete(i),O.clearTimeout(i)),i},e.setInterval=function(i,r){i=wt(this,i),this.clearTimersOnDispose_();var n=O.setInterval(i,r);return this.setIntervalIds_.add(n),n},e.clearInterval=function(i){return this.setIntervalIds_.has(i)&&(this.setIntervalIds_.delete(i),O.clearInterval(i)),i},e.requestAnimationFrame=function(i){var r=this;if(!this.supportsRaf_)return this.setTimeout(i,1e3/60);this.clearTimersOnDispose_();var n;return i=wt(this,i),n=O.requestAnimationFrame(function(){r.rafIds_.has(n)&&r.rafIds_.delete(n),i()}),this.rafIds_.add(n),n},e.requestNamedAnimationFrame=function(i,r){var n=this;if(!this.namedRafs_.has(i)){this.clearTimersOnDispose_(),r=wt(this,r);var a=this.requestAnimationFrame(function(){r(),n.namedRafs_.has(i)&&n.namedRafs_.delete(i)});return this.namedRafs_.set(i,a),i}},e.cancelNamedAnimationFrame=function(i){this.namedRafs_.has(i)&&(this.cancelAnimationFrame(this.namedRafs_.get(i)),this.namedRafs_.delete(i))},e.cancelAnimationFrame=function(i){return this.supportsRaf_?(this.rafIds_.has(i)&&(this.rafIds_.delete(i),O.cancelAnimationFrame(i)),i):this.clearTimeout(i)},e.clearTimersOnDispose_=function(){var i=this;this.clearingTimersOnDispose_||(this.clearingTimersOnDispose_=!0,this.one("dispose",function(){[["namedRafs_","cancelNamedAnimationFrame"],["rafIds_","cancelAnimationFrame"],["setTimeoutIds_","clearTimeout"],["setIntervalIds_","clearInterval"]].forEach(function(r){var n=r[0],a=r[1];i[n].forEach(function(o,l){return i[a](l)})}),i.clearingTimersOnDispose_=!1}))},s.registerComponent=function(i,r){if(typeof i!="string"||!i)throw new Error('Illegal component name, "'+i+'"; must be a non-empty string.');var n=s.getComponent("Tech"),a=n&&n.isTech(r),o=s===r||s.prototype.isPrototypeOf(r.prototype);if(a||!o){var l;throw a?l="techs must be registered using Tech.registerTech()":l="must be a Component subclass",new Error('Illegal component, "'+i+'"; '+l+".")}i=zt(i),s.components_||(s.components_={});var u=s.getComponent("Player");if(i==="Player"&&u&&u.players){var c=u.players,h=Object.keys(c);if(c&&h.length>0&&h.map(function(d){return c[d]}).every(Boolean))throw new Error("Can not register Player component after player has been created.")}return s.components_[i]=r,s.components_[Mc(i)]=r,r},s.getComponent=function(i){if(!(!i||!s.components_))return s.components_[i]},s}();be.prototype.supportsRaf_=typeof O.requestAnimationFrame=="function"&&typeof O.cancelAnimationFrame=="function";be.registerComponent("Component",be);function u4(s,e,t){if(typeof e!="number"||e<0||e>t)throw new Error("Failed to execute '"+s+"' on 'TimeRanges': The index provided ("+e+") is non-numeric or out of bounds (0-"+t+").")}function eb(s,e,t,i){return u4(s,i,t.length-1),t[i][e]}function ip(s){var e;return s===void 0||s.length===0?e={length:0,start:function(){throw new Error("This TimeRanges object is empty")},end:function(){throw new Error("This TimeRanges object is empty")}}:e={length:s.length,start:eb.bind(null,"start",0,s),end:eb.bind(null,"end",1,s)},O.Symbol&&O.Symbol.iterator&&(e[O.Symbol.iterator]=function(){return(s||[]).values()}),e}function ia(s,e){return Array.isArray(s)?ip(s):s===void 0||e===void 0?ip():ip([[s,e]])}function sk(s,e){var t=0,i,r;if(!e)return 0;(!s||!s.length)&&(s=ia(0,0));for(var n=0;n<s.length;n++)i=s.start(n),r=s.end(n),r>e&&(r=e),t+=r-i;return t/e}function Ni(s){if(s instanceof Ni)return s;typeof s=="number"?this.code=s:typeof s=="string"?this.message=s:Nn(s)&&(typeof s.code=="number"&&(this.code=s.code),jt(this,s)),this.message||(this.message=Ni.defaultMessages[this.code]||"")}Ni.prototype.code=0;Ni.prototype.message="";Ni.prototype.status=null;Ni.errorTypes=["MEDIA_ERR_CUSTOM","MEDIA_ERR_ABORTED","MEDIA_ERR_NETWORK","MEDIA_ERR_DECODE","MEDIA_ERR_SRC_NOT_SUPPORTED","MEDIA_ERR_ENCRYPTED"];Ni.defaultMessages={1:"You aborted the media playback",2:"A network error caused the media download to fail part-way.",3:"The media playback was aborted due to a corruption problem or because the media used features your browser did not support.",4:"The media could not be loaded, either because the server or network failed or because the format is not supported.",5:"The media is encrypted and we do not have the keys to decrypt it."};for(var Ua=0;Ua<Ni.errorTypes.length;Ua++)Ni[Ni.errorTypes[Ua]]=Ua,Ni.prototype[Ni.errorTypes[Ua]]=Ua;function jl(s){return s!=null&&typeof s.then=="function"}function Yr(s){jl(s)&&s.then(null,function(e){})}var hv=function(e){var t=["kind","label","language","id","inBandMetadataTrackDispatchType","mode","src"].reduce(function(i,r,n){return e[r]&&(i[r]=e[r]),i},{cues:e.cues&&Array.prototype.map.call(e.cues,function(i){return{startTime:i.startTime,endTime:i.endTime,text:i.text,id:i.id}})});return t},c4=function(e){var t=e.$$("track"),i=Array.prototype.map.call(t,function(n){return n.track}),r=Array.prototype.map.call(t,function(n){var a=hv(n.track);return n.src&&(a.src=n.src),a});return r.concat(Array.prototype.filter.call(e.textTracks(),function(n){return i.indexOf(n)===-1}).map(hv))},h4=function(e,t){return e.forEach(function(i){var r=t.addRemoteTextTrack(i).track;!i.src&&i.cues&&i.cues.forEach(function(n){return r.addCue(n)})}),t.textTracks()},tb={textTracksToJson:c4,jsonToTextTracks:h4,trackToJson_:hv},rp="vjs-modal-dialog",Ho=function(s){Ce(e,s);function e(i,r){var n;return n=s.call(this,i,r)||this,n.handleKeyDown_=function(a){return n.handleKeyDown(a)},n.close_=function(a){return n.close(a)},n.opened_=n.hasBeenOpened_=n.hasBeenFilled_=!1,n.closeable(!n.options_.uncloseable),n.content(n.options_.content),n.contentEl_=rt("div",{className:rp+"-content"},{role:"document"}),n.descEl_=rt("p",{className:rp+"-description vjs-control-text",id:n.el().getAttribute("aria-describedby")}),ua(n.descEl_,n.description()),n.el_.appendChild(n.descEl_),n.el_.appendChild(n.contentEl_),n}var t=e.prototype;return t.createEl=function(){return s.prototype.createEl.call(this,"div",{className:this.buildCSSClass(),tabIndex:-1},{"aria-describedby":this.id()+"_description","aria-hidden":"true","aria-label":this.label(),role:"dialog"})},t.dispose=function(){this.contentEl_=null,this.descEl_=null,this.previouslyActiveEl_=null,s.prototype.dispose.call(this)},t.buildCSSClass=function(){return rp+" vjs-hidden "+s.prototype.buildCSSClass.call(this)},t.label=function(){return this.localize(this.options_.label||"Modal Window")},t.description=function(){var r=this.options_.description||this.localize("This is a modal window.");return this.closeable()&&(r+=" "+this.localize("This modal can be closed by pressing the Escape key or activating the close button.")),r},t.open=function(){if(!this.opened_){var r=this.player();this.trigger("beforemodalopen"),this.opened_=!0,(this.options_.fillAlways||!this.hasBeenOpened_&&!this.hasBeenFilled_)&&this.fill(),this.wasPlaying_=!r.paused(),this.options_.pauseOnOpen&&this.wasPlaying_&&r.pause(),this.on("keydown",this.handleKeyDown_),this.hadControls_=r.controls(),r.controls(!1),this.show(),this.conditionalFocus_(),this.el().setAttribute("aria-hidden","false"),this.trigger("modalopen"),this.hasBeenOpened_=!0}},t.opened=function(r){return typeof r=="boolean"&&this[r?"open":"close"](),this.opened_},t.close=function(){if(this.opened_){var r=this.player();this.trigger("beforemodalclose"),this.opened_=!1,this.wasPlaying_&&this.options_.pauseOnOpen&&r.play(),this.off("keydown",this.handleKeyDown_),this.hadControls_&&r.controls(!0),this.hide(),this.el().setAttribute("aria-hidden","true"),this.trigger("modalclose"),this.conditionalBlur_(),this.options_.temporary&&this.dispose()}},t.closeable=function(r){if(typeof r=="boolean"){var n=this.closeable_=!!r,a=this.getChild("closeButton");if(n&&!a){var o=this.contentEl_;this.contentEl_=this.el_,a=this.addChild("closeButton",{controlText:"Close Modal Dialog"}),this.contentEl_=o,this.on(a,"close",this.close_)}!n&&a&&(this.off(a,"close",this.close_),this.removeChild(a),a.dispose())}return this.closeable_},t.fill=function(){this.fillWith(this.content())},t.fillWith=function(r){var n=this.contentEl(),a=n.parentNode,o=n.nextSibling;this.trigger("beforemodalfill"),this.hasBeenFilled_=!0,a.removeChild(n),this.empty(),Kw(n,r),this.trigger("modalfill"),o?a.insertBefore(n,o):a.appendChild(n);var l=this.getChild("closeButton");l&&a.appendChild(l.el_)},t.empty=function(){this.trigger("beforemodalempty"),O0(this.contentEl()),this.trigger("modalempty")},t.content=function(r){return typeof r<"u"&&(this.content_=r),this.content_},t.conditionalFocus_=function(){var r=ce.activeElement,n=this.player_.el_;this.previouslyActiveEl_=null,(n.contains(r)||n===r)&&(this.previouslyActiveEl_=r,this.focus())},t.conditionalBlur_=function(){this.previouslyActiveEl_&&(this.previouslyActiveEl_.focus(),this.previouslyActiveEl_=null)},t.handleKeyDown=function(r){if(r.stopPropagation(),Ge.isEventKey(r,"Escape")&&this.closeable()){r.preventDefault(),this.close();return}if(Ge.isEventKey(r,"Tab")){for(var n=this.focusableEls_(),a=this.el_.querySelector(":focus"),o,l=0;l<n.length;l++)if(a===n[l]){o=l;break}ce.activeElement===this.el_&&(o=0),r.shiftKey&&o===0?(n[n.length-1].focus(),r.preventDefault()):!r.shiftKey&&o===n.length-1&&(n[0].focus(),r.preventDefault())}},t.focusableEls_=function(){var r=this.el_.querySelectorAll("*");return Array.prototype.filter.call(r,function(n){return(n instanceof O.HTMLAnchorElement||n instanceof O.HTMLAreaElement)&&n.hasAttribute("href")||(n instanceof O.HTMLInputElement||n instanceof O.HTMLSelectElement||n instanceof O.HTMLTextAreaElement||n instanceof O.HTMLButtonElement)&&!n.hasAttribute("disabled")||n instanceof O.HTMLIFrameElement||n instanceof O.HTMLObjectElement||n instanceof O.HTMLEmbedElement||n.hasAttribute("tabindex")&&n.getAttribute("tabindex")!==-1||n.hasAttribute("contenteditable")})},e}(be);Ho.prototype.options_={pauseOnOpen:!0,temporary:!0};be.registerComponent("ModalDialog",Ho);var Ao=function(s){Ce(e,s);function e(i){var r;i===void 0&&(i=[]),r=s.call(this)||this,r.tracks_=[],Object.defineProperty(We(r),"length",{get:function(){return this.tracks_.length}});for(var n=0;n<i.length;n++)r.addTrack(i[n]);return r}var t=e.prototype;return t.addTrack=function(r){var n=this,a=this.tracks_.length;""+a in this||Object.defineProperty(this,a,{get:function(){return this.tracks_[a]}}),this.tracks_.indexOf(r)===-1&&(this.tracks_.push(r),this.trigger({track:r,type:"addtrack",target:this})),r.labelchange_=function(){n.trigger({track:r,type:"labelchange",target:n})},Dn(r)&&r.addEventListener("labelchange",r.labelchange_)},t.removeTrack=function(r){for(var n,a=0,o=this.length;a<o;a++)if(this[a]===r){n=this[a],n.off&&n.off(),this.tracks_.splice(a,1);break}n&&this.trigger({track:n,type:"removetrack",target:this})},t.getTrackById=function(r){for(var n=null,a=0,o=this.length;a<o;a++){var l=this[a];if(l.id===r){n=l;break}}return n},e}(ai);Ao.prototype.allowedEvents_={change:"change",addtrack:"addtrack",removetrack:"removetrack",labelchange:"labelchange"};for(var d4 in Ao.prototype.allowedEvents_)Ao.prototype["on"+d4]=null;var np=function(e,t){for(var i=0;i<e.length;i++)!Object.keys(e[i]).length||t.id===e[i].id||(e[i].enabled=!1)},f4=function(s){Ce(e,s);function e(i){var r;i===void 0&&(i=[]);for(var n=i.length-1;n>=0;n--)if(i[n].enabled){np(i,i[n]);break}return r=s.call(this,i)||this,r.changing_=!1,r}var t=e.prototype;return t.addTrack=function(r){var n=this;r.enabled&&np(this,r),s.prototype.addTrack.call(this,r),r.addEventListener&&(r.enabledChange_=function(){n.changing_||(n.changing_=!0,np(n,r),n.changing_=!1,n.trigger("change"))},r.addEventListener("enabledchange",r.enabledChange_))},t.removeTrack=function(r){s.prototype.removeTrack.call(this,r),r.removeEventListener&&r.enabledChange_&&(r.removeEventListener("enabledchange",r.enabledChange_),r.enabledChange_=null)},e}(Ao),sp=function(e,t){for(var i=0;i<e.length;i++)!Object.keys(e[i]).length||t.id===e[i].id||(e[i].selected=!1)},p4=function(s){Ce(e,s);function e(i){var r;i===void 0&&(i=[]);for(var n=i.length-1;n>=0;n--)if(i[n].selected){sp(i,i[n]);break}return r=s.call(this,i)||this,r.changing_=!1,Object.defineProperty(We(r),"selectedIndex",{get:function(){for(var o=0;o<this.length;o++)if(this[o].selected)return o;return-1},set:function(){}}),r}var t=e.prototype;return t.addTrack=function(r){var n=this;r.selected&&sp(this,r),s.prototype.addTrack.call(this,r),r.addEventListener&&(r.selectedChange_=function(){n.changing_||(n.changing_=!0,sp(n,r),n.changing_=!1,n.trigger("change"))},r.addEventListener("selectedchange",r.selectedChange_))},t.removeTrack=function(r){s.prototype.removeTrack.call(this,r),r.removeEventListener&&r.selectedChange_&&(r.removeEventListener("selectedchange",r.selectedChange_),r.selectedChange_=null)},e}(Ao),ak=function(s){Ce(e,s);function e(){return s.apply(this,arguments)||this}var t=e.prototype;return t.addTrack=function(r){var n=this;s.prototype.addTrack.call(this,r),this.queueChange_||(this.queueChange_=function(){return n.queueTrigger("change")}),this.triggerSelectedlanguagechange||(this.triggerSelectedlanguagechange_=function(){return n.trigger("selectedlanguagechange")}),r.addEventListener("modechange",this.queueChange_);var a=["metadata","chapters"];a.indexOf(r.kind)===-1&&r.addEventListener("modechange",this.triggerSelectedlanguagechange_)},t.removeTrack=function(r){s.prototype.removeTrack.call(this,r),r.removeEventListener&&(this.queueChange_&&r.removeEventListener("modechange",this.queueChange_),this.selectedlanguagechange_&&r.removeEventListener("modechange",this.triggerSelectedlanguagechange_))},e}(Ao),m4=function(){function s(t){t===void 0&&(t=[]),this.trackElements_=[],Object.defineProperty(this,"length",{get:function(){return this.trackElements_.length}});for(var i=0,r=t.length;i<r;i++)this.addTrackElement_(t[i])}var e=s.prototype;return e.addTrackElement_=function(i){var r=this.trackElements_.length;""+r in this||Object.defineProperty(this,r,{get:function(){return this.trackElements_[r]}}),this.trackElements_.indexOf(i)===-1&&this.trackElements_.push(i)},e.getTrackElementByTrack_=function(i){for(var r,n=0,a=this.trackElements_.length;n<a;n++)if(i===this.trackElements_[n].track){r=this.trackElements_[n];break}return r},e.removeTrackElement_=function(i){for(var r=0,n=this.trackElements_.length;r<n;r++)if(i===this.trackElements_[r]){this.trackElements_[r].track&&typeof this.trackElements_[r].track.off=="function"&&this.trackElements_[r].track.off(),typeof this.trackElements_[r].off=="function"&&this.trackElements_[r].off(),this.trackElements_.splice(r,1);break}},s}(),ib=function(){function s(t){s.prototype.setCues_.call(this,t),Object.defineProperty(this,"length",{get:function(){return this.length_}})}var e=s.prototype;return e.setCues_=function(i){var r=this.length||0,n=0,a=i.length;this.cues_=i,this.length_=i.length;var o=function(u){""+u in this||Object.defineProperty(this,""+u,{get:function(){return this.cues_[u]}})};if(r<a)for(n=r;n<a;n++)o.call(this,n)},e.getCueById=function(i){for(var r=null,n=0,a=this.length;n<a;n++){var o=this[n];if(o.id===i){r=o;break}}return r},s}(),g4={alternative:"alternative",captions:"captions",main:"main",sign:"sign",subtitles:"subtitles",commentary:"commentary"},v4={alternative:"alternative",descriptions:"descriptions",main:"main","main-desc":"main-desc",translation:"translation",commentary:"commentary"},y4={subtitles:"subtitles",captions:"captions",descriptions:"descriptions",chapters:"chapters",metadata:"metadata"},rb={disabled:"disabled",hidden:"hidden",showing:"showing"},B0=function(s){Ce(e,s);function e(t){var i;t===void 0&&(t={}),i=s.call(this)||this;var r={id:t.id||"vjs_track_"+Rn(),kind:t.kind||"",language:t.language||""},n=t.label||"",a=function(u){Object.defineProperty(We(i),u,{get:function(){return r[u]},set:function(){}})};for(var o in r)a(o);return Object.defineProperty(We(i),"label",{get:function(){return n},set:function(u){u!==n&&(n=u,this.trigger("labelchange"))}}),i}return e}(ai),U0=function(e){var t=["protocol","hostname","port","pathname","search","hash","host"],i=ce.createElement("a");i.href=e;for(var r={},n=0;n<t.length;n++)r[t[n]]=i[t[n]];return r.protocol==="http:"&&(r.host=r.host.replace(/:80$/,"")),r.protocol==="https:"&&(r.host=r.host.replace(/:443$/,"")),r.protocol||(r.protocol=O.location.protocol),r.host||(r.host=O.location.host),r},ok=function(e){if(!e.match(/^https?:\/\//)){var t=ce.createElement("a");t.href=e,e=t.href}return e},$0=function(e){if(typeof e=="string"){var t=/^(\/?)([\s\S]*?)((?:\.{1,2}|[^\/]+?)(\.([^\.\/\?]+)))(?:[\/]*|[\?].*)$/,i=t.exec(e);if(i)return i.pop().toLowerCase()}return""},fd=function(e,t){t===void 0&&(t=O.location);var i=U0(e),r=i.protocol===":"?t.protocol:i.protocol,n=r+i.host!==t.protocol+t.host;return n},_4=Object.freeze({__proto__:null,parseUrl:U0,getAbsoluteURL:ok,getFileExtension:$0,isCrossOrigin:fd}),nb=function(e,t){var i=new O.WebVTT.Parser(O,O.vttjs,O.WebVTT.StringDecoder()),r=[];i.oncue=function(n){t.addCue(n)},i.onparsingerror=function(n){r.push(n)},i.onflush=function(){t.trigger({type:"loadeddata",target:t})},i.parse(e),r.length>0&&(O.console&&O.console.groupCollapsed&&O.console.groupCollapsed("Text Track parsing errors for "+t.src),r.forEach(function(n){return Qe.error(n)}),O.console&&O.console.groupEnd&&O.console.groupEnd()),i.flush()},sb=function(e,t){var i={uri:e},r=fd(e);r&&(i.cors=r);var n=t.tech_.crossOrigin()==="use-credentials";n&&(i.withCredentials=n),dw(i,wt(this,function(a,o,l){if(a)return Qe.error(a,o);t.loaded_=!0,typeof O.WebVTT!="function"?t.tech_&&t.tech_.any(["vttjsloaded","vttjserror"],function(u){if(u.type==="vttjserror"){Qe.error("vttjs failed to load, stopping trying to process "+t.src);return}return nb(l,t)}):nb(l,t)}))},gu=function(s){Ce(e,s);function e(i){var r;if(i===void 0&&(i={}),!i.tech)throw new Error("A tech was not provided.");var n=Et(i,{kind:y4[i.kind]||"subtitles",language:i.language||i.srclang||""}),a=rb[n.mode]||"disabled",o=n.default;(n.kind==="metadata"||n.kind==="chapters")&&(a="hidden"),r=s.call(this,n)||this,r.tech_=n.tech,r.cues_=[],r.activeCues_=[],r.preload_=r.tech_.preloadTextTracks!==!1;var l=new ib(r.cues_),u=new ib(r.activeCues_),c=!1;r.timeupdateHandler=wt(We(r),function(d){if(d===void 0&&(d={}),!this.tech_.isDisposed()){if(!this.tech_.isReady_){d.type!=="timeupdate"&&(this.rvf_=this.tech_.requestVideoFrameCallback(this.timeupdateHandler));return}this.activeCues=this.activeCues,c&&(this.trigger("cuechange"),c=!1),d.type!=="timeupdate"&&(this.rvf_=this.tech_.requestVideoFrameCallback(this.timeupdateHandler))}});var h=function(){r.stopTracking()};return r.tech_.one("dispose",h),a!=="disabled"&&r.startTracking(),Object.defineProperties(We(r),{default:{get:function(){return o},set:function(){}},mode:{get:function(){return a},set:function(g){rb[g]&&a!==g&&(a=g,!this.preload_&&a!=="disabled"&&this.cues.length===0&&sb(this.src,this),this.stopTracking(),a!=="disabled"&&this.startTracking(),this.trigger("modechange"))}},cues:{get:function(){return this.loaded_?l:null},set:function(){}},activeCues:{get:function(){if(!this.loaded_)return null;if(this.cues.length===0)return u;for(var g=this.tech_.currentTime(),y=[],p=0,_=this.cues.length;p<_;p++){var k=this.cues[p];(k.startTime<=g&&k.endTime>=g||k.startTime===k.endTime&&k.startTime<=g&&k.startTime+.5>=g)&&y.push(k)}if(c=!1,y.length!==this.activeCues_.length)c=!0;else for(var A=0;A<y.length;A++)this.activeCues_.indexOf(y[A])===-1&&(c=!0);return this.activeCues_=y,u.setCues_(this.activeCues_),u},set:function(){}}}),n.src?(r.src=n.src,r.preload_||(r.loaded_=!0),(r.preload_||n.kind!=="subtitles"&&n.kind!=="captions")&&sb(r.src,We(r))):r.loaded_=!0,r}var t=e.prototype;return t.startTracking=function(){this.rvf_=this.tech_.requestVideoFrameCallback(this.timeupdateHandler),this.tech_.on("timeupdate",this.timeupdateHandler)},t.stopTracking=function(){this.rvf_&&(this.tech_.cancelVideoFrameCallback(this.rvf_),this.rvf_=void 0),this.tech_.off("timeupdate",this.timeupdateHandler)},t.addCue=function(r){var n=r;if(!("getCueAsHTML"in n)){n=new O.vttjs.VTTCue(r.startTime,r.endTime,r.text);for(var a in r)a in n||(n[a]=r[a]);n.id=r.id,n.originalCue_=r}for(var o=this.tech_.textTracks(),l=0;l<o.length;l++)o[l]!==this&&o[l].removeCue(n);this.cues_.push(n),this.cues.setCues_(this.cues_)},t.removeCue=function(r){for(var n=this.cues_.length;n--;){var a=this.cues_[n];if(a===r||a.originalCue_&&a.originalCue_===r){this.cues_.splice(n,1),this.cues.setCues_(this.cues_);break}}},e}(B0);gu.prototype.allowedEvents_={cuechange:"cuechange"};var lk=function(s){Ce(e,s);function e(t){var i;t===void 0&&(t={});var r=Et(t,{kind:v4[t.kind]||""});i=s.call(this,r)||this;var n=!1;return Object.defineProperty(We(i),"enabled",{get:function(){return n},set:function(o){typeof o!="boolean"||o===n||(n=o,this.trigger("enabledchange"))}}),r.enabled&&(i.enabled=r.enabled),i.loaded_=!0,i}return e}(B0),uk=function(s){Ce(e,s);function e(t){var i;t===void 0&&(t={});var r=Et(t,{kind:g4[t.kind]||""});i=s.call(this,r)||this;var n=!1;return Object.defineProperty(We(i),"selected",{get:function(){return n},set:function(o){typeof o!="boolean"||o===n||(n=o,this.trigger("selectedchange"))}}),r.selected&&(i.selected=r.selected),i}return e}(B0),ck=0,T4=1,hk=2,b4=3,zo=function(s){Ce(e,s);function e(t){var i;t===void 0&&(t={}),i=s.call(this)||this;var r,n=new gu(t);return i.kind=n.kind,i.src=n.src,i.srclang=n.language,i.label=n.label,i.default=n.default,Object.defineProperties(We(i),{readyState:{get:function(){return r}},track:{get:function(){return n}}}),r=ck,n.addEventListener("loadeddata",function(){r=hk,i.trigger({type:"load",target:We(i)})}),i}return e}(ai);zo.prototype.allowedEvents_={load:"load"};zo.NONE=ck;zo.LOADING=T4;zo.LOADED=hk;zo.ERROR=b4;var vr={audio:{ListClass:f4,TrackClass:lk,capitalName:"Audio"},video:{ListClass:p4,TrackClass:uk,capitalName:"Video"},text:{ListClass:ak,TrackClass:gu,capitalName:"Text"}};Object.keys(vr).forEach(function(s){vr[s].getterName=s+"Tracks",vr[s].privateName=s+"Tracks_"});var Io={remoteText:{ListClass:ak,TrackClass:gu,capitalName:"RemoteText",getterName:"remoteTextTracks",privateName:"remoteTextTracks_"},remoteTextEl:{ListClass:m4,TrackClass:zo,capitalName:"RemoteTextTrackEls",getterName:"remoteTextTrackEls",privateName:"remoteTextTrackEls_"}},ki=ft({},vr,Io);Io.names=Object.keys(Io);vr.names=Object.keys(vr);ki.names=[].concat(Io.names).concat(vr.names);function S4(s,e,t,i,r){r===void 0&&(r={});var n=s.textTracks();r.kind=e,t&&(r.label=t),i&&(r.language=i),r.tech=s;var a=new ki.text.TrackClass(r);return n.addTrack(a),a}var yt=function(s){Ce(e,s);function e(i,r){var n;return i===void 0&&(i={}),r===void 0&&(r=function(){}),i.reportTouchActivity=!1,n=s.call(this,null,i,r)||this,n.onDurationChange_=function(a){return n.onDurationChange(a)},n.trackProgress_=function(a){return n.trackProgress(a)},n.trackCurrentTime_=function(a){return n.trackCurrentTime(a)},n.stopTrackingCurrentTime_=function(a){return n.stopTrackingCurrentTime(a)},n.disposeSourceHandler_=function(a){return n.disposeSourceHandler(a)},n.queuedHanders_=new Set,n.hasStarted_=!1,n.on("playing",function(){this.hasStarted_=!0}),n.on("loadstart",function(){this.hasStarted_=!1}),ki.names.forEach(function(a){var o=ki[a];i&&i[o.getterName]&&(n[o.privateName]=i[o.getterName])}),n.featuresProgressEvents||n.manualProgressOn(),n.featuresTimeupdateEvents||n.manualTimeUpdatesOn(),["Text","Audio","Video"].forEach(function(a){i["native"+a+"Tracks"]===!1&&(n["featuresNative"+a+"Tracks"]=!1)}),i.nativeCaptions===!1||i.nativeTextTracks===!1?n.featuresNativeTextTracks=!1:(i.nativeCaptions===!0||i.nativeTextTracks===!0)&&(n.featuresNativeTextTracks=!0),n.featuresNativeTextTracks||n.emulateTextTracks(),n.preloadTextTracks=i.preloadTextTracks!==!1,n.autoRemoteTextTracks_=new ki.text.ListClass,n.initTrackListeners(),i.nativeControlsForTouch||n.emitTapEvents(),n.constructor&&(n.name_=n.constructor.name||"Unknown Tech"),n}var t=e.prototype;return t.triggerSourceset=function(r){var n=this;this.isReady_||this.one("ready",function(){return n.setTimeout(function(){return n.triggerSourceset(r)},1)}),this.trigger({src:r,type:"sourceset"})},t.manualProgressOn=function(){this.on("durationchange",this.onDurationChange_),this.manualProgress=!0,this.one("ready",this.trackProgress_)},t.manualProgressOff=function(){this.manualProgress=!1,this.stopTrackingProgress(),this.off("durationchange",this.onDurationChange_)},t.trackProgress=function(r){this.stopTrackingProgress(),this.progressInterval=this.setInterval(wt(this,function(){var n=this.bufferedPercent();this.bufferedPercent_!==n&&this.trigger("progress"),this.bufferedPercent_=n,n===1&&this.stopTrackingProgress()}),500)},t.onDurationChange=function(r){this.duration_=this.duration()},t.buffered=function(){return ia(0,0)},t.bufferedPercent=function(){return sk(this.buffered(),this.duration_)},t.stopTrackingProgress=function(){this.clearInterval(this.progressInterval)},t.manualTimeUpdatesOn=function(){this.manualTimeUpdates=!0,this.on("play",this.trackCurrentTime_),this.on("pause",this.stopTrackingCurrentTime_)},t.manualTimeUpdatesOff=function(){this.manualTimeUpdates=!1,this.stopTrackingCurrentTime(),this.off("play",this.trackCurrentTime_),this.off("pause",this.stopTrackingCurrentTime_)},t.trackCurrentTime=function(){this.currentTimeInterval&&this.stopTrackingCurrentTime(),this.currentTimeInterval=this.setInterval(function(){this.trigger({type:"timeupdate",target:this,manuallyTriggered:!0})},250)},t.stopTrackingCurrentTime=function(){this.clearInterval(this.currentTimeInterval),this.trigger({type:"timeupdate",target:this,manuallyTriggered:!0})},t.dispose=function(){this.clearTracks(vr.names),this.manualProgress&&this.manualProgressOff(),this.manualTimeUpdates&&this.manualTimeUpdatesOff(),s.prototype.dispose.call(this)},t.clearTracks=function(r){var n=this;r=[].concat(r),r.forEach(function(a){for(var o=n[a+"Tracks"]()||[],l=o.length;l--;){var u=o[l];a==="text"&&n.removeRemoteTextTrack(u),o.removeTrack(u)}})},t.cleanupAutoTextTracks=function(){for(var r=this.autoRemoteTextTracks_||[],n=r.length;n--;){var a=r[n];this.removeRemoteTextTrack(a)}},t.reset=function(){},t.crossOrigin=function(){},t.setCrossOrigin=function(){},t.error=function(r){return r!==void 0&&(this.error_=new Ni(r),this.trigger("error")),this.error_},t.played=function(){return this.hasStarted_?ia(0,0):ia()},t.play=function(){},t.setScrubbing=function(){},t.scrubbing=function(){},t.setCurrentTime=function(){this.manualTimeUpdates&&this.trigger({type:"timeupdate",target:this,manuallyTriggered:!0})},t.initTrackListeners=function(){var r=this;vr.names.forEach(function(n){var a=vr[n],o=function(){r.trigger(n+"trackchange")},l=r[a.getterName]();l.addEventListener("removetrack",o),l.addEventListener("addtrack",o),r.on("dispose",function(){l.removeEventListener("removetrack",o),l.removeEventListener("addtrack",o)})})},t.addWebVttScript_=function(){var r=this;if(!O.WebVTT)if(ce.body.contains(this.el())){if(!this.options_["vtt.js"]&&Jl(ho)&&Object.keys(ho).length>0){this.trigger("vttjsloaded");return}var n=ce.createElement("script");n.src=this.options_["vtt.js"]||"https://vjs.zencdn.net/vttjs/0.14.1/vtt.min.js",n.onload=function(){r.trigger("vttjsloaded")},n.onerror=function(){r.trigger("vttjserror")},this.on("dispose",function(){n.onload=null,n.onerror=null}),O.WebVTT=!0,this.el().parentNode.appendChild(n)}else this.ready(this.addWebVttScript_)},t.emulateTextTracks=function(){var r=this,n=this.textTracks(),a=this.remoteTextTracks(),o=function(d){return n.addTrack(d.track)},l=function(d){return n.removeTrack(d.track)};a.on("addtrack",o),a.on("removetrack",l),this.addWebVttScript_();var u=function(){return r.trigger("texttrackchange")},c=function(){u();for(var d=0;d<n.length;d++){var g=n[d];g.removeEventListener("cuechange",u),g.mode==="showing"&&g.addEventListener("cuechange",u)}};c(),n.addEventListener("change",c),n.addEventListener("addtrack",c),n.addEventListener("removetrack",c),this.on("dispose",function(){a.off("addtrack",o),a.off("removetrack",l),n.removeEventListener("change",c),n.removeEventListener("addtrack",c),n.removeEventListener("removetrack",c);for(var h=0;h<n.length;h++){var d=n[h];d.removeEventListener("cuechange",u)}})},t.addTextTrack=function(r,n,a){if(!r)throw new Error("TextTrack kind is required but was not provided");return S4(this,r,n,a)},t.createRemoteTextTrack=function(r){var n=Et(r,{tech:this});return new Io.remoteTextEl.TrackClass(n)},t.addRemoteTextTrack=function(r,n){var a=this;r===void 0&&(r={});var o=this.createRemoteTextTrack(r);return n!==!0&&n!==!1&&(Qe.warn('Calling addRemoteTextTrack without explicitly setting the "manualCleanup" parameter to `true` is deprecated and default to `false` in future version of video.js'),n=!0),this.remoteTextTrackEls().addTrackElement_(o),this.remoteTextTracks().addTrack(o.track),n!==!0&&this.ready(function(){return a.autoRemoteTextTracks_.addTrack(o.track)}),o},t.removeRemoteTextTrack=function(r){var n=this.remoteTextTrackEls().getTrackElementByTrack_(r);this.remoteTextTrackEls().removeTrackElement_(n),this.remoteTextTracks().removeTrack(r),this.autoRemoteTextTracks_.removeTrack(r)},t.getVideoPlaybackQuality=function(){return{}},t.requestPictureInPicture=function(){var r=this.options_.Promise||O.Promise;if(r)return r.reject()},t.disablePictureInPicture=function(){return!0},t.setDisablePictureInPicture=function(){},t.requestVideoFrameCallback=function(r){var n=this,a=Rn();return!this.isReady_||this.paused()?(this.queuedHanders_.add(a),this.one("playing",function(){n.queuedHanders_.has(a)&&(n.queuedHanders_.delete(a),r())})):this.requestNamedAnimationFrame(a,r),a},t.cancelVideoFrameCallback=function(r){this.queuedHanders_.has(r)?this.queuedHanders_.delete(r):this.cancelNamedAnimationFrame(r)},t.setPoster=function(){},t.playsinline=function(){},t.setPlaysinline=function(){},t.overrideNativeAudioTracks=function(){},t.overrideNativeVideoTracks=function(){},t.canPlayType=function(){return""},e.canPlayType=function(){return""},e.canPlaySource=function(r,n){return e.canPlayType(r.type)},e.isTech=function(r){return r.prototype instanceof e||r instanceof e||r===e},e.registerTech=function(r,n){if(e.techs_||(e.techs_={}),!e.isTech(n))throw new Error("Tech "+r+" must be a Tech");if(!e.canPlayType)throw new Error("Techs must have a static canPlayType method on them");if(!e.canPlaySource)throw new Error("Techs must have a static canPlaySource method on them");return r=zt(r),e.techs_[r]=n,e.techs_[Mc(r)]=n,r!=="Tech"&&e.defaultTechOrder_.push(r),n},e.getTech=function(r){if(r){if(e.techs_&&e.techs_[r])return e.techs_[r];if(r=zt(r),O&&O.videojs&&O.videojs[r])return Qe.warn("The "+r+" tech was added to the videojs object when it should be registered using videojs.registerTech(name, tech)"),O.videojs[r]}},e}(be);ki.names.forEach(function(s){var e=ki[s];yt.prototype[e.getterName]=function(){return this[e.privateName]=this[e.privateName]||new e.ListClass,this[e.privateName]}});yt.prototype.featuresVolumeControl=!0;yt.prototype.featuresMuteControl=!0;yt.prototype.featuresFullscreenResize=!1;yt.prototype.featuresPlaybackRate=!1;yt.prototype.featuresProgressEvents=!1;yt.prototype.featuresSourceset=!1;yt.prototype.featuresTimeupdateEvents=!1;yt.prototype.featuresNativeTextTracks=!1;yt.prototype.featuresVideoFrameCallback=!1;yt.withSourceHandlers=function(s){s.registerSourceHandler=function(t,i){var r=s.sourceHandlers;r||(r=s.sourceHandlers=[]),i===void 0&&(i=r.length),r.splice(i,0,t)},s.canPlayType=function(t){for(var i=s.sourceHandlers||[],r,n=0;n<i.length;n++)if(r=i[n].canPlayType(t),r)return r;return""},s.selectSourceHandler=function(t,i){for(var r=s.sourceHandlers||[],n,a=0;a<r.length;a++)if(n=r[a].canHandleSource(t,i),n)return r[a];return null},s.canPlaySource=function(t,i){var r=s.selectSourceHandler(t,i);return r?r.canHandleSource(t,i):""};var e=["seekable","seeking","duration"];e.forEach(function(t){var i=this[t];typeof i=="function"&&(this[t]=function(){return this.sourceHandler_&&this.sourceHandler_[t]?this.sourceHandler_[t].apply(this.sourceHandler_,arguments):i.apply(this,arguments)})},s.prototype),s.prototype.setSource=function(t){var i=s.selectSourceHandler(t,this.options_);i||(s.nativeSourceHandler?i=s.nativeSourceHandler:Qe.error("No source handler found for the current source.")),this.disposeSourceHandler(),this.off("dispose",this.disposeSourceHandler_),i!==s.nativeSourceHandler&&(this.currentSource_=t),this.sourceHandler_=i.handleSource(t,this,this.options_),this.one("dispose",this.disposeSourceHandler_)},s.prototype.disposeSourceHandler=function(){this.currentSource_&&(this.clearTracks(["audio","video"]),this.currentSource_=null),this.cleanupAutoTextTracks(),this.sourceHandler_&&(this.sourceHandler_.dispose&&this.sourceHandler_.dispose(),this.sourceHandler_=null)}};be.registerComponent("Tech",yt);yt.registerTech("Tech",yt);yt.defaultTechOrder_=[];var ra={},dv={},fh={};function x4(s,e){ra[s]=ra[s]||[],ra[s].push(e)}function C4(s,e,t){s.setTimeout(function(){return Fs(e,ra[e.type],t,s)},1)}function E4(s,e){s.forEach(function(t){return t.setTech&&t.setTech(e)})}function w4(s,e,t){return s.reduceRight(j0(t),e[t]())}function k4(s,e,t,i){return e[t](s.reduce(j0(t),i))}function ab(s,e,t,i){i===void 0&&(i=null);var r="call"+zt(t),n=s.reduce(j0(r),i),a=n===fh,o=a?null:e[t](n);return P4(s,t,o,a),o}var A4={buffered:1,currentTime:1,duration:1,muted:1,played:1,paused:1,seekable:1,volume:1,ended:1},I4={setCurrentTime:1,setMuted:1,setVolume:1},ob={play:1,pause:1};function j0(s){return function(e,t){return e===fh?fh:t[s]?t[s](e):e}}function P4(s,e,t,i){for(var r=s.length-1;r>=0;r--){var n=s[r];n[e]&&n[e](i,t)}}function D4(s){dv[s.id()]=null}function N4(s,e){var t=dv[s.id()],i=null;if(t==null)return i=e(s),dv[s.id()]=[[e,i]],i;for(var r=0;r<t.length;r++){var n=t[r],a=n[0],o=n[1];a===e&&(i=o)}return i===null&&(i=e(s),t.push([e,i])),i}function Fs(s,e,t,i,r,n){s===void 0&&(s={}),e===void 0&&(e=[]),r===void 0&&(r=[]),n===void 0&&(n=!1);var a=e,o=a[0],l=a.slice(1);if(typeof o=="string")Fs(s,ra[o],t,i,r,n);else if(o){var u=N4(i,o);if(!u.setSource)return r.push(u),Fs(s,l,t,i,r,n);u.setSource(jt({},s),function(c,h){if(c)return Fs(s,l,t,i,r,n);r.push(u),Fs(h,s.type===h.type?l:ra[h.type],t,i,r,n)})}else l.length?Fs(s,l,t,i,r,n):n?t(s,r):Fs(s,ra["*"],t,i,r,!0)}var L4={opus:"video/ogg",ogv:"video/ogg",mp4:"video/mp4",mov:"video/mp4",m4v:"video/mp4",mkv:"video/x-matroska",m4a:"audio/mp4",mp3:"audio/mpeg",aac:"audio/aac",caf:"audio/x-caf",flac:"audio/flac",oga:"audio/ogg",wav:"audio/wav",m3u8:"application/x-mpegURL",mpd:"application/dash+xml",jpg:"image/jpeg",jpeg:"image/jpeg",gif:"image/gif",png:"image/png",svg:"image/svg+xml",webp:"image/webp"},ph=function(e){e===void 0&&(e="");var t=$0(e),i=L4[t.toLowerCase()];return i||""},O4=function(e,t){if(!t)return"";if(e.cache_.source.src===t&&e.cache_.source.type)return e.cache_.source.type;var i=e.cache_.sources.filter(function(o){return o.src===t});if(i.length)return i[0].type;for(var r=e.$$("source"),n=0;n<r.length;n++){var a=r[n];if(a.type&&a.src&&a.src===t)return a.type}return ph(t)},M4=function s(e){if(Array.isArray(e)){var t=[];e.forEach(function(i){i=s(i),Array.isArray(i)?t=t.concat(i):Nn(i)&&t.push(i)}),e=t}else typeof e=="string"&&e.trim()?e=[lb({src:e})]:Nn(e)&&typeof e.src=="string"&&e.src&&e.src.trim()?e=[lb(e)]:e=[];return e};function lb(s){if(!s.type){var e=ph(s.src);e&&(s.type=e)}return s}var R4=function(s){Ce(e,s);function e(t,i,r){var n,a=Et({createEl:!1},i);if(n=s.call(this,t,a,r)||this,!i.playerOptions.sources||i.playerOptions.sources.length===0)for(var o=0,l=i.playerOptions.techOrder;o<l.length;o++){var u=zt(l[o]),c=yt.getTech(u);if(u||(c=be.getComponent(u)),c&&c.isSupported()){t.loadTech_(u);break}}else t.src(i.playerOptions.sources);return n}return e}(be);be.registerComponent("MediaLoader",R4);var pd=function(s){Ce(e,s);function e(i,r){var n;return n=s.call(this,i,r)||this,n.options_.controlText&&n.controlText(n.options_.controlText),n.handleMouseOver_=function(a){return n.handleMouseOver(a)},n.handleMouseOut_=function(a){return n.handleMouseOut(a)},n.handleClick_=function(a){return n.handleClick(a)},n.handleKeyDown_=function(a){return n.handleKeyDown(a)},n.emitTapEvents(),n.enable(),n}var t=e.prototype;return t.createEl=function(r,n,a){r===void 0&&(r="div"),n===void 0&&(n={}),a===void 0&&(a={}),n=jt({className:this.buildCSSClass(),tabIndex:0},n),r==="button"&&Qe.error("Creating a ClickableComponent with an HTML element of "+r+" is not supported; use a Button instead."),a=jt({role:"button"},a),this.tabIndex_=n.tabIndex;var o=rt(r,n,a);return o.appendChild(rt("span",{className:"vjs-icon-placeholder"},{"aria-hidden":!0})),this.createControlTextEl(o),o},t.dispose=function(){this.controlTextEl_=null,s.prototype.dispose.call(this)},t.createControlTextEl=function(r){return this.controlTextEl_=rt("span",{className:"vjs-control-text"},{"aria-live":"polite"}),r&&r.appendChild(this.controlTextEl_),this.controlText(this.controlText_,r),this.controlTextEl_},t.controlText=function(r,n){if(n===void 0&&(n=this.el()),r===void 0)return this.controlText_||"Need Text";var a=this.localize(r);this.controlText_=r,ua(this.controlTextEl_,a),!this.nonIconControl&&!this.player_.options_.noUITitleAttributes&&n.setAttribute("title",a)},t.buildCSSClass=function(){return"vjs-control vjs-button "+s.prototype.buildCSSClass.call(this)},t.enable=function(){this.enabled_||(this.enabled_=!0,this.removeClass("vjs-disabled"),this.el_.setAttribute("aria-disabled","false"),typeof this.tabIndex_<"u"&&this.el_.setAttribute("tabIndex",this.tabIndex_),this.on(["tap","click"],this.handleClick_),this.on("keydown",this.handleKeyDown_))},t.disable=function(){this.enabled_=!1,this.addClass("vjs-disabled"),this.el_.setAttribute("aria-disabled","true"),typeof this.tabIndex_<"u"&&this.el_.removeAttribute("tabIndex"),this.off("mouseover",this.handleMouseOver_),this.off("mouseout",this.handleMouseOut_),this.off(["tap","click"],this.handleClick_),this.off("keydown",this.handleKeyDown_)},t.handleLanguagechange=function(){this.controlText(this.controlText_)},t.handleClick=function(r){this.options_.clickHandler&&this.options_.clickHandler.call(this,arguments)},t.handleKeyDown=function(r){Ge.isEventKey(r,"Space")||Ge.isEventKey(r,"Enter")?(r.preventDefault(),r.stopPropagation(),this.trigger("click")):s.prototype.handleKeyDown.call(this,r)},e}(be);be.registerComponent("ClickableComponent",pd);var F4=function(s){Ce(e,s);function e(i,r){var n;return n=s.call(this,i,r)||this,n.update(),n.update_=function(a){return n.update(a)},i.on("posterchange",n.update_),n}var t=e.prototype;return t.dispose=function(){this.player().off("posterchange",this.update_),s.prototype.dispose.call(this)},t.createEl=function(){var r=rt("div",{className:"vjs-poster",tabIndex:-1});return r},t.update=function(r){var n=this.player().poster();this.setSrc(n),n?this.show():this.hide()},t.setSrc=function(r){var n="";r&&(n='url("'+r+'")'),this.el_.style.backgroundImage=n},t.handleClick=function(r){if(this.player_.controls()){var n=this.player_.usingPlugin("eme")&&this.player_.eme.sessions&&this.player_.eme.sessions.length>0;this.player_.tech(!0)&&!((pu||fu)&&n)&&this.player_.tech(!0).focus(),this.player_.paused()?Yr(this.player_.play()):this.player_.pause()}},e}(pd);be.registerComponent("PosterImage",F4);var pr="#222",ub="#ccc",B4={monospace:"monospace",sansSerif:"sans-serif",serif:"serif",monospaceSansSerif:'"Andale Mono", "Lucida Console", monospace',monospaceSerif:'"Courier New", monospace',proportionalSansSerif:"sans-serif",proportionalSerif:"serif",casual:'"Comic Sans MS", Impact, fantasy',script:'"Monotype Corsiva", cursive',smallcaps:'"Andale Mono", "Lucida Console", monospace, sans-serif'};function ap(s,e){var t;if(s.length===4)t=s[1]+s[1]+s[2]+s[2]+s[3]+s[3];else if(s.length===7)t=s.slice(1);else throw new Error("Invalid color code provided, "+s+"; must be formatted as e.g. #f0e or #f604e2.");return"rgba("+parseInt(t.slice(0,2),16)+","+parseInt(t.slice(2,4),16)+","+parseInt(t.slice(4,6),16)+","+e+")"}function op(s,e,t){try{s.style[e]=t}catch{return}}var U4=function(s){Ce(e,s);function e(i,r,n){var a;a=s.call(this,i,r,n)||this;var o=function(u){return a.updateDisplay(u)};return i.on("loadstart",function(l){return a.toggleDisplay(l)}),i.on("texttrackchange",o),i.on("loadedmetadata",function(l){return a.preselectTrack(l)}),i.ready(wt(We(a),function(){if(i.tech_&&i.tech_.featuresNativeTextTracks){this.hide();return}i.on("fullscreenchange",o),i.on("playerresize",o),O.addEventListener("orientationchange",o),i.on("dispose",function(){return O.removeEventListener("orientationchange",o)});for(var l=this.options_.playerOptions.tracks||[],u=0;u<l.length;u++)this.player_.addRemoteTextTrack(l[u],!0);this.preselectTrack()})),a}var t=e.prototype;return t.preselectTrack=function(){for(var r={captions:1,subtitles:1},n=this.player_.textTracks(),a=this.player_.cache_.selectedLanguage,o,l,u,c=0;c<n.length;c++){var h=n[c];a&&a.enabled&&a.language&&a.language===h.language&&h.kind in r?h.kind===a.kind?u=h:u||(u=h):a&&!a.enabled?(u=null,o=null,l=null):h.default&&(h.kind==="descriptions"&&!o?o=h:h.kind in r&&!l&&(l=h))}u?u.mode="showing":l?l.mode="showing":o&&(o.mode="showing")},t.toggleDisplay=function(){this.player_.tech_&&this.player_.tech_.featuresNativeTextTracks?this.hide():this.show()},t.createEl=function(){return s.prototype.createEl.call(this,"div",{className:"vjs-text-track-display"},{translate:"yes","aria-live":"off","aria-atomic":"true"})},t.clearDisplay=function(){typeof O.WebVTT=="function"&&O.WebVTT.processCues(O,[],this.el_)},t.updateDisplay=function(){var r=this.player_.textTracks(),n=this.options_.allowMultipleShowingTracks;if(this.clearDisplay(),n){for(var a=[],o=0;o<r.length;++o){var l=r[o];l.mode==="showing"&&a.push(l)}this.updateForTrack(a);return}for(var u=null,c=null,h=r.length;h--;){var d=r[h];d.mode==="showing"&&(d.kind==="descriptions"?u=d:c=d)}c?(this.getAttribute("aria-live")!=="off"&&this.setAttribute("aria-live","off"),this.updateForTrack(c)):u&&(this.getAttribute("aria-live")!=="assertive"&&this.setAttribute("aria-live","assertive"),this.updateForTrack(u))},t.updateDisplayState=function(r){for(var n=this.player_.textTrackSettings.getValues(),a=r.activeCues,o=a.length;o--;){var l=a[o];if(l){var u=l.displayState;if(n.color&&(u.firstChild.style.color=n.color),n.textOpacity&&op(u.firstChild,"color",ap(n.color||"#fff",n.textOpacity)),n.backgroundColor&&(u.firstChild.style.backgroundColor=n.backgroundColor),n.backgroundOpacity&&op(u.firstChild,"backgroundColor",ap(n.backgroundColor||"#000",n.backgroundOpacity)),n.windowColor&&(n.windowOpacity?op(u,"backgroundColor",ap(n.windowColor,n.windowOpacity)):u.style.backgroundColor=n.windowColor),n.edgeStyle&&(n.edgeStyle==="dropshadow"?u.firstChild.style.textShadow="2px 2px 3px "+pr+", 2px 2px 4px "+pr+", 2px 2px 5px "+pr:n.edgeStyle==="raised"?u.firstChild.style.textShadow="1px 1px "+pr+", 2px 2px "+pr+", 3px 3px "+pr:n.edgeStyle==="depressed"?u.firstChild.style.textShadow="1px 1px "+ub+", 0 1px "+ub+", -1px -1px "+pr+", 0 -1px "+pr:n.edgeStyle==="uniform"&&(u.firstChild.style.textShadow="0 0 4px "+pr+", 0 0 4px "+pr+", 0 0 4px "+pr+", 0 0 4px "+pr)),n.fontPercent&&n.fontPercent!==1){var c=O.parseFloat(u.style.fontSize);u.style.fontSize=c*n.fontPercent+"px",u.style.height="auto",u.style.top="auto"}n.fontFamily&&n.fontFamily!=="default"&&(n.fontFamily==="small-caps"?u.firstChild.style.fontVariant="small-caps":u.firstChild.style.fontFamily=B4[n.fontFamily])}}},t.updateForTrack=function(r){if(Array.isArray(r)||(r=[r]),!(typeof O.WebVTT!="function"||r.every(function(g){return!g.activeCues}))){for(var n=[],a=0;a<r.length;++a)for(var o=r[a],l=0;l<o.activeCues.length;++l)n.push(o.activeCues[l]);O.WebVTT.processCues(O,n,this.el_);for(var u=0;u<r.length;++u){for(var c=r[u],h=0;h<c.activeCues.length;++h){var d=c.activeCues[h].displayState;Pn(d,"vjs-text-track-cue"),Pn(d,"vjs-text-track-cue-"+(c.language?c.language:u)),c.language&&wo(d,"lang",c.language)}this.player_.textTrackSettings&&this.updateDisplayState(c)}}},e}(be);be.registerComponent("TextTrackDisplay",U4);var $4=function(s){Ce(e,s);function e(){return s.apply(this,arguments)||this}var t=e.prototype;return t.createEl=function(){var r=this.player_.isAudio(),n=this.localize(r?"Audio Player":"Video Player"),a=rt("span",{className:"vjs-control-text",textContent:this.localize("{1} is loading.",[n])}),o=s.prototype.createEl.call(this,"div",{className:"vjs-loading-spinner",dir:"ltr"});return o.appendChild(a),o},e}(be);be.registerComponent("LoadingSpinner",$4);var Nr=function(s){Ce(e,s);function e(){return s.apply(this,arguments)||this}var t=e.prototype;return t.createEl=function(r,n,a){n===void 0&&(n={}),a===void 0&&(a={}),r="button",n=jt({className:this.buildCSSClass()},n),a=jt({type:"button"},a);var o=rt(r,n,a);return o.appendChild(rt("span",{className:"vjs-icon-placeholder"},{"aria-hidden":!0})),this.createControlTextEl(o),o},t.addChild=function(r,n){n===void 0&&(n={});var a=this.constructor.name;return Qe.warn("Adding an actionable (user controllable) child to a Button ("+a+") is not supported; use a ClickableComponent instead."),be.prototype.addChild.call(this,r,n)},t.enable=function(){s.prototype.enable.call(this),this.el_.removeAttribute("disabled")},t.disable=function(){s.prototype.disable.call(this),this.el_.setAttribute("disabled","disabled")},t.handleKeyDown=function(r){if(Ge.isEventKey(r,"Space")||Ge.isEventKey(r,"Enter")){r.stopPropagation();return}s.prototype.handleKeyDown.call(this,r)},e}(pd);be.registerComponent("Button",Nr);var dk=function(s){Ce(e,s);function e(i,r){var n;return n=s.call(this,i,r)||this,n.mouseused_=!1,n.on("mousedown",function(a){return n.handleMouseDown(a)}),n}var t=e.prototype;return t.buildCSSClass=function(){return"vjs-big-play-button"},t.handleClick=function(r){var n=this.player_.play();if(this.mouseused_&&r.clientX&&r.clientY){var a=this.player_.usingPlugin("eme")&&this.player_.eme.sessions&&this.player_.eme.sessions.length>0;Yr(n),this.player_.tech(!0)&&!((pu||fu)&&a)&&this.player_.tech(!0).focus();return}var o=this.player_.getChild("controlBar"),l=o&&o.getChild("playToggle");if(!l){this.player_.tech(!0).focus();return}var u=function(){return l.focus()};jl(n)?n.then(u,function(){}):this.setTimeout(u,1)},t.handleKeyDown=function(r){this.mouseused_=!1,s.prototype.handleKeyDown.call(this,r)},t.handleMouseDown=function(r){this.mouseused_=!0},e}(Nr);dk.prototype.controlText_="Play Video";be.registerComponent("BigPlayButton",dk);var j4=function(s){Ce(e,s);function e(i,r){var n;return n=s.call(this,i,r)||this,n.controlText(r&&r.controlText||n.localize("Close")),n}var t=e.prototype;return t.buildCSSClass=function(){return"vjs-close-button "+s.prototype.buildCSSClass.call(this)},t.handleClick=function(r){this.trigger({type:"close",bubbles:!1})},t.handleKeyDown=function(r){Ge.isEventKey(r,"Esc")?(r.preventDefault(),r.stopPropagation(),this.trigger("click")):s.prototype.handleKeyDown.call(this,r)},e}(Nr);be.registerComponent("CloseButton",j4);var fk=function(s){Ce(e,s);function e(i,r){var n;return r===void 0&&(r={}),n=s.call(this,i,r)||this,r.replay=r.replay===void 0||r.replay,n.on(i,"play",function(a){return n.handlePlay(a)}),n.on(i,"pause",function(a){return n.handlePause(a)}),r.replay&&n.on(i,"ended",function(a){return n.handleEnded(a)}),n}var t=e.prototype;return t.buildCSSClass=function(){return"vjs-play-control "+s.prototype.buildCSSClass.call(this)},t.handleClick=function(r){this.player_.paused()?Yr(this.player_.play()):this.player_.pause()},t.handleSeeked=function(r){this.removeClass("vjs-ended"),this.player_.paused()?this.handlePause(r):this.handlePlay(r)},t.handlePlay=function(r){this.removeClass("vjs-ended"),this.removeClass("vjs-paused"),this.addClass("vjs-playing"),this.controlText("Pause")},t.handlePause=function(r){this.removeClass("vjs-playing"),this.addClass("vjs-paused"),this.controlText("Play")},t.handleEnded=function(r){var n=this;this.removeClass("vjs-playing"),this.addClass("vjs-ended"),this.controlText("Replay"),this.one(this.player_,"seeked",function(a){return n.handleSeeked(a)})},e}(Nr);fk.prototype.controlText_="Play";be.registerComponent("PlayToggle",fk);var pk=function(e,t){e=e<0?0:e;var i=Math.floor(e%60),r=Math.floor(e/60%60),n=Math.floor(e/3600),a=Math.floor(t/60%60),o=Math.floor(t/3600);return(isNaN(e)||e===1/0)&&(n=r=i="-"),n=n>0||o>0?n+":":"",r=((n||a>=10)&&r<10?"0"+r:r)+":",i=i<10?"0"+i:i,n+r+i},q0=pk;function q4(s){q0=s}function V4(){q0=pk}function Po(s,e){return e===void 0&&(e=s),q0(s,e)}var Wo=function(s){Ce(e,s);function e(i,r){var n;return n=s.call(this,i,r)||this,n.on(i,["timeupdate","ended"],function(a){return n.updateContent(a)}),n.updateTextNode_(),n}var t=e.prototype;return t.createEl=function(){var r=this.buildCSSClass(),n=s.prototype.createEl.call(this,"div",{className:r+" vjs-time-control vjs-control"}),a=rt("span",{className:"vjs-control-text",textContent:this.localize(this.labelText_)+" "},{role:"presentation"});return n.appendChild(a),this.contentEl_=rt("span",{className:r+"-display"},{"aria-live":"off",role:"presentation"}),n.appendChild(this.contentEl_),n},t.dispose=function(){this.contentEl_=null,this.textNode_=null,s.prototype.dispose.call(this)},t.updateTextNode_=function(r){var n=this;r===void 0&&(r=0),r=Po(r),this.formattedTime_!==r&&(this.formattedTime_=r,this.requestNamedAnimationFrame("TimeDisplay#updateTextNode_",function(){if(n.contentEl_){var a=n.textNode_;a&&n.contentEl_.firstChild!==a&&(a=null,Qe.warn("TimeDisplay#updateTextnode_: Prevented replacement of text node element since it was no longer a child of this node. Appending a new node instead.")),n.textNode_=ce.createTextNode(n.formattedTime_),n.textNode_&&(a?n.contentEl_.replaceChild(n.textNode_,a):n.contentEl_.appendChild(n.textNode_))}}))},t.updateContent=function(r){},e}(be);Wo.prototype.labelText_="Time";Wo.prototype.controlText_="Time";be.registerComponent("TimeDisplay",Wo);var V0=function(s){Ce(e,s);function e(){return s.apply(this,arguments)||this}var t=e.prototype;return t.buildCSSClass=function(){return"vjs-current-time"},t.updateContent=function(r){var n;this.player_.ended()?n=this.player_.duration():n=this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime(),this.updateTextNode_(n)},e}(Wo);V0.prototype.labelText_="Current Time";V0.prototype.controlText_="Current Time";be.registerComponent("CurrentTimeDisplay",V0);var H0=function(s){Ce(e,s);function e(i,r){var n;n=s.call(this,i,r)||this;var a=function(l){return n.updateContent(l)};return n.on(i,"durationchange",a),n.on(i,"loadstart",a),n.on(i,"loadedmetadata",a),n}var t=e.prototype;return t.buildCSSClass=function(){return"vjs-duration"},t.updateContent=function(r){var n=this.player_.duration();this.updateTextNode_(n)},e}(Wo);H0.prototype.labelText_="Duration";H0.prototype.controlText_="Duration";be.registerComponent("DurationDisplay",H0);var H4=function(s){Ce(e,s);function e(){return s.apply(this,arguments)||this}var t=e.prototype;return t.createEl=function(){var r=s.prototype.createEl.call(this,"div",{className:"vjs-time-control vjs-time-divider"},{"aria-hidden":!0}),n=s.prototype.createEl.call(this,"div"),a=s.prototype.createEl.call(this,"span",{textContent:"/"});return n.appendChild(a),r.appendChild(n),r},e}(be);be.registerComponent("TimeDivider",H4);var z0=function(s){Ce(e,s);function e(i,r){var n;return n=s.call(this,i,r)||this,n.on(i,"durationchange",function(a){return n.updateContent(a)}),n}var t=e.prototype;return t.buildCSSClass=function(){return"vjs-remaining-time"},t.createEl=function(){var r=s.prototype.createEl.call(this);return this.options_.displayNegative!==!1&&r.insertBefore(rt("span",{},{"aria-hidden":!0},"-"),this.contentEl_),r},t.updateContent=function(r){if(typeof this.player_.duration()=="number"){var n;this.player_.ended()?n=0:this.player_.remainingTimeDisplay?n=this.player_.remainingTimeDisplay():n=this.player_.remainingTime(),this.updateTextNode_(n)}},e}(Wo);z0.prototype.labelText_="Remaining Time";z0.prototype.controlText_="Remaining Time";be.registerComponent("RemainingTimeDisplay",z0);var z4=function(s){Ce(e,s);function e(i,r){var n;return n=s.call(this,i,r)||this,n.updateShowing(),n.on(n.player(),"durationchange",function(a){return n.updateShowing(a)}),n}var t=e.prototype;return t.createEl=function(){var r=s.prototype.createEl.call(this,"div",{className:"vjs-live-control vjs-control"});return this.contentEl_=rt("div",{className:"vjs-live-display"},{"aria-live":"off"}),this.contentEl_.appendChild(rt("span",{className:"vjs-control-text",textContent:this.localize("Stream Type")+" "})),this.contentEl_.appendChild(ce.createTextNode(this.localize("LIVE"))),r.appendChild(this.contentEl_),r},t.dispose=function(){this.contentEl_=null,s.prototype.dispose.call(this)},t.updateShowing=function(r){this.player().duration()===1/0?this.show():this.hide()},e}(be);be.registerComponent("LiveDisplay",z4);var mk=function(s){Ce(e,s);function e(i,r){var n;return n=s.call(this,i,r)||this,n.updateLiveEdgeStatus(),n.player_.liveTracker&&(n.updateLiveEdgeStatusHandler_=function(a){return n.updateLiveEdgeStatus(a)},n.on(n.player_.liveTracker,"liveedgechange",n.updateLiveEdgeStatusHandler_)),n}var t=e.prototype;return t.createEl=function(){var r=s.prototype.createEl.call(this,"button",{className:"vjs-seek-to-live-control vjs-control"});return this.textEl_=rt("span",{className:"vjs-seek-to-live-text",textContent:this.localize("LIVE")},{"aria-hidden":"true"}),r.appendChild(this.textEl_),r},t.updateLiveEdgeStatus=function(){!this.player_.liveTracker||this.player_.liveTracker.atLiveEdge()?(this.setAttribute("aria-disabled",!0),this.addClass("vjs-at-live-edge"),this.controlText("Seek to live, currently playing live")):(this.setAttribute("aria-disabled",!1),this.removeClass("vjs-at-live-edge"),this.controlText("Seek to live, currently behind live"))},t.handleClick=function(){this.player_.liveTracker.seekToLiveEdge()},t.dispose=function(){this.player_.liveTracker&&this.off(this.player_.liveTracker,"liveedgechange",this.updateLiveEdgeStatusHandler_),this.textEl_=null,s.prototype.dispose.call(this)},e}(Nr);mk.prototype.controlText_="Seek to live, currently playing live";be.registerComponent("SeekToLive",mk);var md=function(e,t,i){return e=Number(e),Math.min(i,Math.max(t,isNaN(e)?t:e))},W0=function(s){Ce(e,s);function e(i,r){var n;return n=s.call(this,i,r)||this,n.handleMouseDown_=function(a){return n.handleMouseDown(a)},n.handleMouseUp_=function(a){return n.handleMouseUp(a)},n.handleKeyDown_=function(a){return n.handleKeyDown(a)},n.handleClick_=function(a){return n.handleClick(a)},n.handleMouseMove_=function(a){return n.handleMouseMove(a)},n.update_=function(a){return n.update(a)},n.bar=n.getChild(n.options_.barName),n.vertical(!!n.options_.vertical),n.enable(),n}var t=e.prototype;return t.enabled=function(){return this.enabled_},t.enable=function(){this.enabled()||(this.on("mousedown",this.handleMouseDown_),this.on("touchstart",this.handleMouseDown_),this.on("keydown",this.handleKeyDown_),this.on("click",this.handleClick_),this.on(this.player_,"controlsvisible",this.update),this.playerEvent&&this.on(this.player_,this.playerEvent,this.update),this.removeClass("disabled"),this.setAttribute("tabindex",0),this.enabled_=!0)},t.disable=function(){if(this.enabled()){var r=this.bar.el_.ownerDocument;this.off("mousedown",this.handleMouseDown_),this.off("touchstart",this.handleMouseDown_),this.off("keydown",this.handleKeyDown_),this.off("click",this.handleClick_),this.off(this.player_,"controlsvisible",this.update_),this.off(r,"mousemove",this.handleMouseMove_),this.off(r,"mouseup",this.handleMouseUp_),this.off(r,"touchmove",this.handleMouseMove_),this.off(r,"touchend",this.handleMouseUp_),this.removeAttribute("tabindex"),this.addClass("disabled"),this.playerEvent&&this.off(this.player_,this.playerEvent,this.update),this.enabled_=!1}},t.createEl=function(r,n,a){return n===void 0&&(n={}),a===void 0&&(a={}),n.className=n.className+" vjs-slider",n=jt({tabIndex:0},n),a=jt({role:"slider","aria-valuenow":0,"aria-valuemin":0,"aria-valuemax":100,tabIndex:0},a),s.prototype.createEl.call(this,r,n,a)},t.handleMouseDown=function(r){var n=this.bar.el_.ownerDocument;r.type==="mousedown"&&r.preventDefault(),r.type==="touchstart"&&!Mn&&r.preventDefault(),Hw(),this.addClass("vjs-sliding"),this.trigger("slideractive"),this.on(n,"mousemove",this.handleMouseMove_),this.on(n,"mouseup",this.handleMouseUp_),this.on(n,"touchmove",this.handleMouseMove_),this.on(n,"touchend",this.handleMouseUp_),this.handleMouseMove(r,!0)},t.handleMouseMove=function(r){},t.handleMouseUp=function(){var r=this.bar.el_.ownerDocument;zw(),this.removeClass("vjs-sliding"),this.trigger("sliderinactive"),this.off(r,"mousemove",this.handleMouseMove_),this.off(r,"mouseup",this.handleMouseUp_),this.off(r,"touchmove",this.handleMouseMove_),this.off(r,"touchend",this.handleMouseUp_),this.update()},t.update=function(){var r=this;if(!(!this.el_||!this.bar)){var n=this.getProgress();return n===this.progress_||(this.progress_=n,this.requestNamedAnimationFrame("Slider#update",function(){var a=r.vertical()?"height":"width";r.bar.el().style[a]=(n*100).toFixed(2)+"%"})),n}},t.getProgress=function(){return Number(md(this.getPercent(),0,1).toFixed(4))},t.calculateDistance=function(r){var n=ud(this.el_,r);return this.vertical()?n.y:n.x},t.handleKeyDown=function(r){Ge.isEventKey(r,"Left")||Ge.isEventKey(r,"Down")?(r.preventDefault(),r.stopPropagation(),this.stepBack()):Ge.isEventKey(r,"Right")||Ge.isEventKey(r,"Up")?(r.preventDefault(),r.stopPropagation(),this.stepForward()):s.prototype.handleKeyDown.call(this,r)},t.handleClick=function(r){r.stopPropagation(),r.preventDefault()},t.vertical=function(r){if(r===void 0)return this.vertical_||!1;this.vertical_=!!r,this.vertical_?this.addClass("vjs-slider-vertical"):this.addClass("vjs-slider-horizontal")},e}(be);be.registerComponent("Slider",W0);var lp=function(e,t){return md(e/t*100,0,100).toFixed(2)+"%"},W4=function(s){Ce(e,s);function e(i,r){var n;return n=s.call(this,i,r)||this,n.partEls_=[],n.on(i,"progress",function(a){return n.update(a)}),n}var t=e.prototype;return t.createEl=function(){var r=s.prototype.createEl.call(this,"div",{className:"vjs-load-progress"}),n=rt("span",{className:"vjs-control-text"}),a=rt("span",{textContent:this.localize("Loaded")}),o=ce.createTextNode(": ");return this.percentageEl_=rt("span",{className:"vjs-control-text-loaded-percentage",textContent:"0%"}),r.appendChild(n),n.appendChild(a),n.appendChild(o),n.appendChild(this.percentageEl_),r},t.dispose=function(){this.partEls_=null,this.percentageEl_=null,s.prototype.dispose.call(this)},t.update=function(r){var n=this;this.requestNamedAnimationFrame("LoadProgressBar#update",function(){var a=n.player_.liveTracker,o=n.player_.buffered(),l=a&&a.isLive()?a.seekableEnd():n.player_.duration(),u=n.player_.bufferedEnd(),c=n.partEls_,h=lp(u,l);n.percent_!==h&&(n.el_.style.width=h,ua(n.percentageEl_,h),n.percent_=h);for(var d=0;d<o.length;d++){var g=o.start(d),y=o.end(d),p=c[d];p||(p=n.el_.appendChild(rt()),c[d]=p),!(p.dataset.start===g&&p.dataset.end===y)&&(p.dataset.start=g,p.dataset.end=y,p.style.left=lp(g,u),p.style.width=lp(y-g,u))}for(var _=c.length;_>o.length;_--)n.el_.removeChild(c[_-1]);c.length=o.length})},e}(be);be.registerComponent("LoadProgressBar",W4);var G4=function(s){Ce(e,s);function e(i,r){var n;return n=s.call(this,i,r)||this,n.update=Ln(wt(We(n),n.update),Lr),n}var t=e.prototype;return t.createEl=function(){return s.prototype.createEl.call(this,"div",{className:"vjs-time-tooltip"},{"aria-hidden":"true"})},t.update=function(r,n,a){var o=eu(this.el_),l=ko(this.player_.el()),u=r.width*n;if(!(!l||!o)){var c=r.left-l.left+u,h=r.width-u+(l.right-r.right),d=o.width/2;c<d?d+=d-c:h<d&&(d=h),d<0?d=0:d>o.width&&(d=o.width),d=Math.round(d),this.el_.style.right="-"+d+"px",this.write(a)}},t.write=function(r){ua(this.el_,r)},t.updateTime=function(r,n,a,o){var l=this;this.requestNamedAnimationFrame("TimeTooltip#updateTime",function(){var u,c=l.player_.duration();if(l.player_.liveTracker&&l.player_.liveTracker.isLive()){var h=l.player_.liveTracker.liveWindow(),d=h-n*h;u=(d<1?"":"-")+Po(d,h)}else u=Po(a,c);l.update(r,n,u),o&&o()})},e}(be);be.registerComponent("TimeTooltip",G4);var G0=function(s){Ce(e,s);function e(i,r){var n;return n=s.call(this,i,r)||this,n.update=Ln(wt(We(n),n.update),Lr),n}var t=e.prototype;return t.createEl=function(){return s.prototype.createEl.call(this,"div",{className:"vjs-play-progress vjs-slider-bar"},{"aria-hidden":"true"})},t.update=function(r,n){var a=this.getChild("timeTooltip");if(a){var o=this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime();a.updateTime(r,n,o)}},e}(be);G0.prototype.options_={children:[]};!Oi&&!On&&G0.prototype.options_.children.push("timeTooltip");be.registerComponent("PlayProgressBar",G0);var gk=function(s){Ce(e,s);function e(i,r){var n;return n=s.call(this,i,r)||this,n.update=Ln(wt(We(n),n.update),Lr),n}var t=e.prototype;return t.createEl=function(){return s.prototype.createEl.call(this,"div",{className:"vjs-mouse-display"})},t.update=function(r,n){var a=this,o=n*this.player_.duration();this.getChild("timeTooltip").updateTime(r,n,o,function(){a.el_.style.left=r.width*n+"px"})},e}(be);gk.prototype.options_={children:["timeTooltip"]};be.registerComponent("MouseTimeDisplay",gk);var mc=5,cb=12,K0=function(s){Ce(e,s);function e(i,r){var n;return n=s.call(this,i,r)||this,n.setEventHandlers_(),n}var t=e.prototype;return t.setEventHandlers_=function(){var r=this;this.update_=wt(this,this.update),this.update=Ln(this.update_,Lr),this.on(this.player_,["ended","durationchange","timeupdate"],this.update),this.player_.liveTracker&&this.on(this.player_.liveTracker,"liveedgechange",this.update),this.updateInterval=null,this.enableIntervalHandler_=function(n){return r.enableInterval_(n)},this.disableIntervalHandler_=function(n){return r.disableInterval_(n)},this.on(this.player_,["playing"],this.enableIntervalHandler_),this.on(this.player_,["ended","pause","waiting"],this.disableIntervalHandler_),"hidden"in ce&&"visibilityState"in ce&&this.on(ce,"visibilitychange",this.toggleVisibility_)},t.toggleVisibility_=function(r){ce.visibilityState==="hidden"?(this.cancelNamedAnimationFrame("SeekBar#update"),this.cancelNamedAnimationFrame("Slider#update"),this.disableInterval_(r)):(!this.player_.ended()&&!this.player_.paused()&&this.enableInterval_(),this.update())},t.enableInterval_=function(){this.updateInterval||(this.updateInterval=this.setInterval(this.update,Lr))},t.disableInterval_=function(r){this.player_.liveTracker&&this.player_.liveTracker.isLive()&&r&&r.type!=="ended"||this.updateInterval&&(this.clearInterval(this.updateInterval),this.updateInterval=null)},t.createEl=function(){return s.prototype.createEl.call(this,"div",{className:"vjs-progress-holder"},{"aria-label":this.localize("Progress Bar")})},t.update=function(r){var n=this;if(ce.visibilityState!=="hidden"){var a=s.prototype.update.call(this);return this.requestNamedAnimationFrame("SeekBar#update",function(){var o=n.player_.ended()?n.player_.duration():n.getCurrentTime_(),l=n.player_.liveTracker,u=n.player_.duration();l&&l.isLive()&&(u=n.player_.liveTracker.liveCurrentTime()),n.percent_!==a&&(n.el_.setAttribute("aria-valuenow",(a*100).toFixed(2)),n.percent_=a),(n.currentTime_!==o||n.duration_!==u)&&(n.el_.setAttribute("aria-valuetext",n.localize("progress bar timing: currentTime={1} duration={2}",[Po(o,u),Po(u,u)],"{1} of {2}")),n.currentTime_=o,n.duration_=u),n.bar&&n.bar.update(ko(n.el()),n.getProgress())}),a}},t.userSeek_=function(r){this.player_.liveTracker&&this.player_.liveTracker.isLive()&&this.player_.liveTracker.nextSeekedFromUser(),this.player_.currentTime(r)},t.getCurrentTime_=function(){return this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime()},t.getPercent=function(){var r=this.getCurrentTime_(),n,a=this.player_.liveTracker;return a&&a.isLive()?(n=(r-a.seekableStart())/a.liveWindow(),a.atLiveEdge()&&(n=1)):n=r/this.player_.duration(),n},t.handleMouseDown=function(r){tu(r)&&(r.stopPropagation(),this.videoWasPlaying=!this.player_.paused(),this.player_.pause(),s.prototype.handleMouseDown.call(this,r))},t.handleMouseMove=function(r,n){if(n===void 0&&(n=!1),!!tu(r)){!n&&!this.player_.scrubbing()&&this.player_.scrubbing(!0);var a,o=this.calculateDistance(r),l=this.player_.liveTracker;if(!l||!l.isLive())a=o*this.player_.duration(),a===this.player_.duration()&&(a=a-.1);else{if(o>=.99){l.seekToLiveEdge();return}var u=l.seekableStart(),c=l.liveCurrentTime();if(a=u+o*l.liveWindow(),a>=c&&(a=c),a<=u&&(a=u+.1),a===1/0)return}this.userSeek_(a)}},t.enable=function(){s.prototype.enable.call(this);var r=this.getChild("mouseTimeDisplay");r&&r.show()},t.disable=function(){s.prototype.disable.call(this);var r=this.getChild("mouseTimeDisplay");r&&r.hide()},t.handleMouseUp=function(r){s.prototype.handleMouseUp.call(this,r),r&&r.stopPropagation(),this.player_.scrubbing(!1),this.player_.trigger({type:"timeupdate",target:this,manuallyTriggered:!0}),this.videoWasPlaying?Yr(this.player_.play()):this.update_()},t.stepForward=function(){this.userSeek_(this.player_.currentTime()+mc)},t.stepBack=function(){this.userSeek_(this.player_.currentTime()-mc)},t.handleAction=function(r){this.player_.paused()?this.player_.play():this.player_.pause()},t.handleKeyDown=function(r){var n=this.player_.liveTracker;if(Ge.isEventKey(r,"Space")||Ge.isEventKey(r,"Enter"))r.preventDefault(),r.stopPropagation(),this.handleAction(r);else if(Ge.isEventKey(r,"Home"))r.preventDefault(),r.stopPropagation(),this.userSeek_(0);else if(Ge.isEventKey(r,"End"))r.preventDefault(),r.stopPropagation(),n&&n.isLive()?this.userSeek_(n.liveCurrentTime()):this.userSeek_(this.player_.duration());else if(/^[0-9]$/.test(Ge(r))){r.preventDefault(),r.stopPropagation();var a=(Ge.codes[Ge(r)]-Ge.codes[0])*10/100;n&&n.isLive()?this.userSeek_(n.seekableStart()+n.liveWindow()*a):this.userSeek_(this.player_.duration()*a)}else Ge.isEventKey(r,"PgDn")?(r.preventDefault(),r.stopPropagation(),this.userSeek_(this.player_.currentTime()-mc*cb)):Ge.isEventKey(r,"PgUp")?(r.preventDefault(),r.stopPropagation(),this.userSeek_(this.player_.currentTime()+mc*cb)):s.prototype.handleKeyDown.call(this,r)},t.dispose=function(){this.disableInterval_(),this.off(this.player_,["ended","durationchange","timeupdate"],this.update),this.player_.liveTracker&&this.off(this.player_.liveTracker,"liveedgechange",this.update),this.off(this.player_,["playing"],this.enableIntervalHandler_),this.off(this.player_,["ended","pause","waiting"],this.disableIntervalHandler_),"hidden"in ce&&"visibilityState"in ce&&this.off(ce,"visibilitychange",this.toggleVisibility_),s.prototype.dispose.call(this)},e}(W0);K0.prototype.options_={children:["loadProgressBar","playProgressBar"],barName:"playProgressBar"};!Oi&&!On&&K0.prototype.options_.children.splice(1,0,"mouseTimeDisplay");be.registerComponent("SeekBar",K0);var vk=function(s){Ce(e,s);function e(i,r){var n;return n=s.call(this,i,r)||this,n.handleMouseMove=Ln(wt(We(n),n.handleMouseMove),Lr),n.throttledHandleMouseSeek=Ln(wt(We(n),n.handleMouseSeek),Lr),n.handleMouseUpHandler_=function(a){return n.handleMouseUp(a)},n.handleMouseDownHandler_=function(a){return n.handleMouseDown(a)},n.enable(),n}var t=e.prototype;return t.createEl=function(){return s.prototype.createEl.call(this,"div",{className:"vjs-progress-control vjs-control"})},t.handleMouseMove=function(r){var n=this.getChild("seekBar");if(n){var a=n.getChild("playProgressBar"),o=n.getChild("mouseTimeDisplay");if(!(!a&&!o)){var l=n.el(),u=eu(l),c=ud(l,r).x;c=md(c,0,1),o&&o.update(u,c),a&&a.update(u,n.getProgress())}}},t.handleMouseSeek=function(r){var n=this.getChild("seekBar");n&&n.handleMouseMove(r)},t.enabled=function(){return this.enabled_},t.disable=function(){if(this.children().forEach(function(n){return n.disable&&n.disable()}),!!this.enabled()&&(this.off(["mousedown","touchstart"],this.handleMouseDownHandler_),this.off(this.el_,"mousemove",this.handleMouseMove),this.removeListenersAddedOnMousedownAndTouchstart(),this.addClass("disabled"),this.enabled_=!1,this.player_.scrubbing())){var r=this.getChild("seekBar");this.player_.scrubbing(!1),r.videoWasPlaying&&Yr(this.player_.play())}},t.enable=function(){this.children().forEach(function(r){return r.enable&&r.enable()}),!this.enabled()&&(this.on(["mousedown","touchstart"],this.handleMouseDownHandler_),this.on(this.el_,"mousemove",this.handleMouseMove),this.removeClass("disabled"),this.enabled_=!0)},t.removeListenersAddedOnMousedownAndTouchstart=function(){var r=this.el_.ownerDocument;this.off(r,"mousemove",this.throttledHandleMouseSeek),this.off(r,"touchmove",this.throttledHandleMouseSeek),this.off(r,"mouseup",this.handleMouseUpHandler_),this.off(r,"touchend",this.handleMouseUpHandler_)},t.handleMouseDown=function(r){var n=this.el_.ownerDocument,a=this.getChild("seekBar");a&&a.handleMouseDown(r),this.on(n,"mousemove",this.throttledHandleMouseSeek),this.on(n,"touchmove",this.throttledHandleMouseSeek),this.on(n,"mouseup",this.handleMouseUpHandler_),this.on(n,"touchend",this.handleMouseUpHandler_)},t.handleMouseUp=function(r){var n=this.getChild("seekBar");n&&n.handleMouseUp(r),this.removeListenersAddedOnMousedownAndTouchstart()},e}(be);vk.prototype.options_={children:["seekBar"]};be.registerComponent("ProgressControl",vk);var yk=function(s){Ce(e,s);function e(i,r){var n;return n=s.call(this,i,r)||this,n.on(i,["enterpictureinpicture","leavepictureinpicture"],function(a){return n.handlePictureInPictureChange(a)}),n.on(i,["disablepictureinpicturechanged","loadedmetadata"],function(a){return n.handlePictureInPictureEnabledChange(a)}),n.on(i,["loadedmetadata","audioonlymodechange","audiopostermodechange"],function(){var a=i.currentType().substring(0,5)==="audio";a||i.audioPosterMode()||i.audioOnlyMode()?(i.isInPictureInPicture()&&i.exitPictureInPicture(),n.hide()):n.show()}),n.disable(),n}var t=e.prototype;return t.buildCSSClass=function(){return"vjs-picture-in-picture-control "+s.prototype.buildCSSClass.call(this)},t.handlePictureInPictureEnabledChange=function(){ce.pictureInPictureEnabled&&this.player_.disablePictureInPicture()===!1?this.enable():this.disable()},t.handlePictureInPictureChange=function(r){this.player_.isInPictureInPicture()?this.controlText("Exit Picture-in-Picture"):this.controlText("Picture-in-Picture"),this.handlePictureInPictureEnabledChange()},t.handleClick=function(r){this.player_.isInPictureInPicture()?this.player_.exitPictureInPicture():this.player_.requestPictureInPicture()},e}(Nr);yk.prototype.controlText_="Picture-in-Picture";be.registerComponent("PictureInPictureToggle",yk);var _k=function(s){Ce(e,s);function e(i,r){var n;return n=s.call(this,i,r)||this,n.on(i,"fullscreenchange",function(a){return n.handleFullscreenChange(a)}),ce[i.fsApi_.fullscreenEnabled]===!1&&n.disable(),n}var t=e.prototype;return t.buildCSSClass=function(){return"vjs-fullscreen-control "+s.prototype.buildCSSClass.call(this)},t.handleFullscreenChange=function(r){this.player_.isFullscreen()?this.controlText("Non-Fullscreen"):this.controlText("Fullscreen")},t.handleClick=function(r){this.player_.isFullscreen()?this.player_.exitFullscreen():this.player_.requestFullscreen()},e}(Nr);_k.prototype.controlText_="Fullscreen";be.registerComponent("FullscreenToggle",_k);var K4=function(e,t){t.tech_&&!t.tech_.featuresVolumeControl&&e.addClass("vjs-hidden"),e.on(t,"loadstart",function(){t.tech_.featuresVolumeControl?e.removeClass("vjs-hidden"):e.addClass("vjs-hidden")})},X4=function(s){Ce(e,s);function e(){return s.apply(this,arguments)||this}var t=e.prototype;return t.createEl=function(){var r=s.prototype.createEl.call(this,"div",{className:"vjs-volume-level"});return r.appendChild(s.prototype.createEl.call(this,"span",{className:"vjs-control-text"})),r},e}(be);be.registerComponent("VolumeLevel",X4);var Q4=function(s){Ce(e,s);function e(i,r){var n;return n=s.call(this,i,r)||this,n.update=Ln(wt(We(n),n.update),Lr),n}var t=e.prototype;return t.createEl=function(){return s.prototype.createEl.call(this,"div",{className:"vjs-volume-tooltip"},{"aria-hidden":"true"})},t.update=function(r,n,a,o){if(!a){var l=ko(this.el_),u=ko(this.player_.el()),c=r.width*n;if(!u||!l)return;var h=r.left-u.left+c,d=r.width-c+(u.right-r.right),g=l.width/2;h<g?g+=g-h:d<g&&(g=d),g<0?g=0:g>l.width&&(g=l.width),this.el_.style.right="-"+g+"px"}this.write(o+"%")},t.write=function(r){ua(this.el_,r)},t.updateVolume=function(r,n,a,o,l){var u=this;this.requestNamedAnimationFrame("VolumeLevelTooltip#updateVolume",function(){u.update(r,n,a,o.toFixed(0)),l&&l()})},e}(be);be.registerComponent("VolumeLevelTooltip",Q4);var Tk=function(s){Ce(e,s);function e(i,r){var n;return n=s.call(this,i,r)||this,n.update=Ln(wt(We(n),n.update),Lr),n}var t=e.prototype;return t.createEl=function(){return s.prototype.createEl.call(this,"div",{className:"vjs-mouse-display"})},t.update=function(r,n,a){var o=this,l=100*n;this.getChild("volumeLevelTooltip").updateVolume(r,n,a,l,function(){a?o.el_.style.bottom=r.height*n+"px":o.el_.style.left=r.width*n+"px"})},e}(be);Tk.prototype.options_={children:["volumeLevelTooltip"]};be.registerComponent("MouseVolumeLevelDisplay",Tk);var gd=function(s){Ce(e,s);function e(i,r){var n;return n=s.call(this,i,r)||this,n.on("slideractive",function(a){return n.updateLastVolume_(a)}),n.on(i,"volumechange",function(a){return n.updateARIAAttributes(a)}),i.ready(function(){return n.updateARIAAttributes()}),n}var t=e.prototype;return t.createEl=function(){return s.prototype.createEl.call(this,"div",{className:"vjs-volume-bar vjs-slider-bar"},{"aria-label":this.localize("Volume Level"),"aria-live":"polite"})},t.handleMouseDown=function(r){tu(r)&&s.prototype.handleMouseDown.call(this,r)},t.handleMouseMove=function(r){var n=this.getChild("mouseVolumeLevelDisplay");if(n){var a=this.el(),o=ko(a),l=this.vertical(),u=ud(a,r);u=l?u.y:u.x,u=md(u,0,1),n.update(o,u,l)}tu(r)&&(this.checkMuted(),this.player_.volume(this.calculateDistance(r)))},t.checkMuted=function(){this.player_.muted()&&this.player_.muted(!1)},t.getPercent=function(){return this.player_.muted()?0:this.player_.volume()},t.stepForward=function(){this.checkMuted(),this.player_.volume(this.player_.volume()+.1)},t.stepBack=function(){this.checkMuted(),this.player_.volume(this.player_.volume()-.1)},t.updateARIAAttributes=function(r){var n=this.player_.muted()?0:this.volumeAsPercentage_();this.el_.setAttribute("aria-valuenow",n),this.el_.setAttribute("aria-valuetext",n+"%")},t.volumeAsPercentage_=function(){return Math.round(this.player_.volume()*100)},t.updateLastVolume_=function(){var r=this,n=this.player_.volume();this.one("sliderinactive",function(){r.player_.volume()===0&&r.player_.lastVolume_(n)})},e}(W0);gd.prototype.options_={children:["volumeLevel"],barName:"volumeLevel"};!Oi&&!On&&gd.prototype.options_.children.splice(0,0,"mouseVolumeLevelDisplay");gd.prototype.playerEvent="volumechange";be.registerComponent("VolumeBar",gd);var bk=function(s){Ce(e,s);function e(i,r){var n;return r===void 0&&(r={}),r.vertical=r.vertical||!1,(typeof r.volumeBar>"u"||Jl(r.volumeBar))&&(r.volumeBar=r.volumeBar||{},r.volumeBar.vertical=r.vertical),n=s.call(this,i,r)||this,K4(We(n),i),n.throttledHandleMouseMove=Ln(wt(We(n),n.handleMouseMove),Lr),n.handleMouseUpHandler_=function(a){return n.handleMouseUp(a)},n.on("mousedown",function(a){return n.handleMouseDown(a)}),n.on("touchstart",function(a){return n.handleMouseDown(a)}),n.on("mousemove",function(a){return n.handleMouseMove(a)}),n.on(n.volumeBar,["focus","slideractive"],function(){n.volumeBar.addClass("vjs-slider-active"),n.addClass("vjs-slider-active"),n.trigger("slideractive")}),n.on(n.volumeBar,["blur","sliderinactive"],function(){n.volumeBar.removeClass("vjs-slider-active"),n.removeClass("vjs-slider-active"),n.trigger("sliderinactive")}),n}var t=e.prototype;return t.createEl=function(){var r="vjs-volume-horizontal";return this.options_.vertical&&(r="vjs-volume-vertical"),s.prototype.createEl.call(this,"div",{className:"vjs-volume-control vjs-control "+r})},t.handleMouseDown=function(r){var n=this.el_.ownerDocument;this.on(n,"mousemove",this.throttledHandleMouseMove),this.on(n,"touchmove",this.throttledHandleMouseMove),this.on(n,"mouseup",this.handleMouseUpHandler_),this.on(n,"touchend",this.handleMouseUpHandler_)},t.handleMouseUp=function(r){var n=this.el_.ownerDocument;this.off(n,"mousemove",this.throttledHandleMouseMove),this.off(n,"touchmove",this.throttledHandleMouseMove),this.off(n,"mouseup",this.handleMouseUpHandler_),this.off(n,"touchend",this.handleMouseUpHandler_)},t.handleMouseMove=function(r){this.volumeBar.handleMouseMove(r)},e}(be);bk.prototype.options_={children:["volumeBar"]};be.registerComponent("VolumeControl",bk);var Y4=function(e,t){t.tech_&&!t.tech_.featuresMuteControl&&e.addClass("vjs-hidden"),e.on(t,"loadstart",function(){t.tech_.featuresMuteControl?e.removeClass("vjs-hidden"):e.addClass("vjs-hidden")})},Sk=function(s){Ce(e,s);function e(i,r){var n;return n=s.call(this,i,r)||this,Y4(We(n),i),n.on(i,["loadstart","volumechange"],function(a){return n.update(a)}),n}var t=e.prototype;return t.buildCSSClass=function(){return"vjs-mute-control "+s.prototype.buildCSSClass.call(this)},t.handleClick=function(r){var n=this.player_.volume(),a=this.player_.lastVolume_();if(n===0){var o=a<.1?.1:a;this.player_.volume(o),this.player_.muted(!1)}else this.player_.muted(!this.player_.muted())},t.update=function(r){this.updateIcon_(),this.updateControlText_()},t.updateIcon_=function(){var r=this.player_.volume(),n=3;Oi&&this.player_.tech_&&this.player_.tech_.el_&&this.player_.muted(this.player_.tech_.el_.muted),r===0||this.player_.muted()?n=0:r<.33?n=1:r<.67&&(n=2);for(var a=0;a<4;a++)mu(this.el_,"vjs-vol-"+a);Pn(this.el_,"vjs-vol-"+n)},t.updateControlText_=function(){var r=this.player_.muted()||this.player_.volume()===0,n=r?"Unmute":"Mute";this.controlText()!==n&&this.controlText(n)},e}(Nr);Sk.prototype.controlText_="Mute";be.registerComponent("MuteToggle",Sk);var xk=function(s){Ce(e,s);function e(i,r){var n;return r===void 0&&(r={}),typeof r.inline<"u"?r.inline=r.inline:r.inline=!0,(typeof r.volumeControl>"u"||Jl(r.volumeControl))&&(r.volumeControl=r.volumeControl||{},r.volumeControl.vertical=!r.inline),n=s.call(this,i,r)||this,n.handleKeyPressHandler_=function(a){return n.handleKeyPress(a)},n.on(i,["loadstart"],function(a){return n.volumePanelState_(a)}),n.on(n.muteToggle,"keyup",function(a){return n.handleKeyPress(a)}),n.on(n.volumeControl,"keyup",function(a){return n.handleVolumeControlKeyUp(a)}),n.on("keydown",function(a){return n.handleKeyPress(a)}),n.on("mouseover",function(a){return n.handleMouseOver(a)}),n.on("mouseout",function(a){return n.handleMouseOut(a)}),n.on(n.volumeControl,["slideractive"],n.sliderActive_),n.on(n.volumeControl,["sliderinactive"],n.sliderInactive_),n}var t=e.prototype;return t.sliderActive_=function(){this.addClass("vjs-slider-active")},t.sliderInactive_=function(){this.removeClass("vjs-slider-active")},t.volumePanelState_=function(){this.volumeControl.hasClass("vjs-hidden")&&this.muteToggle.hasClass("vjs-hidden")&&this.addClass("vjs-hidden"),this.volumeControl.hasClass("vjs-hidden")&&!this.muteToggle.hasClass("vjs-hidden")&&this.addClass("vjs-mute-toggle-only")},t.createEl=function(){var r="vjs-volume-panel-horizontal";return this.options_.inline||(r="vjs-volume-panel-vertical"),s.prototype.createEl.call(this,"div",{className:"vjs-volume-panel vjs-control "+r})},t.dispose=function(){this.handleMouseOut(),s.prototype.dispose.call(this)},t.handleVolumeControlKeyUp=function(r){Ge.isEventKey(r,"Esc")&&this.muteToggle.focus()},t.handleMouseOver=function(r){this.addClass("vjs-hover"),or(ce,"keyup",this.handleKeyPressHandler_)},t.handleMouseOut=function(r){this.removeClass("vjs-hover"),Ti(ce,"keyup",this.handleKeyPressHandler_)},t.handleKeyPress=function(r){Ge.isEventKey(r,"Esc")&&this.handleMouseOut()},e}(be);xk.prototype.options_={children:["muteToggle","volumeControl"]};be.registerComponent("VolumePanel",xk);var Ck=function(s){Ce(e,s);function e(i,r){var n;return n=s.call(this,i,r)||this,r&&(n.menuButton_=r.menuButton),n.focusedChild_=-1,n.on("keydown",function(a){return n.handleKeyDown(a)}),n.boundHandleBlur_=function(a){return n.handleBlur(a)},n.boundHandleTapClick_=function(a){return n.handleTapClick(a)},n}var t=e.prototype;return t.addEventListenerForItem=function(r){r instanceof be&&(this.on(r,"blur",this.boundHandleBlur_),this.on(r,["tap","click"],this.boundHandleTapClick_))},t.removeEventListenerForItem=function(r){r instanceof be&&(this.off(r,"blur",this.boundHandleBlur_),this.off(r,["tap","click"],this.boundHandleTapClick_))},t.removeChild=function(r){typeof r=="string"&&(r=this.getChild(r)),this.removeEventListenerForItem(r),s.prototype.removeChild.call(this,r)},t.addItem=function(r){var n=this.addChild(r);n&&this.addEventListenerForItem(n)},t.createEl=function(){var r=this.options_.contentElType||"ul";this.contentEl_=rt(r,{className:"vjs-menu-content"}),this.contentEl_.setAttribute("role","menu");var n=s.prototype.createEl.call(this,"div",{append:this.contentEl_,className:"vjs-menu"});return n.appendChild(this.contentEl_),or(n,"click",function(a){a.preventDefault(),a.stopImmediatePropagation()}),n},t.dispose=function(){this.contentEl_=null,this.boundHandleBlur_=null,this.boundHandleTapClick_=null,s.prototype.dispose.call(this)},t.handleBlur=function(r){var n=r.relatedTarget||ce.activeElement;if(!this.children().some(function(o){return o.el()===n})){var a=this.menuButton_;a&&a.buttonPressed_&&n!==a.el().firstChild&&a.unpressButton()}},t.handleTapClick=function(r){if(this.menuButton_){this.menuButton_.unpressButton();var n=this.children();if(!Array.isArray(n))return;var a=n.filter(function(o){return o.el()===r.target})[0];if(!a)return;a.name()!=="CaptionSettingsMenuItem"&&this.menuButton_.focus()}},t.handleKeyDown=function(r){Ge.isEventKey(r,"Left")||Ge.isEventKey(r,"Down")?(r.preventDefault(),r.stopPropagation(),this.stepForward()):(Ge.isEventKey(r,"Right")||Ge.isEventKey(r,"Up"))&&(r.preventDefault(),r.stopPropagation(),this.stepBack())},t.stepForward=function(){var r=0;this.focusedChild_!==void 0&&(r=this.focusedChild_+1),this.focus(r)},t.stepBack=function(){var r=0;this.focusedChild_!==void 0&&(r=this.focusedChild_-1),this.focus(r)},t.focus=function(r){r===void 0&&(r=0);var n=this.children().slice(),a=n.length&&n[0].hasClass("vjs-menu-title");a&&n.shift(),n.length>0&&(r<0?r=0:r>=n.length&&(r=n.length-1),this.focusedChild_=r,n[r].el_.focus())},e}(be);be.registerComponent("Menu",Ck);var X0=function(s){Ce(e,s);function e(i,r){var n;r===void 0&&(r={}),n=s.call(this,i,r)||this,n.menuButton_=new Nr(i,r),n.menuButton_.controlText(n.controlText_),n.menuButton_.el_.setAttribute("aria-haspopup","true");var a=Nr.prototype.buildCSSClass();n.menuButton_.el_.className=n.buildCSSClass()+" "+a,n.menuButton_.removeClass("vjs-control"),n.addChild(n.menuButton_),n.update(),n.enabled_=!0;var o=function(u){return n.handleClick(u)};return n.handleMenuKeyUp_=function(l){return n.handleMenuKeyUp(l)},n.on(n.menuButton_,"tap",o),n.on(n.menuButton_,"click",o),n.on(n.menuButton_,"keydown",function(l){return n.handleKeyDown(l)}),n.on(n.menuButton_,"mouseenter",function(){n.addClass("vjs-hover"),n.menu.show(),or(ce,"keyup",n.handleMenuKeyUp_)}),n.on("mouseleave",function(l){return n.handleMouseLeave(l)}),n.on("keydown",function(l){return n.handleSubmenuKeyDown(l)}),n}var t=e.prototype;return t.update=function(){var r=this.createMenu();this.menu&&(this.menu.dispose(),this.removeChild(this.menu)),this.menu=r,this.addChild(r),this.buttonPressed_=!1,this.menuButton_.el_.setAttribute("aria-expanded","false"),this.items&&this.items.length<=this.hideThreshold_?(this.hide(),this.menu.contentEl_.removeAttribute("role")):(this.show(),this.menu.contentEl_.setAttribute("role","menu"))},t.createMenu=function(){var r=new Ck(this.player_,{menuButton:this});if(this.hideThreshold_=0,this.options_.title){var n=rt("li",{className:"vjs-menu-title",textContent:zt(this.options_.title),tabIndex:-1}),a=new be(this.player_,{el:n});r.addItem(a)}if(this.items=this.createItems(),this.items)for(var o=0;o<this.items.length;o++)r.addItem(this.items[o]);return r},t.createItems=function(){},t.createEl=function(){return s.prototype.createEl.call(this,"div",{className:this.buildWrapperCSSClass()},{})},t.buildWrapperCSSClass=function(){var r="vjs-menu-button";this.options_.inline===!0?r+="-inline":r+="-popup";var n=Nr.prototype.buildCSSClass();return"vjs-menu-button "+r+" "+n+" "+s.prototype.buildCSSClass.call(this)},t.buildCSSClass=function(){var r="vjs-menu-button";return this.options_.inline===!0?r+="-inline":r+="-popup","vjs-menu-button "+r+" "+s.prototype.buildCSSClass.call(this)},t.controlText=function(r,n){return n===void 0&&(n=this.menuButton_.el()),this.menuButton_.controlText(r,n)},t.dispose=function(){this.handleMouseLeave(),s.prototype.dispose.call(this)},t.handleClick=function(r){this.buttonPressed_?this.unpressButton():this.pressButton()},t.handleMouseLeave=function(r){this.removeClass("vjs-hover"),Ti(ce,"keyup",this.handleMenuKeyUp_)},t.focus=function(){this.menuButton_.focus()},t.blur=function(){this.menuButton_.blur()},t.handleKeyDown=function(r){Ge.isEventKey(r,"Esc")||Ge.isEventKey(r,"Tab")?(this.buttonPressed_&&this.unpressButton(),Ge.isEventKey(r,"Tab")||(r.preventDefault(),this.menuButton_.focus())):(Ge.isEventKey(r,"Up")||Ge.isEventKey(r,"Down"))&&(this.buttonPressed_||(r.preventDefault(),this.pressButton()))},t.handleMenuKeyUp=function(r){(Ge.isEventKey(r,"Esc")||Ge.isEventKey(r,"Tab"))&&this.removeClass("vjs-hover")},t.handleSubmenuKeyPress=function(r){this.handleSubmenuKeyDown(r)},t.handleSubmenuKeyDown=function(r){(Ge.isEventKey(r,"Esc")||Ge.isEventKey(r,"Tab"))&&(this.buttonPressed_&&this.unpressButton(),Ge.isEventKey(r,"Tab")||(r.preventDefault(),this.menuButton_.focus()))},t.pressButton=function(){if(this.enabled_){if(this.buttonPressed_=!0,this.menu.show(),this.menu.lockShowing(),this.menuButton_.el_.setAttribute("aria-expanded","true"),Oi&&Uw())return;this.menu.focus()}},t.unpressButton=function(){this.enabled_&&(this.buttonPressed_=!1,this.menu.unlockShowing(),this.menu.hide(),this.menuButton_.el_.setAttribute("aria-expanded","false"))},t.disable=function(){this.unpressButton(),this.enabled_=!1,this.addClass("vjs-disabled"),this.menuButton_.disable()},t.enable=function(){this.enabled_=!0,this.removeClass("vjs-disabled"),this.menuButton_.enable()},e}(be);be.registerComponent("MenuButton",X0);var Q0=function(s){Ce(e,s);function e(t,i){var r,n=i.tracks;if(r=s.call(this,t,i)||this,r.items.length<=1&&r.hide(),!n)return We(r);var a=wt(We(r),r.update);return n.addEventListener("removetrack",a),n.addEventListener("addtrack",a),n.addEventListener("labelchange",a),r.player_.on("ready",a),r.player_.on("dispose",function(){n.removeEventListener("removetrack",a),n.removeEventListener("addtrack",a),n.removeEventListener("labelchange",a)}),r}return e}(X0);be.registerComponent("TrackButton",Q0);var J4=["Tab","Esc","Up","Down","Right","Left"],vu=function(s){Ce(e,s);function e(i,r){var n;return n=s.call(this,i,r)||this,n.selectable=r.selectable,n.isSelected_=r.selected||!1,n.multiSelectable=r.multiSelectable,n.selected(n.isSelected_),n.selectable?n.multiSelectable?n.el_.setAttribute("role","menuitemcheckbox"):n.el_.setAttribute("role","menuitemradio"):n.el_.setAttribute("role","menuitem"),n}var t=e.prototype;return t.createEl=function(r,n,a){this.nonIconControl=!0;var o=s.prototype.createEl.call(this,"li",jt({className:"vjs-menu-item",tabIndex:-1},n),a);return o.replaceChild(rt("span",{className:"vjs-menu-item-text",textContent:this.localize(this.options_.label)}),o.querySelector(".vjs-icon-placeholder")),o},t.handleKeyDown=function(r){J4.some(function(n){return Ge.isEventKey(r,n)})||s.prototype.handleKeyDown.call(this,r)},t.handleClick=function(r){this.selected(!0)},t.selected=function(r){this.selectable&&(r?(this.addClass("vjs-selected"),this.el_.setAttribute("aria-checked","true"),this.controlText(", selected"),this.isSelected_=!0):(this.removeClass("vjs-selected"),this.el_.setAttribute("aria-checked","false"),this.controlText(""),this.isSelected_=!1))},e}(pd);be.registerComponent("MenuItem",vu);var yu=function(s){Ce(e,s);function e(i,r){var n,a=r.track,o=i.textTracks();r.label=a.label||a.language||"Unknown",r.selected=a.mode==="showing",n=s.call(this,i,r)||this,n.track=a,n.kinds=(r.kinds||[r.kind||n.track.kind]).filter(Boolean);var l=function(){for(var d=arguments.length,g=new Array(d),y=0;y<d;y++)g[y]=arguments[y];n.handleTracksChange.apply(We(n),g)},u=function(){for(var d=arguments.length,g=new Array(d),y=0;y<d;y++)g[y]=arguments[y];n.handleSelectedLanguageChange.apply(We(n),g)};if(i.on(["loadstart","texttrackchange"],l),o.addEventListener("change",l),o.addEventListener("selectedlanguagechange",u),n.on("dispose",function(){i.off(["loadstart","texttrackchange"],l),o.removeEventListener("change",l),o.removeEventListener("selectedlanguagechange",u)}),o.onchange===void 0){var c;n.on(["tap","click"],function(){if(typeof O.Event!="object")try{c=new O.Event("change")}catch{}c||(c=ce.createEvent("Event"),c.initEvent("change",!0,!0)),o.dispatchEvent(c)})}return n.handleTracksChange(),n}var t=e.prototype;return t.handleClick=function(r){var n=this.track,a=this.player_.textTracks();if(s.prototype.handleClick.call(this,r),!!a)for(var o=0;o<a.length;o++){var l=a[o];this.kinds.indexOf(l.kind)!==-1&&(l===n?l.mode!=="showing"&&(l.mode="showing"):l.mode!=="disabled"&&(l.mode="disabled"))}},t.handleTracksChange=function(r){var n=this.track.mode==="showing";n!==this.isSelected_&&this.selected(n)},t.handleSelectedLanguageChange=function(r){if(this.track.mode==="showing"){var n=this.player_.cache_.selectedLanguage;if(n&&n.enabled&&n.language===this.track.language&&n.kind!==this.track.kind)return;this.player_.cache_.selectedLanguage={enabled:!0,language:this.track.language,kind:this.track.kind}}},t.dispose=function(){this.track=null,s.prototype.dispose.call(this)},e}(vu);be.registerComponent("TextTrackMenuItem",yu);var Ek=function(s){Ce(e,s);function e(i,r){return r.track={player:i,kind:r.kind,kinds:r.kinds,default:!1,mode:"disabled"},r.kinds||(r.kinds=[r.kind]),r.label?r.track.label=r.label:r.track.label=r.kinds.join(" and ")+" off",r.selectable=!0,r.multiSelectable=!1,s.call(this,i,r)||this}var t=e.prototype;return t.handleTracksChange=function(r){for(var n=this.player().textTracks(),a=!0,o=0,l=n.length;o<l;o++){var u=n[o];if(this.options_.kinds.indexOf(u.kind)>-1&&u.mode==="showing"){a=!1;break}}a!==this.isSelected_&&this.selected(a)},t.handleSelectedLanguageChange=function(r){for(var n=this.player().textTracks(),a=!0,o=0,l=n.length;o<l;o++){var u=n[o];if(["captions","descriptions","subtitles"].indexOf(u.kind)>-1&&u.mode==="showing"){a=!1;break}}a&&(this.player_.cache_.selectedLanguage={enabled:!1})},e}(yu);be.registerComponent("OffTextTrackMenuItem",Ek);var Go=function(s){Ce(e,s);function e(i,r){return r===void 0&&(r={}),r.tracks=i.textTracks(),s.call(this,i,r)||this}var t=e.prototype;return t.createItems=function(r,n){r===void 0&&(r=[]),n===void 0&&(n=yu);var a;this.label_&&(a=this.label_+" off"),r.push(new Ek(this.player_,{kinds:this.kinds_,kind:this.kind_,label:a})),this.hideThreshold_+=1;var o=this.player_.textTracks();Array.isArray(this.kinds_)||(this.kinds_=[this.kind_]);for(var l=0;l<o.length;l++){var u=o[l];if(this.kinds_.indexOf(u.kind)>-1){var c=new n(this.player_,{track:u,kinds:this.kinds_,kind:this.kind_,selectable:!0,multiSelectable:!1});c.addClass("vjs-"+u.kind+"-menu-item"),r.push(c)}}return r},e}(Q0);be.registerComponent("TextTrackButton",Go);var wk=function(s){Ce(e,s);function e(i,r){var n,a=r.track,o=r.cue,l=i.currentTime();return r.selectable=!0,r.multiSelectable=!1,r.label=o.text,r.selected=o.startTime<=l&&l<o.endTime,n=s.call(this,i,r)||this,n.track=a,n.cue=o,n}var t=e.prototype;return t.handleClick=function(r){s.prototype.handleClick.call(this),this.player_.currentTime(this.cue.startTime)},e}(vu);be.registerComponent("ChaptersTrackMenuItem",wk);var Y0=function(s){Ce(e,s);function e(i,r,n){var a;return a=s.call(this,i,r,n)||this,a.selectCurrentItem_=function(){a.items.forEach(function(o){o.selected(a.track_.activeCues[0]===o.cue)})},a}var t=e.prototype;return t.buildCSSClass=function(){return"vjs-chapters-button "+s.prototype.buildCSSClass.call(this)},t.buildWrapperCSSClass=function(){return"vjs-chapters-button "+s.prototype.buildWrapperCSSClass.call(this)},t.update=function(r){if(!(r&&r.track&&r.track.kind!=="chapters")){var n=this.findChaptersTrack();n!==this.track_?(this.setTrack(n),s.prototype.update.call(this)):(!this.items||n&&n.cues&&n.cues.length!==this.items.length)&&s.prototype.update.call(this)}},t.setTrack=function(r){if(this.track_!==r){if(this.updateHandler_||(this.updateHandler_=this.update.bind(this)),this.track_){var n=this.player_.remoteTextTrackEls().getTrackElementByTrack_(this.track_);n&&n.removeEventListener("load",this.updateHandler_),this.track_.removeEventListener("cuechange",this.selectCurrentItem_),this.track_=null}if(this.track_=r,this.track_){this.track_.mode="hidden";var a=this.player_.remoteTextTrackEls().getTrackElementByTrack_(this.track_);a&&a.addEventListener("load",this.updateHandler_),this.track_.addEventListener("cuechange",this.selectCurrentItem_)}}},t.findChaptersTrack=function(){for(var r=this.player_.textTracks()||[],n=r.length-1;n>=0;n--){var a=r[n];if(a.kind===this.kind_)return a}},t.getMenuCaption=function(){return this.track_&&this.track_.label?this.track_.label:this.localize(zt(this.kind_))},t.createMenu=function(){return this.options_.title=this.getMenuCaption(),s.prototype.createMenu.call(this)},t.createItems=function(){var r=[];if(!this.track_)return r;var n=this.track_.cues;if(!n)return r;for(var a=0,o=n.length;a<o;a++){var l=n[a],u=new wk(this.player_,{track:this.track_,cue:l});r.push(u)}return r},e}(Go);Y0.prototype.kind_="chapters";Y0.prototype.controlText_="Chapters";be.registerComponent("ChaptersButton",Y0);var J0=function(s){Ce(e,s);function e(i,r,n){var a;a=s.call(this,i,r,n)||this;var o=i.textTracks(),l=wt(We(a),a.handleTracksChange);return o.addEventListener("change",l),a.on("dispose",function(){o.removeEventListener("change",l)}),a}var t=e.prototype;return t.handleTracksChange=function(r){for(var n=this.player().textTracks(),a=!1,o=0,l=n.length;o<l;o++){var u=n[o];if(u.kind!==this.kind_&&u.mode==="showing"){a=!0;break}}a?this.disable():this.enable()},t.buildCSSClass=function(){return"vjs-descriptions-button "+s.prototype.buildCSSClass.call(this)},t.buildWrapperCSSClass=function(){return"vjs-descriptions-button "+s.prototype.buildWrapperCSSClass.call(this)},e}(Go);J0.prototype.kind_="descriptions";J0.prototype.controlText_="Descriptions";be.registerComponent("DescriptionsButton",J0);var Z0=function(s){Ce(e,s);function e(i,r,n){return s.call(this,i,r,n)||this}var t=e.prototype;return t.buildCSSClass=function(){return"vjs-subtitles-button "+s.prototype.buildCSSClass.call(this)},t.buildWrapperCSSClass=function(){return"vjs-subtitles-button "+s.prototype.buildWrapperCSSClass.call(this)},e}(Go);Z0.prototype.kind_="subtitles";Z0.prototype.controlText_="Subtitles";be.registerComponent("SubtitlesButton",Z0);var ey=function(s){Ce(e,s);function e(i,r){var n;return r.track={player:i,kind:r.kind,label:r.kind+" settings",selectable:!1,default:!1,mode:"disabled"},r.selectable=!1,r.name="CaptionSettingsMenuItem",n=s.call(this,i,r)||this,n.addClass("vjs-texttrack-settings"),n.controlText(", opens "+r.kind+" settings dialog"),n}var t=e.prototype;return t.handleClick=function(r){this.player().getChild("textTrackSettings").open()},e}(yu);be.registerComponent("CaptionSettingsMenuItem",ey);var ty=function(s){Ce(e,s);function e(i,r,n){return s.call(this,i,r,n)||this}var t=e.prototype;return t.buildCSSClass=function(){return"vjs-captions-button "+s.prototype.buildCSSClass.call(this)},t.buildWrapperCSSClass=function(){return"vjs-captions-button "+s.prototype.buildWrapperCSSClass.call(this)},t.createItems=function(){var r=[];return!(this.player().tech_&&this.player().tech_.featuresNativeTextTracks)&&this.player().getChild("textTrackSettings")&&(r.push(new ey(this.player_,{kind:this.kind_})),this.hideThreshold_+=1),s.prototype.createItems.call(this,r)},e}(Go);ty.prototype.kind_="captions";ty.prototype.controlText_="Captions";be.registerComponent("CaptionsButton",ty);var kk=function(s){Ce(e,s);function e(){return s.apply(this,arguments)||this}var t=e.prototype;return t.createEl=function(r,n,a){var o=s.prototype.createEl.call(this,r,n,a),l=o.querySelector(".vjs-menu-item-text");return this.options_.track.kind==="captions"&&(l.appendChild(rt("span",{className:"vjs-icon-placeholder"},{"aria-hidden":!0})),l.appendChild(rt("span",{className:"vjs-control-text",textContent:" "+this.localize("Captions")}))),o},e}(yu);be.registerComponent("SubsCapsMenuItem",kk);var iy=function(s){Ce(e,s);function e(i,r){var n;return r===void 0&&(r={}),n=s.call(this,i,r)||this,n.label_="subtitles",["en","en-us","en-ca","fr-ca"].indexOf(n.player_.language_)>-1&&(n.label_="captions"),n.menuButton_.controlText(zt(n.label_)),n}var t=e.prototype;return t.buildCSSClass=function(){return"vjs-subs-caps-button "+s.prototype.buildCSSClass.call(this)},t.buildWrapperCSSClass=function(){return"vjs-subs-caps-button "+s.prototype.buildWrapperCSSClass.call(this)},t.createItems=function(){var r=[];return!(this.player().tech_&&this.player().tech_.featuresNativeTextTracks)&&this.player().getChild("textTrackSettings")&&(r.push(new ey(this.player_,{kind:this.label_})),this.hideThreshold_+=1),r=s.prototype.createItems.call(this,r,kk),r},e}(Go);iy.prototype.kinds_=["captions","subtitles"];iy.prototype.controlText_="Subtitles";be.registerComponent("SubsCapsButton",iy);var Ak=function(s){Ce(e,s);function e(i,r){var n,a=r.track,o=i.audioTracks();r.label=a.label||a.language||"Unknown",r.selected=a.enabled,n=s.call(this,i,r)||this,n.track=a,n.addClass("vjs-"+a.kind+"-menu-item");var l=function(){for(var c=arguments.length,h=new Array(c),d=0;d<c;d++)h[d]=arguments[d];n.handleTracksChange.apply(We(n),h)};return o.addEventListener("change",l),n.on("dispose",function(){o.removeEventListener("change",l)}),n}var t=e.prototype;return t.createEl=function(r,n,a){var o=s.prototype.createEl.call(this,r,n,a),l=o.querySelector(".vjs-menu-item-text");return this.options_.track.kind==="main-desc"&&(l.appendChild(rt("span",{className:"vjs-icon-placeholder"},{"aria-hidden":!0})),l.appendChild(rt("span",{className:"vjs-control-text",textContent:" "+this.localize("Descriptions")}))),o},t.handleClick=function(r){if(s.prototype.handleClick.call(this,r),this.track.enabled=!0,this.player_.tech_.featuresNativeAudioTracks)for(var n=this.player_.audioTracks(),a=0;a<n.length;a++){var o=n[a];o!==this.track&&(o.enabled=o===this.track)}},t.handleTracksChange=function(r){this.selected(this.track.enabled)},e}(vu);be.registerComponent("AudioTrackMenuItem",Ak);var Ik=function(s){Ce(e,s);function e(i,r){return r===void 0&&(r={}),r.tracks=i.audioTracks(),s.call(this,i,r)||this}var t=e.prototype;return t.buildCSSClass=function(){return"vjs-audio-button "+s.prototype.buildCSSClass.call(this)},t.buildWrapperCSSClass=function(){return"vjs-audio-button "+s.prototype.buildWrapperCSSClass.call(this)},t.createItems=function(r){r===void 0&&(r=[]),this.hideThreshold_=1;for(var n=this.player_.audioTracks(),a=0;a<n.length;a++){var o=n[a];r.push(new Ak(this.player_,{track:o,selectable:!0,multiSelectable:!1}))}return r},e}(Q0);Ik.prototype.controlText_="Audio Track";be.registerComponent("AudioTrackButton",Ik);var ry=function(s){Ce(e,s);function e(i,r){var n,a=r.rate,o=parseFloat(a,10);return r.label=a,r.selected=o===i.playbackRate(),r.selectable=!0,r.multiSelectable=!1,n=s.call(this,i,r)||this,n.label=a,n.rate=o,n.on(i,"ratechange",function(l){return n.update(l)}),n}var t=e.prototype;return t.handleClick=function(r){s.prototype.handleClick.call(this),this.player().playbackRate(this.rate)},t.update=function(r){this.selected(this.player().playbackRate()===this.rate)},e}(vu);ry.prototype.contentElType="button";be.registerComponent("PlaybackRateMenuItem",ry);var Pk=function(s){Ce(e,s);function e(i,r){var n;return n=s.call(this,i,r)||this,n.menuButton_.el_.setAttribute("aria-describedby",n.labelElId_),n.updateVisibility(),n.updateLabel(),n.on(i,"loadstart",function(a){return n.updateVisibility(a)}),n.on(i,"ratechange",function(a){return n.updateLabel(a)}),n.on(i,"playbackrateschange",function(a){return n.handlePlaybackRateschange(a)}),n}var t=e.prototype;return t.createEl=function(){var r=s.prototype.createEl.call(this);return this.labelElId_="vjs-playback-rate-value-label-"+this.id_,this.labelEl_=rt("div",{className:"vjs-playback-rate-value",id:this.labelElId_,textContent:"1x"}),r.appendChild(this.labelEl_),r},t.dispose=function(){this.labelEl_=null,s.prototype.dispose.call(this)},t.buildCSSClass=function(){return"vjs-playback-rate "+s.prototype.buildCSSClass.call(this)},t.buildWrapperCSSClass=function(){return"vjs-playback-rate "+s.prototype.buildWrapperCSSClass.call(this)},t.createItems=function(){for(var r=this.playbackRates(),n=[],a=r.length-1;a>=0;a--)n.push(new ry(this.player(),{rate:r[a]+"x"}));return n},t.updateARIAAttributes=function(){this.el().setAttribute("aria-valuenow",this.player().playbackRate())},t.handleClick=function(r){var n=this.player().playbackRate(),a=this.playbackRates(),o=a.indexOf(n),l=(o+1)%a.length;this.player().playbackRate(a[l])},t.handlePlaybackRateschange=function(r){this.update()},t.playbackRates=function(){var r=this.player();return r.playbackRates&&r.playbackRates()||[]},t.playbackRateSupported=function(){return this.player().tech_&&this.player().tech_.featuresPlaybackRate&&this.playbackRates()&&this.playbackRates().length>0},t.updateVisibility=function(r){this.playbackRateSupported()?this.removeClass("vjs-hidden"):this.addClass("vjs-hidden")},t.updateLabel=function(r){this.playbackRateSupported()&&(this.labelEl_.textContent=this.player().playbackRate()+"x")},e}(X0);Pk.prototype.controlText_="Playback Rate";be.registerComponent("PlaybackRateMenuButton",Pk);var Dk=function(s){Ce(e,s);function e(){return s.apply(this,arguments)||this}var t=e.prototype;return t.buildCSSClass=function(){return"vjs-spacer "+s.prototype.buildCSSClass.call(this)},t.createEl=function(r,n,a){return r===void 0&&(r="div"),n===void 0&&(n={}),a===void 0&&(a={}),n.className||(n.className=this.buildCSSClass()),s.prototype.createEl.call(this,r,n,a)},e}(be);be.registerComponent("Spacer",Dk);var Z4=function(s){Ce(e,s);function e(){return s.apply(this,arguments)||this}var t=e.prototype;return t.buildCSSClass=function(){return"vjs-custom-control-spacer "+s.prototype.buildCSSClass.call(this)},t.createEl=function(){return s.prototype.createEl.call(this,"div",{className:this.buildCSSClass(),textContent:" "})},e}(Dk);be.registerComponent("CustomControlSpacer",Z4);var mh=function(s){Ce(e,s);function e(){return s.apply(this,arguments)||this}var t=e.prototype;return t.createEl=function(){return s.prototype.createEl.call(this,"div",{className:"vjs-control-bar",dir:"ltr"})},e}(be);mh.prototype.options_={children:["playToggle","volumePanel","currentTimeDisplay","timeDivider","durationDisplay","progressControl","liveDisplay","seekToLive","remainingTimeDisplay","customControlSpacer","playbackRateMenuButton","chaptersButton","descriptionsButton","subsCapsButton","audioTrackButton","fullscreenToggle"]};"exitPictureInPicture"in ce&&mh.prototype.options_.children.splice(mh.prototype.options_.children.length-1,0,"pictureInPictureToggle");be.registerComponent("ControlBar",mh);var Nk=function(s){Ce(e,s);function e(i,r){var n;return n=s.call(this,i,r)||this,n.on(i,"error",function(a){return n.open(a)}),n}var t=e.prototype;return t.buildCSSClass=function(){return"vjs-error-display "+s.prototype.buildCSSClass.call(this)},t.content=function(){var r=this.player().error();return r?this.localize(r.message):""},e}(Ho);Nk.prototype.options_=ft({},Ho.prototype.options_,{pauseOnOpen:!1,fillAlways:!0,temporary:!1,uncloseable:!0});be.registerComponent("ErrorDisplay",Nk);var up="vjs-text-track-settings",hb=["#000","Black"],db=["#00F","Blue"],fb=["#0FF","Cyan"],pb=["#0F0","Green"],mb=["#F0F","Magenta"],gb=["#F00","Red"],vb=["#FFF","White"],yb=["#FF0","Yellow"],cp=["1","Opaque"],hp=["0.5","Semi-Transparent"],_b=["0","Transparent"],$s={backgroundColor:{selector:".vjs-bg-color > select",id:"captions-background-color-%s",label:"Color",options:[hb,vb,gb,pb,db,yb,mb,fb]},backgroundOpacity:{selector:".vjs-bg-opacity > select",id:"captions-background-opacity-%s",label:"Transparency",options:[cp,hp,_b]},color:{selector:".vjs-fg-color > select",id:"captions-foreground-color-%s",label:"Color",options:[vb,hb,gb,pb,db,yb,mb,fb]},edgeStyle:{selector:".vjs-edge-style > select",id:"%s",label:"Text Edge Style",options:[["none","None"],["raised","Raised"],["depressed","Depressed"],["uniform","Uniform"],["dropshadow","Dropshadow"]]},fontFamily:{selector:".vjs-font-family > select",id:"captions-font-family-%s",label:"Font Family",options:[["proportionalSansSerif","Proportional Sans-Serif"],["monospaceSansSerif","Monospace Sans-Serif"],["proportionalSerif","Proportional Serif"],["monospaceSerif","Monospace Serif"],["casual","Casual"],["script","Script"],["small-caps","Small Caps"]]},fontPercent:{selector:".vjs-font-percent > select",id:"captions-font-size-%s",label:"Font Size",options:[["0.50","50%"],["0.75","75%"],["1.00","100%"],["1.25","125%"],["1.50","150%"],["1.75","175%"],["2.00","200%"],["3.00","300%"],["4.00","400%"]],default:2,parser:function(e){return e==="1.00"?null:Number(e)}},textOpacity:{selector:".vjs-text-opacity > select",id:"captions-foreground-opacity-%s",label:"Transparency",options:[cp,hp]},windowColor:{selector:".vjs-window-color > select",id:"captions-window-color-%s",label:"Color"},windowOpacity:{selector:".vjs-window-opacity > select",id:"captions-window-opacity-%s",label:"Transparency",options:[_b,hp,cp]}};$s.windowColor.options=$s.backgroundColor.options;function Lk(s,e){if(e&&(s=e(s)),s&&s!=="none")return s}function e8(s,e){var t=s.options[s.options.selectedIndex].value;return Lk(t,e)}function t8(s,e,t){if(e){for(var i=0;i<s.options.length;i++)if(Lk(s.options[i].value,t)===e){s.selectedIndex=i;break}}}var i8=function(s){Ce(e,s);function e(i,r){var n;return r.temporary=!1,n=s.call(this,i,r)||this,n.updateDisplay=n.updateDisplay.bind(We(n)),n.fill(),n.hasBeenOpened_=n.hasBeenFilled_=!0,n.endDialog=rt("p",{className:"vjs-control-text",textContent:n.localize("End of dialog window.")}),n.el().appendChild(n.endDialog),n.setDefaults(),r.persistTextTrackSettings===void 0&&(n.options_.persistTextTrackSettings=n.options_.playerOptions.persistTextTrackSettings),n.on(n.$(".vjs-done-button"),"click",function(){n.saveSettings(),n.close()}),n.on(n.$(".vjs-default-button"),"click",function(){n.setDefaults(),n.updateDisplay()}),oo($s,function(a){n.on(n.$(a.selector),"change",n.updateDisplay)}),n.options_.persistTextTrackSettings&&n.restoreSettings(),n}var t=e.prototype;return t.dispose=function(){this.endDialog=null,s.prototype.dispose.call(this)},t.createElSelect_=function(r,n,a){var o=this;n===void 0&&(n=""),a===void 0&&(a="label");var l=$s[r],u=l.id.replace("%s",this.id_),c=[n,u].join(" ").trim();return["<"+a+' id="'+u+'" class="'+(a==="label"?"vjs-label":"")+'">',this.localize(l.label),"</"+a+">",'<select aria-labelledby="'+c+'">'].concat(l.options.map(function(h){var d=u+"-"+h[1].replace(/\W+/g,"");return['<option id="'+d+'" value="'+h[0]+'" ','aria-labelledby="'+c+" "+d+'">',o.localize(h[1]),"</option>"].join("")})).concat("</select>").join("")},t.createElFgColor_=function(){var r="captions-text-legend-"+this.id_;return['<fieldset class="vjs-fg-color vjs-track-setting">','<legend id="'+r+'">',this.localize("Text"),"</legend>",this.createElSelect_("color",r),'<span class="vjs-text-opacity vjs-opacity">',this.createElSelect_("textOpacity",r),"</span>","</fieldset>"].join("")},t.createElBgColor_=function(){var r="captions-background-"+this.id_;return['<fieldset class="vjs-bg-color vjs-track-setting">','<legend id="'+r+'">',this.localize("Background"),"</legend>",this.createElSelect_("backgroundColor",r),'<span class="vjs-bg-opacity vjs-opacity">',this.createElSelect_("backgroundOpacity",r),"</span>","</fieldset>"].join("")},t.createElWinColor_=function(){var r="captions-window-"+this.id_;return['<fieldset class="vjs-window-color vjs-track-setting">','<legend id="'+r+'">',this.localize("Window"),"</legend>",this.createElSelect_("windowColor",r),'<span class="vjs-window-opacity vjs-opacity">',this.createElSelect_("windowOpacity",r),"</span>","</fieldset>"].join("")},t.createElColors_=function(){return rt("div",{className:"vjs-track-settings-colors",innerHTML:[this.createElFgColor_(),this.createElBgColor_(),this.createElWinColor_()].join("")})},t.createElFont_=function(){return rt("div",{className:"vjs-track-settings-font",innerHTML:['<fieldset class="vjs-font-percent vjs-track-setting">',this.createElSelect_("fontPercent","","legend"),"</fieldset>",'<fieldset class="vjs-edge-style vjs-track-setting">',this.createElSelect_("edgeStyle","","legend"),"</fieldset>",'<fieldset class="vjs-font-family vjs-track-setting">',this.createElSelect_("fontFamily","","legend"),"</fieldset>"].join("")})},t.createElControls_=function(){var r=this.localize("restore all settings to the default values");return rt("div",{className:"vjs-track-settings-controls",innerHTML:['<button type="button" class="vjs-default-button" title="'+r+'">',this.localize("Reset"),'<span class="vjs-control-text"> '+r+"</span>","</button>",'<button type="button" class="vjs-done-button">'+this.localize("Done")+"</button>"].join("")})},t.content=function(){return[this.createElColors_(),this.createElFont_(),this.createElControls_()]},t.label=function(){return this.localize("Caption Settings Dialog")},t.description=function(){return this.localize("Beginning of dialog window. Escape will cancel and close the window.")},t.buildCSSClass=function(){return s.prototype.buildCSSClass.call(this)+" vjs-text-track-settings"},t.getValues=function(){var r=this;return HB($s,function(n,a,o){var l=e8(r.$(a.selector),a.parser);return l!==void 0&&(n[o]=l),n},{})},t.setValues=function(r){var n=this;oo($s,function(a,o){t8(n.$(a.selector),r[o],a.parser)})},t.setDefaults=function(){var r=this;oo($s,function(n){var a=n.hasOwnProperty("default")?n.default:0;r.$(n.selector).selectedIndex=a})},t.restoreSettings=function(){var r;try{r=JSON.parse(O.localStorage.getItem(up))}catch(n){Qe.warn(n)}r&&this.setValues(r)},t.saveSettings=function(){if(this.options_.persistTextTrackSettings){var r=this.getValues();try{Object.keys(r).length?O.localStorage.setItem(up,JSON.stringify(r)):O.localStorage.removeItem(up)}catch(n){Qe.warn(n)}}},t.updateDisplay=function(){var r=this.player_.getChild("textTrackDisplay");r&&r.updateDisplay()},t.conditionalBlur_=function(){this.previouslyActiveEl_=null;var r=this.player_.controlBar,n=r&&r.subsCapsButton,a=r&&r.captionsButton;n?n.focus():a&&a.focus()},e}(Ho);be.registerComponent("TextTrackSettings",i8);var r8=function(s){Ce(e,s);function e(i,r){var n,a=r.ResizeObserver||O.ResizeObserver;r.ResizeObserver===null&&(a=!1);var o=Et({createEl:!a,reportTouchActivity:!1},r);return n=s.call(this,i,o)||this,n.ResizeObserver=r.ResizeObserver||O.ResizeObserver,n.loadListener_=null,n.resizeObserver_=null,n.debouncedHandler_=t4(function(){n.resizeHandler()},100,!1,We(n)),a?(n.resizeObserver_=new n.ResizeObserver(n.debouncedHandler_),n.resizeObserver_.observe(i.el())):(n.loadListener_=function(){if(!(!n.el_||!n.el_.contentWindow)){var l=n.debouncedHandler_,u=n.unloadListener_=function(){Ti(this,"resize",l),Ti(this,"unload",u),u=null};or(n.el_.contentWindow,"unload",u),or(n.el_.contentWindow,"resize",l)}},n.one("load",n.loadListener_)),n}var t=e.prototype;return t.createEl=function(){return s.prototype.createEl.call(this,"iframe",{className:"vjs-resize-manager",tabIndex:-1,title:this.localize("No content")},{"aria-hidden":"true"})},t.resizeHandler=function(){!this.player_||!this.player_.trigger||this.player_.trigger("playerresize")},t.dispose=function(){this.debouncedHandler_&&this.debouncedHandler_.cancel(),this.resizeObserver_&&(this.player_.el()&&this.resizeObserver_.unobserve(this.player_.el()),this.resizeObserver_.disconnect()),this.loadListener_&&this.off("load",this.loadListener_),this.el_&&this.el_.contentWindow&&this.unloadListener_&&this.unloadListener_.call(this.el_.contentWindow),this.ResizeObserver=null,this.resizeObserver=null,this.debouncedHandler_=null,this.loadListener_=null,s.prototype.dispose.call(this)},e}(be);be.registerComponent("ResizeManager",r8);var n8={trackingThreshold:20,liveTolerance:15},s8=function(s){Ce(e,s);function e(i,r){var n,a=Et(n8,r,{createEl:!1});return n=s.call(this,i,a)||this,n.handleVisibilityChange_=function(o){return n.handleVisibilityChange(o)},n.trackLiveHandler_=function(){return n.trackLive_()},n.handlePlay_=function(o){return n.handlePlay(o)},n.handleFirstTimeupdate_=function(o){return n.handleFirstTimeupdate(o)},n.handleSeeked_=function(o){return n.handleSeeked(o)},n.seekToLiveEdge_=function(o){return n.seekToLiveEdge(o)},n.reset_(),n.on(n.player_,"durationchange",function(o){return n.handleDurationchange(o)}),n.on(n.player_,"canplay",function(){return n.toggleTracking()}),pu&&"hidden"in ce&&"visibilityState"in ce&&n.on(ce,"visibilitychange",n.handleVisibilityChange_),n}var t=e.prototype;return t.handleVisibilityChange=function(){this.player_.duration()===1/0&&(ce.hidden?this.stopTracking():this.startTracking())},t.trackLive_=function(){var r=this.player_.seekable();if(!(!r||!r.length)){var n=Number(O.performance.now().toFixed(4)),a=this.lastTime_===-1?0:(n-this.lastTime_)/1e3;this.lastTime_=n,this.pastSeekEnd_=this.pastSeekEnd()+a;var o=this.liveCurrentTime(),l=this.player_.currentTime(),u=this.player_.paused()||this.seekedBehindLive_||Math.abs(o-l)>this.options_.liveTolerance;(!this.timeupdateSeen_||o===1/0)&&(u=!1),u!==this.behindLiveEdge_&&(this.behindLiveEdge_=u,this.trigger("liveedgechange"))}},t.handleDurationchange=function(){this.toggleTracking()},t.toggleTracking=function(){this.player_.duration()===1/0&&this.liveWindow()>=this.options_.trackingThreshold?(this.player_.options_.liveui&&this.player_.addClass("vjs-liveui"),this.startTracking()):(this.player_.removeClass("vjs-liveui"),this.stopTracking())},t.startTracking=function(){this.isTracking()||(this.timeupdateSeen_||(this.timeupdateSeen_=this.player_.hasStarted()),this.trackingInterval_=this.setInterval(this.trackLiveHandler_,Lr),this.trackLive_(),this.on(this.player_,["play","pause"],this.trackLiveHandler_),this.timeupdateSeen_?this.on(this.player_,"seeked",this.handleSeeked_):(this.one(this.player_,"play",this.handlePlay_),this.one(this.player_,"timeupdate",this.handleFirstTimeupdate_)))},t.handleFirstTimeupdate=function(){this.timeupdateSeen_=!0,this.on(this.player_,"seeked",this.handleSeeked_)},t.handleSeeked=function(){var r=Math.abs(this.liveCurrentTime()-this.player_.currentTime());this.seekedBehindLive_=this.nextSeekedFromUser_&&r>2,this.nextSeekedFromUser_=!1,this.trackLive_()},t.handlePlay=function(){this.one(this.player_,"timeupdate",this.seekToLiveEdge_)},t.reset_=function(){this.lastTime_=-1,this.pastSeekEnd_=0,this.lastSeekEnd_=-1,this.behindLiveEdge_=!0,this.timeupdateSeen_=!1,this.seekedBehindLive_=!1,this.nextSeekedFromUser_=!1,this.clearInterval(this.trackingInterval_),this.trackingInterval_=null,this.off(this.player_,["play","pause"],this.trackLiveHandler_),this.off(this.player_,"seeked",this.handleSeeked_),this.off(this.player_,"play",this.handlePlay_),this.off(this.player_,"timeupdate",this.handleFirstTimeupdate_),this.off(this.player_,"timeupdate",this.seekToLiveEdge_)},t.nextSeekedFromUser=function(){this.nextSeekedFromUser_=!0},t.stopTracking=function(){this.isTracking()&&(this.reset_(),this.trigger("liveedgechange"))},t.seekableEnd=function(){for(var r=this.player_.seekable(),n=[],a=r?r.length:0;a--;)n.push(r.end(a));return n.length?n.sort()[n.length-1]:1/0},t.seekableStart=function(){for(var r=this.player_.seekable(),n=[],a=r?r.length:0;a--;)n.push(r.start(a));return n.length?n.sort()[0]:0},t.liveWindow=function(){var r=this.liveCurrentTime();return r===1/0?0:r-this.seekableStart()},t.isLive=function(){return this.isTracking()},t.atLiveEdge=function(){return!this.behindLiveEdge()},t.liveCurrentTime=function(){return this.pastSeekEnd()+this.seekableEnd()},t.pastSeekEnd=function(){var r=this.seekableEnd();return this.lastSeekEnd_!==-1&&r!==this.lastSeekEnd_&&(this.pastSeekEnd_=0),this.lastSeekEnd_=r,this.pastSeekEnd_},t.behindLiveEdge=function(){return this.behindLiveEdge_},t.isTracking=function(){return typeof this.trackingInterval_=="number"},t.seekToLiveEdge=function(){this.seekedBehindLive_=!1,!this.atLiveEdge()&&(this.nextSeekedFromUser_=!1,this.player_.currentTime(this.liveCurrentTime()))},t.dispose=function(){this.off(ce,"visibilitychange",this.handleVisibilityChange_),this.stopTracking(),s.prototype.dispose.call(this)},e}(be);be.registerComponent("LiveTracker",s8);var fv=function(e){var t=e.el();if(t.hasAttribute("src"))return e.triggerSourceset(t.src),!0;var i=e.$$("source"),r=[],n="";if(!i.length)return!1;for(var a=0;a<i.length;a++){var o=i[a].src;o&&r.indexOf(o)===-1&&r.push(o)}return r.length?(r.length===1&&(n=r[0]),e.triggerSourceset(n),!0):!1},a8=Object.defineProperty({},"innerHTML",{get:function(){return this.cloneNode(!0).innerHTML},set:function(e){var t=ce.createElement(this.nodeName.toLowerCase());t.innerHTML=e;for(var i=ce.createDocumentFragment();t.childNodes.length;)i.appendChild(t.childNodes[0]);return this.innerText="",O.Element.prototype.appendChild.call(this,i),this.innerHTML}}),Ok=function(e,t){for(var i={},r=0;r<e.length&&(i=Object.getOwnPropertyDescriptor(e[r],t),!(i&&i.set&&i.get));r++);return i.enumerable=!0,i.configurable=!0,i},o8=function(e){return Ok([e.el(),O.HTMLMediaElement.prototype,O.Element.prototype,a8],"innerHTML")},Tb=function(e){var t=e.el();if(!t.resetSourceWatch_){var i={},r=o8(e),n=function(o){return function(){for(var l=arguments.length,u=new Array(l),c=0;c<l;c++)u[c]=arguments[c];var h=o.apply(t,u);return fv(e),h}};["append","appendChild","insertAdjacentHTML"].forEach(function(a){t[a]&&(i[a]=t[a],t[a]=n(i[a]))}),Object.defineProperty(t,"innerHTML",Et(r,{set:n(r.set)})),t.resetSourceWatch_=function(){t.resetSourceWatch_=null,Object.keys(i).forEach(function(a){t[a]=i[a]}),Object.defineProperty(t,"innerHTML",r)},e.one("sourceset",t.resetSourceWatch_)}},l8=Object.defineProperty({},"src",{get:function(){return this.hasAttribute("src")?ok(O.Element.prototype.getAttribute.call(this,"src")):""},set:function(e){return O.Element.prototype.setAttribute.call(this,"src",e),e}}),u8=function(e){return Ok([e.el(),O.HTMLMediaElement.prototype,l8],"src")},c8=function(e){if(e.featuresSourceset){var t=e.el();if(!t.resetSourceset_){var i=u8(e),r=t.setAttribute,n=t.load;Object.defineProperty(t,"src",Et(i,{set:function(o){var l=i.set.call(t,o);return e.triggerSourceset(t.src),l}})),t.setAttribute=function(a,o){var l=r.call(t,a,o);return/src/i.test(a)&&e.triggerSourceset(t.src),l},t.load=function(){var a=n.call(t);return fv(e)||(e.triggerSourceset(""),Tb(e)),a},t.currentSrc?e.triggerSourceset(t.currentSrc):fv(e)||Tb(e),t.resetSourceset_=function(){t.resetSourceset_=null,t.load=n,t.setAttribute=r,Object.defineProperty(t,"src",i),t.resetSourceWatch_&&t.resetSourceWatch_()}}}},ny=function(e,t,i,r){r===void 0&&(r=!0);var n=function(l){return Object.defineProperty(e,t,{value:l,enumerable:!0,writable:!0})},a={configurable:!0,enumerable:!0,get:function(){var l=i();return n(l),l}};return r&&(a.set=n),Object.defineProperty(e,t,a)},Ie=function(s){Ce(e,s);function e(i,r){var n;n=s.call(this,i,r)||this;var a=i.source,o=!1;if(n.featuresVideoFrameCallback=n.featuresVideoFrameCallback&&n.el_.tagName==="VIDEO",a&&(n.el_.currentSrc!==a.src||i.tag&&i.tag.initNetworkState_===3)?n.setSource(a):n.handleLateInit_(n.el_),i.enableSourceset&&n.setupSourcesetHandling_(),n.isScrubbing_=!1,n.el_.hasChildNodes()){for(var l=n.el_.childNodes,u=l.length,c=[];u--;){var h=l[u],d=h.nodeName.toLowerCase();d==="track"&&(n.featuresNativeTextTracks?(n.remoteTextTrackEls().addTrackElement_(h),n.remoteTextTracks().addTrack(h.track),n.textTracks().addTrack(h.track),!o&&!n.el_.hasAttribute("crossorigin")&&fd(h.src)&&(o=!0)):c.push(h))}for(var g=0;g<c.length;g++)n.el_.removeChild(c[g])}return n.proxyNativeTracks_(),n.featuresNativeTextTracks&&o&&Qe.warn(`Text Tracks are being loaded from another origin but the crossorigin attribute isn't used.
258
- This may prevent text tracks from loading.`),n.restoreMetadataTracksInIOSNativePlayer_(),(Eo||L0||Ow)&&i.nativeControlsForTouch===!0&&n.setControls(!0),n.proxyWebkitFullscreen_(),n.triggerReady(),n}var t=e.prototype;return t.dispose=function(){this.el_&&this.el_.resetSourceset_&&this.el_.resetSourceset_(),e.disposeMediaElement(this.el_),this.options_=null,s.prototype.dispose.call(this)},t.setupSourcesetHandling_=function(){c8(this)},t.restoreMetadataTracksInIOSNativePlayer_=function(){var r=this.textTracks(),n,a=function(){n=[];for(var u=0;u<r.length;u++){var c=r[u];c.kind==="metadata"&&n.push({track:c,storedMode:c.mode})}};a(),r.addEventListener("change",a),this.on("dispose",function(){return r.removeEventListener("change",a)});var o=function l(){for(var u=0;u<n.length;u++){var c=n[u];c.track.mode==="disabled"&&c.track.mode!==c.storedMode&&(c.track.mode=c.storedMode)}r.removeEventListener("change",l)};this.on("webkitbeginfullscreen",function(){r.removeEventListener("change",a),r.removeEventListener("change",o),r.addEventListener("change",o)}),this.on("webkitendfullscreen",function(){r.removeEventListener("change",a),r.addEventListener("change",a),r.removeEventListener("change",o)})},t.overrideNative_=function(r,n){var a=this;if(n===this["featuresNative"+r+"Tracks"]){var o=r.toLowerCase();this[o+"TracksListeners_"]&&Object.keys(this[o+"TracksListeners_"]).forEach(function(l){var u=a.el()[o+"Tracks"];u.removeEventListener(l,a[o+"TracksListeners_"][l])}),this["featuresNative"+r+"Tracks"]=!n,this[o+"TracksListeners_"]=null,this.proxyNativeTracksForType_(o)}},t.overrideNativeAudioTracks=function(r){this.overrideNative_("Audio",r)},t.overrideNativeVideoTracks=function(r){this.overrideNative_("Video",r)},t.proxyNativeTracksForType_=function(r){var n=this,a=vr[r],o=this.el()[a.getterName],l=this[a.getterName]();if(!(!this["featuresNative"+a.capitalName+"Tracks"]||!o||!o.addEventListener)){var u={change:function(d){var g={type:"change",target:l,currentTarget:l,srcElement:l};l.trigger(g),r==="text"&&n[Io.remoteText.getterName]().trigger(g)},addtrack:function(d){l.addTrack(d.track)},removetrack:function(d){l.removeTrack(d.track)}},c=function(){for(var d=[],g=0;g<l.length;g++){for(var y=!1,p=0;p<o.length;p++)if(o[p]===l[g]){y=!0;break}y||d.push(l[g])}for(;d.length;)l.removeTrack(d.shift())};this[a.getterName+"Listeners_"]=u,Object.keys(u).forEach(function(h){var d=u[h];o.addEventListener(h,d),n.on("dispose",function(g){return o.removeEventListener(h,d)})}),this.on("loadstart",c),this.on("dispose",function(h){return n.off("loadstart",c)})}},t.proxyNativeTracks_=function(){var r=this;vr.names.forEach(function(n){r.proxyNativeTracksForType_(n)})},t.createEl=function(){var r=this.options_.tag;if(!r||!(this.options_.playerElIngest||this.movingMediaElementInDOM)){if(r){var n=r.cloneNode(!0);r.parentNode&&r.parentNode.insertBefore(n,r),e.disposeMediaElement(r),r=n}else{r=ce.createElement("video");var a=this.options_.tag&&xn(this.options_.tag),o=Et({},a);(!Eo||this.options_.nativeControlsForTouch!==!0)&&delete o.controls,qw(r,jt(o,{id:this.options_.techId,class:"vjs-tech"}))}r.playerId=this.options_.playerId}typeof this.options_.preload<"u"&&wo(r,"preload",this.options_.preload),this.options_.disablePictureInPicture!==void 0&&(r.disablePictureInPicture=this.options_.disablePictureInPicture);for(var l=["loop","muted","playsinline","autoplay"],u=0;u<l.length;u++){var c=l[u],h=this.options_[c];typeof h<"u"&&(h?wo(r,c,c):ld(r,c),r[c]=h)}return r},t.handleLateInit_=function(r){if(!(r.networkState===0||r.networkState===3)){if(r.readyState===0){var n=!1,a=function(){n=!0};this.on("loadstart",a);var o=function(){n||this.trigger("loadstart")};this.on("loadedmetadata",o),this.ready(function(){this.off("loadstart",a),this.off("loadedmetadata",o),n||this.trigger("loadstart")});return}var l=["loadstart"];l.push("loadedmetadata"),r.readyState>=2&&l.push("loadeddata"),r.readyState>=3&&l.push("canplay"),r.readyState>=4&&l.push("canplaythrough"),this.ready(function(){l.forEach(function(u){this.trigger(u)},this)})}},t.setScrubbing=function(r){this.isScrubbing_=r},t.scrubbing=function(){return this.isScrubbing_},t.setCurrentTime=function(r){try{this.isScrubbing_&&this.el_.fastSeek&&od?this.el_.fastSeek(r):this.el_.currentTime=r}catch(n){Qe(n,"Video is not ready. (Video.js)")}},t.duration=function(){var r=this;if(this.el_.duration===1/0&&On&&Mn&&this.el_.currentTime===0){var n=function a(){r.el_.currentTime>0&&(r.el_.duration===1/0&&r.trigger("durationchange"),r.off("timeupdate",a))};return this.on("timeupdate",n),NaN}return this.el_.duration||NaN},t.width=function(){return this.el_.offsetWidth},t.height=function(){return this.el_.offsetHeight},t.proxyWebkitFullscreen_=function(){var r=this;if("webkitDisplayingFullscreen"in this.el_){var n=function(){this.trigger("fullscreenchange",{isFullscreen:!1}),this.el_.controls&&!this.options_.nativeControlsForTouch&&this.controls()&&(this.el_.controls=!1)},a=function(){"webkitPresentationMode"in this.el_&&this.el_.webkitPresentationMode!=="picture-in-picture"&&(this.one("webkitendfullscreen",n),this.trigger("fullscreenchange",{isFullscreen:!0,nativeIOSFullscreen:!0}))};this.on("webkitbeginfullscreen",a),this.on("dispose",function(){r.off("webkitbeginfullscreen",a),r.off("webkitendfullscreen",n)})}},t.supportsFullScreen=function(){if(typeof this.el_.webkitEnterFullScreen=="function"){var r=O.navigator&&O.navigator.userAgent||"";if(/Android/.test(r)||!/Chrome|Mac OS X 10.5/.test(r))return!0}return!1},t.enterFullScreen=function(){var r=this.el_;if(r.paused&&r.networkState<=r.HAVE_METADATA)Yr(this.el_.play()),this.setTimeout(function(){r.pause();try{r.webkitEnterFullScreen()}catch(n){this.trigger("fullscreenerror",n)}},0);else try{r.webkitEnterFullScreen()}catch(n){this.trigger("fullscreenerror",n)}},t.exitFullScreen=function(){if(!this.el_.webkitDisplayingFullscreen){this.trigger("fullscreenerror",new Error("The video is not fullscreen"));return}this.el_.webkitExitFullScreen()},t.requestPictureInPicture=function(){return this.el_.requestPictureInPicture()},t.requestVideoFrameCallback=function(r){return this.featuresVideoFrameCallback&&!this.el_.webkitKeys?this.el_.requestVideoFrameCallback(r):s.prototype.requestVideoFrameCallback.call(this,r)},t.cancelVideoFrameCallback=function(r){this.featuresVideoFrameCallback&&!this.el_.webkitKeys?this.el_.cancelVideoFrameCallback(r):s.prototype.cancelVideoFrameCallback.call(this,r)},t.src=function(r){if(r===void 0)return this.el_.src;this.setSrc(r)},t.reset=function(){e.resetMediaElement(this.el_)},t.currentSrc=function(){return this.currentSource_?this.currentSource_.src:this.el_.currentSrc},t.setControls=function(r){this.el_.controls=!!r},t.addTextTrack=function(r,n,a){return this.featuresNativeTextTracks?this.el_.addTextTrack(r,n,a):s.prototype.addTextTrack.call(this,r,n,a)},t.createRemoteTextTrack=function(r){if(!this.featuresNativeTextTracks)return s.prototype.createRemoteTextTrack.call(this,r);var n=ce.createElement("track");return r.kind&&(n.kind=r.kind),r.label&&(n.label=r.label),(r.language||r.srclang)&&(n.srclang=r.language||r.srclang),r.default&&(n.default=r.default),r.id&&(n.id=r.id),r.src&&(n.src=r.src),n},t.addRemoteTextTrack=function(r,n){var a=s.prototype.addRemoteTextTrack.call(this,r,n);return this.featuresNativeTextTracks&&this.el().appendChild(a),a},t.removeRemoteTextTrack=function(r){if(s.prototype.removeRemoteTextTrack.call(this,r),this.featuresNativeTextTracks)for(var n=this.$$("track"),a=n.length;a--;)(r===n[a]||r===n[a].track)&&this.el().removeChild(n[a])},t.getVideoPlaybackQuality=function(){if(typeof this.el().getVideoPlaybackQuality=="function")return this.el().getVideoPlaybackQuality();var r={};return typeof this.el().webkitDroppedFrameCount<"u"&&typeof this.el().webkitDecodedFrameCount<"u"&&(r.droppedVideoFrames=this.el().webkitDroppedFrameCount,r.totalVideoFrames=this.el().webkitDecodedFrameCount),O.performance&&typeof O.performance.now=="function"?r.creationTime=O.performance.now():O.performance&&O.performance.timing&&typeof O.performance.timing.navigationStart=="number"&&(r.creationTime=O.Date.now()-O.performance.timing.navigationStart),r},e}(yt);ny(Ie,"TEST_VID",function(){if(jo()){var s=ce.createElement("video"),e=ce.createElement("track");return e.kind="captions",e.srclang="en",e.label="English",s.appendChild(e),s}});Ie.isSupported=function(){try{Ie.TEST_VID.volume=.5}catch{return!1}return!!(Ie.TEST_VID&&Ie.TEST_VID.canPlayType)};Ie.canPlayType=function(s){return Ie.TEST_VID.canPlayType(s)};Ie.canPlaySource=function(s,e){return Ie.canPlayType(s.type)};Ie.canControlVolume=function(){try{var s=Ie.TEST_VID.volume;Ie.TEST_VID.volume=s/2+.1;var e=s!==Ie.TEST_VID.volume;return e&&Oi?(O.setTimeout(function(){Ie&&Ie.prototype&&(Ie.prototype.featuresVolumeControl=s!==Ie.TEST_VID.volume)}),!1):e}catch{return!1}};Ie.canMuteVolume=function(){try{var s=Ie.TEST_VID.muted;return Ie.TEST_VID.muted=!s,Ie.TEST_VID.muted?wo(Ie.TEST_VID,"muted","muted"):ld(Ie.TEST_VID,"muted","muted"),s!==Ie.TEST_VID.muted}catch{return!1}};Ie.canControlPlaybackRate=function(){if(On&&Mn&&Rw<58)return!1;try{var s=Ie.TEST_VID.playbackRate;return Ie.TEST_VID.playbackRate=s/2+.1,s!==Ie.TEST_VID.playbackRate}catch{return!1}};Ie.canOverrideAttributes=function(){try{var s=function(){};Object.defineProperty(ce.createElement("video"),"src",{get:s,set:s}),Object.defineProperty(ce.createElement("audio"),"src",{get:s,set:s}),Object.defineProperty(ce.createElement("video"),"innerHTML",{get:s,set:s}),Object.defineProperty(ce.createElement("audio"),"innerHTML",{get:s,set:s})}catch{return!1}return!0};Ie.supportsNativeTextTracks=function(){return od||Oi&&Mn};Ie.supportsNativeVideoTracks=function(){return!!(Ie.TEST_VID&&Ie.TEST_VID.videoTracks)};Ie.supportsNativeAudioTracks=function(){return!!(Ie.TEST_VID&&Ie.TEST_VID.audioTracks)};Ie.Events=["loadstart","suspend","abort","error","emptied","stalled","loadedmetadata","loadeddata","canplay","canplaythrough","playing","waiting","seeking","seeked","ended","durationchange","timeupdate","progress","play","pause","ratechange","resize","volumechange"];[["featuresMuteControl","canMuteVolume"],["featuresPlaybackRate","canControlPlaybackRate"],["featuresSourceset","canOverrideAttributes"],["featuresNativeTextTracks","supportsNativeTextTracks"],["featuresNativeVideoTracks","supportsNativeVideoTracks"],["featuresNativeAudioTracks","supportsNativeAudioTracks"]].forEach(function(s){var e=s[0],t=s[1];ny(Ie.prototype,e,function(){return Ie[t]()},!0)});Ie.prototype.featuresVolumeControl=Ie.canControlVolume();Ie.prototype.movingMediaElementInDOM=!Oi;Ie.prototype.featuresFullscreenResize=!0;Ie.prototype.featuresProgressEvents=!0;Ie.prototype.featuresTimeupdateEvents=!0;Ie.prototype.featuresVideoFrameCallback=!!(Ie.TEST_VID&&Ie.TEST_VID.requestVideoFrameCallback);var gh;Ie.patchCanPlayType=function(){P0>=4&&!Mw&&!Mn&&(gh=Ie.TEST_VID&&Ie.TEST_VID.constructor.prototype.canPlayType,Ie.TEST_VID.constructor.prototype.canPlayType=function(s){var e=/^application\/(?:x-|vnd\.apple\.)mpegurl/i;return s&&e.test(s)?"maybe":gh.call(this,s)})};Ie.unpatchCanPlayType=function(){var s=Ie.TEST_VID.constructor.prototype.canPlayType;return gh&&(Ie.TEST_VID.constructor.prototype.canPlayType=gh),s};Ie.patchCanPlayType();Ie.disposeMediaElement=function(s){if(s){for(s.parentNode&&s.parentNode.removeChild(s);s.hasChildNodes();)s.removeChild(s.firstChild);s.removeAttribute("src"),typeof s.load=="function"&&function(){try{s.load()}catch{}}()}};Ie.resetMediaElement=function(s){if(s){for(var e=s.querySelectorAll("source"),t=e.length;t--;)s.removeChild(e[t]);s.removeAttribute("src"),typeof s.load=="function"&&function(){try{s.load()}catch{}}()}};["muted","defaultMuted","autoplay","controls","loop","playsinline"].forEach(function(s){Ie.prototype[s]=function(){return this.el_[s]||this.el_.hasAttribute(s)}});["muted","defaultMuted","autoplay","loop","playsinline"].forEach(function(s){Ie.prototype["set"+zt(s)]=function(e){this.el_[s]=e,e?this.el_.setAttribute(s,s):this.el_.removeAttribute(s)}});["paused","currentTime","buffered","volume","poster","preload","error","seeking","seekable","ended","playbackRate","defaultPlaybackRate","disablePictureInPicture","played","networkState","readyState","videoWidth","videoHeight","crossOrigin"].forEach(function(s){Ie.prototype[s]=function(){return this.el_[s]}});["volume","src","poster","preload","playbackRate","defaultPlaybackRate","disablePictureInPicture","crossOrigin"].forEach(function(s){Ie.prototype["set"+zt(s)]=function(e){this.el_[s]=e}});["pause","load","play"].forEach(function(s){Ie.prototype[s]=function(){return this.el_[s]()}});yt.withSourceHandlers(Ie);Ie.nativeSourceHandler={};Ie.nativeSourceHandler.canPlayType=function(s){try{return Ie.TEST_VID.canPlayType(s)}catch{return""}};Ie.nativeSourceHandler.canHandleSource=function(s,e){if(s.type)return Ie.nativeSourceHandler.canPlayType(s.type);if(s.src){var t=$0(s.src);return Ie.nativeSourceHandler.canPlayType("video/"+t)}return""};Ie.nativeSourceHandler.handleSource=function(s,e,t){e.setSrc(s.src)};Ie.nativeSourceHandler.dispose=function(){};Ie.registerSourceHandler(Ie.nativeSourceHandler);yt.registerTech("Html5",Ie);var Mk=["progress","abort","suspend","emptied","stalled","loadedmetadata","loadeddata","timeupdate","resize","volumechange","texttrackchange"],dp={canplay:"CanPlay",canplaythrough:"CanPlayThrough",playing:"Playing",seeked:"Seeked"},pv=["tiny","xsmall","small","medium","large","xlarge","huge"],Rc={};pv.forEach(function(s){var e=s.charAt(0)==="x"?"x-"+s.substring(1):s;Rc[s]="vjs-layout-"+e});var h8={tiny:210,xsmall:320,small:425,medium:768,large:1440,xlarge:2560,huge:1/0},Gt=function(s){Ce(e,s);function e(i,r,n){var a;if(i.id=i.id||r.id||"vjs_video_"+Rn(),r=jt(e.getTagSettings(i),r),r.initChildren=!1,r.createEl=!1,r.evented=!1,r.reportTouchActivity=!1,!r.language)if(typeof i.closest=="function"){var o=i.closest("[lang]");o&&o.getAttribute&&(r.language=o.getAttribute("lang"))}else for(var l=i;l&&l.nodeType===1;){if(xn(l).hasOwnProperty("lang")){r.language=l.getAttribute("lang");break}l=l.parentNode}if(a=s.call(this,null,r,n)||this,a.boundDocumentFullscreenChange_=function(d){return a.documentFullscreenChange_(d)},a.boundFullWindowOnEscKey_=function(d){return a.fullWindowOnEscKey(d)},a.boundUpdateStyleEl_=function(d){return a.updateStyleEl_(d)},a.boundApplyInitTime_=function(d){return a.applyInitTime_(d)},a.boundUpdateCurrentBreakpoint_=function(d){return a.updateCurrentBreakpoint_(d)},a.boundHandleTechClick_=function(d){return a.handleTechClick_(d)},a.boundHandleTechDoubleClick_=function(d){return a.handleTechDoubleClick_(d)},a.boundHandleTechTouchStart_=function(d){return a.handleTechTouchStart_(d)},a.boundHandleTechTouchMove_=function(d){return a.handleTechTouchMove_(d)},a.boundHandleTechTouchEnd_=function(d){return a.handleTechTouchEnd_(d)},a.boundHandleTechTap_=function(d){return a.handleTechTap_(d)},a.isFullscreen_=!1,a.log=Dw(a.id_),a.fsApi_=hh,a.isPosterFromTech_=!1,a.queuedCallbacks_=[],a.isReady_=!1,a.hasStarted_=!1,a.userActive_=!1,a.debugEnabled_=!1,a.audioOnlyMode_=!1,a.audioPosterMode_=!1,a.audioOnlyCache_={playerHeight:null,hiddenChildren:[]},!a.options_||!a.options_.techOrder||!a.options_.techOrder.length)throw new Error("No techOrder specified. Did you overwrite videojs.options instead of just changing the properties you want to override?");if(a.tag=i,a.tagAttributes=i&&xn(i),a.language(a.options_.language),r.languages){var u={};Object.getOwnPropertyNames(r.languages).forEach(function(d){u[d.toLowerCase()]=r.languages[d]}),a.languages_=u}else a.languages_=e.prototype.options_.languages;a.resetCache_(),a.poster_=r.poster||"",a.controls_=!!r.controls,i.controls=!1,i.removeAttribute("controls"),a.changingSrc_=!1,a.playCallbacks_=[],a.playTerminatedQueue_=[],i.hasAttribute("autoplay")?a.autoplay(!0):a.autoplay(a.options_.autoplay),r.plugins&&Object.keys(r.plugins).forEach(function(d){if(typeof a[d]!="function")throw new Error('plugin "'+d+'" does not exist')}),a.scrubbing_=!1,a.el_=a.createEl(),F0(We(a),{eventBusKey:"el_"}),a.fsApi_.requestFullscreen&&(or(ce,a.fsApi_.fullscreenchange,a.boundDocumentFullscreenChange_),a.on(a.fsApi_.fullscreenchange,a.boundDocumentFullscreenChange_)),a.fluid_&&a.on(["playerreset","resize"],a.boundUpdateStyleEl_);var c=Et(a.options_);r.plugins&&Object.keys(r.plugins).forEach(function(d){a[d](r.plugins[d])}),r.debug&&a.debug(!0),a.options_.playerOptions=c,a.middleware_=[],a.playbackRates(r.playbackRates),a.initChildren(),a.isAudio(i.nodeName.toLowerCase()==="audio"),a.controls()?a.addClass("vjs-controls-enabled"):a.addClass("vjs-controls-disabled"),a.el_.setAttribute("role","region"),a.isAudio()?a.el_.setAttribute("aria-label",a.localize("Audio Player")):a.el_.setAttribute("aria-label",a.localize("Video Player")),a.isAudio()&&a.addClass("vjs-audio"),a.flexNotSupported_()&&a.addClass("vjs-no-flex"),Eo&&a.addClass("vjs-touch-enabled"),Oi||a.addClass("vjs-workinghover"),e.players[a.id_]=We(a);var h=Aw.split(".")[0];return a.addClass("vjs-v"+h),a.userActive(!0),a.reportUserActivity(),a.one("play",function(d){return a.listenForUserActivity_(d)}),a.on("stageclick",function(d){return a.handleStageClick_(d)}),a.on("keydown",function(d){return a.handleKeyDown(d)}),a.on("languagechange",function(d){return a.handleLanguagechange(d)}),a.breakpoints(a.options_.breakpoints),a.responsive(a.options_.responsive),a.on("ready",function(){a.audioPosterMode(a.options_.audioPosterMode),a.audioOnlyMode(a.options_.audioOnlyMode)}),a}var t=e.prototype;return t.dispose=function(){var r=this;this.trigger("dispose"),this.off("dispose"),Ti(ce,this.fsApi_.fullscreenchange,this.boundDocumentFullscreenChange_),Ti(ce,"keydown",this.boundFullWindowOnEscKey_),this.styleEl_&&this.styleEl_.parentNode&&(this.styleEl_.parentNode.removeChild(this.styleEl_),this.styleEl_=null),e.players[this.id_]=null,this.tag&&this.tag.player&&(this.tag.player=null),this.el_&&this.el_.player&&(this.el_.player=null),this.tech_&&(this.tech_.dispose(),this.isPosterFromTech_=!1,this.poster_=""),this.playerElIngest_&&(this.playerElIngest_=null),this.tag&&(this.tag=null),D4(this),ki.names.forEach(function(n){var a=ki[n],o=r[a.getterName]();o&&o.off&&o.off()}),s.prototype.dispose.call(this,{restoreEl:this.options_.restoreEl})},t.createEl=function(){var r=this.tag,n,a=this.playerElIngest_=r.parentNode&&r.parentNode.hasAttribute&&r.parentNode.hasAttribute("data-vjs-player"),o=this.tag.tagName.toLowerCase()==="video-js";a?n=this.el_=r.parentNode:o||(n=this.el_=s.prototype.createEl.call(this,"div"));var l=xn(r);if(o){for(n=this.el_=r,r=this.tag=ce.createElement("video");n.children.length;)r.appendChild(n.firstChild);ta(n,"video-js")||Pn(n,"video-js"),n.appendChild(r),a=this.playerElIngest_=n,Object.keys(n).forEach(function(y){try{r[y]=n[y]}catch{}})}if(r.setAttribute("tabindex","-1"),l.tabindex="-1",(pu||Mn&&Fw)&&(r.setAttribute("role","application"),l.role="application"),r.removeAttribute("width"),r.removeAttribute("height"),"width"in l&&delete l.width,"height"in l&&delete l.height,Object.getOwnPropertyNames(l).forEach(function(y){o&&y==="class"||n.setAttribute(y,l[y]),o&&r.setAttribute(y,l[y])}),r.playerId=r.id,r.id+="_html5_api",r.className="vjs-tech",r.player=n.player=this,this.addClass("vjs-paused"),O.VIDEOJS_NO_DYNAMIC_STYLE!==!0){this.styleEl_=Jw("vjs-styles-dimensions");var u=cs(".vjs-styles-defaults"),c=cs("head");c.insertBefore(this.styleEl_,u?u.nextSibling:c.firstChild)}this.fill_=!1,this.fluid_=!1,this.width(this.options_.width),this.height(this.options_.height),this.fill(this.options_.fill),this.fluid(this.options_.fluid),this.aspectRatio(this.options_.aspectRatio),this.crossOrigin(this.options_.crossOrigin||this.options_.crossorigin);for(var h=r.getElementsByTagName("a"),d=0;d<h.length;d++){var g=h.item(d);Pn(g,"vjs-hidden"),g.setAttribute("hidden","hidden")}return r.initNetworkState_=r.networkState,r.parentNode&&!a&&r.parentNode.insertBefore(n,r),av(r,n),this.children_.unshift(r),this.el_.setAttribute("lang",this.language_),this.el_.setAttribute("translate","no"),this.el_=n,n},t.crossOrigin=function(r){if(!r)return this.techGet_("crossOrigin");if(r!=="anonymous"&&r!=="use-credentials"){Qe.warn('crossOrigin must be "anonymous" or "use-credentials", given "'+r+'"');return}this.techCall_("setCrossOrigin",r)},t.width=function(r){return this.dimension("width",r)},t.height=function(r){return this.dimension("height",r)},t.dimension=function(r,n){var a=r+"_";if(n===void 0)return this[a]||0;if(n===""||n==="auto"){this[a]=void 0,this.updateStyleEl_();return}var o=parseFloat(n);if(isNaN(o)){Qe.error('Improper value "'+n+'" supplied for for '+r);return}this[a]=o,this.updateStyleEl_()},t.fluid=function(r){var n=this;if(r===void 0)return!!this.fluid_;this.fluid_=!!r,Dn(this)&&this.off(["playerreset","resize"],this.boundUpdateStyleEl_),r?(this.addClass("vjs-fluid"),this.fill(!1),i4(this,function(){n.on(["playerreset","resize"],n.boundUpdateStyleEl_)})):this.removeClass("vjs-fluid"),this.updateStyleEl_()},t.fill=function(r){if(r===void 0)return!!this.fill_;this.fill_=!!r,r?(this.addClass("vjs-fill"),this.fluid(!1)):this.removeClass("vjs-fill")},t.aspectRatio=function(r){if(r===void 0)return this.aspectRatio_;if(!/^\d+\:\d+$/.test(r))throw new Error("Improper value supplied for aspect ratio. The format should be width:height, for example 16:9.");this.aspectRatio_=r,this.fluid(!0),this.updateStyleEl_()},t.updateStyleEl_=function(){if(O.VIDEOJS_NO_DYNAMIC_STYLE===!0){var r=typeof this.width_=="number"?this.width_:this.options_.width,n=typeof this.height_=="number"?this.height_:this.options_.height,a=this.tech_&&this.tech_.el();a&&(r>=0&&(a.width=r),n>=0&&(a.height=n));return}var o,l,u,c;this.aspectRatio_!==void 0&&this.aspectRatio_!=="auto"?u=this.aspectRatio_:this.videoWidth()>0?u=this.videoWidth()+":"+this.videoHeight():u="16:9";var h=u.split(":"),d=h[1]/h[0];this.width_!==void 0?o=this.width_:this.height_!==void 0?o=this.height_/d:o=this.videoWidth()||300,this.height_!==void 0?l=this.height_:l=o*d,/^[^a-zA-Z]/.test(this.id())?c="dimensions-"+this.id():c=this.id()+"-dimensions",this.addClass(c),Zw(this.styleEl_,`
259
- .`+c+` {
260
- width: `+o+`px;
261
- height: `+l+`px;
262
- }
263
-
264
- .`+c+`.vjs-fluid:not(.vjs-audio-only-mode) {
265
- padding-top: `+d*100+`%;
266
- }
267
- `)},t.loadTech_=function(r,n){var a=this;this.tech_&&this.unloadTech_();var o=zt(r),l=r.charAt(0).toLowerCase()+r.slice(1);o!=="Html5"&&this.tag&&(yt.getTech("Html5").disposeMediaElement(this.tag),this.tag.player=null,this.tag=null),this.techName_=o,this.isReady_=!1;var u=this.autoplay();(typeof this.autoplay()=="string"||this.autoplay()===!0&&this.options_.normalizeAutoplay)&&(u=!1);var c={source:n,autoplay:u,nativeControlsForTouch:this.options_.nativeControlsForTouch,playerId:this.id(),techId:this.id()+"_"+l+"_api",playsinline:this.options_.playsinline,preload:this.options_.preload,loop:this.options_.loop,disablePictureInPicture:this.options_.disablePictureInPicture,muted:this.options_.muted,poster:this.poster(),language:this.language(),playerElIngest:this.playerElIngest_||!1,"vtt.js":this.options_["vtt.js"],canOverridePoster:!!this.options_.techCanOverridePoster,enableSourceset:this.options_.enableSourceset,Promise:this.options_.Promise};ki.names.forEach(function(d){var g=ki[d];c[g.getterName]=a[g.privateName]}),jt(c,this.options_[o]),jt(c,this.options_[l]),jt(c,this.options_[r.toLowerCase()]),this.tag&&(c.tag=this.tag),n&&n.src===this.cache_.src&&this.cache_.currentTime>0&&(c.startTime=this.cache_.currentTime);var h=yt.getTech(r);if(!h)throw new Error("No Tech named '"+o+"' exists! '"+o+"' should be registered using videojs.registerTech()'");this.tech_=new h(c),this.tech_.ready(wt(this,this.handleTechReady_),!0),tb.jsonToTextTracks(this.textTracksJson_||[],this.tech_),Mk.forEach(function(d){a.on(a.tech_,d,function(g){return a["handleTech"+zt(d)+"_"](g)})}),Object.keys(dp).forEach(function(d){a.on(a.tech_,d,function(g){if(a.tech_.playbackRate()===0&&a.tech_.seeking()){a.queuedCallbacks_.push({callback:a["handleTech"+dp[d]+"_"].bind(a),event:g});return}a["handleTech"+dp[d]+"_"](g)})}),this.on(this.tech_,"loadstart",function(d){return a.handleTechLoadStart_(d)}),this.on(this.tech_,"sourceset",function(d){return a.handleTechSourceset_(d)}),this.on(this.tech_,"waiting",function(d){return a.handleTechWaiting_(d)}),this.on(this.tech_,"ended",function(d){return a.handleTechEnded_(d)}),this.on(this.tech_,"seeking",function(d){return a.handleTechSeeking_(d)}),this.on(this.tech_,"play",function(d){return a.handleTechPlay_(d)}),this.on(this.tech_,"firstplay",function(d){return a.handleTechFirstPlay_(d)}),this.on(this.tech_,"pause",function(d){return a.handleTechPause_(d)}),this.on(this.tech_,"durationchange",function(d){return a.handleTechDurationChange_(d)}),this.on(this.tech_,"fullscreenchange",function(d,g){return a.handleTechFullscreenChange_(d,g)}),this.on(this.tech_,"fullscreenerror",function(d,g){return a.handleTechFullscreenError_(d,g)}),this.on(this.tech_,"enterpictureinpicture",function(d){return a.handleTechEnterPictureInPicture_(d)}),this.on(this.tech_,"leavepictureinpicture",function(d){return a.handleTechLeavePictureInPicture_(d)}),this.on(this.tech_,"error",function(d){return a.handleTechError_(d)}),this.on(this.tech_,"posterchange",function(d){return a.handleTechPosterChange_(d)}),this.on(this.tech_,"textdata",function(d){return a.handleTechTextData_(d)}),this.on(this.tech_,"ratechange",function(d){return a.handleTechRateChange_(d)}),this.on(this.tech_,"loadedmetadata",this.boundUpdateStyleEl_),this.usingNativeControls(this.techGet_("controls")),this.controls()&&!this.usingNativeControls()&&this.addTechControlsListeners_(),this.tech_.el().parentNode!==this.el()&&(o!=="Html5"||!this.tag)&&av(this.tech_.el(),this.el()),this.tag&&(this.tag.player=null,this.tag=null)},t.unloadTech_=function(){var r=this;ki.names.forEach(function(n){var a=ki[n];r[a.privateName]=r[a.getterName]()}),this.textTracksJson_=tb.textTracksToJson(this.tech_),this.isReady_=!1,this.tech_.dispose(),this.tech_=!1,this.isPosterFromTech_&&(this.poster_="",this.trigger("posterchange")),this.isPosterFromTech_=!1},t.tech=function(r){return r===void 0&&Qe.warn(`Using the tech directly can be dangerous. I hope you know what you're doing.
268
- See https://github.com/videojs/video.js/issues/2617 for more info.
269
- `),this.tech_},t.addTechControlsListeners_=function(){this.removeTechControlsListeners_(),this.on(this.tech_,"click",this.boundHandleTechClick_),this.on(this.tech_,"dblclick",this.boundHandleTechDoubleClick_),this.on(this.tech_,"touchstart",this.boundHandleTechTouchStart_),this.on(this.tech_,"touchmove",this.boundHandleTechTouchMove_),this.on(this.tech_,"touchend",this.boundHandleTechTouchEnd_),this.on(this.tech_,"tap",this.boundHandleTechTap_)},t.removeTechControlsListeners_=function(){this.off(this.tech_,"tap",this.boundHandleTechTap_),this.off(this.tech_,"touchstart",this.boundHandleTechTouchStart_),this.off(this.tech_,"touchmove",this.boundHandleTechTouchMove_),this.off(this.tech_,"touchend",this.boundHandleTechTouchEnd_),this.off(this.tech_,"click",this.boundHandleTechClick_),this.off(this.tech_,"dblclick",this.boundHandleTechDoubleClick_)},t.handleTechReady_=function(){this.triggerReady(),this.cache_.volume&&this.techCall_("setVolume",this.cache_.volume),this.handleTechPosterChange_(),this.handleTechDurationChange_()},t.handleTechLoadStart_=function(){this.removeClass("vjs-ended"),this.removeClass("vjs-seeking"),this.error(null),this.handleTechDurationChange_(),this.paused()?(this.hasStarted(!1),this.trigger("loadstart")):(this.trigger("loadstart"),this.trigger("firstplay")),this.manualAutoplay_(this.autoplay()===!0&&this.options_.normalizeAutoplay?"play":this.autoplay())},t.manualAutoplay_=function(r){var n=this;if(!(!this.tech_||typeof r!="string")){var a=function(){var u=n.muted();n.muted(!0);var c=function(){n.muted(u)};n.playTerminatedQueue_.push(c);var h=n.play();if(jl(h))return h.catch(function(d){throw c(),new Error("Rejection at manualAutoplay. Restoring muted value. "+(d||""))})},o;if(r==="any"&&!this.muted()?(o=this.play(),jl(o)&&(o=o.catch(a))):r==="muted"&&!this.muted()?o=a():o=this.play(),!!jl(o))return o.then(function(){n.trigger({type:"autoplay-success",autoplay:r})}).catch(function(){n.trigger({type:"autoplay-failure",autoplay:r})})}},t.updateSourceCaches_=function(r){r===void 0&&(r="");var n=r,a="";typeof n!="string"&&(n=r.src,a=r.type),this.cache_.source=this.cache_.source||{},this.cache_.sources=this.cache_.sources||[],n&&!a&&(a=O4(this,n)),this.cache_.source=Et({},r,{src:n,type:a});for(var o=this.cache_.sources.filter(function(g){return g.src&&g.src===n}),l=[],u=this.$$("source"),c=[],h=0;h<u.length;h++){var d=xn(u[h]);l.push(d),d.src&&d.src===n&&c.push(d.src)}c.length&&!o.length?this.cache_.sources=l:o.length||(this.cache_.sources=[this.cache_.source]),this.cache_.src=n},t.handleTechSourceset_=function(r){var n=this;if(!this.changingSrc_){var a=function(c){return n.updateSourceCaches_(c)},o=this.currentSource().src,l=r.src;o&&!/^blob:/.test(o)&&/^blob:/.test(l)&&(!this.lastSource_||this.lastSource_.tech!==l&&this.lastSource_.player!==o)&&(a=function(){}),a(l),r.src||this.tech_.any(["sourceset","loadstart"],function(u){if(u.type!=="sourceset"){var c=n.techGet("currentSrc");n.lastSource_.tech=c,n.updateSourceCaches_(c)}})}this.lastSource_={player:this.currentSource().src,tech:r.src},this.trigger({src:r.src,type:"sourceset"})},t.hasStarted=function(r){if(r===void 0)return this.hasStarted_;r!==this.hasStarted_&&(this.hasStarted_=r,this.hasStarted_?(this.addClass("vjs-has-started"),this.trigger("firstplay")):this.removeClass("vjs-has-started"))},t.handleTechPlay_=function(){this.removeClass("vjs-ended"),this.removeClass("vjs-paused"),this.addClass("vjs-playing"),this.hasStarted(!0),this.trigger("play")},t.handleTechRateChange_=function(){this.tech_.playbackRate()>0&&this.cache_.lastPlaybackRate===0&&(this.queuedCallbacks_.forEach(function(r){return r.callback(r.event)}),this.queuedCallbacks_=[]),this.cache_.lastPlaybackRate=this.tech_.playbackRate(),this.trigger("ratechange")},t.handleTechWaiting_=function(){var r=this;this.addClass("vjs-waiting"),this.trigger("waiting");var n=this.currentTime(),a=function o(){n!==r.currentTime()&&(r.removeClass("vjs-waiting"),r.off("timeupdate",o))};this.on("timeupdate",a)},t.handleTechCanPlay_=function(){this.removeClass("vjs-waiting"),this.trigger("canplay")},t.handleTechCanPlayThrough_=function(){this.removeClass("vjs-waiting"),this.trigger("canplaythrough")},t.handleTechPlaying_=function(){this.removeClass("vjs-waiting"),this.trigger("playing")},t.handleTechSeeking_=function(){this.addClass("vjs-seeking"),this.trigger("seeking")},t.handleTechSeeked_=function(){this.removeClass("vjs-seeking"),this.removeClass("vjs-ended"),this.trigger("seeked")},t.handleTechFirstPlay_=function(){this.options_.starttime&&(Qe.warn("Passing the `starttime` option to the player will be deprecated in 6.0"),this.currentTime(this.options_.starttime)),this.addClass("vjs-has-started"),this.trigger("firstplay")},t.handleTechPause_=function(){this.removeClass("vjs-playing"),this.addClass("vjs-paused"),this.trigger("pause")},t.handleTechEnded_=function(){this.addClass("vjs-ended"),this.removeClass("vjs-waiting"),this.options_.loop?(this.currentTime(0),this.play()):this.paused()||this.pause(),this.trigger("ended")},t.handleTechDurationChange_=function(){this.duration(this.techGet_("duration"))},t.handleTechClick_=function(r){this.controls_&&(this.options_===void 0||this.options_.userActions===void 0||this.options_.userActions.click===void 0||this.options_.userActions.click!==!1)&&(this.options_!==void 0&&this.options_.userActions!==void 0&&typeof this.options_.userActions.click=="function"?this.options_.userActions.click.call(this,r):this.paused()?Yr(this.play()):this.pause())},t.handleTechDoubleClick_=function(r){if(this.controls_){var n=Array.prototype.some.call(this.$$(".vjs-control-bar, .vjs-modal-dialog"),function(a){return a.contains(r.target)});n||(this.options_===void 0||this.options_.userActions===void 0||this.options_.userActions.doubleClick===void 0||this.options_.userActions.doubleClick!==!1)&&(this.options_!==void 0&&this.options_.userActions!==void 0&&typeof this.options_.userActions.doubleClick=="function"?this.options_.userActions.doubleClick.call(this,r):this.isFullscreen()?this.exitFullscreen():this.requestFullscreen())}},t.handleTechTap_=function(){this.userActive(!this.userActive())},t.handleTechTouchStart_=function(){this.userWasActive=this.userActive()},t.handleTechTouchMove_=function(){this.userWasActive&&this.reportUserActivity()},t.handleTechTouchEnd_=function(r){r.cancelable&&r.preventDefault()},t.handleStageClick_=function(){this.reportUserActivity()},t.toggleFullscreenClass_=function(){this.isFullscreen()?this.addClass("vjs-fullscreen"):this.removeClass("vjs-fullscreen")},t.documentFullscreenChange_=function(r){var n=r.target.player;if(!(n&&n!==this)){var a=this.el(),o=ce[this.fsApi_.fullscreenElement]===a;!o&&a.matches?o=a.matches(":"+this.fsApi_.fullscreen):!o&&a.msMatchesSelector&&(o=a.msMatchesSelector(":"+this.fsApi_.fullscreen)),this.isFullscreen(o)}},t.handleTechFullscreenChange_=function(r,n){var a=this;n&&(n.nativeIOSFullscreen&&(this.addClass("vjs-ios-native-fs"),this.tech_.one("webkitendfullscreen",function(){a.removeClass("vjs-ios-native-fs")})),this.isFullscreen(n.isFullscreen))},t.handleTechFullscreenError_=function(r,n){this.trigger("fullscreenerror",n)},t.togglePictureInPictureClass_=function(){this.isInPictureInPicture()?this.addClass("vjs-picture-in-picture"):this.removeClass("vjs-picture-in-picture")},t.handleTechEnterPictureInPicture_=function(r){this.isInPictureInPicture(!0)},t.handleTechLeavePictureInPicture_=function(r){this.isInPictureInPicture(!1)},t.handleTechError_=function(){var r=this.tech_.error();this.error(r)},t.handleTechTextData_=function(){var r=null;arguments.length>1&&(r=arguments[1]),this.trigger("textdata",r)},t.getCache=function(){return this.cache_},t.resetCache_=function(){this.cache_={currentTime:0,initTime:0,inactivityTimeout:this.options_.inactivityTimeout,duration:NaN,lastVolume:1,lastPlaybackRate:this.defaultPlaybackRate(),media:null,src:"",source:{},sources:[],playbackRates:[],volume:1}},t.techCall_=function(r,n){this.ready(function(){if(r in I4)return k4(this.middleware_,this.tech_,r,n);if(r in ob)return ab(this.middleware_,this.tech_,r,n);try{this.tech_&&this.tech_[r](n)}catch(a){throw Qe(a),a}},!0)},t.techGet_=function(r){if(!(!this.tech_||!this.tech_.isReady_)){if(r in A4)return w4(this.middleware_,this.tech_,r);if(r in ob)return ab(this.middleware_,this.tech_,r);try{return this.tech_[r]()}catch(n){throw this.tech_[r]===void 0?(Qe("Video.js: "+r+" method not defined for "+this.techName_+" playback technology.",n),n):n.name==="TypeError"?(Qe("Video.js: "+r+" unavailable on "+this.techName_+" playback technology element.",n),this.tech_.isReady_=!1,n):(Qe(n),n)}}},t.play=function(){var r=this,n=this.options_.Promise||O.Promise;return n?new n(function(a){r.play_(a)}):this.play_()},t.play_=function(r){var n=this;r===void 0&&(r=Yr),this.playCallbacks_.push(r);var a=!!(!this.changingSrc_&&(this.src()||this.currentSrc())),o=!!(od||Oi);if(this.waitToPlay_&&(this.off(["ready","loadstart"],this.waitToPlay_),this.waitToPlay_=null),!this.isReady_||!a){this.waitToPlay_=function(c){n.play_()},this.one(["ready","loadstart"],this.waitToPlay_),!a&&o&&this.load();return}var l=this.techGet_("play"),u=o&&this.hasClass("vjs-ended");u&&this.resetProgressBar_(),l===null?this.runPlayTerminatedQueue_():this.runPlayCallbacks_(l)},t.runPlayTerminatedQueue_=function(){var r=this.playTerminatedQueue_.slice(0);this.playTerminatedQueue_=[],r.forEach(function(n){n()})},t.runPlayCallbacks_=function(r){var n=this.playCallbacks_.slice(0);this.playCallbacks_=[],this.playTerminatedQueue_=[],n.forEach(function(a){a(r)})},t.pause=function(){this.techCall_("pause")},t.paused=function(){return this.techGet_("paused")!==!1},t.played=function(){return this.techGet_("played")||ia(0,0)},t.scrubbing=function(r){if(typeof r>"u")return this.scrubbing_;this.scrubbing_=!!r,this.techCall_("setScrubbing",this.scrubbing_),r?this.addClass("vjs-scrubbing"):this.removeClass("vjs-scrubbing")},t.currentTime=function(r){if(typeof r<"u"){if(r<0&&(r=0),!this.isReady_||this.changingSrc_||!this.tech_||!this.tech_.isReady_){this.cache_.initTime=r,this.off("canplay",this.boundApplyInitTime_),this.one("canplay",this.boundApplyInitTime_);return}this.techCall_("setCurrentTime",r),this.cache_.initTime=0;return}return this.cache_.currentTime=this.techGet_("currentTime")||0,this.cache_.currentTime},t.applyInitTime_=function(){this.currentTime(this.cache_.initTime)},t.duration=function(r){if(r===void 0)return this.cache_.duration!==void 0?this.cache_.duration:NaN;r=parseFloat(r),r<0&&(r=1/0),r!==this.cache_.duration&&(this.cache_.duration=r,r===1/0?this.addClass("vjs-live"):this.removeClass("vjs-live"),isNaN(r)||this.trigger("durationchange"))},t.remainingTime=function(){return this.duration()-this.currentTime()},t.remainingTimeDisplay=function(){return Math.floor(this.duration())-Math.floor(this.currentTime())},t.buffered=function(){var r=this.techGet_("buffered");return(!r||!r.length)&&(r=ia(0,0)),r},t.bufferedPercent=function(){return sk(this.buffered(),this.duration())},t.bufferedEnd=function(){var r=this.buffered(),n=this.duration(),a=r.end(r.length-1);return a>n&&(a=n),a},t.volume=function(r){var n;if(r!==void 0){n=Math.max(0,Math.min(1,parseFloat(r))),this.cache_.volume=n,this.techCall_("setVolume",n),n>0&&this.lastVolume_(n);return}return n=parseFloat(this.techGet_("volume")),isNaN(n)?1:n},t.muted=function(r){if(r!==void 0){this.techCall_("setMuted",r);return}return this.techGet_("muted")||!1},t.defaultMuted=function(r){return r!==void 0?this.techCall_("setDefaultMuted",r):this.techGet_("defaultMuted")||!1},t.lastVolume_=function(r){if(r!==void 0&&r!==0){this.cache_.lastVolume=r;return}return this.cache_.lastVolume},t.supportsFullScreen=function(){return this.techGet_("supportsFullScreen")||!1},t.isFullscreen=function(r){if(r!==void 0){var n=this.isFullscreen_;this.isFullscreen_=!!r,this.isFullscreen_!==n&&this.fsApi_.prefixed&&this.trigger("fullscreenchange"),this.toggleFullscreenClass_();return}return this.isFullscreen_},t.requestFullscreen=function(r){var n=this.options_.Promise||O.Promise;if(n){var a=this;return new n(function(o,l){function u(){a.off("fullscreenerror",h),a.off("fullscreenchange",c)}function c(){u(),o()}function h(g,y){u(),l(y)}a.one("fullscreenchange",c),a.one("fullscreenerror",h);var d=a.requestFullscreenHelper_(r);d&&(d.then(u,u),d.then(o,l))})}return this.requestFullscreenHelper_()},t.requestFullscreenHelper_=function(r){var n=this,a;if(this.fsApi_.prefixed||(a=this.options_.fullscreen&&this.options_.fullscreen.options||{},r!==void 0&&(a=r)),this.fsApi_.requestFullscreen){var o=this.el_[this.fsApi_.requestFullscreen](a);return o&&o.then(function(){return n.isFullscreen(!0)},function(){return n.isFullscreen(!1)}),o}else this.tech_.supportsFullScreen()&&!this.options_.preferFullWindow?this.techCall_("enterFullScreen"):this.enterFullWindow()},t.exitFullscreen=function(){var r=this.options_.Promise||O.Promise;if(r){var n=this;return new r(function(a,o){function l(){n.off("fullscreenerror",c),n.off("fullscreenchange",u)}function u(){l(),a()}function c(d,g){l(),o(g)}n.one("fullscreenchange",u),n.one("fullscreenerror",c);var h=n.exitFullscreenHelper_();h&&(h.then(l,l),h.then(a,o))})}return this.exitFullscreenHelper_()},t.exitFullscreenHelper_=function(){var r=this;if(this.fsApi_.requestFullscreen){var n=ce[this.fsApi_.exitFullscreen]();return n&&Yr(n.then(function(){return r.isFullscreen(!1)})),n}else this.tech_.supportsFullScreen()&&!this.options_.preferFullWindow?this.techCall_("exitFullScreen"):this.exitFullWindow()},t.enterFullWindow=function(){this.isFullscreen(!0),this.isFullWindow=!0,this.docOrigOverflow=ce.documentElement.style.overflow,or(ce,"keydown",this.boundFullWindowOnEscKey_),ce.documentElement.style.overflow="hidden",Pn(ce.body,"vjs-full-window"),this.trigger("enterFullWindow")},t.fullWindowOnEscKey=function(r){Ge.isEventKey(r,"Esc")&&this.isFullscreen()===!0&&(this.isFullWindow?this.exitFullWindow():this.exitFullscreen())},t.exitFullWindow=function(){this.isFullscreen(!1),this.isFullWindow=!1,Ti(ce,"keydown",this.boundFullWindowOnEscKey_),ce.documentElement.style.overflow=this.docOrigOverflow,mu(ce.body,"vjs-full-window"),this.trigger("exitFullWindow")},t.disablePictureInPicture=function(r){if(r===void 0)return this.techGet_("disablePictureInPicture");this.techCall_("setDisablePictureInPicture",r),this.options_.disablePictureInPicture=r,this.trigger("disablepictureinpicturechanged")},t.isInPictureInPicture=function(r){if(r!==void 0){this.isInPictureInPicture_=!!r,this.togglePictureInPictureClass_();return}return!!this.isInPictureInPicture_},t.requestPictureInPicture=function(){if("pictureInPictureEnabled"in ce&&this.disablePictureInPicture()===!1)return this.techGet_("requestPictureInPicture")},t.exitPictureInPicture=function(){if("pictureInPictureEnabled"in ce)return ce.exitPictureInPicture()},t.handleKeyDown=function(r){var n=this.options_.userActions;if(!(!n||!n.hotkeys)){var a=function(l){var u=l.tagName.toLowerCase();if(l.isContentEditable)return!0;var c=["button","checkbox","hidden","radio","reset","submit"];if(u==="input")return c.indexOf(l.type)===-1;var h=["textarea"];return h.indexOf(u)!==-1};a(this.el_.ownerDocument.activeElement)||(typeof n.hotkeys=="function"?n.hotkeys.call(this,r):this.handleHotkeys(r))}},t.handleHotkeys=function(r){var n=this.options_.userActions?this.options_.userActions.hotkeys:{},a=n.fullscreenKey,o=a===void 0?function(p){return Ge.isEventKey(p,"f")}:a,l=n.muteKey,u=l===void 0?function(p){return Ge.isEventKey(p,"m")}:l,c=n.playPauseKey,h=c===void 0?function(p){return Ge.isEventKey(p,"k")||Ge.isEventKey(p,"Space")}:c;if(o.call(this,r)){r.preventDefault(),r.stopPropagation();var d=be.getComponent("FullscreenToggle");ce[this.fsApi_.fullscreenEnabled]!==!1&&d.prototype.handleClick.call(this,r)}else if(u.call(this,r)){r.preventDefault(),r.stopPropagation();var g=be.getComponent("MuteToggle");g.prototype.handleClick.call(this,r)}else if(h.call(this,r)){r.preventDefault(),r.stopPropagation();var y=be.getComponent("PlayToggle");y.prototype.handleClick.call(this,r)}},t.canPlayType=function(r){for(var n,a=0,o=this.options_.techOrder;a<o.length;a++){var l=o[a],u=yt.getTech(l);if(u||(u=be.getComponent(l)),!u){Qe.error('The "'+l+'" tech is undefined. Skipped browser support check for that tech.');continue}if(u.isSupported()&&(n=u.canPlayType(r),n))return n}return""},t.selectSource=function(r){var n=this,a=this.options_.techOrder.map(function(h){return[h,yt.getTech(h)]}).filter(function(h){var d=h[0],g=h[1];return g?g.isSupported():(Qe.error('The "'+d+'" tech is undefined. Skipped browser support check for that tech.'),!1)}),o=function(d,g,y){var p;return d.some(function(_){return g.some(function(k){if(p=y(_,k),p)return!0})}),p},l,u=function(d){return function(g,y){return d(y,g)}},c=function(d,g){var y=d[0],p=d[1];if(p.canPlaySource(g,n.options_[y.toLowerCase()]))return{source:g,tech:y}};return this.options_.sourceOrder?l=o(r,a,u(c)):l=o(a,r,c),l||!1},t.handleSrc_=function(r,n){var a=this;if(typeof r>"u")return this.cache_.src||"";this.resetRetryOnError_&&this.resetRetryOnError_();var o=M4(r);if(!o.length){this.setTimeout(function(){this.error({code:4,message:this.options_.notSupportedMessage})},0);return}if(this.changingSrc_=!0,n||(this.cache_.sources=o),this.updateSourceCaches_(o[0]),C4(this,o[0],function(c,h){a.middleware_=h,n||(a.cache_.sources=o),a.updateSourceCaches_(c);var d=a.src_(c);if(d){if(o.length>1)return a.handleSrc_(o.slice(1));a.changingSrc_=!1,a.setTimeout(function(){this.error({code:4,message:this.options_.notSupportedMessage})},0),a.triggerReady();return}E4(h,a.tech_)}),this.options_.retryOnError&&o.length>1){var l=function(){a.error(null),a.handleSrc_(o.slice(1),!0)},u=function(){a.off("error",l)};this.one("error",l),this.one("playing",u),this.resetRetryOnError_=function(){a.off("error",l),a.off("playing",u)}}},t.src=function(r){return this.handleSrc_(r,!1)},t.src_=function(r){var n=this,a=this.selectSource([r]);return a?s4(a.tech,this.techName_)?(this.ready(function(){this.tech_.constructor.prototype.hasOwnProperty("setSource")?this.techCall_("setSource",r):this.techCall_("src",r.src),this.changingSrc_=!1},!0),!1):(this.changingSrc_=!0,this.loadTech_(a.tech,a.source),this.tech_.ready(function(){n.changingSrc_=!1}),!1):!0},t.load=function(){this.techCall_("load")},t.reset=function(){var r=this,n=this.options_.Promise||O.Promise;if(this.paused()||!n)this.doReset_();else{var a=this.play();Yr(a.then(function(){return r.doReset_()}))}},t.doReset_=function(){this.tech_&&this.tech_.clearTracks("text"),this.resetCache_(),this.poster(""),this.loadTech_(this.options_.techOrder[0],null),this.techCall_("reset"),this.resetControlBarUI_(),Dn(this)&&this.trigger("playerreset")},t.resetControlBarUI_=function(){this.resetProgressBar_(),this.resetPlaybackRate_(),this.resetVolumeBar_()},t.resetProgressBar_=function(){this.currentTime(0);var r=this.controlBar||{},n=r.durationDisplay,a=r.remainingTimeDisplay;n&&n.updateContent(),a&&a.updateContent()},t.resetPlaybackRate_=function(){this.playbackRate(this.defaultPlaybackRate()),this.handleTechRateChange_()},t.resetVolumeBar_=function(){this.volume(1),this.trigger("volumechange")},t.currentSources=function(){var r=this.currentSource(),n=[];return Object.keys(r).length!==0&&n.push(r),this.cache_.sources||n},t.currentSource=function(){return this.cache_.source||{}},t.currentSrc=function(){return this.currentSource()&&this.currentSource().src||""},t.currentType=function(){return this.currentSource()&&this.currentSource().type||""},t.preload=function(r){if(r!==void 0){this.techCall_("setPreload",r),this.options_.preload=r;return}return this.techGet_("preload")},t.autoplay=function(r){if(r===void 0)return this.options_.autoplay||!1;var n;typeof r=="string"&&/(any|play|muted)/.test(r)||r===!0&&this.options_.normalizeAutoplay?(this.options_.autoplay=r,this.manualAutoplay_(typeof r=="string"?r:"play"),n=!1):r?this.options_.autoplay=!0:this.options_.autoplay=!1,n=typeof n>"u"?this.options_.autoplay:n,this.tech_&&this.techCall_("setAutoplay",n)},t.playsinline=function(r){return r!==void 0?(this.techCall_("setPlaysinline",r),this.options_.playsinline=r,this):this.techGet_("playsinline")},t.loop=function(r){if(r!==void 0){this.techCall_("setLoop",r),this.options_.loop=r;return}return this.techGet_("loop")},t.poster=function(r){if(r===void 0)return this.poster_;r||(r=""),r!==this.poster_&&(this.poster_=r,this.techCall_("setPoster",r),this.isPosterFromTech_=!1,this.trigger("posterchange"))},t.handleTechPosterChange_=function(){if((!this.poster_||this.options_.techCanOverridePoster)&&this.tech_&&this.tech_.poster){var r=this.tech_.poster()||"";r!==this.poster_&&(this.poster_=r,this.isPosterFromTech_=!0,this.trigger("posterchange"))}},t.controls=function(r){if(r===void 0)return!!this.controls_;r=!!r,this.controls_!==r&&(this.controls_=r,this.usingNativeControls()&&this.techCall_("setControls",r),this.controls_?(this.removeClass("vjs-controls-disabled"),this.addClass("vjs-controls-enabled"),this.trigger("controlsenabled"),this.usingNativeControls()||this.addTechControlsListeners_()):(this.removeClass("vjs-controls-enabled"),this.addClass("vjs-controls-disabled"),this.trigger("controlsdisabled"),this.usingNativeControls()||this.removeTechControlsListeners_()))},t.usingNativeControls=function(r){if(r===void 0)return!!this.usingNativeControls_;r=!!r,this.usingNativeControls_!==r&&(this.usingNativeControls_=r,this.usingNativeControls_?(this.addClass("vjs-using-native-controls"),this.trigger("usingnativecontrols")):(this.removeClass("vjs-using-native-controls"),this.trigger("usingcustomcontrols")))},t.error=function(r){var n=this;if(r===void 0)return this.error_||null;if(us("beforeerror").forEach(function(o){var l=o(n,r);if(!(Nn(l)&&!Array.isArray(l)||typeof l=="string"||typeof l=="number"||l===null)){n.log.error("please return a value that MediaError expects in beforeerror hooks");return}r=l}),this.options_.suppressNotSupportedError&&r&&r.code===4){var a=function(){this.error(r)};this.options_.suppressNotSupportedError=!1,this.any(["click","touchstart"],a),this.one("loadstart",function(){this.off(["click","touchstart"],a)});return}if(r===null){this.error_=r,this.removeClass("vjs-error"),this.errorDisplay&&this.errorDisplay.close();return}this.error_=new Ni(r),this.addClass("vjs-error"),Qe.error("(CODE:"+this.error_.code+" "+Ni.errorTypes[this.error_.code]+")",this.error_.message,this.error_),this.trigger("error"),us("error").forEach(function(o){return o(n,n.error_)})},t.reportUserActivity=function(r){this.userActivity_=!0},t.userActive=function(r){if(r===void 0)return this.userActive_;if(r=!!r,r!==this.userActive_){if(this.userActive_=r,this.userActive_){this.userActivity_=!0,this.removeClass("vjs-user-inactive"),this.addClass("vjs-user-active"),this.trigger("useractive");return}this.tech_&&this.tech_.one("mousemove",function(n){n.stopPropagation(),n.preventDefault()}),this.userActivity_=!1,this.removeClass("vjs-user-active"),this.addClass("vjs-user-inactive"),this.trigger("userinactive")}},t.listenForUserActivity_=function(){var r,n,a,o=wt(this,this.reportUserActivity),l=function(y){(y.screenX!==n||y.screenY!==a)&&(n=y.screenX,a=y.screenY,o())},u=function(){o(),this.clearInterval(r),r=this.setInterval(o,250)},c=function(y){o(),this.clearInterval(r)};this.on("mousedown",u),this.on("mousemove",l),this.on("mouseup",c),this.on("mouseleave",c);var h=this.getChild("controlBar");h&&!Oi&&!On&&(h.on("mouseenter",function(g){this.player().options_.inactivityTimeout!==0&&(this.player().cache_.inactivityTimeout=this.player().options_.inactivityTimeout),this.player().options_.inactivityTimeout=0}),h.on("mouseleave",function(g){this.player().options_.inactivityTimeout=this.player().cache_.inactivityTimeout})),this.on("keydown",o),this.on("keyup",o);var d;this.setInterval(function(){if(this.userActivity_){this.userActivity_=!1,this.userActive(!0),this.clearTimeout(d);var g=this.options_.inactivityTimeout;g<=0||(d=this.setTimeout(function(){this.userActivity_||this.userActive(!1)},g))}},250)},t.playbackRate=function(r){if(r!==void 0){this.techCall_("setPlaybackRate",r);return}return this.tech_&&this.tech_.featuresPlaybackRate?this.cache_.lastPlaybackRate||this.techGet_("playbackRate"):1},t.defaultPlaybackRate=function(r){return r!==void 0?this.techCall_("setDefaultPlaybackRate",r):this.tech_&&this.tech_.featuresPlaybackRate?this.techGet_("defaultPlaybackRate"):1},t.isAudio=function(r){if(r!==void 0){this.isAudio_=!!r;return}return!!this.isAudio_},t.enableAudioOnlyUI_=function(){var r=this;this.addClass("vjs-audio-only-mode");var n=this.children(),a=this.getChild("ControlBar"),o=a&&a.currentHeight();n.forEach(function(l){l!==a&&l.el_&&!l.hasClass("vjs-hidden")&&(l.hide(),r.audioOnlyCache_.hiddenChildren.push(l))}),this.audioOnlyCache_.playerHeight=this.currentHeight(),this.height(o),this.trigger("audioonlymodechange")},t.disableAudioOnlyUI_=function(){this.removeClass("vjs-audio-only-mode"),this.audioOnlyCache_.hiddenChildren.forEach(function(r){return r.show()}),this.height(this.audioOnlyCache_.playerHeight),this.trigger("audioonlymodechange")},t.audioOnlyMode=function(r){var n=this;if(typeof r!="boolean"||r===this.audioOnlyMode_)return this.audioOnlyMode_;this.audioOnlyMode_=r;var a=this.options_.Promise||O.Promise;if(a){if(r){var o=[];return this.isInPictureInPicture()&&o.push(this.exitPictureInPicture()),this.isFullscreen()&&o.push(this.exitFullscreen()),this.audioPosterMode()&&o.push(this.audioPosterMode(!1)),a.all(o).then(function(){return n.enableAudioOnlyUI_()})}return a.resolve().then(function(){return n.disableAudioOnlyUI_()})}r?(this.isInPictureInPicture()&&this.exitPictureInPicture(),this.isFullscreen()&&this.exitFullscreen(),this.enableAudioOnlyUI_()):this.disableAudioOnlyUI_()},t.enablePosterModeUI_=function(){var r=this.tech_&&this.tech_;r.hide(),this.addClass("vjs-audio-poster-mode"),this.trigger("audiopostermodechange")},t.disablePosterModeUI_=function(){var r=this.tech_&&this.tech_;r.show(),this.removeClass("vjs-audio-poster-mode"),this.trigger("audiopostermodechange")},t.audioPosterMode=function(r){var n=this;if(typeof r!="boolean"||r===this.audioPosterMode_)return this.audioPosterMode_;this.audioPosterMode_=r;var a=this.options_.Promise||O.Promise;if(a){if(r){if(this.audioOnlyMode()){var o=this.audioOnlyMode(!1);return o.then(function(){n.enablePosterModeUI_()})}return a.resolve().then(function(){n.enablePosterModeUI_()})}return a.resolve().then(function(){n.disablePosterModeUI_()})}if(r){this.audioOnlyMode()&&this.audioOnlyMode(!1),this.enablePosterModeUI_();return}this.disablePosterModeUI_()},t.addTextTrack=function(r,n,a){if(this.tech_)return this.tech_.addTextTrack(r,n,a)},t.addRemoteTextTrack=function(r,n){if(this.tech_)return this.tech_.addRemoteTextTrack(r,n)},t.removeRemoteTextTrack=function(r){r===void 0&&(r={});var n=r,a=n.track;if(a||(a=r),this.tech_)return this.tech_.removeRemoteTextTrack(a)},t.getVideoPlaybackQuality=function(){return this.techGet_("getVideoPlaybackQuality")},t.videoWidth=function(){return this.tech_&&this.tech_.videoWidth&&this.tech_.videoWidth()||0},t.videoHeight=function(){return this.tech_&&this.tech_.videoHeight&&this.tech_.videoHeight()||0},t.language=function(r){if(r===void 0)return this.language_;this.language_!==String(r).toLowerCase()&&(this.language_=String(r).toLowerCase(),Dn(this)&&this.trigger("languagechange"))},t.languages=function(){return Et(e.prototype.options_.languages,this.languages_)},t.toJSON=function(){var r=Et(this.options_),n=r.tracks;r.tracks=[];for(var a=0;a<n.length;a++){var o=n[a];o=Et(o),o.player=void 0,r.tracks[a]=o}return r},t.createModal=function(r,n){var a=this;n=n||{},n.content=r||"";var o=new Ho(this,n);return this.addChild(o),o.on("dispose",function(){a.removeChild(o)}),o.open(),o},t.updateCurrentBreakpoint_=function(){if(this.responsive())for(var r=this.currentBreakpoint(),n=this.currentWidth(),a=0;a<pv.length;a++){var o=pv[a],l=this.breakpoints_[o];if(n<=l){if(r===o)return;r&&this.removeClass(Rc[r]),this.addClass(Rc[o]),this.breakpoint_=o;break}}},t.removeCurrentBreakpoint_=function(){var r=this.currentBreakpointClass();this.breakpoint_="",r&&this.removeClass(r)},t.breakpoints=function(r){return r===void 0?jt(this.breakpoints_):(this.breakpoint_="",this.breakpoints_=jt({},h8,r),this.updateCurrentBreakpoint_(),jt(this.breakpoints_))},t.responsive=function(r){if(r===void 0)return this.responsive_;r=!!r;var n=this.responsive_;if(r!==n)return this.responsive_=r,r?(this.on("playerresize",this.boundUpdateCurrentBreakpoint_),this.updateCurrentBreakpoint_()):(this.off("playerresize",this.boundUpdateCurrentBreakpoint_),this.removeCurrentBreakpoint_()),r},t.currentBreakpoint=function(){return this.breakpoint_},t.currentBreakpointClass=function(){return Rc[this.breakpoint_]||""},t.loadMedia=function(r,n){var a=this;if(!(!r||typeof r!="object")){this.reset(),this.cache_.media=Et(r);var o=this.cache_.media,l=o.artwork,u=o.poster,c=o.src,h=o.textTracks;!l&&u&&(this.cache_.media.artwork=[{src:u,type:ph(u)}]),c&&this.src(c),u&&this.poster(u),Array.isArray(h)&&h.forEach(function(d){return a.addRemoteTextTrack(d,!1)}),this.ready(n)}},t.getMedia=function(){if(!this.cache_.media){var r=this.poster(),n=this.currentSources(),a=Array.prototype.map.call(this.remoteTextTracks(),function(l){return{kind:l.kind,label:l.label,language:l.language,src:l.src}}),o={src:n,textTracks:a};return r&&(o.poster=r,o.artwork=[{src:o.poster,type:ph(o.poster)}]),o}return Et(this.cache_.media)},e.getTagSettings=function(r){var n={sources:[],tracks:[]},a=xn(r),o=a["data-setup"];if(ta(r,"vjs-fill")&&(a.fill=!0),ta(r,"vjs-fluid")&&(a.fluid=!0),o!==null){var l=tF(o||"{}"),u=l[0],c=l[1];u&&Qe.error(u),jt(a,c)}if(jt(n,a),r.hasChildNodes())for(var h=r.childNodes,d=0,g=h.length;d<g;d++){var y=h[d],p=y.nodeName.toLowerCase();p==="source"?n.sources.push(xn(y)):p==="track"&&n.tracks.push(xn(y))}return n},t.flexNotSupported_=function(){var r=ce.createElement("i");return!("flexBasis"in r.style||"webkitFlexBasis"in r.style||"mozFlexBasis"in r.style||"msFlexBasis"in r.style||"msFlexOrder"in r.style)},t.debug=function(r){if(r===void 0)return this.debugEnabled_;r?(this.trigger("debugon"),this.previousLogLevel_=this.log.level,this.log.level("debug"),this.debugEnabled_=!0):(this.trigger("debugoff"),this.log.level(this.previousLogLevel_),this.previousLogLevel_=void 0,this.debugEnabled_=!1)},t.playbackRates=function(r){if(r===void 0)return this.cache_.playbackRates;Array.isArray(r)&&r.every(function(n){return typeof n=="number"})&&(this.cache_.playbackRates=r,this.trigger("playbackrateschange"))},e}(be);ki.names.forEach(function(s){var e=ki[s];Gt.prototype[e.getterName]=function(){return this.tech_?this.tech_[e.getterName]():(this[e.privateName]=this[e.privateName]||new e.ListClass,this[e.privateName])}});Gt.prototype.crossorigin=Gt.prototype.crossOrigin;Gt.players={};var Tl=O.navigator;Gt.prototype.options_={techOrder:yt.defaultTechOrder_,html5:{},inactivityTimeout:2e3,playbackRates:[],liveui:!1,children:["mediaLoader","posterImage","textTrackDisplay","loadingSpinner","bigPlayButton","liveTracker","controlBar","errorDisplay","textTrackSettings","resizeManager"],language:Tl&&(Tl.languages&&Tl.languages[0]||Tl.userLanguage||Tl.language)||"en",languages:{},notSupportedMessage:"No compatible source was found for this media.",normalizeAutoplay:!1,fullscreen:{options:{navigationUI:"hide"}},breakpoints:{},responsive:!1,audioOnlyMode:!1,audioPosterMode:!1};["ended","seeking","seekable","networkState","readyState"].forEach(function(s){Gt.prototype[s]=function(){return this.techGet_(s)}});Mk.forEach(function(s){Gt.prototype["handleTech"+zt(s)+"_"]=function(){return this.trigger(s)}});be.registerComponent("Player",Gt);var vh="plugin",lo="activePlugins_",Xa={},yh=function(e){return Xa.hasOwnProperty(e)},Fc=function(e){return yh(e)?Xa[e]:void 0},Rk=function(e,t){e[lo]=e[lo]||{},e[lo][t]=!0},_h=function(e,t,i){var r=(i?"before":"")+"pluginsetup";e.trigger(r,t),e.trigger(r+":"+t.name,t)},d8=function(e,t){var i=function(){_h(this,{name:e,plugin:t,instance:null},!0);var n=t.apply(this,arguments);return Rk(this,e),_h(this,{name:e,plugin:t,instance:n}),n};return Object.keys(t).forEach(function(r){i[r]=t[r]}),i},bb=function(e,t){return t.prototype.name=e,function(){_h(this,{name:e,plugin:t,instance:null},!0);for(var i=arguments.length,r=new Array(i),n=0;n<i;n++)r[n]=arguments[n];var a=pw(t,[this].concat(r));return this[e]=function(){return a},_h(this,a.getEventHash()),a}},an=function(){function s(t){if(this.constructor===s)throw new Error("Plugin must be sub-classed; not directly instantiated.");this.player=t,this.log||(this.log=this.player.log.createLogger(this.name)),F0(this),delete this.trigger,nk(this,this.constructor.defaultState),Rk(t,this.name),this.dispose=this.dispose.bind(this),t.on("dispose",this.dispose)}var e=s.prototype;return e.version=function(){return this.constructor.VERSION},e.getEventHash=function(i){return i===void 0&&(i={}),i.name=this.name,i.plugin=this.constructor,i.instance=this,i},e.trigger=function(i,r){return r===void 0&&(r={}),Vo(this.eventBusEl_,i,this.getEventHash(r))},e.handleStateChanged=function(i){},e.dispose=function(){var i=this.name,r=this.player;this.trigger("dispose"),this.off(),r.off("dispose",this.dispose),r[lo][i]=!1,this.player=this.state=null,r[i]=bb(i,Xa[i])},s.isBasic=function(i){var r=typeof i=="string"?Fc(i):i;return typeof r=="function"&&!s.prototype.isPrototypeOf(r.prototype)},s.registerPlugin=function(i,r){if(typeof i!="string")throw new Error('Illegal plugin name, "'+i+'", must be a string, was '+typeof i+".");if(yh(i))Qe.warn('A plugin named "'+i+'" already exists. You may want to avoid re-registering plugins!');else if(Gt.prototype.hasOwnProperty(i))throw new Error('Illegal plugin name, "'+i+'", cannot share a name with an existing player method!');if(typeof r!="function")throw new Error('Illegal plugin for "'+i+'", must be a function, was '+typeof r+".");return Xa[i]=r,i!==vh&&(s.isBasic(r)?Gt.prototype[i]=d8(i,r):Gt.prototype[i]=bb(i,r)),r},s.deregisterPlugin=function(i){if(i===vh)throw new Error("Cannot de-register base plugin.");yh(i)&&(delete Xa[i],delete Gt.prototype[i])},s.getPlugins=function(i){i===void 0&&(i=Object.keys(Xa));var r;return i.forEach(function(n){var a=Fc(n);a&&(r=r||{},r[n]=a)}),r},s.getPluginVersion=function(i){var r=Fc(i);return r&&r.VERSION||""},s}();an.getPlugin=Fc;an.BASE_PLUGIN_NAME=vh;an.registerPlugin(vh,an);Gt.prototype.usingPlugin=function(s){return!!this[lo]&&this[lo][s]===!0};Gt.prototype.hasPlugin=function(s){return!!yh(s)};var Sb=!1,f8=function(e,t){t===void 0&&(t={}),Sb||(Qe.warn("videojs.extend is deprecated as of Video.js 7.22.0 and will be removed in Video.js 8.0.0"),Sb=!0);var i=function(){e.apply(this,arguments)},r={};typeof t=="object"?(t.constructor!==Object.prototype.constructor&&(i=t.constructor),r=t):typeof t=="function"&&(i=t),sF(i,e),e&&(i.super_=e);for(var n in r)r.hasOwnProperty(n)&&(i.prototype[n]=r[n]);return i},Fk=function(e){return e.indexOf("#")===0?e.slice(1):e};function ae(s,e,t){var i=ae.getPlayer(s);if(i)return e&&Qe.warn('Player "'+s+'" is already initialised. Options will not be applied.'),t&&i.ready(t),i;var r=typeof s=="string"?cs("#"+Fk(s)):s;if(!qo(r))throw new TypeError("The element or ID supplied is not valid. (videojs)");(!r.ownerDocument.defaultView||!r.ownerDocument.body.contains(r))&&Qe.warn("The element supplied is not included in the DOM"),e=e||{},e.restoreEl===!0&&(e.restoreEl=(r.parentNode&&r.parentNode.hasAttribute("data-vjs-player")?r.parentNode:r).cloneNode(!0)),us("beforesetup").forEach(function(a){var o=a(r,Et(e));if(!Nn(o)||Array.isArray(o)){Qe.error("please return an object in beforesetup hooks");return}e=Et(e,o)});var n=be.getComponent("Player");return i=new n(r,e,t),us("setup").forEach(function(a){return a(i)}),i}ae.hooks_=wn;ae.hooks=us;ae.hook=$B;ae.hookOnce=jB;ae.removeHook=Iw;if(O.VIDEOJS_NO_DYNAMIC_STYLE!==!0&&jo()){var gc=cs(".vjs-styles-defaults");if(!gc){gc=Jw("vjs-styles-defaults");var fp=cs("head");fp&&fp.insertBefore(gc,fp.firstChild),Zw(gc,`
270
- .video-js {
271
- width: 300px;
272
- height: 150px;
273
- }
274
-
275
- .vjs-fluid:not(.vjs-audio-only-mode) {
276
- padding-top: 56.25%
277
- }
278
- `)}}lv(1,ae);ae.VERSION=Aw;ae.options=Gt.prototype.options_;ae.getPlayers=function(){return Gt.players};ae.getPlayer=function(s){var e=Gt.players,t;if(typeof s=="string"){var i=Fk(s),r=e[i];if(r)return r;t=cs("#"+i)}else t=s;if(qo(t)){var n=t,a=n.player,o=n.playerId;if(a||e[o])return a||e[o]}};ae.getAllPlayers=function(){return Object.keys(Gt.players).map(function(s){return Gt.players[s]}).filter(Boolean)};ae.players=Gt.players;ae.getComponent=be.getComponent;ae.registerComponent=function(s,e){yt.isTech(e)&&Qe.warn("The "+s+" tech was registered as a component. It should instead be registered using videojs.registerTech(name, tech)"),be.registerComponent.call(be,s,e)};ae.getTech=yt.getTech;ae.registerTech=yt.registerTech;ae.use=x4;Object.defineProperty(ae,"middleware",{value:{},writeable:!1,enumerable:!0});Object.defineProperty(ae.middleware,"TERMINATOR",{value:fh,writeable:!1,enumerable:!0});ae.browser=GB;ae.TOUCH_ENABLED=Eo;ae.extend=f8;ae.mergeOptions=Et;ae.bind=wt;ae.registerPlugin=an.registerPlugin;ae.deregisterPlugin=an.deregisterPlugin;ae.plugin=function(s,e){return Qe.warn("videojs.plugin() is deprecated; use videojs.registerPlugin() instead"),an.registerPlugin(s,e)};ae.getPlugins=an.getPlugins;ae.getPlugin=an.getPlugin;ae.getPluginVersion=an.getPluginVersion;ae.addLanguage=function(s,e){var t;return s=(""+s).toLowerCase(),ae.options.languages=Et(ae.options.languages,(t={},t[s]=e,t)),ae.options.languages[s]};ae.log=Qe;ae.createLogger=Dw;ae.createTimeRange=ae.createTimeRanges=ia;ae.formatTime=Po;ae.setFormatTime=q4;ae.resetFormatTime=V4;ae.parseUrl=U0;ae.isCrossOrigin=fd;ae.EventTarget=ai;ae.on=or;ae.one=hd;ae.off=Ti;ae.trigger=Vo;ae.xhr=dw;ae.TextTrack=gu;ae.AudioTrack=lk;ae.VideoTrack=uk;["isEl","isTextNode","createEl","hasClass","addClass","removeClass","toggleClass","setAttributes","getAttributes","emptyEl","appendContent","insertContent"].forEach(function(s){ae[s]=function(){return Qe.warn("videojs."+s+"() is deprecated; use videojs.dom."+s+"() instead"),Qw[s].apply(null,arguments)}});ae.computedStyle=Zl;ae.dom=Qw;ae.url=_4;ae.defineLazyProperty=ny;ae.addLanguage("en",{"Non-Fullscreen":"Exit Fullscreen"});/*! @name @videojs/http-streaming @version 2.16.3 @license Apache-2.0 */var Pr=rd,Th=function(e,t,i){return e&&i&&i.responseURL&&t!==i.responseURL?i.responseURL:t},Mr=function(e){return ae.log.debug?ae.log.debug.bind(ae,"VHS:",e+" >"):function(){}},hs=1/30,Jr=hs*3,Bk=function(e,t){var i=[],r;if(e&&e.length)for(r=0;r<e.length;r++)t(e.start(r),e.end(r))&&i.push([e.start(r),e.end(r)]);return ae.createTimeRanges(i)},Qa=function(e,t){return Bk(e,function(i,r){return i-Jr<=t&&r+Jr>=t})},vc=function(e,t){return Bk(e,function(i){return i-hs>=t})},p8=function(e){if(e.length<2)return ae.createTimeRanges();for(var t=[],i=1;i<e.length;i++){var r=e.end(i-1),n=e.start(i);t.push([r,n])}return ae.createTimeRanges(t)},m8=function(e,t){var i=null,r=null,n=0,a=[],o=[];if(!e||!e.length||!t||!t.length)return ae.createTimeRange();for(var l=e.length;l--;)a.push({time:e.start(l),type:"start"}),a.push({time:e.end(l),type:"end"});for(l=t.length;l--;)a.push({time:t.start(l),type:"start"}),a.push({time:t.end(l),type:"end"});for(a.sort(function(u,c){return u.time-c.time}),l=0;l<a.length;l++)a[l].type==="start"?(n++,n===2&&(i=a[l].time)):a[l].type==="end"&&(n--,n===1&&(r=a[l].time)),i!==null&&r!==null&&(o.push([i,r]),i=null,r=null);return ae.createTimeRanges(o)},Uk=function(e){var t=[];if(!e||!e.length)return"";for(var i=0;i<e.length;i++)t.push(e.start(i)+" => "+e.end(i));return t.join(", ")},g8=function(e,t,i){i===void 0&&(i=1);var r=e.length?e.end(e.length-1):0;return(r-t)/i},Hs=function(e){for(var t=[],i=0;i<e.length;i++)t.push({start:e.start(i),end:e.end(i)});return t},v8=function(e,t){if(e===t)return!1;if(!e&&t||!t&&e||e.length!==t.length)return!0;for(var i=0;i<e.length;i++)if(e.start(i)!==t.start(i)||e.end(i)!==t.end(i))return!0;return!1},xb=function(e){if(!(!e||!e.length||!e.end))return e.end(e.length-1)},sy=function(e,t){var i=0;if(!e||!e.length)return i;for(var r=0;r<e.length;r++){var n=e.start(r),a=e.end(r);if(!(t>a)){if(t>n&&t<=a){i+=a-t;continue}i+=a-n}}return i},Cb=ae.createTimeRange,ay=function(e,t){if(!t.preload)return t.duration;var i=0;return(t.parts||[]).forEach(function(r){i+=r.duration}),(t.preloadHints||[]).forEach(function(r){r.type==="PART"&&(i+=e.partTargetDuration)}),i},mv=function(e){return(e.segments||[]).reduce(function(t,i,r){return i.parts?i.parts.forEach(function(n,a){t.push({duration:n.duration,segmentIndex:r,partIndex:a,part:n,segment:i})}):t.push({duration:i.duration,segmentIndex:r,partIndex:null,segment:i,part:null}),t},[])},$k=function(e){var t=e.segments&&e.segments.length&&e.segments[e.segments.length-1];return t&&t.parts||[]},jk=function(e){var t=e.preloadSegment;if(t){var i=t.parts,r=t.preloadHints,n=(r||[]).reduce(function(a,o){return a+(o.type==="PART"?1:0)},0);return n+=i&&i.length?i.length:0,n}},qk=function(e,t){if(t.endList)return 0;if(e&&e.suggestedPresentationDelay)return e.suggestedPresentationDelay;var i=$k(t).length>0;return i&&t.serverControl&&t.serverControl.partHoldBack?t.serverControl.partHoldBack:i&&t.partTargetDuration?t.partTargetDuration*3:t.serverControl&&t.serverControl.holdBack?t.serverControl.holdBack:t.targetDuration?t.targetDuration*3:0},y8=function(e,t){var i=0,r=t-e.mediaSequence,n=e.segments[r];if(n){if(typeof n.start<"u")return{result:n.start,precise:!0};if(typeof n.end<"u")return{result:n.end-n.duration,precise:!0}}for(;r--;){if(n=e.segments[r],typeof n.end<"u")return{result:i+n.end,precise:!0};if(i+=ay(e,n),typeof n.start<"u")return{result:i+n.start,precise:!0}}return{result:i,precise:!1}},_8=function(e,t){for(var i=0,r,n=t-e.mediaSequence;n<e.segments.length;n++){if(r=e.segments[n],typeof r.start<"u")return{result:r.start-i,precise:!0};if(i+=ay(e,r),typeof r.end<"u")return{result:r.end-i,precise:!0}}return{result:-1,precise:!1}},Vk=function(e,t,i){if(typeof t>"u"&&(t=e.mediaSequence+e.segments.length),t<e.mediaSequence)return 0;var r=y8(e,t);if(r.precise)return r.result;var n=_8(e,t);return n.precise?n.result:r.result+i},Hk=function(e,t,i){if(!e)return 0;if(typeof i!="number"&&(i=0),typeof t>"u"){if(e.totalDuration)return e.totalDuration;if(!e.endList)return O.Infinity}return Vk(e,t,i)},ql=function(e){var t=e.defaultDuration,i=e.durationList,r=e.startIndex,n=e.endIndex,a=0;if(r>n){var o=[n,r];r=o[0],n=o[1]}if(r<0){for(var l=r;l<Math.min(0,n);l++)a+=t;r=0}for(var u=r;u<n;u++)a+=i[u].duration;return a},zk=function(e,t,i,r){if(!e||!e.segments)return null;if(e.endList)return Hk(e);if(t===null)return null;t=t||0;var n=Vk(e,e.mediaSequence+e.segments.length,t);return i&&(r=typeof r=="number"?r:qk(null,e),n-=r),Math.max(0,n)},T8=function(e,t,i){var r=!0,n=t||0,a=zk(e,t,r,i);return a===null?Cb():Cb(n,a)},b8=function(e){for(var t=e.playlist,i=e.currentTime,r=e.startingSegmentIndex,n=e.startingPartIndex,a=e.startTime,o=e.experimentalExactManifestTimings,l=i-a,u=mv(t),c=0,h=0;h<u.length;h++){var d=u[h];if(r===d.segmentIndex&&!(typeof n=="number"&&typeof d.partIndex=="number"&&n!==d.partIndex)){c=h;break}}if(l<0){if(c>0)for(var g=c-1;g>=0;g--){var y=u[g];if(l+=y.duration,o){if(l<0)continue}else if(l+hs<=0)continue;return{partIndex:y.partIndex,segmentIndex:y.segmentIndex,startTime:a-ql({defaultDuration:t.targetDuration,durationList:u,startIndex:c,endIndex:g})}}return{partIndex:u[0]&&u[0].partIndex||null,segmentIndex:u[0]&&u[0].segmentIndex||0,startTime:i}}if(c<0){for(var p=c;p<0;p++)if(l-=t.targetDuration,l<0)return{partIndex:u[0]&&u[0].partIndex||null,segmentIndex:u[0]&&u[0].segmentIndex||0,startTime:i};c=0}for(var _=c;_<u.length;_++){var k=u[_];if(l-=k.duration,o){if(l>0)continue}else if(l-hs>=0)continue;return{partIndex:k.partIndex,segmentIndex:k.segmentIndex,startTime:a+ql({defaultDuration:t.targetDuration,durationList:u,startIndex:c,endIndex:_})}}return{segmentIndex:u[u.length-1].segmentIndex,partIndex:u[u.length-1].partIndex,startTime:i}},Wk=function(e){return e.excludeUntil&&e.excludeUntil>Date.now()},oy=function(e){return e.excludeUntil&&e.excludeUntil===1/0},vd=function(e){var t=Wk(e);return!e.disabled&&!t},S8=function(e){return e.disabled},x8=function(e){for(var t=0;t<e.segments.length;t++)if(e.segments[t].key)return!0;return!1},Gk=function(e,t){return t.attributes&&t.attributes[e]},C8=function(e,t,i,r){if(r===void 0&&(r=0),!Gk("BANDWIDTH",i))return NaN;var n=e*i.attributes.BANDWIDTH;return(n-r*8)/t},gv=function(e,t){if(e.playlists.length===1)return!0;var i=t.attributes.BANDWIDTH||Number.MAX_VALUE;return e.playlists.filter(function(r){return vd(r)?(r.attributes.BANDWIDTH||0)<i:!1}).length===0},ly=function(e,t){return!e&&!t||!e&&t||e&&!t?!1:!!(e===t||e.id&&t.id&&e.id===t.id||e.resolvedUri&&t.resolvedUri&&e.resolvedUri===t.resolvedUri||e.uri&&t.uri&&e.uri===t.uri)},Eb=function(e,t){var i=e&&e.mediaGroups&&e.mediaGroups.AUDIO||{},r=!1;for(var n in i){for(var a in i[n])if(r=t(i[n][a]),r)break;if(r)break}return!!r},_u=function(e){if(!e||!e.playlists||!e.playlists.length){var t=Eb(e,function(a){return a.playlists&&a.playlists.length||a.uri});return t}for(var i=function(o){var l=e.playlists[o],u=l.attributes&&l.attributes.CODECS;if(u&&u.split(",").every(function(h){return vw(h)}))return"continue";var c=Eb(e,function(h){return ly(l,h)});return c?"continue":{v:!1}},r=0;r<e.playlists.length;r++){var n=i(r);if(n!=="continue"&&typeof n=="object")return n.v}return!0},Vi={liveEdgeDelay:qk,duration:Hk,seekable:T8,getMediaInfoForTime:b8,isEnabled:vd,isDisabled:S8,isBlacklisted:Wk,isIncompatible:oy,playlistEnd:zk,isAes:x8,hasAttribute:Gk,estimateSegmentRequestTime:C8,isLowestEnabledRendition:gv,isAudioOnly:_u,playlistMatch:ly,segmentDurationWithParts:ay},Kk=ae.log,uy=function(e,t){return e+"-"+t},E8=function(e,t,i){return"placeholder-uri-"+e+"-"+t+"-"+i},w8=function(e){var t=e.onwarn,i=e.oninfo,r=e.manifestString,n=e.customTagParsers,a=n===void 0?[]:n,o=e.customTagMappers,l=o===void 0?[]:o,u=e.experimentalLLHLS,c=new pF;t&&c.on("warn",t),i&&c.on("info",i),a.forEach(function(p){return c.addParser(p)}),l.forEach(function(p){return c.addTagMapper(p)}),c.push(r),c.end();var h=c.manifest;if(u||(["preloadSegment","skip","serverControl","renditionReports","partInf","partTargetDuration"].forEach(function(p){h.hasOwnProperty(p)&&delete h[p]}),h.segments&&h.segments.forEach(function(p){["parts","preloadHints"].forEach(function(_){p.hasOwnProperty(_)&&delete p[_]})})),!h.targetDuration){var d=10;h.segments&&h.segments.length&&(d=h.segments.reduce(function(p,_){return Math.max(p,_.duration)},0)),t&&t("manifest has no targetDuration defaulting to "+d),h.targetDuration=d}var g=$k(h);if(g.length&&!h.partTargetDuration){var y=g.reduce(function(p,_){return Math.max(p,_.duration)},0);t&&(t("manifest has no partTargetDuration defaulting to "+y),Kk.error("LL-HLS manifest has parts but lacks required #EXT-X-PART-INF:PART-TARGET value. See https://datatracker.ietf.org/doc/html/draft-pantos-hls-rfc8216bis-09#section-4.4.3.7. Playback is not guaranteed.")),h.partTargetDuration=y}return h},Ko=function(e,t){e.mediaGroups&&["AUDIO","SUBTITLES"].forEach(function(i){if(e.mediaGroups[i])for(var r in e.mediaGroups[i])for(var n in e.mediaGroups[i][r]){var a=e.mediaGroups[i][r][n];t(a,i,r,n)}})},Xk=function(e){var t=e.playlist,i=e.uri,r=e.id;t.id=r,t.playlistErrors_=0,i&&(t.uri=i),t.attributes=t.attributes||{}},k8=function(e){for(var t=e.playlists.length;t--;){var i=e.playlists[t];Xk({playlist:i,id:uy(t,i.uri)}),i.resolvedUri=Pr(e.uri,i.uri),e.playlists[i.id]=i,e.playlists[i.uri]=i,i.attributes.BANDWIDTH||Kk.warn("Invalid playlist STREAM-INF detected. Missing BANDWIDTH attribute.")}},A8=function(e){Ko(e,function(t){t.uri&&(t.resolvedUri=Pr(e.uri,t.uri))})},I8=function(e,t){var i=uy(0,t),r={mediaGroups:{AUDIO:{},VIDEO:{},"CLOSED-CAPTIONS":{},SUBTITLES:{}},uri:O.location.href,resolvedUri:O.location.href,playlists:[{uri:t,id:i,resolvedUri:t,attributes:{}}]};return r.playlists[i]=r.playlists[0],r.playlists[t]=r.playlists[0],r},Qk=function(e,t,i){i===void 0&&(i=E8),e.uri=t;for(var r=0;r<e.playlists.length;r++)if(!e.playlists[r].uri){var n="placeholder-uri-"+r;e.playlists[r].uri=n}var a=_u(e);Ko(e,function(o,l,u,c){if(!o.playlists||!o.playlists.length){if(a&&l==="AUDIO"&&!o.uri)for(var h=0;h<e.playlists.length;h++){var d=e.playlists[h];if(d.attributes&&d.attributes.AUDIO&&d.attributes.AUDIO===u)return}o.playlists=[ft({},o)]}o.playlists.forEach(function(g,y){var p=i(l,u,c,g),_=uy(y,p);g.uri?g.resolvedUri=g.resolvedUri||Pr(e.uri,g.uri):(g.uri=y===0?p:_,g.resolvedUri=g.uri),g.id=g.id||_,g.attributes=g.attributes||{},e.playlists[g.id]=g,e.playlists[g.uri]=g})}),k8(e),A8(e)},bh=ae.mergeOptions,P8=ae.EventTarget,D8=function(e,t){if(t.endList||!t.serverControl)return e;var i={};if(t.serverControl.canBlockReload){var r=t.preloadSegment,n=t.mediaSequence+t.segments.length;if(r){var a=r.parts||[],o=jk(t)-1;o>-1&&o!==a.length-1&&(i._HLS_part=o),(o>-1||a.length)&&n--}i._HLS_msn=n}if(t.serverControl&&t.serverControl.canSkipUntil&&(i._HLS_skip=t.serverControl.canSkipDateranges?"v2":"YES"),Object.keys(i).length){var l=new O.URL(e);["_HLS_skip","_HLS_msn","_HLS_part"].forEach(function(u){i.hasOwnProperty(u)&&l.searchParams.set(u,i[u])}),e=l.toString()}return e},N8=function(e,t){if(!e)return t;var i=bh(e,t);if(e.preloadHints&&!t.preloadHints&&delete i.preloadHints,e.parts&&!t.parts)delete i.parts;else if(e.parts&&t.parts)for(var r=0;r<t.parts.length;r++)e.parts&&e.parts[r]&&(i.parts[r]=bh(e.parts[r],t.parts[r]));return!e.skipped&&t.skipped&&(i.skipped=!1),e.preload&&!t.preload&&(i.preload=!1),i},L8=function(e,t,i){var r=e.slice(),n=t.slice();i=i||0;for(var a=[],o,l=0;l<n.length;l++){var u=r[l+i],c=n[l];u?(o=u.map||o,a.push(N8(u,c))):(o&&!c.map&&(c.map=o),a.push(c))}return a},Yk=function(e,t){!e.resolvedUri&&e.uri&&(e.resolvedUri=Pr(t,e.uri)),e.key&&!e.key.resolvedUri&&(e.key.resolvedUri=Pr(t,e.key.uri)),e.map&&!e.map.resolvedUri&&(e.map.resolvedUri=Pr(t,e.map.uri)),e.map&&e.map.key&&!e.map.key.resolvedUri&&(e.map.key.resolvedUri=Pr(t,e.map.key.uri)),e.parts&&e.parts.length&&e.parts.forEach(function(i){i.resolvedUri||(i.resolvedUri=Pr(t,i.uri))}),e.preloadHints&&e.preloadHints.length&&e.preloadHints.forEach(function(i){i.resolvedUri||(i.resolvedUri=Pr(t,i.uri))})},Jk=function(e){var t=e.segments||[],i=e.preloadSegment;if(i&&i.parts&&i.parts.length){if(i.preloadHints){for(var r=0;r<i.preloadHints.length;r++)if(i.preloadHints[r].type==="MAP")return t}i.duration=e.targetDuration,i.preload=!0,t.push(i)}return t},Zk=function(e,t){return e===t||e.segments&&t.segments&&e.segments.length===t.segments.length&&e.endList===t.endList&&e.mediaSequence===t.mediaSequence&&e.preloadSegment===t.preloadSegment},vv=function(e,t,i){i===void 0&&(i=Zk);var r=bh(e,{}),n=r.playlists[t.id];if(!n||i(n,t))return null;t.segments=Jk(t);var a=bh(n,t);if(a.preloadSegment&&!t.preloadSegment&&delete a.preloadSegment,n.segments){if(t.skip){t.segments=t.segments||[];for(var o=0;o<t.skip.skippedSegments;o++)t.segments.unshift({skipped:!0})}a.segments=L8(n.segments,t.segments,t.mediaSequence-n.mediaSequence)}a.segments.forEach(function(u){Yk(u,a.resolvedUri)});for(var l=0;l<r.playlists.length;l++)r.playlists[l].id===t.id&&(r.playlists[l]=a);return r.playlists[t.id]=a,r.playlists[t.uri]=a,Ko(e,function(u,c,h,d){if(u.playlists)for(var g=0;g<u.playlists.length;g++)t.id===u.playlists[g].id&&(u.playlists[g]=a)}),r},yv=function(e,t){var i=e.segments||[],r=i[i.length-1],n=r&&r.parts&&r.parts[r.parts.length-1],a=n&&n.duration||r&&r.duration;return t&&a?a*1e3:(e.partTargetDuration||e.targetDuration||10)*500},Ya=function(s){Ce(e,s);function e(i,r,n){var a;if(n===void 0&&(n={}),a=s.call(this)||this,!i)throw new Error("A non-empty playlist URL or object is required");a.logger_=Mr("PlaylistLoader");var o=n,l=o.withCredentials,u=l===void 0?!1:l,c=o.handleManifestRedirects,h=c===void 0?!1:c;a.src=i,a.vhs_=r,a.withCredentials=u,a.handleManifestRedirects=h;var d=r.options_;return a.customTagParsers=d&&d.customTagParsers||[],a.customTagMappers=d&&d.customTagMappers||[],a.experimentalLLHLS=d&&d.experimentalLLHLS||!1,ae.browser.IE_VERSION&&(a.experimentalLLHLS=!1),a.state="HAVE_NOTHING",a.handleMediaupdatetimeout_=a.handleMediaupdatetimeout_.bind(We(a)),a.on("mediaupdatetimeout",a.handleMediaupdatetimeout_),a}var t=e.prototype;return t.handleMediaupdatetimeout_=function(){var r=this;if(this.state==="HAVE_METADATA"){var n=this.media(),a=Pr(this.master.uri,n.uri);this.experimentalLLHLS&&(a=D8(a,n)),this.state="HAVE_CURRENT_METADATA",this.request=this.vhs_.xhr({uri:a,withCredentials:this.withCredentials},function(o,l){if(r.request){if(o)return r.playlistRequestError(r.request,r.media(),"HAVE_METADATA");r.haveMetadata({playlistString:r.request.responseText,url:r.media().uri,id:r.media().id})}})}},t.playlistRequestError=function(r,n,a){var o=n.uri,l=n.id;this.request=null,a&&(this.state=a),this.error={playlist:this.master.playlists[l],status:r.status,message:"HLS playlist request error at URL: "+o+".",responseText:r.responseText,code:r.status>=500?4:2},this.trigger("error")},t.parseManifest_=function(r){var n=this,a=r.url,o=r.manifestString;return w8({onwarn:function(u){var c=u.message;return n.logger_("m3u8-parser warn for "+a+": "+c)},oninfo:function(u){var c=u.message;return n.logger_("m3u8-parser info for "+a+": "+c)},manifestString:o,customTagParsers:this.customTagParsers,customTagMappers:this.customTagMappers,experimentalLLHLS:this.experimentalLLHLS})},t.haveMetadata=function(r){var n=r.playlistString,a=r.playlistObject,o=r.url,l=r.id;this.request=null,this.state="HAVE_METADATA";var u=a||this.parseManifest_({url:o,manifestString:n});u.lastRequest=Date.now(),Xk({playlist:u,uri:o,id:l});var c=vv(this.master,u);this.targetDuration=u.partTargetDuration||u.targetDuration,this.pendingMedia_=null,c?(this.master=c,this.media_=this.master.playlists[l]):this.trigger("playlistunchanged"),this.updateMediaUpdateTimeout_(yv(this.media(),!!c)),this.trigger("loadedplaylist")},t.dispose=function(){this.trigger("dispose"),this.stopRequest(),O.clearTimeout(this.mediaUpdateTimeout),O.clearTimeout(this.finalRenditionTimeout),this.off()},t.stopRequest=function(){if(this.request){var r=this.request;this.request=null,r.onreadystatechange=null,r.abort()}},t.media=function(r,n){var a=this;if(!r)return this.media_;if(this.state==="HAVE_NOTHING")throw new Error("Cannot switch media playlist from "+this.state);if(typeof r=="string"){if(!this.master.playlists[r])throw new Error("Unknown playlist URI: "+r);r=this.master.playlists[r]}if(O.clearTimeout(this.finalRenditionTimeout),n){var o=(r.partTargetDuration||r.targetDuration)/2*1e3||5e3;this.finalRenditionTimeout=O.setTimeout(this.media.bind(this,r,!1),o);return}var l=this.state,u=!this.media_||r.id!==this.media_.id,c=this.master.playlists[r.id];if(c&&c.endList||r.endList&&r.segments.length){this.request&&(this.request.onreadystatechange=null,this.request.abort(),this.request=null),this.state="HAVE_METADATA",this.media_=r,u&&(this.trigger("mediachanging"),l==="HAVE_MASTER"?this.trigger("loadedmetadata"):this.trigger("mediachange"));return}if(this.updateMediaUpdateTimeout_(yv(r,!0)),!!u){if(this.state="SWITCHING_MEDIA",this.request){if(r.resolvedUri===this.request.url)return;this.request.onreadystatechange=null,this.request.abort(),this.request=null}this.media_&&this.trigger("mediachanging"),this.pendingMedia_=r,this.request=this.vhs_.xhr({uri:r.resolvedUri,withCredentials:this.withCredentials},function(h,d){if(a.request){if(r.lastRequest=Date.now(),r.resolvedUri=Th(a.handleManifestRedirects,r.resolvedUri,d),h)return a.playlistRequestError(a.request,r,l);a.haveMetadata({playlistString:d.responseText,url:r.uri,id:r.id}),l==="HAVE_MASTER"?a.trigger("loadedmetadata"):a.trigger("mediachange")}})}},t.pause=function(){this.mediaUpdateTimeout&&(O.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null),this.stopRequest(),this.state==="HAVE_NOTHING"&&(this.started=!1),this.state==="SWITCHING_MEDIA"?this.media_?this.state="HAVE_METADATA":this.state="HAVE_MASTER":this.state==="HAVE_CURRENT_METADATA"&&(this.state="HAVE_METADATA")},t.load=function(r){var n=this;this.mediaUpdateTimeout&&(O.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null);var a=this.media();if(r){var o=a?(a.partTargetDuration||a.targetDuration)/2*1e3:5e3;this.mediaUpdateTimeout=O.setTimeout(function(){n.mediaUpdateTimeout=null,n.load()},o);return}if(!this.started){this.start();return}a&&!a.endList?this.trigger("mediaupdatetimeout"):this.trigger("loadedplaylist")},t.updateMediaUpdateTimeout_=function(r){var n=this;this.mediaUpdateTimeout&&(O.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null),!(!this.media()||this.media().endList)&&(this.mediaUpdateTimeout=O.setTimeout(function(){n.mediaUpdateTimeout=null,n.trigger("mediaupdatetimeout"),n.updateMediaUpdateTimeout_(r)},r))},t.start=function(){var r=this;if(this.started=!0,typeof this.src=="object"){this.src.uri||(this.src.uri=O.location.href),this.src.resolvedUri=this.src.uri,setTimeout(function(){r.setupInitialPlaylist(r.src)},0);return}this.request=this.vhs_.xhr({uri:this.src,withCredentials:this.withCredentials},function(n,a){if(r.request){if(r.request=null,n)return r.error={status:a.status,message:"HLS playlist request error at URL: "+r.src+".",responseText:a.responseText,code:2},r.state==="HAVE_NOTHING"&&(r.started=!1),r.trigger("error");r.src=Th(r.handleManifestRedirects,r.src,a);var o=r.parseManifest_({manifestString:a.responseText,url:r.src});r.setupInitialPlaylist(o)}})},t.srcUri=function(){return typeof this.src=="string"?this.src:this.src.uri},t.setupInitialPlaylist=function(r){if(this.state="HAVE_MASTER",r.playlists){this.master=r,Qk(this.master,this.srcUri()),r.playlists.forEach(function(a){a.segments=Jk(a),a.segments.forEach(function(o){Yk(o,a.resolvedUri)})}),this.trigger("loadedplaylist"),this.request||this.media(this.master.playlists[0]);return}var n=this.srcUri()||O.location.href;this.master=I8(r,n),this.haveMetadata({playlistObject:r,url:n,id:this.master.playlists[0].id}),this.trigger("loadedmetadata")},e}(P8),O8=ae.xhr,M8=ae.mergeOptions,_v=function(e,t,i,r){var n=e.responseType==="arraybuffer"?e.response:e.responseText;!t&&n&&(e.responseTime=Date.now(),e.roundTripTime=e.responseTime-e.requestTime,e.bytesReceived=n.byteLength||n.length,e.bandwidth||(e.bandwidth=Math.floor(e.bytesReceived/e.roundTripTime*8*1e3))),i.headers&&(e.responseHeaders=i.headers),t&&t.code==="ETIMEDOUT"&&(e.timedout=!0),!t&&!e.aborted&&i.statusCode!==200&&i.statusCode!==206&&i.statusCode!==0&&(t=new Error("XHR Failed with a response of: "+(e&&(n||e.responseText)))),r(t,e)},eA=function(){var e=function t(i,r){i=M8({timeout:45e3},i);var n=t.beforeRequest||ae.Vhs.xhr.beforeRequest;if(n&&typeof n=="function"){var a=n(i);a&&(i=a)}var o=ae.Vhs.xhr.original===!0?O8:ae.Vhs.xhr,l=o(i,function(c,h){return _v(l,c,h,r)}),u=l.abort;return l.abort=function(){return l.aborted=!0,u.apply(l,arguments)},l.uri=i.uri,l.requestTime=Date.now(),l};return e.original=!0,e},R8=function(e){var t,i=e.offset;return typeof e.offset=="bigint"||typeof e.length=="bigint"?t=O.BigInt(e.offset)+O.BigInt(e.length)-O.BigInt(1):t=e.offset+e.length-1,"bytes="+i+"-"+t},Tv=function(e){var t={};return e.byterange&&(t.Range=R8(e.byterange)),t},F8=function(e,t){return e.start(t)+"-"+e.end(t)},B8=function(e,t){var i=e.toString(16);return"00".substring(0,2-i.length)+i+(t%2?" ":"")},U8=function(e){return e>=32&&e<126?String.fromCharCode(e):"."},tA=function(e){var t={};return Object.keys(e).forEach(function(i){var r=e[i];_w(r)?t[i]={bytes:r.buffer,byteOffset:r.byteOffset,byteLength:r.byteLength}:t[i]=r}),t},Sh=function(e){var t=e.byterange||{length:1/0,offset:0};return[t.length,t.offset,e.resolvedUri].join(",")},iA=function(e){return e.resolvedUri},rA=function(e){for(var t=Array.prototype.slice.call(e),i=16,r="",n,a,o=0;o<t.length/i;o++)n=t.slice(o*i,o*i+i).map(B8).join(""),a=t.slice(o*i,o*i+i).map(U8).join(""),r+=n+" "+a+`
279
- `;return r},$8=function(e){var t=e.bytes;return rA(t)},j8=function(e){var t="",i;for(i=0;i<e.length;i++)t+=F8(e,i)+" ";return t},q8=Object.freeze({__proto__:null,createTransferableMessage:tA,initSegmentId:Sh,segmentKeyId:iA,hexDump:rA,tagDump:$8,textRanges:j8}),nA=.25,V8=function(e,t){if(!t.dateTimeObject)return null;var i=t.videoTimingInfo.transmuxerPrependedSeconds,r=t.videoTimingInfo.transmuxedPresentationStart,n=r+i,a=e-n;return new Date(t.dateTimeObject.getTime()+a*1e3)},H8=function(e){return e.transmuxedPresentationEnd-e.transmuxedPresentationStart-e.transmuxerPrependedSeconds},z8=function(e,t){var i;try{i=new Date(e)}catch{return null}if(!t||!t.segments||t.segments.length===0)return null;var r=t.segments[0];if(i<r.dateTimeObject)return null;for(var n=0;n<t.segments.length-1;n++){r=t.segments[n];var a=t.segments[n+1].dateTimeObject;if(i<a)break}var o=t.segments[t.segments.length-1],l=o.dateTimeObject,u=o.videoTimingInfo?H8(o.videoTimingInfo):o.duration+o.duration*nA,c=new Date(l.getTime()+u*1e3);return i>c?null:(i>l&&(r=o),{segment:r,estimatedStart:r.videoTimingInfo?r.videoTimingInfo.transmuxedPresentationStart:Vi.duration(t,t.mediaSequence+t.segments.indexOf(r)),type:r.videoTimingInfo?"accurate":"estimate"})},W8=function(e,t){if(!t||!t.segments||t.segments.length===0)return null;for(var i=0,r,n=0;n<t.segments.length&&(r=t.segments[n],i=r.videoTimingInfo?r.videoTimingInfo.transmuxedPresentationEnd:i+r.duration,!(e<=i));n++);var a=t.segments[t.segments.length-1];if(a.videoTimingInfo&&a.videoTimingInfo.transmuxedPresentationEnd<e)return null;if(e>i){if(e>i+a.duration*nA)return null;r=a}return{segment:r,estimatedStart:r.videoTimingInfo?r.videoTimingInfo.transmuxedPresentationStart:i-r.duration,type:r.videoTimingInfo?"accurate":"estimate"}},G8=function(e,t){var i,r;try{i=new Date(e),r=new Date(t)}catch{}var n=i.getTime(),a=r.getTime();return(a-n)/1e3},K8=function(e){if(!e.segments||e.segments.length===0)return!1;for(var t=0;t<e.segments.length;t++){var i=e.segments[t];if(!i.dateTimeObject)return!1}return!0},X8=function(e){var t=e.playlist,i=e.time,r=i===void 0?void 0:i,n=e.callback;if(!n)throw new Error("getProgramTime: callback must be provided");if(!t||r===void 0)return n({message:"getProgramTime: playlist and time must be provided"});var a=W8(r,t);if(!a)return n({message:"valid programTime was not found"});if(a.type==="estimate")return n({message:"Accurate programTime could not be determined. Please seek to e.seekTime and try again",seekTime:a.estimatedStart});var o={mediaSeconds:r},l=V8(r,a.segment);return l&&(o.programDateTime=l.toISOString()),n(null,o)},Q8=function s(e){var t=e.programTime,i=e.playlist,r=e.retryCount,n=r===void 0?2:r,a=e.seekTo,o=e.pauseAfterSeek,l=o===void 0?!0:o,u=e.tech,c=e.callback;if(!c)throw new Error("seekToProgramTime: callback must be provided");if(typeof t>"u"||!i||!a)return c({message:"seekToProgramTime: programTime, seekTo and playlist must be provided"});if(!i.endList&&!u.hasStarted_)return c({message:"player must be playing a live stream to start buffering"});if(!K8(i))return c({message:"programDateTime tags must be provided in the manifest "+i.resolvedUri});var h=z8(t,i);if(!h)return c({message:t+" was not found in the stream"});var d=h.segment,g=G8(d.dateTimeObject,t);if(h.type==="estimate"){if(n===0)return c({message:t+" is not buffered yet. Try again"});a(h.estimatedStart+g),u.one("seeked",function(){s({programTime:t,playlist:i,retryCount:n-1,seekTo:a,pauseAfterSeek:l,tech:u,callback:c})});return}var y=d.start+g,p=function(){return c(null,u.currentTime())};u.one("seeked",p),l&&u.pause(),a(y)},pp=function(e,t){if(e.readyState===4)return t()},Y8=function(e,t,i){var r=[],n,a=!1,o=function(d,g,y,p){return g.abort(),a=!0,i(d,g,y,p)},l=function(d,g){if(!a){if(d)return o(d,g,"",r);var y=g.responseText.substring(r&&r.byteLength||0,g.responseText.length);if(r=wF(r,Tw(y,!0)),n=n||Il(r),r.length<10||n&&r.length<n+2)return pp(g,function(){return o(d,g,"",r)});var p=I0(r);return p==="ts"&&r.length<188?pp(g,function(){return o(d,g,"",r)}):!p&&r.length<376?pp(g,function(){return o(d,g,"",r)}):o(null,g,p,r)}},u={uri:e,beforeSend:function(d){d.overrideMimeType("text/plain; charset=x-user-defined"),d.addEventListener("progress",function(g){return g.total,g.loaded,_v(d,null,{statusCode:d.status},l)})}},c=t(u,function(h,d){return _v(c,h,d,l)});return c},J8=ae.EventTarget,sA=ae.mergeOptions,wb=function(e,t){if(!Zk(e,t)||e.sidx&&t.sidx&&(e.sidx.offset!==t.sidx.offset||e.sidx.length!==t.sidx.length))return!1;if(!e.sidx&&t.sidx||e.sidx&&!t.sidx||e.segments&&!t.segments||!e.segments&&t.segments)return!1;if(!e.segments&&!t.segments)return!0;for(var i=0;i<e.segments.length;i++){var r=e.segments[i],n=t.segments[i];if(r.uri!==n.uri)return!1;if(!(!r.byterange&&!n.byterange)){var a=r.byterange,o=n.byterange;if(a&&!o||!a&&o||a.offset!==o.offset||a.length!==o.length)return!1}}return!0},Z8=function(e,t,i,r){var n=r.attributes.NAME||i;return"placeholder-uri-"+e+"-"+t+"-"+n},eU=function(e){var t=e.masterXml,i=e.srcUrl,r=e.clientOffset,n=e.sidxMapping,a=e.previousManifest,o=vB(t,{manifestUri:i,clientOffset:r,sidxMapping:n,previousManifest:a});return Qk(o,i,Z8),o},tU=function(e,t){Ko(e,function(i,r,n,a){a in t.mediaGroups[r][n]||delete e.mediaGroups[r][n][a]})},iU=function(e,t,i){for(var r=!0,n=sA(e,{duration:t.duration,minimumUpdatePeriod:t.minimumUpdatePeriod,timelineStarts:t.timelineStarts}),a=0;a<t.playlists.length;a++){var o=t.playlists[a];if(o.sidx){var l=sd(o.sidx);i&&i[l]&&i[l].sidx&&E0(o,i[l].sidx,o.sidx.resolvedUri)}var u=vv(n,o,wb);u&&(n=u,r=!1)}return Ko(t,function(c,h,d,g){if(c.playlists&&c.playlists.length){var y=c.playlists[0].id,p=vv(n,c.playlists[0],wb);p&&(n=p,g in n.mediaGroups[h][d]||(n.mediaGroups[h][d][g]=c),n.mediaGroups[h][d][g].playlists[0]=n.playlists[y],r=!1)}}),tU(n,t),t.minimumUpdatePeriod!==e.minimumUpdatePeriod&&(r=!1),r?null:n},rU=function(e,t){var i=!e.map&&!t.map,r=i||!!(e.map&&t.map&&e.map.byterange.offset===t.map.byterange.offset&&e.map.byterange.length===t.map.byterange.length);return r&&e.uri===t.uri&&e.byterange.offset===t.byterange.offset&&e.byterange.length===t.byterange.length},kb=function(e,t){var i={};for(var r in e){var n=e[r],a=n.sidx;if(a){var o=sd(a);if(!t[o])break;var l=t[o].sidxInfo;rU(l,a)&&(i[o]=t[o])}}return i},nU=function(e,t){var i=kb(e.playlists,t),r=i;return Ko(e,function(n,a,o,l){if(n.playlists&&n.playlists.length){var u=n.playlists;r=sA(r,kb(u,t))}}),r},bv=function(s){Ce(e,s);function e(i,r,n,a){var o;n===void 0&&(n={}),o=s.call(this)||this,o.masterPlaylistLoader_=a||We(o),a||(o.isMaster_=!0);var l=n,u=l.withCredentials,c=u===void 0?!1:u,h=l.handleManifestRedirects,d=h===void 0?!1:h;if(o.vhs_=r,o.withCredentials=c,o.handleManifestRedirects=d,!i)throw new Error("A non-empty playlist URL or object is required");return o.on("minimumUpdatePeriod",function(){o.refreshXml_()}),o.on("mediaupdatetimeout",function(){o.refreshMedia_(o.media().id)}),o.state="HAVE_NOTHING",o.loadedPlaylists_={},o.logger_=Mr("DashPlaylistLoader"),o.isMaster_?(o.masterPlaylistLoader_.srcUrl=i,o.masterPlaylistLoader_.sidxMapping_={}):o.childPlaylist_=i,o}var t=e.prototype;return t.requestErrored_=function(r,n,a){if(!this.request)return!0;if(this.request=null,r)return this.error=typeof r=="object"&&!(r instanceof Error)?r:{status:n.status,message:"DASH request error at URL: "+n.uri,response:n.response,code:2},a&&(this.state=a),this.trigger("error"),!0},t.addSidxSegments_=function(r,n,a){var o=this,l=r.sidx&&sd(r.sidx);if(!r.sidx||!l||this.masterPlaylistLoader_.sidxMapping_[l]){this.mediaRequest_=O.setTimeout(function(){return a(!1)},0);return}var u=Th(this.handleManifestRedirects,r.sidx.resolvedUri),c=function(d,g){if(!o.requestErrored_(d,g,n)){var y=o.masterPlaylistLoader_.sidxMapping_,p;try{p=SB(je(g.response).subarray(8))}catch(_){o.requestErrored_(_,g,n);return}return y[l]={sidxInfo:r.sidx,sidx:p},E0(r,p,r.sidx.resolvedUri),a(!0)}};this.request=Y8(u,this.vhs_.xhr,function(h,d,g,y){if(h)return c(h,d);if(!g||g!=="mp4")return c({status:d.status,message:"Unsupported "+(g||"unknown")+" container type for sidx segment at URL: "+u,response:"",playlist:r,internal:!0,blacklistDuration:1/0,code:2},d);var p=r.sidx.byterange,_=p.offset,k=p.length;if(y.length>=k+_)return c(h,{response:y.subarray(_,_+k),status:d.status,uri:d.uri});o.request=o.vhs_.xhr({uri:u,responseType:"arraybuffer",headers:Tv({byterange:r.sidx.byterange})},c)})},t.dispose=function(){this.trigger("dispose"),this.stopRequest(),this.loadedPlaylists_={},O.clearTimeout(this.minimumUpdatePeriodTimeout_),O.clearTimeout(this.mediaRequest_),O.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null,this.mediaRequest_=null,this.minimumUpdatePeriodTimeout_=null,this.masterPlaylistLoader_.createMupOnMedia_&&(this.off("loadedmetadata",this.masterPlaylistLoader_.createMupOnMedia_),this.masterPlaylistLoader_.createMupOnMedia_=null),this.off()},t.hasPendingRequest=function(){return this.request||this.mediaRequest_},t.stopRequest=function(){if(this.request){var r=this.request;this.request=null,r.onreadystatechange=null,r.abort()}},t.media=function(r){var n=this;if(!r)return this.media_;if(this.state==="HAVE_NOTHING")throw new Error("Cannot switch media playlist from "+this.state);var a=this.state;if(typeof r=="string"){if(!this.masterPlaylistLoader_.master.playlists[r])throw new Error("Unknown playlist URI: "+r);r=this.masterPlaylistLoader_.master.playlists[r]}var o=!this.media_||r.id!==this.media_.id;if(o&&this.loadedPlaylists_[r.id]&&this.loadedPlaylists_[r.id].endList){this.state="HAVE_METADATA",this.media_=r,o&&(this.trigger("mediachanging"),this.trigger("mediachange"));return}o&&(this.media_&&this.trigger("mediachanging"),this.addSidxSegments_(r,a,function(l){n.haveMetadata({startingState:a,playlist:r})}))},t.haveMetadata=function(r){var n=r.startingState,a=r.playlist;this.state="HAVE_METADATA",this.loadedPlaylists_[a.id]=a,this.mediaRequest_=null,this.refreshMedia_(a.id),n==="HAVE_MASTER"?this.trigger("loadedmetadata"):this.trigger("mediachange")},t.pause=function(){this.masterPlaylistLoader_.createMupOnMedia_&&(this.off("loadedmetadata",this.masterPlaylistLoader_.createMupOnMedia_),this.masterPlaylistLoader_.createMupOnMedia_=null),this.stopRequest(),O.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null,this.isMaster_&&(O.clearTimeout(this.masterPlaylistLoader_.minimumUpdatePeriodTimeout_),this.masterPlaylistLoader_.minimumUpdatePeriodTimeout_=null),this.state==="HAVE_NOTHING"&&(this.started=!1)},t.load=function(r){var n=this;O.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null;var a=this.media();if(r){var o=a?a.targetDuration/2*1e3:5e3;this.mediaUpdateTimeout=O.setTimeout(function(){return n.load()},o);return}if(!this.started){this.start();return}a&&!a.endList?(this.isMaster_&&!this.minimumUpdatePeriodTimeout_&&(this.trigger("minimumUpdatePeriod"),this.updateMinimumUpdatePeriodTimeout_()),this.trigger("mediaupdatetimeout")):this.trigger("loadedplaylist")},t.start=function(){var r=this;if(this.started=!0,!this.isMaster_){this.mediaRequest_=O.setTimeout(function(){return r.haveMaster_()},0);return}this.requestMaster_(function(n,a){r.haveMaster_(),!r.hasPendingRequest()&&!r.media_&&r.media(r.masterPlaylistLoader_.master.playlists[0])})},t.requestMaster_=function(r){var n=this;this.request=this.vhs_.xhr({uri:this.masterPlaylistLoader_.srcUrl,withCredentials:this.withCredentials},function(a,o){if(n.requestErrored_(a,o)){n.state==="HAVE_NOTHING"&&(n.started=!1);return}var l=o.responseText!==n.masterPlaylistLoader_.masterXml_;if(n.masterPlaylistLoader_.masterXml_=o.responseText,o.responseHeaders&&o.responseHeaders.date?n.masterLoaded_=Date.parse(o.responseHeaders.date):n.masterLoaded_=Date.now(),n.masterPlaylistLoader_.srcUrl=Th(n.handleManifestRedirects,n.masterPlaylistLoader_.srcUrl,o),l){n.handleMaster_(),n.syncClientServerClock_(function(){return r(o,l)});return}return r(o,l)})},t.syncClientServerClock_=function(r){var n=this,a=yB(this.masterPlaylistLoader_.masterXml_);if(a===null)return this.masterPlaylistLoader_.clientOffset_=this.masterLoaded_-Date.now(),r();if(a.method==="DIRECT")return this.masterPlaylistLoader_.clientOffset_=a.value-Date.now(),r();this.request=this.vhs_.xhr({uri:Pr(this.masterPlaylistLoader_.srcUrl,a.value),method:a.method,withCredentials:this.withCredentials},function(o,l){if(n.request){if(o)return n.masterPlaylistLoader_.clientOffset_=n.masterLoaded_-Date.now(),r();var u;a.method==="HEAD"?!l.responseHeaders||!l.responseHeaders.date?u=n.masterLoaded_:u=Date.parse(l.responseHeaders.date):u=Date.parse(l.responseText),n.masterPlaylistLoader_.clientOffset_=u-Date.now(),r()}})},t.haveMaster_=function(){this.state="HAVE_MASTER",this.isMaster_?this.trigger("loadedplaylist"):this.media_||this.media(this.childPlaylist_)},t.handleMaster_=function(){this.mediaRequest_=null;var r=this.masterPlaylistLoader_.master,n=eU({masterXml:this.masterPlaylistLoader_.masterXml_,srcUrl:this.masterPlaylistLoader_.srcUrl,clientOffset:this.masterPlaylistLoader_.clientOffset_,sidxMapping:this.masterPlaylistLoader_.sidxMapping_,previousManifest:r});r&&(n=iU(r,n,this.masterPlaylistLoader_.sidxMapping_)),this.masterPlaylistLoader_.master=n||r;var a=this.masterPlaylistLoader_.master.locations&&this.masterPlaylistLoader_.master.locations[0];return a&&a!==this.masterPlaylistLoader_.srcUrl&&(this.masterPlaylistLoader_.srcUrl=a),(!r||n&&n.minimumUpdatePeriod!==r.minimumUpdatePeriod)&&this.updateMinimumUpdatePeriodTimeout_(),!!n},t.updateMinimumUpdatePeriodTimeout_=function(){var r=this.masterPlaylistLoader_;r.createMupOnMedia_&&(r.off("loadedmetadata",r.createMupOnMedia_),r.createMupOnMedia_=null),r.minimumUpdatePeriodTimeout_&&(O.clearTimeout(r.minimumUpdatePeriodTimeout_),r.minimumUpdatePeriodTimeout_=null);var n=r.master&&r.master.minimumUpdatePeriod;if(n===0&&(r.media()?n=r.media().targetDuration*1e3:(r.createMupOnMedia_=r.updateMinimumUpdatePeriodTimeout_,r.one("loadedmetadata",r.createMupOnMedia_))),typeof n!="number"||n<=0){n<0&&this.logger_("found invalid minimumUpdatePeriod of "+n+", not setting a timeout");return}this.createMUPTimeout_(n)},t.createMUPTimeout_=function(r){var n=this.masterPlaylistLoader_;n.minimumUpdatePeriodTimeout_=O.setTimeout(function(){n.minimumUpdatePeriodTimeout_=null,n.trigger("minimumUpdatePeriod"),n.createMUPTimeout_(r)},r)},t.refreshXml_=function(){var r=this;this.requestMaster_(function(n,a){a&&(r.media_&&(r.media_=r.masterPlaylistLoader_.master.playlists[r.media_.id]),r.masterPlaylistLoader_.sidxMapping_=nU(r.masterPlaylistLoader_.master,r.masterPlaylistLoader_.sidxMapping_),r.addSidxSegments_(r.media(),r.state,function(o){r.refreshMedia_(r.media().id)}))})},t.refreshMedia_=function(r){var n=this;if(!r)throw new Error("refreshMedia_ must take a media id");this.media_&&this.isMaster_&&this.handleMaster_();var a=this.masterPlaylistLoader_.master.playlists,o=!this.media_||this.media_!==a[r];if(o?this.media_=a[r]:this.trigger("playlistunchanged"),!this.mediaUpdateTimeout){var l=function u(){n.media().endList||(n.mediaUpdateTimeout=O.setTimeout(function(){n.trigger("mediaupdatetimeout"),u()},yv(n.media(),!!o)))};l()}this.trigger("loadedplaylist")},e}(J8),ti={GOAL_BUFFER_LENGTH:30,MAX_GOAL_BUFFER_LENGTH:60,BACK_BUFFER_LENGTH:30,GOAL_BUFFER_LENGTH_RATE:1,INITIAL_BANDWIDTH:4194304,BANDWIDTH_VARIANCE:1.2,BUFFER_LOW_WATER_LINE:0,MAX_BUFFER_LOW_WATER_LINE:30,EXPERIMENTAL_MAX_BUFFER_LOW_WATER_LINE:16,BUFFER_LOW_WATER_LINE_RATE:1,BUFFER_HIGH_WATER_LINE:30},sU=function(e){for(var t=new Uint8Array(new ArrayBuffer(e.length)),i=0;i<e.length;i++)t[i]=e.charCodeAt(i);return t.buffer},aA=function(e){return e.on=e.addEventListener,e.off=e.removeEventListener,e},aU=function(e){try{return URL.createObjectURL(new Blob([e],{type:"application/javascript"}))}catch{var t=new BlobBuilder;return t.append(e),URL.createObjectURL(t.getBlob())}},oA=function(e){return function(){var t=aU(e),i=aA(new Worker(t));i.objURL=t;var r=i.terminate;return i.on=i.addEventListener,i.off=i.removeEventListener,i.terminate=function(){return URL.revokeObjectURL(t),r.call(this)},i}},lA=function(e){return"var browserWorkerPolyFill = "+aA.toString()+`;
280
- browserWorkerPolyFill(self);
281
- `+e},uA=function(e){return e.toString().replace(/^function.+?{/,"").slice(0,-1)},oU=lA(uA(function(){var s=function(){this.init=function(){var m={};this.on=function(x,T){m[x]||(m[x]=[]),m[x]=m[x].concat(T)},this.off=function(x,T){var E;return m[x]?(E=m[x].indexOf(T),m[x]=m[x].slice(),m[x].splice(E,1),E>-1):!1},this.trigger=function(x){var T,E,P,M;if(T=m[x],!!T)if(arguments.length===2)for(P=T.length,E=0;E<P;++E)T[E].call(this,arguments[1]);else{for(M=[],E=arguments.length,E=1;E<arguments.length;++E)M.push(arguments[E]);for(P=T.length,E=0;E<P;++E)T[E].apply(this,M)}},this.dispose=function(){m={}}}};s.prototype.pipe=function(j){return this.on("data",function(m){j.push(m)}),this.on("done",function(m){j.flush(m)}),this.on("partialdone",function(m){j.partialFlush(m)}),this.on("endedtimeline",function(m){j.endTimeline(m)}),this.on("reset",function(m){j.reset(m)}),j},s.prototype.push=function(j){this.trigger("data",j)},s.prototype.flush=function(j){this.trigger("done",j)},s.prototype.partialFlush=function(j){this.trigger("partialdone",j)},s.prototype.endTimeline=function(j){this.trigger("endedtimeline",j)},s.prototype.reset=function(j){this.trigger("reset",j)};var e=s,t=Math.pow(2,32),i=function(m){var x=new DataView(m.buffer,m.byteOffset,m.byteLength),T;return x.getBigUint64?(T=x.getBigUint64(0),T<Number.MAX_SAFE_INTEGER?Number(T):T):x.getUint32(0)*t+x.getUint32(4)},r={getUint64:i,MAX_UINT32:t},n=r.MAX_UINT32,a,o,l,u,c,h,d,g,y,p,_,k,A,N,$,R,L,F,B,C,I,G,H,K,ie,he,fe,re,ne,oe,de,ve,ke,De,Me,Ne;(function(){var j;if(H={avc1:[],avcC:[],btrt:[],dinf:[],dref:[],esds:[],ftyp:[],hdlr:[],mdat:[],mdhd:[],mdia:[],mfhd:[],minf:[],moof:[],moov:[],mp4a:[],mvex:[],mvhd:[],pasp:[],sdtp:[],smhd:[],stbl:[],stco:[],stsc:[],stsd:[],stsz:[],stts:[],styp:[],tfdt:[],tfhd:[],traf:[],trak:[],trun:[],trex:[],tkhd:[],vmhd:[]},!(typeof Uint8Array>"u")){for(j in H)H.hasOwnProperty(j)&&(H[j]=[j.charCodeAt(0),j.charCodeAt(1),j.charCodeAt(2),j.charCodeAt(3)]);K=new Uint8Array([105,115,111,109]),he=new Uint8Array([97,118,99,49]),ie=new Uint8Array([0,0,0,1]),fe=new Uint8Array([0,0,0,0,0,0,0,0,118,105,100,101,0,0,0,0,0,0,0,0,0,0,0,0,86,105,100,101,111,72,97,110,100,108,101,114,0]),re=new Uint8Array([0,0,0,0,0,0,0,0,115,111,117,110,0,0,0,0,0,0,0,0,0,0,0,0,83,111,117,110,100,72,97,110,100,108,101,114,0]),ne={video:fe,audio:re},ve=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),de=new Uint8Array([0,0,0,0,0,0,0,0]),ke=new Uint8Array([0,0,0,0,0,0,0,0]),De=ke,Me=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),Ne=ke,oe=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0])}})(),a=function(m){var x=[],T=0,E,P,M;for(E=1;E<arguments.length;E++)x.push(arguments[E]);for(E=x.length;E--;)T+=x[E].byteLength;for(P=new Uint8Array(T+8),M=new DataView(P.buffer,P.byteOffset,P.byteLength),M.setUint32(0,P.byteLength),P.set(m,4),E=0,T=8;E<x.length;E++)P.set(x[E],T),T+=x[E].byteLength;return P},o=function(){return a(H.dinf,a(H.dref,ve))},l=function(m){return a(H.esds,new Uint8Array([0,0,0,0,3,25,0,0,0,4,17,64,21,0,6,0,0,0,218,192,0,0,218,192,5,2,m.audioobjecttype<<3|m.samplingfrequencyindex>>>1,m.samplingfrequencyindex<<7|m.channelcount<<3,6,1,2]))},u=function(){return a(H.ftyp,K,ie,K,he)},R=function(m){return a(H.hdlr,ne[m])},c=function(m){return a(H.mdat,m)},$=function(m){var x=new Uint8Array([0,0,0,0,0,0,0,2,0,0,0,3,0,1,95,144,m.duration>>>24&255,m.duration>>>16&255,m.duration>>>8&255,m.duration&255,85,196,0,0]);return m.samplerate&&(x[12]=m.samplerate>>>24&255,x[13]=m.samplerate>>>16&255,x[14]=m.samplerate>>>8&255,x[15]=m.samplerate&255),a(H.mdhd,x)},N=function(m){return a(H.mdia,$(m),R(m.type),d(m))},h=function(m){return a(H.mfhd,new Uint8Array([0,0,0,0,(m&4278190080)>>24,(m&16711680)>>16,(m&65280)>>8,m&255]))},d=function(m){return a(H.minf,m.type==="video"?a(H.vmhd,oe):a(H.smhd,de),o(),F(m))},g=function(m,x){for(var T=[],E=x.length;E--;)T[E]=C(x[E]);return a.apply(null,[H.moof,h(m)].concat(T))},y=function(m){for(var x=m.length,T=[];x--;)T[x]=k(m[x]);return a.apply(null,[H.moov,_(4294967295)].concat(T).concat(p(m)))},p=function(m){for(var x=m.length,T=[];x--;)T[x]=I(m[x]);return a.apply(null,[H.mvex].concat(T))},_=function(m){var x=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,2,0,1,95,144,(m&4278190080)>>24,(m&16711680)>>16,(m&65280)>>8,m&255,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255]);return a(H.mvhd,x)},L=function(m){var x=m.samples||[],T=new Uint8Array(4+x.length),E,P;for(P=0;P<x.length;P++)E=x[P].flags,T[P+4]=E.dependsOn<<4|E.isDependedOn<<2|E.hasRedundancy;return a(H.sdtp,T)},F=function(m){return a(H.stbl,B(m),a(H.stts,Ne),a(H.stsc,De),a(H.stsz,Me),a(H.stco,ke))},function(){var j,m;B=function(T){return a(H.stsd,new Uint8Array([0,0,0,0,0,0,0,1]),T.type==="video"?j(T):m(T))},j=function(T){var E=T.sps||[],P=T.pps||[],M=[],z=[],Q,te;for(Q=0;Q<E.length;Q++)M.push((E[Q].byteLength&65280)>>>8),M.push(E[Q].byteLength&255),M=M.concat(Array.prototype.slice.call(E[Q]));for(Q=0;Q<P.length;Q++)z.push((P[Q].byteLength&65280)>>>8),z.push(P[Q].byteLength&255),z=z.concat(Array.prototype.slice.call(P[Q]));if(te=[H.avc1,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,(T.width&65280)>>8,T.width&255,(T.height&65280)>>8,T.height&255,0,72,0,0,0,72,0,0,0,0,0,0,0,1,19,118,105,100,101,111,106,115,45,99,111,110,116,114,105,98,45,104,108,115,0,0,0,0,0,0,0,0,0,0,0,0,0,24,17,17]),a(H.avcC,new Uint8Array([1,T.profileIdc,T.profileCompatibility,T.levelIdc,255].concat([E.length],M,[P.length],z))),a(H.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192]))],T.sarRatio){var Z=T.sarRatio[0],se=T.sarRatio[1];te.push(a(H.pasp,new Uint8Array([(Z&4278190080)>>24,(Z&16711680)>>16,(Z&65280)>>8,Z&255,(se&4278190080)>>24,(se&16711680)>>16,(se&65280)>>8,se&255])))}return a.apply(null,te)},m=function(T){return a(H.mp4a,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,(T.channelcount&65280)>>8,T.channelcount&255,(T.samplesize&65280)>>8,T.samplesize&255,0,0,0,0,(T.samplerate&65280)>>8,T.samplerate&255,0,0]),l(T))}}(),A=function(m){var x=new Uint8Array([0,0,0,7,0,0,0,0,0,0,0,0,(m.id&4278190080)>>24,(m.id&16711680)>>16,(m.id&65280)>>8,m.id&255,0,0,0,0,(m.duration&4278190080)>>24,(m.duration&16711680)>>16,(m.duration&65280)>>8,m.duration&255,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,(m.width&65280)>>8,m.width&255,0,0,(m.height&65280)>>8,m.height&255,0,0]);return a(H.tkhd,x)},C=function(m){var x,T,E,P,M,z,Q;return x=a(H.tfhd,new Uint8Array([0,0,0,58,(m.id&4278190080)>>24,(m.id&16711680)>>16,(m.id&65280)>>8,m.id&255,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0])),z=Math.floor(m.baseMediaDecodeTime/n),Q=Math.floor(m.baseMediaDecodeTime%n),T=a(H.tfdt,new Uint8Array([1,0,0,0,z>>>24&255,z>>>16&255,z>>>8&255,z&255,Q>>>24&255,Q>>>16&255,Q>>>8&255,Q&255])),M=92,m.type==="audio"?(E=G(m,M),a(H.traf,x,T,E)):(P=L(m),E=G(m,P.length+M),a(H.traf,x,T,E,P))},k=function(m){return m.duration=m.duration||4294967295,a(H.trak,A(m),N(m))},I=function(m){var x=new Uint8Array([0,0,0,0,(m.id&4278190080)>>24,(m.id&16711680)>>16,(m.id&65280)>>8,m.id&255,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]);return m.type!=="video"&&(x[x.length-1]=0),a(H.trex,x)},function(){var j,m,x;x=function(E,P){var M=0,z=0,Q=0,te=0;return E.length&&(E[0].duration!==void 0&&(M=1),E[0].size!==void 0&&(z=2),E[0].flags!==void 0&&(Q=4),E[0].compositionTimeOffset!==void 0&&(te=8)),[0,0,M|z|Q|te,1,(E.length&4278190080)>>>24,(E.length&16711680)>>>16,(E.length&65280)>>>8,E.length&255,(P&4278190080)>>>24,(P&16711680)>>>16,(P&65280)>>>8,P&255]},m=function(E,P){var M,z,Q,te,Z,se;for(te=E.samples||[],P+=20+16*te.length,Q=x(te,P),z=new Uint8Array(Q.length+te.length*16),z.set(Q),M=Q.length,se=0;se<te.length;se++)Z=te[se],z[M++]=(Z.duration&4278190080)>>>24,z[M++]=(Z.duration&16711680)>>>16,z[M++]=(Z.duration&65280)>>>8,z[M++]=Z.duration&255,z[M++]=(Z.size&4278190080)>>>24,z[M++]=(Z.size&16711680)>>>16,z[M++]=(Z.size&65280)>>>8,z[M++]=Z.size&255,z[M++]=Z.flags.isLeading<<2|Z.flags.dependsOn,z[M++]=Z.flags.isDependedOn<<6|Z.flags.hasRedundancy<<4|Z.flags.paddingValue<<1|Z.flags.isNonSyncSample,z[M++]=Z.flags.degradationPriority&61440,z[M++]=Z.flags.degradationPriority&15,z[M++]=(Z.compositionTimeOffset&4278190080)>>>24,z[M++]=(Z.compositionTimeOffset&16711680)>>>16,z[M++]=(Z.compositionTimeOffset&65280)>>>8,z[M++]=Z.compositionTimeOffset&255;return a(H.trun,z)},j=function(E,P){var M,z,Q,te,Z,se;for(te=E.samples||[],P+=20+8*te.length,Q=x(te,P),M=new Uint8Array(Q.length+te.length*8),M.set(Q),z=Q.length,se=0;se<te.length;se++)Z=te[se],M[z++]=(Z.duration&4278190080)>>>24,M[z++]=(Z.duration&16711680)>>>16,M[z++]=(Z.duration&65280)>>>8,M[z++]=Z.duration&255,M[z++]=(Z.size&4278190080)>>>24,M[z++]=(Z.size&16711680)>>>16,M[z++]=(Z.size&65280)>>>8,M[z++]=Z.size&255;return a(H.trun,M)},G=function(E,P){return E.type==="audio"?j(E,P):m(E,P)}}();var Ye={ftyp:u,mdat:c,moof:g,moov:y,initSegment:function(m){var x=u(),T=y(m),E;return E=new Uint8Array(x.byteLength+T.byteLength),E.set(x),E.set(T,x.byteLength),E}},Re=function(m){var x,T,E=[],P=[];for(P.byteLength=0,P.nalCount=0,P.duration=0,E.byteLength=0,x=0;x<m.length;x++)T=m[x],T.nalUnitType==="access_unit_delimiter_rbsp"?(E.length&&(E.duration=T.dts-E.dts,P.byteLength+=E.byteLength,P.nalCount+=E.length,P.duration+=E.duration,P.push(E)),E=[T],E.byteLength=T.data.byteLength,E.pts=T.pts,E.dts=T.dts):(T.nalUnitType==="slice_layer_without_partitioning_rbsp_idr"&&(E.keyFrame=!0),E.duration=T.dts-E.dts,E.byteLength+=T.data.byteLength,E.push(T));return P.length&&(!E.duration||E.duration<=0)&&(E.duration=P[P.length-1].duration),P.byteLength+=E.byteLength,P.nalCount+=E.length,P.duration+=E.duration,P.push(E),P},Oe=function(m){var x,T,E=[],P=[];for(E.byteLength=0,E.nalCount=0,E.duration=0,E.pts=m[0].pts,E.dts=m[0].dts,P.byteLength=0,P.nalCount=0,P.duration=0,P.pts=m[0].pts,P.dts=m[0].dts,x=0;x<m.length;x++)T=m[x],T.keyFrame?(E.length&&(P.push(E),P.byteLength+=E.byteLength,P.nalCount+=E.nalCount,P.duration+=E.duration),E=[T],E.nalCount=T.length,E.byteLength=T.byteLength,E.pts=T.pts,E.dts=T.dts,E.duration=T.duration):(E.duration+=T.duration,E.nalCount+=T.length,E.byteLength+=T.byteLength,E.push(T));return P.length&&E.duration<=0&&(E.duration=P[P.length-1].duration),P.byteLength+=E.byteLength,P.nalCount+=E.nalCount,P.duration+=E.duration,P.push(E),P},Ve=function(m){var x;return!m[0][0].keyFrame&&m.length>1&&(x=m.shift(),m.byteLength-=x.byteLength,m.nalCount-=x.nalCount,m[0][0].dts=x.dts,m[0][0].pts=x.pts,m[0][0].duration+=x.duration),m},nt=function(){return{size:0,flags:{isLeading:0,dependsOn:1,isDependedOn:0,hasRedundancy:0,degradationPriority:0,isNonSyncSample:1}}},_t=function(m,x){var T=nt();return T.dataOffset=x,T.compositionTimeOffset=m.pts-m.dts,T.duration=m.duration,T.size=4*m.length,T.size+=m.byteLength,m.keyFrame&&(T.flags.dependsOn=2,T.flags.isNonSyncSample=0),T},Nt=function(m,x){var T,E,P,M,z,Q=x||0,te=[];for(T=0;T<m.length;T++)for(M=m[T],E=0;E<M.length;E++)z=M[E],P=_t(z,Q),Q+=P.size,te.push(P);return te},Mi=function(m){var x,T,E,P,M,z,Q=0,te=m.byteLength,Z=m.nalCount,se=te+4*Z,ge=new Uint8Array(se),xe=new DataView(ge.buffer);for(x=0;x<m.length;x++)for(P=m[x],T=0;T<P.length;T++)for(M=P[T],E=0;E<M.length;E++)z=M[E],xe.setUint32(Q,z.data.byteLength),Q+=4,ge.set(z.data,Q),Q+=z.data.byteLength;return ge},Ft=function(m,x){var T,E=x||0,P=[];return T=_t(m,E),P.push(T),P},zi=function(m){var x,T,E=0,P=m.byteLength,M=m.length,z=P+4*M,Q=new Uint8Array(z),te=new DataView(Q.buffer);for(x=0;x<m.length;x++)T=m[x],te.setUint32(E,T.data.byteLength),E+=4,Q.set(T.data,E),E+=T.data.byteLength;return Q},Te={groupNalsIntoFrames:Re,groupFramesIntoGops:Oe,extendFirstKeyFrame:Ve,generateSampleTable:Nt,concatenateNalData:Mi,generateSampleTableForFrame:Ft,concatenateNalDataForFrame:zi},Ee=[33,16,5,32,164,27],Be=[33,65,108,84,1,2,4,8,168,2,4,8,17,191,252],Fe=function(m){for(var x=[];m--;)x.push(0);return x},Xe=function(m){return Object.keys(m).reduce(function(x,T){return x[T]=new Uint8Array(m[T].reduce(function(E,P){return E.concat(P)},[])),x},{})},Je,Tt=function(){if(!Je){var m={96e3:[Ee,[227,64],Fe(154),[56]],88200:[Ee,[231],Fe(170),[56]],64e3:[Ee,[248,192],Fe(240),[56]],48e3:[Ee,[255,192],Fe(268),[55,148,128],Fe(54),[112]],44100:[Ee,[255,192],Fe(268),[55,163,128],Fe(84),[112]],32e3:[Ee,[255,192],Fe(268),[55,234],Fe(226),[112]],24e3:[Ee,[255,192],Fe(268),[55,255,128],Fe(268),[111,112],Fe(126),[224]],16e3:[Ee,[255,192],Fe(268),[55,255,128],Fe(268),[111,255],Fe(269),[223,108],Fe(195),[1,192]],12e3:[Be,Fe(268),[3,127,248],Fe(268),[6,255,240],Fe(268),[13,255,224],Fe(268),[27,253,128],Fe(259),[56]],11025:[Be,Fe(268),[3,127,248],Fe(268),[6,255,240],Fe(268),[13,255,224],Fe(268),[27,255,192],Fe(268),[55,175,128],Fe(108),[112]],8e3:[Be,Fe(268),[3,121,16],Fe(47),[7]]};Je=Xe(m)}return Je},Wi=9e4,Sr,xr,cr,Gi,un,Fn,cn;Sr=function(m){return m*Wi},xr=function(m,x){return m*x},cr=function(m){return m/Wi},Gi=function(m,x){return m/x},un=function(m,x){return Sr(Gi(m,x))},Fn=function(m,x){return xr(cr(m),x)},cn=function(m,x,T){return cr(T?m:m-x)};var Ze={ONE_SECOND_IN_TS:Wi,secondsToVideoTs:Sr,secondsToAudioTs:xr,videoTsToSeconds:cr,audioTsToSeconds:Gi,audioTsToVideoTs:un,videoTsToAudioTs:Fn,metadataTsToSeconds:cn},st=function(m){var x,T,E=0;for(x=0;x<m.length;x++)T=m[x],E+=T.data.byteLength;return E},ha=function(m,x,T,E){var P,M=0,z=0,Q=0,te=0,Z,se,ge;if(x.length&&(P=Ze.audioTsToVideoTs(m.baseMediaDecodeTime,m.samplerate),M=Math.ceil(Ze.ONE_SECOND_IN_TS/(m.samplerate/1024)),T&&E&&(z=P-Math.max(T,E),Q=Math.floor(z/M),te=Q*M),!(Q<1||te>Ze.ONE_SECOND_IN_TS/2))){for(Z=Tt()[m.samplerate],Z||(Z=x[0].data),se=0;se<Q;se++)ge=x[0],x.splice(0,0,{data:Z,dts:ge.dts-M,pts:ge.pts-M});return m.baseMediaDecodeTime-=Math.floor(Ze.videoTsToAudioTs(te,m.samplerate)),te}},hn=function(m,x,T){return x.minSegmentDts>=T?m:(x.minSegmentDts=1/0,m.filter(function(E){return E.dts>=T?(x.minSegmentDts=Math.min(x.minSegmentDts,E.dts),x.minSegmentPts=x.minSegmentDts,!0):!1}))},da=function(m){var x,T,E=[];for(x=0;x<m.length;x++)T=m[x],E.push({size:T.data.byteLength,duration:1024});return E},ps=function(m){var x,T,E=0,P=new Uint8Array(st(m));for(x=0;x<m.length;x++)T=m[x],P.set(T.data,E),E+=T.data.byteLength;return P},Ki={prefixWithSilence:ha,trimAdtsFramesByEarliestDts:hn,generateSampleTable:da,concatenateFrameData:ps},fa=Ze.ONE_SECOND_IN_TS,ms=function(m,x){typeof x.pts=="number"&&(m.timelineStartInfo.pts===void 0&&(m.timelineStartInfo.pts=x.pts),m.minSegmentPts===void 0?m.minSegmentPts=x.pts:m.minSegmentPts=Math.min(m.minSegmentPts,x.pts),m.maxSegmentPts===void 0?m.maxSegmentPts=x.pts:m.maxSegmentPts=Math.max(m.maxSegmentPts,x.pts)),typeof x.dts=="number"&&(m.timelineStartInfo.dts===void 0&&(m.timelineStartInfo.dts=x.dts),m.minSegmentDts===void 0?m.minSegmentDts=x.dts:m.minSegmentDts=Math.min(m.minSegmentDts,x.dts),m.maxSegmentDts===void 0?m.maxSegmentDts=x.dts:m.maxSegmentDts=Math.max(m.maxSegmentDts,x.dts))},pa=function(m){delete m.minSegmentDts,delete m.maxSegmentDts,delete m.minSegmentPts,delete m.maxSegmentPts},q=function(m,x){var T,E,P=m.minSegmentDts;return x||(P-=m.timelineStartInfo.dts),T=m.timelineStartInfo.baseMediaDecodeTime,T+=P,T=Math.max(0,T),m.type==="audio"&&(E=m.samplerate/fa,T*=E,T=Math.floor(T)),T},V={clearDtsInfo:pa,calculateTrackBaseMediaDecodeTime:q,collectDtsInfo:ms},ee=4,pe=128,we=function(m){for(var x=0,T={payloadType:-1,payloadSize:0},E=0,P=0;x<m.byteLength&&m[x]!==pe;){for(;m[x]===255;)E+=255,x++;for(E+=m[x++];m[x]===255;)P+=255,x++;if(P+=m[x++],!T.payload&&E===ee){var M=String.fromCharCode(m[x+3],m[x+4],m[x+5],m[x+6]);if(M==="GA94"){T.payloadType=E,T.payloadSize=P,T.payload=m.subarray(x,x+P);break}else T.payload=void 0}x+=P,E=0,P=0}return T},qe=function(m){return m.payload[0]!==181||(m.payload[1]<<8|m.payload[2])!==49||String.fromCharCode(m.payload[3],m.payload[4],m.payload[5],m.payload[6])!=="GA94"||m.payload[7]!==3?null:m.payload.subarray(8,m.payload.length-1)},ut=function(m,x){var T=[],E,P,M,z;if(!(x[0]&64))return T;for(P=x[0]&31,E=0;E<P;E++)M=E*3,z={type:x[M+2]&3,pts:m},x[M+2]&4&&(z.ccData=x[M+3]<<8|x[M+4],T.push(z));return T},Yt=function(m){for(var x=m.byteLength,T=[],E=1,P,M;E<x-2;)m[E]===0&&m[E+1]===0&&m[E+2]===3?(T.push(E+2),E+=2):E++;if(T.length===0)return m;P=x-T.length,M=new Uint8Array(P);var z=0;for(E=0;E<P;z++,E++)z===T[0]&&(z++,T.shift()),M[E]=m[z];return M},oi={parseSei:we,parseUserData:qe,parseCaptionPackets:ut,discardEmulationPreventionBytes:Yt,USER_DATA_REGISTERED_ITU_T_T35:ee},kt=function j(m){m=m||{},j.prototype.init.call(this),this.parse708captions_=typeof m.parse708captions=="boolean"?m.parse708captions:!0,this.captionPackets_=[],this.ccStreams_=[new xt(0,0),new xt(0,1),new xt(1,0),new xt(1,1)],this.parse708captions_&&(this.cc708Stream_=new it({captionServices:m.captionServices})),this.reset(),this.ccStreams_.forEach(function(x){x.on("data",this.trigger.bind(this,"data")),x.on("partialdone",this.trigger.bind(this,"partialdone")),x.on("done",this.trigger.bind(this,"done"))},this),this.parse708captions_&&(this.cc708Stream_.on("data",this.trigger.bind(this,"data")),this.cc708Stream_.on("partialdone",this.trigger.bind(this,"partialdone")),this.cc708Stream_.on("done",this.trigger.bind(this,"done")))};kt.prototype=new e,kt.prototype.push=function(j){var m,x,T;if(j.nalUnitType==="sei_rbsp"&&(m=oi.parseSei(j.escapedRBSP),!!m.payload&&m.payloadType===oi.USER_DATA_REGISTERED_ITU_T_T35&&(x=oi.parseUserData(m),!!x))){if(j.dts<this.latestDts_){this.ignoreNextEqualDts_=!0;return}else if(j.dts===this.latestDts_&&this.ignoreNextEqualDts_){this.numSameDts_--,this.numSameDts_||(this.ignoreNextEqualDts_=!1);return}T=oi.parseCaptionPackets(j.pts,x),this.captionPackets_=this.captionPackets_.concat(T),this.latestDts_!==j.dts&&(this.numSameDts_=0),this.numSameDts_++,this.latestDts_=j.dts}},kt.prototype.flushCCStreams=function(j){this.ccStreams_.forEach(function(m){return j==="flush"?m.flush():m.partialFlush()},this)},kt.prototype.flushStream=function(j){if(!this.captionPackets_.length){this.flushCCStreams(j);return}this.captionPackets_.forEach(function(m,x){m.presortIndex=x}),this.captionPackets_.sort(function(m,x){return m.pts===x.pts?m.presortIndex-x.presortIndex:m.pts-x.pts}),this.captionPackets_.forEach(function(m){m.type<2?this.dispatchCea608Packet(m):this.dispatchCea708Packet(m)},this),this.captionPackets_.length=0,this.flushCCStreams(j)},kt.prototype.flush=function(){return this.flushStream("flush")},kt.prototype.partialFlush=function(){return this.flushStream("partialFlush")},kt.prototype.reset=function(){this.latestDts_=null,this.ignoreNextEqualDts_=!1,this.numSameDts_=0,this.activeCea608Channel_=[null,null],this.ccStreams_.forEach(function(j){j.reset()})},kt.prototype.dispatchCea608Packet=function(j){this.setsTextOrXDSActive(j)?this.activeCea608Channel_[j.type]=null:this.setsChannel1Active(j)?this.activeCea608Channel_[j.type]=0:this.setsChannel2Active(j)&&(this.activeCea608Channel_[j.type]=1),this.activeCea608Channel_[j.type]!==null&&this.ccStreams_[(j.type<<1)+this.activeCea608Channel_[j.type]].push(j)},kt.prototype.setsChannel1Active=function(j){return(j.ccData&30720)===4096},kt.prototype.setsChannel2Active=function(j){return(j.ccData&30720)===6144},kt.prototype.setsTextOrXDSActive=function(j){return(j.ccData&28928)===256||(j.ccData&30974)===4138||(j.ccData&30974)===6186},kt.prototype.dispatchCea708Packet=function(j){this.parse708captions_&&this.cc708Stream_.push(j)};var Xi={127:9834,4128:32,4129:160,4133:8230,4138:352,4140:338,4144:9608,4145:8216,4146:8217,4147:8220,4148:8221,4149:8226,4153:8482,4154:353,4156:339,4157:8480,4159:376,4214:8539,4215:8540,4216:8541,4217:8542,4218:9168,4219:9124,4220:9123,4221:9135,4222:9126,4223:9121,4256:12600},hr=function(m){var x=Xi[m]||m;return m&4096&&m===x?"":String.fromCharCode(x)},pi=function(m){return 32<=m&&m<=127||160<=m&&m<=255},Bt=function(m){this.windowNum=m,this.reset()};Bt.prototype.reset=function(){this.clearText(),this.pendingNewLine=!1,this.winAttr={},this.penAttr={},this.penLoc={},this.penColor={},this.visible=0,this.rowLock=0,this.columnLock=0,this.priority=0,this.relativePositioning=0,this.anchorVertical=0,this.anchorHorizontal=0,this.anchorPoint=0,this.rowCount=1,this.virtualRowCount=this.rowCount+1,this.columnCount=41,this.windowStyle=0,this.penStyle=0},Bt.prototype.getText=function(){return this.rows.join(`
282
- `)},Bt.prototype.clearText=function(){this.rows=[""],this.rowIdx=0},Bt.prototype.newLine=function(j){for(this.rows.length>=this.virtualRowCount&&typeof this.beforeRowOverflow=="function"&&this.beforeRowOverflow(j),this.rows.length>0&&(this.rows.push(""),this.rowIdx++);this.rows.length>this.virtualRowCount;)this.rows.shift(),this.rowIdx--},Bt.prototype.isEmpty=function(){return this.rows.length===0?!0:this.rows.length===1?this.rows[0]==="":!1},Bt.prototype.addText=function(j){this.rows[this.rowIdx]+=j},Bt.prototype.backspace=function(){if(!this.isEmpty()){var j=this.rows[this.rowIdx];this.rows[this.rowIdx]=j.substr(0,j.length-1)}};var ot=function(m,x,T){this.serviceNum=m,this.text="",this.currentWindow=new Bt(-1),this.windows=[],this.stream=T,typeof x=="string"&&this.createTextDecoder(x)};ot.prototype.init=function(j,m){this.startPts=j;for(var x=0;x<8;x++)this.windows[x]=new Bt(x),typeof m=="function"&&(this.windows[x].beforeRowOverflow=m)},ot.prototype.setCurrentWindow=function(j){this.currentWindow=this.windows[j]},ot.prototype.createTextDecoder=function(j){if(typeof TextDecoder>"u")this.stream.trigger("log",{level:"warn",message:"The `encoding` option is unsupported without TextDecoder support"});else try{this.textDecoder_=new TextDecoder(j)}catch(m){this.stream.trigger("log",{level:"warn",message:"TextDecoder could not be created with "+j+" encoding. "+m})}};var it=function j(m){m=m||{},j.prototype.init.call(this);var x=this,T=m.captionServices||{},E={},P;Object.keys(T).forEach(function(M){P=T[M],/^SERVICE/.test(M)&&(E[M]=P.encoding)}),this.serviceEncodings=E,this.current708Packet=null,this.services={},this.push=function(M){M.type===3?(x.new708Packet(),x.add708Bytes(M)):(x.current708Packet===null&&x.new708Packet(),x.add708Bytes(M))}};it.prototype=new e,it.prototype.new708Packet=function(){this.current708Packet!==null&&this.push708Packet(),this.current708Packet={data:[],ptsVals:[]}},it.prototype.add708Bytes=function(j){var m=j.ccData,x=m>>>8,T=m&255;this.current708Packet.ptsVals.push(j.pts),this.current708Packet.data.push(x),this.current708Packet.data.push(T)},it.prototype.push708Packet=function(){var j=this.current708Packet,m=j.data,x=null,T=null,E=0,P=m[E++];for(j.seq=P>>6,j.sizeCode=P&63;E<m.length;E++)P=m[E++],x=P>>5,T=P&31,x===7&&T>0&&(P=m[E++],x=P),this.pushServiceBlock(x,E,T),T>0&&(E+=T-1)},it.prototype.pushServiceBlock=function(j,m,x){var T,E=m,P=this.current708Packet.data,M=this.services[j];for(M||(M=this.initService(j,E));E<m+x&&E<P.length;E++)T=P[E],pi(T)?E=this.handleText(E,M):T===24?E=this.multiByteCharacter(E,M):T===16?E=this.extendedCommands(E,M):128<=T&&T<=135?E=this.setCurrentWindow(E,M):152<=T&&T<=159?E=this.defineWindow(E,M):T===136?E=this.clearWindows(E,M):T===140?E=this.deleteWindows(E,M):T===137?E=this.displayWindows(E,M):T===138?E=this.hideWindows(E,M):T===139?E=this.toggleWindows(E,M):T===151?E=this.setWindowAttributes(E,M):T===144?E=this.setPenAttributes(E,M):T===145?E=this.setPenColor(E,M):T===146?E=this.setPenLocation(E,M):T===143?M=this.reset(E,M):T===8?M.currentWindow.backspace():T===12?M.currentWindow.clearText():T===13?M.currentWindow.pendingNewLine=!0:T===14?M.currentWindow.clearText():T===141&&E++},it.prototype.extendedCommands=function(j,m){var x=this.current708Packet.data,T=x[++j];return pi(T)&&(j=this.handleText(j,m,{isExtended:!0})),j},it.prototype.getPts=function(j){return this.current708Packet.ptsVals[Math.floor(j/2)]},it.prototype.initService=function(j,m){var T="SERVICE"+j,x=this,T,E;return T in this.serviceEncodings&&(E=this.serviceEncodings[T]),this.services[j]=new ot(j,E,x),this.services[j].init(this.getPts(m),function(P){x.flushDisplayed(P,x.services[j])}),this.services[j]},it.prototype.handleText=function(j,m,x){var T=x&&x.isExtended,E=x&&x.isMultiByte,P=this.current708Packet.data,M=T?4096:0,z=P[j],Q=P[j+1],te=m.currentWindow,Z,se;return m.textDecoder_&&!T?(E?(se=[z,Q],j++):se=[z],Z=m.textDecoder_.decode(new Uint8Array(se))):Z=hr(M|z),te.pendingNewLine&&!te.isEmpty()&&te.newLine(this.getPts(j)),te.pendingNewLine=!1,te.addText(Z),j},it.prototype.multiByteCharacter=function(j,m){var x=this.current708Packet.data,T=x[j+1],E=x[j+2];return pi(T)&&pi(E)&&(j=this.handleText(++j,m,{isMultiByte:!0})),j},it.prototype.setCurrentWindow=function(j,m){var x=this.current708Packet.data,T=x[j],E=T&7;return m.setCurrentWindow(E),j},it.prototype.defineWindow=function(j,m){var x=this.current708Packet.data,T=x[j],E=T&7;m.setCurrentWindow(E);var P=m.currentWindow;return T=x[++j],P.visible=(T&32)>>5,P.rowLock=(T&16)>>4,P.columnLock=(T&8)>>3,P.priority=T&7,T=x[++j],P.relativePositioning=(T&128)>>7,P.anchorVertical=T&127,T=x[++j],P.anchorHorizontal=T,T=x[++j],P.anchorPoint=(T&240)>>4,P.rowCount=T&15,T=x[++j],P.columnCount=T&63,T=x[++j],P.windowStyle=(T&56)>>3,P.penStyle=T&7,P.virtualRowCount=P.rowCount+1,j},it.prototype.setWindowAttributes=function(j,m){var x=this.current708Packet.data,T=x[j],E=m.currentWindow.winAttr;return T=x[++j],E.fillOpacity=(T&192)>>6,E.fillRed=(T&48)>>4,E.fillGreen=(T&12)>>2,E.fillBlue=T&3,T=x[++j],E.borderType=(T&192)>>6,E.borderRed=(T&48)>>4,E.borderGreen=(T&12)>>2,E.borderBlue=T&3,T=x[++j],E.borderType+=(T&128)>>5,E.wordWrap=(T&64)>>6,E.printDirection=(T&48)>>4,E.scrollDirection=(T&12)>>2,E.justify=T&3,T=x[++j],E.effectSpeed=(T&240)>>4,E.effectDirection=(T&12)>>2,E.displayEffect=T&3,j},it.prototype.flushDisplayed=function(j,m){for(var x=[],T=0;T<8;T++)m.windows[T].visible&&!m.windows[T].isEmpty()&&x.push(m.windows[T].getText());m.endPts=j,m.text=x.join(`
283
-
284
- `),this.pushCaption(m),m.startPts=j},it.prototype.pushCaption=function(j){j.text!==""&&(this.trigger("data",{startPts:j.startPts,endPts:j.endPts,text:j.text,stream:"cc708_"+j.serviceNum}),j.text="",j.startPts=j.endPts)},it.prototype.displayWindows=function(j,m){var x=this.current708Packet.data,T=x[++j],E=this.getPts(j);this.flushDisplayed(E,m);for(var P=0;P<8;P++)T&1<<P&&(m.windows[P].visible=1);return j},it.prototype.hideWindows=function(j,m){var x=this.current708Packet.data,T=x[++j],E=this.getPts(j);this.flushDisplayed(E,m);for(var P=0;P<8;P++)T&1<<P&&(m.windows[P].visible=0);return j},it.prototype.toggleWindows=function(j,m){var x=this.current708Packet.data,T=x[++j],E=this.getPts(j);this.flushDisplayed(E,m);for(var P=0;P<8;P++)T&1<<P&&(m.windows[P].visible^=1);return j},it.prototype.clearWindows=function(j,m){var x=this.current708Packet.data,T=x[++j],E=this.getPts(j);this.flushDisplayed(E,m);for(var P=0;P<8;P++)T&1<<P&&m.windows[P].clearText();return j},it.prototype.deleteWindows=function(j,m){var x=this.current708Packet.data,T=x[++j],E=this.getPts(j);this.flushDisplayed(E,m);for(var P=0;P<8;P++)T&1<<P&&m.windows[P].reset();return j},it.prototype.setPenAttributes=function(j,m){var x=this.current708Packet.data,T=x[j],E=m.currentWindow.penAttr;return T=x[++j],E.textTag=(T&240)>>4,E.offset=(T&12)>>2,E.penSize=T&3,T=x[++j],E.italics=(T&128)>>7,E.underline=(T&64)>>6,E.edgeType=(T&56)>>3,E.fontStyle=T&7,j},it.prototype.setPenColor=function(j,m){var x=this.current708Packet.data,T=x[j],E=m.currentWindow.penColor;return T=x[++j],E.fgOpacity=(T&192)>>6,E.fgRed=(T&48)>>4,E.fgGreen=(T&12)>>2,E.fgBlue=T&3,T=x[++j],E.bgOpacity=(T&192)>>6,E.bgRed=(T&48)>>4,E.bgGreen=(T&12)>>2,E.bgBlue=T&3,T=x[++j],E.edgeRed=(T&48)>>4,E.edgeGreen=(T&12)>>2,E.edgeBlue=T&3,j},it.prototype.setPenLocation=function(j,m){var x=this.current708Packet.data,T=x[j],E=m.currentWindow.penLoc;return m.currentWindow.pendingNewLine=!0,T=x[++j],E.row=T&15,T=x[++j],E.column=T&63,j},it.prototype.reset=function(j,m){var x=this.getPts(j);return this.flushDisplayed(x,m),this.initService(m.serviceNum,j)};var dn={42:225,92:233,94:237,95:243,96:250,123:231,124:247,125:209,126:241,127:9608,304:174,305:176,306:189,307:191,308:8482,309:162,310:163,311:9834,312:224,313:160,314:232,315:226,316:234,317:238,318:244,319:251,544:193,545:201,546:211,547:218,548:220,549:252,550:8216,551:161,552:42,553:39,554:8212,555:169,556:8480,557:8226,558:8220,559:8221,560:192,561:194,562:199,563:200,564:202,565:203,566:235,567:206,568:207,569:239,570:212,571:217,572:249,573:219,574:171,575:187,800:195,801:227,802:205,803:204,804:236,805:210,806:242,807:213,808:245,809:123,810:125,811:92,812:94,813:95,814:124,815:126,816:196,817:228,818:214,819:246,820:223,821:165,822:164,823:9474,824:197,825:229,826:216,827:248,828:9484,829:9488,830:9492,831:9496},bt=function(m){return m===null?"":(m=dn[m]||m,String.fromCharCode(m))},li=14,Qi=[4352,4384,4608,4640,5376,5408,5632,5664,5888,5920,4096,4864,4896,5120,5152],tt=function(){for(var m=[],x=li+1;x--;)m.push("");return m},xt=function j(m,x){j.prototype.init.call(this),this.field_=m||0,this.dataChannel_=x||0,this.name_="CC"+((this.field_<<1|this.dataChannel_)+1),this.setConstants(),this.reset(),this.push=function(T){var E,P,M,z,Q;if(E=T.ccData&32639,E===this.lastControlCode_){this.lastControlCode_=null;return}if((E&61440)===4096?this.lastControlCode_=E:E!==this.PADDING_&&(this.lastControlCode_=null),M=E>>>8,z=E&255,E!==this.PADDING_)if(E===this.RESUME_CAPTION_LOADING_)this.mode_="popOn";else if(E===this.END_OF_CAPTION_)this.mode_="popOn",this.clearFormatting(T.pts),this.flushDisplayed(T.pts),P=this.displayed_,this.displayed_=this.nonDisplayed_,this.nonDisplayed_=P,this.startPts_=T.pts;else if(E===this.ROLL_UP_2_ROWS_)this.rollUpRows_=2,this.setRollUp(T.pts);else if(E===this.ROLL_UP_3_ROWS_)this.rollUpRows_=3,this.setRollUp(T.pts);else if(E===this.ROLL_UP_4_ROWS_)this.rollUpRows_=4,this.setRollUp(T.pts);else if(E===this.CARRIAGE_RETURN_)this.clearFormatting(T.pts),this.flushDisplayed(T.pts),this.shiftRowsUp_(),this.startPts_=T.pts;else if(E===this.BACKSPACE_)this.mode_==="popOn"?this.nonDisplayed_[this.row_]=this.nonDisplayed_[this.row_].slice(0,-1):this.displayed_[this.row_]=this.displayed_[this.row_].slice(0,-1);else if(E===this.ERASE_DISPLAYED_MEMORY_)this.flushDisplayed(T.pts),this.displayed_=tt();else if(E===this.ERASE_NON_DISPLAYED_MEMORY_)this.nonDisplayed_=tt();else if(E===this.RESUME_DIRECT_CAPTIONING_)this.mode_!=="paintOn"&&(this.flushDisplayed(T.pts),this.displayed_=tt()),this.mode_="paintOn",this.startPts_=T.pts;else if(this.isSpecialCharacter(M,z))M=(M&3)<<8,Q=bt(M|z),this[this.mode_](T.pts,Q),this.column_++;else if(this.isExtCharacter(M,z))this.mode_==="popOn"?this.nonDisplayed_[this.row_]=this.nonDisplayed_[this.row_].slice(0,-1):this.displayed_[this.row_]=this.displayed_[this.row_].slice(0,-1),M=(M&3)<<8,Q=bt(M|z),this[this.mode_](T.pts,Q),this.column_++;else if(this.isMidRowCode(M,z))this.clearFormatting(T.pts),this[this.mode_](T.pts," "),this.column_++,(z&14)===14&&this.addFormatting(T.pts,["i"]),(z&1)===1&&this.addFormatting(T.pts,["u"]);else if(this.isOffsetControlCode(M,z))this.column_+=z&3;else if(this.isPAC(M,z)){var te=Qi.indexOf(E&7968);this.mode_==="rollUp"&&(te-this.rollUpRows_+1<0&&(te=this.rollUpRows_-1),this.setRollUp(T.pts,te)),te!==this.row_&&(this.clearFormatting(T.pts),this.row_=te),z&1&&this.formatting_.indexOf("u")===-1&&this.addFormatting(T.pts,["u"]),(E&16)===16&&(this.column_=((E&14)>>1)*4),this.isColorPAC(z)&&(z&14)===14&&this.addFormatting(T.pts,["i"])}else this.isNormalChar(M)&&(z===0&&(z=null),Q=bt(M),Q+=bt(z),this[this.mode_](T.pts,Q),this.column_+=Q.length)}};xt.prototype=new e,xt.prototype.flushDisplayed=function(j){var m=this.displayed_.map(function(x,T){try{return x.trim()}catch{return this.trigger("log",{level:"warn",message:"Skipping a malformed 608 caption at index "+T+"."}),""}},this).join(`
285
- `).replace(/^\n+|\n+$/g,"");m.length&&this.trigger("data",{startPts:this.startPts_,endPts:j,text:m,stream:this.name_})},xt.prototype.reset=function(){this.mode_="popOn",this.topRow_=0,this.startPts_=0,this.displayed_=tt(),this.nonDisplayed_=tt(),this.lastControlCode_=null,this.column_=0,this.row_=li,this.rollUpRows_=2,this.formatting_=[]},xt.prototype.setConstants=function(){this.dataChannel_===0?(this.BASE_=16,this.EXT_=17,this.CONTROL_=(20|this.field_)<<8,this.OFFSET_=23):this.dataChannel_===1&&(this.BASE_=24,this.EXT_=25,this.CONTROL_=(28|this.field_)<<8,this.OFFSET_=31),this.PADDING_=0,this.RESUME_CAPTION_LOADING_=this.CONTROL_|32,this.END_OF_CAPTION_=this.CONTROL_|47,this.ROLL_UP_2_ROWS_=this.CONTROL_|37,this.ROLL_UP_3_ROWS_=this.CONTROL_|38,this.ROLL_UP_4_ROWS_=this.CONTROL_|39,this.CARRIAGE_RETURN_=this.CONTROL_|45,this.RESUME_DIRECT_CAPTIONING_=this.CONTROL_|41,this.BACKSPACE_=this.CONTROL_|33,this.ERASE_DISPLAYED_MEMORY_=this.CONTROL_|44,this.ERASE_NON_DISPLAYED_MEMORY_=this.CONTROL_|46},xt.prototype.isSpecialCharacter=function(j,m){return j===this.EXT_&&m>=48&&m<=63},xt.prototype.isExtCharacter=function(j,m){return(j===this.EXT_+1||j===this.EXT_+2)&&m>=32&&m<=63},xt.prototype.isMidRowCode=function(j,m){return j===this.EXT_&&m>=32&&m<=47},xt.prototype.isOffsetControlCode=function(j,m){return j===this.OFFSET_&&m>=33&&m<=35},xt.prototype.isPAC=function(j,m){return j>=this.BASE_&&j<this.BASE_+8&&m>=64&&m<=127},xt.prototype.isColorPAC=function(j){return j>=64&&j<=79||j>=96&&j<=127},xt.prototype.isNormalChar=function(j){return j>=32&&j<=127},xt.prototype.setRollUp=function(j,m){if(this.mode_!=="rollUp"&&(this.row_=li,this.mode_="rollUp",this.flushDisplayed(j),this.nonDisplayed_=tt(),this.displayed_=tt()),m!==void 0&&m!==this.row_)for(var x=0;x<this.rollUpRows_;x++)this.displayed_[m-x]=this.displayed_[this.row_-x],this.displayed_[this.row_-x]="";m===void 0&&(m=this.row_),this.topRow_=m-this.rollUpRows_+1},xt.prototype.addFormatting=function(j,m){this.formatting_=this.formatting_.concat(m);var x=m.reduce(function(T,E){return T+"<"+E+">"},"");this[this.mode_](j,x)},xt.prototype.clearFormatting=function(j){if(this.formatting_.length){var m=this.formatting_.reverse().reduce(function(x,T){return x+"</"+T+">"},"");this.formatting_=[],this[this.mode_](j,m)}},xt.prototype.popOn=function(j,m){var x=this.nonDisplayed_[this.row_];x+=m,this.nonDisplayed_[this.row_]=x},xt.prototype.rollUp=function(j,m){var x=this.displayed_[this.row_];x+=m,this.displayed_[this.row_]=x},xt.prototype.shiftRowsUp_=function(){var j;for(j=0;j<this.topRow_;j++)this.displayed_[j]="";for(j=this.row_+1;j<li+1;j++)this.displayed_[j]="";for(j=this.topRow_;j<this.row_;j++)this.displayed_[j]=this.displayed_[j+1];this.displayed_[this.row_]=""},xt.prototype.paintOn=function(j,m){var x=this.displayed_[this.row_];x+=m,this.displayed_[this.row_]=x};var fn={CaptionStream:kt,Cea608Stream:xt,Cea708Stream:it},Ut={H264_STREAM_TYPE:27,ADTS_STREAM_TYPE:15,METADATA_STREAM_TYPE:21},wd=8589934592,pn=4294967296,pt="shared",ma=function(m,x){var T=1;for(m>x&&(T=-1);Math.abs(x-m)>pn;)m+=T*wd;return m},gs=function j(m){var x,T;j.prototype.init.call(this),this.type_=m||pt,this.push=function(E){this.type_!==pt&&E.type!==this.type_||(T===void 0&&(T=E.dts),E.dts=ma(E.dts,T),E.pts=ma(E.pts,T),x=E.dts,this.trigger("data",E))},this.flush=function(){T=x,this.trigger("done")},this.endTimeline=function(){this.flush(),this.trigger("endedtimeline")},this.discontinuity=function(){T=void 0,x=void 0},this.reset=function(){this.discontinuity(),this.trigger("reset")}};gs.prototype=new e;var Cu={TimestampRolloverStream:gs,handleRollover:ma},Eu=function(m,x,T){var E,P="";for(E=x;E<T;E++)P+="%"+("00"+m[E].toString(16)).slice(-2);return P},ga=function(m,x,T){return decodeURIComponent(Eu(m,x,T))},wu=function(m,x,T){return unescape(Eu(m,x,T))},Bn=function(m){return m[0]<<21|m[1]<<14|m[2]<<7|m[3]},va={TXXX:function(m){var x;if(m.data[0]===3){for(x=1;x<m.data.length;x++)if(m.data[x]===0){m.description=ga(m.data,1,x),m.value=ga(m.data,x+1,m.data.length).replace(/\0*$/,"");break}m.data=m.value}},WXXX:function(m){var x;if(m.data[0]===3){for(x=1;x<m.data.length;x++)if(m.data[x]===0){m.description=ga(m.data,1,x),m.url=ga(m.data,x+1,m.data.length);break}}},PRIV:function(m){var x;for(x=0;x<m.data.length;x++)if(m.data[x]===0){m.owner=wu(m.data,0,x);break}m.privateData=m.data.subarray(x+1),m.data=m.privateData}},vs;vs=function(m){var x={descriptor:m&&m.descriptor},T=0,E=[],P=0,M;if(vs.prototype.init.call(this),this.dispatchType=Ut.METADATA_STREAM_TYPE.toString(16),x.descriptor)for(M=0;M<x.descriptor.length;M++)this.dispatchType+=("00"+x.descriptor[M].toString(16)).slice(-2);this.push=function(z){var Q,te,Z,se,ge,xe;if(z.type==="timed-metadata"){if(z.dataAlignmentIndicator&&(P=0,E.length=0),E.length===0&&(z.data.length<10||z.data[0]!==73||z.data[1]!==68||z.data[2]!==51)){this.trigger("log",{level:"warn",message:"Skipping unrecognized metadata packet"});return}if(E.push(z),P+=z.data.byteLength,E.length===1&&(T=Bn(z.data.subarray(6,10)),T+=10),!(P<T)){for(Q={data:new Uint8Array(T),frames:[],pts:E[0].pts,dts:E[0].dts},ge=0;ge<T;)Q.data.set(E[0].data.subarray(0,T-ge),ge),ge+=E[0].data.byteLength,P-=E[0].data.byteLength,E.shift();te=10,Q.data[5]&64&&(te+=4,te+=Bn(Q.data.subarray(10,14)),T-=Bn(Q.data.subarray(16,20)));do{if(Z=Bn(Q.data.subarray(te+4,te+8)),Z<1){this.trigger("log",{level:"warn",message:"Malformed ID3 frame encountered. Skipping metadata parsing."});return}if(xe=String.fromCharCode(Q.data[te],Q.data[te+1],Q.data[te+2],Q.data[te+3]),se={id:xe,data:Q.data.subarray(te+10,te+Z+10)},se.key=se.id,va[se.id]&&(va[se.id](se),se.owner==="com.apple.streaming.transportStreamTimestamp")){var Pe=se.data,Se=(Pe[3]&1)<<30|Pe[4]<<22|Pe[5]<<14|Pe[6]<<6|Pe[7]>>>2;Se*=4,Se+=Pe[7]&3,se.timeStamp=Se,Q.pts===void 0&&Q.dts===void 0&&(Q.pts=se.timeStamp,Q.dts=se.timeStamp),this.trigger("timestamp",se)}Q.frames.push(se),te+=10,te+=Z}while(te<T);this.trigger("data",Q)}}}},vs.prototype=new e;var kd=vs,Ad=Cu.TimestampRolloverStream,mn,Br,ys,dr=188,gn=71;mn=function(){var m=new Uint8Array(dr),x=0;mn.prototype.init.call(this),this.push=function(T){var E=0,P=dr,M;for(x?(M=new Uint8Array(T.byteLength+x),M.set(m.subarray(0,x)),M.set(T,x),x=0):M=T;P<M.byteLength;){if(M[E]===gn&&M[P]===gn){this.trigger("data",M.subarray(E,P)),E+=dr,P+=dr;continue}E++,P++}E<M.byteLength&&(m.set(M.subarray(E),0),x=M.byteLength-E)},this.flush=function(){x===dr&&m[0]===gn&&(this.trigger("data",m),x=0),this.trigger("done")},this.endTimeline=function(){this.flush(),this.trigger("endedtimeline")},this.reset=function(){x=0,this.trigger("reset")}},mn.prototype=new e,Br=function(){var m,x,T,E;Br.prototype.init.call(this),E=this,this.packetsWaitingForPmt=[],this.programMapTable=void 0,m=function(M,z){var Q=0;z.payloadUnitStartIndicator&&(Q+=M[Q]+1),z.type==="pat"?x(M.subarray(Q),z):T(M.subarray(Q),z)},x=function(M,z){z.section_number=M[7],z.last_section_number=M[8],E.pmtPid=(M[10]&31)<<8|M[11],z.pmtPid=E.pmtPid},T=function(M,z){var Q,te,Z,se;if(M[5]&1){for(E.programMapTable={video:null,audio:null,"timed-metadata":{}},Q=(M[1]&15)<<8|M[2],te=3+Q-4,Z=(M[10]&15)<<8|M[11],se=12+Z;se<te;){var ge=M[se],xe=(M[se+1]&31)<<8|M[se+2];ge===Ut.H264_STREAM_TYPE&&E.programMapTable.video===null?E.programMapTable.video=xe:ge===Ut.ADTS_STREAM_TYPE&&E.programMapTable.audio===null?E.programMapTable.audio=xe:ge===Ut.METADATA_STREAM_TYPE&&(E.programMapTable["timed-metadata"][xe]=ge),se+=((M[se+3]&15)<<8|M[se+4])+5}z.programMapTable=E.programMapTable}},this.push=function(P){var M={},z=4;if(M.payloadUnitStartIndicator=!!(P[1]&64),M.pid=P[1]&31,M.pid<<=8,M.pid|=P[2],(P[3]&48)>>>4>1&&(z+=P[z]+1),M.pid===0)M.type="pat",m(P.subarray(z),M),this.trigger("data",M);else if(M.pid===this.pmtPid)for(M.type="pmt",m(P.subarray(z),M),this.trigger("data",M);this.packetsWaitingForPmt.length;)this.processPes_.apply(this,this.packetsWaitingForPmt.shift());else this.programMapTable===void 0?this.packetsWaitingForPmt.push([P,z,M]):this.processPes_(P,z,M)},this.processPes_=function(P,M,z){z.pid===this.programMapTable.video?z.streamType=Ut.H264_STREAM_TYPE:z.pid===this.programMapTable.audio?z.streamType=Ut.ADTS_STREAM_TYPE:z.streamType=this.programMapTable["timed-metadata"][z.pid],z.type="pes",z.data=P.subarray(M),this.trigger("data",z)}},Br.prototype=new e,Br.STREAM_TYPES={h264:27,adts:15},ys=function(){var m=this,x=!1,T={data:[],size:0},E={data:[],size:0},P={data:[],size:0},M,z=function(Z,se){var ge,xe=Z[0]<<16|Z[1]<<8|Z[2];se.data=new Uint8Array,xe===1&&(se.packetLength=6+(Z[4]<<8|Z[5]),se.dataAlignmentIndicator=(Z[6]&4)!==0,ge=Z[7],ge&192&&(se.pts=(Z[9]&14)<<27|(Z[10]&255)<<20|(Z[11]&254)<<12|(Z[12]&255)<<5|(Z[13]&254)>>>3,se.pts*=4,se.pts+=(Z[13]&6)>>>1,se.dts=se.pts,ge&64&&(se.dts=(Z[14]&14)<<27|(Z[15]&255)<<20|(Z[16]&254)<<12|(Z[17]&255)<<5|(Z[18]&254)>>>3,se.dts*=4,se.dts+=(Z[18]&6)>>>1)),se.data=Z.subarray(9+Z[8]))},Q=function(Z,se,ge){var xe=new Uint8Array(Z.size),Pe={type:se},Se=0,ze=0,Lt=!1,ui;if(!(!Z.data.length||Z.size<9)){for(Pe.trackId=Z.data[0].pid,Se=0;Se<Z.data.length;Se++)ui=Z.data[Se],xe.set(ui.data,ze),ze+=ui.data.byteLength;z(xe,Pe),Lt=se==="video"||Pe.packetLength<=Z.size,(ge||Lt)&&(Z.size=0,Z.data.length=0),Lt&&m.trigger("data",Pe)}};ys.prototype.init.call(this),this.push=function(te){({pat:function(){},pes:function(){var se,ge;switch(te.streamType){case Ut.H264_STREAM_TYPE:se=T,ge="video";break;case Ut.ADTS_STREAM_TYPE:se=E,ge="audio";break;case Ut.METADATA_STREAM_TYPE:se=P,ge="timed-metadata";break;default:return}te.payloadUnitStartIndicator&&Q(se,ge,!0),se.data.push(te),se.size+=te.data.byteLength},pmt:function(){var se={type:"metadata",tracks:[]};M=te.programMapTable,M.video!==null&&se.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+M.video,codec:"avc",type:"video"}),M.audio!==null&&se.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+M.audio,codec:"adts",type:"audio"}),x=!0,m.trigger("data",se)}})[te.type]()},this.reset=function(){T.size=0,T.data.length=0,E.size=0,E.data.length=0,this.trigger("reset")},this.flushStreams_=function(){Q(T,"video"),Q(E,"audio"),Q(P,"timed-metadata")},this.flush=function(){if(!x&&M){var te={type:"metadata",tracks:[]};M.video!==null&&te.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+M.video,codec:"avc",type:"video"}),M.audio!==null&&te.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+M.audio,codec:"adts",type:"audio"}),m.trigger("data",te)}x=!1,this.flushStreams_(),this.trigger("done")}},ys.prototype=new e;var Un={PAT_PID:0,MP2T_PACKET_LENGTH:dr,TransportPacketStream:mn,TransportParseStream:Br,ElementaryStream:ys,TimestampRolloverStream:Ad,CaptionStream:fn.CaptionStream,Cea608Stream:fn.Cea608Stream,Cea708Stream:fn.Cea708Stream,MetadataStream:kd};for(var vn in Ut)Ut.hasOwnProperty(vn)&&(Un[vn]=Ut[vn]);var Cr=Un,ku=Ze.ONE_SECOND_IN_TS,ya,Au=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350];ya=function(m){var x,T=0;ya.prototype.init.call(this),this.skipWarn_=function(E,P){this.trigger("log",{level:"warn",message:"adts skiping bytes "+E+" to "+P+" in frame "+T+" outside syncword"})},this.push=function(E){var P=0,M,z,Q,te,Z;if(m||(T=0),E.type==="audio"){x&&x.length?(Q=x,x=new Uint8Array(Q.byteLength+E.data.byteLength),x.set(Q),x.set(E.data,Q.byteLength)):x=E.data;for(var se;P+7<x.length;){if(x[P]!==255||(x[P+1]&246)!==240){typeof se!="number"&&(se=P),P++;continue}if(typeof se=="number"&&(this.skipWarn_(se,P),se=null),z=(~x[P+1]&1)*2,M=(x[P+3]&3)<<11|x[P+4]<<3|(x[P+5]&224)>>5,te=((x[P+6]&3)+1)*1024,Z=te*ku/Au[(x[P+2]&60)>>>2],x.byteLength-P<M)break;this.trigger("data",{pts:E.pts+T*Z,dts:E.dts+T*Z,sampleCount:te,audioobjecttype:(x[P+2]>>>6&3)+1,channelcount:(x[P+2]&1)<<2|(x[P+3]&192)>>>6,samplerate:Au[(x[P+2]&60)>>>2],samplingfrequencyindex:(x[P+2]&60)>>>2,samplesize:16,data:x.subarray(P+7+z,P+M)}),T++,P+=M}typeof se=="number"&&(this.skipWarn_(se,P),se=null),x=x.subarray(P)}},this.flush=function(){T=0,this.trigger("done")},this.reset=function(){x=void 0,this.trigger("reset")},this.endTimeline=function(){x=void 0,this.trigger("endedtimeline")}},ya.prototype=new e;var Er=ya,_s;_s=function(m){var x=m.byteLength,T=0,E=0;this.length=function(){return 8*x},this.bitsAvailable=function(){return 8*x+E},this.loadWord=function(){var P=m.byteLength-x,M=new Uint8Array(4),z=Math.min(4,x);if(z===0)throw new Error("no bytes available");M.set(m.subarray(P,P+z)),T=new DataView(M.buffer).getUint32(0),E=z*8,x-=z},this.skipBits=function(P){var M;E>P?(T<<=P,E-=P):(P-=E,M=Math.floor(P/8),P-=M*8,x-=M,this.loadWord(),T<<=P,E-=P)},this.readBits=function(P){var M=Math.min(E,P),z=T>>>32-M;return E-=M,E>0?T<<=M:x>0&&this.loadWord(),M=P-M,M>0?z<<M|this.readBits(M):z},this.skipLeadingZeros=function(){var P;for(P=0;P<E;++P)if((T&2147483648>>>P)!==0)return T<<=P,E-=P,P;return this.loadWord(),P+this.skipLeadingZeros()},this.skipUnsignedExpGolomb=function(){this.skipBits(1+this.skipLeadingZeros())},this.skipExpGolomb=function(){this.skipBits(1+this.skipLeadingZeros())},this.readUnsignedExpGolomb=function(){var P=this.skipLeadingZeros();return this.readBits(P+1)-1},this.readExpGolomb=function(){var P=this.readUnsignedExpGolomb();return 1&P?1+P>>>1:-1*(P>>>1)},this.readBoolean=function(){return this.readBits(1)===1},this.readUnsignedByte=function(){return this.readBits(8)},this.loadWord()};var Id=_s,$n,jn,Ri;jn=function(){var m=0,x,T;jn.prototype.init.call(this),this.push=function(E){var P;T?(P=new Uint8Array(T.byteLength+E.data.byteLength),P.set(T),P.set(E.data,T.byteLength),T=P):T=E.data;for(var M=T.byteLength;m<M-3;m++)if(T[m+2]===1){x=m+5;break}for(;x<M;)switch(T[x]){case 0:if(T[x-1]!==0){x+=2;break}else if(T[x-2]!==0){x++;break}m+3!==x-2&&this.trigger("data",T.subarray(m+3,x-2));do x++;while(T[x]!==1&&x<M);m=x-2,x+=3;break;case 1:if(T[x-1]!==0||T[x-2]!==0){x+=3;break}this.trigger("data",T.subarray(m+3,x-2)),m=x-2,x+=3;break;default:x+=3;break}T=T.subarray(m),x-=m,m=0},this.reset=function(){T=null,m=0,this.trigger("reset")},this.flush=function(){T&&T.byteLength>3&&this.trigger("data",T.subarray(m+3)),T=null,m=0,this.trigger("done")},this.endTimeline=function(){this.flush(),this.trigger("endedtimeline")}},jn.prototype=new e,Ri={100:!0,110:!0,122:!0,244:!0,44:!0,83:!0,86:!0,118:!0,128:!0,138:!0,139:!0,134:!0},$n=function(){var m=new jn,x,T,E,P,M,z,Q;$n.prototype.init.call(this),x=this,this.push=function(te){te.type==="video"&&(T=te.trackId,E=te.pts,P=te.dts,m.push(te))},m.on("data",function(te){var Z={trackId:T,pts:E,dts:P,data:te,nalUnitTypeCode:te[0]&31};switch(Z.nalUnitTypeCode){case 5:Z.nalUnitType="slice_layer_without_partitioning_rbsp_idr";break;case 6:Z.nalUnitType="sei_rbsp",Z.escapedRBSP=M(te.subarray(1));break;case 7:Z.nalUnitType="seq_parameter_set_rbsp",Z.escapedRBSP=M(te.subarray(1)),Z.config=z(Z.escapedRBSP);break;case 8:Z.nalUnitType="pic_parameter_set_rbsp";break;case 9:Z.nalUnitType="access_unit_delimiter_rbsp";break}x.trigger("data",Z)}),m.on("done",function(){x.trigger("done")}),m.on("partialdone",function(){x.trigger("partialdone")}),m.on("reset",function(){x.trigger("reset")}),m.on("endedtimeline",function(){x.trigger("endedtimeline")}),this.flush=function(){m.flush()},this.partialFlush=function(){m.partialFlush()},this.reset=function(){m.reset()},this.endTimeline=function(){m.endTimeline()},Q=function(Z,se){var ge=8,xe=8,Pe,Se;for(Pe=0;Pe<Z;Pe++)xe!==0&&(Se=se.readExpGolomb(),xe=(ge+Se+256)%256),ge=xe===0?ge:xe},M=function(Z){for(var se=Z.byteLength,ge=[],xe=1,Pe,Se;xe<se-2;)Z[xe]===0&&Z[xe+1]===0&&Z[xe+2]===3?(ge.push(xe+2),xe+=2):xe++;if(ge.length===0)return Z;Pe=se-ge.length,Se=new Uint8Array(Pe);var ze=0;for(xe=0;xe<Pe;ze++,xe++)ze===ge[0]&&(ze++,ge.shift()),Se[xe]=Z[ze];return Se},z=function(Z){var se=0,ge=0,xe=0,Pe=0,Se,ze,Lt,ui,Ji,nl,sl,al,Gu,ol,ll,Ot=[1,1],Ku,kr;if(Se=new Id(Z),ze=Se.readUnsignedByte(),ui=Se.readUnsignedByte(),Lt=Se.readUnsignedByte(),Se.skipUnsignedExpGolomb(),Ri[ze]&&(Ji=Se.readUnsignedExpGolomb(),Ji===3&&Se.skipBits(1),Se.skipUnsignedExpGolomb(),Se.skipUnsignedExpGolomb(),Se.skipBits(1),Se.readBoolean()))for(ll=Ji!==3?8:12,kr=0;kr<ll;kr++)Se.readBoolean()&&(kr<6?Q(16,Se):Q(64,Se));if(Se.skipUnsignedExpGolomb(),nl=Se.readUnsignedExpGolomb(),nl===0)Se.readUnsignedExpGolomb();else if(nl===1)for(Se.skipBits(1),Se.skipExpGolomb(),Se.skipExpGolomb(),sl=Se.readUnsignedExpGolomb(),kr=0;kr<sl;kr++)Se.skipExpGolomb();if(Se.skipUnsignedExpGolomb(),Se.skipBits(1),al=Se.readUnsignedExpGolomb(),Gu=Se.readUnsignedExpGolomb(),ol=Se.readBits(1),ol===0&&Se.skipBits(1),Se.skipBits(1),Se.readBoolean()&&(se=Se.readUnsignedExpGolomb(),ge=Se.readUnsignedExpGolomb(),xe=Se.readUnsignedExpGolomb(),Pe=Se.readUnsignedExpGolomb()),Se.readBoolean()&&Se.readBoolean()){switch(Ku=Se.readUnsignedByte(),Ku){case 1:Ot=[1,1];break;case 2:Ot=[12,11];break;case 3:Ot=[10,11];break;case 4:Ot=[16,11];break;case 5:Ot=[40,33];break;case 6:Ot=[24,11];break;case 7:Ot=[20,11];break;case 8:Ot=[32,11];break;case 9:Ot=[80,33];break;case 10:Ot=[18,11];break;case 11:Ot=[15,11];break;case 12:Ot=[64,33];break;case 13:Ot=[160,99];break;case 14:Ot=[4,3];break;case 15:Ot=[3,2];break;case 16:Ot=[2,1];break;case 255:{Ot=[Se.readUnsignedByte()<<8|Se.readUnsignedByte(),Se.readUnsignedByte()<<8|Se.readUnsignedByte()];break}}Ot&&Ot[0]/Ot[1]}return{profileIdc:ze,levelIdc:Lt,profileCompatibility:ui,width:(al+1)*16-se*2-ge*2,height:(2-ol)*(Gu+1)*16-xe*2-Pe*2,sarRatio:Ot}}},$n.prototype=new e;var Pd={H264Stream:$n},_a=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350],qn=function(m,x){var T=m[x+6]<<21|m[x+7]<<14|m[x+8]<<7|m[x+9],E=m[x+5],P=(E&16)>>4;return T=T>=0?T:0,P?T+20:T+10},Ta=function j(m,x){return m.length-x<10||m[x]!==73||m[x+1]!==68||m[x+2]!==51?x:(x+=qn(m,x),j(m,x))},Vn=function(m){var x=Ta(m,0);return m.length>=x+2&&(m[x]&255)===255&&(m[x+1]&240)===240&&(m[x+1]&22)===16},ba=function(m){return m[0]<<21|m[1]<<14|m[2]<<7|m[3]},Iu=function(m,x,T){var E,P="";for(E=x;E<T;E++)P+="%"+("00"+m[E].toString(16)).slice(-2);return P},el=function(m,x,T){return unescape(Iu(m,x,T))},Dd=function(m,x){var T=(m[x+5]&224)>>5,E=m[x+4]<<3,P=m[x+3]&6144;return P|E|T},Nd=function(m,x){return m[x]===73&&m[x+1]===68&&m[x+2]===51?"timed-metadata":m[x]&!0&&(m[x+1]&240)===240?"audio":null},Ld=function(m){for(var x=0;x+5<m.length;){if(m[x]!==255||(m[x+1]&246)!==240){x++;continue}return _a[(m[x+2]&60)>>>2]}return null},Sa=function(m){var x,T,E,P;x=10,m[5]&64&&(x+=4,x+=ba(m.subarray(10,14)));do{if(T=ba(m.subarray(x+4,x+8)),T<1)return null;if(P=String.fromCharCode(m[x],m[x+1],m[x+2],m[x+3]),P==="PRIV"){E=m.subarray(x+10,x+T+10);for(var M=0;M<E.byteLength;M++)if(E[M]===0){var z=el(E,0,M);if(z==="com.apple.streaming.transportStreamTimestamp"){var Q=E.subarray(M+1),te=(Q[3]&1)<<30|Q[4]<<22|Q[5]<<14|Q[6]<<6|Q[7]>>>2;return te*=4,te+=Q[7]&3,te}break}}x+=10,x+=T}while(x<m.byteLength);return null},Ts={isLikelyAacData:Vn,parseId3TagSize:qn,parseAdtsSize:Dd,parseType:Nd,parseSampleRate:Ld,parseAacTimestamp:Sa},xa;xa=function(){var m=new Uint8Array,x=0;xa.prototype.init.call(this),this.setTimestamp=function(T){x=T},this.push=function(T){var E=0,P=0,M,z,Q,te;for(m.length?(te=m.length,m=new Uint8Array(T.byteLength+te),m.set(m.subarray(0,te)),m.set(T,te)):m=T;m.length-P>=3;){if(m[P]===73&&m[P+1]===68&&m[P+2]===51){if(m.length-P<10||(E=Ts.parseId3TagSize(m,P),P+E>m.length))break;z={type:"timed-metadata",data:m.subarray(P,P+E)},this.trigger("data",z),P+=E;continue}else if((m[P]&255)===255&&(m[P+1]&240)===240){if(m.length-P<7||(E=Ts.parseAdtsSize(m,P),P+E>m.length))break;Q={type:"audio",data:m.subarray(P,P+E),pts:x,dts:x},this.trigger("data",Q),P+=E;continue}P++}M=m.length-P,M>0?m=m.subarray(P):m=new Uint8Array},this.reset=function(){m=new Uint8Array,this.trigger("reset")},this.endTimeline=function(){m=new Uint8Array,this.trigger("endedtimeline")}},xa.prototype=new e;var Pu=xa,Od=["audioobjecttype","channelcount","samplerate","samplingfrequencyindex","samplesize"],tl=Od,Md=["width","height","profileIdc","levelIdc","profileCompatibility","sarRatio"],bs=Md,Ca=Pd.H264Stream,Du=Ts.isLikelyAacData,Rd=Ze.ONE_SECOND_IN_TS,Ea,Hn,Ss,yn,Nu=function(m,x){x.stream=m,this.trigger("log",x)},Lu=function(m,x){for(var T=Object.keys(x),E=0;E<T.length;E++){var P=T[E];P==="headOfPipeline"||!x[P].on||x[P].on("log",Nu.bind(m,P))}},Ou=function(m,x){var T;if(m.length!==x.length)return!1;for(T=0;T<m.length;T++)if(m[T]!==x[T])return!1;return!0},Mu=function(m,x,T,E,P,M){var z=T-x,Q=E-x,te=P-T;return{start:{dts:m,pts:m+z},end:{dts:m+Q,pts:m+te},prependedContentDuration:M,baseMediaDecodeTime:m}};Hn=function(m,x){var T=[],E,P=0,M=0,z=1/0;x=x||{},E=x.firstSequenceNumber||0,Hn.prototype.init.call(this),this.push=function(Q){V.collectDtsInfo(m,Q),m&&tl.forEach(function(te){m[te]=Q[te]}),T.push(Q)},this.setEarliestDts=function(Q){P=Q},this.setVideoBaseMediaDecodeTime=function(Q){z=Q},this.setAudioAppendStart=function(Q){M=Q},this.flush=function(){var Q,te,Z,se,ge,xe,Pe;if(T.length===0){this.trigger("done","AudioSegmentStream");return}Q=Ki.trimAdtsFramesByEarliestDts(T,m,P),m.baseMediaDecodeTime=V.calculateTrackBaseMediaDecodeTime(m,x.keepOriginalTimestamps),Pe=Ki.prefixWithSilence(m,Q,M,z),m.samples=Ki.generateSampleTable(Q),Z=Ye.mdat(Ki.concatenateFrameData(Q)),T=[],te=Ye.moof(E,[m]),se=new Uint8Array(te.byteLength+Z.byteLength),E++,se.set(te),se.set(Z,te.byteLength),V.clearDtsInfo(m),ge=Math.ceil(Rd*1024/m.samplerate),Q.length&&(xe=Q.length*ge,this.trigger("segmentTimingInfo",Mu(Ze.audioTsToVideoTs(m.baseMediaDecodeTime,m.samplerate),Q[0].dts,Q[0].pts,Q[0].dts+xe,Q[0].pts+xe,Pe||0)),this.trigger("timingInfo",{start:Q[0].pts,end:Q[0].pts+xe})),this.trigger("data",{track:m,boxes:se}),this.trigger("done","AudioSegmentStream")},this.reset=function(){V.clearDtsInfo(m),T=[],this.trigger("reset")}},Hn.prototype=new e,Ea=function(m,x){var T,E=[],P=[],M,z;x=x||{},T=x.firstSequenceNumber||0,Ea.prototype.init.call(this),delete m.minPTS,this.gopCache_=[],this.push=function(Q){V.collectDtsInfo(m,Q),Q.nalUnitType==="seq_parameter_set_rbsp"&&!M&&(M=Q.config,m.sps=[Q.data],bs.forEach(function(te){m[te]=M[te]},this)),Q.nalUnitType==="pic_parameter_set_rbsp"&&!z&&(z=Q.data,m.pps=[Q.data]),E.push(Q)},this.flush=function(){for(var Q,te,Z,se,ge,xe,Pe=0,Se,ze;E.length&&E[0].nalUnitType!=="access_unit_delimiter_rbsp";)E.shift();if(E.length===0){this.resetStream_(),this.trigger("done","VideoSegmentStream");return}if(Q=Te.groupNalsIntoFrames(E),Z=Te.groupFramesIntoGops(Q),Z[0][0].keyFrame||(te=this.getGopForFusion_(E[0],m),te?(Pe=te.duration,Z.unshift(te),Z.byteLength+=te.byteLength,Z.nalCount+=te.nalCount,Z.pts=te.pts,Z.dts=te.dts,Z.duration+=te.duration):Z=Te.extendFirstKeyFrame(Z)),P.length){var Lt;if(x.alignGopsAtEnd?Lt=this.alignGopsAtEnd_(Z):Lt=this.alignGopsAtStart_(Z),!Lt){this.gopCache_.unshift({gop:Z.pop(),pps:m.pps,sps:m.sps}),this.gopCache_.length=Math.min(6,this.gopCache_.length),E=[],this.resetStream_(),this.trigger("done","VideoSegmentStream");return}V.clearDtsInfo(m),Z=Lt}V.collectDtsInfo(m,Z),m.samples=Te.generateSampleTable(Z),ge=Ye.mdat(Te.concatenateNalData(Z)),m.baseMediaDecodeTime=V.calculateTrackBaseMediaDecodeTime(m,x.keepOriginalTimestamps),this.trigger("processedGopsInfo",Z.map(function(ui){return{pts:ui.pts,dts:ui.dts,byteLength:ui.byteLength}})),Se=Z[0],ze=Z[Z.length-1],this.trigger("segmentTimingInfo",Mu(m.baseMediaDecodeTime,Se.dts,Se.pts,ze.dts+ze.duration,ze.pts+ze.duration,Pe)),this.trigger("timingInfo",{start:Z[0].pts,end:Z[Z.length-1].pts+Z[Z.length-1].duration}),this.gopCache_.unshift({gop:Z.pop(),pps:m.pps,sps:m.sps}),this.gopCache_.length=Math.min(6,this.gopCache_.length),E=[],this.trigger("baseMediaDecodeTime",m.baseMediaDecodeTime),this.trigger("timelineStartInfo",m.timelineStartInfo),se=Ye.moof(T,[m]),xe=new Uint8Array(se.byteLength+ge.byteLength),T++,xe.set(se),xe.set(ge,se.byteLength),this.trigger("data",{track:m,boxes:xe}),this.resetStream_(),this.trigger("done","VideoSegmentStream")},this.reset=function(){this.resetStream_(),E=[],this.gopCache_.length=0,P.length=0,this.trigger("reset")},this.resetStream_=function(){V.clearDtsInfo(m),M=void 0,z=void 0},this.getGopForFusion_=function(Q){var te=45e3,Z=1/0,se,ge,xe,Pe,Se;for(Se=0;Se<this.gopCache_.length;Se++)Pe=this.gopCache_[Se],xe=Pe.gop,!(!(m.pps&&Ou(m.pps[0],Pe.pps[0]))||!(m.sps&&Ou(m.sps[0],Pe.sps[0])))&&(xe.dts<m.timelineStartInfo.dts||(se=Q.dts-xe.dts-xe.duration,se>=-1e4&&se<=te&&(!ge||Z>se)&&(ge=Pe,Z=se)));return ge?ge.gop:null},this.alignGopsAtStart_=function(Q){var te,Z,se,ge,xe,Pe,Se,ze;for(xe=Q.byteLength,Pe=Q.nalCount,Se=Q.duration,te=Z=0;te<P.length&&Z<Q.length&&(se=P[te],ge=Q[Z],se.pts!==ge.pts);){if(ge.pts>se.pts){te++;continue}Z++,xe-=ge.byteLength,Pe-=ge.nalCount,Se-=ge.duration}return Z===0?Q:Z===Q.length?null:(ze=Q.slice(Z),ze.byteLength=xe,ze.duration=Se,ze.nalCount=Pe,ze.pts=ze[0].pts,ze.dts=ze[0].dts,ze)},this.alignGopsAtEnd_=function(Q){var te,Z,se,ge,xe,Pe;for(te=P.length-1,Z=Q.length-1,xe=null,Pe=!1;te>=0&&Z>=0;){if(se=P[te],ge=Q[Z],se.pts===ge.pts){Pe=!0;break}if(se.pts>ge.pts){te--;continue}te===P.length-1&&(xe=Z),Z--}if(!Pe&&xe===null)return null;var Se;if(Pe?Se=Z:Se=xe,Se===0)return Q;var ze=Q.slice(Se),Lt=ze.reduce(function(ui,Ji){return ui.byteLength+=Ji.byteLength,ui.duration+=Ji.duration,ui.nalCount+=Ji.nalCount,ui},{byteLength:0,duration:0,nalCount:0});return ze.byteLength=Lt.byteLength,ze.duration=Lt.duration,ze.nalCount=Lt.nalCount,ze.pts=ze[0].pts,ze.dts=ze[0].dts,ze},this.alignGopsWith=function(Q){P=Q}},Ea.prototype=new e,yn=function(m,x){this.numberOfTracks=0,this.metadataStream=x,m=m||{},typeof m.remux<"u"?this.remuxTracks=!!m.remux:this.remuxTracks=!0,typeof m.keepOriginalTimestamps=="boolean"?this.keepOriginalTimestamps=m.keepOriginalTimestamps:this.keepOriginalTimestamps=!1,this.pendingTracks=[],this.videoTrack=null,this.pendingBoxes=[],this.pendingCaptions=[],this.pendingMetadata=[],this.pendingBytes=0,this.emittedTracks=0,yn.prototype.init.call(this),this.push=function(T){if(T.text)return this.pendingCaptions.push(T);if(T.frames)return this.pendingMetadata.push(T);this.pendingTracks.push(T.track),this.pendingBytes+=T.boxes.byteLength,T.track.type==="video"&&(this.videoTrack=T.track,this.pendingBoxes.push(T.boxes)),T.track.type==="audio"&&(this.audioTrack=T.track,this.pendingBoxes.unshift(T.boxes))}},yn.prototype=new e,yn.prototype.flush=function(j){var m=0,x={captions:[],captionStreams:{},metadata:[],info:{}},T,E,P,M=0,z;if(this.pendingTracks.length<this.numberOfTracks){if(j!=="VideoSegmentStream"&&j!=="AudioSegmentStream")return;if(this.remuxTracks)return;if(this.pendingTracks.length===0){this.emittedTracks++,this.emittedTracks>=this.numberOfTracks&&(this.trigger("done"),this.emittedTracks=0);return}}if(this.videoTrack?(M=this.videoTrack.timelineStartInfo.pts,bs.forEach(function(Q){x.info[Q]=this.videoTrack[Q]},this)):this.audioTrack&&(M=this.audioTrack.timelineStartInfo.pts,tl.forEach(function(Q){x.info[Q]=this.audioTrack[Q]},this)),this.videoTrack||this.audioTrack){for(this.pendingTracks.length===1?x.type=this.pendingTracks[0].type:x.type="combined",this.emittedTracks+=this.pendingTracks.length,P=Ye.initSegment(this.pendingTracks),x.initSegment=new Uint8Array(P.byteLength),x.initSegment.set(P),x.data=new Uint8Array(this.pendingBytes),z=0;z<this.pendingBoxes.length;z++)x.data.set(this.pendingBoxes[z],m),m+=this.pendingBoxes[z].byteLength;for(z=0;z<this.pendingCaptions.length;z++)T=this.pendingCaptions[z],T.startTime=Ze.metadataTsToSeconds(T.startPts,M,this.keepOriginalTimestamps),T.endTime=Ze.metadataTsToSeconds(T.endPts,M,this.keepOriginalTimestamps),x.captionStreams[T.stream]=!0,x.captions.push(T);for(z=0;z<this.pendingMetadata.length;z++)E=this.pendingMetadata[z],E.cueTime=Ze.metadataTsToSeconds(E.pts,M,this.keepOriginalTimestamps),x.metadata.push(E);for(x.metadata.dispatchType=this.metadataStream.dispatchType,this.pendingTracks.length=0,this.videoTrack=null,this.pendingBoxes.length=0,this.pendingCaptions.length=0,this.pendingBytes=0,this.pendingMetadata.length=0,this.trigger("data",x),z=0;z<x.captions.length;z++)T=x.captions[z],this.trigger("caption",T);for(z=0;z<x.metadata.length;z++)E=x.metadata[z],this.trigger("id3Frame",E)}this.emittedTracks>=this.numberOfTracks&&(this.trigger("done"),this.emittedTracks=0)},yn.prototype.setRemux=function(j){this.remuxTracks=j},Ss=function(m){var x=this,T=!0,E,P;Ss.prototype.init.call(this),m=m||{},this.baseMediaDecodeTime=m.baseMediaDecodeTime||0,this.transmuxPipeline_={},this.setupAacPipeline=function(){var M={};this.transmuxPipeline_=M,M.type="aac",M.metadataStream=new Cr.MetadataStream,M.aacStream=new Pu,M.audioTimestampRolloverStream=new Cr.TimestampRolloverStream("audio"),M.timedMetadataTimestampRolloverStream=new Cr.TimestampRolloverStream("timed-metadata"),M.adtsStream=new Er,M.coalesceStream=new yn(m,M.metadataStream),M.headOfPipeline=M.aacStream,M.aacStream.pipe(M.audioTimestampRolloverStream).pipe(M.adtsStream),M.aacStream.pipe(M.timedMetadataTimestampRolloverStream).pipe(M.metadataStream).pipe(M.coalesceStream),M.metadataStream.on("timestamp",function(z){M.aacStream.setTimestamp(z.timeStamp)}),M.aacStream.on("data",function(z){z.type!=="timed-metadata"&&z.type!=="audio"||M.audioSegmentStream||(P=P||{timelineStartInfo:{baseMediaDecodeTime:x.baseMediaDecodeTime},codec:"adts",type:"audio"},M.coalesceStream.numberOfTracks++,M.audioSegmentStream=new Hn(P,m),M.audioSegmentStream.on("log",x.getLogTrigger_("audioSegmentStream")),M.audioSegmentStream.on("timingInfo",x.trigger.bind(x,"audioTimingInfo")),M.adtsStream.pipe(M.audioSegmentStream).pipe(M.coalesceStream),x.trigger("trackinfo",{hasAudio:!!P,hasVideo:!!E}))}),M.coalesceStream.on("data",this.trigger.bind(this,"data")),M.coalesceStream.on("done",this.trigger.bind(this,"done")),Lu(this,M)},this.setupTsPipeline=function(){var M={};this.transmuxPipeline_=M,M.type="ts",M.metadataStream=new Cr.MetadataStream,M.packetStream=new Cr.TransportPacketStream,M.parseStream=new Cr.TransportParseStream,M.elementaryStream=new Cr.ElementaryStream,M.timestampRolloverStream=new Cr.TimestampRolloverStream,M.adtsStream=new Er,M.h264Stream=new Ca,M.captionStream=new Cr.CaptionStream(m),M.coalesceStream=new yn(m,M.metadataStream),M.headOfPipeline=M.packetStream,M.packetStream.pipe(M.parseStream).pipe(M.elementaryStream).pipe(M.timestampRolloverStream),M.timestampRolloverStream.pipe(M.h264Stream),M.timestampRolloverStream.pipe(M.adtsStream),M.timestampRolloverStream.pipe(M.metadataStream).pipe(M.coalesceStream),M.h264Stream.pipe(M.captionStream).pipe(M.coalesceStream),M.elementaryStream.on("data",function(z){var Q;if(z.type==="metadata"){for(Q=z.tracks.length;Q--;)!E&&z.tracks[Q].type==="video"?(E=z.tracks[Q],E.timelineStartInfo.baseMediaDecodeTime=x.baseMediaDecodeTime):!P&&z.tracks[Q].type==="audio"&&(P=z.tracks[Q],P.timelineStartInfo.baseMediaDecodeTime=x.baseMediaDecodeTime);E&&!M.videoSegmentStream&&(M.coalesceStream.numberOfTracks++,M.videoSegmentStream=new Ea(E,m),M.videoSegmentStream.on("log",x.getLogTrigger_("videoSegmentStream")),M.videoSegmentStream.on("timelineStartInfo",function(te){P&&!m.keepOriginalTimestamps&&(P.timelineStartInfo=te,M.audioSegmentStream.setEarliestDts(te.dts-x.baseMediaDecodeTime))}),M.videoSegmentStream.on("processedGopsInfo",x.trigger.bind(x,"gopInfo")),M.videoSegmentStream.on("segmentTimingInfo",x.trigger.bind(x,"videoSegmentTimingInfo")),M.videoSegmentStream.on("baseMediaDecodeTime",function(te){P&&M.audioSegmentStream.setVideoBaseMediaDecodeTime(te)}),M.videoSegmentStream.on("timingInfo",x.trigger.bind(x,"videoTimingInfo")),M.h264Stream.pipe(M.videoSegmentStream).pipe(M.coalesceStream)),P&&!M.audioSegmentStream&&(M.coalesceStream.numberOfTracks++,M.audioSegmentStream=new Hn(P,m),M.audioSegmentStream.on("log",x.getLogTrigger_("audioSegmentStream")),M.audioSegmentStream.on("timingInfo",x.trigger.bind(x,"audioTimingInfo")),M.audioSegmentStream.on("segmentTimingInfo",x.trigger.bind(x,"audioSegmentTimingInfo")),M.adtsStream.pipe(M.audioSegmentStream).pipe(M.coalesceStream)),x.trigger("trackinfo",{hasAudio:!!P,hasVideo:!!E})}}),M.coalesceStream.on("data",this.trigger.bind(this,"data")),M.coalesceStream.on("id3Frame",function(z){z.dispatchType=M.metadataStream.dispatchType,x.trigger("id3Frame",z)}),M.coalesceStream.on("caption",this.trigger.bind(this,"caption")),M.coalesceStream.on("done",this.trigger.bind(this,"done")),Lu(this,M)},this.setBaseMediaDecodeTime=function(M){var z=this.transmuxPipeline_;m.keepOriginalTimestamps||(this.baseMediaDecodeTime=M),P&&(P.timelineStartInfo.dts=void 0,P.timelineStartInfo.pts=void 0,V.clearDtsInfo(P),z.audioTimestampRolloverStream&&z.audioTimestampRolloverStream.discontinuity()),E&&(z.videoSegmentStream&&(z.videoSegmentStream.gopCache_=[]),E.timelineStartInfo.dts=void 0,E.timelineStartInfo.pts=void 0,V.clearDtsInfo(E),z.captionStream.reset()),z.timestampRolloverStream&&z.timestampRolloverStream.discontinuity()},this.setAudioAppendStart=function(M){P&&this.transmuxPipeline_.audioSegmentStream.setAudioAppendStart(M)},this.setRemux=function(M){var z=this.transmuxPipeline_;m.remux=M,z&&z.coalesceStream&&z.coalesceStream.setRemux(M)},this.alignGopsWith=function(M){E&&this.transmuxPipeline_.videoSegmentStream&&this.transmuxPipeline_.videoSegmentStream.alignGopsWith(M)},this.getLogTrigger_=function(M){var z=this;return function(Q){Q.stream=M,z.trigger("log",Q)}},this.push=function(M){if(T){var z=Du(M);z&&this.transmuxPipeline_.type!=="aac"?this.setupAacPipeline():!z&&this.transmuxPipeline_.type!=="ts"&&this.setupTsPipeline(),T=!1}this.transmuxPipeline_.headOfPipeline.push(M)},this.flush=function(){T=!0,this.transmuxPipeline_.headOfPipeline.flush()},this.endTimeline=function(){this.transmuxPipeline_.headOfPipeline.endTimeline()},this.reset=function(){this.transmuxPipeline_.headOfPipeline&&this.transmuxPipeline_.headOfPipeline.reset()},this.resetCaptions=function(){this.transmuxPipeline_.captionStream&&this.transmuxPipeline_.captionStream.reset()}},Ss.prototype=new e;var Fd={Transmuxer:Ss},Bd=function(m){return m>>>0},Ud=function(m){return("00"+m.toString(16)).slice(-2)},zn={toUnsigned:Bd,toHexString:Ud},$d=function(m){var x="";return x+=String.fromCharCode(m[0]),x+=String.fromCharCode(m[1]),x+=String.fromCharCode(m[2]),x+=String.fromCharCode(m[3]),x},Ur=$d,wa=zn.toUnsigned,jd=function j(m,x){var T=[],E,P,M,z,Q;if(!x.length)return null;for(E=0;E<m.byteLength;)P=wa(m[E]<<24|m[E+1]<<16|m[E+2]<<8|m[E+3]),M=Ur(m.subarray(E+4,E+8)),z=P>1?E+P:m.byteLength,M===x[0]&&(x.length===1?T.push(m.subarray(E+8,z)):(Q=j(m.subarray(E+8,z),x.slice(1)),Q.length&&(T=T.concat(Q)))),E=z;return T},mt=jd,qd=zn.toUnsigned,Vd=r.getUint64,Hd=function(m){var x={version:m[0],flags:new Uint8Array(m.subarray(1,4))};return x.version===1?x.baseMediaDecodeTime=Vd(m.subarray(4)):x.baseMediaDecodeTime=qd(m[4]<<24|m[5]<<16|m[6]<<8|m[7]),x},xs=Hd,Cs=function(m){return{isLeading:(m[0]&12)>>>2,dependsOn:m[0]&3,isDependedOn:(m[1]&192)>>>6,hasRedundancy:(m[1]&48)>>>4,paddingValue:(m[1]&14)>>>1,isNonSyncSample:m[1]&1,degradationPriority:m[2]<<8|m[3]}},Wn=Cs,ka=function(m){var x={version:m[0],flags:new Uint8Array(m.subarray(1,4)),samples:[]},T=new DataView(m.buffer,m.byteOffset,m.byteLength),E=x.flags[2]&1,P=x.flags[2]&4,M=x.flags[1]&1,z=x.flags[1]&2,Q=x.flags[1]&4,te=x.flags[1]&8,Z=T.getUint32(4),se=8,ge;for(E&&(x.dataOffset=T.getInt32(se),se+=4),P&&Z&&(ge={flags:Wn(m.subarray(se,se+4))},se+=4,M&&(ge.duration=T.getUint32(se),se+=4),z&&(ge.size=T.getUint32(se),se+=4),te&&(x.version===1?ge.compositionTimeOffset=T.getInt32(se):ge.compositionTimeOffset=T.getUint32(se),se+=4),x.samples.push(ge),Z--);Z--;)ge={},M&&(ge.duration=T.getUint32(se),se+=4),z&&(ge.size=T.getUint32(se),se+=4),Q&&(ge.flags=Wn(m.subarray(se,se+4)),se+=4),te&&(x.version===1?ge.compositionTimeOffset=T.getInt32(se):ge.compositionTimeOffset=T.getUint32(se),se+=4),x.samples.push(ge);return x},Fi=ka,wr=function(m){var x=new DataView(m.buffer,m.byteOffset,m.byteLength),T={version:m[0],flags:new Uint8Array(m.subarray(1,4)),trackId:x.getUint32(4)},E=T.flags[2]&1,P=T.flags[2]&2,M=T.flags[2]&8,z=T.flags[2]&16,Q=T.flags[2]&32,te=T.flags[0]&65536,Z=T.flags[0]&131072,se;return se=8,E&&(se+=4,T.baseDataOffset=x.getUint32(12),se+=4),P&&(T.sampleDescriptionIndex=x.getUint32(se),se+=4),M&&(T.defaultSampleDuration=x.getUint32(se),se+=4),z&&(T.defaultSampleSize=x.getUint32(se),se+=4),Q&&(T.defaultSampleFlags=x.getUint32(se)),te&&(T.durationIsEmpty=!0),!E&&Z&&(T.baseDataOffsetIsMoof=!0),T},Es=wr,il=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},ws;typeof window<"u"?ws=window:typeof il<"u"?ws=il:typeof self<"u"?ws=self:ws={};var ks=ws,zd=oi.discardEmulationPreventionBytes,Wd=fn.CaptionStream,Ru=function(m,x){for(var T=m,E=0;E<x.length;E++){var P=x[E];if(T<P.size)return P;T-=P.size}return null},Fu=function(m,x,T){var E=new DataView(m.buffer,m.byteOffset,m.byteLength),P={logs:[],seiNals:[]},M,z,Q,te;for(z=0;z+4<m.length;z+=Q)if(Q=E.getUint32(z),z+=4,!(Q<=0))switch(m[z]&31){case 6:var Z=m.subarray(z+1,z+1+Q),se=Ru(z,x);if(M={nalUnitType:"sei_rbsp",size:Q,data:Z,escapedRBSP:zd(Z),trackId:T},se)M.pts=se.pts,M.dts=se.dts,te=se;else if(te)M.pts=te.pts,M.dts=te.dts;else{P.logs.push({level:"warn",message:"We've encountered a nal unit without data at "+z+" for trackId "+T+". See mux.js#223."});break}P.seiNals.push(M);break}return P},Aa=function(m,x,T){var E=x,P=T.defaultSampleDuration||0,M=T.defaultSampleSize||0,z=T.trackId,Q=[];return m.forEach(function(te){var Z=Fi(te),se=Z.samples;se.forEach(function(ge){ge.duration===void 0&&(ge.duration=P),ge.size===void 0&&(ge.size=M),ge.trackId=z,ge.dts=E,ge.compositionTimeOffset===void 0&&(ge.compositionTimeOffset=0),typeof E=="bigint"?(ge.pts=E+ks.BigInt(ge.compositionTimeOffset),E+=ks.BigInt(ge.duration)):(ge.pts=E+ge.compositionTimeOffset,E+=ge.duration)}),Q=Q.concat(se)}),Q},As=function(m,x){var T=mt(m,["moof","traf"]),E=mt(m,["mdat"]),P={},M=[];return E.forEach(function(z,Q){var te=T[Q];M.push({mdat:z,traf:te})}),M.forEach(function(z){var Q=z.mdat,te=z.traf,Z=mt(te,["tfhd"]),se=Es(Z[0]),ge=se.trackId,xe=mt(te,["tfdt"]),Pe=xe.length>0?xs(xe[0]).baseMediaDecodeTime:0,Se=mt(te,["trun"]),ze,Lt;x===ge&&Se.length>0&&(ze=Aa(Se,Pe,se),Lt=Fu(Q,ze,ge),P[ge]||(P[ge]={seiNals:[],logs:[]}),P[ge].seiNals=P[ge].seiNals.concat(Lt.seiNals),P[ge].logs=P[ge].logs.concat(Lt.logs))}),P},Ia=function(m,x,T){var E;if(x===null)return null;E=As(m,x);var P=E[x]||{};return{seiNals:P.seiNals,logs:P.logs,timescale:T}},_n=function(){var m=!1,x,T,E,P,M,z;this.isInitialized=function(){return m},this.init=function(Q){x=new Wd,m=!0,z=Q?Q.isPartial:!1,x.on("data",function(te){te.startTime=te.startPts/P,te.endTime=te.endPts/P,M.captions.push(te),M.captionStreams[te.stream]=!0}),x.on("log",function(te){M.logs.push(te)})},this.isNewInit=function(Q,te){return Q&&Q.length===0||te&&typeof te=="object"&&Object.keys(te).length===0?!1:E!==Q[0]||P!==te[E]},this.parse=function(Q,te,Z){var se;if(this.isInitialized()){if(!te||!Z)return null;if(this.isNewInit(te,Z))E=te[0],P=Z[E];else if(E===null||!P)return T.push(Q),null}else return null;for(;T.length>0;){var ge=T.shift();this.parse(ge,te,Z)}return se=Ia(Q,E,P),se&&se.logs&&(M.logs=M.logs.concat(se.logs)),se===null||!se.seiNals?M.logs.length?{logs:M.logs,captions:[],captionStreams:[]}:null:(this.pushNals(se.seiNals),this.flushStream(),M)},this.pushNals=function(Q){if(!this.isInitialized()||!Q||Q.length===0)return null;Q.forEach(function(te){x.push(te)})},this.flushStream=function(){if(!this.isInitialized())return null;z?x.partialFlush():x.flush()},this.clearParsedCaptions=function(){M.captions=[],M.captionStreams={},M.logs=[]},this.resetCaptionStream=function(){if(!this.isInitialized())return null;x.reset()},this.clearAllCaptions=function(){this.clearParsedCaptions(),this.resetCaptionStream()},this.reset=function(){T=[],E=null,P=null,M?this.clearParsedCaptions():M={captions:[],captionStreams:{},logs:[]},this.resetCaptionStream()},this.reset()},Gd=_n,Is=zn.toUnsigned,Gn=zn.toHexString,Bu=r.getUint64,Uu,$u,ju,Ps,qu,Pa;Uu=function(m){var x={},T=mt(m,["moov","trak"]);return T.reduce(function(E,P){var M,z,Q,te,Z;return M=mt(P,["tkhd"])[0],!M||(z=M[0],Q=z===0?12:20,te=Is(M[Q]<<24|M[Q+1]<<16|M[Q+2]<<8|M[Q+3]),Z=mt(P,["mdia","mdhd"])[0],!Z)?null:(z=Z[0],Q=z===0?12:20,E[te]=Is(Z[Q]<<24|Z[Q+1]<<16|Z[Q+2]<<8|Z[Q+3]),E)},x)},$u=function(m,x){var T;T=mt(x,["moof","traf"]);var E=T.reduce(function(P,M){var z=mt(M,["tfhd"])[0],Q=Is(z[4]<<24|z[5]<<16|z[6]<<8|z[7]),te=m[Q]||9e4,Z=mt(M,["tfdt"])[0],se=new DataView(Z.buffer,Z.byteOffset,Z.byteLength),ge;Z[0]===1?ge=Bu(Z.subarray(4,12)):ge=se.getUint32(4);var xe;return typeof ge=="bigint"?xe=ge/ks.BigInt(te):typeof ge=="number"&&!isNaN(ge)&&(xe=ge/te),xe<Number.MAX_SAFE_INTEGER&&(xe=Number(xe)),xe<P&&(P=xe),P},1/0);return typeof E=="bigint"||isFinite(E)?E:0},ju=function(m,x){var T=mt(x,["moof","traf"]),E=0,P=0,M;if(T&&T.length){var z=mt(T[0],["tfhd"])[0],Q=mt(T[0],["trun"])[0],te=mt(T[0],["tfdt"])[0];if(z){var Z=Es(z);M=Z.trackId}if(te){var se=xs(te);E=se.baseMediaDecodeTime}if(Q){var ge=Fi(Q);ge.samples&&ge.samples.length&&(P=ge.samples[0].compositionTimeOffset||0)}}var xe=m[M]||9e4;typeof E=="bigint"&&(P=ks.BigInt(P),xe=ks.BigInt(xe));var Pe=(E+P)/xe;return typeof Pe=="bigint"&&Pe<Number.MAX_SAFE_INTEGER&&(Pe=Number(Pe)),Pe},Ps=function(m){var x=mt(m,["moov","trak"]),T=[];return x.forEach(function(E){var P=mt(E,["mdia","hdlr"]),M=mt(E,["tkhd"]);P.forEach(function(z,Q){var te=Ur(z.subarray(8,12)),Z=M[Q],se,ge,xe;te==="vide"&&(se=new DataView(Z.buffer,Z.byteOffset,Z.byteLength),ge=se.getUint8(0),xe=ge===0?se.getUint32(12):se.getUint32(20),T.push(xe))})}),T},Pa=function(m){var x=m[0],T=x===0?12:20;return Is(m[T]<<24|m[T+1]<<16|m[T+2]<<8|m[T+3])},qu=function(m){var x=mt(m,["moov","trak"]),T=[];return x.forEach(function(E){var P={},M=mt(E,["tkhd"])[0],z,Q;M&&(z=new DataView(M.buffer,M.byteOffset,M.byteLength),Q=z.getUint8(0),P.id=Q===0?z.getUint32(12):z.getUint32(20));var te=mt(E,["mdia","hdlr"])[0];if(te){var Z=Ur(te.subarray(8,12));Z==="vide"?P.type="video":Z==="soun"?P.type="audio":P.type=Z}var se=mt(E,["mdia","minf","stbl","stsd"])[0];if(se){var ge=se.subarray(8);P.codec=Ur(ge.subarray(4,8));var xe=mt(ge,[P.codec])[0],Pe,Se;xe&&(/^[asm]vc[1-9]$/i.test(P.codec)?(Pe=xe.subarray(78),Se=Ur(Pe.subarray(4,8)),Se==="avcC"&&Pe.length>11?(P.codec+=".",P.codec+=Gn(Pe[9]),P.codec+=Gn(Pe[10]),P.codec+=Gn(Pe[11])):P.codec="avc1.4d400d"):/^mp4[a,v]$/i.test(P.codec)?(Pe=xe.subarray(28),Se=Ur(Pe.subarray(4,8)),Se==="esds"&&Pe.length>20&&Pe[19]!==0?(P.codec+="."+Gn(Pe[19]),P.codec+="."+Gn(Pe[20]>>>2&63).replace(/^0/,"")):P.codec="mp4a.40.2"):P.codec=P.codec.toLowerCase())}var ze=mt(E,["mdia","mdhd"])[0];ze&&(P.timescale=Pa(ze)),T.push(P)}),T};var Vu={findBox:mt,parseType:Ur,timescale:Uu,startTime:$u,compositionStartTime:ju,videoTrackIds:Ps,tracks:qu,getTimescaleFromMediaHeader:Pa},Hu=function(m){var x=m[1]&31;return x<<=8,x|=m[2],x},Ds=function(m){return!!(m[1]&64)},Kn=function(m){var x=0;return(m[3]&48)>>>4>1&&(x+=m[4]+1),x},Kd=function(m,x){var T=Hu(m);return T===0?"pat":T===x?"pmt":x?"pes":null},Xd=function(m){var x=Ds(m),T=4+Kn(m);return x&&(T+=m[T]+1),(m[T+10]&31)<<8|m[T+11]},Qd=function(m){var x={},T=Ds(m),E=4+Kn(m);if(T&&(E+=m[E]+1),!!(m[E+5]&1)){var P,M,z;P=(m[E+1]&15)<<8|m[E+2],M=3+P-4,z=(m[E+10]&15)<<8|m[E+11];for(var Q=12+z;Q<M;){var te=E+Q;x[(m[te+1]&31)<<8|m[te+2]]=m[te],Q+=((m[te+3]&15)<<8|m[te+4])+5}return x}},rl=function(m,x){var T=Hu(m),E=x[T];switch(E){case Ut.H264_STREAM_TYPE:return"video";case Ut.ADTS_STREAM_TYPE:return"audio";case Ut.METADATA_STREAM_TYPE:return"timed-metadata";default:return null}},Yd=function(m){var x=Ds(m);if(!x)return null;var T=4+Kn(m);if(T>=m.byteLength)return null;var E=null,P;return P=m[T+7],P&192&&(E={},E.pts=(m[T+9]&14)<<27|(m[T+10]&255)<<20|(m[T+11]&254)<<12|(m[T+12]&255)<<5|(m[T+13]&254)>>>3,E.pts*=4,E.pts+=(m[T+13]&6)>>>1,E.dts=E.pts,P&64&&(E.dts=(m[T+14]&14)<<27|(m[T+15]&255)<<20|(m[T+16]&254)<<12|(m[T+17]&255)<<5|(m[T+18]&254)>>>3,E.dts*=4,E.dts+=(m[T+18]&6)>>>1)),E},Da=function(m){switch(m){case 5:return"slice_layer_without_partitioning_rbsp_idr";case 6:return"sei_rbsp";case 7:return"seq_parameter_set_rbsp";case 8:return"pic_parameter_set_rbsp";case 9:return"access_unit_delimiter_rbsp";default:return null}},Jd=function(m){for(var x=4+Kn(m),T=m.subarray(x),E=0,P=0,M=!1,z;P<T.byteLength-3;P++)if(T[P+2]===1){E=P+5;break}for(;E<T.byteLength;)switch(T[E]){case 0:if(T[E-1]!==0){E+=2;break}else if(T[E-2]!==0){E++;break}P+3!==E-2&&(z=Da(T[P+3]&31),z==="slice_layer_without_partitioning_rbsp_idr"&&(M=!0));do E++;while(T[E]!==1&&E<T.length);P=E-2,E+=3;break;case 1:if(T[E-1]!==0||T[E-2]!==0){E+=3;break}z=Da(T[P+3]&31),z==="slice_layer_without_partitioning_rbsp_idr"&&(M=!0),P=E-2,E+=3;break;default:E+=3;break}return T=T.subarray(P),E-=P,P=0,T&&T.byteLength>3&&(z=Da(T[P+3]&31),z==="slice_layer_without_partitioning_rbsp_idr"&&(M=!0)),M},Zd={parseType:Kd,parsePat:Xd,parsePmt:Qd,parsePayloadUnitStartIndicator:Ds,parsePesType:rl,parsePesTime:Yd,videoPacketContainsKeyFrame:Jd},Tn=Cu.handleRollover,at={};at.ts=Zd,at.aac=Ts;var $r=Ze.ONE_SECOND_IN_TS,Jt=188,Yi=71,ef=function(m,x){for(var T=0,E=Jt,P,M;E<m.byteLength;){if(m[T]===Yi&&m[E]===Yi){switch(P=m.subarray(T,E),M=at.ts.parseType(P,x.pid),M){case"pat":x.pid=at.ts.parsePat(P);break;case"pmt":var z=at.ts.parsePmt(P);x.table=x.table||{},Object.keys(z).forEach(function(Q){x.table[Q]=z[Q]});break}T+=Jt,E+=Jt;continue}T++,E++}},zu=function(m,x,T){for(var E=0,P=Jt,M,z,Q,te,Z,se=!1;P<=m.byteLength;){if(m[E]===Yi&&(m[P]===Yi||P===m.byteLength)){switch(M=m.subarray(E,P),z=at.ts.parseType(M,x.pid),z){case"pes":Q=at.ts.parsePesType(M,x.table),te=at.ts.parsePayloadUnitStartIndicator(M),Q==="audio"&&te&&(Z=at.ts.parsePesTime(M),Z&&(Z.type="audio",T.audio.push(Z),se=!0));break}if(se)break;E+=Jt,P+=Jt;continue}E++,P++}for(P=m.byteLength,E=P-Jt,se=!1;E>=0;){if(m[E]===Yi&&(m[P]===Yi||P===m.byteLength)){switch(M=m.subarray(E,P),z=at.ts.parseType(M,x.pid),z){case"pes":Q=at.ts.parsePesType(M,x.table),te=at.ts.parsePayloadUnitStartIndicator(M),Q==="audio"&&te&&(Z=at.ts.parsePesTime(M),Z&&(Z.type="audio",T.audio.push(Z),se=!0));break}if(se)break;E-=Jt,P-=Jt;continue}E--,P--}},Na=function(m,x,T){for(var E=0,P=Jt,M,z,Q,te,Z,se,ge,xe,Pe=!1,Se={data:[],size:0};P<m.byteLength;){if(m[E]===Yi&&m[P]===Yi){switch(M=m.subarray(E,P),z=at.ts.parseType(M,x.pid),z){case"pes":if(Q=at.ts.parsePesType(M,x.table),te=at.ts.parsePayloadUnitStartIndicator(M),Q==="video"&&(te&&!Pe&&(Z=at.ts.parsePesTime(M),Z&&(Z.type="video",T.video.push(Z),Pe=!0)),!T.firstKeyFrame)){if(te&&Se.size!==0){for(se=new Uint8Array(Se.size),ge=0;Se.data.length;)xe=Se.data.shift(),se.set(xe,ge),ge+=xe.byteLength;if(at.ts.videoPacketContainsKeyFrame(se)){var ze=at.ts.parsePesTime(se);ze?(T.firstKeyFrame=ze,T.firstKeyFrame.type="video"):console.warn("Failed to extract PTS/DTS from PES at first keyframe. This could be an unusual TS segment, or else mux.js did not parse your TS segment correctly. If you know your TS segments do contain PTS/DTS on keyframes please file a bug report! You can try ffprobe to double check for yourself.")}Se.size=0}Se.data.push(M),Se.size+=M.byteLength}break}if(Pe&&T.firstKeyFrame)break;E+=Jt,P+=Jt;continue}E++,P++}for(P=m.byteLength,E=P-Jt,Pe=!1;E>=0;){if(m[E]===Yi&&m[P]===Yi){switch(M=m.subarray(E,P),z=at.ts.parseType(M,x.pid),z){case"pes":Q=at.ts.parsePesType(M,x.table),te=at.ts.parsePayloadUnitStartIndicator(M),Q==="video"&&te&&(Z=at.ts.parsePesTime(M),Z&&(Z.type="video",T.video.push(Z),Pe=!0));break}if(Pe)break;E-=Jt,P-=Jt;continue}E--,P--}},tf=function(m,x){if(m.audio&&m.audio.length){var T=x;(typeof T>"u"||isNaN(T))&&(T=m.audio[0].dts),m.audio.forEach(function(M){M.dts=Tn(M.dts,T),M.pts=Tn(M.pts,T),M.dtsTime=M.dts/$r,M.ptsTime=M.pts/$r})}if(m.video&&m.video.length){var E=x;if((typeof E>"u"||isNaN(E))&&(E=m.video[0].dts),m.video.forEach(function(M){M.dts=Tn(M.dts,E),M.pts=Tn(M.pts,E),M.dtsTime=M.dts/$r,M.ptsTime=M.pts/$r}),m.firstKeyFrame){var P=m.firstKeyFrame;P.dts=Tn(P.dts,E),P.pts=Tn(P.pts,E),P.dtsTime=P.dts/$r,P.ptsTime=P.pts/$r}}},rf=function(m){for(var x=!1,T=0,E=null,P=null,M=0,z=0,Q;m.length-z>=3;){var te=at.aac.parseType(m,z);switch(te){case"timed-metadata":if(m.length-z<10){x=!0;break}if(M=at.aac.parseId3TagSize(m,z),M>m.length){x=!0;break}P===null&&(Q=m.subarray(z,z+M),P=at.aac.parseAacTimestamp(Q)),z+=M;break;case"audio":if(m.length-z<7){x=!0;break}if(M=at.aac.parseAdtsSize(m,z),M>m.length){x=!0;break}E===null&&(Q=m.subarray(z,z+M),E=at.aac.parseSampleRate(Q)),T++,z+=M;break;default:z++;break}if(x)return null}if(E===null||P===null)return null;var Z=$r/E,se={audio:[{type:"audio",dts:P,pts:P},{type:"audio",dts:P+T*1024*Z,pts:P+T*1024*Z}]};return se},nf=function(m){var x={pid:null,table:null},T={};ef(m,x);for(var E in x.table)if(x.table.hasOwnProperty(E)){var P=x.table[E];switch(P){case Ut.H264_STREAM_TYPE:T.video=[],Na(m,x,T),T.video.length===0&&delete T.video;break;case Ut.ADTS_STREAM_TYPE:T.audio=[],zu(m,x,T),T.audio.length===0&&delete T.audio;break}}return T},sf=function(m,x){var T=at.aac.isLikelyAacData(m),E;return T?E=rf(m):E=nf(m),!E||!E.audio&&!E.video?null:(tf(E,x),E)},Wu={inspect:sf,parseAudioPes_:zu},af=function(m,x){x.on("data",function(T){var E=T.initSegment;T.initSegment={data:E.buffer,byteOffset:E.byteOffset,byteLength:E.byteLength};var P=T.data;T.data=P.buffer,m.postMessage({action:"data",segment:T,byteOffset:P.byteOffset,byteLength:P.byteLength},[T.data])}),x.on("done",function(T){m.postMessage({action:"done"})}),x.on("gopInfo",function(T){m.postMessage({action:"gopInfo",gopInfo:T})}),x.on("videoSegmentTimingInfo",function(T){var E={start:{decode:Ze.videoTsToSeconds(T.start.dts),presentation:Ze.videoTsToSeconds(T.start.pts)},end:{decode:Ze.videoTsToSeconds(T.end.dts),presentation:Ze.videoTsToSeconds(T.end.pts)},baseMediaDecodeTime:Ze.videoTsToSeconds(T.baseMediaDecodeTime)};T.prependedContentDuration&&(E.prependedContentDuration=Ze.videoTsToSeconds(T.prependedContentDuration)),m.postMessage({action:"videoSegmentTimingInfo",videoSegmentTimingInfo:E})}),x.on("audioSegmentTimingInfo",function(T){var E={start:{decode:Ze.videoTsToSeconds(T.start.dts),presentation:Ze.videoTsToSeconds(T.start.pts)},end:{decode:Ze.videoTsToSeconds(T.end.dts),presentation:Ze.videoTsToSeconds(T.end.pts)},baseMediaDecodeTime:Ze.videoTsToSeconds(T.baseMediaDecodeTime)};T.prependedContentDuration&&(E.prependedContentDuration=Ze.videoTsToSeconds(T.prependedContentDuration)),m.postMessage({action:"audioSegmentTimingInfo",audioSegmentTimingInfo:E})}),x.on("id3Frame",function(T){m.postMessage({action:"id3Frame",id3Frame:T})}),x.on("caption",function(T){m.postMessage({action:"caption",caption:T})}),x.on("trackinfo",function(T){m.postMessage({action:"trackinfo",trackInfo:T})}),x.on("audioTimingInfo",function(T){m.postMessage({action:"audioTimingInfo",audioTimingInfo:{start:Ze.videoTsToSeconds(T.start),end:Ze.videoTsToSeconds(T.end)}})}),x.on("videoTimingInfo",function(T){m.postMessage({action:"videoTimingInfo",videoTimingInfo:{start:Ze.videoTsToSeconds(T.start),end:Ze.videoTsToSeconds(T.end)}})}),x.on("log",function(T){m.postMessage({action:"log",log:T})})},Xn=function(){function j(x,T){this.options=T||{},this.self=x,this.init()}var m=j.prototype;return m.init=function(){this.transmuxer&&this.transmuxer.dispose(),this.transmuxer=new Fd.Transmuxer(this.options),af(this.self,this.transmuxer)},m.pushMp4Captions=function(T){this.captionParser||(this.captionParser=new Gd,this.captionParser.init());var E=new Uint8Array(T.data,T.byteOffset,T.byteLength),P=this.captionParser.parse(E,T.trackIds,T.timescales);this.self.postMessage({action:"mp4Captions",captions:P&&P.captions||[],logs:P&&P.logs||[],data:E.buffer},[E.buffer])},m.probeMp4StartTime=function(T){var E=T.timescales,P=T.data,M=Vu.startTime(E,P);this.self.postMessage({action:"probeMp4StartTime",startTime:M,data:P},[P.buffer])},m.probeMp4Tracks=function(T){var E=T.data,P=Vu.tracks(E);this.self.postMessage({action:"probeMp4Tracks",tracks:P,data:E},[E.buffer])},m.probeTs=function(T){var E=T.data,P=T.baseStartTime,M=typeof P=="number"&&!isNaN(P)?P*Ze.ONE_SECOND_IN_TS:void 0,z=Wu.inspect(E,M),Q=null;z&&(Q={hasVideo:z.video&&z.video.length===2||!1,hasAudio:z.audio&&z.audio.length===2||!1},Q.hasVideo&&(Q.videoStart=z.video[0].ptsTime),Q.hasAudio&&(Q.audioStart=z.audio[0].ptsTime)),this.self.postMessage({action:"probeTs",result:Q,data:E},[E.buffer])},m.clearAllMp4Captions=function(){this.captionParser&&this.captionParser.clearAllCaptions()},m.clearParsedMp4Captions=function(){this.captionParser&&this.captionParser.clearParsedCaptions()},m.push=function(T){var E=new Uint8Array(T.data,T.byteOffset,T.byteLength);this.transmuxer.push(E)},m.reset=function(){this.transmuxer.reset()},m.setTimestampOffset=function(T){var E=T.timestampOffset||0;this.transmuxer.setBaseMediaDecodeTime(Math.round(Ze.secondsToVideoTs(E)))},m.setAudioAppendStart=function(T){this.transmuxer.setAudioAppendStart(Math.ceil(Ze.secondsToVideoTs(T.appendStart)))},m.setRemux=function(T){this.transmuxer.setRemux(T.remux)},m.flush=function(T){this.transmuxer.flush(),self.postMessage({action:"done",type:"transmuxed"})},m.endTimeline=function(){this.transmuxer.endTimeline(),self.postMessage({action:"endedtimeline",type:"transmuxed"})},m.alignGopsWith=function(T){this.transmuxer.alignGopsWith(T.gopsToAlignWith.slice())},j}();self.onmessage=function(j){if(j.data.action==="init"&&j.data.options){this.messageHandlers=new Xn(self,j.data.options);return}this.messageHandlers||(this.messageHandlers=new Xn(self)),j.data&&j.data.action&&j.data.action!=="init"&&this.messageHandlers[j.data.action]&&this.messageHandlers[j.data.action](j.data)}})),lU=oA(oU),uU=function(e,t,i){var r=e.data.segment,n=r.type,a=r.initSegment,o=r.captions,l=r.captionStreams,u=r.metadata,c=r.videoFrameDtsTime,h=r.videoFramePtsTime;t.buffer.push({captions:o,captionStreams:l,metadata:u});var d=e.data.segment.boxes||{data:e.data.segment.data},g={type:n,data:new Uint8Array(d.data,d.data.byteOffset,d.data.byteLength),initSegment:new Uint8Array(a.data,a.byteOffset,a.byteLength)};typeof c<"u"&&(g.videoFrameDtsTime=c),typeof h<"u"&&(g.videoFramePtsTime=h),i(g)},cU=function(e){var t=e.transmuxedData,i=e.callback;t.buffer=[],i(t)},hU=function(e,t){t.gopInfo=e.data.gopInfo},cA=function(e){var t=e.transmuxer,i=e.bytes,r=e.audioAppendStart,n=e.gopsToAlignWith,a=e.remux,o=e.onData,l=e.onTrackInfo,u=e.onAudioTimingInfo,c=e.onVideoTimingInfo,h=e.onVideoSegmentTimingInfo,d=e.onAudioSegmentTimingInfo,g=e.onId3,y=e.onCaptions,p=e.onDone,_=e.onEndedTimeline,k=e.onTransmuxerLog,A=e.isEndOfTimeline,N={buffer:[]},$=A,R=function(C){t.currentTransmux===e&&(C.data.action==="data"&&uU(C,N,o),C.data.action==="trackinfo"&&l(C.data.trackInfo),C.data.action==="gopInfo"&&hU(C,N),C.data.action==="audioTimingInfo"&&u(C.data.audioTimingInfo),C.data.action==="videoTimingInfo"&&c(C.data.videoTimingInfo),C.data.action==="videoSegmentTimingInfo"&&h(C.data.videoSegmentTimingInfo),C.data.action==="audioSegmentTimingInfo"&&d(C.data.audioSegmentTimingInfo),C.data.action==="id3Frame"&&g([C.data.id3Frame],C.data.id3Frame.dispatchType),C.data.action==="caption"&&y(C.data.caption),C.data.action==="endedtimeline"&&($=!1,_()),C.data.action==="log"&&k(C.data.log),C.data.type==="transmuxed"&&($||(t.onmessage=null,cU({transmuxedData:N,callback:p}),hA(t))))};if(t.onmessage=R,r&&t.postMessage({action:"setAudioAppendStart",appendStart:r}),Array.isArray(n)&&t.postMessage({action:"alignGopsWith",gopsToAlignWith:n}),typeof a<"u"&&t.postMessage({action:"setRemux",remux:a}),i.byteLength){var L=i instanceof ArrayBuffer?i:i.buffer,F=i instanceof ArrayBuffer?0:i.byteOffset;t.postMessage({action:"push",data:L,byteOffset:F,byteLength:i.byteLength},[L])}A&&t.postMessage({action:"endTimeline"}),t.postMessage({action:"flush"})},hA=function(e){e.currentTransmux=null,e.transmuxQueue.length&&(e.currentTransmux=e.transmuxQueue.shift(),typeof e.currentTransmux=="function"?e.currentTransmux():cA(e.currentTransmux))},Ab=function(e,t){e.postMessage({action:t}),hA(e)},dA=function(e,t){if(!t.currentTransmux){t.currentTransmux=e,Ab(t,e);return}t.transmuxQueue.push(Ab.bind(null,t,e))},dU=function(e){dA("reset",e)},fU=function(e){dA("endTimeline",e)},fA=function(e){if(!e.transmuxer.currentTransmux){e.transmuxer.currentTransmux=e,cA(e);return}e.transmuxer.transmuxQueue.push(e)},pU=function(e){var t=new lU;t.currentTransmux=null,t.transmuxQueue=[];var i=t.terminate;return t.terminate=function(){return t.currentTransmux=null,t.transmuxQueue.length=0,i.call(t)},t.postMessage({action:"init",options:e}),t},mp={reset:dU,endTimeline:fU,transmux:fA,createTransmuxer:pU},xh=function(e){var t=e.transmuxer,i=e.endAction||e.action,r=e.callback,n=ft({},e,{endAction:null,transmuxer:null,callback:null}),a=function u(c){c.data.action===i&&(t.removeEventListener("message",u),c.data.data&&(c.data.data=new Uint8Array(c.data.data,e.byteOffset||0,e.byteLength||c.data.data.byteLength),e.data&&(e.data=c.data.data)),r(c.data))};if(t.addEventListener("message",a),e.data){var o=e.data instanceof ArrayBuffer;n.byteOffset=o?0:e.data.byteOffset,n.byteLength=e.data.byteLength;var l=[o?e.data:e.data.buffer];t.postMessage(n,l)}else t.postMessage(n)},Zr={FAILURE:2,TIMEOUT:-101,ABORTED:-102},Sv=function(e){e.forEach(function(t){t.abort()})},mU=function(e){return{bandwidth:e.bandwidth,bytesReceived:e.bytesReceived||0,roundTripTime:e.roundTripTime||0}},gU=function(e){var t=e.target,i=Date.now()-t.requestTime,r={bandwidth:1/0,bytesReceived:0,roundTripTime:i||0};return r.bytesReceived=e.loaded,r.bandwidth=Math.floor(r.bytesReceived/r.roundTripTime*8*1e3),r},cy=function(e,t){return t.timedout?{status:t.status,message:"HLS request timed-out at URL: "+t.uri,code:Zr.TIMEOUT,xhr:t}:t.aborted?{status:t.status,message:"HLS request aborted at URL: "+t.uri,code:Zr.ABORTED,xhr:t}:e?{status:t.status,message:"HLS request errored at URL: "+t.uri,code:Zr.FAILURE,xhr:t}:t.responseType==="arraybuffer"&&t.response.byteLength===0?{status:t.status,message:"Empty HLS response at URL: "+t.uri,code:Zr.FAILURE,xhr:t}:null},Ib=function(e,t,i){return function(r,n){var a=n.response,o=cy(r,n);if(o)return i(o,e);if(a.byteLength!==16)return i({status:n.status,message:"Invalid HLS key at URL: "+n.uri,code:Zr.FAILURE,xhr:n},e);for(var l=new DataView(a),u=new Uint32Array([l.getUint32(0),l.getUint32(4),l.getUint32(8),l.getUint32(12)]),c=0;c<t.length;c++)t[c].bytes=u;return i(null,e)}},pA=function(e,t){var i=I0(e.map.bytes);if(i!=="mp4"){var r=e.map.resolvedUri||e.map.uri;return t({internal:!0,message:"Found unsupported "+(i||"unknown")+" container for initialization segment at URL: "+r,code:Zr.FAILURE})}xh({action:"probeMp4Tracks",data:e.map.bytes,transmuxer:e.transmuxer,callback:function(a){var o=a.tracks,l=a.data;return e.map.bytes=l,o.forEach(function(u){e.map.tracks=e.map.tracks||{},!e.map.tracks[u.type]&&(e.map.tracks[u.type]=u,typeof u.id=="number"&&u.timescale&&(e.map.timescales=e.map.timescales||{},e.map.timescales[u.id]=u.timescale))}),t(null)}})},vU=function(e){var t=e.segment,i=e.finishProcessingFn;return function(r,n){var a=cy(r,n);if(a)return i(a,t);var o=new Uint8Array(n.response);if(t.map.key)return t.map.encryptedBytes=o,i(null,t);t.map.bytes=o,pA(t,function(l){if(l)return l.xhr=n,l.status=n.status,i(l,t);i(null,t)})}},yU=function(e){var t=e.segment,i=e.finishProcessingFn,r=e.responseType;return function(n,a){var o=cy(n,a);if(o)return i(o,t);var l=r==="arraybuffer"||!a.responseText?a.response:sU(a.responseText.substring(t.lastReachedChar||0));return t.stats=mU(a),t.key?t.encryptedBytes=new Uint8Array(l):t.bytes=new Uint8Array(l),i(null,t)}},_U=function(e){var t=e.segment,i=e.bytes,r=e.trackInfoFn,n=e.timingInfoFn,a=e.videoSegmentTimingInfoFn,o=e.audioSegmentTimingInfoFn,l=e.id3Fn,u=e.captionsFn,c=e.isEndOfTimeline,h=e.endedTimelineFn,d=e.dataFn,g=e.doneFn,y=e.onTransmuxerLog,p=t.map&&t.map.tracks||{},_=!!(p.audio&&p.video),k=n.bind(null,t,"audio","start"),A=n.bind(null,t,"audio","end"),N=n.bind(null,t,"video","start"),$=n.bind(null,t,"video","end"),R=function(){return fA({bytes:i,transmuxer:t.transmuxer,audioAppendStart:t.audioAppendStart,gopsToAlignWith:t.gopsToAlignWith,remux:_,onData:function(B){B.type=B.type==="combined"?"video":B.type,d(t,B)},onTrackInfo:function(B){r&&(_&&(B.isMuxed=!0),r(t,B))},onAudioTimingInfo:function(B){k&&typeof B.start<"u"&&(k(B.start),k=null),A&&typeof B.end<"u"&&A(B.end)},onVideoTimingInfo:function(B){N&&typeof B.start<"u"&&(N(B.start),N=null),$&&typeof B.end<"u"&&$(B.end)},onVideoSegmentTimingInfo:function(B){a(B)},onAudioSegmentTimingInfo:function(B){o(B)},onId3:function(B,C){l(t,B,C)},onCaptions:function(B){u(t,[B])},isEndOfTimeline:c,onEndedTimeline:function(){h()},onTransmuxerLog:y,onDone:function(B){g&&(B.type=B.type==="combined"?"video":B.type,g(null,t,B))}})};xh({action:"probeTs",transmuxer:t.transmuxer,data:i,baseStartTime:t.baseStartTime,callback:function(F){t.bytes=i=F.data;var B=F.result;B&&(r(t,{hasAudio:B.hasAudio,hasVideo:B.hasVideo,isMuxed:_}),r=null,B.hasAudio&&!_&&k(B.audioStart),B.hasVideo&&N(B.videoStart),k=null,N=null),R()}})},mA=function(e){var t=e.segment,i=e.bytes,r=e.trackInfoFn,n=e.timingInfoFn,a=e.videoSegmentTimingInfoFn,o=e.audioSegmentTimingInfoFn,l=e.id3Fn,u=e.captionsFn,c=e.isEndOfTimeline,h=e.endedTimelineFn,d=e.dataFn,g=e.doneFn,y=e.onTransmuxerLog,p=new Uint8Array(i);if(FB(p)){t.isFmp4=!0;var _=t.map.tracks,k={isFmp4:!0,hasVideo:!!_.video,hasAudio:!!_.audio};_.audio&&_.audio.codec&&_.audio.codec!=="enca"&&(k.audioCodec=_.audio.codec),_.video&&_.video.codec&&_.video.codec!=="encv"&&(k.videoCodec=_.video.codec),_.video&&_.audio&&(k.isMuxed=!0),r(t,k);var A=function($){d(t,{data:p,type:k.hasAudio&&!k.isMuxed?"audio":"video"}),$&&$.length&&u(t,$),g(null,t,{})};xh({action:"probeMp4StartTime",timescales:t.map.timescales,data:p,transmuxer:t.transmuxer,callback:function($){var R=$.data,L=$.startTime;if(i=R.buffer,t.bytes=p=R,k.hasAudio&&!k.isMuxed&&n(t,"audio","start",L),k.hasVideo&&n(t,"video","start",L),!_.video||!R.byteLength||!t.transmuxer){A();return}xh({action:"pushMp4Captions",endAction:"mp4Captions",transmuxer:t.transmuxer,data:p,timescales:t.map.timescales,trackIds:[_.video.id],callback:function(B){i=B.data.buffer,t.bytes=p=B.data,B.logs.forEach(function(C){y(ae.mergeOptions(C,{stream:"mp4CaptionParser"}))}),A(B.captions)}})}});return}if(!t.transmuxer){g(null,t,{});return}if(typeof t.container>"u"&&(t.container=I0(p)),t.container!=="ts"&&t.container!=="aac"){r(t,{hasAudio:!1,hasVideo:!1}),g(null,t,{});return}_U({segment:t,bytes:i,trackInfoFn:r,timingInfoFn:n,videoSegmentTimingInfoFn:a,audioSegmentTimingInfoFn:o,id3Fn:l,captionsFn:u,isEndOfTimeline:c,endedTimelineFn:h,dataFn:d,doneFn:g,onTransmuxerLog:y})},gA=function(e,t){var i=e.id,r=e.key,n=e.encryptedBytes,a=e.decryptionWorker,o=function u(c){if(c.data.source===i){a.removeEventListener("message",u);var h=c.data.decrypted;t(new Uint8Array(h.bytes,h.byteOffset,h.byteLength))}};a.addEventListener("message",o);var l;r.bytes.slice?l=r.bytes.slice():l=new Uint32Array(Array.prototype.slice.call(r.bytes)),a.postMessage(tA({source:i,encrypted:n,key:l,iv:r.iv}),[n.buffer,l.buffer])},TU=function(e){var t=e.decryptionWorker,i=e.segment,r=e.trackInfoFn,n=e.timingInfoFn,a=e.videoSegmentTimingInfoFn,o=e.audioSegmentTimingInfoFn,l=e.id3Fn,u=e.captionsFn,c=e.isEndOfTimeline,h=e.endedTimelineFn,d=e.dataFn,g=e.doneFn,y=e.onTransmuxerLog;gA({id:i.requestId,key:i.key,encryptedBytes:i.encryptedBytes,decryptionWorker:t},function(p){i.bytes=p,mA({segment:i,bytes:i.bytes,trackInfoFn:r,timingInfoFn:n,videoSegmentTimingInfoFn:a,audioSegmentTimingInfoFn:o,id3Fn:l,captionsFn:u,isEndOfTimeline:c,endedTimelineFn:h,dataFn:d,doneFn:g,onTransmuxerLog:y})})},bU=function(e){var t=e.activeXhrs,i=e.decryptionWorker,r=e.trackInfoFn,n=e.timingInfoFn,a=e.videoSegmentTimingInfoFn,o=e.audioSegmentTimingInfoFn,l=e.id3Fn,u=e.captionsFn,c=e.isEndOfTimeline,h=e.endedTimelineFn,d=e.dataFn,g=e.doneFn,y=e.onTransmuxerLog,p=0,_=!1;return function(k,A){if(!_){if(k)return _=!0,Sv(t),g(k,A);if(p+=1,p===t.length){var N=function(){if(A.encryptedBytes)return TU({decryptionWorker:i,segment:A,trackInfoFn:r,timingInfoFn:n,videoSegmentTimingInfoFn:a,audioSegmentTimingInfoFn:o,id3Fn:l,captionsFn:u,isEndOfTimeline:c,endedTimelineFn:h,dataFn:d,doneFn:g,onTransmuxerLog:y});mA({segment:A,bytes:A.bytes,trackInfoFn:r,timingInfoFn:n,videoSegmentTimingInfoFn:a,audioSegmentTimingInfoFn:o,id3Fn:l,captionsFn:u,isEndOfTimeline:c,endedTimelineFn:h,dataFn:d,doneFn:g,onTransmuxerLog:y})};if(A.endOfAllRequests=Date.now(),A.map&&A.map.encryptedBytes&&!A.map.bytes)return gA({decryptionWorker:i,id:A.requestId+"-init",encryptedBytes:A.map.encryptedBytes,key:A.map.key},function($){A.map.bytes=$,pA(A,function(R){if(R)return Sv(t),g(R,A);N()})});N()}}}},SU=function(e){var t=e.loadendState,i=e.abortFn;return function(r){var n=r.target;n.aborted&&i&&!t.calledAbortFn&&(i(),t.calledAbortFn=!0)}},xU=function(e){var t=e.segment,i=e.progressFn;return function(r){var n=r.target;if(!n.aborted)return t.stats=ae.mergeOptions(t.stats,gU(r)),!t.stats.firstBytesReceivedAt&&t.stats.bytesReceived&&(t.stats.firstBytesReceivedAt=Date.now()),i(r,t)}},CU=function(e){var t=e.xhr,i=e.xhrOptions,r=e.decryptionWorker,n=e.segment,a=e.abortFn,o=e.progressFn,l=e.trackInfoFn,u=e.timingInfoFn,c=e.videoSegmentTimingInfoFn,h=e.audioSegmentTimingInfoFn,d=e.id3Fn,g=e.captionsFn,y=e.isEndOfTimeline,p=e.endedTimelineFn,_=e.dataFn,k=e.doneFn,A=e.onTransmuxerLog,N=[],$=bU({activeXhrs:N,decryptionWorker:r,trackInfoFn:l,timingInfoFn:u,videoSegmentTimingInfoFn:c,audioSegmentTimingInfoFn:h,id3Fn:d,captionsFn:g,isEndOfTimeline:y,endedTimelineFn:p,dataFn:_,doneFn:k,onTransmuxerLog:A});if(n.key&&!n.key.bytes){var R=[n.key];n.map&&!n.map.bytes&&n.map.key&&n.map.key.resolvedUri===n.key.resolvedUri&&R.push(n.map.key);var L=ae.mergeOptions(i,{uri:n.key.resolvedUri,responseType:"arraybuffer"}),F=Ib(n,R,$),B=t(L,F);N.push(B)}if(n.map&&!n.map.bytes){var C=n.map.key&&(!n.key||n.key.resolvedUri!==n.map.key.resolvedUri);if(C){var I=ae.mergeOptions(i,{uri:n.map.key.resolvedUri,responseType:"arraybuffer"}),G=Ib(n,[n.map.key],$),H=t(I,G);N.push(H)}var K=ae.mergeOptions(i,{uri:n.map.resolvedUri,responseType:"arraybuffer",headers:Tv(n.map)}),ie=vU({segment:n,finishProcessingFn:$}),he=t(K,ie);N.push(he)}var fe=ae.mergeOptions(i,{uri:n.part&&n.part.resolvedUri||n.resolvedUri,responseType:"arraybuffer",headers:Tv(n)}),re=yU({segment:n,finishProcessingFn:$,responseType:fe.responseType}),ne=t(fe,re);ne.addEventListener("progress",xU({segment:n,progressFn:o})),N.push(ne);var oe={};return N.forEach(function(de){de.addEventListener("loadend",SU({loadendState:oe,abortFn:a}))}),function(){return Sv(N)}},EU=Mr("CodecUtils"),wU=function(e){var t=e.attributes||{};if(t.CODECS)return Hr(t.CODECS)},vA=function(e,t){var i=t.attributes||{};return e&&e.mediaGroups&&e.mediaGroups.AUDIO&&i.AUDIO&&e.mediaGroups.AUDIO[i.AUDIO]},kU=function(e,t){if(!vA(e,t))return!0;var i=t.attributes||{},r=e.mediaGroups.AUDIO[i.AUDIO];for(var n in r)if(!r[n].uri&&!r[n].playlists)return!0;return!1},Ch=function(e){var t={};return e.forEach(function(i){var r=i.mediaType,n=i.type,a=i.details;t[r]=t[r]||[],t[r].push(gw(""+n+a))}),Object.keys(t).forEach(function(i){if(t[i].length>1){EU("multiple "+i+" codecs found as attributes: "+t[i].join(", ")+". Setting playlist codecs to null so that we wait for mux.js to probe segments for real codecs."),t[i]=null;return}t[i]=t[i][0]}),t},Pb=function(e){var t=0;return e.audio&&t++,e.video&&t++,t},Vl=function(e,t){var i=t.attributes||{},r=Ch(wU(t)||[]);if(vA(e,t)&&!r.audio&&!kU(e,t)){var n=Ch(gF(e,i.AUDIO)||[]);n.audio&&(r.audio=n.audio)}return r},yc=Mr("PlaylistSelector"),Db=function(e){if(!(!e||!e.playlist)){var t=e.playlist;return JSON.stringify({id:t.id,bandwidth:e.bandwidth,width:e.width,height:e.height,codecs:t.attributes&&t.attributes.CODECS||""})}},Eh=function(e,t){if(!e)return"";var i=O.getComputedStyle(e);return i?i[t]:""},uo=function(e,t){var i=e.slice();e.sort(function(r,n){var a=t(r,n);return a===0?i.indexOf(r)-i.indexOf(n):a})},hy=function(e,t){var i,r;return e.attributes.BANDWIDTH&&(i=e.attributes.BANDWIDTH),i=i||O.Number.MAX_VALUE,t.attributes.BANDWIDTH&&(r=t.attributes.BANDWIDTH),r=r||O.Number.MAX_VALUE,i-r},AU=function(e,t){var i,r;return e.attributes.RESOLUTION&&e.attributes.RESOLUTION.width&&(i=e.attributes.RESOLUTION.width),i=i||O.Number.MAX_VALUE,t.attributes.RESOLUTION&&t.attributes.RESOLUTION.width&&(r=t.attributes.RESOLUTION.width),r=r||O.Number.MAX_VALUE,i===r&&e.attributes.BANDWIDTH&&t.attributes.BANDWIDTH?e.attributes.BANDWIDTH-t.attributes.BANDWIDTH:i-r},yA=function(e,t,i,r,n,a){if(e){var o={bandwidth:t,width:i,height:r,limitRenditionByPlayerDimensions:n},l=e.playlists;Vi.isAudioOnly(e)&&(l=a.getAudioTrackPlaylists_(),o.audioOnly=!0);var u=l.map(function(I){var G,H=I.attributes&&I.attributes.RESOLUTION&&I.attributes.RESOLUTION.width,K=I.attributes&&I.attributes.RESOLUTION&&I.attributes.RESOLUTION.height;return G=I.attributes&&I.attributes.BANDWIDTH,G=G||O.Number.MAX_VALUE,{bandwidth:G,width:H,height:K,playlist:I}});uo(u,function(I,G){return I.bandwidth-G.bandwidth}),u=u.filter(function(I){return!Vi.isIncompatible(I.playlist)});var c=u.filter(function(I){return Vi.isEnabled(I.playlist)});c.length||(c=u.filter(function(I){return!Vi.isDisabled(I.playlist)}));var h=c.filter(function(I){return I.bandwidth*ti.BANDWIDTH_VARIANCE<t}),d=h[h.length-1],g=h.filter(function(I){return I.bandwidth===d.bandwidth})[0];if(n===!1){var y=g||c[0]||u[0];if(y&&y.playlist){var p="sortedPlaylistReps";return g&&(p="bandwidthBestRep"),c[0]&&(p="enabledPlaylistReps"),yc("choosing "+Db(y)+" using "+p+" with options",o),y.playlist}return yc("could not choose a playlist with options",o),null}var _=h.filter(function(I){return I.width&&I.height});uo(_,function(I,G){return I.width-G.width});var k=_.filter(function(I){return I.width===i&&I.height===r});d=k[k.length-1];var A=k.filter(function(I){return I.bandwidth===d.bandwidth})[0],N,$,R;A||(N=_.filter(function(I){return I.width>i||I.height>r}),$=N.filter(function(I){return I.width===N[0].width&&I.height===N[0].height}),d=$[$.length-1],R=$.filter(function(I){return I.bandwidth===d.bandwidth})[0]);var L;if(a.experimentalLeastPixelDiffSelector){var F=_.map(function(I){return I.pixelDiff=Math.abs(I.width-i)+Math.abs(I.height-r),I});uo(F,function(I,G){return I.pixelDiff===G.pixelDiff?G.bandwidth-I.bandwidth:I.pixelDiff-G.pixelDiff}),L=F[0]}var B=L||R||A||g||c[0]||u[0];if(B&&B.playlist){var C="sortedPlaylistReps";return L?C="leastPixelDiffRep":R?C="resolutionPlusOneRep":A?C="resolutionBestRep":g?C="bandwidthBestRep":c[0]&&(C="enabledPlaylistReps"),yc("choosing "+Db(B)+" using "+C+" with options",o),B.playlist}return yc("could not choose a playlist with options",o),null}},Nb=function(){var e=this.useDevicePixelRatio&&O.devicePixelRatio||1;return yA(this.playlists.master,this.systemBandwidth,parseInt(Eh(this.tech_.el(),"width"),10)*e,parseInt(Eh(this.tech_.el(),"height"),10)*e,this.limitRenditionByPlayerDimensions,this.masterPlaylistController_)},IU=function(e){var t=-1,i=-1;if(e<0||e>1)throw new Error("Moving average bandwidth decay must be between 0 and 1.");return function(){var r=this.useDevicePixelRatio&&O.devicePixelRatio||1;return t<0&&(t=this.systemBandwidth,i=this.systemBandwidth),this.systemBandwidth>0&&this.systemBandwidth!==i&&(t=e*this.systemBandwidth+(1-e)*t,i=this.systemBandwidth),yA(this.playlists.master,t,parseInt(Eh(this.tech_.el(),"width"),10)*r,parseInt(Eh(this.tech_.el(),"height"),10)*r,this.limitRenditionByPlayerDimensions,this.masterPlaylistController_)}},PU=function(e){var t=e.master,i=e.currentTime,r=e.bandwidth,n=e.duration,a=e.segmentDuration,o=e.timeUntilRebuffer,l=e.currentTimeline,u=e.syncController,c=t.playlists.filter(function(p){return!Vi.isIncompatible(p)}),h=c.filter(Vi.isEnabled);h.length||(h=c.filter(function(p){return!Vi.isDisabled(p)}));var d=h.filter(Vi.hasAttribute.bind(null,"BANDWIDTH")),g=d.map(function(p){var _=u.getSyncPoint(p,n,l,i),k=_?1:2,A=Vi.estimateSegmentRequestTime(a,r,p),N=A*k-o;return{playlist:p,rebufferingImpact:N}}),y=g.filter(function(p){return p.rebufferingImpact<=0});return uo(y,function(p,_){return hy(_.playlist,p.playlist)}),y.length?y[0]:(uo(g,function(p,_){return p.rebufferingImpact-_.rebufferingImpact}),g[0]||null)},DU=function(){var e=this,t=this.playlists.master.playlists.filter(Vi.isEnabled);uo(t,function(r,n){return hy(r,n)});var i=t.filter(function(r){return!!Vl(e.playlists.master,r).video});return i[0]||null},NU=function(e){var t=0,i;return e.bytes&&(i=new Uint8Array(e.bytes),e.segments.forEach(function(r){i.set(r,t),t+=r.byteLength})),i},LU=function(e,t,i){if(!e[i]){t.trigger({type:"usage",name:"vhs-608"}),t.trigger({type:"usage",name:"hls-608"});var r=i;/^cc708_/.test(i)&&(r="SERVICE"+i.split("_")[1]);var n=t.textTracks().getTrackById(r);if(n)e[i]=n;else{var a=t.options_.vhs&&t.options_.vhs.captionServices||{},o=i,l=i,u=!1,c=a[r];c&&(o=c.label,l=c.language,u=c.default),e[i]=t.addRemoteTextTrack({kind:"captions",id:r,default:u,label:o,language:l},!1).track}}},OU=function(e){var t=e.inbandTextTracks,i=e.captionArray,r=e.timestampOffset;if(i){var n=O.WebKitDataCue||O.VTTCue;i.forEach(function(a){var o=a.stream;t[o].addCue(new n(a.startTime+r,a.endTime+r,a.text))})}},MU=function(e){Object.defineProperties(e.frame,{id:{get:function(){return ae.log.warn("cue.frame.id is deprecated. Use cue.value.key instead."),e.value.key}},value:{get:function(){return ae.log.warn("cue.frame.value is deprecated. Use cue.value.data instead."),e.value.data}},privateData:{get:function(){return ae.log.warn("cue.frame.privateData is deprecated. Use cue.value.data instead."),e.value.data}}})},RU=function(e){var t=e.inbandTextTracks,i=e.metadataArray,r=e.timestampOffset,n=e.videoDuration;if(i){var a=O.WebKitDataCue||O.VTTCue,o=t.metadataTrack_;if(o&&(i.forEach(function(g){var y=g.cueTime+r;typeof y!="number"||O.isNaN(y)||y<0||!(y<1/0)||g.frames.forEach(function(p){var _=new a(y,y,p.value||p.url||p.data||"");_.frame=p,_.value=p,MU(_),o.addCue(_)})}),!(!o.cues||!o.cues.length))){for(var l=o.cues,u=[],c=0;c<l.length;c++)l[c]&&u.push(l[c]);var h=u.reduce(function(g,y){var p=g[y.startTime]||[];return p.push(y),g[y.startTime]=p,g},{}),d=Object.keys(h).sort(function(g,y){return Number(g)-Number(y)});d.forEach(function(g,y){var p=h[g],_=Number(d[y+1])||n;p.forEach(function(k){k.endTime=_})})}}},FU=function(e,t,i){e.metadataTrack_||(e.metadataTrack_=i.addRemoteTextTrack({kind:"metadata",label:"Timed Metadata"},!1).track,e.metadataTrack_.inBandMetadataTrackDispatchType=t)},Dl=function(e,t,i){var r,n;if(i&&i.cues)for(r=i.cues.length;r--;)n=i.cues[r],n.startTime>=e&&n.endTime<=t&&i.removeCue(n)},BU=function(e){var t=e.cues;if(t)for(var i=0;i<t.length;i++){for(var r=[],n=0,a=0;a<t.length;a++)t[i].startTime===t[a].startTime&&t[i].endTime===t[a].endTime&&t[i].text===t[a].text&&(n++,n>1&&r.push(t[a]));r.length&&r.forEach(function(o){return e.removeCue(o)})}},UU=function(e,t,i){if(typeof t>"u"||t===null||!e.length)return[];var r=Math.ceil((t-i+3)*ch.ONE_SECOND_IN_TS),n;for(n=0;n<e.length&&!(e[n].pts>r);n++);return e.slice(n)},$U=function(e,t,i){if(!t.length)return e;if(i)return t.slice();var r=t[0].pts,n=0;for(n;n<e.length&&!(e[n].pts>=r);n++);return e.slice(0,n).concat(t)},jU=function(e,t,i,r){for(var n=Math.ceil((t-r)*ch.ONE_SECOND_IN_TS),a=Math.ceil((i-r)*ch.ONE_SECOND_IN_TS),o=e.slice(),l=e.length;l--&&!(e[l].pts<=a););if(l===-1)return o;for(var u=l+1;u--&&!(e[u].pts<=n););return u=Math.max(u,0),o.splice(u,l-u+1),o},qU=function(e,t){if(!e&&!t||!e&&t||e&&!t)return!1;if(e===t)return!0;var i=Object.keys(e).sort(),r=Object.keys(t).sort();if(i.length!==r.length)return!1;for(var n=0;n<i.length;n++){var a=i[n];if(a!==r[n]||e[a]!==t[a])return!1}return!0},_A=22,VU=function(e,t,i){t=t||[];for(var r=[],n=0,a=0;a<t.length;a++){var o=t[a];if(e===o.timeline&&(r.push(a),n+=o.duration,n>i))return a}return r.length===0?0:r[r.length-1]},bl=1,HU=500,Lb=function(e){return typeof e=="number"&&isFinite(e)},_c=1/60,zU=function(e,t,i){return e!=="main"||!t||!i?null:!i.hasAudio&&!i.hasVideo?"Neither audio nor video found in segment.":t.hasVideo&&!i.hasVideo?"Only audio found in segment when we expected video. We can't switch to audio only from a stream that had video. To get rid of this message, please add codec information to the manifest.":!t.hasVideo&&i.hasVideo?"Video found in segment when we expected only audio. We can't switch to a stream with video from an audio only stream. To get rid of this message, please add codec information to the manifest.":null},WU=function(e,t,i){var r=t-ti.BACK_BUFFER_LENGTH;e.length&&(r=Math.max(r,e.start(0)));var n=t-i;return Math.min(n,r)},$a=function(e){var t=e.startOfSegment,i=e.duration,r=e.segment,n=e.part,a=e.playlist,o=a.mediaSequence,l=a.id,u=a.segments,c=u===void 0?[]:u,h=e.mediaIndex,d=e.partIndex,g=e.timeline,y=c.length-1,p="mediaIndex/partIndex increment";e.getMediaInfoForTime?p="getMediaInfoForTime ("+e.getMediaInfoForTime+")":e.isSyncRequest&&(p="getSyncSegmentCandidate (isSyncRequest)"),e.independent&&(p+=" with independent "+e.independent);var _=typeof d=="number",k=e.segment.uri?"segment":"pre-segment",A=_?jk({preloadSegment:r})-1:0;return k+" ["+(o+h)+"/"+(o+y)+"]"+(_?" part ["+d+"/"+A+"]":"")+(" segment start/end ["+r.start+" => "+r.end+"]")+(_?" part start/end ["+n.start+" => "+n.end+"]":"")+(" startOfSegment ["+t+"]")+(" duration ["+i+"]")+(" timeline ["+g+"]")+(" selected by ["+p+"]")+(" playlist ["+l+"]")},Ob=function(e){return e+"TimingInfo"},GU=function(e){var t=e.segmentTimeline,i=e.currentTimeline,r=e.startOfSegment,n=e.buffered,a=e.overrideCheck;return!a&&t===i?null:t<i?r:n.length?n.end(n.length-1):r},Mb=function(e){var t=e.timelineChangeController,i=e.currentTimeline,r=e.segmentTimeline,n=e.loaderType,a=e.audioDisabled;if(i===r)return!1;if(n==="audio"){var o=t.lastTimelineChange({type:"main"});return!o||o.to!==r}if(n==="main"&&a){var l=t.pendingTimelineChange({type:"audio"});return!(l&&l.to===r)}return!1},KU=function(e){var t=0;return["video","audio"].forEach(function(i){var r=e[i+"TimingInfo"];if(r){var n=r.start,a=r.end,o;typeof n=="bigint"||typeof a=="bigint"?o=O.BigInt(a)-O.BigInt(n):typeof n=="number"&&typeof a=="number"&&(o=a-n),typeof o<"u"&&o>t&&(t=o)}}),typeof t=="bigint"&&t<Number.MAX_SAFE_INTEGER&&(t=Number(t)),t},Rb=function(e){var t=e.segmentDuration,i=e.maxDuration;return t?Math.round(t)>i+hs:!1},XU=function(e,t){if(t!=="hls")return null;var i=KU({audioTimingInfo:e.audioTimingInfo,videoTimingInfo:e.videoTimingInfo});if(!i)return null;var r=e.playlist.targetDuration,n=Rb({segmentDuration:i,maxDuration:r*2}),a=Rb({segmentDuration:i,maxDuration:r}),o="Segment with index "+e.mediaIndex+" "+("from playlist "+e.playlist.id+" ")+("has a duration of "+i+" ")+("when the reported duration is "+e.duration+" ")+("and the target duration is "+r+". ")+"For HLS content, a duration in excess of the target duration may result in playback issues. See the HLS specification section on EXT-X-TARGETDURATION for more details: https://tools.ietf.org/html/draft-pantos-http-live-streaming-23#section-4.3.3.1";return n||a?{severity:n?"warn":"info",message:o}:null},xv=function(s){Ce(e,s);function e(i,r){var n;if(n=s.call(this)||this,!i)throw new TypeError("Initialization settings are required");if(typeof i.currentTime!="function")throw new TypeError("No currentTime getter specified");if(!i.mediaSource)throw new TypeError("No MediaSource specified");return n.bandwidth=i.bandwidth,n.throughput={rate:0,count:0},n.roundTrip=NaN,n.resetStats_(),n.mediaIndex=null,n.partIndex=null,n.hasPlayed_=i.hasPlayed,n.currentTime_=i.currentTime,n.seekable_=i.seekable,n.seeking_=i.seeking,n.duration_=i.duration,n.mediaSource_=i.mediaSource,n.vhs_=i.vhs,n.loaderType_=i.loaderType,n.currentMediaInfo_=void 0,n.startingMediaInfo_=void 0,n.segmentMetadataTrack_=i.segmentMetadataTrack,n.goalBufferLength_=i.goalBufferLength,n.sourceType_=i.sourceType,n.sourceUpdater_=i.sourceUpdater,n.inbandTextTracks_=i.inbandTextTracks,n.state_="INIT",n.timelineChangeController_=i.timelineChangeController,n.shouldSaveSegmentTimingInfo_=!0,n.parse708captions_=i.parse708captions,n.useDtsForTimestampOffset_=i.useDtsForTimestampOffset,n.captionServices_=i.captionServices,n.experimentalExactManifestTimings=i.experimentalExactManifestTimings,n.checkBufferTimeout_=null,n.error_=void 0,n.currentTimeline_=-1,n.pendingSegment_=null,n.xhrOptions_=null,n.pendingSegments_=[],n.audioDisabled_=!1,n.isPendingTimestampOffset_=!1,n.gopBuffer_=[],n.timeMapping_=0,n.safeAppend_=ae.browser.IE_VERSION>=11,n.appendInitSegment_={audio:!0,video:!0},n.playlistOfLastInitSegment_={audio:null,video:null},n.callQueue_=[],n.loadQueue_=[],n.metadataQueue_={id3:[],caption:[]},n.waitingOnRemove_=!1,n.quotaExceededErrorRetryTimeout_=null,n.activeInitSegmentId_=null,n.initSegments_={},n.cacheEncryptionKeys_=i.cacheEncryptionKeys,n.keyCache_={},n.decrypter_=i.decrypter,n.syncController_=i.syncController,n.syncPoint_={segmentIndex:0,time:0},n.transmuxer_=n.createTransmuxer_(),n.triggerSyncInfoUpdate_=function(){return n.trigger("syncinfoupdate")},n.syncController_.on("syncinfoupdate",n.triggerSyncInfoUpdate_),n.mediaSource_.addEventListener("sourceopen",function(){n.isEndOfStream_()||(n.ended_=!1)}),n.fetchAtBuffer_=!1,n.logger_=Mr("SegmentLoader["+n.loaderType_+"]"),Object.defineProperty(We(n),"state",{get:function(){return this.state_},set:function(o){o!==this.state_&&(this.logger_(this.state_+" -> "+o),this.state_=o,this.trigger("statechange"))}}),n.sourceUpdater_.on("ready",function(){n.hasEnoughInfoToAppend_()&&n.processCallQueue_()}),n.loaderType_==="main"&&n.timelineChangeController_.on("pendingtimelinechange",function(){n.hasEnoughInfoToAppend_()&&n.processCallQueue_()}),n.loaderType_==="audio"&&n.timelineChangeController_.on("timelinechange",function(){n.hasEnoughInfoToLoad_()&&n.processLoadQueue_(),n.hasEnoughInfoToAppend_()&&n.processCallQueue_()}),n}var t=e.prototype;return t.createTransmuxer_=function(){return mp.createTransmuxer({remux:!1,alignGopsAtEnd:this.safeAppend_,keepOriginalTimestamps:!0,parse708captions:this.parse708captions_,captionServices:this.captionServices_})},t.resetStats_=function(){this.mediaBytesTransferred=0,this.mediaRequests=0,this.mediaRequestsAborted=0,this.mediaRequestsTimedout=0,this.mediaRequestsErrored=0,this.mediaTransferDuration=0,this.mediaSecondsLoaded=0,this.mediaAppends=0},t.dispose=function(){this.trigger("dispose"),this.state="DISPOSED",this.pause(),this.abort_(),this.transmuxer_&&this.transmuxer_.terminate(),this.resetStats_(),this.checkBufferTimeout_&&O.clearTimeout(this.checkBufferTimeout_),this.syncController_&&this.triggerSyncInfoUpdate_&&this.syncController_.off("syncinfoupdate",this.triggerSyncInfoUpdate_),this.off()},t.setAudio=function(r){this.audioDisabled_=!r,r?this.appendInitSegment_.audio=!0:this.sourceUpdater_.removeAudio(0,this.duration_())},t.abort=function(){if(this.state!=="WAITING"){this.pendingSegment_&&(this.pendingSegment_=null);return}this.abort_(),this.state="READY",this.paused()||this.monitorBuffer_()},t.abort_=function(){this.pendingSegment_&&this.pendingSegment_.abortRequests&&this.pendingSegment_.abortRequests(),this.pendingSegment_=null,this.callQueue_=[],this.loadQueue_=[],this.metadataQueue_.id3=[],this.metadataQueue_.caption=[],this.timelineChangeController_.clearPendingTimelineChange(this.loaderType_),this.waitingOnRemove_=!1,O.clearTimeout(this.quotaExceededErrorRetryTimeout_),this.quotaExceededErrorRetryTimeout_=null},t.checkForAbort_=function(r){return this.state==="APPENDING"&&!this.pendingSegment_?(this.state="READY",!0):!this.pendingSegment_||this.pendingSegment_.requestId!==r},t.error=function(r){return typeof r<"u"&&(this.logger_("error occurred:",r),this.error_=r),this.pendingSegment_=null,this.error_},t.endOfStream=function(){this.ended_=!0,this.transmuxer_&&mp.reset(this.transmuxer_),this.gopBuffer_.length=0,this.pause(),this.trigger("ended")},t.buffered_=function(){var r=this.getMediaInfo_();if(!this.sourceUpdater_||!r)return ae.createTimeRanges();if(this.loaderType_==="main"){var n=r.hasAudio,a=r.hasVideo,o=r.isMuxed;if(a&&n&&!this.audioDisabled_&&!o)return this.sourceUpdater_.buffered();if(a)return this.sourceUpdater_.videoBuffered()}return this.sourceUpdater_.audioBuffered()},t.initSegmentForMap=function(r,n){if(n===void 0&&(n=!1),!r)return null;var a=Sh(r),o=this.initSegments_[a];return n&&!o&&r.bytes&&(this.initSegments_[a]=o={resolvedUri:r.resolvedUri,byterange:r.byterange,bytes:r.bytes,tracks:r.tracks,timescales:r.timescales}),o||r},t.segmentKey=function(r,n){if(n===void 0&&(n=!1),!r)return null;var a=iA(r),o=this.keyCache_[a];this.cacheEncryptionKeys_&&n&&!o&&r.bytes&&(this.keyCache_[a]=o={resolvedUri:r.resolvedUri,bytes:r.bytes});var l={resolvedUri:(o||r).resolvedUri};return o&&(l.bytes=o.bytes),l},t.couldBeginLoading_=function(){return this.playlist_&&!this.paused()},t.load=function(){if(this.monitorBuffer_(),!!this.playlist_){if(this.state==="INIT"&&this.couldBeginLoading_())return this.init_();!this.couldBeginLoading_()||this.state!=="READY"&&this.state!=="INIT"||(this.state="READY")}},t.init_=function(){return this.state="READY",this.resetEverything(),this.monitorBuffer_()},t.playlist=function(r,n){if(n===void 0&&(n={}),!!r){var a=this.playlist_,o=this.pendingSegment_;this.playlist_=r,this.xhrOptions_=n,this.state==="INIT"&&(r.syncInfo={mediaSequence:r.mediaSequence,time:0},this.loaderType_==="main"&&this.syncController_.setDateTimeMappingForStart(r));var l=null;if(a&&(a.id?l=a.id:a.uri&&(l=a.uri)),this.logger_("playlist update ["+l+" => "+(r.id||r.uri)+"]"),this.trigger("syncinfoupdate"),this.state==="INIT"&&this.couldBeginLoading_())return this.init_();if(!a||a.uri!==r.uri){this.mediaIndex!==null&&(r.endList?this.resyncLoader():this.resetLoader()),this.currentMediaInfo_=void 0,this.trigger("playlistupdate");return}var u=r.mediaSequence-a.mediaSequence;if(this.logger_("live window shift ["+u+"]"),this.mediaIndex!==null)if(this.mediaIndex-=u,this.mediaIndex<0)this.mediaIndex=null,this.partIndex=null;else{var c=this.playlist_.segments[this.mediaIndex];if(this.partIndex&&(!c.parts||!c.parts.length||!c.parts[this.partIndex])){var h=this.mediaIndex;this.logger_("currently processing part (index "+this.partIndex+") no longer exists."),this.resetLoader(),this.mediaIndex=h}}o&&(o.mediaIndex-=u,o.mediaIndex<0?(o.mediaIndex=null,o.partIndex=null):(o.mediaIndex>=0&&(o.segment=r.segments[o.mediaIndex]),o.partIndex>=0&&o.segment.parts&&(o.part=o.segment.parts[o.partIndex]))),this.syncController_.saveExpiredSegmentInfo(a,r)}},t.pause=function(){this.checkBufferTimeout_&&(O.clearTimeout(this.checkBufferTimeout_),this.checkBufferTimeout_=null)},t.paused=function(){return this.checkBufferTimeout_===null},t.resetEverything=function(r){this.ended_=!1,this.activeInitSegmentId_=null,this.appendInitSegment_={audio:!0,video:!0},this.resetLoader(),this.remove(0,1/0,r),this.transmuxer_&&(this.transmuxer_.postMessage({action:"clearAllMp4Captions"}),this.transmuxer_.postMessage({action:"reset"}))},t.resetLoader=function(){this.fetchAtBuffer_=!1,this.resyncLoader()},t.resyncLoader=function(){this.transmuxer_&&mp.reset(this.transmuxer_),this.mediaIndex=null,this.partIndex=null,this.syncPoint_=null,this.isPendingTimestampOffset_=!1,this.callQueue_=[],this.loadQueue_=[],this.metadataQueue_.id3=[],this.metadataQueue_.caption=[],this.abort(),this.transmuxer_&&this.transmuxer_.postMessage({action:"clearParsedMp4Captions"})},t.remove=function(r,n,a,o){if(a===void 0&&(a=function(){}),o===void 0&&(o=!1),n===1/0&&(n=this.duration_()),n<=r){this.logger_("skipping remove because end ${end} is <= start ${start}");return}if(!this.sourceUpdater_||!this.getMediaInfo_()){this.logger_("skipping remove because no source updater or starting media info");return}var l=1,u=function(){l--,l===0&&a()};(o||!this.audioDisabled_)&&(l++,this.sourceUpdater_.removeAudio(r,n,u)),(o||this.loaderType_==="main")&&(this.gopBuffer_=jU(this.gopBuffer_,r,n,this.timeMapping_),l++,this.sourceUpdater_.removeVideo(r,n,u));for(var c in this.inbandTextTracks_)Dl(r,n,this.inbandTextTracks_[c]);Dl(r,n,this.segmentMetadataTrack_),u()},t.monitorBuffer_=function(){this.checkBufferTimeout_&&O.clearTimeout(this.checkBufferTimeout_),this.checkBufferTimeout_=O.setTimeout(this.monitorBufferTick_.bind(this),1)},t.monitorBufferTick_=function(){this.state==="READY"&&this.fillBuffer_(),this.checkBufferTimeout_&&O.clearTimeout(this.checkBufferTimeout_),this.checkBufferTimeout_=O.setTimeout(this.monitorBufferTick_.bind(this),HU)},t.fillBuffer_=function(){if(!this.sourceUpdater_.updating()){var r=this.chooseNextRequest_();r&&(typeof r.timestampOffset=="number"&&(this.isPendingTimestampOffset_=!1,this.timelineChangeController_.pendingTimelineChange({type:this.loaderType_,from:this.currentTimeline_,to:r.timeline})),this.loadSegment_(r))}},t.isEndOfStream_=function(r,n,a){if(r===void 0&&(r=this.mediaIndex),n===void 0&&(n=this.playlist_),a===void 0&&(a=this.partIndex),!n||!this.mediaSource_)return!1;var o=typeof r=="number"&&n.segments[r],l=r+1===n.segments.length,u=!o||!o.parts||a+1===o.parts.length;return n.endList&&this.mediaSource_.readyState==="open"&&l&&u},t.chooseNextRequest_=function(){var r=this.buffered_(),n=xb(r)||0,a=sy(r,this.currentTime_()),o=!this.hasPlayed_()&&a>=1,l=a>=this.goalBufferLength_(),u=this.playlist_.segments;if(!u.length||o||l)return null;this.syncPoint_=this.syncPoint_||this.syncController_.getSyncPoint(this.playlist_,this.duration_(),this.currentTimeline_,this.currentTime_());var c={partIndex:null,mediaIndex:null,startOfSegment:null,playlist:this.playlist_,isSyncRequest:!this.syncPoint_};if(c.isSyncRequest)c.mediaIndex=VU(this.currentTimeline_,u,n);else if(this.mediaIndex!==null){var h=u[this.mediaIndex],d=typeof this.partIndex=="number"?this.partIndex:-1;c.startOfSegment=h.end?h.end:n,h.parts&&h.parts[d+1]?(c.mediaIndex=this.mediaIndex,c.partIndex=d+1):c.mediaIndex=this.mediaIndex+1}else{var g=Vi.getMediaInfoForTime({experimentalExactManifestTimings:this.experimentalExactManifestTimings,playlist:this.playlist_,currentTime:this.fetchAtBuffer_?n:this.currentTime_(),startingPartIndex:this.syncPoint_.partIndex,startingSegmentIndex:this.syncPoint_.segmentIndex,startTime:this.syncPoint_.time}),y=g.segmentIndex,p=g.startTime,_=g.partIndex;c.getMediaInfoForTime=this.fetchAtBuffer_?"bufferedEnd "+n:"currentTime "+this.currentTime_(),c.mediaIndex=y,c.startOfSegment=p,c.partIndex=_}var k=u[c.mediaIndex],A=k&&typeof c.partIndex=="number"&&k.parts&&k.parts[c.partIndex];if(!k||typeof c.partIndex=="number"&&!A)return null;if(typeof c.partIndex!="number"&&k.parts&&(c.partIndex=0,A=k.parts[0]),!a&&A&&!A.independent)if(c.partIndex===0){var N=u[c.mediaIndex-1],$=N.parts&&N.parts.length&&N.parts[N.parts.length-1];$&&$.independent&&(c.mediaIndex-=1,c.partIndex=N.parts.length-1,c.independent="previous segment")}else k.parts[c.partIndex-1].independent&&(c.partIndex-=1,c.independent="previous part");var R=this.mediaSource_&&this.mediaSource_.readyState==="ended";return c.mediaIndex>=u.length-1&&R&&!this.seeking_()?null:this.generateSegmentInfo_(c)},t.generateSegmentInfo_=function(r){var n=r.independent,a=r.playlist,o=r.mediaIndex,l=r.startOfSegment,u=r.isSyncRequest,c=r.partIndex,h=r.forceTimestampOffset,d=r.getMediaInfoForTime,g=a.segments[o],y=typeof c=="number"&&g.parts[c],p={requestId:"segment-loader-"+Math.random(),uri:y&&y.resolvedUri||g.resolvedUri,mediaIndex:o,partIndex:y?c:null,isSyncRequest:u,startOfSegment:l,playlist:a,bytes:null,encryptedBytes:null,timestampOffset:null,timeline:g.timeline,duration:y&&y.duration||g.duration,segment:g,part:y,byteLength:0,transmuxer:this.transmuxer_,getMediaInfoForTime:d,independent:n},_=typeof h<"u"?h:this.isPendingTimestampOffset_;p.timestampOffset=this.timestampOffsetForSegment_({segmentTimeline:g.timeline,currentTimeline:this.currentTimeline_,startOfSegment:l,buffered:this.buffered_(),overrideCheck:_});var k=xb(this.sourceUpdater_.audioBuffered());return typeof k=="number"&&(p.audioAppendStart=k-this.sourceUpdater_.audioTimestampOffset()),this.sourceUpdater_.videoBuffered().length&&(p.gopsToAlignWith=UU(this.gopBuffer_,this.currentTime_()-this.sourceUpdater_.videoTimestampOffset(),this.timeMapping_)),p},t.timestampOffsetForSegment_=function(r){return GU(r)},t.earlyAbortWhenNeeded_=function(r){if(!(this.vhs_.tech_.paused()||!this.xhrOptions_.timeout||!this.playlist_.attributes.BANDWIDTH)&&!(Date.now()-(r.firstBytesReceivedAt||Date.now())<1e3)){var n=this.currentTime_(),a=r.bandwidth,o=this.pendingSegment_.duration,l=Vi.estimateSegmentRequestTime(o,a,this.playlist_,r.bytesReceived),u=g8(this.buffered_(),n,this.vhs_.tech_.playbackRate())-1;if(!(l<=u)){var c=PU({master:this.vhs_.playlists.master,currentTime:n,bandwidth:a,duration:this.duration_(),segmentDuration:o,timeUntilRebuffer:u,currentTimeline:this.currentTimeline_,syncController:this.syncController_});if(c){var h=l-u,d=h-c.rebufferingImpact,g=.5;u<=hs&&(g=1),!(!c.playlist||c.playlist.uri===this.playlist_.uri||d<g)&&(this.bandwidth=c.playlist.attributes.BANDWIDTH*ti.BANDWIDTH_VARIANCE+1,this.trigger("earlyabort"))}}}},t.handleAbort_=function(r){this.logger_("Aborting "+$a(r)),this.mediaRequestsAborted+=1},t.handleProgress_=function(r,n){this.earlyAbortWhenNeeded_(n.stats),!this.checkForAbort_(n.requestId)&&this.trigger("progress")},t.handleTrackInfo_=function(r,n){this.earlyAbortWhenNeeded_(r.stats),!this.checkForAbort_(r.requestId)&&(this.checkForIllegalMediaSwitch(n)||(n=n||{},qU(this.currentMediaInfo_,n)||(this.appendInitSegment_={audio:!0,video:!0},this.startingMediaInfo_=n,this.currentMediaInfo_=n,this.logger_("trackinfo update",n),this.trigger("trackinfo")),!this.checkForAbort_(r.requestId)&&(this.pendingSegment_.trackInfo=n,this.hasEnoughInfoToAppend_()&&this.processCallQueue_())))},t.handleTimingInfo_=function(r,n,a,o){if(this.earlyAbortWhenNeeded_(r.stats),!this.checkForAbort_(r.requestId)){var l=this.pendingSegment_,u=Ob(n);l[u]=l[u]||{},l[u][a]=o,this.logger_("timinginfo: "+n+" - "+a+" - "+o),this.hasEnoughInfoToAppend_()&&this.processCallQueue_()}},t.handleCaptions_=function(r,n){var a=this;if(this.earlyAbortWhenNeeded_(r.stats),!this.checkForAbort_(r.requestId)){if(n.length===0){this.logger_("SegmentLoader received no captions from a caption event");return}var o=this.pendingSegment_;if(!o.hasAppendedData_){this.metadataQueue_.caption.push(this.handleCaptions_.bind(this,r,n));return}var l=this.sourceUpdater_.videoTimestampOffset()===null?this.sourceUpdater_.audioTimestampOffset():this.sourceUpdater_.videoTimestampOffset(),u={};n.forEach(function(c){u[c.stream]=u[c.stream]||{startTime:1/0,captions:[],endTime:0};var h=u[c.stream];h.startTime=Math.min(h.startTime,c.startTime+l),h.endTime=Math.max(h.endTime,c.endTime+l),h.captions.push(c)}),Object.keys(u).forEach(function(c){var h=u[c],d=h.startTime,g=h.endTime,y=h.captions,p=a.inbandTextTracks_;a.logger_("adding cues from "+d+" -> "+g+" for "+c),LU(p,a.vhs_.tech_,c),Dl(d,g,p[c]),OU({captionArray:y,inbandTextTracks:p,timestampOffset:l})}),this.transmuxer_&&this.transmuxer_.postMessage({action:"clearParsedMp4Captions"})}},t.handleId3_=function(r,n,a){if(this.earlyAbortWhenNeeded_(r.stats),!this.checkForAbort_(r.requestId)){var o=this.pendingSegment_;if(!o.hasAppendedData_){this.metadataQueue_.id3.push(this.handleId3_.bind(this,r,n,a));return}var l=this.sourceUpdater_.videoTimestampOffset()===null?this.sourceUpdater_.audioTimestampOffset():this.sourceUpdater_.videoTimestampOffset();FU(this.inbandTextTracks_,a,this.vhs_.tech_),RU({inbandTextTracks:this.inbandTextTracks_,metadataArray:n,timestampOffset:l,videoDuration:this.duration_()})}},t.processMetadataQueue_=function(){this.metadataQueue_.id3.forEach(function(r){return r()}),this.metadataQueue_.caption.forEach(function(r){return r()}),this.metadataQueue_.id3=[],this.metadataQueue_.caption=[]},t.processCallQueue_=function(){var r=this.callQueue_;this.callQueue_=[],r.forEach(function(n){return n()})},t.processLoadQueue_=function(){var r=this.loadQueue_;this.loadQueue_=[],r.forEach(function(n){return n()})},t.hasEnoughInfoToLoad_=function(){if(this.loaderType_!=="audio")return!0;var r=this.pendingSegment_;return r?this.getCurrentMediaInfo_()?!Mb({timelineChangeController:this.timelineChangeController_,currentTimeline:this.currentTimeline_,segmentTimeline:r.timeline,loaderType:this.loaderType_,audioDisabled:this.audioDisabled_}):!0:!1},t.getCurrentMediaInfo_=function(r){return r===void 0&&(r=this.pendingSegment_),r&&r.trackInfo||this.currentMediaInfo_},t.getMediaInfo_=function(r){return r===void 0&&(r=this.pendingSegment_),this.getCurrentMediaInfo_(r)||this.startingMediaInfo_},t.getPendingSegmentPlaylist=function(){return this.pendingSegment_?this.pendingSegment_.playlist:null},t.hasEnoughInfoToAppend_=function(){if(!this.sourceUpdater_.ready()||this.waitingOnRemove_||this.quotaExceededErrorRetryTimeout_)return!1;var r=this.pendingSegment_,n=this.getCurrentMediaInfo_();if(!r||!n)return!1;var a=n.hasAudio,o=n.hasVideo,l=n.isMuxed;return!(o&&!r.videoTimingInfo||a&&!this.audioDisabled_&&!l&&!r.audioTimingInfo||Mb({timelineChangeController:this.timelineChangeController_,currentTimeline:this.currentTimeline_,segmentTimeline:r.timeline,loaderType:this.loaderType_,audioDisabled:this.audioDisabled_}))},t.handleData_=function(r,n){if(this.earlyAbortWhenNeeded_(r.stats),!this.checkForAbort_(r.requestId)){if(this.callQueue_.length||!this.hasEnoughInfoToAppend_()){this.callQueue_.push(this.handleData_.bind(this,r,n));return}var a=this.pendingSegment_;if(this.setTimeMapping_(a.timeline),this.updateMediaSecondsLoaded_(a.part||a.segment),this.mediaSource_.readyState!=="closed"){if(r.map&&(r.map=this.initSegmentForMap(r.map,!0),a.segment.map=r.map),r.key&&this.segmentKey(r.key,!0),a.isFmp4=r.isFmp4,a.timingInfo=a.timingInfo||{},a.isFmp4)this.trigger("fmp4"),a.timingInfo.start=a[Ob(n.type)].start;else{var o=this.getCurrentMediaInfo_(),l=this.loaderType_==="main"&&o&&o.hasVideo,u;l&&(u=a.videoTimingInfo.start),a.timingInfo.start=this.trueSegmentStart_({currentStart:a.timingInfo.start,playlist:a.playlist,mediaIndex:a.mediaIndex,currentVideoTimestampOffset:this.sourceUpdater_.videoTimestampOffset(),useVideoTimingInfo:l,firstVideoFrameTimeForData:u,videoTimingInfo:a.videoTimingInfo,audioTimingInfo:a.audioTimingInfo})}if(this.updateAppendInitSegmentStatus(a,n.type),this.updateSourceBufferTimestampOffset_(a),a.isSyncRequest){this.updateTimingInfoEnd_(a),this.syncController_.saveSegmentTimingInfo({segmentInfo:a,shouldSaveTimelineMapping:this.loaderType_==="main"});var c=this.chooseNextRequest_();if(c.mediaIndex!==a.mediaIndex||c.partIndex!==a.partIndex){this.logger_("sync segment was incorrect, not appending");return}this.logger_("sync segment was correct, appending")}a.hasAppendedData_=!0,this.processMetadataQueue_(),this.appendData_(a,n)}}},t.updateAppendInitSegmentStatus=function(r,n){this.loaderType_==="main"&&typeof r.timestampOffset=="number"&&!r.changedTimestampOffset&&(this.appendInitSegment_={audio:!0,video:!0}),this.playlistOfLastInitSegment_[n]!==r.playlist&&(this.appendInitSegment_[n]=!0)},t.getInitSegmentAndUpdateState_=function(r){var n=r.type,a=r.initSegment,o=r.map,l=r.playlist;if(o){var u=Sh(o);if(this.activeInitSegmentId_===u)return null;a=this.initSegmentForMap(o,!0).bytes,this.activeInitSegmentId_=u}return a&&this.appendInitSegment_[n]?(this.playlistOfLastInitSegment_[n]=l,this.appendInitSegment_[n]=!1,this.activeInitSegmentId_=null,a):null},t.handleQuotaExceededError_=function(r,n){var a=this,o=r.segmentInfo,l=r.type,u=r.bytes,c=this.sourceUpdater_.audioBuffered(),h=this.sourceUpdater_.videoBuffered();c.length>1&&this.logger_("On QUOTA_EXCEEDED_ERR, found gaps in the audio buffer: "+Hs(c).join(", ")),h.length>1&&this.logger_("On QUOTA_EXCEEDED_ERR, found gaps in the video buffer: "+Hs(h).join(", "));var d=c.length?c.start(0):0,g=c.length?c.end(c.length-1):0,y=h.length?h.start(0):0,p=h.length?h.end(h.length-1):0;if(g-d<=bl&&p-y<=bl){this.logger_("On QUOTA_EXCEEDED_ERR, single segment too large to append to buffer, triggering an error. "+("Appended byte length: "+u.byteLength+", ")+("audio buffer: "+Hs(c).join(", ")+", ")+("video buffer: "+Hs(h).join(", ")+", ")),this.error({message:"Quota exceeded error with append of a single segment of content",excludeUntil:1/0}),this.trigger("error");return}this.waitingOnRemove_=!0,this.callQueue_.push(this.appendToSourceBuffer_.bind(this,{segmentInfo:o,type:l,bytes:u}));var _=this.currentTime_(),k=_-bl;this.logger_("On QUOTA_EXCEEDED_ERR, removing audio/video from 0 to "+k),this.remove(0,k,function(){a.logger_("On QUOTA_EXCEEDED_ERR, retrying append in "+bl+"s"),a.waitingOnRemove_=!1,a.quotaExceededErrorRetryTimeout_=O.setTimeout(function(){a.logger_("On QUOTA_EXCEEDED_ERR, re-processing call queue"),a.quotaExceededErrorRetryTimeout_=null,a.processCallQueue_()},bl*1e3)},!0)},t.handleAppendError_=function(r,n){var a=r.segmentInfo,o=r.type,l=r.bytes;if(n){if(n.code===_A){this.handleQuotaExceededError_({segmentInfo:a,type:o,bytes:l});return}this.logger_("Received non QUOTA_EXCEEDED_ERR on append",n),this.error(o+" append of "+l.length+"b failed for segment "+("#"+a.mediaIndex+" in playlist "+a.playlist.id)),this.trigger("appenderror")}},t.appendToSourceBuffer_=function(r){var n=r.segmentInfo,a=r.type,o=r.initSegment,l=r.data,u=r.bytes;if(!u){var c=[l],h=l.byteLength;o&&(c.unshift(o),h+=o.byteLength),u=NU({bytes:h,segments:c})}this.sourceUpdater_.appendBuffer({segmentInfo:n,type:a,bytes:u},this.handleAppendError_.bind(this,{segmentInfo:n,type:a,bytes:u}))},t.handleSegmentTimingInfo_=function(r,n,a){if(!(!this.pendingSegment_||n!==this.pendingSegment_.requestId)){var o=this.pendingSegment_.segment,l=r+"TimingInfo";o[l]||(o[l]={}),o[l].transmuxerPrependedSeconds=a.prependedContentDuration||0,o[l].transmuxedPresentationStart=a.start.presentation,o[l].transmuxedDecodeStart=a.start.decode,o[l].transmuxedPresentationEnd=a.end.presentation,o[l].transmuxedDecodeEnd=a.end.decode,o[l].baseMediaDecodeTime=a.baseMediaDecodeTime}},t.appendData_=function(r,n){var a=n.type,o=n.data;if(!(!o||!o.byteLength)&&!(a==="audio"&&this.audioDisabled_)){var l=this.getInitSegmentAndUpdateState_({type:a,initSegment:n.initSegment,playlist:r.playlist,map:r.isFmp4?r.segment.map:null});this.appendToSourceBuffer_({segmentInfo:r,type:a,initSegment:l,data:o})}},t.loadSegment_=function(r){var n=this;if(this.state="WAITING",this.pendingSegment_=r,this.trimBackBuffer_(r),typeof r.timestampOffset=="number"&&this.transmuxer_&&this.transmuxer_.postMessage({action:"clearAllMp4Captions"}),!this.hasEnoughInfoToLoad_()){this.loadQueue_.push(function(){var a=ft({},r,{forceTimestampOffset:!0});ft(r,n.generateSegmentInfo_(a)),n.isPendingTimestampOffset_=!1,n.updateTransmuxerAndRequestSegment_(r)});return}this.updateTransmuxerAndRequestSegment_(r)},t.updateTransmuxerAndRequestSegment_=function(r){var n=this;this.shouldUpdateTransmuxerTimestampOffset_(r.timestampOffset)&&(this.gopBuffer_.length=0,r.gopsToAlignWith=[],this.timeMapping_=0,this.transmuxer_.postMessage({action:"reset"}),this.transmuxer_.postMessage({action:"setTimestampOffset",timestampOffset:r.timestampOffset}));var a=this.createSimplifiedSegmentObj_(r),o=this.isEndOfStream_(r.mediaIndex,r.playlist,r.partIndex),l=this.mediaIndex!==null,u=r.timeline!==this.currentTimeline_&&r.timeline>0,c=o||l&&u;this.logger_("Requesting "+$a(r)),a.map&&!a.map.bytes&&(this.logger_("going to request init segment."),this.appendInitSegment_={video:!0,audio:!0}),r.abortRequests=CU({xhr:this.vhs_.xhr,xhrOptions:this.xhrOptions_,decryptionWorker:this.decrypter_,segment:a,abortFn:this.handleAbort_.bind(this,r),progressFn:this.handleProgress_.bind(this),trackInfoFn:this.handleTrackInfo_.bind(this),timingInfoFn:this.handleTimingInfo_.bind(this),videoSegmentTimingInfoFn:this.handleSegmentTimingInfo_.bind(this,"video",r.requestId),audioSegmentTimingInfoFn:this.handleSegmentTimingInfo_.bind(this,"audio",r.requestId),captionsFn:this.handleCaptions_.bind(this),isEndOfTimeline:c,endedTimelineFn:function(){n.logger_("received endedtimeline callback")},id3Fn:this.handleId3_.bind(this),dataFn:this.handleData_.bind(this),doneFn:this.segmentRequestFinished_.bind(this),onTransmuxerLog:function(d){var g=d.message,y=d.level,p=d.stream;n.logger_($a(r)+" logged from transmuxer stream "+p+" as a "+y+": "+g)}})},t.trimBackBuffer_=function(r){var n=WU(this.seekable_(),this.currentTime_(),this.playlist_.targetDuration||10);n>0&&this.remove(0,n)},t.createSimplifiedSegmentObj_=function(r){var n=r.segment,a=r.part,o={resolvedUri:a?a.resolvedUri:n.resolvedUri,byterange:a?a.byterange:n.byterange,requestId:r.requestId,transmuxer:r.transmuxer,audioAppendStart:r.audioAppendStart,gopsToAlignWith:r.gopsToAlignWith,part:r.part},l=r.playlist.segments[r.mediaIndex-1];if(l&&l.timeline===n.timeline&&(l.videoTimingInfo?o.baseStartTime=l.videoTimingInfo.transmuxedDecodeEnd:l.audioTimingInfo&&(o.baseStartTime=l.audioTimingInfo.transmuxedDecodeEnd)),n.key){var u=n.key.iv||new Uint32Array([0,0,0,r.mediaIndex+r.playlist.mediaSequence]);o.key=this.segmentKey(n.key),o.key.iv=u}return n.map&&(o.map=this.initSegmentForMap(n.map)),o},t.saveTransferStats_=function(r){this.mediaRequests+=1,r&&(this.mediaBytesTransferred+=r.bytesReceived,this.mediaTransferDuration+=r.roundTripTime)},t.saveBandwidthRelatedStats_=function(r,n){if(this.pendingSegment_.byteLength=n.bytesReceived,r<_c){this.logger_("Ignoring segment's bandwidth because its duration of "+r+(" is less than the min to record "+_c));return}this.bandwidth=n.bandwidth,this.roundTrip=n.roundTripTime},t.handleTimeout_=function(){this.mediaRequestsTimedout+=1,this.bandwidth=1,this.roundTrip=NaN,this.trigger("bandwidthupdate"),this.trigger("timeout")},t.segmentRequestFinished_=function(r,n,a){if(this.callQueue_.length){this.callQueue_.push(this.segmentRequestFinished_.bind(this,r,n,a));return}if(this.saveTransferStats_(n.stats),!!this.pendingSegment_&&n.requestId===this.pendingSegment_.requestId){if(r){if(this.pendingSegment_=null,this.state="READY",r.code===Zr.ABORTED)return;if(this.pause(),r.code===Zr.TIMEOUT){this.handleTimeout_();return}this.mediaRequestsErrored+=1,this.error(r),this.trigger("error");return}var o=this.pendingSegment_;this.saveBandwidthRelatedStats_(o.duration,n.stats),o.endOfAllRequests=n.endOfAllRequests,a.gopInfo&&(this.gopBuffer_=$U(this.gopBuffer_,a.gopInfo,this.safeAppend_)),this.state="APPENDING",this.trigger("appending"),this.waitForAppendsToComplete_(o)}},t.setTimeMapping_=function(r){var n=this.syncController_.mappingForTimeline(r);n!==null&&(this.timeMapping_=n)},t.updateMediaSecondsLoaded_=function(r){typeof r.start=="number"&&typeof r.end=="number"?this.mediaSecondsLoaded+=r.end-r.start:this.mediaSecondsLoaded+=r.duration},t.shouldUpdateTransmuxerTimestampOffset_=function(r){return r===null?!1:this.loaderType_==="main"&&r!==this.sourceUpdater_.videoTimestampOffset()||!this.audioDisabled_&&r!==this.sourceUpdater_.audioTimestampOffset()},t.trueSegmentStart_=function(r){var n=r.currentStart,a=r.playlist,o=r.mediaIndex,l=r.firstVideoFrameTimeForData,u=r.currentVideoTimestampOffset,c=r.useVideoTimingInfo,h=r.videoTimingInfo,d=r.audioTimingInfo;if(typeof n<"u")return n;if(!c)return d.start;var g=a.segments[o-1];return o===0||!g||typeof g.start>"u"||g.end!==l+u?l:h.start},t.waitForAppendsToComplete_=function(r){var n=this.getCurrentMediaInfo_(r);if(!n){this.error({message:"No starting media returned, likely due to an unsupported media format.",blacklistDuration:1/0}),this.trigger("error");return}var a=n.hasAudio,o=n.hasVideo,l=n.isMuxed,u=this.loaderType_==="main"&&o,c=!this.audioDisabled_&&a&&!l;if(r.waitingOnAppends=0,!r.hasAppendedData_){!r.timingInfo&&typeof r.timestampOffset=="number"&&(this.isPendingTimestampOffset_=!0),r.timingInfo={start:0},r.waitingOnAppends++,this.isPendingTimestampOffset_||(this.updateSourceBufferTimestampOffset_(r),this.processMetadataQueue_()),this.checkAppendsDone_(r);return}u&&r.waitingOnAppends++,c&&r.waitingOnAppends++,u&&this.sourceUpdater_.videoQueueCallback(this.checkAppendsDone_.bind(this,r)),c&&this.sourceUpdater_.audioQueueCallback(this.checkAppendsDone_.bind(this,r))},t.checkAppendsDone_=function(r){this.checkForAbort_(r.requestId)||(r.waitingOnAppends--,r.waitingOnAppends===0&&this.handleAppendsDone_())},t.checkForIllegalMediaSwitch=function(r){var n=zU(this.loaderType_,this.getCurrentMediaInfo_(),r);return n?(this.error({message:n,blacklistDuration:1/0}),this.trigger("error"),!0):!1},t.updateSourceBufferTimestampOffset_=function(r){if(!(r.timestampOffset===null||typeof r.timingInfo.start!="number"||r.changedTimestampOffset||this.loaderType_!=="main")){var n=!1;r.timestampOffset-=this.getSegmentStartTimeForTimestampOffsetCalculation_({videoTimingInfo:r.segment.videoTimingInfo,audioTimingInfo:r.segment.audioTimingInfo,timingInfo:r.timingInfo}),r.changedTimestampOffset=!0,r.timestampOffset!==this.sourceUpdater_.videoTimestampOffset()&&(this.sourceUpdater_.videoTimestampOffset(r.timestampOffset),n=!0),r.timestampOffset!==this.sourceUpdater_.audioTimestampOffset()&&(this.sourceUpdater_.audioTimestampOffset(r.timestampOffset),n=!0),n&&this.trigger("timestampoffset")}},t.getSegmentStartTimeForTimestampOffsetCalculation_=function(r){var n=r.videoTimingInfo,a=r.audioTimingInfo,o=r.timingInfo;return this.useDtsForTimestampOffset_?n&&typeof n.transmuxedDecodeStart=="number"?n.transmuxedDecodeStart:a&&typeof a.transmuxedDecodeStart=="number"?a.transmuxedDecodeStart:o.start:o.start},t.updateTimingInfoEnd_=function(r){r.timingInfo=r.timingInfo||{};var n=this.getMediaInfo_(),a=this.loaderType_==="main"&&n&&n.hasVideo,o=a&&r.videoTimingInfo?r.videoTimingInfo:r.audioTimingInfo;o&&(r.timingInfo.end=typeof o.end=="number"?o.end:o.start+r.duration)},t.handleAppendsDone_=function(){if(this.pendingSegment_&&this.trigger("appendsdone"),!this.pendingSegment_){this.state="READY",this.paused()||this.monitorBuffer_();return}var r=this.pendingSegment_;this.updateTimingInfoEnd_(r),this.shouldSaveSegmentTimingInfo_&&this.syncController_.saveSegmentTimingInfo({segmentInfo:r,shouldSaveTimelineMapping:this.loaderType_==="main"});var n=XU(r,this.sourceType_);if(n&&(n.severity==="warn"?ae.log.warn(n.message):this.logger_(n.message)),this.recordThroughput_(r),this.pendingSegment_=null,this.state="READY",r.isSyncRequest&&(this.trigger("syncinfoupdate"),!r.hasAppendedData_)){this.logger_("Throwing away un-appended sync request "+$a(r));return}this.logger_("Appended "+$a(r)),this.addSegmentMetadataCue_(r),this.fetchAtBuffer_=!0,this.currentTimeline_!==r.timeline&&(this.timelineChangeController_.lastTimelineChange({type:this.loaderType_,from:this.currentTimeline_,to:r.timeline}),this.loaderType_==="main"&&!this.audioDisabled_&&this.timelineChangeController_.lastTimelineChange({type:"audio",from:this.currentTimeline_,to:r.timeline})),this.currentTimeline_=r.timeline,this.trigger("syncinfoupdate");var a=r.segment,o=r.part,l=a.end&&this.currentTime_()-a.end>r.playlist.targetDuration*3,u=o&&o.end&&this.currentTime_()-o.end>r.playlist.partTargetDuration*3;if(l||u){this.logger_("bad "+(l?"segment":"part")+" "+$a(r)),this.resetEverything();return}var c=this.mediaIndex!==null;c&&this.trigger("bandwidthupdate"),this.trigger("progress"),this.mediaIndex=r.mediaIndex,this.partIndex=r.partIndex,this.isEndOfStream_(r.mediaIndex,r.playlist,r.partIndex)&&this.endOfStream(),this.trigger("appended"),r.hasAppendedData_&&this.mediaAppends++,this.paused()||this.monitorBuffer_()},t.recordThroughput_=function(r){if(r.duration<_c){this.logger_("Ignoring segment's throughput because its duration of "+r.duration+(" is less than the min to record "+_c));return}var n=this.throughput.rate,a=Date.now()-r.endOfAllRequests+1,o=Math.floor(r.byteLength/a*8*1e3);this.throughput.rate+=(o-n)/++this.throughput.count},t.addSegmentMetadataCue_=function(r){if(this.segmentMetadataTrack_){var n=r.segment,a=n.start,o=n.end;if(!(!Lb(a)||!Lb(o))){Dl(a,o,this.segmentMetadataTrack_);var l=O.WebKitDataCue||O.VTTCue,u={custom:n.custom,dateTimeObject:n.dateTimeObject,dateTimeString:n.dateTimeString,bandwidth:r.playlist.attributes.BANDWIDTH,resolution:r.playlist.attributes.RESOLUTION,codecs:r.playlist.attributes.CODECS,byteLength:r.byteLength,uri:r.uri,timeline:r.timeline,playlist:r.playlist.id,start:a,end:o},c=JSON.stringify(u),h=new l(a,o,c);h.value=u,this.segmentMetadataTrack_.addCue(h)}}},e}(ae.EventTarget);function kn(){}var TA=function(e){return typeof e!="string"?e:e.replace(/./,function(t){return t.toUpperCase()})},QU=["video","audio"],Cv=function(e,t){var i=t[e+"Buffer"];return i&&i.updating||t.queuePending[e]},YU=function(e,t){for(var i=0;i<t.length;i++){var r=t[i];if(r.type==="mediaSource")return null;if(r.type===e)return i}return null},dy=function s(e,t){if(t.queue.length!==0){var i=0,r=t.queue[i];if(r.type==="mediaSource"){!t.updating()&&t.mediaSource.readyState!=="closed"&&(t.queue.shift(),r.action(t),r.doneFn&&r.doneFn(),s("audio",t),s("video",t));return}if(e!=="mediaSource"&&!(!t.ready()||t.mediaSource.readyState==="closed"||Cv(e,t))){if(r.type!==e){if(i=YU(e,t.queue),i===null)return;r=t.queue[i]}if(t.queue.splice(i,1),t.queuePending[e]=r,r.action(e,t),!r.doneFn){t.queuePending[e]=null,s(e,t);return}}}},bA=function(e,t){var i=t[e+"Buffer"],r=TA(e);i&&(i.removeEventListener("updateend",t["on"+r+"UpdateEnd_"]),i.removeEventListener("error",t["on"+r+"Error_"]),t.codecs[e]=null,t[e+"Buffer"]=null)},Wr=function(e,t){return e&&t&&Array.prototype.indexOf.call(e.sourceBuffers,t)!==-1},ir={appendBuffer:function(e,t,i){return function(r,n){var a=n[r+"Buffer"];if(Wr(n.mediaSource,a)){n.logger_("Appending segment "+t.mediaIndex+"'s "+e.length+" bytes to "+r+"Buffer");try{a.appendBuffer(e)}catch(o){n.logger_("Error with code "+o.code+" "+(o.code===_A?"(QUOTA_EXCEEDED_ERR) ":"")+("when appending segment "+t.mediaIndex+" to "+r+"Buffer")),n.queuePending[r]=null,i(o)}}}},remove:function(e,t){return function(i,r){var n=r[i+"Buffer"];if(Wr(r.mediaSource,n)){r.logger_("Removing "+e+" to "+t+" from "+i+"Buffer");try{n.remove(e,t)}catch{r.logger_("Remove "+e+" to "+t+" from "+i+"Buffer failed")}}}},timestampOffset:function(e){return function(t,i){var r=i[t+"Buffer"];Wr(i.mediaSource,r)&&(i.logger_("Setting "+t+"timestampOffset to "+e),r.timestampOffset=e)}},callback:function(e){return function(t,i){e()}},endOfStream:function(e){return function(t){if(t.mediaSource.readyState==="open"){t.logger_("Calling mediaSource endOfStream("+(e||"")+")");try{t.mediaSource.endOfStream(e)}catch(i){ae.log.warn("Failed to call media source endOfStream",i)}}}},duration:function(e){return function(t){t.logger_("Setting mediaSource duration to "+e);try{t.mediaSource.duration=e}catch(i){ae.log.warn("Failed to set media source duration",i)}}},abort:function(){return function(e,t){if(t.mediaSource.readyState==="open"){var i=t[e+"Buffer"];if(Wr(t.mediaSource,i)){t.logger_("calling abort on "+e+"Buffer");try{i.abort()}catch(r){ae.log.warn("Failed to abort on "+e+"Buffer",r)}}}}},addSourceBuffer:function(e,t){return function(i){var r=TA(e),n=Ql(t);i.logger_("Adding "+e+"Buffer with codec "+t+" to mediaSource");var a=i.mediaSource.addSourceBuffer(n);a.addEventListener("updateend",i["on"+r+"UpdateEnd_"]),a.addEventListener("error",i["on"+r+"Error_"]),i.codecs[e]=t,i[e+"Buffer"]=a}},removeSourceBuffer:function(e){return function(t){var i=t[e+"Buffer"];if(bA(e,t),!!Wr(t.mediaSource,i)){t.logger_("Removing "+e+"Buffer with codec "+t.codecs[e]+" from mediaSource");try{t.mediaSource.removeSourceBuffer(i)}catch(r){ae.log.warn("Failed to removeSourceBuffer "+e+"Buffer",r)}}}},changeType:function(e){return function(t,i){var r=i[t+"Buffer"],n=Ql(e);if(Wr(i.mediaSource,r)&&i.codecs[t]!==e){i.logger_("changing "+t+"Buffer codec from "+i.codecs[t]+" to "+e);try{r.changeType(n),i.codecs[t]=e}catch(a){ae.log.warn("Failed to changeType on "+t+"Buffer",a)}}}}},rr=function(e){var t=e.type,i=e.sourceUpdater,r=e.action,n=e.doneFn,a=e.name;i.queue.push({type:t,action:r,doneFn:n,name:a}),dy(t,i)},Fb=function(e,t){return function(i){if(t.queuePending[e]){var r=t.queuePending[e].doneFn;t.queuePending[e]=null,r&&r(t[e+"Error_"])}dy(e,t)}},SA=function(s){Ce(e,s);function e(i){var r;return r=s.call(this)||this,r.mediaSource=i,r.sourceopenListener_=function(){return dy("mediaSource",We(r))},r.mediaSource.addEventListener("sourceopen",r.sourceopenListener_),r.logger_=Mr("SourceUpdater"),r.audioTimestampOffset_=0,r.videoTimestampOffset_=0,r.queue=[],r.queuePending={audio:null,video:null},r.delayedAudioAppendQueue_=[],r.videoAppendQueued_=!1,r.codecs={},r.onVideoUpdateEnd_=Fb("video",We(r)),r.onAudioUpdateEnd_=Fb("audio",We(r)),r.onVideoError_=function(n){r.videoError_=n},r.onAudioError_=function(n){r.audioError_=n},r.createdSourceBuffers_=!1,r.initializedEme_=!1,r.triggeredReady_=!1,r}var t=e.prototype;return t.initializedEme=function(){this.initializedEme_=!0,this.triggerReady()},t.hasCreatedSourceBuffers=function(){return this.createdSourceBuffers_},t.hasInitializedAnyEme=function(){return this.initializedEme_},t.ready=function(){return this.hasCreatedSourceBuffers()&&this.hasInitializedAnyEme()},t.createSourceBuffers=function(r){this.hasCreatedSourceBuffers()||(this.addOrChangeSourceBuffers(r),this.createdSourceBuffers_=!0,this.trigger("createdsourcebuffers"),this.triggerReady())},t.triggerReady=function(){this.ready()&&!this.triggeredReady_&&(this.triggeredReady_=!0,this.trigger("ready"))},t.addSourceBuffer=function(r,n){rr({type:"mediaSource",sourceUpdater:this,action:ir.addSourceBuffer(r,n),name:"addSourceBuffer"})},t.abort=function(r){rr({type:r,sourceUpdater:this,action:ir.abort(r),name:"abort"})},t.removeSourceBuffer=function(r){if(!this.canRemoveSourceBuffer()){ae.log.error("removeSourceBuffer is not supported!");return}rr({type:"mediaSource",sourceUpdater:this,action:ir.removeSourceBuffer(r),name:"removeSourceBuffer"})},t.canRemoveSourceBuffer=function(){return!ae.browser.IE_VERSION&&!ae.browser.IS_FIREFOX&&O.MediaSource&&O.MediaSource.prototype&&typeof O.MediaSource.prototype.removeSourceBuffer=="function"},e.canChangeType=function(){return O.SourceBuffer&&O.SourceBuffer.prototype&&typeof O.SourceBuffer.prototype.changeType=="function"},t.canChangeType=function(){return this.constructor.canChangeType()},t.changeType=function(r,n){if(!this.canChangeType()){ae.log.error("changeType is not supported!");return}rr({type:r,sourceUpdater:this,action:ir.changeType(n),name:"changeType"})},t.addOrChangeSourceBuffers=function(r){var n=this;if(!r||typeof r!="object"||Object.keys(r).length===0)throw new Error("Cannot addOrChangeSourceBuffers to undefined codecs");Object.keys(r).forEach(function(a){var o=r[a];if(!n.hasCreatedSourceBuffers())return n.addSourceBuffer(a,o);n.canChangeType()&&n.changeType(a,o)})},t.appendBuffer=function(r,n){var a=this,o=r.segmentInfo,l=r.type,u=r.bytes;if(this.processedAppend_=!0,l==="audio"&&this.videoBuffer&&!this.videoAppendQueued_){this.delayedAudioAppendQueue_.push([r,n]),this.logger_("delayed audio append of "+u.length+" until video append");return}var c=n;if(rr({type:l,sourceUpdater:this,action:ir.appendBuffer(u,o||{mediaIndex:-1},c),doneFn:n,name:"appendBuffer"}),l==="video"){if(this.videoAppendQueued_=!0,!this.delayedAudioAppendQueue_.length)return;var h=this.delayedAudioAppendQueue_.slice();this.logger_("queuing delayed audio "+h.length+" appendBuffers"),this.delayedAudioAppendQueue_.length=0,h.forEach(function(d){a.appendBuffer.apply(a,d)})}},t.audioBuffered=function(){return Wr(this.mediaSource,this.audioBuffer)&&this.audioBuffer.buffered?this.audioBuffer.buffered:ae.createTimeRange()},t.videoBuffered=function(){return Wr(this.mediaSource,this.videoBuffer)&&this.videoBuffer.buffered?this.videoBuffer.buffered:ae.createTimeRange()},t.buffered=function(){var r=Wr(this.mediaSource,this.videoBuffer)?this.videoBuffer:null,n=Wr(this.mediaSource,this.audioBuffer)?this.audioBuffer:null;return n&&!r?this.audioBuffered():r&&!n?this.videoBuffered():m8(this.audioBuffered(),this.videoBuffered())},t.setDuration=function(r,n){n===void 0&&(n=kn),rr({type:"mediaSource",sourceUpdater:this,action:ir.duration(r),name:"duration",doneFn:n})},t.endOfStream=function(r,n){r===void 0&&(r=null),n===void 0&&(n=kn),typeof r!="string"&&(r=void 0),rr({type:"mediaSource",sourceUpdater:this,action:ir.endOfStream(r),name:"endOfStream",doneFn:n})},t.removeAudio=function(r,n,a){if(a===void 0&&(a=kn),!this.audioBuffered().length||this.audioBuffered().end(0)===0){a();return}rr({type:"audio",sourceUpdater:this,action:ir.remove(r,n),doneFn:a,name:"remove"})},t.removeVideo=function(r,n,a){if(a===void 0&&(a=kn),!this.videoBuffered().length||this.videoBuffered().end(0)===0){a();return}rr({type:"video",sourceUpdater:this,action:ir.remove(r,n),doneFn:a,name:"remove"})},t.updating=function(){return!!(Cv("audio",this)||Cv("video",this))},t.audioTimestampOffset=function(r){return typeof r<"u"&&this.audioBuffer&&this.audioTimestampOffset_!==r&&(rr({type:"audio",sourceUpdater:this,action:ir.timestampOffset(r),name:"timestampOffset"}),this.audioTimestampOffset_=r),this.audioTimestampOffset_},t.videoTimestampOffset=function(r){return typeof r<"u"&&this.videoBuffer&&this.videoTimestampOffset!==r&&(rr({type:"video",sourceUpdater:this,action:ir.timestampOffset(r),name:"timestampOffset"}),this.videoTimestampOffset_=r),this.videoTimestampOffset_},t.audioQueueCallback=function(r){this.audioBuffer&&rr({type:"audio",sourceUpdater:this,action:ir.callback(r),name:"callback"})},t.videoQueueCallback=function(r){this.videoBuffer&&rr({type:"video",sourceUpdater:this,action:ir.callback(r),name:"callback"})},t.dispose=function(){var r=this;this.trigger("dispose"),QU.forEach(function(n){r.abort(n),r.canRemoveSourceBuffer()?r.removeSourceBuffer(n):r[n+"QueueCallback"](function(){return bA(n,r)})}),this.videoAppendQueued_=!1,this.delayedAudioAppendQueue_.length=0,this.sourceopenListener_&&this.mediaSource.removeEventListener("sourceopen",this.sourceopenListener_),this.off()},e}(ae.EventTarget),Bb=function(e){return decodeURIComponent(escape(String.fromCharCode.apply(null,e)))},Ub=new Uint8Array(`
286
-
287
- `.split("").map(function(s){return s.charCodeAt(0)})),JU=function(s){Ce(e,s);function e(){return s.call(this,"Trying to parse received VTT cues, but there is no WebVTT. Make sure vtt.js is loaded.")||this}return e}(sv(Error)),ZU=function(s){Ce(e,s);function e(i,r){var n;return r===void 0&&(r={}),n=s.call(this,i,r)||this,n.mediaSource_=null,n.subtitlesTrack_=null,n.loaderType_="subtitle",n.featuresNativeTextTracks_=i.featuresNativeTextTracks,n.loadVttJs=i.loadVttJs,n.shouldSaveSegmentTimingInfo_=!1,n}var t=e.prototype;return t.createTransmuxer_=function(){return null},t.buffered_=function(){if(!this.subtitlesTrack_||!this.subtitlesTrack_.cues||!this.subtitlesTrack_.cues.length)return ae.createTimeRanges();var r=this.subtitlesTrack_.cues,n=r[0].startTime,a=r[r.length-1].startTime;return ae.createTimeRanges([[n,a]])},t.initSegmentForMap=function(r,n){if(n===void 0&&(n=!1),!r)return null;var a=Sh(r),o=this.initSegments_[a];if(n&&!o&&r.bytes){var l=Ub.byteLength+r.bytes.byteLength,u=new Uint8Array(l);u.set(r.bytes),u.set(Ub,r.bytes.byteLength),this.initSegments_[a]=o={resolvedUri:r.resolvedUri,byterange:r.byterange,bytes:u}}return o||r},t.couldBeginLoading_=function(){return this.playlist_&&this.subtitlesTrack_&&!this.paused()},t.init_=function(){return this.state="READY",this.resetEverything(),this.monitorBuffer_()},t.track=function(r){return typeof r>"u"?this.subtitlesTrack_:(this.subtitlesTrack_=r,this.state==="INIT"&&this.couldBeginLoading_()&&this.init_(),this.subtitlesTrack_)},t.remove=function(r,n){Dl(r,n,this.subtitlesTrack_)},t.fillBuffer_=function(){var r=this,n=this.chooseNextRequest_();if(n){if(this.syncController_.timestampOffsetForTimeline(n.timeline)===null){var a=function(){r.state="READY",r.paused()||r.monitorBuffer_()};this.syncController_.one("timestampoffset",a),this.state="WAITING_ON_TIMELINE";return}this.loadSegment_(n)}},t.timestampOffsetForSegment_=function(){return null},t.chooseNextRequest_=function(){return this.skipEmptySegments_(s.prototype.chooseNextRequest_.call(this))},t.skipEmptySegments_=function(r){for(;r&&r.segment.empty;){if(r.mediaIndex+1>=r.playlist.segments.length){r=null;break}r=this.generateSegmentInfo_({playlist:r.playlist,mediaIndex:r.mediaIndex+1,startOfSegment:r.startOfSegment+r.duration,isSyncRequest:r.isSyncRequest})}return r},t.stopForError=function(r){this.error(r),this.state="READY",this.pause(),this.trigger("error")},t.segmentRequestFinished_=function(r,n,a){var o=this;if(!this.subtitlesTrack_){this.state="READY";return}if(this.saveTransferStats_(n.stats),!this.pendingSegment_){this.state="READY",this.mediaRequestsAborted+=1;return}if(r){r.code===Zr.TIMEOUT&&this.handleTimeout_(),r.code===Zr.ABORTED?this.mediaRequestsAborted+=1:this.mediaRequestsErrored+=1,this.stopForError(r);return}var l=this.pendingSegment_;this.saveBandwidthRelatedStats_(l.duration,n.stats),n.key&&this.segmentKey(n.key,!0),this.state="APPENDING",this.trigger("appending");var u=l.segment;if(u.map&&(u.map.bytes=n.map.bytes),l.bytes=n.bytes,typeof O.WebVTT!="function"&&typeof this.loadVttJs=="function"){this.state="WAITING_ON_VTTJS",this.loadVttJs().then(function(){return o.segmentRequestFinished_(r,n,a)},function(){return o.stopForError({message:"Error loading vtt.js"})});return}u.requested=!0;try{this.parseVTTCues_(l)}catch(c){this.stopForError({message:c.message});return}if(this.updateTimeMapping_(l,this.syncController_.timelines[l.timeline],this.playlist_),l.cues.length?l.timingInfo={start:l.cues[0].startTime,end:l.cues[l.cues.length-1].endTime}:l.timingInfo={start:l.startOfSegment,end:l.startOfSegment+l.duration},l.isSyncRequest){this.trigger("syncinfoupdate"),this.pendingSegment_=null,this.state="READY";return}l.byteLength=l.bytes.byteLength,this.mediaSecondsLoaded+=u.duration,l.cues.forEach(function(c){o.subtitlesTrack_.addCue(o.featuresNativeTextTracks_?new O.VTTCue(c.startTime,c.endTime,c.text):c)}),BU(this.subtitlesTrack_),this.handleAppendsDone_()},t.handleData_=function(){},t.updateTimingInfoEnd_=function(){},t.parseVTTCues_=function(r){var n,a=!1;if(typeof O.WebVTT!="function")throw new JU;typeof O.TextDecoder=="function"?n=new O.TextDecoder("utf8"):(n=O.WebVTT.StringDecoder(),a=!0);var o=new O.WebVTT.Parser(O,O.vttjs,n);if(r.cues=[],r.timestampmap={MPEGTS:0,LOCAL:0},o.oncue=r.cues.push.bind(r.cues),o.ontimestampmap=function(c){r.timestampmap=c},o.onparsingerror=function(c){ae.log.warn("Error encountered when parsing cues: "+c.message)},r.segment.map){var l=r.segment.map.bytes;a&&(l=Bb(l)),o.parse(l)}var u=r.bytes;a&&(u=Bb(u)),o.parse(u),o.flush()},t.updateTimeMapping_=function(r,n,a){var o=r.segment;if(n){if(!r.cues.length){o.empty=!0;return}var l=r.timestampmap,u=l.MPEGTS/ch.ONE_SECOND_IN_TS-l.LOCAL+n.mapping;if(r.cues.forEach(function(d){d.startTime+=u,d.endTime+=u}),!a.syncInfo){var c=r.cues[0].startTime,h=r.cues[r.cues.length-1].startTime;a.syncInfo={mediaSequence:a.mediaSequence+r.mediaIndex,time:Math.min(c,h-o.duration)}}}},e}(xv),e5=function(e,t){for(var i=e.cues,r=0;r<i.length;r++){var n=i[r];if(t>=n.adStartTime&&t<=n.adEndTime)return n}return null},t5=function(e,t,i){if(i===void 0&&(i=0),!!e.segments)for(var r=i,n,a=0;a<e.segments.length;a++){var o=e.segments[a];if(n||(n=e5(t,r+o.duration/2)),n){if("cueIn"in o){n.endTime=r,n.adEndTime=r,r+=o.duration,n=null;continue}if(r<n.endTime){r+=o.duration;continue}n.endTime+=o.duration}else if("cueOut"in o&&(n=new O.VTTCue(r,r+o.duration,o.cueOut),n.adStartTime=r,n.adEndTime=r+parseFloat(o.cueOut),t.addCue(n)),"cueOutCont"in o){var l=o.cueOutCont.split("/").map(parseFloat),u=l[0],c=l[1];n=new O.VTTCue(r,r+o.duration,""),n.adStartTime=r-u,n.adEndTime=n.adStartTime+c,t.addCue(n)}r+=o.duration}},i5=86400,$b=[{name:"VOD",run:function(e,t,i,r,n){if(i!==1/0){var a={time:0,segmentIndex:0,partIndex:null};return a}return null}},{name:"ProgramDateTime",run:function(e,t,i,r,n){if(!Object.keys(e.timelineToDatetimeMappings).length)return null;var a=null,o=null,l=mv(t);n=n||0;for(var u=0;u<l.length;u++){var c=t.endList||n===0?u:l.length-(u+1),h=l[c],d=h.segment,g=e.timelineToDatetimeMappings[d.timeline];if(!(!g||!d.dateTimeObject)){var y=d.dateTimeObject.getTime()/1e3,p=y+g;if(d.parts&&typeof h.partIndex=="number")for(var _=0;_<h.partIndex;_++)p+=d.parts[_].duration;var k=Math.abs(n-p);if(o!==null&&(k===0||o<k))break;o=k,a={time:p,segmentIndex:h.segmentIndex,partIndex:h.partIndex}}}return a}},{name:"Segment",run:function(e,t,i,r,n){var a=null,o=null;n=n||0;for(var l=mv(t),u=0;u<l.length;u++){var c=t.endList||n===0?u:l.length-(u+1),h=l[c],d=h.segment,g=h.part&&h.part.start||d&&d.start;if(d.timeline===r&&typeof g<"u"){var y=Math.abs(n-g);if(o!==null&&o<y)break;(!a||o===null||o>=y)&&(o=y,a={time:g,segmentIndex:h.segmentIndex,partIndex:h.partIndex})}}return a}},{name:"Discontinuity",run:function(e,t,i,r,n){var a=null;if(n=n||0,t.discontinuityStarts&&t.discontinuityStarts.length)for(var o=null,l=0;l<t.discontinuityStarts.length;l++){var u=t.discontinuityStarts[l],c=t.discontinuitySequence+l+1,h=e.discontinuities[c];if(h){var d=Math.abs(n-h.time);if(o!==null&&o<d)break;(!a||o===null||o>=d)&&(o=d,a={time:h.time,segmentIndex:u,partIndex:null})}}return a}},{name:"Playlist",run:function(e,t,i,r,n){if(t.syncInfo){var a={time:t.syncInfo.time,segmentIndex:t.syncInfo.mediaSequence-t.mediaSequence,partIndex:null};return a}return null}}],r5=function(s){Ce(e,s);function e(i){var r;return r=s.call(this)||this,r.timelines=[],r.discontinuities=[],r.timelineToDatetimeMappings={},r.logger_=Mr("SyncController"),r}var t=e.prototype;return t.getSyncPoint=function(r,n,a,o){var l=this.runStrategies_(r,n,a,o);return l.length?this.selectSyncPoint_(l,{key:"time",value:o}):null},t.getExpiredTime=function(r,n){if(!r||!r.segments)return null;var a=this.runStrategies_(r,n,r.discontinuitySequence,0);if(!a.length)return null;var o=this.selectSyncPoint_(a,{key:"segmentIndex",value:0});return o.segmentIndex>0&&(o.time*=-1),Math.abs(o.time+ql({defaultDuration:r.targetDuration,durationList:r.segments,startIndex:o.segmentIndex,endIndex:0}))},t.runStrategies_=function(r,n,a,o){for(var l=[],u=0;u<$b.length;u++){var c=$b[u],h=c.run(this,r,n,a,o);h&&(h.strategy=c.name,l.push({strategy:c.name,syncPoint:h}))}return l},t.selectSyncPoint_=function(r,n){for(var a=r[0].syncPoint,o=Math.abs(r[0].syncPoint[n.key]-n.value),l=r[0].strategy,u=1;u<r.length;u++){var c=Math.abs(r[u].syncPoint[n.key]-n.value);c<o&&(o=c,a=r[u].syncPoint,l=r[u].strategy)}return this.logger_("syncPoint for ["+n.key+": "+n.value+"] chosen with strategy"+(" ["+l+"]: [time:"+a.time+",")+(" segmentIndex:"+a.segmentIndex)+(typeof a.partIndex=="number"?",partIndex:"+a.partIndex:"")+"]"),a},t.saveExpiredSegmentInfo=function(r,n){var a=n.mediaSequence-r.mediaSequence;if(a>i5){ae.log.warn("Not saving expired segment info. Media sequence gap "+a+" is too large.");return}for(var o=a-1;o>=0;o--){var l=r.segments[o];if(l&&typeof l.start<"u"){n.syncInfo={mediaSequence:r.mediaSequence+o,time:l.start},this.logger_("playlist refresh sync: [time:"+n.syncInfo.time+","+(" mediaSequence: "+n.syncInfo.mediaSequence+"]")),this.trigger("syncinfoupdate");break}}},t.setDateTimeMappingForStart=function(r){if(this.timelineToDatetimeMappings={},r.segments&&r.segments.length&&r.segments[0].dateTimeObject){var n=r.segments[0],a=n.dateTimeObject.getTime()/1e3;this.timelineToDatetimeMappings[n.timeline]=-a}},t.saveSegmentTimingInfo=function(r){var n=r.segmentInfo,a=r.shouldSaveTimelineMapping,o=this.calculateSegmentTimeMapping_(n,n.timingInfo,a),l=n.segment;o&&(this.saveDiscontinuitySyncInfo_(n),n.playlist.syncInfo||(n.playlist.syncInfo={mediaSequence:n.playlist.mediaSequence+n.mediaIndex,time:l.start}));var u=l.dateTimeObject;l.discontinuity&&a&&u&&(this.timelineToDatetimeMappings[l.timeline]=-(u.getTime()/1e3))},t.timestampOffsetForTimeline=function(r){return typeof this.timelines[r]>"u"?null:this.timelines[r].time},t.mappingForTimeline=function(r){return typeof this.timelines[r]>"u"?null:this.timelines[r].mapping},t.calculateSegmentTimeMapping_=function(r,n,a){var o=r.segment,l=r.part,u=this.timelines[r.timeline],c,h;if(typeof r.timestampOffset=="number")u={time:r.startOfSegment,mapping:r.startOfSegment-n.start},a&&(this.timelines[r.timeline]=u,this.trigger("timestampoffset"),this.logger_("time mapping for timeline "+r.timeline+": "+("[time: "+u.time+"] [mapping: "+u.mapping+"]"))),c=r.startOfSegment,h=n.end+u.mapping;else if(u)c=n.start+u.mapping,h=n.end+u.mapping;else return!1;return l&&(l.start=c,l.end=h),(!o.start||c<o.start)&&(o.start=c),o.end=h,!0},t.saveDiscontinuitySyncInfo_=function(r){var n=r.playlist,a=r.segment;if(a.discontinuity)this.discontinuities[a.timeline]={time:a.start,accuracy:0};else if(n.discontinuityStarts&&n.discontinuityStarts.length)for(var o=0;o<n.discontinuityStarts.length;o++){var l=n.discontinuityStarts[o],u=n.discontinuitySequence+o+1,c=l-r.mediaIndex,h=Math.abs(c);if(!this.discontinuities[u]||this.discontinuities[u].accuracy>h){var d=void 0;c<0?d=a.start-ql({defaultDuration:n.targetDuration,durationList:n.segments,startIndex:r.mediaIndex,endIndex:l}):d=a.end+ql({defaultDuration:n.targetDuration,durationList:n.segments,startIndex:r.mediaIndex+1,endIndex:l}),this.discontinuities[u]={time:d,accuracy:h}}}},t.dispose=function(){this.trigger("dispose"),this.off()},e}(ae.EventTarget),n5=function(s){Ce(e,s);function e(){var i;return i=s.call(this)||this,i.pendingTimelineChanges_={},i.lastTimelineChanges_={},i}var t=e.prototype;return t.clearPendingTimelineChange=function(r){this.pendingTimelineChanges_[r]=null,this.trigger("pendingtimelinechange")},t.pendingTimelineChange=function(r){var n=r.type,a=r.from,o=r.to;return typeof a=="number"&&typeof o=="number"&&(this.pendingTimelineChanges_[n]={type:n,from:a,to:o},this.trigger("pendingtimelinechange")),this.pendingTimelineChanges_[n]},t.lastTimelineChange=function(r){var n=r.type,a=r.from,o=r.to;return typeof a=="number"&&typeof o=="number"&&(this.lastTimelineChanges_[n]={type:n,from:a,to:o},delete this.pendingTimelineChanges_[n],this.trigger("timelinechange")),this.lastTimelineChanges_[n]},t.dispose=function(){this.trigger("dispose"),this.pendingTimelineChanges_={},this.lastTimelineChanges_={},this.off()},e}(ae.EventTarget),s5=lA(uA(function(){var s=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function e($,R,L){return L={path:R,exports:{},require:function(B,C){return t(B,C??L.path)}},$(L,L.exports),L.exports}function t(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}var i=e(function($){function R(F,B){for(var C=0;C<B.length;C++){var I=B[C];I.enumerable=I.enumerable||!1,I.configurable=!0,"value"in I&&(I.writable=!0),Object.defineProperty(F,I.key,I)}}function L(F,B,C){return B&&R(F.prototype,B),C&&R(F,C),F}$.exports=L,$.exports.default=$.exports,$.exports.__esModule=!0}),r=e(function($){function R(L,F){return $.exports=R=Object.setPrototypeOf||function(C,I){return C.__proto__=I,C},$.exports.default=$.exports,$.exports.__esModule=!0,R(L,F)}$.exports=R,$.exports.default=$.exports,$.exports.__esModule=!0}),n=e(function($){function R(L,F){L.prototype=Object.create(F.prototype),L.prototype.constructor=L,r(L,F)}$.exports=R,$.exports.default=$.exports,$.exports.__esModule=!0}),a=function(){function $(){this.listeners={}}var R=$.prototype;return R.on=function(F,B){this.listeners[F]||(this.listeners[F]=[]),this.listeners[F].push(B)},R.off=function(F,B){if(!this.listeners[F])return!1;var C=this.listeners[F].indexOf(B);return this.listeners[F]=this.listeners[F].slice(0),this.listeners[F].splice(C,1),C>-1},R.trigger=function(F){var B=this.listeners[F];if(B)if(arguments.length===2)for(var C=B.length,I=0;I<C;++I)B[I].call(this,arguments[1]);else for(var G=Array.prototype.slice.call(arguments,1),H=B.length,K=0;K<H;++K)B[K].apply(this,G)},R.dispose=function(){this.listeners={}},R.pipe=function(F){this.on("data",function(B){F.push(B)})},$}();/*! @name pkcs7 @version 1.0.4 @license Apache-2.0 */function o($){return $.subarray(0,$.byteLength-$[$.byteLength-1])}/*! @name aes-decrypter @version 3.1.3 @license Apache-2.0 */var l=function(){var R=[[[],[],[],[],[]],[[],[],[],[],[]]],L=R[0],F=R[1],B=L[4],C=F[4],I,G,H,K=[],ie=[],he,fe,re,ne,oe,de;for(I=0;I<256;I++)ie[(K[I]=I<<1^(I>>7)*283)^I]=I;for(G=H=0;!B[G];G^=he||1,H=ie[H]||1)for(ne=H^H<<1^H<<2^H<<3^H<<4,ne=ne>>8^ne&255^99,B[G]=ne,C[ne]=G,re=K[fe=K[he=K[G]]],de=re*16843009^fe*65537^he*257^G*16843008,oe=K[ne]*257^ne*16843008,I=0;I<4;I++)L[I][G]=oe=oe<<24^oe>>>8,F[I][ne]=de=de<<24^de>>>8;for(I=0;I<5;I++)L[I]=L[I].slice(0),F[I]=F[I].slice(0);return R},u=null,c=function(){function $(L){u||(u=l()),this._tables=[[u[0][0].slice(),u[0][1].slice(),u[0][2].slice(),u[0][3].slice(),u[0][4].slice()],[u[1][0].slice(),u[1][1].slice(),u[1][2].slice(),u[1][3].slice(),u[1][4].slice()]];var F,B,C,I=this._tables[0][4],G=this._tables[1],H=L.length,K=1;if(H!==4&&H!==6&&H!==8)throw new Error("Invalid aes key size");var ie=L.slice(0),he=[];for(this._key=[ie,he],F=H;F<4*H+28;F++)C=ie[F-1],(F%H===0||H===8&&F%H===4)&&(C=I[C>>>24]<<24^I[C>>16&255]<<16^I[C>>8&255]<<8^I[C&255],F%H===0&&(C=C<<8^C>>>24^K<<24,K=K<<1^(K>>7)*283)),ie[F]=ie[F-H]^C;for(B=0;F;B++,F--)C=ie[B&3?F:F-4],F<=4||B<4?he[B]=C:he[B]=G[0][I[C>>>24]]^G[1][I[C>>16&255]]^G[2][I[C>>8&255]]^G[3][I[C&255]]}var R=$.prototype;return R.decrypt=function(F,B,C,I,G,H){var K=this._key[1],ie=F^K[0],he=I^K[1],fe=C^K[2],re=B^K[3],ne,oe,de,ve=K.length/4-2,ke,De=4,Me=this._tables[1],Ne=Me[0],Ye=Me[1],Re=Me[2],Oe=Me[3],Ve=Me[4];for(ke=0;ke<ve;ke++)ne=Ne[ie>>>24]^Ye[he>>16&255]^Re[fe>>8&255]^Oe[re&255]^K[De],oe=Ne[he>>>24]^Ye[fe>>16&255]^Re[re>>8&255]^Oe[ie&255]^K[De+1],de=Ne[fe>>>24]^Ye[re>>16&255]^Re[ie>>8&255]^Oe[he&255]^K[De+2],re=Ne[re>>>24]^Ye[ie>>16&255]^Re[he>>8&255]^Oe[fe&255]^K[De+3],De+=4,ie=ne,he=oe,fe=de;for(ke=0;ke<4;ke++)G[(3&-ke)+H]=Ve[ie>>>24]<<24^Ve[he>>16&255]<<16^Ve[fe>>8&255]<<8^Ve[re&255]^K[De++],ne=ie,ie=he,he=fe,fe=re,re=ne},$}(),h=function($){n(R,$);function R(){var F;return F=$.call(this,a)||this,F.jobs=[],F.delay=1,F.timeout_=null,F}var L=R.prototype;return L.processJob_=function(){this.jobs.shift()(),this.jobs.length?this.timeout_=setTimeout(this.processJob_.bind(this),this.delay):this.timeout_=null},L.push=function(B){this.jobs.push(B),this.timeout_||(this.timeout_=setTimeout(this.processJob_.bind(this),this.delay))},R}(a),d=function(R){return R<<24|(R&65280)<<8|(R&16711680)>>8|R>>>24},g=function(R,L,F){var B=new Int32Array(R.buffer,R.byteOffset,R.byteLength>>2),C=new c(Array.prototype.slice.call(L)),I=new Uint8Array(R.byteLength),G=new Int32Array(I.buffer),H,K,ie,he,fe,re,ne,oe,de;for(H=F[0],K=F[1],ie=F[2],he=F[3],de=0;de<B.length;de+=4)fe=d(B[de]),re=d(B[de+1]),ne=d(B[de+2]),oe=d(B[de+3]),C.decrypt(fe,re,ne,oe,G,de),G[de]=d(G[de]^H),G[de+1]=d(G[de+1]^K),G[de+2]=d(G[de+2]^ie),G[de+3]=d(G[de+3]^he),H=fe,K=re,ie=ne,he=oe;return I},y=function(){function $(L,F,B,C){var I=$.STEP,G=new Int32Array(L.buffer),H=new Uint8Array(L.byteLength),K=0;for(this.asyncStream_=new h,this.asyncStream_.push(this.decryptChunk_(G.subarray(K,K+I),F,B,H)),K=I;K<G.length;K+=I)B=new Uint32Array([d(G[K-4]),d(G[K-3]),d(G[K-2]),d(G[K-1])]),this.asyncStream_.push(this.decryptChunk_(G.subarray(K,K+I),F,B,H));this.asyncStream_.push(function(){C(null,o(H))})}var R=$.prototype;return R.decryptChunk_=function(F,B,C,I){return function(){var G=g(F,B,C);I.set(G,F.byteOffset)}},i($,null,[{key:"STEP",get:function(){return 32e3}}]),$}(),p;typeof window<"u"?p=window:typeof s<"u"?p=s:typeof self<"u"?p=self:p={};var _=p,k=function(R){return ArrayBuffer.isView==="function"?ArrayBuffer.isView(R):R&&R.buffer instanceof ArrayBuffer},A=_.BigInt||Number;A("0x1"),A("0x100"),A("0x10000"),A("0x1000000"),A("0x100000000"),A("0x10000000000"),A("0x1000000000000"),A("0x100000000000000"),A("0x10000000000000000");var N=function(R){var L={};return Object.keys(R).forEach(function(F){var B=R[F];k(B)?L[F]={bytes:B.buffer,byteOffset:B.byteOffset,byteLength:B.byteLength}:L[F]=B}),L};self.onmessage=function($){var R=$.data,L=new Uint8Array(R.encrypted.bytes,R.encrypted.byteOffset,R.encrypted.byteLength),F=new Uint32Array(R.key.bytes,R.key.byteOffset,R.key.byteLength/4),B=new Uint32Array(R.iv.bytes,R.iv.byteOffset,R.iv.byteLength/4);new y(L,F,B,function(C,I){self.postMessage(N({source:R.source,decrypted:I}),[I.buffer])})}})),a5=oA(s5),o5=function(e){var t=e.default?"main":"alternative";return e.characteristics&&e.characteristics.indexOf("public.accessibility.describes-video")>=0&&(t="main-desc"),t},wh=function(e,t){e.abort(),e.pause(),t&&t.activePlaylistLoader&&(t.activePlaylistLoader.pause(),t.activePlaylistLoader=null)},Ev=function(e,t){t.activePlaylistLoader=e,e.load()},l5=function(e,t){return function(){var i=t.segmentLoaders,r=i[e],n=i.main,a=t.mediaTypes[e],o=a.activeTrack(),l=a.getActiveGroup(),u=a.activePlaylistLoader,c=a.lastGroup_;if(!(l&&c&&l.id===c.id)&&(a.lastGroup_=l,a.lastTrack_=o,wh(r,a),!(!l||l.isMasterPlaylist))){if(!l.playlistLoader){u&&n.resetEverything();return}r.resyncLoader(),Ev(l.playlistLoader,a)}}},u5=function(e,t){return function(){var i=t.segmentLoaders[e],r=t.mediaTypes[e];r.lastGroup_=null,i.abort(),i.pause()}},c5=function(e,t){return function(){var i=t.masterPlaylistLoader,r=t.segmentLoaders,n=r[e],a=r.main,o=t.mediaTypes[e],l=o.activeTrack(),u=o.getActiveGroup(),c=o.activePlaylistLoader,h=o.lastTrack_;if(!(h&&l&&h.id===l.id)&&(o.lastGroup_=u,o.lastTrack_=l,wh(n,o),!!u)){if(u.isMasterPlaylist){if(!l||!h||l.id===h.id)return;var d=t.vhs.masterPlaylistController_,g=d.selectPlaylist();if(d.media()===g)return;o.logger_("track change. Switching master audio from "+h.id+" to "+l.id),i.pause(),a.resetEverything(),d.fastQualityChange_(g);return}if(e==="AUDIO"){if(!u.playlistLoader){a.setAudio(!0),a.resetEverything();return}n.setAudio(!0),a.setAudio(!1)}if(c===u.playlistLoader){Ev(u.playlistLoader,o);return}n.track&&n.track(l),n.resetEverything(),Ev(u.playlistLoader,o)}}},kh={AUDIO:function(e,t){return function(){var i=t.segmentLoaders[e],r=t.mediaTypes[e],n=t.blacklistCurrentPlaylist;wh(i,r);var a=r.activeTrack(),o=r.activeGroup(),l=(o.filter(function(h){return h.default})[0]||o[0]).id,u=r.tracks[l];if(a===u){n({message:"Problem encountered loading the default audio track."});return}ae.log.warn("Problem encountered loading the alternate audio track.Switching back to default.");for(var c in r.tracks)r.tracks[c].enabled=r.tracks[c]===u;r.onTrackChanged()}},SUBTITLES:function(e,t){return function(){var i=t.segmentLoaders[e],r=t.mediaTypes[e];ae.log.warn("Problem encountered loading the subtitle track.Disabling subtitle track."),wh(i,r);var n=r.activeTrack();n&&(n.mode="disabled"),r.onTrackChanged()}}},jb={AUDIO:function(e,t,i){if(t){var r=i.tech,n=i.requestOptions,a=i.segmentLoaders[e];t.on("loadedmetadata",function(){var o=t.media();a.playlist(o,n),(!r.paused()||o.endList&&r.preload()!=="none")&&a.load()}),t.on("loadedplaylist",function(){a.playlist(t.media(),n),r.paused()||a.load()}),t.on("error",kh[e](e,i))}},SUBTITLES:function(e,t,i){var r=i.tech,n=i.requestOptions,a=i.segmentLoaders[e],o=i.mediaTypes[e];t.on("loadedmetadata",function(){var l=t.media();a.playlist(l,n),a.track(o.activeTrack()),(!r.paused()||l.endList&&r.preload()!=="none")&&a.load()}),t.on("loadedplaylist",function(){a.playlist(t.media(),n),r.paused()||a.load()}),t.on("error",kh[e](e,i))}},h5={AUDIO:function(e,t){var i=t.vhs,r=t.sourceType,n=t.segmentLoaders[e],a=t.requestOptions,o=t.master.mediaGroups,l=t.mediaTypes[e],u=l.groups,c=l.tracks,h=l.logger_,d=t.masterPlaylistLoader,g=_u(d.master);(!o[e]||Object.keys(o[e]).length===0)&&(o[e]={main:{default:{default:!0}}},g&&(o[e].main.default.playlists=d.master.playlists));for(var y in o[e]){u[y]||(u[y]=[]);for(var p in o[e][y]){var _=o[e][y][p],k=void 0;if(g?(h("AUDIO group '"+y+"' label '"+p+"' is a master playlist"),_.isMasterPlaylist=!0,k=null):r==="vhs-json"&&_.playlists?k=new Ya(_.playlists[0],i,a):_.resolvedUri?k=new Ya(_.resolvedUri,i,a):_.playlists&&r==="dash"?k=new bv(_.playlists[0],i,a,d):k=null,_=ae.mergeOptions({id:p,playlistLoader:k},_),jb[e](e,_.playlistLoader,t),u[y].push(_),typeof c[p]>"u"){var A=new ae.AudioTrack({id:p,kind:o5(_),enabled:!1,language:_.language,default:_.default,label:p});c[p]=A}}}n.on("error",kh[e](e,t))},SUBTITLES:function(e,t){var i=t.tech,r=t.vhs,n=t.sourceType,a=t.segmentLoaders[e],o=t.requestOptions,l=t.master.mediaGroups,u=t.mediaTypes[e],c=u.groups,h=u.tracks,d=t.masterPlaylistLoader;for(var g in l[e]){c[g]||(c[g]=[]);for(var y in l[e][g])if(!l[e][g][y].forced){var p=l[e][g][y],_=void 0;if(n==="hls")_=new Ya(p.resolvedUri,r,o);else if(n==="dash"){var k=p.playlists.filter(function(N){return N.excludeUntil!==1/0});if(!k.length)return;_=new bv(p.playlists[0],r,o,d)}else n==="vhs-json"&&(_=new Ya(p.playlists?p.playlists[0]:p.resolvedUri,r,o));if(p=ae.mergeOptions({id:y,playlistLoader:_},p),jb[e](e,p.playlistLoader,t),c[g].push(p),typeof h[y]>"u"){var A=i.addRemoteTextTrack({id:y,kind:"subtitles",default:p.default&&p.autoselect,language:p.language,label:y},!1).track;h[y]=A}}}a.on("error",kh[e](e,t))},"CLOSED-CAPTIONS":function(e,t){var i=t.tech,r=t.master.mediaGroups,n=t.mediaTypes[e],a=n.groups,o=n.tracks;for(var l in r[e]){a[l]||(a[l]=[]);for(var u in r[e][l]){var c=r[e][l][u];if(/^(?:CC|SERVICE)/.test(c.instreamId)){var h=i.options_.vhs&&i.options_.vhs.captionServices||{},d={label:u,language:c.language,instreamId:c.instreamId,default:c.default&&c.autoselect};if(h[d.instreamId]&&(d=ae.mergeOptions(d,h[d.instreamId])),d.default===void 0&&delete d.default,a[l].push(ae.mergeOptions({id:u},c)),typeof o[u]>"u"){var g=i.addRemoteTextTrack({id:d.instreamId,kind:"captions",default:d.default,language:d.language,label:d.label},!1).track;o[u]=g}}}}}},d5=function s(e,t){for(var i=0;i<e.length;i++)if(ly(t,e[i])||e[i].playlists&&s(e[i].playlists,t))return!0;return!1},f5=function(e,t){return function(i){var r=t.masterPlaylistLoader,n=t.mediaTypes[e].groups,a=r.media();if(!a)return null;var o=null;a.attributes[e]&&(o=n[a.attributes[e]]);var l=Object.keys(n);if(!o)if(e==="AUDIO"&&l.length>1&&_u(t.master))for(var u=0;u<l.length;u++){var c=n[l[u]];if(d5(c,a)){o=c;break}}else n.main?o=n.main:l.length===1&&(o=n[l[0]]);return typeof i>"u"?o:i===null||!o?null:o.filter(function(h){return h.id===i.id})[0]||null}},p5={AUDIO:function(e,t){return function(){var i=t.mediaTypes[e].tracks;for(var r in i)if(i[r].enabled)return i[r];return null}},SUBTITLES:function(e,t){return function(){var i=t.mediaTypes[e].tracks;for(var r in i)if(i[r].mode==="showing"||i[r].mode==="hidden")return i[r];return null}}},m5=function(e,t){var i=t.mediaTypes;return function(){var r=i[e].activeTrack();return r?i[e].activeGroup(r):null}},g5=function(e){["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(function(y){h5[y](y,e)});var t=e.mediaTypes,i=e.masterPlaylistLoader,r=e.tech,n=e.vhs,a=e.segmentLoaders,o=a.AUDIO,l=a.main;["AUDIO","SUBTITLES"].forEach(function(y){t[y].activeGroup=f5(y,e),t[y].activeTrack=p5[y](y,e),t[y].onGroupChanged=l5(y,e),t[y].onGroupChanging=u5(y,e),t[y].onTrackChanged=c5(y,e),t[y].getActiveGroup=m5(y,e)});var u=t.AUDIO.activeGroup();if(u){var c=(u.filter(function(y){return y.default})[0]||u[0]).id;t.AUDIO.tracks[c].enabled=!0,t.AUDIO.onGroupChanged(),t.AUDIO.onTrackChanged();var h=t.AUDIO.getActiveGroup();h.playlistLoader?(l.setAudio(!1),o.setAudio(!0)):l.setAudio(!0)}i.on("mediachange",function(){["AUDIO","SUBTITLES"].forEach(function(y){return t[y].onGroupChanged()})}),i.on("mediachanging",function(){["AUDIO","SUBTITLES"].forEach(function(y){return t[y].onGroupChanging()})});var d=function(){t.AUDIO.onTrackChanged(),r.trigger({type:"usage",name:"vhs-audio-change"}),r.trigger({type:"usage",name:"hls-audio-change"})};r.audioTracks().addEventListener("change",d),r.remoteTextTracks().addEventListener("change",t.SUBTITLES.onTrackChanged),n.on("dispose",function(){r.audioTracks().removeEventListener("change",d),r.remoteTextTracks().removeEventListener("change",t.SUBTITLES.onTrackChanged)}),r.clearTracks("audio");for(var g in t.AUDIO.tracks)r.audioTracks().addTrack(t.AUDIO.tracks[g])},v5=function(){var e={};return["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(function(t){e[t]={groups:{},tracks:{},activePlaylistLoader:null,activeGroup:kn,activeTrack:kn,getActiveGroup:kn,onGroupChanged:kn,onTrackChanged:kn,lastTrack_:null,logger_:Mr("MediaGroups["+t+"]")}}),e},y5=60*2,Sn,_5=["mediaRequests","mediaRequestsAborted","mediaRequestsTimedout","mediaRequestsErrored","mediaTransferDuration","mediaBytesTransferred","mediaAppends"],T5=function(e){return this.audioSegmentLoader_[e]+this.mainSegmentLoader_[e]},b5=function(e){var t=e.currentPlaylist,i=e.buffered,r=e.currentTime,n=e.nextPlaylist,a=e.bufferLowWaterLine,o=e.bufferHighWaterLine,l=e.duration,u=e.experimentalBufferBasedABR,c=e.log;if(!n)return ae.log.warn("We received no playlist to switch to. Please check your stream."),!1;var h="allowing switch "+(t&&t.id||"null")+" -> "+n.id;if(!t)return c(h+" as current playlist is not set"),!0;if(n.id===t.id)return!1;var d=!!Qa(i,r).length;if(!t.endList)return!d&&typeof t.partTargetDuration=="number"?(c("not "+h+" as current playlist is live llhls, but currentTime isn't in buffered."),!1):(c(h+" as current playlist is live"),!0);var g=sy(i,r),y=u?ti.EXPERIMENTAL_MAX_BUFFER_LOW_WATER_LINE:ti.MAX_BUFFER_LOW_WATER_LINE;if(l<y)return c(h+" as duration < max low water line ("+l+" < "+y+")"),!0;var p=n.attributes.BANDWIDTH,_=t.attributes.BANDWIDTH;if(p<_&&(!u||g<o)){var k=h+" as next bandwidth < current bandwidth ("+p+" < "+_+")";return u&&(k+=" and forwardBuffer < bufferHighWaterLine ("+g+" < "+o+")"),c(k),!0}if((!u||p>_)&&g>=a){var A=h+" as forwardBuffer >= bufferLowWaterLine ("+g+" >= "+a+")";return u&&(A+=" and next bandwidth > current bandwidth ("+p+" > "+_+")"),c(A),!0}return c("not "+h+" as no switching criteria met"),!1},S5=function(s){Ce(e,s);function e(i){var r;r=s.call(this)||this;var n=i.src,a=i.handleManifestRedirects,o=i.withCredentials,l=i.tech,u=i.bandwidth,c=i.externVhs,h=i.useCueTags,d=i.blacklistDuration,g=i.enableLowInitialPlaylist,y=i.sourceType,p=i.cacheEncryptionKeys,_=i.experimentalBufferBasedABR,k=i.experimentalLeastPixelDiffSelector,A=i.captionServices;if(!n)throw new Error("A non-empty playlist URL or JSON manifest string is required");var N=i.maxPlaylistRetries;(N===null||typeof N>"u")&&(N=1/0),Sn=c,r.experimentalBufferBasedABR=!!_,r.experimentalLeastPixelDiffSelector=!!k,r.withCredentials=o,r.tech_=l,r.vhs_=l.vhs,r.sourceType_=y,r.useCueTags_=h,r.blacklistDuration=d,r.maxPlaylistRetries=N,r.enableLowInitialPlaylist=g,r.useCueTags_&&(r.cueTagsTrack_=r.tech_.addTextTrack("metadata","ad-cues"),r.cueTagsTrack_.inBandMetadataTrackDispatchType=""),r.requestOptions_={withCredentials:o,handleManifestRedirects:a,maxPlaylistRetries:N,timeout:null},r.on("error",r.pauseLoading),r.mediaTypes_=v5(),r.mediaSource=new O.MediaSource,r.handleDurationChange_=r.handleDurationChange_.bind(We(r)),r.handleSourceOpen_=r.handleSourceOpen_.bind(We(r)),r.handleSourceEnded_=r.handleSourceEnded_.bind(We(r)),r.mediaSource.addEventListener("durationchange",r.handleDurationChange_),r.mediaSource.addEventListener("sourceopen",r.handleSourceOpen_),r.mediaSource.addEventListener("sourceended",r.handleSourceEnded_),r.seekable_=ae.createTimeRanges(),r.hasPlayed_=!1,r.syncController_=new r5(i),r.segmentMetadataTrack_=l.addRemoteTextTrack({kind:"metadata",label:"segment-metadata"},!1).track,r.decrypter_=new a5,r.sourceUpdater_=new SA(r.mediaSource),r.inbandTextTracks_={},r.timelineChangeController_=new n5;var $={vhs:r.vhs_,parse708captions:i.parse708captions,useDtsForTimestampOffset:i.useDtsForTimestampOffset,captionServices:A,mediaSource:r.mediaSource,currentTime:r.tech_.currentTime.bind(r.tech_),seekable:function(){return r.seekable()},seeking:function(){return r.tech_.seeking()},duration:function(){return r.duration()},hasPlayed:function(){return r.hasPlayed_},goalBufferLength:function(){return r.goalBufferLength()},bandwidth:u,syncController:r.syncController_,decrypter:r.decrypter_,sourceType:r.sourceType_,inbandTextTracks:r.inbandTextTracks_,cacheEncryptionKeys:p,sourceUpdater:r.sourceUpdater_,timelineChangeController:r.timelineChangeController_,experimentalExactManifestTimings:i.experimentalExactManifestTimings};r.masterPlaylistLoader_=r.sourceType_==="dash"?new bv(n,r.vhs_,r.requestOptions_):new Ya(n,r.vhs_,r.requestOptions_),r.setupMasterPlaylistLoaderListeners_(),r.mainSegmentLoader_=new xv(ae.mergeOptions($,{segmentMetadataTrack:r.segmentMetadataTrack_,loaderType:"main"}),i),r.audioSegmentLoader_=new xv(ae.mergeOptions($,{loaderType:"audio"}),i),r.subtitleSegmentLoader_=new ZU(ae.mergeOptions($,{loaderType:"vtt",featuresNativeTextTracks:r.tech_.featuresNativeTextTracks,loadVttJs:function(){return new Promise(function(F,B){function C(){l.off("vttjserror",I),F()}function I(){l.off("vttjsloaded",C),B()}l.one("vttjsloaded",C),l.one("vttjserror",I),l.addWebVttScript_()})}}),i),r.setupSegmentLoaderListeners_(),r.experimentalBufferBasedABR&&(r.masterPlaylistLoader_.one("loadedplaylist",function(){return r.startABRTimer_()}),r.tech_.on("pause",function(){return r.stopABRTimer_()}),r.tech_.on("play",function(){return r.startABRTimer_()})),_5.forEach(function(L){r[L+"_"]=T5.bind(We(r),L)}),r.logger_=Mr("MPC"),r.triggeredFmp4Usage=!1,r.tech_.preload()==="none"?(r.loadOnPlay_=function(){r.loadOnPlay_=null,r.masterPlaylistLoader_.load()},r.tech_.one("play",r.loadOnPlay_)):r.masterPlaylistLoader_.load(),r.timeToLoadedData__=-1,r.mainAppendsToLoadedData__=-1,r.audioAppendsToLoadedData__=-1;var R=r.tech_.preload()==="none"?"play":"loadstart";return r.tech_.one(R,function(){var L=Date.now();r.tech_.one("loadeddata",function(){r.timeToLoadedData__=Date.now()-L,r.mainAppendsToLoadedData__=r.mainSegmentLoader_.mediaAppends,r.audioAppendsToLoadedData__=r.audioSegmentLoader_.mediaAppends})}),r}var t=e.prototype;return t.mainAppendsToLoadedData_=function(){return this.mainAppendsToLoadedData__},t.audioAppendsToLoadedData_=function(){return this.audioAppendsToLoadedData__},t.appendsToLoadedData_=function(){var r=this.mainAppendsToLoadedData_(),n=this.audioAppendsToLoadedData_();return r===-1||n===-1?-1:r+n},t.timeToLoadedData_=function(){return this.timeToLoadedData__},t.checkABR_=function(r){r===void 0&&(r="abr");var n=this.selectPlaylist();n&&this.shouldSwitchToMedia_(n)&&this.switchMedia_(n,r)},t.switchMedia_=function(r,n,a){var o=this.media(),l=o&&(o.id||o.uri),u=r.id||r.uri;l&&l!==u&&(this.logger_("switch media "+l+" -> "+u+" from "+n),this.tech_.trigger({type:"usage",name:"vhs-rendition-change-"+n})),this.masterPlaylistLoader_.media(r,a)},t.startABRTimer_=function(){var r=this;this.stopABRTimer_(),this.abrTimer_=O.setInterval(function(){return r.checkABR_()},250)},t.stopABRTimer_=function(){this.tech_.scrubbing&&this.tech_.scrubbing()||(O.clearInterval(this.abrTimer_),this.abrTimer_=null)},t.getAudioTrackPlaylists_=function(){var r=this.master(),n=r&&r.playlists||[];if(!r||!r.mediaGroups||!r.mediaGroups.AUDIO)return n;var a=r.mediaGroups.AUDIO,o=Object.keys(a),l;if(Object.keys(this.mediaTypes_.AUDIO.groups).length)l=this.mediaTypes_.AUDIO.activeTrack();else{var u=a.main||o.length&&a[o[0]];for(var c in u)if(u[c].default){l={label:c};break}}if(!l)return n;var h=[];for(var d in a)if(a[d][l.label]){var g=a[d][l.label];if(g.playlists&&g.playlists.length)h.push.apply(h,g.playlists);else if(g.uri)h.push(g);else if(r.playlists.length)for(var y=0;y<r.playlists.length;y++){var p=r.playlists[y];p.attributes&&p.attributes.AUDIO&&p.attributes.AUDIO===d&&h.push(p)}}return h.length?h:n},t.setupMasterPlaylistLoaderListeners_=function(){var r=this;this.masterPlaylistLoader_.on("loadedmetadata",function(){var n=r.masterPlaylistLoader_.media(),a=n.targetDuration*1.5*1e3;gv(r.masterPlaylistLoader_.master,r.masterPlaylistLoader_.media())?r.requestOptions_.timeout=0:r.requestOptions_.timeout=a,n.endList&&r.tech_.preload()!=="none"&&(r.mainSegmentLoader_.playlist(n,r.requestOptions_),r.mainSegmentLoader_.load()),g5({sourceType:r.sourceType_,segmentLoaders:{AUDIO:r.audioSegmentLoader_,SUBTITLES:r.subtitleSegmentLoader_,main:r.mainSegmentLoader_},tech:r.tech_,requestOptions:r.requestOptions_,masterPlaylistLoader:r.masterPlaylistLoader_,vhs:r.vhs_,master:r.master(),mediaTypes:r.mediaTypes_,blacklistCurrentPlaylist:r.blacklistCurrentPlaylist.bind(r)}),r.triggerPresenceUsage_(r.master(),n),r.setupFirstPlay(),!r.mediaTypes_.AUDIO.activePlaylistLoader||r.mediaTypes_.AUDIO.activePlaylistLoader.media()?r.trigger("selectedinitialmedia"):r.mediaTypes_.AUDIO.activePlaylistLoader.one("loadedmetadata",function(){r.trigger("selectedinitialmedia")})}),this.masterPlaylistLoader_.on("loadedplaylist",function(){r.loadOnPlay_&&r.tech_.off("play",r.loadOnPlay_);var n=r.masterPlaylistLoader_.media();if(!n){r.excludeUnsupportedVariants_();var a;if(r.enableLowInitialPlaylist&&(a=r.selectInitialPlaylist()),a||(a=r.selectPlaylist()),!a||!r.shouldSwitchToMedia_(a))return;r.initialMedia_=a,r.switchMedia_(r.initialMedia_,"initial");var o=r.sourceType_==="vhs-json"&&r.initialMedia_.segments;if(!o)return;n=r.initialMedia_}r.handleUpdatedMediaPlaylist(n)}),this.masterPlaylistLoader_.on("error",function(){r.blacklistCurrentPlaylist(r.masterPlaylistLoader_.error)}),this.masterPlaylistLoader_.on("mediachanging",function(){r.mainSegmentLoader_.abort(),r.mainSegmentLoader_.pause()}),this.masterPlaylistLoader_.on("mediachange",function(){var n=r.masterPlaylistLoader_.media(),a=n.targetDuration*1.5*1e3;gv(r.masterPlaylistLoader_.master,r.masterPlaylistLoader_.media())?r.requestOptions_.timeout=0:r.requestOptions_.timeout=a,r.masterPlaylistLoader_.load(),r.mainSegmentLoader_.playlist(n,r.requestOptions_),r.mainSegmentLoader_.load(),r.tech_.trigger({type:"mediachange",bubbles:!0})}),this.masterPlaylistLoader_.on("playlistunchanged",function(){var n=r.masterPlaylistLoader_.media();if(n.lastExcludeReason_!=="playlist-unchanged"){var a=r.stuckAtPlaylistEnd_(n);a&&(r.blacklistCurrentPlaylist({message:"Playlist no longer updating.",reason:"playlist-unchanged"}),r.tech_.trigger("playliststuck"))}}),this.masterPlaylistLoader_.on("renditiondisabled",function(){r.tech_.trigger({type:"usage",name:"vhs-rendition-disabled"}),r.tech_.trigger({type:"usage",name:"hls-rendition-disabled"})}),this.masterPlaylistLoader_.on("renditionenabled",function(){r.tech_.trigger({type:"usage",name:"vhs-rendition-enabled"}),r.tech_.trigger({type:"usage",name:"hls-rendition-enabled"})})},t.handleUpdatedMediaPlaylist=function(r){this.useCueTags_&&this.updateAdCues_(r),this.mainSegmentLoader_.playlist(r,this.requestOptions_),this.updateDuration(!r.endList),this.tech_.paused()||(this.mainSegmentLoader_.load(),this.audioSegmentLoader_&&this.audioSegmentLoader_.load())},t.triggerPresenceUsage_=function(r,n){var a=r.mediaGroups||{},o=!0,l=Object.keys(a.AUDIO);for(var u in a.AUDIO)for(var c in a.AUDIO[u]){var h=a.AUDIO[u][c];h.uri||(o=!1)}o&&(this.tech_.trigger({type:"usage",name:"vhs-demuxed"}),this.tech_.trigger({type:"usage",name:"hls-demuxed"})),Object.keys(a.SUBTITLES).length&&(this.tech_.trigger({type:"usage",name:"vhs-webvtt"}),this.tech_.trigger({type:"usage",name:"hls-webvtt"})),Sn.Playlist.isAes(n)&&(this.tech_.trigger({type:"usage",name:"vhs-aes"}),this.tech_.trigger({type:"usage",name:"hls-aes"})),l.length&&Object.keys(a.AUDIO[l[0]]).length>1&&(this.tech_.trigger({type:"usage",name:"vhs-alternate-audio"}),this.tech_.trigger({type:"usage",name:"hls-alternate-audio"})),this.useCueTags_&&(this.tech_.trigger({type:"usage",name:"vhs-playlist-cue-tags"}),this.tech_.trigger({type:"usage",name:"hls-playlist-cue-tags"}))},t.shouldSwitchToMedia_=function(r){var n=this.masterPlaylistLoader_.media()||this.masterPlaylistLoader_.pendingMedia_,a=this.tech_.currentTime(),o=this.bufferLowWaterLine(),l=this.bufferHighWaterLine(),u=this.tech_.buffered();return b5({buffered:u,currentTime:a,currentPlaylist:n,nextPlaylist:r,bufferLowWaterLine:o,bufferHighWaterLine:l,duration:this.duration(),experimentalBufferBasedABR:this.experimentalBufferBasedABR,log:this.logger_})},t.setupSegmentLoaderListeners_=function(){var r=this;this.mainSegmentLoader_.on("bandwidthupdate",function(){r.checkABR_("bandwidthupdate"),r.tech_.trigger("bandwidthupdate")}),this.mainSegmentLoader_.on("timeout",function(){r.experimentalBufferBasedABR&&r.mainSegmentLoader_.load()}),this.experimentalBufferBasedABR||this.mainSegmentLoader_.on("progress",function(){r.trigger("progress")}),this.mainSegmentLoader_.on("error",function(){r.blacklistCurrentPlaylist(r.mainSegmentLoader_.error())}),this.mainSegmentLoader_.on("appenderror",function(){r.error=r.mainSegmentLoader_.error_,r.trigger("error")}),this.mainSegmentLoader_.on("syncinfoupdate",function(){r.onSyncInfoUpdate_()}),this.mainSegmentLoader_.on("timestampoffset",function(){r.tech_.trigger({type:"usage",name:"vhs-timestamp-offset"}),r.tech_.trigger({type:"usage",name:"hls-timestamp-offset"})}),this.audioSegmentLoader_.on("syncinfoupdate",function(){r.onSyncInfoUpdate_()}),this.audioSegmentLoader_.on("appenderror",function(){r.error=r.audioSegmentLoader_.error_,r.trigger("error")}),this.mainSegmentLoader_.on("ended",function(){r.logger_("main segment loader ended"),r.onEndOfStream()}),this.mainSegmentLoader_.on("earlyabort",function(a){r.experimentalBufferBasedABR||(r.delegateLoaders_("all",["abort"]),r.blacklistCurrentPlaylist({message:"Aborted early because there isn't enough bandwidth to complete the request without rebuffering."},y5))});var n=function(){if(!r.sourceUpdater_.hasCreatedSourceBuffers())return r.tryToCreateSourceBuffers_();var o=r.getCodecsOrExclude_();o&&r.sourceUpdater_.addOrChangeSourceBuffers(o)};this.mainSegmentLoader_.on("trackinfo",n),this.audioSegmentLoader_.on("trackinfo",n),this.mainSegmentLoader_.on("fmp4",function(){r.triggeredFmp4Usage||(r.tech_.trigger({type:"usage",name:"vhs-fmp4"}),r.tech_.trigger({type:"usage",name:"hls-fmp4"}),r.triggeredFmp4Usage=!0)}),this.audioSegmentLoader_.on("fmp4",function(){r.triggeredFmp4Usage||(r.tech_.trigger({type:"usage",name:"vhs-fmp4"}),r.tech_.trigger({type:"usage",name:"hls-fmp4"}),r.triggeredFmp4Usage=!0)}),this.audioSegmentLoader_.on("ended",function(){r.logger_("audioSegmentLoader ended"),r.onEndOfStream()})},t.mediaSecondsLoaded_=function(){return Math.max(this.audioSegmentLoader_.mediaSecondsLoaded+this.mainSegmentLoader_.mediaSecondsLoaded)},t.load=function(){this.mainSegmentLoader_.load(),this.mediaTypes_.AUDIO.activePlaylistLoader&&this.audioSegmentLoader_.load(),this.mediaTypes_.SUBTITLES.activePlaylistLoader&&this.subtitleSegmentLoader_.load()},t.smoothQualityChange_=function(r){r===void 0&&(r=this.selectPlaylist()),this.fastQualityChange_(r)},t.fastQualityChange_=function(r){var n=this;if(r===void 0&&(r=this.selectPlaylist()),r===this.masterPlaylistLoader_.media()){this.logger_("skipping fastQualityChange because new media is same as old");return}this.switchMedia_(r,"fast-quality"),this.mainSegmentLoader_.resetEverything(function(){ae.browser.IE_VERSION||ae.browser.IS_EDGE?n.tech_.setCurrentTime(n.tech_.currentTime()+.04):n.tech_.setCurrentTime(n.tech_.currentTime())})},t.play=function(){if(!this.setupFirstPlay()){this.tech_.ended()&&this.tech_.setCurrentTime(0),this.hasPlayed_&&this.load();var r=this.tech_.seekable();if(this.tech_.duration()===1/0&&this.tech_.currentTime()<r.start(0))return this.tech_.setCurrentTime(r.end(r.length-1))}},t.setupFirstPlay=function(){var r=this,n=this.masterPlaylistLoader_.media();if(!n||this.tech_.paused()||this.hasPlayed_)return!1;if(!n.endList){var a=this.seekable();if(!a.length)return!1;if(ae.browser.IE_VERSION&&this.tech_.readyState()===0)return this.tech_.one("loadedmetadata",function(){r.trigger("firstplay"),r.tech_.setCurrentTime(a.end(0)),r.hasPlayed_=!0}),!1;this.trigger("firstplay"),this.tech_.setCurrentTime(a.end(0))}return this.hasPlayed_=!0,this.load(),!0},t.handleSourceOpen_=function(){if(this.tryToCreateSourceBuffers_(),this.tech_.autoplay()){var r=this.tech_.play();typeof r<"u"&&typeof r.then=="function"&&r.then(null,function(n){})}this.trigger("sourceopen")},t.handleSourceEnded_=function(){if(this.inbandTextTracks_.metadataTrack_){var r=this.inbandTextTracks_.metadataTrack_.cues;if(!(!r||!r.length)){var n=this.duration();r[r.length-1].endTime=isNaN(n)||Math.abs(n)===1/0?Number.MAX_VALUE:n}}},t.handleDurationChange_=function(){this.tech_.trigger("durationchange")},t.onEndOfStream=function(){var r=this.mainSegmentLoader_.ended_;if(this.mediaTypes_.AUDIO.activePlaylistLoader){var n=this.mainSegmentLoader_.getCurrentMediaInfo_();!n||n.hasVideo?r=r&&this.audioSegmentLoader_.ended_:r=this.audioSegmentLoader_.ended_}r&&(this.stopABRTimer_(),this.sourceUpdater_.endOfStream())},t.stuckAtPlaylistEnd_=function(r){var n=this.seekable();if(!n.length)return!1;var a=this.syncController_.getExpiredTime(r,this.duration());if(a===null)return!1;var o=Sn.Playlist.playlistEnd(r,a),l=this.tech_.currentTime(),u=this.tech_.buffered();if(!u.length)return o-l<=Jr;var c=u.end(u.length-1);return c-l<=Jr&&o-c<=Jr},t.blacklistCurrentPlaylist=function(r,n){r===void 0&&(r={});var a=r.playlist||this.masterPlaylistLoader_.media();if(n=n||r.blacklistDuration||this.blacklistDuration,!a){this.error=r,this.mediaSource.readyState!=="open"?this.trigger("error"):this.sourceUpdater_.endOfStream("network");return}a.playlistErrors_++;var o=this.masterPlaylistLoader_.master.playlists,l=o.filter(vd),u=l.length===1&&l[0]===a;if(o.length===1&&n!==1/0)return ae.log.warn("Problem encountered with playlist "+a.id+". Trying again since it is the only playlist."),this.tech_.trigger("retryplaylist"),this.masterPlaylistLoader_.load(u);if(u){var c=!1;o.forEach(function(k){if(k!==a){var A=k.excludeUntil;typeof A<"u"&&A!==1/0&&(c=!0,delete k.excludeUntil)}}),c&&(ae.log.warn("Removing other playlists from the exclusion list because the last rendition is about to be excluded."),this.tech_.trigger("retryplaylist"))}var h;a.playlistErrors_>this.maxPlaylistRetries?h=1/0:h=Date.now()+n*1e3,a.excludeUntil=h,r.reason&&(a.lastExcludeReason_=r.reason),this.tech_.trigger("blacklistplaylist"),this.tech_.trigger({type:"usage",name:"vhs-rendition-blacklisted"}),this.tech_.trigger({type:"usage",name:"hls-rendition-blacklisted"});var d=this.selectPlaylist();if(!d){this.error="Playback cannot continue. No available working or supported playlists.",this.trigger("error");return}var g=r.internal?this.logger_:ae.log.warn,y=r.message?" "+r.message:"";g((r.internal?"Internal problem":"Problem")+" encountered with playlist "+a.id+"."+(y+" Switching to playlist "+d.id+".")),d.attributes.AUDIO!==a.attributes.AUDIO&&this.delegateLoaders_("audio",["abort","pause"]),d.attributes.SUBTITLES!==a.attributes.SUBTITLES&&this.delegateLoaders_("subtitle",["abort","pause"]),this.delegateLoaders_("main",["abort","pause"]);var p=d.targetDuration/2*1e3||5*1e3,_=typeof d.lastRequest=="number"&&Date.now()-d.lastRequest<=p;return this.switchMedia_(d,"exclude",u||_)},t.pauseLoading=function(){this.delegateLoaders_("all",["abort","pause"]),this.stopABRTimer_()},t.delegateLoaders_=function(r,n){var a=this,o=[],l=r==="all";(l||r==="main")&&o.push(this.masterPlaylistLoader_);var u=[];(l||r==="audio")&&u.push("AUDIO"),(l||r==="subtitle")&&(u.push("CLOSED-CAPTIONS"),u.push("SUBTITLES")),u.forEach(function(c){var h=a.mediaTypes_[c]&&a.mediaTypes_[c].activePlaylistLoader;h&&o.push(h)}),["main","audio","subtitle"].forEach(function(c){var h=a[c+"SegmentLoader_"];h&&(r===c||r==="all")&&o.push(h)}),o.forEach(function(c){return n.forEach(function(h){typeof c[h]=="function"&&c[h]()})})},t.setCurrentTime=function(r){var n=Qa(this.tech_.buffered(),r);if(!(this.masterPlaylistLoader_&&this.masterPlaylistLoader_.media())||!this.masterPlaylistLoader_.media().segments)return 0;if(n&&n.length)return r;this.mainSegmentLoader_.resetEverything(),this.mainSegmentLoader_.abort(),this.mediaTypes_.AUDIO.activePlaylistLoader&&(this.audioSegmentLoader_.resetEverything(),this.audioSegmentLoader_.abort()),this.mediaTypes_.SUBTITLES.activePlaylistLoader&&(this.subtitleSegmentLoader_.resetEverything(),this.subtitleSegmentLoader_.abort()),this.load()},t.duration=function(){if(!this.masterPlaylistLoader_)return 0;var r=this.masterPlaylistLoader_.media();return r?r.endList?this.mediaSource?this.mediaSource.duration:Sn.Playlist.duration(r):1/0:0},t.seekable=function(){return this.seekable_},t.onSyncInfoUpdate_=function(){var r;if(this.masterPlaylistLoader_){var n=this.masterPlaylistLoader_.media();if(n){var a=this.syncController_.getExpiredTime(n,this.duration());if(a!==null){var o=this.masterPlaylistLoader_.master,l=Sn.Playlist.seekable(n,a,Sn.Playlist.liveEdgeDelay(o,n));if(l.length!==0&&!(this.mediaTypes_.AUDIO.activePlaylistLoader&&(n=this.mediaTypes_.AUDIO.activePlaylistLoader.media(),a=this.syncController_.getExpiredTime(n,this.duration()),a===null||(r=Sn.Playlist.seekable(n,a,Sn.Playlist.liveEdgeDelay(o,n)),r.length===0)))){var u,c;this.seekable_&&this.seekable_.length&&(u=this.seekable_.end(0),c=this.seekable_.start(0)),r?r.start(0)>l.end(0)||l.start(0)>r.end(0)?this.seekable_=l:this.seekable_=ae.createTimeRanges([[r.start(0)>l.start(0)?r.start(0):l.start(0),r.end(0)<l.end(0)?r.end(0):l.end(0)]]):this.seekable_=l,!(this.seekable_&&this.seekable_.length&&this.seekable_.end(0)===u&&this.seekable_.start(0)===c)&&(this.logger_("seekable updated ["+Uk(this.seekable_)+"]"),this.tech_.trigger("seekablechanged"))}}}}},t.updateDuration=function(r){if(this.updateDuration_&&(this.mediaSource.removeEventListener("sourceopen",this.updateDuration_),this.updateDuration_=null),this.mediaSource.readyState!=="open"){this.updateDuration_=this.updateDuration.bind(this,r),this.mediaSource.addEventListener("sourceopen",this.updateDuration_);return}if(r){var n=this.seekable();if(!n.length)return;(isNaN(this.mediaSource.duration)||this.mediaSource.duration<n.end(n.length-1))&&this.sourceUpdater_.setDuration(n.end(n.length-1));return}var a=this.tech_.buffered(),o=Sn.Playlist.duration(this.masterPlaylistLoader_.media());a.length>0&&(o=Math.max(o,a.end(a.length-1))),this.mediaSource.duration!==o&&this.sourceUpdater_.setDuration(o)},t.dispose=function(){var r=this;this.trigger("dispose"),this.decrypter_.terminate(),this.masterPlaylistLoader_.dispose(),this.mainSegmentLoader_.dispose(),this.loadOnPlay_&&this.tech_.off("play",this.loadOnPlay_),["AUDIO","SUBTITLES"].forEach(function(n){var a=r.mediaTypes_[n].groups;for(var o in a)a[o].forEach(function(l){l.playlistLoader&&l.playlistLoader.dispose()})}),this.audioSegmentLoader_.dispose(),this.subtitleSegmentLoader_.dispose(),this.sourceUpdater_.dispose(),this.timelineChangeController_.dispose(),this.stopABRTimer_(),this.updateDuration_&&this.mediaSource.removeEventListener("sourceopen",this.updateDuration_),this.mediaSource.removeEventListener("durationchange",this.handleDurationChange_),this.mediaSource.removeEventListener("sourceopen",this.handleSourceOpen_),this.mediaSource.removeEventListener("sourceended",this.handleSourceEnded_),this.off()},t.master=function(){return this.masterPlaylistLoader_.master},t.media=function(){return this.masterPlaylistLoader_.media()||this.initialMedia_},t.areMediaTypesKnown_=function(){var r=!!this.mediaTypes_.AUDIO.activePlaylistLoader,n=!!this.mainSegmentLoader_.getCurrentMediaInfo_(),a=r?!!this.audioSegmentLoader_.getCurrentMediaInfo_():!0;return!(!n||!a)},t.getCodecsOrExclude_=function(){var r=this,n={main:this.mainSegmentLoader_.getCurrentMediaInfo_()||{},audio:this.audioSegmentLoader_.getCurrentMediaInfo_()||{}},a=this.mainSegmentLoader_.getPendingSegmentPlaylist()||this.media();n.video=n.main;var o=Vl(this.master(),a),l={},u=!!this.mediaTypes_.AUDIO.activePlaylistLoader;if(n.main.hasVideo&&(l.video=o.video||n.main.videoCodec||yF),n.main.isMuxed&&(l.video+=","+(o.audio||n.main.audioCodec||RT)),(n.main.hasAudio&&!n.main.isMuxed||n.audio.hasAudio||u)&&(l.audio=o.audio||n.main.audioCodec||n.audio.audioCodec||RT,n.audio.isFmp4=n.main.hasAudio&&!n.main.isMuxed?n.main.isFmp4:n.audio.isFmp4),!l.audio&&!l.video){this.blacklistCurrentPlaylist({playlist:a,message:"Could not determine codecs for playlist.",blacklistDuration:1/0});return}var c=function(k,A){return k?Lc(A):Xf(A)},h={},d;if(["video","audio"].forEach(function(_){if(l.hasOwnProperty(_)&&!c(n[_].isFmp4,l[_])){var k=n[_].isFmp4?"browser":"muxer";h[k]=h[k]||[],h[k].push(l[_]),_==="audio"&&(d=k)}}),u&&d&&a.attributes.AUDIO){var g=a.attributes.AUDIO;this.master().playlists.forEach(function(_){var k=_.attributes&&_.attributes.AUDIO;k===g&&_!==a&&(_.excludeUntil=1/0)}),this.logger_("excluding audio group "+g+" as "+d+' does not support codec(s): "'+l.audio+'"')}if(Object.keys(h).length){var y=Object.keys(h).reduce(function(_,k){return _&&(_+=", "),_+=k+' does not support codec(s): "'+h[k].join(",")+'"',_},"")+".";this.blacklistCurrentPlaylist({playlist:a,internal:!0,message:y,blacklistDuration:1/0});return}if(this.sourceUpdater_.hasCreatedSourceBuffers()&&!this.sourceUpdater_.canChangeType()){var p=[];if(["video","audio"].forEach(function(_){var k=(Hr(r.sourceUpdater_.codecs[_]||"")[0]||{}).type,A=(Hr(l[_]||"")[0]||{}).type;k&&A&&k.toLowerCase()!==A.toLowerCase()&&p.push('"'+r.sourceUpdater_.codecs[_]+'" -> "'+l[_]+'"')}),p.length){this.blacklistCurrentPlaylist({playlist:a,message:"Codec switching not supported: "+p.join(", ")+".",blacklistDuration:1/0,internal:!0});return}}return l},t.tryToCreateSourceBuffers_=function(){if(!(this.mediaSource.readyState!=="open"||this.sourceUpdater_.hasCreatedSourceBuffers())&&this.areMediaTypesKnown_()){var r=this.getCodecsOrExclude_();if(r){this.sourceUpdater_.createSourceBuffers(r);var n=[r.video,r.audio].filter(Boolean).join(",");this.excludeIncompatibleVariants_(n)}}},t.excludeUnsupportedVariants_=function(){var r=this,n=this.master().playlists,a=[];Object.keys(n).forEach(function(o){var l=n[o];if(a.indexOf(l.id)===-1){a.push(l.id);var u=Vl(r.master,l),c=[];u.audio&&!Xf(u.audio)&&!Lc(u.audio)&&c.push("audio codec "+u.audio),u.video&&!Xf(u.video)&&!Lc(u.video)&&c.push("video codec "+u.video),u.text&&u.text==="stpp.ttml.im1t"&&c.push("text codec "+u.text),c.length&&(l.excludeUntil=1/0,r.logger_("excluding "+l.id+" for unsupported: "+c.join(", ")))}})},t.excludeIncompatibleVariants_=function(r){var n=this,a=[],o=this.master().playlists,l=Ch(Hr(r)),u=Pb(l),c=l.video&&Hr(l.video)[0]||null,h=l.audio&&Hr(l.audio)[0]||null;Object.keys(o).forEach(function(d){var g=o[d];if(!(a.indexOf(g.id)!==-1||g.excludeUntil===1/0)){a.push(g.id);var y=[],p=Vl(n.masterPlaylistLoader_.master,g),_=Pb(p);if(!(!p.audio&&!p.video)){if(_!==u&&y.push('codec count "'+_+'" !== "'+u+'"'),!n.sourceUpdater_.canChangeType()){var k=p.video&&Hr(p.video)[0]||null,A=p.audio&&Hr(p.audio)[0]||null;k&&c&&k.type.toLowerCase()!==c.type.toLowerCase()&&y.push('video codec "'+k.type+'" !== "'+c.type+'"'),A&&h&&A.type.toLowerCase()!==h.type.toLowerCase()&&y.push('audio codec "'+A.type+'" !== "'+h.type+'"')}y.length&&(g.excludeUntil=1/0,n.logger_("blacklisting "+g.id+": "+y.join(" && ")))}}})},t.updateAdCues_=function(r){var n=0,a=this.seekable();a.length&&(n=a.start(0)),t5(r,this.cueTagsTrack_,n)},t.goalBufferLength=function(){var r=this.tech_.currentTime(),n=ti.GOAL_BUFFER_LENGTH,a=ti.GOAL_BUFFER_LENGTH_RATE,o=Math.max(n,ti.MAX_GOAL_BUFFER_LENGTH);return Math.min(n+r*a,o)},t.bufferLowWaterLine=function(){var r=this.tech_.currentTime(),n=ti.BUFFER_LOW_WATER_LINE,a=ti.BUFFER_LOW_WATER_LINE_RATE,o=Math.max(n,ti.MAX_BUFFER_LOW_WATER_LINE),l=Math.max(n,ti.EXPERIMENTAL_MAX_BUFFER_LOW_WATER_LINE);return Math.min(n+r*a,this.experimentalBufferBasedABR?l:o)},t.bufferHighWaterLine=function(){return ti.BUFFER_HIGH_WATER_LINE},e}(ae.EventTarget),x5=function(e,t,i){return function(r){var n=e.master.playlists[t],a=oy(n),o=vd(n);return typeof r>"u"?o:(r?delete n.disabled:n.disabled=!0,r!==o&&!a&&(i(),r?e.trigger("renditionenabled"):e.trigger("renditiondisabled")),r)}},C5=function(e,t,i){var r=e.masterPlaylistController_,n=e.options_.smoothQualityChange,a=n?"smooth":"fast",o=r[a+"QualityChange_"].bind(r);if(t.attributes){var l=t.attributes.RESOLUTION;this.width=l&&l.width,this.height=l&&l.height,this.bandwidth=t.attributes.BANDWIDTH,this.frameRate=t.attributes["FRAME-RATE"]}this.codecs=Vl(r.master(),t),this.playlist=t,this.id=i,this.enabled=x5(e.playlists,t.id,o)},E5=function(e){e.representations=function(){var t=e.masterPlaylistController_.master(),i=_u(t)?e.masterPlaylistController_.getAudioTrackPlaylists_():t.playlists;return i?i.filter(function(r){return!oy(r)}).map(function(r,n){return new C5(e,r,r.id)}):[]}},qb=["seeking","seeked","pause","playing","error"],w5=function(){function s(t){var i=this;this.masterPlaylistController_=t.masterPlaylistController,this.tech_=t.tech,this.seekable=t.seekable,this.allowSeeksWithinUnsafeLiveWindow=t.allowSeeksWithinUnsafeLiveWindow,this.liveRangeSafeTimeDelta=t.liveRangeSafeTimeDelta,this.media=t.media,this.consecutiveUpdates=0,this.lastRecordedTime=null,this.timer_=null,this.checkCurrentTimeTimeout_=null,this.logger_=Mr("PlaybackWatcher"),this.logger_("initialize");var r=function(){return i.monitorCurrentTime_()},n=function(){return i.monitorCurrentTime_()},a=function(){return i.techWaiting_()},o=function(){return i.cancelTimer_()},l=this.masterPlaylistController_,u=["main","subtitle","audio"],c={};u.forEach(function(d){c[d]={reset:function(){return i.resetSegmentDownloads_(d)},updateend:function(){return i.checkSegmentDownloads_(d)}},l[d+"SegmentLoader_"].on("appendsdone",c[d].updateend),l[d+"SegmentLoader_"].on("playlistupdate",c[d].reset),i.tech_.on(["seeked","seeking"],c[d].reset)});var h=function(g){["main","audio"].forEach(function(y){l[y+"SegmentLoader_"][g]("appended",i.seekingAppendCheck_)})};this.seekingAppendCheck_=function(){i.fixesBadSeeks_()&&(i.consecutiveUpdates=0,i.lastRecordedTime=i.tech_.currentTime(),h("off"))},this.clearSeekingAppendCheck_=function(){return h("off")},this.watchForBadSeeking_=function(){i.clearSeekingAppendCheck_(),h("on")},this.tech_.on("seeked",this.clearSeekingAppendCheck_),this.tech_.on("seeking",this.watchForBadSeeking_),this.tech_.on("waiting",a),this.tech_.on(qb,o),this.tech_.on("canplay",n),this.tech_.one("play",r),this.dispose=function(){i.clearSeekingAppendCheck_(),i.logger_("dispose"),i.tech_.off("waiting",a),i.tech_.off(qb,o),i.tech_.off("canplay",n),i.tech_.off("play",r),i.tech_.off("seeking",i.watchForBadSeeking_),i.tech_.off("seeked",i.clearSeekingAppendCheck_),u.forEach(function(d){l[d+"SegmentLoader_"].off("appendsdone",c[d].updateend),l[d+"SegmentLoader_"].off("playlistupdate",c[d].reset),i.tech_.off(["seeked","seeking"],c[d].reset)}),i.checkCurrentTimeTimeout_&&O.clearTimeout(i.checkCurrentTimeTimeout_),i.cancelTimer_()}}var e=s.prototype;return e.monitorCurrentTime_=function(){this.checkCurrentTime_(),this.checkCurrentTimeTimeout_&&O.clearTimeout(this.checkCurrentTimeTimeout_),this.checkCurrentTimeTimeout_=O.setTimeout(this.monitorCurrentTime_.bind(this),250)},e.resetSegmentDownloads_=function(i){var r=this.masterPlaylistController_[i+"SegmentLoader_"];this[i+"StalledDownloads_"]>0&&this.logger_("resetting possible stalled download count for "+i+" loader"),this[i+"StalledDownloads_"]=0,this[i+"Buffered_"]=r.buffered_()},e.checkSegmentDownloads_=function(i){var r=this.masterPlaylistController_,n=r[i+"SegmentLoader_"],a=n.buffered_(),o=v8(this[i+"Buffered_"],a);if(this[i+"Buffered_"]=a,o){this.resetSegmentDownloads_(i);return}this[i+"StalledDownloads_"]++,this.logger_("found #"+this[i+"StalledDownloads_"]+" "+i+" appends that did not increase buffer (possible stalled download)",{playlistId:n.playlist_&&n.playlist_.id,buffered:Hs(a)}),!(this[i+"StalledDownloads_"]<10)&&(this.logger_(i+" loader stalled download exclusion"),this.resetSegmentDownloads_(i),this.tech_.trigger({type:"usage",name:"vhs-"+i+"-download-exclusion"}),i!=="subtitle"&&r.blacklistCurrentPlaylist({message:"Excessive "+i+" segment downloading detected."},1/0))},e.checkCurrentTime_=function(){if(!(this.tech_.paused()||this.tech_.seeking())){var i=this.tech_.currentTime(),r=this.tech_.buffered();if(this.lastRecordedTime===i&&(!r.length||i+Jr>=r.end(r.length-1)))return this.techWaiting_();this.consecutiveUpdates>=5&&i===this.lastRecordedTime?(this.consecutiveUpdates++,this.waiting_()):i===this.lastRecordedTime?this.consecutiveUpdates++:(this.consecutiveUpdates=0,this.lastRecordedTime=i)}},e.cancelTimer_=function(){this.consecutiveUpdates=0,this.timer_&&(this.logger_("cancelTimer_"),clearTimeout(this.timer_)),this.timer_=null},e.fixesBadSeeks_=function(){var i=this.tech_.seeking();if(!i)return!1;var r=this.seekable(),n=this.tech_.currentTime(),a=this.afterSeekableWindow_(r,n,this.media(),this.allowSeeksWithinUnsafeLiveWindow),o;if(a){var l=r.end(r.length-1);o=l}if(this.beforeSeekableWindow_(r,n)){var u=r.start(0);o=u+(u===r.end(0)?0:Jr)}if(typeof o<"u")return this.logger_("Trying to seek outside of seekable at time "+n+" with "+("seekable range "+Uk(r)+". Seeking to ")+(o+".")),this.tech_.setCurrentTime(o),!0;for(var c=this.masterPlaylistController_.sourceUpdater_,h=this.tech_.buffered(),d=c.audioBuffer?c.audioBuffered():null,g=c.videoBuffer?c.videoBuffered():null,y=this.media(),p=y.partTargetDuration?y.partTargetDuration:(y.targetDuration-hs)*2,_=[d,g],k=0;k<_.length;k++)if(_[k]){var A=sy(_[k],n);if(A<p)return!1}var N=vc(h,n);return N.length===0?!1:(o=N.start(0)+Jr,this.logger_("Buffered region starts ("+N.start(0)+") "+(" just beyond seek point ("+n+"). Seeking to "+o+".")),this.tech_.setCurrentTime(o),!0)},e.waiting_=function(){if(!this.techWaiting_()){var i=this.tech_.currentTime(),r=this.tech_.buffered(),n=Qa(r,i);if(n.length&&i+3<=n.end(0)){this.cancelTimer_(),this.tech_.setCurrentTime(i),this.logger_("Stopped at "+i+" while inside a buffered region "+("["+n.start(0)+" -> "+n.end(0)+"]. Attempting to resume ")+"playback by seeking to the current time."),this.tech_.trigger({type:"usage",name:"vhs-unknown-waiting"}),this.tech_.trigger({type:"usage",name:"hls-unknown-waiting"});return}}},e.techWaiting_=function(){var i=this.seekable(),r=this.tech_.currentTime();if(this.tech_.seeking()||this.timer_!==null)return!0;if(this.beforeSeekableWindow_(i,r)){var n=i.end(i.length-1);return this.logger_("Fell out of live window at time "+r+". Seeking to "+("live point (seekable end) "+n)),this.cancelTimer_(),this.tech_.setCurrentTime(n),this.tech_.trigger({type:"usage",name:"vhs-live-resync"}),this.tech_.trigger({type:"usage",name:"hls-live-resync"}),!0}var a=this.tech_.vhs.masterPlaylistController_.sourceUpdater_,o=this.tech_.buffered(),l=this.videoUnderflow_({audioBuffered:a.audioBuffered(),videoBuffered:a.videoBuffered(),currentTime:r});if(l)return this.cancelTimer_(),this.tech_.setCurrentTime(r),this.tech_.trigger({type:"usage",name:"vhs-video-underflow"}),this.tech_.trigger({type:"usage",name:"hls-video-underflow"}),!0;var u=vc(o,r);if(u.length>0){var c=u.start(0)-r;return this.logger_("Stopped at "+r+", setting timer for "+c+", seeking "+("to "+u.start(0))),this.cancelTimer_(),this.timer_=setTimeout(this.skipTheGap_.bind(this),c*1e3,r),!0}return!1},e.afterSeekableWindow_=function(i,r,n,a){if(a===void 0&&(a=!1),!i.length)return!1;var o=i.end(i.length-1)+Jr,l=!n.endList;return l&&a&&(o=i.end(i.length-1)+n.targetDuration*3),r>o},e.beforeSeekableWindow_=function(i,r){return!!(i.length&&i.start(0)>0&&r<i.start(0)-this.liveRangeSafeTimeDelta)},e.videoUnderflow_=function(i){var r=i.videoBuffered,n=i.audioBuffered,a=i.currentTime;if(r){var o;if(r.length&&n.length){var l=Qa(r,a-3),u=Qa(r,a),c=Qa(n,a);c.length&&!u.length&&l.length&&(o={start:l.end(0),end:c.end(0)})}else{var h=vc(r,a);h.length||(o=this.gapFromVideoUnderflow_(r,a))}return o?(this.logger_("Encountered a gap in video from "+o.start+" to "+o.end+". "+("Seeking to current time "+a)),!0):!1}},e.skipTheGap_=function(i){var r=this.tech_.buffered(),n=this.tech_.currentTime(),a=vc(r,n);this.cancelTimer_(),!(a.length===0||n!==i)&&(this.logger_("skipTheGap_:","currentTime:",n,"scheduled currentTime:",i,"nextRange start:",a.start(0)),this.tech_.setCurrentTime(a.start(0)+hs),this.tech_.trigger({type:"usage",name:"vhs-gap-skip"}),this.tech_.trigger({type:"usage",name:"hls-gap-skip"}))},e.gapFromVideoUnderflow_=function(i,r){for(var n=p8(i),a=0;a<n.length;a++){var o=n.start(a),l=n.end(a);if(r-o<4&&r-o>2)return{start:o,end:l}}return null},s}(),k5={errorInterval:30,getSource:function(e){var t=this.tech({IWillNotUseThisInPlugins:!0}),i=t.currentSource_||this.currentSource();return e(i)}},A5=function s(e,t){var i=0,r=0,n=ae.mergeOptions(k5,t);e.ready(function(){e.trigger({type:"usage",name:"vhs-error-reload-initialized"}),e.trigger({type:"usage",name:"hls-error-reload-initialized"})});var a=function(){r&&e.currentTime(r)},o=function(d){d!=null&&(r=e.duration()!==1/0&&e.currentTime()||0,e.one("loadedmetadata",a),e.src(d),e.trigger({type:"usage",name:"vhs-error-reload"}),e.trigger({type:"usage",name:"hls-error-reload"}),e.play())},l=function(){if(Date.now()-i<n.errorInterval*1e3){e.trigger({type:"usage",name:"vhs-error-reload-canceled"}),e.trigger({type:"usage",name:"hls-error-reload-canceled"});return}if(!n.getSource||typeof n.getSource!="function"){ae.log.error("ERROR: reloadSourceOnError - The option getSource must be a function!");return}return i=Date.now(),n.getSource.call(e,o)},u=function h(){e.off("loadedmetadata",a),e.off("error",l),e.off("dispose",h)},c=function(d){u(),s(e,d)};e.on("error",l),e.on("dispose",u),e.reloadSourceOnError=c},I5=function(e){A5(this,e)},xA="2.16.3",P5="6.0.1",D5="0.22.1",N5="4.8.0",L5="3.1.3",di={PlaylistLoader:Ya,Playlist:Vi,utils:q8,STANDARD_PLAYLIST_SELECTOR:Nb,INITIAL_PLAYLIST_SELECTOR:DU,lastBandwidthSelector:Nb,movingAverageBandwidthSelector:IU,comparePlaylistBandwidth:hy,comparePlaylistResolution:AU,xhr:eA()};Object.keys(ti).forEach(function(s){Object.defineProperty(di,s,{get:function(){return ae.log.warn("using Vhs."+s+" is UNSAFE be sure you know what you are doing"),ti[s]},set:function(t){if(ae.log.warn("using Vhs."+s+" is UNSAFE be sure you know what you are doing"),typeof t!="number"||t<0){ae.log.warn("value of Vhs."+s+" must be greater than or equal to 0");return}ti[s]=t}})});var CA="videojs-vhs",EA=function(e,t){for(var i=t.media(),r=-1,n=0;n<e.length;n++)if(e[n].id===i.id){r=n;break}e.selectedIndex_=r,e.trigger({selectedIndex:r,type:"change"})},O5=function(e,t){t.representations().forEach(function(i){e.addQualityLevel(i)}),EA(e,t.playlists)};di.canPlaySource=function(){return ae.log.warn("HLS is no longer a tech. Please remove it from your player's techOrder.")};var M5=function(e,t,i){if(!e)return e;var r={};t&&t.attributes&&t.attributes.CODECS&&(r=Ch(Hr(t.attributes.CODECS))),i&&i.attributes&&i.attributes.CODECS&&(r.audio=i.attributes.CODECS);var n=Ql(r.video),a=Ql(r.audio),o={};for(var l in e)o[l]={},a&&(o[l].audioContentType=a),n&&(o[l].videoContentType=n),t.contentProtection&&t.contentProtection[l]&&t.contentProtection[l].pssh&&(o[l].pssh=t.contentProtection[l].pssh),typeof e[l]=="string"&&(o[l].url=e[l]);return ae.mergeOptions(e,o)},R5=function(e,t){return e.reduce(function(i,r){if(!r.contentProtection)return i;var n=t.reduce(function(a,o){var l=r.contentProtection[o];return l&&l.pssh&&(a[o]={pssh:l.pssh}),a},{});return Object.keys(n).length&&i.push(n),i},[])},F5=function(e){var t=e.player,i=e.sourceKeySystems,r=e.audioMedia,n=e.mainPlaylists;if(!t.eme.initializeMediaKeys)return Promise.resolve();var a=r?n.concat([r]):n,o=R5(a,Object.keys(i)),l=[],u=[];return o.forEach(function(c){u.push(new Promise(function(h,d){t.tech_.one("keysessioncreated",h)})),l.push(new Promise(function(h,d){t.eme.initializeMediaKeys({keySystems:c},function(g){if(g){d(g);return}h()})}))}),Promise.race([Promise.all(l),Promise.race(u)])},B5=function(e){var t=e.player,i=e.sourceKeySystems,r=e.media,n=e.audioMedia,a=M5(i,r,n);return a?(t.currentSource().keySystems=a,a&&!t.eme?(ae.log.warn("DRM encrypted source cannot be decrypted without a DRM plugin"),!1):!0):!1},wA=function(){if(!O.localStorage)return null;var e=O.localStorage.getItem(CA);if(!e)return null;try{return JSON.parse(e)}catch{return null}},U5=function(e){if(!O.localStorage)return!1;var t=wA();t=t?ae.mergeOptions(t,e):e;try{O.localStorage.setItem(CA,JSON.stringify(t))}catch{return!1}return t},$5=function(e){return e.toLowerCase().indexOf("data:application/vnd.videojs.vhs+json,")===0?JSON.parse(e.substring(e.indexOf(",")+1)):e};di.supportsNativeHls=function(){if(!ce||!ce.createElement)return!1;var s=ce.createElement("video");if(!ae.getTech("Html5").isSupported())return!1;var e=["application/vnd.apple.mpegurl","audio/mpegurl","audio/x-mpegurl","application/x-mpegurl","video/x-mpegurl","video/mpegurl","application/mpegurl"];return e.some(function(t){return/maybe|probably/i.test(s.canPlayType(t))})}();di.supportsNativeDash=function(){return!ce||!ce.createElement||!ae.getTech("Html5").isSupported()?!1:/maybe|probably/i.test(ce.createElement("video").canPlayType("application/dash+xml"))}();di.supportsTypeNatively=function(s){return s==="hls"?di.supportsNativeHls:s==="dash"?di.supportsNativeDash:!1};di.isSupported=function(){return ae.log.warn("HLS is no longer a tech. Please remove it from your player's techOrder.")};var j5=ae.getComponent("Component"),fy=function(s){Ce(e,s);function e(i,r,n){var a;if(a=s.call(this,r,ae.mergeOptions(n.hls,n.vhs))||this,n.hls&&Object.keys(n.hls).length&&ae.log.warn("Using hls options is deprecated. Please rename `hls` to `vhs` in your options object."),typeof n.initialBandwidth=="number"&&(a.options_.bandwidth=n.initialBandwidth),a.logger_=Mr("VhsHandler"),r.options_&&r.options_.playerId){var o=ae(r.options_.playerId);o.hasOwnProperty("hls")||Object.defineProperty(o,"hls",{get:function(){return ae.log.warn("player.hls is deprecated. Use player.tech().vhs instead."),r.trigger({type:"usage",name:"hls-player-access"}),We(a)},configurable:!0}),o.hasOwnProperty("vhs")||Object.defineProperty(o,"vhs",{get:function(){return ae.log.warn("player.vhs is deprecated. Use player.tech().vhs instead."),r.trigger({type:"usage",name:"vhs-player-access"}),We(a)},configurable:!0}),o.hasOwnProperty("dash")||Object.defineProperty(o,"dash",{get:function(){return ae.log.warn("player.dash is deprecated. Use player.tech().vhs instead."),We(a)},configurable:!0}),a.player_=o}if(a.tech_=r,a.source_=i,a.stats={},a.ignoreNextSeekingEvent_=!1,a.setOptions_(),a.options_.overrideNative&&r.overrideNativeAudioTracks&&r.overrideNativeVideoTracks)r.overrideNativeAudioTracks(!0),r.overrideNativeVideoTracks(!0);else if(a.options_.overrideNative&&(r.featuresNativeVideoTracks||r.featuresNativeAudioTracks))throw new Error("Overriding native HLS requires emulated tracks. See https://git.io/vMpjB");return a.on(ce,["fullscreenchange","webkitfullscreenchange","mozfullscreenchange","MSFullscreenChange"],function(l){var u=ce.fullscreenElement||ce.webkitFullscreenElement||ce.mozFullScreenElement||ce.msFullscreenElement;u&&u.contains(a.tech_.el())?a.masterPlaylistController_.fastQualityChange_():a.masterPlaylistController_.checkABR_()}),a.on(a.tech_,"seeking",function(){if(this.ignoreNextSeekingEvent_){this.ignoreNextSeekingEvent_=!1;return}this.setCurrentTime(this.tech_.currentTime())}),a.on(a.tech_,"error",function(){this.tech_.error()&&this.masterPlaylistController_&&this.masterPlaylistController_.pauseLoading()}),a.on(a.tech_,"play",a.play),a}var t=e.prototype;return t.setOptions_=function(){var r=this;if(this.options_.withCredentials=this.options_.withCredentials||!1,this.options_.handleManifestRedirects=this.options_.handleManifestRedirects!==!1,this.options_.limitRenditionByPlayerDimensions=this.options_.limitRenditionByPlayerDimensions!==!1,this.options_.useDevicePixelRatio=this.options_.useDevicePixelRatio||!1,this.options_.smoothQualityChange=this.options_.smoothQualityChange||!1,this.options_.useBandwidthFromLocalStorage=typeof this.source_.useBandwidthFromLocalStorage<"u"?this.source_.useBandwidthFromLocalStorage:this.options_.useBandwidthFromLocalStorage||!1,this.options_.useNetworkInformationApi=this.options_.useNetworkInformationApi||!1,this.options_.useDtsForTimestampOffset=this.options_.useDtsForTimestampOffset||!1,this.options_.customTagParsers=this.options_.customTagParsers||[],this.options_.customTagMappers=this.options_.customTagMappers||[],this.options_.cacheEncryptionKeys=this.options_.cacheEncryptionKeys||!1,typeof this.options_.blacklistDuration!="number"&&(this.options_.blacklistDuration=5*60),typeof this.options_.bandwidth!="number"&&this.options_.useBandwidthFromLocalStorage){var n=wA();n&&n.bandwidth&&(this.options_.bandwidth=n.bandwidth,this.tech_.trigger({type:"usage",name:"vhs-bandwidth-from-local-storage"}),this.tech_.trigger({type:"usage",name:"hls-bandwidth-from-local-storage"})),n&&n.throughput&&(this.options_.throughput=n.throughput,this.tech_.trigger({type:"usage",name:"vhs-throughput-from-local-storage"}),this.tech_.trigger({type:"usage",name:"hls-throughput-from-local-storage"}))}typeof this.options_.bandwidth!="number"&&(this.options_.bandwidth=ti.INITIAL_BANDWIDTH),this.options_.enableLowInitialPlaylist=this.options_.enableLowInitialPlaylist&&this.options_.bandwidth===ti.INITIAL_BANDWIDTH,["withCredentials","useDevicePixelRatio","limitRenditionByPlayerDimensions","bandwidth","smoothQualityChange","customTagParsers","customTagMappers","handleManifestRedirects","cacheEncryptionKeys","playlistSelector","initialPlaylistSelector","experimentalBufferBasedABR","liveRangeSafeTimeDelta","experimentalLLHLS","useNetworkInformationApi","useDtsForTimestampOffset","experimentalExactManifestTimings","experimentalLeastPixelDiffSelector"].forEach(function(a){typeof r.source_[a]<"u"&&(r.options_[a]=r.source_[a])}),this.limitRenditionByPlayerDimensions=this.options_.limitRenditionByPlayerDimensions,this.useDevicePixelRatio=this.options_.useDevicePixelRatio},t.src=function(r,n){var a=this;if(r){this.setOptions_(),this.options_.src=$5(this.source_.src),this.options_.tech=this.tech_,this.options_.externVhs=di,this.options_.sourceType=yw(n),this.options_.seekTo=function(u){a.tech_.setCurrentTime(u)},this.options_.smoothQualityChange&&ae.log.warn("smoothQualityChange is deprecated and will be removed in the next major version"),this.masterPlaylistController_=new S5(this.options_);var o=ae.mergeOptions({liveRangeSafeTimeDelta:Jr},this.options_,{seekable:function(){return a.seekable()},media:function(){return a.masterPlaylistController_.media()},masterPlaylistController:this.masterPlaylistController_});this.playbackWatcher_=new w5(o),this.masterPlaylistController_.on("error",function(){var u=ae.players[a.tech_.options_.playerId],c=a.masterPlaylistController_.error;typeof c=="object"&&!c.code?c.code=3:typeof c=="string"&&(c={message:c,code:3}),u.error(c)});var l=this.options_.experimentalBufferBasedABR?di.movingAverageBandwidthSelector(.55):di.STANDARD_PLAYLIST_SELECTOR;this.masterPlaylistController_.selectPlaylist=this.selectPlaylist?this.selectPlaylist.bind(this):l.bind(this),this.masterPlaylistController_.selectInitialPlaylist=di.INITIAL_PLAYLIST_SELECTOR.bind(this),this.playlists=this.masterPlaylistController_.masterPlaylistLoader_,this.mediaSource=this.masterPlaylistController_.mediaSource,Object.defineProperties(this,{selectPlaylist:{get:function(){return this.masterPlaylistController_.selectPlaylist},set:function(c){this.masterPlaylistController_.selectPlaylist=c.bind(this)}},throughput:{get:function(){return this.masterPlaylistController_.mainSegmentLoader_.throughput.rate},set:function(c){this.masterPlaylistController_.mainSegmentLoader_.throughput.rate=c,this.masterPlaylistController_.mainSegmentLoader_.throughput.count=1}},bandwidth:{get:function(){var c=this.masterPlaylistController_.mainSegmentLoader_.bandwidth,h=O.navigator.connection||O.navigator.mozConnection||O.navigator.webkitConnection,d=1e7;if(this.options_.useNetworkInformationApi&&h){var g=h.downlink*1e3*1e3;g>=d&&c>=d?c=Math.max(c,g):c=g}return c},set:function(c){this.masterPlaylistController_.mainSegmentLoader_.bandwidth=c,this.masterPlaylistController_.mainSegmentLoader_.throughput={rate:0,count:0}}},systemBandwidth:{get:function(){var c=1/(this.bandwidth||1),h;this.throughput>0?h=1/this.throughput:h=0;var d=Math.floor(1/(c+h));return d},set:function(){ae.log.error('The "systemBandwidth" property is read-only')}}}),this.options_.bandwidth&&(this.bandwidth=this.options_.bandwidth),this.options_.throughput&&(this.throughput=this.options_.throughput),Object.defineProperties(this.stats,{bandwidth:{get:function(){return a.bandwidth||0},enumerable:!0},mediaRequests:{get:function(){return a.masterPlaylistController_.mediaRequests_()||0},enumerable:!0},mediaRequestsAborted:{get:function(){return a.masterPlaylistController_.mediaRequestsAborted_()||0},enumerable:!0},mediaRequestsTimedout:{get:function(){return a.masterPlaylistController_.mediaRequestsTimedout_()||0},enumerable:!0},mediaRequestsErrored:{get:function(){return a.masterPlaylistController_.mediaRequestsErrored_()||0},enumerable:!0},mediaTransferDuration:{get:function(){return a.masterPlaylistController_.mediaTransferDuration_()||0},enumerable:!0},mediaBytesTransferred:{get:function(){return a.masterPlaylistController_.mediaBytesTransferred_()||0},enumerable:!0},mediaSecondsLoaded:{get:function(){return a.masterPlaylistController_.mediaSecondsLoaded_()||0},enumerable:!0},mediaAppends:{get:function(){return a.masterPlaylistController_.mediaAppends_()||0},enumerable:!0},mainAppendsToLoadedData:{get:function(){return a.masterPlaylistController_.mainAppendsToLoadedData_()||0},enumerable:!0},audioAppendsToLoadedData:{get:function(){return a.masterPlaylistController_.audioAppendsToLoadedData_()||0},enumerable:!0},appendsToLoadedData:{get:function(){return a.masterPlaylistController_.appendsToLoadedData_()||0},enumerable:!0},timeToLoadedData:{get:function(){return a.masterPlaylistController_.timeToLoadedData_()||0},enumerable:!0},buffered:{get:function(){return Hs(a.tech_.buffered())},enumerable:!0},currentTime:{get:function(){return a.tech_.currentTime()},enumerable:!0},currentSource:{get:function(){return a.tech_.currentSource_},enumerable:!0},currentTech:{get:function(){return a.tech_.name_},enumerable:!0},duration:{get:function(){return a.tech_.duration()},enumerable:!0},master:{get:function(){return a.playlists.master},enumerable:!0},playerDimensions:{get:function(){return a.tech_.currentDimensions()},enumerable:!0},seekable:{get:function(){return Hs(a.tech_.seekable())},enumerable:!0},timestamp:{get:function(){return Date.now()},enumerable:!0},videoPlaybackQuality:{get:function(){return a.tech_.getVideoPlaybackQuality()},enumerable:!0}}),this.tech_.one("canplay",this.masterPlaylistController_.setupFirstPlay.bind(this.masterPlaylistController_)),this.tech_.on("bandwidthupdate",function(){a.options_.useBandwidthFromLocalStorage&&U5({bandwidth:a.bandwidth,throughput:Math.round(a.throughput)})}),this.masterPlaylistController_.on("selectedinitialmedia",function(){E5(a)}),this.masterPlaylistController_.sourceUpdater_.on("createdsourcebuffers",function(){a.setupEme_()}),this.on(this.masterPlaylistController_,"progress",function(){this.tech_.trigger("progress")}),this.on(this.masterPlaylistController_,"firstplay",function(){this.ignoreNextSeekingEvent_=!0}),this.setupQualityLevels_(),this.tech_.el()&&(this.mediaSourceUrl_=O.URL.createObjectURL(this.masterPlaylistController_.mediaSource),this.tech_.src(this.mediaSourceUrl_))}},t.createKeySessions_=function(){var r=this,n=this.masterPlaylistController_.mediaTypes_.AUDIO.activePlaylistLoader;this.logger_("waiting for EME key session creation"),F5({player:this.player_,sourceKeySystems:this.source_.keySystems,audioMedia:n&&n.media(),mainPlaylists:this.playlists.master.playlists}).then(function(){r.logger_("created EME key session"),r.masterPlaylistController_.sourceUpdater_.initializedEme()}).catch(function(a){r.logger_("error while creating EME key session",a),r.player_.error({message:"Failed to initialize media keys for EME",code:3})})},t.handleWaitingForKey_=function(){this.logger_("waitingforkey fired, attempting to create any new key sessions"),this.createKeySessions_()},t.setupEme_=function(){var r=this,n=this.masterPlaylistController_.mediaTypes_.AUDIO.activePlaylistLoader,a=B5({player:this.player_,sourceKeySystems:this.source_.keySystems,media:this.playlists.media(),audioMedia:n&&n.media()});if(this.player_.tech_.on("keystatuschange",function(o){if(o.status==="output-restricted"){var l=r.masterPlaylistController_.master();if(!(!l||!l.playlists)){var u=[];if(l.playlists.forEach(function(h){h&&h.attributes&&h.attributes.RESOLUTION&&h.attributes.RESOLUTION.height>=720&&(!h.excludeUntil||h.excludeUntil<1/0)&&(h.excludeUntil=1/0,u.push(h))}),u.length){var c;(c=ae.log).warn.apply(c,['DRM keystatus changed to "output-restricted." Removing the following HD playlists that will most likely fail to play and clearing the buffer. This may be due to HDCP restrictions on the stream and the capabilities of the current device.'].concat(u)),r.masterPlaylistController_.fastQualityChange_()}}}}),this.handleWaitingForKey_=this.handleWaitingForKey_.bind(this),this.player_.tech_.on("waitingforkey",this.handleWaitingForKey_),ae.browser.IE_VERSION===11||!a){this.masterPlaylistController_.sourceUpdater_.initializedEme();return}this.createKeySessions_()},t.setupQualityLevels_=function(){var r=this,n=ae.players[this.tech_.options_.playerId];!n||!n.qualityLevels||this.qualityLevels_||(this.qualityLevels_=n.qualityLevels(),this.masterPlaylistController_.on("selectedinitialmedia",function(){O5(r.qualityLevels_,r)}),this.playlists.on("mediachange",function(){EA(r.qualityLevels_,r.playlists)}))},e.version=function(){return{"@videojs/http-streaming":xA,"mux.js":P5,"mpd-parser":D5,"m3u8-parser":N5,"aes-decrypter":L5}},t.version=function(){return this.constructor.version()},t.canChangeType=function(){return SA.canChangeType()},t.play=function(){this.masterPlaylistController_.play()},t.setCurrentTime=function(r){this.masterPlaylistController_.setCurrentTime(r)},t.duration=function(){return this.masterPlaylistController_.duration()},t.seekable=function(){return this.masterPlaylistController_.seekable()},t.dispose=function(){this.playbackWatcher_&&this.playbackWatcher_.dispose(),this.masterPlaylistController_&&this.masterPlaylistController_.dispose(),this.qualityLevels_&&this.qualityLevels_.dispose(),this.player_&&(delete this.player_.vhs,delete this.player_.dash,delete this.player_.hls),this.tech_&&this.tech_.vhs&&delete this.tech_.vhs,this.tech_&&delete this.tech_.hls,this.mediaSourceUrl_&&O.URL.revokeObjectURL&&(O.URL.revokeObjectURL(this.mediaSourceUrl_),this.mediaSourceUrl_=null),this.tech_&&this.tech_.off("waitingforkey",this.handleWaitingForKey_),s.prototype.dispose.call(this)},t.convertToProgramTime=function(r,n){return X8({playlist:this.masterPlaylistController_.media(),time:r,callback:n})},t.seekToProgramTime=function(r,n,a,o){return a===void 0&&(a=!0),o===void 0&&(o=2),Q8({programTime:r,playlist:this.masterPlaylistController_.media(),retryCount:o,pauseAfterSeek:a,seekTo:this.options_.seekTo,tech:this.options_.tech,callback:n})},e}(j5),iu={name:"videojs-http-streaming",VERSION:xA,canHandleSource:function(e,t){t===void 0&&(t={});var i=ae.mergeOptions(ae.options,t);return iu.canPlayType(e.type,i)},handleSource:function(e,t,i){i===void 0&&(i={});var r=ae.mergeOptions(ae.options,i);return t.vhs=new fy(e,t,r),ae.hasOwnProperty("hls")||Object.defineProperty(t,"hls",{get:function(){return ae.log.warn("player.tech().hls is deprecated. Use player.tech().vhs instead."),t.vhs},configurable:!0}),t.vhs.xhr=eA(),t.vhs.src(e.src,e.type),t.vhs},canPlayType:function(e,t){var i=yw(e);if(!i)return"";var r=iu.getOverrideNative(t),n=di.supportsTypeNatively(i),a=!n||r;return a?"maybe":""},getOverrideNative:function(e){e===void 0&&(e={});var t=e,i=t.vhs,r=i===void 0?{}:i,n=t.hls,a=n===void 0?{}:n,o=!(ae.browser.IS_ANY_SAFARI||ae.browser.IS_IOS),l=r.overrideNative,u=l===void 0?o:l,c=a.overrideNative,h=c===void 0?!1:c;return h||u}},q5=function(){return Lc("avc1.4d400d,mp4a.40.2")};q5()&&ae.getTech("Html5").registerSourceHandler(iu,0);ae.VhsHandler=fy;Object.defineProperty(ae,"HlsHandler",{get:function(){return ae.log.warn("videojs.HlsHandler is deprecated. Use videojs.VhsHandler instead."),fy},configurable:!0});ae.VhsSourceHandler=iu;Object.defineProperty(ae,"HlsSourceHandler",{get:function(){return ae.log.warn("videojs.HlsSourceHandler is deprecated. Use videojs.VhsSourceHandler instead."),iu},configurable:!0});ae.Vhs=di;Object.defineProperty(ae,"Hls",{get:function(){return ae.log.warn("videojs.Hls is deprecated. Use videojs.Vhs instead."),di},configurable:!0});ae.use||(ae.registerComponent("Hls",di),ae.registerComponent("Vhs",di));ae.options.vhs=ae.options.vhs||{};ae.options.hls=ae.options.hls||{};if(!ae.getPlugin||!ae.getPlugin("reloadSourceOnError")){var V5=ae.registerPlugin||ae.plugin;V5("reloadSourceOnError",I5)}/*! @name videojs-contrib-quality-levels @version 2.0.9 @license Apache-2.0 */function H5(s,e){s.prototype=Object.create(e.prototype),s.prototype.constructor=s,s.__proto__=e}function gp(s){if(s===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return s}var z5=function s(e){var t=this;if(ae.browser.IS_IE8){t=ce.createElement("custom");for(var i in s.prototype)i!=="constructor"&&(t[i]=s.prototype[i])}return t.id=e.id,t.label=t.id,t.width=e.width,t.height=e.height,t.bitrate=e.bandwidth,t.enabled_=e.enabled,Object.defineProperty(t,"enabled",{get:function(){return t.enabled_()},set:function(n){t.enabled_(n)}}),t},Ah=function(s){H5(e,s);function e(){var i;i=s.call(this)||this;var r=gp(gp(i));if(ae.browser.IS_IE8){r=ce.createElement("custom");for(var n in e.prototype)n!=="constructor"&&(r[n]=e.prototype[n])}return r.levels_=[],r.selectedIndex_=-1,Object.defineProperty(r,"selectedIndex",{get:function(){return r.selectedIndex_}}),Object.defineProperty(r,"length",{get:function(){return r.levels_.length}}),r||gp(i)}var t=e.prototype;return t.addQualityLevel=function(r){var n=this.getQualityLevelById(r.id);if(n)return n;var a=this.levels_.length;return n=new z5(r),""+a in this||Object.defineProperty(this,a,{get:function(){return this.levels_[a]}}),this.levels_.push(n),this.trigger({qualityLevel:n,type:"addqualitylevel"}),n},t.removeQualityLevel=function(r){for(var n=null,a=0,o=this.length;a<o;a++)if(this[a]===r){n=this.levels_.splice(a,1)[0],this.selectedIndex_===a?this.selectedIndex_=-1:this.selectedIndex_>a&&this.selectedIndex_--;break}return n&&this.trigger({qualityLevel:r,type:"removequalitylevel"}),n},t.getQualityLevelById=function(r){for(var n=0,a=this.length;n<a;n++){var o=this[n];if(o.id===r)return o}return null},t.dispose=function(){this.selectedIndex_=-1,this.levels_.length=0},e}(ae.EventTarget);Ah.prototype.allowedEvents_={change:"change",addqualitylevel:"addqualitylevel",removequalitylevel:"removequalitylevel"};for(var W5 in Ah.prototype.allowedEvents_)Ah.prototype["on"+W5]=null;var kA="2.0.9",G5=ae.registerPlugin||ae.plugin,K5=function(e,t){var i=e.qualityLevels,r=new Ah,n=function a(){r.dispose(),e.qualityLevels=i,e.off("dispose",a)};return e.on("dispose",n),e.qualityLevels=function(){return r},e.qualityLevels.VERSION=kA,r},AA=function(e){return K5(this,ae.mergeOptions({},e))};G5("qualityLevels",AA);AA.VERSION=kA;const X5={SMALL:450},Q5=U.getPlugin("plugin");class Y5 extends Q5{constructor(e,t){super(e),this.options=t,this.configureMenuDimensions=this.configureMenuDimensions.bind(this),this.initialize()}initialize(){this.player.ready(this.configureMenuDimensions),this.player.one("play",this.configureMenuDimensions),this.player.on("resize",this.configureMenuDimensions),this.player.on("fullscreenchange",this.configureMenuDimensions),this.player.on("resizemenus",this.configureMenuDimensions),this.player.on("ready",this.configureMenuDimensions)}dispose(){this.player.off("resize",this.configureMenuDimensions),this.player.off("fullscreenchange",this.configureMenuDimensions),this.player.off("resizemenus",this.configureMenuDimensions),this.player.off("ready",this.configureMenuDimensions),super.dispose()}configureMenuDimensions(){const e=u=>{if(this.options.mobile)return;const c=this.player.getChild("collapserator"),h=c.getChild("volumePanel"),d=c.children_.indexOf(h);c.removeChild(h),c.addChild("volumePanel",{inline:u},d),this.player.trigger("volumechange")},t=this.player.isFullscreen();if(t&&!this.options.mobile){const u=this.player.whiteboardModePlugin().side;if(e(u!=="top"),u==="left"||u==="right"||u==="top"){const c=this.player.currentWidth();this.player.el().querySelectorAll(".vjs-menu").forEach(d=>{d.style.paddingTop=null,d.style.marginBottom=null,d.style.width=`calc(${c}px - 4em)`});return}}t||e(!0);const i=this.player.currentWidth(),n=this.player.currentHeight()/i*100,a=this.player.el().querySelector(".cv-collapsorator"),o=this.player.el().querySelectorAll(".vjs-menu");let l=a&&a.offsetHeight;if(!l){this.player.one("play",this.configureMenuDimensions);return}this.options.seekBarName==="CreateClipSeekBar"&&(l+=22),!(!o||!o.length)&&o.forEach(u=>{!t&&this.options.overflowControls?u.style.paddingTop="80%":u.style.paddingTop=`calc(${n}% - ${l}px)`,u.style.marginBottom=`${l}px`,u.style.width=null,u.querySelector(".vjs-menu-content")&&(i<=X5.SMALL?this.player.addClass("cv-player-small"):this.player.removeClass("cv-player-small"))})}}U.registerPlugin("configureMenuDimensionsPlugin",Y5);const Vb="cv-persisttest",ht={hasLocalStorage:()=>{try{return window.localStorage.setItem(Vb,"cv-player-storage-test"),window.localStorage.removeItem(Vb),!0}catch{return!1}},get:s=>window.localStorage.getItem(s),set:(s,e)=>{window.localStorage.setItem(s,e)},remove:s=>{window.localStorage.removeItem(s)}},J5=U.getPlugin("plugin"),Hb="cvplayer-volume",zb="cvplayer-mute";class Z5 extends J5{constructor(e){super(e),this.enabled=!0,this.player.ready(()=>this.initialize())}initialize(){if(this.player.options_.mobile){this.removeVolumeControl();return}ht.hasLocalStorage()&&(this.saveVolumeState=this.saveVolumeState.bind(this),this.player.on("volumechange",this.saveVolumeState),this.applyUserPreferences())}applyUserPreferences(){const e=ht.get(Hb),t=ht.get(zb);e&&this.player.volume(+e),t&&this.player.muted(t==="true")}saveVolumeState(){this.enabled&&(ht.set(Hb,this.player.volume().toString()),ht.set(zb,this.player.muted().toString()))}removeVolumeControl(){this.player.volume(1);const e=this.player.getChild("collapserator"),t=e.getChild("volumePanel");e.removeChild(t)}enable(){this.enabled=!0}disable(){this.enabled=!1}dispose(){this.player.off("volumechange",this.saveVolumeState),super.dispose()}}U.registerPlugin("persistVolumePlugin",Z5);const e6=U.getPlugin("plugin"),Wb="cvplayer-playback-rate";class t6 extends e6{constructor(e,t){super(e),this.options=t,this.player.dataLoaded(()=>this.initialize())}initialize(){var i;if(!ht.hasLocalStorage())return;this.savePlaybackRate=this.savePlaybackRate.bind(this),this.player.on("ratechange",this.savePlaybackRate),this.one("dispose",()=>{this.player.off("ratechange",this.savePlaybackRate)});const e=+ht.get(Wb);((i=this.player.options_.playbackRates)==null?void 0:i.some(r=>r===e))&&this.player.playbackRate(e)}savePlaybackRate(){var t;const e=this.player.playbackRate().toString();ht.set(Wb,e),(t=this.options.analyticsService)==null||t.logUserAction({rate:e},{actionType:fi.Select,workflowPhase:Hl.Complete,descriptor:aa.ChangeSpeed,entity:Ai.PlaybackSpeed,eventVersion:Gs.V3})}}U.registerPlugin("persistPlaybackRatePlugin",t6);const i6=U.getPlugin("plugin");class r6 extends i6{constructor(e){super(e),this.fullscreenBecauseOfRotate=!1,this.player.supportsFullScreen()&&(this.onRotate=this.onRotate.bind(this),this.onFullscreenChange=this.onFullscreenChange.bind(this),this.player.ready(()=>this.initialize()))}initialize(){this.player.on("fullscreenchange",this.onFullscreenChange),window.addEventListener("orientationchange",this.onRotate)}dispose(){this.player.off("fullscreenchange",this.onFullscreenChange),window.removeEventListener("orientationchange",this.onRotate)}onFullscreenChange(){this.player.isFullscreen()||(this.fullscreenBecauseOfRotate=!1)}onRotate(){const e=this.getAngle();if(e!==90&&e!==-90&&e!==270){this.fullscreenBecauseOfRotate&&this.player.isFullscreen()&&this.player.exitFullscreen();return}this.player.requestFullscreen(),this.fullscreenBecauseOfRotate=!0}getAngle(){var e,t;return typeof((t=(e=window.screen)==null?void 0:e.orientation)==null?void 0:t.angle)=="number"?window.screen.orientation.angle:0}}U.registerPlugin("fullscreenOnRotatePlugin",r6);const IA=`
288
- <svg viewBox='0 0 434 71'>
289
- <g>
290
- <path fill='#FFFFFF' d='M114.44 56.57l3.5 3.5a32.87 32.87 0 0 1-25.16 11.26c-19.63 0-33.62-15.54-33.62-35.16C59.16 16.55 73.16 1 92.78 1a32.31 32.31 0 0 1 24.19 10.4l-3.6 3.3a27.32 27.32 0 0 0-20.59-8.74c-16.91 0-28.39 13.5-28.39 30.21s11.48 30.21 28.39 30.21a28.08 28.08 0 0 0 21.66-9.81zM126.64 1h4.55v70.22h-4.73L126.64 1zm17.3 10.6a3.7 3.7 0 1 1 0 7.4 3.7 3.7 0 0 1 0-7.4zm-2.41 15.07h4.81v44.56h-4.81V26.67zm48 33.15l3.33 3.15a21.8 21.8 0 0 1-17.31 8.61c-12.59 0-21.76-10-21.76-22.22 0-12.22 9.17-22.22 21.76-22.22a21.84 21.84 0 0 1 16.85 8l-3.43 3.06a17.15 17.15 0 0 0-13.42-6.3c-10.09 0-16.76 8.15-16.76 17.5s6.67 17.5 16.76 17.5a17.38 17.38 0 0 0 13.98-7.08zm14.99-9.33v20.74h-4.73V1.01h4.73v47.75l20.74-19.02h6.64l-21.56 19.84L234 71.23h-7.01l-22.47-20.74z'/>
291
- <path fill='#F8981D' d='M304.09 19.4a5.56 5.56 0 1 1 0-11.12 5.56 5.56 0 0 1 0 11.12zm-5.56 7.27h11.11v44.56h-11.11V26.67zm61.42 22.15c0 .81 0 2.42-.09 4h-31.75c.8 3.77 5.2 8.61 11.93 8.61a17.11 17.11 0 0 0 11.66-4.31l5.38 8.16a27.23 27.23 0 0 1-17 6.1c-12.92 0-22.88-9.87-22.88-22.34s9.06-22.33 21.35-22.33c11.62-.04 21.4 9.02 21.4 22.11zm-10.77-3.76c-.18-3.68-3.58-8.62-10.67-8.62-6.91 0-10.05 4.85-10.4 8.62h21.07zM385.92 71h-6.42l-19.64-44.37h13.97l9.16 23.98 9.72-23.98h8.31l9.63 23.98 9.16-23.98h13.97L414.24 71h-6.52l-10.85-23.7L385.92 71zm-120.22.35h-6L226.11 1.01h17.01l19.42 44.18 18.08-44.18h16.91L265.7 71.35zM0 1l41 35L0 71V1z'/>
292
- </g>
293
- </svg>
294
- `,n6=U.getComponent("Button");class PA extends n6{constructor(e,t){super(e,t),this.update=I3(this.update.bind(this),1e3),e.on("timeupdate",this.update),e.one("dispose",()=>{e.off("timeupdate",this.update),this.el_.removeEventListener("click",this.pause)})}update(){const e=this.player_.currentTime();this.el_.href=this.options_.getExternalLink({currentTime:Math.round(e)})}buildCSSClass(){return"cv-open-externally-button"}createEl(){const e="a",t={innerHTML:IA,className:this.buildCSSClass()},i={type:"button",href:this.options_.getExternalLink({currentTime:0}),target:"_blank"},r=U.dom.createEl(e,t,i);return this.createControlTextEl(r),r.addEventListener("click",this.pause.bind(this)),r}pause(){this.player_.pause()}}PA.prototype.controlText_="Open in ClickView";U.registerComponent("OpenExternallyButton",PA);const s6=U.getPlugin("plugin");class a6 extends s6{constructor(e,t){super(e,t),this.options=t,e.ready(()=>this.onReady())}onReady(){const e=this.player.getChild("collapserator"),t=e.getChild("customControlSpacer"),i=e.children_.indexOf(t);e.addChild("OpenExternallyButton",{getExternalLink:this.options.getExternalLink},i+1)}}U.registerPlugin("openExternallyPlugin",a6);const o6=U.getComponent("component");class l6 extends o6{constructor(e,t){super(e,t)}buildCSSClass(){return`cv-touch-control-ui ${super.buildCSSClass()}`}createEl(e,t,i){return super.createEl(e,{...t,className:this.buildCSSClass()},i)}setUi(e,t){const i=e>0,r=i?"cv-touch-right":"cv-touch-left";this.el_.className=this.buildCSSClass()+" cv-ui-touch-active",this.el_.innerHTML=`
295
- <div class='${r}'>
296
- <div class='cv-touch-text'>
297
- ${i?"+":""}${e*10}s
298
- </div>
299
- </div>
300
- `,window.clearTimeout(this.timeoutId),this.timeoutId=window.setTimeout(()=>{this.removeText()},t)}removeText(){this.el_.className=this.buildCSSClass(),this.el_.innerHTML=""}}U.registerComponent("TouchControls",l6);const u6=U.getPlugin("plugin"),Sl=300;class c6 extends u6{constructor(e){super(e),this.doubleTouchCount=0,this.seekStartTime=0,this.directionModifier=0,this.bindFunctions(),this.player.ready(()=>this.initialize())}bindFunctions(){this.onTouchStart=this.onTouchStart.bind(this),this.onTouchEnd=this.onTouchEnd.bind(this),this.reBindEventListeners=this.reBindEventListeners.bind(this),this.unBindEventListeners=this.unBindEventListeners.bind(this)}initialize(){this.player.addChild("TouchControls"),this.touchControls=this.player.getChild("TouchControls"),this.player.on("ready",this.reBindEventListeners),this.one("dispose",()=>{this.player.off("ready",this.reBindEventListeners)}),this.reBindEventListeners()}reBindEventListeners(){this.unBindEventListeners(),this.tech=this.player.tech(!0),this.tech.name()==="Html5"&&(this.tech.on("touchstart",this.onTouchStart),this.tech.on("touchend",this.onTouchEnd))}unBindEventListeners(){this.tech&&this.tech.name()==="Html5"&&(this.tech.off("touchstart",this.onTouchStart),this.tech.off("touchend",this.onTouchEnd))}dispose(){super.dispose(),this.unBindEventListeners()}onTouchStart(e){this.touchStartTime=e.timeStamp,this.userActive=this.player.userActive()}onTouchEnd(e){if(e.changedTouches.length){if(e.timeStamp-this.lastTouchTime<Sl){this.onDoubleTouch(e),this.lastTouchTime=e.timeStamp;return}if(this.resetProperties(),this.lastTouchTime=e.timeStamp,e.timeStamp-this.touchStartTime<Sl){window.setTimeout(()=>{this.doubleTouchCount||(this.player.paused()?this.player.play():this.userActive&&this.player.pause())},Sl);return}}}resetProperties(){this.doubleTouchCount=0,this.seekStartTime=0,this.directionModifier=0}onDoubleTouch(e){const t=this.player.el().getBoundingClientRect(),i=t.left+t.width/2;if(this.doubleTouchCount===0&&(this.seekStartTime=this.player.currentTime(),e.changedTouches[0].pageX<i?this.directionModifier=-1:this.directionModifier=1),this.doubleTouchCount++,this.directionModifier<0){if(this.doubleTouchCount*10>this.seekStartTime+10)return;this.touchControls.setUi(-this.doubleTouchCount,Sl*3),this.player.currentTime(this.player.currentTime()-10);return}const r=this.player.duration()-this.seekStartTime;this.doubleTouchCount*10>r+10||(this.touchControls.setUi(this.doubleTouchCount,Sl*3),this.player.currentTime(this.player.currentTime()+10))}}U.registerPlugin("touchControls",c6);class h6{constructor(e,t){this.id=t.id,this.plugin=e,this.source=t,this.enabled=this.enabled.bind(this)}enabled(e){return e===void 0?this.plugin.currentSource===this.source:(e&&this.plugin.setSource(this.source.id),e)}}const d6=U.getPlugin("plugin");class f6 extends d6{constructor(e,t){super(e),this.options_=t,this.player.ready(()=>this.initialize())}initialize(){this.sources=[],this.qualityLevels=this.player.qualityLevels(),this.populateSources(this.options_.sources),this.onQualityChange=this.onQualityChange.bind(this),this.qualityLevels.on("change",this.onQualityChange),this.player.one("dispose",()=>{this.qualityLevels.off("change",this.onQualityChange)})}get currentSource(){return this._currentSource}onQualityChange(){const e=this.qualityLevels[this.qualityLevels.selectedIndex];this.player.trigger("cv-quality-change",e.id)}setSource(e){const t=this.getSourceById(e);if(t===null)return this.currentSource;const i=this.player.currentTime(),r=!this.player.paused();this._currentSource=t;const n=this.player.playbackRate(),a=this.player.hasStarted();this.player.src({src:t.url,type:t.mimeType});const o=()=>{this.player.playbackRate(n),this.player.currentTime()!==i&&this.player.currentTime(i),r&&this.player.play(),a&&this.player.hasStarted(!0)};return this.player.one("loadedmetadata",o),this.trigger({event:"sourcechange",source:t}),this.sourceChangeUpdateQualityLevels(t),t}getSourceById(e){return this.sources.find(t=>t.id===e)}repopulateSources(e){let t=null;for(;this.qualityLevels.length;)this.qualityLevels[0].enabled&&(t=this.qualityLevels[0].id),this.qualityLevels.removeQualityLevel(this.qualityLevels[0]);this.sources=[],this.populateSources(e,t)}sortSources(e){return e.sort((t,i)=>t.id===i.id?0:+t.id>+i.id?-1:1)}populateSources(e,t=null){let i=null;e=this.sortSources(e),e.forEach(r=>{if(this.qualityLevels.addQualityLevel(new h6(this,r)),this.sources.push(r),this.trigger({event:"addsource",source:r}),t!==null){r.id===t&&(i=r);return}r.default&&(i=r)}),i===null&&(i=this.sources[0]),i!==null&&this.setSource(i.id)}sourceChangeUpdateQualityLevels(e){const t=this.qualityLevels;let i=-1;for(let r=0;r<t.length;r++)if(t[r].id===e.id){i=r;break}t.selectedIndex_=i,t.trigger({selectedIndex:i,type:"change"})}}U.registerPlugin("progressiveFiles",f6);class DA{static getKnownProfiles(){return["1080","720","480","360","240"]}static enableProfileOrNextBest(e,t){let i=e.getQualityLevelById(t);if(i||(i=this.getNextBestQuality(e,t)),!i)return null;for(let r=0;r<e.length;r++){const n=e[r];n.enabled=i.id===n.id}return i}static getNextBestQuality(e,t){const i=this.getKnownProfiles(),r=i.indexOf(t);if(r>=0){for(let n=r+1;n<i.length;n++){const a=i[n],o=e.getQualityLevelById(a);if(o)return o}for(let n=r-1;n>0;n--){const a=i[n],o=e.getQualityLevelById(a);if(o)return o}}return null}}class p6{constructor(e){this.name=e.name,this.playbackProfile=e.playbackProfile,this.address=new URL(e.httpsAddress)}getUrl(e){return e?this.address+"cache?file="+encodeURIComponent(e):null}async ping(){const t=new AbortController,i=setTimeout(()=>t.abort(),1e3);try{const n=await(await fetch(this.address+"ping",{method:"GET",mode:"cors",signal:t.signal})).text();return clearTimeout(i),n==="PONG"}catch{return!1}}}class m6{constructor(e){this.player=e,this.logger=U.log.createLogger("localcache")}async setSource(e,t){if(this.player.localCache&&(e==null?void 0:e.src)!==void 0){const i=await this.player.localCache().getActiveLocalCache();i!==null&&(this.logger.debug("Using Local Cache",i),e.src=i.getUrl(e.src))}t(null,e)}}U.use("*",s=>new m6(s));const NA='<?xml version="1.0" encoding="UTF-8"?><svg width="24px" height="24px" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><g id="Artboard" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd" opacity="0.9"><g id="Local-Cache" transform="translate(2.000000, 2.000000)"><rect id="Rectangle" fill="#FFFFFF" x="0" y="2.4" width="18.8" height="15.2"></rect><ellipse id="Oval" fill="#FFFFFF" cx="9.4" cy="2.4" rx="9.4" ry="2.4"></ellipse><ellipse id="Oval-Copy" fill="#FFFFFF" cx="9.4" cy="17.6" rx="9.4" ry="2.4"></ellipse><g id="Logo/Circle" transform="translate(2.500000, 3.000000)"><circle id="Oval" fill="#FFFFFF" cx="7" cy="7" r="7"></circle><polygon id="Fill-1" fill="#F8981D" points="4.66666667 2.33333333 4.66666667 11.4245258 10.0383286 6.87866667"></polygon></g></g></g></svg>',g6=U.getComponent("Component");class v6 extends g6{constructor(e,t){super(e,t),this.hide(),this.onLocalCacheChange=this.onLocalCacheChange.bind(this),e.ready(()=>{this.initialize()})}createEl(){return super.createEl("div",{className:"vjs-local-cache-indicator",innerHTML:`<div class="vjs-local-cache-indicator-icon">${NA}</div>`},{title:"Streaming from ClickView Local Cache"})}initialize(){this.localCachePlugin=this.player_.localCache(),this.localCachePlugin&&(this.localCachePlugin.on("localcachechanged",this.onLocalCacheChange),this.player_.on("dispose",()=>{this.localCachePlugin.off("localcachechanged",this.onLocalCacheChange)}),this.onLocalCacheChange())}async onLocalCacheChange(){await this.localCachePlugin.getActiveLocalCache()?this.show():this.hide()}}U.registerComponent("localCacheIndicator",v6);const y6=U.getPlugin("plugin");class _6 extends y6{constructor(e,t){if(super(e),this.logger_=U.log.createLogger("localcache"),t===void 0)throw Error("no options defined");this.localCaches_=t.localCacheAddresses.map(i=>new p6(i)),this.player.ready(()=>{this.initialize(),t.enabled&&this.enable()})}get isEnabled(){return this.enabled_}enable(){this.enabled_=!0,this.resetActiveLocalCache()}disable(){this.enabled_=!1}getActiveLocalCache(){return this.enabled_?this.activeLocalCache_:null}resetActiveLocalCache(){this.clearActiveLocalCache(),this.activeLocalCache_=this.getActiveLocalCacheInternal()}clearActiveLocalCache(){this.activeLocalCache_&&(this.activeLocalCache_=null,this.onLocalCacheChange(null))}removeLocalCache(e){this.localCaches_=this.localCaches_.filter(t=>t!==e)}dispose(){super.dispose()}initialize(){this.player.controlBar.addChild("localCacheIndicator")}async handleNetworkError(){const e=await this.getActiveLocalCache();return e&&await e.ping()&&this.removeLocalCache(e),this.resetActiveLocalCache(),await this.getActiveLocalCache(),this.resetSource(),!0}resetSource(){const e=this.player.qualityLevels();for(let t=0;t<e.length;t++)e[t].enabled&&(e[t].enabled=!0)}async getActiveLocalCacheInternal(){const e=[],t=async i=>{await i.ping()&&e.push(i)};if(await Promise.all(this.localCaches_.map(i=>t(i))),e.length>0){const i=e[0];return this.onLocalCacheChange(i),i}return null}onLocalCacheChange(e){this.logger_.debug("Local Cache changed",e),this.trigger("localcachechanged",{localCache:e});let t=!1;e&&e.playbackProfile&&(this.logger_.debug("Changing active profile for local cache",e.playbackProfile),DA.enableProfileOrNextBest(this.player.qualityLevels(),e.playbackProfile),t=!0),t||this.player.src(this.player.src())}}U.registerPlugin("localCache",_6);const T6=9e5,b6=U.getPlugin("plugin");class S6 extends b6{constructor(e,t){super(e),this.playerApi=t.playerApi,this.fileToken=t.fileToken,this.logger=U.log.createLogger("video-signature-expiry-plugin"),this.bindErrorHandlers()}bindErrorHandlers(){this.onError=this.onError.bind(this),this.player.on("error",this.onError)}dispose(){this.player.off("error",this.onError),super.dispose()}async onError(){const e=this.player.error().code;if(!(e!==MediaError.MEDIA_ERR_NETWORK&&e!==MediaError.MEDIA_ERR_SRC_NOT_SUPPORTED)){if(await this.player.localCache().getActiveLocalCache()){this.callErrorHandler(()=>this.player.localCache().handleNetworkError());return}this.callErrorHandler(()=>this.handleVideoSignatureExpiry())}}async handleVideoSignatureExpiry(){if(!this.playerApi||!this.fileToken||this.refetchedSourcesTimestamp+T6>Date.now())return!1;this.refetchedSourcesTimestamp=Date.now();let e=null;try{this.logger.debug("Detected expired mp4 urls, attempting to refetch");const t=`${this.playerApi.origin}/api/files?fileToken=${this.fileToken}`;e=await Zg.get(t)}catch{return this.logger.error("Failed to refetch expired mp4 urls"),!1}return this.logger.debug("Mp4 urls successfully refetched"),this.player.progressiveFiles().repopulateSources(e.progressive.map(t=>({id:t.profile,mimeType:t.mimeType,url:t.url}))),this.fileToken=e.fileToken,!0}async callErrorHandler(e){const t=this.player.currentTime(),i=!this.player.paused(),r=this.player.playbackRate(),n=()=>{this.player.playbackRate(r),this.player.currentTime(t),i&&this.player.play(),this.player.error(null)};this.player.one("loadedmetadata",n),!await e()&&this.player.off("loadedmetadata",n)}}U.registerPlugin("handleNetworkErrors",S6);const x6=U.getPlugin("plugin"),vp="cvplayer-show-subtitles",yp="cvplayer-selected-language",Gb="cvplayer-subtitle-size";class C6 extends x6{constructor(e,t){super(e),this.options=t,this.initialize()}initialize(){this.applyUserPreferences=this.applyUserPreferences.bind(this),this.player.textTracks().length&&(this.applyUserPreferences(),this.bindEventListeners())}applyUserPreferences(){let e=!!this.options.showSubtitles;const t=this.safeGet(vp);if(t==="true"&&(e=!0),t==="false"&&(e=!1),e){const r=this.guessWhichTrack();r&&(r.mode="showing",this.player.trigger("cv:languageselected"))}else this.hideSubtitles();let i=this.safeGet(Gb);i||(i=this.options.subtitleSize),this.player.options_.mobile&&(i="medium"),i&&this.player.textTrackSettings.setSizeSetting(i)}safeGet(e){if(ht.hasLocalStorage())return ht.get(e)}onSelectedLanguageChange(){var t,i;const e=this.player.textTracks();for(let r=0;r<e.length;r++){const n=e[r];if(n.mode==="showing"){ht.set(vp,"true"),ht.set(yp,n.language),(t=this.options.analyticsService)==null||t.logUserAction({language:n.language},{actionType:fi.Select,entity:Ai.Subtitle,workflowPhase:Hl.Complete,descriptor:By.On});return}}ht.set(vp,"false"),ht.remove(yp),(i=this.options.analyticsService)==null||i.logUserAction({language:""},{actionType:fi.Select,entity:Ai.Subtitle,workflowPhase:Hl.Complete,descriptor:By.Off,eventVersion:Gs.V3})}bindEventListeners(){ht.hasLocalStorage()&&(this.onSelectedLanguageChange=this.onSelectedLanguageChange.bind(this),this.onChangeSubtitleSize=this.onChangeSubtitleSize.bind(this),this.player.on("cv:languageselected",this.onSelectedLanguageChange),this.player.on("changesubtitlesize",this.onChangeSubtitleSize),this.one("dispose",()=>{this.player.off("cv:languageselected",this.onSelectedLanguageChange),this.player.off("changesubtitlesize",this.onChangeSubtitleSize)}))}onChangeSubtitleSize(){const t=this.player.textTrackSettings.getSizeSetting();ht.set(Gb,t)}guessWhichTrack(){const e=this.safeGet(yp)||window.navigator.language,{language:t,country:i}=this.getLanguageParts(e);let r,n;const a=this.player.textTracks();for(let o=0;o<a.length;o++){const l=a[o],{language:u,country:c}=this.getLanguageParts(l.language);if(u===t&&(r=l,c||(n=l),c===i))return r}return n||r||null}getLanguageParts(e){const t=e.toLowerCase().split("-"),i=t[0],r=t[1];return{language:i,country:r}}hideSubtitles(){const e=this.player.textTracks();for(let t=0;t<e.length;t++){const i=e[t];i.mode="hidden"}}previewModeSubtitles(){const e=this.guessWhichTrack();e&&(e.mode="showing"),this.player.off("changesubtitlesize",this.onChangeSubtitleSize),this.player.textTrackSettings.setSizeSetting("large"),this.player.on("changesubtitlesize",this.onChangeSubtitleSize)}}U.registerPlugin("persistSubtitleSettingsPlugin",C6);const E6=U.getPlugin("plugin"),w6="cvplayer-playback-quality",k6="cvplayer-localcache-playback-quality",A6="1080";class I6 extends E6{constructor(e,t){super(e),this.options=t,this.player.ready(()=>this.initialize())}async initialize(){const e=await this.getActiveLocalCache();let t=e?this.options.playbackProfileLocalCache:this.options.playbackProfile;if(t||(t=A6),ht.hasLocalStorage()){const r=ht.get(this.getStorageKey(!!e));r&&(t=r)}const i=this.player.qualityLevels();e!=null&&e.playbackProfile||DA.enableProfileOrNextBest(i,t),ht.hasLocalStorage()&&(this.onQualityLevelsChange=this.onQualityLevelsChange.bind(this),i.on("change",this.onQualityLevelsChange),this.on("dispose",()=>{i.off("change",this.onQualityLevelsChange)}))}async onQualityLevelsChange(){var r;const e=await this.isLocalCacheActive(),t=this.player.qualityLevels(),i=t[t.selectedIndex];ht.set(this.getStorageKey(e),i.id),(r=this.options.analyticsService)==null||r.logUserAction({quality:i.id},{actionType:fi.Select,workflowPhase:Hl.Complete,descriptor:aa.ChangeResolution,entity:Ai.Resolution,eventVersion:Gs.V3})}async isLocalCacheActive(){return!!await this.player.localCache().getActiveLocalCache()}getActiveLocalCache(){return this.player.localCache().getActiveLocalCache()}getStorageKey(e){return e?k6:w6}}U.registerPlugin("persistQualitySettingsPlugin",I6);const LA=U.getComponent("Component");class P6 extends LA{constructor(e,t){super(e,t)}createEl(){return U.dom.createEl("div",{className:"cv-progress-reporter-item"})}update(){const e=this.options_.event,t=this.player_.duration(),r=(e.end.time-e.start.time)/t;this.el_.style.width=r*100+"%";const n=e.start.time/t;this.el_.style.left=n*100+"%"}}class D6 extends LA{constructor(){super(...arguments),this.events_=[]}update(){const e=this.children();for(let t=e.length;t>0;t--)this.removeChild(e[t]);this.events_.forEach(t=>{const i=new P6(this.player(),{event:t});this.addChild(i),i.update()})}addEvents(e){this.events_.push(...e),this.update()}createEl(){return U.dom.createEl("div",{className:"cv-progress-reporter-display"})}}const N6=U.getPlugin("plugin"),Kb=5e3,L6="ArrowUpArrowUpArrowDownArrowDownArrowLeftArrowRightArrowLeftArrowRightba",$t={PLAY:"play",PLAYING:"playing",PAUSE:"pause",SEEKING:"seeking",SEEK_START:"seekstart",SEEK_END:"seekend",ENDED:"ended",PAUSED_SEEK:"pausedseek",TIME_UPDATE:"timeupdate"};class O6 extends N6{constructor(e,t){super(e,t),this.eventBuffer=[],this.latestTime=0,this.lastPlayingTime=0,this.isPlaying=!1,this.isSeeking=!1,this.hasEnded=!1,this.shouldLogPlayOnTimeUpdate=!1,this.options=t,this.player.ready(()=>this.initialize())}initialize(){this.validateOptions(),this.bindListeners(),this.startInterval(),this.addEasterEgg()}validateOptions(){if(typeof this.options.onFlush!="function")throw new Error("Please provide the onFlush option")}bindListeners(){const e={[$t.PLAY]:()=>this.onPlay(),[$t.PAUSE]:()=>this.onPause(),[$t.TIME_UPDATE]:()=>this.onTimeUpdate(),[$t.SEEKING]:()=>this.onSeeking(),[$t.ENDED]:()=>this.onEnded(),[$t.PLAYING]:()=>this.onPlaying()},t=Object.keys(e);t.forEach(i=>this.player.on(i,e[i])),this.one("dispose",()=>{t.forEach(i=>this.player.off(i,e[i]))})}startInterval(){const e=this.options.interval||Kb;this.interval=window.setInterval(()=>this.flushBuffer(),e),this.player.one("dispose",()=>window.clearInterval(this.interval))}addEasterEgg(){let e="",t;const i=u=>{e=e+u.key,e===L6&&this.addDisplay(),window.clearTimeout(t),t=window.setTimeout(()=>{e=""},500)};let r=!1,n;const a=()=>{r=!0,n=window.setTimeout(()=>{r&&this.addDisplay()},1e4)};function o(){r=!1,window.clearTimeout(n)}this.player.el().addEventListener("keyup",i);const l=this.player.getChild("Collapserator").getChild("PlayToggle");l.on("touchstart",a),l.on("touchend",o),this.player.one("dispose",()=>{var u,c;(c=(u=this.player)==null?void 0:u.el())==null||c.removeEventListener("keyup",i),l.off("touchstart",a),l.off("touchend",o)})}addDisplay(){this.progressReporterDisplay||(this.progressReporterDisplay=new D6(this.player),this.player.addChild(this.progressReporterDisplay),this.player.options_.inactivityTimeout=0,this.player.one("dispose",()=>{this.progressReporterDisplay=void 0}))}onPlay(){if(this.isPlaying=!0,this.isSeeking){this.logEvent($t.SEEK_END),this.isSeeking=!1;return}if(this.hasEnded){this.shouldLogPlayOnTimeUpdate=!0,this.hasEnded=!1;return}this.logEvent($t.PLAY)}onPause(){this.isSeeking||(this.pauseTimeout=window.setTimeout(()=>{this.isPlaying=!1,this.logEvent($t.PAUSE),delete this.pauseTimeout},50))}onTimeUpdate(){this.shouldLogPlayOnTimeUpdate&&(this.shouldLogPlayOnTimeUpdate=!1,this.logEvent($t.PLAY)),!(!this.isPlaying||this.isSeeking)&&this.logEvent($t.PLAYING)}onSeeking(){this.pauseTimeout&&(this.latestTime=this.previousLatestTime,window.clearTimeout(this.pauseTimeout),delete this.pauseTimeout),this.isPlaying||this.logEvent($t.PAUSED_SEEK),!(this.isSeeking||!this.isPlaying)&&(this.isSeeking=!0,this.logEvent($t.SEEK_START))}onEnded(){this.hasEnded=!0,this.logEvent($t.ENDED)}onPlaying(){this.isSeeking=!1,this.isPlaying=!0}logEvent(e){if(!this.player)return;let t=this.player.currentTime();e===$t.SEEK_START&&(t=this.latestTime),this.previousLatestTime=this.latestTime,this.latestTime=this.player.currentTime(),this.eventBuffer.push({time:t,type:e})}shouldUseCarriedOverTime(e){return this.lastPlayingTime&&(e===$t.PLAYING||e===$t.PLAY)}shouldSaveCarriedOverTime(e){return e===$t.PLAYING||e===$t.PAUSE}shouldClearCarriedOverTime(e){return e===$t.ENDED||e===$t.PAUSED_SEEK}flushBuffer(){var i,r;const e=[];let t={};for(;this.eventBuffer.length;){const n=this.eventBuffer.shift();if(this.shouldClearCarriedOverTime(n.type)){delete this.lastPlayingTime;continue}if(!t.start){this.shouldUseCarriedOverTime(n.type)&&(n.time=this.lastPlayingTime,delete this.lastPlayingTime),t.start=n;continue}n.type===$t.PLAYING&&this.eventBuffer.length>0||(this.shouldSaveCarriedOverTime(n.type)&&(this.lastPlayingTime=n.time),t.end=n,e.push(t),t={})}this.eventBuffer=[],e.length&&this.validateEvents(e)&&(this.options.onFlush(e),(i=this.player)==null||i.trigger("progressflush"),(r=this.progressReporterDisplay)==null||r.addEvents(e))}validateEvents(e){let t=0;e.forEach(r=>{t+=r.end.time-r.start.time});let i=this.options.interval||Kb;return i=i/1e3,i+=.5,i=i*this.player.playbackRate(),t<i}}U.registerPlugin("progressReporterPlugin",O6);const M6=U.getComponent("Component");class R6 extends M6{createEl(){const e="span",t={innerHTML:'<span class="vjs-icon-placeholder"></span>',className:"cv-drag-handle vjs-control vjs-button"};return U.dom.createEl(e,t,{})}}const OA=["top","left","right","bottom"],Xb={top:"Top",left:"Left",right:"Right",bottom:"Bottom"},MA=U.getComponent("Component");class F6 extends MA{constructor(e,t){super(e,t),this.bindEventListeners()}createEl(){return super.createEl("div",{},{class:`cv-drop-target cv-drop-${this.options_.side}`})}bindEventListeners(){const e=this.el(),t=n=>{n.preventDefault(),n.dataTransfer.dropEffect="move",this.addClass("cv-drag-over")},i=n=>{n.preventDefault(),this.removeClass("cv-drag-over"),this.player_.whiteboardModePlugin().setWhiteboardMode(this.options_.side)},r=()=>{this.removeClass("cv-drag-over")};e.addEventListener("dragover",t),e.addEventListener("drop",i),e.addEventListener("dragleave",r),this.on("dispose",()=>{e.removeEventListener("dragover",t),e.removeEventListener("drop",i),e.removeEventListener("dragleave",r)})}}class B6 extends MA{constructor(e,t){super(e,t),this.addChildren()}addChildren(){OA.forEach(e=>{this.addChild(new F6(this.player_,{side:e}))})}}const U6=U.getComponent("MenuItem");class $6 extends U6{constructor(e,t){super(e,t)}handleClick(){this.player_.whiteboardModePlugin().setWhiteboardMode(this.options_.side)}}const Qb=U.getComponent("MenuButton");class j6 extends Qb{constructor(){super(...arguments),this.alwaysCollapsed=!0,this.isCollapsed=!1,this.isCollabsible=!0}createItems(){const e=this.player_.whiteboardModePlugin().side,t=[new la(this.player_,{label:"Video Controls"})];return OA.forEach(i=>{t.push(new $6(this.player_,{side:i,label:Xb[i],selectable:!0,multiSelectable:!1,selected:i===e}))}),t}buildWrapperCSSClass(){return`cv-menu-small cv-has-left-icons ${super.buildWrapperCSSClass()}`}getCollabsibleName(){return"Video Controls"}getCollabsibleValue(){const e=this.player_.whiteboardModePlugin().side;return Xb[e]}showInCollabsibleMenu(){return this.player_.whiteboardModePlugin().isEnabled()?this.player_.isFullscreen():!1}showCollapsibleMenu(){Qb.prototype.handleClick.apply(this)}}const Yb="cv-whiteboard-side",q6=U.getPlugin("plugin");class V6 extends q6{constructor(e){super(e),this.side="bottom",this.enabled=!0,this.player.ready(()=>{this.initialize()})}initialize(){if(!this.player.options_.mobile){if(ht.hasLocalStorage()){const e=ht.get(Yb);e&&(this.side=e)}this.initCollapserator(),this.initDragTargets(),this.initFullscreenListener()}}initCollapserator(){var a,o;if((o=(a=this.player).viewTranscriptPlugin)!=null&&o.call(a).isTranscriptOn())return;const e=this.player.getChild("collapserator");this.dragHandle=new R6(this.player),this.button=new j6(this.player),e.addChild(this.dragHandle),e.addChild(this.button),this.player.trigger("cv-updatecog");const t=()=>{this.player.isFullscreen()&&e.el().setAttribute("draggable","true")},i=()=>{this.player.isFullscreen()&&e.el().setAttribute("draggable","false")},r=l=>{this.player.isFullscreen()&&(this.player.addClass("cv-dragging"),l.dataTransfer.setData("text/plain","handle"))},n=()=>{this.player.isFullscreen()&&(this.player.removeClass("cv-dragging"),e.el().setAttribute("draggable","false"))};this.dragHandle.el().addEventListener("mousedown",t),this.dragHandle.el().addEventListener("mouseup",i),e.el().addEventListener("dragstart",r),e.el().addEventListener("dragend",n),this.on("dispose",()=>{this.dragHandle.el().removeEventListener("mousedown",t),this.dragHandle.el().removeEventListener("mouseup",i),e.el().removeEventListener("dragstart",r),e.el().removeEventListener("dragend",n)})}initDragTargets(){this.player.addChild(new B6(this.player))}initFullscreenListener(){this.update=this.update.bind(this),this.player.on("fullscreenchange",this.update),this.player.on("cv-transcript-toggle",this.update),this.one("dispose",()=>{this.player.off("fullscreenchange",this.update)})}setWhiteboardMode(e){this.side=e,this.button.update(),ht.hasLocalStorage()&&ht.set(Yb,e),this.player.trigger("cv-whiteboard-change"),this.update()}setEnabled(e){this.enabled=e,this.update()}isEnabled(){return this.enabled}getSide(){return this.isEnabled()?this.side:"bottom"}update(){var t,i;if(this.player.removeClass("cv-whiteboard-top"),this.player.removeClass("cv-whiteboard-left"),this.player.removeClass("cv-whiteboard-right"),U.dom.removeClass(window.document.documentElement,"cv-whiteboard-html-font-size"),this.player.trigger("resizemenus"),this.player.trigger("cv-updatecog"),!this.isEnabled()){(t=this.dragHandle)==null||t.hide();return}(i=this.dragHandle)==null||i.show();const e=this.getSide();!this.player.isFullscreen()||e==="bottom"||(this.player.addClass(`cv-whiteboard-${e}`),U.dom.addClass(window.document.documentElement,"cv-whiteboard-html-font-size"))}}U.registerPlugin("whiteboardModePlugin",V6);const H6=U.getPlugin("plugin");class z6 extends H6{constructor(e){super(e)}deferMenu(){const e={subtitles:this.buildSubtitles(),qualities:this.buildQualities(),playbackSpeeds:this.buildPlaybackSpeeds()};this.player.trigger("cv-defer-menus",e)}buildSubtitles(){const e=[];let t=!1;const i=this.player.textTracks();for(let r=0;r<i.length;r++){const n=i[r],a=n.mode==="showing";e.unshift({id:n.label,name:n.label,selected:a}),a&&(t=!0)}return e.push({id:null,name:"Off",selected:!t}),e}buildQualities(){const e=[],t=this.player.qualityLevels();for(let i=0;i<t.length;i++){const r=t[i];e.push({id:r.id,name:r.id+"p",selected:r.enabled})}return e}buildPlaybackSpeeds(){const e=this.player.playbackRate();return this.player.options_.playbackRates.map(t=>({id:t,name:t+"x"+(t===1?" (Normal)":""),selected:e===t}))}}U.registerPlugin("deferMenusPlugin",z6);const W6="No skipping ahead!",Ih="PreventScrubbingTooltip",RA=1e3,G6=U.getComponent("Component"),Jb="cv-prevent-scrubbing-tooltip-show",Zb="cv-prevent-scrubbing-tooltip-remove-transition";class K6 extends G6{constructor(){super(...arguments),this.isShowing=!1}buildCSSClass(){return`cv-prevent-scrubbing-tooltip ${super.buildCSSClass()}`}createEl(e,t,i){return super.createEl(e,{...t,className:this.buildCSSClass(),innerText:W6},i)}show(){this.isShowing||(this.player_.userActive(!0),this.addClass(Jb),this.isShowing=!0)}hide(e=!1){this.isShowing&&(e&&(this.addClass(Zb),window.requestAnimationFrame(()=>{this.removeClass(Zb)})),this.player_.userActive(!1),this.removeClass(Jb),this.isShowing=!1)}}U.registerComponent(Ih,K6);const X6=U.getPlugin("plugin");class Q6 extends X6{constructor(e,t){super(e),this.isEnabled=!1,this.isPreviewing=!1;const{furthestVisitedTime:i=0,isEnabled:r=!1}=t??{};this.playerCurrentTimeFn=this.player.currentTime.bind(e),this.player.currentTime=this.currentTime.bind(this),this.onTimeUpdate=this.onTimeUpdate.bind(this),this.furthestVisitedTime=i,this.isEnabled=r,r&&this.enable()}dispose(){this.player.currentTime=this.playerCurrentTimeFn,this.isEnabled&&(this.disable(),super.dispose())}togglePreview(e){if(e){if(this.configurePreview(),this.isEnabled)return;this.enable(),this.isPreviewing=!0}else this.disable(),this.isPreviewing=!1}configurePreview(){this.player.currentTime(0),this.furthestVisitedTime=0}enable(){this.player.on("timeupdate",this.onTimeUpdate),this.getProgressControl().addChild(Ih),this.isEnabled=!0}disable(){this.player.off("timeupdate",this.onTimeUpdate),this.getProgressControl().removeChild(this.getPreventScrubbingTooltip()),this.isEnabled=!1}getProgressControl(){return this.player.controlBar.getChild("progressControl")}onTimeUpdate(){const e=this.playerCurrentTimeFn();e>this.furthestVisitedTime&&(this.furthestVisitedTime=e)}currentTime(e,...t){var n;if(typeof e!="number")return this.playerCurrentTimeFn(e,...t);if(!this.isEnabled){this.playerCurrentTimeFn(e,...t);return}const i=this.getPreventScrubbingTooltip(),r=(n=this.getSeekBar())==null?void 0:n.getChild("MouseTimeDisplay");if(e>this.furthestVisitedTime){i.show(),du(i.hide,RA,!1,i)(),r==null||r.hide(),this.playerCurrentTimeFn(this.furthestVisitedTime,t);return}r==null||r.show(),i.hide(!0),this.playerCurrentTimeFn(e,t)}getPreventScrubbingTooltip(){return this.getProgressControl().getChild(Ih)}getSeekBar(){var e;return(e=this.player.controlBar.getChild("ProgressControl"))==null?void 0:e.getChild("SeekBar")}}U.registerPlugin("preventScrubbingPlugin",Q6);const Y6=U.getComponent("Button"),eS="cv-muted";class py extends Y6{constructor(e){super(e),this.update(),this.update=this.update.bind(this),e.on("volumechange",this.update),e.on("dispose",()=>e.off("volumechange",this.update))}handleClick(){this.player_.muted(!this.player_.muted()),this.update()}update(){this.player_.muted()?this.addClass(eS):this.removeClass(eS)}buildCSSClass(){return"cv-mute-button cv-muted"}}U.registerComponent("muteButton",py);py.prototype.controlText_="Mute";const J6=U.getComponent("Component");class FA extends J6{constructor(e,t){super(e,t),this._onClickHandler=t.onClickHandler,this.bindEventListeners()}createEl(){return U.dom.createEl("div",{className:"cv-player-overlay"})}handleClick(e){typeof this._onClickHandler=="function"&&(e.stopImmediatePropagation(),this._onClickHandler())}dispose(){this.off("click",this.handleClick),super.dispose()}bindEventListeners(){this.on("click",this.handleClick)}}U.registerComponent("playerOverlay",FA);var BA=(s=>(s.Default="play",s.Hover="hover",s))(BA||{});const Z6=U.getPlugin("plugin"),tS="cv-preview-mode";class e7 extends Z6{constructor(e){super(e),this.buttonAdded=!1,this.mode=null}getMode(){return this.mode}setPlayerMode(e,t){const i=this.mode;if(this.mode=e,e==="hover"){this.buttonAdded||this.addButtons(t),this.player.addClass(tS),this.enableSubtites(),this.mute(),this.removeActivityTimeout(),this.player.trigger("resize");return}i==="hover"&&(this.player.removeClass(tS),this.disableSubtitles(),this.unmute(),this.restoreActivityTimeout(),this.player.trigger("resize"))}addButtons(e){const t=new py(this.player),i=new FA(this.player,{onClickHandler:e});this.player.addChild(t),this.player.addChild(i),this.buttonAdded=!0}enableSubtites(){this.player.dataLoaded(()=>this.player.persistSubtitleSettingsPlugin().previewModeSubtitles())}disableSubtitles(){this.player.dataLoaded(()=>this.player.persistSubtitleSettingsPlugin().applyUserPreferences())}mute(){this.player.ready(()=>{this.player.persistVolumePlugin().disable(),this.player.muted(!0)})}unmute(){this.player.ready(()=>{this.player.persistVolumePlugin().applyUserPreferences(),this.player.persistVolumePlugin().enable()})}removeActivityTimeout(){this.player.cache_.inactivityTimeout=this.player.options_.inactivityTimeout,this.player.options_.inactivityTimeout=0}restoreActivityTimeout(){this.player.options_.inactivityTimeout=this.player.cache_.inactivityTimeout}}U.registerPlugin("playerModePlugin",e7);const wv=U.getComponent("Component"),t7=U.getComponent("ClickableComponent"),i7=`
301
- <svg version="1.1" viewBox="0 0 24 24">
302
- <path id="Heart-Filled" d="m18.833 5.9735c-0.78916-0.95022-1.8839-1.4735-3.0826-1.4735-1.6859 0-2.7532 1.0685-3.3517 1.9648-0.15528 0.2326-0.28738 0.46582-0.39828 0.68529-0.11091-0.21946-0.24297-0.45269-0.39828-0.68529-0.5985-0.89636-1.6658-1.9648-3.3517-1.9648-1.1987 0-2.2935 0.52333-3.0827 1.4735-0.75275 0.90644-1.1673 2.1204-1.1673 3.4183 0 1.4128 0.51978 2.7268 1.6358 4.1353 0.99741 1.2588 2.4323 2.5564 4.0939 4.0589 0.61916 0.5599 1.2594 1.1389 1.9411 1.7718l0.02047 0.01903c0.08837 0.08211 0.19856 0.12313 0.30875 0.12313s0.22038-0.04105 0.30875-0.12313l0.02047-0.01903c0.68166-0.63289 1.3219-1.2119 1.9412-1.7719 1.6615-1.5024 3.0964-2.8 4.0938-4.0588 1.116-1.4085 1.6358-2.7225 1.6358-4.1353 0-1.2979-0.41459-2.5119-1.1674-3.4183z"/>
303
- </svg>
304
- `,r7=`
305
- <svg version="1.1" viewBox="0 0 24 24">
306
- <path id="Shape" d="m18.959 5.9741c-0.76992-0.92705-1.9357-1.5351-3.1052-1.5351-1.6448 0-2.8808 0.74937-3.4647 1.6238-0.15149 0.22693-0.28074 0.55125-0.38894 0.76537-0.10821-0.21411-0.23718-0.53844-0.38871-0.76537-0.58391-0.87451-1.8205-1.6238-3.4653-1.6238-1.1695 0-2.2376 0.60808-3.0075 1.5351-0.7344 0.88434-1.1388 1.9712-1.1388 3.2374 0 1.3784 0.50711 3.0509 1.5959 4.4251 0.97309 1.2281 2.373 2.4941 3.9941 3.9599 0.60406 0.54625 1.2285 1.1104 1.8936 1.7278l0.01997 0.01934c0.08622 0.08011 0.38931 0.21727 0.49681 0.21727 0.1075 0 0.40992-0.13796 0.49614-0.21804l0.0201-0.0178c0.66504-0.61746 1.2897-1.1824 1.8939-1.7287 1.621-1.4658 3.0209-2.7317 3.994-3.9598 1.0888-1.3742 1.5955-3.0467 1.5955-4.4251 0-1.2663-0.30646-2.3531-1.0409-3.2374zm-5.337 10.688c-0.51948 0.47226-1.0567 0.95549-1.6218 1.4768-0.56507-0.52124-1.101-1.0059-1.6219-1.4769-3.1725-2.8689-5.2684-4.7641-5.2684-7.2556 0-1.0298 0.32333-1.9863 0.91044-2.6933 0.59385-0.71497 1.4183-1.1088 2.3213-1.1088 1.254 0 2.0645 0.81976 2.5237 1.5074 0.41187 0.61679 0.62678 1.2385 0.70006 1.4772 0.06131 0.19978 0.23683 0.33499 0.43482 0.33499s0.37351-0.1352 0.43482-0.33499c0.07329-0.23867 0.28821-0.86044 0.70006-1.4773 0.45914-0.68766 1.2698-1.5074 2.5237-1.5074 0.90309 0 1.7274 0.39377 2.3213 1.1088 0.58714 0.70695 0.91047 1.6634 0.91047 2.6933 0 2.4914-2.1035 4.3783-5.2685 7.2557z" stroke-width=".97562"/>
307
- </svg>
308
- `;class n7 extends wv{createEl(){return wv.prototype.createEl.call(this,"span",{className:"cv-favourite-button-svg",innerHTML:`<span class='cv-favourite-heart'>${i7}</span><span class='cv-favourite-outline'>${r7}</span>`})}}class UA extends t7{constructor(e,t){super(e,t),this.isFavourited=t.isFavourited,this.renderIcon(),this.update()}renderIcon(){this.icon&&this.removeChild(this.icon),this.icon=new n7(this.player_),this.addChild(this.icon)}update(){this.isFavourited?this.addClass("cv-favourited"):this.removeClass("cv-favourited")}createEl(e,t,i){e="button",t={innerHTML:"",className:"cv-favourite-button",...t},i={type:"button",...i};const r=wv.prototype.createEl.call(this,e,t,i);return this.createControlTextEl(r),r}handleClick(){this.isFavourited=!this.isFavourited,this.update(),this.options_.onClick&&this.options_.onClick(this.isFavourited)}}UA.prototype.controlText_="Favourite";const s7=U.getPlugin("plugin");class a7 extends s7{setFavourite(e,t){if(this.initialized)return;const i=new UA(this.player,{isFavourited:e,onClick:t});this.player.addChild(i),this.initialized=!0}}U.registerPlugin("favouritePlugin",a7);const o7=U.getComponent("MenuButton"),l7=992,$A="Theatre mode (t)",jA="Default view (t)",iS="cv-theatre-mode-button";class u7 extends o7{constructor(e,t){super(e,t),this.alwaysCollapsed=!1,this.isCollapsed=!1,this.isCollabsible=!0,this.updateControlText()}getCollabsibleName(){return""}getCollabsibleValue(){return""}showInCollabsibleMenu(){return!(window.innerWidth<l7)}showCollapsibleMenu(){super.handleClick(null)}buildCSSClass(){return`cv-default-mode-button ${super.buildCSSClass()}`}buildWrapperCSSClass(){return`cv-menu-big ${super.buildWrapperCSSClass()}`}handleClick(){this.player_.theatreModePlugin().toggleTheatreMode(void 0,{shouldLog:!0}),this.updateControlText()}updateControlText(){this.player().theatreModePlugin().getTheatreMode()?this.controlText(jA):this.controlText($A)}}U.registerComponent("theatreModeButton",u7);const c7=U.getPlugin("plugin"),rS=992;class h7 extends c7{constructor(e,t){super(e,t),this.options=t,this.bindListeners(),e.ready(()=>this.onReady())}bindListeners(){this.onResize=this.onResize.bind(this),this.onFullscreenChange=this.onFullscreenChange.bind(this),this.player.on("playerresize",this.onResize),this.player.on("fullscreenchange",this.onFullscreenChange)}onReady(){if(!this.options||window.innerWidth<rS||!this.getCollapserator())return;this.button=this.createButton();const t=this.options.theatreMode;t&&(this.toggleButton(!0),this.options.onRequestTheatreMode(t))}dispose(){this.player.off("playerresize",this.onResize),this.player.off("fullscreenchange",this.onFullscreenChange),super.dispose()}toggleTheatreMode(e,t){var n;if(!this.options)return;const i=this.options.theatreMode,r=e!==void 0?e:!i;if(this.options.onRequestTheatreMode(r),this.options.theatreMode=r,window.requestAnimationFrame(()=>this.player.trigger("resize")),!!this.button)return i!==r&&(t!=null&&t.shouldLog)&&((n=this.analyticsService)==null||n.logUserAction({id:this.options.playbackObject.videoId,name:this.options.playbackObject.title},{actionType:fi.Click,descriptor:r?aa.EnableTheatreMode:aa.DisableTheatreMode,entity:Ai.Video})),r?(i||this.player.fill(!0),this.toggleButton(!0),r):(i&&this.player.fluid(!0),this.toggleButton(!1),this.player.viewTranscriptPlugin&&this.player.viewTranscriptPlugin().toggleTranscript(!1,{shouldLog:!1}),r)}onResize(){var e,t;window.innerWidth<rS?(e=this.button)==null||e.hide():this.player.isFullscreen()||(this.button||(this.button=this.createButton()),(t=this.button)==null||t.show())}createButton(){const e=this.getCollapserator();return(e==null?void 0:e.getChild("theatreModeButton"))||e.addChild("theatreModeButton",{},e.children_.length-3),e==null?void 0:e.getChild("theatreModeButton")}onFullscreenChange(){var e,t;this.player.isFullscreen()?(e=this.button)==null||e.hide():(t=this.button)==null||t.show()}getCollapserator(){return this.player.getChild("collapserator")}getTheatreMode(){return this.options.theatreMode}registerAnalytics(e){this.analyticsService=e}toggleButton(e){var t;this.button&&(e?(this.button.addClass(iS),this.button.updateControlText($A),this.button.setActive(!0)):((t=this.button)==null||t.removeClass(iS),this.button.updateControlText(jA),this.button.setActive(!1)))}}U.registerPlugin("theatreModePlugin",h7);var nS={},_p,sS;function bi(){if(sS)return _p;sS=1;var s=function(e){return e&&e.Math==Math&&e};return _p=s(typeof globalThis=="object"&&globalThis)||s(typeof window=="object"&&window)||s(typeof self=="object"&&self)||s(typeof ri=="object"&&ri)||Function("return this")(),_p}var Tp={},bp,aS;function br(){return aS||(aS=1,bp=function(s){try{return!!s()}catch{return!0}}),bp}var Sp,oS;function ca(){if(oS)return Sp;oS=1;var s=br();return Sp=!s(function(){return Object.defineProperty({},"a",{get:function(){return 7}}).a!=7}),Sp}var xp={},lS;function qA(){if(lS)return xp;lS=1;var s={}.propertyIsEnumerable,e=Object.getOwnPropertyDescriptor,t=e&&!s.call({1:2},1);return xp.f=t?function(r){var n=e(this,r);return!!n&&n.enumerable}:s,xp}var Cp,uS;function my(){return uS||(uS=1,Cp=function(s,e){return{enumerable:!(s&1),configurable:!(s&2),writable:!(s&4),value:e}}),Cp}var Ep,cS;function yd(){if(cS)return Ep;cS=1;var s={}.toString;return Ep=function(e){return s.call(e).slice(8,-1)},Ep}var wp,hS;function _d(){if(hS)return wp;hS=1;var s=br(),e=yd(),t="".split;return wp=s(function(){return!Object("z").propertyIsEnumerable(0)})?function(i){return e(i)=="String"?t.call(i,""):Object(i)}:Object,wp}var kp,dS;function Xo(){return dS||(dS=1,kp=function(s){if(s==null)throw TypeError("Can't call method on "+s);return s}),kp}var Ap,fS;function Td(){if(fS)return Ap;fS=1;var s=_d(),e=Xo();return Ap=function(t){return s(e(t))},Ap}var Ip,pS;function Rr(){return pS||(pS=1,Ip=function(s){return typeof s=="object"?s!==null:typeof s=="function"}),Ip}var Pp,mS;function VA(){if(mS)return Pp;mS=1;var s=Rr();return Pp=function(e,t){if(!s(e))return e;var i,r;if(t&&typeof(i=e.toString)=="function"&&!s(r=i.call(e))||typeof(i=e.valueOf)=="function"&&!s(r=i.call(e))||!t&&typeof(i=e.toString)=="function"&&!s(r=i.call(e)))return r;throw TypeError("Can't convert object to primitive value")},Pp}var Dp,gS;function on(){if(gS)return Dp;gS=1;var s={}.hasOwnProperty;return Dp=function(e,t){return s.call(e,t)},Dp}var Np,vS;function HA(){if(vS)return Np;vS=1;var s=bi(),e=Rr(),t=s.document,i=e(t)&&e(t.createElement);return Np=function(r){return i?t.createElement(r):{}},Np}var Lp,yS;function zA(){if(yS)return Lp;yS=1;var s=ca(),e=br(),t=HA();return Lp=!s&&!e(function(){return Object.defineProperty(t("div"),"a",{get:function(){return 7}}).a!=7}),Lp}var _S;function WA(){if(_S)return Tp;_S=1;var s=ca(),e=qA(),t=my(),i=Td(),r=VA(),n=on(),a=zA(),o=Object.getOwnPropertyDescriptor;return Tp.f=s?o:function(u,c){if(u=i(u),c=r(c,!0),a)try{return o(u,c)}catch{}if(n(u,c))return t(!e.f.call(u,c),u[c])},Tp}var Op={},Mp,TS;function Fr(){if(TS)return Mp;TS=1;var s=Rr();return Mp=function(e){if(!s(e))throw TypeError(String(e)+" is not an object");return e},Mp}var bS;function Qo(){if(bS)return Op;bS=1;var s=ca(),e=zA(),t=Fr(),i=VA(),r=Object.defineProperty;return Op.f=s?r:function(a,o,l){if(t(a),o=i(o,!0),t(l),e)try{return r(a,o,l)}catch{}if("get"in l||"set"in l)throw TypeError("Accessors not supported");return"value"in l&&(a[o]=l.value),a},Op}var Rp,SS;function ln(){if(SS)return Rp;SS=1;var s=ca(),e=Qo(),t=my();return Rp=s?function(i,r,n){return e.f(i,r,t(1,n))}:function(i,r,n){return i[r]=n,i},Rp}var Fp={exports:{}},Bp={exports:{}},Up,xS;function gy(){return xS||(xS=1,Up=!1),Up}var $p,CS;function vy(){if(CS)return $p;CS=1;var s=bi(),e=ln();return $p=function(t,i){try{e(s,t,i)}catch{s[t]=i}return i},$p}var jp,ES;function d7(){if(ES)return jp;ES=1;var s=bi(),e=vy(),t="__core-js_shared__",i=s[t]||e(t,{});return jp=i,jp}var wS;function bd(){if(wS)return Bp.exports;wS=1;var s=gy(),e=d7();return(Bp.exports=function(t,i){return e[t]||(e[t]=i!==void 0?i:{})})("versions",[]).push({version:"3.4.0",mode:s?"pure":"global",copyright:"© 2019 Denis Pushkarev (zloirock.ru)"}),Bp.exports}var qp,kS;function GA(){if(kS)return qp;kS=1;var s=bd();return qp=s("native-function-to-string",Function.toString),qp}var Vp,AS;function KA(){if(AS)return Vp;AS=1;var s=bi(),e=GA(),t=s.WeakMap;return Vp=typeof t=="function"&&/native code/.test(e.call(t)),Vp}var Hp,IS;function yy(){if(IS)return Hp;IS=1;var s=0,e=Math.random();return Hp=function(t){return"Symbol("+String(t===void 0?"":t)+")_"+(++s+e).toString(36)},Hp}var zp,PS;function _y(){if(PS)return zp;PS=1;var s=bd(),e=yy(),t=s("keys");return zp=function(i){return t[i]||(t[i]=e(i))},zp}var Wp,DS;function Sd(){return DS||(DS=1,Wp={}),Wp}var Gp,NS;function Tu(){if(NS)return Gp;NS=1;var s=KA(),e=bi(),t=Rr(),i=ln(),r=on(),n=_y(),a=Sd(),o=e.WeakMap,l,u,c,h=function(A){return c(A)?u(A):l(A,{})},d=function(A){return function(N){var $;if(!t(N)||($=u(N)).type!==A)throw TypeError("Incompatible receiver, "+A+" required");return $}};if(s){var g=new o,y=g.get,p=g.has,_=g.set;l=function(A,N){return _.call(g,A,N),N},u=function(A){return y.call(g,A)||{}},c=function(A){return p.call(g,A)}}else{var k=n("state");a[k]=!0,l=function(A,N){return i(A,k,N),N},u=function(A){return r(A,k)?A[k]:{}},c=function(A){return r(A,k)}}return Gp={set:l,get:u,has:c,enforce:h,getterFor:d},Gp}var LS;function Yo(){if(LS)return Fp.exports;LS=1;var s=bi(),e=bd(),t=ln(),i=on(),r=vy(),n=GA(),a=Tu(),o=a.get,l=a.enforce,u=String(n).split("toString");return e("inspectSource",function(c){return n.call(c)}),(Fp.exports=function(c,h,d,g){var y=g?!!g.unsafe:!1,p=g?!!g.enumerable:!1,_=g?!!g.noTargetGet:!1;if(typeof d=="function"&&(typeof h=="string"&&!i(d,"name")&&t(d,"name",h),l(d).source=u.join(typeof h=="string"?h:"")),c===s){p?c[h]=d:r(h,d);return}else y?!_&&c[h]&&(p=!0):delete c[h];p?c[h]=d:t(c,h,d)})(Function.prototype,"toString",function(){return typeof this=="function"&&o(this).source||n.call(this)}),Fp.exports}var Kp,OS;function f7(){return OS||(OS=1,Kp=bi()),Kp}var Xp,MS;function Ty(){if(MS)return Xp;MS=1;var s=f7(),e=bi(),t=function(i){return typeof i=="function"?i:void 0};return Xp=function(i,r){return arguments.length<2?t(s[i])||t(e[i]):s[i]&&s[i][r]||e[i]&&e[i][r]},Xp}var Qp={},Yp,RS;function xd(){if(RS)return Yp;RS=1;var s=Math.ceil,e=Math.floor;return Yp=function(t){return isNaN(t=+t)?0:(t>0?e:s)(t)},Yp}var Jp,FS;function Jo(){if(FS)return Jp;FS=1;var s=xd(),e=Math.min;return Jp=function(t){return t>0?e(s(t),9007199254740991):0},Jp}var Zp,BS;function p7(){if(BS)return Zp;BS=1;var s=xd(),e=Math.max,t=Math.min;return Zp=function(i,r){var n=s(i);return n<0?e(n+r,0):t(n,r)},Zp}var em,US;function m7(){if(US)return em;US=1;var s=Td(),e=Jo(),t=p7(),i=function(r){return function(n,a,o){var l=s(n),u=e(l.length),c=t(o,u),h;if(r&&a!=a){for(;u>c;)if(h=l[c++],h!=h)return!0}else for(;u>c;c++)if((r||c in l)&&l[c]===a)return r||c||0;return!r&&-1}};return em={includes:i(!0),indexOf:i(!1)},em}var tm,$S;function XA(){if($S)return tm;$S=1;var s=on(),e=Td(),t=m7().indexOf,i=Sd();return tm=function(r,n){var a=e(r),o=0,l=[],u;for(u in a)!s(i,u)&&s(a,u)&&l.push(u);for(;n.length>o;)s(a,u=n[o++])&&(~t(l,u)||l.push(u));return l},tm}var im,jS;function by(){return jS||(jS=1,im=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]),im}var qS;function g7(){if(qS)return Qp;qS=1;var s=XA(),e=by(),t=e.concat("length","prototype");return Qp.f=Object.getOwnPropertyNames||function(r){return s(r,t)},Qp}var rm={},VS;function QA(){return VS||(VS=1,rm.f=Object.getOwnPropertySymbols),rm}var nm,HS;function v7(){if(HS)return nm;HS=1;var s=Ty(),e=g7(),t=QA(),i=Fr();return nm=s("Reflect","ownKeys")||function(n){var a=e.f(i(n)),o=t.f;return o?a.concat(o(n)):a},nm}var sm,zS;function y7(){if(zS)return sm;zS=1;var s=on(),e=v7(),t=WA(),i=Qo();return sm=function(r,n){for(var a=e(n),o=i.f,l=t.f,u=0;u<a.length;u++){var c=a[u];s(r,c)||o(r,c,l(n,c))}},sm}var am,WS;function YA(){if(WS)return am;WS=1;var s=br(),e=/#|\.prototype\./,t=function(o,l){var u=r[i(o)];return u==a?!0:u==n?!1:typeof l=="function"?s(l):!!l},i=t.normalize=function(o){return String(o).replace(e,".").toLowerCase()},r=t.data={},n=t.NATIVE="N",a=t.POLYFILL="P";return am=t,am}var om,GS;function fs(){if(GS)return om;GS=1;var s=bi(),e=WA().f,t=ln(),i=Yo(),r=vy(),n=y7(),a=YA();return om=function(o,l){var u=o.target,c=o.global,h=o.stat,d,g,y,p,_,k;if(c?g=s:h?g=s[u]||r(u,{}):g=(s[u]||{}).prototype,g)for(y in l){if(_=l[y],o.noTargetGet?(k=e(g,y),p=k&&k.value):p=g[y],d=a(c?y:u+(h?".":"#")+y,o.forced),!d&&p!==void 0){if(typeof _==typeof p)continue;n(_,p)}(o.sham||p&&p.sham)&&t(_,"sham",!0),i(g,y,_,o)}},om}var lm,KS;function JA(){return KS||(KS=1,lm=function(s){if(typeof s!="function")throw TypeError(String(s)+" is not a function");return s}),lm}var um,XS;function ZA(){if(XS)return um;XS=1;var s=JA();return um=function(e,t,i){if(s(e),t===void 0)return e;switch(i){case 0:return function(){return e.call(t)};case 1:return function(r){return e.call(t,r)};case 2:return function(r,n){return e.call(t,r,n)};case 3:return function(r,n,a){return e.call(t,r,n,a)}}return function(){return e.apply(t,arguments)}},um}var cm,QS;function bu(){if(QS)return cm;QS=1;var s=Xo();return cm=function(e){return Object(s(e))},cm}var hm,YS;function _7(){if(YS)return hm;YS=1;var s=yd();return hm=Array.isArray||function(t){return s(t)=="Array"},hm}var dm,JS;function T7(){if(JS)return dm;JS=1;var s=br();return dm=!!Object.getOwnPropertySymbols&&!s(function(){return!String(Symbol())}),dm}var fm,ZS;function lr(){if(ZS)return fm;ZS=1;var s=bi(),e=bd(),t=yy(),i=T7(),r=s.Symbol,n=e("wks");return fm=function(a){return n[a]||(n[a]=i&&r[a]||(i?r:t)("Symbol."+a))},fm}var pm,ex;function b7(){if(ex)return pm;ex=1;var s=Rr(),e=_7(),t=lr(),i=t("species");return pm=function(r,n){var a;return e(r)&&(a=r.constructor,typeof a=="function"&&(a===Array||e(a.prototype))?a=void 0:s(a)&&(a=a[i],a===null&&(a=void 0))),new(a===void 0?Array:a)(n===0?0:n)},pm}var mm,tx;function Sy(){if(tx)return mm;tx=1;var s=ZA(),e=_d(),t=bu(),i=Jo(),r=b7(),n=[].push,a=function(o){var l=o==1,u=o==2,c=o==3,h=o==4,d=o==6,g=o==5||d;return function(y,p,_,k){for(var A=t(y),N=e(A),$=s(p,_,3),R=i(N.length),L=0,F=k||r,B=l?F(y,R):u?F(y,0):void 0,C,I;R>L;L++)if((g||L in N)&&(C=N[L],I=$(C,L,A),o)){if(l)B[L]=I;else if(I)switch(o){case 3:return!0;case 5:return C;case 6:return L;case 2:n.call(B,C)}else if(h)return!1}return d?-1:c||h?h:B}};return mm={forEach:a(0),map:a(1),filter:a(2),some:a(3),every:a(4),find:a(5),findIndex:a(6)},mm}var gm,ix;function eI(){if(ix)return gm;ix=1;var s=br();return gm=function(e,t){var i=[][e];return!i||!s(function(){i.call(null,t||function(){throw 1},1)})},gm}var vm,rx;function tI(){if(rx)return vm;rx=1;var s=Sy().forEach,e=eI();return vm=e("forEach")?function(i){return s(this,i,arguments.length>1?arguments[1]:void 0)}:[].forEach,vm}var nx;function S7(){if(nx)return nS;nx=1;var s=fs(),e=tI();return s({target:"Array",proto:!0,forced:[].forEach!=e},{forEach:e}),nS}S7();var sx={},ym,ax;function iI(){return ax||(ax=1,ym={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0}),ym}var ox;function x7(){if(ox)return sx;ox=1;var s=bi(),e=iI(),t=tI(),i=ln();for(var r in e){var n=s[r],a=n&&n.prototype;if(a&&a.forEach!==t)try{i(a,"forEach",t)}catch{a.forEach=t}}return sx}x7();var _m,lx;function C7(){if(lx)return _m;lx=1;var s=!!(typeof window<"u"&&window.document&&window.document.createElement);return _m=s,_m}var E7=C7();const xy=Hi(E7);var ux={},Tm,cx;function w7(){if(cx)return Tm;cx=1;var s=Ty();return Tm=s("navigator","userAgent")||"",Tm}var bm,hx;function k7(){if(hx)return bm;hx=1;var s=bi(),e=w7(),t=s.process,i=t&&t.versions,r=i&&i.v8,n,a;return r?(n=r.split("."),a=n[0]+n[1]):e&&(n=e.match(/Edge\/(\d+)/),(!n||n[1]>=74)&&(n=e.match(/Chrome\/(\d+)/),n&&(a=n[1]))),bm=a&&+a,bm}var Sm,dx;function A7(){if(dx)return Sm;dx=1;var s=br(),e=lr(),t=k7(),i=e("species");return Sm=function(r){return t>=51||!s(function(){var n=[],a=n.constructor={};return a[i]=function(){return{foo:1}},n[r](Boolean).foo!==1})},Sm}var fx;function I7(){if(fx)return ux;fx=1;var s=fs(),e=Sy().filter,t=A7();return s({target:"Array",proto:!0,forced:!t("filter")},{filter:function(r){return e(this,r,arguments.length>1?arguments[1]:void 0)}}),ux}I7();var xm,px;function rI(){if(px)return xm;px=1;var s=XA(),e=by();return xm=Object.keys||function(i){return s(i,e)},xm}var Cm,mx;function P7(){if(mx)return Cm;mx=1;var s=ca(),e=Qo(),t=Fr(),i=rI();return Cm=s?Object.defineProperties:function(n,a){t(n);for(var o=i(a),l=o.length,u=0,c;l>u;)e.f(n,c=o[u++],a[c]);return n},Cm}var Em,gx;function D7(){if(gx)return Em;gx=1;var s=Ty();return Em=s("document","documentElement"),Em}var wm,vx;function nI(){if(vx)return wm;vx=1;var s=Fr(),e=P7(),t=by(),i=Sd(),r=D7(),n=HA(),a=_y(),o=a("IE_PROTO"),l="prototype",u=function(){},c=function(){var h=n("iframe"),d=t.length,g="<",y="script",p=">",_="java"+y+":",k;for(h.style.display="none",r.appendChild(h),h.src=String(_),k=h.contentWindow.document,k.open(),k.write(g+y+p+"document.F=Object"+g+"/"+y+p),k.close(),c=k.F;d--;)delete c[l][t[d]];return c()};return wm=Object.create||function(d,g){var y;return d!==null?(u[l]=s(d),y=new u,u[l]=null,y[o]=d):y=c(),g===void 0?y:e(y,g)},i[o]=!0,wm}var km,yx;function N7(){if(yx)return km;yx=1;var s=lr(),e=nI(),t=ln(),i=s("unscopables"),r=Array.prototype;return r[i]==null&&t(r,i,e(null)),km=function(n){r[i][n]=!0},km}var Am,_x;function Su(){return _x||(_x=1,Am={}),Am}var Im,Tx;function L7(){if(Tx)return Im;Tx=1;var s=br();return Im=!s(function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype}),Im}var Pm,bx;function sI(){if(bx)return Pm;bx=1;var s=on(),e=bu(),t=_y(),i=L7(),r=t("IE_PROTO"),n=Object.prototype;return Pm=i?Object.getPrototypeOf:function(a){return a=e(a),s(a,r)?a[r]:typeof a.constructor=="function"&&a instanceof a.constructor?a.constructor.prototype:a instanceof Object?n:null},Pm}var Dm,Sx;function aI(){if(Sx)return Dm;Sx=1;var s=sI(),e=ln(),t=on(),i=lr(),r=gy(),n=i("iterator"),a=!1,o=function(){return this},l,u,c;return[].keys&&(c=[].keys(),"next"in c?(u=s(s(c)),u!==Object.prototype&&(l=u)):a=!0),l==null&&(l={}),!r&&!t(l,n)&&e(l,n,o),Dm={IteratorPrototype:l,BUGGY_SAFARI_ITERATORS:a},Dm}var Nm,xx;function Cy(){if(xx)return Nm;xx=1;var s=Qo().f,e=on(),t=lr(),i=t("toStringTag");return Nm=function(r,n,a){r&&!e(r=a?r:r.prototype,i)&&s(r,i,{configurable:!0,value:n})},Nm}var Lm,Cx;function O7(){if(Cx)return Lm;Cx=1;var s=aI().IteratorPrototype,e=nI(),t=my(),i=Cy(),r=Su(),n=function(){return this};return Lm=function(a,o,l){var u=o+" Iterator";return a.prototype=e(s,{next:t(1,l)}),i(a,u,!1,!0),r[u]=n,a},Lm}var Om,Ex;function M7(){if(Ex)return Om;Ex=1;var s=Rr();return Om=function(e){if(!s(e)&&e!==null)throw TypeError("Can't set "+String(e)+" as a prototype");return e},Om}var Mm,wx;function oI(){if(wx)return Mm;wx=1;var s=Fr(),e=M7();return Mm=Object.setPrototypeOf||("__proto__"in{}?function(){var t=!1,i={},r;try{r=Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set,r.call(i,[]),t=i instanceof Array}catch{}return function(a,o){return s(a),e(o),t?r.call(a,o):a.__proto__=o,a}}():void 0),Mm}var Rm,kx;function lI(){if(kx)return Rm;kx=1;var s=fs(),e=O7(),t=sI(),i=oI(),r=Cy(),n=ln(),a=Yo(),o=lr(),l=gy(),u=Su(),c=aI(),h=c.IteratorPrototype,d=c.BUGGY_SAFARI_ITERATORS,g=o("iterator"),y="keys",p="values",_="entries",k=function(){return this};return Rm=function(A,N,$,R,L,F,B){e($,N,R);var C=function(oe){if(oe===L&&ie)return ie;if(!d&&oe in H)return H[oe];switch(oe){case y:return function(){return new $(this,oe)};case p:return function(){return new $(this,oe)};case _:return function(){return new $(this,oe)}}return function(){return new $(this)}},I=N+" Iterator",G=!1,H=A.prototype,K=H[g]||H["@@iterator"]||L&&H[L],ie=!d&&K||C(L),he=N=="Array"&&H.entries||K,fe,re,ne;if(he&&(fe=t(he.call(new A)),h!==Object.prototype&&fe.next&&(!l&&t(fe)!==h&&(i?i(fe,h):typeof fe[g]!="function"&&n(fe,g,k)),r(fe,I,!0,!0),l&&(u[I]=k))),L==p&&K&&K.name!==p&&(G=!0,ie=function(){return K.call(this)}),(!l||B)&&H[g]!==ie&&n(H,g,ie),u[N]=ie,L)if(re={values:C(p),keys:F?ie:C(y),entries:C(_)},B)for(ne in re)(d||G||!(ne in H))&&a(H,ne,re[ne]);else s({target:N,proto:!0,forced:d||G},re);return re},Rm}var Fm,Ax;function uI(){if(Ax)return Fm;Ax=1;var s=Td(),e=N7(),t=Su(),i=Tu(),r=lI(),n="Array Iterator",a=i.set,o=i.getterFor(n);return Fm=r(Array,"Array",function(l,u){a(this,{type:n,target:s(l),index:0,kind:u})},function(){var l=o(this),u=l.target,c=l.kind,h=l.index++;return!u||h>=u.length?(l.target=void 0,{value:void 0,done:!0}):c=="keys"?{value:h,done:!1}:c=="values"?{value:u[h],done:!1}:{value:[h,u[h]],done:!1}},"values"),t.Arguments=t.Array,e("keys"),e("values"),e("entries"),Fm}uI();var Ix={},Bm,Px;function R7(){if(Px)return Bm;Px=1;var s=ca(),e=br(),t=rI(),i=QA(),r=qA(),n=bu(),a=_d(),o=Object.assign;return Bm=!o||e(function(){var l={},u={},c=Symbol(),h="abcdefghijklmnopqrst";return l[c]=7,h.split("").forEach(function(d){u[d]=d}),o({},l)[c]!=7||t(o({},u)).join("")!=h})?function(u,c){for(var h=n(u),d=arguments.length,g=1,y=i.f,p=r.f;d>g;)for(var _=a(arguments[g++]),k=y?t(_).concat(y(_)):t(_),A=k.length,N=0,$;A>N;)$=k[N++],(!s||p.call(_,$))&&(h[$]=_[$]);return h}:o,Bm}var Dx;function F7(){if(Dx)return Ix;Dx=1;var s=fs(),e=R7();return s({target:"Object",stat:!0,forced:Object.assign!==e},{assign:e}),Ix}F7();var Nx={},Um,Lx;function cI(){if(Lx)return Um;Lx=1;var s=yd(),e=lr(),t=e("toStringTag"),i=s(function(){return arguments}())=="Arguments",r=function(n,a){try{return n[a]}catch{}};return Um=function(n){var a,o,l;return n===void 0?"Undefined":n===null?"Null":typeof(o=r(a=Object(n),t))=="string"?o:i?s(a):(l=s(a))=="Object"&&typeof a.callee=="function"?"Arguments":l},Um}var $m,Ox;function B7(){if(Ox)return $m;Ox=1;var s=cI(),e=lr(),t=e("toStringTag"),i={};return i[t]="z",$m=String(i)!=="[object z]"?function(){return"[object "+s(this)+"]"}:i.toString,$m}var Mx;function U7(){if(Mx)return Nx;Mx=1;var s=Yo(),e=B7(),t=Object.prototype;return e!==t.toString&&s(t,"toString",e,{unsafe:!0}),Nx}U7();var Rx={},jm,Fx;function hI(){return Fx||(Fx=1,jm=`
309
- \v\f\r                 \u2028\u2029\uFEFF`),jm}var qm,Bx;function $7(){if(Bx)return qm;Bx=1;var s=Xo(),e=hI(),t="["+e+"]",i=RegExp("^"+t+t+"*"),r=RegExp(t+t+"*$"),n=function(a){return function(o){var l=String(s(o));return a&1&&(l=l.replace(i,"")),a&2&&(l=l.replace(r,"")),l}};return qm={start:n(1),end:n(2),trim:n(3)},qm}var Vm,Ux;function j7(){if(Ux)return Vm;Ux=1;var s=bi(),e=$7().trim,t=hI(),i=s.parseInt,r=/^[+-]?0[Xx]/,n=i(t+"08")!==8||i(t+"0x16")!==22;return Vm=n?function(o,l){var u=e(String(o));return i(u,l>>>0||(r.test(u)?16:10))}:i,Vm}var $x;function q7(){if($x)return Rx;$x=1;var s=fs(),e=j7();return s({global:!0,forced:parseInt!=e},{parseInt:e}),Rx}q7();var jx={},Hm,qx;function dI(){if(qx)return Hm;qx=1;var s=xd(),e=Xo(),t=function(i){return function(r,n){var a=String(e(r)),o=s(n),l=a.length,u,c;return o<0||o>=l?i?"":void 0:(u=a.charCodeAt(o),u<55296||u>56319||o+1===l||(c=a.charCodeAt(o+1))<56320||c>57343?i?a.charAt(o):u:i?a.slice(o,o+2):(u-55296<<10)+(c-56320)+65536)}};return Hm={codeAt:t(!1),charAt:t(!0)},Hm}var Vx;function V7(){if(Vx)return jx;Vx=1;var s=dI().charAt,e=Tu(),t=lI(),i="String Iterator",r=e.set,n=e.getterFor(i);return t(String,"String",function(a){r(this,{type:i,string:String(a),index:0})},function(){var o=n(this),l=o.string,u=o.index,c;return u>=l.length?{value:void 0,done:!0}:(c=s(l,u),o.index+=c.length,{value:c,done:!1})}),jx}V7();var zm={exports:{}},Wm,Hx;function fI(){if(Hx)return Wm;Hx=1;var s=Yo();return Wm=function(e,t,i){for(var r in t)s(e,r,t[r],i);return e},Wm}var Gm={exports:{}},Km,zx;function H7(){if(zx)return Km;zx=1;var s=br();return Km=!s(function(){return Object.isExtensible(Object.preventExtensions({}))}),Km}var Wx;function Ey(){if(Wx)return Gm.exports;Wx=1;var s=Sd(),e=Rr(),t=on(),i=Qo().f,r=yy(),n=H7(),a=r("meta"),o=0,l=Object.isExtensible||function(){return!0},u=function(y){i(y,a,{value:{objectID:"O"+ ++o,weakData:{}}})},c=function(y,p){if(!e(y))return typeof y=="symbol"?y:(typeof y=="string"?"S":"P")+y;if(!t(y,a)){if(!l(y))return"F";if(!p)return"E";u(y)}return y[a].objectID},h=function(y,p){if(!t(y,a)){if(!l(y))return!0;if(!p)return!1;u(y)}return y[a].weakData},d=function(y){return n&&g.REQUIRED&&l(y)&&!t(y,a)&&u(y),y},g=Gm.exports={REQUIRED:!1,fastKey:c,getWeakData:h,onFreeze:d};return s[a]=!0,Gm.exports}var Xm={exports:{}},Qm,Gx;function z7(){if(Gx)return Qm;Gx=1;var s=lr(),e=Su(),t=s("iterator"),i=Array.prototype;return Qm=function(r){return r!==void 0&&(e.Array===r||i[t]===r)},Qm}var Ym,Kx;function W7(){if(Kx)return Ym;Kx=1;var s=cI(),e=Su(),t=lr(),i=t("iterator");return Ym=function(r){if(r!=null)return r[i]||r["@@iterator"]||e[s(r)]},Ym}var Jm,Xx;function G7(){if(Xx)return Jm;Xx=1;var s=Fr();return Jm=function(e,t,i,r){try{return r?t(s(i)[0],i[1]):t(i)}catch(a){var n=e.return;throw n!==void 0&&s(n.call(e)),a}},Jm}var Qx;function pI(){if(Qx)return Xm.exports;Qx=1;var s=Fr(),e=z7(),t=Jo(),i=ZA(),r=W7(),n=G7(),a=function(l,u){this.stopped=l,this.result=u},o=Xm.exports=function(l,u,c,h,d){var g=i(u,c,h?2:1),y,p,_,k,A,N,$;if(d)y=l;else{if(p=r(l),typeof p!="function")throw TypeError("Target is not iterable");if(e(p)){for(_=0,k=t(l.length);k>_;_++)if(A=h?g(s($=l[_])[0],$[1]):g(l[_]),A&&A instanceof a)return A;return new a(!1)}y=p.call(l)}for(N=y.next;!($=N.call(y)).done;)if(A=n(y,g,$.value,h),typeof A=="object"&&A&&A instanceof a)return A;return new a(!1)};return o.stop=function(l){return new a(!0,l)},Xm.exports}var Zm,Yx;function mI(){return Yx||(Yx=1,Zm=function(s,e,t){if(!(s instanceof e))throw TypeError("Incorrect "+(t?t+" ":"")+"invocation");return s}),Zm}var eg,Jx;function K7(){if(Jx)return eg;Jx=1;var s=lr(),e=s("iterator"),t=!1;try{var i=0,r={next:function(){return{done:!!i++}},return:function(){t=!0}};r[e]=function(){return this},Array.from(r,function(){throw 2})}catch{}return eg=function(n,a){if(!a&&!t)return!1;var o=!1;try{var l={};l[e]=function(){return{next:function(){return{done:o=!0}}}},n(l)}catch{}return o},eg}var tg,Zx;function X7(){if(Zx)return tg;Zx=1;var s=Rr(),e=oI();return tg=function(t,i,r){var n,a;return e&&typeof(n=i.constructor)=="function"&&n!==r&&s(a=n.prototype)&&a!==r.prototype&&e(t,a),t},tg}var ig,eC;function Q7(){if(eC)return ig;eC=1;var s=fs(),e=bi(),t=YA(),i=Yo(),r=Ey(),n=pI(),a=mI(),o=Rr(),l=br(),u=K7(),c=Cy(),h=X7();return ig=function(d,g,y,p,_){var k=e[d],A=k&&k.prototype,N=k,$=p?"set":"add",R={},L=function(H){var K=A[H];i(A,H,H=="add"?function(he){return K.call(this,he===0?0:he),this}:H=="delete"?function(ie){return _&&!o(ie)?!1:K.call(this,ie===0?0:ie)}:H=="get"?function(he){return _&&!o(he)?void 0:K.call(this,he===0?0:he)}:H=="has"?function(he){return _&&!o(he)?!1:K.call(this,he===0?0:he)}:function(he,fe){return K.call(this,he===0?0:he,fe),this})};if(t(d,typeof k!="function"||!(_||A.forEach&&!l(function(){new k().entries().next()}))))N=y.getConstructor(g,d,p,$),r.REQUIRED=!0;else if(t(d,!0)){var F=new N,B=F[$](_?{}:-0,1)!=F,C=l(function(){F.has(1)}),I=u(function(H){new k(H)}),G=!_&&l(function(){for(var H=new k,K=5;K--;)H[$](K,K);return!H.has(-0)});I||(N=g(function(H,K){a(H,N,d);var ie=h(new k,H,N);return K!=null&&n(K,ie[$],ie,p),ie}),N.prototype=A,A.constructor=N),(C||G)&&(L("delete"),L("has"),p&&L("get")),(G||B)&&L($),_&&A.clear&&delete A.clear}return R[d]=N,s({global:!0,forced:N!=k},R),c(N,d),_||y.setStrong(N,d,p),N},ig}var rg,tC;function Y7(){if(tC)return rg;tC=1;var s=fI(),e=Ey().getWeakData,t=Fr(),i=Rr(),r=mI(),n=pI(),a=Sy(),o=on(),l=Tu(),u=l.set,c=l.getterFor,h=a.find,d=a.findIndex,g=0,y=function(k){return k.frozen||(k.frozen=new p)},p=function(){this.entries=[]},_=function(k,A){return h(k.entries,function(N){return N[0]===A})};return p.prototype={get:function(k){var A=_(this,k);if(A)return A[1]},has:function(k){return!!_(this,k)},set:function(k,A){var N=_(this,k);N?N[1]=A:this.entries.push([k,A])},delete:function(k){var A=d(this.entries,function(N){return N[0]===k});return~A&&this.entries.splice(A,1),!!~A}},rg={getConstructor:function(k,A,N,$){var R=k(function(B,C){r(B,R,A),u(B,{type:A,id:g++,frozen:void 0}),C!=null&&n(C,B[$],B,N)}),L=c(A),F=function(B,C,I){var G=L(B),H=e(t(C),!0);return H===!0?y(G).set(C,I):H[G.id]=I,B};return s(R.prototype,{delete:function(B){var C=L(this);if(!i(B))return!1;var I=e(B);return I===!0?y(C).delete(B):I&&o(I,C.id)&&delete I[C.id]},has:function(C){var I=L(this);if(!i(C))return!1;var G=e(C);return G===!0?y(I).has(C):G&&o(G,I.id)}}),s(R.prototype,N?{get:function(C){var I=L(this);if(i(C)){var G=e(C);return G===!0?y(I).get(C):G?G[I.id]:void 0}},set:function(C,I){return F(this,C,I)}}:{add:function(C){return F(this,C,!0)}}),R}},rg}var iC;function J7(){if(iC)return zm.exports;iC=1;var s=bi(),e=fI(),t=Ey(),i=Q7(),r=Y7(),n=Rr(),a=Tu().enforce,o=KA(),l=!s.ActiveXObject&&"ActiveXObject"in s,u=Object.isExtensible,c,h=function(A){return function(){return A(this,arguments.length?arguments[0]:void 0)}},d=zm.exports=i("WeakMap",h,r,!0,!0);if(o&&l){c=r.getConstructor(h,"WeakMap",!0),t.REQUIRED=!0;var g=d.prototype,y=g.delete,p=g.has,_=g.get,k=g.set;e(g,{delete:function(A){if(n(A)&&!u(A)){var N=a(this);return N.frozen||(N.frozen=new c),y.call(this,A)||N.frozen.delete(A)}return y.call(this,A)},has:function(N){if(n(N)&&!u(N)){var $=a(this);return $.frozen||($.frozen=new c),p.call(this,N)||$.frozen.has(N)}return p.call(this,N)},get:function(N){if(n(N)&&!u(N)){var $=a(this);return $.frozen||($.frozen=new c),p.call(this,N)?_.call(this,N):$.frozen.get(N)}return _.call(this,N)},set:function(N,$){if(n(N)&&!u(N)){var R=a(this);R.frozen||(R.frozen=new c),p.call(this,N)?k.call(this,N,$):R.frozen.set(N,$)}else k.call(this,N,$);return this}})}return zm.exports}J7();var rC={},nC;function Z7(){if(nC)return rC;nC=1;var s=bi(),e=iI(),t=uI(),i=ln(),r=lr(),n=r("iterator"),a=r("toStringTag"),o=t.values;for(var l in e){var u=s[l],c=u&&u.prototype;if(c){if(c[n]!==o)try{i(c,n,o)}catch{c[n]=o}if(c[a]||i(c,a,l),e[l]){for(var h in t)if(c[h]!==t[h])try{i(c,h,t[h])}catch{c[h]=t[h]}}}}return rC}Z7();var ng,sC;function e$(){if(sC)return ng;sC=1;var s="Expected a function",e=NaN,t="[object Symbol]",i=/^\s+|\s+$/g,r=/^[-+]0x[0-9a-f]+$/i,n=/^0b[01]+$/i,a=/^0o[0-7]+$/i,o=parseInt,l=typeof ri=="object"&&ri&&ri.Object===Object&&ri,u=typeof self=="object"&&self&&self.Object===Object&&self,c=l||u||Function("return this")(),h=Object.prototype,d=h.toString,g=Math.max,y=Math.min,p=function(){return c.Date.now()};function _(L,F,B){var C,I,G,H,K,ie,he=0,fe=!1,re=!1,ne=!0;if(typeof L!="function")throw new TypeError(s);F=R(F)||0,A(B)&&(fe=!!B.leading,re="maxWait"in B,G=re?g(R(B.maxWait)||0,F):G,ne="trailing"in B?!!B.trailing:ne);function oe(Oe){var Ve=C,nt=I;return C=I=void 0,he=Oe,H=L.apply(nt,Ve),H}function de(Oe){return he=Oe,K=setTimeout(De,F),fe?oe(Oe):H}function ve(Oe){var Ve=Oe-ie,nt=Oe-he,_t=F-Ve;return re?y(_t,G-nt):_t}function ke(Oe){var Ve=Oe-ie,nt=Oe-he;return ie===void 0||Ve>=F||Ve<0||re&&nt>=G}function De(){var Oe=p();if(ke(Oe))return Me(Oe);K=setTimeout(De,ve(Oe))}function Me(Oe){return K=void 0,ne&&C?oe(Oe):(C=I=void 0,H)}function Ne(){K!==void 0&&clearTimeout(K),he=0,C=ie=I=K=void 0}function Ye(){return K===void 0?H:Me(p())}function Re(){var Oe=p(),Ve=ke(Oe);if(C=arguments,I=this,ie=Oe,Ve){if(K===void 0)return de(ie);if(re)return K=setTimeout(De,F),oe(ie)}return K===void 0&&(K=setTimeout(De,F)),H}return Re.cancel=Ne,Re.flush=Ye,Re}function k(L,F,B){var C=!0,I=!0;if(typeof L!="function")throw new TypeError(s);return A(B)&&(C="leading"in B?!!B.leading:C,I="trailing"in B?!!B.trailing:I),_(L,F,{leading:C,maxWait:F,trailing:I})}function A(L){var F=typeof L;return!!L&&(F=="object"||F=="function")}function N(L){return!!L&&typeof L=="object"}function $(L){return typeof L=="symbol"||N(L)&&d.call(L)==t}function R(L){if(typeof L=="number")return L;if($(L))return e;if(A(L)){var F=typeof L.valueOf=="function"?L.valueOf():L;L=A(F)?F+"":F}if(typeof L!="string")return L===0?L:+L;L=L.replace(i,"");var B=n.test(L);return B||a.test(L)?o(L.slice(2),B?2:8):r.test(L)?e:+L}return ng=k,ng}var t$=e$();const aC=Hi(t$);var sg,oC;function i$(){if(oC)return sg;oC=1;var s="Expected a function",e=NaN,t="[object Symbol]",i=/^\s+|\s+$/g,r=/^[-+]0x[0-9a-f]+$/i,n=/^0b[01]+$/i,a=/^0o[0-7]+$/i,o=parseInt,l=typeof ri=="object"&&ri&&ri.Object===Object&&ri,u=typeof self=="object"&&self&&self.Object===Object&&self,c=l||u||Function("return this")(),h=Object.prototype,d=h.toString,g=Math.max,y=Math.min,p=function(){return c.Date.now()};function _(R,L,F){var B,C,I,G,H,K,ie=0,he=!1,fe=!1,re=!0;if(typeof R!="function")throw new TypeError(s);L=$(L)||0,k(F)&&(he=!!F.leading,fe="maxWait"in F,I=fe?g($(F.maxWait)||0,L):I,re="trailing"in F?!!F.trailing:re);function ne(Re){var Oe=B,Ve=C;return B=C=void 0,ie=Re,G=R.apply(Ve,Oe),G}function oe(Re){return ie=Re,H=setTimeout(ke,L),he?ne(Re):G}function de(Re){var Oe=Re-K,Ve=Re-ie,nt=L-Oe;return fe?y(nt,I-Ve):nt}function ve(Re){var Oe=Re-K,Ve=Re-ie;return K===void 0||Oe>=L||Oe<0||fe&&Ve>=I}function ke(){var Re=p();if(ve(Re))return De(Re);H=setTimeout(ke,de(Re))}function De(Re){return H=void 0,re&&B?ne(Re):(B=C=void 0,G)}function Me(){H!==void 0&&clearTimeout(H),ie=0,B=K=C=H=void 0}function Ne(){return H===void 0?G:De(p())}function Ye(){var Re=p(),Oe=ve(Re);if(B=arguments,C=this,K=Re,Oe){if(H===void 0)return oe(K);if(fe)return H=setTimeout(ke,L),ne(K)}return H===void 0&&(H=setTimeout(ke,L)),G}return Ye.cancel=Me,Ye.flush=Ne,Ye}function k(R){var L=typeof R;return!!R&&(L=="object"||L=="function")}function A(R){return!!R&&typeof R=="object"}function N(R){return typeof R=="symbol"||A(R)&&d.call(R)==t}function $(R){if(typeof R=="number")return R;if(N(R))return e;if(k(R)){var L=typeof R.valueOf=="function"?R.valueOf():R;R=k(L)?L+"":L}if(typeof R!="string")return R===0?R:+R;R=R.replace(i,"");var F=n.test(R);return F||a.test(R)?o(R.slice(2),F?2:8):r.test(R)?e:+R}return sg=_,sg}var r$=i$();const lC=Hi(r$);var ag,uC;function n$(){if(uC)return ag;uC=1;var s="Expected a function",e="__lodash_hash_undefined__",t="[object Function]",i="[object GeneratorFunction]",r=/[\\^$.*+?()[\]{}|]/g,n=/^\[object .+?Constructor\]$/,a=typeof ri=="object"&&ri&&ri.Object===Object&&ri,o=typeof self=="object"&&self&&self.Object===Object&&self,l=a||o||Function("return this")();function u(Te,Ee){return Te==null?void 0:Te[Ee]}function c(Te){var Ee=!1;if(Te!=null&&typeof Te.toString!="function")try{Ee=!!(Te+"")}catch{}return Ee}var h=Array.prototype,d=Function.prototype,g=Object.prototype,y=l["__core-js_shared__"],p=function(){var Te=/[^.]+$/.exec(y&&y.keys&&y.keys.IE_PROTO||"");return Te?"Symbol(src)_1."+Te:""}(),_=d.toString,k=g.hasOwnProperty,A=g.toString,N=RegExp("^"+_.call(k).replace(r,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),$=h.splice,R=Oe(l,"Map"),L=Oe(Object,"create");function F(Te){var Ee=-1,Be=Te?Te.length:0;for(this.clear();++Ee<Be;){var Fe=Te[Ee];this.set(Fe[0],Fe[1])}}function B(){this.__data__=L?L(null):{}}function C(Te){return this.has(Te)&&delete this.__data__[Te]}function I(Te){var Ee=this.__data__;if(L){var Be=Ee[Te];return Be===e?void 0:Be}return k.call(Ee,Te)?Ee[Te]:void 0}function G(Te){var Ee=this.__data__;return L?Ee[Te]!==void 0:k.call(Ee,Te)}function H(Te,Ee){var Be=this.__data__;return Be[Te]=L&&Ee===void 0?e:Ee,this}F.prototype.clear=B,F.prototype.delete=C,F.prototype.get=I,F.prototype.has=G,F.prototype.set=H;function K(Te){var Ee=-1,Be=Te?Te.length:0;for(this.clear();++Ee<Be;){var Fe=Te[Ee];this.set(Fe[0],Fe[1])}}function ie(){this.__data__=[]}function he(Te){var Ee=this.__data__,Be=Ne(Ee,Te);if(Be<0)return!1;var Fe=Ee.length-1;return Be==Fe?Ee.pop():$.call(Ee,Be,1),!0}function fe(Te){var Ee=this.__data__,Be=Ne(Ee,Te);return Be<0?void 0:Ee[Be][1]}function re(Te){return Ne(this.__data__,Te)>-1}function ne(Te,Ee){var Be=this.__data__,Fe=Ne(Be,Te);return Fe<0?Be.push([Te,Ee]):Be[Fe][1]=Ee,this}K.prototype.clear=ie,K.prototype.delete=he,K.prototype.get=fe,K.prototype.has=re,K.prototype.set=ne;function oe(Te){var Ee=-1,Be=Te?Te.length:0;for(this.clear();++Ee<Be;){var Fe=Te[Ee];this.set(Fe[0],Fe[1])}}function de(){this.__data__={hash:new F,map:new(R||K),string:new F}}function ve(Te){return Re(this,Te).delete(Te)}function ke(Te){return Re(this,Te).get(Te)}function De(Te){return Re(this,Te).has(Te)}function Me(Te,Ee){return Re(this,Te).set(Te,Ee),this}oe.prototype.clear=de,oe.prototype.delete=ve,oe.prototype.get=ke,oe.prototype.has=De,oe.prototype.set=Me;function Ne(Te,Ee){for(var Be=Te.length;Be--;)if(Mi(Te[Be][0],Ee))return Be;return-1}function Ye(Te){if(!zi(Te)||nt(Te))return!1;var Ee=Ft(Te)||c(Te)?N:n;return Ee.test(_t(Te))}function Re(Te,Ee){var Be=Te.__data__;return Ve(Ee)?Be[typeof Ee=="string"?"string":"hash"]:Be.map}function Oe(Te,Ee){var Be=u(Te,Ee);return Ye(Be)?Be:void 0}function Ve(Te){var Ee=typeof Te;return Ee=="string"||Ee=="number"||Ee=="symbol"||Ee=="boolean"?Te!=="__proto__":Te===null}function nt(Te){return!!p&&p in Te}function _t(Te){if(Te!=null){try{return _.call(Te)}catch{}try{return Te+""}catch{}}return""}function Nt(Te,Ee){if(typeof Te!="function"||Ee&&typeof Ee!="function")throw new TypeError(s);var Be=function(){var Fe=arguments,Xe=Ee?Ee.apply(this,Fe):Fe[0],Je=Be.cache;if(Je.has(Xe))return Je.get(Xe);var Tt=Te.apply(this,Fe);return Be.cache=Je.set(Xe,Tt),Tt};return Be.cache=new(Nt.Cache||oe),Be}Nt.Cache=oe;function Mi(Te,Ee){return Te===Ee||Te!==Te&&Ee!==Ee}function Ft(Te){var Ee=zi(Te)?A.call(Te):"";return Ee==t||Ee==i}function zi(Te){var Ee=typeof Te;return!!Te&&(Ee=="object"||Ee=="function")}return ag=Nt,ag}var s$=n$();const a$=Hi(s$);var gI=function(){if(typeof Map<"u")return Map;function s(e,t){var i=-1;return e.some(function(r,n){return r[0]===t?(i=n,!0):!1}),i}return function(){function e(){this.__entries__=[]}return Object.defineProperty(e.prototype,"size",{get:function(){return this.__entries__.length},enumerable:!0,configurable:!0}),e.prototype.get=function(t){var i=s(this.__entries__,t),r=this.__entries__[i];return r&&r[1]},e.prototype.set=function(t,i){var r=s(this.__entries__,t);~r?this.__entries__[r][1]=i:this.__entries__.push([t,i])},e.prototype.delete=function(t){var i=this.__entries__,r=s(i,t);~r&&i.splice(r,1)},e.prototype.has=function(t){return!!~s(this.__entries__,t)},e.prototype.clear=function(){this.__entries__.splice(0)},e.prototype.forEach=function(t,i){i===void 0&&(i=null);for(var r=0,n=this.__entries__;r<n.length;r++){var a=n[r];t.call(i,a[1],a[0])}},e}()}(),kv=typeof window<"u"&&typeof document<"u"&&window.document===document,Ph=function(){return typeof global<"u"&&global.Math===Math?global:typeof self<"u"&&self.Math===Math?self:typeof window<"u"&&window.Math===Math?window:Function("return this")()}(),o$=function(){return typeof requestAnimationFrame=="function"?requestAnimationFrame.bind(Ph):function(s){return setTimeout(function(){return s(Date.now())},1e3/60)}}(),l$=2;function u$(s,e){var t=!1,i=!1,r=0;function n(){t&&(t=!1,s()),i&&o()}function a(){o$(n)}function o(){var l=Date.now();if(t){if(l-r<l$)return;i=!0}else t=!0,i=!1,setTimeout(a,e);r=l}return o}var c$=20,h$=["top","right","bottom","left","width","height","size","weight"],d$=typeof MutationObserver<"u",f$=function(){function s(){this.connected_=!1,this.mutationEventsAdded_=!1,this.mutationsObserver_=null,this.observers_=[],this.onTransitionEnd_=this.onTransitionEnd_.bind(this),this.refresh=u$(this.refresh.bind(this),c$)}return s.prototype.addObserver=function(e){~this.observers_.indexOf(e)||this.observers_.push(e),this.connected_||this.connect_()},s.prototype.removeObserver=function(e){var t=this.observers_,i=t.indexOf(e);~i&&t.splice(i,1),!t.length&&this.connected_&&this.disconnect_()},s.prototype.refresh=function(){var e=this.updateObservers_();e&&this.refresh()},s.prototype.updateObservers_=function(){var e=this.observers_.filter(function(t){return t.gatherActive(),t.hasActive()});return e.forEach(function(t){return t.broadcastActive()}),e.length>0},s.prototype.connect_=function(){!kv||this.connected_||(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),d$?(this.mutationsObserver_=new MutationObserver(this.refresh),this.mutationsObserver_.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0})):(document.addEventListener("DOMSubtreeModified",this.refresh),this.mutationEventsAdded_=!0),this.connected_=!0)},s.prototype.disconnect_=function(){!kv||!this.connected_||(document.removeEventListener("transitionend",this.onTransitionEnd_),window.removeEventListener("resize",this.refresh),this.mutationsObserver_&&this.mutationsObserver_.disconnect(),this.mutationEventsAdded_&&document.removeEventListener("DOMSubtreeModified",this.refresh),this.mutationsObserver_=null,this.mutationEventsAdded_=!1,this.connected_=!1)},s.prototype.onTransitionEnd_=function(e){var t=e.propertyName,i=t===void 0?"":t,r=h$.some(function(n){return!!~i.indexOf(n)});r&&this.refresh()},s.getInstance=function(){return this.instance_||(this.instance_=new s),this.instance_},s.instance_=null,s}(),vI=function(s,e){for(var t=0,i=Object.keys(e);t<i.length;t++){var r=i[t];Object.defineProperty(s,r,{value:e[r],enumerable:!1,writable:!1,configurable:!0})}return s},Do=function(s){var e=s&&s.ownerDocument&&s.ownerDocument.defaultView;return e||Ph},yI=Cd(0,0,0,0);function Dh(s){return parseFloat(s)||0}function cC(s){for(var e=[],t=1;t<arguments.length;t++)e[t-1]=arguments[t];return e.reduce(function(i,r){var n=s["border-"+r+"-width"];return i+Dh(n)},0)}function p$(s){for(var e=["top","right","bottom","left"],t={},i=0,r=e;i<r.length;i++){var n=r[i],a=s["padding-"+n];t[n]=Dh(a)}return t}function m$(s){var e=s.getBBox();return Cd(0,0,e.width,e.height)}function g$(s){var e=s.clientWidth,t=s.clientHeight;if(!e&&!t)return yI;var i=Do(s).getComputedStyle(s),r=p$(i),n=r.left+r.right,a=r.top+r.bottom,o=Dh(i.width),l=Dh(i.height);if(i.boxSizing==="border-box"&&(Math.round(o+n)!==e&&(o-=cC(i,"left","right")+n),Math.round(l+a)!==t&&(l-=cC(i,"top","bottom")+a)),!y$(s)){var u=Math.round(o+n)-e,c=Math.round(l+a)-t;Math.abs(u)!==1&&(o-=u),Math.abs(c)!==1&&(l-=c)}return Cd(r.left,r.top,o,l)}var v$=function(){return typeof SVGGraphicsElement<"u"?function(s){return s instanceof Do(s).SVGGraphicsElement}:function(s){return s instanceof Do(s).SVGElement&&typeof s.getBBox=="function"}}();function y$(s){return s===Do(s).document.documentElement}function _$(s){return kv?v$(s)?m$(s):g$(s):yI}function T$(s){var e=s.x,t=s.y,i=s.width,r=s.height,n=typeof DOMRectReadOnly<"u"?DOMRectReadOnly:Object,a=Object.create(n.prototype);return vI(a,{x:e,y:t,width:i,height:r,top:t,right:e+i,bottom:r+t,left:e}),a}function Cd(s,e,t,i){return{x:s,y:e,width:t,height:i}}var b$=function(){function s(e){this.broadcastWidth=0,this.broadcastHeight=0,this.contentRect_=Cd(0,0,0,0),this.target=e}return s.prototype.isActive=function(){var e=_$(this.target);return this.contentRect_=e,e.width!==this.broadcastWidth||e.height!==this.broadcastHeight},s.prototype.broadcastRect=function(){var e=this.contentRect_;return this.broadcastWidth=e.width,this.broadcastHeight=e.height,e},s}(),S$=function(){function s(e,t){var i=T$(t);vI(this,{target:e,contentRect:i})}return s}(),x$=function(){function s(e,t,i){if(this.activeObservations_=[],this.observations_=new gI,typeof e!="function")throw new TypeError("The callback provided as parameter 1 is not a function.");this.callback_=e,this.controller_=t,this.callbackCtx_=i}return s.prototype.observe=function(e){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(!(typeof Element>"u"||!(Element instanceof Object))){if(!(e instanceof Do(e).Element))throw new TypeError('parameter 1 is not of type "Element".');var t=this.observations_;t.has(e)||(t.set(e,new b$(e)),this.controller_.addObserver(this),this.controller_.refresh())}},s.prototype.unobserve=function(e){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(!(typeof Element>"u"||!(Element instanceof Object))){if(!(e instanceof Do(e).Element))throw new TypeError('parameter 1 is not of type "Element".');var t=this.observations_;t.has(e)&&(t.delete(e),t.size||this.controller_.removeObserver(this))}},s.prototype.disconnect=function(){this.clearActive(),this.observations_.clear(),this.controller_.removeObserver(this)},s.prototype.gatherActive=function(){var e=this;this.clearActive(),this.observations_.forEach(function(t){t.isActive()&&e.activeObservations_.push(t)})},s.prototype.broadcastActive=function(){if(this.hasActive()){var e=this.callbackCtx_,t=this.activeObservations_.map(function(i){return new S$(i.target,i.broadcastRect())});this.callback_.call(e,t,e),this.clearActive()}},s.prototype.clearActive=function(){this.activeObservations_.splice(0)},s.prototype.hasActive=function(){return this.activeObservations_.length>0},s}(),_I=typeof WeakMap<"u"?new WeakMap:new gI,TI=function(){function s(e){if(!(this instanceof s))throw new TypeError("Cannot call a class as a function.");if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");var t=f$.getInstance(),i=new x$(e,t,this);_I.set(this,i)}return s}();["observe","unobserve","disconnect"].forEach(function(s){TI.prototype[s]=function(){var e;return(e=_I.get(this))[s].apply(e,arguments)}});var C$=function(){return typeof Ph.ResizeObserver<"u"?Ph.ResizeObserver:TI}(),hC={},og,dC;function E$(){if(dC)return og;dC=1;var s=JA(),e=bu(),t=_d(),i=Jo(),r=function(n){return function(a,o,l,u){s(o);var c=e(a),h=t(c),d=i(c.length),g=n?d-1:0,y=n?-1:1;if(l<2)for(;;){if(g in h){u=h[g],g+=y;break}if(g+=y,n?g<0:d<=g)throw TypeError("Reduce of empty array with no initial value")}for(;n?g>=0:d>g;g+=y)g in h&&(u=o(u,h[g],g,c));return u}};return og={left:r(!1),right:r(!0)},og}var fC;function w$(){if(fC)return hC;fC=1;var s=fs(),e=E$().left,t=eI();return s({target:"Array",proto:!0,forced:t("reduce")},{reduce:function(r){return e(this,r,arguments.length,arguments.length>1?arguments[1]:void 0)}}),hC}w$();var pC={},mC;function k$(){if(mC)return pC;mC=1;var s=ca(),e=Qo().f,t=Function.prototype,i=t.toString,r=/^\s*function ([^ (]*)/,n="name";return s&&!(n in t)&&e(t,n,{configurable:!0,get:function(){try{return i.call(this).match(r)[1]}catch{return""}}}),pC}k$();var gC={},lg,vC;function A$(){if(vC)return lg;vC=1;var s=Fr();return lg=function(){var e=s(this),t="";return e.global&&(t+="g"),e.ignoreCase&&(t+="i"),e.multiline&&(t+="m"),e.dotAll&&(t+="s"),e.unicode&&(t+="u"),e.sticky&&(t+="y"),t},lg}var ug,yC;function wy(){if(yC)return ug;yC=1;var s=A$(),e=RegExp.prototype.exec,t=String.prototype.replace,i=e,r=function(){var o=/a/,l=/b*/g;return e.call(o,"a"),e.call(l,"a"),o.lastIndex!==0||l.lastIndex!==0}(),n=/()??/.exec("")[1]!==void 0,a=r||n;return a&&(i=function(l){var u=this,c,h,d,g;return n&&(h=new RegExp("^"+u.source+"$(?!\\s)",s.call(u))),r&&(c=u.lastIndex),d=e.call(u,l),r&&d&&(u.lastIndex=u.global?d.index+d[0].length:c),n&&d&&d.length>1&&t.call(d[0],h,function(){for(g=1;g<arguments.length-2;g++)arguments[g]===void 0&&(d[g]=void 0)}),d}),ug=i,ug}var _C;function I$(){if(_C)return gC;_C=1;var s=fs(),e=wy();return s({target:"RegExp",proto:!0,forced:/./.exec!==e},{exec:e}),gC}I$();var TC={},cg,bC;function bI(){if(bC)return cg;bC=1;var s=ln(),e=Yo(),t=br(),i=lr(),r=wy(),n=i("species"),a=!t(function(){var l=/./;return l.exec=function(){var u=[];return u.groups={a:"7"},u},"".replace(l,"$<a>")!=="7"}),o=!t(function(){var l=/(?:)/,u=l.exec;l.exec=function(){return u.apply(this,arguments)};var c="ab".split(l);return c.length!==2||c[0]!=="a"||c[1]!=="b"});return cg=function(l,u,c,h){var d=i(l),g=!t(function(){var N={};return N[d]=function(){return 7},""[l](N)!=7}),y=g&&!t(function(){var N=!1,$=/a/;return l==="split"&&($={},$.constructor={},$.constructor[n]=function(){return $},$.flags="",$[d]=/./[d]),$.exec=function(){return N=!0,null},$[d](""),!N});if(!g||!y||l==="replace"&&!a||l==="split"&&!o){var p=/./[d],_=c(d,""[l],function(N,$,R,L,F){return $.exec===r?g&&!F?{done:!0,value:p.call($,R,L)}:{done:!0,value:N.call(R,$,L)}:{done:!1}}),k=_[0],A=_[1];e(String.prototype,l,k),e(RegExp.prototype,d,u==2?function(N,$){return A.call(N,this,$)}:function(N){return A.call(N,this)}),h&&s(RegExp.prototype[d],"sham",!0)}},cg}var hg,SC;function SI(){if(SC)return hg;SC=1;var s=dI().charAt;return hg=function(e,t,i){return t+(i?s(e,t).length:1)},hg}var dg,xC;function xI(){if(xC)return dg;xC=1;var s=yd(),e=wy();return dg=function(t,i){var r=t.exec;if(typeof r=="function"){var n=r.call(t,i);if(typeof n!="object")throw TypeError("RegExp exec method returned something other than an Object or null");return n}if(s(t)!=="RegExp")throw TypeError("RegExp#exec called on incompatible receiver");return e.call(t,i)},dg}var CC;function P$(){if(CC)return TC;CC=1;var s=bI(),e=Fr(),t=Jo(),i=Xo(),r=SI(),n=xI();return s("match",1,function(a,o,l){return[function(c){var h=i(this),d=c==null?void 0:c[a];return d!==void 0?d.call(c,h):new RegExp(c)[a](String(h))},function(u){var c=l(o,u,this);if(c.done)return c.value;var h=e(u),d=String(this);if(!h.global)return n(h,d);var g=h.unicode;h.lastIndex=0;for(var y=[],p=0,_;(_=n(h,d))!==null;){var k=String(_[0]);y[p]=k,k===""&&(h.lastIndex=r(d,t(h.lastIndex),g)),p++}return p===0?null:y}]}),TC}P$();var EC={},wC;function D$(){if(wC)return EC;wC=1;var s=bI(),e=Fr(),t=bu(),i=Jo(),r=xd(),n=Xo(),a=SI(),o=xI(),l=Math.max,u=Math.min,c=Math.floor,h=/\$([$&'`]|\d\d?|<[^>]*>)/g,d=/\$([$&'`]|\d\d?)/g,g=function(y){return y===void 0?y:String(y)};return s("replace",2,function(y,p,_){return[function(N,$){var R=n(this),L=N==null?void 0:N[y];return L!==void 0?L.call(N,R,$):p.call(String(R),N,$)},function(A,N){var $=_(p,A,this,N);if($.done)return $.value;var R=e(A),L=String(this),F=typeof N=="function";F||(N=String(N));var B=R.global;if(B){var C=R.unicode;R.lastIndex=0}for(var I=[];;){var G=o(R,L);if(G===null||(I.push(G),!B))break;var H=String(G[0]);H===""&&(R.lastIndex=a(L,i(R.lastIndex),C))}for(var K="",ie=0,he=0;he<I.length;he++){G=I[he];for(var fe=String(G[0]),re=l(u(r(G.index),L.length),0),ne=[],oe=1;oe<G.length;oe++)ne.push(g(G[oe]));var de=G.groups;if(F){var ve=[fe].concat(ne,re,L);de!==void 0&&ve.push(de);var ke=String(N.apply(void 0,ve))}else ke=k(fe,L,re,ne,de,N);re>=ie&&(K+=L.slice(ie,re)+ke,ie=re+fe.length)}return K+L.slice(ie)}];function k(A,N,$,R,L,F){var B=$+A.length,C=R.length,I=d;return L!==void 0&&(L=t(L),I=h),p.call(F,I,function(G,H){var K;switch(H.charAt(0)){case"$":return"$";case"&":return A;case"`":return N.slice(0,$);case"'":return N.slice(B);case"<":K=L[H.slice(1,-1)];break;default:var ie=+H;if(ie===0)return G;if(ie>C){var he=c(ie/10);return he===0?G:he<=C?R[he-1]===void 0?H.charAt(1):R[he-1]+H.charAt(1):G}K=R[ie-1]}return K===void 0?"":K})}}),EC}D$();var za=null,kC=null;xy&&window.addEventListener("resize",function(){kC!==window.devicePixelRatio&&(kC=window.devicePixelRatio,za=null)});function AC(){if(za===null){if(typeof document>"u")return za=0,za;var s=document.body,e=document.createElement("div");e.classList.add("simplebar-hide-scrollbar"),s.appendChild(e);var t=e.getBoundingClientRect().right;s.removeChild(e),za=t}return za}var Nh=function(e){var t=Array.prototype.reduce.call(e,function(i,r){var n=r.name.match(/data-simplebar-(.+)/);if(n){var a=n[1].replace(/\W+(.)/g,function(o,l){return l.toUpperCase()});switch(r.value){case"true":i[a]=!0;break;case"false":i[a]=!1;break;case void 0:i[a]=!0;break;default:i[a]=r.value}}return i},{});return t};function is(s){return!s||!s.ownerDocument||!s.ownerDocument.defaultView?window:s.ownerDocument.defaultView}function fg(s){return!s||!s.ownerDocument?document:s.ownerDocument}var Vt=function(){function s(t,i){var r=this;this.onScroll=function(){var n=is(r.el);r.scrollXTicking||(n.requestAnimationFrame(r.scrollX),r.scrollXTicking=!0),r.scrollYTicking||(n.requestAnimationFrame(r.scrollY),r.scrollYTicking=!0)},this.scrollX=function(){r.axis.x.isOverflowing&&(r.showScrollbar("x"),r.positionScrollbar("x")),r.scrollXTicking=!1},this.scrollY=function(){r.axis.y.isOverflowing&&(r.showScrollbar("y"),r.positionScrollbar("y")),r.scrollYTicking=!1},this.onMouseEnter=function(){r.showScrollbar("x"),r.showScrollbar("y")},this.onMouseMove=function(n){r.mouseX=n.clientX,r.mouseY=n.clientY,(r.axis.x.isOverflowing||r.axis.x.forceVisible)&&r.onMouseMoveForAxis("x"),(r.axis.y.isOverflowing||r.axis.y.forceVisible)&&r.onMouseMoveForAxis("y")},this.onMouseLeave=function(){r.onMouseMove.cancel(),(r.axis.x.isOverflowing||r.axis.x.forceVisible)&&r.onMouseLeaveForAxis("x"),(r.axis.y.isOverflowing||r.axis.y.forceVisible)&&r.onMouseLeaveForAxis("y"),r.mouseX=-1,r.mouseY=-1},this.onWindowResize=function(){r.scrollbarWidth=r.getScrollbarWidth(),r.hideNativeScrollbar()},this.hideScrollbars=function(){r.axis.x.track.rect=r.axis.x.track.el.getBoundingClientRect(),r.axis.y.track.rect=r.axis.y.track.el.getBoundingClientRect(),r.isWithinBounds(r.axis.y.track.rect)||(r.axis.y.scrollbar.el.classList.remove(r.classNames.visible),r.axis.y.isVisible=!1),r.isWithinBounds(r.axis.x.track.rect)||(r.axis.x.scrollbar.el.classList.remove(r.classNames.visible),r.axis.x.isVisible=!1)},this.onPointerEvent=function(n){var a,o;r.axis.x.track.rect=r.axis.x.track.el.getBoundingClientRect(),r.axis.y.track.rect=r.axis.y.track.el.getBoundingClientRect(),(r.axis.x.isOverflowing||r.axis.x.forceVisible)&&(a=r.isWithinBounds(r.axis.x.track.rect)),(r.axis.y.isOverflowing||r.axis.y.forceVisible)&&(o=r.isWithinBounds(r.axis.y.track.rect)),(a||o)&&(n.preventDefault(),n.stopPropagation(),n.type==="mousedown"&&(a&&(r.axis.x.scrollbar.rect=r.axis.x.scrollbar.el.getBoundingClientRect(),r.isWithinBounds(r.axis.x.scrollbar.rect)?r.onDragStart(n,"x"):r.onTrackClick(n,"x")),o&&(r.axis.y.scrollbar.rect=r.axis.y.scrollbar.el.getBoundingClientRect(),r.isWithinBounds(r.axis.y.scrollbar.rect)?r.onDragStart(n,"y"):r.onTrackClick(n,"y"))))},this.drag=function(n){var a,o=r.axis[r.draggedAxis].track,l=o.rect[r.axis[r.draggedAxis].sizeAttr],u=r.axis[r.draggedAxis].scrollbar,c=r.contentWrapperEl[r.axis[r.draggedAxis].scrollSizeAttr],h=parseInt(r.elStyles[r.axis[r.draggedAxis].sizeAttr],10);n.preventDefault(),n.stopPropagation(),r.draggedAxis==="y"?a=n.pageY:a=n.pageX;var d=a-o.rect[r.axis[r.draggedAxis].offsetAttr]-r.axis[r.draggedAxis].dragOffset,g=d/(l-u.size),y=g*(c-h);r.draggedAxis==="x"&&(y=r.isRtl&&s.getRtlHelpers().isRtlScrollbarInverted?y-(l+u.size):y,y=r.isRtl&&s.getRtlHelpers().isRtlScrollingInverted?-y:y),r.contentWrapperEl[r.axis[r.draggedAxis].scrollOffsetAttr]=y},this.onEndDrag=function(n){var a=fg(r.el),o=is(r.el);n.preventDefault(),n.stopPropagation(),r.el.classList.remove(r.classNames.dragging),a.removeEventListener("mousemove",r.drag,!0),a.removeEventListener("mouseup",r.onEndDrag,!0),r.removePreventClickId=o.setTimeout(function(){a.removeEventListener("click",r.preventClick,!0),a.removeEventListener("dblclick",r.preventClick,!0),r.removePreventClickId=null})},this.preventClick=function(n){n.preventDefault(),n.stopPropagation()},this.el=t,this.minScrollbarWidth=20,this.options=Object.assign({},s.defaultOptions,{},i),this.classNames=Object.assign({},s.defaultOptions.classNames,{},this.options.classNames),this.axis={x:{scrollOffsetAttr:"scrollLeft",sizeAttr:"width",scrollSizeAttr:"scrollWidth",offsetSizeAttr:"offsetWidth",offsetAttr:"left",overflowAttr:"overflowX",dragOffset:0,isOverflowing:!0,isVisible:!1,forceVisible:!1,track:{},scrollbar:{}},y:{scrollOffsetAttr:"scrollTop",sizeAttr:"height",scrollSizeAttr:"scrollHeight",offsetSizeAttr:"offsetHeight",offsetAttr:"top",overflowAttr:"overflowY",dragOffset:0,isOverflowing:!0,isVisible:!1,forceVisible:!1,track:{},scrollbar:{}}},this.removePreventClickId=null,!s.instances.has(this.el)&&(this.recalculate=aC(this.recalculate.bind(this),64),this.onMouseMove=aC(this.onMouseMove.bind(this),64),this.hideScrollbars=lC(this.hideScrollbars.bind(this),this.options.timeout),this.onWindowResize=lC(this.onWindowResize.bind(this),64,{leading:!0}),s.getRtlHelpers=a$(s.getRtlHelpers),this.init())}s.getRtlHelpers=function(){var i=document.createElement("div");i.innerHTML='<div class="hs-dummy-scrollbar-size"><div style="height: 200%; width: 200%; margin: 10px 0;"></div></div>';var r=i.firstElementChild;document.body.appendChild(r);var n=r.firstElementChild;r.scrollLeft=0;var a=s.getOffset(r),o=s.getOffset(n);r.scrollLeft=999;var l=s.getOffset(n);return{isRtlScrollingInverted:a.left!==o.left&&o.left-l.left!==0,isRtlScrollbarInverted:a.left!==o.left}},s.getOffset=function(i){var r=i.getBoundingClientRect(),n=fg(i),a=is(i);return{top:r.top+(a.pageYOffset||n.documentElement.scrollTop),left:r.left+(a.pageXOffset||n.documentElement.scrollLeft)}};var e=s.prototype;return e.init=function(){s.instances.set(this.el,this),xy&&(this.initDOM(),this.scrollbarWidth=this.getScrollbarWidth(),this.recalculate(),this.initListeners())},e.initDOM=function(){var i=this;if(Array.prototype.filter.call(this.el.children,function(a){return a.classList.contains(i.classNames.wrapper)}).length)this.wrapperEl=this.el.querySelector("."+this.classNames.wrapper),this.contentWrapperEl=this.options.scrollableNode||this.el.querySelector("."+this.classNames.contentWrapper),this.contentEl=this.options.contentNode||this.el.querySelector("."+this.classNames.contentEl),this.offsetEl=this.el.querySelector("."+this.classNames.offset),this.maskEl=this.el.querySelector("."+this.classNames.mask),this.placeholderEl=this.findChild(this.wrapperEl,"."+this.classNames.placeholder),this.heightAutoObserverWrapperEl=this.el.querySelector("."+this.classNames.heightAutoObserverWrapperEl),this.heightAutoObserverEl=this.el.querySelector("."+this.classNames.heightAutoObserverEl),this.axis.x.track.el=this.findChild(this.el,"."+this.classNames.track+"."+this.classNames.horizontal),this.axis.y.track.el=this.findChild(this.el,"."+this.classNames.track+"."+this.classNames.vertical);else{for(this.wrapperEl=document.createElement("div"),this.contentWrapperEl=document.createElement("div"),this.offsetEl=document.createElement("div"),this.maskEl=document.createElement("div"),this.contentEl=document.createElement("div"),this.placeholderEl=document.createElement("div"),this.heightAutoObserverWrapperEl=document.createElement("div"),this.heightAutoObserverEl=document.createElement("div"),this.wrapperEl.classList.add(this.classNames.wrapper),this.contentWrapperEl.classList.add(this.classNames.contentWrapper),this.offsetEl.classList.add(this.classNames.offset),this.maskEl.classList.add(this.classNames.mask),this.contentEl.classList.add(this.classNames.contentEl),this.placeholderEl.classList.add(this.classNames.placeholder),this.heightAutoObserverWrapperEl.classList.add(this.classNames.heightAutoObserverWrapperEl),this.heightAutoObserverEl.classList.add(this.classNames.heightAutoObserverEl);this.el.firstChild;)this.contentEl.appendChild(this.el.firstChild);this.contentWrapperEl.appendChild(this.contentEl),this.offsetEl.appendChild(this.contentWrapperEl),this.maskEl.appendChild(this.offsetEl),this.heightAutoObserverWrapperEl.appendChild(this.heightAutoObserverEl),this.wrapperEl.appendChild(this.heightAutoObserverWrapperEl),this.wrapperEl.appendChild(this.maskEl),this.wrapperEl.appendChild(this.placeholderEl),this.el.appendChild(this.wrapperEl)}if(!this.axis.x.track.el||!this.axis.y.track.el){var r=document.createElement("div"),n=document.createElement("div");r.classList.add(this.classNames.track),n.classList.add(this.classNames.scrollbar),r.appendChild(n),this.axis.x.track.el=r.cloneNode(!0),this.axis.x.track.el.classList.add(this.classNames.horizontal),this.axis.y.track.el=r.cloneNode(!0),this.axis.y.track.el.classList.add(this.classNames.vertical),this.el.appendChild(this.axis.x.track.el),this.el.appendChild(this.axis.y.track.el)}this.axis.x.scrollbar.el=this.axis.x.track.el.querySelector("."+this.classNames.scrollbar),this.axis.y.scrollbar.el=this.axis.y.track.el.querySelector("."+this.classNames.scrollbar),this.options.autoHide||(this.axis.x.scrollbar.el.classList.add(this.classNames.visible),this.axis.y.scrollbar.el.classList.add(this.classNames.visible)),this.el.setAttribute("data-simplebar","init")},e.initListeners=function(){var i=this,r=is(this.el);this.options.autoHide&&this.el.addEventListener("mouseenter",this.onMouseEnter),["mousedown","click","dblclick"].forEach(function(o){i.el.addEventListener(o,i.onPointerEvent,!0)}),["touchstart","touchend","touchmove"].forEach(function(o){i.el.addEventListener(o,i.onPointerEvent,{capture:!0,passive:!0})}),this.el.addEventListener("mousemove",this.onMouseMove),this.el.addEventListener("mouseleave",this.onMouseLeave),this.contentWrapperEl.addEventListener("scroll",this.onScroll),r.addEventListener("resize",this.onWindowResize);var n=!1,a=r.ResizeObserver||C$;this.resizeObserver=new a(function(){n&&i.recalculate()}),this.resizeObserver.observe(this.el),this.resizeObserver.observe(this.contentEl),r.requestAnimationFrame(function(){n=!0}),this.mutationObserver=new r.MutationObserver(this.recalculate),this.mutationObserver.observe(this.contentEl,{childList:!0,subtree:!0,characterData:!0})},e.recalculate=function(){var i=is(this.el);this.elStyles=i.getComputedStyle(this.el),this.isRtl=this.elStyles.direction==="rtl";var r=this.heightAutoObserverEl.offsetHeight<=1,n=this.heightAutoObserverEl.offsetWidth<=1,a=this.contentEl.offsetWidth,o=this.contentWrapperEl.offsetWidth,l=this.elStyles.overflowX,u=this.elStyles.overflowY;this.contentEl.style.padding=this.elStyles.paddingTop+" "+this.elStyles.paddingRight+" "+this.elStyles.paddingBottom+" "+this.elStyles.paddingLeft,this.wrapperEl.style.margin="-"+this.elStyles.paddingTop+" -"+this.elStyles.paddingRight+" -"+this.elStyles.paddingBottom+" -"+this.elStyles.paddingLeft;var c=this.contentEl.scrollHeight,h=this.contentEl.scrollWidth;this.contentWrapperEl.style.height=r?"auto":"100%",this.placeholderEl.style.width=n?a+"px":"auto",this.placeholderEl.style.height=c+"px";var d=this.contentWrapperEl.offsetHeight;this.axis.x.isOverflowing=h>a,this.axis.y.isOverflowing=c>d,this.axis.x.isOverflowing=l==="hidden"?!1:this.axis.x.isOverflowing,this.axis.y.isOverflowing=u==="hidden"?!1:this.axis.y.isOverflowing,this.axis.x.forceVisible=this.options.forceVisible==="x"||this.options.forceVisible===!0,this.axis.y.forceVisible=this.options.forceVisible==="y"||this.options.forceVisible===!0,this.hideNativeScrollbar();var g=this.axis.x.isOverflowing?this.scrollbarWidth:0,y=this.axis.y.isOverflowing?this.scrollbarWidth:0;this.axis.x.isOverflowing=this.axis.x.isOverflowing&&h>o-y,this.axis.y.isOverflowing=this.axis.y.isOverflowing&&c>d-g,this.axis.x.scrollbar.size=this.getScrollbarSize("x"),this.axis.y.scrollbar.size=this.getScrollbarSize("y"),this.axis.x.scrollbar.el.style.width=this.axis.x.scrollbar.size+"px",this.axis.y.scrollbar.el.style.height=this.axis.y.scrollbar.size+"px",this.positionScrollbar("x"),this.positionScrollbar("y"),this.toggleTrackVisibility("x"),this.toggleTrackVisibility("y")},e.getScrollbarSize=function(i){if(i===void 0&&(i="y"),!this.axis[i].isOverflowing)return 0;var r=this.contentEl[this.axis[i].scrollSizeAttr],n=this.axis[i].track.el[this.axis[i].offsetSizeAttr],a,o=n/r;return a=Math.max(~~(o*n),this.options.scrollbarMinSize),this.options.scrollbarMaxSize&&(a=Math.min(a,this.options.scrollbarMaxSize)),a},e.positionScrollbar=function(i){if(i===void 0&&(i="y"),!!this.axis[i].isOverflowing){var r=this.contentWrapperEl[this.axis[i].scrollSizeAttr],n=this.axis[i].track.el[this.axis[i].offsetSizeAttr],a=parseInt(this.elStyles[this.axis[i].sizeAttr],10),o=this.axis[i].scrollbar,l=this.contentWrapperEl[this.axis[i].scrollOffsetAttr];l=i==="x"&&this.isRtl&&s.getRtlHelpers().isRtlScrollingInverted?-l:l;var u=l/(r-a),c=~~((n-o.size)*u);c=i==="x"&&this.isRtl&&s.getRtlHelpers().isRtlScrollbarInverted?c+(n-o.size):c,o.el.style.transform=i==="x"?"translate3d("+c+"px, 0, 0)":"translate3d(0, "+c+"px, 0)"}},e.toggleTrackVisibility=function(i){i===void 0&&(i="y");var r=this.axis[i].track.el,n=this.axis[i].scrollbar.el;this.axis[i].isOverflowing||this.axis[i].forceVisible?(r.style.visibility="visible",this.contentWrapperEl.style[this.axis[i].overflowAttr]="scroll"):(r.style.visibility="hidden",this.contentWrapperEl.style[this.axis[i].overflowAttr]="hidden"),this.axis[i].isOverflowing?n.style.display="block":n.style.display="none"},e.hideNativeScrollbar=function(){this.offsetEl.style[this.isRtl?"left":"right"]=this.axis.y.isOverflowing||this.axis.y.forceVisible?"-"+this.scrollbarWidth+"px":0,this.offsetEl.style.bottom=this.axis.x.isOverflowing||this.axis.x.forceVisible?"-"+this.scrollbarWidth+"px":0},e.onMouseMoveForAxis=function(i){i===void 0&&(i="y"),this.axis[i].track.rect=this.axis[i].track.el.getBoundingClientRect(),this.axis[i].scrollbar.rect=this.axis[i].scrollbar.el.getBoundingClientRect();var r=this.isWithinBounds(this.axis[i].scrollbar.rect);r?this.axis[i].scrollbar.el.classList.add(this.classNames.hover):this.axis[i].scrollbar.el.classList.remove(this.classNames.hover),this.isWithinBounds(this.axis[i].track.rect)?(this.showScrollbar(i),this.axis[i].track.el.classList.add(this.classNames.hover)):this.axis[i].track.el.classList.remove(this.classNames.hover)},e.onMouseLeaveForAxis=function(i){i===void 0&&(i="y"),this.axis[i].track.el.classList.remove(this.classNames.hover),this.axis[i].scrollbar.el.classList.remove(this.classNames.hover)},e.showScrollbar=function(i){i===void 0&&(i="y");var r=this.axis[i].scrollbar.el;this.axis[i].isVisible||(r.classList.add(this.classNames.visible),this.axis[i].isVisible=!0),this.options.autoHide&&this.hideScrollbars()},e.onDragStart=function(i,r){r===void 0&&(r="y");var n=fg(this.el),a=is(this.el),o=this.axis[r].scrollbar,l=r==="y"?i.pageY:i.pageX;this.axis[r].dragOffset=l-o.rect[this.axis[r].offsetAttr],this.draggedAxis=r,this.el.classList.add(this.classNames.dragging),n.addEventListener("mousemove",this.drag,!0),n.addEventListener("mouseup",this.onEndDrag,!0),this.removePreventClickId===null?(n.addEventListener("click",this.preventClick,!0),n.addEventListener("dblclick",this.preventClick,!0)):(a.clearTimeout(this.removePreventClickId),this.removePreventClickId=null)},e.onTrackClick=function(i,r){var n=this;if(r===void 0&&(r="y"),!!this.options.clickOnTrack){var a=is(this.el);this.axis[r].scrollbar.rect=this.axis[r].scrollbar.el.getBoundingClientRect();var o=this.axis[r].scrollbar,l=o.rect[this.axis[r].offsetAttr],u=parseInt(this.elStyles[this.axis[r].sizeAttr],10),c=this.contentWrapperEl[this.axis[r].scrollOffsetAttr],h=r==="y"?this.mouseY-l:this.mouseX-l,d=h<0?-1:1,g=d===-1?c-u:c+u,y=function p(){if(d===-1){if(c>g){var _;c-=n.options.clickOnTrackSpeed,n.contentWrapperEl.scrollTo((_={},_[n.axis[r].offsetAttr]=c,_)),a.requestAnimationFrame(p)}}else if(c<g){var k;c+=n.options.clickOnTrackSpeed,n.contentWrapperEl.scrollTo((k={},k[n.axis[r].offsetAttr]=c,k)),a.requestAnimationFrame(p)}};y()}},e.getContentElement=function(){return this.contentEl},e.getScrollElement=function(){return this.contentWrapperEl},e.getScrollbarWidth=function(){try{return getComputedStyle(this.contentWrapperEl,"::-webkit-scrollbar").display==="none"||"scrollbarWidth"in document.documentElement.style||"-ms-overflow-style"in document.documentElement.style?0:AC()}catch{return AC()}},e.removeListeners=function(){var i=this,r=is(this.el);this.options.autoHide&&this.el.removeEventListener("mouseenter",this.onMouseEnter),["mousedown","click","dblclick"].forEach(function(n){i.el.removeEventListener(n,i.onPointerEvent,!0)}),["touchstart","touchend","touchmove"].forEach(function(n){i.el.removeEventListener(n,i.onPointerEvent,{capture:!0,passive:!0})}),this.el.removeEventListener("mousemove",this.onMouseMove),this.el.removeEventListener("mouseleave",this.onMouseLeave),this.contentWrapperEl&&this.contentWrapperEl.removeEventListener("scroll",this.onScroll),r.removeEventListener("resize",this.onWindowResize),this.mutationObserver&&this.mutationObserver.disconnect(),this.resizeObserver&&this.resizeObserver.disconnect(),this.recalculate.cancel(),this.onMouseMove.cancel(),this.hideScrollbars.cancel(),this.onWindowResize.cancel()},e.unMount=function(){this.removeListeners(),s.instances.delete(this.el)},e.isWithinBounds=function(i){return this.mouseX>=i.left&&this.mouseX<=i.left+i.width&&this.mouseY>=i.top&&this.mouseY<=i.top+i.height},e.findChild=function(i,r){var n=i.matches||i.webkitMatchesSelector||i.mozMatchesSelector||i.msMatchesSelector;return Array.prototype.filter.call(i.children,function(a){return n.call(a,r)})[0]},s}();Vt.defaultOptions={autoHide:!0,forceVisible:!1,clickOnTrack:!0,clickOnTrackSpeed:40,classNames:{contentEl:"simplebar-content",contentWrapper:"simplebar-content-wrapper",offset:"simplebar-offset",mask:"simplebar-mask",wrapper:"simplebar-wrapper",placeholder:"simplebar-placeholder",scrollbar:"simplebar-scrollbar",track:"simplebar-track",heightAutoObserverWrapperEl:"simplebar-height-auto-observer-wrapper",heightAutoObserverEl:"simplebar-height-auto-observer",visible:"simplebar-visible",horizontal:"simplebar-horizontal",vertical:"simplebar-vertical",hover:"simplebar-hover",dragging:"simplebar-dragging"},scrollbarMinSize:25,scrollbarMaxSize:0,timeout:1e3};Vt.instances=new WeakMap;Vt.initDOMLoadedElements=function(){document.removeEventListener("DOMContentLoaded",this.initDOMLoadedElements),window.removeEventListener("load",this.initDOMLoadedElements),Array.prototype.forEach.call(document.querySelectorAll("[data-simplebar]"),function(s){s.getAttribute("data-simplebar")!=="init"&&!Vt.instances.has(s)&&new Vt(s,Nh(s.attributes))})};Vt.removeObserver=function(){this.globalObserver.disconnect()};Vt.initHtmlApi=function(){this.initDOMLoadedElements=this.initDOMLoadedElements.bind(this),typeof MutationObserver<"u"&&(this.globalObserver=new MutationObserver(Vt.handleMutations),this.globalObserver.observe(document,{childList:!0,subtree:!0})),document.readyState==="complete"||document.readyState!=="loading"&&!document.documentElement.doScroll?window.setTimeout(this.initDOMLoadedElements):(document.addEventListener("DOMContentLoaded",this.initDOMLoadedElements),window.addEventListener("load",this.initDOMLoadedElements))};Vt.handleMutations=function(s){s.forEach(function(e){Array.prototype.forEach.call(e.addedNodes,function(t){t.nodeType===1&&(t.hasAttribute("data-simplebar")?!Vt.instances.has(t)&&new Vt(t,Nh(t.attributes)):Array.prototype.forEach.call(t.querySelectorAll("[data-simplebar]"),function(i){i.getAttribute("data-simplebar")!=="init"&&!Vt.instances.has(i)&&new Vt(i,Nh(i.attributes))}))}),Array.prototype.forEach.call(e.removedNodes,function(t){t.nodeType===1&&(t.hasAttribute('[data-simplebar="init"]')?Vt.instances.has(t)&&Vt.instances.get(t).unMount():Array.prototype.forEach.call(t.querySelectorAll('[data-simplebar="init"]'),function(i){Vt.instances.has(i)&&Vt.instances.get(i).unMount()}))})})};Vt.getOptions=Nh;xy&&Vt.initHtmlApi();const ur=U.getComponent("Menu"),CI=ur.prototype.createEl;ur.prototype.createEl=function(){const e=CI.call(this);return this.simpleBar=new Vt(this.contentEl(),{autoHide:!1}),e};const N$=ur.prototype.contentEl;ur.prototype.contentEl=function(){return this.simpleBar?this.simpleBar.getContentElement():N$.call(this)};const L$=ur.prototype.dispose;ur.prototype.dispose=function(){this.simpleBar&&(this.simpleBar.unMount(),delete this.simpleBar),L$.call(this)};const O$=ur.prototype.addItem;ur.prototype.addItem=function(e){O$.call(this,e),this.simpleBar.recalculate()};const M$=ur.prototype.lockShowing;ur.prototype.lockShowing=function(){M$.call(this),this.simpleBar.recalculate()};ur.prototype.recalculateScrollBar=function(){this.simpleBar.recalculate()};const R$=ur.prototype.handleBlur;ur.prototype.handleBlur=function(e){const t=e.relatedTarget||document.activeElement;this.el().contains(t)||R$.call(this,e)};const IC="cv-active-button",F$=U.getComponent("Menu"),B$=function(s){return typeof s!="string"?s:s.replace(/./,e=>e.toUpperCase())},U$=U.getComponent("Component"),Zo=U.getComponent("MenuButton");let $$=class extends Zo{createMenu(){const e=new F$(this.player_,{menuButton:this});if(this.hideThreshold_=0,this.options_.title){const t=U.dom.createEl("li",{className:"vjs-menu-title",innerHTML:B$(this.options_.title),tabIndex:-1});this.hideThreshold_+=1;const i=new U$(this.player_,{el:t});e.addItem(i)}if(this.items=this.createItems(),this.items)for(let t=0;t<this.items.length;t++)e.addItem(this.items[t]);return e}};const j$=Zo.prototype.pressButton;Zo.prototype.pressButton=function(){j$.call(this),this.inactivityTimeout=this.player_.cache_.inactivityTimeout,this.player_.cache_.inactivityTimeout=0,this.player_.options_.inactivityTimeout=0};const q$=Zo.prototype.unpressButton;Zo.prototype.unpressButton=function(){q$.call(this),this.player_.cache_.inactivityTimeout=this.inactivityTimeout,this.player_.options_.inactivityTimeout=this.inactivityTimeout,this.player_.reportUserActivity()};Zo.prototype.setActive=function(e){e?this.addClass(IC):this.removeClass(IC)};U.registerComponent("MenuButton",$$);const V$=U.getComponent("Component");class EI extends V${buildCSSClass(){return`cv-time-wrapper ${super.buildCSSClass()}`}createEl(e,t,i){return super.createEl(e,{...t,className:this.buildCSSClass()},i)}}EI.prototype.options_={children:["currentTimeDisplay","remainingTimeDisplay"]};U.registerComponent("TimeWrapper",EI);const xl=U.getComponent("SeekBar");let H$=class extends xl{handleMouseDown(e){const t=this.player_.preventScrubbingPlugin();t.isEnabled&&this.getMouseTime(e)>t.furthestVisitedTime||(xl.prototype.handleMouseDown.call(this,e),this.player_.addClass("cv-disable-play-pause-feedback"))}handleMouseMove(e){xl.prototype.handleMouseMove.call(this,e),this.update()}getPercent(){const t=this.player_.currentTime()/this.player_.duration();return t>=1?1:t}handleMouseUp(e){xl.prototype.handleMouseUp.call(this,e),this.timeoutId&&window.clearTimeout(this.timeoutId),this.timeoutId=window.setTimeout(()=>{this.player_.removeClass("cv-disable-play-pause-feedback")},500)}clamp(e,t,i){return Math.min(Math.max(e,t),i)}getMouseTime(e){return this.clamp(xl.prototype.calculateDistance.call(this,e).x,0,1)*this.player_.duration()}};U.registerComponent("SeekBar",H$);const z$=U.getComponent("Component");class W$ extends z${buildCSSClass(){return`cv-chapter-bar-load-progress ${super.buildCSSClass()}`}createEl(e,t,i){return super.createEl(e,{...t,className:this.buildCSSClass()},i)}update(e){this.el_.style.width=e*100+"%"}}const G$=U.getComponent("Component");class K$ extends G${buildCSSClass(){return`cv-chapter-bar-play-progress ${super.buildCSSClass()}`}createEl(e,t,i){return super.createEl(e,{...t,className:this.buildCSSClass()},i)}update(e){e>0&&e<1?this.addClass("cv-current"):this.removeClass("cv-current"),this.el_.style.width=e*100+"%"}}const X$=U.getComponent("Component");class PC extends X${constructor(e,t){super(e,t),this.playProgress=new K$(this.player_),this.addChild(this.playProgress),this.loadProgress=new W$(this.player_),this.addChild(this.loadProgress),this.update(),this.updateBuffered(0)}buildCSSClass(){return`cv-chapter-bar-item ${super.buildCSSClass()}`}createEl(e,t,i){return super.createEl(e,{...t,className:this.buildCSSClass()},i)}getCurrentTime(){return this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime()}update(){const e=this.player_.duration()||3600,t=this.options_.endTime-this.options_.startTime;if(e!==this.duration_){const r=t/e;this.el_.style.width=r*100+"%";const n=this.options_.startTime/e;this.el_.style.left=n*100+"%",this.duration_=e}const i=this.getCurrentTime();i<this.options_.startTime?this.playProgress.update(0):i>this.options_.endTime?this.playProgress.update(1):this.playProgress.update((i-this.options_.startTime)/t)}updateBuffered(e){const t=this.options_.endTime-this.options_.startTime;e<this.options_.startTime?this.loadProgress.update(0):e>this.options_.endTime?this.loadProgress.update(1):this.loadProgress.update((e-this.options_.startTime)/t)}}function wI(s){const e=s.buffered(),t=s.currentTime();let i=0;for(let r=0;r<e.length;r++){const n=e.start(r),a=e.end(r);if(n<=t&&a>=t){i=a;break}}return i}const Q$=U.getComponent("Component");class Y$ extends Q${buildCSSClass(){return`cv-chapter-bar-items ${super.buildCSSClass()}`}createEl(e,t,i){return super.createEl(e,{...t,className:this.buildCSSClass()},i)}update(){this.children_.forEach(e=>{e.update()})}updateBuffered(){this.children_.forEach(e=>{e.updateBuffered(wI(this.player_))})}}const J$=U.getComponent("SeekBar");class ky extends J${constructor(e,t){super(e,t),this.onDurationChange=this.onDurationChange.bind(this),this.createChapterItems=this.createChapterItems.bind(this),this.updateBuffered=this.updateBuffered.bind(this),Qt.useChapters(this.player_,this.createChapterItems),this.player_.on("durationchange",this.onDurationChange),this.player_.on("progress",this.updateBuffered),this.createChapterItems(),this.update()}dispose(){this.player_.off("durationchange",this.onDurationChange),this.player_.off("progress",this.updateBuffered),super.dispose()}createEl(){return U.dom.createEl("div",{className:"vjs-progress-holder cv-chapter-seek-bar"},{"aria-label":this.localize("Progress Bar"),role:"progressbar"})}onDurationChange(){this.createChapterItems(),this.update()}update(){const e=super.update();return this.chapterBarItems&&this.chapterBarItems.update(),e}updateBuffered(){this.chapterBarItems.updateBuffered()}bindUpdateListener(e){const t=()=>{this.createChapterItems(),this.updateBuffered()};e.addEventListener("cv:cuechange",t),this.player_.one("dispose",()=>e.removeEventListener("cv:cuechange",t))}createChapterItems(e){var i,r;e&&(this.track_||this.bindUpdateListener(e),this.track_=e);const t=new Y$(this.player_);if((r=(i=this.track_)==null?void 0:i.cues)!=null&&r.length&&!this.options_.ignoreChapters)for(let n=0;n<this.track_.cues.length;n++){const a=this.track_.cues[n],o=a.startTime;let l=a.endTime;const u=this.player_.duration();u&&(n===this.track_.cues.length-1&&a.endTime<this.player_.duration()&&(l=this.player_.duration()),l>u&&(l=u));const c=new PC(this.player_,{startTime:o,endTime:l});if(t.addChild(c),u&&l===u)break}else t.addChild(new PC(this.player_,{startTime:0,endTime:this.player_.duration()||3600}));this.chapterBarItems&&this.removeChild(this.chapterBarItems),this.chapterBarItems=t,this.addChild(this.chapterBarItems)}}ky.prototype.options_={children:["playProgressBar"],barName:"playProgressBar"};!U.browser.IS_IOS&&!U.browser.IS_ANDROID&&ky.prototype.options_.children.splice(1,0,"mouseTimeDisplay");U.registerComponent("ChapterSeekBar",ky);const Z$=U.getComponent("ProgressControl"),DC="seekBar";class kI extends Z${constructor(){super(...arguments),this.seekBarName_=DC}setSeekBarName(e){this.seekBarName_=e}getChild(e){return(e==null?void 0:e.toLowerCase())===DC.toLowerCase()&&(e=this.seekBarName_),super.getChild(e)}}kI.prototype.options_={children:[]};U.registerComponent("ProgressControl",kI);function AI(s,e=s){s=s<0?0:s;let t=Math.floor(s%60),i=Math.floor(s/60%60),r=Math.floor(s/3600);const n=Math.floor(e/60%60),a=Math.floor(e/3600);return(isNaN(s)||s===1/0)&&(r=i=t="-"),r=r>0||a>0?r+":":"",i=((r||n>=10)&&i<10?"0"+i:i)+":",t=t<10?"0"+t:t,r+i+t}const ej=U.getComponent("TimeTooltip");class tj extends ej{constructor(e,t){super(e,t),this.hasCustomChapterText=!1,Qt.useChapters(this.player_,i=>{this.track_=i})}createEl(){const e=super.createEl();return this.chapter_=U.dom.createEl("div"),e.appendChild(this.chapter_),this.time_=U.dom.createEl("div"),e.appendChild(this.time_),e}updateTime(e){const t=this.player_.duration();if(U.dom.textContent(this.time_,AI(e,t)),!(!this.track_||this.hasCustomChapterText)){for(let i=0;i<this.track_.cues.length;i++){const r=this.track_.cues[i],n=r.endTime||t;if(r.startTime<=e&&n>=e){U.dom.textContent(this.chapter_,r.text);return}}U.dom.textContent(this.chapter_,"")}}clearChapterContent(){U.dom.textContent(this.chapter_,"")}updateText(e){U.dom.textContent(this.time_,e)}setCustomChapterText(e){this.hasCustomChapterText=!!e,U.dom.textContent(this.chapter_,e??"")}}U.registerComponent("TimeTooltip",tj);const ij=U.getComponent("Component");class Ay extends ij{constructor(e,t){super(e,t)}setTrack(e){this.track_=e}createEl(){const e=super.createEl("div",{className:"cv-thumbnail-display"});return this.img_=U.dom.createEl("img"),e.appendChild(this.img_),e}enable(){this.addClass("cv-thumbnail-display-enabled")}disable(){this.removeClass("cv-thumbnail-display-enabled")}parseImageLink(e){const t=e.indexOf("#");if(t===-1)return{src:e,w:0,h:0,x:0,y:0};const i=e.substr(0,t),r=e.substr(t+1);if(r.substr(0,5)!=="xywh=")return{src:e,w:0,h:0,x:0,y:0};const n=this.getScale(),a=r.substr(5).split(",");return{src:i,w:parseInt(a[2])*n,h:parseInt(a[3])*n,x:parseInt(a[0])*n,y:parseInt(a[1])*n}}getScale(){let e=this.options_.scaleFactor;const t=this.player_.whiteboardModePlugin().side;return this.player_.isFullscreen()&&t!=="bottom"&&(e=e*2),e}update(e){var h,d;if(!((d=(h=this.track_)==null?void 0:h.cues)!=null&&d.length))return;const t=e;let i,r=0;for(;r<this.track_.cues.length;){const g=this.track_.cues[r];if(g.startTime<=t&&g.endTime>=t){i=this.parseImageLink(g.text);break}r++}if(!(i!=null&&i.src)){this.disable();return}this.enable();const{src:n,w:a,h:o,x:l,y:u}=i,c=this.getScale();this.img_.src=n,this.img_.style.left=-l+"px",this.img_.style.top=-u+"px",this.img_.style.transformOrigin="0 0",this.img_.style.transform=`scale(${c})`,this.el_.style.width=a+"px",this.el_.style.height=o+"px"}}Ay.prototype.options_={scaleFactor:1};U.registerComponent("ThumbnailDisplay",Ay);const rj=U.getComponent("MouseTimeDisplay"),NC="cv-mouse-time-display-force-show";class II extends rj{constructor(e,t){super(e,t),Qt.useMetadataTrack(this.player_,"thumbnails",i=>{this.getChild("ThumbnailDisplay").setTrack(i)}),this.update=this.update.bind(this),this.player_.on("durationchange",this.update),this.player_.one("dispose",()=>{this.player_.off("durationchange",this.update)})}update(e,t){this.requestAnimationFrame(()=>{const i=this.getChild("TimeTooltip"),r=this.getChild("ThumbnailDisplay"),n=t*this.player_.duration(),a=this.player_.preventScrubbingPlugin(),o=this.player_.controlBar.getChild("progressControl").getChild(Ih);let l=!1;a.isEnabled&&(l=n>a.furthestVisitedTime),l?(this.hide(),o.show(),du(o.hide,RA,!1,o)()):(this.show(),o&&o.hide(!0),r.update(n),i.updateTime(n));const u=this.el_.getBoundingClientRect();this.el_.style.marginLeft=-(u.width/2)+"px";const c=e.width*t;c<u.width/2?this.el_.style.left=u.width/2+"px":c>e.width-u.width/2?this.el_.style.left=e.width-u.width/2+"px":this.el_.style.left=e.width*t+"px"})}forceShow(){this.addClass(NC)}removeForceShow(){this.removeClass(NC)}}II.prototype.options_={children:["ThumbnailDisplay","TimeTooltip"]};U.registerComponent("MouseTimeDisplay",II);const LC=U.getComponent("ChaptersTrackMenuItem");class nj extends LC{constructor(e,t){super(e,t),this.nonIconControl=!1,this.thumbnailDisplay=new Ay(this.player_,{scaleFactor:.5}),this.el().insertBefore(this.thumbnailDisplay.el(),this.el().firstChild),Qt.useMetadataTrack(this.player_,"thumbnails",i=>{this.addClass("cv-has-thumbnails"),this.thumbnailDisplay.setTrack(i),this.thumbnailDisplay.update(this.options_.cue.startTime)})}update(){this.player_&&LC.prototype.update.call(this)}buildCSSClass(){return"vjs-menu-item cv-chapter-menu-item"}createEl(e,t,i){return this.nonIconControl=!0,super.createEl("li",Object.assign({className:this.buildCSSClass(),innerHTML:this.getInnerHTML(),tabIndex:-1},t),i)}getInnerHTML(){const e=this.player_.duration();return`<span class="vjs-menu-item-text cv-chapter-menu-item-text"><p>${this.localize(this.options_.label)}</p><p>(${AI(this.options_.cue.startTime,e)})</p></span>`}}const sj=U.getComponent("ChaptersButton");class aj extends sj{constructor(e,t,i){super(e,t,i),this.alwaysCollapsed=!1,this.isCollapsed=!1,this.isCollabsible=!0,this.update=this.update.bind(this),this.player_.on("cv-whiteboard-change",this.update),this.player_.on("fullscreenchange",this.update),this.player_.on("dispose",()=>{this.player_.off("cv-whiteboard-change",this.update),this.player_.off("fullscreenchange",this.update)})}buildCSSClass(){return`cv-chapters-button ${super.buildCSSClass()}`}buildWrapperCSSClass(){return`cv-menu-big ${super.buildWrapperCSSClass()}`}createItems(){const e=[];if(!this.track_)return e;const t=this.track_.cues;if(!t||t.length<2)return e;for(let i=0,r=t.length;i<r;i++){const n=t[i],a=new nj(this.player_,{track:this.track_,cue:n});e.push(a)}return e}setTrack(e){if(super.setTrack(e),this.track_&&this.track_.kind==="chapters"){e.one("loadeddata",this.update);const t=()=>{this.update(),this.player_.trigger("resizemenus")};e.on("cv:cuechange",t),this.player_.one("dispose",()=>e.off("cv:cueupdate",t))}}update(e){super.update(e)}getCollabsibleName(){return"Chapters"}getCollabsibleValue(){const e=this.track_.activeCues[0];return(e==null?void 0:e.text)||""}showInCollabsibleMenu(){if(!this.track_)return!1;const e=this.track_.cues;return!(!e||!e.length)}showCollapsibleMenu(){this.handleClick(null)}}U.registerComponent("ChaptersButton",aj);const OC=U.getComponent("OffTextTrackMenuItem");let oj=class extends OC{constructor(e,t){t.track={player:e,kind:t.kind,kinds:t.kinds,default:!1,mode:"hidden"},t.kinds||(t.kinds=[t.kind]),t.label?t.track.label=t.label:t.track.label=t.kinds.join(" and ")+" off",t.selectable=!0,t.multiSelectable=!1,super(e,t)}handleClick(e){OC.prototype.handleClick.call(this,e);const t=this.player_.textTracks();for(let i=0;i<t.length;i++){const r=t[i];r.kind==="subtitles"&&(r.mode="hidden")}this.player_.trigger("cv:languageselected")}createEl(e,t,i){return super.createEl("li",{className:"vjs-menu-item",tabIndex:-1,...t,innerHTML:'<span class="vjs-menu-item-text">Off</span>'},i)}};U.registerComponent("OffTextTrackMenuItem",oj);const lj=U.getComponent("TextTrackButton"),uj=U.getComponent("TextTrackMenuItem"),cj=U.getComponent("OffTextTrackMenuItem");let hj=class extends lj{createItems(e=[],t=uj){let i;this.label_&&(i=`${this.label_} off`),e.push(new cj(this.player_,{kinds:this.kinds_,kind:this.kind_,label:i})),this.hideThreshold_+=1;const r=this.player_.textTracks();Array.isArray(this.kinds_)||(this.kinds_=[this.kind_]);for(let n=0;n<r.length;n++){const a=r[n];if(this.kinds_.indexOf(a.kind)>-1){const o=new t(this.player_,{track:a,kinds:this.kinds_,kind:this.kind_,selectable:!0,multiSelectable:!1});o.addClass(`vjs-${a.kind}-menu-item`),e.push(o)}}return this.player().trigger("resizemenus"),e}};U.registerComponent("TextTrackButton",hj);const dj={englishName:"Afar",nativeName:"Qafar"},fj={englishName:"Afrikaans",nativeName:"Afrikaans"},pj={englishName:"Aghem",nativeName:"Aghem"},mj={englishName:"Akan",nativeName:"Akan"},gj={englishName:"Amharic",nativeName:"�� ማርኛ"},vj={englishName:"Arabic",nativeName:"العربية"},yj={englishName:"Mapudungun",nativeName:"Mapudungun"},_j={englishName:"Assamese",nativeName:"অসমীয়া"},Tj={englishName:"Asu",nativeName:"Kipare"},bj={englishName:"Asturian",nativeName:"asturianu"},Sj={englishName:"Azerbaijani",nativeName:"azÉ™rbaycan dili"},xj={englishName:"Bashkir",nativeName:"Башҡорт"},Cj={englishName:"Basaa",nativeName:"Ɓ� s� a"},Ej={englishName:"Belarusian",nativeName:"Беларуская"},wj={englishName:"Bemba",nativeName:"Ichibemba"},kj={englishName:"Bena",nativeName:"Hibena"},Aj={englishName:"Bulgarian",nativeName:"български"},Ij={englishName:"Edo",nativeName:"Ẹ̀dó"},Pj={englishName:"Bamanankan",nativeName:"bamanakan"},Dj={englishName:"Bangla",nativeName:"বাংলা"},Nj={englishName:"Tibetan",nativeName:"བོད་ཡིག"},Lj={englishName:"Breton",nativeName:"brezhoneg"},Oj={englishName:"Bodo",nativeName:"बड़ो"},Mj={englishName:"Bosnian",nativeName:"bosanski"},Rj={englishName:"Blin",nativeName:"ብሊን"},Fj={englishName:"Catalan",nativeName:"catal� "},Bj={englishName:"Chechen",nativeName:"нохчийн"},Uj={englishName:"Chiga",nativeName:"Rukiga"},$j={englishName:"Cherokee",nativeName:"ᏣᎳᎩ"},jj={englishName:"Corsican",nativeName:"Corsu"},qj={englishName:"Czech",nativeName:"čeÅ¡tina"},Vj={englishName:"Church Slavic",nativeName:"церковнослове́нскїй"},Hj={englishName:"Welsh",nativeName:"Cymraeg"},zj={englishName:"Danish",nativeName:"dansk"},Wj={englishName:"Taita",nativeName:"Kitaita"},Gj={englishName:"German",nativeName:"Deutsch"},Kj={englishName:"Zarma",nativeName:"Zarmaciine"},Xj={englishName:"Lower Sorbian",nativeName:"dolnoserbšćina"},Qj={englishName:"Duala",nativeName:"duálá"},Yj={englishName:"Divehi",nativeName:"ދިވެހިބަސް"},Jj={englishName:"Jola-Fonyi",nativeName:"joola"},Zj={englishName:"Dzongkha",nativeName:"རྫོང་ཁ"},e9={englishName:"Embu",nativeName:"KÄ©embu"},t9={englishName:"Ewe",nativeName:"EÊ‹egbe"},i9={englishName:"Greek",nativeName:"Ελληνικά"},r9={englishName:"English",nativeName:"English"},n9={englishName:"Esperanto",nativeName:"esperanto"},s9={englishName:"Spanish",nativeName:"español"},a9={englishName:"Estonian",nativeName:"eesti"},o9={englishName:"Basque",nativeName:"euskara"},l9={englishName:"Ewondo",nativeName:"ewondo"},u9={englishName:"Persian",nativeName:"فارسى"},c9={englishName:"Fulah",nativeName:"Fulah"},h9={englishName:"Finnish",nativeName:"suomi"},d9={englishName:"Filipino",nativeName:"Filipino"},f9={englishName:"Faroese",nativeName:"føroyskt"},p9={englishName:"French",nativeName:"français"},m9={englishName:"Friulian",nativeName:"furlan"},g9={englishName:"Western Frisian",nativeName:"Frysk"},v9={englishName:"Irish",nativeName:"Gaeilge"},y9={englishName:"Scottish Gaelic",nativeName:"G� idhlig"},_9={englishName:"Galician",nativeName:"galego"},T9={englishName:"Guarani",nativeName:"Avañe’ẽ"},b9={englishName:"Alsatian",nativeName:"Elsässisch"},S9={englishName:"Gujarati",nativeName:"ગુજરાતી"},x9={englishName:"Gusii",nativeName:"Ekegusii"},C9={englishName:"Manx",nativeName:"Gaelg"},E9={englishName:"Hausa",nativeName:"Hausa"},w9={englishName:"Hawaiian",nativeName:"ʻŌlelo HawaiÊ»i"},k9={englishName:"Hebrew",nativeName:"עברית"},A9={englishName:"Hindi",nativeName:"हिंदी"},I9={englishName:"Croatian",nativeName:"hrvatski"},P9={englishName:"Upper Sorbian",nativeName:"hornjoserbšćina"},D9={englishName:"Hungarian",nativeName:"magyar"},N9={englishName:"Armenian",nativeName:"Õ€Õ¡ÕµÕ¥Ö€Õ¥Õ¶"},L9={englishName:"Interlingua",nativeName:"interlingua"},O9={englishName:"Ibibio",nativeName:"Ibibio-Efik"},M9={englishName:"Indonesian",nativeName:"Indonesia"},R9={englishName:"Igbo",nativeName:"Igbo"},F9={englishName:"Yi",nativeName:"ꆈ�� ꁱꂷ"},B9={englishName:"Icelandic",nativeName:"íslenska"},U9={englishName:"Italian",nativeName:"italiano"},$9={englishName:"Inuktitut",nativeName:"Inuktitut"},j9={englishName:"Japanese",nativeName:"日本語"},q9={englishName:"Ngomba",nativeName:"Ndaꞌa"},V9={englishName:"Machame",nativeName:"Kimachame"},H9={englishName:"Javanese",nativeName:"Basa Jawa"},z9={englishName:"Georgian",nativeName:"ქა�� თული"},W9={englishName:"Kabyle",nativeName:"Taqbaylit"},G9={englishName:"Kamba",nativeName:"Kikamba"},K9={englishName:"Makonde",nativeName:"Chimakonde"},X9={englishName:"Kabuverdianu",nativeName:"kabuverdianu"},Q9={englishName:"Koyra Chiini",nativeName:"Koyra ciini"},Y9={englishName:"Kikuyu",nativeName:"Gikuyu"},J9={englishName:"Kazakh",nativeName:"қазақ тілі"},Z9={englishName:"Kako",nativeName:"kakÉ”"},eq={englishName:"Greenlandic",nativeName:"kalaallisut"},tq={englishName:"Kalenjin",nativeName:"Kalenjin"},iq={englishName:"Khmer",nativeName:"ភាសាខ្មែរ"},rq={englishName:"Kannada",nativeName:"ಕನ್ನಡ"},nq={englishName:"Korean",nativeName:"한국어"},sq={englishName:"Konkani",nativeName:"कोंकणी"},aq={englishName:"Kanuri",nativeName:"Kanuri"},oq={englishName:"Kashmiri",nativeName:"کٲشُر"},lq={englishName:"Shambala",nativeName:"Kishambaa"},uq={englishName:"Bafia",nativeName:"rikpa"},cq={englishName:"Ripuarian",nativeName:"Kölsch"},hq={englishName:"Central Kurdish",nativeName:"کوردیی ناوەڕاست"},dq={englishName:"Cornish",nativeName:"kernewek"},fq={englishName:"Kyrgyz",nativeName:"Кыргыз"},pq={englishName:"Latin",nativeName:"lingua latÄ«na"},mq={englishName:"Langi",nativeName:"Kɨlaangi"},gq={englishName:"Luxembourgish",nativeName:"Lëtzebuergesch"},vq={englishName:"Ganda",nativeName:"Luganda"},yq={englishName:"Lakota",nativeName:"Lakȟólʼiyapi"},_q={englishName:"Lingala",nativeName:"lingála"},Tq={englishName:"Lao",nativeName:"ລາວ"},bq={englishName:"Northern Luri",nativeName:"لۊری شومالی"},Sq={englishName:"Lithuanian",nativeName:"lietuvių"},xq={englishName:"Luba-Katanga",nativeName:"Tshiluba"},Cq={englishName:"Luo",nativeName:"Dholuo"},Eq={englishName:"Luyia",nativeName:"Luluhia"},wq={englishName:"Latvian",nativeName:"latvieÅ¡u"},kq={englishName:"Masai",nativeName:"Maa"},Aq={englishName:"Meru",nativeName:"KÄ©mÄ©rÅ©"},Iq={englishName:"Morisyen",nativeName:"kreol morisien"},Pq={englishName:"Malagasy",nativeName:"Malagasy"},Dq={englishName:"Makhuwa-Meetto",nativeName:"Makua"},Nq={englishName:"Metaʼ",nativeName:"metaʼ"},Lq={englishName:"Maori",nativeName:"Reo Māori"},Oq={englishName:"Macedonian",nativeName:"македонски"},Mq={englishName:"Malayalam",nativeName:"മലയാളം"},Rq={englishName:"Mongolian",nativeName:"Монгол хэл"},Fq={englishName:"Manipuri",nativeName:"মৈতৈলোন্"},Bq={englishName:"Mohawk",nativeName:"Kanien’kéha"},Uq={englishName:"Marathi",nativeName:"मरा�� ी"},$q={englishName:"Malay",nativeName:"Bahasa Melayu"},jq={englishName:"Maltese",nativeName:"Malti"},qq={englishName:"Mundang",nativeName:"MUNDAÅŠ"},Vq={englishName:"Burmese",nativeName:"ဗမာ"},Hq={englishName:"Mazanderani",nativeName:"مازرونی"},zq={englishName:"Nama",nativeName:"Khoekhoegowab"},Wq={englishName:"Norwegian BokmÃ¥l",nativeName:"norsk bokmÃ¥l"},Gq={englishName:"North Ndebele",nativeName:"isiNdebele"},Kq={englishName:"Nepali",nativeName:"नेपाली"},Xq={englishName:"Dutch",nativeName:"Nederlands"},Qq={englishName:"Kwasio",nativeName:"Kwasio"},Yq={englishName:"Norwegian Nynorsk",nativeName:"nynorsk"},Jq={englishName:"Ngiemboon",nativeName:"Shwóŋò ngiembɔɔn"},Zq={englishName:"Norwegian",nativeName:"norsk"},eV={englishName:"N'ko",nativeName:"ߒߞߏ"},tV={englishName:"South Ndebele",nativeName:"isiNdebele"},iV={englishName:"Sesotho sa Leboa",nativeName:"Sesotho sa Leboa"},rV={englishName:"Nuer",nativeName:"Thok Nath"},nV={englishName:"Nyankole",nativeName:"Runyankore"},sV={englishName:"Occitan",nativeName:"Occitan"},aV={englishName:"Oromo",nativeName:"Oromoo"},oV={englishName:"Odia",nativeName:"ଓଡ଼ିଆ"},lV={englishName:"Ossetian",nativeName:"Ирон æвзаг"},uV={englishName:"Punjabi",nativeName:"ਪੰਜਾਬੀ"},cV={englishName:"Papiamento",nativeName:"Papiamentu"},hV={englishName:"Polish",nativeName:"polski"},dV={englishName:"Prussian",nativeName:"prÅ«siskan"},fV={englishName:"Dari",nativeName:"درى"},pV={englishName:"Pashto",nativeName:"پښتو"},mV={englishName:"Portuguese",nativeName:"português"},gV={englishName:"K'iche'",nativeName:"K'iche'"},vV={englishName:"Quechua",nativeName:"runasimi"},yV={englishName:"Romansh",nativeName:"rumantsch"},_V={englishName:"Rundi",nativeName:"Ikirundi"},TV={englishName:"Romanian",nativeName:"română"},bV={englishName:"Rombo",nativeName:"Kihorombo"},SV={englishName:"Russian",nativeName:"русский"},xV={englishName:"Kinyarwanda",nativeName:"Kinyarwanda"},CV={englishName:"Rwa",nativeName:"Kiruwa"},EV={englishName:"Sanskrit",nativeName:"संस्कृत"},wV={englishName:"Sakha",nativeName:"Саха"},kV={englishName:"Samburu",nativeName:"Kisampur"},AV={englishName:"Sangu",nativeName:"Ishisangu"},IV={englishName:"Sindhi",nativeName:"سنڌي"},PV={englishName:"Northern Sami",nativeName:"davvisámegiella"},DV={englishName:"Sena",nativeName:"sena"},NV={englishName:"Koyraboro Senni",nativeName:"Koyraboro senni"},LV={englishName:"Sango",nativeName:"Sängö"},OV={englishName:"Tachelhit",nativeName:"ⵜⴰⵛⵍⵃⵉⵜ"},MV={englishName:"Sinhala",nativeName:"සිංහල"},RV={englishName:"Slovak",nativeName:"slovenčina"},FV={englishName:"Slovenian",nativeName:"slovenščina"},BV={englishName:"Sami (Southern)",nativeName:"Ã¥arjelsaemiengïele"},UV={englishName:"Sami (Lule)",nativeName:"julevusámegiella"},$V={englishName:"Sami (Inari)",nativeName:"anarâškielâ"},jV={englishName:"Sami (Skolt)",nativeName:"sää´mÇ©iõll"},qV={englishName:"Shona",nativeName:"chiShona"},VV={englishName:"Somali",nativeName:"Soomaali"},HV={englishName:"Albanian",nativeName:"shqip"},zV={englishName:"Serbian",nativeName:"srpski"},WV={englishName:"siSwati",nativeName:"Siswati"},GV={englishName:"Saho",nativeName:"Saho"},KV={englishName:"Sesotho",nativeName:"Sesotho"},XV={englishName:"Swedish",nativeName:"svenska"},QV={englishName:"Kiswahili",nativeName:"Kiswahili"},YV={englishName:"Syriac",nativeName:"ܣܘܪܝܝܐ"},JV={englishName:"Tamil",nativeName:"தமிழ்"},ZV={englishName:"Telugu",nativeName:"తెలుగు"},eH={englishName:"Teso",nativeName:"Kiteso"},tH={englishName:"Tajik",nativeName:"Тоҷикӣ"},iH={englishName:"Thai",nativeName:"ไทย"},rH={englishName:"Tigrinya",nativeName:"ትግርኛ"},nH={englishName:"Tigre",nativeName:"ትግረ"},sH={englishName:"Turkmen",nativeName:"Türkmen dili"},aH={englishName:"Setswana",nativeName:"Setswana"},oH={englishName:"Tongan",nativeName:"lea fakatonga"},lH={englishName:"Turkish",nativeName:"Türkçe"},uH={englishName:"Tsonga",nativeName:"Xitsonga"},cH={englishName:"Tatar",nativeName:"Татар"},hH={englishName:"Tasawaq",nativeName:"Tasawaq senni"},dH={englishName:"Central Atlas Tamazight",nativeName:"TamaziÉ£t n laá¹­laá¹£"},fH={englishName:"Uyghur",nativeName:"ئۇيغۇرچە"},pH={englishName:"Ukrainian",nativeName:"українська"},mH={englishName:"Urdu",nativeName:"اُردو"},gH={englishName:"Uzbek",nativeName:"o‘zbek"},vH={englishName:"Vai",nativeName:"ꕙꔤ"},yH={englishName:"Venda",nativeName:"Tshivenḓa"},_H={englishName:"Vietnamese",nativeName:"Tiếng Việt"},TH={englishName:"Volapük",nativeName:"Volapük"},bH={englishName:"Vunjo",nativeName:"Kyivunjo"},SH={englishName:"Walser",nativeName:"Walser"},xH={englishName:"Wolaytta",nativeName:"ወላይታቱ"},CH={englishName:"Wolof",nativeName:"Wolof"},EH={englishName:"isiXhosa",nativeName:"isiXhosa"},wH={englishName:"Soga",nativeName:"Olusoga"},kH={englishName:"Yangben",nativeName:"nuasue"},AH={englishName:"Yiddish",nativeName:"ייִדיש"},IH={englishName:"Yoruba",nativeName:"Èdè Yorùbá"},PH={englishName:"Standard Moroccan Tamazight",nativeName:"ⵜⴰⵎⴰⵣⵉⵖⵜ"},DH={englishName:"Chinese",nativeName:"中文"},NH={englishName:"isiZulu",nativeName:"isiZulu"},Av={aa:dj,"aa-dj":{englishName:"Afar (Djibouti)",nativeName:"Qafar (Yabuuti)"},"aa-er":{englishName:"Afar (Eritrea)",nativeName:"Qafar (Eretria)"},"aa-et":{englishName:"Afar (Ethiopia)",nativeName:"Qafar (Otobbia)"},af:fj,"af-na":{englishName:"Afrikaans (Namibia)",nativeName:"Afrikaans (Namibië)"},"af-za":{englishName:"Afrikaans (South Africa)",nativeName:"Afrikaans (Suid-Afrika)"},agq:pj,"agq-cm":{englishName:"Aghem (Cameroon)",nativeName:"Aghem (K� m� lûŋ)"},ak:mj,"ak-gh":{englishName:"Akan (Ghana)",nativeName:"Akan (Gaana)"},am:gj,"am-et":{englishName:"Amharic (Ethiopia)",nativeName:"�� ማርኛ (ኢትዮጵያ)"},ar:vj,"ar-001":{englishName:"Arabic (World)",nativeName:"العربية (العالم)"},"ar-ae":{englishName:"Arabic (United Arab Emirates)",nativeName:"العربية (الإمارات العربية المتحدة)"},"ar-bh":{englishName:"Arabic (Bahrain)",nativeName:"العربية (البحرين)"},"ar-dj":{englishName:"Arabic (Djibouti)",nativeName:"العربية (جيبوتي)"},"ar-dz":{englishName:"Arabic (Algeria)",nativeName:"العربية (الجزائر)"},"ar-eg":{englishName:"Arabic (Egypt)",nativeName:"العربية (مصر)"},"ar-er":{englishName:"Arabic (Eritrea)",nativeName:"العربية (إريتريا)"},"ar-il":{englishName:"Arabic (Israel)",nativeName:"العربية (إسرائيل)"},"ar-iq":{englishName:"Arabic (Iraq)",nativeName:"العربية (العراق)"},"ar-jo":{englishName:"Arabic (Jordan)",nativeName:"العربية (الأردن)"},"ar-km":{englishName:"Arabic (Comoros)",nativeName:"العربية (جزر القمر)"},"ar-kw":{englishName:"Arabic (Kuwait)",nativeName:"العربية (الكويت)"},"ar-lb":{englishName:"Arabic (Lebanon)",nativeName:"العربية (لبنان)"},"ar-ly":{englishName:"Arabic (Libya)",nativeName:"العربية (ليبيا)"},"ar-ma":{englishName:"Arabic (Morocco)",nativeName:"العربية (المملكة المغربية)"},"ar-mr":{englishName:"Arabic (Mauritania)",nativeName:"العربية (موريتانيا)"},"ar-om":{englishName:"Arabic (Oman)",nativeName:"العربية (عمان)"},"ar-ps":{englishName:"Arabic (Palestinian Authority)",nativeName:"العربية (السلطة الفلسطينية)"},"ar-qa":{englishName:"Arabic (Qatar)",nativeName:"العربية (قطر)"},"ar-sa":{englishName:"Arabic (Saudi Arabia)",nativeName:"العربية (المملكة العربية السعودية)"},"ar-sd":{englishName:"Arabic (Sudan)",nativeName:"العربية (السودان)"},"ar-so":{englishName:"Arabic (Somalia)",nativeName:"العربية (الصومال)"},"ar-ss":{englishName:"Arabic (South Sudan)",nativeName:"العربية (جنوب السودان)"},"ar-sy":{englishName:"Arabic (Syria)",nativeName:"العربية (سوريا)"},"ar-td":{englishName:"Arabic (Chad)",nativeName:"العربية (تشاد)"},"ar-tn":{englishName:"Arabic (Tunisia)",nativeName:"العربية (تونس)"},"ar-ye":{englishName:"Arabic (Yemen)",nativeName:"العربية (اليمن)"},arn:yj,"arn-cl":{englishName:"Mapudungun (Chile)",nativeName:"Mapudungun (Chile)"},as:_j,"as-in":{englishName:"Assamese (India)",nativeName:"অসমীয়া (ভাৰত)"},asa:Tj,"asa-tz":{englishName:"Asu (Tanzania)",nativeName:"Kipare (Tadhania)"},ast:bj,"ast-es":{englishName:"Asturian (Spain)",nativeName:"asturianu (España)"},az:Sj,"az-cyrl":{englishName:"Azerbaijani (Cyrillic)",nativeName:"Азәрбајҹан дили"},"az-cyrl-az":{englishName:"Azerbaijani (Cyrillic, Azerbaijan)",nativeName:"Азәрбајҹан дили (Азәрбајҹан)"},"az-latn":{englishName:"Azerbaijani (Latin)",nativeName:"AzÉ™rbaycan dili"},"az-latn-az":{englishName:"Azerbaijani (Latin, Azerbaijan)",nativeName:"AzÉ™rbaycan dili (AzÉ™rbaycan)"},ba:xj,"ba-ru":{englishName:"Bashkir (Russia)",nativeName:"Башҡорт (� әсәй)"},bas:Cj,"bas-cm":{englishName:"Basaa (Cameroon)",nativeName:"Ɓ� s� a (K� mɛ̀rûn)"},be:Ej,"be-by":{englishName:"Belarusian (Belarus)",nativeName:"Беларуская (Беларусь)"},bem:wj,"bem-zm":{englishName:"Bemba (Zambia)",nativeName:"Ichibemba (Zambia)"},bez:kj,"bez-tz":{englishName:"Bena (Tanzania)",nativeName:"Hibena (Hutanzania)"},bg:Aj,"bg-bg":{englishName:"Bulgarian (Bulgaria)",nativeName:"български (България)"},bin:Ij,"bin-ng":{englishName:"Edo (Nigeria)",nativeName:"Ẹ̀dó (Nigeria)"},bm:Pj,"bm-latn":{englishName:"Bamanankan (Latin)",nativeName:"bamanakan"},"bm-latn-ml":{englishName:"Bamanankan (Latin, Mali)",nativeName:"bamanakan (Mali)"},bn:Dj,"bn-bd":{englishName:"Bangla (Bangladesh)",nativeName:"বাংলা (বাংলাদেশ)"},"bn-in":{englishName:"Bangla (India)",nativeName:"বাংলা (ভারত)"},bo:Nj,"bo-cn":{englishName:"Tibetan (China)",nativeName:"བོད་ཡིག (ཀྲུང་ཧྭ་མི་དམངས་སྤྱི་མཐུན་རྒྱལ་ཁབ།)"},"bo-in":{englishName:"Tibetan (India)",nativeName:"བོད་སྐད་ (རྒྱ་གར་)"},br:Lj,"br-fr":{englishName:"Breton (France)",nativeName:"brezhoneg (Frañs)"},brx:Oj,"brx-in":{englishName:"Bodo (India)",nativeName:"बड़ो (भारत)"},bs:Mj,"bs-cyrl":{englishName:"Bosnian (Cyrillic)",nativeName:"босански"},"bs-cyrl-ba":{englishName:"Bosnian (Cyrillic, Bosnia and Herzegovina)",nativeName:"босански (Босна и Херцеговина)"},"bs-latn":{englishName:"Bosnian (Latin)",nativeName:"bosanski"},"bs-latn-ba":{englishName:"Bosnian (Latin, Bosnia and Herzegovina)",nativeName:"bosanski (Bosna i Hercegovina)"},byn:Rj,"byn-er":{englishName:"Blin (Eritrea)",nativeName:"ብሊን (ኤርትራ)"},ca:Fj,"ca-ad":{englishName:"Catalan (Andorra)",nativeName:"catal� (Andorra)"},"ca-es":{englishName:"Catalan (Catalan)",nativeName:"catal� (catal� )"},"ca-es-valencia":{englishName:"Valencian (Spain)",nativeName:"valenci� (Espanya)"},"ca-fr":{englishName:"Catalan (France)",nativeName:"catal� (França)"},"ca-it":{englishName:"Catalan (Italy)",nativeName:"catal� (It� lia)"},ce:Bj,"ce-ru":{englishName:"Chechen (Russia)",nativeName:"нохчийн (� осси)"},cgg:Uj,"cgg-ug":{englishName:"Chiga (Uganda)",nativeName:"Rukiga (Uganda)"},chr:$j,"chr-cher":{englishName:"Cherokee",nativeName:"ᏣᎳᎩ"},"chr-cher-us":{englishName:"Cherokee (Cherokee)",nativeName:"ᏣᎳᎩ (ᏣᎳᎩ)"},co:jj,"co-fr":{englishName:"Corsican (France)",nativeName:"Corsu (Francia)"},cs:qj,"cs-cz":{englishName:"Czech (Czech Republic)",nativeName:"čeÅ¡tina (ÄŒeská republika)"},cu:Vj,"cu-ru":{englishName:"Church Slavic (Russia)",nativeName:"церковнослове́нскїй (рѡссі́а)"},cy:Hj,"cy-gb":{englishName:"Welsh (United Kingdom)",nativeName:"Cymraeg (Y Deyrnas Unedig)"},da:zj,"da-dk":{englishName:"Danish (Denmark)",nativeName:"dansk (Danmark)"},"da-gl":{englishName:"Danish (Greenland)",nativeName:"dansk (Grønland)"},dav:Wj,"dav-ke":{englishName:"Taita (Kenya)",nativeName:"Kitaita (Kenya)"},de:Gj,"de-at":{englishName:"German (Austria)",nativeName:"Deutsch (Österreich)"},"de-be":{englishName:"German (Belgium)",nativeName:"Deutsch (Belgien)"},"de-ch":{englishName:"German (Switzerland)",nativeName:"Deutsch (Schweiz)"},"de-de":{englishName:"German (Germany)",nativeName:"Deutsch (Deutschland)"},"de-li":{englishName:"German (Liechtenstein)",nativeName:"Deutsch (Liechtenstein)"},"de-lu":{englishName:"German (Luxembourg)",nativeName:"Deutsch (Luxemburg)"},dje:Kj,"dje-ne":{englishName:"Zarma (Niger)",nativeName:"Zarmaciine (Nižer)"},dsb:Xj,"dsb-de":{englishName:"Lower Sorbian (Germany)",nativeName:"dolnoserbšćina (Nimska)"},dua:Qj,"dua-cm":{englishName:"Duala (Cameroon)",nativeName:"duálá (Cameroun)"},dv:Yj,"dv-mv":{englishName:"Divehi (Maldives)",nativeName:"ދިވެހިބަސް (Þ‹Þ¨ÞˆÞ¬Þ€Þ¨ ÞƒÞ§Þ‡Þ°Þ–Þ¬)"},dyo:Jj,"dyo-sn":{englishName:"Jola-Fonyi (Senegal)",nativeName:"joola (Senegal)"},dz:Zj,"dz-bt":{englishName:"Dzongkha (Bhutan)",nativeName:"རྫོང་ཁ (�� བྲུག)"},ebu:e9,"ebu-ke":{englishName:"Embu (Kenya)",nativeName:"KÄ©embu (Kenya)"},ee:t9,"ee-gh":{englishName:"Ewe (Ghana)",nativeName:"EÊ‹egbe (Ghana nutome)"},"ee-tg":{englishName:"Ewe (Togo)",nativeName:"EÊ‹egbe (Togo nutome)"},el:i9,"el-cy":{englishName:"Greek (Cyprus)",nativeName:"Ελληνικά (Κύπρος)"},"el-gr":{englishName:"Greek (Greece)",nativeName:"Ελληνικά (Ελλάδα)"},en:r9,"en-001":{englishName:"English (World)",nativeName:"English (World)"},"en-029":{englishName:"English (Caribbean)",nativeName:"English (Caribbean)"},"en-150":{englishName:"English (Europe)",nativeName:"English (Europe)"},"en-ag":{englishName:"English (Antigua and Barbuda)",nativeName:"English (Antigua and Barbuda)"},"en-ai":{englishName:"English (Anguilla)",nativeName:"English (Anguilla)"},"en-as":{englishName:"English (American Samoa)",nativeName:"English (American Samoa)"},"en-at":{englishName:"English (Austria)",nativeName:"English (Austria)"},"en-au":{englishName:"English (Australia)",nativeName:"English (Australia)"},"en-bb":{englishName:"English (Barbados)",nativeName:"English (Barbados)"},"en-be":{englishName:"English (Belgium)",nativeName:"English (Belgium)"},"en-bi":{englishName:"English (Burundi)",nativeName:"English (Burundi)"},"en-bm":{englishName:"English (Bermuda)",nativeName:"English (Bermuda)"},"en-bs":{englishName:"English (Bahamas)",nativeName:"English (Bahamas)"},"en-bw":{englishName:"English (Botswana)",nativeName:"English (Botswana)"},"en-bz":{englishName:"English (Belize)",nativeName:"English (Belize)"},"en-ca":{englishName:"English (Canada)",nativeName:"English (Canada)"},"en-cc":{englishName:"English (Cocos (Keeling) Islands)",nativeName:"English (Cocos (Keeling) Islands)"},"en-ch":{englishName:"English (Switzerland)",nativeName:"English (Switzerland)"},"en-ck":{englishName:"English (Cook Islands)",nativeName:"English (Cook Islands)"},"en-cm":{englishName:"English (Cameroon)",nativeName:"English (Cameroon)"},"en-cx":{englishName:"English (Christmas Island)",nativeName:"English (Christmas Island)"},"en-cy":{englishName:"English (Cyprus)",nativeName:"English (Cyprus)"},"en-de":{englishName:"English (Germany)",nativeName:"English (Germany)"},"en-dk":{englishName:"English (Denmark)",nativeName:"English (Denmark)"},"en-dm":{englishName:"English (Dominica)",nativeName:"English (Dominica)"},"en-er":{englishName:"English (Eritrea)",nativeName:"English (Eritrea)"},"en-fi":{englishName:"English (Finland)",nativeName:"English (Finland)"},"en-fj":{englishName:"English (Fiji)",nativeName:"English (Fiji)"},"en-fk":{englishName:"English (Falkland Islands)",nativeName:"English (Falkland Islands)"},"en-fm":{englishName:"English (Micronesia)",nativeName:"English (Micronesia)"},"en-gb":{englishName:"English (United Kingdom)",nativeName:"English (United Kingdom)"},"en-gd":{englishName:"English (Grenada)",nativeName:"English (Grenada)"},"en-gg":{englishName:"English (Guernsey)",nativeName:"English (Guernsey)"},"en-gh":{englishName:"English (Ghana)",nativeName:"English (Ghana)"},"en-gi":{englishName:"English (Gibraltar)",nativeName:"English (Gibraltar)"},"en-gm":{englishName:"English (Gambia)",nativeName:"English (Gambia)"},"en-gu":{englishName:"English (Guam)",nativeName:"English (Guam)"},"en-gy":{englishName:"English (Guyana)",nativeName:"English (Guyana)"},"en-hk":{englishName:"English (Hong Kong SAR)",nativeName:"English (Hong Kong SAR)"},"en-id":{englishName:"English (Indonesia)",nativeName:"English (Indonesia)"},"en-ie":{englishName:"English (Ireland)",nativeName:"English (Ireland)"},"en-il":{englishName:"English (Israel)",nativeName:"English (Israel)"},"en-im":{englishName:"English (Isle of Man)",nativeName:"English (Isle of Man)"},"en-in":{englishName:"English (India)",nativeName:"English (India)"},"en-io":{englishName:"English (British Indian Ocean Territory)",nativeName:"English (British Indian Ocean Territory)"},"en-je":{englishName:"English (Jersey)",nativeName:"English (Jersey)"},"en-jm":{englishName:"English (Jamaica)",nativeName:"English (Jamaica)"},"en-ke":{englishName:"English (Kenya)",nativeName:"English (Kenya)"},"en-ki":{englishName:"English (Kiribati)",nativeName:"English (Kiribati)"},"en-kn":{englishName:"English (Saint Kitts and Nevis)",nativeName:"English (Saint Kitts and Nevis)"},"en-ky":{englishName:"English (Cayman Islands)",nativeName:"English (Cayman Islands)"},"en-lc":{englishName:"English (Saint Lucia)",nativeName:"English (Saint Lucia)"},"en-lr":{englishName:"English (Liberia)",nativeName:"English (Liberia)"},"en-ls":{englishName:"English (Lesotho)",nativeName:"English (Lesotho)"},"en-mg":{englishName:"English (Madagascar)",nativeName:"English (Madagascar)"},"en-mh":{englishName:"English (Marshall Islands)",nativeName:"English (Marshall Islands)"},"en-mo":{englishName:"English (Macao SAR)",nativeName:"English (Macao SAR)"},"en-mp":{englishName:"English (Northern Mariana Islands)",nativeName:"English (Northern Mariana Islands)"},"en-ms":{englishName:"English (Montserrat)",nativeName:"English (Montserrat)"},"en-mt":{englishName:"English (Malta)",nativeName:"English (Malta)"},"en-mu":{englishName:"English (Mauritius)",nativeName:"English (Mauritius)"},"en-mw":{englishName:"English (Malawi)",nativeName:"English (Malawi)"},"en-my":{englishName:"English (Malaysia)",nativeName:"English (Malaysia)"},"en-na":{englishName:"English (Namibia)",nativeName:"English (Namibia)"},"en-nf":{englishName:"English (Norfolk Island)",nativeName:"English (Norfolk Island)"},"en-ng":{englishName:"English (Nigeria)",nativeName:"English (Nigeria)"},"en-nl":{englishName:"English (Netherlands)",nativeName:"English (Netherlands)"},"en-nr":{englishName:"English (Nauru)",nativeName:"English (Nauru)"},"en-nu":{englishName:"English (Niue)",nativeName:"English (Niue)"},"en-nz":{englishName:"English (New Zealand)",nativeName:"English (New Zealand)"},"en-pg":{englishName:"English (Papua New Guinea)",nativeName:"English (Papua New Guinea)"},"en-ph":{englishName:"English (Philippines)",nativeName:"English (Philippines)"},"en-pk":{englishName:"English (Pakistan)",nativeName:"English (Pakistan)"},"en-pn":{englishName:"English (Pitcairn Islands)",nativeName:"English (Pitcairn Islands)"},"en-pr":{englishName:"English (Puerto Rico)",nativeName:"English (Puerto Rico)"},"en-pw":{englishName:"English (Palau)",nativeName:"English (Palau)"},"en-rw":{englishName:"English (Rwanda)",nativeName:"English (Rwanda)"},"en-sb":{englishName:"English (Solomon Islands)",nativeName:"English (Solomon Islands)"},"en-sc":{englishName:"English (Seychelles)",nativeName:"English (Seychelles)"},"en-sd":{englishName:"English (Sudan)",nativeName:"English (Sudan)"},"en-se":{englishName:"English (Sweden)",nativeName:"English (Sweden)"},"en-sg":{englishName:"English (Singapore)",nativeName:"English (Singapore)"},"en-sh":{englishName:"English (St Helena, Ascension, Tristan da Cunha)",nativeName:"English (St Helena, Ascension, Tristan da Cunha)"},"en-si":{englishName:"English (Slovenia)",nativeName:"English (Slovenia)"},"en-sl":{englishName:"English (Sierra Leone)",nativeName:"English (Sierra Leone)"},"en-ss":{englishName:"English (South Sudan)",nativeName:"English (South Sudan)"},"en-sx":{englishName:"English (Sint Maarten)",nativeName:"English (Sint Maarten)"},"en-sz":{englishName:"English (Swaziland)",nativeName:"English (Swaziland)"},"en-tc":{englishName:"English (Turks and Caicos Islands)",nativeName:"English (Turks and Caicos Islands)"},"en-tk":{englishName:"English (Tokelau)",nativeName:"English (Tokelau)"},"en-to":{englishName:"English (Tonga)",nativeName:"English (Tonga)"},"en-tt":{englishName:"English (Trinidad and Tobago)",nativeName:"English (Trinidad and Tobago)"},"en-tv":{englishName:"English (Tuvalu)",nativeName:"English (Tuvalu)"},"en-tz":{englishName:"English (Tanzania)",nativeName:"English (Tanzania)"},"en-ug":{englishName:"English (Uganda)",nativeName:"English (Uganda)"},"en-um":{englishName:"English (U.S. Outlying Islands)",nativeName:"English (U.S. Outlying Islands)"},"en-us":{englishName:"English (United States)",nativeName:"English (United States)"},"en-vc":{englishName:"English (Saint Vincent and the Grenadines)",nativeName:"English (Saint Vincent and the Grenadines)"},"en-vg":{englishName:"English (British Virgin Islands)",nativeName:"English (British Virgin Islands)"},"en-vi":{englishName:"English (U.S. Virgin Islands)",nativeName:"English (U.S. Virgin Islands)"},"en-vu":{englishName:"English (Vanuatu)",nativeName:"English (Vanuatu)"},"en-ws":{englishName:"English (Samoa)",nativeName:"English (Samoa)"},"en-za":{englishName:"English (South Africa)",nativeName:"English (South Africa)"},"en-zm":{englishName:"English (Zambia)",nativeName:"English (Zambia)"},"en-zw":{englishName:"English (Zimbabwe)",nativeName:"English (Zimbabwe)"},eo:n9,"eo-001":{englishName:"Esperanto (World)",nativeName:"esperanto (World)"},es:s9,"es-419":{englishName:"Spanish (Latin America)",nativeName:"español (Latinoamérica)"},"es-ar":{englishName:"Spanish (Argentina)",nativeName:"español (Argentina)"},"es-bo":{englishName:"Spanish (Bolivia)",nativeName:"español (Bolivia)"},"es-cl":{englishName:"Spanish (Chile)",nativeName:"español (Chile)"},"es-co":{englishName:"Spanish (Colombia)",nativeName:"español (Colombia)"},"es-cr":{englishName:"Spanish (Costa Rica)",nativeName:"español (Costa Rica)"},"es-cu":{englishName:"Spanish (Cuba)",nativeName:"español (Cuba)"},"es-do":{englishName:"Spanish (Dominican Republic)",nativeName:"español (República Dominicana)"},"es-ec":{englishName:"Spanish (Ecuador)",nativeName:"español (Ecuador)"},"es-es":{englishName:"Spanish (Spain, International Sort)",nativeName:"español (España, alfabetización internacional)"},"es-gq":{englishName:"Spanish (Equatorial Guinea)",nativeName:"español (Guinea Ecuatorial)"},"es-gt":{englishName:"Spanish (Guatemala)",nativeName:"español (Guatemala)"},"es-hn":{englishName:"Spanish (Honduras)",nativeName:"español (Honduras)"},"es-mx":{englishName:"Spanish (Mexico)",nativeName:"español (México)"},"es-ni":{englishName:"Spanish (Nicaragua)",nativeName:"español (Nicaragua)"},"es-pa":{englishName:"Spanish (Panama)",nativeName:"español (Panamá)"},"es-pe":{englishName:"Spanish (Peru)",nativeName:"español (Perú)"},"es-ph":{englishName:"Spanish (Philippines)",nativeName:"español (Filipinas)"},"es-pr":{englishName:"Spanish (Puerto Rico)",nativeName:"español (Puerto Rico)"},"es-py":{englishName:"Spanish (Paraguay)",nativeName:"español (Paraguay)"},"es-sv":{englishName:"Spanish (El Salvador)",nativeName:"español (El Salvador)"},"es-us":{englishName:"Spanish (United States)",nativeName:"español (Estados Unidos)"},"es-uy":{englishName:"Spanish (Uruguay)",nativeName:"español (Uruguay)"},"es-ve":{englishName:"Spanish (Venezuela)",nativeName:"español (Venezuela)"},et:a9,"et-ee":{englishName:"Estonian (Estonia)",nativeName:"eesti (Eesti)"},eu:o9,"eu-es":{englishName:"Basque (Basque)",nativeName:"euskara (euskara)"},ewo:l9,"ewo-cm":{englishName:"Ewondo (Cameroon)",nativeName:"ewondo (KamÉ™rún)"},fa:u9,"fa-ir":{englishName:"Persian (Iran)",nativeName:"فارسى (ایران)"},ff:c9,"ff-cm":{englishName:"Fulah (Cameroon)",nativeName:"Pulaar (Kameruun)"},"ff-gn":{englishName:"Fulah (Guinea)",nativeName:"Pulaar (Gine)"},"ff-latn":{englishName:"Fulah",nativeName:"Fulah"},"ff-latn-sn":{englishName:"Fulah (Latin, Senegal)",nativeName:"Fulah (Sénégal)"},"ff-mr":{englishName:"Fulah (Mauritania)",nativeName:"Pulaar (Muritani)"},"ff-ng":{englishName:"Fulah (Nigeria)",nativeName:"Pulaar (Nigeria)"},fi:h9,"fi-fi":{englishName:"Finnish (Finland)",nativeName:"suomi (Suomi)"},fil:d9,"fil-ph":{englishName:"Filipino (Philippines)",nativeName:"Filipino (Pilipinas)"},fo:f9,"fo-dk":{englishName:"Faroese (Denmark)",nativeName:"føroyskt (Danmark)"},"fo-fo":{englishName:"Faroese (Faroe Islands)",nativeName:"føroyskt (Føroyar)"},fr:p9,"fr-029":{englishName:"French (Caribbean)",nativeName:"français (caraïbes)"},"fr-be":{englishName:"French (Belgium)",nativeName:"français (Belgique)"},"fr-bf":{englishName:"French (Burkina Faso)",nativeName:"français (Burkina Faso)"},"fr-bi":{englishName:"French (Burundi)",nativeName:"français (Burundi)"},"fr-bj":{englishName:"French (Benin)",nativeName:"français (Bénin)"},"fr-bl":{englishName:"French (Saint Barthélemy)",nativeName:"français (Saint-Barthélemy)"},"fr-ca":{englishName:"French (Canada)",nativeName:"français (Canada)"},"fr-cd":{englishName:"French (Congo DRC)",nativeName:"français (Congo, République démocratique du)"},"fr-cf":{englishName:"French (Central African Republic)",nativeName:"français (République centrafricaine)"},"fr-cg":{englishName:"French (Congo)",nativeName:"français (Congo)"},"fr-ch":{englishName:"French (Switzerland)",nativeName:"français (Suisse)"},"fr-ci":{englishName:"French (Côte d’Ivoire)",nativeName:"français (Côte d’Ivoire)"},"fr-cm":{englishName:"French (Cameroon)",nativeName:"français (Cameroun)"},"fr-dj":{englishName:"French (Djibouti)",nativeName:"français (Djibouti)"},"fr-dz":{englishName:"French (Algeria)",nativeName:"français (Algérie)"},"fr-fr":{englishName:"French (France)",nativeName:"français (France)"},"fr-ga":{englishName:"French (Gabon)",nativeName:"français (Gabon)"},"fr-gf":{englishName:"French (French Guiana)",nativeName:"français (Guyane française)"},"fr-gn":{englishName:"French (Guinea)",nativeName:"français (Guinée)"},"fr-gp":{englishName:"French (Guadeloupe)",nativeName:"français (Guadeloupe)"},"fr-gq":{englishName:"French (Equatorial Guinea)",nativeName:"français (Guinée équatoriale)"},"fr-ht":{englishName:"French (Haiti)",nativeName:"français (Haïti)"},"fr-km":{englishName:"French (Comoros)",nativeName:"français (Comores)"},"fr-lu":{englishName:"French (Luxembourg)",nativeName:"français (Luxembourg)"},"fr-ma":{englishName:"French (Morocco)",nativeName:"français (Maroc)"},"fr-mc":{englishName:"French (Monaco)",nativeName:"français (Monaco)"},"fr-mf":{englishName:"French (Saint Martin)",nativeName:"français (Saint-Martin)"},"fr-mg":{englishName:"French (Madagascar)",nativeName:"français (Madagascar)"},"fr-ml":{englishName:"French (Mali)",nativeName:"français (Mali)"},"fr-mq":{englishName:"French (Martinique)",nativeName:"français (Martinique)"},"fr-mr":{englishName:"French (Mauritania)",nativeName:"français (Mauritanie)"},"fr-mu":{englishName:"French (Mauritius)",nativeName:"français (Maurice)"},"fr-nc":{englishName:"French (New Caledonia)",nativeName:"français (Nouvelle-Calédonie)"},"fr-ne":{englishName:"French (Niger)",nativeName:"français (Niger)"},"fr-pf":{englishName:"French (French Polynesia)",nativeName:"français (Polynésie française)"},"fr-pm":{englishName:"French (Saint Pierre and Miquelon)",nativeName:"français (Saint-Pierre-et-Miquelon)"},"fr-re":{englishName:"French (Réunion)",nativeName:"français (La Réunion)"},"fr-rw":{englishName:"French (Rwanda)",nativeName:"français (Rwanda)"},"fr-sc":{englishName:"French (Seychelles)",nativeName:"français (Seychelles)"},"fr-sn":{englishName:"French (Senegal)",nativeName:"français (Sénégal)"},"fr-sy":{englishName:"French (Syria)",nativeName:"français (Syrie)"},"fr-td":{englishName:"French (Chad)",nativeName:"français (Tchad)"},"fr-tg":{englishName:"French (Togo)",nativeName:"français (Togo)"},"fr-tn":{englishName:"French (Tunisia)",nativeName:"français (Tunisie)"},"fr-vu":{englishName:"French (Vanuatu)",nativeName:"français (Vanuatu)"},"fr-wf":{englishName:"French (Wallis and Futuna)",nativeName:"français (Wallis-et-Futuna)"},"fr-yt":{englishName:"French (Mayotte)",nativeName:"français (Mayotte)"},fur:m9,"fur-it":{englishName:"Friulian (Italy)",nativeName:"furlan (Italie)"},fy:g9,"fy-nl":{englishName:"Western Frisian (Netherlands)",nativeName:"Frysk (Nederlân)"},ga:v9,"ga-ie":{englishName:"Irish (Ireland)",nativeName:"Gaeilge (Éire)"},gd:y9,"gd-gb":{englishName:"Scottish Gaelic (United Kingdom)",nativeName:"G� idhlig (An Rìoghachd Aonaichte)"},gl:_9,"gl-es":{englishName:"Galician (Galician)",nativeName:"galego (galego)"},gn:T9,"gn-py":{englishName:"Guarani (Paraguay)",nativeName:"Avañe’ẽ (Paraguái)"},gsw:b9,"gsw-ch":{englishName:"Alsatian (Switzerland)",nativeName:"Elsässisch (Schwiiz)"},"gsw-fr":{englishName:"Alsatian (France)",nativeName:"Elsässisch (Fr� nkrisch)"},"gsw-li":{englishName:"Alsatian (Liechtenstein)",nativeName:"Elsässisch (Liächteschtäi)"},gu:S9,"gu-in":{englishName:"Gujarati (India)",nativeName:"ગુજરાતી (ભારત)"},guz:x9,"guz-ke":{englishName:"Gusii (Kenya)",nativeName:"Ekegusii (Kenya)"},gv:C9,"gv-im":{englishName:"Manx (Isle of Man)",nativeName:"Gaelg (Ellan Vannin)"},ha:E9,"ha-latn":{englishName:"Hausa (Latin)",nativeName:"Hausa"},"ha-latn-gh":{englishName:"Hausa (Latin, Ghana)",nativeName:"Hausa (Gana)"},"ha-latn-ne":{englishName:"Hausa (Latin, Niger)",nativeName:"Hausa (Nijar)"},"ha-latn-ng":{englishName:"Hausa (Latin, Nigeria)",nativeName:"Hausa (Najeriya)"},haw:w9,"haw-us":{englishName:"Hawaiian (United States)",nativeName:"ʻŌlelo HawaiÊ»i (Ê»Amelika Hui PÅ« Ê»Ia)"},he:k9,"he-il":{englishName:"Hebrew (Israel)",nativeName:"עברית (ישראל)"},hi:A9,"hi-in":{englishName:"Hindi (India)",nativeName:"हिंदी (भारत)"},hr:I9,"hr-ba":{englishName:"Croatian (Bosnia and Herzegovina)",nativeName:"hrvatski (Bosna i Hercegovina)"},"hr-hr":{englishName:"Croatian (Croatia)",nativeName:"hrvatski (Hrvatska)"},hsb:P9,"hsb-de":{englishName:"Upper Sorbian (Germany)",nativeName:"hornjoserbšćina (NÄ›mska)"},hu:D9,"hu-hu":{englishName:"Hungarian (Hungary)",nativeName:"magyar (Magyarország)"},hy:N9,"hy-am":{englishName:"Armenian (Armenia)",nativeName:"Õ€Õ¡ÕµÕ¥Ö€Õ¥Õ¶ (Õ€Õ¡ÕµÕ¡Õ½Õ¿Õ¡Õ¶)"},ia:L9,"ia-001":{englishName:"Interlingua (World)",nativeName:"interlingua (World)"},"ia-fr":{englishName:"Interlingua (France)",nativeName:"interlingua (Francia)"},ibb:O9,"ibb-ng":{englishName:"Ibibio (Nigeria)",nativeName:"Ibibio-Efik (Nigeria)"},id:M9,"id-id":{englishName:"Indonesian (Indonesia)",nativeName:"Indonesia (Indonesia)"},ig:R9,"ig-ng":{englishName:"Igbo (Nigeria)",nativeName:"Igbo (Nigeria)"},ii:F9,"ii-cn":{englishName:"Yi (China)",nativeName:"ꆈ�� ꁱꂷ (ꍏꉸꏓꂱꇭꉼꇩ)"},is:B9,"is-is":{englishName:"Icelandic (Iceland)",nativeName:"íslenska (Ísland)"},it:U9,"it-ch":{englishName:"Italian (Switzerland)",nativeName:"italiano (Svizzera)"},"it-it":{englishName:"Italian (Italy)",nativeName:"italiano (Italia)"},"it-sm":{englishName:"Italian (San Marino)",nativeName:"italiano (San Marino)"},iu:$9,"iu-cans":{englishName:"Inuktitut (Syllabics)",nativeName:"ᐃᓄᒃᑎᑐᑦ"},"iu-cans-ca":{englishName:"Inuktitut (Syllabics, Canada)",nativeName:"ᐃᓄᒃᑎᑐᑦ (ᑲᓇᑕᒥ)"},"iu-latn":{englishName:"Inuktitut (Latin)",nativeName:"Inuktitut"},"iu-latn-ca":{englishName:"Inuktitut (Latin, Canada)",nativeName:"Inuktitut (Kanatami)"},ja:j9,"ja-jp":{englishName:"Japanese (Japan)",nativeName:"日本語 (日本)"},jgo:q9,"jgo-cm":{englishName:"Ngomba (Cameroon)",nativeName:"Ndaꞌa (KamÉ›lûn)"},jmc:V9,"jmc-tz":{englishName:"Machame (Tanzania)",nativeName:"Kimachame (Tanzania)"},jv:H9,"jv-java":{englishName:"Javanese (Javanese)",nativeName:"ꦧꦱꦗꦮ"},"jv-java-id":{englishName:"Javanese (Javanese, Indonesia)",nativeName:"ꦧꦱꦗꦮ (Indonesia)"},"jv-latn":{englishName:"Javanese",nativeName:"Basa Jawa"},"jv-latn-id":{englishName:"Javanese (Indonesia)",nativeName:"Basa Jawa (Indonesia)"},ka:z9,"ka-ge":{englishName:"Georgian (Georgia)",nativeName:"ქა�� თული (საქა�� თველო)"},kab:W9,"kab-dz":{englishName:"Kabyle (Algeria)",nativeName:"Taqbaylit (Lezzayer)"},kam:G9,"kam-ke":{englishName:"Kamba (Kenya)",nativeName:"Kikamba (Kenya)"},kde:K9,"kde-tz":{englishName:"Makonde (Tanzania)",nativeName:"Chimakonde (Tanzania)"},kea:X9,"kea-cv":{englishName:"Kabuverdianu (Cabo Verde)",nativeName:"kabuverdianu (Kabu Verdi)"},khq:Q9,"khq-ml":{englishName:"Koyra Chiini (Mali)",nativeName:"Koyra ciini (Maali)"},ki:Y9,"ki-ke":{englishName:"Kikuyu (Kenya)",nativeName:"Gikuyu (Kenya)"},kk:J9,"kk-kz":{englishName:"Kazakh (Kazakhstan)",nativeName:"қазақ тілі (Қазақстан)"},kkj:Z9,"kkj-cm":{englishName:"Kako (Cameroon)",nativeName:"kakÉ” (KamÉ›run)"},kl:eq,"kl-gl":{englishName:"Greenlandic (Greenland)",nativeName:"kalaallisut (Kalaallit Nunaat)"},kln:tq,"kln-ke":{englishName:"Kalenjin (Kenya)",nativeName:"Kalenjin (Emetab Kenya)"},km:iq,"km-kh":{englishName:"Khmer (Cambodia)",nativeName:"ភាសាខ្មែរ (កម្ពុជា)"},kn:rq,"kn-in":{englishName:"Kannada (India)",nativeName:"ಕನ್ನಡ (ಭಾರತ)"},ko:nq,"ko-kp":{englishName:"Korean (North Korea)",nativeName:"한국어 (조�� 민주주의인민공화국)"},"ko-kr":{englishName:"Korean (Korea)",nativeName:"한국어(대한민국)"},kok:sq,"kok-in":{englishName:"Konkani (India)",nativeName:"कोंकणी (भारत)"},kr:aq,"kr-ng":{englishName:"Kanuri (Nigeria)",nativeName:"Kanuri (Nigeria)"},ks:oq,"ks-arab":{englishName:"Kashmiri (Perso-Arabic)",nativeName:"کٲشُر"},"ks-arab-in":{englishName:"Kashmiri (Perso-Arabic)",nativeName:"کٲشُر (اَربی)"},"ks-deva":{englishName:"Kashmiri (Devanagari)",nativeName:"कॉशुर"},"ks-deva-in":{englishName:"Kashmiri (Devanagari, India)",nativeName:"कॉशुर (India)"},ksb:lq,"ksb-tz":{englishName:"Shambala (Tanzania)",nativeName:"Kishambaa (Tanzania)"},ksf:uq,"ksf-cm":{englishName:"Bafia (Cameroon)",nativeName:"rikpa (kamÉ›rún)"},ksh:cq,"ksh-de":{englishName:"Ripuarian (Germany)",nativeName:"Kölsch (Doütschland)"},ku:hq,"ku-arab":{englishName:"Central Kurdish",nativeName:"کوردیی ناوەڕاست"},"ku-arab-iq":{englishName:"Central Kurdish (Iraq)",nativeName:"کوردیی ناوەڕاست (کوردستان)"},"ku-arab-ir":{englishName:"Kurdish (Perso-Arabic, Iran)",nativeName:"کوردی (ئێران)"},kw:dq,"kw-gb":{englishName:"Cornish (United Kingdom)",nativeName:"kernewek (Rywvaneth Unys)"},ky:fq,"ky-kg":{englishName:"Kyrgyz (Kyrgyzstan)",nativeName:"Кыргыз (Кыргызстан)"},la:pq,"la-001":{englishName:"Latin (World)",nativeName:"lingua latÄ«na (World)"},lag:mq,"lag-tz":{englishName:"Langi (Tanzania)",nativeName:"Kɨlaangi (Taansanía)"},lb:gq,"lb-lu":{englishName:"Luxembourgish (Luxembourg)",nativeName:"Lëtzebuergesch (Lëtzebuerg)"},lg:vq,"lg-ug":{englishName:"Ganda (Uganda)",nativeName:"Luganda (Yuganda)"},lkt:yq,"lkt-us":{englishName:"Lakota (United States)",nativeName:"Lakȟólʼiyapi (MílahaÅ‹ska TÈŸamákÈŸočhe)"},ln:_q,"ln-ao":{englishName:"Lingala (Angola)",nativeName:"lingála (Angóla)"},"ln-cd":{englishName:"Lingala (Congo DRC)",nativeName:"lingála (Repibiki demokratiki ya Kongó)"},"ln-cf":{englishName:"Lingala (Central African Republic)",nativeName:"lingála (Repibiki ya Afríka ya Káti)"},"ln-cg":{englishName:"Lingala (Congo)",nativeName:"lingála (Kongo)"},lo:Tq,"lo-la":{englishName:"Lao (Laos)",nativeName:"ລາວ (ລາວ)"},lrc:bq,"lrc-iq":{englishName:"Northern Luri (Iraq)",nativeName:"لۊری شومالی (Iraq)"},"lrc-ir":{englishName:"Northern Luri (Iran)",nativeName:"لۊری شومالی (Iran)"},lt:Sq,"lt-lt":{englishName:"Lithuanian (Lithuania)",nativeName:"lietuvių (Lietuva)"},lu:xq,"lu-cd":{englishName:"Luba-Katanga (Congo DRC)",nativeName:"Tshiluba (Ditunga wa Kongu)"},luo:Cq,"luo-ke":{englishName:"Luo (Kenya)",nativeName:"Dholuo (Kenya)"},luy:Eq,"luy-ke":{englishName:"Luyia (Kenya)",nativeName:"Luluhia (Kenya)"},lv:wq,"lv-lv":{englishName:"Latvian (Latvia)",nativeName:"latvieÅ¡u (Latvija)"},mas:kq,"mas-ke":{englishName:"Masai (Kenya)",nativeName:"Maa (Kenya)"},"mas-tz":{englishName:"Masai (Tanzania)",nativeName:"Maa (Tansania)"},mer:Aq,"mer-ke":{englishName:"Meru (Kenya)",nativeName:"KÄ©mÄ©rÅ© (Kenya)"},mfe:Iq,"mfe-mu":{englishName:"Morisyen (Mauritius)",nativeName:"kreol morisien (Moris)"},mg:Pq,"mg-mg":{englishName:"Malagasy (Madagascar)",nativeName:"Malagasy (Madagasikara)"},mgh:Dq,"mgh-mz":{englishName:"Makhuwa-Meetto (Mozambique)",nativeName:"Makua (Umozambiki)"},mgo:Nq,"mgo-cm":{englishName:"Metaʼ (Cameroon)",nativeName:"metaʼ (Kamalun)"},mi:Lq,"mi-nz":{englishName:"Maori (New Zealand)",nativeName:"Reo Māori (Aotearoa)"},mk:Oq,"mk-mk":{englishName:"Macedonian (Macedonia, FYRO)",nativeName:"македонски (� епублика Македонија)"},ml:Mq,"ml-in":{englishName:"Malayalam (India)",nativeName:"മലയാളം (ഇന്ത്യ)"},mn:Rq,"mn-cyrl":{englishName:"Mongolian",nativeName:"монгол"},"mn-mn":{englishName:"Mongolian (Mongolia)",nativeName:"монгол (Монгол)"},"mn-mong":{englishName:"Mongolian (Traditional Mongolian)",nativeName:"� �� �� �� �� �� �� � � �� �� �� �"},"mn-mong-cn":{englishName:"Mongolian (Traditional Mongolian, China)",nativeName:"� �� �� �� �� �� �� � � �� �� �� � (� �� �� �� �� �� � � �� � �� �� � �� �� � �� � � �� �� �� �� � �� � � � �� � � � �� �� �� �)"},"mn-mong-mn":{englishName:"Mongolian (Traditional Mongolian, Mongolia)",nativeName:"� �� �� �� �� �� �� � � �� �� �� � (� �� �� �� �� �� �� � � �� �� �� �)"},mni:Fq,"mni-in":{englishName:"Manipuri (India)",nativeName:"মৈতৈলোন্ (India)"},moh:Bq,"moh-ca":{englishName:"Mohawk (Mohawk)",nativeName:"Kanien'kéha"},mr:Uq,"mr-in":{englishName:"Marathi (India)",nativeName:"मरा�� ी (भारत)"},ms:$q,"ms-bn":{englishName:"Malay (Brunei)",nativeName:"Bahasa Melayu (Brunei)"},"ms-my":{englishName:"Malay (Malaysia)",nativeName:"Bahasa Melayu (Malaysia)"},"ms-sg":{englishName:"Malay (Singapore)",nativeName:"Bahasa Melayu (Singapura)"},mt:jq,"mt-mt":{englishName:"Maltese (Malta)",nativeName:"Malti (Malta)"},mua:qq,"mua-cm":{englishName:"Mundang (Cameroon)",nativeName:"MUNDAÅŠ (kameruÅ‹)"},my:Vq,"my-mm":{englishName:"Burmese (Myanmar)",nativeName:"ဗမာ (မြန်မာ)"},mzn:Hq,"mzn-ir":{englishName:"Mazanderani (Iran)",nativeName:"مازرونی (ایران)"},naq:zq,"naq-na":{englishName:"Nama (Namibia)",nativeName:"Khoekhoegowab (Namibiab)"},nb:Wq,"nb-no":{englishName:"Norwegian BokmÃ¥l (Norway)",nativeName:"norsk bokmÃ¥l (Norge)"},"nb-sj":{englishName:"Norwegian BokmÃ¥l (Svalbard and Jan Mayen)",nativeName:"norsk bokmÃ¥l (Svalbard og Jan Mayen)"},nd:Gq,"nd-zw":{englishName:"North Ndebele (Zimbabwe)",nativeName:"isiNdebele (Zimbabwe)"},ne:Kq,"ne-in":{englishName:"Nepali (India)",nativeName:"नेपाली (भारत)"},"ne-np":{englishName:"Nepali (Nepal)",nativeName:"नेपाली (नेपाल)"},nl:Xq,"nl-aw":{englishName:"Dutch (Aruba)",nativeName:"Nederlands (Aruba)"},"nl-be":{englishName:"Dutch (Belgium)",nativeName:"Nederlands (België)"},"nl-bq":{englishName:"Dutch (Bonaire, Sint Eustatius and Saba)",nativeName:"Nederlands (Bonaire, Sint Eustatius en Saba)"},"nl-cw":{englishName:"Dutch (Curaçao)",nativeName:"Nederlands (Curaçao)"},"nl-nl":{englishName:"Dutch (Netherlands)",nativeName:"Nederlands (Nederland)"},"nl-sr":{englishName:"Dutch (Suriname)",nativeName:"Nederlands (Suriname)"},"nl-sx":{englishName:"Dutch (Sint Maarten)",nativeName:"Nederlands (Sint-Maarten)"},nmg:Qq,"nmg-cm":{englishName:"Kwasio (Cameroon)",nativeName:"Kwasio (Kamerun)"},nn:Yq,"nn-no":{englishName:"Norwegian Nynorsk (Norway)",nativeName:"nynorsk (Noreg)"},nnh:Jq,"nnh-cm":{englishName:"Ngiemboon (Cameroon)",nativeName:"Shwóŋò ngiembɔɔn (K� malûm)"},no:Zq,nqo:eV,"nqo-gn":{englishName:"N'ko (Guinea)",nativeName:"ߒߞߏ (ߖߌ߬ߣߍ߬ ߞߊ߲ߓߍ߲)"},nr:tV,"nr-za":{englishName:"South Ndebele (South Africa)",nativeName:"isiNdebele (South Africa)"},nso:iV,"nso-za":{englishName:"Sesotho sa Leboa (South Africa)",nativeName:"Sesotho sa Leboa (Afrika Borwa)"},nus:rV,"nus-ss":{englishName:"Nuer (South Sudan)",nativeName:"Thok Nath (South Sudan)"},nyn:nV,"nyn-ug":{englishName:"Nyankole (Uganda)",nativeName:"Runyankore (Uganda)"},oc:sV,"oc-fr":{englishName:"Occitan (France)",nativeName:"Occitan (França)"},om:aV,"om-et":{englishName:"Oromo (Ethiopia)",nativeName:"Oromoo (Itoophiyaa)"},"om-ke":{englishName:"Oromo (Kenya)",nativeName:"Oromoo (Keeniyaa)"},or:oV,"or-in":{englishName:"Odia (India)",nativeName:"ଓଡ଼ିଆ (ଭାରତ)"},os:lV,"os-ge":{englishName:"Ossetian (Georgia)",nativeName:"Ирон æвзаг (Гуырдзыстон)"},"os-ru":{englishName:"Ossetian (Russia)",nativeName:"Ирон æвзаг (Уӕрӕсе)"},pa:uV,"pa-arab":{englishName:"Punjabi",nativeName:"پنجابی"},"pa-arab-pk":{englishName:"Punjabi (Pakistan)",nativeName:"پنجابی (پاکستان)"},"pa-in":{englishName:"Punjabi (India)",nativeName:"ਪੰਜਾਬੀ (ਭਾਰਤ)"},pap:cV,"pap-029":{englishName:"Papiamento (Caribbean)",nativeName:"Papiamentu (Caribbean)"},pl:hV,"pl-pl":{englishName:"Polish (Poland)",nativeName:"polski (Polska)"},prg:dV,"prg-001":{englishName:"Prussian (World)",nativeName:"prÅ«siskan (swÄ«tai)"},prs:fV,"prs-af":{englishName:"Dari (Afghanistan)",nativeName:"درى (افغانستان)"},ps:pV,"ps-af":{englishName:"Pashto (Afghanistan)",nativeName:"پښتو (افغانستان)"},pt:mV,"pt-ao":{englishName:"Portuguese (Angola)",nativeName:"português (Angola)"},"pt-br":{englishName:"Portuguese (Brazil)",nativeName:"português (Brasil)"},"pt-cv":{englishName:"Portuguese (Cabo Verde)",nativeName:"português (Cabo Verde)"},"pt-gw":{englishName:"Portuguese (Guinea-Bissau)",nativeName:"português (Guiné-Bissau)"},"pt-mo":{englishName:"Portuguese (Macao SAR)",nativeName:"português (RAE de Macau)"},"pt-mz":{englishName:"Portuguese (Mozambique)",nativeName:"português (Moçambique)"},"pt-pt":{englishName:"Portuguese (Portugal)",nativeName:"português (Portugal)"},"pt-st":{englishName:"Portuguese (São Tomé and Príncipe)",nativeName:"português (São Tomé e Príncipe)"},"pt-tl":{englishName:"Portuguese (Timor-Leste)",nativeName:"português (Timor-Leste)"},quc:gV,"quc-latn":{englishName:"K'iche'",nativeName:"K'iche'"},"quc-latn-gt":{englishName:"K'iche' (Guatemala)",nativeName:"K'iche' (Guatemala)"},quz:vV,"quz-bo":{englishName:"Quechua (Bolivia)",nativeName:"runasimi (Qullasuyu)"},"quz-ec":{englishName:"Quichua (Ecuador)",nativeName:"runa shimi (Ecuador Suyu)"},"quz-pe":{englishName:"Quechua (Peru)",nativeName:"runasimi (Peru)"},rm:yV,"rm-ch":{englishName:"Romansh (Switzerland)",nativeName:"rumantsch (Svizra)"},rn:_V,"rn-bi":{englishName:"Rundi (Burundi)",nativeName:"Ikirundi (Uburundi)"},ro:TV,"ro-md":{englishName:"Romanian (Moldova)",nativeName:"română (Republica Moldova)"},"ro-ro":{englishName:"Romanian (Romania)",nativeName:"română (România)"},rof:bV,"rof-tz":{englishName:"Rombo (Tanzania)",nativeName:"Kihorombo (Tanzania)"},ru:SV,"ru-by":{englishName:"Russian (Belarus)",nativeName:"русский (Беларусь)"},"ru-kg":{englishName:"Russian (Kyrgyzstan)",nativeName:"русский (Киргизия)"},"ru-kz":{englishName:"Russian (Kazakhstan)",nativeName:"русский (Казахстан)"},"ru-md":{englishName:"Russian (Moldova)",nativeName:"русский (Молдова)"},"ru-ru":{englishName:"Russian (Russia)",nativeName:"русский (� оссия)"},"ru-ua":{englishName:"Russian (Ukraine)",nativeName:"русский (Украина)"},rw:xV,"rw-rw":{englishName:"Kinyarwanda (Rwanda)",nativeName:"Kinyarwanda (Rwanda)"},rwk:CV,"rwk-tz":{englishName:"Rwa (Tanzania)",nativeName:"Kiruwa (Tanzania)"},sa:EV,"sa-in":{englishName:"Sanskrit (India)",nativeName:"संस्कृत (भारतम्)"},sah:wV,"sah-ru":{englishName:"Sakha (Russia)",nativeName:"Саха (� оссия)"},saq:kV,"saq-ke":{englishName:"Samburu (Kenya)",nativeName:"Kisampur (Kenya)"},sbp:AV,"sbp-tz":{englishName:"Sangu (Tanzania)",nativeName:"Ishisangu (Tansaniya)"},sd:IV,"sd-arab":{englishName:"Sindhi",nativeName:"سنڌي"},"sd-arab-pk":{englishName:"Sindhi (Pakistan)",nativeName:"سنڌي (پاکستان)"},"sd-deva":{englishName:"Sindhi (Devanagari)",nativeName:"सिन्धी"},"sd-deva-in":{englishName:"Sindhi (Devanagari, India)",nativeName:"सिन्धी (India)"},se:PV,"se-fi":{englishName:"Sami, Northern (Finland)",nativeName:"davvisámegiella (Suopma)"},"se-no":{englishName:"Sami, Northern (Norway)",nativeName:"davvisámegiella (Norga)"},"se-se":{englishName:"Sami, Northern (Sweden)",nativeName:"davvisámegiella (Ruoŧŧa)"},seh:DV,"seh-mz":{englishName:"Sena (Mozambique)",nativeName:"sena (Moçambique)"},ses:NV,"ses-ml":{englishName:"Koyraboro Senni (Mali)",nativeName:"Koyraboro senni (Maali)"},sg:LV,"sg-cf":{englishName:"Sango (Central African Republic)",nativeName:"Sängö (Ködörösêse tî Bêafrîka)"},shi:OV,"shi-latn":{englishName:"Tachelhit (Latin)",nativeName:"Tashelḥiyt"},"shi-latn-ma":{englishName:"Tachelhit (Latin, Morocco)",nativeName:"Tashelḥiyt (lmÉ£rib)"},"shi-tfng":{englishName:"Tachelhit (Tifinagh)",nativeName:"ⵜⴰⵛⵍⵃⵉⵜ"},"shi-tfng-ma":{englishName:"Tachelhit (Tifinagh, Morocco)",nativeName:"ⵜⴰⵛⵍⵃⵉⵜ (ⵍⵎⵖⵔⵉⴱ)"},si:MV,"si-lk":{englishName:"Sinhala (Sri Lanka)",nativeName:"සිංහල (ශ්‍රී ලංකාව)"},sk:RV,"sk-sk":{englishName:"Slovak (Slovakia)",nativeName:"slovenčina (Slovensko)"},sl:FV,"sl-si":{englishName:"Slovenian (Slovenia)",nativeName:"slovenščina (Slovenija)"},sma:BV,"sma-no":{englishName:"Sami, Southern (Norway)",nativeName:"Ã¥arjelsaemiengïele (Nöörje)"},"sma-se":{englishName:"Sami, Southern (Sweden)",nativeName:"Ã¥arjelsaemiengïele (Sveerje)"},smj:UV,"smj-no":{englishName:"Sami, Lule (Norway)",nativeName:"julevusámegiella (Vuodna)"},"smj-se":{englishName:"Sami, Lule (Sweden)",nativeName:"julevusámegiella (Svierik)"},smn:$V,"smn-fi":{englishName:"Sami, Inari (Finland)",nativeName:"anarâškielâ (Suomâ)"},sms:jV,"sms-fi":{englishName:"Sami, Skolt (Finland)",nativeName:"sää´mÇ©iõll (Lää´ddjânnam)"},sn:qV,"sn-latn":{englishName:"Shona (Latin)",nativeName:"chiShona (Latin)"},"sn-latn-zw":{englishName:"Shona (Latin, Zimbabwe)",nativeName:"chiShona (Zimbabwe)"},so:VV,"so-dj":{englishName:"Somali (Djibouti)",nativeName:"Soomaali (Jabuuti)"},"so-et":{englishName:"Somali (Ethiopia)",nativeName:"Soomaali (Itoobiya)"},"so-ke":{englishName:"Somali (Kenya)",nativeName:"Soomaali (Kiiniya)"},"so-so":{englishName:"Somali (Somalia)",nativeName:"Soomaali (Soomaaliya)"},sq:HV,"sq-al":{englishName:"Albanian (Albania)",nativeName:"shqip (Shqipëri)"},"sq-mk":{englishName:"Albanian (Macedonia, FYRO)",nativeName:"shqip (Republika e Maqedonisë)"},"sq-xk":{englishName:"Albanian (Kosovo)",nativeName:"shqip (Kosovë)"},sr:zV,"sr-cyrl":{englishName:"Serbian (Cyrillic)",nativeName:"српски"},"sr-cyrl-ba":{englishName:"Serbian (Cyrillic, Bosnia and Herzegovina)",nativeName:"српски (Босна и Херцеговина)"},"sr-cyrl-me":{englishName:"Serbian (Cyrillic, Montenegro)",nativeName:"српски (Црна Гора)"},"sr-cyrl-rs":{englishName:"Serbian (Cyrillic, Serbia)",nativeName:"српски (Србија)"},"sr-cyrl-xk":{englishName:"Serbian (Cyrillic, Kosovo)",nativeName:"српски (Косово)"},"sr-latn":{englishName:"Serbian (Latin)",nativeName:"srpski"},"sr-latn-ba":{englishName:"Serbian (Latin, Bosnia and Herzegovina)",nativeName:"srpski (Bosna i Hercegovina)"},"sr-latn-me":{englishName:"Serbian (Latin, Montenegro)",nativeName:"srpski (Crna Gora)"},"sr-latn-rs":{englishName:"Serbian (Latin, Serbia)",nativeName:"srpski (Srbija)"},"sr-latn-xk":{englishName:"Serbian (Latin, Kosovo)",nativeName:"srpski (Kosovo)"},ss:WV,"ss-sz":{englishName:"siSwati (Swaziland)",nativeName:"siSwati (Swaziland)"},"ss-za":{englishName:"siSwati (South Africa)",nativeName:"siSwati (South Africa)"},ssy:GV,"ssy-er":{englishName:"Saho (Eritrea)",nativeName:"Saho (Eretria)"},st:KV,"st-ls":{englishName:"Sesotho (Lesotho)",nativeName:"Sesotho (Lesotho)"},"st-za":{englishName:"Sesotho (South Africa)",nativeName:"Sesotho (South Africa)"},sv:XV,"sv-ax":{englishName:"Swedish (Ã…land Islands)",nativeName:"svenska (Ã…land)"},"sv-fi":{englishName:"Swedish (Finland)",nativeName:"svenska (Finland)"},"sv-se":{englishName:"Swedish (Sweden)",nativeName:"svenska (Sverige)"},sw:QV,"sw-cd":{englishName:"Kiswahili (Congo DRC)",nativeName:"Kiswahili (Jamhuri ya Kidemokrasia ya Kongo)"},"sw-ke":{englishName:"Kiswahili (Kenya)",nativeName:"Kiswahili (Kenya)"},"sw-tz":{englishName:"Kiswahili (Tanzania)",nativeName:"Kiswahili (Tanzania)"},"sw-ug":{englishName:"Kiswahili (Uganda)",nativeName:"Kiswahili (Uganda)"},syr:YV,"syr-sy":{englishName:"Syriac (Syria)",nativeName:"ܣܘܪܝܝܐ (ܣܘܪܝܐ)"},ta:JV,"ta-in":{englishName:"Tamil (India)",nativeName:"தமிழ் (இந்தியா)"},"ta-lk":{englishName:"Tamil (Sri Lanka)",nativeName:"தமிழ் (இலங்கை)"},"ta-my":{englishName:"Tamil (Malaysia)",nativeName:"தமிழ் (மலேசியா)"},"ta-sg":{englishName:"Tamil (Singapore)",nativeName:"தமிழ் (சிங்கப்பூர்)"},te:ZV,"te-in":{englishName:"Telugu (India)",nativeName:"తెలుగు (భారత దేశం)"},teo:eH,"teo-ke":{englishName:"Teso (Kenya)",nativeName:"Kiteso (Kenia)"},"teo-ug":{englishName:"Teso (Uganda)",nativeName:"Kiteso (Uganda)"},tg:tH,"tg-cyrl":{englishName:"Tajik (Cyrillic)",nativeName:"Тоҷикӣ"},"tg-cyrl-tj":{englishName:"Tajik (Cyrillic, Tajikistan)",nativeName:"Тоҷикӣ (Тоҷикистон)"},th:iH,"th-th":{englishName:"Thai (Thailand)",nativeName:"ไทย (ไทย)"},ti:rH,"ti-er":{englishName:"Tigrinya (Eritrea)",nativeName:"ትግርኛ (ኤርትራ)"},"ti-et":{englishName:"Tigrinya (Ethiopia)",nativeName:"ትግርኛ (ኢትዮጵያ)"},tig:nH,"tig-er":{englishName:"Tigre (Eritrea)",nativeName:"ትግረ (ኤርትራ)"},tk:sH,"tk-tm":{englishName:"Turkmen (Turkmenistan)",nativeName:"Türkmen dili (Türkmenistan)"},tn:aH,"tn-bw":{englishName:"Setswana (Botswana)",nativeName:"Setswana (Botswana)"},"tn-za":{englishName:"Setswana (South Africa)",nativeName:"Setswana (Aforika Borwa)"},to:oH,"to-to":{englishName:"Tongan (Tonga)",nativeName:"lea fakatonga (Tonga)"},tr:lH,"tr-cy":{englishName:"Turkish (Cyprus)",nativeName:"Türkçe (Kıbrıs)"},"tr-tr":{englishName:"Turkish (Turkey)",nativeName:"Türkçe (Türkiye)"},ts:uH,"ts-za":{englishName:"Xitsonga (South Africa)",nativeName:"Xitsonga (South Africa)"},tt:cH,"tt-ru":{englishName:"Tatar (Russia)",nativeName:"Татар (� оссия)"},twq:hH,"twq-ne":{englishName:"Tasawaq (Niger)",nativeName:"Tasawaq senni (Nižer)"},tzm:dH,"tzm-arab":{englishName:"Central Atlas Tamazight (Arabic)",nativeName:"أطلس المركزية التامازيتية"},"tzm-arab-ma":{englishName:"Central Atlas Tamazight (Arabic, Morocco)",nativeName:"أطلس المركزية التامازيتية (Morocco)"},"tzm-latn":{englishName:"Central Atlas Tamazight (Latin)",nativeName:"TamaziÉ£t n laá¹­laá¹£"},"tzm-latn-dz":{englishName:"Central Atlas Tamazight (Latin, Algeria)",nativeName:"TamaziÉ£t n laá¹­laá¹£ (Djazaïr)"},"tzm-latn-ma":{englishName:"Central Atlas Tamazight (Latin, Morocco)",nativeName:"TamaziÉ£t n laá¹­laá¹£ (Meṛṛuk)"},"tzm-tfng":{englishName:"Central Atlas Tamazight (Tifinagh)",nativeName:"ⵜⴰⵎⴰⵣⵉⵖⵜ"},"tzm-tfng-ma":{englishName:"Central Atlas Tamazight (Tifinagh, Morocco)",nativeName:"ⵜⴰⵎⴰⵣⵉⵖⵜ (ⵍⵎⵖⵔⵉⴱ)"},ug:fH,"ug-cn":{englishName:"Uyghur (China)",nativeName:"ئۇيغۇرچە (جۇڭخۇا خەلق جۇمھۇرىيىتى)"},uk:pH,"uk-ua":{englishName:"Ukrainian (Ukraine)",nativeName:"українська (Україна)"},ur:mH,"ur-in":{englishName:"Urdu (India)",nativeName:"اردو (بھارت)"},"ur-pk":{englishName:"Urdu (Pakistan)",nativeName:"اُردو (پاکستان)"},uz:gH,"uz-arab":{englishName:"Uzbek (Perso-Arabic)",nativeName:"اوزبیک"},"uz-arab-af":{englishName:"Uzbek (Perso-Arabic, Afghanistan)",nativeName:"اوزبیک (افغانستان)"},"uz-cyrl":{englishName:"Uzbek (Cyrillic)",nativeName:"Ўзбек"},"uz-cyrl-uz":{englishName:"Uzbek (Cyrillic, Uzbekistan)",nativeName:"Ўзбек (Ўзбекистон)"},"uz-latn":{englishName:"Uzbek (Latin)",nativeName:"o‘zbek"},"uz-latn-uz":{englishName:"Uzbek (Latin, Uzbekistan)",nativeName:"o‘zbek (OÊ»zbekiston)"},vai:vH,"vai-latn":{englishName:"Vai (Latin)",nativeName:"Vai"},"vai-latn-lr":{englishName:"Vai (Latin, Liberia)",nativeName:"Vai (Laibhiya)"},"vai-vaii":{englishName:"Vai (Vai)",nativeName:"ꕙꔤ"},"vai-vaii-lr":{englishName:"Vai (Vai, Liberia)",nativeName:"ꕙꔤ (ꕞꔤꔫꕩ)"},ve:yH,"ve-za":{englishName:"Venda (South Africa)",nativeName:"Tshivenḓa (South Africa)"},vi:_H,"vi-vn":{englishName:"Vietnamese (Vietnam)",nativeName:"Tiếng Việt (Việt Nam)"},vo:TH,"vo-001":{englishName:"Volapük (World)",nativeName:"Volapük (World)"},vun:bH,"vun-tz":{englishName:"Vunjo (Tanzania)",nativeName:"Kyivunjo (Tanzania)"},wae:SH,"wae-ch":{englishName:"Walser (Switzerland)",nativeName:"Walser (Schwiz)"},wal:xH,"wal-et":{englishName:"Wolaytta (Ethiopia)",nativeName:"ወላይታቱ (ኢትዮጵያ)"},wo:CH,"wo-sn":{englishName:"Wolof (Senegal)",nativeName:"Wolof (Senegaal)"},xh:EH,"xh-za":{englishName:"isiXhosa (South Africa)",nativeName:"isiXhosa (eMzantsi Afrika)"},xog:wH,"xog-ug":{englishName:"Soga (Uganda)",nativeName:"Olusoga (Yuganda)"},yav:kH,"yav-cm":{englishName:"Yangben (Cameroon)",nativeName:"nuasue (Kemelún)"},yi:AH,"yi-001":{englishName:"Yiddish (World)",nativeName:"ייִדיש (וועלט)"},yo:IH,"yo-bj":{englishName:"Yoruba (Benin)",nativeName:"Èdè Yorùbá (Orílɛ́ède Bɛ̀nɛ̀)"},"yo-ng":{englishName:"Yoruba (Nigeria)",nativeName:"Èdè Yorùbá (Orílẹ́ède N� ìjírí� )"},zgh:PH,"zgh-tfng":{englishName:"Standard Moroccan Tamazight (Tifinagh)",nativeName:"ⵜⴰⵎⴰⵣⵉⵖⵜ"},"zgh-tfng-ma":{englishName:"Standard Moroccan Tamazight (Tifinagh, Morocco)",nativeName:"ⵜⴰⵎⴰⵣⵉⵖⵜ (ⵍⵎⵖⵔⵉⴱ)"},zh:DH,"zh-cn":{englishName:"Chinese (Simplified, China)",nativeName:"中文(中国)"},"zh-hans":{englishName:"Chinese (Simplified)",nativeName:"中文(简体)"},"zh-hans-hk":{englishName:"Chinese (Simplified Han, Hong Kong SAR)",nativeName:"中文 (香港特别行政区)"},"zh-hans-mo":{englishName:"Chinese (Simplified Han, Macao SAR)",nativeName:"中文 (澳门特别行政区)"},"zh-hant":{englishName:"Chinese (Traditional)",nativeName:"中文(繁體)"},"zh-hk":{englishName:"Chinese (Traditional, Hong Kong SAR)",nativeName:"中文(香港特別行政區)"},"zh-mo":{englishName:"Chinese (Traditional, Macao SAR)",nativeName:"中文(澳門特別行政區)"},"zh-sg":{englishName:"Chinese (Simplified, Singapore)",nativeName:"中文(新�� 坡)"},"zh-tw":{englishName:"Chinese (Traditional, Taiwan)",nativeName:"中文(台灣)"},zu:NH,"zu-za":{englishName:"isiZulu (South Africa)",nativeName:"isiZulu (i-South Africa)"},"zh-chs":{englishName:"Chinese (Simplified) Legacy",nativeName:"中文(简体) 旧版"},"zh-cht":{englishName:"Chinese (Traditional) Legacy",nativeName:"中文(繁體) 舊版"}};function Lh(s){return Av[s.toLowerCase()]}function MC(s){const e=s.indexOf("-");if(e===-1)return Lh(s);const t=s.substring(0,e);return Lh(t)}function LH(s){const e={},t=s.toLowerCase();for(const i in Av){const r=Av[i];r.englishName.toLowerCase().indexOf(t)>-1&&(e[i]=r)}return e}const Iv={getEnglishName(s){var e;return(e=MC(s))==null?void 0:e.englishName},getNativeName(s){var e;return(e=MC(s))==null?void 0:e.nativeName},getFullEnglishName(s){var e;return(e=Lh(s))==null?void 0:e.englishName},getFullNativeName(s){var e;return(e=Lh(s))==null?void 0:e.nativeName},getEnglishNameContains(s){return LH(s)},VERSION:"1.2.0"},OH="shared.shared-utils",MH={getEnglishName(s,e){var n;const t=s.language,i=e==null?void 0:e.filter(a=>a.language!==t);let r;return i.length>0?r=Iv.getFullEnglishName(t):r=Iv.getEnglishName(t),(n=s.metadata)!=null&&n.autoGenerated?su.getPhrase(OH,"autoGeneratedSubtitle",{name:r}):r}},RH={ALLOWED_TAGS:["i","b","u","ruby","rt"]},RC="en-US",FH="English",BH="subtitles",pg=new Map,Bc={getLanguagesOptions:s=>{if(!s)return[];const e=s.filter(t=>!t.customer);return e.map(t=>({label:MH.getEnglishName(t,e),value:t.language,id:t.id})).sort((t,i)=>{const r=t.value.includes(ru)?1:0;return(i.value.includes(ru)?1:0)-r})},transformVtt:s=>{if(!s)return[];const e=[],t=new ho.WebVTT.Parser(window,ho.WebVTT.StringDecoder()),i=[];return t.oncue=function(r){i.push(r)},t.onparsingerror=function(r){e.push(r)},t.parse(s),t.flush(),e.length>0&&PP.throw(new DP(`Failed to parse vtt, ${e.map(r=>r.message)}`)),i},createTextTrackList:(s,e)=>{const t=document.createElement("video"),i=t.addTextTrack(BH,e?Iv.getEnglishName(e):FH,e||RC);return s.forEach(r=>{i.addCue(r)}),t.textTracks},attachCuesToPlayer:(s,e,t)=>{var n;if(!e)return;const i=(n=s==null?void 0:s.addTranscript)==null?void 0:n.call(s,t||RC),r=Bc.transformVtt(e);return r==null||r.forEach(a=>{i==null||i.addCue(a)}),i},transformVttToTextTrackList:(s,e,t)=>{const i=`${t}-${e}`;if(pg.has(i))return pg.get(i);if(!s)return null;const r=Bc.transformVtt(s),n=Bc.createTextTrackList(r,e);return pg.set(i,n),n},sanitizeCueText:s=>IP.sanitize(s,RH)},FC="transcript-selected-language",ru="en";function BC(s){var e,t;return((e=s.find(i=>i.language.includes(ru)))==null?void 0:e.language)||((t=s[0])==null?void 0:t.language)}function ja(s,e,t){let i=t.initialDeps??[],r;return()=>{var n,a,o,l;let u;t.key&&((n=t.debug)!=null&&n.call(t))&&(u=Date.now());const c=s();if(!(c.length!==i.length||c.some((g,y)=>i[y]!==g)))return r;i=c;let d;if(t.key&&((a=t.debug)!=null&&a.call(t))&&(d=Date.now()),r=e(...c),t.key&&((o=t.debug)!=null&&o.call(t))){const g=Math.round((Date.now()-u)*100)/100,y=Math.round((Date.now()-d)*100)/100,p=y/16,_=(k,A)=>{for(k=String(k);k.length<A;)k=" "+k;return k};console.info(`%c⏱ ${_(y,5)} /${_(g,5)} ms`,`
310
- font-size: .6rem;
311
- font-weight: bold;
312
- color: hsl(${Math.max(0,Math.min(120-120*p,120))}deg 100% 31%);`,t==null?void 0:t.key)}return(l=t==null?void 0:t.onChange)==null||l.call(t,r),r}}function mg(s,e){if(s===void 0)throw new Error("Unexpected undefined");return s}const UH=(s,e)=>Math.abs(s-e)<1,$H=(s,e,t)=>{let i;return function(...r){s.clearTimeout(i),i=s.setTimeout(()=>e.apply(this,r),t)}},jH=s=>s,qH=s=>{const e=Math.max(s.startIndex-s.overscan,0),t=Math.min(s.endIndex+s.overscan,s.count-1),i=[];for(let r=e;r<=t;r++)i.push(r);return i},VH=(s,e)=>{const t=s.scrollElement;if(!t)return;const i=s.targetWindow;if(!i)return;const r=a=>{const{width:o,height:l}=a;e({width:Math.round(o),height:Math.round(l)})};if(r(t.getBoundingClientRect()),!i.ResizeObserver)return()=>{};const n=new i.ResizeObserver(a=>{const o=()=>{const l=a[0];if(l!=null&&l.borderBoxSize){const u=l.borderBoxSize[0];if(u){r({width:u.inlineSize,height:u.blockSize});return}}r(t.getBoundingClientRect())};s.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(o):o()});return n.observe(t,{box:"border-box"}),()=>{n.unobserve(t)}},UC={passive:!0},$C=typeof window>"u"?!0:"onscrollend"in window,HH=(s,e)=>{const t=s.scrollElement;if(!t)return;const i=s.targetWindow;if(!i)return;let r=0;const n=s.options.useScrollendEvent&&$C?()=>{}:$H(i,()=>{e(r,!1)},s.options.isScrollingResetDelay),a=c=>()=>{const{horizontal:h,isRtl:d}=s.options;r=h?t.scrollLeft*(d&&-1||1):t.scrollTop,n(),e(r,c)},o=a(!0),l=a(!1);l(),t.addEventListener("scroll",o,UC);const u=s.options.useScrollendEvent&&$C;return u&&t.addEventListener("scrollend",l,UC),()=>{t.removeEventListener("scroll",o),u&&t.removeEventListener("scrollend",l)}},zH=(s,e,t)=>{if(e!=null&&e.borderBoxSize){const i=e.borderBoxSize[0];if(i)return Math.round(i[t.options.horizontal?"inlineSize":"blockSize"])}return Math.round(s.getBoundingClientRect()[t.options.horizontal?"width":"height"])},WH=(s,{adjustments:e=0,behavior:t},i)=>{var r,n;const a=s+e;(n=(r=i.scrollElement)==null?void 0:r.scrollTo)==null||n.call(r,{[i.options.horizontal?"left":"top"]:a,behavior:t})};class GH{constructor(e){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.scrollToIndexTimeoutId=null,this.measurementsCache=[],this.itemSizeCache=new Map,this.pendingMeasuredCacheIndexes=[],this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this.scrollAdjustments=0,this.elementsCache=new Map,this.observer=(()=>{let t=null;const i=()=>t||(!this.targetWindow||!this.targetWindow.ResizeObserver?null:t=new this.targetWindow.ResizeObserver(r=>{r.forEach(n=>{const a=()=>{this._measureElement(n.target,n)};this.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(a):a()})}));return{disconnect:()=>{var r;(r=i())==null||r.disconnect(),t=null},observe:r=>{var n;return(n=i())==null?void 0:n.observe(r,{box:"border-box"})},unobserve:r=>{var n;return(n=i())==null?void 0:n.unobserve(r)}}})(),this.range=null,this.setOptions=t=>{Object.entries(t).forEach(([i,r])=>{typeof r>"u"&&delete t[i]}),this.options={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:jH,rangeExtractor:qH,onChange:()=>{},measureElement:zH,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:"data-index",initialMeasurementsCache:[],lanes:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,useScrollendEvent:!0,useAnimationFrameWithResizeObserver:!1,...t}},this.notify=t=>{var i,r;(r=(i=this.options).onChange)==null||r.call(i,this,t)},this.maybeNotify=ja(()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]),t=>{this.notify(t)},{key:!1,debug:()=>this.options.debug,initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=()=>{this.unsubs.filter(Boolean).forEach(t=>t()),this.unsubs=[],this.observer.disconnect(),this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{var t;const i=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==i){if(this.cleanup(),!i){this.maybeNotify();return}this.scrollElement=i,this.scrollElement&&"ownerDocument"in this.scrollElement?this.targetWindow=this.scrollElement.ownerDocument.defaultView:this.targetWindow=((t=this.scrollElement)==null?void 0:t.window)??null,this.elementsCache.forEach(r=>{this.observer.observe(r)}),this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0}),this.unsubs.push(this.options.observeElementRect(this,r=>{this.scrollRect=r,this.maybeNotify()})),this.unsubs.push(this.options.observeElementOffset(this,(r,n)=>{this.scrollAdjustments=0,this.scrollDirection=n?this.getScrollOffset()<r?"forward":"backward":null,this.scrollOffset=r,this.isScrolling=n,this.maybeNotify()}))}},this.getSize=()=>this.options.enabled?(this.scrollRect=this.scrollRect??this.options.initialRect,this.scrollRect[this.options.horizontal?"width":"height"]):(this.scrollRect=null,0),this.getScrollOffset=()=>this.options.enabled?(this.scrollOffset=this.scrollOffset??(typeof this.options.initialOffset=="function"?this.options.initialOffset():this.options.initialOffset),this.scrollOffset):(this.scrollOffset=null,0),this.getFurthestMeasurement=(t,i)=>{const r=new Map,n=new Map;for(let a=i-1;a>=0;a--){const o=t[a];if(r.has(o.lane))continue;const l=n.get(o.lane);if(l==null||o.end>l.end?n.set(o.lane,o):o.end<l.end&&r.set(o.lane,!0),r.size===this.options.lanes)break}return n.size===this.options.lanes?Array.from(n.values()).sort((a,o)=>a.end===o.end?a.index-o.index:a.end-o.end)[0]:void 0},this.getMeasurementOptions=ja(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled],(t,i,r,n,a)=>(this.pendingMeasuredCacheIndexes=[],{count:t,paddingStart:i,scrollMargin:r,getItemKey:n,enabled:a}),{key:!1}),this.getMeasurements=ja(()=>[this.getMeasurementOptions(),this.itemSizeCache],({count:t,paddingStart:i,scrollMargin:r,getItemKey:n,enabled:a},o)=>{if(!a)return this.measurementsCache=[],this.itemSizeCache.clear(),[];this.measurementsCache.length===0&&(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(c=>{this.itemSizeCache.set(c.key,c.size)}));const l=this.pendingMeasuredCacheIndexes.length>0?Math.min(...this.pendingMeasuredCacheIndexes):0;this.pendingMeasuredCacheIndexes=[];const u=this.measurementsCache.slice(0,l);for(let c=l;c<t;c++){const h=n(c),d=this.options.lanes===1?u[c-1]:this.getFurthestMeasurement(u,c),g=d?d.end+this.options.gap:i+r,y=o.get(h),p=typeof y=="number"?y:this.options.estimateSize(c),_=g+p,k=d?d.lane:c%this.options.lanes;u[c]={index:c,start:g,size:p,end:_,key:h,lane:k}}return this.measurementsCache=u,u},{key:!1,debug:()=>this.options.debug}),this.calculateRange=ja(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(t,i,r,n)=>this.range=t.length>0&&i>0?KH({measurements:t,outerSize:i,scrollOffset:r,lanes:n}):null,{key:!1,debug:()=>this.options.debug}),this.getVirtualIndexes=ja(()=>{let t=null,i=null;const r=this.calculateRange();return r&&(t=r.startIndex,i=r.endIndex),[this.options.rangeExtractor,this.options.overscan,this.options.count,t,i]},(t,i,r,n,a)=>n===null||a===null?[]:t({startIndex:n,endIndex:a,overscan:i,count:r}),{key:!1,debug:()=>this.options.debug}),this.indexFromElement=t=>{const i=this.options.indexAttribute,r=t.getAttribute(i);return r?parseInt(r,10):(console.warn(`Missing attribute name '${i}={index}' on measured element.`),-1)},this._measureElement=(t,i)=>{const r=this.indexFromElement(t),n=this.measurementsCache[r];if(!n)return;const a=n.key,o=this.elementsCache.get(a);o!==t&&(o&&this.observer.unobserve(o),this.observer.observe(t),this.elementsCache.set(a,t)),t.isConnected&&this.resizeItem(r,this.options.measureElement(t,i,this))},this.resizeItem=(t,i)=>{const r=this.measurementsCache[t];if(!r)return;const n=this.itemSizeCache.get(r.key)??r.size,a=i-n;a!==0&&((this.shouldAdjustScrollPositionOnItemSizeChange!==void 0?this.shouldAdjustScrollPositionOnItemSizeChange(r,a,this):r.start<this.getScrollOffset()+this.scrollAdjustments)&&this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=a,behavior:void 0}),this.pendingMeasuredCacheIndexes.push(r.index),this.itemSizeCache=new Map(this.itemSizeCache.set(r.key,i)),this.notify(!1))},this.measureElement=t=>{if(!t){this.elementsCache.forEach((i,r)=>{i.isConnected||(this.observer.unobserve(i),this.elementsCache.delete(r))});return}this._measureElement(t,void 0)},this.getVirtualItems=ja(()=>[this.getVirtualIndexes(),this.getMeasurements()],(t,i)=>{const r=[];for(let n=0,a=t.length;n<a;n++){const o=t[n],l=i[o];r.push(l)}return r},{key:!1,debug:()=>this.options.debug}),this.getVirtualItemForOffset=t=>{const i=this.getMeasurements();if(i.length!==0)return mg(i[PI(0,i.length-1,r=>mg(i[r]).start,t)])},this.getOffsetForAlignment=(t,i,r=0)=>{const n=this.getSize(),a=this.getScrollOffset();i==="auto"&&(i=t>=a+n?"end":"start"),i==="center"?t+=(r-n)/2:i==="end"&&(t-=n);const o=this.options.horizontal?"scrollWidth":"scrollHeight",u=(this.scrollElement?"document"in this.scrollElement?this.scrollElement.document.documentElement[o]:this.scrollElement[o]:0)-n;return Math.max(Math.min(u,t),0)},this.getOffsetForIndex=(t,i="auto")=>{t=Math.max(0,Math.min(t,this.options.count-1));const r=this.measurementsCache[t];if(!r)return;const n=this.getSize(),a=this.getScrollOffset();if(i==="auto")if(r.end>=a+n-this.options.scrollPaddingEnd)i="end";else if(r.start<=a+this.options.scrollPaddingStart)i="start";else return[a,i];const o=i==="end"?r.end+this.options.scrollPaddingEnd:r.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(o,i,r.size),i]},this.isDynamicMode=()=>this.elementsCache.size>0,this.cancelScrollToIndex=()=>{this.scrollToIndexTimeoutId!==null&&this.targetWindow&&(this.targetWindow.clearTimeout(this.scrollToIndexTimeoutId),this.scrollToIndexTimeoutId=null)},this.scrollToOffset=(t,{align:i="start",behavior:r}={})=>{this.cancelScrollToIndex(),r==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),this._scrollToOffset(this.getOffsetForAlignment(t,i),{adjustments:void 0,behavior:r})},this.scrollToIndex=(t,{align:i="auto",behavior:r}={})=>{t=Math.max(0,Math.min(t,this.options.count-1)),this.cancelScrollToIndex(),r==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size.");const n=this.getOffsetForIndex(t,i);if(!n)return;const[a,o]=n;this._scrollToOffset(a,{adjustments:void 0,behavior:r}),r!=="smooth"&&this.isDynamicMode()&&this.targetWindow&&(this.scrollToIndexTimeoutId=this.targetWindow.setTimeout(()=>{if(this.scrollToIndexTimeoutId=null,this.elementsCache.has(this.options.getItemKey(t))){const[u]=mg(this.getOffsetForIndex(t,o));UH(u,this.getScrollOffset())||this.scrollToIndex(t,{align:o,behavior:r})}else this.scrollToIndex(t,{align:o,behavior:r})}))},this.scrollBy=(t,{behavior:i}={})=>{this.cancelScrollToIndex(),i==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),this._scrollToOffset(this.getScrollOffset()+t,{adjustments:void 0,behavior:i})},this.getTotalSize=()=>{var t;const i=this.getMeasurements();let r;return i.length===0?r=this.options.paddingStart:r=this.options.lanes===1?((t=i[i.length-1])==null?void 0:t.end)??0:Math.max(...i.slice(-this.options.lanes).map(n=>n.end)),Math.max(r-this.options.scrollMargin+this.options.paddingEnd,0)},this._scrollToOffset=(t,{adjustments:i,behavior:r})=>{this.options.scrollToFn(t,{behavior:r,adjustments:i},this)},this.measure=()=>{this.itemSizeCache=new Map,this.notify(!1)},this.setOptions(e)}}const PI=(s,e,t,i)=>{for(;s<=e;){const r=(s+e)/2|0,n=t(r);if(n<i)s=r+1;else if(n>i)e=r-1;else return r}return s>0?s-1:0};function KH({measurements:s,outerSize:e,scrollOffset:t,lanes:i}){const r=s.length-1;let a=PI(0,r,l=>s[l].start,t),o=a;for(;o<r&&s[o].end<t+e;)o++;return i>1&&(a=Math.max(0,a-a%i),o=Math.min(r,o+(i-1-o%i))),{startIndex:a,endIndex:o}}const jC=typeof document<"u"?Ks.useLayoutEffect:Ks.useEffect;function XH(s){const e=Ks.useReducer(()=>({}),{})[1],t={...s,onChange:(r,n)=>{var a;n?NP.flushSync(e):e(),(a=s.onChange)==null||a.call(s,r,n)}},[i]=Ks.useState(()=>new GH(t));return i.setOptions(t),jC(()=>i._didMount(),[]),jC(()=>i._willUpdate()),i}function QH(s){return XH({observeElementRect:VH,observeElementOffset:HH,scrollToFn:WH,...s})}function YH(s){function e(i){const r=Array.from((i==null?void 0:i.activeCues)||[]);if(!r.length)return;const n=s.cuesToDisplay.findIndex(a=>a.startTime===LP.last(r).startTime);if(n===-1){s.setCurrentCueIndex(null);return}s.setCurrentCueIndex(n)}Pt.useEffect(()=>{s.hasStarted&&e(s.currentTranscriptTrack)},[s.hasStarted]);function t(){e(s.currentTranscriptTrack)}Pt.useEffect(()=>(s.currentTranscriptTrack&&s.currentTranscriptTrack.addEventListener("cuechange",t),()=>{var i;return(i=s.currentTranscriptTrack)==null?void 0:i.removeEventListener("cuechange",t)}),[s.currentTranscriptTrack])}function JH(s,e,t){function i(r){t&&t.scrollToIndex(r,{align:"start"})}return Pt.useEffect(()=>{!e||typeof s!="number"||i(s)},[s,e,t]),i}const qC=/\n/g;function ZH({cuesToDisplay:s,resetHighlightedCues:e,setHighlightedCues:t,scrollToCue:i}){const[r,n]=Pt.useState(""),[a,o]=Pt.useState(null),[l,u]=Pt.useState(0),[,c]=Pt.useTransition();function h(p){n(p),l!==0&&u(0),c(()=>{d(p)})}function d(p){if(!p.length){o(null),e();return}const _=new RegExp(p.replace(qC," "),"gi"),k=[];let A=0;const N=s.map(($,R)=>{const L=$.text,F=L.replace(qC," ").matchAll(_);if(F.length===0)return Object.assign($,{nodes:[{text:L,searchResultIndex:null}]});const B=[];let C=0;return F.forEach((I,G)=>{const H=I[0],K=I.index;K>C&&B.push({text:L.substring(C,K),searchResultIndex:null}),B.push({text:H,searchResultIndex:A}),A++,k.push({cueIndex:R,cueMatchIndex:G}),C=K+H.length}),C<L.length&&B.push({text:L.substring(C),searchResultIndex:null}),Object.assign($,{nodes:B})});o(k),t(N),k.length&&i(k[0].cueIndex)}function g(p){const _=a[p];_&&(u(p),i(_.cueIndex))}function y(){o(null),n(""),u(0),e()}return{isSearching:a!==null,searchQuery:r,onSearch:h,jumpToSearchResult:g,totalSearchResults:a==null?void 0:a.length,currentSearchResultIndex:l,resetSearchResults:y}}function ez(s){return ue.jsx("svg",{...s,children:ue.jsx("path",{fill:"currentColor",d:"M4 5.5A1.5 1.5 0 0 1 5.5 4h9A1.5 1.5 0 0 1 16 5.5v1a.5.5 0 0 1-1 0v-1a.5.5 0 0 0-.5-.5h-9a.5.5 0 0 0-.5.5V15a.5.5 0 0 0 .5.5h1a.5.5 0 0 1 0 1h-1A1.5 1.5 0 0 1 4 15zM7.5 9A1.5 1.5 0 0 1 9 7.5h9.5A1.5 1.5 0 0 1 20 9v9.5a1.5 1.5 0 0 1-1.5 1.5H9a1.5 1.5 0 0 1-1.5-1.5zM9 8.5a.5.5 0 0 0-.5.5v9.5a.5.5 0 0 0 .5.5h9.5a.5.5 0 0 0 .5-.5V9a.5.5 0 0 0-.5-.5z"})})}const tz="_hide_i94hz_1",iz="_show_i94hz_4",VC={hide:tz,show:iz},rz="shared.copyContentIconButton",HC=su.encloseNamespace(rz);function nz(s){const[e,t]=Pt.useState(!1);return Pt.useEffect(()=>{if(!e)return;const i=window.setTimeout(()=>{t(!1)},1e3);return()=>window.clearTimeout(i)},[e]),ue.jsx(Ov,{title:HC(e?"copied":"copy"),spanHack:!0,spanHackClassName:s.tooltipClassName||"",children:ue.jsx(Ja,{"aria-label":"Copy to clipboard",className:s.visible?VC.show:VC.hide,onClick:i=>{i.stopPropagation(),navigator.clipboard.writeText(s.copyableContent).then(()=>{var r;t(!0),(r=s.onClick)==null||r.call(s)})},children:ue.jsx(An,{svg:ez,size:Cg.Small})})})}const sz="_timePoint_1jw83_1",az="_wide_1jw83_6",oz="_item_1jw83_9",lz="_inPlayer_1jw83_9",qa={timePoint:sz,wide:az,item:oz,inPlayer:lz};function uz(s){const e=s.currentTimePoint===s.timePoint,[t,i]=x1();return ue.jsxs("div",{...s.isAuthenticated&&{role:"button"},className:`d-flex p-2 align-items-center cursor-pointer rounded text-dark ${s.inPlayer?qa.inPlayer:""} ${s.isAuthenticated?"cursor-pointer":""} ${qa.item} ${e?"bg-gray-100":""}`,id:s.timePoint.toString(),onClick:()=>{s.onClick(),as.logUserAction({...s.analyticsData,cueIndex:s.cueIndex},{...s.analyticsOptions,descriptor:OP.TranscriptTimepoint,actionType:fi.Click})},ref:t,children:[ue.jsx("div",{className:"d-flex flex-column align-items-center",children:ue.jsx("div",{className:`bg-light-blue text-info rounded-pill d-inline py-1 text-center ${qa.timePoint} ${s.wideTimeTag?qa.wide:""} ${e?"bg-white":""}`,children:nD.ToDisplayDuration(s.timePoint*1e3)})}),ue.jsx("div",{className:`${qa.transcript} ms-3 w-100`,children:s.nodes.map((r,n)=>{const a=Bc.sanitizeCueText(r.text);return r.searchResultIndex===null?ue.jsx("span",{dangerouslySetInnerHTML:{__html:a}},n):ue.jsx("mark",{className:`${qa.mark} ${r.searchResultIndex===s.currentSearchResultIndex?"bg-orange":"bg-yellow"}`,dangerouslySetInnerHTML:{__html:a}},n)})}),ue.jsx(nz,{copyableContent:s.transcript,visible:i,onClick:()=>{as.logUserAction({...s.analyticsData,cueIndex:s.cueIndex},{...s.analyticsOptions,actionType:fi.Copy})}})]})}function cz(s){var i;const e=s.cuesToDisplay.some(r=>r.startTime>=3600),t=new Map;return s.chapters.forEach((r,n)=>{const a=s.cuesToDisplay.findIndex(o=>o.startTime>r.startTime);t.set(a,n)}),ue.jsx("div",{className:"w-100 position-relative",style:{height:s.virtualizer.getTotalSize()},children:ue.jsx("div",{className:"w-100 position-absolute top-0 start-0",style:{transform:`translateY(${((i=s.items[0])==null?void 0:i.start)??0}px)`},children:s.items.map(r=>{var u;const n=r.index,a=s.cuesToDisplay[n];let o=!1,l="";return t.has(n)&&(o=!0,l=s.chapters[t.get(n)].name),ue.jsxs("div",{className:s.inPlayer?"":"px-3",ref:s.virtualizer.measureElement,"data-index":n,children:[o&&ue.jsx("h3",{className:`${t.get(n)!==0?"mt-2":""} my-2 h6 ${s.inPlayer?"px-2":""}`,children:ue.jsxs("span",{children:[t.get(n)+1,". ",l]})}),ue.jsx(uz,{timePoint:a.startTime,transcript:a.text,nodes:a.nodes,onClick:()=>s.onClickTranscriptionItem(a),currentTimePoint:(u=s.timepoint)==null?void 0:u.startTime,currentSearchResultIndex:s.currentSearchResultIndex,wideTimeTag:!!e,inPlayer:s.inPlayer,analyticsOptions:s.analyticsOptions,analyticsData:s.analyticsData,cueIndex:n,isAuthenticated:s.isAuthenticated})]},a.startTime)})})})}function hz(s){return ue.jsx("svg",{...s,children:ue.jsx("path",{d:"m12.733 8.305 5.963 5.906a1.046 1.046 0 0 1 0 1.473l-.01.011a1.034 1.034 0 0 1-1.467 0L12 10.526l-5.22 5.17a1.034 1.034 0 0 1-1.465 0l-.011-.012a1.046 1.046 0 0 1 0-1.473l5.963-5.906a1.034 1.034 0 0 1 1.466 0",fill:"currentColor"})})}const dz="_inputWithoutHighlight_1bbmu_1",fz="_inputFocus_1bbmu_5",pz="_inputBlur_1bbmu_9",mz="_cursor_1bbmu_13",Tc={inputWithoutHighlight:dz,inputFocus:fz,inputBlur:pz,cursor:mz},gz="playPage.transcriptSearchBar",bc=su.encloseNamespace(gz);function vz(s){const e=Pt.useRef(null),[t,i]=Pt.useState(!1);function r(y){as.logUserAction({...s.analyticsData,query:y},{...s.analyticsOptions,actionType:fi.Search,descriptor:y?Ju.SearchTranscript:Ju.ResetResults})}const n=Pt.useCallback(MP.debounce(y=>r(y),500),[]);function a(){as.logUserAction({...s.analyticsData,query:s.query},{...s.analyticsOptions,actionType:fi.Search,descriptor:Ju.NextResult}),s.currentSearchResultIndex===s.totalSearchResults-1?s.jumpToSearchResult(0):s.jumpToSearchResult(s.currentSearchResultIndex+1)}function o(){as.logUserAction({...s.analyticsData,query:s.query},{...s.analyticsOptions,actionType:fi.Search,descriptor:Ju.PreviousResult}),s.currentSearchResultIndex===0?s.jumpToSearchResult(s.totalSearchResults-1):s.jumpToSearchResult(s.currentSearchResultIndex-1)}function l(y){n(y.target.value),s.onSearch(y.target.value)}function u(y){var p;y.keepFocus||(p=e.current)==null||p.focus(),a()}function c(y){var p;y.keepFocus||(p=e.current)==null||p.focus(),o()}function h(){var y;r(""),(y=e.current)==null||y.focus(),s.onSearch("")}function d(y){y.key==="Enter"&&(y.preventDefault(),y.shiftKey?o():a())}function g(y){if(y==="focus"){i(!0);return}i(!1)}return ue.jsxs("div",{className:JP("form-control py-0 px-1 d-flex align-items-center",t?Tc.inputFocus:Tc.inputBlur,Tc.cursor),onClick:()=>{var y;return(y=e.current)==null?void 0:y.focus()},role:"search",children:[ue.jsx("div",{"aria-hidden":"true",children:ue.jsx(An,{svg:ZP})}),ue.jsx("input",{className:`form-control border-0 px-1 ${Tc.inputWithoutHighlight}`,value:s.query,onChange:l,autoComplete:"off",placeholder:bc("searchPlaceholder"),ref:e,onKeyDown:d,onFocus:()=>g("focus"),onBlur:()=>g("blur")}),!!s.query&&ue.jsxs("div",{className:"d-flex align-items-center",children:[ue.jsx("div",{children:s.totalSearchResults?`${s.currentSearchResultIndex+1}/${s.totalSearchResults}`:"0/0"}),ue.jsx(Ja,{"aria-label":bc("previousResult"),onClick:()=>c({keepFocus:!1}),onKeyDown:y=>{(y.key==="Enter"||y.key===" ")&&c({keepFocus:!0})},children:ue.jsx(An,{svg:hz})}),ue.jsx(Ja,{"aria-label":bc("nextResult"),onClick:()=>u({keepFocus:!1}),onKeyDown:y=>{(y.key==="Enter"||y.key===" ")&&u({keepFocus:!0})},children:ue.jsx(An,{svg:eD})}),ue.jsx(Ja,{"aria-label":bc("clearSearch"),onClick:h,children:ue.jsx(An,{svg:Mv})})]})]})}function DI(s){return ue.jsx("svg",{...s,children:ue.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M12 20a8 8 0 1 0 0-16 8 8 0 0 0 0 16m0-15a7 7 0 1 1 0 14 7 7 0 0 1 0-14m.5 4a.5.5 0 0 0-1 0v5.293l-2.146-2.147a.5.5 0 0 0-.708.708l3 3a.5.5 0 0 0 .708 0l3-3a.5.5 0 0 0-.708-.708L12.5 14.293z",clipRule:"evenodd"})})}function yz(s){return ue.jsx("svg",{...s,children:ue.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M20 12a8 8 0 1 1-16 0 8 8 0 0 1 16 0M5.493 14.585a7 7 0 0 0 9.244 3.86l-.59-.591c-.008-.008-.062-.05-.232-.068a2.7 2.7 0 0 0-.603.023c-.205.025-.41.062-.61.098l-.083.015c-.203.036-.44.078-.619.078a.72.72 0 0 1-.544-.261 1.2 1.2 0 0 1-.215-.39 4 4 0 0 1-.175-.856C11 15.903 11 15.256 11 15.005V15c0-.209.088-.397.245-.528a.9.9 0 0 1 .394-.18c.2-.042.45-.042.644-.042h.03c.226 0 .422-.001.59-.026.176-.026.233-.067.243-.078.187-.187.282-.37.407-.62l.006-.013c.124-.248.28-.559.587-.867a1.14 1.14 0 0 1 .667-.345 1.15 1.15 0 0 1 .66.127c.325.162.624.462.851.689l.023.023c.043-.01.103-.033.24-.088l.04-.016c.352-.141.9-.331 1.597.017.267.133.459.326.594.54a7.003 7.003 0 0 0-5.136-8.389.4.4 0 0 0-.026.108c.006.01.021.033.073.084q.022.022.059.057c.103.097.278.26.41.457.182.274.302.622.302 1.09 0 .357-.081.667-.264.925-.18.253-.423.405-.652.51-.191.09-.409.16-.605.223l-.09.03c-.23.075-.45.152-.665.26l-.066.035.04.102.016.042c.063.158.17.426.144.749q-.039.51-.504.978c-.573.572-1.07.771-1.604.771-.215 0-.426-.033-.605-.06l-.05-.008a4 4 0 0 0-.567-.057c-.023.096-.028.249-.028.5v.036c0 .221 0 .543-.088.81a.96.96 0 0 1-.316.463A.95.95 0 0 1 8 13.5c-.384 0-.7-.146-.956-.323a5 5 0 0 1-.633-.56l-.015-.013a4 4 0 0 0-.509-.458.74.74 0 0 0-.325-.142l-.012.03q-.08.204-.1.673c-.012.3 0 .63.015.948l.011.215c.012.233.024.458.024.63a1 1 0 0 1-.007.085M12 5a7 7 0 0 0-6.945 6.118A.85.85 0 0 1 5.5 11c.384 0 .7.146.956.323.241.167.456.382.633.56l.015.013c.194.195.35.348.509.458a.7.7 0 0 0 .359.145C7.995 12.403 8 12.25 8 12v-.036c0-.221 0-.543.088-.81a.96.96 0 0 1 .316-.463A.95.95 0 0 1 9 10.5c.291 0 .542.037.748.068l.03.005c.2.03.338.052.472.052.215 0 .469-.051.896-.479.188-.188.211-.3.215-.35.005-.068-.013-.143-.075-.298l-.012-.03c-.026-.063-.061-.15-.087-.235a1 1 0 0 1-.043-.409c.044-.378.319-.614.632-.771.285-.143.565-.238.803-.316l.097-.032a5 5 0 0 0 .49-.177c.146-.068.215-.127.255-.182.035-.05.079-.144.079-.346 0-.282-.068-.434-.135-.535a1.2 1.2 0 0 0-.207-.23q-.059-.054-.136-.131c-.153-.153-.366-.4-.366-.792q0-.137.035-.278A7 7 0 0 0 12 5m3.651 12.944.018.018a7.04 7.04 0 0 0 2.34-2.369.5.5 0 0 1 .044-.317l.007-.018.016-.053q.019-.067.033-.17c.019-.136.024-.296.007-.454-.038-.335-.16-.544-.34-.634-.303-.152-.505-.092-.778.017l-.023.01-.025.01c-.125.051-.319.13-.509.153a.93.93 0 0 1-.795-.283c-.27-.27-.458-.451-.62-.532a.3.3 0 0 0-.07-.027q-.02-.003-.019-.002h-.003l-.012.006a.3.3 0 0 0-.068.055c-.187.187-.282.37-.407.62l-.006.013c-.124.248-.28.559-.587.867-.24.239-.558.323-.804.36-.248.036-.513.036-.722.036h-.015q-.195-.001-.312.004c.003.3.014.733.058 1.128.029.254.067.461.113.6q.105-.015.271-.044l.081-.015c.197-.035.43-.077.664-.107.264-.033.559-.054.834-.024.268.029.59.112.832.354l.795.796zm-1.098-9.293c.23-.46.53-.776.91-.873a.93.93 0 0 1 .82.18c.19.1.445.259.668.45.124.107.252.236.353.384.099.145.196.345.196.583 0 .267-.123.521-.239.709a3.3 3.3 0 0 1-.47.582 3.3 3.3 0 0 1-.582.47c-.188.116-.442.239-.709.239-.065 0-.157.017-.337.05l-.027.004c-.172.032-.399.071-.636.071a1.6 1.6 0 0 1-.786-.186 1.6 1.6 0 0 1-.661-.715c-.15-.3-.251-.688-.007-1.03a.96.96 0 0 1 .349-.29c.108-.055.226-.096.322-.128l.057-.02c.404-.134.646-.214.779-.48m1.13.114c-.043.034-.129.12-.236.334-.329.658-.975.862-1.322.971q-.051.015-.092.03l-.095.033.01.018c.085.171.174.246.245.285a.63.63 0 0 0 .307.064c.138 0 .286-.023.457-.054l.052-.01a3 3 0 0 1 .491-.061q-.006 0 .001-.002c.016-.004.075-.022.181-.087.125-.077.267-.192.402-.327s.25-.277.327-.402a.8.8 0 0 0 .085-.172l-.019-.03a1 1 0 0 0-.178-.188 2.8 2.8 0 0 0-.523-.345l-.072-.036z",clipRule:"evenodd"})})}const _z="shared.playPageTranscription";su.encloseNamespace(_z);function Tz(s){return s.map(e=>Object.assign(e,{nodes:[{text:e.text,searchResultIndex:null}]}))}const bz="_languageSelect_1ws0w_1",zC={languageSelect:bz};function Sz(s){var n,a;const e=(n=s.languageOptions[0])==null?void 0:n.label,t=s.track.src,i=sD();async function r(){as.logUserAction(s.analyticsData,{...s.analyticsOptions,actionType:fi.Download});try{await aD.downloadBlob(t,`Subtitles-${s.selectedLanguage}.vtt`)}catch{i.error("Error downloading transcript")}}return ue.jsxs("div",{className:"d-flex px-1 mb-3",children:[ue.jsx(vz,{query:s.searchQuery,currentSearchResultIndex:s.currentSearchResultIndex,onSearch:s.onSearch,totalSearchResults:s.totalSearchResults,jumpToSearchResult:s.jumpToSearchResult,analyticsData:s.analyticsData,analyticsOptions:s.analyticsOptions}),ue.jsx(Ov,{spanHack:!0,title:s.languageOptions.length>1?"":`Only available in ${e}`,children:ue.jsxs(Zu,{children:[ue.jsx(Zu.Toggle,{className:`text-dark ${zC.languageSelect}`,id:"language-select",disabled:((a=s.languageOptions)==null?void 0:a.length)<=1,variant:"outline-dark",children:ue.jsx(An,{svg:yz})}),ue.jsx(Zu.Menu,{className:zC.menu,"aria-labelledby":"language-select",children:s.languageOptions.map((o,l)=>ue.jsx(Zu.Item,{onClick:()=>{var u;(u=s.onChangeLanguage)==null||u.call(s,o.value),as.logUserAction({...s.analyticsData,language:o.value,previousLanguageName:s.selectedLanguage},{...s.analyticsOptions,actionType:fi.Select})},className:"cursor-pointer",active:o.value===s.selectedLanguage,children:o.label},l))})]})}),ue.jsx(_1,{svg:DI,onClick:r,className:"position-relative d-flex align-items-center text-dark"})]})}const xz=U.getComponent("Component");class Cz extends xz{constructor(e,t){super(e,t)}dispose(){setImmediate(()=>{var e;(e=this.root)==null||e.unmount()}),super.dispose()}}const Ez={tagName:"div"};function Ed(s,e=Ez){if(!s)throw new Error("componentCtor is required");class t extends Cz{createEl(){const r=U.dom.createEl(e.tagName,e.properties,e.attributes),n=RP.createRoot(r);return n.render(s(this.player_,this.options_)),this.root=n,r}}return t}function wz(s){const e=ht.get(FC)||BC(s.allTracks);function t(){return s.allTracks.find(oe=>oe.language===e)||s.allTracks.find(oe=>oe.language===BC(s.allTracks))}const[i,r]=Pt.useState(()=>t()),[n,a]=Pt.useState(e),[o,l]=Pt.useState(-1),[u,c]=Pt.useState(!0),[h,d]=Pt.useState([]),g=Pt.useMemo(()=>Array.from((i==null?void 0:i.cues)||[]),[n]),y={videoId:s.playbackObject.videoId,videoName:s.playbackObject.title,language:n},p={location:Ll.Player,entity:Ai.Transcript},_=s.player.hasStarted();YH({currentTranscriptTrack:i,cuesToDisplay:g,setCurrentCueIndex:l,hasStarted:_});const k=Pt.useRef(),A=QH({count:h.length,getScrollElement:()=>{var oe;return(oe=k.current)==null?void 0:oe.view},estimateSize:()=>40,enabled:h.length>0}),N=A.getVirtualItems(),$=JH(o,u,A),{isSearching:R,searchQuery:L,totalSearchResults:F,jumpToSearchResult:B,onSearch:C,currentSearchResultIndex:I,resetSearchResults:G}=ZH({cuesToDisplay:g,resetHighlightedCues:he,setHighlightedCues:d,scrollToCue:$}),H=s.player.paused(),[K,ie]=x1();Pt.useEffect(()=>{c(!ie&&!R&&_&&!H)},[ie,R,_,H]);function he(){d(Tz(g))}Pt.useEffect(()=>{he()},[g]);function fe(){s.toggleTranscript(!1)}function re(oe){r(s.allTracks.find(de=>de.language===oe)),a(oe),ht.set(FC,oe),G()}function ne(oe){var de;(de=s.setStartTime)==null||de.call(s,oe.startTime)}return!i||!g.length?ue.jsx(ue.Fragment,{}):ue.jsxs("div",{ref:K,className:`cv-transcript py-3 px-2 ${s.showTranscript?"cv-open":""}`,children:[ue.jsxs("div",{className:"text-dark d-flex justify-content-between px-1",children:[ue.jsx("h3",{children:"Transcript"}),ue.jsx(_1,{svg:Mv,onClick:fe,ariaLabel:"Close transcript"})]}),ue.jsx(Sz,{selectedLanguage:n,languageOptions:s.languageOptions,onChangeLanguage:re,track:i,onSearch:C,searchQuery:L,currentSearchResultIndex:I,totalSearchResults:F,jumpToSearchResult:B,analyticsData:y,analyticsOptions:p}),ue.jsx("div",{className:"cv-transcript-list-wrapper text-dark",children:ue.jsx(WP,{ref:k,children:ue.jsx(cz,{timepoint:g[o],onClickTranscriptionItem:ne,cuesToDisplay:h,chapters:s.chapters,currentSearchResultIndex:I,inPlayer:!0,virtualizer:A,items:N,analyticsOptions:p,analyticsData:y,isAuthenticated:!1})})})]})}U.registerComponent("Transcript",Ed((s,e)=>ue.jsx(wz,{player:s,...e})));const kz=U.getPlugin("plugin"),Iy=992;class Az extends kz{constructor(e){super(e),this.allClickViewTracks=[],this.player=e,this.bindListeners(),e.ready(()=>this.initialize())}bindListeners(){this.onResize=this.onResize.bind(this),Qt.useMetadataTracks(this.player,"transcript",()=>this.player.trigger("resizemenus")),this.player.on("playerresize",this.onResize)}dispose(){this.player.off("playerresize",this.onResize),super.dispose()}initialize(){Qt.useSubtitles(this.player,this.onTrackLoaded.bind(this)),Qt.useChapters(this.player,this.onChaptersLoaded.bind(this))}onChaptersLoaded(e){this.chapterTrack=e}onTrackLoaded(e){const t=e.isClickViewProduced;!this.allClickViewTracks.find(i=>i.language===e.language)&&t&&this.allClickViewTracks.push(e),this.languageOptions=this.buildOptions(this.allClickViewTracks)}buildOptions(e){return e.map(t=>({label:t.label,value:t.language})).sort((t,i)=>{const r=t.value.includes(ru)?1:0;return(i.value.includes(ru)?1:0)-r})}buildComponentProps(e,t,i){var n;const r=Array.from(((n=this.chapterTrack)==null?void 0:n.cues)||[]).map(a=>({endTimeStamp:a.endTime,startTime:a.startTime,name:a.text}));return{showTranscript:e,languageOptions:this.languageOptions,toggleTranscript:a=>t(a,{shouldLog:!0}),allTracks:this.allClickViewTracks,setStartTime:i,chapters:r,playbackObject:this.playbackObject}}addChildren(e){if(this.component)return this.component.show(),this.component;const t=this.toggleTranscript.bind(this),i=this.setStartTime.bind(this),r=this.buildComponentProps(e,t,i);this.component=this.player.addChild("Transcript",r)}toggleTranscript(e,t){var r,n,a;const i=e!==void 0?e:!this.showTranscript;this.showTranscript=i,i?((r=this.player.theatreModePlugin())==null||r.toggleTheatreMode(!0,{shouldLog:!1}),this.addChildren(!0),this.player.addClass("cv-transcript-plugin")):((n=this.component)==null||n.hide(),this.player.removeClass("cv-transcript-plugin")),this.player.whiteboardModePlugin&&this.player.whiteboardModePlugin().setEnabled(!i),this.player.trigger("cv-transcript-toggle",i),this.player.trigger("resizemenus"),this.player.trigger("playerresize"),t!=null&&t.shouldLog&&((a=this.analyticsService)==null||a.logUserAction({videoId:this.playbackObject.videoId,videoName:this.playbackObject.title},{actionType:fi.Click,descriptor:i?aa.ShowTranscript:aa.HideTranscript,entity:Ai.Transcript}))}setStartTime(e){this.player.currentTime(e)}isTranscriptOn(){return!!this.showTranscript}onResize(){if(window.innerWidth<Iy){this.player.addClass("hide-transcript");return}this.showTranscript&&this.player.removeClass("hide-transcript")}registerAnalytics(e,t){this.analyticsService=e,this.playbackObject=t}}U.registerPlugin("viewTranscriptPlugin",Az);const WC=U.getComponent("SubsCapsMenuItem");class Iz extends WC{handleClick(e){WC.prototype.handleClick.call(this,e);const t=this.player_.textTracks();for(let i=0;i<t.length;i++){const r=t[i];r.kind==="subtitles"&&r.mode==="disabled"&&(r.mode="hidden")}this.player_.trigger("cv:languageselected")}}const Pz=U.getComponent("TextTrackMenuItem");class Dz extends Pz{constructor(e){const t={};t.track={player:e,kind:"subtitle",label:"Search Captions",selectable:!1,default:!1,mode:"disabled"},t.selectable=!1,t.name="SubtitleSearchMenuItem",super(e,t),this.addClass("vjs-texttrack-settings"),this.addClass("cv-subtitle-search-menu-item"),this.controlText(", opens subtitle search"),this.toggleEnabled=this.toggleEnabled.bind(this);const i=this.player_.textTracks();i.addEventListener("selectedlanguagechange",this.toggleEnabled),this.player_.one("dispose",()=>{i.removeEventListener("selectedlanguagechange",this.toggleEnabled)}),this.toggleEnabled()}toggleEnabled(){var t;if(!this.player_)return;const e=Qt.getCurrentTextTrack(this.player_);if(!e){this.addClass("vjs-disabled");return}(t=e.cues)!=null&&t.length?this.removeClass("vjs-disabled"):(this.bindTrackEvents(e),this.addClass("vjs-disabled"))}bindTrackEvents(e){e.removeEventListener("loadeddata",this.toggleEnabled),e.addEventListener("loadeddata",this.toggleEnabled),this.player_.one("dispose",()=>{e.removeEventListener("loadeddata",this.toggleEnabled)})}handleClick(){var t;const e=Qt.getCurrentTextTrack(this.player_);(t=e==null?void 0:e.cues)!=null&&t.length&&this.requestAnimationFrame(()=>{this.player_.getChild("collapserator").getChild("subtitleSearchButton").showCollapsibleMenu()})}}const Nz=U.getComponent("TextTrackMenuItem");class Lz extends Nz{constructor(e){const t={};t.track={player:e,kind:"subtitle",label:"Caption Text Size",selectable:!1,default:!1,mode:"disabled"},t.selectable=!1,t.name="SubtitleSizeMenuItem",super(e,t),this.addClass("vjs-texttrack-settings"),this.addClass("cv-divider-after-menu-item"),this.addClass("cv-subtitle-size-menu-item"),this.controlText(", opens subtitle size settings")}handleClick(){this.requestAnimationFrame(()=>{this.player_.getChild("collapserator").getChild("subtitleSizeButton").showCollapsibleMenu()})}}const Oz=U.getComponent("TextTrackMenuItem");class NI extends Oz{constructor(e){const t={};t.track={player:e,kind:"subtitle",label:"Video Transcript",selectable:!1,default:!1,mode:"disabled"},t.selectable=!1,t.name="TranscriptMenuItem",super(e,t),this.transcriptOn=this.player_.viewTranscriptPlugin&&this.player_.viewTranscriptPlugin().isTranscriptOn(),this.bindEventListeners()}bindEventListeners(){const e=this.toggleListener.bind(this),t=this.onResize.bind(this);this.player_.on("cv-transcript-toggle",e),this.player_.on("playerresize",t),this.on("dispose",()=>{this.player_.off("cv-transcript-toggle",e),this.player_.off("playerresize",t)})}onResize(){const e=window.innerWidth<Iy;this.item&&(this.item.style.display=e?"none":"block")}handleToggleListener(){this.transcriptOn?this.toggleOff():this.toggleOn()}toggleListener(e,t){var i,r;t?(this.transcriptOn=!0,U.dom.addClass(this.toggleEl,"on")):(this.transcriptOn=!1,(r=(i=U.dom).removeClass)==null||r.call(i,this.toggleEl,"on"))}toggleOn(){var e,t;this.transcriptOn=!0,U.dom.addClass(this.toggleEl,"on"),this.player_.viewTranscriptPlugin&&((t=(e=this.player_.viewTranscriptPlugin())==null?void 0:e.toggleTranscript)==null||t.call(e,!0,{shouldLog:!0})),this.player_.whiteboardModePlugin&&this.player_.whiteboardModePlugin().setEnabled(!1)}toggleOff(){var e,t,i,r;this.transcriptOn=!1,(t=(e=U.dom).removeClass)==null||t.call(e,this.toggleEl,"on"),this.player_.viewTranscriptPlugin&&((r=(i=this.player_.viewTranscriptPlugin())==null?void 0:i.toggleTranscript)==null||r.call(i,!1,{shouldLog:!0}))}createEl(e,t,i){this.handlerBound||(this.handleToggleListener=this.handleToggleListener.bind(this),this.handlerBound=!0),this.toggleEl&&this.toggleEl.removeEventListener("click",this.handleToggleListener),this.toggleEl=U.dom.createEl("div",{className:"custom-toggle custom-toggle-info toggle-option float-end",innerHTML:'<span class="handle"></span></div>'}),this.toggleEl.addEventListener("click",this.handleToggleListener);const r=`
313
- <span class="vjs-menu-item-text">Video Transcript</span>
314
- <span class="cv-toggle-container"></span>
315
- <span class="vjs-control-text" aria-live="polite">, opens transcript</span>
316
- `;return this.item=U.dom.createEl("li",{className:"vjs-menu-item cv-transcript-toggle",innerHTML:r,tabIndex:-1},i),this.item.children[1].appendChild(this.toggleEl),this.item}}U.registerComponent("ToggleTranscriptMenuItem",NI);const Mz=U.getComponent("TextTrackButton"),GC=U.getComponent("SubsCapsButton");class Rz extends GC{constructor(e,t){super(e,t),this.alwaysCollapsed=!1,this.isCollapsed=!1,this.isCollabsible=!0,this.className="cv-subs-caps-menu-button",this.onSelectedLanguageChange=this.onSelectedLanguageChange.bind(this),this.player_.on("cv:languageselected",this.onSelectedLanguageChange),this.player_.one("dispose",()=>this.player_.off("cv:languageselected",this.onSelectedLanguageChange))}buildWrapperCSSClass(){return`cv-menu-small cv-has-left-icons ${super.buildWrapperCSSClass()}`}createItems(){const e=[];if(!this.player_.options_.mobile){const t=this.player().textTracks(),i=Array.from(t||[]).some(n=>n.kind==="subtitles");this.player_.options_.allowTranscript&&!!i&&this.player_.viewTranscriptPlugin&&window.innerWidth>=Iy&&e.push(new NI(this.player_)),this.player_.options_.allowTranscript||e.push(new Dz(this.player_)),e.push(new Lz(this.player_)),this.hideThreshold_=this.hideThreshold_+2}return this.player().trigger("resizemenus"),Mz.prototype.createItems.call(this,e,Iz)}onSelectedLanguageChange(){const e=this.player_.textTracks();for(let t=0;t<e.length;t++)if(e[t].mode==="showing"){this.setActive(!0);return}this.setActive(!1)}getCollabsibleName(){return"Subtitles"}getCollabsibleValue(){const e=this.player_.textTracks();for(let t=0;t<e.length;t++){const i=e[t];if(this.kinds_.indexOf(i.kind)>-1&&i.mode==="showing")return i.label}return"Off"}showInCollabsibleMenu(){const e=this.player_.textTracks();for(let t=0;t<e.length;t++){const i=e[t];if(this.kinds_.indexOf(i.kind)>-1)return!0}return!1}showCollapsibleMenu(){GC.prototype.handleClick.apply(this)}}U.registerComponent("SubsCapsButton",Rz);const Fz=`<span class='vjs-local-cache-indicator-icon' title='Streaming from ClickView Local Cache'>${NA}</span>`,Bz=U.getComponent("MenuItem");class Uz extends Bz{constructor(e,t){super(e,t),this.qualityId=t.qualityId;const i=e.qualityLevels(),r=this.handleQualityChange.bind(this);i.on("change",r),e.one("dispose",()=>{i.off("change",r)}),this.handleLocalCacheChange=this.handleLocalCacheChange.bind(this),this.player_.ready(()=>{this.player_&&(this.player_.on("localcachechanged",this.handleLocalCacheChange),this.player_.one("dispose",()=>{var n;(n=this.player_)==null||n.off("localcachechanged",this.handleLocalCacheChange)}),this.handleLocalCacheChange())})}async handleLocalCacheChange(){const t=await this.player_.localCache().getActiveLocalCache();if(!(t!=null&&t.playbackProfile)){this.show(),this.enable(),this.setLabel(this.options_.label);return}t.playbackProfile!==this.qualityId?this.disable():this.setLabel(this.options_.label+Fz)}setLabel(e){const t=this.$(".vjs-menu-item-text");t&&(t.innerHTML=e)}buildCSSClass(){return"vjs-menu-item cv-quality-menu-item"}handleClick(){const e=this.player_.qualityLevels();for(let t=0;t<e.length;t++){const i=e[t];i.enabled=i.id===this.qualityId}}handleQualityChange(){if(!this.player_)return;const e=this.player_.qualityLevels(),t=e[e.selectedIndex],i=t&&t.id===this.qualityId;i!==this.isSelected_&&this.selected(i)}}const KC={144:"144p (Preview)",240:"240p",360:"360p",480:"480p",720:"720p",1080:"1080p"},XC=U.getComponent("MenuButton");class $z extends XC{constructor(e,t){super(e,t),this.alwaysCollapsed=!0,this.isCollapsed=!1,this.isCollabsible=!0,this.className="cv-quality-menu-button";const i=this.player_.qualityLevels(),r=this.update.bind(this);i.on("addqualitylevel",r),i.on("removequalitylevel",r),e.one("dispose",()=>{i.removeEventListener("addqualitylevel",r),i.removeEventListener("removequalitylevel",r)})}buildCSSClass(){return`cv-quality-button ${super.buildCSSClass()}`}buildWrapperCSSClass(){return`cv-menu-small vjs-quality-button cv-has-left-icons ${super.buildWrapperCSSClass()}`}createItems(){const e=[],t=this.player_.qualityLevels();e.push(new la(this.player_,{label:"Quality"}));for(let i=0;i<t.length;i++){const r=t[i];if(!r)continue;const n=KC[r.id];n&&e.push(new Uz(this.player_,{qualityId:r.id,label:n,selectable:!0,multiSelectable:!1}))}return e}getCollabsibleName(){return"Quality"}getCollabsibleValue(){const e=this.player_.qualityLevels(),t=e[e.selectedIndex];return t?KC[t.id]:""}showInCollabsibleMenu(){return!!this.player_.qualityLevels().length}showCollapsibleMenu(){XC.prototype.handleClick.apply(this)}}U.registerComponent("QualityButton",$z);const jz=U.getComponent("Menu"),QC=U.getComponent("MenuButton"),qz=U.getComponent("PlaybackRateMenuItem"),YC=U.getComponent("PlaybackRateMenuButton");class Vz extends YC{constructor(){super(...arguments),this.alwaysCollapsed=!0,this.isCollapsed=!1,this.isCollabsible=!0,this.className="cv-playback-rate-menu-button"}createEl(...e){return QC.prototype.createEl.apply(this,...e)}buildWrapperCSSClass(){return`cv-menu-small cv-has-left-icons ${super.buildWrapperCSSClass()}`}createMenu(){const e=new jz(this.player(),{menuButton:this});e.addItem(new la(this.player_,{label:"Playback speed"}));const t=this.playbackRates();if(t)for(let i=0;i<t.length;i++){let r=t[i]+"x";t[i]===1&&(r+=" (Normal)"),e.addItem(new qz(this.player(),{rate:r}))}return e}handleClick(...e){return QC.prototype.handleClick.apply(this,...e)}updateLabel(...e){return this.setupLabelEl(),YC.prototype.updateLabel.apply(this,...e)}setupLabelEl(){if(this.labelEl_)return;const e=this.$("button");e&&(this.labelEl_=U.dom.createEl("div",{className:"vjs-playback-rate-value",innerHTML:"1x"}),e.appendChild(this.labelEl_))}getCollabsibleName(){return"Playback speed"}getCollabsibleValue(){return this.player().playbackRate()+"x"}showInCollabsibleMenu(){return!!this.playbackRates()}showCollapsibleMenu(){this.handleClick(null)}}U.registerComponent("PlaybackRateMenuButton",Vz);const Hz=U.getComponent("TextTrackSettings"),Uc={backgroundColor:"#000",backgroundOpacity:"1",color:"#FFF",edgeStyle:void 0,fontFamily:"proportionalSansSerif",fontPercent:1,textOpacity:"1",windowColor:"#000",windowOpacity:"0"},JC={small:Uc,medium:{...Uc,fontPercent:1.5},large:{...Uc,fontPercent:2}};class zz extends Hz{setSizeSetting(e){this.size_=e,this.player_.getChild("textTrackDisplay").updateDisplay();const i=this.player_.getChild("collapserator").getChild("subtitleSizeButton");this.player_.trigger("changesubtitlesize",this.size_),window.requestAnimationFrame(()=>{i.update(),this.player_.trigger("resizemenus")})}getSizeSetting(){return this.size_||"small"}getValues(){return JC[this.size_]?JC[this.size_]:Uc}}U.registerComponent("TextTrackSettings",zz);const Wz="cv-video-wrapper",$c=U.getComponent("Player");class LI extends $c{constructor(e,t){super(e,t),this._dataLoaded=!1,t.mobile&&this.addClass("cv-mobile-player");const i=()=>this._dataLoaded=!0;this.on("cv-playback-data-loaded",i),this.on("dispose",()=>this.off("cv-playback-data-loaded",i))}dataLoaded(e){if(this._dataLoaded){e();return}this.one("cv-playback-data-loaded",e),this.one("dispose",()=>{this.off("cv-playback-data-loaded",e)})}lock(e){this.callback_=e}unlock(){delete this.callback_}currentTime(e,t){if(typeof e!="number"||!this.callback_||t)return super.currentTime(e);this.callback_(()=>{this.unlock(),this.currentTime(e)})}play(){if(!this.callback_)return super.play();this.callback_(()=>{this.unlock(),this.play()})}createEl(){const e=super.createEl();return this.videoContainer||(this.videoContainer=U.dom.createEl("div",{className:Wz}),e.appendChild(this.videoContainer)),Array.from(e.childNodes).forEach(t=>t!==this.videoContainer&&this.videoContainer.appendChild(t)),e}addChild(e,t={},i=this.children_.length){const r=super.addChild(e,t,i),n=r.el();return n&&this.videoContainer.appendChild(n),r}updateStyleEl_(){if($c.prototype.updateStyleEl_.call(this),!this.options_.fluid)return;const e=this.el_.parentNode;if(!e||!this.options_.setMaxHeight)return;let t=this.aspectRatio();if((t===void 0||t==="auto")&&(this.videoWidth()>0?t=this.videoWidth()+":"+this.videoHeight():t="16:9"),this.player_.playerModePlugin().getMode()===BA.Hover){e.style.removeProperty("maxWidth"),e.style.removeProperty("margin");return}const i=t.split(":"),r=+i[1]/+i[0];e.style.maxWidth=85*1/r+"vh",e.style.margin="0 auto"}listenForUserActivity_(){$c.prototype.listenForUserActivity_.call(this);const e=this.getChild("collapserator");e.on("mouseenter",()=>{this.player().cache_.inactivityTimeout=this.player().options_.inactivityTimeout,this.player().options_.inactivityTimeout=0}),e.on("mouseleave",()=>{this.player().options_.inactivityTimeout=this.player().cache_.inactivityTimeout})}}LI.prototype.options_={...$c.prototype.options_,setMaxHeight:!0};U.registerComponent("player",LI);const Gz=U.getComponent("Component");class Kz extends Gz{constructor(e,t){super(e,t),this.player_.addClass("cv-disable-play-pause-feedback"),this.onFirstPlay=this.onFirstPlay.bind(this),this.player_.one("play",this.onFirstPlay)}dispose(){this.player_.off("play",this.onFirstPlay)}onFirstPlay(){window.setTimeout(()=>{this.player_.isDisposed()||this.player_.removeClass("cv-disable-play-pause-feedback")},500)}createEl(){return U.dom.createEl("div",{className:"cv-play-pause-feedback"})}}U.registerComponent("PlayPauseFeedback",Kz);const Sc=U.getComponent("PlayToggle"),OI="Play (space)",Xz="Pause (space)";let MI=class extends Sc{handlePlay(){Sc.prototype.handlePlay.call(this),this.controlText(Xz)}handlePause(){Sc.prototype.handlePause.call(this),this.controlText(OI)}handleClick(e){Sc.prototype.handleClick.call(this,e),this.player_.addClass("cv-disable-play-pause-feedback"),this.timeoutId&&window.clearTimeout(this.timeoutId),this.timeoutId=window.setTimeout(()=>{this.player_.removeClass("cv-disable-play-pause-feedback")},500)}};U.registerComponent("PlayToggle",MI);MI.prototype.controlText_=OI;const ZC=U.getComponent("TextTrackDisplay"),Qz=.025;class Yz extends ZC{constructor(e,t){super(e,t),this.bindListeners()}bindListeners(){this.onResize=this.onResize.bind(this),this.player_.on("resize",this.onResize)}onResize(){this.updateDisplay()}updateDisplayState(e){ZC.prototype.updateDisplayState.call(this,e);const t=this.player_.textTrackSettings.getValues(),i=e.activeCues;let r=i.length;for(;r--;){const n=i[r];if(!n)continue;const a=n.displayState;if(t.fontPercent&&t.fontPercent!==1){const l=this.el().getBoundingClientRect().width*Qz*100/100;a.style.fontSize=l*t.fontPercent+"px"}}}}U.registerComponent("TextTrackDisplay",Yz);const Jz=U.getComponent("Component");class Zz extends Jz{createEl(){return U.dom.createEl("div",{className:"cv-control-bar-gradient-container",innerHTML:'<div class="cv-control-bar-gradient"></div>'})}}U.registerComponent("ControlBarGradient",Zz);const eW=U.getComponent("Component");class tW extends eW{constructor(e,t){super(e,t),this.options_=t}createEl(){let e=this.options_.title;if(!this.options_.seriesName)return super.createEl("h1",{innerHTML:e});const t=this.buildSeasonEpisodeString();return t?(e=`<div class='cv-splash-series'>${this.options_.seriesName.toUpperCase()} ${t}</div>`+e,super.createEl("h1",{innerHTML:e})):(e=`<div class='cv-splash-series'>${this.options_.seriesName.toUpperCase()}</div>`+e,super.createEl("h1",{innerHTML:e}))}buildSeasonEpisodeString(){if(!this.options_.seasonNumber||!this.options_.episodeNumber)return"";const e=this.padNumber(this.options_.seasonNumber,2),t=this.padNumber(this.options_.episodeNumber,2);return`S${e} • E${t}`}padNumber(e,t){let i=e.toString();if(i.length>=t)return i;for(t=t-i.length;t>0;)i="0"+i,t--;return i}}function iW(s){return s?(t=>{switch(!0){case t<32:return"cv-rating-purple";case t<48:return"cv-rating-green";case t<80:return"cv-rating-blue";case t<96:return"cv-rating-red";case t<128:return"cv-rating-pink";case t>=128:return"cv-rating-yellow";default:return""}})(s):""}const rW=U.getComponent("Component");class nW extends rW{constructor(e,t){super(e,t),this.options_=t}buildCSSClass(){return`cv-splash-rating ${iW(this.options_.ratingValue)}`}createEl(e,t,i){return this.options_.ratingCode?super.createEl(e,{...t,className:this.buildCSSClass(),innerHTML:this.options_.ratingCode},i):null}}const sW=U.getComponent("Component");class aW extends sW{constructor(e,t){if(super(e,t),!t.embed)return this;this.addChild(new tW(e,t)),this.addChild(new nW(e,t))}createEl(){return U.dom.createEl("div",{className:"cv-splash-metadata"})}}const oW=U.getComponent("posterImage");class lW extends oW{constructor(e,t){super(e,t),this.addChild(new aW(e,t))}createEl(){let e="<div class='cv-splash-mask'></div>";return this.options_.embed&&(e+=`<div class='cv-splash-logo'>${IA}</div>`),U.dom.createEl("div",{className:"vjs-poster cv-embed-splash cv-embed-splash-black",tabIndex:-1,innerHTML:e})}setSrc(e){let t="";e&&(t=`url("${e}")`),this.el_.style.backgroundImage=t}}U.registerComponent("posterImage",lW);const uW=U.getComponent("ErrorDisplay");class cW extends uW{constructor(e,t){super(e,t),this.el().prepend(this.getErrorImage())}getErrorImage(){return U.dom.createEl("div",{className:"cv-error-image",innerHTML:`
317
- <svg viewBox="0 0 301 185" xmlns="http://www.w3.org/2000/svg">
318
- <path d="M267.393 36.6514V167.906C267.393 168.182 267.169 168.406 266.893 168.406H32C31.7239 168.406 31.5 168.182 31.5 167.906V36.6514C31.5 36.3752 31.7239 36.1514 32 36.1514H80.5C80.7761 36.1514 81 36.3752 81 36.6514V57.7196C81 58.7622 82.0375 59.4868 83.0164 59.1279L95.7377 54.4634C95.9961 54.3687 96.2825 54.5006 96.3785 54.7585L102.094 70.1194C102.677 71.6866 105 71.2685 105 69.5964V48.4925C105 47.7632 104.475 47.1396 103.757 47.0146L94.2479 45.3609C93.9436 45.308 93.7596 44.9946 93.8616 44.7031L96.7376 36.4862C96.8077 36.2856 96.997 36.1514 97.2095 36.1514H266.893C267.169 36.1514 267.393 36.3752 267.393 36.6514Z" stroke="white"/>
319
- <path d="M163.296 101.777L149.437 90.1217C148.275 89.1441 146.5 89.9705 146.5 91.4894V113.664C146.5 115.141 148.191 115.98 149.367 115.087L163.226 104.569C164.139 103.876 164.173 102.515 163.296 101.777Z" stroke="white" stroke-linecap="round"/>
320
- <path d="M295.53 23.0783L277.524 26.2801L283.252 32.7192L274.855 38.9079L292.861 35.7061L287.133 29.2671L295.53 23.0783Z" stroke="white" stroke-linecap="round" stroke-linejoin="round"/>
321
- <path d="M268.06 2.91764L254.192 14.8403L262.401 17.4661L258.324 27.0679L272.192 15.1453L263.983 12.5194L268.06 2.91764Z" stroke="white" stroke-linecap="round" stroke-linejoin="round"/>
322
- </svg>
323
- `})}}U.registerComponent("ErrorDisplay",cW);const e1=U.getComponent("FullscreenToggle"),RI="Fullscreen (f)";class FI extends e1{handleFullscreenChange(){e1.prototype.handleFullscreenChange.call(this),this.controlText(RI)}}U.registerComponent("FullscreenToggle",FI);FI.prototype.controlText_=RI;const hW=U.getComponent("MuteToggle"),BI="Mute (m)",dW="Unmute (m)";class UI extends hW{updateControlText_(){const t=this.player_.muted()||this.player_.volume()===0?dW:BI;this.controlText_!==t&&this.controlText(t)}}U.registerComponent("MuteToggle",UI);UI.prototype.controlText_=BI;const fW=U.getComponent("Player"),pW=s=>s.indexOf("#")===0?s.slice(1):s,mW=3;let Cl;const Mh=class Mh{constructor(e,t){if(this.streamLogged=!1,this.options=U.obj.merge({},Mh.options_,t),this.options.playerApi===null)throw new Error("PlayerApi required");this.initialize(),this.createEl(e),this.buildVideoJs(),this.options.splash&&this.setupSplash(this.options.splash),this.bindEventListeners(),this.setupSeekBar(),this.fetchConfig(),this.logStream=this.logStream.bind(this),this.player.ready(()=>{this._configurePlugins(),this.options.setup&&this.options.setup(this.options,this.player),this.fetch().catch(i=>this.handleFetchError(i))})}initialize(){}_configurePlugins(){this.player.configureMenuDimensionsPlugin({mobile:this.options.mobile,overflowControls:this.options.overflowControls,seekBarName:this.getSeekBarName()}),this.player.progressReporterPlugin({onFlush:this.onFlushProgress=this.onFlushProgress.bind(this)}),this.player.persistVolumePlugin(),!this.options.mobile&&this.options.allowFullscreen&&this.player.fullscreenOnRotatePlugin(),this.player.touchControls(),this.options.getExternalLink&&this.player.openExternallyPlugin({getExternalLink:this.options.getExternalLink}),this.configurePlugins()}configurePlugins(){}onFlushProgress(e){var t;(t=this.analyticsService)==null||t.logVideoProgress(e)}buildVideoJs(){return this.player=U(this.el,this.getPlayerOptions())}getInactivityTimeout(){if(typeof this.options.inactivityTimeout=="number")return this.options.inactivityTimeout;let e=500;return(this.options.mobile||U.browser.IS_IOS||U.browser.IS_ANDROID)&&(e=3e3),e}getFluid(){return!(this.options.theatreMode||this.options.embed||this.options.mobile)}getFill(){return!!(this.options.theatreMode||this.options.embed||this.options.mobile)}getPlayerOptions(){let e=fW.prototype.options_.children;return e=e.filter(t=>!(t==="bigPlayButton"||t==="posterImage")),{controls:this.options.controls,fluid:this.getFluid(),fill:this.getFill(),inactivityTimeout:this.getInactivityTimeout(),controlBar:{children:["timeWrapper","progressControl"]},children:[...e,{name:"collapserator",children:j3.filter(t=>!(t==="fullscreenToggle"&&!this.options.allowFullscreen))},"playPauseFeedback","controlBarGradient"],userActions:{hotkeys:t=>Q3(t,this.player,this.options)},playbackRates:this.options.playbackRates,techOrder:["html5"],html5:{nativeTextTracks:!1},playsinline:!0,aspectRatio:this.options.aspectRatio,mobile:this.options.mobile,allowTheatreMode:this.options.allowTheatreMode,deferMenus:this.options.deferMenus,muted:this.options.muted,devicesConfig:this.options.devicesConfig}}async getPlaybackObject(){if(this.options.offlinePlaybackObject)return this.options.offlinePlaybackObject;let e=this.options.fetch;if(this.options.fetch===void 0&&(e=i=>{const r=`${this.options.playerApi.origin}/api/playback?viewKey=${i}`;return Zg.get(r)}),!this.options.viewKey)throw new Error("Please specify a viewKey or a fetch function");const t=await e(this.options.viewKey);if(!t)throw new Error("Error fetching playback object");return t}setChaptersInternal(e,t){let i=Qt.getTrack(this.player,"chapters",null);i||(i=this.player.addTextTrack("chapters")),[...i.cues.cues_].forEach(n=>i.removeCue(n)),e.forEach(n=>{i.addCue({startTime:n.timestamp,endTime:n.endTimestamp,text:n.name})}),t&&i.trigger({type:"cv:cuechange",target:i}),i.trigger({type:"loadeddata",target:i})}setChapters(e){this.setChaptersInternal(e,!0)}setPlayerMode(e,t){this.player.playerModePlugin().setPlayerMode(e,t)}setFavourite(e,t){this.player.favouritePlugin().setFavourite(e,t)}async fetch(){var r,n,a;const e=await this.getPlaybackObject();if(this.isDisposed())return;const t=e.mediaType==="MasterClip",i=(r=e.additionalData)==null?void 0:r.clipData;((a=(n=e.chapters)==null?void 0:n.list)==null?void 0:a.length)>0&&!t&&!i&&this.setChaptersInternal(e.chapters.list,!1),this.player.localCache({localCacheAddresses:e.localCacheAddresses??[],enabled:this.options.enableLocalCache??!0}),this.player.progressiveFiles({sources:e.files.progressive.map(o=>({id:o.profile,mimeType:o.mimeType,url:o.url}))}),this.player.handleNetworkErrors({playerApi:this.options.playerApi,fileToken:e.files.fileToken}),e.subtitles.list.length>0&&e.subtitles.list.forEach(o=>{if(o.mimeType!=="text/vtt")return;const l=this.player.addRemoteTextTrack({kind:"subtitles",src:o.url,language:o.language,label:o.label},!0);l.track.isClickViewProduced=o.isClickViewProduced,Qt.sanitizeTrack(l.track,this.player),Qt.activeTextTrack(l.track)}),e.posterUrl&&this.player.poster(Va.createUrl(e.posterUrl,{size:T1.Large})),this.setupSplash({title:e.title,posterUrl:e.posterUrl,episodeNumber:e.episodeNumber,ratingCode:e.ratingCode,seasonNumber:e.seasonNumber,seriesName:e.seriesName}),this.additionalSetup(e),this.handleAutoplay(e),this.options.startTime&&(this.player.currentTime(this.options.startTime),this.player.one("canplay",()=>{this.player.currentTime(this.options.startTime)})),this.player.trigger("cv-playback-data-loaded",e)}handleFetchError(e){var i;let t=e.message;e instanceof Jg&&((i=e.response)==null?void 0:i.type)===hw.PhysicallyChapteredVideo&&(t="Video cannot be played because it is either corrupt or damaged."),this.player.error(t),this.options.onError&&this.options.onError(e)}async fetchConfig(){if(Cl||this.options.fetch||this.options.offlinePlaybackObject)return;const e=`${this.options.playerApi.origin}/api/config`;Cl=await Zg.get(e),!this.isDisposed()&&this.trigger("config:loaded")}additionalSetup(e){var i;this.player.whiteboardModePlugin(),this.player.deferMenusPlugin();const t=this.options.enableLocalCache&&!!((i=e.localCacheAddresses)!=null&&i.length);Cl?this.setupAnalyticsService(e,t):this.one("config:loaded",()=>this.setupAnalyticsService(e,t)),this.analyticsService||!this.isAnalyticsEnabled()?this.setupAnalyticsDependentPlugins(e):this.one("analytics:loaded",()=>this.setupAnalyticsDependentPlugins(e))}setupAnalyticsService(e,t){this.options.eventLogging&&(this.analyticsService=new q3({player:this.player,collectionApiUrls:Cl.collectionApi.urls,collectionApiClientId:Cl.collectionApi.clientId,productVersion:J3.version,authSessionId:e.viewerAuthSessionId,videoId:e.videoId,mediaId:e.mediaId,userId:e.viewerId,shareId:e.shareId,customerId:e.viewerCustomerId,mediaType:e.mediaType,playerType:this.getAnalyticsPlayerType(),isEmbedded:this.options.embed,isUsingLocalCache:t,additionalAnalyticsData:this.getAdditionalAnalyticsData(e),regionName:e.instanceRegion||this.options.sharerInstanceRegion||FP.CvApSoutheast1}),this.on("timeupdate",this.logStream),this.trigger("analytics:loaded"))}setupAnalyticsDependentPlugins(e){var t,i,r,n;this.player.persistSubtitleSettingsPlugin({showSubtitles:(t=e.settings)==null?void 0:t.showSubtitles,subtitleSize:(i=e.settings)==null?void 0:i.playbackSubtitleSizeDefault,analyticsService:this.analyticsService}),this.player.persistQualitySettingsPlugin({playbackProfile:(r=e.settings)==null?void 0:r.playbackProfile,playbackProfileLocalCache:(n=e.settings)==null?void 0:n.playbackProfileLocalCache,analyticsService:this.analyticsService}),this.player.persistPlaybackRatePlugin({analyticsService:this.analyticsService})}getAdditionalAnalyticsData(e){return{}}isAnalyticsEnabled(){return this.options.fetch||this.options.offlinePlaybackObject?!1:this.options.eventLogging}handleAutoplay(e){this.options.autoplay&&this.player.ready(()=>{this.player.play().catch(()=>{this.isDisposed()||this.showSplash()})})}logStream(){this.analyticsService&&(this.player.currentTime()<mW||this.streamLogged||(this.analyticsService.logStream(),this.streamLogged=!0,this.off("timeupdate",this.logStream)))}getAnalyticsPlayerType(){return"player"}createEl(e){let t;typeof e=="string"?(e=pW(e),t=U.dom.$("#"+e)):t=e;let i="video-js";return this.getPlayerClassName()&&(i+=` ${this.getPlayerClassName()}`),this.el=U.dom.createEl("video",{},{class:i}),t.appendChild(this.el),this.el}getPlayerClassName(){return""}on(e,t){this.player.on(e,t)}one(e,t){this.player.one(e,t)}off(e,t){this.player.off(e,t)}trigger(e,t){return this.player.trigger(e,t)}dispose(){this.player.dispose()}ready(e){this.player.ready(e)}isDisposed(){return this.player.isDisposed()}play(){this.player.play()}pause(){this.player.pause()}isPaused(){return this.player.paused()}currentTime(e){return this.player.currentTime(e)}muted(e){return this.player.muted(e)}duration(){return this.player.duration()}isFullscreen(){return this.player.isFullscreen()}requestFullscreen(){this.player.requestFullscreen()}exitFullscreen(){this.player.exitFullscreen()}playbackRate(e){return this.player.playbackRate(e)}quality(e){const t=this.player.qualityLevels();for(let i=0;i<t.length;i++){const r=t[i];if(e){r.enabled=r.id===e.toString();continue}if(r.enabled)return r.id}}subtitles(e){const t=this.player.textTracks();for(let i=0;i<t.length;i++){const r=t[i];if(e!==void 0){r.label===e?r.mode="showing":r.mode="hidden";continue}if(r.mode==="showing")return r.label}}bindEventListeners(){const e=i=>i.preventDefault();if(this.showSplash=this.showSplash.bind(this),this.hideSplash=this.hideSplash.bind(this),this.player.on("ended",this.showSplash),this.player.on("play",this.hideSplash),this.player.tech(!0).on("contextmenu",e),this.player.one("dispose",()=>{this.off("ended",this.showSplash),this.off("play",this.hideSplash),this.player.tech(!0).off("contextmenu",e)}),!this.options.hotkeyElQuerySelector)return;const t=U.dom.$(this.options.hotkeyElQuerySelector);t&&(this.player.on(t,"keydown",this.player.handleKeyDown),this.player.one("dispose",()=>{this.player.off(t,"keydown",this.player.handleKeyDown)}))}setupSeekBar(){const e=this.getSeekBarName(),t=this.player.controlBar.getChild("progressControl");t.addChild(e,this.getSeekBarOptions()),t.setSeekBarName(e)}setupSplash(e){this._splashAdded||(this._splashAdded=!0,this.player.addChild("posterImage",{embed:this.options.embed,...e}),this.player.addChild("bigPlayButton"),this.options.autoplay?this.hideSplash():this.showSplash())}showSplash(){this.player.hasStarted(!1),this.player.getChild("posterImage").show(),this.player.getChild("bigPlayButton").show()}hideSplash(){this.player.getChild("posterImage").hide(),this.player.getChild("bigPlayButton").hide()}getSeekBarOptions(){return{}}getSeekBarName(){return"ChapterSeekBar"}};Mh.options_={viewKey:null,controls:!0,playbackRates:[.25,.5,.75,1,1.25,1.5,1.75,2],playerApi:new URL("http://localhost:52000"),enableLocalCache:!0,eventLogging:!0,allowFullscreen:!0};let Pv=Mh;const gW=U.getPlugin("plugin"),vW=10;class yW extends gW{constructor(e,t){if(super(e),t.startTime===void 0)throw Error("Invalid clip start");if(t.endTime===void 0)throw Error("Invalid clip end");if(t.startTime>t.endTime)throw Error("Clip start cannot be greater than clip end");this._clipStart=parseFloat(t.startTime.toPrecision(4)),this._clipEnd=parseFloat(t.endTime.toPrecision(4)),this.playerEndedFn=this.player.ended.bind(e),this.playerDurationFn=this.player.duration.bind(e),this.playerCurrentTimeFn=this.player.currentTime.bind(e),this.playerbufferedFn=this.player.buffered.bind(e),this.player.ended=this.ended.bind(this),this.player.duration=this.duration.bind(this),this.player.currentTime=this.currentTime.bind(this),this.player.buffered=this.buffered.bind(this),this.initialize(),this.player.ready(()=>{this.player.trigger("durationchange")})}get clipStart(){const e=this.playerDurationFn();return this._clipStart>e?e:this._clipStart}get clipEnd(){const e=this.playerDurationFn();return e<=0?this._clipEnd:this._clipEnd>e?e:this._clipEnd}dispose(){this.player.off("timeupdate",this.onTimeUpdate),this.player.off("play",this.onPlay),this.player.ended=this.playerEndedFn,this.player.duration=this.playerDurationFn,this.player.currentTime=this.playerCurrentTimeFn,this.player.buffered=this.playerbufferedFn,this.player.trigger("durationchange"),super.dispose()}initialize(){this.onTimeUpdate=this.onTimeUpdate.bind(this),this.onPlay=this.onPlay.bind(this),this.player.on("timeupdate",this.onTimeUpdate),this.player.on("play",this.onPlay)}onPlay(){this._isEnded&&this.player.currentTime(0)}onTimeUpdate(){const e=this.getCurrentTime(!1);if(e>this.clipEnd){this._isEnded||(this.player.pause(),this.player.trigger("ended"),this._isEnded=!0);return}this._isEnded=!1,e<this.clipStart-vW&&this.playerCurrentTimeFn(this.clipStart,!0)}ended(){return this.getCurrentTime(!1)>this.clipEnd}duration(e){return e&&e>0&&(this.playerDurationFn()?console.info("The duration of the player has already been set. This is a no-op."):this.playerDurationFn(e)),this.clipEnd-this.clipStart}currentTime(e,...t){if(typeof e!="number")return this.getCurrentTime(!0);const i=e+this.clipStart;this.playerCurrentTimeFn(i,t)}getCurrentTime(e){const t=this.playerCurrentTimeFn();let i=0;return t>=this.clipStart&&(i=t-this.clipStart),this.player.getCache().currentTime=i,e?i:t}buffered(){const e=this.playerbufferedFn(),t=[];for(let i=0;i<e.length;i++)t[i]=[Math.max(0,e.start(i)-this.clipStart),Math.min(Math.max(0,e.end(i)-this.clipStart),this.player.duration())];return U.createTimeRanges(t)}}U.registerPlugin("clipPlugin",yW);const _W=U.getComponent("Button");class $I extends _W{constructor(){super(...arguments),this.alwaysCollapsed=!1,this.isCollapsed=!1,this.isCollabsible=!0}buildCSSClass(){return"cv-create-clip-button"}getCollabsibleName(){return this.controlText_}getCollabsibleValue(){return""}showInCollabsibleMenu(){return!0}showCollapsibleMenu(){super.handleClick(null)}}$I.prototype.controlText_="Create clip";U.registerComponent("CreateClipButton",$I);const TW=U.getPlugin("plugin");class bW extends TW{constructor(e,t){super(e,t),this.options=t,e.ready(()=>this.onReady())}onReady(){var i;const e=this.player.getChild("collapserator"),t=(i=e==null?void 0:e.children())==null?void 0:i.findIndex(r=>r.name()==="CustomControlSpacer");!t||t===-1||e.addChild("CreateClipButton",{clickHandler:this.options.onClick},t+1)}}U.registerPlugin("createClipButtonPlugin",bW);const SW=U.getComponent("PictureInPictureToggle");class xW extends SW{handlePictureInPictureEnabledChange(){this.enable()}}U.registerComponent("PictureInPictureToggle",xW);const CW=U.getComponent("PlayToggle"),EW=U.getPlugin("plugin"),wW=800;class kW extends EW{constructor(e,t){super(e,t),this.options=t,this.bindFunctions(),e.ready(()=>this.initialize())}bindFunctions(){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}initialize(){const e=this.player.getChild("collapserator");let t=e.children().findIndex(i=>{var r;return((r=i.name())==null?void 0:r.toLowerCase())==="fullscreentoggle"});t===-1&&(t=e.children().length-1),this.toggle=e.addChild("pictureInPictureToggle",{},t),this.toggle.enable(),this.player.on("playerresize",this.onPlayerResize),this.player.on("dispose",()=>{var i;(i=this.player)==null||i.off("playerresize",this.onPlayerResize)})}togglePictureInPicture(e){if(e===this.player.isInPictureInPicture())return;const t=e?"enterpictureinpicture":"leavepictureinpicture";this.player.isInPictureInPicture(e),this.player.trigger(t),e?this.addPipStyles():this.removePipStyles()}onPlayerResize(){var t,i;if(this.player.isInPictureInPicture())return;const e=this.player.el().getBoundingClientRect();e.width!==0&&(e.width<wW?(t=this.toggle)==null||t.hide():(i=this.toggle)==null||i.show())}addPipStyles(){this.player.addClass("cv-picture-in-picture"),this.playToggle=new CW(this.player),this.playToggle.addClass("cv-pip-play-toggle"),this.player.addChild(this.playToggle),this.player.paused()?this.playToggle.handlePause():this.playToggle.handlePlay()}removePipStyles(){this.player.removeClass("cv-picture-in-picture"),this.player.removeChild(this.playToggle),delete this.playToggle}requestPictureInPicture(){var e;this.togglePictureInPicture(!0),typeof((e=this.options)==null?void 0:e.onRequestPictureInPicture)=="function"&&this.options.onRequestPictureInPicture(!0)}async exitPictureInPicture(){this.togglePictureInPicture(!1),this.options.onRequestPictureInPicture(!1),this.removePipStyles()}dispose(){this.player.requestPictureInPicture=this.playerRequestPictureInPictureFn,this.player.exitPictureInPicture=this.playerExitPictureInPictureFn,super.dispose()}}U.registerPlugin("pictureInPicture",kW);class AW{constructor(){this.listeners={}}subscribe(e,t){this.registerListener(e,t)}subscribeOnce(e,t){this.registerListener(e,t,1)}unsubscribe(e,t){this.deregisterListener(e,t)}trigger(e,...t){this.triggerCallbacks(e,t)}registerListener(e,t,i){if(typeof e!="string")throw new Error("Event name must be a string");if(typeof t!="function")throw new Error("Event callback must be a function");if(i&&typeof i!="number")throw new Error("Execution limit must be a number or undefined");this.listeners[e]=this.listeners[e]??[],this.listeners[e].push({callback:t,executionLimit:i})}deregisterListener(e,t){var r;if(typeof e!="string")throw new Error("Event name must be a string");if(t&&typeof t!="function")throw new Error("Event callback must be a function");if(!t){this.listeners[e]=[];return}const i=(r=this.listeners[e])==null?void 0:r.findIndex(n=>n.callback===t);typeof i!="number"||i===-1||(this.listeners[e].splice(i,1),this.listeners[e].length===0&&delete this.listeners[e])}triggerCallbacks(e,...t){if(!this.listeners[e])return;const i=[];this.listeners[e].forEach(r=>{typeof r.executionLimit=="number"&&(r.executionCount=r.executionCount??0,r.executionCount++,r.executionCount===r.executionLimit&&i.push(r.callback)),r.callback.apply(null,...t)}),i.length&&i.forEach(r=>this.deregisterListener(e,r))}}const IW=new AW,PW=U.getComponent("Component");class DW extends PW{constructor(e,t){super(e,t),this.hasBuffered=!1,this.hasPlayed=!1,this.eventsService=IW,this.pointOfInterest=t.pointOfInterest,this.onMouseOver=this.onMouseOver.bind(this),this.onMouseLeave=this.onMouseLeave.bind(this),this.onGlancePointOfInterestMouseEnter=this.onGlancePointOfInterestMouseEnter.bind(this),this.onGlancePointOfInterestMouseLeave=this.onGlancePointOfInterestMouseLeave.bind(this),this.initialize()}initialize(){this.setPosition(),this.bindListeners()}buildCSSClass(){return`cv-point-of-interest-indicator ${super.buildCSSClass()}`}createEl(e,t,i){return super.createEl(e,{...t,className:this.buildCSSClass()},i)}bindListeners(){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)}dispose(){this.eventsService.unsubscribe("glance:poi:mouseover",this.onGlancePointOfInterestMouseEnter),this.eventsService.unsubscribe("glance:poi:mouseleave",this.onGlancePointOfInterestMouseLeave)}getPointOfInterestTime(){return this.pointOfInterest.startTime}setPosition(){const e=this.player().duration();this.el_.style.left=this.getPointOfInterestTime()/e*100+"%"}updateBuffered(e){const t=this.getPointOfInterestTime()<=e;if(t===this.hasBuffered)return;this.hasBuffered=t;const i="cv-point-of-interest-indicator-buffered";this.hasBuffered?this.addClass(i):this.removeClass(i)}updatePlaybackProgress(e){const t=this.getPointOfInterestTime()<=e;if(t===this.hasPlayed)return;this.hasPlayed=t;const i="cv-point-of-interest-indicator-played";t?this.addClass(i):this.removeClass(i)}toggleVisibility(e){const t="cv-point-of-interest-indicator-hidden";e?this.removeClass(t):this.addClass(t)}onMouseOver(){this.setTimeTooltipText(),this.eventsService.trigger("player:poi:mouseover",this.pointOfInterest)}onMouseLeave(){this.clearTimeTooltipText(),this.eventsService.trigger("player:poi:mouseleave")}onGlancePointOfInterestMouseEnter(e){e.id===this.pointOfInterest.id&&(this.addClass("cv-point-of-interest-indicator-highlight"),this.setTimeTooltipTime(),this.setTimeTooltipText(),this.positionMouseTimeDisplay(),this.showMouseTimeDisplay())}onGlancePointOfInterestMouseLeave(){this.removeClass("cv-point-of-interest-indicator-highlight"),this.hideMouseTimeDisplay()}setTimeTooltipText(){var e;(e=this.getTimeTooltip())==null||e.setCustomChapterText(this.pointOfInterest.description)}clearTimeTooltipText(){var e;(e=this.getTimeTooltip())==null||e.setCustomChapterText()}setTimeTooltipTime(){const e=this.getTimeTooltip();e==null||e.updateTime(this.getPointOfInterestTime())}positionMouseTimeDisplay(){var r,n;const e=(r=this.getSeekBar())==null?void 0:r.el();if(!e)return;const t=U.dom.findPosition(e),i=this.getPointOfInterestTime()/this.player().duration();(n=this.getMouseTimeDisplay())==null||n.update(t,i)}showMouseTimeDisplay(){var e;(e=this.getMouseTimeDisplay())==null||e.forceShow()}hideMouseTimeDisplay(){var e;(e=this.getMouseTimeDisplay())==null||e.removeForceShow()}getSeekBar(){var e;return(e=this.player().controlBar.getChild("ProgressControl"))==null?void 0:e.getChild("SeekBar")}getMouseTimeDisplay(){var e;return(e=this.getSeekBar())==null?void 0:e.getChild("MouseTimeDisplay")}getTimeTooltip(){var e;return(e=this.getMouseTimeDisplay())==null?void 0:e.getChild("TimeTooltip")}}const NW=U.getComponent("MenuItem");class jI extends NW{constructor(e,t){super(e,t),this.pointsOfInterestVisible=t.pointsOfInterestVisible,this.toggle(this.pointsOfInterestVisible)}handleToggle(){this.toggle(!this.pointsOfInterestVisible)}toggle(e){e?this.toggleOn():this.toggleOff()}toggleOn(){U.dom.addClass(this.toggleEl,"on"),U.dom.setAttribute(this.toggleEl,"aria-checked","true"),this.pointsOfInterestVisible=!0,this.player().pointsOfInterestPlugin().togglePointsOfInterest(this.pointsOfInterestVisible)}toggleOff(){U.dom.removeClass(this.toggleEl,"on"),U.dom.setAttribute(this.toggleEl,"aria-checked","false"),this.pointsOfInterestVisible=!1,this.player().pointsOfInterestPlugin().togglePointsOfInterest(this.pointsOfInterestVisible)}handleClick(e){e.stopImmediatePropagation()}createEl(e,t,i){this.handlerBound||(this.handleToggle=this.handleToggle.bind(this),this.handlerBound=!0),this.toggleEl&&this.toggleEl.removeEventListener("click",this.handleToggle),this.toggleEl=U.dom.createEl("div",{className:"custom-toggle custom-toggle-info toggle-option float-end",innerHTML:'<span class="handle"></span></div>'}),U.dom.setAttribute(this.toggleEl,"id","poi-toggle"),U.dom.setAttribute(this.toggleEl,"role","switch"),this.toggleEl.addEventListener("click",this.handleToggle);const n=super.createEl(e,{className:"vjs-menu-item cv-cog-menu-item cv-poi-toggle",innerHTML:`
324
- <span for="poi-toggle" class="vjs-menu-item-text">Points of Interest</span>
325
- <span class="cv-toggle-container"></span>`},i);return n.children[1].appendChild(this.toggleEl),n}}U.registerComponent("PointsOfInterestMenuItem",jI);const LW=U.getPlugin("plugin"),t1="cvplayer-points-of-interest";class OW extends LW{constructor(e,t){super(e),this.pointOfInterestIndicators=[],this.enabled=!0,this.pointsOfInterest=t==null?void 0:t.pointsOfInterest,this.initialize=this.initialize.bind(this),this.updateBuffered=this.updateBuffered.bind(this),this.updatePlaybackProgress=this.updatePlaybackProgress.bind(this),this.player.one("loadedmetadata",()=>this.player.ready(this.initialize))}initialize(){this.pointsOfInterest&&(ht.hasLocalStorage()&&ht.get(t1)==="false"&&(this.enabled=!1),this.setupTrack(),this.createPointOfInterestIndicators(),this.addMenuItem(),this.bindListeners())}bindListeners(){this.player.on("progress",this.updateBuffered),this.player.on("timeupdate",this.updatePlaybackProgress),this.player.on("dispose",()=>{var e,t;(e=this.player)==null||e.off("progress",this.updateBuffered),(t=this.player)==null||t.off("timeupdate",this.updatePlaybackProgress)})}togglePointsOfInterest(e){ht.set(t1,e.toString()),this.pointOfInterestIndicators.forEach(t=>t.toggleVisibility(e))}setupTrack(){const e=this.player.addTextTrack("metadata","pointsofinterest");this.pointsOfInterest.forEach(t=>{e.addCue({startTime:t.startTime,endTime:t.endTime,text:t.description})}),e.trigger({type:"loadeddata",target:e})}createPointOfInterestIndicators(){var t;const e=(t=this.player.controlBar.getChild("ProgressControl"))==null?void 0:t.getChild("SeekBar");this.pointsOfInterest.forEach(i=>{const r=new DW(this.player,{pointOfInterest:i});this.pointOfInterestIndicators.push(r),e.addChild(r)})}addMenuItem(){var t;((t=this.player.getChild("collapserator"))==null?void 0:t.getChild("cogButton")).addItem({index:0,ctor:jI,name:"PointsOfInterestMenuItem",options:{pointsOfInterestVisible:this.enabled}})}updateBuffered(){this.pointOfInterestIndicators.forEach(e=>e.updateBuffered(wI(this.player)))}updatePlaybackProgress(){this.pointOfInterestIndicators.forEach(e=>e.updatePlaybackProgress(this.player.currentTime()))}}U.registerPlugin("pointsOfInterestPlugin",OW);var Bs=(s=>(s.None="None",s.Complete="Complete",s.Incomplete="Incomplete",s))(Bs||{});const MW=U.getComponent("Button");class qI extends MW{constructor(e,t){super(e,t),this.update()}update(){this.options_.activityStatus===Bs.Complete?this.addClass("cv-activity-completed"):this.removeClass("cv-activity-completed")}handleClick(...e){this.options_.activityStatus=this.getToggledActivityStatus(),this.update(),this.options_.clickHandler&&this.options_.clickHandler.call(this,e)}buildCSSClass(){return"cv-activity-status-button"}getToggledActivityStatus(){if(this.options_.activityStatus===Bs.None||this.options_.activityStatus===Bs.Incomplete)return Bs.Complete;if(this.options_.activityStatus===Bs.Complete)return Bs.Incomplete}}qI.prototype.controlText_="Complete";const RW=U.getPlugin("plugin");class FW extends RW{setActivityStatus(e,t){e!==this.activityStatus&&(this.activityStatus=e,this.onToggleStatus=t,this.player.ready(()=>{this.renderActivityStatusButton()}))}renderActivityStatusButton(){this.button&&this.player.removeChild(this.button),this.button=new qI(this.player,{activityStatus:this.activityStatus,clickHandler:this.onToggleStatus}),this.player.addChild(this.button)}}U.registerPlugin("activityStatusPlugin",FW);const BW=U.getComponent("Component");class i1 extends BW{constructor(e,t){super(e,t),this.initialize()}initialize(){this.setPosition()}buildCSSClass(){return`cv-range-indicator ${super.buildCSSClass()}`}createEl(e,t,i){return super.createEl(e,{...t,className:this.buildCSSClass()},i)}setPosition(){const e=this.player().duration();this.el_.style.left=this.options_.time/e*100+"%"}}const UW=U.getComponent("ClickableComponent");class r1 extends UW{constructor(e,t){super(e,t)}buildCSSClass(){return`cv-replay-view-button ${super.buildCSSClass()}`}createEl(e,t,i){return super.createEl(e,{...t,innerHTML:`<span class="${this.options_.iconClassName}"></span><span>${this.options_.label}</span>`,className:this.buildCSSClass()},i)}handleClick(){this.options_.onPress()}}const $W=U.getComponent("Component");class jW extends $W{constructor(e,t){super(e,t)}buildCSSClass(){return`cv-replay-view ${super.buildCSSClass()}`}createEl(e,t,i){const r=super.createEl(e,{...t,className:this.buildCSSClass()},i),n=U.dom.createEl("h5",{innerHTML:this.localize("This clip has finished"),className:"cv-replay-heading"}),a=U.dom.createEl("div",{className:"cv-button-container"}),o=new r1(this.player_,{label:this.localize("Replay clip"),iconClassName:"cv-replay-icon",onPress:this.options_.onReplayPress}),l=new r1(this.player_,{label:this.localize("Continue watching"),iconClassName:"cv-continue-icon",onPress:this.options_.onContinuePress});return r.appendChild(n),r.appendChild(a),a.appendChild(o.el()),a.appendChild(l.el()),r}}const qW=U.getPlugin("plugin");class VW extends qW{constructor(e,t){if(super(e,t),this.startTime=parseFloat(t.startTime.toPrecision(4)),this.endTime=parseFloat(t.endTime.toPrecision(4)),this.dismissed=!1,this.startTime>this.endTime)throw Error("Range start cannot be greater than range end");this.bindFunctions(),this.initialize()}bindFunctions(){this.onReady=this.onReady.bind(this),this.onTimeUpdateOrSeeked=this.onTimeUpdateOrSeeked.bind(this),this.onReplayPress=this.onReplayPress.bind(this),this.onContinuePress=this.onContinuePress.bind(this)}initialize(){this.player.one("loadedmetadata",()=>this.player.ready(this.onReady)),this.player.on("timeupdate",this.onTimeUpdateOrSeeked),this.player.on("seeked",this.onTimeUpdateOrSeeked)}onReady(){this.addCssClasses(),this.showRangeIndicators(),this.addMaskToProgressBar()}onTimeUpdateOrSeeked(){if(this.dismissed)return;const e=this.player.currentTime();if(e<this.startTime){this.player.currentTime(this.startTime);return}if(e>this.endTime){this.showReplayView(),this.disablePlayToggle(),this.player.pause(),this.player.currentTime(this.endTime);return}}onReplayPress(){this.player.currentTime(this.startTime),this.player.play(),this.hideReplayView(),this.enablePlayToggle()}onContinuePress(){this.dismissed=!0,this.player.play(),this.hideRangeIndicators(),this.removeMaskFromProgressBar(),this.hideReplayView(),this.enablePlayToggle(),this.removeCssClasses()}showRangeIndicators(){var t;const e=(t=this.player.controlBar.getChild("ProgressControl"))==null?void 0:t.getChild("SeekBar");this.startTimeIndicator||(this.startTimeIndicator=new i1(this.player,{time:this.startTime}),e==null||e.addChild(this.startTimeIndicator)),this.endTimeIndicator||(this.endTimeIndicator=new i1(this.player,{time:this.endTime}),e==null||e.addChild(this.endTimeIndicator))}hideRangeIndicators(){var e,t;(e=this.startTimeIndicator)==null||e.hide(),(t=this.endTimeIndicator)==null||t.hide()}addMaskToProgressBar(){var i;const e=(i=this.player.controlBar.getChild("ProgressControl"))==null?void 0:i.getChild("SeekBar"),t=e==null?void 0:e.el().getElementsByClassName("cv-chapter-bar-items");if(t&&t.length){const r=t[0],n=this.player.duration(),a=this.startTime/n*100,o=100-this.endTime/n*100,l=-5;r.style.clipPath=`inset(${l}em ${o}% ${l}em ${a}%)`}}removeMaskFromProgressBar(){var i;const e=(i=this.player.controlBar.getChild("ProgressControl"))==null?void 0:i.getChild("SeekBar"),t=e==null?void 0:e.el().getElementsByClassName("cv-chapter-bar-items");if(t&&t.length){const r=t[0];r.style.clipPath=""}}showReplayView(){this.replayView||(this.replayView=new jW(this.player,{onContinuePress:this.onContinuePress,onReplayPress:this.onReplayPress}),this.player.addChild(this.replayView)),this.replayView.show()}hideReplayView(){var e;(e=this.replayView)==null||e.hide()}getPlayToggle(){const e=this.player.getChild("collapserator");return e==null?void 0:e.getChild("PlayToggle")}enablePlayToggle(){const e=this.getPlayToggle();e&&e.enable()}disablePlayToggle(){const e=this.getPlayToggle();e&&e.disable()}addCssClasses(){this.player.addClass("cv-range-indicator-plugin")}removeCssClasses(){this.player.removeClass("cv-range-indicator-plugin")}dispose(){var e,t,i;this.removeCssClasses(),this.player.off("timeupdate",this.onTimeUpdateOrSeeked),this.player.off("seeked",this.onTimeUpdateOrSeeked),(e=this.startTimeIndicator)==null||e.dispose(),(t=this.endTimeIndicator)==null||t.dispose(),(i=this.replayView)==null||i.dispose(),super.dispose()}}U.registerPlugin("rangeIndicatorPlugin",VW);const HW=U.getComponent("MenuItem");let zW=class extends HW{constructor(e,t){super(e,t),this.onLoopVideoChange=this.onLoopVideoChange.bind(this),this.player_.on("cv:loopvideo",this.onLoopVideoChange),this.onLoopVideoChange(null,this.player_.loopVideoPlugin().loop())}onLoopVideoChange(e,t){t?this.toggleOn():this.toggleOff()}handleToggle(){const e=this.player_.loopVideoPlugin().loop();this.player_.loopVideoPlugin().loop(!e)}toggleOn(){U.dom.addClass(this.toggleEl,"on")}toggleOff(){U.dom.removeClass(this.toggleEl,"on")}handleClick(e){e.stopImmediatePropagation()}createEl(e,t,i){this.handlerBound||(this.handleToggle=this.handleToggle.bind(this),this.handlerBound=!0),this.toggleEl&&this.toggleEl.removeEventListener("click",this.handleToggle),this.toggleEl=U.dom.createEl("div",{className:"custom-toggle custom-toggle-info toggle-option float-end",innerHTML:'<span class="handle"></span></div>'}),this.toggleEl.addEventListener("click",this.handleToggle);const n=super.createEl(e,{className:"vjs-menu-item cv-cog-menu-item cv-loop-video-toggle",innerHTML:`
326
- <span class="vjs-menu-item-text">Loop video</span>
327
- <span class="cv-toggle-container"></span>`},i);return n.children[1].appendChild(this.toggleEl),n}dispose(){this.player_.off("cv:loopvideo",this.onLoopVideoChange),super.dispose()}};U.registerComponent("LoopVideoMenuItem",zW);const WW=U.getPlugin("plugin");U.getComponent("MenuItem");const GW=U.getComponent("LoopVideoMenuItem");class KW extends WW{constructor(e,t){super(e),t.allowLoop&&this.player.ready(()=>this.addButton()),this.onEnded=this.onEnded.bind(this),this.player.on("ended",this.onEnded)}addButton(){var t;((t=this.player.getChild("collapserator"))==null?void 0:t.getChild("cogButton")).addItem({index:0,ctor:GW,name:"LoopVideoMenuItem"})}onEnded(){this.player.loop()&&this.player.play()}loop(e){var t,i,r;if(typeof e!="boolean")return this.player.loop();e&&((r=(i=(t=this.player).nextVideoPlugin)==null?void 0:i.call(t))==null||r.setShouldPlayNext(!1,!1)),this.player.trigger("cv:loopvideo",e),this.player.loop(e)}dispose(){this.player.off("ended",this.onEnded),super.dispose()}}U.registerPlugin("loopVideoPlugin",KW);const VI={generateRandomId:()=>{var s,e;return((e=(s=window.crypto)==null?void 0:s.randomUUID)==null?void 0:e.call(s))??Math.random().toString()}};class XW extends Pv{constructor(e,t){super(e,t)}getPlayerOptions(){var t;const e=super.getPlayerOptions();return this.options.allowTranscript&&(e.allowTranscript=!0),(t=e.devicesConfig)!=null&&t.canUserCastToDevices?{...e,techOrder:["devices",...e.techOrder],devices:{instanceId:VI.generateRandomId()}}:e}configurePlugins(){var e;try{this.options.onClickCreateClip&&this.player.createClipButtonPlugin({onClick:this.options.onClickCreateClip}),this.options.onRequestPictureInPicture&&this.player.pictureInPicture({onRequestPictureInPicture:this.options.onRequestPictureInPicture}),(e=this.options.pointsOfInterest)!=null&&e.length&&this.player.pointsOfInterestPlugin({pointsOfInterest:this.options.pointsOfInterest}),this.player.loopVideoPlugin({allowLoop:this.options.allowLoop})}catch(t){console.log("failed to register plugins",t)}}setNextVideo(e,t,i){if(!this.player.nextVideoPlugin)return;this.player.nextVideoPlugin().setNextVideo(e,t,i)}togglePictureInPicture(e){const t=this.player.pictureInPicture();t&&t.togglePictureInPicture(e)}toggleTheatreMode(e){const t=this.player.theatreModePlugin();t&&t.toggleTheatreMode(e,{shouldLog:!0})}toggleTranscript(e){if(!this.player.viewTranscriptPlugin)return;const t=this.player.viewTranscriptPlugin();t&&t.toggleTranscript(e)}hasStarted(){return this.player.hasStarted()}async additionalSetup(e){if(this.options.onRequestTheatreMode&&this.options.allowTheatreMode&&this.player.theatreModePlugin&&this.player.theatreModePlugin({onRequestTheatreMode:this.options.onRequestTheatreMode,theatreMode:this.options.theatreMode,playbackObject:e}),super.additionalSetup(e),this.options.showResources&&e.resources&&this.player.resourcesPlugin&&this.player.resourcesPlugin({resources:e.resources.list,imageCdnUrl:this.options.imageCdnUrl}),e.mediaType==="MasterClip"){const t=e.additionalData;if(t===null)throw Error("Invalid clip data");this.player.clipPlugin({startTime:t.startTime,endTime:t.endTime})}e.mediaType==="MasterVideo"&&this.options.startTime&&this.options.endTime&&this.player.rangeIndicatorPlugin({startTime:this.options.startTime,endTime:this.options.endTime})}setupAnalyticsDependentPlugins(e){var t;super.setupAnalyticsDependentPlugins(e),this.options.allowTranscript&&this.player.viewTranscriptPlugin().registerAnalytics(this.analyticsService,e),this.options.onRequestTheatreMode&&this.options.allowTheatreMode&&this.player.theatreModePlugin&&this.player.theatreModePlugin().registerAnalytics(this.analyticsService),(t=this.options.devicesConfig)!=null&&t.canUserCastToDevices&&this.player.devicesPlugin&&this.player.devicesPlugin({...this.options.devicesConfig,userId:parseInt(e.viewerId),title:e.title,analyticsService:this.analyticsService})}setActivityStatus(e,t){this.player.activityStatusPlugin().setActivityStatus(e,t)}addTranscript(e){return Qt.getTrack(this.player,"metadata","transcript",e)?null:this.player.addTextTrack("metadata","transcript",e)}useCurrentTranscript(e,t){return Qt.useMetadataTracks(this.player,"transcript",e,t)}}function QW(s){return new Proxy(s,{get(e,t,i){if(!(t!=="off"&&e.isDisposed()))return Reflect.get(e,t,i)}})}var El={},gg={exports:{}},vg={exports:{}},yg={exports:{}},n1;function YW(){if(n1)return yg.exports;n1=1;var s=yg.exports={type:i,isArray:n,isFunction:r,isPlainObject:o,each:a,extend:l,noop:function(){}},e=Object.prototype.toString,t={};"Boolean Number String Function Array Date RegExp Object".split(" ").forEach(function(u){t["[object "+u+"]"]=u.toLowerCase()});function i(u){return u==null?String(u):t[e.call(u)]||"object"}function r(u){return s.type(u)==="function"}function n(u){return s.type(u)==="array"}function a(u,c,h){var d,g=0,y=u.length,p=y===void 0||r(u);if(h)if(p){for(d in u)if(c.apply(u[d],h)===!1)break}else for(;g<y&&c.apply(u[g++],h)!==!1;);else if(p){for(d in u)if(c.call(u[d],d,u[d])===!1)break}else for(;g<y&&c.call(u[g],g,u[g++])!==!1;);return u}function o(u){return!(!u||s.type(u)!=="object")}function l(){var u,c,h,d,g,y,p=arguments[0]||{},_=1,k=arguments.length,A=!1;for(typeof p=="boolean"&&(A=p,p=arguments[1]||{},_=2),typeof p!="object"&&!s.isFunction(p)&&(p={}),k===_&&(p=this,--_);_<k;_++)if((u=arguments[_])!=null)for(c in u)h=p[c],d=u[c],p!==d&&(A&&d&&(s.isPlainObject(d)||(g=s.isArray(d)))?(g?(g=!1,y=h&&s.isArray(h)?h:[]):y=h&&s.isPlainObject(h)?h:{},p[c]=s.extend(A,y,d)):d!==void 0&&(p[c]=d));return p}return yg.exports}var s1;function JW(){if(s1)return vg.exports;s1=1;var s=vg.exports=YW(),e=/\s+/,t={};function i(r){var n=t[r]={};return s.each(r.split(e),function(a,o){n[o]=!0}),n}return s.Callbacks=function(r){r=typeof r=="string"?t[r]||i(r):s.extend({},r);var n,a,o,l,u,c,h=[],d=!r.once&&[],g=function(p){for(n=r.memory&&p,a=!0,c=l||0,l=0,u=h.length,o=!0;h&&c<u;c++)if(h[c].apply(p[0],p[1])===!1&&r.stopOnFalse){n=!1;break}o=!1,h&&(d?d.length&&g(d.shift()):n?h=[]:y.disable())},y={add:function(){if(h){var p=h.length;(function _(k){s.each(k,function(A,N){var $=s.type(N);$==="function"?(!r.unique||!y.has(N))&&h.push(N):N&&N.length&&$!=="string"&&_(N)})})(arguments),o?u=h.length:n&&(l=p,g(n))}return this},remove:function(){return h&&s.each(arguments,function(p,_){for(var k;(k=s.inArray(_,h,k))>-1;)h.splice(k,1),o&&(k<=u&&u--,k<=c&&c--)}),this},has:function(p){return s.inArray(p,h)>-1},empty:function(){return h=[],this},disable:function(){return h=d=n=void 0,this},disabled:function(){return!h},lock:function(){return d=void 0,n||y.disable(),this},locked:function(){return!d},fireWith:function(p,_){return _=_||[],_=[p,_.slice?_.slice():_],h&&(!a||d)&&(o?d.push(_):g(_)),this},fire:function(){return y.fireWith(this,arguments),this},fired:function(){return!!a}};return y},vg.exports}var a1;function ZW(){if(a1)return gg.exports;a1=1;/*!
328
- * jquery-deferred
329
- * Copyright(c) 2011 Hidden <zzdhidden@gmail.com>
330
- * MIT Licensed
331
- */var s=gg.exports=JW(),e=Array.prototype.slice;return s.extend({Deferred:function(t){var i=[["resolve","done",s.Callbacks("once memory"),"resolved"],["reject","fail",s.Callbacks("once memory"),"rejected"],["notify","progress",s.Callbacks("memory")]],r="pending",n={state:function(){return r},always:function(){return a.done(arguments).fail(arguments),this},then:function(){var o=arguments;return s.Deferred(function(l){s.each(i,function(u,c){var h=c[0],d=o[u];a[c[1]](s.isFunction(d)?function(){var g=d.apply(this,arguments);g&&s.isFunction(g.promise)?g.promise().done(l.resolve).fail(l.reject).progress(l.notify):l[h+"With"](this===a?l:this,[g])}:l[h])}),o=null}).promise()},promise:function(o){return o!=null?s.extend(o,n):n}},a={};return n.pipe=n.then,s.each(i,function(o,l){var u=l[2],c=l[3];n[l[1]]=u.add,c&&u.add(function(){r=c},i[o^1][2].disable,i[2][2].lock),a[l[0]]=u.fire,a[l[0]+"With"]=u.fireWith}),n.promise(a),t&&t.call(a,a),a},when:function(t){var i=0,r=e.call(arguments),n=r.length,a=n!==1||t&&s.isFunction(t.promise)?n:0,o=a===1?t:s.Deferred(),l=function(d,g,y){return function(p){g[d]=this,y[d]=arguments.length>1?e.call(arguments):p,y===u?o.notifyWith(g,y):--a||o.resolveWith(g,y)}},u,c,h;if(n>1)for(u=new Array(n),c=new Array(n),h=new Array(n);i<n;i++)r[i]&&s.isFunction(r[i].promise)?r[i].promise().done(l(i,h,r)).fail(o.reject).progress(l(i,c,u)):--a;return a||o.resolveWith(h,r),o.promise()}}),gg.exports}var _g,o1;function eG(){return o1||(o1=1,_g=ZW()),_g}var Tg={exports:{}};/**
332
- * @preserve jquery-param (c) 2015 KNOWLEDGECODE | MIT
333
- */var l1;function tG(){return l1||(l1=1,function(s){(function(e){var t=function(i){var r=[],n=/\[\]$/,a=function(u){return Object.prototype.toString.call(u)==="[object Array]"},o=function(u,c){c=typeof c=="function"?c():c===null||c===void 0?"":c,r[r.length]=encodeURIComponent(u)+"="+encodeURIComponent(c)},l=function(u,c){var h,d,g;if(u)if(a(c))for(h=0,d=c.length;h<d;h++)n.test(u)?o(u,c[h]):l(u+"["+(typeof c[h]=="object"?h:"")+"]",c[h]);else if(c&&String(c)==="[object Object]")for(g in c)l(u+"["+g+"]",c[g]);else o(u,c);else if(a(c))for(h=0,d=c.length;h<d;h++)o(c[h].name,c[h].value);else for(g in c)l(g,c[g]);return r};return l("",i).join("&").replace(/%20/g,"+")};s.exports=t})()}(Tg)),Tg.exports}var bg,u1;function iG(){if(u1)return bg;u1=1;var s=eG(),e=tG(),t=function(a){var o=a.events||{};return a&&a===a.window?{0:a,load:function(u){return a.addEventListener("load",u,!1)},bind:function(u,c){return a.addEventListener(u,c,!1)},unbind:function(u,c){return a.removeEventListener(u,c,!1)}}:{0:a,unbind:function(u,c){var h=o[u]||[];if(c){var d=h.indexOf(c);d!==-1&&h.splice(d,1)}else h=[];o[u]=h,a.events=o},bind:function(u,c){var h=o[u]||[];o[u]=h.concat(c),a.events=o},triggerHandler:function(u,c){var h=this,d=o[u]||[];d.forEach(function(g){c&&c[0]&&c[0].type===void 0?c=[{type:u}].concat(c||[]):c=c||[],g.apply(h,c)})}}},i=function(){try{return new window.XMLHttpRequest}catch{}},r=function(a){var o=i();a.xhrFields&&a.xhrFields.withCredentials&&(o.withCredentials=!0),o.onreadystatechange=function(){if(o.readyState===4)if(o.status===200&&!o._hasError)try{a.success&&a.success(JSON.parse(o.responseText))}catch{a.error&&a.error(o)}else a.error&&a.error(o)},o.withCredentials=a.xhrFields.withCredentials;var l="_="+new Date().getTime();return a.url.indexOf("?")===-1?a.url+="?"+l:a.url.indexOf("_=")===-1?a.url+="&"+l:a.url=a.url.replace(/_=\d+/,l),o.open(a.type,a.url),o.setRequestHeader("content-type",a.contentType),a.headers&&Object.keys(a.headers).forEach(function(u){var c=a.headers[u];o.setRequestHeader(u,c)}),o.send(a.data.data&&"data="+encodeURIComponent(a.data.data)),{abort:function(c){return o.abort(c)}}};return bg=s.extend(t,s,{defaultAjaxHeaders:null,ajax:r,inArray:function(a,o){return a.indexOf(o)!==-1},trim:function(a){return a&&a.trim()},isEmptyObject:function(a){return!a||Object.keys(a).length===0},makeArray:function(a){return[].slice.call(a,0)},param:function(a){return e(a)},support:{cors:function(){var n=i();return!!n&&"withCredentials"in n}()}}),bg}var c1;function rG(){if(c1)return El;c1=1,Object.defineProperty(El,"__esModule",{value:!0});var s=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},e=iG();/*!
334
- * ASP.NET SignalR JavaScript Library 2.4.1
335
- * http://signalr.net/
336
- *
337
- * Copyright (c) .NET Foundation. All rights reserved.
338
- * Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
339
- *
340
- */return function(t,i,r){var n={nojQuery:"jQuery was not found. Please ensure jQuery is referenced before the SignalR client JavaScript file.",noTransportOnInit:"No transport could be initialized successfully. Try specifying a different transport or none at all for auto initialization.",errorOnNegotiate:"Error during negotiation request.",stoppedWhileLoading:"The connection was stopped during page load.",stoppedWhileNegotiating:"The connection was stopped during the negotiate request.",errorParsingNegotiateResponse:"Error parsing negotiate response.",errorRedirectionExceedsLimit:"Negotiate redirection limit exceeded.",errorDuringStartRequest:"Error during start request. Stopping the connection.",errorFromServer:"Error message received from the server: '{0}'.",stoppedDuringStartRequest:"The connection was stopped during the start request.",errorParsingStartResponse:"Error parsing start response: '{0}'. Stopping the connection.",invalidStartResponse:"Invalid start response: '{0}'. Stopping the connection.",protocolIncompatible:"You are using a version of the client that isn't compatible with the server. Client version {0}, server version {1}.",aspnetCoreSignalrServer:"Detected a connection attempt to an ASP.NET Core SignalR Server. This client only supports connecting to an ASP.NET SignalR Server. See https://aka.ms/signalr-core-differences for details.",sendFailed:"Send failed.",parseFailed:"Failed at parsing response: {0}",longPollFailed:"Long polling request failed.",eventSourceFailedToConnect:"EventSource failed to connect.",eventSourceError:"Error raised by EventSource",webSocketClosed:"WebSocket closed.",pingServerFailedInvalidResponse:"Invalid ping response when pinging server: '{0}'.",pingServerFailed:"Failed to ping server.",pingServerFailedStatusCode:"Failed to ping server. Server responded with status code {0}, stopping the connection.",pingServerFailedParse:"Failed to parse ping server response, stopping the connection.",noConnectionTransport:"Connection is in an invalid state, there is no transport active.",webSocketsInvalidState:"The Web Socket transport is in an invalid state, transitioning into reconnecting.",reconnectTimeout:"Couldn't reconnect within the configured timeout of {0} ms, disconnecting.",reconnectWindowTimeout:"The client has been inactive since {0} and it has exceeded the inactivity timeout of {1} ms. Stopping the connection.",jsonpNotSupportedWithAccessToken:"The JSONP protocol does not support connections that require a Bearer token to connect, such as the Azure SignalR Service."};if(typeof t!="function")throw new Error(n.nojQuery);var a,o,l=i.document.readyState==="complete",u=t(i),c="__Negotiate Aborted__",h={onStart:"onStart",onStarting:"onStarting",onReceived:"onReceived",onError:"onError",onConnectionSlow:"onConnectionSlow",onReconnecting:"onReconnecting",onReconnect:"onReconnect",onStateChanged:"onStateChanged",onDisconnect:"onDisconnect"},d={processData:!0,timeout:null,async:!0,global:!1,cache:!1},g=function(F,B){if(B!==!1){var C;typeof i.console>"u"||(C="["+new Date().toTimeString()+"] SignalR: "+F,i.console.debug?i.console.debug(C):i.console.log&&i.console.log(C))}},y=function(F,B,C){return B===F.state?(F.state=C,t(F).triggerHandler(h.onStateChanged,[{oldState:B,newState:C}]),!0):!1},p=function(F){return F.state===a.connectionState.disconnected},_=function(F){return F._.keepAliveData.activated&&F.transport.supportsKeepAlive(F)},k=function(F){var B,C;F._.configuredStopReconnectingTimeout||(C=function(G){var H=a._.format(a.resources.reconnectTimeout,G.disconnectTimeout);G.log(H),t(G).triggerHandler(h.onError,[a._.error(H,"TimeoutException")]),G.stop(!1,!1)},F.reconnecting(function(){var I=this;I.state===a.connectionState.reconnecting&&(B=i.setTimeout(function(){C(I)},I.disconnectTimeout))}),F.stateChanged(function(I){I.oldState===a.connectionState.reconnecting&&i.clearTimeout(B)}),F._.configuredStopReconnectingTimeout=!0)};a=function(F,B,C){return new a.fn.init(F,B,C)},a._={defaultContentType:"application/x-www-form-urlencoded; charset=UTF-8",ieVersion:function(){var L,F;return i.navigator.appName==="Microsoft Internet Explorer"&&(F=/MSIE ([0-9]+\.[0-9]+)/.exec(i.navigator.userAgent),F&&(L=i.parseFloat(F[1]))),L}(),error:function(F,B,C){var I=new Error(F);return I.source=B,typeof C<"u"&&(I.context=C),I},transportError:function(F,B,C,I){var G=this.error(F,C,I);return G.transport=B?B.name:r,G},format:function(){for(var F=arguments[0],B=0;B<arguments.length-1;B++)F=F.replace("{"+B+"}",arguments[B+1]);return F},firefoxMajorVersion:function(F){var B=F.match(/Firefox\/(\d+)/);return!B||!B.length||B.length<2?0:parseInt(B[1],10)},configurePingInterval:function(F){var B=F._.config,C=function(G){t(F).triggerHandler(h.onError,[G])};B&&!F._.pingIntervalId&&B.pingInterval&&(F._.pingIntervalId=i.setInterval(function(){a.transports._logic.pingServer(F).fail(C)},B.pingInterval))}},a.events=h,a.resources=n,a.ajaxDefaults=d,a.changeState=y,a.isDisconnecting=p,a.connectionState={connecting:0,connected:1,reconnecting:2,disconnected:4},a.hub={start:function(){throw new Error("SignalR: Error loading hubs. Ensure your hubs reference is correct, e.g. <script src='/signalr/js'><\/script>.")}},typeof u.on=="function"?u.on("load",function(){l=!0}):u.load(function(){l=!0});function A(L,F){if(t.isArray(L)){for(var B=L.length-1;B>=0;B--){var C=L[B];(t.type(C)!=="string"||!a.transports[C])&&(F.log("Invalid transport: "+C+", removing it from the transports list."),L.splice(B,1))}L.length===0&&(F.log("No transports remain within the specified transport array."),L=null)}else if(!a.transports[L]&&L!=="auto")F.log("Invalid transport: "+L.toString()+"."),L=null;else if(L==="auto"&&a._.ieVersion<=8)return["longPolling"];return L}function N(L){if(L==="http:")return 80;if(L==="https:")return 443}function $(L,F){return F.match(/:\d+$/)?F:F+":"+N(L)}function R(L,F){var B=this,C=[];B.tryBuffer=function(I){return L.state===t.signalR.connectionState.connecting?(C.push(I),!0):!1},B.drain=function(){if(L.state===t.signalR.connectionState.connected)for(;C.length>0;)F(C.shift())},B.clear=function(){C=[]}}a.fn=a.prototype={init:function(F,B,C){var I=t(this);this.url=F,this.qs=B,this.lastError=null,this._={keepAliveData:{},connectingMessageBuffer:new R(this,function(G){I.triggerHandler(h.onReceived,[G])}),lastMessageAt:new Date().getTime(),lastActiveAt:new Date().getTime(),beatInterval:5e3,beatHandle:null,totalTransportConnectTimeout:0,redirectQs:null},typeof C=="boolean"&&(this.logging=C)},_parseResponse:function(F){var B=this;return F&&(typeof F=="string"?B.json.parse(F):F)},_originalJson:i.JSON,json:i.JSON,isCrossDomain:function(F,B){var C;return F=t.trim(F),B=B||i.location,F.indexOf("http")!==0?!1:(C=i.document.createElement("a"),C.href=F,C.protocol+$(C.protocol,C.host)!==B.protocol+$(B.protocol,B.host))},ajaxDataType:"text",contentType:"application/json; charset=UTF-8",logging:!1,state:a.connectionState.disconnected,clientProtocol:"2.1",supportedProtocols:["1.5","2.0","2.1"],negotiateRedirectSupportedProtocols:["2.0","2.1"],reconnectDelay:2e3,transportConnectTimeout:0,disconnectTimeout:3e4,reconnectWindow:3e4,keepAliveWarnAt:2/3,start:function(F,B){var C=this,I={pingInterval:3e5,waitForPageLoad:!0,transport:"auto",jsonp:!1},G,H=C._deferral||t.Deferred(),K=i.document.createElement("a"),ie=function(ne,oe){ne.url===oe&&ne.baseUrl||(ne.url=oe,K.href=ne.url,!K.protocol||K.protocol===":"?(ne.protocol=i.document.location.protocol,ne.host=K.host||i.document.location.host):(ne.protocol=K.protocol,ne.host=K.host),ne.baseUrl=ne.protocol+"//"+ne.host,ne.wsProtocol=ne.protocol==="https:"?"wss://":"ws://",ne.url.indexOf("//")===0&&(ne.url=i.location.protocol+ne.url,ne.log("Protocol relative URL detected, normalizing it to '"+ne.url+"'.")),ne.isCrossDomain(ne.url)&&(ne.log("Auto detected cross domain url."),I.transport==="auto"&&(I.transport=["webSockets","serverSentEvents","longPolling"]),typeof ne.withCredentials>"u"&&(ne.withCredentials=!0),t.support.cors||(ne.ajaxDataType="jsonp",ne.log("Using jsonp because this browser doesn't support CORS.")),ne.contentType=a._.defaultContentType))};if(C.lastError=null,C._deferral=H,!C.json)throw new Error("SignalR: No JSON parser found. Please ensure json2.js is referenced before the SignalR.js file if you need to support clients without native JSON parsing support, e.g. IE<8.");if(t.type(F)==="function"?B=F:t.type(F)==="object"&&(t.extend(I,F),t.type(I.callback)==="function"&&(B=I.callback)),I.transport=A(I.transport,C),!I.transport)throw new Error("SignalR: Invalid transport(s) specified, aborting start.");if(C._.config=I,!l&&I.waitForPageLoad===!0)return C._.deferredStartHandler=function(){C.start(F,B)},u.bind("load",C._.deferredStartHandler),H.promise();if(C.state===a.connectionState.connecting)return H.promise();if(y(C,a.connectionState.disconnected,a.connectionState.connecting)===!1)return H.resolve(C),H.promise();k(C),I.transport==="auto"&&I.jsonp===!0&&(I.transport="longPolling"),C.withCredentials=I.withCredentials,C._originalUrl=C.url,C.ajaxDataType=I.jsonp?"jsonp":"text",ie(C,C.url),t(C).bind(h.onStart,function(re,ne){t.type(B)==="function"&&B.call(C),H.resolve(C)}),C._.initHandler=a.transports._logic.initHandler(C),G=function(ne,oe){var de=a._.error(n.noTransportOnInit);if(oe=oe||0,oe>=ne.length){oe===0?C.log("No transports supported by the server were selected."):oe===1?C.log("No fallback transports were selected."):C.log("Fallback transports exhausted."),t(C).triggerHandler(h.onError,[de]),H.reject(de),C.stop();return}if(C.state!==a.connectionState.disconnected){var ve=ne[oe],ke=a.transports[ve],De=function(){G(ne,oe+1)};C.transport=ke;try{C._.initHandler.start(ke,function(){var Me=a._.firefoxMajorVersion(i.navigator.userAgent)>=11,Ne=!0;C.log("The start request succeeded. Transitioning to the connected state."),_(C)&&a.transports._logic.monitorKeepAlive(C),a.transports._logic.startHeartbeat(C),a._.configurePingInterval(C),y(C,a.connectionState.connecting,a.connectionState.connected)||C.log("WARNING! The connection was not in the connecting state."),C._.connectingMessageBuffer.drain(),t(C).triggerHandler(h.onStart),u.bind("unload",function(){C.log("Window unloading, stopping the connection."),C.stop(Ne)}),Me&&u.bind("beforeunload",function(){i.setTimeout(function(){C.stop(Ne)},0)})},De)}catch(Me){C.log(ke.name+" transport threw '"+Me.message+"' when attempting to start."),De()}}};var he=C.url+"/negotiate",fe=function(ne,oe){var de=a._.error(n.errorOnNegotiate,ne,oe._.negotiateRequest);t(oe).triggerHandler(h.onError,de),H.reject(de),oe.stop()};return t(C).triggerHandler(h.onStarting),he=a.transports._logic.prepareQueryString(C,he),C.log("Negotiating with '"+he+"'."),C._.negotiateRequest=function(){var re,ne=0,oe=100,de,ve,ke=[],De=[],Me=function(Re,Oe){var Ve=a.transports._logic.prepareQueryString(Re,Re.url+"/negotiate");Re.log("Negotiating with '"+Ve+"'.");var nt={url:Ve,error:function(Nt,Mi){Mi!==c?fe(Nt,Re):H.reject(a._.error(n.stoppedWhileNegotiating,null,Re._.negotiateRequest))},success:Oe};return Re.accessToken&&(nt.headers={Authorization:"Bearer "+Re.accessToken}),a.transports._logic.ajax(Re,nt)},Ne=function Ye(Re){try{re=C._parseResponse(Re)}catch(Ve){fe(a._.error(n.errorParsingNegotiateResponse,Ve),C);return}if(re.availableTransports){ve=a._.error(n.aspnetCoreSignalrServer),t(C).triggerHandler(h.onError,[ve]),H.reject(ve);return}if(!re.ProtocolVersion||C.supportedProtocols.indexOf(re.ProtocolVersion)===-1){ve=a._.error(a._.format(n.protocolIncompatible,C.clientProtocol,re.ProtocolVersion)),t(C).triggerHandler(h.onError,[ve]),H.reject(ve);return}if(C.negotiateRedirectSupportedProtocols.indexOf(re.ProtocolVersion)!==-1){if(re.Error){ve=a._.error(a._.format(n.errorFromServer,re.Error)),t(C).triggerHandler(h.onError,[ve]),H.reject(ve);return}else if(re.RedirectUrl){if(ne===oe){fe(a._.error(n.errorRedirectionExceedsLimit),C);return}I.transport==="auto"&&(I.transport=["webSockets","serverSentEvents","longPolling"]),C.log("Received redirect to: "+re.RedirectUrl),C.accessToken=re.AccessToken;var Oe=re.RedirectUrl.split("?",2);if(ie(C,Oe[0]),C._.redirectQs=Oe.length===2?Oe[1]:null,C.ajaxDataType==="jsonp"&&C.accessToken){fe(a._.error(n.jsonpNotSupportedWithAccessToken),C);return}ne++,Me(C,Ye);return}}de=C._.keepAliveData,C.appRelativeUrl=re.Url,C.id=re.ConnectionId,C.token=re.ConnectionToken,C.webSocketServerUrl=re.WebSocketServerUrl,C._.pollTimeout=re.ConnectionTimeout*1e3+1e4,C.disconnectTimeout=re.DisconnectTimeout*1e3,C._.totalTransportConnectTimeout=C.transportConnectTimeout+re.TransportConnectTimeout*1e3,re.KeepAliveTimeout?(de.activated=!0,de.timeout=re.KeepAliveTimeout*1e3,de.timeoutWarning=de.timeout*C.keepAliveWarnAt,C._.beatInterval=(de.timeout-de.timeoutWarning)/3):de.activated=!1,C.reconnectWindow=C.disconnectTimeout+(de.timeout||0),t.each(a.transports,function(Ve){if(Ve.indexOf("_")===0||Ve==="webSockets"&&!re.TryWebSockets)return!0;De.push(Ve)}),t.isArray(I.transport)?t.each(I.transport,function(Ve,nt){t.inArray(nt,De)>=0&&ke.push(nt)}):I.transport==="auto"?ke=De:t.inArray(I.transport,De)>=0&&ke.push(I.transport),G(ke)};return Me(C,Ne)}(),H.promise()},starting:function(F){var B=this;return t(B).bind(h.onStarting,function(C,I){F.call(B)}),B},send:function(F){var B=this;if(B.state===a.connectionState.disconnected)throw new Error("SignalR: Connection must be started before data can be sent. Call .start() before .send()");if(B.state===a.connectionState.connecting)throw new Error("SignalR: Connection has not been fully initialized. Use .start().done() or .start().fail() to run logic after the connection has started.");return B.transport.send(B,F),B},received:function(F){var B=this;return t(B).bind(h.onReceived,function(C,I){F.call(B,I)}),B},stateChanged:function(F){var B=this;return t(B).bind(h.onStateChanged,function(C,I){F.call(B,I)}),B},error:function(F){var B=this;return t(B).bind(h.onError,function(C,I,G){B.lastError=I,F.call(B,I,G)}),B},disconnected:function(F){var B=this;return t(B).bind(h.onDisconnect,function(C,I){F.call(B)}),B},connectionSlow:function(F){var B=this;return t(B).bind(h.onConnectionSlow,function(C,I){F.call(B)}),B},reconnecting:function(F){var B=this;return t(B).bind(h.onReconnecting,function(C,I){F.call(B)}),B},reconnected:function(F){var B=this;return t(B).bind(h.onReconnect,function(C,I){F.call(B)}),B},stop:function(F,B){var C=this,I=C._deferral;if(C._.deferredStartHandler&&u.unbind("load",C._.deferredStartHandler),delete C._.config,delete C._.deferredStartHandler,!l&&(!C._.config||C._.config.waitForPageLoad===!0)){C.log("Stopping connection prior to negotiate."),I&&I.reject(a._.error(n.stoppedWhileLoading));return}if(C.state!==a.connectionState.disconnected)return C.log("Stopping connection."),i.clearTimeout(C._.beatHandle),i.clearInterval(C._.pingIntervalId),C.transport&&(C.transport.stop(C),B!==!1&&C.transport.abort(C,F),_(C)&&a.transports._logic.stopMonitoringKeepAlive(C),C.transport=null),C._.negotiateRequest&&(C._.negotiateRequest.abort(c),delete C._.negotiateRequest),C._.initHandler&&C._.initHandler.stop(),delete C._deferral,delete C.messageId,delete C.groupsToken,delete C.id,delete C._.pingIntervalId,delete C._.lastMessageAt,delete C._.lastActiveAt,C._.connectingMessageBuffer.clear(),t(C).unbind(h.onStart),delete C.accessToken,delete C.protocol,delete C.host,delete C.baseUrl,delete C.wsProtocol,delete C.contentType,C.url=C._originalUrl,C._.redirectQs=null,y(C,C.state,a.connectionState.disconnected),t(C).triggerHandler(h.onDisconnect),C},log:function(F){g(F,this.logging)}},a.fn.init.prototype=a.fn,a.noConflict=function(){return t.connection===a&&(t.connection=o),a},t.connection&&(o=t.connection),t.connection=t.signalR=a}(e,window),function(t,i,r){var n=t.signalR,a=t.signalR.events,o=t.signalR.changeState,l="__Start Aborted__",u;n.transports={};function c(y){y._.keepAliveData.monitoring&&h(y),u.markActive(y)&&(y._.beatHandle=i.setTimeout(function(){c(y)},y._.beatInterval))}function h(y){var p=y._.keepAliveData,_;y.state===n.connectionState.connected&&(_=new Date().getTime()-y._.lastMessageAt,_>=p.timeout?(y.log("Keep alive timed out. Notifying transport that connection has been lost."),y.transport.lostConnection(y)):_>=p.timeoutWarning?p.userNotified||(y.log("Keep alive has been missed, connection may be dead/slow."),t(y).triggerHandler(a.onConnectionSlow),p.userNotified=!0):p.userNotified=!1)}function d(y,p){var _=y.url+p;return y.transport&&(_+="?transport="+y.transport.name),u.prepareQueryString(y,_)}function g(y){this.connection=y,this.startRequested=!1,this.startCompleted=!1,this.connectionStopped=!1}g.prototype={start:function(p,_,k){var A=this,N=A.connection,$=!1;if(A.startRequested||A.connectionStopped){N.log("WARNING! "+p.name+" transport cannot be started. Initialization ongoing or completed.");return}N.log(p.name+" transport starting."),p.start(N,function(){$||A.initReceived(p,_)},function(R){return $||($=!0,A.transportFailed(p,R,k)),!A.startCompleted||A.connectionStopped}),A.transportTimeoutHandle=i.setTimeout(function(){$||($=!0,N.log(p.name+" transport timed out when trying to connect."),A.transportFailed(p,r,k))},N._.totalTransportConnectTimeout)},stop:function(){this.connectionStopped=!0,i.clearTimeout(this.transportTimeoutHandle),n.transports._logic.tryAbortStartRequest(this.connection)},initReceived:function(p,_){var k=this,A=k.connection;if(k.startRequested){A.log("WARNING! The client received multiple init messages.");return}k.connectionStopped||(k.startRequested=!0,i.clearTimeout(k.transportTimeoutHandle),A.log(p.name+" transport connected. Initiating start request."),n.transports._logic.ajaxStart(A,function(){k.startCompleted=!0,_()}))},transportFailed:function(p,_,k){var A=this.connection,N=A._deferral,$;this.connectionStopped||(i.clearTimeout(this.transportTimeoutHandle),this.startRequested?this.startCompleted||($=n._.error(n.resources.errorDuringStartRequest,_),A.log(p.name+" transport failed during the start request. Stopping the connection."),t(A).triggerHandler(a.onError,[$]),N&&N.reject($),A.stop()):(p.stop(A),A.log(p.name+" transport failed to connect. Attempting to fall back."),k()))}},u=n.transports._logic={ajax:function(p,_){return t.ajax(t.extend(!0,{},t.signalR.ajaxDefaults,{type:"GET",data:{},xhrFields:{withCredentials:p.withCredentials},contentType:p.contentType,dataType:p.ajaxDataType},_))},pingServer:function(p){var _,k,A=t.Deferred();return p.transport?(_=p.url+"/ping",_=u.addQs(_,p.qs),k=u.ajax(p,{url:_,headers:p.accessToken?{Authorization:"Bearer "+p.accessToken}:{},success:function($){var R;try{R=p._parseResponse($)}catch(L){A.reject(n._.transportError(n.resources.pingServerFailedParse,p.transport,L,k)),p.stop();return}R.Response==="pong"?A.resolve():A.reject(n._.transportError(n._.format(n.resources.pingServerFailedInvalidResponse,$),p.transport,null,k))},error:function($){$.status===401||$.status===403?(A.reject(n._.transportError(n._.format(n.resources.pingServerFailedStatusCode,$.status),p.transport,$,k)),p.stop()):A.reject(n._.transportError(n.resources.pingServerFailed,p.transport,$,k))}})):A.reject(n._.transportError(n.resources.noConnectionTransport,p.transport)),A.promise()},prepareQueryString:function(p,_){var k;return k=u.addQs(_,"clientProtocol="+p.clientProtocol),typeof p._.redirectQs=="string"?k=u.addQs(k,p._.redirectQs):k=u.addQs(k,p.qs),p.token&&(k+="&connectionToken="+i.encodeURIComponent(p.token)),p.data&&(k+="&connectionData="+i.encodeURIComponent(p.data)),k},addQs:function(p,_){var k=p.indexOf("?")!==-1?"&":"?",A;if(!_)return p;if((typeof _>"u"?"undefined":s(_))==="object")return p+k+t.param(_);if(typeof _=="string")return A=_.charAt(0),(A==="?"||A==="&")&&(k=""),p+k+_;throw new Error("Query string property must be either a string or object.")},getUrl:function(p,_,k,A,N){var $=_==="webSockets"?"":p.baseUrl,R=$+p.appRelativeUrl,L="transport="+_;return!N&&p.groupsToken&&(L+="&groupsToken="+i.encodeURIComponent(p.groupsToken)),k?(A?R+="/poll":R+="/reconnect",!N&&p.messageId&&(L+="&messageId="+i.encodeURIComponent(p.messageId))):R+="/connect",R+="?"+L,R=u.prepareQueryString(p,R),p.transport&&p.accessToken&&(p.transport.name==="serverSentEvents"||p.transport.name==="webSockets")&&(R+="&access_token="+i.encodeURIComponent(p.accessToken)),N||(R+="&tid="+Math.floor(Math.random()*11)),R},maximizePersistentResponse:function(p){return{MessageId:p.C,Messages:p.M,Initialized:typeof p.S<"u",ShouldReconnect:typeof p.T<"u",LongPollDelay:p.L,GroupsToken:p.G,Error:p.E}},updateGroups:function(p,_){_&&(p.groupsToken=_)},stringifySend:function(p,_){return typeof _=="string"||typeof _>"u"||_===null?_:p.json.stringify(_)},ajaxSend:function(p,_){var k=u.stringifySend(p,_),A=d(p,"/send"),N,$=function(L,F){t(F).triggerHandler(a.onError,[n._.transportError(n.resources.sendFailed,F.transport,L,N),_])};return N=u.ajax(p,{url:A,type:p.ajaxDataType==="jsonp"?"GET":"POST",contentType:n._.defaultContentType,headers:p.accessToken?{Authorization:"Bearer "+p.accessToken}:{},data:{data:k},success:function(L){var F;if(L){try{F=p._parseResponse(L)}catch(B){$(B,p),p.stop();return}u.triggerReceived(p,F)}},error:function(L,F){F==="abort"||F==="parsererror"||$(L,p)}}),N},ajaxAbort:function(p,_){if(!(typeof p.transport>"u")){_=typeof _>"u"?!0:_;var k=d(p,"/abort");u.ajax(p,{url:k,async:_,timeout:1e3,type:"POST",headers:p.accessToken?{Authorization:"Bearer "+p.accessToken}:{},dataType:"text"}),p.log("Fired ajax abort async = "+_+".")}},ajaxStart:function(p,_){var k=function($){var R=p._deferral;R&&R.reject($)},A=function($){p.log("The start request failed. Stopping the connection."),t(p).triggerHandler(a.onError,[$]),k($),p.stop()};p._.startRequest=u.ajax(p,{url:d(p,"/start"),headers:p.accessToken?{Authorization:"Bearer "+p.accessToken}:{},success:function($,R,L){var F;try{F=p._parseResponse($)}catch(B){A(n._.error(n._.format(n.resources.errorParsingStartResponse,$),B,L));return}F.Response==="started"?_():A(n._.error(n._.format(n.resources.invalidStartResponse,$),null,L))},error:function($,R,L){R!==l?A(n._.error(n.resources.errorDuringStartRequest,L,$)):(p.log("The start request aborted because connection.stop() was called."),k(n._.error(n.resources.stoppedDuringStartRequest,null,$)))}})},tryAbortStartRequest:function(p){p._.startRequest&&(p._.startRequest.abort(l),delete p._.startRequest)},tryInitialize:function(p,_,k){_.Initialized&&k?k():_.Initialized&&p.log("WARNING! The client received an init message after reconnecting.")},triggerReceived:function(p,_){p._.connectingMessageBuffer.tryBuffer(_)||t(p).triggerHandler(a.onReceived,[_])},processMessages:function(p,_,k){var A;if(_&&typeof _.I<"u"){u.triggerReceived(p,_);return}if(u.markLastMessage(p),_){if(A=u.maximizePersistentResponse(_),A.Error){p.log("Received an error message from the server: "+_.E),t(p).triggerHandler(n.events.onError,[n._.error(_.E,"ServerError")]),p.stop(!1,!1);return}u.updateGroups(p,A.GroupsToken),A.MessageId&&(p.messageId=A.MessageId),A.Messages&&(t.each(A.Messages,function(N,$){u.triggerReceived(p,$)}),u.tryInitialize(p,A,k))}},monitorKeepAlive:function(p){var _=p._.keepAliveData;_.monitoring?p.log("Tried to monitor keep alive but it's already being monitored."):(_.monitoring=!0,u.markLastMessage(p),p._.keepAliveData.reconnectKeepAliveUpdate=function(){u.markLastMessage(p)},t(p).bind(a.onReconnect,p._.keepAliveData.reconnectKeepAliveUpdate),p.log("Now monitoring keep alive with a warning timeout of "+_.timeoutWarning+", keep alive timeout of "+_.timeout+" and disconnecting timeout of "+p.disconnectTimeout))},stopMonitoringKeepAlive:function(p){var _=p._.keepAliveData;_.monitoring&&(_.monitoring=!1,t(p).unbind(a.onReconnect,p._.keepAliveData.reconnectKeepAliveUpdate),p._.keepAliveData={},p.log("Stopping the monitoring of the keep alive."))},startHeartbeat:function(p){p._.lastActiveAt=new Date().getTime(),c(p)},markLastMessage:function(p){p._.lastMessageAt=new Date().getTime()},markActive:function(p){return u.verifyLastActive(p)?(p._.lastActiveAt=new Date().getTime(),!0):!1},isConnectedOrReconnecting:function(p){return p.state===n.connectionState.connected||p.state===n.connectionState.reconnecting},ensureReconnectingState:function(p){return o(p,n.connectionState.connected,n.connectionState.reconnecting)===!0&&t(p).triggerHandler(a.onReconnecting),p.state===n.connectionState.reconnecting},clearReconnectTimeout:function(p){p&&p._.reconnectTimeout&&(i.clearTimeout(p._.reconnectTimeout),delete p._.reconnectTimeout)},verifyLastActive:function(p){if(new Date().getTime()-p._.lastActiveAt>=p.reconnectWindow){var _=n._.format(n.resources.reconnectWindowTimeout,new Date(p._.lastActiveAt),p.reconnectWindow);return p.log(_),t(p).triggerHandler(a.onError,[n._.error(_,"TimeoutException")]),p.stop(!1,!1),!1}return!0},reconnect:function(p,_){var k=n.transports[_];if(u.isConnectedOrReconnecting(p)&&!p._.reconnectTimeout){if(!u.verifyLastActive(p))return;p._.reconnectTimeout=i.setTimeout(function(){u.verifyLastActive(p)&&(k.stop(p),u.ensureReconnectingState(p)&&(p.log(_+" reconnecting."),k.start(p)))},p.reconnectDelay)}},handleParseFailure:function(p,_,k,A,N){var $=n._.transportError(n._.format(n.resources.parseFailed,_),p.transport,k,N);A&&A($)?p.log("Failed to parse server response while attempting to connect."):(t(p).triggerHandler(a.onError,[$]),p.stop())},initHandler:function(p){return new g(p)},foreverFrame:{count:0,connections:{}}}}(e,window),function(t,i,r){var n=t.signalR,a=t.signalR.events,o=t.signalR.changeState,l=n.transports._logic;n.transports.webSockets={name:"webSockets",supportsKeepAlive:function(){return!0},send:function(c,h){var d=l.stringifySend(c,h);try{c.socket.send(d)}catch(g){t(c).triggerHandler(a.onError,[n._.transportError(n.resources.webSocketsInvalidState,c.transport,g,c.socket),h])}},start:function(c,h,d){var g,y=!1,p=this,_=!h,k=t(c);if(!i.WebSocket){d();return}c.socket||(c.webSocketServerUrl?g=c.webSocketServerUrl:g=c.wsProtocol+c.host,g+=l.getUrl(c,this.name,_),c.log("Connecting to websocket endpoint '"+g+"'."),c.socket=new i.WebSocket(g),c.socket.onopen=function(){y=!0,c.log("Websocket opened."),l.clearReconnectTimeout(c),o(c,n.connectionState.reconnecting,n.connectionState.connected)===!0&&k.triggerHandler(a.onReconnect)},c.socket.onclose=function(A){var N;this===c.socket&&(y&&typeof A.wasClean<"u"&&A.wasClean===!1?(N=n._.transportError(n.resources.webSocketClosed,c.transport,A),c.log("Unclean disconnect from websocket: "+(A.reason||"[no reason given]."))):c.log("Websocket closed."),(!d||!d(N))&&(N&&t(c).triggerHandler(a.onError,[N]),p.reconnect(c)))},c.socket.onmessage=function(A){var N;try{N=c._parseResponse(A.data)}catch($){l.handleParseFailure(c,A.data,$,d,A);return}N&&l.processMessages(c,N,h)})},reconnect:function(c){l.reconnect(c,this.name)},lostConnection:function(c){this.reconnect(c)},stop:function(c){l.clearReconnectTimeout(c),c.socket&&(c.log("Closing the Websocket."),c.socket.close(),c.socket=null)},abort:function(c,h){l.ajaxAbort(c,h)}}}(e,window),function(t,i,r){var n=t.signalR,a=t.signalR.events,o=t.signalR.changeState,l=n.transports._logic,u=function(h){i.clearTimeout(h._.reconnectAttemptTimeoutHandle),delete h._.reconnectAttemptTimeoutHandle};n.transports.serverSentEvents={name:"serverSentEvents",supportsKeepAlive:function(){return!0},timeOut:3e3,start:function(h,d,g){var y=this,p=!1,_=t(h),k=!d,A;if(h.eventSource&&(h.log("The connection already has an event source. Stopping it."),h.stop()),!i.EventSource){g&&(h.log("This browser doesn't support SSE."),g());return}A=l.getUrl(h,this.name,k);try{h.log("Attempting to connect to SSE endpoint '"+A+"'."),h.eventSource=new i.EventSource(A,{withCredentials:h.withCredentials})}catch(N){h.log("EventSource failed trying to connect with error "+N.Message+"."),g?g():(_.triggerHandler(a.onError,[n._.transportError(n.resources.eventSourceFailedToConnect,h.transport,N)]),k&&y.reconnect(h));return}k&&(h._.reconnectAttemptTimeoutHandle=i.setTimeout(function(){p===!1&&h.eventSource.readyState!==i.EventSource.OPEN&&y.reconnect(h)},y.timeOut)),h.eventSource.addEventListener("open",function(N){h.log("EventSource connected."),u(h),l.clearReconnectTimeout(h),p===!1&&(p=!0,o(h,n.connectionState.reconnecting,n.connectionState.connected)===!0&&_.triggerHandler(a.onReconnect))},!1),h.eventSource.addEventListener("message",function(N){var $;if(N.data!=="initialized"){try{$=h._parseResponse(N.data)}catch(R){l.handleParseFailure(h,N.data,R,g,N);return}l.processMessages(h,$,d)}},!1),h.eventSource.addEventListener("error",function(N){var $=n._.transportError(n.resources.eventSourceError,h.transport,N);this===h.eventSource&&(g&&g($)||(h.log("EventSource readyState: "+h.eventSource.readyState+"."),N.eventPhase===i.EventSource.CLOSED?(h.log("EventSource reconnecting due to the server connection ending."),y.reconnect(h)):(h.log("EventSource error."),_.triggerHandler(a.onError,[$]))))},!1)},reconnect:function(h){l.reconnect(h,this.name)},lostConnection:function(h){this.reconnect(h)},send:function(h,d){l.ajaxSend(h,d)},stop:function(h){u(h),l.clearReconnectTimeout(h),h&&h.eventSource&&(h.log("EventSource calling close()."),h.eventSource.close(),h.eventSource=null,delete h.eventSource)},abort:function(h,d){l.ajaxAbort(h,d)}}}(e,window),function(t,i,r){var n=t.signalR,a=t.signalR.events,o=t.signalR.changeState,l=n.transports._logic,u=function(){var d=i.document.createElement("iframe");return d.setAttribute("style","position:absolute;top:0;left:0;width:0;height:0;visibility:hidden;"),d},c=function(){var h=null,d=1e3,g=0;return{prevent:function(){n._.ieVersion<=8&&(g===0&&(h=i.setInterval(function(){var p=u();i.document.body.appendChild(p),i.document.body.removeChild(p),p=null},d)),g++)},cancel:function(){g===1&&i.clearInterval(h),g>0&&g--}}}();n.transports.foreverFrame={name:"foreverFrame",supportsKeepAlive:function(){return!0},iframeClearThreshold:50,start:function(d,g,y){if(d.accessToken){y&&(d.log("Forever Frame does not support connections that require a Bearer token to connect, such as the Azure SignalR Service."),y());return}var p=this,_=l.foreverFrame.count+=1,k,A=u(),N=function(){d.log("Forever frame iframe finished loading and is no longer receiving messages."),(!y||!y())&&p.reconnect(d)};if(i.EventSource){y&&(d.log("Forever Frame is not supported by SignalR on browsers with SSE support."),y());return}A.setAttribute("data-signalr-connection-id",d.id),c.prevent(),k=l.getUrl(d,this.name),k+="&frameId="+_,i.document.documentElement.appendChild(A),d.log("Binding to iframe's load event."),A.addEventListener?A.addEventListener("load",N,!1):A.attachEvent&&A.attachEvent("onload",N),A.src=k,l.foreverFrame.connections[_]=d,d.frame=A,d.frameId=_,g&&(d.onSuccess=function(){d.log("Iframe transport started."),g()})},reconnect:function(d){var g=this;l.isConnectedOrReconnecting(d)&&l.verifyLastActive(d)&&i.setTimeout(function(){if(l.verifyLastActive(d)&&d.frame&&l.ensureReconnectingState(d)){var y=d.frame,p=l.getUrl(d,g.name,!0)+"&frameId="+d.frameId;d.log("Updating iframe src to '"+p+"'."),y.src=p}},d.reconnectDelay)},lostConnection:function(d){this.reconnect(d)},send:function(d,g){l.ajaxSend(d,g)},receive:function(d,g){var y,p,_;if(d.json!==d._originalJson&&(g=d._originalJson.stringify(g)),_=d._parseResponse(g),l.processMessages(d,_,d.onSuccess),d.state===t.signalR.connectionState.connected&&(d.frameMessageCount=(d.frameMessageCount||0)+1,d.frameMessageCount>n.transports.foreverFrame.iframeClearThreshold&&(d.frameMessageCount=0,y=d.frame.contentWindow||d.frame.contentDocument,y&&y.document&&y.document.body)))for(p=y.document.body;p.firstChild;)p.removeChild(p.firstChild)},stop:function(d){var g=null;if(c.cancel(),d.frame){if(d.frame.stop)d.frame.stop();else try{g=d.frame.contentWindow||d.frame.contentDocument,g.document&&g.document.execCommand&&g.document.execCommand("Stop")}catch(y){d.log("Error occurred when stopping foreverFrame transport. Message = "+y.message+".")}d.frame.parentNode===i.document.documentElement&&i.document.documentElement.removeChild(d.frame),delete l.foreverFrame.connections[d.frameId],d.frame=null,d.frameId=null,delete d.frame,delete d.frameId,delete d.onSuccess,delete d.frameMessageCount,d.log("Stopping forever frame.")}},abort:function(d,g){l.ajaxAbort(d,g)},getConnection:function(d){return l.foreverFrame.connections[d]},started:function(d){o(d,n.connectionState.reconnecting,n.connectionState.connected)===!0&&t(d).triggerHandler(a.onReconnect)}}}(e,window),function(t,i,r){var n=t.signalR,a=t.signalR.events,o=t.signalR.changeState,l=t.signalR.isDisconnecting,u=n.transports._logic;n.transports.longPolling={name:"longPolling",supportsKeepAlive:function(){return!1},reconnectDelay:3e3,start:function(h,d,g){var y=this,p=function(){p=t.noop,h.log("LongPolling connected."),d?d():h.log("WARNING! The client received an init message after reconnecting.")},_=function(L){return g(L)?(h.log("LongPolling failed to connect."),!0):!1},k=h._,A=0,N=function(L){i.clearTimeout(k.reconnectTimeoutId),k.reconnectTimeoutId=null,o(L,n.connectionState.reconnecting,n.connectionState.connected)===!0&&(L.log("Raising the reconnect event"),t(L).triggerHandler(a.onReconnect))},$=36e5;h.pollXhr&&(h.log("Polling xhr requests already exists, aborting."),h.stop()),h.messageId=null,k.reconnectTimeoutId=null,k.pollTimeoutId=i.setTimeout(function(){(function R(L,F){var B=L.messageId,C=B===null,I=!C,G=!F,H=u.getUrl(L,y.name,I,G,!0),K={};L.messageId&&(K.messageId=L.messageId),L.groupsToken&&(K.groupsToken=L.groupsToken),l(L)!==!0&&(h.log("Opening long polling request to '"+H+"'."),L.pollXhr=u.ajax(h,{xhrFields:{onprogress:function(){u.markLastMessage(h)}},url:H,type:"POST",contentType:n._.defaultContentType,data:K,timeout:h._.pollTimeout,headers:h.accessToken?{Authorization:"Bearer "+h.accessToken}:{},success:function(he){var fe,re=0,ne,oe;h.log("Long poll complete."),A=0;try{fe=h._parseResponse(he)}catch(de){u.handleParseFailure(L,he,de,_,L.pollXhr);return}k.reconnectTimeoutId!==null&&N(L),fe&&(ne=u.maximizePersistentResponse(fe)),u.processMessages(L,fe,p),ne&&t.type(ne.LongPollDelay)==="number"&&(re=ne.LongPollDelay),l(L)!==!0&&(oe=ne&&ne.ShouldReconnect,!(oe&&!u.ensureReconnectingState(L))&&(re>0?k.pollTimeoutId=i.setTimeout(function(){R(L,oe)},re):R(L,oe)))},error:function(he,fe){var re=n._.transportError(n.resources.longPollFailed,h.transport,he,L.pollXhr);if(i.clearTimeout(k.reconnectTimeoutId),k.reconnectTimeoutId=null,fe==="abort"){h.log("Aborted xhr request.");return}if(!_(re)){if(A++,h.state!==n.connectionState.reconnecting&&(h.log("An error occurred using longPolling. Status = "+fe+". Response = "+he.responseText+"."),t(L).triggerHandler(a.onError,[re])),(h.state===n.connectionState.connected||h.state===n.connectionState.reconnecting)&&!u.verifyLastActive(h)||!u.ensureReconnectingState(L))return;k.pollTimeoutId=i.setTimeout(function(){R(L,!0)},y.reconnectDelay)}}}),I&&F===!0&&(k.reconnectTimeoutId=i.setTimeout(function(){N(L)},Math.min(1e3*(Math.pow(2,A)-1),$))))})(h)},250)},lostConnection:function(h){h.pollXhr&&h.pollXhr.abort("lostConnection")},send:function(h,d){u.ajaxSend(h,d)},stop:function(h){i.clearTimeout(h._.pollTimeoutId),i.clearTimeout(h._.reconnectTimeoutId),delete h._.pollTimeoutId,delete h._.reconnectTimeoutId,h.pollXhr&&(h.pollXhr.abort(),h.pollXhr=null,delete h.pollXhr)},abort:function(h,d){u.ajaxAbort(h,d)}}}(e,window),function(t,i,r){var n=0,a=".hubProxy",o=t.signalR;function l(_){return _+a}function u(_,k,A){var N,$=_.length,R=[];for(N=0;N<$;N+=1)_.hasOwnProperty(N)&&(R[N]=k.call(A,_[N],N,_));return R}function c(_){return t.isFunction(_)||t.type(_)==="undefined"?null:_}function h(_){for(var k in _)if(_.hasOwnProperty(k))return!0;return!1}function d(_,k){var A=_._.invocationCallbacks,N;h(A)&&_.log("Clearing hub invocation callbacks with error: "+k+"."),_._.invocationCallbackId=0,delete _._.invocationCallbacks,_._.invocationCallbacks={};for(var $ in A)N=A[$],N.method.call(N.scope,{E:k})}function g(_){return t.isFunction(_)&&_.toString().slice(0,256).indexOf("// Call the client hub method")>=0}function y(_,k){return new y.fn.init(_,k)}y.fn=y.prototype={init:function(k,A){this.state={},this.connection=k,this.hubName=A,this._={callbackMap:{}}},constructor:y,hasSubscriptions:function(){return h(this._.callbackMap)},on:function(k,A,N){var $=this,R=$._.callbackMap,L=!N&&g(A);N=N||A,N._signalRGuid||(N._signalRGuid=n++),k=k.toLowerCase();var F=R[k];F||(F=[],R[k]=F);for(var B,C=0;C<F.length;C++)(F[C].guid===N._signalRGuid||L&&F[C].isFromOldGeneratedHubProxy)&&(B=F[C]);B||(B={guid:N._signalRGuid,eventHandlers:[],isFromOldGeneratedHubProxy:L},R[k].push(B));var I=function(H,K){A.apply($,K)};return B.eventHandlers.push(I),t($).bind(l(k),I),$},off:function(k,A,N){var $=this,R=$._.callbackMap,L,F=!N&&g(A);if(N=N||A,k=k.toLowerCase(),L=R[k],L)if(A){for(var B,C=0;C<L.length;C++)(L[C].guid===N._signalRGuid||F&&L[C].isFromOldGeneratedHubProxy)&&(B=L[C]);if(B){for(var I=0;I<B.eventHandlers.length;I++)t($).unbind(l(k),B.eventHandlers[I]);L.splice(C,1),L.length===0&&delete R[k]}}else A||(t($).unbind(l(k)),delete R[k]);return $},invoke:function(k){var A=this,N=A.connection,$=t.makeArray(arguments).slice(1),R=u($,c),L={H:A.hubName,M:k,A:R,I:N._.invocationCallbackId},F=t.Deferred(),B=function(I){var G=A._maximizeHubResponse(I),H,K;t.extend(A.state,G.State),G.Progress?F.notifyWith?F.notifyWith(A,[G.Progress.Data]):N._.progressjQueryVersionLogged||(N.log("A hub method invocation progress update was received but the version of jQuery in use ("+t.prototype.jquery+") does not support progress updates. Upgrade to jQuery 1.7+ to receive progress notifications."),N._.progressjQueryVersionLogged=!0):G.Error?(G.StackTrace&&N.log(G.Error+`
341
- `+G.StackTrace+"."),H=G.IsHubException?"HubException":"Exception",K=o._.error(G.Error,H),K.data=G.ErrorData,N.log(A.hubName+"."+k+" failed to execute. Error: "+K.message),F.rejectWith(A,[K])):(N.log("Invoked "+A.hubName+"."+k),F.resolveWith(A,[G.Result]))};return N._.invocationCallbacks[N._.invocationCallbackId.toString()]={scope:A,method:B},N._.invocationCallbackId+=1,t.isEmptyObject(A.state)||(L.S=A.state),N.log("Invoking "+A.hubName+"."+k),N.send(L),F.promise()},_maximizeHubResponse:function(k){return{State:k.S,Result:k.R,Progress:k.P?{Id:k.P.I,Data:k.P.D}:null,Id:k.I,IsHubException:k.H,Error:k.E,StackTrace:k.T,ErrorData:k.D}}},y.fn.init.prototype=y.fn;function p(_,k){var A={qs:null,logging:!1,useDefaultPath:!0};return t.extend(A,k),(!_||A.useDefaultPath)&&(_=(_||"")+"/signalr"),new p.fn.init(_,A)}p.fn=p.prototype=t.connection(),p.fn.init=function(_,k){var A={qs:null,logging:!1,useDefaultPath:!0},N=this;t.extend(A,k),t.signalR.fn.init.call(N,_,A.qs,A.logging),N.proxies={},N._.invocationCallbackId=0,N._.invocationCallbacks={},N.received(function($){var R,L,F,B,C,I;$&&(typeof $.P<"u"?(F=$.P.I.toString(),B=N._.invocationCallbacks[F],B&&B.method.call(B.scope,$)):typeof $.I<"u"?(F=$.I.toString(),B=N._.invocationCallbacks[F],B&&(N._.invocationCallbacks[F]=null,delete N._.invocationCallbacks[F],B.method.call(B.scope,$))):(R=this._maximizeClientHubInvocation($),N.log("Triggering client hub event '"+R.Method+"' on hub '"+R.Hub+"'."),C=R.Hub.toLowerCase(),I=R.Method.toLowerCase(),L=this.proxies[C],t.extend(L.state,R.State),t(L).triggerHandler(l(I),[R.Args])))}),N.error(function($,R){var L,F;R&&(L=R.I,F=N._.invocationCallbacks[L],F&&(N._.invocationCallbacks[L]=null,delete N._.invocationCallbacks[L],F.method.call(F.scope,{E:$})))}),N.reconnecting(function(){N.transport&&N.transport.name==="webSockets"&&d(N,"Connection started reconnecting before invocation result was received.")}),N.disconnected(function(){d(N,"Connection was disconnected before invocation result was received.")})},p.fn._maximizeClientHubInvocation=function(_){return{Hub:_.H,Method:_.M,Args:_.A,State:_.S}},p.fn._registerSubscribedHubs=function(){var _=this;_._subscribedToHubs||(_._subscribedToHubs=!0,_.starting(function(){var k=[];t.each(_.proxies,function(A){this.hasSubscriptions()&&(k.push({name:A}),_.log("Client subscribed to hub '"+A+"'."))}),k.length===0&&_.log("No hubs have been subscribed to. The client will not receive data from hubs. To fix, declare at least one client side function prior to connection start for each hub you wish to subscribe to."),_.data=_.json.stringify(k)}))},p.fn.createHubProxy=function(_){_=_.toLowerCase();var k=this.proxies[_];return k||(k=y(this,_),this.proxies[_]=k),this._registerSubscribedHubs(),k},p.fn.init.prototype=p.fn,t.hubConnection=p}(e),function(t,i){t.signalR.version="2.4.1"}(e),El.hubConnection=e.hubConnection,El.signalR=e.signalR,El}var nG=rG(),nr=(s=>(s.AppleTv="apple-tv",s.Vivi="vivi",s))(nr||{}),na=(s=>(s.Available="available",s.Offline="offline",s.Busy="busy",s))(na||{});const sG=class Dv{constructor(e,t){this[Symbol.toStringTag]=e[Symbol.toStringTag],this.innerPromise=e,this.onTimeout=t,this.bindFunctions()}bindFunctions(){this.timeout=this.timeout.bind(this),this.then=this.then.bind(this),this.catch=this.catch.bind(this),this.finally=this.finally.bind(this)}timeout(e){return new Promise((t,i)=>{this.then(t).catch(i).finally(()=>clearTimeout(r));const r=setTimeout(()=>{var n;(n=this.onTimeout)==null||n.call(this),i(new Error("Promise timed out"))},e)})}then(e,t){return this.innerPromise.then(e,t)}catch(e){return this.innerPromise.catch(e)}finally(e){return this.innerPromise.finally(e)}static reject(e){return new Dv(Promise.reject(e))}static fromPromise(e){return new Dv(e)}};let Nv=sG;class aG{constructor(){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)}trigger(e){this.callbacks.forEach((t,i)=>{const r=this.predicates[i];r&&!r(e)||t(e)})}on(e){this.isDisposed()&&console.warn("This EventChannel instance been disposed - this is a no-op");const t=this.callbacks.length;this.callbacks[t]=e,this.predicates[t]=()=>!0;const i=()=>{this.off(e)};return{off:i,filter:n=>(this.predicates[t]=n,i)}}one(e=()=>!0){if(this.isDisposed())return Nv.reject(new Error("This EventChannel instance has been disposed"));let t;return new Nv(new Promise((i,r)=>{t=this.on(a=>{this.signal.removeEventListener("abort",n),t(),i(a)}).filter(e);const n=()=>{t(),r(new Error("Aborted while waiting for message"))};this.signal.addEventListener("abort",n,{once:!0})}),()=>{t()})}off(e){const t=this.callbacks.indexOf(e);t!==-1&&(this.callbacks.splice(t,1),this.predicates.splice(t,1))}dispose(){this.callbacks.length=0,this.predicates.length=0,this.controller.abort()}isDisposed(){return this.signal.aborted}}class xu{constructor(){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)}trigger(e,t){this.getChannel(e).trigger(t)}on(e,t){return this.getChannel(e).on(t)}one(e,t){return this.getChannel(e).one(t)}off(e,t){this.getChannel(e).off(t)}dispose(){this.trigger("dispose",dt.void),Object.values(this.channels).forEach(e=>e.dispose()),this.channels={}}getChannel(e){return this.channels[e]||(this.channels[e]=new aG),this.channels[e]}}const dt={void:void 0};class Py{constructor(){this.bindFunctions()}bindFunctions(){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)}schedule(e){return this.task=e,this}every(e){return this.intervalInMilliseconds=e,this}trigger(){var e;return(e=this.task)==null||e.call(this,this),this}start(){return this.intervalId||(this.intervalId=setInterval(()=>this.trigger(),this.intervalInMilliseconds)),this}stop(){return this.intervalId&&(clearInterval(this.intervalId),this.intervalId=void 0),this}}function oG(s,e){return s._lastModified||(s._lastModified={}),new Proxy(s,{set:(t,i,r,n)=>{const a=s._lastModified[i.toString()];return a&&Date.now()<a+e?!0:Reflect.set(t,i,r,n)}})}function lG(s){return s._lastModified||(s._lastModified={}),new Proxy(s,{set:(e,t,i,r)=>(s._lastModified[t.toString()]=Date.now(),Reflect.set(e,t,i,r))})}const Oh={withDebouncedSetters:oG,withTimestampedSetters:lG};var Nl=(s=>(s[s.Offline=0]="Offline",s[s.Online=1]="Online",s[s.Locked=2]="Locked",s[s.Suspended=3]="Suspended",s))(Nl||{}),nu=(s=>(s[s.PlaybackStatusChange=0]="PlaybackStatusChange",s[s.PositionChange=1]="PositionChange",s))(nu||{}),gi=(s=>(s.Begin="BEGIN",s.Play="PLAY",s.Pause="PAUSE",s.Load="LOAD",s.Scan="SCAN",s.Stop="STOP",s))(gi||{});const uG=2e3;class cG{constructor(e,t){return this.title=e,this.device=t,this.locked=!1,this.position=0,this.playbackStatus=gi.Load,this.debounced=Oh.withDebouncedSetters(this,uG),Oh.withTimestampedSetters(this)}}class hG extends xu{constructor(e,t){super(),this.client=e,this.localState=new cG(t.title,t.device),this.bindFunctions(),this.initialize()}bindFunctions(){this.initialize=this.initialize.bind(this),this.dispose=this.dispose.bind(this),this.handleDisconnected=this.handleDisconnected.bind(this),this.handleAllVideoMessages=this.handleAllVideoMessages.bind(this),this.handlePlaybackChange=this.handlePlaybackChange.bind(this),this.handlePositionChange=this.handlePositionChange.bind(this),this.loadSource=this.loadSource.bind(this),this.play=this.play.bind(this),this.pause=this.pause.bind(this),this.seek=this.seek.bind(this),this.setVolume=this.setVolume.bind(this),this.isPlaying=this.isPlaying.bind(this),this.getPosition=this.getPosition.bind(this),this.getDuration=this.getDuration.bind(this),this.getVolume=this.getVolume.bind(this)}initialize(){this.client.on("dispose",this.dispose),this.client.on("disconnected",this.handleDisconnected),this.client.on("message",this.handleAllVideoMessages)}dispose(){this.client.off("dispose",this.dispose),this.client.off("disconnected",this.handleDisconnected),this.client.off("message",this.handleAllVideoMessages),this.client.stop(this.getDevice().id).catch(e=>console.error(e)),super.dispose()}handleDisconnected(){this.trigger("error",new Error("The connection to the Apple TV has been lost and cannot be recovered"))}handleAllVideoMessages(e){if(e.deviceId!==this.getDevice().id)return;const t=this.localState.debounced;switch(e.event){case nu.PlaybackStatusChange:this.handlePlaybackChange(t,e);break;case nu.PositionChange:this.handlePositionChange(t,e);break}}handlePlaybackChange(e,t){e.playbackStatus!==t.params.playbackStatus&&(e.playbackStatus=t.params.playbackStatus,this.trigger("playingchange",dt.void),e.playbackStatus===gi.Stop&&this.dispose())}handlePositionChange(e,t){e.position!==t.params.position&&(e.position=t.params.position,this.trigger("positionchange",dt.void))}async loadSource(){try{if(this.localState.locked)return;await this.client.lock(this.getDevice().id),this.localState.locked=!0,await this.client.loadVideo(this.getDevice().id),this.trigger("sourceloaded",dt.void)}catch(e){console.error(e),this.trigger("error",new Error("Could not load video on Apple TV device"))}}play(){this.localState.locked&&this.localState.playbackStatus!==gi.Play&&(this.localState.playbackStatus=gi.Play,this.client.play(this.getDevice().id),this.trigger("playingchange",dt.void))}pause(){this.localState.locked&&this.localState.playbackStatus!==gi.Pause&&(this.localState.playbackStatus=gi.Pause,this.client.pause(this.getDevice().id),this.trigger("playingchange",dt.void))}seek(e){this.localState.locked&&this.localState.position!==e&&(this.localState.position=e,this.client.seek(this.getDevice().id,e),this.trigger("positionchange",dt.void))}setVolume(){console.info("Setting the volume is not supported on Apple TV")}setMuted(){console.info("Muting is not supported on Apple TV")}setSubtitles(){console.info("Subtitles are not supported on Apple TV")}isPlaying(){return this.localState.playbackStatus===gi.Play||this.localState.playbackStatus===gi.Begin||this.localState.playbackStatus===gi.Load}isPlaybackFinished(){return this.localState.playbackStatus===gi.Stop}getPosition(){return this.localState.position}getDuration(){}getVolume(){return 1}getMuted(){return!1}getSubtitles(){}getDevice(){return this.localState.device}getTitle(){return this.localState.title}}const dG=2e4,fG=500,pG="DeviceUserHub",mG=5e3;class zs extends xu{constructor(e){super(),this.options=e,this.accessToken=void 0,this.devices=[],this.heartbeat=new Py,this.bindFunctions(),this.initialize()}bindFunctions(){this.initialize=this.initialize.bind(this),this.connect=this.connect.bind(this),this.subscribe=this.subscribe.bind(this),this.tryFixConnection=this.tryFixConnection.bind(this),this.invoke=this.invoke.bind(this),this.invokeDebounced=du(this.invoke,fG,!0),this.handleDeviceList=this.handleDeviceList.bind(this),this.handleDeviceStateChange=this.handleDeviceStateChange.bind(this),this.handleDevicePaired=this.handleDevicePaired.bind(this),this.handleDeviceUnpaired=this.handleDeviceUnpaired.bind(this),this.handlePlayStatusChange=this.handlePlayStatusChange.bind(this),this.handleTimeSync=this.handleTimeSync.bind(this),this.dispose=this.dispose.bind(this),this.canCastToDevice=this.canCastToDevice.bind(this),this.getDevices=this.getDevices.bind(this),this.startCastSession=this.startCastSession.bind(this),this.lock=this.lock.bind(this),this.loadVideo=this.loadVideo.bind(this),this.play=this.play.bind(this),this.pause=this.pause.bind(this),this.seek=this.seek.bind(this),this.stop=this.stop.bind(this),this.pair=this.pair.bind(this),this.unpair=this.unpair.bind(this),this.renameDevice=this.renameDevice.bind(this)}async initialize(){try{this.accessToken=await this.options.fetchAccessToken(),this.connection=nG.hubConnection(this.accessToken.host,{logging:!1}),this.hubProxy=this.connection.createHubProxy(pG),this.hubProxy.on("DeviceList",this.handleDeviceList),this.hubProxy.on("DeviceStateChange",this.handleDeviceStateChange),this.hubProxy.on("Paired",this.handleDevicePaired),this.hubProxy.on("Unpaired",this.handleDeviceUnpaired),this.hubProxy.on("PlayStatusChange",this.handlePlayStatusChange),this.hubProxy.on("TimeSync",this.handleTimeSync),await this.connect(),await this.subscribe(this.accessToken.token),this.heartbeat.schedule(this.tryFixConnection).every(mG).start()}catch(e){console.error(e),this.trigger("error",new Error("Could not connect to Online API"))}}async connect(){return new Promise((e,t)=>{this.connection.start({jsonp:!1,withCredentials:!1}).done(()=>e()).fail(()=>t(new Error("Could not connect to SignalR hub")))})}async subscribe(e){if(!await this.invoke("Subscribe",e))throw new Error("The subscription request was rejected by Online API")}async tryFixConnection(){if(this.connection.state===4)try{this.heartbeat.stop(),this.accessToken=await this.options.fetchAccessToken(),await this.connect(),await this.subscribe(this.accessToken.token)}catch(e){console.warn(e),console.warn("Could not reconnect to Online API")}finally{this.heartbeat.start()}}async invoke(e,...t){const i=new Promise((r,n)=>{var a;((a=this.hubProxy)==null?void 0:a.invoke(e,...t)).done(r).fail(n)});return Nv.fromPromise(i).timeout(dG)}handleDeviceList(e){this.devices=e.filter(t=>t.type!=="vivi").map(zs.convertToGenericDevice),this.trigger("deviceschange",dt.void)}handleDeviceStateChange(e){const t=this.devices.findIndex(i=>i.id===e.deviceId);t>=0&&(this.devices[t]=zs.convertToGenericDevice(e),this.trigger("deviceschange",dt.void))}handleDevicePaired(e){e.type!=="vivi"&&(this.devices.push(zs.convertToGenericDevice(e)),this.trigger("deviceschange",dt.void))}handleDeviceUnpaired(e){this.devices=this.devices.filter(t=>t.id!==e),this.trigger("deviceschange",dt.void)}handlePlayStatusChange(e,t){this.trigger("message",{event:nu.PlaybackStatusChange,deviceId:e,params:{playbackStatus:t.commandType}})}handleTimeSync(e,t){this.trigger("message",{event:nu.PositionChange,deviceId:e,params:{position:t}})}dispose(){this.hubProxy.off("DeviceList",this.handleDeviceList),this.hubProxy.off("DeviceStateChange",this.handleDeviceStateChange),this.hubProxy.off("Paired",this.handleDevicePaired),this.hubProxy.off("Unpaired",this.handleDeviceUnpaired),this.hubProxy.off("PlayStatusChange",this.handlePlayStatusChange),this.hubProxy.off("TimeSync",this.handleTimeSync),this.hubProxy.connection.stop(!1,!0),this.heartbeat.stop(),super.dispose()}canCastToDevice(e){return e===nr.AppleTv}getDevices(){return this.devices}startCastSession(e){return new hG(this,e)}async lock(e){if(!await this.invoke("Lock",e,this.options.userId,this.options.username??""))throw new Error("Could not lock device")}async loadVideo(e){if(!this.options.trackingCode)throw new Error("Tracking code must be provided to cast videos");await this.invoke("Command",{DeviceId:e,CommandType:gi.Play,Data:this.options.trackingCode})}async play(e){await this.invoke("Command",{DeviceId:e,CommandType:gi.Play})}async pause(e){await this.invoke("Command",{DeviceId:e,CommandType:gi.Pause})}seek(e,t){this.invokeDebounced("Command",{DeviceId:e,CommandType:gi.Play,Params:`1,${Math.trunc(t)}`})}async stop(e){await this.invoke("Command",{DeviceId:e,CommandType:gi.Stop})}async pair(e){const t=await this.invoke("Pair",e);if(!t)throw new Error("Could not pair device");return t}async unpair(e){await this.invoke("Unpair",e)}async renameDevice({deviceId:e,deviceName:t}){if(!await this.invoke("Renamedevice",e,t))throw new Error("Could not rename device")}static convertToGenericDeviceStatus(e){switch(e){case Nl.Online:return na.Available;case Nl.Locked:return na.Busy;case Nl.Suspended:case Nl.Offline:return na.Offline}}static convertToGenericDevice(e){return{id:e.deviceId,name:e.name,type:nr.AppleTv,status:zs.convertToGenericDeviceStatus(e.status)}}}const h1={reconnectIntervalInMilliseconds:3e3,heartbeatEnabled:!1,heartbeatIntervalInMillseconds:1e4,heartbeatMessage:""};class gG{constructor(e,t=h1){this.bindFunctions(),this.url=e,this.options={...h1,...t},this.webSocket=this.connect(),this.heartbeat=new Py().schedule(()=>this.send(this.options.heartbeatMessage)).every(this.options.heartbeatIntervalInMillseconds)}bindFunctions(){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)}cleanup(){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)}handleOpen(e){var t;(t=this.onOpen)==null||t.call(this,e),this.options.heartbeatEnabled&&this.heartbeat.start()}handleMessage(e){var t;(t=this.onMessage)==null||t.call(this,e)}handleClose(e){var t;(t=this.onClose)==null||t.call(this,e),this.cleanup(),setTimeout(()=>{this.webSocket=this.connect()},this.options.reconnectIntervalInMilliseconds)}handleError(e){var t;(t=this.onError)==null||t.call(this,e),this.handleClose()}connect(){const 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}send(e){this.webSocket.send(e)}dipose(){this.cleanup(),this.webSocket.close()}}const vG=2e3;class yG{constructor(e,t){return this._timerStartedAt=0,this.position=0,this.duration=void 0,this.playing=!1,this.mute=!1,this.videoSource="",this.subtitleSource="",this.subtitles=!1,this.volume=0,this.title=e,this.device=t,this.ready=!1,this.playbackFinished=!1,this.debounced=Oh.withDebouncedSetters(this,vG),Oh.withTimestampedSetters(this)}get position(){return this._position+this.getTimerDurationInSeconds()}set position(e){this._position=e,this.restartTimer()}get playing(){return this._playing}set playing(e){this._playing=e,e?this.restartTimer():(this._position+=this.getTimerDurationInSeconds(),this.stopTimer())}restartTimer(){this._timerStartedAt=Date.now()}stopTimer(){this._timerStartedAt=0}getTimerDurationInSeconds(){return this._timerStartedAt?(Date.now()-this._timerStartedAt)/1e3:0}}var rs=(s=>(s.Update="update",s.Volume="volume",s.Playing="playing",s.Paused="paused",s.NewChapter="new_chapter",s.Stopped="stopped",s.Ready="ready",s.Mute="mute",s.Finished="finished",s.Subtitles="subtitles",s))(rs||{});class _G extends xu{constructor(e,t){super(),this.client=e,this.localState=new yG(t.title,t.device),this.bindFunctions(),this.initialize()}bindFunctions(){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)}initialize(){this.client.on("dispose",this.dispose),this.client.on("connected",this.handleClientConnected),this.client.on("message",this.handleDisconnectMessage).filter(e=>e.source===this.getDevice().id&&e.message.type==="disconnect"),this.client.on("message",this.handleAllVideoMessages).filter(e=>e.source===this.getDevice().id&&e.message.type==="video_event")}dispose(){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(e=>console.error(e)),super.dispose()}async handleClientConnected(){try{await this.client.joinRoom(this.getDevice().id)}catch(e){this.trigger("error",e)}}handleDisconnectMessage(){this.dispose()}handleAllVideoMessages(e){const t=this.localState.debounced,i=e.message.payload.params||{};switch(e.message.payload.event){case rs.Update:this.handleUpdateMessage(t,i);break;case rs.NewChapter:this.handleNewChapterMessage(t,i);break;case rs.Volume:this.handleVolumeMessage(t,i);break;case rs.Playing:this.handlePlayingMessage(t);break;case rs.Paused:this.handlePausedMessage(t);break;case rs.Finished:this.handleFinishedMessage(t);break;case rs.Stopped:this.handleStoppedMessage();break}}handleUpdateMessage(e,t){e.duration!==t.duration&&(e.duration=t.duration,this.trigger("durationchange",dt.void)),e.position!==t.position&&(e.position=t.position,this.trigger("positionchange",dt.void)),e.subtitles!==t.subtitles&&(e.subtitles=t.subtitles,this.trigger("subtitleschange",dt.void))}handleVolumeMessage(e,t){e.volume!==t.level&&(e.volume=t.level,e.mute=t.level===0,this.trigger("volumechange",dt.void))}handlePlayingMessage(e){e.playing!==!0&&(e.playing=!0,e.playbackFinished=!1,this.trigger("playingchange",dt.void))}handlePausedMessage(e){e.playing!==!1&&(e.playing=!1,this.trigger("playingchange",dt.void))}handleFinishedMessage(e){e.playbackFinished!==!0&&(e.playing=!1,e.playbackFinished=!0,this.trigger("playingchange",dt.void))}handleNewChapterMessage(e,t){const r=(t.queue??[]).find(n=>n.url===e.videoSource);if(!r){console.info("The device is no longer playing the source we loaded - disposing the session"),this.dispose();return}e.subtitleSource!==r.suburl&&(e.subtitleSource=r.suburl,this.trigger("subtitleschange",dt.void))}handleStoppedMessage(){this.dispose()}async loadSource(e,t){if(!(this.localState.videoSource===e&&this.localState.subtitleSource===t))try{const i=this.getDevice().id,r=this.getPosition();this.localState.videoSource=e,this.localState.subtitleSource=t,this.localState.ready=!1,await this.client.joinRoom(i),await this.client.loadQueue({title:this.getTitle(),roomId:i,videoSource:e,subtitleSource:t}),this.localState.ready=!0,this.trigger("sourceloaded",dt.void),r>0&&this.seek(r),t&&this.setSubtitles(t)}catch(i){console.error(i),this.trigger("error",new Error("Could not load video on Vivi device"))}}play(){this.localState.ready&&this.localState.playing!==!0&&(this.localState.playing=!0,this.client.play(this.getDevice().id),this.trigger("playingchange",dt.void))}pause(){this.localState.ready&&this.localState.playing!==!1&&(this.localState.playing=!1,this.client.pause(this.getDevice().id),this.trigger("playingchange",dt.void))}seek(e){this.localState.ready&&this.localState.position!==e&&(this.localState.position=e,this.client.seek(this.getDevice().id,e),this.trigger("positionchange",dt.void))}setVolume(e){this.localState.ready&&this.localState.volume!==e&&(this.localState.volume=e,this.client.setVolume(this.getDevice().id,e),this.trigger("volumechange",dt.void))}setMuted(e){this.localState.ready&&this.localState.mute!==e&&(this.localState.mute=e,this.client.setMuted(this.getDevice().id,e),this.trigger("volumechange",dt.void))}async setSubtitles(e){if(!this.localState.ready)return;e&&await this.loadSource(this.localState.videoSource,e);const t=!!e;this.localState.subtitles!==t&&(this.localState.subtitles=t,this.client.setSubtitles(this.getDevice().id,t),this.trigger("subtitleschange",dt.void))}isPlaying(){return this.localState.playing}isPlaybackFinished(){return this.localState.playbackFinished}getPosition(){return this.localState.position}getDuration(){return this.localState.duration}getVolume(){return this.localState.volume}getMuted(){return this.localState.mute}getSubtitles(){if(this.localState.subtitles)return this.localState.subtitleSource}getDevice(){return this.localState.device}getTitle(){return this.localState.title}}const mr=1e4,TG=500,bG=1e4;class Ws extends xu{constructor(e){super(),this.options=e,this.accessToken="",this.devices=[],this.devicesFingerprint="",this.deviceDiscovery=new Py,this.bindFunctions(),this.initialize()}bindFunctions(){this.initialize=this.initialize.bind(this),this.sendMessage=this.sendMessage.bind(this),this.sendMessageDebounced=du(this.sendMessage,TG,!0),this.beginDeviceDiscovery=this.beginDeviceDiscovery.bind(this),this.dispose=this.dispose.bind(this),this.canCastToDevice=this.canCastToDevice.bind(this),this.getDevices=this.getDevices.bind(this),this.startCastSession=this.startCastSession.bind(this),this.authenticateWithVivi=this.authenticateWithVivi.bind(this),this.getRoomList=this.getRoomList.bind(this),this.joinRoom=this.joinRoom.bind(this),this.query=this.query.bind(this),this.loadQueue=this.loadQueue.bind(this),this.play=this.play.bind(this),this.pause=this.pause.bind(this),this.stop=this.stop.bind(this),this.seek=this.seek.bind(this),this.setVolume=this.setVolume.bind(this),this.setMuted=this.setMuted.bind(this),this.setSubtitles=this.setSubtitles.bind(this)}initialize(){this.webSocket=new gG(this.options.url),this.webSocket.onMessage=e=>this.trigger("message",JSON.parse(e.data)),this.webSocket.onOpen=async()=>{try{this.accessToken=await this.options.fetchAccessToken(),await this.authenticateWithVivi(),this.beginDeviceDiscovery(),this.trigger("connected",dt.void)}catch(e){console.error(e),this.trigger("error",new Error("Could not connect to Vivi"))}}}sendMessage(e){var t;(t=this.webSocket)==null||t.send(JSON.stringify(e))}beginDeviceDiscovery(){this.deviceDiscovery.every(bG).schedule(async()=>{try{const e=await this.getRoomList(),t=Ws.calculateFingerprint(e);if(t===this.devicesFingerprint)return;const i=new Set(e.map(n=>n.organisation??"")).size,r=new Set(e.map(n=>n.location??"")).size;this.devices=e.map(n=>({id:n.id,name:n.name,schoolName:i>1?n.organisation:"",description:r>1?n.location:"",type:nr.Vivi,status:na.Available})),this.devicesFingerprint=t,this.trigger("deviceschange",dt.void)}catch(e){console.warn(e)}}).trigger().start()}dispose(){var e;this.deviceDiscovery.stop(),(e=this.webSocket)==null||e.dipose(),super.dispose()}canCastToDevice(e){return e===nr.Vivi}getDevices(){return this.devices}startCastSession(e){return new _G(this,e)}async authenticateWithVivi(){this.sendMessage({destination:"relay",message:{token:this.accessToken,type:"identify_video_api"}}),await this.one("message",e=>e.message.type==="video_api_identified").timeout(mr).catch(()=>{throw new Error("Failed to authenticate with Vivi")})}async getRoomList(){return this.sendMessage({destination:"relay",message:{type:"video_api_rooms"}}),(await this.one("message",t=>t.message.type==="video_api_rooms").timeout(mr).catch(()=>{throw new Error("Failed to fetch rooms")})).message.rooms||[]}async joinRoom(e){this.sendMessage({destination:"relay",message:{destination_type:"box",new_destination:e,token:this.accessToken,type:"connect"}}),await this.one("message",t=>{if(t.source===e&&t.message.type==="connect"||t.message.type==="error"&&t.message.error_type==="already_connected")return!0}).timeout(mr).catch(()=>{throw new Error("Failed to join room")})}async query(e){const t=Ws.createAckId();return this.sendMessage({destination:e,message:{type:"message_with_ack",ack_id:t,name:"query"}}),await this.one("message",i=>i.message.ack_id===t).timeout(mr).catch(()=>{throw new Error("Failed to fetch query")})}async loadQueue({roomId:e,title:t,videoSource:i,subtitleSource:r}){this.sendMessage({destination:e,message:{type:"message_with_ack",ack_id:Ws.createAckId(),name:"queue_load",payload:{urls:[{title:t,url:i,suburl:r}]}}}),await this.one("message",n=>{var a;return n.source===e&&((a=n.message.payload)==null?void 0:a.event)==="ready"}).timeout(mr).catch(()=>{throw new Error("Failed to load media")})}async play(e){this.sendMessage({destination:e,message:{type:"message",name:"video_play",payload:{}}}),await this.one("message",t=>{var i;return t.source===e&&((i=t.message.payload)==null?void 0:i.event)==="playing"}).timeout(mr).catch(()=>{throw new Error("Failed to play video")})}async pause(e){this.sendMessage({destination:e,message:{type:"message",name:"video_pause"}}),await this.one("message",t=>{var i;return t.source===e&&((i=t.message.payload)==null?void 0:i.event)==="paused"}).timeout(mr).catch(()=>{throw new Error("Failed to pause video")})}async stop(e){this.sendMessage({destination:e,message:{type:"message",name:"video_stop"}}),await this.one("message",t=>{var i;return t.source===e&&((i=t.message.payload)==null?void 0:i.event)==="stopped"}).timeout(mr).catch(()=>{throw new Error("Failed to stop video")})}async seek(e,t){this.sendMessageDebounced({destination:e,message:{type:"message",name:"video_seek",payload:{position:t}}})&&await this.one("message",r=>{var n;return r.source===e&&((n=r.message.payload)==null?void 0:n.event)==="playing"}).timeout(mr).catch(()=>{throw new Error("Failed to seek video")})}async setVolume(e,t){this.sendMessageDebounced({destination:e,message:{type:"message",name:"set_volume",payload:{volume:t}}})&&await this.one("message",r=>{var n;return r.source===e&&((n=r.message.payload)==null?void 0:n.event)==="volume"}).timeout(mr).catch(()=>{throw new Error("Failed to set volume")})}async setMuted(e,t){this.sendMessage({destination:e,message:{type:"message",name:"set_mute",payload:{mute:t}}}),await this.one("message",i=>{var r;return i.source===e&&((r=i.message.payload)==null?void 0:r.event)==="mute"}).timeout(mr).catch(()=>{throw new Error("Failed to set mute")})}async setSubtitles(e,t){const i=Ws.createAckId();this.sendMessage({destination:e,message:{type:"message_with_ack",ack_id:i,name:"set_subtitles",payload:{subtitles:t}}}),await this.one("message",r=>{var n;return r.source===e&&((n=r.message.payload)==null?void 0:n.event)==="subtitles"}).timeout(mr).catch(()=>{throw new Error("Failed to set subtitles")})}static createAckId(){return VI.generateRandomId()}static calculateFingerprint(e){return e.map(t=>t.id).sort().join(",")}}const Rh=class Rh extends xu{constructor(e){super(),this.instanceId=e,this.clients=[],this.bindFunctions()}bindFunctions(){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)}addClient(e){e.on("deviceschange",this.gatherAndPublishDevices),e.on("error",t=>this.trigger("error",t)),this.clients.push(e)}hasInstanceOfClient(e){return this.clients.some(t=>t instanceof e)}startCastSession(e){if(this.castSession)if(this.castSession.getDevice().id!==e.device.id)this.castSession.dispose();else{console.info(`A session with device ${e.device.id} already exists - this is a no-op`);return}const t=this.clients.find(i=>i.canCastToDevice(e.device.type));t&&(this.castSession=t.startCastSession(e),this.castSession.on("error",i=>{this.castSession.dispose(),this.trigger("error",i)}),this.castSession.on("dispose",()=>{this.castSession=void 0,this.trigger("castsessionchange",void 0)}),this.trigger("castsessionchange",this.castSession))}getCastSession(){return this.castSession}gatherAndPublishDevices(){const t=this.clients.map(i=>i.getDevices()).reduce((i,r)=>[...i,...r],[]);this.trigger("deviceschange",t)}dispose(){var e;(e=this.castSession)==null||e.dispose(),this.clients.forEach(t=>t.dispose()),this.castSession=void 0,this.clients=[],super.dispose()}static getOrCreateInstance(e){if(!e)throw new Error("instanceId is required");return this.instances[e]||(this.instances[e]=new Rh(e)),this.instances[e]}static disposeAndRemoveInstance(e){e.dispose(),delete this.instances[e.instanceId]}static isActive(){return Object.keys(this.instances).length>0}};Rh.instances={};let sa=Rh;const SG=U.getComponent("MenuItem");class d1 extends SG{constructor(e,t){super(e,t),this.isVisible=this.isVisible.bind(this)}createEl(){const e={vivi:"cv-vivi-icon","apple-tv":"cv-apple-icon"},t=super.createEl("li",{className:"vjs-menu-item cv-device-menu-item"}),i=U.dom.createEl("div",{className:"cv-device-menu-item-body",innerHTML:`
342
- <span class="cv-device-icon ${e[this.options_.type]}"></span>
343
- <div>
344
- <span class="vjs-menu-item-text">${this.options_.label}</span>
345
- <span class="vjs-menu-item-text cv-device-truncated-text">${this.options_.schoolName??""}</span>
346
- <span class="vjs-menu-item-text cv-device-truncated-text cv-device-description">${this.options_.description??""}</span>
347
- </div>
348
- `});return t.replaceChildren(i),t}handleClick(){this.options_.onClick()}show(){super.show()}hide(){super.hide()}isVisible(){return!super.hasClass("vjs-hidden")}}const xG=U.getComponent("Menu");class HI extends xG{createEl(){const e=CI.apply(this),t=this.contentEl_;return this.contentWrapper=U.dom.createEl("div",{className:"vjs-menu-content"}),e.className="vjs-menu cv-devices-menu",t.className="cv-devices-menu-item-list",e.removeChild(t),e.appendChild(this.contentWrapper),this.contentWrapper.appendChild(t),this.simpleBar=new Vt(t,{autoHide:!1}),e}addCta(e){if(this.ctaElement){console.warn("CTA has already been added to the menu - this is a no-op");return}this.ctaElement=e.el(),this.contentWrapper.prepend(this.ctaElement),this.el().classList.add("has-cta")}removeCta(){this.ctaElement&&(this.contentWrapper.removeChild(this.ctaElement),this.el().classList.remove("has-cta"))}}U.registerComponent("DevicesMenu",HI);function CG({inactiveIntegrations:s,canUserManageIntegrations:e,player:t,onDismiss:i,onInstall:r,onLearnMore:n,onContactSupport:a}){if(s.length===0)return ue.jsx(ue.Fragment,{});const o=c=>t.localize(c),l=c=>s.indexOf(c)!==-1;let u;return l(nr.AppleTv)&&l(nr.Vivi)?u="vivi_and_apple_tv":l(nr.Vivi)?u="vivi":u="apple_tv",ue.jsxs("div",{className:"cv-devices-cta",tabIndex:-1,children:[ue.jsx(EG,{context:u,localize:o,onDismiss:()=>i(u)}),ue.jsx(wG,{context:u}),ue.jsx(kG,{context:u,canUserManageIntegrations:e,localize:o,onContactSupport:()=>a(u),onInstall:()=>r(u),onLearnMore:()=>n(u)})]})}function EG({context:s,localize:e,onDismiss:t}){return ue.jsxs("div",{className:"cv-devices-cta-header",children:[ue.jsx("span",{className:"cv-devices-badge",children:e("New")}),ue.jsxs("span",{className:"cv-devices-title",children:[s==="vivi_and_apple_tv"&&e("Cast to Vivi and Apple TV"),s==="vivi"&&e("Cast to Vivi"),s==="apple_tv"&&e("Cast to Apple TV")]}),ue.jsx("span",{className:"cv-devices-close",onClick:t,children:ue.jsx("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:ue.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",fill:"white",d:"M11.9588 10.6413L16.3612 6.34478C16.7361 5.97191 17.3439 5.97191 17.7188 6.34478C18.0937 6.71764 18.0937 7.32218 17.7188 7.69505L13.3165 11.9916L17.7188 16.3701C18.0937 16.7429 18.0937 17.3475 17.7188 17.7203C17.3439 18.0932 16.7361 18.0932 16.3612 17.7203L11.9588 13.3419L7.63882 17.7203C7.26392 18.0932 6.65608 18.0932 6.28118 17.7203C5.90627 17.3475 5.90627 16.7429 6.28118 16.3701L10.6012 11.9916L6.28118 7.62993C5.90627 7.25706 5.90627 6.65252 6.28118 6.27965C6.65608 5.90678 7.26392 5.90678 7.63882 6.27965L11.9588 10.6413Z"})})})]})}function wG({context:s}){const e=s==="vivi_and_apple_tv"?"bg-vivi-and-apple":s==="vivi"?"bg-vivi":"bg-apple";return ue.jsxs("div",{className:`cv-devices-cta-body ${e}`,children:[(s==="vivi_and_apple_tv"||s==="apple_tv")&&ue.jsx("div",{className:"cv-devices-icon-container",children:ue.jsx("span",{className:"cv-devices-icon apple"})}),(s==="vivi_and_apple_tv"||s==="vivi")&&ue.jsx("div",{className:"cv-devices-icon-container",children:ue.jsx("span",{className:"cv-devices-icon vivi"})})]})}function kG({context:s,canUserManageIntegrations:e,localize:t,onInstall:i,onLearnMore:r,onContactSupport:n}){return e?ue.jsxs("div",{className:"cv-devices-cta-footer",children:[ue.jsxs("span",{children:[s==="vivi_and_apple_tv"&&t("Discover our new device integrations to make presenting in the classroom easy!"),s==="vivi"&&t("Discover our new Vivi integration."),s==="apple_tv"&&t("Discover our new Apple TV integration.")]}),ue.jsx("br",{}),ue.jsx("span",{className:"cv-devices-link",onClick:i,children:t("Click here to install")})]}):ue.jsxs("div",{className:"cv-devices-cta-footer",children:[ue.jsxs("span",{children:[s==="vivi_and_apple_tv"&&t("Cast to Vivi and Apple TV is now available! Please contact "),s==="vivi"&&t("Cast to Vivi is now available! Please contact "),s==="apple_tv"&&t("Cast to Apple TV is now available! Please contact ")]}),ue.jsx("span",{className:"cv-devices-link",onClick:n,children:"ClickView Support"}),ue.jsxs("span",{children:[s==="vivi_and_apple_tv"&&t(" or your administrator to set up Apple TV and Vivi."),s==="vivi"&&t(" or your administrator to set up Vivi."),s==="apple_tv"&&t(" or your administrator to set up Apple TV.")]}),ue.jsx("br",{}),ue.jsx("span",{className:"cv-devices-link",onClick:r,children:"Learn more"})]})}U.registerComponent("DevicesCta",Ed((s,e)=>ue.jsx(CG,{player:s,...e}),{properties:{className:"cv-devices-cta-wrapper"}}));const AG=20,IG=U.getComponent("DevicesCta"),f1=U.getComponent("MenuButton");class zI extends f1{constructor(e,t){super(e,t),this.alwaysCollapsed=!1,this.isCollapsed=!1,this.isCollabsible=!0,this.className="cv-devices-menu-button",this.searchText="",this.devices=[],this.castSession=void 0,this.bindFunctions(),this.bindEventListeners()}bindFunctions(){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.showNotificationBadge=this.showNotificationBadge.bind(this),this.hideNotificationBadge=this.hideNotificationBadge.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)}bindEventListeners(){const e=this.$("button"),t=i=>{this.menu.handleBlur(i)};e.addEventListener("blur",t),this.one("dispose",()=>{var i;e.removeEventListener("blur",t),(i=this.cta)==null||i.dispose()})}createEl(...e){return f1.prototype.createEl.apply(this,...e)}buildWrapperCSSClass(){return`cv-menu-small cv-devices-button ${super.buildWrapperCSSClass()}`}createMenu(){const e=new HI(this.player_,{menuButton:this});if(!this.options_.ctaOptions.hasBeenDismissed&&this.options_.ctaOptions.inactiveIntegrations.length>0){const{onDismiss:i,...r}=this.options_.ctaOptions;this.cta=new IG(this.player(),{...r,onDismiss:n=>{this.hideNotificationBadge(),e.removeCta(),i(n)}}),this.showNotificationBadge(),e.addCta(this.cta)}return this.createItems().forEach(i=>e.addItem(i)),e}createItems(){const e=[];return this.headingItem=new la(this.player_,{label:this.localize("Select a device"),selectable:!1}),this.searchInputItem=new b0(this.player_,{menuButton:this,search:t=>this.setSearchText(t),className:"cv-devices-search-input"}),this.emptyPlaceholder=new S0(this.player_,{label:"No devices found",selected:!1,selectable:!1,multiSelectable:!1}),this.headingItem.show(),this.searchInputItem.hide(),this.emptyPlaceholder.show(),e.push(this.headingItem,this.searchInputItem,this.emptyPlaceholder),e}pressButton(){var e;super.pressButton(),this.shouldShowSearchInput()&&((e=this.searchInputItem)==null||e.focus())}setDevices(e){this.devices=e,this.render()}setCastSession(e){this.castSession=e,this.render()}setSearchText(e){this.searchText=e,this.render()}getDeviceMenuItems(){return this.menu.children_.filter(e=>e instanceof d1)}showNotificationBadge(){this.addClass("notification-badge")}hideNotificationBadge(){this.removeClass("notification-badge")}render(){this.removeMenuItems(this.getDeviceMenuItems()),this.addMenuItemsForDevices(this.devices),this.toggleSearchInput(),this.toggleDeviceMenuItems(),this.toggleEmptyStatePlaceholder()}removeMenuItems(e){e.forEach(t=>{this.menu.removeChild(t),t.dispose()})}addMenuItemsForDevices(e){e.sort((i,r)=>{const n=`${i.type}${i.schoolName??""}${i.description??""}${i.name}`,a=`${r.type}${r.schoolName??""}${r.description??""}${r.name}`;return n.localeCompare(a)}).forEach(i=>{const r=new d1(this.player(),{id:i.id,label:i.name,schoolName:i.schoolName,description:i.description,selected:!1,multiSelectable:!1,selectable:!0,available:i.status===na.Available,type:i.type,onClick:()=>{this.options_.onDeviceMenuItemClick(r,i)}});this.menu.addItem(r)})}shouldShowSearchInput(){return this.getDeviceMenuItems().length>=AG}toggleSearchInput(){this.shouldShowSearchInput()?(this.searchInputItem.show(),this.menu.addClass("vertical-fill")):(this.searchInputItem.hide(),this.menu.removeClass("vertical-fill"))}toggleDeviceMenuItems(){const e=this.getDeviceMenuItems(),t=this.shouldShowSearchInput(),i=this.searchText.toLowerCase();e.forEach(r=>{var u;const n=this.devices.find(c=>c.id===r.options_.id);if(!n)return;const a=n.status===na.Available,o=n.id===((u=this.castSession)==null?void 0:u.getDevice().id),l=t?`${n.name} ${n.schoolName??""} ${n.description??""}`.trim().toLowerCase().indexOf(i)!==-1:!0;a?r.enable():r.disable(),l?r.show():r.hide(),o?r.selected(!0):r.selected(!1)})}toggleEmptyStatePlaceholder(){const e=this.getDeviceMenuItems();e.filter(i=>i.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"))}getCollabsibleName(){return this.controlText_}getCollabsibleValue(){var e;return((e=this.castSession)==null?void 0:e.getDevice().name)??" "}showInCollabsibleMenu(){return!0}showCollapsibleMenu(){this.handleClick()}handleClick(){super.handleClick(null),this.options_.onClick()}}zI.prototype.controlText_="Devices";U.registerComponent("DevicesButton",zI);const PG=U.getComponent("Component");class DG extends PG{constructor(e){super(null,e)}createEl(){return super.createEl("div",{className:"cv-devices-tech"})}setPoster(e){this.poster=e,this.update()}setDevice(e){this.device=e,this.update()}update(){var r,n;const e={vivi:"cv-vivi-icon","apple-tv":"cv-apple-icon"};this.el_.innerHTML=`
349
- <div class="cv-devices-content">
350
- <p>${this.localize("Currently playing on")}</p>
351
- <h2><span class="cv-device-icon ${e[((r=this.device)==null?void 0:r.type)??nr.Vivi]}"></span>${((n=this.device)==null?void 0:n.name)??""}</h2>
352
- </div>
353
- <div class="cv-devices-background" style="background-image: url(${this.poster})"></div>
354
- `;const t=document.createElement("button"),i=a=>{a.stopPropagation(),this.options_.onStopCasting()};t.onclick=i,t.ontouchstart=i,t.className="stop-casting-button",t.innerHTML=this.localize("Stop casting"),this.el_.querySelector(".cv-devices-content").appendChild(t)}play(){}}const NG=U.getComponent("Tech");class LG extends NG{constructor(e,t){super(e,t),this.featuresVolumeControl=!0,this.featuresPlaybackRate=!1,this.movingMediaElementInDOM=!1,this.featuresFullscreenResize=!0,this.featuresTimeupdateEvents=!0,this.featuresProgressEvents=!1,this.featuresNativeTextTracks=!1,this.featuresNativeAudioTracks=!1,this.featuresNativeVideoTracks=!1,this.featuresMuteControl=!0,this.featuresSourceset=!1,this.videojsPlayer=U(this.options_.playerId),this.bindFunctions(),this.bindEventListeners(),this.ready(()=>{this.setSource(this.options_.source)}),this.triggerReady()}bindFunctions(){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)}bindEventListeners(){const e=this.getCastSession();e&&(this.textTracks().on("change",this.onTextTrackChanged),this.videojsPlayer.one("ended",()=>{e.dispose()}),e.on("durationchange",()=>{this.trigger("durationchange")}),e.on("dispose",()=>{this.trigger("ended"),this.hideUI()}),e.on("playingchange",()=>{e.isPlaying()?(this.trigger("play"),this.trigger("playing")):this.trigger("pause")}),e.on("volumechange",()=>{this.trigger("volumechange")}),e.on("sourceloaded",()=>{this.trigger("loadeddata")}),e.on("subtitleschange",()=>{this.setSelectedTextTrack(e.getSubtitles())}))}onTextTrackChanged(){var t;const e=this.getSelectedTextTrack();(t=this.getCastSession())==null||t.setSubtitles(e==null?void 0:e.src)}getSelectedTextTrack(){return Qt.findTrackByPredicate(this.videojsPlayer.player_,e=>e.mode==="showing"&&!!e.src)}setSelectedTextTrack(e){Qt.forEachTrack(this.videojsPlayer.player_,t=>{t.src===e?t.mode="showing":t.mode="hidden"})}showUI(e){this.ui&&(this.ui.setPoster(this.options_.poster),this.ui.setDevice(e),this.ui.show())}hideUI(){var e;(e=this.ui)==null||e.hide()}dispose(){this.textTracks().off("change",this.onTextTrackChanged);const e=this.getCastSession();e&&e.dispose(),super.cleanupAutoTextTracks(),super.dispose()}createEl(){return this.ui=this.ui||new DG({onStopCasting:()=>{var e;(e=this.getCastSession())==null||e.dispose()}}),this.ui.el()}setSource(e){const t=this.getCastSession();if(!t)return;this.showUI(t.getDevice()),this.trigger("loadstart");const i=this.getSelectedTextTrack();t.loadSource(e.src,i==null?void 0:i.src)}addRemoteTextTrack(e){return super.addRemoteTextTrack(e,!0)}getCastSession(){return sa.getOrCreateInstance(this.options_.instanceId??"").getCastSession()}play(){var e;(e=this.getCastSession())==null||e.play()}pause(){var e;(e=this.getCastSession())==null||e.pause()}paused(){var e;return((e=this.getCastSession())==null?void 0:e.isPlaying())===!1}ended(){var e;return((e=this.getCastSession())==null?void 0:e.isPlaybackFinished())??!1}setCurrentTime(e){var t;(t=this.getCastSession())==null||t.seek(e??0)}currentTime(){var e;return((e=this.getCastSession())==null?void 0:e.getPosition())??0}duration(){var e;return((e=this.getCastSession())==null?void 0:e.getDuration())??this.videojsPlayer.duration()}volume(){var e;return((e=this.getCastSession())==null?void 0:e.getVolume())??1}setVolume(e){var t;(t=this.getCastSession())==null||t.setVolume(e)}muted(){var e;return((e=this.getCastSession())==null?void 0:e.getMuted())??!1}setMuted(e){var t;(t=this.getCastSession())==null||t.setMuted(e)}buffered(){}seekable(){return U.createTimeRanges(0,this.duration())}playbackRate(){return 1}readyState(){return 4}controls(){return!1}playsinline(){return!0}supportsFullScreen(){return!0}setAutoplay(){}preload(){}load(){}setPlaybackRate(){}static canPlayType(){return""}static canPlaySource(e,t){return!!sa.getOrCreateInstance((t==null?void 0:t.instanceId)??"").getCastSession()}static isSupported(){return sa.isActive()}}U.registerTech("devices",LG);const OG=U.getPlugin("plugin");class MG extends OG{constructor(e,t){var i;super(e,t),this.options=t,this.instanceId=((i=this.player.options_.devices)==null?void 0:i.instanceId)??"",this.bindFunctions(),this.initialize()}bindFunctions(){this.initialize=this.initialize.bind(this),this.onReady=this.onReady.bind(this),this.onDevicesChanged=this.onDevicesChanged.bind(this),this.onCastSessionChanged=this.onCastSessionChanged.bind(this),this.onDevicesError=this.onDevicesError.bind(this),this.addViviClient=this.addViviClient.bind(this),this.addAppleTvClient=this.addAppleTvClient.bind(this),this.reloadTech=this.reloadTech.bind(this),this.getSessionManager=this.getSessionManager.bind(this),this.dispose=this.dispose.bind(this)}initialize(){this.player.ready(this.onReady)}onReady(){const e=this.player.getChild("collapserator"),t=e==null?void 0:e.children().findIndex(g=>g.name()==="CustomControlSpacer"),i=e==null?void 0:e.children().findIndex(g=>g.name()==="OpenExternallyButton"),r=Math.max(t,i)+1,n=this.getSessionManager();if(!e||!t||t===-1||!n)return;n.on("deviceschange",this.onDevicesChanged),n.on("castsessionchange",this.onCastSessionChanged),n.on("error",this.onDevicesError);const a=()=>{this.addViviClient(n),this.addAppleTvClient(n)},o=(g,y)=>{var p;n.startCastSession({device:y,title:this.options.title}),(p=this.options.analyticsService)==null||p.logUserAction(y,{actionType:fi.Select,workflowPhase:Hl.Complete,descriptor:aa.ChangeDevice,entity:Ai.Device,eventVersion:Gs.V3})},l=this.options.ctaOptions,u=this.options.vivi,c=this.options.appleTv,h=[];c.enabled||h.push(nr.AppleTv),(!u.enabled||!u.accountConnected)&&h.push(nr.Vivi);const d={onClick:a,onDeviceMenuItemClick:o,ctaOptions:{...l,inactiveIntegrations:h}};this.devicesButton=e.addChild("DevicesButton",d,r)}onDevicesChanged(e){var t;(t=this.devicesButton)==null||t.setDevices(e)}onCastSessionChanged(e){var t;(t=this.devicesButton)==null||t.setCastSession(e),this.reloadTech(),e?(this.player.addClass("cv-device-casting"),this.player.addClass(`cv-device-${e.getDevice().type}`),this.player.isFullscreen()&&this.player.exitFullscreen()):(this.player.removeClass("cv-device-casting"),this.player.removeClass(`cv-device-${nr.AppleTv}`),this.player.removeClass(`cv-device-${nr.Vivi}`))}onDevicesError(e){this.player.error(e.message),this.player.pause()}addViviClient(e){if(!this.options.vivi.enabled||!this.options.vivi.accountConnected||!this.options.vivi.apiUrl||e.hasInstanceOfClient(Ws))return;const t=new Ws({url:this.options.vivi.apiUrl,fetchAccessToken:this.options.vivi.fetchAccessToken});e.addClient(t)}addAppleTvClient(e){if(!this.options.appleTv.enabled||!this.options.trackingCode||!this.options.userId||e.hasInstanceOfClient(zs))return;const t=new zs({fetchAccessToken:this.options.appleTv.fetchAccessToken,trackingCode:this.options.trackingCode,userId:this.options.userId});e.addClient(t)}reloadTech(){const e=this.player,t=e.currentSources(),i=e.volume(),r=e.muted(),n=e.currentTime(),a=e.paused();e.src(t),e.one("playing",()=>{e.volume(i),e.muted(r),e.currentTime(n),a?e.pause():e.play()})}getSessionManager(){if(this.instanceId)return sa.getOrCreateInstance(this.instanceId)}dispose(){const e=this.getSessionManager();e&&(e.off("deviceschange",this.onDevicesChanged),e.off("castsessionchange",this.onCastSessionChanged),e.off("error",this.onDevicesError),sa.disposeAndRemoveInstance(e),super.dispose())}}U.registerPlugin("devicesPlugin",MG);function RG(s){var n;const[e,t]=Ks.useState(5);if(Ks.useEffect(()=>{const a=setInterval(()=>{t(o=>o-1)},1e3);return()=>{clearInterval(a)}},[]),Ks.useEffect(()=>{e===0&&s.onPlayNext()},[e]),!s.nextVideo||!s.onPlayNext)return ue.jsx(ue.Fragment,{});const i=Math.ceil(e),r=i===1?"second":"seconds";return ue.jsx(ue.Fragment,{children:ue.jsxs("div",{className:"cv-up-next-container",children:[ue.jsx("div",{className:"cv-cancel-up-next cursor-pointer",role:"button",onClick:s.onCancel,children:"×"}),ue.jsxs("div",{className:"cv-up-next-heading",children:["Up next in ",i," ",r,":"]}),ue.jsx("div",{className:"cv-up-next-image cursor-pointer",onClick:s.onPlayNext,style:{backgroundImage:`url(${(n=s.nextVideo)==null?void 0:n.thumbnailUrl})`}}),ue.jsx("div",{className:"cv-up-next-title",children:s.nextVideo.name})]})})}U.registerComponent("UpNext",Ed((s,e)=>ue.jsx(RG,{player:s,...e})));const FG=U.getComponent("MenuItem");let BG=class extends FG{constructor(e,t){super(e,t),this.bindListeners(),this.player_.nextVideoPlugin().getShouldPlayNext()&&this.toggleOn()}bindListeners(){this.onPlayNextChange=this.onPlayNextChange.bind(this),this.player_.on("cv:playnext",this.onPlayNextChange)}handleToggle(){const e=this.player_.nextVideoPlugin().getShouldPlayNext();this.player_.nextVideoPlugin().setShouldPlayNext(!e,!0)}onPlayNextChange(e,t){t?this.toggleOn():this.toggleOff()}toggleOn(){U.dom.addClass(this.toggleEl,"on")}toggleOff(){U.dom.removeClass(this.toggleEl,"on")}handleClick(e){e.stopImmediatePropagation()}createEl(e,t,i){this.handlerBound||(this.handleToggle=this.handleToggle.bind(this),this.handlerBound=!0),this.toggleEl&&this.toggleEl.removeEventListener("click",this.handleToggle),this.toggleEl=U.dom.createEl("div",{className:"custom-toggle custom-toggle-info toggle-option float-end",innerHTML:'<span class="handle"></span></div>'}),this.toggleEl.addEventListener("click",this.handleToggle);const n=super.createEl(e,{className:"vjs-menu-item cv-cog-menu-item cv-play-next-toggle",innerHTML:`
355
- <span class="vjs-menu-item-text">Play next video</span>
356
- <span class="cv-toggle-container"></span>`},i);return n.children[1].appendChild(this.toggleEl),n}dispose(){this.player_.off("cv:playnext",this.onPlayNextChange),super.dispose()}};U.registerComponent("NextVideoMenuItem",BG);const p1="cv-persisttest",m1="cv-play-next-video",UG=U.getPlugin("plugin");U.getComponent("MenuItem");const $G=U.getComponent("NextVideoMenuItem");class jG extends UG{constructor(e){if(super(e),this.setShouldPlayNext=this.setShouldPlayNext.bind(this),this.getShouldPlayNext=this.getShouldPlayNext.bind(this),this.getChapterTrack=this.getChapterTrack.bind(this),this.onTimeUpdate=this.onTimeUpdate.bind(this),this.hasLocalStorage=this.testHasLocalStorage(),this.shouldPlayNextVideo=!1,this.hasLocalStorage){const t=window.localStorage.getItem(m1);this.shouldPlayNextVideo=t==="true"}e.ready(()=>{this.initialize()})}initialize(){this.player.isDisposed()||this.bindListeners()}getChapterTrack(){return Qt.getTrack(this.player,"chapters",null)}setNextVideo(e,t,i){var n;this.nextVideo=e,this.callback=i,t&&this.setShouldPlayNext(!0),((n=this.player.getChild("collapserator"))==null?void 0:n.getChild("cogButton")).addItem({index:0,ctor:$G,name:"NextVideoMenuItem"})}getShouldPlayNext(){return this.shouldPlayNextVideo}setShouldPlayNext(e,t){this.shouldPlayNextVideo=e,this.player.trigger("cv:playnext",e),this.hasLocalStorage&&t&&window.localStorage.setItem(m1,e.toString()),e&&this.player.loopVideoPlugin().loop(!1)}bindListeners(){this.player.on("timeupdate",this.onTimeUpdate)}dispose(){this.player.off("timeupdate",this.onTimeUpdate),this.hideUpNext(),super.dispose()}onTimeUpdate(){if(!(this.player.pictureInPicture&&this.player.isInPictureInPicture())){if(!this.getShouldPlayNext()){this.hideUpNext();return}if(this.upNextRendered&&this.player.currentTime()<this.player.duration()){this.hideUpNext();return}this.player.ended()&&this.showUpNext()}}showUpNext(){this.upNextRendered||(this.upNextRendered=!0,this.player.addChild("UpNext",{nextVideo:this.nextVideo,onPlayNext:this.callback,onCancel:()=>{this.hideUpNext(),this.setShouldPlayNext(!1)}}))}hideUpNext(){if(!this.upNextRendered)return;this.upNextRendered=!1;const e=this.player.getChild("UpNext");e&&(this.player.removeChild(e),e.dispose())}testHasLocalStorage(){try{return window.localStorage.setItem(p1,"persistPlayNext"),window.localStorage.removeItem(p1),!0}catch{return!1}}}U.registerPlugin("nextVideoPlugin",jG);const qG="_imageStyle_9s5en_1",VG="_imageTypeResource_9s5en_6",HG="_fallBackImage_9s5en_12",Sg={imageStyle:qG,imageTypeResource:VG,fallBackImage:HG},zG={width:200,resizeType:b1.Cover};function WG(s,e,t=zG){var n,a,o;const i=WI(e);if("thumbnail"in e&&((n=e.thumbnail)!=null&&n.url))return Va.createUrl((a=e.thumbnail)==null?void 0:a.url,{...t});const r=BP.safeUrlConcat(s,"/v1/previews");return zl.isResource(e)?i===wc.Pdf?e.metadata.type===co.Pdf?Va.createResourceImage(r,e.url,{...t}):Va.createResourceImage(r,(o=e.pdf)==null?void 0:o.url,{...t}):e.metadata.type!==co.Zip?Va.createUrl(e.url,{size:T1.Medium,resizeType:b1.Cover}):"/images/zip-resource.png":Va.createResourceImage(r,e.url,{...t})}function WI(s){var e;return zl.isResource(s)?s.metadata.type===co.Pdf||(e=s.pdf)!=null&&e.url?wc.Pdf:wc.Thumbnails:wc.Link}function GG(s){var r,n;let e=null,t=0;zl.isResource(s.resource)&&(e=s.resource.metadata,t=((n=(r=s.resource.thumbnail)==null?void 0:r.metadata)==null?void 0:n.rotation)??0);const i=WG(s.imageCdnUrl,s.resource,s.dynamicRatioImageOptions);return ue.jsx(oD,{data:i,imageType:WI(s.resource),imageStyle:{transform:`rotate(${t}deg)`},alt:s.resource.name,errorFallbackImageSrc:s.imageErrorFallbackUrl,errorFallbackImageClassName:Sg.fallBackImage,imageClassName:(e==null?void 0:e.type)===co.Image?`${Sg.imageTypeResource} ${Sg.imageStyle}`:"",preload:s.preloadImage,preventLoad:!s.preloadImage})}const KG={getResourceTypeName(s){switch(s){case"additional-materials":return"Additional Materials";case"atom-guide":return"ATOM Guide";case"teacher-pack":return"Teacher Pack";case"student-activity":return"Student Activity";default:return"N/A"}}},XG="_imageStyle_1xd89_1",QG="_item_1xd89_6",YG="_dashboard_1xd89_10",JG="_playPage_1xd89_25",ZG="_aspectRatio_1xd89_34",eK="_outerContainer_1xd89_39",tK="_innerContainer_1xd89_46",iK="_actions_1xd89_46",rK="_titleBelow_1xd89_56",nK="_thumbnailContainer_1xd89_59",sK="_titleAbove_1xd89_62",aK="_teacherPack_1xd89_65",oK="_text_1xd89_68",lK="_hoverState_1xd89_71",uK="_atomGuide_1xd89_74",cK="_studentActivity_1xd89_83",hK="_additionalMaterials_1xd89_92",dK="_userUploaded_1xd89_101",fK="_download_1xd89_116",Kt={imageStyle:XG,item:QG,dashboard:YG,playPage:JG,aspectRatio:ZG,outerContainer:eK,innerContainer:tK,actions:iK,titleBelow:rK,thumbnailContainer:nK,titleAbove:sK,teacherPack:aK,text:oK,hoverState:lK,atomGuide:uK,studentActivity:cK,additionalMaterials:hK,userUploaded:dK,download:fK};function pK(s){switch(s){case"atom-guide":return Kt.atomGuide;case"student-activity":return Kt.studentActivity;case"teacher-pack":return Kt.teacherPack;case"additional-materials":return Kt.additionalMaterials;default:return Kt.userUploaded}}function mK(s,e){var i;const t=lD();return e==="public"?!0:t.xs||t.sm||s.type!=="resource"||!("metadata"in s)?!1:s.metadata.type===co.Image?!0:s.metadata.type===co.Pdf?!!s.url:!!((i=s.pdf)!=null&&i.url)}js.defaultProps={preloadImage:!0,actionBehaviour:"normal"};function js(s){var r,n,a;let e=null;"metadata"in s.data&&(e=s.data.metadata);const t=zl.isType(s.data,kc.Resource);function i(o){var u;let l=`
357
- d-flex flex-column align-items-center justify-content-end rounded-3 h-100
358
- position-relative ${pK(o)} ${Kt.innerContainer}`;return(u=s.theme)!=null&&u.containerClass?l+=` ${s.theme.containerClass}`:l+=" pt-3 px-3",s.applyHoverState&&(l+=` ${Kt.hoverState}`),l}return ue.jsxs(ue.Fragment,{children:[ue.jsx("div",{className:Kt.aspectRatio,children:ue.jsx("div",{className:Kt.outerContainer,children:ue.jsxs("div",{className:i(e==null?void 0:e.resourceType),children:[s.titlePosition==="above"&&ue.jsx(Ov,{title:s.data.name,children:ue.jsx("h3",{className:`text-center text-break h5 mb-3 ${Kt.text}`,children:ue.jsx("span",{className:"clamp-1",children:s.data.name})})}),ue.jsx("div",{className:`
359
- ${((r=s.theme)==null?void 0:r.thumbnailContainerClass)??""} w-75 overflow-hidden
360
- ${Kt.thumbnailContainer} ${s.titlePosition==="above"?Kt.titleAbove:""}
361
- ${Kt.imageStyle}
362
- `,children:ue.jsx(GG,{resource:s.data,imageCdnUrl:s.imageCdnUrl,imageErrorFallbackUrl:s.imageErrorFallbackUrl,preloadImage:s.preloadImage})}),t&&s.onClickDownload&&s.actionBehaviour==="normal"&&ue.jsx("div",{className:Kt.actions,children:ue.jsx(Ja,{onClick:o=>s.onClickDownload(o,s.data),className:`${Kt.download} d-flex align-items-center justify-content-center`,children:ue.jsx(An,{svg:DI})})}),!s.hideTypeBadge&&t&&ue.jsx(KP,{typeId:kc.Resource})]})})}),s.titlePosition==="below"&&ue.jsxs("div",{className:`mt-1 ${Kt.titleBelow}`,children:[zl.isType(s.data,kc.Resource)&&!!((a=(n=s.data)==null?void 0:n.metadata)!=null&&a.resourceType)&&ue.jsx(XP,{children:KG.getResourceTypeName(s.data.metadata.resourceType)}),ue.jsx("h3",{className:"h6 clamp-2",children:s.data.name})]})]})}Pt.memo(function(s){const e=mK(s.data,s.actionBehaviour);function t(){return s.location==="play-page"?Kt.playPage:Kt.dashboard}const i={...s.analyticsData,...s.data},r={...s.analyticsOptions,actionType:fi.Click,entity:s.data.typeId===kc.Resource?Ai.Resource:Ai.Link};function n(){as.logUserAction(i,r)}const a={...s,applyHoverState:e||!!s.data.url};return ue.jsx("div",{className:`px-1 flex-shrink-0 ${Kt.item} ${t()} ${UP.RESOURCE_ITEM_SELECTOR}`,children:(()=>{const o="d-block no-decoration";return s.data.type==="link"?ue.jsx("a",{href:s.data.url,target:"_blank",className:o,onClick:n,children:ue.jsx(js,{...a})}):e?s.actionBehaviour==="public"?ue.jsx("div",{className:`${o} cursor-pointer d-inline`,onClick:()=>{n(),$P.trigger(s.getAppLink(s.data))},children:ue.jsx(js,{...a})}):ue.jsx(jP,{appLink:s.getAppLink(s.data),className:o,analyticsData:i,analyticsOptions:r,children:ue.jsx(js,{...a})}):s.data.url?ue.jsx("a",{href:s.data.url,className:o,onClick:n,children:ue.jsx(js,{...a})}):ue.jsx("div",{className:o,children:ue.jsx(js,{...a})})})()})});function gK(s){return ue.jsx("div",{className:"cv-resource-item",children:ue.jsx(js,{data:s.resource,imageCdnUrl:s.imageCdnUrl,titlePosition:"above",hideTypeBadge:!0})})}const vK=Ed((s,e)=>ue.jsx(gK,{...e})),yK=U.getComponent("MenuItem");class _K extends yK{constructor(e,t){super(e,t);const i=new vK(e,{resource:t.resource,imageCdnUrl:t.imageCdnUrl});this.addChild(i)}createEl(e,t={},i){return super.createEl(e,{...t,className:`${t.className} cv-resource-menu-item`},i)}handleClick(e){e.stopImmediatePropagation(),this.options_.downloadResource(this.options_.resource)}}const TK=U.getComponent("MenuButton");class GI extends TK{constructor(){super(...arguments),this.alwaysCollapsed=!1,this.isCollapsed=!1,this.isCollabsible=!0}buildWrapperCSSClass(){return`cv-menu-small cv-resources-button-wrapper ${super.buildWrapperCSSClass()}`}buildCSSClass(){return`cv-resources-button ${super.buildCSSClass()}`}update(){super.update()}createItems(){const e=[];return e.push(new la(this.player_,{label:"Resources"})),this.options_.resources.forEach(t=>{const i=new _K(this.player(),{resource:t,imageCdnUrl:this.options_.imageCdnUrl,downloadResource:r=>this.downloadResource(r),label:t.name});e.push(i)}),e}downloadResource(e){if(e.type==="link"){qP.PageLoad(e.url,!0);return}this.getDownloadIframe().src=e.url}getDownloadIframe(){return this.downloadIframe?this.downloadIframe:(this.downloadIframe=U.dom.createEl("iframe"),this.downloadIframe.style.display="none",U.dom.appendContent(U.dom.$("body"),this.downloadIframe),this.downloadIframe)}getCollabsibleName(){return this.controlText_}getCollabsibleValue(){return""}showInCollabsibleMenu(){return!0}showCollapsibleMenu(){super.handleClick(null)}}GI.prototype.controlText_="Resources";U.registerComponent("ResourcesButton",GI);const bK=U.getPlugin("plugin");class SK extends bK{constructor(e,t){super(e,t),this.options=t,e.ready(()=>this.onReady())}onReady(){if(!this.options.resources.length)return;const e=this.player.getChild("collapserator");e.addChild("ResourcesButton",{resources:this.options.resources,imageCdnUrl:this.options.imageCdnUrl},e.children_.length-4)}}U.registerPlugin("resourcesPlugin",SK);function HQ(s){const{className:e="",playerApi:t,onReady:i,onDispose:r,...n}=s,a=Pt.useRef(null);return Pt.useEffect(()=>{if(!a)return;const o=new XW(a.current,{...n,playerApi:t});return i&&o.ready(()=>{i(QW(o))}),r&&o.one("dispose",r),()=>{o==null||o.dispose()}},[s.viewKey]),ue.jsx("div",{ref:a,className:e})}const xK="_overlay_rtlcs_1",CK="_close_rtlcs_10",EK="_preview_rtlcs_15",xc={overlay:xK,close:CK,preview:EK};function zQ(s){return ue.jsxs(ue.Fragment,{children:[ue.jsx("div",{className:`${xc.overlay} ${xc.preview} d-flex align-items-center justify-content-start`,children:ue.jsx(An,{svg:zP,size:Cg.Large})}),ue.jsx(Ja,{className:`${xc.overlay} ${xc.close} d-flex align-items-center justify-content-center`,onClick:s.closePopup,children:ue.jsx(An,{svg:Mv,size:Cg.Large})})]})}const wK="_copyrightDisclaimer_yyjul_1",kK="_overlayContainer_yyjul_4",g1={copyrightDisclaimer:wK,overlayContainer:kK},xg="shared.copyrightDisclaimer",AK=150;function IK(s){const[e,t]=rD({});function i(){var n;return document.documentElement.clientHeight-((n=e.current)==null?void 0:n.getBoundingClientRect().bottom)<AK}return ue.jsxs("div",{ref:e,className:s.className,children:[ue.jsx("p",{className:`${g1.copyrightDisclaimer} ${s.phraseClassName??"mb-1"}`,children:ue.jsx(Ol,{namespace:xg,phrase:"copyrightDisclaimer"})}),ue.jsx(VP,{target:e.current,show:t,placement:s.overflowPlacement&&i()?s.overflowPlacement:s.placement,children:ue.jsxs("div",{className:`${g1.overlayContainer} mw-100 bg-white border rounded-3 p-2`,children:[ue.jsx("p",{children:ue.jsx(Ol,{namespace:xg,phrase:"warning"})}),ue.jsx("p",{className:"fw-semibold mb-0",children:ue.jsx(Ol,{namespace:xg,phrase:"sharing"})})]})})]})}function PK(s){const{page:e,totalPages:t}=s,i=qy.isNumber(e)&&e>0&&e<t&&e+1,r=qy.isNumber(e)&&e>1&&e-1,n={};if(i&&i<=t&&(n.next=i.toString()),r&&(n.previous=r.toString()),!HP.isEmpty(n))return n}const KI={isEmpty(s){return s&&!(s.data&&s.data.length)},length(s){return s&&s.data&&s.data.length},at(s,e){if(!(!s||!s.data||!s.data.length||e>s.data.length))return s.data[e]},get(s,e){if(!(!s||!s.data||!s.data.length))return s.data.find(t=>t.id&&t.id.toString()===e)},flattenCollections(s){if(!s||!s.length)return;let e=[];return s.forEach(t=>{e=[...e,...t.data]}),e},getNextCursor(s){return s.pagination&&s.pagination.cursors&&s.pagination.cursors.next},convertLegacyPaginatedCollection(s){if(s)return{data:s.data,pagination:{cursors:PK(s.pagination),limit:s.pagination.pageSize}}},hasData(s){return!KI.isEmpty(s)}};function v1(s){var e;switch((e=s.tagType)==null?void 0:e.toLowerCase()){case Uy.Pedagogy:return 0;case Uy.Skill:return 1;default:return 2}}function DK(s){if(!s.tags)return ue.jsx(ue.Fragment,{});const e=[...s.tags].sort((t,i)=>v1(t)-v1(i));return ue.jsx("div",{className:`${tD.tagList} ${s.className}`,children:e.map(t=>{const i=typeof s.getAppLink=="function"?s.getAppLink(t):null,r=typeof s.onRemove=="function"?()=>s.onRemove(t):null,n=typeof s.onClick=="function"?()=>s.onClick(t):null;return ue.jsx(iD,{tag:t,appLink:i,themeColours:s.themeColours,onRemove:r,onClick:n},t.id||t.name)})})}function Cc(s){const{label:e,items:t}=s;if(!(t&&t.data&&t.data.length))return ue.jsx(ue.Fragment,{});const r=t.data.map(n=>n.name).join(", ");return ue.jsxs("div",{className:"mb-2",children:[e,": ",r]})}const XI="exchange.detailsSection",Ec=su.encloseNamespace(XI);function NK(s){var r,n,a,o,l,u,c,h,d,g;const{video:e,hasPPDD:t,description:i}=s;return ue.jsxs("div",{className:i?"col-md-5 ps-md-3 pt-3 pt-md-0":"col-12",children:[ue.jsx("h2",{className:"h6 mb-2",children:ue.jsx(Ol,{namespace:XI,phrase:"details"})}),t&&ue.jsxs("div",{children:[ue.jsx(Cc,{label:Ec("productionCompanies",{smartCount:(n=(r=e.productionCompanies)==null?void 0:r.data)==null?void 0:n.length}),items:e.productionCompanies}),ue.jsx(Cc,{label:Ec("distributors",{smartCount:(o=(a=e.distributors)==null?void 0:a.data)==null?void 0:o.length}),items:e.distributors}),ue.jsx(Cc,{label:Ec("producers",{smartCount:(u=(l=e.producers)==null?void 0:l.data)==null?void 0:u.length}),items:e.producers}),ue.jsx(Cc,{label:Ec("directors",{smartCount:(h=(c=e.directors)==null?void 0:c.data)==null?void 0:h.length}),items:e.directors})]}),!!((g=(d=e.tags)==null?void 0:d.data)!=null&&g.length)&&ue.jsx(DK,{tags:e.tags.data})]})}const LK="_previewBadge_1mq7j_1",y1={previewBadge:LK},OK="exchange.previewVideoDetails",MK=200;function WQ(s){var h,d,g,y,p;const{title:e,description:t,video:i,videoActions:r}=s,n=_=>_?!KI.isEmpty(_):!1,a=!!(i!=null&&i.series),o=!!((h=i==null?void 0:i.rating)!=null&&h.value)||!!(i!=null&&i.productionYear)||s.program,l=n(i==null?void 0:i.productionCompanies)||n(i==null?void 0:i.producers)||n(i==null?void 0:i.distributors)||n(i==null?void 0:i.directors),u=!!t,c=l||!!((g=(d=i==null?void 0:i.tags)==null?void 0:d.data)!=null&&g.length);return ue.jsxs("div",{className:"p-3",children:[ue.jsxs("div",{className:`${!a&&!o?"mb-2":"mb-3"} position-relative`,children:[ue.jsxs("div",{className:"w-100",children:[ue.jsx("div",{className:"ms-2 float-end",children:ue.jsx(uD,{actions:r,actionsDropdownClassName:"btn btn-outline-dark px-1"})}),!!i&&ue.jsx(QP,{type:"series",video:i,appLink:hD(i.series),className:"text-wrap",analyticsOptions:{location:Ll.PlayPage}}),ue.jsx("h1",{className:`h4 mb-1 ${!a&&!o?"mb-0 pt-2":""}`,children:ue.jsx("span",{className:"align-self-center",children:e})})]}),o&&ue.jsxs(cD,{children:[ue.jsx($y,{type:jy.Rating,data:i==null?void 0:i.rating,className:`${y1.previewBadge} fw-semibold py-0 font-size-normal align-items-center px-2`}),ue.jsx($y,{type:jy.ProductionYear,data:i==null?void 0:i.productionYear,className:`${y1.previewBadge} fw-semibold font-size-sm align-items-center px-1`}),((y=s.program)==null?void 0:y.channelLogoUrl)&&ue.jsx(fD,{logoUrl:s.program.channelLogoUrl,className:"me-1"}),((p=s.program)==null?void 0:p.hasAdsFree)&&ue.jsx(dD,{className:"me-1"}),s.program&&ue.jsx(pD,{program:s.program,showDate:!0,showEndTime:!0})]})]}),ue.jsxs("div",{children:[ue.jsx(GP.Scrollbars,{autoHeight:!0,autoHeightMax:MK,children:ue.jsxs("div",{className:"row g-0",children:[u&&ue.jsxs("div",{className:c?"border-end pe-3 col-md-7":"col-12",children:[ue.jsx("div",{className:"d-flex align-items-center",children:ue.jsx("h2",{className:"h6 mb-2",children:ue.jsx(Ol,{namespace:OK,phrase:"description"})})}),ue.jsx("p",{className:"mb-2",dangerouslySetInnerHTML:{__html:YP.linkifyText(t,{nl2br:!0})}})]}),c&&ue.jsx(NK,{video:i,hasPPDD:l,description:t})]})}),s.video&&ue.jsxs("div",{className:"row",children:[ue.jsx("div",{className:`${l?"d-md-block col-7":""} d-none`}),ue.jsx("div",{className:`${l?"col-md-5 ps-md-3":"ps-2 "} `,children:ue.jsx(IK,{placement:l?"bottom-end":"bottom-start",overflowPlacement:l?"top-end":"top-start"})})]})]})]})}export{HQ as C,WQ as P,zQ as a};