@clickview/exchange 0.43.0-rc.2 → 0.43.1-dev.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Actions-BtMRNMuv.cjs +1 -0
- package/dist/Actions-DfeKDy3k.js +178 -0
- package/dist/AddToLibraryView-BoCLtcWV.js +508 -0
- package/dist/AddToLibraryView-MpkcVgoR.cjs +1 -0
- package/dist/Badge-3MW5GacP.cjs +1 -0
- package/dist/Badge-Ddz0Il5v.js +326 -0
- package/dist/BadgeListContainer-CqwUuWKL.js +19 -0
- package/dist/BadgeListContainer-DLrBuDpU.cjs +1 -0
- package/dist/ButtonGroup-C-z2yWvb.cjs +1 -0
- package/dist/ButtonGroup-zaxEq7ZK.js +24 -0
- package/dist/Caret-Cpx0uvJ0.js +36 -0
- package/dist/Caret-Dgjy7YHO.cjs +1 -0
- package/dist/ChevronDownSvg-BI6xUNrZ.cjs +1 -0
- package/dist/ChevronDownSvg-BfijmId7.js +13 -0
- package/dist/ClassNameHelper-aJ0BDnVo.js +29 -0
- package/dist/ClassNameHelper-n4BHW-GR.cjs +1 -0
- package/dist/CloseSvg-2PKjla1T.js +13 -0
- package/dist/CloseSvg-B7rizkGp.cjs +1 -0
- package/dist/CurationStatus-BGjsO3l8.cjs +1 -0
- package/dist/CurationStatus-DZn3C9Qe.js +4 -0
- package/dist/DevErrorView-Bg1Ufy6-.js +79 -0
- package/dist/DevErrorView-CpXfV0V4.cjs +1 -0
- package/dist/DialogView-B5FEh3e8.cjs +1 -0
- package/dist/DialogView-RcNOylD7.js +22 -0
- package/dist/DownloadHelper-ChKHN-Le.cjs +1 -0
- package/dist/DownloadHelper-dL46n0Kq.js +32 -0
- package/dist/DownloadVideoView-CvDFi8HI.cjs +1 -0
- package/dist/DownloadVideoView-HSnwAYLp.js +32 -0
- package/dist/DragDropMoveWrapper-B_dy7ady.cjs +1 -0
- package/dist/DragDropMoveWrapper-TdzJqiqv.js +462 -0
- package/dist/ExchangeAddView-BRLjRe3p.js +63 -0
- package/dist/ExchangeAddView-CWfp5W52.cjs +1 -0
- package/dist/ExchangeFolderView-4ArEcQvn.js +159 -0
- package/dist/ExchangeFolderView-_ldS0uwf.cjs +1 -0
- package/dist/ExchangeMostRecentView-BMAosIXz.js +61 -0
- package/dist/ExchangeMostRecentView-s1iLfclz.cjs +1 -0
- package/dist/ExchangeNotFoundView-C_dtuc6J.cjs +1 -0
- package/dist/ExchangeNotFoundView-Cb-rmQH1.js +7 -0
- package/dist/ExchangePreviewView-hztBChIE.js +82 -0
- package/dist/ExchangePreviewView-kjDv-uqf.cjs +1 -0
- package/dist/ExchangeRequests-B3wRfv5Y.cjs +1 -0
- package/dist/ExchangeRequests-DV7BD3HZ.js +115 -0
- package/dist/ExchangeSearchBar-CNtU_swT.js +32 -0
- package/dist/ExchangeSearchBar-Ci1_Sc2S.cjs +1 -0
- package/dist/ExchangeSearchResultsView-CEueb9Li.js +1641 -0
- package/dist/ExchangeSearchResultsView-CGSIyjiV.cjs +2 -0
- package/dist/ExchangeSeriesView-BGBgwgMW.cjs +1 -0
- package/dist/ExchangeSeriesView-DMr_mCAH.js +143 -0
- package/dist/ExchangeSuggestEditView-B3P-nGFE.js +307 -0
- package/dist/ExchangeSuggestEditView-D1m5Z20N.cjs +1 -0
- package/dist/ExchangeTabs-CrA22PjN.js +46 -0
- package/dist/ExchangeTabs-KgrROs1d.cjs +1 -0
- package/dist/ExchangeUtils-BRDE3b9w.cjs +1 -0
- package/dist/ExchangeUtils-CCCrn5oQ.js +65 -0
- package/dist/ExchangeView-Cui4zZ4D.js +30 -0
- package/dist/ExchangeView-Dql8pHzi.cjs +1 -0
- package/dist/FormButtons-CDOsf9A-.cjs +1 -0
- package/dist/FormButtons-fQkvwYsy.js +20 -0
- package/dist/FormFeedback-5Dd3bMCl.js +7 -0
- package/dist/FormFeedback-BU7vSBqB.cjs +1 -0
- package/dist/FormField-Cb2l2GMO.cjs +5 -0
- package/dist/FormField-DYeERWxm.js +3353 -0
- package/dist/GiveFeedbackView-0tH6h1s3.js +5436 -0
- package/dist/GiveFeedbackView-DirGDc2a.cjs +7 -0
- package/dist/GroupSvg-BmwXO6yT.js +53 -0
- package/dist/GroupSvg-DVAq4iNX.cjs +1 -0
- package/dist/HardCoded-25AFj2sZ.js +51 -0
- package/dist/HardCoded-BbbeCQNt.cjs +1 -0
- package/dist/HttpErrorHandlers-CBhvfsvb.cjs +1 -0
- package/dist/HttpErrorHandlers-DKqNIMOg.js +76 -0
- package/dist/IconCircle-BVHFUBGt.cjs +1 -0
- package/dist/IconCircle-CxFLsbLY.js +26 -0
- package/dist/InstanceRegion-C7aJEkFV.cjs +1 -0
- package/dist/InstanceRegion-DQlzs4EK.js +4 -0
- package/dist/LazyImage-DBQklqeJ.js +163 -0
- package/dist/LazyImage-lv36coda.cjs +1 -0
- package/dist/LibraryRequests-BHAZPSUw.js +186 -0
- package/dist/LibraryRequests-DKCsJHbr.cjs +1 -0
- package/dist/LinkifyHelper-DPHYATPc.js +925 -0
- package/dist/LinkifyHelper-EOfbsqdi.cjs +4 -0
- package/dist/MasterTypeHelper-Y_SDsEUF.cjs +1 -0
- package/dist/MasterTypeHelper-uSKy6GZd.js +16 -0
- package/dist/MediaQueries-9caJ2eG6.js +4 -0
- package/dist/MediaQueries-CE9Kbs0e.cjs +1 -0
- package/dist/PartialLoadingHelper-D42uOdDd.cjs +1 -0
- package/dist/PartialLoadingHelper-DIas6hnM.js +29 -0
- package/dist/PermissionFilterOption-B-QrMVdA.js +4 -0
- package/dist/PermissionFilterOption-BIA__Q_O.cjs +1 -0
- package/dist/PillTabSelector-B5V2rqf0.js +64 -0
- package/dist/PillTabSelector-yR52s5ix.cjs +14 -0
- package/dist/PreviewVideoDetails-BQ0lYYbK.cjs +362 -0
- package/dist/PreviewVideoDetails-DJXB4vV3.js +68337 -0
- package/dist/ProgramType-DHk-SlRZ.cjs +1 -0
- package/dist/ProgramType-FpE5cuZV.js +60 -0
- package/dist/RatingRequests-BNPZAxXm.cjs +1 -0
- package/dist/RatingRequests-Dr3w3-z8.js +11 -0
- package/dist/RedirectView-BK8yU-PU.js +22 -0
- package/dist/RedirectView-OEJhJrvf.cjs +1 -0
- package/dist/RestrictionHelper-BSceJYz-.js +112 -0
- package/dist/RestrictionHelper-C5u_CmoL.cjs +1 -0
- package/dist/ScrollHelper-Dg7bDIH7.js +10 -0
- package/dist/ScrollHelper-ESsjtyv8.cjs +1 -0
- package/dist/SearchFilters-C_yEnumc.js +3046 -0
- package/dist/SearchFilters-D3fLjseM.cjs +1 -0
- package/dist/SearchSvg-BB6oXs1v.js +13 -0
- package/dist/SearchSvg-BU6G1Fs0.cjs +1 -0
- package/dist/SharedSearchHelper-BuVD-GvT.js +159 -0
- package/dist/SharedSearchHelper-D5GJJwW7.cjs +1 -0
- package/dist/TagItem-BBc3HmnI.cjs +1 -0
- package/dist/TagItem-BFnSikAz.js +1125 -0
- package/dist/TvAdFreeBadge-BDFn2ujd.js +11 -0
- package/dist/TvAdFreeBadge-X2iSf6B3.cjs +1 -0
- package/dist/TvAdFreeRequestView-CEAvozfO.js +46 -0
- package/dist/TvAdFreeRequestView-DgnMCKX4.cjs +1 -0
- package/dist/TvAddView-Bv12wfX7.js +276 -0
- package/dist/TvAddView-CA7Yappn.cjs +1 -0
- package/dist/TvAlreadyAddedView-C240rLQ7.js +56 -0
- package/dist/TvAlreadyAddedView-X4KElzJA.cjs +1 -0
- package/dist/TvBroadcastContentView-DizJHvTQ.js +52 -0
- package/dist/TvBroadcastContentView-g8i0Cy-k.cjs +1 -0
- package/dist/TvChannelBadge-B4a1wkQI.cjs +1 -0
- package/dist/TvChannelBadge-Doqs12s9.js +11 -0
- package/dist/TvChannelView-CSn0VleL.js +177 -0
- package/dist/TvChannelView-Ds_F3Mmp.cjs +1 -0
- package/dist/TvChannelsView-CM_T5E3j.js +171 -0
- package/dist/TvChannelsView-r3NO_BRv.cjs +1 -0
- package/dist/TvGuideView-B8vS-8lS.cjs +1 -0
- package/dist/TvGuideView-BLlQJiZ3.js +54 -0
- package/dist/TvHomeView-C_h4DZw_.cjs +1 -0
- package/dist/TvHomeView-CbNg8AyI.js +15 -0
- package/dist/TvPreviewView-DhXD3H__.js +114 -0
- package/dist/TvPreviewView-hGq7_Bzs.cjs +1 -0
- package/dist/TvProgramTimeBadge-BtQKNLz2.js +18 -0
- package/dist/TvProgramTimeBadge-DPJu73xG.cjs +1 -0
- package/dist/TvProgramsView-Ba9VPnEh.cjs +1 -0
- package/dist/TvProgramsView-DO4WnPJx.js +223 -0
- package/dist/TvRadioDownloadView-ByABG_YW.js +41 -0
- package/dist/TvRadioDownloadView-CitV60kZ.cjs +1 -0
- package/dist/TvRequestProgramView-CYc5nAEt.cjs +1 -0
- package/dist/TvRequestProgramView-Dm5Bra4d.js +267 -0
- package/dist/TvRequests-Bcy68aT5.js +227 -0
- package/dist/TvRequests-l_Xv-rcr.cjs +1 -0
- package/dist/TvSearchBar-5J6420z2.cjs +1 -0
- package/dist/TvSearchBar-KZqcg7G0.js +95 -0
- package/dist/TvSearchResultsView-BTONTtMg.cjs +1 -0
- package/dist/TvSearchResultsView-CMsq8ehS.js +212 -0
- package/dist/TvTabs-CrQVKuod.js +88 -0
- package/dist/TvTabs-JuCI2Ea7.cjs +1 -0
- package/dist/TypeHelper-Dt2Y9Wc4.js +14 -0
- package/dist/TypeHelper-Z2rqPzup.cjs +1 -0
- package/dist/UseAlerts-B2BbQeN3.js +39 -0
- package/dist/UseAlerts-pIg83NsO.cjs +1 -0
- package/dist/UseFetchAll-BaDVJFdj.cjs +1 -0
- package/dist/UseFetchAll-DYGA8s5a.js +147 -0
- package/dist/UseGetMediaQueryString-BLeJTZt2.cjs +1 -0
- package/dist/UseGetMediaQueryString-Dc_jP0rr.js +226 -0
- package/dist/UseHandleDialogError-BJHsOnKn.js +9 -0
- package/dist/UseHandleDialogError-PbyWsVaT.cjs +1 -0
- package/dist/UseHandleObjectError-CBFN1Ill.cjs +1 -0
- package/dist/UseHandleObjectError-DAhDbPEo.js +16 -0
- package/dist/UseHover-CLOLtbUV.cjs +1 -0
- package/dist/UseHover-Cc_d5rRf.js +85 -0
- package/dist/UseSelectAllPages-04737Rdu.cjs +1 -0
- package/dist/UseSelectAllPages-Cnk3MEAt.js +149 -0
- package/dist/VideoHelper-3AKe5Jyy.js +477 -0
- package/dist/VideoHelper-BQ7rWUw0.cjs +1 -0
- package/dist/VideoList-SNG1hmoL.cjs +49 -0
- package/dist/VideoList-s7lvSqSs.js +2622 -0
- package/dist/VideoRequests-CpDXl7E_.cjs +1 -0
- package/dist/VideoRequests-DlUeYLjl.js +225 -0
- package/dist/VideoSortSelect-3JfrvPfj.cjs +1 -0
- package/dist/VideoSortSelect-DS9Uvc-S.js +116 -0
- package/dist/VisibleOnSvg-BisjF586.cjs +1 -0
- package/dist/VisibleOnSvg-WDCQPPvV.js +33 -0
- package/dist/app-2U039aX_.js +67680 -0
- package/dist/app-DcIbciDa.cjs +454 -0
- package/dist/app.js +1 -0
- package/dist/en.json +1 -0
- package/dist/exchange.css +1 -0
- package/dist/getRegionInfo-B_h_jjAy.js +31 -0
- package/dist/getRegionInfo-Bs5JKG7h.cjs +1 -0
- package/dist/index-CGkY5YVS.cjs +1 -0
- package/dist/index-DUgR-v-j.js +885 -0
- package/dist/toLocalTime-Bt8Uy4Kq.js +15 -0
- package/dist/toLocalTime-DF9SIfIt.cjs +1 -0
- package/dist/useBreakpoints-37V489ap.js +66 -0
- package/dist/useBreakpoints-B-bcgx-L.cjs +1 -0
- package/dist/useGetExchangeActions-BwXrBSH-.cjs +1 -0
- package/dist/useGetExchangeActions-C8Y1FNSl.js +176 -0
- package/dist/useGetTvActions-CmEBdHbw.cjs +1 -0
- package/dist/useGetTvActions-DENrO3wZ.js +54 -0
- package/dist/useHandleRegionError-BNRrs6y8.cjs +1 -0
- package/dist/useHandleRegionError-BNxhNPKP.js +10 -0
- package/dist/usePreviewContext--ihfEi4P.js +14 -0
- package/dist/usePreviewContext-DjpFhe3I.cjs +1 -0
- package/dist/useSelectedRegion-7_2s4QQF.js +16 -0
- package/dist/useSelectedRegion-D3Xsu2Ut.cjs +1 -0
- package/dist/useVerifiedEmailRequiredErrorHandler-CSkvs-EW.cjs +1 -0
- package/dist/useVerifiedEmailRequiredErrorHandler-DFLs3cQc.js +57 -0
- package/package.json +12 -3
- package/typings/utils/imports.d.ts +1 -1
- package/vite-i18n-plugin.ts +113 -0
- package/vite.config.ts +59 -0
- package/dist/bundles.json +0 -4
- package/dist/css/137-exchange-8c1b8716b3.chunk.css +0 -25
- package/dist/css/212-exchange-d71527fc65.chunk.css +0 -1
- package/dist/css/226-exchange-9ab9f14b3c.chunk.css +0 -57
- package/dist/css/291-exchange-be9d9f0cdb.chunk.css +0 -11
- package/dist/css/298-exchange-78ece5c7c5.chunk.css +0 -37
- package/dist/css/332-exchange-e4754ae27a.chunk.css +0 -1
- package/dist/css/489-exchange-6ecb1e7adc.chunk.css +0 -85
- package/dist/css/494-exchange-02d7a0249c.chunk.css +0 -2
- package/dist/css/522-exchange-1387f35e92.chunk.css +0 -14
- package/dist/css/538-exchange-4cbfe56ba3.chunk.css +0 -1
- package/dist/css/589-exchange-fa098d9131.chunk.css +0 -11
- package/dist/css/611-exchange-cbf2bb5621.chunk.css +0 -5
- package/dist/css/669-exchange-e80e6c6649.chunk.css +0 -10
- package/dist/css/68-exchange-b5eaf8af44.chunk.css +0 -35
- package/dist/css/75-exchange-6d2304419c.chunk.css +0 -5
- package/dist/css/759-exchange-23bb5dd175.chunk.css +0 -8
- package/dist/css/858-exchange-06944bdfa4.chunk.css +0 -1
- package/dist/css/904-exchange-0eab318199.chunk.css +0 -40
- package/dist/css/95-exchange-4cbfe56ba3.chunk.css +0 -1
- package/dist/css/lite-exchange-ed6bd260c5.css +0 -14
- package/dist/languages/en.json +0 -1
- package/dist/scripts/117-e2b3dd7f3e-exchange.chunk.js +0 -1
- package/dist/scripts/127-4a3c8f9725-exchange.chunk.js +0 -1
- package/dist/scripts/136-fd99ef4c9d-exchange.chunk.js +0 -2
- package/dist/scripts/136-fd99ef4c9d-exchange.chunk.js.LICENSE.txt +0 -1
- package/dist/scripts/137-51b4dab452-exchange.chunk.js +0 -1
- package/dist/scripts/156-847dae6ace-exchange.chunk.js +0 -1
- package/dist/scripts/170-9db7c3b12e-exchange.chunk.js +0 -1
- package/dist/scripts/173-3668db114a-exchange.chunk.js +0 -1
- package/dist/scripts/212-6ed71b2797-exchange.chunk.js +0 -1
- package/dist/scripts/226-889bef8e6c-exchange.chunk.js +0 -1
- package/dist/scripts/267-7daf64f8a1-exchange.chunk.js +0 -1
- package/dist/scripts/291-7e85a6e844-exchange.chunk.js +0 -1
- package/dist/scripts/298-ed8e8b8328-exchange.chunk.js +0 -1
- package/dist/scripts/312-69afcbbc39-exchange.chunk.js +0 -1
- package/dist/scripts/325-76baea117f-exchange.chunk.js +0 -1
- package/dist/scripts/332-08d48debc2-exchange.chunk.js +0 -1
- package/dist/scripts/414-567e121c75-exchange.chunk.js +0 -2
- package/dist/scripts/414-567e121c75-exchange.chunk.js.LICENSE.txt +0 -60
- package/dist/scripts/442-fcba36183d-exchange.chunk.js +0 -1
- package/dist/scripts/455-ceeb969c54-exchange.chunk.js +0 -1
- package/dist/scripts/484-08c82c5a88-exchange.chunk.js +0 -1
- package/dist/scripts/489-be60742399-exchange.chunk.js +0 -2
- package/dist/scripts/489-be60742399-exchange.chunk.js.LICENSE.txt +0 -1
- package/dist/scripts/494-abba46b945-exchange.chunk.js +0 -2
- package/dist/scripts/494-abba46b945-exchange.chunk.js.LICENSE.txt +0 -1
- package/dist/scripts/507-b6e119c8e2-exchange.chunk.js +0 -1
- package/dist/scripts/522-ce819dee18-exchange.chunk.js +0 -2
- package/dist/scripts/522-ce819dee18-exchange.chunk.js.LICENSE.txt +0 -1
- package/dist/scripts/536-b915864d5f-exchange.chunk.js +0 -1
- package/dist/scripts/538-ccc01a623f-exchange.chunk.js +0 -2
- package/dist/scripts/538-ccc01a623f-exchange.chunk.js.LICENSE.txt +0 -1
- package/dist/scripts/558-1bdbbc1f64-exchange.chunk.js +0 -1
- package/dist/scripts/589-17d73ab116-exchange.chunk.js +0 -1
- package/dist/scripts/601-a3c22b0a9f-exchange.chunk.js +0 -1
- package/dist/scripts/611-d8bd3e98dc-exchange.chunk.js +0 -1
- package/dist/scripts/619-1abac6cb1d-exchange.chunk.js +0 -1
- package/dist/scripts/648-485af12c37-exchange.chunk.js +0 -1
- package/dist/scripts/659-d08f206e1d-exchange.chunk.js +0 -1
- package/dist/scripts/669-a49a0838ff-exchange.chunk.js +0 -1
- package/dist/scripts/68-34b81dae8c-exchange.chunk.js +0 -1
- package/dist/scripts/725-9ddf1084b6-exchange.chunk.js +0 -1
- package/dist/scripts/726-868a877381-exchange.chunk.js +0 -1
- package/dist/scripts/75-9780e4300e-exchange.chunk.js +0 -1
- package/dist/scripts/759-f1a9db4868-exchange.chunk.js +0 -1
- package/dist/scripts/782-2c340d8404-exchange.chunk.js +0 -1
- package/dist/scripts/831-8808647fc7-exchange.chunk.js +0 -1
- package/dist/scripts/851-61f77ce4aa-exchange.chunk.js +0 -2
- package/dist/scripts/851-61f77ce4aa-exchange.chunk.js.LICENSE.txt +0 -1
- package/dist/scripts/858-70085ed3b1-exchange.chunk.js +0 -1
- package/dist/scripts/866-14ce8a3a4d-exchange.chunk.js +0 -1
- package/dist/scripts/87-d569a1463e-exchange.chunk.js +0 -1
- package/dist/scripts/877-5b357aeb63-exchange.chunk.js +0 -1
- package/dist/scripts/904-bd1dfd39e0-exchange.chunk.js +0 -1
- package/dist/scripts/925-f70ee1c7f9-exchange.chunk.js +0 -1
- package/dist/scripts/937-2e1f1f330e-exchange.chunk.js +0 -1
- package/dist/scripts/95-841a847f54-exchange.chunk.js +0 -2
- package/dist/scripts/95-841a847f54-exchange.chunk.js.LICENSE.txt +0 -1
- package/dist/scripts/bundle-26830afcc1.min.js +0 -2
- package/dist/scripts/bundle-26830afcc1.min.js.LICENSE.txt +0 -108
|
@@ -0,0 +1,362 @@
|
|
|
1
|
+
"use strict";const A=require("./app-DcIbciDa.cjs"),cv=require("./VisibleOnSvg-BisjF586.cjs"),VC=require("./index-CGkY5YVS.cjs"),yc=require("./LinkifyHelper-EOfbsqdi.cjs"),GI=require("./ClassNameHelper-n4BHW-GR.cjs"),hv=require("./CloseSvg-B7rizkGp.cjs"),KI=require("./SearchSvg-BU6G1Fs0.cjs"),XI=require("./ChevronDownSvg-BI6xUNrZ.cjs"),_c=require("./TagItem-BBc3HmnI.cjs"),dv=require("./UseHover-CLOLtbUV.cjs"),xr=require("./Badge-3MW5GacP.cjs"),QI=require("./UseAlerts-pIg83NsO.cjs"),YI=require("./DownloadHelper-ChKHN-Le.cjs"),kl=require("./MasterTypeHelper-Y_SDsEUF.cjs"),zC=require("./useBreakpoints-B-bcgx-L.cjs"),JI=require("./Actions-BtMRNMuv.cjs"),ZI=require("./BadgeListContainer-DLrBuDpU.cjs"),fy=require("./TypeHelper-Z2rqPzup.cjs"),eP=require("./ExchangeUtils-BRDE3b9w.cjs"),tP=require("./TvAdFreeBadge-X2iSf6B3.cjs"),iP=require("./TvChannelBadge-B4a1wkQI.cjs"),rP=require("./TvProgramTimeBadge-DPJu73xG.cjs");var $d,py;function vo(){if(py)return $d;py=1;var s;return typeof window<"u"?s=window:typeof A.commonjsGlobal<"u"?s=A.commonjsGlobal:typeof self<"u"?s=self:s={},$d=s,$d}var nP=vo();const R=A.getDefaultExportFromCjs(nP),sP={},aP=Object.freeze(Object.defineProperty({__proto__:null,default:sP},Symbol.toStringTag,{value:"Module"})),oP=A.getAugmentedNamespace(aP);var qd,my;function WC(){if(my)return qd;my=1;var s=typeof A.commonjsGlobal<"u"?A.commonjsGlobal:typeof window<"u"?window:{},e=oP,t;return typeof document<"u"?t=document:(t=s["__GLOBAL_DOCUMENT_CACHE@4"],t||(t=s["__GLOBAL_DOCUMENT_CACHE@4"]=e)),qd=t,qd}var lP=WC();const ce=A.getDefaultExportFromCjs(lP);var Lu={exports:{}},Hd,gy;function GC(){if(gy)return Hd;gy=1,Hd=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 Hd}var Vd,vy;function uP(){if(vy)return Vd;vy=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 Vd=i,Vd}var zd,yy;function cP(){if(yy)return zd;yy=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 zd=s,zd}var Wd,_y;function hP(){if(_y)return Wd;_y=1;var s=vo(),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 Wd=e,Wd}var Ty;function dP(){if(Ty)return Lu.exports;Ty=1;var s=vo(),e=cv.require_extends(),t=GC(),i=uP(),r=cP();u.httpHandler=hP(),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(":"),I=_.slice(0,k).trim().toLowerCase(),L=_.slice(k+1).trim();typeof p[I]>"u"?p[I]=L:Array.isArray(p[I])?p[I].push(L):p[I]=[p[I],L]}),p};Lu.exports=u,Lu.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(se,le,de){_||(_=!0,g.callback(se,le,de))};function I(){O.readyState===4&&!u.responseInterceptorsStorage.getIsEnabled()&&setTimeout(F,0)}function L(){var ne=void 0;if(O.response?ne=O.response:ne=O.responseText||h(O),re)try{ne=JSON.parse(ne)}catch{}return ne}function $(ne){if(clearTimeout(he),clearTimeout(g.retryTimeout),ne instanceof Error||(ne=new Error(""+(ne||"Unknown XMLHttpRequest Error"))),ne.statusCode=0,!U&&u.retryManager.getIsEnabled()&&g.retry&&g.retry.shouldRetry()){g.retryTimeout=setTimeout(function(){g.retry.moveToNextAttempt(),g.xhr=O,c(g)},g.retry.getCurrentFuzzedDelay());return}if(g.requestType&&u.responseInterceptorsStorage.getIsEnabled()){var se={headers:fe.headers||{},body:fe.body,responseUrl:O.responseURL,responseType:O.responseType},le=u.responseInterceptorsStorage.execute(g.requestType,se);fe.body=le.body,fe.headers=le.headers}return k(ne,fe)}function F(){if(!U){var ne;clearTimeout(he),clearTimeout(g.retryTimeout),g.useXDR&&O.status===void 0?ne=200:ne=O.status===1223?204:O.status;var se=fe,le=null;if(ne!==0?(se={body:L(),statusCode:ne,method:P,headers:{},url:C,rawRequest:O},O.getAllResponseHeaders&&(se.headers=n(O.getAllResponseHeaders()))):le=new Error("Internal XMLHttpRequest Error"),g.requestType&&u.responseInterceptorsStorage.getIsEnabled()){var de={headers:se.headers||{},body:se.body,responseUrl:O.responseURL,responseType:O.responseType},ve=u.responseInterceptorsStorage.execute(g.requestType,de);se.body=ve.body,se.headers=ve.headers}return k(le,se,se.body)}}var O=g.xhr||null;O||(g.cors||g.useXDR?O=new u.XDomainRequest:O=new u.XMLHttpRequest);var B,U,C=O.url=g.uri||g.url,P=O.method=g.method||"GET",K=g.body||g.data,z=O.headers=g.headers||{},X=!!g.sync,re=!1,he,fe={body:void 0,headers:{},statusCode:0,method:P,url:C,rawRequest:O};if("json"in g&&g.json!==!1&&(re=!0,z.accept||z.Accept||(z.Accept="application/json"),P!=="GET"&&P!=="HEAD"&&(z["content-type"]||z["Content-Type"]||(z["Content-Type"]="application/json"),K=JSON.stringify(g.json===!0?K:g.json))),O.onreadystatechange=I,O.onload=F,O.onerror=$,O.onprogress=function(){},O.onabort=function(){U=!0,clearTimeout(g.retryTimeout)},O.ontimeout=$,O.open(P,C,!X,g.username,g.password),X||(O.withCredentials=!!g.withCredentials),!X&&g.timeout>0&&(he=setTimeout(function(){if(!U){U=!0,O.abort("timeout");var ne=new Error("XMLHttpRequest timeout");ne.code="ETIMEDOUT",$(ne)}},g.timeout)),O.setRequestHeader)for(B in z)z.hasOwnProperty(B)&&O.setRequestHeader(B,z[B]);else if(g.headers&&!o(g.headers))throw new Error("Headers cannot be set on an XDomainRequest object");return"responseType"in g&&(O.responseType=g.responseType),"beforeSend"in g&&typeof g.beforeSend=="function"&&g.beforeSend(O),O.send(K||null),O}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 Lu.exports}var fP=dP();const KC=A.getDefaultExportFromCjs(fP);var Gd={exports:{}},Kd,by;function pP(){if(by)return Kd;by=1;var s=WC(),e=Object.create||function(){function C(){}return function(P){if(arguments.length!==1)throw new Error("Object.create shim only accepts one parameter.");return C.prototype=P,new C}}();function t(C,P){this.name="ParsingError",this.code=C.code,this.message=P||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 P(z,X,re,he){return(z|0)*3600+(X|0)*60+(re|0)+(he|0)/1e3}var K=C.match(/^(\d+):(\d{1,2})(:\d{1,2})?\.(\d{3})/);return K?K[3]?P(K[1],K[2],K[3].replace(":",""),K[4]):K[1]>59?P(K[1],K[2],0,K[4]):P(0,K[1],K[2],K[4]):null}function r(){this.values=e(null)}r.prototype={set:function(C,P){!this.get(C)&&P!==""&&(this.values[C]=P)},get:function(C,P,K){return K?this.has(C)?this.values[C]:P[K]:this.has(C)?this.values[C]:P},has:function(C){return C in this.values},alt:function(C,P,K){for(var z=0;z<K.length;++z)if(P===K[z]){this.set(C,P);break}},integer:function(C,P){/^-?\d+$/.test(P)&&this.set(C,parseInt(P,10))},percent:function(C,P){return P.match(/^([\d]{1,3})(\.[\d]*)?%$/)&&(P=parseFloat(P),P>=0&&P<=100)?(this.set(C,P),!0):!1}};function n(C,P,K,z){var X=z?C.split(z):[C];for(var re in X)if(typeof X[re]=="string"){var he=X[re].split(K);if(he.length===2){var fe=he[0].trim(),ne=he[1].trim();P(fe,ne)}}}function a(C,P,K){var z=C;function X(){var fe=i(C);if(fe===null)throw new t(t.Errors.BadTimeStamp,"Malformed timestamp: "+z);return C=C.replace(/^[^\sa-zA-Z-]+/,""),fe}function re(fe,ne){var se=new r;n(fe,function(le,de){switch(le){case"region":for(var ve=K.length-1;ve>=0;ve--)if(K[ve].id===de){se.set(le,K[ve].region);break}break;case"vertical":se.alt(le,de,["rl","lr"]);break;case"line":var we=de.split(","),Pe=we[0];se.integer(le,Pe),se.percent(le,Pe)&&se.set("snapToLines",!1),se.alt(le,Pe,["auto"]),we.length===2&&se.alt("lineAlign",we[1],["start","center","end"]);break;case"position":we=de.split(","),se.percent(le,we[0]),we.length===2&&se.alt("positionAlign",we[1],["start","center","end"]);break;case"size":se.percent(le,de);break;case"align":se.alt(le,de,["start","center","end","left","right"]);break}},/:/,/\s/),ne.region=se.get("region",null),ne.vertical=se.get("vertical","");try{ne.line=se.get("line","auto")}catch{}ne.lineAlign=se.get("lineAlign","start"),ne.snapToLines=se.get("snapToLines",!0),ne.size=se.get("size",100);try{ne.align=se.get("align","center")}catch{ne.align=se.get("align","middle")}try{ne.position=se.get("position","auto")}catch{ne.position=se.get("position",{start:0,left:0,center:50,middle:50,end:100,right:100},ne.align)}ne.positionAlign=se.get("positionAlign",{start:"start",left:"start",center:"center",middle:"center",end:"end",right:"end"},ne.align)}function he(){C=C.replace(/^\s+/,"")}if(he(),P.startTime=X(),he(),C.substr(0,3)!=="-->")throw new t(t.Errors.BadTimeStamp,"Malformed time stamp (time stamps must be separated by '-->'): "+z);C=C.substr(3),he(),P.endTime=X(),he(),re(C,P)}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,P){function K(){if(!P)return null;function Pe(De){return P=P.substr(De.length),De}var Oe=P.match(/^([^<]*)(<[^>]*>?)?/);return Pe(Oe[1]?Oe[1]:Oe[2])}function z(Pe){return o.innerHTML=Pe,Pe=o.textContent,o.textContent="",Pe}function X(Pe,Oe){return!h[Oe.localName]||h[Oe.localName]===Pe.localName}function re(Pe,Oe){var De=l[Pe];if(!De)return null;var Xe=C.document.createElement(De),Re=c[Pe];return Re&&Oe&&(Xe[Re]=Oe.trim()),Xe}for(var he=C.document.createElement("div"),fe=he,ne,se=[];(ne=K())!==null;){if(ne[0]==="<"){if(ne[1]==="/"){se.length&&se[se.length-1]===ne.substr(2).replace(">","")&&(se.pop(),fe=fe.parentNode);continue}var le=i(ne.substr(1,ne.length-2)),de;if(le){de=C.document.createProcessingInstruction("timestamp",le),fe.appendChild(de);continue}var ve=ne.match(/^<([^.\s/0-9>]+)(\.[^\s\\>]+)?([^>\\]+)?(\\?)>?$/);if(!ve||(de=re(ve[1],ve[3]),!de)||!X(fe,de))continue;if(ve[2]){var we=ve[2].split(".");we.forEach(function(Pe){var Oe=/^bg_/.test(Pe),De=Oe?Pe.slice(3):Pe;if(u.hasOwnProperty(De)){var Xe=Oe?"background-color":"color",Re=u[De];de.style[Xe]=Re}}),de.className=we.join(" ")}se.push(ve[1]),fe.appendChild(de),fe=de;continue}fe.appendChild(C.document.createTextNode(z(ne)))}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 P=0;P<g.length;P++){var K=g[P];if(C>=K[0]&&C<=K[1])return!0}return!1}function p(C){var P=[],K="",z;if(!C||!C.childNodes)return"ltr";function X(fe,ne){for(var se=ne.childNodes.length-1;se>=0;se--)fe.push(ne.childNodes[se])}function re(fe){if(!fe||!fe.length)return null;var ne=fe.pop(),se=ne.textContent||ne.innerText;if(se){var le=se.match(/^.*(\n|\r)/);return le?(fe.length=0,le[0]):se}if(ne.tagName==="ruby")return re(fe);if(ne.childNodes)return X(fe,ne),re(fe)}for(X(P,C);K=re(P);)for(var he=0;he<K.length;he++)if(z=K.charCodeAt(he),y(z))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 P=C.track,K=P.textTrackList,z=0,X=0;X<K.length&&K[X]!==P;X++)K[X].mode==="showing"&&z++;return++z*-1}function k(){}k.prototype.applyStyles=function(C,P){P=P||this.div;for(var K in C)C.hasOwnProperty(K)&&(P.style[K]=C[K])},k.prototype.formatStyle=function(C,P){return C===0?0:C+P};function I(C,P,K){k.call(this),this.cue=P,this.cueDiv=d(C,P.text);var z={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:P.vertical===""?"horizontal-tb":P.vertical==="lr"?"vertical-lr":"vertical-rl",unicodeBidi:"plaintext"};this.applyStyles(z,this.cueDiv),this.div=C.document.createElement("div"),z={direction:p(this.cueDiv),writingMode:P.vertical===""?"horizontal-tb":P.vertical==="lr"?"vertical-lr":"vertical-rl",unicodeBidi:"plaintext",textAlign:P.align==="middle"?"center":P.align,font:K.font,whiteSpace:"pre-line",position:"absolute"},this.applyStyles(z),this.div.appendChild(this.cueDiv);var X=0;switch(P.positionAlign){case"start":case"line-left":X=P.position;break;case"center":X=P.position-P.size/2;break;case"end":case"line-right":X=P.position-P.size;break}P.vertical===""?this.applyStyles({left:this.formatStyle(X,"%"),width:this.formatStyle(P.size,"%")}):this.applyStyles({top:this.formatStyle(X,"%"),height:this.formatStyle(P.size,"%")}),this.move=function(re){this.applyStyles({top:this.formatStyle(re.top,"px"),bottom:this.formatStyle(re.bottom,"px"),left:this.formatStyle(re.left,"px"),right:this.formatStyle(re.right,"px"),height:this.formatStyle(re.height,"px"),width:this.formatStyle(re.width,"px")})}}I.prototype=e(k.prototype),I.prototype.constructor=I;function L(C){var P,K,z,X;if(C.div){K=C.div.offsetHeight,z=C.div.offsetWidth,X=C.div.offsetTop;var re=(re=C.div.childNodes)&&(re=re[0])&&re.getClientRects&&re.getClientRects();C=C.div.getBoundingClientRect(),P=re?Math.max(re[0]&&re[0].height||0,C.height/re.length):0}this.left=C.left,this.right=C.right,this.top=C.top||X,this.height=C.height||K,this.bottom=C.bottom||X+(C.height||K),this.width=C.width||z,this.lineHeight=P!==void 0?P:C.lineHeight}L.prototype.move=function(C,P){switch(P=P!==void 0?P:this.lineHeight,C){case"+x":this.left+=P,this.right+=P;break;case"-x":this.left-=P,this.right-=P;break;case"+y":this.top+=P,this.bottom+=P;break;case"-y":this.top-=P,this.bottom-=P;break}},L.prototype.overlaps=function(C){return this.left<C.right&&this.right>C.left&&this.top<C.bottom&&this.bottom>C.top},L.prototype.overlapsAny=function(C){for(var P=0;P<C.length;P++)if(this.overlaps(C[P]))return!0;return!1},L.prototype.within=function(C){return this.top>=C.top&&this.bottom<=C.bottom&&this.left>=C.left&&this.right<=C.right},L.prototype.overlapsOppositeAxis=function(C,P){switch(P){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}},L.prototype.intersectPercentage=function(C){var P=Math.max(0,Math.min(this.right,C.right)-Math.max(this.left,C.left)),K=Math.max(0,Math.min(this.bottom,C.bottom)-Math.max(this.top,C.top)),z=P*K;return z/(this.height*this.width)},L.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}},L.getSimpleBoxPosition=function(C){var P=C.div?C.div.offsetHeight:C.tagName?C.offsetHeight:0,K=C.div?C.div.offsetWidth:C.tagName?C.offsetWidth:0,z=C.div?C.div.offsetTop:C.tagName?C.offsetTop:0;C=C.div?C.div.getBoundingClientRect():C.tagName?C.getBoundingClientRect():C;var X={left:C.left,right:C.right,top:C.top||z,height:C.height||P,bottom:C.bottom||z+(C.height||P),width:C.width||K};return X};function $(C,P,K,z){function X(De,Xe){for(var Re,Le=new L(De),qe=1,it=0;it<Xe.length;it++){for(;De.overlapsOppositeAxis(K,Xe[it])||De.within(K)&&De.overlapsAny(z);)De.move(Xe[it]);if(De.within(K))return De;var gt=De.intersectPercentage(K);qe>gt&&(Re=new L(De),qe=gt),De=new L(Le)}return Re||Le}var re=new L(P),he=P.cue,fe=_(he),ne=[];if(he.snapToLines){var se;switch(he.vertical){case"":ne=["+y","-y"],se="height";break;case"rl":ne=["+x","-x"],se="width";break;case"lr":ne=["-x","+x"],se="width";break}var le=re.lineHeight,de=le*Math.round(fe),ve=K[se]+le,we=ne[0];Math.abs(de)>ve&&(de=de<0?-1:1,de*=Math.ceil(ve/le)*le),fe<0&&(de+=he.vertical===""?K.height:K.width,ne=ne.reverse()),re.move(we,de)}else{var Pe=re.lineHeight/K.height*100;switch(he.lineAlign){case"center":fe-=Pe/2;break;case"end":fe-=Pe;break}switch(he.vertical){case"":P.applyStyles({top:P.formatStyle(fe,"%")});break;case"rl":P.applyStyles({left:P.formatStyle(fe,"%")});break;case"lr":P.applyStyles({right:P.formatStyle(fe,"%")});break}ne=["+y","-x","+x","-y"],re=new L(P)}var Oe=X(re,ne);P.move(Oe.toCSSCompatValues(K))}function F(){}F.StringDecoder=function(){return{decode:function(C){if(!C)return"";if(typeof C!="string")throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(C))}}},F.convertCueToDOMTree=function(C,P){return!C||!P?null:d(C,P)};var O=.05,B="sans-serif",U="1.5%";return F.processCues=function(C,P,K){if(!C||!P||!K)return null;for(;K.firstChild;)K.removeChild(K.firstChild);var z=C.document.createElement("div");z.style.position="absolute",z.style.left="0",z.style.right="0",z.style.top="0",z.style.bottom="0",z.style.margin=U,K.appendChild(z);function X(le){for(var de=0;de<le.length;de++)if(le[de].hasBeenReset||!le[de].displayState)return!0;return!1}if(!X(P)){for(var re=0;re<P.length;re++)z.appendChild(P[re].displayState);return}var he=[],fe=L.getSimpleBoxPosition(z),ne=Math.round(fe.height*O*100)/100,se={font:ne+"px "+B};(function(){for(var le,de,ve=0;ve<P.length;ve++)de=P[ve],le=new I(C,de,se),z.appendChild(le.div),$(C,le,fe,he),de.displayState=le.div,he.push(L.getSimpleBoxPosition(le))})()},F.Parser=function(C,P,K){K||(K=P,P={}),P||(P={}),this.window=C,this.vttjs=P,this.state="INITIAL",this.buffer="",this.decoder=K||new TextDecoder("utf8"),this.regionList=[]},F.Parser.prototype={reportOrThrowError:function(C){if(C instanceof t)this.onparsingerror&&this.onparsingerror(C);else throw C},parse:function(C){var P=this;C&&(P.buffer+=P.decoder.decode(C,{stream:!0}));function K(){for(var le=P.buffer,de=0;de<le.length&&le[de]!=="\r"&&le[de]!==`
|
|
10
|
+
`;)++de;var ve=le.substr(0,de);return le[de]==="\r"&&++de,le[de]===`
|
|
11
|
+
`&&++de,P.buffer=le.substr(de),ve}function z(le){var de=new r;if(n(le,function(we,Pe){switch(we){case"id":de.set(we,Pe);break;case"width":de.percent(we,Pe);break;case"lines":de.integer(we,Pe);break;case"regionanchor":case"viewportanchor":var Oe=Pe.split(",");if(Oe.length!==2)break;var De=new r;if(De.percent("x",Oe[0]),De.percent("y",Oe[1]),!De.has("x")||!De.has("y"))break;de.set(we+"X",De.get("x")),de.set(we+"Y",De.get("y"));break;case"scroll":de.alt(we,Pe,["up"]);break}},/=/,/\s/),de.has("id")){var ve=new(P.vttjs.VTTRegion||P.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",""),P.onregion&&P.onregion(ve),P.regionList.push({id:de.get("id"),region:ve})}}function X(le){var de=new r;n(le,function(ve,we){switch(ve){case"MPEGT":de.integer(ve+"S",we);break;case"LOCA":de.set(ve+"L",i(we));break}},/[^\d]:/,/,/),P.ontimestampmap&&P.ontimestampmap({MPEGTS:de.get("MPEGTS"),LOCAL:de.get("LOCAL")})}function re(le){le.match(/X-TIMESTAMP-MAP/)?n(le,function(de,ve){switch(de){case"X-TIMESTAMP-MAP":X(ve);break}},/=/):n(le,function(de,ve){switch(de){case"Region":z(ve);break}},/:/)}try{var he;if(P.state==="INITIAL"){if(!/\r\n|\n/.test(P.buffer))return this;he=K();var fe=he.match(/^WEBVTT([ \t].*)?$/);if(!fe||!fe[0])throw new t(t.Errors.BadSignature);P.state="HEADER"}for(var ne=!1;P.buffer;){if(!/\r\n|\n/.test(P.buffer))return this;switch(ne?ne=!1:he=K(),P.state){case"HEADER":/:/.test(he)?re(he):he||(P.state="ID");continue;case"NOTE":he||(P.state="ID");continue;case"ID":if(/^NOTE($|[ \t])/.test(he)){P.state="NOTE";break}if(!he)continue;P.cue=new(P.vttjs.VTTCue||P.window.VTTCue)(0,0,"");try{P.cue.align="center"}catch{P.cue.align="middle"}if(P.state="CUE",he.indexOf("-->")===-1){P.cue.id=he;continue}case"CUE":try{a(he,P.cue,P.regionList)}catch(le){P.reportOrThrowError(le),P.cue=null,P.state="BADCUE";continue}P.state="CUETEXT";continue;case"CUETEXT":var se=he.indexOf("-->")!==-1;if(!he||se&&(ne=!0)){P.oncue&&P.oncue(P.cue),P.cue=null,P.state="ID";continue}P.cue.text&&(P.cue.text+=`
|
|
12
|
+
`),P.cue.text+=he.replace(/\u2028/g,`
|
|
13
|
+
`).replace(/u2029/g,`
|
|
14
|
+
`);continue;case"BADCUE":he||(P.state="ID");continue}}}catch(le){P.reportOrThrowError(le),P.state==="CUETEXT"&&P.cue&&P.oncue&&P.oncue(P.cue),P.cue=null,P.state=P.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(P){C.reportOrThrowError(P)}return C.onflush&&C.onflush(),this}},Kd=F,Kd}var Xd,Sy;function mP(){if(Sy)return Xd;Sy=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",I="start",L="auto",$="auto",F=100,O="center";Object.defineProperties(this,{id:{enumerable:!0,get:function(){return u},set:function(B){u=""+B}},pauseOnExit:{enumerable:!0,get:function(){return c},set:function(B){c=!!B}},startTime:{enumerable:!0,get:function(){return h},set:function(B){if(typeof B!="number")throw new TypeError("Start time must be set to a number.");h=B,this.hasBeenReset=!0}},endTime:{enumerable:!0,get:function(){return d},set:function(B){if(typeof B!="number")throw new TypeError("End time must be set to a number.");d=B,this.hasBeenReset=!0}},text:{enumerable:!0,get:function(){return g},set:function(B){g=""+B,this.hasBeenReset=!0}},region:{enumerable:!0,get:function(){return y},set:function(B){y=B,this.hasBeenReset=!0}},vertical:{enumerable:!0,get:function(){return p},set:function(B){var U=i(B);if(U===!1)throw new SyntaxError("Vertical: an invalid or illegal direction string was specified.");p=U,this.hasBeenReset=!0}},snapToLines:{enumerable:!0,get:function(){return _},set:function(B){_=!!B,this.hasBeenReset=!0}},line:{enumerable:!0,get:function(){return k},set:function(B){if(typeof B!="number"&&B!==s)throw new SyntaxError("Line: an invalid number or illegal string was specified.");k=B,this.hasBeenReset=!0}},lineAlign:{enumerable:!0,get:function(){return I},set:function(B){var U=r(B);U?(I=U,this.hasBeenReset=!0):console.warn("lineAlign: an invalid or illegal string was specified.")}},position:{enumerable:!0,get:function(){return L},set:function(B){if(B<0||B>100)throw new Error("Position must be between 0 and 100.");L=B,this.hasBeenReset=!0}},positionAlign:{enumerable:!0,get:function(){return $},set:function(B){var U=r(B);U?($=U,this.hasBeenReset=!0):console.warn("positionAlign: an invalid or illegal string was specified.")}},size:{enumerable:!0,get:function(){return F},set:function(B){if(B<0||B>100)throw new Error("Size must be between 0 and 100.");F=B,this.hasBeenReset=!0}},align:{enumerable:!0,get:function(){return O},set:function(B){var U=r(B);if(!U)throw new SyntaxError("align: an invalid or illegal alignment string was specified.");O=U,this.hasBeenReset=!0}}}),this.displayState=void 0}return n.prototype.getCueAsHTML=function(){return WebVTT.convertCueToDOMTree(window,this.text)},Xd=n,Xd}var Qd,xy;function gP(){if(xy)return Qd;xy=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 Qd=i,Qd}var Cy;function vP(){if(Cy)return Gd.exports;Cy=1;var s=vo(),e=Gd.exports={WebVTT:pP(),VTTCue:mP(),VTTRegion:gP()};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(),Gd.exports}var yP=vP();const Qa=A.getDefaultExportFromCjs(yP);var Ey="https://example.com",gh=function(e,t){if(/^[a-z]+:/i.test(t))return t;/^data:/.test(e)&&(e=R.location&&R.location.href||"");var i=/^\/\//.test(e),r=!R.location&&!/\/\//i.test(e);e=new R.URL(e,R.location||Ey);var n=new URL(t,e);return r?n.href.slice(Ey.length):i?n.href.slice(n.protocol.length):n.href},fv=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}(),_P=function(e){return R.atob?R.atob(e):Buffer.from(e,"base64").toString("binary")};function XC(s){for(var e=_P(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 TP=class extends fv{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 bP=" ",Yd=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},SP=function(){const t="(?:"+"[^=]*"+")=(?:"+'"[^"]*"|[^,]*'+")";return new RegExp("(?:^|,)("+t+")")},vi=function(s){const e={};if(!s)return e;const t=s.split(SP());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},wy=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 xP=class extends fv{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=A._extends(Yd(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=vi(t[1]);a.URI&&(i.uri=a.URI),a.BYTERANGE&&(i.byterange=Yd(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=vi(t[1]),i.attributes.RESOLUTION&&(i.attributes.RESOLUTION=wy(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=vi(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=vi(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=vi(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=vi(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(bP)),this.trigger("data",i);return}if(t=/^#EXT-X-PART:(.*)$/.exec(n),t&&t[1]){i={type:"tag",tagType:"part"},i.attributes=vi(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=Yd(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=vi(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=vi(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=vi(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=vi(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=vi(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=vi(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=vi(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=wy(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=vi(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 CP=s=>s.toLowerCase().replace(/-(\w)/g,e=>e[1].toUpperCase()),Vn=function(s){const e={};return Object.keys(s).forEach(function(t){e[CP(t)]=s[t]}),e},Jd=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 EP=class extends fv{constructor(e={}){super(),this.lineStream=new TP,this.parseStream=new xP,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 I in t.manifest.definitions)if(p.uri&&(p.uri=p.uri.replace(`{$${I}}`,t.manifest.definitions[I])),p.attributes)for(const L in p.attributes)typeof p.attributes[L]=="string"&&(p.attributes[L]=p.attributes[L].replace(`{$${I}}`,t.manifest.definitions[I]))}({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 I={};"length"in p&&(r.byterange=I,I.length=p.length,"offset"in p||(p.offset=d)),"offset"in p&&(r.byterange=I,I.offset=p.offset),d=I.offset+I.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:XC(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={}),A._extends(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 I=this.manifest.mediaGroups[p.attributes.TYPE];I[p.attributes["GROUP-ID"]]=I[p.attributes["GROUP-ID"]]||{},_=I[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:I}=this;this.lastProgramDateTime=new Date(p.dateTimeString).getTime(),I===null&&this.manifest.segments.reduceRight((L,$)=>($.programDateTime=L-$.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,Jd.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=Vn(p.attributes),this.warnOnMissingAttributes_("#EXT-X-SKIP",p.attributes,["SKIPPED-SEGMENTS"])},part(){o=!0;const I=this.manifest.segments.length,L=Vn(p.attributes);r.parts=r.parts||[],r.parts.push(L),L.byterange&&(L.byterange.hasOwnProperty("offset")||(L.byterange.offset=g),g=L.byterange.offset+L.byterange.length);const $=r.parts.length-1;this.warnOnMissingAttributes_(`#EXT-X-PART #${$} for segment #${I}`,p.attributes,["URI","DURATION"]),this.manifest.renditionReports&&this.manifest.renditionReports.forEach((F,O)=>{F.hasOwnProperty("lastPart")||this.trigger("warn",{message:`#EXT-X-RENDITION-REPORT #${O} lacks required attribute(s): LAST-PART`})})},"server-control"(){const I=this.manifest.serverControl=Vn(p.attributes);I.hasOwnProperty("canBlockReload")||(I.canBlockReload=!1,this.trigger("info",{message:"#EXT-X-SERVER-CONTROL defaulting CAN-BLOCK-RELOAD to false"})),Jd.call(this,this.manifest),I.canSkipDateranges&&!I.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 I=this.manifest.segments.length,L=Vn(p.attributes),$=L.type&&L.type==="PART";r.preloadHints=r.preloadHints||[],r.preloadHints.push(L),L.byterange&&(L.byterange.hasOwnProperty("offset")||(L.byterange.offset=$?g:0,$&&(g=L.byterange.offset+L.byterange.length)));const F=r.preloadHints.length-1;if(this.warnOnMissingAttributes_(`#EXT-X-PRELOAD-HINT #${F} for segment #${I}`,p.attributes,["TYPE","URI"]),!!L.type)for(let O=0;O<r.preloadHints.length-1;O++){const B=r.preloadHints[O];B.type&&B.type===L.type&&this.trigger("warn",{message:`#EXT-X-PRELOAD-HINT #${F} for segment #${I} has the same TYPE ${L.type} as preload hint #${O}`})}},"rendition-report"(){const I=Vn(p.attributes);this.manifest.renditionReports=this.manifest.renditionReports||[],this.manifest.renditionReports.push(I);const L=this.manifest.renditionReports.length-1,$=["LAST-MSN","URI"];o&&$.push("LAST-PART"),this.warnOnMissingAttributes_(`#EXT-X-RENDITION-REPORT #${L}`,p.attributes,$)},"part-inf"(){this.manifest.partInf=Vn(p.attributes),this.warnOnMissingAttributes_("#EXT-X-PART-INF",p.attributes,["PART-TARGET"]),this.manifest.partInf.partTarget&&(this.manifest.partTargetDuration=this.manifest.partInf.partTarget),Jd.call(this,this.manifest)},daterange(){this.manifest.dateRanges.push(Vn(p.attributes));const I=this.manifest.dateRanges.length-1;this.warnOnMissingAttributes_(`#EXT-X-DATERANGE #${I}`,p.attributes,["ID","START-DATE"]);const L=this.manifest.dateRanges[I];L.endDate&&L.startDate&&new Date(L.endDate)<new Date(L.startDate)&&this.trigger("warn",{message:"EXT-X-DATERANGE END-DATE must be equal to or later than the value of the START-DATE"}),L.duration&&L.duration<0&&this.trigger("warn",{message:"EXT-X-DATERANGE DURATION must not be negative"}),L.plannedDuration&&L.plannedDuration<0&&this.trigger("warn",{message:"EXT-X-DATERANGE PLANNED-DURATION must not be negative"});const $=!!L.endOnNext;if($&&!L.class&&this.trigger("warn",{message:"EXT-X-DATERANGE with an END-ON-NEXT=YES attribute must have a CLASS attribute"}),$&&(L.duration||L.endDate)&&this.trigger("warn",{message:"EXT-X-DATERANGE with an END-ON-NEXT=YES attribute must not contain DURATION or END-DATE attributes"}),L.duration&&L.endDate){const O=L.startDate.getTime()+L.duration*1e3;this.manifest.dateRanges[I].endDate=new Date(O)}if(!y[L.id])y[L.id]=L;else{for(const O in y[L.id])if(L[O]&&JSON.stringify(y[L.id][O])!==JSON.stringify(L[O])){this.trigger("warn",{message:"EXT-X-DATERANGE tags with the same ID in a playlist must have the same attributes values"});break}const F=this.manifest.dateRanges.findIndex(O=>O.id===L.id);this.manifest.dateRanges[F]=A._extends(this.manifest.dateRanges[F],L),y[L.id]=A._extends(y[L.id],L),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=Vn(p.attributes),this.warnOnMissingAttributes_("#EXT-X-CONTENT-STEERING",p.attributes,["SERVER-URI"])},define(){this.manifest.definitions=this.manifest.definitions||{};const I=(L,$)=>{if(L in this.manifest.definitions){this.trigger("error",{message:`EXT-X-DEFINE: Duplicate name ${L}`});return}this.manifest.definitions[L]=$};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 L=this.params.get(p.attributes.QUERYPARAM);if(!L){this.trigger("error",{message:`EXT-X-DEFINE: No query param ${p.attributes.QUERYPARAM}`});return}I(p.attributes.QUERYPARAM,decodeURIComponent(L));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}I(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}I(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 Bs={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^/},wP=["video","audio","text"],ky=["Video","Audio","Text"],QC=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})},Mr=function(e){e===void 0&&(e="");var t=e.split(","),i=[];return t.forEach(function(r){r=r.trim();var n;wP.forEach(function(a){var o=Bs[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},kP=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 Mr(n.playlists[0].attributes.CODECS)}return null},YC=function(e){return e===void 0&&(e=""),Bs.audio.test(e.trim().toLowerCase())},AP=function(e){return e===void 0&&(e=""),Bs.text.test(e.trim().toLowerCase())},Ya=function(e){if(!(!e||typeof e!="string")){var t=e.toLowerCase().split(",").map(function(n){return QC(n.trim())}),i="video";t.length===1&&YC(t[0])?i="audio":t.length===1&&AP(t[0])&&(i="application");var r="mp4";return t.every(function(n){return Bs.mp4.test(n)})?r="mp4":t.every(function(n){return Bs.webm.test(n)})?r="webm":t.every(function(n){return Bs.ogg.test(n)})&&(r="ogg"),i+"/"+r+';codecs="'+e+'"'}},yl=function(e,t){return e===void 0&&(e=""),t===void 0&&(t=!1),R.MediaSource&&R.MediaSource.isTypeSupported&&R.MediaSource.isTypeSupported(Ya(e))||t&&R.ManagedMediaSource&&R.ManagedMediaSource.isTypeSupported&&R.ManagedMediaSource.isTypeSupported(Ya(e))||!1},Zd=function(e){return e===void 0&&(e=""),e.toLowerCase().split(",").every(function(t){t=t.trim();for(var i=0;i<ky.length;i++){var r=ky[i];if(Bs["muxer"+r].test(t))return!0}return!1})},Ay="mp4a.40.2",IP="avc1.4d400d",PP=/^(audio|video|application)\/(x-|vnd\.apple\.)?mpegurl/i,DP=/^application\/dash\+xml/i,JC=function(e){return PP.test(e)?"hls":DP.test(e)?"dash":e==="application/vnd.videojs.vhs+json"?"vhs-json":null},NP=function(e){return e.toString(2).length},LP=function(e){return Math.ceil(NP(e)/8)},ZC=function(e){return ArrayBuffer.isView==="function"?ArrayBuffer.isView(e):e&&e.buffer instanceof ArrayBuffer},OP=function(e){return ZC(e)},Ue=function(e){return e instanceof Uint8Array?e:(!Array.isArray(e)&&!OP(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))},si=R.BigInt||Number,ig=[si("0x1"),si("0x100"),si("0x10000"),si("0x1000000"),si("0x100000000"),si("0x10000000000"),si("0x1000000000000"),si("0x100000000000000"),si("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 RP=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=Ue(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+si(g)*ig[p]},si(0));if(n){var h=ig[e.length]/si(2)-si(1);c=si(c),c>h&&(c-=h,c-=h,c-=si(2))}return Number(c)},MP=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=si(e);for(var a=LP(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/ig[l]&si(255)),e<0&&(o[u]=Math.abs(~o[u]),o[u]-=l===0?1:2)}return o},e1=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},FP=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 Ue(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=Ue(o),n.set(o,a),a+=o.byteLength}),n},Et=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=Ue(e),t=Ue(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})},BP=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)}})},Zo={},pn={},Cs={},Iy;function vh(){if(Iy)return Cs;Iy=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 Cs.assign=t,Cs.find=s,Cs.freeze=e,Cs.MIME_TYPE=i,Cs.NAMESPACE=r,Cs}var Py;function t1(){if(Py)return pn;Py=1;var s=vh(),e=s.find,t=s.NAMESPACE;function i(H){return H!==""}function r(H){return H?H.split(/[\t\n\f\r ]+/).filter(i):[]}function n(H,V){return H.hasOwnProperty(V)||(H[V]=!0),H}function a(H){if(!H)return[];var V=r(H);return Object.keys(V.reduce(n,{}))}function o(H){return function(V){return H&&H.indexOf(V)!==-1}}function l(H,V){for(var te in H)Object.prototype.hasOwnProperty.call(H,te)&&(V[te]=H[te])}function u(H,V){var te=H.prototype;if(!(te instanceof V)){let pe=function(){};pe.prototype=V.prototype,pe=new pe,l(te,pe),H.prototype=te=pe}te.constructor!=H&&(typeof H!="function"&&console.error("unknown Class:"+H),te.constructor=H)}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,I=c.COMMENT_NODE=8,L=c.DOCUMENT_NODE=9,$=c.DOCUMENT_TYPE_NODE=10,F=c.DOCUMENT_FRAGMENT_NODE=11,O=c.NOTATION_NODE=12,B={},U={};B.INDEX_SIZE_ERR=(U[1]="Index size error",1),B.DOMSTRING_SIZE_ERR=(U[2]="DOMString size error",2);var C=B.HIERARCHY_REQUEST_ERR=(U[3]="Hierarchy request error",3);B.WRONG_DOCUMENT_ERR=(U[4]="Wrong document",4),B.INVALID_CHARACTER_ERR=(U[5]="Invalid character",5),B.NO_DATA_ALLOWED_ERR=(U[6]="No data allowed",6),B.NO_MODIFICATION_ALLOWED_ERR=(U[7]="No modification allowed",7);var P=B.NOT_FOUND_ERR=(U[8]="Not found",8);B.NOT_SUPPORTED_ERR=(U[9]="Not supported",9);var K=B.INUSE_ATTRIBUTE_ERR=(U[10]="Attribute in use",10);B.INVALID_STATE_ERR=(U[11]="Invalid state",11),B.SYNTAX_ERR=(U[12]="Syntax error",12),B.INVALID_MODIFICATION_ERR=(U[13]="Invalid modification",13),B.NAMESPACE_ERR=(U[14]="Invalid namespace",14),B.INVALID_ACCESS_ERR=(U[15]="Invalid access",15);function z(H,V){if(V instanceof Error)var te=V;else te=this,Error.call(this,U[H]),this.message=U[H],Error.captureStackTrace&&Error.captureStackTrace(this,z);return te.code=H,V&&(this.message=this.message+": "+V),te}z.prototype=Error.prototype,l(B,z);function X(){}X.prototype={length:0,item:function(H){return H>=0&&H<this.length?this[H]:null},toString:function(H,V){for(var te=[],pe=0;pe<this.length;pe++)ji(this[pe],te,H,V);return te.join("")},filter:function(H){return Array.prototype.filter.call(this,H)},indexOf:function(H){return Array.prototype.indexOf.call(this,H)}};function re(H,V){this._node=H,this._refresh=V,he(this)}function he(H){var V=H._node._inc||H._node.ownerDocument._inc;if(H._inc!==V){var te=H._refresh(H._node);if(ia(H,"length",te.length),!H.$$length||te.length<H.$$length)for(var pe=te.length;pe in H;pe++)Object.prototype.hasOwnProperty.call(H,pe)&&delete H[pe];l(te,H),H._inc=V}}re.prototype.item=function(H){return he(this),this[H]||null},u(re,X);function fe(){}function ne(H,V){for(var te=H.length;te--;)if(H[te]===V)return te}function se(H,V,te,pe){if(pe?V[ne(V,pe)]=te:V[V.length++]=te,H){te.ownerElement=H;var Ee=H.ownerDocument;Ee&&(pe&&Xe(Ee,H,pe),De(Ee,H,te))}}function le(H,V,te){var pe=ne(V,te);if(pe>=0){for(var Ee=V.length-1;pe<Ee;)V[pe]=V[++pe];if(V.length=Ee,H){var $e=H.ownerDocument;$e&&(Xe($e,H,te),te.ownerElement=null)}}else throw new z(P,new Error(H.tagName+"@"+te))}fe.prototype={length:0,item:X.prototype.item,getNamedItem:function(H){for(var V=this.length;V--;){var te=this[V];if(te.nodeName==H)return te}},setNamedItem:function(H){var V=H.ownerElement;if(V&&V!=this._ownerElement)throw new z(K);var te=this.getNamedItem(H.nodeName);return se(this._ownerElement,this,H,te),te},setNamedItemNS:function(H){var V=H.ownerElement,te;if(V&&V!=this._ownerElement)throw new z(K);return te=this.getNamedItemNS(H.namespaceURI,H.localName),se(this._ownerElement,this,H,te),te},removeNamedItem:function(H){var V=this.getNamedItem(H);return le(this._ownerElement,this,V),V},removeNamedItemNS:function(H,V){var te=this.getNamedItemNS(H,V);return le(this._ownerElement,this,te),te},getNamedItemNS:function(H,V){for(var te=this.length;te--;){var pe=this[te];if(pe.localName==V&&pe.namespaceURI==H)return pe}return null}};function de(){}de.prototype={hasFeature:function(H,V){return!0},createDocument:function(H,V,te){var pe=new Oe;if(pe.implementation=this,pe.childNodes=new X,pe.doctype=te||null,te&&pe.appendChild(te),V){var Ee=pe.createElementNS(H,V);pe.appendChild(Ee)}return pe},createDocumentType:function(H,V,te){var pe=new Ui;return pe.name=H,pe.nodeName=H,pe.publicId=V||"",pe.systemId=te||"",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(H,V){return Me(this,H,V)},replaceChild:function(H,V){Me(this,H,V,Fe),V&&this.removeChild(V)},removeChild:function(H){return Le(this,H)},appendChild:function(H){return this.insertBefore(H,null)},hasChildNodes:function(){return this.firstChild!=null},cloneNode:function(H){return as(this.ownerDocument||this,this,H)},normalize:function(){for(var H=this.firstChild;H;){var V=H.nextSibling;V&&V.nodeType==g&&H.nodeType==g?(this.removeChild(V),H.appendData(V.data)):(H.normalize(),H=V)}},isSupported:function(H,V){return this.ownerDocument.implementation.hasFeature(H,V)},hasAttributes:function(){return this.attributes.length>0},lookupPrefix:function(H){for(var V=this;V;){var te=V._nsMap;if(te){for(var pe in te)if(Object.prototype.hasOwnProperty.call(te,pe)&&te[pe]===H)return pe}V=V.nodeType==d?V.ownerDocument:V.parentNode}return null},lookupNamespaceURI:function(H){for(var V=this;V;){var te=V._nsMap;if(te&&Object.prototype.hasOwnProperty.call(te,H))return te[H];V=V.nodeType==d?V.ownerDocument:V.parentNode}return null},isDefaultNamespace:function(H){var V=this.lookupPrefix(H);return V==null}};function we(H){return H=="<"&&"<"||H==">"&&">"||H=="&"&&"&"||H=='"'&&"""||"&#"+H.charCodeAt()+";"}l(c,ve),l(c,ve.prototype);function Pe(H,V){if(V(H))return!0;if(H=H.firstChild)do if(Pe(H,V))return!0;while(H=H.nextSibling)}function Oe(){this.ownerDocument=this}function De(H,V,te){H&&H._inc++;var pe=te.namespaceURI;pe===t.XMLNS&&(V._nsMap[te.prefix?te.localName:""]=te.value)}function Xe(H,V,te,pe){H&&H._inc++;var Ee=te.namespaceURI;Ee===t.XMLNS&&delete V._nsMap[te.prefix?te.localName:""]}function Re(H,V,te){if(H&&H._inc){H._inc++;var pe=V.childNodes;if(te)pe[pe.length++]=te;else{for(var Ee=V.firstChild,$e=0;Ee;)pe[$e++]=Ee,Ee=Ee.nextSibling;pe.length=$e,delete pe[pe.length]}}}function Le(H,V){var te=V.previousSibling,pe=V.nextSibling;return te?te.nextSibling=pe:H.firstChild=pe,pe?pe.previousSibling=te:H.lastChild=te,V.parentNode=null,V.previousSibling=null,V.nextSibling=null,Re(H.ownerDocument,H),V}function qe(H){return H&&(H.nodeType===ve.DOCUMENT_NODE||H.nodeType===ve.DOCUMENT_FRAGMENT_NODE||H.nodeType===ve.ELEMENT_NODE)}function it(H){return H&&(At(H)||Ai(H)||gt(H)||H.nodeType===ve.DOCUMENT_FRAGMENT_NODE||H.nodeType===ve.COMMENT_NODE||H.nodeType===ve.PROCESSING_INSTRUCTION_NODE)}function gt(H){return H&&H.nodeType===ve.DOCUMENT_TYPE_NODE}function At(H){return H&&H.nodeType===ve.ELEMENT_NODE}function Ai(H){return H&&H.nodeType===ve.TEXT_NODE}function Lt(H,V){var te=H.childNodes||[];if(e(te,At)||gt(V))return!1;var pe=e(te,gt);return!(V&&pe&&te.indexOf(pe)>te.indexOf(V))}function Fi(H,V){var te=H.childNodes||[];function pe($e){return At($e)&&$e!==V}if(e(te,pe))return!1;var Ee=e(te,gt);return!(V&&Ee&&te.indexOf(Ee)>te.indexOf(V))}function Te(H,V,te){if(!qe(H))throw new z(C,"Unexpected parent node type "+H.nodeType);if(te&&te.parentNode!==H)throw new z(P,"child not in parent");if(!it(V)||gt(V)&&H.nodeType!==ve.DOCUMENT_NODE)throw new z(C,"Unexpected node type "+V.nodeType+" for parent node type "+H.nodeType)}function Ce(H,V,te){var pe=H.childNodes||[],Ee=V.childNodes||[];if(V.nodeType===ve.DOCUMENT_FRAGMENT_NODE){var $e=Ee.filter(At);if($e.length>1||e(Ee,Ai))throw new z(C,"More than one element or text in fragment");if($e.length===1&&!Lt(H,te))throw new z(C,"Element in fragment can not be inserted before doctype")}if(At(V)&&!Lt(H,te))throw new z(C,"Only one element can be added and only after doctype");if(gt(V)){if(e(pe,gt))throw new z(C,"Only one doctype is allowed");var ot=e(pe,At);if(te&&pe.indexOf(ot)<pe.indexOf(te))throw new z(C,"Doctype can only be inserted before an element");if(!te&&ot)throw new z(C,"Doctype can not be appended since element is present")}}function Fe(H,V,te){var pe=H.childNodes||[],Ee=V.childNodes||[];if(V.nodeType===ve.DOCUMENT_FRAGMENT_NODE){var $e=Ee.filter(At);if($e.length>1||e(Ee,Ai))throw new z(C,"More than one element or text in fragment");if($e.length===1&&!Fi(H,te))throw new z(C,"Element in fragment can not be inserted before doctype")}if(At(V)&&!Fi(H,te))throw new z(C,"Only one element can be added and only after doctype");if(gt(V)){if(e(pe,function(ii){return gt(ii)&&ii!==te}))throw new z(C,"Only one doctype is allowed");var ot=e(pe,At);if(te&&pe.indexOf(ot)<pe.indexOf(te))throw new z(C,"Doctype can only be inserted before an element")}}function Me(H,V,te,pe){Te(H,V,te),H.nodeType===ve.DOCUMENT_NODE&&(pe||Ce)(H,V,te);var Ee=V.parentNode;if(Ee&&Ee.removeChild(V),V.nodeType===F){var $e=V.firstChild;if($e==null)return V;var ot=V.lastChild}else $e=ot=V;var Gt=te?te.previousSibling:H.lastChild;$e.previousSibling=Gt,ot.nextSibling=te,Gt?Gt.nextSibling=$e:H.firstChild=$e,te==null?H.lastChild=ot:te.previousSibling=ot;do $e.parentNode=H;while($e!==ot&&($e=$e.nextSibling));return Re(H.ownerDocument||H,H),V.nodeType==F&&(V.firstChild=V.lastChild=null),V}function Ge(H,V){return V.parentNode&&V.parentNode.removeChild(V),V.parentNode=H,V.previousSibling=H.lastChild,V.nextSibling=null,V.previousSibling?V.previousSibling.nextSibling=V:H.firstChild=V,H.lastChild=V,Re(H.ownerDocument,H,V),V}Oe.prototype={nodeName:"#document",nodeType:L,doctype:null,documentElement:null,_inc:1,insertBefore:function(H,V){if(H.nodeType==F){for(var te=H.firstChild;te;){var pe=te.nextSibling;this.insertBefore(te,V),te=pe}return H}return Me(this,H,V),H.ownerDocument=this,this.documentElement===null&&H.nodeType===h&&(this.documentElement=H),H},removeChild:function(H){return this.documentElement==H&&(this.documentElement=null),Le(this,H)},replaceChild:function(H,V){Me(this,H,V,Fe),H.ownerDocument=this,V&&this.removeChild(V),At(H)&&(this.documentElement=H)},importNode:function(H,V){return ta(this,H,V)},getElementById:function(H){var V=null;return Pe(this.documentElement,function(te){if(te.nodeType==h&&te.getAttribute("id")==H)return V=te,!0}),V},getElementsByClassName:function(H){var V=a(H);return new re(this,function(te){var pe=[];return V.length>0&&Pe(te.documentElement,function(Ee){if(Ee!==te&&Ee.nodeType===h){var $e=Ee.getAttribute("class");if($e){var ot=H===$e;if(!ot){var Gt=a($e);ot=V.every(o(Gt))}ot&&pe.push(Ee)}}}),pe})},createElement:function(H){var V=new Qe;V.ownerDocument=this,V.nodeName=H,V.tagName=H,V.localName=H,V.childNodes=new X;var te=V.attributes=new fe;return te._ownerElement=V,V},createDocumentFragment:function(){var H=new Ye;return H.ownerDocument=this,H.childNodes=new X,H},createTextNode:function(H){var V=new pr;return V.ownerDocument=this,V.appendData(H),V},createComment:function(H){var V=new mr;return V.ownerDocument=this,V.appendData(H),V},createCDATASection:function(H){var V=new ir;return V.ownerDocument=this,V.appendData(H),V},createProcessingInstruction:function(H,V){var te=new rt;return te.ownerDocument=this,te.tagName=te.nodeName=te.target=H,te.nodeValue=te.data=V,te},createAttribute:function(H){var V=new vt;return V.ownerDocument=this,V.name=H,V.nodeName=H,V.localName=H,V.specified=!0,V},createEntityReference:function(H){var V=new rn;return V.ownerDocument=this,V.nodeName=H,V},createElementNS:function(H,V){var te=new Qe,pe=V.split(":"),Ee=te.attributes=new fe;return te.childNodes=new X,te.ownerDocument=this,te.nodeName=V,te.tagName=V,te.namespaceURI=H,pe.length==2?(te.prefix=pe[0],te.localName=pe[1]):te.localName=V,Ee._ownerElement=te,te},createAttributeNS:function(H,V){var te=new vt,pe=V.split(":");return te.ownerDocument=this,te.nodeName=V,te.name=V,te.namespaceURI=H,te.specified=!0,pe.length==2?(te.prefix=pe[0],te.localName=pe[1]):te.localName=V,te}},u(Oe,ve);function Qe(){this._nsMap={}}Qe.prototype={nodeType:h,hasAttribute:function(H){return this.getAttributeNode(H)!=null},getAttribute:function(H){var V=this.getAttributeNode(H);return V&&V.value||""},getAttributeNode:function(H){return this.attributes.getNamedItem(H)},setAttribute:function(H,V){var te=this.ownerDocument.createAttribute(H);te.value=te.nodeValue=""+V,this.setAttributeNode(te)},removeAttribute:function(H){var V=this.getAttributeNode(H);V&&this.removeAttributeNode(V)},appendChild:function(H){return H.nodeType===F?this.insertBefore(H,null):Ge(this,H)},setAttributeNode:function(H){return this.attributes.setNamedItem(H)},setAttributeNodeNS:function(H){return this.attributes.setNamedItemNS(H)},removeAttributeNode:function(H){return this.attributes.removeNamedItem(H.nodeName)},removeAttributeNS:function(H,V){var te=this.getAttributeNodeNS(H,V);te&&this.removeAttributeNode(te)},hasAttributeNS:function(H,V){return this.getAttributeNodeNS(H,V)!=null},getAttributeNS:function(H,V){var te=this.getAttributeNodeNS(H,V);return te&&te.value||""},setAttributeNS:function(H,V,te){var pe=this.ownerDocument.createAttributeNS(H,V);pe.value=pe.nodeValue=""+te,this.setAttributeNode(pe)},getAttributeNodeNS:function(H,V){return this.attributes.getNamedItemNS(H,V)},getElementsByTagName:function(H){return new re(this,function(V){var te=[];return Pe(V,function(pe){pe!==V&&pe.nodeType==h&&(H==="*"||pe.tagName==H)&&te.push(pe)}),te})},getElementsByTagNameNS:function(H,V){return new re(this,function(te){var pe=[];return Pe(te,function(Ee){Ee!==te&&Ee.nodeType===h&&(H==="*"||Ee.namespaceURI===H)&&(V==="*"||Ee.localName==V)&&pe.push(Ee)}),pe})}},Oe.prototype.getElementsByTagName=Qe.prototype.getElementsByTagName,Oe.prototype.getElementsByTagNameNS=Qe.prototype.getElementsByTagNameNS,u(Qe,ve);function vt(){}vt.prototype.nodeType=d,u(vt,ve);function Bi(){}Bi.prototype={data:"",substringData:function(H,V){return this.data.substring(H,H+V)},appendData:function(H){H=this.data+H,this.nodeValue=this.data=H,this.length=H.length},insertData:function(H,V){this.replaceData(H,0,V)},appendChild:function(H){throw new Error(U[C])},deleteData:function(H,V){this.replaceData(H,V,"")},replaceData:function(H,V,te){var pe=this.data.substring(0,H),Ee=this.data.substring(H+V);te=pe+te+Ee,this.nodeValue=this.data=te,this.length=te.length}},u(Bi,ve);function pr(){}pr.prototype={nodeName:"#text",nodeType:g,splitText:function(H){var V=this.data,te=V.substring(H);V=V.substring(0,H),this.data=this.nodeValue=V,this.length=V.length;var pe=this.ownerDocument.createTextNode(te);return this.parentNode&&this.parentNode.insertBefore(pe,this.nextSibling),pe}},u(pr,Bi);function mr(){}mr.prototype={nodeName:"#comment",nodeType:I},u(mr,Bi);function ir(){}ir.prototype={nodeName:"#cdata-section",nodeType:y},u(ir,Bi);function Ui(){}Ui.prototype.nodeType=$,u(Ui,ve);function tn(){}tn.prototype.nodeType=O,u(tn,ve);function In(){}In.prototype.nodeType=_,u(In,ve);function rn(){}rn.prototype.nodeType=p,u(rn,ve);function Ye(){}Ye.prototype.nodeName="#document-fragment",Ye.prototype.nodeType=F,u(Ye,ve);function rt(){}rt.prototype.nodeType=k,u(rt,ve);function Zs(){}Zs.prototype.serializeToString=function(H,V,te){return nn.call(H,V,te)},ve.prototype.toString=nn;function nn(H,V){var te=[],pe=this.nodeType==9&&this.documentElement||this,Ee=pe.prefix,$e=pe.namespaceURI;if($e&&Ee==null){var Ee=pe.lookupPrefix($e);if(Ee==null)var ot=[{namespace:$e,prefix:null}]}return ji(this,te,H,V,ot),te.join("")}function ea(H,V,te){var pe=H.prefix||"",Ee=H.namespaceURI;if(!Ee||pe==="xml"&&Ee===t.XML||Ee===t.XMLNS)return!1;for(var $e=te.length;$e--;){var ot=te[$e];if(ot.prefix===pe)return ot.namespace!==Ee}return!0}function ss(H,V,te){H.push(" ",V,'="',te.replace(/[<>&"\t\n\r]/g,we),'"')}function ji(H,V,te,pe,Ee){if(Ee||(Ee=[]),pe)if(H=pe(H),H){if(typeof H=="string"){V.push(H);return}}else return;switch(H.nodeType){case h:var $e=H.attributes,ot=$e.length,yt=H.firstChild,Gt=H.tagName;te=t.isHTML(H.namespaceURI)||te;var ii=Gt;if(!te&&!H.prefix&&H.namespaceURI){for(var Ct,$i=0;$i<$e.length;$i++)if($e.item($i).name==="xmlns"){Ct=$e.item($i).value;break}if(!Ct)for(var rr=Ee.length-1;rr>=0;rr--){var li=Ee[rr];if(li.prefix===""&&li.namespace===H.namespaceURI){Ct=li.namespace;break}}if(Ct!==H.namespaceURI)for(var rr=Ee.length-1;rr>=0;rr--){var li=Ee[rr];if(li.namespace===H.namespaceURI){li.prefix&&(ii=li.prefix+":"+Gt);break}}}V.push("<",ii);for(var Ot=0;Ot<ot;Ot++){var st=$e.item(Ot);st.prefix=="xmlns"?Ee.push({prefix:st.localName,namespace:st.value}):st.nodeName=="xmlns"&&Ee.push({prefix:"",namespace:st.value})}for(var Ot=0;Ot<ot;Ot++){var st=$e.item(Ot);if(ea(st,te,Ee)){var et=st.prefix||"",sn=st.namespaceURI;ss(V,et?"xmlns:"+et:"xmlns",sn),Ee.push({prefix:et,namespace:sn})}ji(st,V,te,pe,Ee)}if(Gt===ii&&ea(H,te,Ee)){var et=H.prefix||"",sn=H.namespaceURI;ss(V,et?"xmlns:"+et:"xmlns",sn),Ee.push({prefix:et,namespace:sn})}if(yt||te&&!/^(?:meta|link|img|br|hr|input)$/i.test(Gt)){if(V.push(">"),te&&/^script$/i.test(Gt))for(;yt;)yt.data?V.push(yt.data):ji(yt,V,te,pe,Ee.slice()),yt=yt.nextSibling;else for(;yt;)ji(yt,V,te,pe,Ee.slice()),yt=yt.nextSibling;V.push("</",ii,">")}else V.push("/>");return;case L:case F:for(var yt=H.firstChild;yt;)ji(yt,V,te,pe,Ee.slice()),yt=yt.nextSibling;return;case d:return ss(V,H.name,H.value);case g:return V.push(H.data.replace(/[<&>]/g,we));case y:return V.push("<![CDATA[",H.data,"]]>");case I:return V.push("<!--",H.data,"-->");case $:var ri=H.publicId,qi=H.systemId;if(V.push("<!DOCTYPE ",H.name),ri)V.push(" PUBLIC ",ri),qi&&qi!="."&&V.push(" ",qi),V.push(">");else if(qi&&qi!=".")V.push(" SYSTEM ",qi,">");else{var Ze=H.internalSubset;Ze&&V.push(" [",Ze,"]"),V.push(">")}return;case k:return V.push("<?",H.target," ",H.data,"?>");case p:return V.push("&",H.nodeName,";");default:V.push("??",H.nodeName)}}function ta(H,V,te){var pe;switch(V.nodeType){case h:pe=V.cloneNode(!1),pe.ownerDocument=H;case F:break;case d:te=!0;break}if(pe||(pe=V.cloneNode(!1)),pe.ownerDocument=H,pe.parentNode=null,te)for(var Ee=V.firstChild;Ee;)pe.appendChild(ta(H,Ee,te)),Ee=Ee.nextSibling;return pe}function as(H,V,te){var pe=new V.constructor;for(var Ee in V)if(Object.prototype.hasOwnProperty.call(V,Ee)){var $e=V[Ee];typeof $e!="object"&&$e!=pe[Ee]&&(pe[Ee]=$e)}switch(V.childNodes&&(pe.childNodes=new X),pe.ownerDocument=H,pe.nodeType){case h:var ot=V.attributes,Gt=pe.attributes=new fe,ii=ot.length;Gt._ownerElement=pe;for(var Ct=0;Ct<ii;Ct++)pe.setAttributeNode(as(H,ot.item(Ct),!0));break;case d:te=!0}if(te)for(var $i=V.firstChild;$i;)pe.appendChild(as(H,$i,te)),$i=$i.nextSibling;return pe}function ia(H,V,te){H[V]=te}try{if(Object.defineProperty){let H=function(V){switch(V.nodeType){case h:case F:var te=[];for(V=V.firstChild;V;)V.nodeType!==7&&V.nodeType!==8&&te.push(H(V)),V=V.nextSibling;return te.join("");default:return V.nodeValue}};Object.defineProperty(re.prototype,"length",{get:function(){return he(this),this.$$length}}),Object.defineProperty(ve.prototype,"textContent",{get:function(){return H(this)},set:function(V){switch(this.nodeType){case h:case F: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}}}),ia=function(V,te,pe){V["$$"+te]=pe}}}catch{}return pn.DocumentType=Ui,pn.DOMException=z,pn.DOMImplementation=de,pn.Element=Qe,pn.Node=ve,pn.NodeList=X,pn.XMLSerializer=Zs,pn}var el={},ef={},Dy;function UP(){return Dy||(Dy=1,function(s){var e=vh().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}(ef)),ef}var Ou={},Ny;function jP(){if(Ny)return Ou;Ny=1;var s=vh().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,P){this.message=C,this.locator=P,Error.captureStackTrace&&Error.captureStackTrace(this,d)}d.prototype=new Error,d.prototype.name=d.name;function g(){}g.prototype={parse:function(C,P,K){var z=this.domBuilder;z.startDocument(),$(P,P={}),y(C,P,K,z,this.errorHandler),z.endDocument()}};function y(C,P,K,z,X){function re(Qe){if(Qe>65535){Qe-=65536;var vt=55296+(Qe>>10),Bi=56320+(Qe&1023);return String.fromCharCode(vt,Bi)}else return String.fromCharCode(Qe)}function he(Qe){var vt=Qe.slice(1,-1);return Object.hasOwnProperty.call(K,vt)?K[vt]:vt.charAt(0)==="#"?re(parseInt(vt.substr(1).replace("x","0x"))):(X.error("entity not found:"+Qe),Qe)}function fe(Qe){if(Qe>Oe){var vt=C.substring(Oe,Qe).replace(/&#?\w+;/g,he);ve&&ne(Oe),z.characters(vt,0,Qe-Oe),Oe=Qe}}function ne(Qe,vt){for(;Qe>=le&&(vt=de.exec(C));)se=vt.index,le=se+vt[0].length,ve.lineNumber++;ve.columnNumber=Qe-se+1}for(var se=0,le=0,de=/.*(?:\r\n?|\n)|.*$/g,ve=z.locator,we=[{currentNSMap:P}],Pe={},Oe=0;;){try{var De=C.indexOf("<",Oe);if(De<0){if(!C.substr(Oe).match(/^\s*$/)){var Xe=z.doc,Re=Xe.createTextNode(C.substr(Oe));Xe.appendChild(Re),z.currentElement=Re}return}switch(De>Oe&&fe(De),C.charAt(De+1)){case"/":var Te=C.indexOf(">",De+3),Le=C.substring(De+2,Te).replace(/[ \t\n\r]+$/g,""),qe=we.pop();Te<0?(Le=C.substring(De+2).replace(/[\s<].*/,""),X.error("end tag name: "+Le+" is not complete:"+qe.tagName),Te=De+1+Le.length):Le.match(/\s</)&&(Le=Le.replace(/[\s<].*/,""),X.error("end tag name: "+Le+" maybe not complete"),Te=De+1+Le.length);var it=qe.localNSMap,gt=qe.tagName==Le,At=gt||qe.tagName&&qe.tagName.toLowerCase()==Le.toLowerCase();if(At){if(z.endElement(qe.uri,qe.localName,Le),it)for(var Ai in it)Object.prototype.hasOwnProperty.call(it,Ai)&&z.endPrefixMapping(Ai);gt||X.fatalError("end tag name: "+Le+" is not match the current start tagName:"+qe.tagName)}else we.push(qe);Te++;break;case"?":ve&&ne(De),Te=O(C,De,z);break;case"!":ve&&ne(De),Te=F(C,De,z,X);break;default:ve&&ne(De);var Lt=new B,Fi=we[we.length-1].currentNSMap,Te=_(C,De,Lt,Fi,he,X),Ce=Lt.length;if(!Lt.closed&&L(C,Te,Lt.tagName,Pe)&&(Lt.closed=!0,K.nbsp||X.warning("unclosed xml attribute")),ve&&Ce){for(var Fe=p(ve,{}),Me=0;Me<Ce;Me++){var Ge=Lt[Me];ne(Ge.offset),Ge.locator=p(ve,{})}z.locator=Fe,k(Lt,z,Fi)&&we.push(Lt),z.locator=ve}else k(Lt,z,Fi)&&we.push(Lt);s.isHTML(Lt.uri)&&!Lt.closed?Te=I(C,Te,Lt.tagName,he,z):Te++}}catch(Qe){if(Qe instanceof d)throw Qe;X.error("element parse error: "+Qe),Te=-1}Te>Oe?Oe=Te:fe(Math.max(De,Oe)+1)}}function p(C,P){return P.lineNumber=C.lineNumber,P.columnNumber=C.columnNumber,P}function _(C,P,K,z,X,re){function he(ve,we,Pe){K.attributeNames.hasOwnProperty(ve)&&re.fatalError("Attribute "+ve+" redefined"),K.addValue(ve,we.replace(/[\t\n\r]/g," ").replace(/&#?\w+;/g,X),Pe)}for(var fe,ne,se=++P,le=r;;){var de=C.charAt(se);switch(de){case"=":if(le===n)fe=C.slice(P,se),le=o;else if(le===a)le=o;else throw new Error("attribute equal must after attrName");break;case"'":case'"':if(le===o||le===n)if(le===n&&(re.warning('attribute value must after "="'),fe=C.slice(P,se)),P=se+1,se=C.indexOf(de,P),se>0)ne=C.slice(P,se),he(fe,ne,P-1),le=u;else throw new Error("attribute value no end '"+de+"' match");else if(le==l)ne=C.slice(P,se),he(fe,ne,P),re.warning('attribute "'+fe+'" missed start quot('+de+")!!"),P=se+1,le=u;else throw new Error('attribute value must after "="');break;case"/":switch(le){case r:K.setTagName(C.slice(P,se));case u:case c:case h:le=h,K.closed=!0;case l:case n:break;case a:K.closed=!0;break;default:throw new Error("attribute invalid close char('/')")}break;case"":return re.error("unexpected end of input"),le==r&&K.setTagName(C.slice(P,se)),se;case">":switch(le){case r:K.setTagName(C.slice(P,se));case u:case c:case h:break;case l:case n:ne=C.slice(P,se),ne.slice(-1)==="/"&&(K.closed=!0,ne=ne.slice(0,-1));case a:le===a&&(ne=fe),le==l?(re.warning('attribute "'+ne+'" missed quot(")!'),he(fe,ne,P)):((!s.isHTML(z[""])||!ne.match(/^(?:disabled|checked|selected)$/i))&&re.warning('attribute "'+ne+'" missed value!! "'+ne+'" instead!!'),he(ne,ne,P));break;case o:throw new Error("attribute value missed!!")}return se;case"":de=" ";default:if(de<=" ")switch(le){case r:K.setTagName(C.slice(P,se)),le=c;break;case n:fe=C.slice(P,se),le=a;break;case l:var ne=C.slice(P,se);re.warning('attribute "'+ne+'" missed quot(")!!'),he(fe,ne,P);case u:le=c;break}else switch(le){case a:K.tagName,(!s.isHTML(z[""])||!fe.match(/^(?:disabled|checked|selected)$/i))&&re.warning('attribute "'+fe+'" missed value!! "'+fe+'" instead2!!'),he(fe,fe,P),P=se,le=n;break;case u:re.warning('attribute space is required"'+fe+'"!!');case c:le=n,P=se;break;case o:le=l,P=se;break;case h:throw new Error("elements closed character '/' and '>' must be connected to")}}se++}}function k(C,P,K){for(var z=C.tagName,X=null,de=C.length;de--;){var re=C[de],he=re.qName,fe=re.value,ve=he.indexOf(":");if(ve>0)var ne=re.prefix=he.slice(0,ve),se=he.slice(ve+1),le=ne==="xmlns"&&se;else se=he,ne=null,le=he==="xmlns"&&"";re.localName=se,le!==!1&&(X==null&&(X={},$(K,K={})),K[le]=X[le]=fe,re.uri=s.XMLNS,P.startPrefixMapping(le,fe))}for(var de=C.length;de--;){re=C[de];var ne=re.prefix;ne&&(ne==="xml"&&(re.uri=s.XML),ne!=="xmlns"&&(re.uri=K[ne||""]))}var ve=z.indexOf(":");ve>0?(ne=C.prefix=z.slice(0,ve),se=C.localName=z.slice(ve+1)):(ne=null,se=C.localName=z);var we=C.uri=K[ne||""];if(P.startElement(we,se,z,C),C.closed){if(P.endElement(we,se,z),X)for(ne in X)Object.prototype.hasOwnProperty.call(X,ne)&&P.endPrefixMapping(ne)}else return C.currentNSMap=K,C.localNSMap=X,!0}function I(C,P,K,z,X){if(/^(?:script|textarea)$/i.test(K)){var re=C.indexOf("</"+K+">",P),he=C.substring(P+1,re);if(/[&<]/.test(he))return/^script$/i.test(K)?(X.characters(he,0,he.length),re):(he=he.replace(/&#?\w+;/g,z),X.characters(he,0,he.length),re)}return P+1}function L(C,P,K,z){var X=z[K];return X==null&&(X=C.lastIndexOf("</"+K+">"),X<P&&(X=C.lastIndexOf("</"+K)),z[K]=X),X<P}function $(C,P){for(var K in C)Object.prototype.hasOwnProperty.call(C,K)&&(P[K]=C[K])}function F(C,P,K,z){var X=C.charAt(P+2);switch(X){case"-":if(C.charAt(P+3)==="-"){var re=C.indexOf("-->",P+4);return re>P?(K.comment(C,P+4,re-P-4),re+3):(z.error("Unclosed comment"),-1)}else return-1;default:if(C.substr(P+3,6)=="CDATA["){var re=C.indexOf("]]>",P+9);return K.startCDATA(),K.characters(C,P+9,re-P-9),K.endCDATA(),re+3}var he=U(C,P),fe=he.length;if(fe>1&&/!doctype/i.test(he[0][0])){var ne=he[1][0],se=!1,le=!1;fe>3&&(/^public$/i.test(he[2][0])?(se=he[3][0],le=fe>4&&he[4][0]):/^system$/i.test(he[2][0])&&(le=he[3][0]));var de=he[fe-1];return K.startDTD(ne,se,le),K.endDTD(),de.index+de[0].length}}return-1}function O(C,P,K){var z=C.indexOf("?>",P);if(z){var X=C.substring(P,z).match(/^<\?(\S*)\s*([\s\S]*?)\s*$/);return X?(X[0].length,K.processingInstruction(X[1],X[2]),z+2):-1}return-1}function B(){this.attributeNames={}}B.prototype={setTagName:function(C){if(!i.test(C))throw new Error("invalid tagName:"+C);this.tagName=C},addValue:function(C,P,K){if(!i.test(C))throw new Error("invalid attribute:"+C);this.attributeNames[C]=this.length,this[this.length++]={qName:C,value:P,offset:K}},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 U(C,P){var K,z=[],X=/'[^']+'|"[^"]+"|[^\s<>\/=]+=?|(\/?\s*>|<)/g;for(X.lastIndex=P,X.exec(C);K=X.exec(C);)if(z.push(K),K[1])return z}return Ou.XMLReader=g,Ou.ParseError=d,Ou}var Ly;function $P(){if(Ly)return el;Ly=1;var s=vh(),e=t1(),t=UP(),i=jP(),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 I=this.options,L=new o,$=I.domBuilder||new h,F=I.errorHandler,O=I.locator,B=I.xmlns||{},U=/\/x?html?$/.test(k),C=U?t.HTML_ENTITIES:t.XML_ENTITIES;O&&$.setDocumentLocator(O),L.errorHandler=c(F,$,O),L.domBuilder=I.domBuilder||$,U&&(B[""]=n.HTML),B.xml=B.xml||n.XML;var P=I.normalizeLineEndings||l;return _&&typeof _=="string"?L.parse(P(_),B,C):L.errorHandler.error("invalid doc source"),$.doc};function c(_,k,I){if(!_){if(k instanceof h)return k;_=k}var L={},$=_ instanceof Function;I=I||{};function F(O){var B=_[O];!B&&$&&(B=_.length==2?function(U){_(O,U)}:_),L[O]=B&&function(U){B("[xmldom "+O+"] "+U+g(I))}||function(){}}return F("warning"),F("error"),F("fatalError"),L}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,I,L){var $=this.doc,F=$.createElementNS(_,I||k),O=L.length;p(this,F),this.currentElement=F,this.locator&&d(this.locator,F);for(var B=0;B<O;B++){var _=L.getURI(B),U=L.getValue(B),I=L.getQName(B),C=$.createAttributeNS(_,I);this.locator&&d(L.getLocator(B),C),C.value=C.nodeValue=U,F.setAttributeNode(C)}},endElement:function(_,k,I){var L=this.currentElement;L.tagName,this.currentElement=L.parentNode},startPrefixMapping:function(_,k){},endPrefixMapping:function(_){},processingInstruction:function(_,k){var I=this.doc.createProcessingInstruction(_,k);this.locator&&d(this.locator,I),p(this,I)},ignorableWhitespace:function(_,k,I){},characters:function(_,k,I){if(_=y.apply(this,arguments),_){if(this.cdata)var L=this.doc.createCDATASection(_);else var L=this.doc.createTextNode(_);this.currentElement?this.currentElement.appendChild(L):/^\s*$/.test(_)&&this.doc.appendChild(L),this.locator&&d(this.locator,L)}},skippedEntity:function(_){},endDocument:function(){this.doc.normalize()},setDocumentLocator:function(_){(this.locator=_)&&(_.lineNumber=0)},comment:function(_,k,I){_=y.apply(this,arguments);var L=this.doc.createComment(_);this.locator&&d(this.locator,L),p(this,L)},startCDATA:function(){this.cdata=!0},endCDATA:function(){this.cdata=!1},startDTD:function(_,k,I){var L=this.doc.implementation;if(L&&L.createDocumentType){var $=L.createDocumentType(_,k,I);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,I){return typeof _=="string"?_.substr(k,I):_.length>=k+I||k?new java.lang.String(_,k,I)+"":_}"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 el.__DOMHandler=h,el.normalizeLineEndings=l,el.DOMParser=u,el}var Oy;function qP(){if(Oy)return Zo;Oy=1;var s=t1();return Zo.DOMImplementation=s.DOMImplementation,Zo.XMLSerializer=s.XMLSerializer,Zo.DOMParser=$P().DOMParser,Zo}var i1=qP();/*! @name mpd-parser @version 1.3.1 @license Apache-2.0 */const Ry=s=>!!s&&typeof s=="object",Jt=(...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]):Ry(e[i])&&Ry(t[i])?e[i]=Jt(e[i],t[i]):e[i]=t[i]}),e),{}),r1=s=>Object.keys(s).map(e=>s[e]),HP=(s,e)=>{const t=[];for(let i=s;i<e;i++)t.push(i);return t},Ja=s=>s.reduce((e,t)=>e.concat(t),[]),n1=s=>{if(!s.length)return[];const e=[];for(let t=0;t<s.length;t++)e.push(s[t]);return e},VP=(s,e)=>s.reduce((t,i,r)=>(i[e]&&t.push(r),t),[]),zP=(s,e)=>r1(s.reduce((t,i)=>(i.forEach(r=>{t[e(r)]=r}),t),{}));var Za={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 Al=({baseUrl:s="",source:e="",range:t="",indexRange:i=""})=>{const r={uri:e,resolvedUri:gh(s||"",e)};if(t||i){const a=(t||i).split("-");let o=R.BigInt?R.BigInt(a[0]):parseInt(a[0],10),l=R.BigInt?R.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=R.BigInt(l)-R.BigInt(o)+R.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},WP=s=>{let e;return typeof s.offset=="bigint"||typeof s.length=="bigint"?e=R.BigInt(s.offset)+R.BigInt(s.length)-R.BigInt(1):e=s.offset+s.length-1,`${s.offset}-${e}`},My=s=>(s&&typeof s!="number"&&(s=parseInt(s,10)),isNaN(s)?null:s),GP={static(s){const{duration:e,timescale:t=1,sourceDuration:i,periodDuration:r}=s,n=My(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=My(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,_)}}},KP=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}},pv=s=>{const{type:e,duration:t,timescale:i=1,periodDuration:r,sourceDuration:n}=s,{start:a,end:o}=GP[e](s),l=HP(a,o).map(KP(s));if(e==="static"){const u=l.length-1,c=typeof r=="number"?r:n;l[u].duration=c-t/i*u}return l},s1=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(Za.NO_BASE_URL);const u=Al({baseUrl:e,source:t.sourceURL,range:t.range}),c=Al({baseUrl:e,source:e,indexRange:r});if(c.map=u,l){const h=pv(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]},mv=(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=R.BigInt(o)+e.firstOffset:p=o+e.firstOffset;for(let _=0;_<u.length;_++){const k=e.references[_],I=k.referencedSize,L=k.subsegmentDuration;let $;typeof p=="bigint"?$=p+R.BigInt(I)-R.BigInt(1):$=p+I-1;const F=`${p}-${$}`,B=s1({baseUrl:t,timescale:l,timeline:n,periodStart:d,presentationTime:g,number:y,duration:L,sourceDuration:r,indexRange:F,type:h})[0];i&&(B.map=i),c.push(B),typeof p=="bigint"?p+=R.BigInt(I):p+=I,g+=L/l,y++}return s.segments=c,s},XP=["AUDIO","SUBTITLES"],QP=1/60,a1=s=>zP(s,({timeline:e})=>e).sort((e,t)=>e.timeline>t.timeline?1:-1),YP=(s,e)=>{for(let t=0;t<s.length;t++)if(s[t].attributes.NAME===e)return s[t];return null},Fy=s=>{let e=[];return BP(s,XP,(t,i,r,n)=>{e=e.concat(t.playlists||[])}),e},By=({playlist:s,mediaSequence:e})=>{s.mediaSequence=e,s.segments.forEach((t,i)=>{t.number=s.mediaSequence+i})},JP=({oldPlaylists:s,newPlaylists:e,timelineStarts:t})=>{e.forEach(i=>{i.discontinuitySequence=t.findIndex(function({timeline:l}){return l===i.timeline});const r=YP(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)<QP});if(a===-1){By({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--),By({playlist:i,mediaSequence:r.segments[a].number})})},ZP=({oldManifest:s,newManifest:e})=>{const t=s.playlists.concat(Fy(s)),i=e.playlists.concat(Fy(e));return e.timelineStarts=a1([s.timelineStarts,e.timelineStarts]),JP({oldPlaylists:t,newPlaylists:i,timelineStarts:e.timelineStarts}),e},yh=s=>s&&s.uri+"-"+WP(s.byterange),tf=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=r1(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=VP(i.segments||[],"discontinuity"),i))},gv=(s,e)=>{const t=yh(s.sidx),i=t&&e[t]&&e[t].sidx;return i&&mv(s,i,s.sidx.resolvedUri),s},eD=(s,e={})=>{if(!Object.keys(e).length)return s;for(const t in s)s[t]=gv(s[t],e);return s},tD=({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},iD=({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},rD=(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=gv(tD(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},nD=(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(gv(iD(i),e)),t},{}),sD=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),{}),aD=({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},oD=({attributes:s})=>s.mimeType==="video/mp4"||s.mimeType==="video/webm"||s.contentType==="video",lD=({attributes:s})=>s.mimeType==="audio/mp4"||s.mimeType==="audio/webm"||s.contentType==="audio",uD=({attributes:s})=>s.mimeType==="text/vtt"||s.contentType==="text",cD=(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})})},Uy=s=>s?Object.keys(s).reduce((e,t)=>{const i=s[t];return e.concat(i.playlists)},[]):[],hD=({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=tf(s.filter(oD)).map(aD),h=tf(s.filter(lD)),d=tf(s.filter(uD)),g=s.map($=>$.attributes.captionServices).filter(Boolean),y={allowCache:!0,discontinuityStarts:[],segments:[],endList:!0,mediaGroups:{AUDIO:{},VIDEO:{},"CLOSED-CAPTIONS":{},SUBTITLES:{}},uri:"",duration:a,playlists:eD(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?rD(h,i,p):null,k=d.length?nD(d,i):null,I=c.concat(Uy(_),Uy(k)),L=I.map(({timelineStarts:$})=>$);return y.timelineStarts=a1(L),cD(I,y.timelineStarts),_&&(y.mediaGroups.AUDIO.audio=_),k&&(y.mediaGroups.SUBTITLES.subs=k),g.length&&(y.mediaGroups["CLOSED-CAPTIONS"].cc=sD(g)),r?ZP({oldManifest:r,newManifest:y}):y},dD=(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)},o1=(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 L=h+1;L===e.length?t==="dynamic"&&i>0&&r.indexOf("$Number$")>0?_=dD(s,c,g):_=(n*a-c)/g:_=(e[L].t-c)/g}else _=y+1;const k=o+u.length+_;let I=o+u.length;for(;I<k;)u.push({number:I,duration:g/a,time:c,timeline:l}),c+=g,I++}return u},fD=/\$([A-z]*)(?:(%0)([0-9]+)d)?\$/g,pD=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}`},jy=(s,e)=>s.replace(fD,pD(e)),mD=(s,e)=>!s.duration&&!e?[{number:s.startNumber||1,duration:s.sourceDuration,time:0,timeline:s.periodStart}]:s.duration?pv(s):o1(s,e),gD=(s,e)=>{const t={RepresentationID:s.id,Bandwidth:s.bandwidth||0},{initialization:i={sourceURL:"",range:""}}=s,r=Al({baseUrl:s.baseUrl,source:jy(i.sourceURL,t),range:i.range});return mD(s,e).map(a=>{t.Number=a.number,t.Time=a.time;const o=jy(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:gh(s.baseUrl||"",o),map:r,number:a.number,presentationTime:c}})},vD=(s,e)=>{const{baseUrl:t,initialization:i={}}=s,r=Al({baseUrl:t,source:i.sourceURL,range:i.range}),n=Al({baseUrl:t,source:e.media,range:e.mediaRange});return n.map=r,n},yD=(s,e)=>{const{duration:t,segmentUrls:i=[],periodStart:r}=s;if(!t&&!e||t&&e)throw new Error(Za.SEGMENT_TIME_UNSPECIFIED);const n=i.map(l=>vD(s,l));let a;return t&&(a=pv(s)),e&&(a=o1(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)},_D=({attributes:s,segmentInfo:e})=>{let t,i;e.template?(i=gD,t=Jt(s,e.template)):e.base?(i=s1,t=Jt(s,e.base)):e.list&&(i=yD,t=Jt(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},TD=s=>s.map(_D),kt=(s,e)=>n1(s.childNodes).filter(({tagName:t})=>t===e),$l=s=>s.textContent.trim(),bD=s=>parseFloat(s.split("/").reduce((e,t)=>e/t)),Sa=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)},SD=s=>(/^\d+-\d+-\d+T\d+:\d+:\d+(\.\d+)?$/.test(s)&&(s+="Z"),Date.parse(s)),$y={mediaPresentationDuration(s){return Sa(s)},availabilityStartTime(s){return SD(s)/1e3},minimumUpdatePeriod(s){return Sa(s)},suggestedPresentationDelay(s){return Sa(s)},type(s){return s},timeShiftBufferDepth(s){return Sa(s)},start(s){return Sa(s)},width(s){return parseInt(s,10)},height(s){return parseInt(s,10)},bandwidth(s){return parseInt(s,10)},frameRate(s){return bD(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)?Sa(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}},qt=s=>s&&s.attributes?n1(s.attributes).reduce((e,t)=>{const i=$y[t.name]||$y.DEFAULT;return e[t.name]=i(t.value),e},{}):{},xD={"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?Ja(s.map(function(t){return e.map(function(i){const r=$l(i),n=gh(t.baseUrl,r),a=Jt(qt(i),{baseUrl:n});return n!==r&&!a.serviceLocation&&t.serviceLocation&&(a.serviceLocation=t.serviceLocation),a})})):s,vv=s=>{const e=kt(s,"SegmentTemplate")[0],t=kt(s,"SegmentList")[0],i=t&&kt(t,"SegmentURL").map(h=>Jt({tag:"SegmentURL"},qt(h))),r=kt(s,"SegmentBase")[0],n=t||e,a=n&&kt(n,"SegmentTimeline")[0],o=t||r||e,l=o&&kt(o,"Initialization")[0],u=e&&qt(e);u&&l?u.initialization=l&&qt(l):u&&u.initialization&&(u.initialization={sourceURL:u.initialization});const c={template:u,segmentTimeline:a&&kt(a,"S").map(h=>qt(h)),list:t&&Jt(qt(t),{segmentUrls:i,initialization:qt(l)}),base:r&&Jt(qt(r),{initialization:qt(l)})};return Object.keys(c).forEach(h=>{c[h]||delete c[h]}),c},CD=(s,e,t)=>i=>{const r=kt(i,"BaseURL"),n=_h(e,r),a=Jt(s,qt(i)),o=vv(i);return n.map(l=>({segmentInfo:Jt(t,o),attributes:Jt(a,l)}))},ED=s=>s.reduce((e,t)=>{const i=qt(t);i.schemeIdUri&&(i.schemeIdUri=i.schemeIdUri.toLowerCase());const r=xD[i.schemeIdUri];if(r){e[r]={attributes:i};const n=kt(t,"cenc:pssh")[0];if(n){const a=$l(n);e[r].pssh=a&&XC(a)}}return e},{}),wD=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})},kD=s=>Ja(kt(s.node,"EventStream").map(e=>{const t=qt(e),i=t.schemeIdUri;return kt(e,"Event").map(r=>{const n=qt(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:$l(r)||n.messageData,contentEncoding:t.contentEncoding,presentationTimeOffset:t.presentationTimeOffset||0}})})),AD=(s,e,t)=>i=>{const r=qt(i),n=_h(e,kt(i,"BaseURL")),a=kt(i,"Role")[0],o={role:qt(a)};let l=Jt(s,r,o);const u=kt(i,"Accessibility")[0],c=wD(qt(u));c&&(l=Jt(l,{captionServices:c}));const h=kt(i,"Label")[0];if(h&&h.childNodes.length){const _=h.childNodes[0].nodeValue.trim();l=Jt(l,{label:_})}const d=ED(kt(i,"ContentProtection"));Object.keys(d).length&&(l=Jt(l,{contentProtection:d}));const g=vv(i),y=kt(i,"Representation"),p=Jt(t,g);return Ja(y.map(CD(l,n,p)))},ID=(s,e)=>(t,i)=>{const r=_h(e,kt(t.node,"BaseURL")),n=Jt(s,{periodStart:t.attributes.start});typeof t.attributes.duration=="number"&&(n.periodDuration=t.attributes.duration);const a=kt(t.node,"AdaptationSet"),o=vv(t.node);return Ja(a.map(AD(n,r,o)))},PD=(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=Jt({serverURL:$l(s[0])},qt(s[0]));return t.queryBeforeStart=t.queryBeforeStart==="true",t},DD=({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,ND=(s,e={})=>{const{manifestUri:t="",NOW:i=Date.now(),clientOffset:r=0,eventHandler:n=function(){}}=e,a=kt(s,"Period");if(!a.length)throw new Error(Za.INVALID_NUMBER_OF_PERIOD);const o=kt(s,"Location"),l=qt(s),u=_h([{baseUrl:t}],kt(s,"BaseURL")),c=kt(s,"ContentSteering");l.type=l.type||"static",l.sourceDuration=l.mediaPresentationDuration||0,l.NOW=i,l.clientOffset=r,o.length&&(l.locations=o.map($l));const h=[];return a.forEach((d,g)=>{const y=qt(d),p=h[g-1];y.start=DD({attributes:y,priorPeriodAttributes:p?p.attributes:null,mpdType:l.type}),h.push({node:d,attributes:y})}),{locations:l.locations,contentSteeringInfo:PD(c,n),representationInfo:Ja(h.map(ID(l,u))),eventStream:Ja(h.map(kD))}},l1=s=>{if(s==="")throw new Error(Za.DASH_EMPTY_MANIFEST);const e=new i1.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(Za.DASH_INVALID_XML);return i},LD=s=>{const e=kt(s,"UTCTiming")[0];if(!e)return null;const t=qt(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(Za.UNSUPPORTED_UTC_TIMING_SCHEME)}return t},OD=(s,e={})=>{const t=ND(l1(s),e),i=TD(t.representationInfo);return hD({dashPlaylists:i,locations:t.locations,contentSteering:t.contentSteeringInfo,sidxMapping:e.sidxMapping,previousManifest:e.previousManifest,eventStream:t.eventStream})},RD=s=>LD(l1(s));var rf,qy;function MD(){if(qy)return rf;qy=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 rf={getUint64:e,MAX_UINT32:s},rf}var nf,Hy;function FD(){if(Hy)return nf;Hy=1;var s=MD().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 nf=e,nf}var BD=FD();const UD=A.getDefaultExportFromCjs(BD);var jD=Ue([73,68,51]),$D=function(e,t){t===void 0&&(t=0),e=Ue(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},hl=function s(e,t){return t===void 0&&(t=0),e=Ue(e),e.length-t<10||!Et(e,jD,{offset:t})?t:(t+=$D(e,t),s(e,t))},Vy=function(e){return typeof e=="string"?e1(e):e},qD=function(e){return Array.isArray(e)?e.map(function(t){return Vy(t)}):[Vy(e)]},HD=function s(e,t,i){i===void 0&&(i=!1),t=qD(t),e=Ue(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);Et(o,t[0])&&(t.length===1?r.push(u):r.push.apply(r,s(u,t.slice(1),i))),n=l}return r},Ru={EBML:Ue([26,69,223,163]),DocType:Ue([66,130]),Segment:Ue([24,83,128,103]),SegmentInfo:Ue([21,73,169,102]),Tracks:Ue([22,84,174,107]),Track:Ue([174]),TrackNumber:Ue([215]),DefaultDuration:Ue([35,227,131]),TrackEntry:Ue([174]),TrackType:Ue([131]),FlagDefault:Ue([136]),CodecID:Ue([134]),CodecPrivate:Ue([99,162]),VideoTrack:Ue([224]),AudioTrack:Ue([225]),Cluster:Ue([31,67,182,117]),Timestamp:Ue([231]),TimestampScale:Ue([42,215,177]),BlockGroup:Ue([160]),BlockDuration:Ue([155]),Block:Ue([161]),SimpleBlock:Ue([163])},rg=[128,64,32,16,8,4,2,1],VD=function(e){for(var t=1,i=0;i<rg.length&&!(e&rg[i]);i++)t++;return t},Tc=function(e,t,i,r){i===void 0&&(i=!0),r===void 0&&(r=!1);var n=VD(e[t]),a=e.subarray(t,t+n);return i&&(a=Array.prototype.slice.call(e,t,t+n),a[0]^=rg[n-1]),{length:n,value:RP(a,{signed:r}),bytes:a}},zy=function s(e){return typeof e=="string"?e.match(/.{1,2}/g).map(function(t){return s(t)}):typeof e=="number"?MP(e):e},zD=function(e){return Array.isArray(e)?e.map(function(t){return zy(t)}):[zy(e)]},WD=function s(e,t,i){if(i>=t.length)return t.length;var r=Tc(t,i,!1);if(Et(e.bytes,r.bytes))return i;var n=Tc(t,i+r.length);return s(e,t,i+n.length+n.value+r.length)},Wy=function s(e,t){t=zD(t),e=Ue(e);var i=[];if(!t.length)return i;for(var r=0;r<e.length;){var n=Tc(e,r,!1),a=Tc(e,r+n.length),o=r+n.length+a.length;a.value===127&&(a.value=WD(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);Et(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},GD=Ue([0,0,0,1]),KD=Ue([0,0,1]),XD=Ue([0,0,3]),QD=function(e){for(var t=[],i=1;i<e.length-2;)Et(e.subarray(i,i+3),XD)&&(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},u1=function(e,t,i,r){e=Ue(e),i=[].concat(i);for(var n=0,a,o=0;n<e.length&&(o<r||a);){var l=void 0;if(Et(e.subarray(n),GD)?l=4:Et(e.subarray(n),KD)&&(l=3),!l){n++;continue}if(o++,a)return QD(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)},YD=function(e,t,i){return u1(e,"h264",t,i)},JD=function(e,t,i){return u1(e,"h265",t,i)},yi={webm:Ue([119,101,98,109]),matroska:Ue([109,97,116,114,111,115,107,97]),flac:Ue([102,76,97,67]),ogg:Ue([79,103,103,83]),ac3:Ue([11,119]),riff:Ue([82,73,70,70]),avi:Ue([65,86,73]),wav:Ue([87,65,86,69]),"3gp":Ue([102,116,121,112,51,103]),mp4:Ue([102,116,121,112]),fmp4:Ue([115,116,121,112]),mov:Ue([102,116,121,112,113,116]),moov:Ue([109,111,111,118]),moof:Ue([109,111,111,102])},eo={aac:function(e){var t=hl(e);return Et(e,[255,16],{offset:t,mask:[255,22]})},mp3:function(e){var t=hl(e);return Et(e,[255,2],{offset:t,mask:[255,6]})},webm:function(e){var t=Wy(e,[Ru.EBML,Ru.DocType])[0];return Et(t,yi.webm)},mkv:function(e){var t=Wy(e,[Ru.EBML,Ru.DocType])[0];return Et(t,yi.matroska)},mp4:function(e){if(eo["3gp"](e)||eo.mov(e))return!1;if(Et(e,yi.mp4,{offset:4})||Et(e,yi.fmp4,{offset:4})||Et(e,yi.moof,{offset:4})||Et(e,yi.moov,{offset:4}))return!0},mov:function(e){return Et(e,yi.mov,{offset:4})},"3gp":function(e){return Et(e,yi["3gp"],{offset:4})},ac3:function(e){var t=hl(e);return Et(e,yi.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=hl(e);return Et(e,yi.flac,{offset:t})},ogg:function(e){return Et(e,yi.ogg)},avi:function(e){return Et(e,yi.riff)&&Et(e,yi.avi,{offset:8})},wav:function(e){return Et(e,yi.riff)&&Et(e,yi.wav,{offset:8})},h264:function(e){return YD(e,7,3).length},h265:function(e){return JD(e,[32,33],3).length}},ng=Object.keys(eo).filter(function(s){return s!=="ts"&&s!=="h264"&&s!=="h265"}).concat(["ts","h264","h265"]);ng.forEach(function(s){var e=eo[s];eo[s]=function(t){return e(Ue(t))}});var ZD=eo,yv=function(e){e=Ue(e);for(var t=0;t<ng.length;t++){var i=ng[t];if(ZD[i](e))return i}return""},eN=function(e){return HD(e,["moof"]).length>0},sf,Gy;function tN(){if(Gy)return sf;Gy=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)},sf={ONE_SECOND_IN_TS:s,secondsToVideoTs:e,secondsToAudioTs:t,videoTsToSeconds:i,audioTsToSeconds:r,audioTsToVideoTs:n,videoTsToAudioTs:a,metadataTsToSeconds:o},sf}var Ls=tN();/**
|
|
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 sg="8.20.0";const vn={},Jn=function(s,e){return vn[s]=vn[s]||[],e&&(vn[s]=vn[s].concat(e)),vn[s]},iN=function(s,e){Jn(s,e)},c1=function(s,e){const t=Jn(s).indexOf(e);return t<=-1?!1:(vn[s]=vn[s].slice(),vn[s].splice(t,1),!0)},rN=function(s,e){Jn(s,[].concat(e).map(t=>{const i=(...r)=>(c1(s,i),t(...r));return i}))},bc={prefixed:!0},sc=[["requestFullscreen","exitFullscreen","fullscreenElement","fullscreenEnabled","fullscreenchange","fullscreenerror","fullscreen"],["webkitRequestFullscreen","webkitExitFullscreen","webkitFullscreenElement","webkitFullscreenEnabled","webkitfullscreenchange","webkitfullscreenerror","-webkit-full-screen"]],Ky=sc[0];let dl;for(let s=0;s<sc.length;s++)if(sc[s][1]in ce){dl=sc[s];break}if(dl){for(let s=0;s<dl.length;s++)bc[Ky[s]]=dl[s];bc.prefixed=dl[0]!==Ky[0]}let Ni=[];const nN=(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+":"),Ni){Ni.push([].concat(n));const c=Ni.length-1e3;Ni.splice(0,c>0?c:0)}if(!R.console)return;let u=R.console[i];!u&&i==="debug"&&(u=R.console.info||R.console.log),!(!u||!a||!o.test(i))&&u[Array.isArray(n)?"apply":"call"](R.console,n)};function ag(s,e=":",t=""){let i="info",r;function n(...a){r("log",i,a)}return r=nN(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 ag(h,u,c)},n.createNewLogger=(a,o,l)=>ag(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=()=>Ni?[].concat(Ni):[],n.history.filter=a=>(Ni||[]).filter(o=>new RegExp(`.*${a}.*`).test(o[0])),n.history.clear=()=>{Ni&&(Ni.length=0)},n.history.disable=()=>{Ni!==null&&(Ni.length=0,Ni=null)},n.history.enable=()=>{Ni===null&&(Ni=[])},n.error=(...a)=>r("error",i,a),n.warn=(...a)=>r("warn",i,a),n.debug=(...a)=>r("debug",i,a),n}const Je=ag("VIDEOJS"),h1=Je.createLogger,sN=Object.prototype.toString,d1=function(s){return Gr(s)?Object.keys(s):[]};function Ua(s,e){d1(s).forEach(t=>e(s[t],t))}function f1(s,e,t=0){return d1(s).reduce((i,r)=>e(i,s[r],r),t)}function Gr(s){return!!s&&typeof s=="object"}function to(s){return Gr(s)&&sN.call(s)==="[object Object]"&&s.constructor===Object}function ft(...s){const e={};return s.forEach(t=>{t&&Ua(t,(i,r)=>{if(!to(i)){e[r]=i;return}to(e[r])||(e[r]={}),e[r]=ft(e[r],i)})}),e}function p1(s={}){const e=[];for(const t in s)if(s.hasOwnProperty(t)){const i=s[t];e.push(i)}return e}function Th(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 aN=Object.freeze({__proto__:null,each:Ua,reduce:f1,isObject:Gr,isPlain:to,merge:ft,values:p1,defineLazyProperty:Th});let _v=!1,m1=null,Kr=!1,g1,v1=!1,ja=!1,$a=!1,Xr=!1,Tv=null,bh=null;const oN=!!(R.cast&&R.cast.framework&&R.cast.framework.CastReceiverContext);let y1=null,Sc=!1,Sh=!1,xc=!1,xh=!1,Cc=!1,Ec=!1,wc=!1;const Il=!!(yo()&&("ontouchstart"in R||R.navigator.maxTouchPoints||R.DocumentTouch&&R.document instanceof R.DocumentTouch)),zn=R.navigator&&R.navigator.userAgentData;zn&&zn.platform&&zn.brands&&(Kr=zn.platform==="Android",ja=!!zn.brands.find(s=>s.brand==="Microsoft Edge"),$a=!!zn.brands.find(s=>s.brand==="Chromium"),Xr=!ja&&$a,Tv=bh=(zn.brands.find(s=>s.brand==="Chromium")||{}).version||null,Sh=zn.platform==="Windows");if(!$a){const s=R.navigator&&R.navigator.userAgent||"";_v=/iPod/i.test(s),m1=function(){const e=s.match(/OS (\d+)_/i);return e&&e[1]?e[1]:null}(),Kr=/Android/i.test(s),g1=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}(),v1=/Firefox/i.test(s),ja=/Edg/i.test(s),$a=/Chrome/i.test(s)||/CriOS/i.test(s),Xr=!ja&&$a,Tv=bh=function(){const e=s.match(/(Chrome|CriOS)\/(\d+)/);return e&&e[2]?parseFloat(e[2]):null}(),y1=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}(),Cc=/Tizen/i.test(s),Ec=/Web0S/i.test(s),wc=Cc||Ec,Sc=/Safari/i.test(s)&&!Xr&&!Kr&&!ja&&!wc,Sh=/Windows/i.test(s),xc=/iPad/i.test(s)||Sc&&Il&&!/iPhone/i.test(s),xh=/iPhone/i.test(s)&&!xc}const wi=xh||xc||_v,Ch=(Sc||wi)&&!Xr;var _1=Object.freeze({__proto__:null,get IS_IPOD(){return _v},get IOS_VERSION(){return m1},get IS_ANDROID(){return Kr},get ANDROID_VERSION(){return g1},get IS_FIREFOX(){return v1},get IS_EDGE(){return ja},get IS_CHROMIUM(){return $a},get IS_CHROME(){return Xr},get CHROMIUM_VERSION(){return Tv},get CHROME_VERSION(){return bh},IS_CHROMECAST_RECEIVER:oN,get IE_VERSION(){return y1},get IS_SAFARI(){return Sc},get IS_WINDOWS(){return Sh},get IS_IPAD(){return xc},get IS_IPHONE(){return xh},get IS_TIZEN(){return Cc},get IS_WEBOS(){return Ec},get IS_SMART_TV(){return wc},TOUCH_ENABLED:Il,IS_IOS:wi,IS_ANY_SAFARI:Ch});function Xy(s){return typeof s=="string"&&!!s.trim()}function lN(s){if(s.indexOf(" ")>=0)throw new Error("class has illegal whitespace characters")}function yo(){return ce===R.document}function _o(s){return Gr(s)&&s.nodeType===1}function T1(){try{return R.parent!==R.self}catch{return!0}}function b1(s){return function(e,t){if(!Xy(e))return ce[s](null);Xy(t)&&(t=ce.querySelector(t));const i=_o(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"?rs(r,a):(r[n]!==a||n==="tabIndex")&&(r[n]=a)}),Object.getOwnPropertyNames(t).forEach(function(n){r.setAttribute(n,t[n])}),i&&bv(r,i),r}function rs(s,e){return typeof s.textContent>"u"?s.innerText=e:s.textContent=e,s}function og(s,e){e.firstChild?e.insertBefore(s,e.firstChild):e.appendChild(s)}function _l(s,e){return lN(e),s.classList.contains(e)}function Us(s,...e){return s.classList.add(...e.reduce((t,i)=>t.concat(i.split(/\s+/)),[])),s}function Eh(s,...e){return s?(s.classList.remove(...e.reduce((t,i)=>t.concat(i.split(/\s+/)),[])),s):(Je.warn("removeClass was called with an element that doesn't exist"),null)}function S1(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 x1(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 Qn(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 C1(s,e){return s.getAttribute(e)}function io(s,e,t){s.setAttribute(e,t)}function wh(s,e){s.removeAttribute(e)}function E1(){ce.body.focus(),ce.onselectstart=function(){return!1}}function w1(){ce.onselectstart=function(){return!0}}function ro(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(no(s,"height"))),t.width||(t.width=parseFloat(no(s,"width"))),t}}function Pl(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[bc.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(wi){let c=s;for(;c&&c.nodeName.toLowerCase()!=="html";){const h=no(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&&R.WebKitCSSMatrix){const d=R.getComputedStyle(c.assignedSlot.parentElement).transform,g=new R.WebKitCSSMatrix(d);t.x+=g.m41,t.y+=g.m42}c=c.parentNode||c.host}}const i={},r=Pl(e.target),n=Pl(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,wi&&(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 k1(s){return Gr(s)&&s.nodeType===3}function Ah(s){for(;s.firstChild;)s.removeChild(s.firstChild);return s}function A1(s){return typeof s=="function"&&(s=s()),(Array.isArray(s)?s:[s]).map(e=>{if(typeof e=="function"&&(e=e()),_o(e)||k1(e))return e;if(typeof e=="string"&&/\S/.test(e))return ce.createTextNode(e)}).filter(e=>e)}function bv(s,e){return A1(e).forEach(t=>s.appendChild(t)),s}function I1(s,e){return bv(Ah(s),e)}function Dl(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 Zn=b1("querySelector"),P1=b1("querySelectorAll");function no(s,e){if(!s||!e)return"";if(typeof R.getComputedStyle=="function"){let t;try{t=R.getComputedStyle(s)}catch{return""}return t?t.getPropertyValue(e)||t[e]:""}return""}function D1(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 N1=Object.freeze({__proto__:null,isReal:yo,isEl:_o,isInFrame:T1,createEl:He,textContent:rs,prependTo:og,hasClass:_l,addClass:Us,removeClass:Eh,toggleClass:S1,setAttributes:x1,getAttributes:Qn,getAttribute:C1,setAttribute:io,removeAttribute:wh,blockTextSelection:E1,unblockTextSelection:w1,getBoundingClientRect:ro,findPosition:Pl,getPointerPosition:kh,isTextNode:k1,emptyEl:Ah,normalizeContent:A1,appendContent:bv,insertContent:I1,isSingleLeftClick:Dl,$:Zn,$$:P1,computedStyle:no,copyStyleSheetsToWindow:D1});let L1=!1,lg;const uN=function(){if(lg.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&&lg(a);else{ug(1);break}}else L1||ug(1)};function ug(s,e){yo()&&(e&&(lg=e),R.setTimeout(uN,s))}function cg(){L1=!0,R.removeEventListener("load",cg)}yo()&&(ce.readyState==="complete"?cg():R.addEventListener("load",cg));const O1=function(s){const e=ce.createElement("style");return e.className=s,e},R1=function(s,e){s.styleSheet?s.styleSheet.cssText=e:s.textContent=e};var Si=new WeakMap;const cN=3;let hN=cN;function cr(){return hN++}function Qy(s,e){if(!Si.has(s))return;const t=Si.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&&Si.delete(s)}function Sv(s,e,t,i){t.forEach(function(r){s(e,r,i)})}function Ih(s){if(s.fixed_)return s;function e(){return!0}function t(){return!1}if(!s||!s.isPropagationStopped||!s.isImmediatePropagationStopped){const i=s||R.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 Mu;const dN=function(){if(typeof Mu!="boolean"){Mu=!1;try{const s=Object.defineProperty({},"passive",{get(){Mu=!0}});R.addEventListener("test",null,s),R.removeEventListener("test",null,s)}catch{}}return Mu},fN=["touchstart","touchmove"];function Yi(s,e,t){if(Array.isArray(e))return Sv(Yi,s,e,t);Si.has(s)||Si.set(s,{});const i=Si.get(s);if(i.handlers||(i.handlers={}),i.handlers[e]||(i.handlers[e]=[]),t.guid||(t.guid=cr()),i.handlers[e].push(t),i.dispatcher||(i.disabled=!1,i.dispatcher=function(r,n){if(i.disabled)return;r=Ih(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){Je.error(c)}}}),i.handlers[e].length===1)if(s.addEventListener){let r=!1;dN()&&fN.indexOf(e)>-1&&(r={passive:!0}),s.addEventListener(e,i.dispatcher,r)}else s.attachEvent&&s.attachEvent("on"+e,i.dispatcher)}function di(s,e,t){if(!Si.has(s))return;const i=Si.get(s);if(!i.handlers)return;if(Array.isArray(e))return Sv(di,s,e,t);const r=function(a,o){i.handlers[o]=[],Qy(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);Qy(s,e)}}function To(s,e,t){const i=Si.has(s)?Si.get(s):{},r=s.parentNode||s.ownerDocument;if(typeof e=="string"?e={type:e,target:s}:e.target||(e.target=s),e=Ih(e),i.dispatcher&&i.dispatcher.call(s,e,t),r&&!e.isPropagationStopped()&&e.bubbles===!0)To.call(null,r,e,t);else if(!r&&!e.defaultPrevented&&e.target&&e.target[e.type]){Si.has(e.target)||Si.set(e.target,{});const n=Si.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 Ph(s,e,t){if(Array.isArray(e))return Sv(Ph,s,e,t);const i=function(){di(s,e,i),t.apply(this,arguments)};i.guid=t.guid=t.guid||cr(),Yi(s,e,i)}function xv(s,e,t){const i=function(){di(s,e,i),t.apply(this,arguments)};i.guid=t.guid=t.guid||cr(),Yi(s,e,i)}var pN=Object.freeze({__proto__:null,fixEvent:Ih,on:Yi,off:di,trigger:To,one:Ph,any:xv});const hr=30,_t=function(s,e,t){e.guid||(e.guid=cr());const i=e.bind(s);return i.guid=t?t+"_"+e.guid:e.guid,i},Qr=function(s,e){let t=R.performance.now();return function(...r){const n=R.performance.now();n-t>=e&&(s(...r),t=n)}},M1=function(s,e,t,i=R){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 mN=Object.freeze({__proto__:null,UPDATE_REFRESH_INTERVAL:hr,bind_:_t,throttle:Qr,debounce:M1});let tl,Ji=class{on(e,t){const i=this.addEventListener;this.addEventListener=()=>{},Yi(this,e,t),this.addEventListener=i}off(e,t){di(this,e,t)}one(e,t){const i=this.addEventListener;this.addEventListener=()=>{},Ph(this,e,t),this.addEventListener=i}any(e,t){const i=this.addEventListener;this.addEventListener=()=>{},xv(this,e,t),this.addEventListener=i}trigger(e){const t=e.type||e;typeof e=="string"&&(e={type:t}),e=Ih(e),this.allowedEvents_[t]&&this["on"+t]&&this["on"+t](e),To(this,e)}queueTrigger(e){tl||(tl=new Map);const t=e.type||e;let i=tl.get(this);i||(i=new Map,tl.set(this,i));const r=i.get(t);i.delete(t),R.clearTimeout(r);const n=R.setTimeout(()=>{i.delete(t),i.size===0&&(i=null,tl.delete(this)),this.trigger(e)},0);i.set(t,n)}};Ji.prototype.allowedEvents_={};Ji.prototype.addEventListener=Ji.prototype.on;Ji.prototype.removeEventListener=Ji.prototype.off;Ji.prototype.dispatchEvent=Ji.prototype.trigger;const Dh=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,bn=s=>s instanceof Ji||!!s.eventBusEl_&&["on","one","off","trigger"].every(e=>typeof s[e]=="function"),gN=(s,e)=>{bn(s)?e():(s.eventedCallbacks||(s.eventedCallbacks=[]),s.eventedCallbacks.push(e))},hg=s=>typeof s=="string"&&/\S/.test(s)||Array.isArray(s)&&!!s.length,kc=(s,e,t)=>{if(!s||!s.nodeName&&!bn(s))throw new Error(`Invalid target for ${Dh(e)}#${t}; must be a DOM node or evented object.`)},F1=(s,e,t)=>{if(!hg(s))throw new Error(`Invalid event type for ${Dh(e)}#${t}; must be a non-empty string or array.`)},B1=(s,e,t)=>{if(typeof s!="function")throw new Error(`Invalid listener for ${Dh(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),F1(n,s,t),B1(a,s,t),a=_t(s,a),{isTargetingSelf:i,target:r,type:n,listener:a}},Es=(s,e,t,i)=>{kc(s,s,e),s.nodeName?pN[e](s,t,i):s[e](t,i)},vN={on(...s){const{isTargetingSelf:e,target:t,type:i,listener:r}=af(this,s,"on");if(Es(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,Es(this,"on","dispose",n),Es(t,"on","dispose",a)}},one(...s){const{isTargetingSelf:e,target:t,type:i,listener:r}=af(this,s,"one");if(e)Es(t,"one",i,r);else{const n=(...a)=>{this.off(t,i,n),r.apply(null,a)};n.guid=r.guid,Es(t,"one",i,n)}},any(...s){const{isTargetingSelf:e,target:t,type:i,listener:r}=af(this,s,"any");if(e)Es(t,"any",i,r);else{const n=(...a)=>{this.off(t,i,n),r.apply(null,a)};n.guid=r.guid,Es(t,"any",i,n)}},off(s,e,t){if(!s||hg(s))di(this.eventBusEl_,s,e);else{const i=s,r=e;kc(i,this,"off"),F1(r,this,"off"),B1(t,this,"off"),t=_t(this,t),this.off("dispose",t),i.nodeName?(di(i,r,t),di(i,"dispose",t)):bn(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(!hg(t))throw new Error(`Invalid event type for ${Dh(this)}#trigger; must be a non-empty string or object with a type key that has a non-empty value.`);return To(this.eventBusEl_,s,e)}};function Cv(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,vN),s.eventedCallbacks&&s.eventedCallbacks.forEach(i=>{i()}),s.on("dispose",()=>{s.off(),[s,s.el_,s.eventBusEl_].forEach(function(i){i&&Si.has(i)&&Si.delete(i)}),R.setTimeout(()=>{s.eventBusEl_=null},0)}),s}const yN={state:{},setState(s){typeof s=="function"&&(s=s());let e;return Ua(s,(t,i)=>{this.state[i]!==t&&(e=e||{},e[i]={from:this.state[i],to:t}),this.state[i]=t}),e&&bn(this)&&this.trigger({changes:e,type:"statechanged"}),e}};function U1(s,e){return Object.assign(s,yN),s.state=Object.assign({},s.state,e),typeof s.handleStateChanged=="function"&&bn(s)&&s.on("statechanged",s.handleStateChanged),s}const Tl=function(s){return typeof s!="string"?s:s.replace(/./,e=>e.toLowerCase())},Bt=function(s){return typeof s!="string"?s:s.replace(/./,e=>e.toUpperCase())},j1=function(s,e){return Bt(s)===Bt(e)};var _N=Object.freeze({__proto__:null,toLowerCase:Tl,toTitleCase:Bt,titleCaseEquals:j1});let _e=class Di{constructor(e,t,i){if(!e&&this.play?this.player_=e=this:this.player_=e,this.isDisposed_=!1,this.parentComponent_=null,this.options_=ft({},this.options_),t=this.options_=ft(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_${cr()}`}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&&(Cv(this,{eventBusKey:this.el_?"el_":null}),this.handleLanguagechange=this.handleLanguagechange.bind(this),this.on(this.player_,"languagechange",this.handleLanguagechange)),U1(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_=ft(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=Bt(e);const a=t.componentClass||n;t.name=n;const o=Di.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&&Bt(r.name()),n&&(this.childNameIndex_[n]=r,this.childNameIndex_[Tl(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_:_o(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_[Bt(e.name())]=null,this.childNameIndex_[Tl(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=Di.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=Di.getComponent(a.opts.componentClass||Bt(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 Zn(e,t||this.contentEl())}$$(e,t){return P1(e,t||this.contentEl())}hasClass(e){return _l(this.el_,e)}addClass(...e){Us(this.el_,...e)}removeClass(...e){Eh(this.el_,...e)}toggleClass(e,t){S1(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 C1(this.el_,e)}setAttribute(e,t){io(this.el_,e,t)}removeAttribute(e){wh(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"+Bt(e)],10)}currentDimension(e){let t=0;if(e!=="width"&&e!=="height")throw new Error("currentDimension only accepts width or height value");if(t=no(this.el_,e),t=parseFloat(t),t===0||isNaN(t)){const i=`offset${Bt(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=R.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&&R.performance.now()-e<r&&(o.preventDefault(),this.trigger("tap"))})}enableTouchActivity(){if(!this.player()||!this.player().reportUserActivity)return;const e=_t(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=_t(this,e),this.clearTimersOnDispose_(),i=R.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),R.clearTimeout(e)),e}setInterval(e,t){e=_t(this,e),this.clearTimersOnDispose_();const i=R.setInterval(e,t);return this.setIntervalIds_.add(i),i}clearInterval(e){return this.setIntervalIds_.has(e)&&(this.setIntervalIds_.delete(e),R.clearInterval(e)),e}requestAnimationFrame(e){this.clearTimersOnDispose_();var t;return e=_t(this,e),t=R.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=_t(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),R.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=R.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"||R.getComputedStyle(n).height==="0px"||R.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||R.innerWidth)||a.y<0||a.y>(ce.documentElement.clientHeight||R.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=Di.getComponent("Tech"),r=i&&i.isTech(t),n=Di===t||Di.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=Bt(e),Di.components_||(Di.components_={});const a=Di.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 Di.components_[e]=t,Di.components_[Tl(e)]=t,t}static getComponent(e){if(!(!e||!Di.components_))return Di.components_[e]}};_e.registerComponent("Component",_e);function TN(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 Yy(s,e,t,i){return TN(s,i,t.length-1),t[i][e]}function of(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:Yy.bind(null,"start",0,s),end:Yy.bind(null,"end",1,s)},R.Symbol&&R.Symbol.iterator&&(e[R.Symbol.iterator]=()=>(s||[]).values()),e}function Cr(s,e){return Array.isArray(s)?of(s):s===void 0||e===void 0?of():of([[s,e]])}const $1=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 Ev=$1;function q1(s){Ev=s}function H1(){Ev=$1}function Xs(s,e=s){return Ev(s,e)}var bN=Object.freeze({__proto__:null,createTimeRanges:Cr,createTimeRange:Cr,setFormatTime:q1,resetFormatTime:H1,formatTime:Xs});function V1(s,e){let t=0,i,r;if(!e)return 0;(!s||!s.length)&&(s=Cr(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 Nt(s){if(s instanceof Nt)return s;typeof s=="number"?this.code=s:typeof s=="string"?this.message=s:Gr(s)&&(typeof s.code=="number"&&(this.code=s.code),Object.assign(this,s)),this.message||(this.message=Nt.defaultMessages[this.code]||"")}Nt.prototype.code=0;Nt.prototype.message="";Nt.prototype.status=null;Nt.prototype.metadata=null;Nt.errorTypes=["MEDIA_ERR_CUSTOM","MEDIA_ERR_ABORTED","MEDIA_ERR_NETWORK","MEDIA_ERR_DECODE","MEDIA_ERR_SRC_NOT_SUPPORTED","MEDIA_ERR_ENCRYPTED"];Nt.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."};Nt.MEDIA_ERR_CUSTOM=0;Nt.prototype.MEDIA_ERR_CUSTOM=0;Nt.MEDIA_ERR_ABORTED=1;Nt.prototype.MEDIA_ERR_ABORTED=1;Nt.MEDIA_ERR_NETWORK=2;Nt.prototype.MEDIA_ERR_NETWORK=2;Nt.MEDIA_ERR_DECODE=3;Nt.prototype.MEDIA_ERR_DECODE=3;Nt.MEDIA_ERR_SRC_NOT_SUPPORTED=4;Nt.prototype.MEDIA_ERR_SRC_NOT_SUPPORTED=4;Nt.MEDIA_ERR_ENCRYPTED=5;Nt.prototype.MEDIA_ERR_ENCRYPTED=5;function bl(s){return s!=null&&typeof s.then=="function"}function jr(s){bl(s)&&s.then(null,e=>{})}const dg=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}})})},SN=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=dg(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(dg))},xN=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 Jy={textTracksToJson:SN,jsonToTextTracks:xN,trackToJson_:dg};const lf="vjs-modal-dialog";let bo=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:`${lf}-content`},{role:"document"}),this.descEl_=He("p",{className:`${lf}-description vjs-control-text`,id:this.el().getAttribute("aria-describedby")}),rs(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`${lf} 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(),I1(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"),Ah(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 R.HTMLAnchorElement||t instanceof R.HTMLAreaElement)&&t.hasAttribute("href")||(t instanceof R.HTMLInputElement||t instanceof R.HTMLSelectElement||t instanceof R.HTMLTextAreaElement||t instanceof R.HTMLButtonElement)&&!t.hasAttribute("disabled")||t instanceof R.HTMLIFrameElement||t instanceof R.HTMLObjectElement||t instanceof R.HTMLEmbedElement||t.hasAttribute("tabindex")&&t.getAttribute("tabindex")!==-1||t.hasAttribute("contenteditable"))}};bo.prototype.options_={pauseOnOpen:!0,temporary:!0};_e.registerComponent("ModalDialog",bo);let so=class extends Ji{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})},bn(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}};so.prototype.allowedEvents_={change:"change",addtrack:"addtrack",removetrack:"removetrack",labelchange:"labelchange"};for(const s in so.prototype.allowedEvents_)so.prototype["on"+s]=null;const uf=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 CN=class extends so{constructor(e=[]){for(let t=e.length-1;t>=0;t--)if(e[t].enabled){uf(e,e[t]);break}super(e),this.changing_=!1}addTrack(e){e.enabled&&uf(this,e),super.addTrack(e),e.addEventListener&&(e.enabledChange_=()=>{this.changing_||(this.changing_=!0,uf(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 cf=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 EN=class extends so{constructor(e=[]){for(let t=e.length-1;t>=0;t--)if(e[t].selected){cf(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&&cf(this,e),super.addTrack(e),e.addEventListener&&(e.selectedChange_=()=>{this.changing_||(this.changing_=!0,cf(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)}},z1=class extends so{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_))}},wN=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}}},Zy=class W1{constructor(e){W1.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 kN={alternative:"alternative",captions:"captions",main:"main",sign:"sign",subtitles:"subtitles",commentary:"commentary"},AN={alternative:"alternative",descriptions:"descriptions",main:"main","main-desc":"main-desc",translation:"translation",commentary:"commentary"},IN={subtitles:"subtitles",captions:"captions",descriptions:"descriptions",chapters:"chapters",metadata:"metadata"},e_={disabled:"disabled",hidden:"hidden",showing:"showing"};let wv=class extends Ji{constructor(e={}){super();const t={id:e.id||"vjs_track_"+cr(),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 kv=function(s){return new URL(s,ce.baseURI)},G1=function(s){return new URL(s,ce.baseURI).href},Av=function(s){if(typeof s=="string"){const t=/^(\/?)([\s\S]*?)((?:\.{1,2}|[^\/]+?)(\.([^\.\/\?]+)))(?:[\/]*|[\?].*)$/.exec(s);if(t)return t.pop().toLowerCase()}return""},Nh=function(s,e=R.location){return kv(s).origin!==e.origin};var PN=Object.freeze({__proto__:null,parseUrl:kv,getAbsoluteURL:G1,getFileExtension:Av,isCrossOrigin:Nh});const t_=function(s,e){const t=new R.WebVTT.Parser(R,R.vttjs,R.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&&(R.console&&R.console.groupCollapsed&&R.console.groupCollapsed(`Text Track parsing errors for ${e.src}`),i.forEach(r=>Je.error(r)),R.console&&R.console.groupEnd&&R.console.groupEnd()),t.flush()},i_=function(s,e){const t={uri:s},i=Nh(s);i&&(t.cors=i);const r=e.tech_.crossOrigin()==="use-credentials";r&&(t.withCredentials=r),KC(t,_t(this,function(n,a,o){if(n)return Je.error(n,a);e.loaded_=!0,typeof R.WebVTT!="function"?e.tech_&&e.tech_.any(["vttjsloaded","vttjserror"],l=>{if(l.type==="vttjserror"){Je.error(`vttjs failed to load, stopping trying to process ${e.src}`);return}return t_(o,e)}):t_(o,e)}))};let ql=class extends wv{constructor(e={}){if(!e.tech)throw new Error("A tech was not provided.");const t=ft(e,{kind:IN[e.kind]||"subtitles",language:e.language||e.srclang||""});let i=e_[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 Zy(this.cues_),a=new Zy(this.activeCues_);let o=!1;this.timeupdateHandler=_t(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){e_[u]&&i!==u&&(i=u,!this.preload_&&i!=="disabled"&&this.cues.length===0&&i_(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")&&i_(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 R.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}}}};ql.prototype.allowedEvents_={cuechange:"cuechange"};let K1=class extends wv{constructor(e={}){const t=ft(e,{kind:AN[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}},X1=class extends wv{constructor(e={}){const t=ft(e,{kind:kN[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)}},So=class fg extends Ji{constructor(e={}){super();let t;const i=new ql(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=fg.NONE,i.addEventListener("loadeddata",()=>{t=fg.LOADED,this.trigger({type:"load",target:this})})}};So.prototype.allowedEvents_={load:"load"};So.NONE=0;So.LOADING=1;So.LOADED=2;So.ERROR=3;const lr={audio:{ListClass:CN,TrackClass:K1,capitalName:"Audio"},video:{ListClass:EN,TrackClass:X1,capitalName:"Video"},text:{ListClass:z1,TrackClass:ql,capitalName:"Text"}};Object.keys(lr).forEach(function(s){lr[s].getterName=`${s}Tracks`,lr[s].privateName=`${s}Tracks_`});const ao={remoteText:{ListClass:z1,TrackClass:ql,capitalName:"RemoteText",getterName:"remoteTextTracks",privateName:"remoteTextTracks_"},remoteTextEl:{ListClass:wN,TrackClass:So,capitalName:"RemoteTextTrackEls",getterName:"remoteTextTrackEls",privateName:"remoteTextTrackEls_"}},Ti=Object.assign({},lr,ao);ao.names=Object.keys(ao);lr.names=Object.keys(lr);Ti.names=[].concat(ao.names).concat(lr.names);function DN(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 Ti.text.TrackClass(r);return n.addTrack(a),a}let pt=class ui 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}),Ti.names.forEach(i=>{const r=Ti[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 Ti.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(_t(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 Cr(0,0)}bufferedPercent(){return V1(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(lr.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 Nt(e),this.trigger("error")),this.error_}played(){return this.hasStarted_?Cr(0,0):Cr()}play(){}setScrubbing(e){}scrubbing(){}setCurrentTime(e){this.manualTimeUpdates&&this.trigger({type:"timeupdate",target:this,manuallyTriggered:!0})}initTrackListeners(){lr.names.forEach(e=>{const t=lr[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(!R.WebVTT)if(ce.body.contains(this.el())){if(!this.options_["vtt.js"]&&to(Qa)&&Object.keys(Qa).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}),R.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 DN(this,e,t,i)}createRemoteTextTrack(e){const t=ft(e,{tech:this});return new ao.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=cr();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 ui.canPlayType(e.type)}static isTech(e){return e.prototype instanceof ui||e instanceof ui||e===ui}static registerTech(e,t){if(ui.techs_||(ui.techs_={}),!ui.isTech(t))throw new Error(`Tech ${e} must be a Tech`);if(!ui.canPlayType)throw new Error("Techs must have a static canPlayType method on them");if(!ui.canPlaySource)throw new Error("Techs must have a static canPlaySource method on them");return e=Bt(e),ui.techs_[e]=t,ui.techs_[Tl(e)]=t,e!=="Tech"&&ui.defaultTechOrder_.push(e),t}static getTech(e){if(e){if(ui.techs_&&ui.techs_[e])return ui.techs_[e];if(e=Bt(e),R&&R.videojs&&R.videojs[e])return Je.warn(`The ${e} tech was added to the videojs object when it should be registered using videojs.registerTech(name, tech)`),R.videojs[e]}}};Ti.names.forEach(function(s){const e=Ti[s];pt.prototype[e.getterName]=function(){return this[e.privateName]=this[e.privateName]||new e.ListClass,this[e.privateName]}});pt.prototype.featuresVolumeControl=!0;pt.prototype.featuresMuteControl=!0;pt.prototype.featuresFullscreenResize=!1;pt.prototype.featuresPlaybackRate=!1;pt.prototype.featuresProgressEvents=!1;pt.prototype.featuresSourceset=!1;pt.prototype.featuresTimeupdateEvents=!1;pt.prototype.featuresNativeTextTracks=!1;pt.prototype.featuresVideoFrameCallback=!1;pt.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:Je.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",pt);pt.registerTech("Tech",pt);pt.defaultTechOrder_=[];const js={},Ac={},Ic={};function NN(s,e){js[s]=js[s]||[],js[s].push(e)}function LN(s,e,t){s.setTimeout(()=>ks(e,js[e.type],t,s),1)}function ON(s,e){s.forEach(t=>t.setTech&&t.setTech(e))}function RN(s,e,t){return s.reduceRight(Iv(t),e[t]())}function MN(s,e,t,i){return e[t](s.reduce(Iv(t),i))}function r_(s,e,t,i=null){const r="call"+Bt(t),n=s.reduce(Iv(r),i),a=n===Ic,o=a?null:e[t](n);return UN(s,t,o,a),o}const FN={buffered:1,currentTime:1,duration:1,muted:1,played:1,paused:1,seekable:1,volume:1,ended:1},BN={setCurrentTime:1,setMuted:1,setVolume:1},n_={play:1,pause:1};function Iv(s){return(e,t)=>e===Ic?Ic:t[s]?t[s](e):e}function UN(s,e,t,i){for(let r=s.length-1;r>=0;r--){const n=s[r];n[e]&&n[e](i,t)}}function jN(s){Ac.hasOwnProperty(s.id())&&delete Ac[s.id()]}function $N(s,e){const t=Ac[s.id()];let i=null;if(t==null)return i=e(s),Ac[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 ks(s={},e=[],t,i,r=[],n=!1){const[a,...o]=e;if(typeof a=="string")ks(s,js[a],t,i,r,n);else if(a){const l=$N(i,a);if(!l.setSource)return r.push(l),ks(s,o,t,i,r,n);l.setSource(Object.assign({},s),function(u,c){if(u)return ks(s,o,t,i,r,n);r.push(l),ks(c,s.type===c.type?o:js[c.type],t,i,r,n)})}else o.length?ks(s,o,t,i,r,n):n?t(s,r):ks(s,js["*"],t,i,r,!0)}const qN={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"},Pc=function(s=""){const e=Av(s);return qN[e.toLowerCase()]||""},HN=(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 Pc(e)},Q1=function(s){if(Array.isArray(s)){let e=[];s.forEach(function(t){t=Q1(t),Array.isArray(t)?e=e.concat(t):Gr(t)&&e.push(t)}),s=e}else typeof s=="string"&&s.trim()?s=[s_({src:s})]:Gr(s)&&typeof s.src=="string"&&s.src&&s.src.trim()?s=[s_(s)]:s=[];return s};function s_(s){if(!s.type){const e=Pc(s.src);e&&(s.type=e)}return s}var VN=`<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 a_=Cc?10009:Ec?461:8,xa={codes:{play:415,pause:19,ff:417,rw:412,back:a_},names:{415:"play",19:"pause",417:"ff",412:"rw",[a_]:"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}},o_=5;class zN extends Ji{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(xa.isEventKey(t,"play")||xa.isEventKey(t,"pause")||xa.isEventKey(t,"ff")||xa.isEventKey(t,"rw")){t.preventDefault();const i=xa.getEventName(t);this.performMediaAction_(i)}else xa.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()+o_);break;case"rw":this.userSeek_(this.player_.currentTime()-o_);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 WN=class extends _e{constructor(e,t,i){const r=ft({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=Bt(a[n]);let l=pt.getTech(o);if(o||(l=_e.getComponent(o)),l&&l.isSupported()){e.loadTech_(o);break}}else e.src(t.playerOptions.sources)}};_e.registerComponent("MediaLoader",WN);let Lh=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"&&Je.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,rs(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",Lh);let pg=class extends Lh{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()?jr(this.player_.play()):this.player_.pause())}};pg.prototype.crossorigin=pg.prototype.crossOrigin;_e.registerComponent("PosterImage",pg);const sr="#222",l_="#ccc",GN={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 hf(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 Rr(s,e,t){try{s.style[e]=t}catch{return}}function u_(s){return s?`${s}px`:""}let KN=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(_t(this,function(){if(e.tech_&&e.tech_.featuresNativeTextTracks){this.hide();return}e.on("fullscreenchange",n),e.on("playerresize",n);const a=R.screen.orientation||R,o=R.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 R.WebVTT=="function"&&R.WebVTT.processCues(R,[],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)),!R.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="",Rr(a,"position","relative"),Rr(a,"height",u-l+"px"),Rr(a,"top","unset"),wc?Rr(a,"bottom",u+"px"):Rr(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()||!R.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)),Rr(this.el_,"insetInline",u_(n)),Rr(this.el_,"insetBlock",u_(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&&Rr(a.firstChild,"color",hf(t.color||"#fff",t.textOpacity)),t.backgroundColor&&(a.firstChild.style.backgroundColor=t.backgroundColor),t.backgroundOpacity&&Rr(a.firstChild,"backgroundColor",hf(t.backgroundColor||"#000",t.backgroundOpacity)),t.windowColor&&(t.windowOpacity?Rr(a,"backgroundColor",hf(t.windowColor,t.windowOpacity)):a.style.backgroundColor=t.windowColor),t.edgeStyle&&(t.edgeStyle==="dropshadow"?a.firstChild.style.textShadow=`2px 2px 3px ${sr}, 2px 2px 4px ${sr}, 2px 2px 5px ${sr}`:t.edgeStyle==="raised"?a.firstChild.style.textShadow=`1px 1px ${sr}, 2px 2px ${sr}, 3px 3px ${sr}`:t.edgeStyle==="depressed"?a.firstChild.style.textShadow=`1px 1px ${l_}, 0 1px ${l_}, -1px -1px ${sr}, 0 -1px ${sr}`:t.edgeStyle==="uniform"&&(a.firstChild.style.textShadow=`0 0 4px ${sr}, 0 0 4px ${sr}, 0 0 4px ${sr}, 0 0 4px ${sr}`)),t.fontPercent&&t.fontPercent!==1){const o=R.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=GN[t.fontFamily])}}updateForTrack(e){if(Array.isArray(e)||(e=[e]),typeof R.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])}R.WebVTT.processCues(R,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;Us(a,"vjs-text-track-cue","vjs-text-track-cue-"+(r.language?r.language:i)),r.language&&io(a,"lang",r.language)}this.player_.textTrackSettings&&this.updateDisplayState(r)}}};_e.registerComponent("TextTrackDisplay",KN);let XN=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",XN);let fi=class extends Lh{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 Je.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",fi);let Y1=class extends fi{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){jr(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}};Y1.prototype.controlText_="Play Video";_e.registerComponent("BigPlayButton",Y1);let QN=class extends fi{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",QN);let J1=class extends fi{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()?jr(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))}};J1.prototype.controlText_="Play";_e.registerComponent("PlayToggle",J1);let xo=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=Xs(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,Je.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){}};xo.prototype.labelText_="Time";xo.prototype.controlText_="Time";_e.registerComponent("TimeDisplay",xo);let Pv=class extends xo{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)}};Pv.prototype.labelText_="Current Time";Pv.prototype.controlText_="Current Time";_e.registerComponent("CurrentTimeDisplay",Pv);let Dv=class extends xo{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)}};Dv.prototype.labelText_="Duration";Dv.prototype.controlText_="Duration";_e.registerComponent("DurationDisplay",Dv);let YN=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",YN);let Nv=class extends xo{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)}};Nv.prototype.labelText_="Remaining Time";Nv.prototype.controlText_="Remaining Time";_e.registerComponent("RemainingTimeDisplay",Nv);let JN=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",JN);let Z1=class extends fi{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()}};Z1.prototype.controlText_="Seek to live, currently playing live";_e.registerComponent("SeekToLive",Z1);function Hl(s,e,t){return s=Number(s),Math.min(t,Math.max(e,isNaN(s)?e:s))}var ZN=Object.freeze({__proto__:null,clamp:Hl});let Lv=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"&&!Xr&&e.preventDefault(),E1(),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;w1(),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(Hl(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",Lv);const df=(s,e)=>Hl(s/e*100,0,100).toFixed(2)+"%";let eL=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=df(n,r);this.percent_!==o&&(this.el_.style.width=o,rs(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=df(u,n),h.style.width=df(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",eL);let tL=class extends _e{constructor(e,t){super(e,t),this.update=Qr(_t(this,this.update),hr)}createEl(){return super.createEl("div",{className:"vjs-time-tooltip"},{"aria-hidden":"true"})}update(e,t,i){const r=Pl(this.el_),n=ro(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){rs(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?"":"-")+Xs(l,o)}else n=Xs(i,a);this.update(e,t,n),r&&r()})}};_e.registerComponent("TimeTooltip",tL);let Ov=class extends _e{constructor(e,t){super(e,t),this.setIcon("circle"),this.update=Qr(_t(this,this.update),hr)}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)}};Ov.prototype.options_={children:[]};!wi&&!Kr&&Ov.prototype.options_.children.push("timeTooltip");_e.registerComponent("PlayProgressBar",Ov);let eE=class extends _e{constructor(e,t){super(e,t),this.update=Qr(_t(this,this.update),hr)}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`})}};eE.prototype.options_={children:["timeTooltip"]};_e.registerComponent("MouseTimeDisplay",eE);const Fu=5,c_=12;let Rv=class extends Lv{constructor(e,t){super(e,t),this.setEventHandlers_()}setEventHandlers_(){this.update_=_t(this,this.update),this.update=Qr(this.update_,hr),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,hr))}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}",[Xs(i,n),Xs(n,n)],"{1} of {2}")),this.currentTime_=i,this.duration_=n),this.bar&&this.bar.update(ro(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){Dl(e)&&(e.stopPropagation(),this.videoWasPlaying=!this.player_.paused(),this.player_.pause(),super.handleMouseDown(e))}handleMouseMove(e,t=!1){if(!Dl(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?jr(this.player_.play()):this.update_()}stepForward(){this.userSeek_(this.player_.currentTime()+Fu)}stepBack(){this.userSeek_(this.player_.currentTime()-Fu)}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()-Fu*c_)):e.key==="PageUp"?(e.preventDefault(),e.stopPropagation(),this.userSeek_(this.player_.currentTime()+Fu*c_)):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()}};Rv.prototype.options_={children:["loadProgressBar","playProgressBar"],barName:"playProgressBar"};!wi&&!Kr&&Rv.prototype.options_.children.splice(1,0,"mouseTimeDisplay");_e.registerComponent("SeekBar",Rv);let tE=class extends _e{constructor(e,t){super(e,t),this.handleMouseMove=Qr(_t(this,this.handleMouseMove),hr),this.throttledHandleMouseSeek=Qr(_t(this,this.handleMouseSeek),hr),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=Pl(n);let o=kh(n,e).x;o=Hl(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&&jr(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()}};tE.prototype.options_={children:["seekBar"]};_e.registerComponent("ProgressControl",tE);let iE=class extends fi{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 R?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()}};iE.prototype.controlText_="Picture-in-Picture";_e.registerComponent("PictureInPictureToggle",iE);let rE=class extends fi{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()}};rE.prototype.controlText_="Fullscreen";_e.registerComponent("FullscreenToggle",rE);const iL=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 rL=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",rL);let nL=class extends _e{constructor(e,t){super(e,t),this.update=Qr(_t(this,this.update),hr)}createEl(){return super.createEl("div",{className:"vjs-volume-tooltip"},{"aria-hidden":"true"})}update(e,t,i,r){if(!i){const n=ro(this.el_),a=ro(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){rs(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",nL);let nE=class extends _e{constructor(e,t){super(e,t),this.update=Qr(_t(this,this.update),hr)}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`})}};nE.prototype.options_={children:["volumeLevelTooltip"]};_e.registerComponent("MouseVolumeLevelDisplay",nE);let Oh=class extends Lv{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){Dl(e)&&super.handleMouseDown(e)}handleMouseMove(e){const t=this.getChild("mouseVolumeLevelDisplay");if(t){const i=this.el(),r=ro(i),n=this.vertical();let a=kh(i,e);a=n?a.y:a.x,a=Hl(a,0,1),t.update(r,a,n)}Dl(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)})}};Oh.prototype.options_={children:["volumeLevel"],barName:"volumeLevel"};!wi&&!Kr&&Oh.prototype.options_.children.splice(0,0,"mouseVolumeLevelDisplay");Oh.prototype.playerEvent="volumechange";_e.registerComponent("VolumeBar",Oh);let sE=class extends _e{constructor(e,t={}){t.vertical=t.vertical||!1,(typeof t.volumeBar>"u"||to(t.volumeBar))&&(t.volumeBar=t.volumeBar||{},t.volumeBar.vertical=t.vertical),super(e,t),iL(this,e),this.throttledHandleMouseMove=Qr(_t(this,this.handleMouseMove),hr),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)}};sE.prototype.options_={children:["volumeBar"]};_e.registerComponent("VolumeControl",sE);const sL=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 aE=class extends fi{constructor(e,t){super(e,t),sL(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"),wi&&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),Eh(this.el_,[0,1,2,3].reduce((i,r)=>i+`${r?" ":""}vjs-vol-${r}`,"")),Us(this.el_,`vjs-vol-${t}`)}updateControlText_(){const t=this.player_.muted()||this.player_.volume()===0?"Unmute":"Mute";this.controlText()!==t&&this.controlText(t)}};aE.prototype.controlText_="Mute";_e.registerComponent("MuteToggle",aE);let oE=class extends _e{constructor(e,t={}){typeof t.inline<"u"?t.inline=t.inline:t.inline=!0,(typeof t.volumeControl>"u"||to(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"),Yi(ce,"keyup",this.handleKeyPressHandler_)}handleMouseOut(e){this.removeClass("vjs-hover"),di(ce,"keyup",this.handleKeyPressHandler_)}handleKeyPress(e){e.key==="Escape"&&this.handleMouseOut()}};oE.prototype.options_={children:["muteToggle","volumeControl"]};_e.registerComponent("VolumePanel",oE);class lE extends fi{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]))}}lE.prototype.controlText_="Skip Forward";_e.registerComponent("SkipForward",lE);class uE extends fi{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]))}}uE.prototype.controlText_="Skip Backward";_e.registerComponent("SkipBackward",uE);let cE=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_),Yi(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",cE);let Mv=class extends _e{constructor(e,t={}){super(e,t),this.menuButton_=new fi(e,t),this.menuButton_.controlText(this.controlText_),this.menuButton_.el_.setAttribute("aria-haspopup","true");const i=fi.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(),Yi(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 cE(this.player_,{menuButton:this});if(this.hideThreshold_=0,this.options_.title){const t=He("li",{className:"vjs-menu-title",textContent:Bt(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=fi.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"),di(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"),wi&&T1())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",Mv);let Fv=class extends Mv{constructor(e,t){const i=t.tracks;if(super(e,t),this.items.length<=1&&this.hide(),!i)return;const r=_t(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",Fv);let Vl=class extends Lh{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",Vl);let zl=class extends Vl{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 R.Event!="object")try{o=new R.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",zl);let hE=class extends zl{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",hE);let Co=class extends Fv{constructor(e,t={}){t.tracks=e.textTracks(),super(e,t)}createItems(e=[],t=zl){let i;this.label_&&(i=`${this.label_} off`),e.push(new hE(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",Co);let dE=class extends Vl{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",dE);let Bv=class extends Co{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(Bt(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 dE(this.player_,{track:this.track_,cue:n});e.push(a)}return e}};Bv.prototype.kind_="chapters";Bv.prototype.controlText_="Chapters";_e.registerComponent("ChaptersButton",Bv);let Uv=class extends Co{constructor(e,t,i){super(e,t,i),this.setIcon("audio-description");const r=e.textTracks(),n=_t(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()}`}};Uv.prototype.kind_="descriptions";Uv.prototype.controlText_="Descriptions";_e.registerComponent("DescriptionsButton",Uv);let jv=class extends Co{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()}`}};jv.prototype.kind_="subtitles";jv.prototype.controlText_="Subtitles";_e.registerComponent("SubtitlesButton",jv);let $v=class extends zl{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",$v);let qv=class extends Co{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 $v(this.player_,{kind:this.kind_})),this.hideThreshold_+=1),super.createItems(e)}};qv.prototype.kind_="captions";qv.prototype.controlText_="Captions";_e.registerComponent("CaptionsButton",qv);let fE=class extends zl{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",fE);let Hv=class extends Co{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(Bt(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 $v(this.player_,{kind:this.label_})),this.hideThreshold_+=1),e=super.createItems(e,fE),e}};Hv.prototype.kinds_=["captions","subtitles"];Hv.prototype.controlText_="Subtitles";_e.registerComponent("SubsCapsButton",Hv);let pE=class extends Vl{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",pE);let mE=class extends Fv{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 pE(this.player_,{track:r,selectable:!0,multiSelectable:!1}))}return e}};mE.prototype.controlText_="Audio Track";_e.registerComponent("AudioTrackButton",mE);let Vv=class extends Vl{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)}};Vv.prototype.contentElType="button";_e.registerComponent("PlaybackRateMenuItem",Vv);let gE=class extends Mv{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 Vv(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")}};gE.prototype.controlText_="Playback Rate";_e.registerComponent("PlaybackRateMenuButton",gE);let vE=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",vE);let aL=class extends vE{buildCSSClass(){return`vjs-custom-control-spacer ${super.buildCSSClass()}`}createEl(){return super.createEl("div",{className:this.buildCSSClass(),textContent:" "})}};_e.registerComponent("CustomControlSpacer",aL);let yE=class extends _e{createEl(){return super.createEl("div",{className:"vjs-control-bar",dir:"ltr"})}};yE.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",yE);let _E=class extends bo{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):""}};_E.prototype.options_=Object.assign({},bo.prototype.options_,{pauseOnOpen:!1,fillAlways:!0,temporary:!1,uncloseable:!0});_e.registerComponent("ErrorDisplay",_E);class TE 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-${cr()}`)+"-"+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",TE);class $s 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_${cr()}`;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 TE(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",$s);class bE extends _e{constructor(e,t={}){super(e,t);const i=this.options_.textTrackComponentid,r=new $s(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 $s(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 $s(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",bE);class SE extends _e{constructor(e,t={}){super(e,t);const i=this.options_.textTrackComponentid,r=new $s(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 $s(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 $s(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",SE);class xE extends _e{constructor(e,t={}){super(e,t);const i=this.localize("restore all settings to the default values"),r=new fi(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 fi(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",xE);const ff="vjs-text-track-settings",h_=["#000","Black"],d_=["#00F","Blue"],f_=["#0FF","Cyan"],p_=["#0F0","Green"],m_=["#F0F","Magenta"],g_=["#F00","Red"],v_=["#FFF","White"],y_=["#FF0","Yellow"],pf=["1","Opaque"],mf=["0.5","Semi-Transparent"],__=["0","Transparent"],Yn={backgroundColor:{selector:".vjs-bg-color > select",id:"captions-background-color-%s",label:"Color",options:[h_,v_,g_,p_,d_,y_,m_,f_],className:"vjs-bg-color"},backgroundOpacity:{selector:".vjs-bg-opacity > select",id:"captions-background-opacity-%s",label:"Opacity",options:[pf,mf,__],className:"vjs-bg-opacity vjs-opacity"},color:{selector:".vjs-text-color > select",id:"captions-foreground-color-%s",label:"Color",options:[v_,h_,g_,p_,d_,y_,m_,f_],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:[pf,mf],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:[__,mf,pf],className:"vjs-window-opacity vjs-opacity"}};Yn.windowColor.options=Yn.backgroundColor.options;function CE(s,e){if(e&&(s=e(s)),s&&s!=="none")return s}function oL(s,e){const t=s.options[s.options.selectedIndex].value;return CE(t,e)}function lL(s,e,t){if(e){for(let i=0;i<s.options.length;i++)if(CE(s.options[i].value,t)===e){s.selectedIndex=i;break}}}let uL=class extends bo{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 bE(e,{textTrackComponentid:this.id_,selectConfigs:Yn,fieldSets:[["color","textOpacity"],["backgroundColor","backgroundOpacity"],["windowColor","windowOpacity"]]});this.addChild(t);const i=new SE(e,{textTrackComponentid:this.id_,selectConfigs:Yn,fieldSets:[["fontPercent"],["edgeStyle"],["fontFamily"]]});this.addChild(i);const r=new xE(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()}),Ua(Yn,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 f1(Yn,(e,t,i)=>{const r=oL(this.$(t.selector),t.parser);return r!==void 0&&(e[i]=r),e},{})}setValues(e){Ua(Yn,(t,i)=>{lL(this.$(t.selector),e[i],t.parser)})}setDefaults(){Ua(Yn,e=>{const t=e.hasOwnProperty("default")?e.default:0;this.$(e.selector).selectedIndex=t})}restoreSettings(){let e;try{e=JSON.parse(R.localStorage.getItem(ff))}catch(t){Je.warn(t)}e&&this.setValues(e)}saveSettings(){if(!this.options_.persistTextTrackSettings)return;const e=this.getValues();try{Object.keys(e).length?R.localStorage.setItem(ff,JSON.stringify(e)):R.localStorage.removeItem(ff)}catch(t){Je.warn(t)}}updateDisplay(){const e=this.player_.getChild("textTrackDisplay");e&&e.updateDisplay()}handleLanguagechange(){this.fill(),this.renderModalComponents(this.player_),this.bindFunctionsToSelectsAndButtons()}};_e.registerComponent("TextTrackSettings",uL);let cL=class extends _e{constructor(e,t){let i=t.ResizeObserver||R.ResizeObserver;t.ResizeObserver===null&&(i=!1);const r=ft({createEl:!i,reportTouchActivity:!1},t);super(e,r),this.ResizeObserver=t.ResizeObserver||R.ResizeObserver,this.loadListener_=null,this.resizeObserver_=null,this.debouncedHandler_=M1(()=>{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(){di(this,"resize",n),di(this,"unload",a),a=null};Yi(this.el_.contentWindow,"unload",a),Yi(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",cL);const hL={trackingThreshold:20,liveTolerance:15};let dL=class extends _e{constructor(e,t){const i=ft(hL,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(R.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_,hr),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",dL);class fL 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-${cr()}`}),description:He("div",{className:"vjs-title-bar-description",id:`vjs-title-bar-description-${cr()}`})},He("div",{className:"vjs-title-bar"},{},p1(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];Ah(a),n&&rs(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",fL);const pL={initialDisplay:4e3,position:[],takeFocus:!1};class mL extends fi{constructor(e,t){t=ft(pL,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",mL);const mg=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},gL=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="",R.Element.prototype.appendChild.call(this,t),this.innerHTML}}),EE=(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},vL=s=>EE([s.el(),R.HTMLMediaElement.prototype,R.Element.prototype,gL],"innerHTML"),T_=function(s){const e=s.el();if(e.resetSourceWatch_)return;const t={},i=vL(s),r=n=>(...a)=>{const o=n.apply(e,a);return mg(s),o};["append","appendChild","insertAdjacentHTML"].forEach(n=>{e[n]&&(t[n]=e[n],e[n]=r(t[n]))}),Object.defineProperty(e,"innerHTML",ft(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_)},yL=Object.defineProperty({},"src",{get(){return this.hasAttribute("src")?G1(R.Element.prototype.getAttribute.call(this,"src")):""},set(s){return R.Element.prototype.setAttribute.call(this,"src",s),s}}),_L=s=>EE([s.el(),R.HTMLMediaElement.prototype,yL],"src"),TL=function(s){if(!s.featuresSourceset)return;const e=s.el();if(e.resetSourceset_)return;const t=_L(s),i=e.setAttribute,r=e.load;Object.defineProperty(e,"src",ft(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 mg(s)||(s.triggerSourceset(""),T_(s)),n},e.currentSrc?s.triggerSourceset(e.currentSrc):mg(s)||T_(s),e.resetSourceset_=()=>{e.resetSourceset_=null,e.load=r,e.setAttribute=i,Object.defineProperty(e,"src",t),e.resetSourceWatch_&&e.resetSourceWatch_()}};let Ne=class ac extends pt{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")&&Nh(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&&Je.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_(),(Il||xh)&&e.nativeControlsForTouch===!0&&this.setControls(!0),this.proxyWebkitFullscreen_(),this.triggerReady()}dispose(){this.el_&&this.el_.resetSourceset_&&this.el_.resetSourceset_(),ac.disposeMediaElement(this.el_),this.options_=null,super.dispose()}setupSourcesetHandling_(){TL(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=lr[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[ao.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_(){lr.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),ac.disposeMediaElement(e),e=i}else{e=ce.createElement("video");const i=this.options_.tag&&Qn(this.options_.tag),r=ft({},i);(!Il||this.options_.nativeControlsForTouch!==!0)&&delete r.controls,x1(e,Object.assign(r,{id:this.options_.techId,class:"vjs-tech"}))}e.playerId=this.options_.playerId}typeof this.options_.preload<"u"&&io(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?io(e,r,r):wh(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&&Ch?this.el_.fastSeek(e):this.el_.currentTime=e}catch(t){Je(t,"Video is not ready. (Video.js)")}}duration(){if(this.el_.duration===1/0&&Kr&&Xr&&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)jr(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 Je.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 Je.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 Je.warn(`No matching source element found with src: ${e}`),!1}reset(){ac.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),R.performance&&(e.creationTime=R.performance.now()),e}};Th(Ne,"TEST_VID",function(){if(!yo())return;const s=ce.createElement("video"),e=ce.createElement("track");return e.kind="captions",e.srclang="en",e.label="English",s.appendChild(e),s});Ne.isSupported=function(){try{Ne.TEST_VID.volume=.5}catch{return!1}return!!(Ne.TEST_VID&&Ne.TEST_VID.canPlayType)};Ne.canPlayType=function(s){return Ne.TEST_VID.canPlayType(s)};Ne.canPlaySource=function(s,e){return Ne.canPlayType(s.type)};Ne.canControlVolume=function(){try{const s=Ne.TEST_VID.volume;Ne.TEST_VID.volume=s/2+.1;const e=s!==Ne.TEST_VID.volume;return e&&wi?(R.setTimeout(()=>{Ne&&Ne.prototype&&(Ne.prototype.featuresVolumeControl=s!==Ne.TEST_VID.volume)}),!1):e}catch{return!1}};Ne.canMuteVolume=function(){try{const s=Ne.TEST_VID.muted;return Ne.TEST_VID.muted=!s,Ne.TEST_VID.muted?io(Ne.TEST_VID,"muted","muted"):wh(Ne.TEST_VID,"muted","muted"),s!==Ne.TEST_VID.muted}catch{return!1}};Ne.canControlPlaybackRate=function(){if(Kr&&Xr&&bh<58)return!1;try{const s=Ne.TEST_VID.playbackRate;return Ne.TEST_VID.playbackRate=s/2+.1,s!==Ne.TEST_VID.playbackRate}catch{return!1}};Ne.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};Ne.supportsNativeTextTracks=function(){return Ch||wi&&Xr};Ne.supportsNativeVideoTracks=function(){return!!(Ne.TEST_VID&&Ne.TEST_VID.videoTracks)};Ne.supportsNativeAudioTracks=function(){return!!(Ne.TEST_VID&&Ne.TEST_VID.audioTracks)};Ne.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]){Th(Ne.prototype,s,()=>Ne[e](),!0)});Ne.prototype.featuresVolumeControl=Ne.canControlVolume();Ne.prototype.movingMediaElementInDOM=!wi;Ne.prototype.featuresFullscreenResize=!0;Ne.prototype.featuresProgressEvents=!0;Ne.prototype.featuresTimeupdateEvents=!0;Ne.prototype.featuresVideoFrameCallback=!!(Ne.TEST_VID&&Ne.TEST_VID.requestVideoFrameCallback);Ne.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{}}()}};Ne.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){Ne.prototype[s]=function(){return this.el_[s]||this.el_.hasAttribute(s)}});["muted","defaultMuted","autoplay","loop","playsinline"].forEach(function(s){Ne.prototype["set"+Bt(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){Ne.prototype[s]=function(){return this.el_[s]}});["volume","src","poster","preload","playbackRate","defaultPlaybackRate","disablePictureInPicture","crossOrigin"].forEach(function(s){Ne.prototype["set"+Bt(s)]=function(e){this.el_[s]=e}});["pause","load","play"].forEach(function(s){Ne.prototype[s]=function(){return this.el_[s]()}});pt.withSourceHandlers(Ne);Ne.nativeSourceHandler={};Ne.nativeSourceHandler.canPlayType=function(s){try{return Ne.TEST_VID.canPlayType(s)}catch{return""}};Ne.nativeSourceHandler.canHandleSource=function(s,e){if(s.type)return Ne.nativeSourceHandler.canPlayType(s.type);if(s.src){const t=Av(s.src);return Ne.nativeSourceHandler.canPlayType(`video/${t}`)}return""};Ne.nativeSourceHandler.handleSource=function(s,e,t){e.setSrc(s.src)};Ne.nativeSourceHandler.dispose=function(){};Ne.registerSourceHandler(Ne.nativeSourceHandler);pt.registerTech("Html5",Ne);const wE=["progress","abort","suspend","emptied","stalled","loadedmetadata","loadeddata","timeupdate","resize","volumechange","texttrackchange"],gf={canplay:"CanPlay",canplaythrough:"CanPlayThrough",playing:"Playing",seeked:"Seeked"},gg=["tiny","xsmall","small","medium","large","xlarge","huge"],oc={};gg.forEach(s=>{const e=s.charAt(0)==="x"?`x-${s.substring(1)}`:s;oc[s]=`vjs-layout-${e}`});const bL={tiny:210,xsmall:320,small:425,medium:768,large:1440,xlarge:2560,huge:1/0};let zt=class Da extends _e{constructor(e,t,i){if(e.id=e.id||t.id||`vjs_video_${cr()}`,t=Object.assign(Da.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=h1(this.id_),this.fsApi_=bc,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&&Qn(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_=Da.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(),Cv(this,{eventBusKey:"el_"}),this.fsApi_.requestFullscreen&&(Yi(ce,this.fsApi_.fullscreenchange,this.boundDocumentFullscreenChange_),this.on(this.fsApi_.fullscreenchange,this.boundDocumentFullscreenChange_)),this.fluid_&&this.on(["playerreset","resize"],this.boundUpdateStyleEl_);const r=ft(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 R.DOMParser().parseFromString(VN,"image/svg+xml");if(o.querySelector("parsererror"))Je.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 zN(this),this.addClass("vjs-spatial-navigation-enabled")),Il&&this.addClass("vjs-touch-enabled"),wi||this.addClass("vjs-workinghover"),Da.players[this.id_]=this;const n=sg.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"),di(ce,this.fsApi_.fullscreenchange,this.boundDocumentFullscreenChange_),di(ce,"keydown",this.boundFullWindowOnEscKey_),this.styleEl_&&this.styleEl_.parentNode&&(this.styleEl_.parentNode.removeChild(this.styleEl_),this.styleEl_=null),Da.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),jN(this),Ti.names.forEach(e=>{const t=Ti[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=Qn(e);if(r){for(t=this.el_=e,e=this.tag=ce.createElement("video");t.children.length;)e.appendChild(t.firstChild);_l(t,"video-js")||Us(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",Xr&&Sh&&(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=>_1[l]).map(l=>"vjs-device-"+l.substring(3).toLowerCase().replace(/\_/g,"-"));if(this.addClass(...a),R.VIDEOJS_NO_DYNAMIC_STYLE!==!0){this.styleEl_=O1("vjs-styles-dimensions");const l=Zn(".vjs-styles-defaults"),u=Zn("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);Us(u,"vjs-hidden"),u.setAttribute("hidden","hidden")}return e.initNetworkState_=e.networkState,e.parentNode&&!i&&e.parentNode.insertBefore(t,e),og(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"){Je.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)){Je.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,bn(this)&&this.off(["playerreset","resize"],this.boundUpdateStyleEl_),e?(this.addClass("vjs-fluid"),this.fill(!1),gN(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(R.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),R1(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=Bt(e),r=e.charAt(0).toLowerCase()+e.slice(1);i!=="Html5"&&this.tag&&(pt.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};Ti.names.forEach(l=>{const u=Ti[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=pt.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(_t(this,this.handleTechReady_),!0),Jy.jsonToTextTracks(this.textTracksJson_||[],this.tech_),wE.forEach(l=>{this.on(this.tech_,l,u=>this[`handleTech${Bt(l)}_`](u))}),Object.keys(gf).forEach(l=>{this.on(this.tech_,l,u=>{if(this.tech_.playbackRate()===0&&this.tech_.seeking()){this.queuedCallbacks_.push({callback:this[`handleTech${gf[l]}_`].bind(this),event:u});return}this[`handleTech${gf[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)&&og(this.tech_.el(),this.el()),this.tag&&(this.tag.player=null,this.tag=null)}unloadTech_(){Ti.names.forEach(e=>{const t=Ti[e];this[t.privateName]=this[t.getterName]()}),this.textTracksJson_=Jy.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&&Je.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":sg}}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=HN(this,t)),this.cache_.source=ft({},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=Qn(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()?jr(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 BN)return MN(this.middleware_,this.tech_,e,t);if(e in n_)return r_(this.middleware_,this.tech_,e,t);try{this.tech_&&this.tech_[e](t)}catch(i){throw Je(i),i}},!0)}techGet_(e){if(!(!this.tech_||!this.tech_.isReady_)){if(e in FN)return RN(this.middleware_,this.tech_,e);if(e in n_)return r_(this.middleware_,this.tech_,e);try{return this.tech_[e]()}catch(t){throw this.tech_[e]===void 0?(Je(`Video.js: ${e} method not defined for ${this.techName_} playback technology.`,t),t):t.name==="TypeError"?(Je(`Video.js: ${e} unavailable on ${this.techName_} playback technology element.`,t),this.tech_.isReady_=!1,t):(Je(t),t)}}}play(){return new Promise(e=>{this.play_(e)})}play_(e=jr){this.playCallbacks_.push(e);const t=!!(!this.changingSrc_&&(this.src()||this.currentSrc())),i=!!(Ch||wi);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")||Cr(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=Cr(0,0)),e}seekable(){let e=this.techGet_("seekable");return(!e||!e.length)&&(e=Cr(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 V1(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&&jr(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,Yi(ce,"keydown",this.boundFullWindowOnEscKey_),ce.documentElement.style.overflow="hidden",Us(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,di(ce,"keydown",this.boundFullWindowOnEscKey_),ce.documentElement.style.overflow=this.docOrigOverflow,Eh(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&&R.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"))),R.documentPictureInPicture.requestWindow({width:this.videoWidth(),height:this.videoHeight()}).then(t=>(D1(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(R.documentPictureInPicture&&R.documentPictureInPicture.window)return R.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=pt.getTech(n);if(a||(a=_e.getComponent(n)),!a){Je.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,pt.getTech(o)]).filter(([o,l])=>l?l.isSupported():(Je.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=Q1(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]),LN(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}ON(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?j1(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();jr(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}),bn(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(Jn("beforeerror").forEach(t=>{const i=t(this,e);if(!(Gr(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 Nt(e),this.addClass("vjs-error"),Je.error(`(CODE:${this.error_.code} ${Nt.errorTypes[this.error_.code]})`,this.error_.message,this.error_),this.trigger("error"),Jn("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=_t(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&&!wi&&!Kr&&(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(),bn(this)&&this.trigger("languagechange"))}languages(){return ft(Da.prototype.options_.languages,this.languages_)}toJSON(){const e=ft(this.options_),t=e.tracks;e.tracks=[];for(let i=0;i<t.length;i++){let r=t[i];r=ft(r),r.player=void 0,e.tracks[i]=r}return e}createModal(e,t){t=t||{},t.content=e||"";const i=new bo(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<gg.length;i++){const r=gg[i],n=this.breakpoints_[r];if(t<=n){if(e===r)return;e&&this.removeClass(oc[e]),this.addClass(oc[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({},bL,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 oc[this.breakpoint_]||""}loadMedia(e,t){if(!e||typeof e!="object")return;const i=this.crossOrigin();this.reset(),this.cache_.media=ft(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:Pc(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:Pc(r.poster)}]),r}return ft(this.cache_.media)}static getTagSettings(e){const t={sources:[],tracks:[]},i=Qn(e),r=i["data-setup"];if(_l(e,"vjs-fill")&&(i.fill=!0),_l(e,"vjs-fluid")&&(i.fluid=!0),r!==null)try{Object.assign(i,JSON.parse(r||"{}"))}catch(n){Je.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(Qn(l)):u==="track"&&t.tracks.push(Qn(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"))}};Ti.names.forEach(function(s){const e=Ti[s];zt.prototype[e.getterName]=function(){return this.tech_?this.tech_[e.getterName]():(this[e.privateName]=this[e.privateName]||new e.ListClass,this[e.privateName])}});zt.prototype.crossorigin=zt.prototype.crossOrigin;zt.players={};const il=R.navigator;zt.prototype.options_={techOrder:pt.defaultTechOrder_,html5:{},enableSourceset:!0,inactivityTimeout:2e3,playbackRates:[],liveui:!1,children:["mediaLoader","posterImage","titleBar","textTrackDisplay","loadingSpinner","bigPlayButton","liveTracker","controlBar","errorDisplay","textTrackSettings","resizeManager"],language:il&&(il.languages&&il.languages[0]||il.userLanguage||il.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};wE.forEach(function(s){zt.prototype[`handleTech${Bt(s)}_`]=function(){return this.trigger(s)}});_e.registerComponent("Player",zt);const Dc="plugin",qa="activePlugins_",La={},Nc=s=>La.hasOwnProperty(s),lc=s=>Nc(s)?La[s]:void 0,kE=(s,e)=>{s[qa]=s[qa]||{},s[qa][e]=!0},Lc=(s,e,t)=>{const i=(t?"before":"")+"pluginsetup";s.trigger(i,e),s.trigger(i+":"+e.name,e)},SL=function(s,e){const t=function(){Lc(this,{name:s,plugin:e,instance:null},!0);const i=e.apply(this,arguments);return kE(this,s),Lc(this,{name:s,plugin:e,instance:i}),i};return Object.keys(e).forEach(function(i){t[i]=e[i]}),t},b_=(s,e)=>(e.prototype.name=s,function(...t){Lc(this,{name:s,plugin:e,instance:null},!0);const i=new e(this,...t);return this[s]=()=>i,Lc(this,i.getEventHash()),i});let Yr=class uc{constructor(e){if(this.constructor===uc)throw new Error("Plugin must be sub-classed; not directly instantiated.");this.player=e,this.log||(this.log=this.player.log.createLogger(this.name)),Cv(this),delete this.trigger,U1(this,this.constructor.defaultState),kE(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 To(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[qa][e]=!1,this.player=this.state=null,t[e]=b_(e,La[e])}static isBasic(e){const t=typeof e=="string"?lc(e):e;return typeof t=="function"&&!uc.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(Nc(e))Je.warn(`A plugin named "${e}" already exists. You may want to avoid re-registering plugins!`);else if(zt.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 La[e]=t,e!==Dc&&(uc.isBasic(t)?zt.prototype[e]=SL(e,t):zt.prototype[e]=b_(e,t)),t}static deregisterPlugin(e){if(e===Dc)throw new Error("Cannot de-register base plugin.");Nc(e)&&(delete La[e],delete zt.prototype[e])}static getPlugins(e=Object.keys(La)){let t;return e.forEach(i=>{const r=lc(i);r&&(t=t||{},t[i]=r)}),t}static getPluginVersion(e){const t=lc(e);return t&&t.VERSION||""}};Yr.getPlugin=lc;Yr.BASE_PLUGIN_NAME=Dc;Yr.registerPlugin(Dc,Yr);zt.prototype.usingPlugin=function(s){return!!this[qa]&&this[qa][s]===!0};zt.prototype.hasPlugin=function(s){return!!Nc(s)};function xL(s,e){let t=!1;return function(...i){return t||Je.warn(s),t=!0,e.apply(this,i)}}function kr(s,e,t,i){return xL(`${e} is deprecated and will be removed in ${s}.0; please use ${t} instead.`,i)}var CL={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 AE=s=>s.indexOf("#")===0?s.slice(1):s;function j(s,e,t){let i=j.getPlayer(s);if(i)return e&&Je.warn(`Player "${s}" is already initialised. Options will not be applied.`),t&&i.ready(t),i;const r=typeof s=="string"?Zn("#"+AE(s)):s;if(!_o(r))throw new TypeError("The element or ID supplied is not valid. (videojs)");const a=("getRootNode"in r?r.getRootNode()instanceof R.ShadowRoot:!1)?r.getRootNode():r.ownerDocument.body;(!r.ownerDocument.defaultView||!a.contains(r))&&Je.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)),Jn("beforesetup").forEach(l=>{const u=l(r,ft(e));if(!Gr(u)||Array.isArray(u)){Je.error("please return an object in beforesetup hooks");return}e=ft(e,u)});const o=_e.getComponent("Player");return i=new o(r,e,t),Jn("setup").forEach(l=>l(i)),i}j.hooks_=vn;j.hooks=Jn;j.hook=iN;j.hookOnce=rN;j.removeHook=c1;if(R.VIDEOJS_NO_DYNAMIC_STYLE!==!0&&yo()){let s=Zn(".vjs-styles-defaults");if(!s){s=O1("vjs-styles-defaults");const e=Zn("head");e&&e.insertBefore(s,e.firstChild),R1(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
|
+
`)}}ug(1,j);j.VERSION=sg;j.options=zt.prototype.options_;j.getPlayers=()=>zt.players;j.getPlayer=s=>{const e=zt.players;let t;if(typeof s=="string"){const i=AE(s),r=e[i];if(r)return r;t=Zn("#"+i)}else t=s;if(_o(t)){const{player:i,playerId:r}=t;if(i||e[r])return i||e[r]}};j.getAllPlayers=()=>Object.keys(zt.players).map(s=>zt.players[s]).filter(Boolean);j.players=zt.players;j.getComponent=_e.getComponent;j.registerComponent=(s,e)=>(pt.isTech(e)&&Je.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));j.getTech=pt.getTech;j.registerTech=pt.registerTech;j.use=NN;Object.defineProperty(j,"middleware",{value:{},writeable:!1,enumerable:!0});Object.defineProperty(j.middleware,"TERMINATOR",{value:Ic,writeable:!1,enumerable:!0});j.browser=_1;j.obj=aN;j.mergeOptions=kr(9,"videojs.mergeOptions","videojs.obj.merge",ft);j.defineLazyProperty=kr(9,"videojs.defineLazyProperty","videojs.obj.defineLazyProperty",Th);j.bind=kr(9,"videojs.bind","native Function.prototype.bind",_t);j.registerPlugin=Yr.registerPlugin;j.deregisterPlugin=Yr.deregisterPlugin;j.plugin=(s,e)=>(Je.warn("videojs.plugin() is deprecated; use videojs.registerPlugin() instead"),Yr.registerPlugin(s,e));j.getPlugins=Yr.getPlugins;j.getPlugin=Yr.getPlugin;j.getPluginVersion=Yr.getPluginVersion;j.addLanguage=function(s,e){return s=(""+s).toLowerCase(),j.options.languages=ft(j.options.languages,{[s]:e}),j.options.languages[s]};j.log=Je;j.createLogger=h1;j.time=bN;j.createTimeRange=kr(9,"videojs.createTimeRange","videojs.time.createTimeRanges",Cr);j.createTimeRanges=kr(9,"videojs.createTimeRanges","videojs.time.createTimeRanges",Cr);j.formatTime=kr(9,"videojs.formatTime","videojs.time.formatTime",Xs);j.setFormatTime=kr(9,"videojs.setFormatTime","videojs.time.setFormatTime",q1);j.resetFormatTime=kr(9,"videojs.resetFormatTime","videojs.time.resetFormatTime",H1);j.parseUrl=kr(9,"videojs.parseUrl","videojs.url.parseUrl",kv);j.isCrossOrigin=kr(9,"videojs.isCrossOrigin","videojs.url.isCrossOrigin",Nh);j.EventTarget=Ji;j.any=xv;j.on=Yi;j.one=Ph;j.off=di;j.trigger=To;j.xhr=KC;j.TextTrack=ql;j.AudioTrack=K1;j.VideoTrack=X1;["isEl","isTextNode","createEl","hasClass","addClass","removeClass","toggleClass","setAttributes","getAttributes","emptyEl","appendContent","insertContent"].forEach(s=>{j[s]=function(){return Je.warn(`videojs.${s}() is deprecated; use videojs.dom.${s}() instead`),N1[s].apply(null,arguments)}});j.computedStyle=kr(9,"videojs.computedStyle","videojs.dom.computedStyle",no);j.dom=N1;j.fn=mN;j.num=ZN;j.str=_N;j.url=PN;j.Error=CL;/*! @name videojs-contrib-quality-levels @version 4.1.0 @license Apache-2.0 */let EL=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}},Oc=class extends j.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 EL(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}};Oc.prototype.allowedEvents_={change:"change",addqualitylevel:"addqualitylevel",removequalitylevel:"removequalitylevel"};for(const s in Oc.prototype.allowedEvents_)Oc.prototype["on"+s]=null;var IE="4.1.0";const wL=function(s,e){const t=s.qualityLevels,i=new Oc,r=function(){i.dispose(),s.qualityLevels=t,s.off("dispose",r)};return s.on("dispose",r),s.qualityLevels=()=>i,s.qualityLevels.VERSION=IE,i},PE=function(s){return wL(this,j.obj.merge({},s))};j.registerPlugin("qualityLevels",PE);PE.VERSION=IE;/*! @name @videojs/http-streaming @version 3.16.0 @license Apache-2.0 */const Oi=gh,Rc=(s,e)=>e&&e.responseURL&&s!==e.responseURL?e.responseURL:s,dr=s=>j.log.debug?j.log.debug.bind(j,"VHS:",`${s} >`):function(){};function at(...s){const e=j.obj||j;return(e.merge||e.mergeOptions).apply(e,s)}function Zt(...s){const e=j.time||j;return(e.createTimeRanges||e.createTimeRanges).apply(e,s)}function kL(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 $r=1/30,qr=$r*3,DE=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 Zt(t)},Oa=function(s,e){return DE(s,function(t,i){return t-qr<=e&&i+qr>=e})},Bu=function(s,e){return DE(s,function(t){return t-$r>=e})},AL=function(s){if(s.length<2)return Zt();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 Zt(e)},IL=function(s,e){let t=null,i=null,r=0;const n=[],a=[];if(!s||!s.length||!e||!e.length)return Zt();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 Zt(a)},NE=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(", ")},PL=function(s,e,t=1){return((s.length?s.end(s.length-1):0)-e)/t},Os=s=>{const e=[];for(let t=0;t<s.length;t++)e.push({start:s.start(t),end:s.end(t)});return e},DL=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},vf=function(s){if(!(!s||!s.length||!s.end))return s.end(s.length-1)},zv=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},Wv=(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},vg=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),[]),LE=s=>{const e=s.segments&&s.segments.length&&s.segments[s.segments.length-1];return e&&e.parts||[]},OE=({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},RE=(s,e)=>{if(e.endList)return 0;if(s&&s.suggestedPresentationDelay)return s.suggestedPresentationDelay;const t=LE(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},NL=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+=Wv(s,r),typeof r.start<"u")return{result:t+r.start,precise:!0}}return{result:t,precise:!1}},LL=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+=Wv(s,i),typeof i.end<"u")return{result:i.end-t,precise:!0}}return{result:-1,precise:!1}},ME=function(s,e,t){if(typeof e>"u"&&(e=s.mediaSequence+s.segments.length),e<s.mediaSequence)return 0;const i=NL(s,e);if(i.precise)return i.result;const r=LL(s,e);return r.precise?r.result:i.result+t},FE=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 R.Infinity}return ME(s,e,t)},Sl=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},BE=function(s,e,t,i){if(!s||!s.segments)return null;if(s.endList)return FE(s);if(e===null)return null;e=e||0;let r=ME(s,s.mediaSequence+s.segments.length,e);return t&&(i=typeof i=="number"?i:RE(null,s),r-=i),Math.max(0,r)},OL=function(s,e,t){const r=e||0;let n=BE(s,e,!0,t);return n===null?Zt():(n<r&&(n=r),Zt(r,n))},RL=function({playlist:s,currentTime:e,startingSegmentIndex:t,startingPartIndex:i,startTime:r,exactManifestTimings:n}){let a=e-r;const o=vg(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+$r<=0)continue;return{partIndex:c.partIndex,segmentIndex:c.segmentIndex,startTime:r-Sl({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>$r,d=a===0,g=h&&a+$r>=0;if(!((d||g)&&u!==o.length-1)){if(n){if(a>0)continue}else if(a-$r>=0)continue;return{partIndex:c.partIndex,segmentIndex:c.segmentIndex,startTime:r+Sl({defaultDuration:s.targetDuration,durationList:o,startIndex:l,endIndex:u})}}}return{segmentIndex:o[o.length-1].segmentIndex,partIndex:o[o.length-1].partIndex,startTime:e}},UE=function(s){return s.excludeUntil&&s.excludeUntil>Date.now()},Gv=function(s){return s.excludeUntil&&s.excludeUntil===1/0},Rh=function(s){const e=UE(s);return!s.disabled&&!e},ML=function(s){return s.disabled},FL=function(s){for(let e=0;e<s.segments.length;e++)if(s.segments[e].key)return!0;return!1},jE=function(s,e){return e.attributes&&e.attributes[s]},BL=function(s,e,t,i=0){return jE("BANDWIDTH",t)?(s*t.attributes.BANDWIDTH-i*8)/e:NaN},yg=(s,e)=>{if(s.playlists.length===1)return!0;const t=e.attributes.BANDWIDTH||Number.MAX_VALUE;return s.playlists.filter(i=>Rh(i)?(i.attributes.BANDWIDTH||0)<t:!1).length===0},Kv=(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),S_=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},Wl=s=>{if(!s||!s.playlists||!s.playlists.length)return S_(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=>YC(n))||S_(s,n=>Kv(t,n))))return!1}return!0};var Ri={liveEdgeDelay:RE,duration:FE,seekable:OL,getMediaInfoForTime:RL,isEnabled:Rh,isDisabled:ML,isExcluded:UE,isIncompatible:Gv,playlistEnd:BE,isAes:FL,hasAttribute:jE,estimateSegmentRequestTime:BL,isLowestEnabledRendition:yg,isAudioOnly:Wl,playlistMatch:Kv,segmentDurationWithParts:Wv};const{log:$E}=j,Ha=(s,e)=>`${s}-${e}`,qE=(s,e,t)=>`placeholder-uri-${s}-${e}-${t}`,UL=({onwarn:s,oninfo:e,manifestString:t,customTagParsers:i=[],customTagMappers:r=[],llhls:n})=>{const a=new EP;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=LE(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}`}),$E.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},Eo=(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)}})},HE=({playlist:s,uri:e,id:t})=>{s.id=t,s.playlistErrors_=0,e&&(s.uri=e),s.attributes=s.attributes||{}},jL=s=>{let e=s.playlists.length;for(;e--;){const t=s.playlists[e];HE({playlist:t,id:Ha(e,t.uri)}),t.resolvedUri=Oi(s.uri,t.uri),s.playlists[t.id]=t,s.playlists[t.uri]=t,t.attributes.BANDWIDTH||$E.warn("Invalid playlist STREAM-INF detected. Missing BANDWIDTH attribute.")}},$L=s=>{Eo(s,e=>{e.uri&&(e.resolvedUri=Oi(s.uri,e.uri))})},qL=(s,e)=>{const t=Ha(0,e),i={mediaGroups:{AUDIO:{},VIDEO:{},"CLOSED-CAPTIONS":{},SUBTITLES:{}},uri:R.location.href,resolvedUri:R.location.href,playlists:[{uri:e,id:t,resolvedUri:e,attributes:{}}]};return i.playlists[t]=i.playlists[0],i.playlists[e]=i.playlists[0],i},VE=(s,e,t=qE)=>{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=Wl(s);Eo(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=[A._extends({},r)]}r.playlists.forEach(function(l,u){const c=t(n,a,o,l),h=Ha(u,c);l.uri?l.resolvedUri=l.resolvedUri||Oi(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})}),jL(s),$L(s)};class x_{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 zE=22,qs=({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=A._extends({},t),a.errorType=j.Error.NetworkRequestFailed;else if(e.aborted)a.errorType=j.Error.NetworkRequestAborted;else if(e.timedout)a.erroType=j.Error.NetworkRequestTimeout;else if(o){const l=i?j.Error.NetworkBodyParserFailed:j.Error.NetworkBadStatus;a.errorType=l,a.status=e.status,a.headers=e.headers}return a},{EventTarget:HL}=j,VL=(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=OE(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 R.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},zL=(s,e)=>{if(!s)return e;const t=at(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]=at(s.parts[i],e.parts[i]));return!s.skipped&&e.skipped&&(t.skipped=!1),s.preload&&!e.preload&&(t.preload=!1),t},WL=(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(zL(l,u))):(a&&!u.map&&(u.map=a),n.push(u))}return n},WE=(s,e)=>{!s.resolvedUri&&s.uri&&(s.resolvedUri=Oi(e,s.uri)),s.key&&!s.key.resolvedUri&&(s.key.resolvedUri=Oi(e,s.key.uri)),s.map&&!s.map.resolvedUri&&(s.map.resolvedUri=Oi(e,s.map.uri)),s.map&&s.map.key&&!s.map.key.resolvedUri&&(s.map.key.resolvedUri=Oi(e,s.map.key.uri)),s.parts&&s.parts.length&&s.parts.forEach(t=>{t.resolvedUri||(t.resolvedUri=Oi(e,t.uri))}),s.preloadHints&&s.preloadHints.length&&s.preloadHints.forEach(t=>{t.resolvedUri||(t.resolvedUri=Oi(e,t.uri))})},GE=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},KE=(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,_g=(s,e,t=KE)=>{const i=at(s,{}),r=i.playlists[e.id];if(!r||t(r,e))return null;e.segments=GE(e);const n=at(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=WL(r.segments,e.segments,e.mediaSequence-r.mediaSequence)}n.segments.forEach(a=>{WE(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,Eo(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},Tg=(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},C_=(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 Ra=class extends HL{constructor(e,t,i={}){if(super(),!e)throw new Error("A non-empty playlist URL or object is required");this.logger_=dr("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 x_,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=Oi(this.main.uri,e.uri);this.llhls&&(t=VL(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:qs({requestType:e.requestType,request:e,error:e.error})},this.trigger("error")}parseManifest_({url:e,manifestString:t}){try{return UL({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:j.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(),HE({playlist:a,uri:i,id:r});const o=_g(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_(Tg(this.media(),!!o)),n.parsedPlaylist=C_(this.main.playlists,n.playlistInfo.type,!this.media_.endList),this.trigger({type:"playlistparsecomplete",metadata:n}),this.trigger("loadedplaylist")}dispose(){this.trigger("dispose"),this.stopRequest(),R.clearTimeout(this.mediaUpdateTimeout),R.clearTimeout(this.finalRenditionTimeout),this.dateRangesStorage_=new x_,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(R.clearTimeout(this.finalRenditionTimeout),t){const o=(e.partTargetDuration||e.targetDuration)/2*1e3||5e3;this.finalRenditionTimeout=R.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_(Tg(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=Rc(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&&(R.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&&(R.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null);const t=this.media();if(e){const i=t?(t.partTargetDuration||t.targetDuration)/2*1e3:5e3;this.mediaUpdateTimeout=R.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&&(R.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null),!(!this.media()||this.media().endList)&&(this.mediaUpdateTimeout=R.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=R.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:qs({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=Rc(this.src,i),this.trigger({type:"playlistparsestart",metadata:e});const r=this.parseManifest_({manifestString:i.responseText,url:this.src});e.parsedPlaylist=C_(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,VE(this.main,this.srcUri()),e.playlists.forEach(i=>{i.segments=GE(i),i.segments.forEach(r=>{WE(r,i.resolvedUri)})}),this.trigger("loadedplaylist"),this.request||this.media(this.main.playlists[0]);return}const t=this.srcUri()||R.location.href;this.main=qL(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=Ha(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=Ha(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]=A._extends({},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=qE(n,t,o),p=Ha(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),at(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 bg=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)},GL=(s,e)=>{if(!s||!s.size)return;let t=e;return s.forEach(i=>{t=i(t)}),t},KL=(s,e,t,i)=>{!s||!s.size||s.forEach(r=>{r(e,t,i)})},XE=function(){const s=function e(t,i){t=at({timeout:45e3},t);const r=e.beforeRequest||j.Vhs.xhr.beforeRequest,n=e._requestCallbackSet||j.Vhs.xhr._requestCallbackSet||new Set,a=e._responseCallbackSet||j.Vhs.xhr._responseCallbackSet;r&&typeof r=="function"&&(j.log.warn("beforeRequest is deprecated, use onRequest instead."),n.add(r));const o=j.Vhs.xhr.original===!0?j.xhr:j.Vhs.xhr,l=GL(n,t);n.delete(r);const u=o(l||t,function(h,d){return KL(a,u,h,d),bg(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},XL=function(s){let e;const t=s.offset;return typeof s.offset=="bigint"||typeof s.length=="bigint"?e=R.BigInt(s.offset)+R.BigInt(s.length)-R.BigInt(1):e=s.offset+s.length-1,"bytes="+t+"-"+e},Sg=function(s){const e={};return s.byterange&&(e.Range=XL(s.byterange)),e},QL=function(s,e){return s.start(e)+"-"+s.end(e)},YL=function(s,e){const t=s.toString(16);return"00".substring(0,2-t.length)+t+(e%2?" ":"")},JL=function(s){return s>=32&&s<126?String.fromCharCode(s):"."},QE=function(s){const e={};return Object.keys(s).forEach(t=>{const i=s[t];ZC(i)?e[t]={bytes:i.buffer,byteOffset:i.byteOffset,byteLength:i.byteLength}:e[t]=i}),e},Mc=function(s){const e=s.byterange||{length:1/0,offset:0};return[e.length,e.offset,s.resolvedUri].join(",")},YE=function(s){return s.resolvedUri},JE=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(YL).join(""),n=e.slice(a*t,a*t+t).map(JL).join(""),i+=r+" "+n+`
|
|
199
|
+
`;return i},ZL=({bytes:s})=>JE(s),eO=s=>{let e="",t;for(t=0;t<s.length;t++)e+=QL(s,t)+" ";return e};var tO=Object.freeze({__proto__:null,createTransferableMessage:QE,initSegmentId:Mc,segmentKeyId:YE,hexDump:JE,tagDump:ZL,textRanges:eO});const ZE=.25,iO=(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)},rO=s=>s.transmuxedPresentationEnd-s.transmuxedPresentationStart-s.transmuxerPrependedSeconds,nO=(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?rO(r.videoTimingInfo):r.duration+r.duration*ZE,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:Ri.duration(e,e.mediaSequence+e.segments.indexOf(i)),type:i.videoTimingInfo?"accurate":"estimate"})},sO=(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*ZE)return null;i=r}return{segment:i,estimatedStart:i.videoTimingInfo?i.videoTimingInfo.transmuxedPresentationStart:t-i.duration,type:i.videoTimingInfo?"accurate":"estimate"}},aO=(s,e)=>{let t,i;try{t=new Date(s),i=new Date(e)}catch{}const r=t.getTime();return(i.getTime()-r)/1e3},oO=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},lO=({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=sO(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=iO(e,i.segment);return n&&(r.programDateTime=n.toISOString()),t(null,r)},e2=({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(!oO(e))return a({message:"programDateTime tags must be provided in the manifest "+e.resolvedUri});const o=nO(s,e);if(!o)return a({message:`${s} was not found in the stream`});const l=o.segment,u=aO(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",()=>{e2({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)},yf=(s,e)=>{if(s.readyState===4)return e()},uO=(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=qs({requestType:i,request:d,error:h}),o(h,d,"",r);const g=d.responseText.substring(r&&r.byteLength||0,d.responseText.length);if(r=FP(r,e1(g,!0)),n=n||hl(r),r.length<10||n&&r.length<n+2)return yf(d,()=>o(h,d,"",r));const y=yv(r);return y==="ts"&&r.length<188?yf(d,()=>o(h,d,"",r)):!y&&r.length<376?yf(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 bg(h,null,{statusCode:h.status},l)})}},function(h,d){return bg(c,h,d,l)});return c},{EventTarget:cO}=j,E_=function(s,e){if(!KE(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},hO=(s,e,t,i)=>{const r=i.attributes.NAME||t;return`placeholder-uri-${s}-${e}-${r}`},dO=({mainXml:s,srcUrl:e,clientOffset:t,sidxMapping:i,previousManifest:r})=>{const n=OD(s,{manifestUri:e,clientOffset:t,sidxMapping:i,previousManifest:r});return VE(n,e,hO),n},fO=(s,e)=>{Eo(s,(t,i,r,n)=>{(!e.mediaGroups[i][r]||!(n in e.mediaGroups[i][r]))&&delete s.mediaGroups[i][r][n]})},pO=(s,e,t)=>{let i=!0,r=at(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=yh(a.sidx);t&&t[l]&&t[l].sidx&&mv(a,t[l].sidx,a.sidx.resolvedUri)}const o=_g(r,a,E_);o&&(r=o,i=!1)}return Eo(e,(n,a,o,l)=>{if(n.playlists&&n.playlists.length){const u=n.playlists[0].id,c=_g(r,n.playlists[0],E_);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)}}),fO(r,e),e.minimumUpdatePeriod!==s.minimumUpdatePeriod&&(i=!1),i?null:r},mO=(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,w_=(s,e)=>{const t={};for(const i in s){const n=s[i].sidx;if(n){const a=yh(n);if(!e[a])break;const o=e[a].sidxInfo;mO(o,n)&&(t[a]=e[a])}}return t},gO=(s,e)=>{let i=w_(s.playlists,e);return Eo(s,(r,n,a,o)=>{if(r.playlists&&r.playlists.length){const l=r.playlists;i=at(i,w_(l,e))}}),i};let xg=class extends cO{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_=dr("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&&yh(e.sidx);if(!e.sidx||!r||this.mainPlaylistLoader_.sidxMapping_[r]){this.mediaRequest_=R.setTimeout(()=>i(!1),0);return}const n=Rc(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=UD(Ue(u.response).subarray(8))}catch(g){g.metadata=qs({requestType:h,request:u,parseFailure:!0}),this.requestErrored_(g,u,t);return}return c[r]={sidxInfo:e.sidx,sidx:d},mv(e,d,e.sidx.resolvedUri),i(!0)},o="dash-sidx";this.request=uO(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:Sg({byterange:e.sidx.byterange})},a)},o)}dispose(){this.trigger("dispose"),this.stopRequest(),this.loadedPlaylists_={},R.clearTimeout(this.minimumUpdatePeriodTimeout_),R.clearTimeout(this.mediaRequest_),R.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(),R.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null,this.isMain_&&(R.clearTimeout(this.mainPlaylistLoader_.minimumUpdatePeriodTimeout_),this.mainPlaylistLoader_.minimumUpdatePeriodTimeout_=null),this.state==="HAVE_NOTHING"&&(this.started=!1)}load(e){R.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null;const t=this.media();if(e){const i=t?t.targetDuration/2*1e3:5e3;this.mediaUpdateTimeout=R.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_=R.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=qs({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=Rc(this.mainPlaylistLoader_.srcUrl,r),n){this.handleMain_(),this.syncClientServerClock_(()=>e(r,n));return}return e(r,n)})}syncClientServerClock_(e){const t=RD(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:Oi(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=qs({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=dO({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:j.Error.StreamingDashManifestParserError,error:n},this.trigger("error")}e&&(i=pO(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_&&(R.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_=R.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_=gO(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=R.setTimeout(()=>{this.trigger("mediaupdatetimeout"),r()},Tg(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 Qt={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 vO=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},t2=function(s){return s.on=s.addEventListener,s.off=s.removeEventListener,s},yO=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())}},i2=function(s){return function(){const e=yO(s),t=t2(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}},r2=function(s){return`var browserWorkerPolyFill = ${t2.toString()};
|
|
200
|
+
browserWorkerPolyFill(self);
|
|
201
|
+
`+s},n2=function(s){return s.toString().replace(/^function.+?{/,"").slice(0,-1)},_O=r2(n2(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,N;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(N=[],b=arguments.length,b=1;b<arguments.length;++b)N.push(arguments[b]);for(w=S.length,b=0;b<w;++b)S[b].apply(this,N)}},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,I,L,$,F,O,B,U,C,P,K,z,X,re,he,fe,ne,se,le,de,ve,we,Pe,Oe,De,Xe;(function(){var f;if(X={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 X)X.hasOwnProperty(f)&&(X[f]=[f.charCodeAt(0),f.charCodeAt(1),f.charCodeAt(2),f.charCodeAt(3)]);re=new Uint8Array([105,115,111,109]),fe=new Uint8Array([97,118,99,49]),he=new Uint8Array([0,0,0,1]),ne=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]),se=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]),le={video:ne,audio:se},we=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]),Pe=new Uint8Array([0,0,0,0,0,0,0,0]),Oe=Pe,De=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),Xe=Pe,de=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0])}})(),o=function(f){var v=[],S=0,b,w,N;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),N=new DataView(w.buffer,w.byteOffset,w.byteLength),N.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(X.dinf,o(X.dref,we))},u=function(f){return o(X.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(X.ftyp,re,he,re,fe)},O=function(f){return o(X.hdlr,le[f])},h=function(f){return o(X.mdat,f)},F=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(X.mdhd,v)},$=function(f){return o(X.mdia,F(f),O(f.type),g(f))},d=function(f){return o(X.mfhd,new Uint8Array([0,0,0,0,(f&4278190080)>>24,(f&16711680)>>16,(f&65280)>>8,f&255]))},g=function(f){return o(X.minf,f.type==="video"?o(X.vmhd,de):o(X.smhd,ve),l(),U(f))},y=function(f,v){for(var S=[],b=v.length;b--;)S[b]=P(v[b]);return o.apply(null,[X.moof,d(f)].concat(S))},p=function(f){for(var v=f.length,S=[];v--;)S[v]=I(f[v]);return o.apply(null,[X.moov,k(4294967295)].concat(S).concat(_(f)))},_=function(f){for(var v=f.length,S=[];v--;)S[v]=K(f[v]);return o.apply(null,[X.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(X.mvhd,v)},B=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(X.sdtp,S)},U=function(f){return o(X.stbl,C(f),o(X.stts,Xe),o(X.stsc,Oe),o(X.stsz,De),o(X.stco,Pe))},function(){var f,v;C=function(S){return o(X.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||[],N=[],G=[],Q,J;for(Q=0;Q<b.length;Q++)N.push((b[Q].byteLength&65280)>>>8),N.push(b[Q].byteLength&255),N=N.concat(Array.prototype.slice.call(b[Q]));for(Q=0;Q<w.length;Q++)G.push((w[Q].byteLength&65280)>>>8),G.push(w[Q].byteLength&255),G=G.concat(Array.prototype.slice.call(w[Q]));if(J=[X.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(X.avcC,new Uint8Array([1,S.profileIdc,S.profileCompatibility,S.levelIdc,255].concat([b.length],N,[w.length],G))),o(X.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192]))],S.sarRatio){var Z=S.sarRatio[0],ue=S.sarRatio[1];J.push(o(X.pasp,new Uint8Array([(Z&4278190080)>>24,(Z&16711680)>>16,(Z&65280)>>8,Z&255,(ue&4278190080)>>24,(ue&16711680)>>16,(ue&65280)>>8,ue&255])))}return o.apply(null,J)},v=function(S){return o(X.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))}}(),L=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(X.tkhd,v)},P=function(f){var v,S,b,w,N,G,Q;return v=o(X.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])),G=Math.floor(f.baseMediaDecodeTime/a),Q=Math.floor(f.baseMediaDecodeTime%a),S=o(X.tfdt,new Uint8Array([1,0,0,0,G>>>24&255,G>>>16&255,G>>>8&255,G&255,Q>>>24&255,Q>>>16&255,Q>>>8&255,Q&255])),N=92,f.type==="audio"?(b=z(f,N),o(X.traf,v,S,b)):(w=B(f),b=z(f,w.length+N),o(X.traf,v,S,b,w))},I=function(f){return f.duration=f.duration||4294967295,o(X.trak,L(f),$(f))},K=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(X.trex,v)},function(){var f,v,S;S=function(b,w){var N=0,G=0,Q=0,J=0;return b.length&&(b[0].duration!==void 0&&(N=1),b[0].size!==void 0&&(G=2),b[0].flags!==void 0&&(Q=4),b[0].compositionTimeOffset!==void 0&&(J=8)),[0,0,N|G|Q|J,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 N,G,Q,J,Z,ue;for(J=b.samples||[],w+=20+16*J.length,Q=S(J,w),G=new Uint8Array(Q.length+J.length*16),G.set(Q),N=Q.length,ue=0;ue<J.length;ue++)Z=J[ue],G[N++]=(Z.duration&4278190080)>>>24,G[N++]=(Z.duration&16711680)>>>16,G[N++]=(Z.duration&65280)>>>8,G[N++]=Z.duration&255,G[N++]=(Z.size&4278190080)>>>24,G[N++]=(Z.size&16711680)>>>16,G[N++]=(Z.size&65280)>>>8,G[N++]=Z.size&255,G[N++]=Z.flags.isLeading<<2|Z.flags.dependsOn,G[N++]=Z.flags.isDependedOn<<6|Z.flags.hasRedundancy<<4|Z.flags.paddingValue<<1|Z.flags.isNonSyncSample,G[N++]=Z.flags.degradationPriority&61440,G[N++]=Z.flags.degradationPriority&15,G[N++]=(Z.compositionTimeOffset&4278190080)>>>24,G[N++]=(Z.compositionTimeOffset&16711680)>>>16,G[N++]=(Z.compositionTimeOffset&65280)>>>8,G[N++]=Z.compositionTimeOffset&255;return o(X.trun,G)},f=function(b,w){var N,G,Q,J,Z,ue;for(J=b.samples||[],w+=20+8*J.length,Q=S(J,w),N=new Uint8Array(Q.length+J.length*8),N.set(Q),G=Q.length,ue=0;ue<J.length;ue++)Z=J[ue],N[G++]=(Z.duration&4278190080)>>>24,N[G++]=(Z.duration&16711680)>>>16,N[G++]=(Z.duration&65280)>>>8,N[G++]=Z.duration&255,N[G++]=(Z.size&4278190080)>>>24,N[G++]=(Z.size&16711680)>>>16,N[G++]=(Z.size&65280)>>>8,N[G++]=Z.size&255;return o(X.trun,N)},z=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}},Le=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},qe=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},it=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},gt=function(){return{size:0,flags:{isLeading:0,dependsOn:1,isDependedOn:0,hasRedundancy:0,degradationPriority:0,isNonSyncSample:1}}},At=function(f,v){var S=gt();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},Ai=function(f,v){var S,b,w,N,G,Q=v||0,J=[];for(S=0;S<f.length;S++)for(N=f[S],b=0;b<N.length;b++)G=N[b],w=At(G,Q),Q+=w.size,J.push(w);return J},Lt=function(f){var v,S,b,w,N,G,Q=0,J=f.byteLength,Z=f.nalCount,ue=J+4*Z,me=new Uint8Array(ue),ke=new DataView(me.buffer);for(v=0;v<f.length;v++)for(w=f[v],S=0;S<w.length;S++)for(N=w[S],b=0;b<N.length;b++)G=N[b],ke.setUint32(Q,G.data.byteLength),Q+=4,me.set(G.data,Q),Q+=G.data.byteLength;return me},Fi=function(f,v){var S,b=v||0,w=[];return S=At(f,b),w.push(S),w},Te=function(f){var v,S,b=0,w=f.byteLength,N=f.length,G=w+4*N,Q=new Uint8Array(G),J=new DataView(Q.buffer);for(v=0;v<f.length;v++)S=f[v],J.setUint32(b,S.data.byteLength),b+=4,Q.set(S.data,b),b+=S.data.byteLength;return Q},Ce={groupNalsIntoFrames:Le,groupFramesIntoGops:qe,extendFirstKeyFrame:it,generateSampleTable:Ai,concatenateNalData:Lt,generateSampleTableForFrame:Fi,concatenateNalDataForFrame:Te},Fe=[33,16,5,32,164,27],Me=[33,65,108,84,1,2,4,8,168,2,4,8,17,191,252],Ge=function(f){for(var v=[];f--;)v.push(0);return v},Qe=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},{})},vt,Bi=function(){if(!vt){var f={96e3:[Fe,[227,64],Ge(154),[56]],88200:[Fe,[231],Ge(170),[56]],64e3:[Fe,[248,192],Ge(240),[56]],48e3:[Fe,[255,192],Ge(268),[55,148,128],Ge(54),[112]],44100:[Fe,[255,192],Ge(268),[55,163,128],Ge(84),[112]],32e3:[Fe,[255,192],Ge(268),[55,234],Ge(226),[112]],24e3:[Fe,[255,192],Ge(268),[55,255,128],Ge(268),[111,112],Ge(126),[224]],16e3:[Fe,[255,192],Ge(268),[55,255,128],Ge(268),[111,255],Ge(269),[223,108],Ge(195),[1,192]],12e3:[Me,Ge(268),[3,127,248],Ge(268),[6,255,240],Ge(268),[13,255,224],Ge(268),[27,253,128],Ge(259),[56]],11025:[Me,Ge(268),[3,127,248],Ge(268),[6,255,240],Ge(268),[13,255,224],Ge(268),[27,255,192],Ge(268),[55,175,128],Ge(108),[112]],8e3:[Me,Ge(268),[3,121,16],Ge(47),[7]]};vt=Qe(f)}return vt},pr=9e4,mr,ir,Ui,tn,In,rn,Ye;mr=function(f){return f*pr},ir=function(f,v){return f*v},Ui=function(f){return f/pr},tn=function(f,v){return f/v},In=function(f,v){return mr(tn(f,v))},rn=function(f,v){return ir(Ui(f),v)},Ye=function(f,v,S){return Ui(S?f:f-v)};var rt={ONE_SECOND_IN_TS:pr,secondsToVideoTs:mr,secondsToAudioTs:ir,videoTsToSeconds:Ui,audioTsToSeconds:tn,audioTsToVideoTs:In,videoTsToAudioTs:rn,metadataTsToSeconds:Ye},Zs=Bi,nn=rt,ea=function(f){var v,S,b=0;for(v=0;v<f.length;v++)S=f[v],b+=S.data.byteLength;return b},ss=function(f,v,S,b){var w,N=0,G=0,Q=0,J=0,Z,ue,me;if(v.length&&(w=nn.audioTsToVideoTs(f.baseMediaDecodeTime,f.samplerate),N=Math.ceil(nn.ONE_SECOND_IN_TS/(f.samplerate/1024)),S&&b&&(G=w-Math.max(S,b),Q=Math.floor(G/N),J=Q*N),!(Q<1||J>nn.ONE_SECOND_IN_TS/2))){for(Z=Zs()[f.samplerate],Z||(Z=v[0].data),ue=0;ue<Q;ue++)me=v[0],v.splice(0,0,{data:Z,dts:me.dts-N,pts:me.pts-N});return f.baseMediaDecodeTime-=Math.floor(nn.videoTsToAudioTs(J,f.samplerate)),J}},ji=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}))},ta=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},as=function(f){var v,S,b=0,w=new Uint8Array(ea(f));for(v=0;v<f.length;v++)S=f[v],w.set(S.data,b),b+=S.data.byteLength;return w},ia={prefixWithSilence:ss,trimAdtsFramesByEarliestDts:ji,generateSampleTable:ta,concatenateFrameData:as},H=rt.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))},te=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/H,S*=b,S=Math.floor(S)),S},Ee={clearDtsInfo:te,calculateTrackBaseMediaDecodeTime:pe,collectDtsInfo:V},$e=4,ot=128,Gt=function(f){for(var v=0,S={payloadType:-1,payloadSize:0},b=0,w=0;v<f.byteLength&&f[v]!==ot;){for(;f[v]===255;)b+=255,v++;for(b+=f[v++];f[v]===255;)w+=255,v++;if(w+=f[v++],!S.payload&&b===$e){var N=String.fromCharCode(f[v+3],f[v+4],f[v+5],f[v+6]);if(N==="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},ii=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)},Ct=function(f,v){var S=[],b,w,N,G;if(!(v[0]&64))return S;for(w=v[0]&31,b=0;b<w;b++)N=b*3,G={type:v[N+2]&3,pts:f},v[N+2]&4&&(G.ccData=v[N+3]<<8|v[N+4],S.push(G));return S},$i=function(f){for(var v=f.byteLength,S=[],b=1,w,N;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,N=new Uint8Array(w);var G=0;for(b=0;b<w;G++,b++)G===S[0]&&(G++,S.shift()),N[b]=f[G];return N},rr={parseSei:Gt,parseUserData:ii,parseCaptionPackets:Ct,discardEmulationPreventionBytes:$i,USER_DATA_REGISTERED_ITU_T_T35:$e},li=t,Ot=rr,st=function(f){f=f||{},st.prototype.init.call(this),this.parse708captions_=typeof f.parse708captions=="boolean"?f.parse708captions:!0,this.captionPackets_=[],this.ccStreams_=[new ht(0,0),new ht(0,1),new ht(1,0),new ht(1,1)],this.parse708captions_&&(this.cc708Stream_=new Ze({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")))};st.prototype=new li,st.prototype.push=function(f){var v,S,b;if(f.nalUnitType==="sei_rbsp"&&(v=Ot.parseSei(f.escapedRBSP),!!v.payload&&v.payloadType===Ot.USER_DATA_REGISTERED_ITU_T_T35&&(S=Ot.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=Ot.parseCaptionPackets(f.pts,S),this.captionPackets_=this.captionPackets_.concat(b),this.latestDts_!==f.dts&&(this.numSameDts_=0),this.numSameDts_++,this.latestDts_=f.dts}},st.prototype.flushCCStreams=function(f){this.ccStreams_.forEach(function(v){return f==="flush"?v.flush():v.partialFlush()},this)},st.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)},st.prototype.flush=function(){return this.flushStream("flush")},st.prototype.partialFlush=function(){return this.flushStream("partialFlush")},st.prototype.reset=function(){this.latestDts_=null,this.ignoreNextEqualDts_=!1,this.numSameDts_=0,this.activeCea608Channel_=[null,null],this.ccStreams_.forEach(function(f){f.reset()})},st.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)},st.prototype.setsChannel1Active=function(f){return(f.ccData&30720)===4096},st.prototype.setsChannel2Active=function(f){return(f.ccData&30720)===6144},st.prototype.setsTextOrXDSActive=function(f){return(f.ccData&28928)===256||(f.ccData&30974)===4138||(f.ccData&30974)===6186},st.prototype.dispatchCea708Packet=function(f){this.parse708captions_&&this.cc708Stream_.push(f)};var et={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},sn=function(f){var v=et[f]||f;return f&4096&&f===v?"":String.fromCharCode(v)},yt=function(f){return 32<=f&&f<=127||160<=f&&f<=255},ri=function(f){this.windowNum=f,this.reset()};ri.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},ri.prototype.getText=function(){return this.rows.join(`
|
|
202
|
+
`)},ri.prototype.clearText=function(){this.rows=[""],this.rowIdx=0},ri.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--},ri.prototype.isEmpty=function(){return this.rows.length===0?!0:this.rows.length===1?this.rows[0]==="":!1},ri.prototype.addText=function(f){this.rows[this.rowIdx]+=f},ri.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 ri(-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 ri(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 Ze=function(f){f=f||{},Ze.prototype.init.call(this);var v=this,S=f.captionServices||{},b={},w;Object.keys(S).forEach(N=>{w=S[N],/^SERVICE/.test(N)&&(b[N]=w.encoding)}),this.serviceEncodings=b,this.current708Packet=null,this.services={},this.push=function(N){N.type===3?(v.new708Packet(),v.add708Bytes(N)):(v.current708Packet===null&&v.new708Packet(),v.add708Bytes(N))}};Ze.prototype=new li,Ze.prototype.new708Packet=function(){this.current708Packet!==null&&this.push708Packet(),this.current708Packet={data:[],ptsVals:[]}},Ze.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)},Ze.prototype.push708Packet=function(){var f=this.current708Packet,v=f.data,S=null,b=null,w=0,N=v[w++];for(f.seq=N>>6,f.sizeCode=N&63;w<v.length;w++)N=v[w++],S=N>>5,b=N&31,S===7&&b>0&&(N=v[w++],S=N),this.pushServiceBlock(S,w,b),b>0&&(w+=b-1)},Ze.prototype.pushServiceBlock=function(f,v,S){var b,w=v,N=this.current708Packet.data,G=this.services[f];for(G||(G=this.initService(f,w));w<v+S&&w<N.length;w++)b=N[w],yt(b)?w=this.handleText(w,G):b===24?w=this.multiByteCharacter(w,G):b===16?w=this.extendedCommands(w,G):128<=b&&b<=135?w=this.setCurrentWindow(w,G):152<=b&&b<=159?w=this.defineWindow(w,G):b===136?w=this.clearWindows(w,G):b===140?w=this.deleteWindows(w,G):b===137?w=this.displayWindows(w,G):b===138?w=this.hideWindows(w,G):b===139?w=this.toggleWindows(w,G):b===151?w=this.setWindowAttributes(w,G):b===144?w=this.setPenAttributes(w,G):b===145?w=this.setPenColor(w,G):b===146?w=this.setPenLocation(w,G):b===143?G=this.reset(w,G):b===8?G.currentWindow.backspace():b===12?G.currentWindow.clearText():b===13?G.currentWindow.pendingNewLine=!0:b===14?G.currentWindow.clearText():b===141&&w++},Ze.prototype.extendedCommands=function(f,v){var S=this.current708Packet.data,b=S[++f];return yt(b)&&(f=this.handleText(f,v,{isExtended:!0})),f},Ze.prototype.getPts=function(f){return this.current708Packet.ptsVals[Math.floor(f/2)]},Ze.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(N){S.flushDisplayed(N,S.services[f])}),this.services[f]},Ze.prototype.handleText=function(f,v,S){var b=S&&S.isExtended,w=S&&S.isMultiByte,N=this.current708Packet.data,G=b?4096:0,Q=N[f],J=N[f+1],Z=v.currentWindow,ue,me;function ke(ye){return ye.map(Be=>("0"+(Be&255).toString(16)).slice(-2)).join("")}if(w?(me=[Q,J],f++):me=[Q],v.textDecoder_&&!b)ue=v.textDecoder_.decode(new Uint8Array(me));else if(w){const ye=ke(me);ue=String.fromCharCode(parseInt(ye,16))}else ue=sn(G|Q);return Z.pendingNewLine&&!Z.isEmpty()&&Z.newLine(this.getPts(f)),Z.pendingNewLine=!1,Z.addText(ue),f},Ze.prototype.multiByteCharacter=function(f,v){var S=this.current708Packet.data,b=S[f+1],w=S[f+2];return yt(b)&&yt(w)&&(f=this.handleText(++f,v,{isMultiByte:!0})),f},Ze.prototype.setCurrentWindow=function(f,v){var S=this.current708Packet.data,b=S[f],w=b&7;return v.setCurrentWindow(w),f},Ze.prototype.defineWindow=function(f,v){var S=this.current708Packet.data,b=S[f],w=b&7;v.setCurrentWindow(w);var N=v.currentWindow;return b=S[++f],N.visible=(b&32)>>5,N.rowLock=(b&16)>>4,N.columnLock=(b&8)>>3,N.priority=b&7,b=S[++f],N.relativePositioning=(b&128)>>7,N.anchorVertical=b&127,b=S[++f],N.anchorHorizontal=b,b=S[++f],N.anchorPoint=(b&240)>>4,N.rowCount=b&15,b=S[++f],N.columnCount=b&63,b=S[++f],N.windowStyle=(b&56)>>3,N.penStyle=b&7,N.virtualRowCount=N.rowCount+1,f},Ze.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},Ze.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},Ze.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)},Ze.prototype.displayWindows=function(f,v){var S=this.current708Packet.data,b=S[++f],w=this.getPts(f);this.flushDisplayed(w,v);for(var N=0;N<8;N++)b&1<<N&&(v.windows[N].visible=1);return f},Ze.prototype.hideWindows=function(f,v){var S=this.current708Packet.data,b=S[++f],w=this.getPts(f);this.flushDisplayed(w,v);for(var N=0;N<8;N++)b&1<<N&&(v.windows[N].visible=0);return f},Ze.prototype.toggleWindows=function(f,v){var S=this.current708Packet.data,b=S[++f],w=this.getPts(f);this.flushDisplayed(w,v);for(var N=0;N<8;N++)b&1<<N&&(v.windows[N].visible^=1);return f},Ze.prototype.clearWindows=function(f,v){var S=this.current708Packet.data,b=S[++f],w=this.getPts(f);this.flushDisplayed(w,v);for(var N=0;N<8;N++)b&1<<N&&v.windows[N].clearText();return f},Ze.prototype.deleteWindows=function(f,v){var S=this.current708Packet.data,b=S[++f],w=this.getPts(f);this.flushDisplayed(w,v);for(var N=0;N<8;N++)b&1<<N&&v.windows[N].reset();return f},Ze.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},Ze.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},Ze.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},Ze.prototype.reset=function(f,v){var S=this.getPts(f);return this.flushDisplayed(S,v),this.initService(v.serviceNum,f)};var Tt={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},an=function(f){return f===null?"":(f=Tt[f]||f,String.fromCharCode(f))},Rt=14,sd=[4352,4384,4608,4640,5376,5408,5632,5664,5888,5920,4096,4864,4896,5120,5152],on=function(){for(var f=[],v=Rt+1;v--;)f.push({text:"",indent:0,offset:0});return f},ht=function(f,v){ht.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,N,G,Q;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),N=b>>>8,G=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_=on();else if(b===this.ERASE_NON_DISPLAYED_MEMORY_)this.nonDisplayed_=on();else if(b===this.RESUME_DIRECT_CAPTIONING_)this.mode_!=="paintOn"&&(this.flushDisplayed(S.pts),this.displayed_=on()),this.mode_="paintOn",this.startPts_=S.pts;else if(this.isSpecialCharacter(N,G))N=(N&3)<<8,Q=an(N|G),this[this.mode_](S.pts,Q),this.column_++;else if(this.isExtCharacter(N,G))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),N=(N&3)<<8,Q=an(N|G),this[this.mode_](S.pts,Q),this.column_++;else if(this.isMidRowCode(N,G))this.clearFormatting(S.pts),this[this.mode_](S.pts," "),this.column_++,(G&14)===14&&this.addFormatting(S.pts,["i"]),(G&1)===1&&this.addFormatting(S.pts,["u"]);else if(this.isOffsetControlCode(N,G)){const Z=G&3;this.nonDisplayed_[this.row_].offset=Z,this.column_+=Z}else if(this.isPAC(N,G)){var J=sd.indexOf(b&7968);if(this.mode_==="rollUp"&&(J-this.rollUpRows_+1<0&&(J=this.rollUpRows_-1),this.setRollUp(S.pts,J)),J!==this.row_&&J>=0&&J<=14&&(this.clearFormatting(S.pts),this.row_=J),G&1&&this.formatting_.indexOf("u")===-1&&this.addFormatting(S.pts,["u"]),(b&16)===16){const Z=(b&14)>>1;this.column_=Z*4,this.nonDisplayed_[this.row_].indent+=Z}this.isColorPAC(G)&&(G&14)===14&&this.addFormatting(S.pts,["i"])}else this.isNormalChar(N)&&(G===0&&(G=null),Q=an(N),Q+=an(G),this[this.mode_](S.pts,Q),this.column_+=Q.length)}};ht.prototype=new li,ht.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_})},ht.prototype.reset=function(){this.mode_="popOn",this.topRow_=0,this.startPts_=0,this.displayed_=on(),this.nonDisplayed_=on(),this.lastControlCode_=null,this.column_=0,this.row_=Rt,this.rollUpRows_=2,this.formatting_=[]},ht.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},ht.prototype.isSpecialCharacter=function(f,v){return f===this.EXT_&&v>=48&&v<=63},ht.prototype.isExtCharacter=function(f,v){return(f===this.EXT_+1||f===this.EXT_+2)&&v>=32&&v<=63},ht.prototype.isMidRowCode=function(f,v){return f===this.EXT_&&v>=32&&v<=47},ht.prototype.isOffsetControlCode=function(f,v){return f===this.OFFSET_&&v>=33&&v<=35},ht.prototype.isPAC=function(f,v){return f>=this.BASE_&&f<this.BASE_+8&&v>=64&&v<=127},ht.prototype.isColorPAC=function(f){return f>=64&&f<=79||f>=96&&f<=127},ht.prototype.isNormalChar=function(f){return f>=32&&f<=127},ht.prototype.setRollUp=function(f,v){if(this.mode_!=="rollUp"&&(this.row_=Rt,this.mode_="rollUp",this.flushDisplayed(f),this.nonDisplayed_=on(),this.displayed_=on()),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},ht.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)},ht.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)}},ht.prototype.popOn=function(f,v){var S=this.nonDisplayed_[this.row_].text;S+=v,this.nonDisplayed_[this.row_].text=S},ht.prototype.rollUp=function(f,v){var S=this.displayed_[this.row_].text;S+=v,this.displayed_[this.row_].text=S},ht.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<Rt+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}},ht.prototype.paintOn=function(f,v){var S=this.displayed_[this.row_].text;S+=v,this.displayed_[this.row_].text=S};var ra={CaptionStream:st,Cea608Stream:ht,Cea708Stream:Ze},os={H264_STREAM_TYPE:27,ADTS_STREAM_TYPE:15,METADATA_STREAM_TYPE:21},su=t,au=8589934592,na=4294967296,ou="shared",Pn=function(f,v){var S=1;for(f>v&&(S=-1);Math.abs(v-f)>na;)f+=S*au;return f},sa=function(f){var v,S;sa.prototype.init.call(this),this.type_=f||ou,this.push=function(b){if(b.type==="metadata"){this.trigger("data",b);return}this.type_!==ou&&b.type!==this.type_||(S===void 0&&(S=b.dts),b.dts=Pn(b.dts,S),b.pts=Pn(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")}};sa.prototype=new su;var ls={TimestampRolloverStream:sa,handleRollover:Pn},ad=(f,v,S)=>{if(!f)return-1;for(var b=S;b<f.length;b++)if(f[b]===v)return b;return-1},od={typedArrayIndexOf:ad},ln=od.typedArrayIndexOf,Dr={Utf8:3},us=function(f,v,S){var b,w="";for(b=v;b<S;b++)w+="%"+("00"+f[b].toString(16)).slice(-2);return w},nr=function(f,v,S){return decodeURIComponent(us(f,v,S))},un=function(f,v,S){return unescape(us(f,v,S))},Dn=function(f){return f[0]<<21|f[1]<<14|f[2]<<7|f[3]},cn={APIC:function(f){var v=1,S,b,w="-->";f.data[0]===Dr.Utf8&&(S=ln(f.data,0,v),!(S<0)&&(f.mimeType=un(f.data,v,S),v=S+1,f.pictureType=f.data[v],v++,b=ln(f.data,0,v),!(b<0)&&(f.description=nr(f.data,v,b),v=b+1,f.mimeType===w?f.url=un(f.data,v,f.data.length):f.pictureData=f.data.subarray(v,f.data.length))))},"T*":function(f){f.data[0]===Dr.Utf8&&(f.value=nr(f.data,1,f.data.length).replace(/\0*$/,""),f.values=f.value.split("\0"))},TXXX:function(f){var v;f.data[0]===Dr.Utf8&&(v=ln(f.data,0,1),v!==-1&&(f.description=nr(f.data,1,v),f.value=nr(f.data,v+1,f.data.length).replace(/\0*$/,""),f.data=f.value))},"W*":function(f){f.url=un(f.data,0,f.data.length).replace(/\0.*$/,"")},WXXX:function(f){var v;f.data[0]===Dr.Utf8&&(v=ln(f.data,0,1),v!==-1&&(f.description=nr(f.data,1,v),f.url=un(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=un(f.data,0,v);break}f.privateData=f.data.subarray(v+1),f.data=f.privateData}},gr=function(f){var v,S,b=10,w=0,N=[];if(!(f.length<10||f[0]!==73||f[1]!==68||f[2]!==51)){w=Dn(f.subarray(6,10)),w+=10;var G=f[5]&64;G&&(b+=4,b+=Dn(f.subarray(10,14)),w-=Dn(f.subarray(16,20)));do{if(v=Dn(f.subarray(b+4,b+8)),v<1)break;S=String.fromCharCode(f[b],f[b+1],f[b+2],f[b+3]);var Q={id:S,data:f.subarray(b+10,b+v+10)};Q.key=Q.id,cn[Q.id]?cn[Q.id](Q):Q.id[0]==="T"?cn["T*"](Q):Q.id[0]==="W"&&cn["W*"](Q),N.push(Q),b+=10,b+=v}while(b<w);return N}},lu={parseId3Frames:gr,parseSyncSafeInteger:Dn,frameParsers:cn},aa=t,uu=os,vr=lu,cs;cs=function(f){var v={descriptor:f&&f.descriptor},S=0,b=[],w=0,N;if(cs.prototype.init.call(this),this.dispatchType=uu.METADATA_STREAM_TYPE.toString(16),v.descriptor)for(N=0;N<v.descriptor.length;N++)this.dispatchType+=("00"+v.descriptor[N].toString(16)).slice(-2);this.push=function(G){var Q,J,Z,ue,me,ke;if(G.type==="timed-metadata"){if(G.dataAlignmentIndicator&&(w=0,b.length=0),b.length===0&&(G.data.length<10||G.data[0]!==73||G.data[1]!==68||G.data[2]!==51)){this.trigger("log",{level:"warn",message:"Skipping unrecognized metadata packet"});return}if(b.push(G),w+=G.data.byteLength,b.length===1&&(S=vr.parseSyncSafeInteger(G.data.subarray(6,10)),S+=10),!(w<S)){for(Q={data:new Uint8Array(S),frames:[],pts:b[0].pts,dts:b[0].dts},me=0;me<S;)Q.data.set(b[0].data.subarray(0,S-me),me),me+=b[0].data.byteLength,w-=b[0].data.byteLength,b.shift();J=10,Q.data[5]&64&&(J+=4,J+=vr.parseSyncSafeInteger(Q.data.subarray(10,14)),S-=vr.parseSyncSafeInteger(Q.data.subarray(16,20)));do{if(Z=vr.parseSyncSafeInteger(Q.data.subarray(J+4,J+8)),Z<1){this.trigger("log",{level:"warn",message:"Malformed ID3 frame encountered. Skipping remaining metadata parsing."});break}if(ke=String.fromCharCode(Q.data[J],Q.data[J+1],Q.data[J+2],Q.data[J+3]),ue={id:ke,data:Q.data.subarray(J+10,J+Z+10)},ue.key=ue.id,vr.frameParsers[ue.id]?vr.frameParsers[ue.id](ue):ue.id[0]==="T"?vr.frameParsers["T*"](ue):ue.id[0]==="W"&&vr.frameParsers["W*"](ue),ue.owner==="com.apple.streaming.transportStreamTimestamp"){var ye=ue.data,Be=(ye[3]&1)<<30|ye[4]<<22|ye[5]<<14|ye[6]<<6|ye[7]>>>2;Be*=4,Be+=ye[7]&3,ue.timeStamp=Be,Q.pts===void 0&&Q.dts===void 0&&(Q.pts=ue.timeStamp,Q.dts=ue.timeStamp),this.trigger("timestamp",ue)}Q.frames.push(ue),J+=10,J+=Z}while(J<S);this.trigger("data",Q)}}}},cs.prototype=new aa;var ld=cs,Nn=t,Ln=ra,Ii=os,ud=ls.TimestampRolloverStream,oa,On,la,Rn=188,ua=71;oa=function(){var f=new Uint8Array(Rn),v=0;oa.prototype.init.call(this),this.push=function(S){var b=0,w=Rn,N;for(v?(N=new Uint8Array(S.byteLength+v),N.set(f.subarray(0,v)),N.set(S,v),v=0):N=S;w<N.byteLength;){if(N[b]===ua&&N[w]===ua){this.trigger("data",N.subarray(b,w)),b+=Rn,w+=Rn;continue}b++,w++}b<N.byteLength&&(f.set(N.subarray(b),0),v=N.byteLength-b)},this.flush=function(){v===Rn&&f[0]===ua&&(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")}},oa.prototype=new Nn,On=function(){var f,v,S,b;On.prototype.init.call(this),b=this,this.packetsWaitingForPmt=[],this.programMapTable=void 0,f=function(w,N){var G=0;N.payloadUnitStartIndicator&&(G+=w[G]+1),N.type==="pat"?v(w.subarray(G),N):S(w.subarray(G),N)},v=function(w,N){N.section_number=w[7],N.last_section_number=w[8],b.pmtPid=(w[10]&31)<<8|w[11],N.pmtPid=b.pmtPid},S=function(w,N){var G,Q,J,Z;if(w[5]&1){for(b.programMapTable={video:null,audio:null,"timed-metadata":{}},G=(w[1]&15)<<8|w[2],Q=3+G-4,J=(w[10]&15)<<8|w[11],Z=12+J;Z<Q;){var ue=w[Z],me=(w[Z+1]&31)<<8|w[Z+2];ue===Ii.H264_STREAM_TYPE&&b.programMapTable.video===null?b.programMapTable.video=me:ue===Ii.ADTS_STREAM_TYPE&&b.programMapTable.audio===null?b.programMapTable.audio=me:ue===Ii.METADATA_STREAM_TYPE&&(b.programMapTable["timed-metadata"][me]=ue),Z+=((w[Z+3]&15)<<8|w[Z+4])+5}N.programMapTable=b.programMapTable}},this.push=function(w){var N={},G=4;if(N.payloadUnitStartIndicator=!!(w[1]&64),N.pid=w[1]&31,N.pid<<=8,N.pid|=w[2],(w[3]&48)>>>4>1&&(G+=w[G]+1),N.pid===0)N.type="pat",f(w.subarray(G),N),this.trigger("data",N);else if(N.pid===this.pmtPid)for(N.type="pmt",f(w.subarray(G),N),this.trigger("data",N);this.packetsWaitingForPmt.length;)this.processPes_.apply(this,this.packetsWaitingForPmt.shift());else this.programMapTable===void 0?this.packetsWaitingForPmt.push([w,G,N]):this.processPes_(w,G,N)},this.processPes_=function(w,N,G){G.pid===this.programMapTable.video?G.streamType=Ii.H264_STREAM_TYPE:G.pid===this.programMapTable.audio?G.streamType=Ii.ADTS_STREAM_TYPE:G.streamType=this.programMapTable["timed-metadata"][G.pid],G.type="pes",G.data=w.subarray(N),this.trigger("data",G)}},On.prototype=new Nn,On.STREAM_TYPES={h264:27,adts:15},la=function(){var f=this,v=!1,S={data:[],size:0},b={data:[],size:0},w={data:[],size:0},N,G=function(J,Z){var ue;const me=J[0]<<16|J[1]<<8|J[2];Z.data=new Uint8Array,me===1&&(Z.packetLength=6+(J[4]<<8|J[5]),Z.dataAlignmentIndicator=(J[6]&4)!==0,ue=J[7],ue&192&&(Z.pts=(J[9]&14)<<27|(J[10]&255)<<20|(J[11]&254)<<12|(J[12]&255)<<5|(J[13]&254)>>>3,Z.pts*=4,Z.pts+=(J[13]&6)>>>1,Z.dts=Z.pts,ue&64&&(Z.dts=(J[14]&14)<<27|(J[15]&255)<<20|(J[16]&254)<<12|(J[17]&255)<<5|(J[18]&254)>>>3,Z.dts*=4,Z.dts+=(J[18]&6)>>>1)),Z.data=J.subarray(9+J[8]))},Q=function(J,Z,ue){var me=new Uint8Array(J.size),ke={type:Z},ye=0,Be=0,We=!1,Xt;if(!(!J.data.length||J.size<9)){for(ke.trackId=J.data[0].pid,ye=0;ye<J.data.length;ye++)Xt=J.data[ye],me.set(Xt.data,Be),Be+=Xt.data.byteLength;G(me,ke),We=Z==="video"||ke.packetLength<=J.size,(ue||We)&&(J.size=0,J.data.length=0),We&&f.trigger("data",ke)}};la.prototype.init.call(this),this.push=function(J){({pat:function(){},pes:function(){var Z,ue;switch(J.streamType){case Ii.H264_STREAM_TYPE:Z=S,ue="video";break;case Ii.ADTS_STREAM_TYPE:Z=b,ue="audio";break;case Ii.METADATA_STREAM_TYPE:Z=w,ue="timed-metadata";break;default:return}J.payloadUnitStartIndicator&&Q(Z,ue,!0),Z.data.push(J),Z.size+=J.data.byteLength},pmt:function(){var Z={type:"metadata",tracks:[]};N=J.programMapTable,N.video!==null&&Z.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+N.video,codec:"avc",type:"video"}),N.audio!==null&&Z.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+N.audio,codec:"adts",type:"audio"}),v=!0,f.trigger("data",Z)}})[J.type]()},this.reset=function(){S.size=0,S.data.length=0,b.size=0,b.data.length=0,this.trigger("reset")},this.flushStreams_=function(){Q(S,"video"),Q(b,"audio"),Q(w,"timed-metadata")},this.flush=function(){if(!v&&N){var J={type:"metadata",tracks:[]};N.video!==null&&J.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+N.video,codec:"avc",type:"video"}),N.audio!==null&&J.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+N.audio,codec:"adts",type:"audio"}),f.trigger("data",J)}v=!1,this.flushStreams_(),this.trigger("done")}},la.prototype=new Nn;var cu={PAT_PID:0,MP2T_PACKET_LENGTH:Rn,TransportPacketStream:oa,TransportParseStream:On,ElementaryStream:la,TimestampRolloverStream:ud,CaptionStream:Ln.CaptionStream,Cea608Stream:Ln.Cea608Stream,Cea708Stream:Ln.Cea708Stream,MetadataStream:ld};for(var Uo in Ii)Ii.hasOwnProperty(Uo)&&(cu[Uo]=Ii[Uo]);var cd=cu,hd=t,dd=rt.ONE_SECOND_IN_TS,ca,hs=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350];ca=function(f){var v,S=0;ca.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,N,G,Q,J,Z;if(f||(S=0),b.type==="audio"){v&&v.length?(Q=v,v=new Uint8Array(Q.byteLength+b.data.byteLength),v.set(Q),v.set(b.data,Q.byteLength)):v=b.data;for(var ue;w+7<v.length;){if(v[w]!==255||(v[w+1]&246)!==240){typeof ue!="number"&&(ue=w),w++;continue}if(typeof ue=="number"&&(this.skipWarn_(ue,w),ue=null),G=(~v[w+1]&1)*2,N=(v[w+3]&3)<<11|v[w+4]<<3|(v[w+5]&224)>>5,J=((v[w+6]&3)+1)*1024,Z=J*dd/hs[(v[w+2]&60)>>>2],v.byteLength-w<N)break;this.trigger("data",{pts:b.pts+S*Z,dts:b.dts+S*Z,sampleCount:J,audioobjecttype:(v[w+2]>>>6&3)+1,channelcount:(v[w+2]&1)<<2|(v[w+3]&192)>>>6,samplerate:hs[(v[w+2]&60)>>>2],samplingfrequencyindex:(v[w+2]&60)>>>2,samplesize:16,data:v.subarray(w+7+G,w+N)}),S++,w+=N}typeof ue=="number"&&(this.skipWarn_(ue,w),ue=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")}},ca.prototype=new hd;var ha=ca,hu;hu=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,N=new Uint8Array(4),G=Math.min(4,v);if(G===0)throw new Error("no bytes available");N.set(f.subarray(w,w+G)),S=new DataView(N.buffer).getUint32(0),b=G*8,v-=G},this.skipBits=function(w){var N;b>w?(S<<=w,b-=w):(w-=b,N=Math.floor(w/8),w-=N*8,v-=N,this.loadWord(),S<<=w,b-=w)},this.readBits=function(w){var N=Math.min(b,w),G=S>>>32-N;return b-=N,b>0?S<<=N:v>0&&this.loadWord(),N=w-N,N>0?G<<N|this.readBits(N):G},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 fd=hu,jo=t,pd=fd,ds,da,du;da=function(){var f=0,v,S;da.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 N=S.byteLength;f<N-3;f++)if(S[f+2]===1){v=f+5;break}for(;v<N;)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<N);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")}},da.prototype=new jo,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},ds=function(){var f=new da,v,S,b,w,N,G,Q;ds.prototype.init.call(this),v=this,this.push=function(J){J.type==="video"&&(S=J.trackId,b=J.pts,w=J.dts,f.push(J))},f.on("data",function(J){var Z={trackId:S,pts:b,dts:w,data:J,nalUnitTypeCode:J[0]&31};switch(Z.nalUnitTypeCode){case 5:Z.nalUnitType="slice_layer_without_partitioning_rbsp_idr";break;case 6:Z.nalUnitType="sei_rbsp",Z.escapedRBSP=N(J.subarray(1));break;case 7:Z.nalUnitType="seq_parameter_set_rbsp",Z.escapedRBSP=N(J.subarray(1)),Z.config=G(Z.escapedRBSP);break;case 8:Z.nalUnitType="pic_parameter_set_rbsp";break;case 9:Z.nalUnitType="access_unit_delimiter_rbsp";break}v.trigger("data",Z)}),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()},Q=function(J,Z){var ue=8,me=8,ke,ye;for(ke=0;ke<J;ke++)me!==0&&(ye=Z.readExpGolomb(),me=(ue+ye+256)%256),ue=me===0?ue:me},N=function(J){for(var Z=J.byteLength,ue=[],me=1,ke,ye;me<Z-2;)J[me]===0&&J[me+1]===0&&J[me+2]===3?(ue.push(me+2),me+=2):me++;if(ue.length===0)return J;ke=Z-ue.length,ye=new Uint8Array(ke);var Be=0;for(me=0;me<ke;Be++,me++)Be===ue[0]&&(Be++,ue.shift()),ye[me]=J[Be];return ye},G=function(J){var Z=0,ue=0,me=0,ke=0,ye,Be,We,Xt,zi,Hn,Ko,Xo,Qo,Yo,Nu,bt=[1,1],Jo,Tr;if(ye=new pd(J),Be=ye.readUnsignedByte(),Xt=ye.readUnsignedByte(),We=ye.readUnsignedByte(),ye.skipUnsignedExpGolomb(),du[Be]&&(zi=ye.readUnsignedExpGolomb(),zi===3&&ye.skipBits(1),ye.skipUnsignedExpGolomb(),ye.skipUnsignedExpGolomb(),ye.skipBits(1),ye.readBoolean()))for(Nu=zi!==3?8:12,Tr=0;Tr<Nu;Tr++)ye.readBoolean()&&(Tr<6?Q(16,ye):Q(64,ye));if(ye.skipUnsignedExpGolomb(),Hn=ye.readUnsignedExpGolomb(),Hn===0)ye.readUnsignedExpGolomb();else if(Hn===1)for(ye.skipBits(1),ye.skipExpGolomb(),ye.skipExpGolomb(),Ko=ye.readUnsignedExpGolomb(),Tr=0;Tr<Ko;Tr++)ye.skipExpGolomb();if(ye.skipUnsignedExpGolomb(),ye.skipBits(1),Xo=ye.readUnsignedExpGolomb(),Qo=ye.readUnsignedExpGolomb(),Yo=ye.readBits(1),Yo===0&&ye.skipBits(1),ye.skipBits(1),ye.readBoolean()&&(Z=ye.readUnsignedExpGolomb(),ue=ye.readUnsignedExpGolomb(),me=ye.readUnsignedExpGolomb(),ke=ye.readUnsignedExpGolomb()),ye.readBoolean()&&ye.readBoolean()){switch(Jo=ye.readUnsignedByte(),Jo){case 1:bt=[1,1];break;case 2:bt=[12,11];break;case 3:bt=[10,11];break;case 4:bt=[16,11];break;case 5:bt=[40,33];break;case 6:bt=[24,11];break;case 7:bt=[20,11];break;case 8:bt=[32,11];break;case 9:bt=[80,33];break;case 10:bt=[18,11];break;case 11:bt=[15,11];break;case 12:bt=[64,33];break;case 13:bt=[160,99];break;case 14:bt=[4,3];break;case 15:bt=[3,2];break;case 16:bt=[2,1];break;case 255:{bt=[ye.readUnsignedByte()<<8|ye.readUnsignedByte(),ye.readUnsignedByte()<<8|ye.readUnsignedByte()];break}}bt&&bt[0]/bt[1]}return{profileIdc:Be,levelIdc:We,profileCompatibility:Xt,width:(Xo+1)*16-Z*2-ue*2,height:(2-Yo)*(Qo+1)*16-me*2-ke*2,sarRatio:bt}}},ds.prototype=new jo;var md={H264Stream:ds},fa=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350],Mn=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},fs=function(f,v){return f.length-v<10||f[v]!==73||f[v+1]!==68||f[v+2]!==51?v:(v+=Mn(f,v),fs(f,v))},hn=function(f){var v=fs(f,0);return f.length>=v+2&&(f[v]&255)===255&&(f[v+1]&240)===240&&(f[v+1]&22)===16},fu=function(f){return f[0]<<21|f[1]<<14|f[2]<<7|f[3]},pu=function(f,v,S){var b,w="";for(b=v;b<S;b++)w+="%"+("00"+f[b].toString(16)).slice(-2);return w},mu=function(f,v,S){return unescape(pu(f,v,S))},gu=function(f,v){var S=(f[v+5]&224)>>5,b=f[v+4]<<3,w=f[v+3]&6144;return w|b|S},gd=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},vd=function(f){for(var v=0;v+5<f.length;){if(f[v]!==255||(f[v+1]&246)!==240){v++;continue}return fa[(f[v+2]&60)>>>2]}return null},yd=function(f){var v,S,b,w;v=10,f[5]&64&&(v+=4,v+=fu(f.subarray(10,14)));do{if(S=fu(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 N=0;N<b.byteLength;N++)if(b[N]===0){var G=mu(b,0,N);if(G==="com.apple.streaming.transportStreamTimestamp"){var Q=b.subarray(N+1),J=(Q[3]&1)<<30|Q[4]<<22|Q[5]<<14|Q[6]<<6|Q[7]>>>2;return J*=4,J+=Q[7]&3,J}break}}v+=10,v+=S}while(v<f.byteLength);return null},Fn={isLikelyAacData:hn,parseId3TagSize:Mn,parseAdtsSize:gu,parseType:gd,parseSampleRate:vd,parseAacTimestamp:yd},_d=t,Nr=Fn,pa;pa=function(){var f=new Uint8Array,v=0;pa.prototype.init.call(this),this.setTimestamp=function(S){v=S},this.push=function(S){var b=0,w=0,N,G,Q,J;for(f.length?(J=f.length,f=new Uint8Array(S.byteLength+J),f.set(f.subarray(0,J)),f.set(S,J)):f=S;f.length-w>=3;){if(f[w]===73&&f[w+1]===68&&f[w+2]===51){if(f.length-w<10||(b=Nr.parseId3TagSize(f,w),w+b>f.length))break;G={type:"timed-metadata",data:f.subarray(w,w+b)},this.trigger("data",G),w+=b;continue}else if((f[w]&255)===255&&(f[w+1]&240)===240){if(f.length-w<7||(b=Nr.parseAdtsSize(f,w),w+b>f.length))break;Q={type:"audio",data:f.subarray(w,w+b),pts:v,dts:v},this.trigger("data",Q),w+=b;continue}w++}N=f.length-w,N>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")}},pa.prototype=new _d;var Td=pa,dt=["audioobjecttype","channelcount","samplerate","samplingfrequencyindex","samplesize"],bd=dt,Sd=["width","height","profileIdc","levelIdc","profileCompatibility","sarRatio"],xd=Sd,ps=t,ms=Re,Bn=Ce,ma=ia,Pi=Ee,yr=cd,gs=rt,$o=ha,vs=md.H264Stream,ys=Td,Cd=Fn.isLikelyAacData,Ed=rt.ONE_SECOND_IN_TS,vu=bd,yu=xd,ga,_s,va,dn,wd=function(f,v){v.stream=f,this.trigger("log",v)},Ts=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",wd.bind(f,w))}},Un=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},_u=function(f,v,S,b,w,N){var G=S-v,Q=b-v,J=w-S;return{start:{dts:f,pts:f+G},end:{dts:f+Q,pts:f+J},prependedContentDuration:N,baseMediaDecodeTime:f}};_s=function(f,v){var S=[],b,w=0,N=0,G=1/0;v=v||{},b=v.firstSequenceNumber||0,_s.prototype.init.call(this),this.push=function(Q){Pi.collectDtsInfo(f,Q),f&&vu.forEach(function(J){f[J]=Q[J]}),S.push(Q)},this.setEarliestDts=function(Q){w=Q},this.setVideoBaseMediaDecodeTime=function(Q){G=Q},this.setAudioAppendStart=function(Q){N=Q},this.flush=function(){var Q,J,Z,ue,me,ke,ye;if(S.length===0){this.trigger("done","AudioSegmentStream");return}Q=ma.trimAdtsFramesByEarliestDts(S,f,w),f.baseMediaDecodeTime=Pi.calculateTrackBaseMediaDecodeTime(f,v.keepOriginalTimestamps),ye=ma.prefixWithSilence(f,Q,N,G),f.samples=ma.generateSampleTable(Q),Z=ms.mdat(ma.concatenateFrameData(Q)),S=[],J=ms.moof(b,[f]),ue=new Uint8Array(J.byteLength+Z.byteLength),b++,ue.set(J),ue.set(Z,J.byteLength),Pi.clearDtsInfo(f),me=Math.ceil(Ed*1024/f.samplerate),Q.length&&(ke=Q.length*me,this.trigger("segmentTimingInfo",_u(gs.audioTsToVideoTs(f.baseMediaDecodeTime,f.samplerate),Q[0].dts,Q[0].pts,Q[0].dts+ke,Q[0].pts+ke,ye||0)),this.trigger("timingInfo",{start:Q[0].pts,end:Q[0].pts+ke})),this.trigger("data",{track:f,boxes:ue}),this.trigger("done","AudioSegmentStream")},this.reset=function(){Pi.clearDtsInfo(f),S=[],this.trigger("reset")}},_s.prototype=new ps,ga=function(f,v){var S,b=[],w=[],N,G;v=v||{},S=v.firstSequenceNumber||0,ga.prototype.init.call(this),delete f.minPTS,this.gopCache_=[],this.push=function(Q){Pi.collectDtsInfo(f,Q),Q.nalUnitType==="seq_parameter_set_rbsp"&&!N&&(N=Q.config,f.sps=[Q.data],yu.forEach(function(J){f[J]=N[J]},this)),Q.nalUnitType==="pic_parameter_set_rbsp"&&!G&&(G=Q.data,f.pps=[Q.data]),b.push(Q)},this.flush=function(){for(var Q,J,Z,ue,me,ke,ye=0,Be,We;b.length&&b[0].nalUnitType!=="access_unit_delimiter_rbsp";)b.shift();if(b.length===0){this.resetStream_(),this.trigger("done","VideoSegmentStream");return}if(Q=Bn.groupNalsIntoFrames(b),Z=Bn.groupFramesIntoGops(Q),Z[0][0].keyFrame||(J=this.getGopForFusion_(b[0],f),J?(ye=J.duration,Z.unshift(J),Z.byteLength+=J.byteLength,Z.nalCount+=J.nalCount,Z.pts=J.pts,Z.dts=J.dts,Z.duration+=J.duration):Z=Bn.extendFirstKeyFrame(Z)),w.length){var Xt;if(v.alignGopsAtEnd?Xt=this.alignGopsAtEnd_(Z):Xt=this.alignGopsAtStart_(Z),!Xt){this.gopCache_.unshift({gop:Z.pop(),pps:f.pps,sps:f.sps}),this.gopCache_.length=Math.min(6,this.gopCache_.length),b=[],this.resetStream_(),this.trigger("done","VideoSegmentStream");return}Pi.clearDtsInfo(f),Z=Xt}Pi.collectDtsInfo(f,Z),f.samples=Bn.generateSampleTable(Z),me=ms.mdat(Bn.concatenateNalData(Z)),f.baseMediaDecodeTime=Pi.calculateTrackBaseMediaDecodeTime(f,v.keepOriginalTimestamps),this.trigger("processedGopsInfo",Z.map(function(zi){return{pts:zi.pts,dts:zi.dts,byteLength:zi.byteLength}})),Be=Z[0],We=Z[Z.length-1],this.trigger("segmentTimingInfo",_u(f.baseMediaDecodeTime,Be.dts,Be.pts,We.dts+We.duration,We.pts+We.duration,ye)),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: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),ue=ms.moof(S,[f]),ke=new Uint8Array(ue.byteLength+me.byteLength),S++,ke.set(ue),ke.set(me,ue.byteLength),this.trigger("data",{track:f,boxes:ke}),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(){Pi.clearDtsInfo(f),N=void 0,G=void 0},this.getGopForFusion_=function(Q){var J=45e3,Z=1/0,ue,me,ke,ye,Be;for(Be=0;Be<this.gopCache_.length;Be++)ye=this.gopCache_[Be],ke=ye.gop,!(!(f.pps&&Un(f.pps[0],ye.pps[0]))||!(f.sps&&Un(f.sps[0],ye.sps[0])))&&(ke.dts<f.timelineStartInfo.dts||(ue=Q.dts-ke.dts-ke.duration,ue>=-1e4&&ue<=J&&(!me||Z>ue)&&(me=ye,Z=ue)));return me?me.gop:null},this.alignGopsAtStart_=function(Q){var J,Z,ue,me,ke,ye,Be,We;for(ke=Q.byteLength,ye=Q.nalCount,Be=Q.duration,J=Z=0;J<w.length&&Z<Q.length&&(ue=w[J],me=Q[Z],ue.pts!==me.pts);){if(me.pts>ue.pts){J++;continue}Z++,ke-=me.byteLength,ye-=me.nalCount,Be-=me.duration}return Z===0?Q:Z===Q.length?null:(We=Q.slice(Z),We.byteLength=ke,We.duration=Be,We.nalCount=ye,We.pts=We[0].pts,We.dts=We[0].dts,We)},this.alignGopsAtEnd_=function(Q){var J,Z,ue,me,ke,ye;for(J=w.length-1,Z=Q.length-1,ke=null,ye=!1;J>=0&&Z>=0;){if(ue=w[J],me=Q[Z],ue.pts===me.pts){ye=!0;break}if(ue.pts>me.pts){J--;continue}J===w.length-1&&(ke=Z),Z--}if(!ye&&ke===null)return null;var Be;if(ye?Be=Z:Be=ke,Be===0)return Q;var We=Q.slice(Be),Xt=We.reduce(function(zi,Hn){return zi.byteLength+=Hn.byteLength,zi.duration+=Hn.duration,zi.nalCount+=Hn.nalCount,zi},{byteLength:0,duration:0,nalCount:0});return We.byteLength=Xt.byteLength,We.duration=Xt.duration,We.nalCount=Xt.nalCount,We.pts=We[0].pts,We.dts=We[0].dts,We},this.alignGopsWith=function(Q){w=Q}},ga.prototype=new ps,dn=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,dn.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))}},dn.prototype=new ps,dn.prototype.flush=function(f){var v=0,S={captions:[],captionStreams:{},metadata:[],info:{}},b,w,N,G=0,Q;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?(G=this.videoTrack.timelineStartInfo.pts,yu.forEach(function(J){S.info[J]=this.videoTrack[J]},this)):this.audioTrack&&(G=this.audioTrack.timelineStartInfo.pts,vu.forEach(function(J){S.info[J]=this.audioTrack[J]},this)),this.videoTrack||this.audioTrack){for(this.pendingTracks.length===1?S.type=this.pendingTracks[0].type:S.type="combined",this.emittedTracks+=this.pendingTracks.length,N=ms.initSegment(this.pendingTracks),S.initSegment=new Uint8Array(N.byteLength),S.initSegment.set(N),S.data=new Uint8Array(this.pendingBytes),Q=0;Q<this.pendingBoxes.length;Q++)S.data.set(this.pendingBoxes[Q],v),v+=this.pendingBoxes[Q].byteLength;for(Q=0;Q<this.pendingCaptions.length;Q++)b=this.pendingCaptions[Q],b.startTime=gs.metadataTsToSeconds(b.startPts,G,this.keepOriginalTimestamps),b.endTime=gs.metadataTsToSeconds(b.endPts,G,this.keepOriginalTimestamps),S.captionStreams[b.stream]=!0,S.captions.push(b);for(Q=0;Q<this.pendingMetadata.length;Q++)w=this.pendingMetadata[Q],w.cueTime=gs.metadataTsToSeconds(w.pts,G,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),Q=0;Q<S.captions.length;Q++)b=S.captions[Q],this.trigger("caption",b);for(Q=0;Q<S.metadata.length;Q++)w=S.metadata[Q],this.trigger("id3Frame",w)}this.emittedTracks>=this.numberOfTracks&&(this.trigger("done"),this.emittedTracks=0)},dn.prototype.setRemux=function(f){this.remuxTracks=f},va=function(f){var v=this,S=!0,b,w;va.prototype.init.call(this),f=f||{},this.baseMediaDecodeTime=f.baseMediaDecodeTime||0,this.transmuxPipeline_={},this.setupAacPipeline=function(){var N={};this.transmuxPipeline_=N,N.type="aac",N.metadataStream=new yr.MetadataStream,N.aacStream=new ys,N.audioTimestampRolloverStream=new yr.TimestampRolloverStream("audio"),N.timedMetadataTimestampRolloverStream=new yr.TimestampRolloverStream("timed-metadata"),N.adtsStream=new $o,N.coalesceStream=new dn(f,N.metadataStream),N.headOfPipeline=N.aacStream,N.aacStream.pipe(N.audioTimestampRolloverStream).pipe(N.adtsStream),N.aacStream.pipe(N.timedMetadataTimestampRolloverStream).pipe(N.metadataStream).pipe(N.coalesceStream),N.metadataStream.on("timestamp",function(G){N.aacStream.setTimestamp(G.timeStamp)}),N.aacStream.on("data",function(G){G.type!=="timed-metadata"&&G.type!=="audio"||N.audioSegmentStream||(w=w||{timelineStartInfo:{baseMediaDecodeTime:v.baseMediaDecodeTime},codec:"adts",type:"audio"},N.coalesceStream.numberOfTracks++,N.audioSegmentStream=new _s(w,f),N.audioSegmentStream.on("log",v.getLogTrigger_("audioSegmentStream")),N.audioSegmentStream.on("timingInfo",v.trigger.bind(v,"audioTimingInfo")),N.adtsStream.pipe(N.audioSegmentStream).pipe(N.coalesceStream),v.trigger("trackinfo",{hasAudio:!!w,hasVideo:!!b}))}),N.coalesceStream.on("data",this.trigger.bind(this,"data")),N.coalesceStream.on("done",this.trigger.bind(this,"done")),Ts(this,N)},this.setupTsPipeline=function(){var N={};this.transmuxPipeline_=N,N.type="ts",N.metadataStream=new yr.MetadataStream,N.packetStream=new yr.TransportPacketStream,N.parseStream=new yr.TransportParseStream,N.elementaryStream=new yr.ElementaryStream,N.timestampRolloverStream=new yr.TimestampRolloverStream,N.adtsStream=new $o,N.h264Stream=new vs,N.captionStream=new yr.CaptionStream(f),N.coalesceStream=new dn(f,N.metadataStream),N.headOfPipeline=N.packetStream,N.packetStream.pipe(N.parseStream).pipe(N.elementaryStream).pipe(N.timestampRolloverStream),N.timestampRolloverStream.pipe(N.h264Stream),N.timestampRolloverStream.pipe(N.adtsStream),N.timestampRolloverStream.pipe(N.metadataStream).pipe(N.coalesceStream),N.h264Stream.pipe(N.captionStream).pipe(N.coalesceStream),N.elementaryStream.on("data",function(G){var Q;if(G.type==="metadata"){for(Q=G.tracks.length;Q--;)!b&&G.tracks[Q].type==="video"?(b=G.tracks[Q],b.timelineStartInfo.baseMediaDecodeTime=v.baseMediaDecodeTime):!w&&G.tracks[Q].type==="audio"&&(w=G.tracks[Q],w.timelineStartInfo.baseMediaDecodeTime=v.baseMediaDecodeTime);b&&!N.videoSegmentStream&&(N.coalesceStream.numberOfTracks++,N.videoSegmentStream=new ga(b,f),N.videoSegmentStream.on("log",v.getLogTrigger_("videoSegmentStream")),N.videoSegmentStream.on("timelineStartInfo",function(J){w&&!f.keepOriginalTimestamps&&(w.timelineStartInfo=J,N.audioSegmentStream.setEarliestDts(J.dts-v.baseMediaDecodeTime))}),N.videoSegmentStream.on("processedGopsInfo",v.trigger.bind(v,"gopInfo")),N.videoSegmentStream.on("segmentTimingInfo",v.trigger.bind(v,"videoSegmentTimingInfo")),N.videoSegmentStream.on("baseMediaDecodeTime",function(J){w&&N.audioSegmentStream.setVideoBaseMediaDecodeTime(J)}),N.videoSegmentStream.on("timingInfo",v.trigger.bind(v,"videoTimingInfo")),N.h264Stream.pipe(N.videoSegmentStream).pipe(N.coalesceStream)),w&&!N.audioSegmentStream&&(N.coalesceStream.numberOfTracks++,N.audioSegmentStream=new _s(w,f),N.audioSegmentStream.on("log",v.getLogTrigger_("audioSegmentStream")),N.audioSegmentStream.on("timingInfo",v.trigger.bind(v,"audioTimingInfo")),N.audioSegmentStream.on("segmentTimingInfo",v.trigger.bind(v,"audioSegmentTimingInfo")),N.adtsStream.pipe(N.audioSegmentStream).pipe(N.coalesceStream)),v.trigger("trackinfo",{hasAudio:!!w,hasVideo:!!b})}}),N.coalesceStream.on("data",this.trigger.bind(this,"data")),N.coalesceStream.on("id3Frame",function(G){G.dispatchType=N.metadataStream.dispatchType,v.trigger("id3Frame",G)}),N.coalesceStream.on("caption",this.trigger.bind(this,"caption")),N.coalesceStream.on("done",this.trigger.bind(this,"done")),Ts(this,N)},this.setBaseMediaDecodeTime=function(N){var G=this.transmuxPipeline_;f.keepOriginalTimestamps||(this.baseMediaDecodeTime=N),w&&(w.timelineStartInfo.dts=void 0,w.timelineStartInfo.pts=void 0,Pi.clearDtsInfo(w),G.audioTimestampRolloverStream&&G.audioTimestampRolloverStream.discontinuity()),b&&(G.videoSegmentStream&&(G.videoSegmentStream.gopCache_=[]),b.timelineStartInfo.dts=void 0,b.timelineStartInfo.pts=void 0,Pi.clearDtsInfo(b),G.captionStream.reset()),G.timestampRolloverStream&&G.timestampRolloverStream.discontinuity()},this.setAudioAppendStart=function(N){w&&this.transmuxPipeline_.audioSegmentStream.setAudioAppendStart(N)},this.setRemux=function(N){var G=this.transmuxPipeline_;f.remux=N,G&&G.coalesceStream&&G.coalesceStream.setRemux(N)},this.alignGopsWith=function(N){b&&this.transmuxPipeline_.videoSegmentStream&&this.transmuxPipeline_.videoSegmentStream.alignGopsWith(N)},this.getLogTrigger_=function(N){var G=this;return function(Q){Q.stream=N,G.trigger("log",Q)}},this.push=function(N){if(S){var G=Cd(N);G&&this.transmuxPipeline_.type!=="aac"?this.setupAacPipeline():!G&&this.transmuxPipeline_.type!=="ts"&&this.setupTsPipeline(),S=!1}this.transmuxPipeline_.headOfPipeline.push(N)},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()}},va.prototype=new ps;var Tu={Transmuxer:va},bu=function(f){return f>>>0},Su=function(f){return("00"+f.toString(16)).slice(-2)},bs={toUnsigned:bu,toHexString:Su},xu=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},ya=xu,Cu=bs.toUnsigned,Eu=ya,Ss=function(f,v){var S=[],b,w,N,G,Q;if(!v.length)return null;for(b=0;b<f.byteLength;)w=Cu(f[b]<<24|f[b+1]<<16|f[b+2]<<8|f[b+3]),N=Eu(f.subarray(b+4,b+8)),G=w>1?b+w:f.byteLength,N===v[0]&&(v.length===1?S.push(f.subarray(b+8,G)):(Q=Ss(f.subarray(b+8,G),v.slice(1)),Q.length&&(S=S.concat(Q)))),b=G;return S},jn=Ss,kd=bs.toUnsigned,Ad=n.getUint64,Id=function(f){var v={version:f[0],flags:new Uint8Array(f.subarray(1,4))};return v.version===1?v.baseMediaDecodeTime=Ad(f.subarray(4)):v.baseMediaDecodeTime=kd(f[4]<<24|f[5]<<16|f[6]<<8|f[7]),v},qo=Id,Pd=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,N=S.flags[2]&8,G=S.flags[2]&16,Q=S.flags[2]&32,J=S.flags[0]&65536,Z=S.flags[0]&131072,ue;return ue=8,b&&(ue+=4,S.baseDataOffset=v.getUint32(12),ue+=4),w&&(S.sampleDescriptionIndex=v.getUint32(ue),ue+=4),N&&(S.defaultSampleDuration=v.getUint32(ue),ue+=4),G&&(S.defaultSampleSize=v.getUint32(ue),ue+=4),Q&&(S.defaultSampleFlags=v.getUint32(ue)),J&&(S.durationIsEmpty=!0),!b&&Z&&(S.baseDataOffsetIsMoof=!0),S},_a=Pd,Dd=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]}},Nd=Dd,fn=Nd,nt=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,N=v.flags[1]&1,G=v.flags[1]&2,Q=v.flags[1]&4,J=v.flags[1]&8,Z=S.getUint32(4),ue=8,me;for(b&&(v.dataOffset=S.getInt32(ue),ue+=4),w&&Z&&(me={flags:fn(f.subarray(ue,ue+4))},ue+=4,N&&(me.duration=S.getUint32(ue),ue+=4),G&&(me.size=S.getUint32(ue),ue+=4),J&&(v.version===1?me.compositionTimeOffset=S.getInt32(ue):me.compositionTimeOffset=S.getUint32(ue),ue+=4),v.samples.push(me),Z--);Z--;)me={},N&&(me.duration=S.getUint32(ue),ue+=4),G&&(me.size=S.getUint32(ue),ue+=4),Q&&(me.flags=fn(f.subarray(ue,ue+4)),ue+=4),J&&(v.version===1?me.compositionTimeOffset=S.getInt32(ue):me.compositionTimeOffset=S.getUint32(ue),ue+=4),v.samples.push(me);return v},Lr=nt,Kt={tfdt:qo,trun:Lr},Hi={parseTfdt:Kt.tfdt,parseTrun:Kt.trun},Ld=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},wu={uint8ToCString:Ld},Ta=wu.uint8ToCString,Od=n.getUint64,Rd=function(f){var v=4,S=f[0],b,w,N,G,Q,J,Z,ue;if(S===0){b=Ta(f.subarray(v)),v+=b.length,w=Ta(f.subarray(v)),v+=w.length;var me=new DataView(f.buffer);N=me.getUint32(v),v+=4,Q=me.getUint32(v),v+=4,J=me.getUint32(v),v+=4,Z=me.getUint32(v),v+=4}else if(S===1){var me=new DataView(f.buffer);N=me.getUint32(v),v+=4,G=Od(f.subarray(v)),v+=8,J=me.getUint32(v),v+=4,Z=me.getUint32(v),v+=4,b=Ta(f.subarray(v)),v+=b.length,w=Ta(f.subarray(v)),v+=w.length}ue=new Uint8Array(f.subarray(v,f.byteLength));var ke={scheme_id_uri:b,value:w,timescale:N||1,presentation_time:G,presentation_time_delta:Q,event_duration:J,id:Z,message_data:ue};return Fd(S,ke)?ke:void 0},Md=function(f,v,S,b){return f||f===0?f/v:b+S/v},Fd=function(f,v){var S=v.scheme_id_uri!=="\0",b=f===0&&ku(v.presentation_time_delta)&&S,w=f===1&&ku(v.presentation_time)&&S;return!(f>1)&&b||w},ku=function(f){return f!==void 0||f!==null},Bd={parseEmsgBox:Rd,scaleTime:Md},$n;typeof window<"u"?$n=window:typeof s<"u"?$n=s:typeof self<"u"?$n=self:$n={};var q=$n,m=bs.toUnsigned,x=bs.toHexString,T=jn,E=ya,D=Bd,M=_a,W=Lr,Y=qo,ie=n.getUint64,ee,ae,ge,xe,Ie,Se,Ve,It=q,ni=lu.parseId3Frames;ee=function(f){var v={},S=T(f,["moov","trak"]);return S.reduce(function(b,w){var N,G,Q,J,Z;return N=T(w,["tkhd"])[0],!N||(G=N[0],Q=G===0?12:20,J=m(N[Q]<<24|N[Q+1]<<16|N[Q+2]<<8|N[Q+3]),Z=T(w,["mdia","mdhd"])[0],!Z)?null:(G=Z[0],Q=G===0?12:20,b[J]=m(Z[Q]<<24|Z[Q+1]<<16|Z[Q+2]<<8|Z[Q+3]),b)},v)},ae=function(f,v){var S;S=T(v,["moof","traf"]);var b=S.reduce(function(w,N){var G=T(N,["tfhd"])[0],Q=m(G[4]<<24|G[5]<<16|G[6]<<8|G[7]),J=f[Q]||9e4,Z=T(N,["tfdt"])[0],ue=new DataView(Z.buffer,Z.byteOffset,Z.byteLength),me;Z[0]===1?me=ie(Z.subarray(4,12)):me=ue.getUint32(4);let ke;return typeof me=="bigint"?ke=me/It.BigInt(J):typeof me=="number"&&!isNaN(me)&&(ke=me/J),ke<Number.MAX_SAFE_INTEGER&&(ke=Number(ke)),ke<w&&(w=ke),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,N;if(S&&S.length){var G=T(S[0],["tfhd"])[0],Q=T(S[0],["trun"])[0],J=T(S[0],["tfdt"])[0];if(G){var Z=M(G);N=Z.trackId}if(J){var ue=Y(J);b=ue.baseMediaDecodeTime}if(Q){var me=W(Q);me.samples&&me.samples.length&&(w=me.samples[0].compositionTimeOffset||0)}}var ke=f[N]||9e4;typeof b=="bigint"&&(w=It.BigInt(w),ke=It.BigInt(ke));var ye=(b+w)/ke;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"]),N=T(b,["tkhd"]);w.forEach(function(G,Q){var J=E(G.subarray(8,12)),Z=N[Q],ue,me,ke;J==="vide"&&(ue=new DataView(Z.buffer,Z.byteOffset,Z.byteLength),me=ue.getUint8(0),ke=me===0?ue.getUint32(12):ue.getUint32(20),S.push(ke))})}),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])},Ie=function(f){var v=T(f,["moov","trak"]),S=[];return v.forEach(function(b){var w={},N=T(b,["tkhd"])[0],G,Q;N&&(G=new DataView(N.buffer,N.byteOffset,N.byteLength),Q=G.getUint8(0),w.id=Q===0?G.getUint32(12):G.getUint32(20));var J=T(b,["mdia","hdlr"])[0];if(J){var Z=E(J.subarray(8,12));Z==="vide"?w.type="video":Z==="soun"?w.type="audio":w.type=Z}var ue=T(b,["mdia","minf","stbl","stsd"])[0];if(ue){var me=ue.subarray(8);w.codec=E(me.subarray(4,8));var ke=T(me,[w.codec])[0],ye,Be;ke&&(/^[asm]vc[1-9]$/i.test(w.codec)?(ye=ke.subarray(78),Be=E(ye.subarray(4,8)),Be==="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=ke.subarray(28),Be=E(ye.subarray(4,8)),Be==="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 We=T(b,["mdia","mdhd"])[0];We&&(w.timescale=Se(We)),S.push(w)}),S},Ve=function(f,v=0){var S=T(f,["emsg"]);return S.map(b=>{var w=D.parseEmsgBox(new Uint8Array(b)),N=ni(w.message_data);return{cueTime:D.scaleTime(w.presentation_time,w.timescale,w.presentation_time_delta,v),duration:D.scaleTime(w.event_duration,w.timescale),frames:N}})};var Vi={findBox:T,parseType:E,timescale:ee,startTime:ae,compositionStartTime:ge,videoTrackIds:xe,tracks:Ie,getTimescaleFromMediaHeader:Se,getEmsgID3:Ve};const{parseTrun:Ho}=Hi,{findBox:Vo}=Vi;var zo=q,Au=function(f){var v=Vo(f,["moof","traf"]),S=Vo(f,["mdat"]),b=[];return S.forEach(function(w,N){var G=v[N];b.push({mdat:w,traf:G})}),b},Wo=function(f,v,S){var b=v,w=S.defaultSampleDuration||0,N=S.defaultSampleSize||0,G=S.trackId,Q=[];return f.forEach(function(J){var Z=Ho(J),ue=Z.samples;ue.forEach(function(me){me.duration===void 0&&(me.duration=w),me.size===void 0&&(me.size=N),me.trackId=G,me.dts=b,me.compositionTimeOffset===void 0&&(me.compositionTimeOffset=0),typeof b=="bigint"?(me.pts=b+zo.BigInt(me.compositionTimeOffset),b+=zo.BigInt(me.duration)):(me.pts=b+me.compositionTimeOffset,b+=me.duration)}),Q=Q.concat(ue)}),Q},Go={getMdatTrafPairs:Au,parseSamples:Wo},Pt=rr.discardEmulationPreventionBytes,Iu=ra.CaptionStream,_r=jn,yI=qo,_I=_a,{getMdatTrafPairs:TI,parseSamples:bI}=Go,SI=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},xI=function(f,v,S){var b=new DataView(f.buffer,f.byteOffset,f.byteLength),w={logs:[],seiNals:[]},N,G,Q,J;for(G=0;G+4<f.length;G+=Q)if(Q=b.getUint32(G),G+=4,!(Q<=0))switch(f[G]&31){case 6:var Z=f.subarray(G+1,G+1+Q),ue=SI(G,v);if(N={nalUnitType:"sei_rbsp",size:Q,data:Z,escapedRBSP:Pt(Z),trackId:S},ue)N.pts=ue.pts,N.dts=ue.dts,J=ue;else if(J)N.pts=J.pts,N.dts=J.dts;else{w.logs.push({level:"warn",message:"We've encountered a nal unit without data at "+G+" for trackId "+S+". See mux.js#223."});break}w.seiNals.push(N);break}return w},CI=function(f,v){var S={},b=TI(f);return b.forEach(function(w){var N=w.mdat,G=w.traf,Q=_r(G,["tfhd"]),J=_I(Q[0]),Z=J.trackId,ue=_r(G,["tfdt"]),me=ue.length>0?yI(ue[0]).baseMediaDecodeTime:0,ke=_r(G,["trun"]),ye,Be;v===Z&&ke.length>0&&(ye=bI(ke,me,J),Be=xI(N,ye,Z),S[Z]||(S[Z]={seiNals:[],logs:[]}),S[Z].seiNals=S[Z].seiNals.concat(Be.seiNals),S[Z].logs=S[Z].logs.concat(Be.logs))}),S},EI=function(f,v,S){var b;if(v===null)return null;b=CI(f,v);var w=b[v]||{};return{seiNals:w.seiNals,logs:w.logs,timescale:S}},wI=function(){var f=!1,v,S,b,w,N,G;this.isInitialized=function(){return f},this.init=function(Q){v=new Iu,f=!0,G=Q?Q.isPartial:!1,v.on("data",function(J){J.startTime=J.startPts/w,J.endTime=J.endPts/w,N.captions.push(J),N.captionStreams[J.stream]=!0}),v.on("log",function(J){N.logs.push(J)})},this.isNewInit=function(Q,J){return Q&&Q.length===0||J&&typeof J=="object"&&Object.keys(J).length===0?!1:b!==Q[0]||w!==J[b]},this.parse=function(Q,J,Z){var ue;if(this.isInitialized()){if(!J||!Z)return null;if(this.isNewInit(J,Z))b=J[0],w=Z[b];else if(b===null||!w)return S.push(Q),null}else return null;for(;S.length>0;){var me=S.shift();this.parse(me,J,Z)}return ue=EI(Q,b,w),ue&&ue.logs&&(N.logs=N.logs.concat(ue.logs)),ue===null||!ue.seiNals?N.logs.length?{logs:N.logs,captions:[],captionStreams:[]}:null:(this.pushNals(ue.seiNals),this.flushStream(),N)},this.pushNals=function(Q){if(!this.isInitialized()||!Q||Q.length===0)return null;Q.forEach(function(J){v.push(J)})},this.flushStream=function(){if(!this.isInitialized())return null;G?v.partialFlush():v.flush()},this.clearParsedCaptions=function(){N.captions=[],N.captionStreams={},N.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,N?this.clearParsedCaptions():N={captions:[],captionStreams:{},logs:[]},this.resetCaptionStream()},this.reset()},kI=wI;const{parseTfdt:AI}=Hi,qn=jn,{getTimescaleFromMediaHeader:II}=Vi,{parseSamples:PI,getMdatTrafPairs:DI}=Go;var ly=function(){let f=9e4;this.init=function(v){const S=qn(v,["moov","trak","mdia","mdhd"])[0];S&&(f=II(S))},this.parseSegment=function(v){const S=[],b=DI(v);let w=0;return b.forEach(function(N){const G=N.mdat,Q=N.traf,J=qn(Q,["tfdt"])[0],Z=qn(Q,["tfhd"])[0],ue=qn(Q,["trun"]);if(J&&(w=AI(J).baseMediaDecodeTime),ue.length&&Z){const me=PI(ue,w,Z);let ke=0;me.forEach(function(ye){const Be="utf-8",We=new TextDecoder(Be),Xt=G.slice(ke,ke+ye.size);if(qn(Xt,["vtte"])[0]){ke+=ye.size;return}qn(Xt,["vttc"]).forEach(function(Ko){const Xo=qn(Ko,["payl"])[0],Qo=qn(Ko,["sttg"])[0],Yo=ye.pts/f,Nu=(ye.pts+ye.duration)/f;let bt,Jo;if(Xo)try{bt=We.decode(Xo)}catch(Tr){console.error(Tr)}if(Qo)try{Jo=We.decode(Qo)}catch(Tr){console.error(Tr)}ye.duration&&bt&&S.push({cueText:bt,start:Yo,end:Nu,settings:Jo})}),ke+=ye.size})}}),S}},Ud=os,uy=function(f){var v=f[1]&31;return v<<=8,v|=f[2],v},Pu=function(f){return!!(f[1]&64)},Du=function(f){var v=0;return(f[3]&48)>>>4>1&&(v+=f[4]+1),v},NI=function(f,v){var S=uy(f);return S===0?"pat":S===v?"pmt":v?"pes":null},LI=function(f){var v=Pu(f),S=4+Du(f);return v&&(S+=f[S]+1),(f[S+10]&31)<<8|f[S+11]},OI=function(f){var v={},S=Pu(f),b=4+Du(f);if(S&&(b+=f[b]+1),!!(f[b+5]&1)){var w,N,G;w=(f[b+1]&15)<<8|f[b+2],N=3+w-4,G=(f[b+10]&15)<<8|f[b+11];for(var Q=12+G;Q<N;){var J=b+Q;v[(f[J+1]&31)<<8|f[J+2]]=f[J],Q+=((f[J+3]&15)<<8|f[J+4])+5}return v}},RI=function(f,v){var S=uy(f),b=v[S];switch(b){case Ud.H264_STREAM_TYPE:return"video";case Ud.ADTS_STREAM_TYPE:return"audio";case Ud.METADATA_STREAM_TYPE:return"timed-metadata";default:return null}},MI=function(f){var v=Pu(f);if(!v)return null;var S=4+Du(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},jd=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}},FI=function(f){for(var v=4+Du(f),S=f.subarray(v),b=0,w=0,N=!1,G;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&&(G=jd(S[w+3]&31),G==="slice_layer_without_partitioning_rbsp_idr"&&(N=!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}G=jd(S[w+3]&31),G==="slice_layer_without_partitioning_rbsp_idr"&&(N=!0),w=b-2,b+=3;break;default:b+=3;break}return S=S.subarray(w),b-=w,w=0,S&&S.byteLength>3&&(G=jd(S[w+3]&31),G==="slice_layer_without_partitioning_rbsp_idr"&&(N=!0)),N},BI={parseType:NI,parsePat:LI,parsePmt:OI,parsePayloadUnitStartIndicator:Pu,parsePesType:RI,parsePesTime:MI,videoPacketContainsKeyFrame:FI},cy=os,ba=ls.handleRollover,lt={};lt.ts=BI,lt.aac=Fn;var xs=rt.ONE_SECOND_IN_TS,gi=188,Or=71,UI=function(f,v){for(var S=0,b=gi,w,N;b<f.byteLength;){if(f[S]===Or&&f[b]===Or){switch(w=f.subarray(S,b),N=lt.ts.parseType(w,v.pid),N){case"pat":v.pid=lt.ts.parsePat(w);break;case"pmt":var G=lt.ts.parsePmt(w);v.table=v.table||{},Object.keys(G).forEach(function(Q){v.table[Q]=G[Q]});break}S+=gi,b+=gi;continue}S++,b++}},hy=function(f,v,S){for(var b=0,w=gi,N,G,Q,J,Z,ue=!1;w<=f.byteLength;){if(f[b]===Or&&(f[w]===Or||w===f.byteLength)){switch(N=f.subarray(b,w),G=lt.ts.parseType(N,v.pid),G){case"pes":Q=lt.ts.parsePesType(N,v.table),J=lt.ts.parsePayloadUnitStartIndicator(N),Q==="audio"&&J&&(Z=lt.ts.parsePesTime(N),Z&&(Z.type="audio",S.audio.push(Z),ue=!0));break}if(ue)break;b+=gi,w+=gi;continue}b++,w++}for(w=f.byteLength,b=w-gi,ue=!1;b>=0;){if(f[b]===Or&&(f[w]===Or||w===f.byteLength)){switch(N=f.subarray(b,w),G=lt.ts.parseType(N,v.pid),G){case"pes":Q=lt.ts.parsePesType(N,v.table),J=lt.ts.parsePayloadUnitStartIndicator(N),Q==="audio"&&J&&(Z=lt.ts.parsePesTime(N),Z&&(Z.type="audio",S.audio.push(Z),ue=!0));break}if(ue)break;b-=gi,w-=gi;continue}b--,w--}},jI=function(f,v,S){for(var b=0,w=gi,N,G,Q,J,Z,ue,me,ke,ye=!1,Be={data:[],size:0};w<f.byteLength;){if(f[b]===Or&&f[w]===Or){switch(N=f.subarray(b,w),G=lt.ts.parseType(N,v.pid),G){case"pes":if(Q=lt.ts.parsePesType(N,v.table),J=lt.ts.parsePayloadUnitStartIndicator(N),Q==="video"&&(J&&!ye&&(Z=lt.ts.parsePesTime(N),Z&&(Z.type="video",S.video.push(Z),ye=!0)),!S.firstKeyFrame)){if(J&&Be.size!==0){for(ue=new Uint8Array(Be.size),me=0;Be.data.length;)ke=Be.data.shift(),ue.set(ke,me),me+=ke.byteLength;if(lt.ts.videoPacketContainsKeyFrame(ue)){var We=lt.ts.parsePesTime(ue);We?(S.firstKeyFrame=We,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.")}Be.size=0}Be.data.push(N),Be.size+=N.byteLength}break}if(ye&&S.firstKeyFrame)break;b+=gi,w+=gi;continue}b++,w++}for(w=f.byteLength,b=w-gi,ye=!1;b>=0;){if(f[b]===Or&&f[w]===Or){switch(N=f.subarray(b,w),G=lt.ts.parseType(N,v.pid),G){case"pes":Q=lt.ts.parsePesType(N,v.table),J=lt.ts.parsePayloadUnitStartIndicator(N),Q==="video"&&J&&(Z=lt.ts.parsePesTime(N),Z&&(Z.type="video",S.video.push(Z),ye=!0));break}if(ye)break;b-=gi,w-=gi;continue}b--,w--}},$I=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(N){N.dts=ba(N.dts,S),N.pts=ba(N.pts,S),N.dtsTime=N.dts/xs,N.ptsTime=N.pts/xs})}if(f.video&&f.video.length){var b=v;if((typeof b>"u"||isNaN(b))&&(b=f.video[0].dts),f.video.forEach(function(N){N.dts=ba(N.dts,b),N.pts=ba(N.pts,b),N.dtsTime=N.dts/xs,N.ptsTime=N.pts/xs}),f.firstKeyFrame){var w=f.firstKeyFrame;w.dts=ba(w.dts,b),w.pts=ba(w.pts,b),w.dtsTime=w.dts/xs,w.ptsTime=w.pts/xs}}},qI=function(f){for(var v=!1,S=0,b=null,w=null,N=0,G=0,Q;f.length-G>=3;){var J=lt.aac.parseType(f,G);switch(J){case"timed-metadata":if(f.length-G<10){v=!0;break}if(N=lt.aac.parseId3TagSize(f,G),N>f.length){v=!0;break}w===null&&(Q=f.subarray(G,G+N),w=lt.aac.parseAacTimestamp(Q)),G+=N;break;case"audio":if(f.length-G<7){v=!0;break}if(N=lt.aac.parseAdtsSize(f,G),N>f.length){v=!0;break}b===null&&(Q=f.subarray(G,G+N),b=lt.aac.parseSampleRate(Q)),S++,G+=N;break;default:G++;break}if(v)return null}if(b===null||w===null)return null;var Z=xs/b,ue={audio:[{type:"audio",dts:w,pts:w},{type:"audio",dts:w+S*1024*Z,pts:w+S*1024*Z}]};return ue},HI=function(f){var v={pid:null,table:null},S={};UI(f,v);for(var b in v.table)if(v.table.hasOwnProperty(b)){var w=v.table[b];switch(w){case cy.H264_STREAM_TYPE:S.video=[],jI(f,v,S),S.video.length===0&&delete S.video;break;case cy.ADTS_STREAM_TYPE:S.audio=[],hy(f,v,S),S.audio.length===0&&delete S.audio;break}}return S},VI=function(f,v){var S=lt.aac.isLikelyAacData(f),b;return S?b=qI(f):b=HI(f),!b||!b.audio&&!b.video?null:($I(b,v),b)},zI={inspect:VI,parseAudioPes_:hy};const WI=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:rt.videoTsToSeconds(S.start.dts),presentation:rt.videoTsToSeconds(S.start.pts)},end:{decode:rt.videoTsToSeconds(S.end.dts),presentation:rt.videoTsToSeconds(S.end.pts)},baseMediaDecodeTime:rt.videoTsToSeconds(S.baseMediaDecodeTime)};S.prependedContentDuration&&(b.prependedContentDuration=rt.videoTsToSeconds(S.prependedContentDuration)),f.postMessage({action:"videoSegmentTimingInfo",videoSegmentTimingInfo:b})}),v.on("audioSegmentTimingInfo",function(S){const b={start:{decode:rt.videoTsToSeconds(S.start.dts),presentation:rt.videoTsToSeconds(S.start.pts)},end:{decode:rt.videoTsToSeconds(S.end.dts),presentation:rt.videoTsToSeconds(S.end.pts)},baseMediaDecodeTime:rt.videoTsToSeconds(S.baseMediaDecodeTime)};S.prependedContentDuration&&(b.prependedContentDuration=rt.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:rt.videoTsToSeconds(S.start),end:rt.videoTsToSeconds(S.end)}})}),v.on("videoTimingInfo",function(S){f.postMessage({action:"videoTimingInfo",videoTimingInfo:{start:rt.videoTsToSeconds(S.start),end:rt.videoTsToSeconds(S.end)}})}),v.on("log",function(S){f.postMessage({action:"log",log:S})})};class dy{constructor(v,S){this.options=S||{},this.self=v,this.init()}init(){this.transmuxer&&this.transmuxer.dispose(),this.transmuxer=new Tu.Transmuxer(this.options),WI(this.self,this.transmuxer)}pushMp4Captions(v){this.captionParser||(this.captionParser=new kI,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 ly);const S=new Uint8Array(v.data,v.byteOffset,v.byteLength);this.webVttParser.init(S)}getMp4WebVttText(v){this.webVttParser||(this.webVttParser=new ly);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=Vi.startTime(v,S);this.self.postMessage({action:"probeMp4StartTime",startTime:b,data:S},[S.buffer])}probeMp4Tracks({data:v}){const S=Vi.tracks(v);this.self.postMessage({action:"probeMp4Tracks",tracks:S,data:v},[v.buffer])}probeEmsgID3({data:v,offset:S}){const b=Vi.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*rt.ONE_SECOND_IN_TS:void 0,w=zI.inspect(v,b);let N=null;w&&(N={hasVideo:w.video&&w.video.length===2||!1,hasAudio:w.audio&&w.audio.length===2||!1},N.hasVideo&&(N.videoStart=w.video[0].ptsTime),N.hasAudio&&(N.audioStart=w.audio[0].ptsTime)),this.self.postMessage({action:"probeTs",result:N,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(rt.secondsToVideoTs(S)))}setAudioAppendStart(v){this.transmuxer.setAudioAppendStart(Math.ceil(rt.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 dy(self,f.data.options);return}this.messageHandlers||(this.messageHandlers=new dy(self)),f.data&&f.data.action&&f.data.action!=="init"&&this.messageHandlers[f.data.action]&&this.messageHandlers[f.data.action](f.data)}}));var TO=i2(_O);const bO=(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)},SO=({transmuxedData:s,callback:e})=>{s.buffer=[],e(s)},xO=(s,e)=>{e.gopInfo=s.data.gopInfo},s2=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:I,triggerSegmentEventFn:L}=s,$={buffer:[]};let F=k;const O=U=>{e.currentTransmux===s&&(U.data.action==="data"&&bO(U,$,a),U.data.action==="trackinfo"&&o(U.data.trackInfo),U.data.action==="gopInfo"&&xO(U,$),U.data.action==="audioTimingInfo"&&l(U.data.audioTimingInfo),U.data.action==="videoTimingInfo"&&u(U.data.videoTimingInfo),U.data.action==="videoSegmentTimingInfo"&&c(U.data.videoSegmentTimingInfo),U.data.action==="audioSegmentTimingInfo"&&h(U.data.audioSegmentTimingInfo),U.data.action==="id3Frame"&&d([U.data.id3Frame],U.data.id3Frame.dispatchType),U.data.action==="caption"&&g(U.data.caption),U.data.action==="endedtimeline"&&(F=!1,p()),U.data.action==="log"&&_(U.data.log),U.data.type==="transmuxed"&&(F||(e.onmessage=null,SO({transmuxedData:$,callback:y}),a2(e))))},B=()=>{const U={message:"Received an error message from the transmuxer worker",metadata:{errorType:j.Error.StreamingFailedToTransmuxSegment,segmentInfo:Ps({segment:I})}};y(null,U)};if(e.onmessage=O,e.onerror=B,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 U=t instanceof ArrayBuffer?t:t.buffer,C=t instanceof ArrayBuffer?0:t.byteOffset;L({type:"segmenttransmuxingstart",segment:I}),e.postMessage({action:"push",data:U,byteOffset:C,byteLength:t.byteLength},[U])}k&&e.postMessage({action:"endTimeline"}),e.postMessage({action:"flush"})},a2=s=>{s.currentTransmux=null,s.transmuxQueue.length&&(s.currentTransmux=s.transmuxQueue.shift(),typeof s.currentTransmux=="function"?s.currentTransmux():s2(s.currentTransmux))},k_=(s,e)=>{s.postMessage({action:e}),a2(s)},o2=(s,e)=>{if(!e.currentTransmux){e.currentTransmux=s,k_(e,s);return}e.transmuxQueue.push(k_.bind(null,e,s))},CO=s=>{o2("reset",s)},EO=s=>{o2("endTimeline",s)},l2=s=>{if(!s.transmuxer.currentTransmux){s.transmuxer.currentTransmux=s,s2(s);return}s.transmuxer.transmuxQueue.push(s)},wO=s=>{const e=new TO;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 _f={reset:CO,endTimeline:EO,transmux:l2,createTransmuxer:wO};const Va=function(s){const e=s.transmuxer,t=s.endAction||s.action,i=s.callback,r=A._extends({},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)},Hr={FAILURE:2,TIMEOUT:-101,ABORTED:-102},u2="wvtt",Cg=s=>{s.forEach(e=>{e.abort()})},kO=s=>({bandwidth:s.bandwidth,bytesReceived:s.bytesReceived||0,roundTripTime:s.roundTripTime||0}),AO=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},Xv=(s,e)=>{const{requestType:t}=e,i=qs({requestType:t,request:e,error:s});return e.timedout?{status:e.status,message:"HLS request timed-out at URL: "+e.uri,code:Hr.TIMEOUT,xhr:e,metadata:i}:e.aborted?{status:e.status,message:"HLS request aborted at URL: "+e.uri,code:Hr.ABORTED,xhr:e,metadata:i}:s?{status:e.status,message:"HLS request errored at URL: "+e.uri,code:Hr.FAILURE,xhr:e,metadata:i}:e.responseType==="arraybuffer"&&e.response.byteLength===0?{status:e.status,message:"Empty HLS response at URL: "+e.uri,code:Hr.FAILURE,xhr:e,metadata:i}:null},A_=(s,e,t,i)=>(r,n)=>{const a=n.response,o=Xv(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:Hr.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)},IO=(s,e)=>{e===u2&&s.transmuxer.postMessage({action:"initMp4WebVttParser",data:s.map.bytes})},PO=(s,e,t)=>{e===u2&&Va({action:"getMp4WebVttText",data:s.bytes,transmuxer:s.transmuxer,callback:({data:i,mp4VttCues:r})=>{s.bytes=i,t(null,s,{mp4VttCues:r})}})},c2=(s,e)=>{const t=yv(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:Hr.FAILURE,metadata:{mediaType:r}})}Va({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"&&IO(s,n.codec))}),e(null))})},DO=({segment:s,finishProcessingFn:e,triggerSegmentEventFn:t})=>(i,r)=>{const n=Xv(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,c2(s,function(o){if(o)return o.xhr=r,o.status=r.status,e(o,s);e(null,s)})},NO=({segment:s,finishProcessingFn:e,responseType:t,triggerSegmentEventFn:i})=>(r,n)=>{const a=Xv(r,n);if(a)return e(a,s);i({type:"segmentloaded",segment:s});const o=t==="arraybuffer"||!n.responseText?n.response:vO(n.responseText.substring(s.lastReachedChar||0));return s.stats=kO(n),s.key?s.encryptedBytes=new Uint8Array(o):s.bytes=new Uint8Array(o),e(null,s)},LO=({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 I=i.bind(null,s,"video","start");const L=i.bind(null,s,"video","end"),$=()=>l2({bytes:e,transmuxer:s.transmuxer,audioAppendStart:s.audioAppendStart,gopsToAlignWith:s.gopsToAlignWith,remux:p,onData:F=>{F.type=F.type==="combined"?"video":F.type,c(s,F)},onTrackInfo:F=>{t&&(p&&(F.isMuxed=!0),t(s,F))},onAudioTimingInfo:F=>{_&&typeof F.start<"u"&&(_(F.start),_=null),k&&typeof F.end<"u"&&k(F.end)},onVideoTimingInfo:F=>{I&&typeof F.start<"u"&&(I(F.start),I=null),L&&typeof F.end<"u"&&L(F.end)},onVideoSegmentTimingInfo:F=>{const O={pts:{start:F.start.presentation,end:F.end.presentation},dts:{start:F.start.decode,end:F.end.decode}};g({type:"segmenttransmuxingtiminginfoavailable",segment:s,timingInfo:O}),r(F)},onAudioSegmentTimingInfo:F=>{const O={pts:{start:F.start.pts,end:F.end.pts},dts:{start:F.start.dts,end:F.end.dts}};g({type:"segmenttransmuxingtiminginfoavailable",segment:s,timingInfo:O}),n(F)},onId3:(F,O)=>{a(s,F,O)},onCaptions:F=>{o(s,[F])},isEndOfTimeline:l,onEndedTimeline:()=>{u()},onTransmuxerLog:d,onDone:(F,O)=>{h&&(F.type=F.type==="combined"?"video":F.type,g({type:"segmenttransmuxingcomplete",segment:s}),h(O,s,F))},segment:s,triggerSegmentEventFn:g});Va({action:"probeTs",transmuxer:s.transmuxer,data:e,baseStartTime:s.baseStartTime,callback:F=>{s.bytes=e=F.data;const O=F.result;O&&(t(s,{hasAudio:O.hasAudio,hasVideo:O.hasVideo,isMuxed:p}),t=null),$()}})},h2=({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(eN(y)){s.isFmp4=!0;const{tracks:p}=s.map;if(p.text&&(!p.audio||!p.video)){c(s,{data:y,type:"text"}),PO(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 I=(L,$)=>{c(s,{data:y,type:k.hasAudio&&!k.isMuxed?"audio":"video"}),$&&$.length&&a(s,$),L&&L.length&&o(s,L),h(null,s,{})};Va({action:"probeMp4StartTime",timescales:s.map.timescales,data:y,transmuxer:s.transmuxer,callback:({data:L,startTime:$})=>{e=L.buffer,s.bytes=y=L,k.hasAudio&&!k.isMuxed&&i(s,"audio","start",$),k.hasVideo&&i(s,"video","start",$),Va({action:"probeEmsgID3",data:y,transmuxer:s.transmuxer,offset:$,callback:({emsgData:F,id3Frames:O})=>{if(e=F.buffer,s.bytes=y=F,!p.video||!F.byteLength||!s.transmuxer){I(void 0,O);return}Va({action:"pushMp4Captions",endAction:"mp4Captions",transmuxer:s.transmuxer,data:y,timescales:s.map.timescales,trackIds:[p.video.id],callback:B=>{e=B.data.buffer,s.bytes=y=B.data,B.logs.forEach(function(U){d(at(U,{stream:"mp4CaptionParser"}))}),I(B.captions,O)}})}})}});return}if(!s.transmuxer){h(null,s,{});return}if(typeof s.container>"u"&&(s.container=yv(y)),s.container!=="ts"&&s.container!=="aac"){t(s,{hasAudio:!1,hasVideo:!1}),h(null,s,{});return}LO({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})},d2=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=Ps({segment:r}),h={message:u,metadata:{error:new Error(u),errorType:j.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(QE({source:s,encrypted:t,key:l,iv:e.iv}),[t.buffer,l.buffer])},OO=({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"}),d2({id:e.requestId,key:e.key,encryptedBytes:e.encryptedBytes,decryptionWorker:s,segment:e,doneFn:h},y=>{e.bytes=y,g({type:"segmentdecryptioncomplete",segment:e}),h2({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})})},RO=({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,Cg(s),h(_,k);if(y+=1,y===s.length){const I=function(){if(k.encryptedBytes)return OO({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});h2({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}),d2({decryptionWorker:e,id:k.requestId+"-init",encryptedBytes:k.map.encryptedBytes,key:k.map.key,segment:k,doneFn:h},L=>{k.map.bytes=L,g({type:"segmentdecryptioncomplete",segment:k}),c2(k,$=>{if($)return Cg(s),h($,k);I()})});I()}}}},MO=({loadendState:s,abortFn:e})=>t=>{t.target.aborted&&e&&!s.calledAbortFn&&(e(),s.calledAbortFn=!0)},FO=({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=at(s.stats,AO(h)),!s.stats.firstBytesReceivedAt&&s.stats.bytesReceived&&(s.stats.firstBytesReceivedAt=Date.now()),e(h,s)},BO=({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 I=[],L=RO({activeXhrs:I,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 U=[i.key];i.map&&!i.map.bytes&&i.map.key&&i.map.key.resolvedUri===i.key.resolvedUri&&U.push(i.map.key);const C=at(e,{uri:i.key.resolvedUri,responseType:"arraybuffer",requestType:"segment-key"}),P=A_(i,U,L,k),K={uri:i.key.resolvedUri};k({type:"segmentkeyloadstart",segment:i,keyInfo:K});const z=s(C,P);I.push(z)}if(i.map&&!i.map.bytes){if(i.map.key&&(!i.key||i.key.resolvedUri!==i.map.key.resolvedUri)){const z=at(e,{uri:i.map.key.resolvedUri,responseType:"arraybuffer",requestType:"segment-key"}),X=A_(i,[i.map.key],L,k),re={uri:i.map.key.resolvedUri};k({type:"segmentkeyloadstart",segment:i,keyInfo:re});const he=s(z,X);I.push(he)}const C=at(e,{uri:i.map.resolvedUri,responseType:"arraybuffer",headers:Sg(i.map),requestType:"segment-media-initialization"}),P=DO({segment:i,finishProcessingFn:L,triggerSegmentEventFn:k});k({type:"segmentloadstart",segment:i});const K=s(C,P);I.push(K)}const $=at(e,{uri:i.part&&i.part.resolvedUri||i.resolvedUri,responseType:"arraybuffer",headers:Sg(i),requestType:"segment"}),F=NO({segment:i,finishProcessingFn:L,responseType:$.responseType,triggerSegmentEventFn:k});k({type:"segmentloadstart",segment:i});const O=s($,F);O.addEventListener("progress",FO({segment:i,progressFn:n,trackInfoFn:a,timingInfoFn:o,videoSegmentTimingInfoFn:l,audioSegmentTimingInfoFn:u,id3Fn:c,captionsFn:h,isEndOfTimeline:d,endedTimelineFn:g,dataFn:y})),I.push(O);const B={};return I.forEach(U=>{U.addEventListener("loadend",MO({loadendState:B,abortFn:r}))}),()=>Cg(I)},UO=dr("CodecUtils"),jO=function(s){const e=s.attributes||{};if(e.CODECS)return Mr(e.CODECS)},f2=(s,e)=>{const t=e.attributes||{};return s&&s.mediaGroups&&s.mediaGroups.AUDIO&&t.AUDIO&&s.mediaGroups.AUDIO[t.AUDIO]},$O=(s,e)=>{if(!f2(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},Fc=function(s){const e={};return s.forEach(({mediaType:t,type:i,details:r})=>{e[t]=e[t]||[],e[t].push(QC(`${i}${r}`))}),Object.keys(e).forEach(function(t){if(e[t].length>1){UO(`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},I_=function(s){let e=0;return s.audio&&e++,s.video&&e++,e},xl=function(s,e){const t=e.attributes||{},i=Fc(jO(e)||[]);if(f2(s,e)&&!i.audio&&!$O(s,e)){const r=Fc(kP(s,t.AUDIO)||[]);r.audio&&(i.audio=r.audio)}return i},Uu=dr("PlaylistSelector"),P_=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||""})},Bc=function(s,e){if(!s)return"";const t=R.getComputedStyle(s);return t?t[e]:""},za=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})},Qv=function(s,e){let t,i;return s.attributes.BANDWIDTH&&(t=s.attributes.BANDWIDTH),t=t||R.Number.MAX_VALUE,e.attributes.BANDWIDTH&&(i=e.attributes.BANDWIDTH),i=i||R.Number.MAX_VALUE,t-i},qO=function(s,e){let t,i;return s.attributes.RESOLUTION&&s.attributes.RESOLUTION.width&&(t=s.attributes.RESOLUTION.width),t=t||R.Number.MAX_VALUE,e.attributes.RESOLUTION&&e.attributes.RESOLUTION.width&&(i=e.attributes.RESOLUTION.width),i=i||R.Number.MAX_VALUE,t===i&&s.attributes.BANDWIDTH&&e.attributes.BANDWIDTH?s.attributes.BANDWIDTH-e.attributes.BANDWIDTH:t-i};let p2=function(s,e,t,i,r,n){if(!s)return;const a={bandwidth:e,width:t,height:i,limitRenditionByPlayerDimensions:r};let o=s.playlists;Ri.isAudioOnly(s)&&(o=n.getAudioTrackPlaylists_(),a.audioOnly=!0);let l=o.map(F=>{let O;const B=F.attributes&&F.attributes.RESOLUTION&&F.attributes.RESOLUTION.width,U=F.attributes&&F.attributes.RESOLUTION&&F.attributes.RESOLUTION.height;return O=F.attributes&&F.attributes.BANDWIDTH,O=O||R.Number.MAX_VALUE,{bandwidth:O,width:B,height:U,playlist:F}});za(l,(F,O)=>F.bandwidth-O.bandwidth),l=l.filter(F=>!Ri.isIncompatible(F.playlist));let u=l.filter(F=>Ri.isEnabled(F.playlist));u.length||(u=l.filter(F=>!Ri.isDisabled(F.playlist)));const c=u.filter(F=>F.bandwidth*Qt.BANDWIDTH_VARIANCE<e);let h=c[c.length-1];const d=c.filter(F=>F.bandwidth===h.bandwidth)[0];if(r===!1){const F=d||u[0]||l[0];if(F&&F.playlist){let O="sortedPlaylistReps";return d&&(O="bandwidthBestRep"),u[0]&&(O="enabledPlaylistReps"),Uu(`choosing ${P_(F)} using ${O} with options`,a),F.playlist}return Uu("could not choose a playlist with options",a),null}const g=c.filter(F=>F.width&&F.height);za(g,(F,O)=>F.width-O.width);const y=g.filter(F=>F.width===t&&F.height===i);h=y[y.length-1];const p=y.filter(F=>F.bandwidth===h.bandwidth)[0];let _,k,I;p||(_=g.filter(F=>F.width>t||F.height>i),k=_.filter(F=>F.width===_[0].width&&F.height===_[0].height),h=k[k.length-1],I=k.filter(F=>F.bandwidth===h.bandwidth)[0]);let L;if(n.leastPixelDiffSelector){const F=g.map(O=>(O.pixelDiff=Math.abs(O.width-t)+Math.abs(O.height-i),O));za(F,(O,B)=>O.pixelDiff===B.pixelDiff?B.bandwidth-O.bandwidth:O.pixelDiff-B.pixelDiff),L=F[0]}const $=L||I||p||d||u[0]||l[0];if($&&$.playlist){let F="sortedPlaylistReps";return L?F="leastPixelDiffRep":I?F="resolutionPlusOneRep":p?F="resolutionBestRep":d?F="bandwidthBestRep":u[0]&&(F="enabledPlaylistReps"),Uu(`choosing ${P_($)} using ${F} with options`,a),$.playlist}return Uu("could not choose a playlist with options",a),null};const D_=function(){let s=this.useDevicePixelRatio&&R.devicePixelRatio||1;return isNaN(this.customPixelRatio)||(s=this.customPixelRatio),p2(this.playlists.main,this.systemBandwidth,parseInt(Bc(this.tech_.el(),"width"),10)*s,parseInt(Bc(this.tech_.el(),"height"),10)*s,this.limitRenditionByPlayerDimensions,this.playlistController_)},HO=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&&R.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),p2(this.playlists.main,e,parseInt(Bc(this.tech_.el(),"width"),10)*i,parseInt(Bc(this.tech_.el(),"height"),10)*i,this.limitRenditionByPlayerDimensions,this.playlistController_)}},VO=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=>!Ri.isIncompatible(y));let c=u.filter(Ri.isEnabled);c.length||(c=u.filter(y=>!Ri.isDisabled(y)));const d=c.filter(Ri.hasAttribute.bind(null,"BANDWIDTH")).map(y=>{const _=l.getSyncPoint(y,r,o,t)?1:2,I=Ri.estimateSegmentRequestTime(n,i,y)*_-a;return{playlist:y,rebufferingImpact:I}}),g=d.filter(y=>y.rebufferingImpact<=0);return za(g,(y,p)=>Qv(p.playlist,y.playlist)),g.length?g[0]:(za(d,(y,p)=>y.rebufferingImpact-p.rebufferingImpact),d[0]||null)},zO=function(){const s=this.playlists.main.playlists.filter(Ri.isEnabled);return za(s,(t,i)=>Qv(t,i)),s.filter(t=>!!xl(this.playlists.main,t).video)[0]||null},WO=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 m2(s){try{return new URL(s).pathname.split("/").slice(-2).join("/")}catch{return""}}const GO=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}}},KO=function({inbandTextTracks:s,captionArray:e,timestampOffset:t}){if(!e)return;const i=R.WebKitDataCue||R.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))})},XO=function(s){Object.defineProperties(s.frame,{id:{get(){return j.log.warn("cue.frame.id is deprecated. Use cue.value.key instead."),s.value.key}},value:{get(){return j.log.warn("cue.frame.value is deprecated. Use cue.value.data instead."),s.value.data}},privateData:{get(){return j.log.warn("cue.frame.privateData is deprecated. Use cue.value.data instead."),s.value.data}}})},QO=({inbandTextTracks:s,metadataArray:e,timestampOffset:t,videoDuration:i})=>{if(!e)return;const r=R.WebKitDataCue||R.VTTCue,n=s.metadataTrack_;if(!n||(e.forEach(c=>{const h=c.cueTime+t;typeof h!="number"||R.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,XO(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})})},YO={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"},JO=new Set(["id","class","startDate","duration","endDate","endOnNext","startTime","endTime","processDateRange"]),ZO=({inbandTextTracks:s,dateRanges:e})=>{const t=s.metadataTrack_;if(!t)return;const i=R.WebKitDataCue||R.VTTCue;e.forEach(r=>{for(const n of Object.keys(r)){if(JO.has(n))continue;const a=new i(r.startTime,r.endTime,"");a.id=r.id,a.type="com.apple.quicktime.HLS",a.value={key:YO[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()})},N_=(s,e,t)=>{s.metadataTrack_||(s.metadataTrack_=t.addRemoteTextTrack({kind:"metadata",label:"Timed Metadata"},!1).track,j.browser.IS_ANY_SAFARI||(s.metadataTrack_.inBandMetadataTrackDispatchType=e))},fl=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)},eR=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}},tR=(s,e,t)=>{if(typeof e>"u"||e===null||!s.length)return[];const i=Math.ceil((e-t+3)*Ls.ONE_SECOND_IN_TS);let r;for(r=0;r<s.length&&!(s[r].pts>i);r++);return s.slice(r)},iR=(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)},rR=(s,e,t,i)=>{const r=Math.ceil((e-i)*Ls.ONE_SECOND_IN_TS),n=Math.ceil((t-i)*Ls.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},nR=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},sR=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]},rl=1,aR=500,L_=s=>typeof s=="number"&&isFinite(s),ju=1/60,oR=(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,lR=(s,e,t)=>{let i=e-Qt.BACK_BUFFER_LENGTH;s.length&&(i=Math.max(i,s.start(0)));const r=e-t;return Math.min(r,i)},Ca=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?OE({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}]`},O_=s=>`${s}TimingInfo`,uR=({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,Eg=({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},cR=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)},hR=s=>{s&&(s.pause(),s.resetEverything(),s.load())},dR=s=>{const e=s.timelineChangeController_.pendingTimelineChange({type:"audio"}),t=s.timelineChangeController_.pendingTimelineChange({type:"main"});return e&&t&&e.to<t.to},Wn=s=>{const e=s.pendingSegment_;if(!e)return;if(Eg({timelineChangeController:s.timelineChangeController_,currentTimeline:s.currentTimeline_,segmentTimeline:e.timeline,loaderType:s.loaderType_,audioDisabled:s.audioDisabled_})&&cR(s.timelineChangeController_)){if(dR(s)){s.timelineChangeController_.trigger("audioTimelineBehind");return}hR(s)}},fR=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=R.BigInt(n)-R.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},R_=({segmentDuration:s,maxDuration:e})=>s?Math.round(s)>e+$r:!1,pR=(s,e)=>{if(e!=="hls")return null;const t=fR({audioTimingInfo:s.audioTimingInfo,videoTimingInfo:s.videoTimingInfo});if(!t)return null;const i=s.playlist.targetDuration,r=R_({segmentDuration:t,maxDuration:i*2}),n=R_({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},Ps=({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 wg=class extends j.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_=dr(`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_():Wn(this)}),this.sourceUpdater_.on("codecschange",i=>{this.trigger(A._extends({type:"codecschange"},i))}),this.loaderType_==="main"&&this.timelineChangeController_.on("pendingtimelinechange",()=>{this.hasEnoughInfoToAppend_()?this.processCallQueue_():Wn(this)}),this.loaderType_==="audio"&&this.timelineChangeController_.on("timelinechange",i=>{this.trigger(A._extends({type:"timelinechange"},i)),this.hasEnoughInfoToLoad_()?this.processLoadQueue_():Wn(this),this.hasEnoughInfoToAppend_()?this.processCallQueue_():Wn(this)})}get mediaSequenceSync_(){return this.syncController_.getMediaSequenceSync(this.loaderType_)}createTransmuxer_(){return _f.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_&&R.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,R.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_&&_f.reset(this.transmuxer_),this.gopBuffer_.length=0,this.pause(),this.trigger("ended")}buffered_(){const e=this.getMediaInfo_();if(!this.sourceUpdater_||!e)return Zt();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=Mc(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=YE(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: ${vf(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_&&(R.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_&&_f.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_=rR(this.gopBuffer_,e,t,this.timeMapping_),n++,this.sourceUpdater_.removeVideo(e,t,a));for(const o in this.inbandTextTracks_)fl(e,t,this.inbandTextTracks_[o]);fl(e,t,this.segmentMetadataTrack_),a()}monitorBuffer_(){this.checkBufferTimeout_&&R.clearTimeout(this.checkBufferTimeout_),this.checkBufferTimeout_=R.setTimeout(this.monitorBufferTick_.bind(this),1)}monitorBufferTick_(){this.state==="READY"&&this.fillBuffer_(),this.checkBufferTimeout_&&R.clearTimeout(this.checkBufferTimeout_),this.checkBufferTimeout_=R.setTimeout(this.monitorBufferTick_.bind(this),aR)}fillBuffer_(){if(this.sourceUpdater_.updating())return;const e=this.chooseNextRequest_();if(!e)return;const t={segmentInfo:Ps({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=vf(e)||0,i=zv(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=sR(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:j.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 _=Ri.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=vf(this.sourceUpdater_.audioBuffered());return typeof y=="number"&&(d.audioAppendStart=y-this.sourceUpdater_.audioTimestampOffset()),this.sourceUpdater_.videoBuffered().length&&(d.gopsToAlignWith=tR(this.gopBuffer_,this.currentTime_()-this.sourceUpdater_.videoTimestampOffset(),this.timeMapping_)),d}timestampOffsetForSegment_(e){return uR(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=Ri.estimateSegmentRequestTime(r,i,this.playlist_,e.bytesReceived),a=PL(this.buffered_(),t,this.vhs_.tech_.playbackRate())-1;if(n<=a)return;const o=VO({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<=$r&&(c=1),!(!o.playlist||o.playlist.uri===this.playlist_.uri||u<c)&&(this.bandwidth=o.playlist.attributes.BANDWIDTH*Qt.BANDWIDTH_VARIANCE+1,this.trigger("earlyabort"))}handleAbort_(e){this.logger_(`Aborting ${Ca(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:Ps({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||{},nR(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_():Wn(this))))}handleTimingInfo_(e,t,i,r){if(this.earlyAbortWhenNeeded_(e.stats),this.checkForAbort_(e.requestId))return;const n=this.pendingSegment_,a=O_(t);n[a]=n[a]||{},n[a][i]=r,this.logger_(`timinginfo: ${t} - ${i} - ${r}`),this.hasEnoughInfoToAppend_()?this.processCallQueue_():Wn(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}`),GO(c,this.vhs_.tech_,a),fl(o,l,c[a]),KO({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_()?!Eg({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||Eg({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_()){Wn(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[O_(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=Mc(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: "+Os(n).join(", ")),a.length>1&&this.logger_("On QUOTA_EXCEEDED_ERR, found gaps in the video buffer: "+Os(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<=rl&&c-u<=rl){this.logger_(`On QUOTA_EXCEEDED_ERR, single segment too large to append to buffer, triggering an error. Appended byte length: ${i.byteLength}, audio buffer: ${Os(n).join(", ")}, video buffer: ${Os(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_()-rl;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 ${rl}s`),this.waitingOnRemove_=!1,this.quotaExceededErrorRetryTimeout_=R.setTimeout(()=>{this.logger_("On QUOTA_EXCEEDED_ERR, re-processing call queue"),this.quotaExceededErrorRetryTimeout_=null,this.processCallQueue_()},rl*1e3)},!0)}handleAppendError_({segmentInfo:e,type:t,bytes:i},r){if(r){if(r.code===zE){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:j.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=WO({bytes:l,segments:o})}const a={segmentInfo:Ps({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_()){Wn(this),this.loadQueue_.push(()=>{const t=A._extends({},e,{forceTimestampOffset:!0});A._extends(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
|
+
${m2(e.uri)}
|
|
214
|
+
${Ca(e)}`),t.map&&!t.map.bytes&&(this.logger_("going to request init segment."),this.appendInitSegment_={video:!0,audio:!0}),e.abortRequests=BO({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_(`${Ca(e)} logged from transmuxer stream ${u} as a ${l}: ${o}`)},triggerSegmentEventFn:({type:o,segment:l,keyInfo:u,trackInfo:c,timingInfo:h})=>{const g={segmentInfo:Ps({segment:l})};u&&(g.keyInfo=u),c&&(g.trackInfo=c),h&&(g.timingInfo=h),this.trigger({type:o,metadata:g})}})}trimBackBuffer_(e){const t=lR(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<ju){this.logger_(`Ignoring segment's bandwidth because its duration of ${e} is less than the min to record ${ju}`);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===Hr.ABORTED)return;if(this.pause(),e.code===Hr.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_=iR(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=oR(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:Ps({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=pR(e,this.sourceType_);if(t&&(t.severity==="warn"?j.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 ${Ca(e)}`);return}this.logger_(`Appended ${Ca(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"} ${Ca(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<ju){this.logger_(`Ignoring segment's throughput because its duration of ${e.duration} is less than the min to record ${ju}`);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(!L_(i)||!L_(r))return;fl(i,r,this.segmentMetadataTrack_);const n=R.WebKitDataCue||R.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 yn(){}const g2=function(s){return typeof s!="string"?s:s.replace(/./,e=>e.toUpperCase())},mR=["video","audio"],kg=(s,e)=>{const t=e[`${s}Buffer`];return t&&t.updating||e.queuePending[s]},gR=(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},Wa=(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(),Wa("audio",e),Wa("video",e));return}if(s!=="mediaSource"&&!(!e.ready()||e.mediaSource.readyState==="closed"||kg(s,e))){if(i.type!==s){if(t=gR(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,Wa(s,e);return}}},v2=(s,e)=>{const t=e[`${s}Buffer`],i=g2(s);t&&(t.removeEventListener("updateend",e[`on${i}UpdateEnd_`]),t.removeEventListener("error",e[`on${i}Error_`]),e.codecs[s]=null,e[`${s}Buffer`]=null)},Br=(s,e)=>s&&e&&Array.prototype.indexOf.call(s.sourceBuffers,e)!==-1,Wi={appendBuffer:(s,e,t)=>(i,r)=>{const n=r[`${i}Buffer`];if(Br(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===zE?"(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(Br(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`];Br(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){j.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){j.log.warn("Failed to set media source duration",t)}},abort:()=>(s,e)=>{if(e.mediaSource.readyState!=="open")return;const t=e[`${s}Buffer`];if(Br(e.mediaSource,t)){e.logger_(`calling abort on ${s}Buffer`);try{t.abort()}catch(i){j.log.warn(`Failed to abort on ${s}Buffer`,i)}}},addSourceBuffer:(s,e)=>t=>{const i=g2(s),r=Ya(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(v2(s,e),!!Br(e.mediaSource,t)){e.logger_(`Removing ${s}Buffer with codec ${e.codecs[s]} from mediaSource`);try{e.mediaSource.removeSourceBuffer(t)}catch(i){j.log.warn(`Failed to removeSourceBuffer ${s}Buffer`,i)}}},changeType:s=>(e,t)=>{const i=t[`${e}Buffer`],r=Ya(s);if(!Br(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=j.Error.StreamingCodecsChangeError,l.error=u,u.metadata=l,t.error_=u,t.trigger("error"),j.log.warn(`Failed to changeType on ${e}Buffer`,u)}}},Gi=({type:s,sourceUpdater:e,action:t,doneFn:i,name:r})=>{e.queue.push({type:s,action:t,doneFn:i,name:r}),Wa(s,e)},M_=(s,e)=>t=>{const i=e[`${s}Buffered`](),r=kL(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_`])}Wa(s,e)};let y2=class extends j.EventTarget{constructor(e){super(),this.mediaSource=e,this.sourceopenListener_=()=>Wa("mediaSource",this),this.mediaSource.addEventListener("sourceopen",this.sourceopenListener_),this.logger_=dr("SourceUpdater"),this.audioTimestampOffset_=0,this.videoTimestampOffset_=0,this.queue=[],this.queuePending={audio:null,video:null},this.delayedAudioAppendQueue_=[],this.videoAppendQueued_=!1,this.codecs={},this.onVideoUpdateEnd_=M_("video",this),this.onAudioUpdateEnd_=M_("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){Gi({type:"mediaSource",sourceUpdater:this,action:Wi.addSourceBuffer(e,t),name:"addSourceBuffer"})}abort(e){Gi({type:e,sourceUpdater:this,action:Wi.abort(e),name:"abort"})}removeSourceBuffer(e){if(!this.canRemoveSourceBuffer()){j.log.error("removeSourceBuffer is not supported!");return}Gi({type:"mediaSource",sourceUpdater:this,action:Wi.removeSourceBuffer(e),name:"removeSourceBuffer"})}canRemoveSourceBuffer(){return!j.browser.IS_FIREFOX&&R.MediaSource&&R.MediaSource.prototype&&typeof R.MediaSource.prototype.removeSourceBuffer=="function"}static canChangeType(){return R.SourceBuffer&&R.SourceBuffer.prototype&&typeof R.SourceBuffer.prototype.changeType=="function"}canChangeType(){return this.constructor.canChangeType()}changeType(e,t){if(!this.canChangeType()){j.log.error("changeType is not supported!");return}Gi({type:e,sourceUpdater:this,action:Wi.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(Gi({type:r,sourceUpdater:this,action:Wi.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 Br(this.mediaSource,this.audioBuffer)&&this.audioBuffer.buffered?this.audioBuffer.buffered:Zt()}videoBuffered(){return Br(this.mediaSource,this.videoBuffer)&&this.videoBuffer.buffered?this.videoBuffer.buffered:Zt()}buffered(){const e=Br(this.mediaSource,this.videoBuffer)?this.videoBuffer:null,t=Br(this.mediaSource,this.audioBuffer)?this.audioBuffer:null;return t&&!e?this.audioBuffered():e&&!t?this.videoBuffered():IL(this.audioBuffered(),this.videoBuffered())}setDuration(e,t=yn){Gi({type:"mediaSource",sourceUpdater:this,action:Wi.duration(e),name:"duration",doneFn:t})}endOfStream(e=null,t=yn){typeof e!="string"&&(e=void 0),Gi({type:"mediaSource",sourceUpdater:this,action:Wi.endOfStream(e),name:"endOfStream",doneFn:t})}removeAudio(e,t,i=yn){if(!this.audioBuffered().length||this.audioBuffered().end(0)===0){i();return}Gi({type:"audio",sourceUpdater:this,action:Wi.remove(e,t),doneFn:i,name:"remove"})}removeVideo(e,t,i=yn){if(!this.videoBuffered().length||this.videoBuffered().end(0)===0){i();return}Gi({type:"video",sourceUpdater:this,action:Wi.remove(e,t),doneFn:i,name:"remove"})}updating(){return!!(kg("audio",this)||kg("video",this))}audioTimestampOffset(e){return typeof e<"u"&&this.audioBuffer&&this.audioTimestampOffset_!==e&&(Gi({type:"audio",sourceUpdater:this,action:Wi.timestampOffset(e),name:"timestampOffset"}),this.audioTimestampOffset_=e),this.audioTimestampOffset_}videoTimestampOffset(e){return typeof e<"u"&&this.videoBuffer&&this.videoTimestampOffset_!==e&&(Gi({type:"video",sourceUpdater:this,action:Wi.timestampOffset(e),name:"timestampOffset"}),this.videoTimestampOffset_=e),this.videoTimestampOffset_}audioQueueCallback(e){this.audioBuffer&&Gi({type:"audio",sourceUpdater:this,action:Wi.callback(e),name:"callback"})}videoQueueCallback(e){this.videoBuffer&&Gi({type:"video",sourceUpdater:this,action:Wi.callback(e),name:"callback"})}dispose(){this.trigger("dispose"),mR.forEach(e=>{this.abort(e),this.canRemoveSourceBuffer()?this.removeSourceBuffer(e):this[`${e}QueueCallback`](()=>v2(e,this))}),this.videoAppendQueued_=!1,this.delayedAudioAppendQueue_.length=0,this.sourceopenListener_&&this.mediaSource.removeEventListener("sourceopen",this.sourceopenListener_),this.off()}};const F_=s=>decodeURIComponent(escape(String.fromCharCode.apply(null,s))),vR=s=>{const e=new Uint8Array(s);return Array.from(e).map(t=>t.toString(16).padStart(2,"0")).join("")},B_=new Uint8Array(`
|
|
215
|
+
|
|
216
|
+
`.split("").map(s=>s.charCodeAt(0)));let yR=class extends Error{constructor(){super("Trying to parse received VTT cues, but there is no WebVTT. Make sure vtt.js is loaded.")}},_R=class extends wg{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 Zt();const e=this.subtitlesTrack_.cues,t=e[0].startTime,i=e[e.length-1].startTime;return Zt([[t,i]])}initSegmentForMap(e,t=!1){if(!e)return null;const i=Mc(e);let r=this.initSegments_[i];if(t&&!r&&e.bytes){const n=B_.byteLength+e.bytes.byteLength,a=new Uint8Array(n);a.set(e.bytes),a.set(B_,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){fl(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===Hr.TIMEOUT&&this.handleTimeout_(),e.code===Hr.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 R.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:j.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 R.VTTCue(o.startTime,o.endTime,o.text):o)}),eR(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 R.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 R.WebVTT!="function")throw new yR;if(e.cues=[],e.timestampmap={MPEGTS:0,LOCAL:0},e.mp4VttCues){this.parseMp4VttCues_(e);return}typeof R.TextDecoder=="function"?t=new R.TextDecoder("utf8"):(t=R.WebVTT.StringDecoder(),i=!0);const r=new R.WebVTT.Parser(R,R.vttjs,t);if(r.oncue=e.cues.push.bind(e.cues),r.ontimestampmap=a=>{e.timestampmap=a},r.onparsingerror=a=>{j.log.warn("Error encountered when parsing cues: "+a.message)},e.segment.map){let a=e.segment.map.bytes;i&&(a=F_(a)),r.parse(a)}let n=e.bytes;i&&(n=F_(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/Ls.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*Ls.ONE_SECOND_IN_TS;const r=t*Ls.ONE_SECOND_IN_TS;let n;for(r<i?n=-8589934592:n=8589934592;Math.abs(i-r)>4294967296;)i+=n;return i/Ls.ONE_SECOND_IN_TS}};const TR=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},bR=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=TR(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 R.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 R.VTTCue(i,i+a.duration,""),r.adStartTime=i-o,r.adEndTime=r.adStartTime+l,e.addCue(r)}i+=a.duration}};class U_{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 SR{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 _2{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 U_({start:h,end:d,appended:g,segmentIndex:u});l.syncInfo=y;let p=a;const _=(l.parts||[]).map((k,I)=>{const L=p,$=p+k.duration,F=!!(c&&c.partsSyncInfo&&c.partsSyncInfo[I]&&c.partsSyncInfo[I].isAppended),O=new U_({start:L,end:$,appended:F,segmentIndex:u,partIndex:I});return p=$,n+=`Media Sequence: ${o}.${I} | Range: ${L} --> ${$} | Appended: ${F}
|
|
218
|
+
`,k.syncInfo=O,O});r.set(o,new SR(y,_)),n+=`${m2(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 j_ extends _2{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 xR=86400,Tf=[{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=vg(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=vg(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 CR=class extends j.EventTarget{constructor(e={}){super(),this.timelines=[],this.discontinuities=[],this.timelineToDatetimeMappings={};const t=new _2,i=new j_(t),r=new j_(t);this.mediaSequenceStorage_={main:t,audio:i,vtt:r},this.logger_=dr("SyncController")}getMediaSequenceSync(e){return this.mediaSequenceStorage_[e]||null}getSyncPoint(e,t,i,r,n){if(t!==1/0)return Tf.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+Sl({defaultDuration:e.targetDuration,durationList:e.segments,startIndex:r.segmentIndex,endIndex:0}))}runStrategies_(e,t,i,r,n){const a=[];for(let o=0;o<Tf.length;o++){const l=Tf[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>xR){j.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-Sl({defaultDuration:t.targetDuration,durationList:t.segments,startIndex:e.mediaIndex,endIndex:n}):u=i.end+Sl({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()}},ER=class extends j.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 wR=r2(n2(function(){var s=function(){function p(){this.listeners={}}var _=p.prototype;return _.on=function(I,L){this.listeners[I]||(this.listeners[I]=[]),this.listeners[I].push(L)},_.off=function(I,L){if(!this.listeners[I])return!1;var $=this.listeners[I].indexOf(L);return this.listeners[I]=this.listeners[I].slice(0),this.listeners[I].splice($,1),$>-1},_.trigger=function(I){var L=this.listeners[I];if(L)if(arguments.length===2)for(var $=L.length,F=0;F<$;++F)L[F].call(this,arguments[1]);else for(var O=Array.prototype.slice.call(arguments,1),B=L.length,U=0;U<B;++U)L[U].apply(this,O)},_.dispose=function(){this.listeners={}},_.pipe=function(I){this.on("data",function(L){I.push(L)})},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],I=_[4],L=k[4];let $,F,O;const B=[],U=[];let C,P,K,z,X,re;for($=0;$<256;$++)U[(B[$]=$<<1^($>>7)*283)^$]=$;for(F=O=0;!I[F];F^=C||1,O=U[O]||1)for(z=O^O<<1^O<<2^O<<3^O<<4,z=z>>8^z&255^99,I[F]=z,L[z]=F,K=B[P=B[C=B[F]]],re=K*16843009^P*65537^C*257^F*16843008,X=B[z]*257^z*16843008,$=0;$<4;$++)_[$][F]=X=X<<24^X>>>8,k[$][z]=re=re<<24^re>>>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,I,L;const $=this._tables[0][4],F=this._tables[1],O=_.length;let B=1;if(O!==4&&O!==6&&O!==8)throw new Error("Invalid aes key size");const U=_.slice(0),C=[];for(this._key=[U,C],k=O;k<4*O+28;k++)L=U[k-1],(k%O===0||O===8&&k%O===4)&&(L=$[L>>>24]<<24^$[L>>16&255]<<16^$[L>>8&255]<<8^$[L&255],k%O===0&&(L=L<<8^L>>>24^B<<24,B=B<<1^(B>>7)*283)),U[k]=U[k-O]^L;for(I=0;k;I++,k--)L=U[I&3?k:k-4],k<=4||I<4?C[I]=L:C[I]=F[0][$[L>>>24]]^F[1][$[L>>16&255]]^F[2][$[L>>8&255]]^F[3][$[L&255]]}decrypt(_,k,I,L,$,F){const O=this._key[1];let B=_^O[0],U=L^O[1],C=I^O[2],P=k^O[3],K,z,X;const re=O.length/4-2;let he,fe=4;const ne=this._tables[1],se=ne[0],le=ne[1],de=ne[2],ve=ne[3],we=ne[4];for(he=0;he<re;he++)K=se[B>>>24]^le[U>>16&255]^de[C>>8&255]^ve[P&255]^O[fe],z=se[U>>>24]^le[C>>16&255]^de[P>>8&255]^ve[B&255]^O[fe+1],X=se[C>>>24]^le[P>>16&255]^de[B>>8&255]^ve[U&255]^O[fe+2],P=se[P>>>24]^le[B>>16&255]^de[U>>8&255]^ve[C&255]^O[fe+3],fe+=4,B=K,U=z,C=X;for(he=0;he<4;he++)$[(3&-he)+F]=we[B>>>24]<<24^we[U>>16&255]<<16^we[C>>8&255]<<8^we[P&255]^O[fe++],K=B,B=U,U=C,C=P,P=K}}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 I=new Int32Array(p.buffer,p.byteOffset,p.byteLength>>2),L=new r(Array.prototype.slice.call(_)),$=new Uint8Array(p.byteLength),F=new Int32Array($.buffer);let O,B,U,C,P,K,z,X,re;for(O=k[0],B=k[1],U=k[2],C=k[3],re=0;re<I.length;re+=4)P=a(I[re]),K=a(I[re+1]),z=a(I[re+2]),X=a(I[re+3]),L.decrypt(P,K,z,X,F,re),F[re]=a(F[re]^O),F[re+1]=a(F[re+1]^B),F[re+2]=a(F[re+2]^U),F[re+3]=a(F[re+3]^C),O=P,B=K,U=z,C=X;return $};class l{constructor(_,k,I,L){const $=l.STEP,F=new Int32Array(_.buffer),O=new Uint8Array(_.byteLength);let B=0;for(this.asyncStream_=new n,this.asyncStream_.push(this.decryptChunk_(F.subarray(B,B+$),k,I,O)),B=$;B<F.length;B+=$)I=new Uint32Array([a(F[B-4]),a(F[B-3]),a(F[B-2]),a(F[B-1])]),this.asyncStream_.push(this.decryptChunk_(F.subarray(B,B+$),k,I,O));this.asyncStream_.push(function(){L(null,e(O))})}static get STEP(){return 32e3}decryptChunk_(_,k,I,L){return function(){const $=o(_,k,I);L.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 I=p[k];d(I)?_[k]={bytes:I.buffer,byteOffset:I.byteOffset,byteLength:I.byteLength}:_[k]=I}),_};self.onmessage=function(p){const _=p.data,k=new Uint8Array(_.encrypted.bytes,_.encrypted.byteOffset,_.encrypted.byteLength),I=new Uint32Array(_.key.bytes,_.key.byteOffset,_.key.byteLength/4),L=new Uint32Array(_.iv.bytes,_.iv.byteOffset,_.iv.byteLength/4);new l(k,I,L,function($,F){self.postMessage(y({source:_.source,decrypted:F}),[F.buffer])})}}));var kR=i2(wR);const AR=s=>{let e=s.default?"main":"alternative";return s.characteristics&&s.characteristics.indexOf("public.accessibility.describes-video")>=0&&(e="main-desc"),e},T2=(s,e)=>{s.abort(),s.pause(),e&&e.activePlaylistLoader&&(e.activePlaylistLoader.pause(),e.activePlaylistLoader=null)},Ag=(s,e)=>{e.activePlaylistLoader=s,s.load()},IR=(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,T2(t,r),!(!a||a.isMainPlaylist))){if(!a.playlistLoader){o&&i.resetEverything();return}t.resyncLoader(),Ag(a.playlistLoader,r)}},PR=(s,e)=>()=>{const{segmentLoaders:{[s]:t},mediaTypes:{[s]:i}}=e;i.lastGroup_=null,t.abort(),t.pause()},DR=(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,T2(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){Ag(o.playlistLoader,n);return}i.track&&i.track(a),i.resetEverything(),Ag(o.playlistLoader,n)}},Uc={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}j.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;j.log.warn("Problem encountered loading the subtitle track.Disabling subtitle track.");const i=t.activeTrack();i&&(i.mode="disabled"),t.onTrackChanged()}},$_={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",Uc[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",Uc[s](s,t))}},NR={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=Wl(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 Ra(y.playlists[0],t,n):y.resolvedUri?p=new Ra(y.resolvedUri,t,n):y.playlists&&i==="dash"?p=new xg(y.playlists[0],t,n,c):p=null,y=at({id:g,playlistLoader:p},y),$_[s](s,y.playlistLoader,e),o[d].push(y),typeof l[g]>"u"){const _=new j.AudioTrack({id:g,kind:AR(y),enabled:!1,language:y.language,default:y.default,label:g});l[g]=_}}}r.on("error",Uc[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 Ra(g.resolvedUri,i,a);else if(r==="dash"){if(!g.playlists.filter(_=>_.excludeUntil!==1/0).length)return;y=new xg(g.playlists[0],i,a,c)}else r==="vhs-json"&&(y=new Ra(g.playlists?g.playlists[0]:g.resolvedUri,i,a));if(g=at({id:d,playlistLoader:y},g),$_[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",Uc[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=at(c,u[c.instreamId])),c.default===void 0&&delete c.default,r[a].push(at({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}}}}},b2=(s,e)=>{for(let t=0;t<s.length;t++)if(Kv(e,s[t])||s[t].playlists&&b2(s[t].playlists,e))return!0;return!1},LR=(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&&Wl(e.main))for(let l=0;l<o.length;l++){const u=r[o[l]];if(b2(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},OR={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}},RR=(s,{mediaTypes:e})=>()=>{const t=e[s].activeTrack();return t?e[s].activeGroup(t):null},MR=s=>{["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(u=>{NR[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=LR(u,s),e[u].activeTrack=OR[u](u,s),e[u].onGroupChanged=IR(u,s),e[u].onGroupChanging=PR(u,s),e[u].onTrackChanged=DR(u,s),e[u].getActiveGroup=RR(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])},FR=()=>{const s={};return["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(e=>{s[e]={groups:{},tracks:{},activePlaylistLoader:null,activeGroup:yn,activeTrack:yn,getActiveGroup:yn,onGroupChanged:yn,onTrackChanged:yn,lastTrack_:null,logger_:dr(`MediaGroups[${e}]`)}}),s};class q_{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_=Oi(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 BR extends j.EventTarget{constructor(e,t){super(),this.currentPathway=null,this.defaultPathway=null,this.queryBeforeStart=!1,this.availablePathways_=new Set,this.steeringManifest=new q_,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_=dr("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=Oi(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:j.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 R.URL(e),i=new R.URL(this.proxyServerUrl_);return i.searchParams.set("url",encodeURI(t.toString())),this.setSteeringParams_(i.toString())}decodeDataUriManifest_(e){const t=JSON.parse(R.atob(e));this.assignSteeringProperties_(t)}setSteeringParams_(e){const t=new R.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_=R.setTimeout(()=>{this.requestSteeringManifest()},t)}clearTTLTimeout_(){R.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 q_}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&&(Oi(e,t.serverURL)!==this.steeringManifest.reloadUri||t.defaultServiceLocation!==this.defaultPathway||t.queryBeforeStart!==this.queryBeforeStart||t.proxyServerURL!==this.proxyServerUrl_)}getAvailablePathways(){return this.availablePathways_}}const UR=10;let Gn;const jR=["mediaRequests","mediaRequestsAborted","mediaRequestsTimedout","mediaRequestsErrored","mediaTransferDuration","mediaBytesTransferred","mediaAppends"],$R=function(s){return this.audioSegmentLoader_[s]+this.mainSegmentLoader_[s]},qR=function({currentPlaylist:s,buffered:e,currentTime:t,nextPlaylist:i,bufferLowWaterLine:r,bufferHighWaterLine:n,duration:a,bufferBasedABR:o,log:l}){if(!i)return j.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=!!Oa(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=zv(e,t),d=o?Qt.EXPERIMENTAL_MAX_BUFFER_LOW_WATER_LINE:Qt.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 HR extends j.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),Gn=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_=FR(),p&&R.ManagedMediaSource?(this.tech_.el_.disableRemotePlayback=!0,this.mediaSource=new R.ManagedMediaSource,j.log("Using ManagedMediaSource")):R.MediaSource&&(this.mediaSource=new R.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_=Zt(),this.hasPlayed_=!1,this.syncController_=new CR(e),this.segmentMetadataTrack_=r.addRemoteTextTrack({kind:"metadata",label:"segment-metadata"},!1).track,this.decrypter_=new kR,this.sourceUpdater_=new y2(this.mediaSource),this.inbandTextTracks_={},this.timelineChangeController_=new ER,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 xg(t,this.vhs_,at(this.requestOptions_,{addMetadataToTextTrack:this.addMetadataToTextTrack.bind(this)})):new Ra(t,this.vhs_,at(this.requestOptions_,{addDateRangesToTextTrack:this.addDateRangesToTextTrack_.bind(this)})),this.setupMainPlaylistLoaderListeners_(),this.mainSegmentLoader_=new wg(at(k,{segmentMetadataTrack:this.segmentMetadataTrack_,loaderType:"main"}),e),this.audioSegmentLoader_=new wg(at(k,{loaderType:"audio"}),e),this.subtitleSegmentLoader_=new _R(at(k,{loaderType:"vtt",featuresNativeTextTracks:this.tech_.featuresNativeTextTracks,loadVttJs:()=>new Promise(($,F)=>{function O(){r.off("vttjserror",B),$()}function B(){r.off("vttjsloaded",O),F()}r.one("vttjsloaded",O),r.one("vttjserror",B),r.addWebVttScript_()})}),e);const I=()=>this.mainSegmentLoader_.bandwidth;this.contentSteeringController_=new BR(this.vhs_.xhr,I),this.setupSegmentLoaderListeners_(),this.bufferBasedABR&&(this.mainPlaylistLoader_.one("loadedplaylist",()=>this.startABRTimer_()),this.tech_.on("pause",()=>this.stopABRTimer_()),this.tech_.on("play",()=>this.startABRTimer_())),jR.forEach($=>{this[$+"_"]=$R.bind(this,$)}),this.logger_=dr("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 L=this.tech_.preload()==="none"?"play":"loadstart";this.tech_.one(L,()=>{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_=R.setInterval(()=>this.checkABR_(),250)}stopABRTimer_(){this.tech_.scrubbing&&this.tech_.scrubbing()||(R.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;yg(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()),MR({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;yg(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(A._extends({},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"}),Gn.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 qR({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:UR}))});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(A._extends({},r))}),this.audioSegmentLoader_.on(i,r=>{this.player_.trigger(A._extends({},r))}),this.subtitleSegmentLoader_.on(i,r=>{this.player_.trigger(A._extends({},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=Gn.Playlist.playlistEnd(e,i),n=this.tech_.currentTime(),a=this.tech_.buffered();if(!a.length)return r-n<=qr;const o=a.end(a.length-1);return o-n<=qr&&r-o<=qr}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(Rh),a=n.length===1&&n[0]===e;if(r.length===1&&i!==1/0)return j.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&&(j.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_:j.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=Oa(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:Gn.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=Gn.Playlist.liveEdgeDelay(this.mainPlaylistLoader_.main,i),c=Math.max(0,l-u);return c<o?null:Zt([[o,c]])}const n=this.syncController_.getExpiredTime(i,this.duration());if(n===null)return null;const a=Gn.Playlist.seekable(i,n,Gn.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:Zt([[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 [${NE(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=Gn.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=xl(this.main(),t),r={},n=!!this.mediaTypes_.AUDIO.activePlaylistLoader;if(e.main.hasVideo&&(r.video=i.video||e.main.videoCodec||IP),e.main.isMuxed&&(r.video+=`,${i.audio||e.main.audioCodec||Ay}`),(e.main.hasAudio&&!e.main.isMuxed||e.audio.hasAudio||n)&&(r.audio=i.audio||e.main.audioCodec||e.audio.audioCodec||Ay,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?yl(c):Zd(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=(Mr(this.sourceUpdater_.codecs[c]||"")[0]||{}).type,d=(Mr(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=xl(this.main,r),a=[];n.audio&&!Zd(n.audio)&&!yl(n.audio)&&a.push(`audio codec ${n.audio}`),n.video&&!Zd(n.video)&&!yl(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=Fc(Mr(e)),n=I_(r),a=r.video&&Mr(r.video)[0]||null,o=r.audio&&Mr(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=xl(this.mainPlaylistLoader_.main,u),d=I_(h);if(!(!h.audio&&!h.video)){if(d!==n&&c.push(`codec count "${d}" !== "${n}"`),!this.sourceUpdater_.canChangeType()){const g=h.video&&Mr(h.video)[0]||null,y=h.audio&&Mr(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)),bR(e,this.cueTagsTrack_,t)}goalBufferLength(){const e=this.tech_.currentTime(),t=Qt.GOAL_BUFFER_LENGTH,i=Qt.GOAL_BUFFER_LENGTH_RATE,r=Math.max(t,Qt.MAX_GOAL_BUFFER_LENGTH);return Math.min(t+e*i,r)}bufferLowWaterLine(){const e=this.tech_.currentTime(),t=Qt.BUFFER_LOW_WATER_LINE,i=Qt.BUFFER_LOW_WATER_LINE_RATE,r=Math.max(t,Qt.MAX_BUFFER_LOW_WATER_LINE),n=Math.max(t,Qt.EXPERIMENTAL_MAX_BUFFER_LOW_WATER_LINE);return Math.min(t+e*i,this.bufferBasedABR?n:r)}bufferHighWaterLine(){return Qt.BUFFER_HIGH_WATER_LINE}addDateRangesToTextTrack_(e){N_(this.inbandTextTracks_,"com.apple.streaming",this.tech_),ZO({inbandTextTracks:this.inbandTextTracks_,dateRanges:e})}addMetadataToTextTrack(e,t,i){const r=this.sourceUpdater_.videoBuffer?this.sourceUpdater_.videoTimestampOffset():this.sourceUpdater_.audioTimestampOffset();N_(this.inbandTextTracks_,e,this.tech_),QO({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(A._extends({},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,j.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:vR(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 VR=(s,e,t)=>i=>{const r=s.main.playlists[e],n=Gv(r),a=Rh(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 zR=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=xl(r.main(),t),this.playlist=t,this.id=i,this.enabled=VR(e.playlists,t.id,n)}};const WR=function(s){s.representations=()=>{const e=s.playlistController_.main(),t=Wl(e)?s.playlistController_.getAudioTrackPlaylists_():e.playlists;return t?t.filter(i=>!Gv(i)).map((i,r)=>new zR(s,i,i.id)):[]}},H_=["seeking","seeked","pause","playing","error"];let GR=class extends j.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_=dr("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(H_,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(H_,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_&&R.clearTimeout(this.checkCurrentTimeTimeout_),this.resetTimeUpdate_()}}monitorCurrentTime_(){this.checkCurrentTime_(),this.checkCurrentTimeTimeout_&&R.clearTimeout(this.checkCurrentTimeTimeout_),this.checkCurrentTimeTimeout_=R.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=DL(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:Os(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+qr>=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(Zt([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:qr)}if(typeof n<"u")return this.logger_(`Trying to seek outside of seekable at time ${i} with seekable range ${NE(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-$r)*2,d=[l,u];for(let y=0;y<d.length;y++){if(!d[y])continue;if(zv(d[y],i)<h)return!1}const g=Bu(o,i);return g.length===0?!1:(n=g.start(0)+qr,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=Oa(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=Bu(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)+qr;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=Oa(e,i-3),a=Oa(e,i),o=Oa(t,i);o.length&&!a.length&&n.length&&(r={start:n.end(0),end:o.end(0)})}else Bu(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=Bu(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)+$r);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=AL(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 KR={errorInterval:30,getSource(s){const t=this.tech({IWillNotUseThisInPlugins:!0}).currentSource_||this.currentSource();return s(t)}},S2=function(s,e){let t=0,i=0;const r=at(KR,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"){j.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(),S2(s,c)};s.on("error",o),s.on("dispose",l),s.reloadSourceOnError=u},XR=function(s){S2(this,s)};var x2="3.16.0",QR="7.1.0",YR="1.3.1",JR="7.2.0",ZR="4.0.2";const Dt={PlaylistLoader:Ra,Playlist:Ri,utils:tO,STANDARD_PLAYLIST_SELECTOR:D_,INITIAL_PLAYLIST_SELECTOR:zO,lastBandwidthSelector:D_,movingAverageBandwidthSelector:HO,comparePlaylistBandwidth:Qv,comparePlaylistResolution:qO,xhr:XE()};Object.keys(Qt).forEach(s=>{Object.defineProperty(Dt,s,{get(){return j.log.warn(`using Vhs.${s} is UNSAFE be sure you know what you are doing`),Qt[s]},set(e){if(j.log.warn(`using Vhs.${s} is UNSAFE be sure you know what you are doing`),typeof e!="number"||e<0){j.log.warn(`value of Vhs.${s} must be greater than or equal to 0`);return}Qt[s]=e}})});const C2="videojs-vhs",E2=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"})},eM=function(s,e){e.representations().forEach(t=>{s.addQualityLevel(t)}),E2(s,e.playlists)};Dt.canPlaySource=function(){return j.log.warn("VHS is no longer a tech. Please remove it from your player's techOrder.")};const tM=(s,e,t)=>{if(!s)return s;let i={};e&&e.attributes&&e.attributes.CODECS&&(i=Fc(Mr(e.attributes.CODECS))),t&&t.attributes&&t.attributes.CODECS&&(i.audio=t.attributes.CODECS);const r=Ya(i.video),n=Ya(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 at(s,a)},iM=(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},[]),rM=({player:s,sourceKeySystems:e,audioMedia:t,mainPlaylists:i})=>{if(!s.eme.initializeMediaKeys)return Promise.resolve();const r=t?i.concat([t]):i,n=iM(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)])},nM=({player:s,sourceKeySystems:e,media:t,audioMedia:i})=>{const r=tM(e,t,i);return r?(s.currentSource().keySystems=r,r&&!s.eme?(j.log.warn("DRM encrypted source cannot be decrypted without a DRM plugin"),!1):!0):!1},w2=()=>{if(!R.localStorage)return null;const s=R.localStorage.getItem(C2);if(!s)return null;try{return JSON.parse(s)}catch{return null}},sM=s=>{if(!R.localStorage)return!1;let e=w2();e=e?at(e,s):s;try{R.localStorage.setItem(C2,JSON.stringify(e))}catch{return!1}return e},aM=s=>s.toLowerCase().indexOf("data:application/vnd.videojs.vhs+json,")===0?JSON.parse(s.substring(s.indexOf(",")+1)):s,k2=(s,e)=>{s._requestCallbackSet||(s._requestCallbackSet=new Set),s._requestCallbackSet.add(e)},A2=(s,e)=>{s._responseCallbackSet||(s._responseCallbackSet=new Set),s._responseCallbackSet.add(e)},I2=(s,e)=>{s._requestCallbackSet&&(s._requestCallbackSet.delete(e),s._requestCallbackSet.size||delete s._requestCallbackSet)},P2=(s,e)=>{s._responseCallbackSet&&(s._responseCallbackSet.delete(e),s._responseCallbackSet.size||delete s._responseCallbackSet)};Dt.supportsNativeHls=function(){if(!ce||!ce.createElement)return!1;const s=ce.createElement("video");return j.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}();Dt.supportsNativeDash=function(){return!ce||!ce.createElement||!j.getTech("Html5").isSupported()?!1:/maybe|probably/i.test(ce.createElement("video").canPlayType("application/dash+xml"))}();Dt.supportsTypeNatively=s=>s==="hls"?Dt.supportsNativeHls:s==="dash"?Dt.supportsNativeDash:!1;Dt.isSupported=function(){return j.log.warn("VHS is no longer a tech. Please remove it from your player's techOrder.")};Dt.xhr.onRequest=function(s){k2(Dt.xhr,s)};Dt.xhr.onResponse=function(s){A2(Dt.xhr,s)};Dt.xhr.offRequest=function(s){I2(Dt.xhr,s)};Dt.xhr.offResponse=function(s){P2(Dt.xhr,s)};const oM=j.getComponent("Component");let D2=class extends oM{constructor(e,t,i){if(super(t,i.vhs),typeof i.initialBandwidth=="number"&&(this.options_.bandwidth=i.initialBandwidth),this.logger_=dr("VhsHandler"),t.options_&&t.options_.playerId){const r=j.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_=at(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=w2();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=Qt.INITIAL_BANDWIDTH),this.options_.enableLowInitialPlaylist=this.options_.enableLowInitialPlaylist&&this.options_.bandwidth===Qt.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=aM(this.source_.src),this.options_.tech=this.tech_,this.options_.externVhs=Dt,this.options_.sourceType=JC(t),this.options_.seekTo=n=>{this.tech_.setCurrentTime(n)},this.options_.player_=this.player_,this.playlistController_=new HR(this.options_);const i=at({liveRangeSafeTimeDelta:qr},this.options_,{seekable:()=>this.seekable(),media:()=>this.playlistController_.media(),playlistController:this.playlistController_});this.playbackWatcher_=new GR(i),this.attachStreamingEventListeners_(),this.playlistController_.on("error",()=>{const n=j.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?Dt.movingAverageBandwidthSelector(.55):Dt.STANDARD_PLAYLIST_SELECTOR;this.playlistController_.selectPlaylist=this.selectPlaylist?this.selectPlaylist.bind(this):r.bind(this),this.playlistController_.selectInitialPlaylist=Dt.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=R.navigator.connection||R.navigator.mozConnection||R.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(){j.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:()=>Os(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:()=>Os(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&&sM({bandwidth:this.bandwidth,throughput:Math.round(this.throughput)})}),this.playlistController_.on("selectedinitialmedia",()=>{WR(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_=R.URL.createObjectURL(this.playlistController_.mediaSource),(j.browser.IS_ANY_SAFARI||j.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"),rM({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=nM({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=j.players[this.tech_.options_.playerId];!e||!e.qualityLevels||this.qualityLevels_||(this.qualityLevels_=e.qualityLevels(),this.playlistController_.on("selectedinitialmedia",()=>{eM(this.qualityLevels_,this)}),this.playlists.on("mediachange",()=>{E2(this.qualityLevels_,this.playlists)}))}static version(){return{"@videojs/http-streaming":x2,"mux.js":QR,"mpd-parser":YR,"m3u8-parser":JR,"aes-decrypter":ZR}}version(){return this.constructor.version()}canChangeType(){return y2.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_&&R.URL.revokeObjectURL&&(R.URL.revokeObjectURL(this.mediaSourceUrl_),this.mediaSourceUrl_=null),this.tech_&&this.tech_.off("waitingforkey",this.handleWaitingForKey_),super.dispose()}convertToProgramTime(e,t){return lO({playlist:this.playlistController_.media(),time:e,callback:t})}seekToProgramTime(e,t,i=!0,r=2){return e2({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=>{k2(this.xhr,e)},this.xhr.onResponse=e=>{A2(this.xhr,e)},this.xhr.offRequest=e=>{I2(this.xhr,e)},this.xhr.offResponse=e=>{P2(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(A._extends({},r))})}),t.forEach(i=>{this.playbackWatcher_.on(i,r=>{this.player_.trigger(A._extends({},r))})})}};const jc={name:"videojs-http-streaming",VERSION:x2,canHandleSource(s,e={}){const t=at(j.options,e);return!t.vhs.experimentalUseMMS&&!yl("avc1.4d400d,mp4a.40.2",!1)?!1:jc.canPlayType(s.type,t)},handleSource(s,e,t={}){const i=at(j.options,t);return e.vhs=new D2(s,e,i),e.vhs.xhr=XE(),e.vhs.setupXhrHooks_(),e.vhs.src(s.src,s.type),e.vhs},canPlayType(s,e){const t=JC(s);if(!t)return"";const i=jc.getOverrideNative(e);return!Dt.supportsTypeNatively(t)||i?"maybe":""},getOverrideNative(s={}){const{vhs:e={}}=s,t=!(j.browser.IS_ANY_SAFARI||j.browser.IS_IOS),{overrideNative:i=t}=e;return i}},lM=()=>yl("avc1.4d400d,mp4a.40.2",!0);lM()&&j.getTech("Html5").registerSourceHandler(jc,0);j.VhsHandler=D2;j.VhsSourceHandler=jc;j.Vhs=Dt;j.use||j.registerComponent("Vhs",Dt);j.options.vhs=j.options.vhs||{};(!j.getPlugin||!j.getPlugin("reloadSourceOnError"))&&j.registerPlugin("reloadSourceOnError",XR);const uM=j.getComponent("MenuItem");class cM extends uM{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_=j.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 hM=j.getComponent("MenuButton");class dM extends hM{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 cM(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())}}j.registerComponent("cogButton",dM);const fM=j.getComponent("MenuItem");class Qs extends fM{constructor(e,t){super(e,t)}createEl(){return j.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 pM=j.getComponent("MenuItem"),V_=j.getComponent("MenuButton"),mM=["large","medium","small"];let gM=class extends pM{constructor(e,t){super(e,t)}handleClick(){this.player_.textTrackSettings.setSizeSetting(this.options_.value)}};class vM extends V_{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 Qs(this.player_,{label:"Caption Text Size",onClickBack:()=>{this.requestAnimationFrame(()=>{this.player_.getChild("collapserator").getChild("subsCapsButton").pressButton()})}})];return mM.map(r=>{i.push(new gM(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(){V_.prototype.handleClick.apply(this)}}j.registerComponent("SubtitleSizeButton",vM);function Yv(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 $c(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 z_(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=A.TextHelper.sanitize(t.text))}}function W_(s,e,t,i,r){const n=s.textTracks(),a=Yv(n,e,t,r)[0];if(a){$c(a,e,t,i);return}const o=l=>{$c(l.track,e,t,i),n.removeEventListener("addtrack",o)};n.addEventListener("addtrack",o),s.one("dispose",()=>{n.removeEventListener("addtrack",o)})}function G_(s,e,t,i,r){const n=s.textTracks(),a=Yv(n,e,t,r);a.length&&a.forEach(l=>$c(l,e,t,i,r));const o=l=>{$c(l.track,e,t,i,r)};n.addEventListener("addtrack",o),s.one("dispose",()=>{n.removeEventListener("addtrack",o)})}const Wt={getTrack(s,e,t,i){const r=s.textTracks();return Yv(r,e,t,i)[0]},useChapters(s,e){W_(s,"chapters",null,e)},useMetadataTrack(s,e,t){W_(s,"metadata",e,t,null)},useMetadataTracks(s,e,t,i){G_(s,"metadata",e,t,i)},useSubtitles(s,e,t){G_(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){z_(s);return}const t=()=>z_(s);s.addEventListener("loadeddata",t),e.one("dispose",()=>{s.removeEventListener("loadeddata",t)})},activeTextTrack(s){s.mode==="disabled"&&s.kind==="subtitles"&&(s.mode="hidden")}},yM=function(s,e){let t=window.performance.now();return function(...r){const n=window.performance.now();n-t>=e&&(s(...r),t=n)}},Gl=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},N2=j.getComponent("MenuItem");class Jv extends N2{constructor(e,t){super(e,t),this.onChange=Gl(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)}}j.registerComponent("SearchInputMenuItem",Jv);class Zv extends N2{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)}}j.registerComponent("NoMatchingResultsMenuItem",Zv);const _M=j.getComponent("MenuItem");class TM extends _M{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 K_=j.getComponent("MenuButton");class bM extends K_{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=Wt.getCurrentTextTrack(this.player_);if(!e)return;if(!((r=e.cues)!=null&&r.length)){this.bindTrackEvents(e);return}const t=[new Jv(this.player_,{menuButton:this,search:this.search})];for(let n=0;n<e.cues.length;n++){const a=e.cues[n];t.push(new TM(this.player_,{cue:a,label:a.text,selected:!1,multiSelectable:!1}))}const i=new Zv(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=Wt.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(){K_.prototype.handleClick.apply(this)}}j.registerComponent("subtitleSearchButton",bM);const SM=j.getComponent("MenuItem"),X_=j.getComponent("MenuButton"),xM=[{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 CM extends SM{constructor(e,t){super(e,t)}createEl(){return j.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">⇑</span> /
|
|
232
|
+
<span class="cv-keyboard-button">Shift</span> +
|
|
233
|
+
<span class="cv-keyboard-button cv-single-key">⇓</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 EM extends X_{constructor(){super(...arguments),this.alwaysCollapsed=!0,this.isCollapsed=!1,this.isCollabsible=!0}createItems(){const e=[];return e.push(new Qs(this.player_,{label:"Keyboard shortcuts"})),xM.forEach(t=>{e.push(new CM(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(){X_.prototype.handleClick.apply(this)}}j.registerComponent("KeyboardShortcutsButton",EM);const wM=600,kM=1200,bf="cv-collapsed",AM=j.getComponent("Component");class IM extends AM{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(bf);continue}e?(i.isCollapsed=!0,i.addClass(bf)):(i.isCollapsed=!1,i.removeClass(bf))}}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")?kM:wM);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)}}j.registerComponent("collapserator",IM);const PM=["playToggle","volumePanel","customControlSpacer","playbackRateMenuButton","chaptersButton","qualityButton","keyboardShortcutsButton","subsCapsButton","whiteboardModeButton","subtitleSizeButton","subtitleSearchButton","fullscreenToggle"];class DM{constructor(e){this.options=e,this.initialize()}logStream(){const e=`v:${this.options.videoId}`;A.LocalStorageHelper.cacheExists(e)||(this.collectionApiClient.log({type:A.UserAction.WebPlayerStream,actionContext:this.getActionContext(),data:this.getAnalyticsData(),eventVersion:A.EventVersion.V3}),A.LocalStorageHelper&&A.LocalStorageHelper.cacheSet(e,null,300))}logVideoProgress(e){const t=this.getAnalyticsData();this.collectionApiClient.log(e.map(i=>({type:A.UserAction.StreamProgress,actionContext:this.getActionContext(),data:{...t,progress:i},eventVersion:A.EventVersion.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||A.EventVersion.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===A.EntityType.Interactive?e.interactive={id:+this.options.mediaId}:t===A.EntityType.Clip&&(e.clip={id:+this.options.mediaId}),e}initialize(){this.setupCollectionApiClient(),A.SessionHelper.lockWindowSession(),this.options.player.one("dispose",()=>A.SessionHelper.unlockWindowSession())}setupCollectionApiClient(){this.collectionApiClient=new A.CollectionApiClient({productName:"player.web",productVersion:this.options.productVersion,regionName:this.options.regionName,collectionApiUrls:this.options.collectionApiUrls,collectionApiClientId:this.options.collectionApiClientId,getUser:()=>this.getCurrentUser(),shouldLog:A.CollectionApiClientHelper.shouldLog,formatData:A.CollectionApiClientHelper.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?A.PlayerDescriptor.Embedded:void 0,workflowPhase:void 0}}getEntityType(){switch(this.options.mediaType){case"MasterVideo":return A.EntityType.Video;case"MasterInteractive":return A.EntityType.Interactive;case"MasterClip":return A.EntityType.Clip}}getLocationContext(){switch(this.options.playerType){case"player":return A.LocationContext.Player;case"interactive-player":return A.LocationContext.InteractivePlayer;case"create-clip-player":return A.LocationContext.CreateClipPlayer}}}class Ig extends Error{constructor(e,t){super((t==null?void 0:t.title)||"Ajax error"),this.url=e,this.response=t}}class NM{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 Ig(e.url)}finally{throw new Ig(e.url,i)}}return await e.json()}}const Pg=new NM;var $u={exports:{}},Q_;function LM(){return Q_||(Q_=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]}($u,$u.exports)),$u.exports}var OM=LM();const ze=A.getDefaultExportFromCjs(OM);function RM(s){document[s.fsApi_.fullscreenEnabled]&&(s.isFullscreen()?s.exitFullscreen():s.requestFullscreen())}function MM(s){const e=s.theatreModePlugin().getTheatreMode();s.theatreModePlugin().toggleTheatreMode(!e,{shouldLog:!0})}function FM(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 Y_(s){s.paused()?s.play():s.pause()}function qu(s,e){s.currentTime(s.currentTime()+e)}function J_(s,e){s.volume(s.volume()+e)}function BM(s){const e=s.target,t=["video-js","vjs-tech"];return e.tagName.toLowerCase()==="video"||!!t.find(i=>e.classList.contains(i))}const Z_={f:RM,m:FM,k:Y_,space:Y_,t:MM,left:s=>qu(s,-5),right:s=>qu(s,5),j:s=>qu(s,-10),l:s=>qu(s,10),up:s=>J_(s,.05),down:s=>J_(s,-.05)};function UM(s,e,t){if(s.ctrlKey||s.metaKey||s.altKey||s.shiftKey)return;const i=ze(s);if(i==="t"&&!t.allowTheatreMode||i==="f"&&!t.allowFullscreen||!Z_[i])return;Z_[i](e,s);const r=BM(s),n=["space"].includes(i);(r||n)&&(s.preventDefault(),s.stopPropagation())}var L2=(s=>(s.PhysicallyChapteredVideo="physically-chaptered-video",s))(L2||{});const jM="1.36.0",$M={version:jM};var Sf,eT;function qM(){if(eT)return Sf;eT=1,Sf=s;function s(e,t){var i,r=null;try{i=JSON.parse(e,t)}catch(n){r=n}return[r,i]}return Sf}var HM=qM();const VM=A.getDefaultExportFromCjs(HM);var Hu={exports:{}},xf,tT;function zM(){if(tT)return xf;tT=1;var s=vo(),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 xf=e,xf}var iT;function WM(){if(iT)return Hu.exports;iT=1;var s=vo(),e=cv.require_extends(),t=GC();o.httpHandler=zM();/**
|
|
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};Hu.exports=o,Hu.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(re,he,fe){d||(d=!0,h.callback(re,he,fe))};function y(){I.readyState===4&&setTimeout(k,0)}function p(){var X=void 0;if(I.response?X=I.response:X=I.responseText||u(I),P)try{X=JSON.parse(X)}catch{}return X}function _(X){return clearTimeout(K),X instanceof Error||(X=new Error(""+(X||"Unknown XMLHttpRequest Error"))),X.statusCode=0,g(X,z)}function k(){if(!$){var X;clearTimeout(K),h.useXDR&&I.status===void 0?X=200:X=I.status===1223?204:I.status;var re=z,he=null;return X!==0?(re={body:p(),statusCode:X,method:O,headers:{},url:F,rawRequest:I},I.getAllResponseHeaders&&(re.headers=i(I.getAllResponseHeaders()))):he=new Error("Internal XMLHttpRequest Error"),g(he,re,re.body)}}var I=h.xhr||null;I||(h.cors||h.useXDR?I=new o.XDomainRequest:I=new o.XMLHttpRequest);var L,$,F=I.url=h.uri||h.url,O=I.method=h.method||"GET",B=h.body||h.data,U=I.headers=h.headers||{},C=!!h.sync,P=!1,K,z={body:void 0,headers:{},statusCode:0,method:O,url:F,rawRequest:I};if("json"in h&&h.json!==!1&&(P=!0,U.accept||U.Accept||(U.Accept="application/json"),O!=="GET"&&O!=="HEAD"&&(U["content-type"]||U["Content-Type"]||(U["Content-Type"]="application/json"),B=JSON.stringify(h.json===!0?B:h.json))),I.onreadystatechange=y,I.onload=k,I.onerror=_,I.onprogress=function(){},I.onabort=function(){$=!0},I.ontimeout=_,I.open(O,F,!C,h.username,h.password),C||(I.withCredentials=!!h.withCredentials),!C&&h.timeout>0&&(K=setTimeout(function(){if(!$){$=!0,I.abort("timeout");var X=new Error("XMLHttpRequest timeout");X.code="ETIMEDOUT",_(X)}},h.timeout)),I.setRequestHeader)for(L in U)U.hasOwnProperty(L)&&I.setRequestHeader(L,U[L]);else if(h.headers&&!n(h.headers))throw new Error("Headers cannot be set on an XDomainRequest object");return"responseType"in h&&(I.responseType=h.responseType),"beforeSend"in h&&typeof h.beforeSend=="function"&&h.beforeSend(I),I.send(B||null),I}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 Hu.exports}var GM=WM();const O2=A.getDefaultExportFromCjs(GM);function R2(){try{var s=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(R2=function(){return!!s})()}function M2(s,e,t){if(R2())return Reflect.construct.apply(null,arguments);var i=[null];i.push.apply(i,e);var r=new(s.bind.apply(s,i));return t&&A._setPrototypeOf(r,t.prototype),r}function KM(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&&A._setPrototypeOf(s,e)}var Cf={exports:{}},rT;function XM(){return rT||(rT=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})()}(Cf)),Cf.exports}var QM=XM();const nT=A.getDefaultExportFromCjs(QM);var sT="http://example.com",Mh=function(e,t){if(/^[a-z]+:/i.test(t))return t;/^data:/.test(e)&&(e=R.location&&R.location.href||"");var i=typeof R.URL=="function",r=/^\/\//.test(e),n=!R.location&&!/\/\//i.test(e);if(i?e=new R.URL(e,R.location||sT):/\/\//i.test(e)||(e=nT.buildAbsoluteURL(R.location&&R.location.href||"",e)),i){var a=new URL(t,e);return n?a.href.slice(sT.length):r?a.href.slice(a.protocol.length):a.href}return nT.buildAbsoluteURL(e,t)},e0=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}(),YM=function(e){return R.atob?R.atob(e):Buffer.from(e,"base64").toString("binary")};function F2(s){for(var e=YM(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 JM=function(s){A._inheritsLoose(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}(e0),ZM=" ",Ef=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},e3=function(){var e="[^=]*",t='"[^"]*"|[^,]*',i="(?:"+e+")=(?:"+t+")";return new RegExp("(?:^|,)("+i+")")},br=function(e){for(var t=e.split(e3()),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},t3=function(s){A._inheritsLoose(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=A._extends(Ef(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=br(a[1]);h.URI&&(o.uri=h.URI),h.BYTERANGE&&(o.byterange=Ef(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=br(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=br(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=br(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=br(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=br(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(ZM)),n.trigger("data",o);return}if(a=/^#EXT-X-PART:(.*)$/.exec(u),a&&a[1]){o={type:"tag",tagType:"part"},o.attributes=br(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=Ef(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=br(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=br(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=br(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=br(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}(e0),i3=function(e){return e.toLowerCase().replace(/-(\w)/g,function(t){return t[1].toUpperCase()})},Ea=function(e){var t={};return Object.keys(e).forEach(function(i){t[i3(i)]=e[i]}),t},wf=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)}},r3=function(s){A._inheritsLoose(e,s);function e(){var i;i=s.call(this)||this,i.lineStream=new JM,i.parseStream=new t3,i.lineStream.pipe(i.parseStream);var r=A._assertThisInitialized(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,I;({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 F={};"length"in _&&(a.byterange=F,F.length=_.length,"offset"in _||(_.offset=y)),"offset"in _&&(a.byterange=F,F.offset=_.offset),y=F.offset+F.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 F=["SAMPLE-AES","SAMPLE-AES-CTR","SAMPLE-AES-CENC"];if(F.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:F2(_.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={}),A._extends(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 F=this.manifest.mediaGroups[_.attributes.TYPE];F[_.attributes["GROUP-ID"]]=F[_.attributes["GROUP-ID"]]||{},k=F[_.attributes["GROUP-ID"]],I={default:/yes/i.test(_.attributes.DEFAULT)},I.default?I.autoselect=!0:I.autoselect=/yes/i.test(_.attributes.AUTOSELECT),_.attributes.LANGUAGE&&(I.language=_.attributes.LANGUAGE),_.attributes.URI&&(I.uri=_.attributes.URI),_.attributes["INSTREAM-ID"]&&(I.instreamId=_.attributes["INSTREAM-ID"]),_.attributes.CHARACTERISTICS&&(I.characteristics=_.attributes.CHARACTERISTICS),_.attributes.FORCED&&(I.forced=/yes/i.test(_.attributes.FORCED)),k[_.attributes.NAME]=I},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,wf.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=Ea(_.attributes),this.warnOnMissingAttributes_("#EXT-X-SKIP",_.attributes,["SKIPPED-SEGMENTS"])},part:function(){var F=this;u=!0;var O=this.manifest.segments.length,B=Ea(_.attributes);a.parts=a.parts||[],a.parts.push(B),B.byterange&&(B.byterange.hasOwnProperty("offset")||(B.byterange.offset=p),p=B.byterange.offset+B.byterange.length);var U=a.parts.length-1;this.warnOnMissingAttributes_("#EXT-X-PART #"+U+" for segment #"+O,_.attributes,["URI","DURATION"]),this.manifest.renditionReports&&this.manifest.renditionReports.forEach(function(C,P){C.hasOwnProperty("lastPart")||F.trigger("warn",{message:"#EXT-X-RENDITION-REPORT #"+P+" lacks required attribute(s): LAST-PART"})})},"server-control":function(){var F=this.manifest.serverControl=Ea(_.attributes);F.hasOwnProperty("canBlockReload")||(F.canBlockReload=!1,this.trigger("info",{message:"#EXT-X-SERVER-CONTROL defaulting CAN-BLOCK-RELOAD to false"})),wf.call(this,this.manifest),F.canSkipDateranges&&!F.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 F=this.manifest.segments.length,O=Ea(_.attributes),B=O.type&&O.type==="PART";a.preloadHints=a.preloadHints||[],a.preloadHints.push(O),O.byterange&&(O.byterange.hasOwnProperty("offset")||(O.byterange.offset=B?p:0,B&&(p=O.byterange.offset+O.byterange.length)));var U=a.preloadHints.length-1;if(this.warnOnMissingAttributes_("#EXT-X-PRELOAD-HINT #"+U+" for segment #"+F,_.attributes,["TYPE","URI"]),!!O.type)for(var C=0;C<a.preloadHints.length-1;C++){var P=a.preloadHints[C];P.type&&P.type===O.type&&this.trigger("warn",{message:"#EXT-X-PRELOAD-HINT #"+U+" for segment #"+F+" has the same TYPE "+O.type+" as preload hint #"+C})}},"rendition-report":function(){var F=Ea(_.attributes);this.manifest.renditionReports=this.manifest.renditionReports||[],this.manifest.renditionReports.push(F);var O=this.manifest.renditionReports.length-1,B=["LAST-MSN","URI"];u&&B.push("LAST-PART"),this.warnOnMissingAttributes_("#EXT-X-RENDITION-REPORT #"+O,_.attributes,B)},"part-inf":function(){this.manifest.partInf=Ea(_.attributes),this.warnOnMissingAttributes_("#EXT-X-PART-INF",_.attributes,["PART-TARGET"]),this.manifest.partInf.partTarget&&(this.manifest.partTargetDuration=this.manifest.partInf.partTarget),wf.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}(e0),Hs={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^/},n3=["video","audio","text"],aT=["Video","Audio","Text"],B2=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})},Fr=function(e){e===void 0&&(e="");var t=e.split(","),i=[];return t.forEach(function(r){r=r.trim();var n;n3.forEach(function(a){var o=Hs[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},s3=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 Fr(n.playlists[0].attributes.CODECS)}return null},U2=function(e){return e===void 0&&(e=""),Hs.audio.test(e.trim().toLowerCase())},a3=function(e){return e===void 0&&(e=""),Hs.text.test(e.trim().toLowerCase())},Nl=function(e){if(!(!e||typeof e!="string")){var t=e.toLowerCase().split(",").map(function(n){return B2(n.trim())}),i="video";t.length===1&&U2(t[0])?i="audio":t.length===1&&a3(t[0])&&(i="application");var r="mp4";return t.every(function(n){return Hs.mp4.test(n)})?r="mp4":t.every(function(n){return Hs.webm.test(n)})?r="webm":t.every(function(n){return Hs.ogg.test(n)})&&(r="ogg"),i+"/"+r+';codecs="'+e+'"'}},cc=function(e){return e===void 0&&(e=""),R.MediaSource&&R.MediaSource.isTypeSupported&&R.MediaSource.isTypeSupported(Nl(e))||!1},kf=function(e){return e===void 0&&(e=""),e.toLowerCase().split(",").every(function(t){t=t.trim();for(var i=0;i<aT.length;i++){var r=aT[i];if(Hs["muxer"+r].test(t))return!0}return!1})},oT="mp4a.40.2",o3="avc1.4d400d",l3=/^(audio|video|application)\/(x-|vnd\.apple\.)?mpegurl/i,u3=/^application\/dash\+xml/i,j2=function(e){return l3.test(e)?"hls":u3.test(e)?"dash":e==="application/vnd.videojs.vhs+json"?"vhs-json":null},c3=function(e){return e.toString(2).length},h3=function(e){return Math.ceil(c3(e)/8)},$2=function(e){return ArrayBuffer.isView==="function"?ArrayBuffer.isView(e):e&&e.buffer instanceof ArrayBuffer},d3=function(e){return $2(e)},je=function(e){return e instanceof Uint8Array?e:(!Array.isArray(e)&&!d3(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))},ai=R.BigInt||Number,Dg=[ai("0x1"),ai("0x100"),ai("0x10000"),ai("0x1000000"),ai("0x100000000"),ai("0x10000000000"),ai("0x1000000000000"),ai("0x100000000000000"),ai("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 f3=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+ai(g)*Dg[p]},ai(0));if(n){var h=Dg[e.length]/ai(2)-ai(1);c=ai(c),c>h&&(c-=h,c-=h,c-=ai(2))}return Number(c)},p3=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=ai(e);for(var a=h3(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/Dg[l]&ai(255)),e<0&&(o[u]=Math.abs(~o[u]),o[u]-=l===0?1:2)}return o},q2=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},m3=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},wt=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})},g3=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 lT=function(e){return!!e&&typeof e=="object"},xi=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]):lT(r[a])&&lT(n[a])?r[a]=s(r[a],n[a]):r[a]=n[a]}),r},{})},H2=function(e){return Object.keys(e).map(function(t){return e[t]})},v3=function(e,t){for(var i=[],r=e;r<t;r++)i.push(r);return i},Fh=function(e){return e.reduce(function(t,i){return t.concat(i)},[])},V2=function(e){if(!e.length)return[];for(var t=[],i=0;i<e.length;i++)t.push(e[i]);return t},y3=function(e,t){return e.reduce(function(i,r,n){return r[t]&&i.push(n),i},[])},Ng=function(e,t){for(var i=0;i<e.length;i++)if(t(e[i]))return i;return-1},_3=function(e,t){return H2(e.reduce(function(i,r){return r.forEach(function(n){i[t(n)]=n}),i},{}))},oo={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"},Ll=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:Mh(i||"",n)};if(o||u){var h=o||u,d=h.split("-"),g=R.BigInt?R.BigInt(d[0]):parseInt(d[0],10),y=R.BigInt?R.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=R.BigInt(y)-R.BigInt(g)+R.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},T3=function(e){var t;return typeof e.offset=="bigint"||typeof e.length=="bigint"?t=R.BigInt(e.offset)+R.BigInt(e.length)-R.BigInt(1):t=e.offset+e.length-1,e.offset+"-"+t},uT=function(e){return e&&typeof e!="number"&&(e=parseInt(e,10)),isNaN(e)?null:e},b3={static:function(e){var t=e.duration,i=e.timescale,r=i===void 0?1:i,n=e.sourceDuration,a=e.periodDuration,o=uT(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=uT(e.endNumber),p=(t+i)/1e3,_=r+u,k=p+h,I=k-_,L=Math.ceil(I*a/o),$=Math.floor((p-_-g)*a/o),F=Math.floor((p-_)*a/o);return{start:Math.max(0,$),end:typeof y=="number"?y:Math.min(L,F)}}},S3=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}}},t0=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=b3[t](e),u=l.start,c=l.end,h=v3(u,c).map(S3(e));if(t==="static"){var d=h.length-1,g=typeof a=="number"?a:o;h[d].duration=g-i/n*d}return h},z2=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(oo.NO_BASE_URL);var g=Ll({baseUrl:t,source:r.sourceURL,range:r.range}),y=Ll({baseUrl:t,source:t,indexRange:o});if(y.map=g,d){var p=t0(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]},i0=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"?_=R.BigInt(l)+t.firstOffset:_=l+t.firstOffset;for(var k=0;k<c.length;k++){var I=t.references[k],L=I.referencedSize,$=I.subsegmentDuration,F=void 0;typeof _=="bigint"?F=_+R.BigInt(L)-R.BigInt(1):F=_+L-1;var O=_+"-"+F,B={baseUrl:i,timescale:u,timeline:a,periodStart:g,presentationTime:y,number:p,duration:$,sourceDuration:n,indexRange:O,type:d},U=z2(B)[0];r&&(U.map=r),h.push(U),typeof _=="bigint"?_+=R.BigInt(L):_+=L,y+=$/u,p++}return e.segments=h,e},x3=["AUDIO","SUBTITLES"],C3=1/60,W2=function(e){return _3(e,function(t){var i=t.timeline;return i}).sort(function(t,i){return t.timeline>i.timeline?1:-1})},E3=function(e,t){for(var i=0;i<e.length;i++)if(e[i].attributes.NAME===t)return e[i];return null},cT=function(e){var t=[];return g3(e,x3,function(i,r,n,a){t=t.concat(i.playlists||[])}),t},hT=function(e){var t=e.playlist,i=e.mediaSequence;t.mediaSequence=i,t.segments.forEach(function(r,n){r.number=t.mediaSequence+n})},w3=function(e){var t=e.oldPlaylists,i=e.newPlaylists,r=e.timelineStarts;i.forEach(function(n){n.discontinuitySequence=Ng(r,function(c){var h=c.timeline;return h===n.timeline});var a=E3(t,n.attributes.NAME);if(a&&!n.sidx){var o=n.segments[0],l=Ng(a.segments,function(c){return Math.abs(c.presentationTime-o.presentationTime)<C3});if(l===-1){hT({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--),hT({playlist:n,mediaSequence:a.segments[l].number})}})},k3=function(e){var t=e.oldManifest,i=e.newManifest,r=t.playlists.concat(cT(t)),n=i.playlists.concat(cT(i));return i.timelineStarts=W2([t.timelineStarts,i.timelineStarts]),w3({oldPlaylists:r,newPlaylists:n,timelineStarts:i.timelineStarts}),i},Bh=function(e){return e&&e.uri+"-"+T3(e.byterange)},Af=function(e){var t=H2(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=y3(i.segments||[],"discontinuity"),i})},r0=function(e,t){var i=Bh(e.sidx),r=i&&t[i]&&t[i].sidx;return r&&i0(e,r,e.sidx.resolvedUri),e},A3=function(e,t){if(t===void 0&&(t={}),!Object.keys(t).length)return e;for(var i in e)e[i]=r0(e[i],t);return e},I3=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},P3=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}},D3=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=r0(I3(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},N3=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(r0(P3(r),t)),i},{})},L3=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},{})},O3=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},R3=function(e){var t=e.attributes;return t.mimeType==="video/mp4"||t.mimeType==="video/webm"||t.contentType==="video"},M3=function(e){var t=e.attributes;return t.mimeType==="audio/mp4"||t.mimeType==="audio/webm"||t.contentType==="audio"},F3=function(e){var t=e.attributes;return t.mimeType==="text/vtt"||t.contentType==="text"},B3=function(e,t){e.forEach(function(i){i.mediaSequence=0,i.discontinuitySequence=Ng(t,function(r){var n=r.timeline;return n===i.timeline}),i.segments&&i.segments.forEach(function(r,n){r.number=n})})},dT=function(e){return e?Object.keys(e).reduce(function(t,i){var r=e[i];return t.concat(r.playlists)},[]):[]},U3=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=Af(i.filter(R3)).map(O3),y=Af(i.filter(M3)),p=Af(i.filter(F3)),_=i.map(function(B){return B.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:A3(g,a)};d>=0&&(k.minimumUpdatePeriod=d*1e3),r&&(k.locations=r),c==="dynamic"&&(k.suggestedPresentationDelay=h);var I=k.playlists.length===0,L=y.length?D3(y,a,I):null,$=p.length?N3(p,a):null,F=g.concat(dT(L),dT($)),O=F.map(function(B){var U=B.timelineStarts;return U});return k.timelineStarts=W2(O),B3(F,k.timelineStarts),L&&(k.mediaGroups.AUDIO.audio=L),$&&(k.mediaGroups.SUBTITLES.subs=$),_.length&&(k.mediaGroups["CLOSED-CAPTIONS"].cc=L3(_)),o?k3({oldManifest:o,newManifest:k}):k},j3=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)},G2=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[_],I=k.d,L=k.r||0,$=k.t||0;p<0&&(p=$),$&&$>p&&(p=$);var F=void 0;if(L<0){var O=_+1;O===t.length?i==="dynamic"&&n>0&&o.indexOf("$Number$")>0?F=j3(e,p,I):F=(l*c-p)/I:F=(t[O].t-p)/I}else F=L+1;for(var B=d+y.length+F,U=d+y.length;U<B;)y.push({number:U,duration:I/c,time:p,timeline:g}),p+=I,U++}return y},$3=/\$([A-z]*)(?:(%0)([0-9]+)d)?\$/g,q3=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}},fT=function(e,t){return e.replace($3,q3(t))},H3=function(e,t){return!e.duration&&!t?[{number:e.startNumber||1,duration:e.sourceDuration,time:0,timeline:e.periodStart}]:e.duration?t0(e):G2(e,t)},V3=function(e,t){var i={RepresentationID:e.id,Bandwidth:e.bandwidth||0},r=e.initialization,n=r===void 0?{sourceURL:"",range:""}:r,a=Ll({baseUrl:e.baseUrl,source:fT(n.sourceURL,i),range:n.range}),o=H3(e,t);return o.map(function(l){i.Number=l.number,i.Time=l.time;var u=fT(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:Mh(e.baseUrl||"",u),map:a,number:l.number,presentationTime:d};return g})},z3=function(e,t){var i=e.baseUrl,r=e.initialization,n=r===void 0?{}:r,a=Ll({baseUrl:i,source:n.sourceURL,range:n.range}),o=Ll({baseUrl:i,source:t.media,range:t.mediaRange});return o.map=a,o},W3=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(oo.SEGMENT_TIME_UNSPECIFIED);var o=n.map(function(c){return z3(e,c)}),l;i&&(l=t0(e)),t&&(l=G2(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},G3=function(e){var t=e.attributes,i=e.segmentInfo,r,n;i.template?(n=V3,r=xi(t,i.template)):i.base?(n=z2,r=xi(t,i.base)):i.list&&(n=W3,r=xi(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},K3=function(e){return e.map(G3)},jt=function(e,t){return V2(e.childNodes).filter(function(i){var r=i.tagName;return r===t})},n0=function(e){return e.textContent.trim()},X3=function(e){return parseFloat(e.split("/").reduce(function(t,i){return t/i}))},wa=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)},Q3=function(e){var t=/^\d+-\d+-\d+T\d+:\d+:\d+(\.\d+)?$/;return t.test(e)&&(e+="Z"),Date.parse(e)},pT={mediaPresentationDuration:function(e){return wa(e)},availabilityStartTime:function(e){return Q3(e)/1e3},minimumUpdatePeriod:function(e){return wa(e)},suggestedPresentationDelay:function(e){return wa(e)},type:function(e){return e},timeShiftBufferDepth:function(e){return wa(e)},start:function(e){return wa(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 X3(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)?wa(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}},hi=function(e){return e&&e.attributes?V2(e.attributes).reduce(function(t,i){var r=pT[i.name]||pT.DEFAULT;return t[i.name]=r(i.value),t},{}):{}},Y3={"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"},Uh=function(e,t){return t.length?Fh(e.map(function(i){return t.map(function(r){return Mh(i,n0(r))})})):e},s0=function(e){var t=jt(e,"SegmentTemplate")[0],i=jt(e,"SegmentList")[0],r=i&&jt(i,"SegmentURL").map(function(d){return xi({tag:"SegmentURL"},hi(d))}),n=jt(e,"SegmentBase")[0],a=i||t,o=a&&jt(a,"SegmentTimeline")[0],l=i||n||t,u=l&&jt(l,"Initialization")[0],c=t&&hi(t);c&&u?c.initialization=u&&hi(u):c&&c.initialization&&(c.initialization={sourceURL:c.initialization});var h={template:c,segmentTimeline:o&&jt(o,"S").map(function(d){return hi(d)}),list:i&&xi(hi(i),{segmentUrls:r,initialization:hi(u)}),base:n&&xi(hi(n),{initialization:hi(u)})};return Object.keys(h).forEach(function(d){h[d]||delete h[d]}),h},J3=function(e,t,i){return function(r){var n=jt(r,"BaseURL"),a=Uh(t,n),o=xi(e,hi(r)),l=s0(r);return a.map(function(u){return{segmentInfo:xi(i,l),attributes:xi(o,{baseUrl:u})}})}},Z3=function(e){return e.reduce(function(t,i){var r=hi(i);r.schemeIdUri&&(r.schemeIdUri=r.schemeIdUri.toLowerCase());var n=Y3[r.schemeIdUri];if(n){t[n]={attributes:r};var a=jt(i,"cenc:pssh")[0];if(a){var o=n0(a);t[n].pssh=o&&F2(o)}}return t},{})},eF=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})}},tF=function(e,t,i){return function(r){var n=hi(r),a=Uh(t,jt(r,"BaseURL")),o=jt(r,"Role")[0],l={role:hi(o)},u=xi(e,n,l),c=jt(r,"Accessibility")[0],h=eF(hi(c));h&&(u=xi(u,{captionServices:h}));var d=jt(r,"Label")[0];if(d&&d.childNodes.length){var g=d.childNodes[0].nodeValue.trim();u=xi(u,{label:g})}var y=Z3(jt(r,"ContentProtection"));Object.keys(y).length&&(u=xi(u,{contentProtection:y}));var p=s0(r),_=jt(r,"Representation"),k=xi(i,p);return Fh(_.map(J3(u,a,k)))}},iF=function(e,t){return function(i,r){var n=Uh(t,jt(i.node,"BaseURL")),a=xi(e,{periodStart:i.attributes.start});typeof i.attributes.duration=="number"&&(a.periodDuration=i.attributes.duration);var o=jt(i.node,"AdaptationSet"),l=s0(i.node);return Fh(o.map(tF(a,n,l)))}},rF=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},nF=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=jt(e,"Period");if(!c.length)throw new Error(oo.INVALID_NUMBER_OF_PERIOD);var h=jt(e,"Location"),d=hi(e),g=Uh([n],jt(e,"BaseURL"));d.type=d.type||"static",d.sourceDuration=d.mediaPresentationDuration||0,d.NOW=o,d.clientOffset=u,h.length&&(d.locations=h.map(n0));var y=[];return c.forEach(function(p,_){var k=hi(p),I=y[_-1];k.start=rF({attributes:k,priorPeriodAttributes:I?I.attributes:null,mpdType:d.type}),y.push({node:p,attributes:k})}),{locations:d.locations,representationInfo:Fh(y.map(iF(d,g)))}},K2=function(e){if(e==="")throw new Error(oo.DASH_EMPTY_MANIFEST);var t=new i1.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(oo.DASH_INVALID_XML);return r},sF=function(e){var t=jt(e,"UTCTiming")[0];if(!t)return null;var i=hi(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(oo.UNSUPPORTED_UTC_TIMING_SCHEME)}return i},aF=function(e,t){t===void 0&&(t={});var i=nF(K2(e),t),r=K3(i.representationInfo);return U3({dashPlaylists:r,locations:i.locations,sidxMapping:t.sidxMapping,previousManifest:t.previousManifest})},oF=function(e){return sF(K2(e))},If,mT;function lF(){if(mT)return If;mT=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 If={getUint64:e,MAX_UINT32:s},If}var Pf,gT;function uF(){if(gT)return Pf;gT=1;var s=lF().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 Pf=e,Pf}var cF=uF();const hF=A.getDefaultExportFromCjs(cF);var dF=je([73,68,51]),fF=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},pl=function s(e,t){return t===void 0&&(t=0),e=je(e),e.length-t<10||!wt(e,dF,{offset:t})?t:(t+=fF(e,t),s(e,t))},vT=function(e){return typeof e=="string"?q2(e):e},pF=function(e){return Array.isArray(e)?e.map(function(t){return vT(t)}):[vT(e)]},mF=function s(e,t,i){i===void 0&&(i=!1),t=pF(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);wt(o,t[0])&&(t.length===1?r.push(u):r.push.apply(r,s(u,t.slice(1),i))),n=l}return r},Vu={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])},Lg=[128,64,32,16,8,4,2,1],gF=function(e){for(var t=1,i=0;i<Lg.length&&!(e&Lg[i]);i++)t++;return t},qc=function(e,t,i,r){i===void 0&&(i=!0),r===void 0&&(r=!1);var n=gF(e[t]),a=e.subarray(t,t+n);return i&&(a=Array.prototype.slice.call(e,t,t+n),a[0]^=Lg[n-1]),{length:n,value:f3(a,{signed:r}),bytes:a}},yT=function s(e){return typeof e=="string"?e.match(/.{1,2}/g).map(function(t){return s(t)}):typeof e=="number"?p3(e):e},vF=function(e){return Array.isArray(e)?e.map(function(t){return yT(t)}):[yT(e)]},yF=function s(e,t,i){if(i>=t.length)return t.length;var r=qc(t,i,!1);if(wt(e.bytes,r.bytes))return i;var n=qc(t,i+r.length);return s(e,t,i+n.length+n.value+r.length)},_T=function s(e,t){t=vF(t),e=je(e);var i=[];if(!t.length)return i;for(var r=0;r<e.length;){var n=qc(e,r,!1),a=qc(e,r+n.length),o=r+n.length+a.length;a.value===127&&(a.value=yF(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);wt(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},_F=je([0,0,0,1]),TF=je([0,0,1]),bF=je([0,0,3]),SF=function(e){for(var t=[],i=1;i<e.length-2;)wt(e.subarray(i,i+3),bF)&&(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},X2=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(wt(e.subarray(n),_F)?l=4:wt(e.subarray(n),TF)&&(l=3),!l){n++;continue}if(o++,a)return SF(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)},xF=function(e,t,i){return X2(e,"h264",t,i)},CF=function(e,t,i){return X2(e,"h265",t,i)},_i={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])},lo={aac:function(e){var t=pl(e);return wt(e,[255,16],{offset:t,mask:[255,22]})},mp3:function(e){var t=pl(e);return wt(e,[255,2],{offset:t,mask:[255,6]})},webm:function(e){var t=_T(e,[Vu.EBML,Vu.DocType])[0];return wt(t,_i.webm)},mkv:function(e){var t=_T(e,[Vu.EBML,Vu.DocType])[0];return wt(t,_i.matroska)},mp4:function(e){if(lo["3gp"](e)||lo.mov(e))return!1;if(wt(e,_i.mp4,{offset:4})||wt(e,_i.fmp4,{offset:4})||wt(e,_i.moof,{offset:4})||wt(e,_i.moov,{offset:4}))return!0},mov:function(e){return wt(e,_i.mov,{offset:4})},"3gp":function(e){return wt(e,_i["3gp"],{offset:4})},ac3:function(e){var t=pl(e);return wt(e,_i.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=pl(e);return wt(e,_i.flac,{offset:t})},ogg:function(e){return wt(e,_i.ogg)},avi:function(e){return wt(e,_i.riff)&&wt(e,_i.avi,{offset:8})},wav:function(e){return wt(e,_i.riff)&&wt(e,_i.wav,{offset:8})},h264:function(e){return xF(e,7,3).length},h265:function(e){return CF(e,[32,33],3).length}},Og=Object.keys(lo).filter(function(s){return s!=="ts"&&s!=="h264"&&s!=="h265"}).concat(["ts","h264","h265"]);Og.forEach(function(s){var e=lo[s];lo[s]=function(t){return e(je(t))}});var EF=lo,a0=function(e){e=je(e);for(var t=0;t<Og.length;t++){var i=Og[t];if(EF[i](e))return i}return""},wF=function(e){return mF(e,["moof"]).length>0},Df,TT;function kF(){if(TT)return Df;TT=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)},Df={ONE_SECOND_IN_TS:s,secondsToVideoTs:e,secondsToAudioTs:t,videoTsToSeconds:i,audioTsToSeconds:r,audioTsToVideoTs:n,videoTsToAudioTs:a,metadataTsToSeconds:o},Df}var Hc=kF();function Rg(s){return Rg=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Rg(s)}function AF(s){try{return Function.toString.call(s).indexOf("[native code]")!==-1}catch{return typeof s=="function"}}function Mg(s){var e=typeof Map=="function"?new Map:void 0;return Mg=function(i){if(i===null||!AF(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 M2(i,arguments,Rg(this).constructor)}return r.prototype=Object.create(i.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),A._setPrototypeOf(r,i)},Mg(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 Q2="7.21.7",_n={},es=function(e,t){return _n[e]=_n[e]||[],t&&(_n[e]=_n[e].concat(t)),_n[e]},IF=function(e,t){es(e,t)},Y2=function(e,t){var i=es(e).indexOf(t);return i<=-1?!1:(_n[e]=_n[e].slice(),_n[e].splice(i,1),!0)},PF=function(e,t){es(e,[].concat(t).map(function(i){var r=function n(){return Y2(e,n),i.apply(void 0,arguments)};return r}))},Vc={prefixed:!0},hc=[["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"]],bT=hc[0],ml;for(var zu=0;zu<hc.length;zu++)if(hc[zu][1]in ce){ml=hc[zu];break}if(ml){for(var Wu=0;Wu<ml.length;Wu++)Vc[bT[Wu]]=ml[Wu];Vc.prefixed=ml[0]!==bT[0]}var Li=[],DF=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+":"),Li){Li.push([].concat(n));var l=Li.length-1e3;Li.splice(0,l>0?l:0)}if(R.console){var u=R.console[i];!u&&i==="debug"&&(u=R.console.info||R.console.log),!(!u||!a||!o.test(i))&&u[Array.isArray(n)?"apply":"call"](R.console,n)}}};function J2(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=DF(s,i),i.createLogger=function(r){return J2(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 Li?[].concat(Li):[]},i.history.filter=function(r){return(Li||[]).filter(function(n){return new RegExp(".*"+r+".*").test(n[0])})},i.history.clear=function(){Li&&(Li.length=0)},i.history.disable=function(){Li!==null&&(Li.length=0,Li=null)},i.history.enable=function(){Li===null&&(Li=[])},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 Ke=J2("VIDEOJS"),Z2=Ke.createLogger,NF=Object.prototype.toString,ew=function(e){return Cn(e)?Object.keys(e):[]};function Ga(s,e){ew(s).forEach(function(t){return e(s[t],t)})}function LF(s,e,t){return t===void 0&&(t=0),ew(s).reduce(function(i,r){return e(i,s[r],r)},t)}function Ft(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?A._extends.apply(void 0,[s].concat(t)):(t.forEach(function(r){r&&Ga(r,function(n,a){s[a]=n})}),s)}function Cn(s){return!!s&&typeof s=="object"}function Ol(s){return Cn(s)&&NF.call(s)==="[object Object]"&&s.constructor===Object}function Rl(s,e){if(!s||!e)return"";if(typeof R.getComputedStyle=="function"){var t;try{t=R.getComputedStyle(s)}catch{return""}return t?t.getPropertyValue(e)||t[e]:""}return""}var ei=R.navigator&&R.navigator.userAgent||"",ST=/AppleWebKit\/([\d.]+)/i.exec(ei),OF=ST?parseFloat(ST.pop()):null,tw=/iPod/i.test(ei),RF=function(){var s=ei.match(/OS (\d+)_/i);return s&&s[1]?s[1]:null}(),wn=/Android/i.test(ei),o0=function(){var s=ei.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}(),iw=wn&&o0<5&&OF<537,rw=/Firefox/i.test(ei),Kl=/Edg/i.test(ei),kn=!Kl&&(/Chrome/i.test(ei)||/CriOS/i.test(ei)),nw=function(){var s=ei.match(/(Chrome|CriOS)\/(\d+)/);return s&&s[2]?parseFloat(s[2]):null}(),Xl=function(){var s=/MSIE\s(\d+)\.\d/.exec(ei),e=s&&parseFloat(s[1]);return!e&&/Trident\/7.0/i.test(ei)&&/rv:11.0/.test(ei)&&(e=11),e}(),l0=/Safari/i.test(ei)&&!kn&&!wn&&!Kl,sw=/Windows/i.test(ei),uo=!!(wo()&&("ontouchstart"in R||R.navigator.maxTouchPoints||R.DocumentTouch&&R.document instanceof R.DocumentTouch)),u0=/iPad/i.test(ei)||l0&&uo&&!/iPhone/i.test(ei),c0=/iPhone/i.test(ei)&&!u0,ki=c0||u0||tw,jh=(l0||ki)&&!kn,MF=Object.freeze({__proto__:null,IS_IPOD:tw,IOS_VERSION:RF,IS_ANDROID:wn,ANDROID_VERSION:o0,IS_NATIVE_ANDROID:iw,IS_FIREFOX:rw,IS_EDGE:Kl,IS_CHROME:kn,CHROME_VERSION:nw,IE_VERSION:Xl,IS_SAFARI:l0,IS_WINDOWS:sw,TOUCH_ENABLED:uo,IS_IPAD:u0,IS_IPHONE:c0,IS_IOS:ki,IS_ANY_SAFARI:jh});function xT(s){return typeof s=="string"&&!!s.trim()}function aw(s){if(s.indexOf(" ")>=0)throw new Error("class has illegal whitespace characters")}function FF(s){return new RegExp("(^|\\s)"+s+"($|\\s)")}function wo(){return ce===R.document}function ko(s){return Cn(s)&&s.nodeType===1}function ow(){try{return R.parent!==R.self}catch{return!0}}function lw(s){return function(e,t){if(!xT(e))return ce[s](null);xT(t)&&(t=ce.querySelector(t));var i=ko(t)?t:ce;return i[s]&&i[s](e)}}function tt(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"?(Ke.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"?Ys(r,a):(r[n]!==a||n==="tabIndex")&&(r[n]=a)}),Object.getOwnPropertyNames(t).forEach(function(n){r.setAttribute(n,t[n])}),i&&d0(r,i),r}function Ys(s,e){return typeof s.textContent>"u"?s.innerText=e:s.textContent=e,s}function Fg(s,e){e.firstChild?e.insertBefore(s,e.firstChild):e.appendChild(s)}function Vs(s,e){return aw(e),s.classList?s.classList.contains(e):FF(e).test(s.className)}function Sn(s,e){return s.classList?s.classList.add(e):Vs(s,e)||(s.className=(s.className+" "+e).trim()),s}function Ql(s,e){return s?(s.classList?s.classList.remove(e):(aw(e),s.className=s.className.split(/\s+/).filter(function(t){return t!==e}).join(" ")),s):(Ke.warn("removeClass was called with an element that doesn't exist"),null)}function uw(s,e,t){var i=Vs(s,e);if(typeof t=="function"&&(t=t(s,e)),typeof t!="boolean"&&(t=!i),t!==i)return t?Sn(s,e):Ql(s,e),s}function cw(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 gn(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 hw(s,e){return s.getAttribute(e)}function co(s,e,t){s.setAttribute(e,t)}function $h(s,e){s.removeAttribute(e)}function dw(){ce.body.focus(),ce.onselectstart=function(){return!1}}function fw(){ce.onselectstart=function(){return!0}}function ho(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(Rl(s,"height"))),t.width||(t.width=parseFloat(Rl(s,"width"))),t}}function Ml(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[Vc.fullscreenElement];)i+=s.offsetLeft,r+=s.offsetTop,s=s.offsetParent;return{left:i,top:r,width:e,height:t}}function qh(s,e){var t={x:0,y:0};if(ki)for(var i=s;i&&i.nodeName.toLowerCase()!=="html";){var r=Rl(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=Ml(e.target),u=Ml(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,ki&&(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 pw(s){return Cn(s)&&s.nodeType===3}function h0(s){for(;s.firstChild;)s.removeChild(s.firstChild);return s}function mw(s){return typeof s=="function"&&(s=s()),(Array.isArray(s)?s:[s]).map(function(e){if(typeof e=="function"&&(e=e()),ko(e)||pw(e))return e;if(typeof e=="string"&&/\S/.test(e))return ce.createTextNode(e)}).filter(function(e){return e})}function d0(s,e){return mw(e).forEach(function(t){return s.appendChild(t)}),s}function gw(s,e){return d0(h0(s),e)}function Fl(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 ts=lw("querySelector"),vw=lw("querySelectorAll"),yw=Object.freeze({__proto__:null,isReal:wo,isEl:ko,isInFrame:ow,createEl:tt,textContent:Ys,prependTo:Fg,hasClass:Vs,addClass:Sn,removeClass:Ql,toggleClass:uw,setAttributes:cw,getAttributes:gn,getAttribute:hw,setAttribute:co,removeAttribute:$h,blockTextSelection:dw,unblockTextSelection:fw,getBoundingClientRect:ho,findPosition:Ml,getPointerPosition:qh,isTextNode:pw,emptyEl:h0,normalizeContent:mw,appendContent:d0,insertContent:gw,isSingleLeftClick:Fl,$:ts,$$:vw}),_w=!1,Bg,BF=function(){if(Bg.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&&Bg(o)}}else{Ug(1);break}}else _w||Ug(1)}};function Ug(s,e){wo()&&(e&&(Bg=e),R.setTimeout(BF,s))}function jg(){_w=!0,R.removeEventListener("load",jg)}wo()&&(ce.readyState==="complete"?jg():R.addEventListener("load",jg));var Tw=function(e){var t=ce.createElement("style");return t.className=e,t},bw=function(e,t){e.styleSheet?e.styleSheet.cssText=t:e.textContent=t},UF=3,jF=UF;function An(){return jF++}var Sw;R.WeakMap||(Sw=function(){function s(){this.vdata="vdata"+Math.floor(R.performance&&R.performance.now()||Date.now()),this.data={}}var e=s.prototype;return e.set=function(i,r){var n=i[this.vdata]||An();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];Ke("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 Ci=R.WeakMap?new WeakMap:new Sw;function CT(s,e){if(Ci.has(s)){var t=Ci.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&&Ci.delete(s)}}function f0(s,e,t,i){t.forEach(function(r){s(e,r,i)})}function Hh(s){if(s.fixed_)return s;function e(){return!0}function t(){return!1}if(!s||!s.isPropagationStopped||!s.isImmediatePropagationStopped){var i=s||R.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 Gu,$F=function(){if(typeof Gu!="boolean"){Gu=!1;try{var e=Object.defineProperty({},"passive",{get:function(){Gu=!0}});R.addEventListener("test",null,e),R.removeEventListener("test",null,e)}catch{}}return Gu},qF=["touchstart","touchmove"];function Zi(s,e,t){if(Array.isArray(e))return f0(Zi,s,e,t);Ci.has(s)||Ci.set(s,{});var i=Ci.get(s);if(i.handlers||(i.handlers={}),i.handlers[e]||(i.handlers[e]=[]),t.guid||(t.guid=An()),i.handlers[e].push(t),i.dispatcher||(i.disabled=!1,i.dispatcher=function(n,a){if(!i.disabled){n=Hh(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){Ke.error(h)}}}),i.handlers[e].length===1)if(s.addEventListener){var r=!1;$F()&&qF.indexOf(e)>-1&&(r={passive:!0}),s.addEventListener(e,i.dispatcher,r)}else s.attachEvent&&s.attachEvent("on"+e,i.dispatcher)}function pi(s,e,t){if(Ci.has(s)){var i=Ci.get(s);if(i.handlers){if(Array.isArray(e))return f0(pi,s,e,t);var r=function(u,c){i.handlers[c]=[],CT(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);CT(s,e)}}}}function Ao(s,e,t){var i=Ci.has(s)?Ci.get(s):{},r=s.parentNode||s.ownerDocument;if(typeof e=="string"?e={type:e,target:s}:e.target||(e.target=s),e=Hh(e),i.dispatcher&&i.dispatcher.call(s,e,t),r&&!e.isPropagationStopped()&&e.bubbles===!0)Ao.call(null,r,e,t);else if(!r&&!e.defaultPrevented&&e.target&&e.target[e.type]){Ci.has(e.target)||Ci.set(e.target,{});var n=Ci.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 Vh(s,e,t){if(Array.isArray(e))return f0(Vh,s,e,t);var i=function r(){pi(s,e,r),t.apply(this,arguments)};i.guid=t.guid=t.guid||An(),Zi(s,e,i)}function xw(s,e,t){var i=function r(){pi(s,e,r),t.apply(this,arguments)};i.guid=t.guid=t.guid||An(),Zi(s,e,i)}var HF=Object.freeze({__proto__:null,fixEvent:Hh,on:Zi,off:pi,trigger:Ao,one:Vh,any:xw}),wr=30,xt=function(e,t,i){t.guid||(t.guid=An());var r=t.bind(e);return r.guid=i?i+"_"+t.guid:t.guid,r},En=function(e,t){var i=R.performance.now(),r=function(){var a=R.performance.now();a-i>=t&&(e.apply(void 0,arguments),i=a)};return r},VF=function(e,t,i,r){r===void 0&&(r=R);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},ti=function(){};ti.prototype.allowedEvents_={};ti.prototype.on=function(s,e){var t=this.addEventListener;this.addEventListener=function(){},Zi(this,s,e),this.addEventListener=t};ti.prototype.addEventListener=ti.prototype.on;ti.prototype.off=function(s,e){pi(this,s,e)};ti.prototype.removeEventListener=ti.prototype.off;ti.prototype.one=function(s,e){var t=this.addEventListener;this.addEventListener=function(){},Vh(this,s,e),this.addEventListener=t};ti.prototype.any=function(s,e){var t=this.addEventListener;this.addEventListener=function(){},xw(this,s,e),this.addEventListener=t};ti.prototype.trigger=function(s){var e=s.type||s;typeof s=="string"&&(s={type:e}),s=Hh(s),this.allowedEvents_[e]&&this["on"+e]&&this["on"+e](s),Ao(this,s)};ti.prototype.dispatchEvent=ti.prototype.trigger;var nl;ti.prototype.queueTrigger=function(s){var e=this;nl||(nl=new Map);var t=s.type||s,i=nl.get(this);i||(i=new Map,nl.set(this,i));var r=i.get(t);i.delete(t),R.clearTimeout(r);var n=R.setTimeout(function(){i.delete(t),i.size===0&&(i=null,nl.delete(e)),e.trigger(s)},0);i.set(t,n)};var zh=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},xn=function(e){return e instanceof ti||!!e.eventBusEl_&&["on","one","off","trigger"].every(function(t){return typeof e[t]=="function"})},zF=function(e,t){xn(e)?t():(e.eventedCallbacks||(e.eventedCallbacks=[]),e.eventedCallbacks.push(t))},$g=function(e){return typeof e=="string"&&/\S/.test(e)||Array.isArray(e)&&!!e.length},zc=function(e,t,i){if(!e||!e.nodeName&&!xn(e))throw new Error("Invalid target for "+zh(t)+"#"+i+"; must be a DOM node or evented object.")},Cw=function(e,t,i){if(!$g(e))throw new Error("Invalid event type for "+zh(t)+"#"+i+"; must be a non-empty string or array.")},Ew=function(e,t,i){if(typeof e!="function")throw new Error("Invalid listener for "+zh(t)+"#"+i+"; must be a function.")},Nf=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]),zc(n,e,i),Cw(a,e,i),Ew(o,e,i),o=xt(e,o),{isTargetingSelf:r,target:n,type:a,listener:o}},ws=function(e,t,i,r){zc(e,e,t),e.nodeName?HF[t](e,i,r):e[t](i,r)},WF={on:function(){for(var e=this,t=arguments.length,i=new Array(t),r=0;r<t;r++)i[r]=arguments[r];var n=Nf(this,i,"on"),a=n.isTargetingSelf,o=n.target,l=n.type,u=n.listener;if(ws(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,ws(this,"on","dispose",c),ws(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=Nf(this,i,"one"),a=n.isTargetingSelf,o=n.target,l=n.type,u=n.listener;if(a)ws(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,ws(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=Nf(this,i,"any"),a=n.isTargetingSelf,o=n.target,l=n.type,u=n.listener;if(a)ws(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,ws(o,"any",l,c)}},off:function(e,t,i){if(!e||$g(e))pi(this.eventBusEl_,e,t);else{var r=e,n=t;zc(r,this,"off"),Cw(n,this,"off"),Ew(i,this,"off"),i=xt(this,i),this.off("dispose",i),r.nodeName?(pi(r,n,i),pi(r,"dispose",i)):xn(r)&&(r.off(n,i),r.off("dispose",i))}},trigger:function(e,t){zc(this.eventBusEl_,this,"trigger");var i=e&&typeof e!="string"?e.type:e;if(!$g(i)){var r="Invalid event type for "+zh(this)+"#trigger; must be a non-empty string or object with a type key that has a non-empty value.";if(e)(this.log||Ke).error(r);else throw new Error(r)}return Ao(this.eventBusEl_,e,t)}};function p0(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_=tt("span",{className:"vjs-event-bus"});return Ft(s,WF),s.eventedCallbacks&&s.eventedCallbacks.forEach(function(r){r()}),s.on("dispose",function(){s.off(),[s,s.el_,s.eventBusEl_].forEach(function(r){r&&Ci.has(r)&&Ci.delete(r)}),R.setTimeout(function(){s.eventBusEl_=null},0)}),s}var GF={state:{},setState:function(e){var t=this;typeof e=="function"&&(e=e());var i;return Ga(e,function(r,n){t.state[n]!==r&&(i=i||{},i[n]={from:t.state[n],to:r}),t.state[n]=r}),i&&xn(this)&&this.trigger({changes:i,type:"statechanged"}),i}};function ww(s,e){return Ft(s,GF),s.state=Ft({},s.state,e),typeof s.handleStateChanged=="function"&&xn(s)&&s.on("statechanged",s.handleStateChanged),s}var dc=function(e){return typeof e!="string"?e:e.replace(/./,function(t){return t.toLowerCase()})},$t=function(e){return typeof e!="string"?e:e.replace(/./,function(t){return t.toUpperCase()})},KF=function(e,t){return $t(e)===$t(t)};function St(){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&&Ga(r,function(n,a){if(!Ol(n)){s[a]=n;return}Ol(s[a])||(s[a]={}),s[a]=St(s[a],n)})}),s}var XF=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}(),QF=R.Map?R.Map:XF,YF=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}(),Lf=R.Set?R.Set:YF,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_=St({},this.options_),i=this.options_=St(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_"+An()}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&&(p0(this,{eventBusKey:this.el_?"el_":null}),this.handleLanguagechange=this.handleLanguagechange.bind(this),this.on(this.player_,"languagechange",this.handleLanguagechange)),ww(this,this.constructor.defaultState),this.children_=[],this.childIndex_={},this.childNameIndex_={},this.setTimeoutIds_=new Lf,this.setIntervalIds_=new Lf,this.rafIds_=new Lf,this.namedRafs_=new QF,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_=St(this.options_,i),this.options_):this.options_},e.el=function(){return this.el_},e.createEl=function(i,r,n){return tt(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=$t(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&&$t(a.name()),o&&(this.childNameIndex_[o]=a,this.childNameIndex_[dc(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_:ko(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_[$t(i.name())]=null,this.childNameIndex_[dc(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||$t(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 ts(i,r||this.contentEl())},e.$$=function(i,r){return vw(i,r||this.contentEl())},e.hasClass=function(i){return Vs(this.el_,i)},e.addClass=function(i){Sn(this.el_,i)},e.removeClass=function(i){Ql(this.el_,i)},e.toggleClass=function(i,r){uw(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 hw(this.el_,i)},e.setAttribute=function(i,r){co(this.el_,i,r)},e.removeAttribute=function(i){$h(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"+$t(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=Rl(this.el_,i),r=parseFloat(r),r===0||isNaN(r)){var n="offset"+$t(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_&&(ze.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=R.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=R.performance.now()-i;c<a&&(u.preventDefault(),this.trigger("tap"))}})},e.enableTouchActivity=function(){if(!(!this.player()||!this.player().reportUserActivity)){var i=xt(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=xt(this,i),this.clearTimersOnDispose_(),a=R.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),R.clearTimeout(i)),i},e.setInterval=function(i,r){i=xt(this,i),this.clearTimersOnDispose_();var n=R.setInterval(i,r);return this.setIntervalIds_.add(n),n},e.clearInterval=function(i){return this.setIntervalIds_.has(i)&&(this.setIntervalIds_.delete(i),R.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=xt(this,i),n=R.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=xt(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),R.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=$t(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_[dc(i)]=r,r},s.getComponent=function(i){if(!(!i||!s.components_))return s.components_[i]},s}();be.prototype.supportsRaf_=typeof R.requestAnimationFrame=="function"&&typeof R.cancelAnimationFrame=="function";be.registerComponent("Component",be);function JF(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 ET(s,e,t,i){return JF(s,i,t.length-1),t[i][e]}function Of(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:ET.bind(null,"start",0,s),end:ET.bind(null,"end",1,s)},R.Symbol&&R.Symbol.iterator&&(e[R.Symbol.iterator]=function(){return(s||[]).values()}),e}function zs(s,e){return Array.isArray(s)?Of(s):s===void 0||e===void 0?Of():Of([[s,e]])}function kw(s,e){var t=0,i,r;if(!e)return 0;(!s||!s.length)&&(s=zs(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 Ei(s){if(s instanceof Ei)return s;typeof s=="number"?this.code=s:typeof s=="string"?this.message=s:Cn(s)&&(typeof s.code=="number"&&(this.code=s.code),Ft(this,s)),this.message||(this.message=Ei.defaultMessages[this.code]||"")}Ei.prototype.code=0;Ei.prototype.message="";Ei.prototype.status=null;Ei.errorTypes=["MEDIA_ERR_CUSTOM","MEDIA_ERR_ABORTED","MEDIA_ERR_NETWORK","MEDIA_ERR_DECODE","MEDIA_ERR_SRC_NOT_SUPPORTED","MEDIA_ERR_ENCRYPTED"];Ei.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 ka=0;ka<Ei.errorTypes.length;ka++)Ei[Ei.errorTypes[ka]]=ka,Ei.prototype[Ei.errorTypes[ka]]=ka;function Cl(s){return s!=null&&typeof s.then=="function"}function Vr(s){Cl(s)&&s.then(null,function(e){})}var qg=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},ZF=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=qg(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(qg))},eB=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()},wT={textTracksToJson:ZF,jsonToTextTracks:eB,trackToJson_:qg},Rf="vjs-modal-dialog",Io=function(s){A._inheritsLoose(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_=tt("div",{className:Rf+"-content"},{role:"document"}),n.descEl_=tt("p",{className:Rf+"-description vjs-control-text",id:n.el().getAttribute("aria-describedby")}),Ys(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 Rf+" 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(),gw(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"),h0(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(),ze.isEventKey(r,"Escape")&&this.closeable()){r.preventDefault(),this.close();return}if(ze.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 R.HTMLAnchorElement||n instanceof R.HTMLAreaElement)&&n.hasAttribute("href")||(n instanceof R.HTMLInputElement||n instanceof R.HTMLSelectElement||n instanceof R.HTMLTextAreaElement||n instanceof R.HTMLButtonElement)&&!n.hasAttribute("disabled")||n instanceof R.HTMLIFrameElement||n instanceof R.HTMLObjectElement||n instanceof R.HTMLEmbedElement||n.hasAttribute("tabindex")&&n.getAttribute("tabindex")!==-1||n.hasAttribute("contenteditable")})},e}(be);Io.prototype.options_={pauseOnOpen:!0,temporary:!0};be.registerComponent("ModalDialog",Io);var fo=function(s){A._inheritsLoose(e,s);function e(i){var r;i===void 0&&(i=[]),r=s.call(this)||this,r.tracks_=[],Object.defineProperty(A._assertThisInitialized(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})},xn(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}(ti);fo.prototype.allowedEvents_={change:"change",addtrack:"addtrack",removetrack:"removetrack",labelchange:"labelchange"};for(var tB in fo.prototype.allowedEvents_)fo.prototype["on"+tB]=null;var Mf=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)},iB=function(s){A._inheritsLoose(e,s);function e(i){var r;i===void 0&&(i=[]);for(var n=i.length-1;n>=0;n--)if(i[n].enabled){Mf(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&&Mf(this,r),s.prototype.addTrack.call(this,r),r.addEventListener&&(r.enabledChange_=function(){n.changing_||(n.changing_=!0,Mf(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}(fo),Ff=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)},rB=function(s){A._inheritsLoose(e,s);function e(i){var r;i===void 0&&(i=[]);for(var n=i.length-1;n>=0;n--)if(i[n].selected){Ff(i,i[n]);break}return r=s.call(this,i)||this,r.changing_=!1,Object.defineProperty(A._assertThisInitialized(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&&Ff(this,r),s.prototype.addTrack.call(this,r),r.addEventListener&&(r.selectedChange_=function(){n.changing_||(n.changing_=!0,Ff(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}(fo),Aw=function(s){A._inheritsLoose(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}(fo),nB=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}(),kT=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}(),sB={alternative:"alternative",captions:"captions",main:"main",sign:"sign",subtitles:"subtitles",commentary:"commentary"},aB={alternative:"alternative",descriptions:"descriptions",main:"main","main-desc":"main-desc",translation:"translation",commentary:"commentary"},oB={subtitles:"subtitles",captions:"captions",descriptions:"descriptions",chapters:"chapters",metadata:"metadata"},AT={disabled:"disabled",hidden:"hidden",showing:"showing"},m0=function(s){A._inheritsLoose(e,s);function e(t){var i;t===void 0&&(t={}),i=s.call(this)||this;var r={id:t.id||"vjs_track_"+An(),kind:t.kind||"",language:t.language||""},n=t.label||"",a=function(u){Object.defineProperty(A._assertThisInitialized(i),u,{get:function(){return r[u]},set:function(){}})};for(var o in r)a(o);return Object.defineProperty(A._assertThisInitialized(i),"label",{get:function(){return n},set:function(u){u!==n&&(n=u,this.trigger("labelchange"))}}),i}return e}(ti),g0=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=R.location.protocol),r.host||(r.host=R.location.host),r},Iw=function(e){if(!e.match(/^https?:\/\//)){var t=ce.createElement("a");t.href=e,e=t.href}return e},v0=function(e){if(typeof e=="string"){var t=/^(\/?)([\s\S]*?)((?:\.{1,2}|[^\/]+?)(\.([^\.\/\?]+)))(?:[\/]*|[\?].*)$/,i=t.exec(e);if(i)return i.pop().toLowerCase()}return""},Wh=function(e,t){t===void 0&&(t=R.location);var i=g0(e),r=i.protocol===":"?t.protocol:i.protocol,n=r+i.host!==t.protocol+t.host;return n},lB=Object.freeze({__proto__:null,parseUrl:g0,getAbsoluteURL:Iw,getFileExtension:v0,isCrossOrigin:Wh}),IT=function(e,t){var i=new R.WebVTT.Parser(R,R.vttjs,R.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&&(R.console&&R.console.groupCollapsed&&R.console.groupCollapsed("Text Track parsing errors for "+t.src),r.forEach(function(n){return Ke.error(n)}),R.console&&R.console.groupEnd&&R.console.groupEnd()),i.flush()},PT=function(e,t){var i={uri:e},r=Wh(e);r&&(i.cors=r);var n=t.tech_.crossOrigin()==="use-credentials";n&&(i.withCredentials=n),O2(i,xt(this,function(a,o,l){if(a)return Ke.error(a,o);t.loaded_=!0,typeof R.WebVTT!="function"?t.tech_&&t.tech_.any(["vttjsloaded","vttjserror"],function(u){if(u.type==="vttjserror"){Ke.error("vttjs failed to load, stopping trying to process "+t.src);return}return IT(l,t)}):IT(l,t)}))},Yl=function(s){A._inheritsLoose(e,s);function e(i){var r;if(i===void 0&&(i={}),!i.tech)throw new Error("A tech was not provided.");var n=St(i,{kind:oB[i.kind]||"subtitles",language:i.language||i.srclang||""}),a=AT[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 kT(r.cues_),u=new kT(r.activeCues_),c=!1;r.timeupdateHandler=xt(A._assertThisInitialized(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(A._assertThisInitialized(r),{default:{get:function(){return o},set:function(){}},mode:{get:function(){return a},set:function(g){AT[g]&&a!==g&&(a=g,!this.preload_&&a!=="disabled"&&this.cues.length===0&&PT(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 I=0;I<y.length;I++)this.activeCues_.indexOf(y[I])===-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")&&PT(r.src,A._assertThisInitialized(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 R.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}(m0);Yl.prototype.allowedEvents_={cuechange:"cuechange"};var Pw=function(s){A._inheritsLoose(e,s);function e(t){var i;t===void 0&&(t={});var r=St(t,{kind:aB[t.kind]||""});i=s.call(this,r)||this;var n=!1;return Object.defineProperty(A._assertThisInitialized(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}(m0),Dw=function(s){A._inheritsLoose(e,s);function e(t){var i;t===void 0&&(t={});var r=St(t,{kind:sB[t.kind]||""});i=s.call(this,r)||this;var n=!1;return Object.defineProperty(A._assertThisInitialized(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}(m0),Nw=0,uB=1,Lw=2,cB=3,Po=function(s){A._inheritsLoose(e,s);function e(t){var i;t===void 0&&(t={}),i=s.call(this)||this;var r,n=new Yl(t);return i.kind=n.kind,i.src=n.src,i.srclang=n.language,i.label=n.label,i.default=n.default,Object.defineProperties(A._assertThisInitialized(i),{readyState:{get:function(){return r}},track:{get:function(){return n}}}),r=Nw,n.addEventListener("loadeddata",function(){r=Lw,i.trigger({type:"load",target:A._assertThisInitialized(i)})}),i}return e}(ti);Po.prototype.allowedEvents_={load:"load"};Po.NONE=Nw;Po.LOADING=uB;Po.LOADED=Lw;Po.ERROR=cB;var ur={audio:{ListClass:iB,TrackClass:Pw,capitalName:"Audio"},video:{ListClass:rB,TrackClass:Dw,capitalName:"Video"},text:{ListClass:Aw,TrackClass:Yl,capitalName:"Text"}};Object.keys(ur).forEach(function(s){ur[s].getterName=s+"Tracks",ur[s].privateName=s+"Tracks_"});var po={remoteText:{ListClass:Aw,TrackClass:Yl,capitalName:"RemoteText",getterName:"remoteTextTracks",privateName:"remoteTextTracks_"},remoteTextEl:{ListClass:nB,TrackClass:Po,capitalName:"RemoteTextTrackEls",getterName:"remoteTextTrackEls",privateName:"remoteTextTrackEls_"}},bi=A._extends({},ur,po);po.names=Object.keys(po);ur.names=Object.keys(ur);bi.names=[].concat(po.names).concat(ur.names);function hB(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 bi.text.TrackClass(r);return n.addTrack(a),a}var mt=function(s){A._inheritsLoose(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}),bi.names.forEach(function(a){var o=bi[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 bi.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(xt(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 zs(0,0)},t.bufferedPercent=function(){return kw(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(ur.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 Ei(r),this.trigger("error")),this.error_},t.played=function(){return this.hasStarted_?zs(0,0):zs()},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;ur.names.forEach(function(n){var a=ur[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(!R.WebVTT)if(ce.body.contains(this.el())){if(!this.options_["vtt.js"]&&Ol(Qa)&&Object.keys(Qa).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}),R.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 hB(this,r,n,a)},t.createRemoteTextTrack=function(r){var n=St(r,{tech:this});return new po.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&&(Ke.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||R.Promise;if(r)return r.reject()},t.disablePictureInPicture=function(){return!0},t.setDisablePictureInPicture=function(){},t.requestVideoFrameCallback=function(r){var n=this,a=An();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=$t(r),e.techs_[r]=n,e.techs_[dc(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=$t(r),R&&R.videojs&&R.videojs[r])return Ke.warn("The "+r+" tech was added to the videojs object when it should be registered using videojs.registerTech(name, tech)"),R.videojs[r]}},e}(be);bi.names.forEach(function(s){var e=bi[s];mt.prototype[e.getterName]=function(){return this[e.privateName]=this[e.privateName]||new e.ListClass,this[e.privateName]}});mt.prototype.featuresVolumeControl=!0;mt.prototype.featuresMuteControl=!0;mt.prototype.featuresFullscreenResize=!1;mt.prototype.featuresPlaybackRate=!1;mt.prototype.featuresProgressEvents=!1;mt.prototype.featuresSourceset=!1;mt.prototype.featuresTimeupdateEvents=!1;mt.prototype.featuresNativeTextTracks=!1;mt.prototype.featuresVideoFrameCallback=!1;mt.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:Ke.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",mt);mt.registerTech("Tech",mt);mt.defaultTechOrder_=[];var Ws={},Hg={},Wc={};function dB(s,e){Ws[s]=Ws[s]||[],Ws[s].push(e)}function fB(s,e,t){s.setTimeout(function(){return As(e,Ws[e.type],t,s)},1)}function pB(s,e){s.forEach(function(t){return t.setTech&&t.setTech(e)})}function mB(s,e,t){return s.reduceRight(y0(t),e[t]())}function gB(s,e,t,i){return e[t](s.reduce(y0(t),i))}function DT(s,e,t,i){i===void 0&&(i=null);var r="call"+$t(t),n=s.reduce(y0(r),i),a=n===Wc,o=a?null:e[t](n);return _B(s,t,o,a),o}var vB={buffered:1,currentTime:1,duration:1,muted:1,played:1,paused:1,seekable:1,volume:1,ended:1},yB={setCurrentTime:1,setMuted:1,setVolume:1},NT={play:1,pause:1};function y0(s){return function(e,t){return e===Wc?Wc:t[s]?t[s](e):e}}function _B(s,e,t,i){for(var r=s.length-1;r>=0;r--){var n=s[r];n[e]&&n[e](i,t)}}function TB(s){Hg[s.id()]=null}function bB(s,e){var t=Hg[s.id()],i=null;if(t==null)return i=e(s),Hg[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 As(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")As(s,Ws[o],t,i,r,n);else if(o){var u=bB(i,o);if(!u.setSource)return r.push(u),As(s,l,t,i,r,n);u.setSource(Ft({},s),function(c,h){if(c)return As(s,l,t,i,r,n);r.push(u),As(h,s.type===h.type?l:Ws[h.type],t,i,r,n)})}else l.length?As(s,l,t,i,r,n):n?t(s,r):As(s,Ws["*"],t,i,r,!0)}var SB={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"},Gc=function(e){e===void 0&&(e="");var t=v0(e),i=SB[t.toLowerCase()];return i||""},xB=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 Gc(t)},CB=function s(e){if(Array.isArray(e)){var t=[];e.forEach(function(i){i=s(i),Array.isArray(i)?t=t.concat(i):Cn(i)&&t.push(i)}),e=t}else typeof e=="string"&&e.trim()?e=[LT({src:e})]:Cn(e)&&typeof e.src=="string"&&e.src&&e.src.trim()?e=[LT(e)]:e=[];return e};function LT(s){if(!s.type){var e=Gc(s.src);e&&(s.type=e)}return s}var EB=function(s){A._inheritsLoose(e,s);function e(t,i,r){var n,a=St({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=$t(l[o]),c=mt.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",EB);var Gh=function(s){A._inheritsLoose(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=Ft({className:this.buildCSSClass(),tabIndex:0},n),r==="button"&&Ke.error("Creating a ClickableComponent with an HTML element of "+r+" is not supported; use a Button instead."),a=Ft({role:"button"},a),this.tabIndex_=n.tabIndex;var o=tt(r,n,a);return o.appendChild(tt("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_=tt("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,Ys(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){ze.isEventKey(r,"Space")||ze.isEventKey(r,"Enter")?(r.preventDefault(),r.stopPropagation(),this.trigger("click")):s.prototype.handleKeyDown.call(this,r)},e}(be);be.registerComponent("ClickableComponent",Gh);var wB=function(s){A._inheritsLoose(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=tt("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)&&!((Xl||Kl)&&n)&&this.player_.tech(!0).focus(),this.player_.paused()?Vr(this.player_.play()):this.player_.pause()}},e}(Gh);be.registerComponent("PosterImage",wB);var ar="#222",OT="#ccc",kB={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 Bf(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 Uf(s,e,t){try{s.style[e]=t}catch{return}}var AB=function(s){A._inheritsLoose(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(xt(A._assertThisInitialized(a),function(){if(i.tech_&&i.tech_.featuresNativeTextTracks){this.hide();return}i.on("fullscreenchange",o),i.on("playerresize",o),R.addEventListener("orientationchange",o),i.on("dispose",function(){return R.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 R.WebVTT=="function"&&R.WebVTT.processCues(R,[],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&&Uf(u.firstChild,"color",Bf(n.color||"#fff",n.textOpacity)),n.backgroundColor&&(u.firstChild.style.backgroundColor=n.backgroundColor),n.backgroundOpacity&&Uf(u.firstChild,"backgroundColor",Bf(n.backgroundColor||"#000",n.backgroundOpacity)),n.windowColor&&(n.windowOpacity?Uf(u,"backgroundColor",Bf(n.windowColor,n.windowOpacity)):u.style.backgroundColor=n.windowColor),n.edgeStyle&&(n.edgeStyle==="dropshadow"?u.firstChild.style.textShadow="2px 2px 3px "+ar+", 2px 2px 4px "+ar+", 2px 2px 5px "+ar:n.edgeStyle==="raised"?u.firstChild.style.textShadow="1px 1px "+ar+", 2px 2px "+ar+", 3px 3px "+ar:n.edgeStyle==="depressed"?u.firstChild.style.textShadow="1px 1px "+OT+", 0 1px "+OT+", -1px -1px "+ar+", 0 -1px "+ar:n.edgeStyle==="uniform"&&(u.firstChild.style.textShadow="0 0 4px "+ar+", 0 0 4px "+ar+", 0 0 4px "+ar+", 0 0 4px "+ar)),n.fontPercent&&n.fontPercent!==1){var c=R.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=kB[n.fontFamily])}}},t.updateForTrack=function(r){if(Array.isArray(r)||(r=[r]),!(typeof R.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]);R.WebVTT.processCues(R,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;Sn(d,"vjs-text-track-cue"),Sn(d,"vjs-text-track-cue-"+(c.language?c.language:u)),c.language&&co(d,"lang",c.language)}this.player_.textTrackSettings&&this.updateDisplayState(c)}}},e}(be);be.registerComponent("TextTrackDisplay",AB);var IB=function(s){A._inheritsLoose(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=tt("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",IB);var Er=function(s){A._inheritsLoose(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=Ft({className:this.buildCSSClass()},n),a=Ft({type:"button"},a);var o=tt(r,n,a);return o.appendChild(tt("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 Ke.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(ze.isEventKey(r,"Space")||ze.isEventKey(r,"Enter")){r.stopPropagation();return}s.prototype.handleKeyDown.call(this,r)},e}(Gh);be.registerComponent("Button",Er);var Ow=function(s){A._inheritsLoose(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;Vr(n),this.player_.tech(!0)&&!((Xl||Kl)&&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()};Cl(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}(Er);Ow.prototype.controlText_="Play Video";be.registerComponent("BigPlayButton",Ow);var PB=function(s){A._inheritsLoose(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){ze.isEventKey(r,"Esc")?(r.preventDefault(),r.stopPropagation(),this.trigger("click")):s.prototype.handleKeyDown.call(this,r)},e}(Er);be.registerComponent("CloseButton",PB);var Rw=function(s){A._inheritsLoose(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()?Vr(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}(Er);Rw.prototype.controlText_="Play";be.registerComponent("PlayToggle",Rw);var Mw=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},_0=Mw;function DB(s){_0=s}function NB(){_0=Mw}function mo(s,e){return e===void 0&&(e=s),_0(s,e)}var Do=function(s){A._inheritsLoose(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=tt("span",{className:"vjs-control-text",textContent:this.localize(this.labelText_)+" "},{role:"presentation"});return n.appendChild(a),this.contentEl_=tt("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=mo(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,Ke.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);Do.prototype.labelText_="Time";Do.prototype.controlText_="Time";be.registerComponent("TimeDisplay",Do);var T0=function(s){A._inheritsLoose(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}(Do);T0.prototype.labelText_="Current Time";T0.prototype.controlText_="Current Time";be.registerComponent("CurrentTimeDisplay",T0);var b0=function(s){A._inheritsLoose(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}(Do);b0.prototype.labelText_="Duration";b0.prototype.controlText_="Duration";be.registerComponent("DurationDisplay",b0);var LB=function(s){A._inheritsLoose(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",LB);var S0=function(s){A._inheritsLoose(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(tt("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}(Do);S0.prototype.labelText_="Remaining Time";S0.prototype.controlText_="Remaining Time";be.registerComponent("RemainingTimeDisplay",S0);var OB=function(s){A._inheritsLoose(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_=tt("div",{className:"vjs-live-display"},{"aria-live":"off"}),this.contentEl_.appendChild(tt("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",OB);var Fw=function(s){A._inheritsLoose(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_=tt("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}(Er);Fw.prototype.controlText_="Seek to live, currently playing live";be.registerComponent("SeekToLive",Fw);var Kh=function(e,t,i){return e=Number(e),Math.min(i,Math.max(t,isNaN(e)?t:e))},x0=function(s){A._inheritsLoose(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=Ft({tabIndex:0},n),a=Ft({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"&&!kn&&r.preventDefault(),dw(),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;fw(),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(Kh(this.getPercent(),0,1).toFixed(4))},t.calculateDistance=function(r){var n=qh(this.el_,r);return this.vertical()?n.y:n.x},t.handleKeyDown=function(r){ze.isEventKey(r,"Left")||ze.isEventKey(r,"Down")?(r.preventDefault(),r.stopPropagation(),this.stepBack()):ze.isEventKey(r,"Right")||ze.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",x0);var jf=function(e,t){return Kh(e/t*100,0,100).toFixed(2)+"%"},RB=function(s){A._inheritsLoose(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=tt("span",{className:"vjs-control-text"}),a=tt("span",{textContent:this.localize("Loaded")}),o=ce.createTextNode(": ");return this.percentageEl_=tt("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=jf(u,l);n.percent_!==h&&(n.el_.style.width=h,Ys(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(tt()),c[d]=p),!(p.dataset.start===g&&p.dataset.end===y)&&(p.dataset.start=g,p.dataset.end=y,p.style.left=jf(g,u),p.style.width=jf(y-g,u))}for(var _=c.length;_>o.length;_--)n.el_.removeChild(c[_-1]);c.length=o.length})},e}(be);be.registerComponent("LoadProgressBar",RB);var MB=function(s){A._inheritsLoose(e,s);function e(i,r){var n;return n=s.call(this,i,r)||this,n.update=En(xt(A._assertThisInitialized(n),n.update),wr),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=Ml(this.el_),l=ho(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){Ys(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?"":"-")+mo(d,h)}else u=mo(a,c);l.update(r,n,u),o&&o()})},e}(be);be.registerComponent("TimeTooltip",MB);var C0=function(s){A._inheritsLoose(e,s);function e(i,r){var n;return n=s.call(this,i,r)||this,n.update=En(xt(A._assertThisInitialized(n),n.update),wr),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);C0.prototype.options_={children:[]};!ki&&!wn&&C0.prototype.options_.children.push("timeTooltip");be.registerComponent("PlayProgressBar",C0);var Bw=function(s){A._inheritsLoose(e,s);function e(i,r){var n;return n=s.call(this,i,r)||this,n.update=En(xt(A._assertThisInitialized(n),n.update),wr),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);Bw.prototype.options_={children:["timeTooltip"]};be.registerComponent("MouseTimeDisplay",Bw);var Ku=5,RT=12,E0=function(s){A._inheritsLoose(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_=xt(this,this.update),this.update=En(this.update_,wr),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,wr))},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}",[mo(o,u),mo(u,u)],"{1} of {2}")),n.currentTime_=o,n.duration_=u),n.bar&&n.bar.update(ho(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){Fl(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),!!Fl(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?Vr(this.player_.play()):this.update_()},t.stepForward=function(){this.userSeek_(this.player_.currentTime()+Ku)},t.stepBack=function(){this.userSeek_(this.player_.currentTime()-Ku)},t.handleAction=function(r){this.player_.paused()?this.player_.play():this.player_.pause()},t.handleKeyDown=function(r){var n=this.player_.liveTracker;if(ze.isEventKey(r,"Space")||ze.isEventKey(r,"Enter"))r.preventDefault(),r.stopPropagation(),this.handleAction(r);else if(ze.isEventKey(r,"Home"))r.preventDefault(),r.stopPropagation(),this.userSeek_(0);else if(ze.isEventKey(r,"End"))r.preventDefault(),r.stopPropagation(),n&&n.isLive()?this.userSeek_(n.liveCurrentTime()):this.userSeek_(this.player_.duration());else if(/^[0-9]$/.test(ze(r))){r.preventDefault(),r.stopPropagation();var a=(ze.codes[ze(r)]-ze.codes[0])*10/100;n&&n.isLive()?this.userSeek_(n.seekableStart()+n.liveWindow()*a):this.userSeek_(this.player_.duration()*a)}else ze.isEventKey(r,"PgDn")?(r.preventDefault(),r.stopPropagation(),this.userSeek_(this.player_.currentTime()-Ku*RT)):ze.isEventKey(r,"PgUp")?(r.preventDefault(),r.stopPropagation(),this.userSeek_(this.player_.currentTime()+Ku*RT)):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}(x0);E0.prototype.options_={children:["loadProgressBar","playProgressBar"],barName:"playProgressBar"};!ki&&!wn&&E0.prototype.options_.children.splice(1,0,"mouseTimeDisplay");be.registerComponent("SeekBar",E0);var Uw=function(s){A._inheritsLoose(e,s);function e(i,r){var n;return n=s.call(this,i,r)||this,n.handleMouseMove=En(xt(A._assertThisInitialized(n),n.handleMouseMove),wr),n.throttledHandleMouseSeek=En(xt(A._assertThisInitialized(n),n.handleMouseSeek),wr),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=Ml(l),c=qh(l,r).x;c=Kh(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&&Vr(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);Uw.prototype.options_={children:["seekBar"]};be.registerComponent("ProgressControl",Uw);var jw=function(s){A._inheritsLoose(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}(Er);jw.prototype.controlText_="Picture-in-Picture";be.registerComponent("PictureInPictureToggle",jw);var $w=function(s){A._inheritsLoose(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}(Er);$w.prototype.controlText_="Fullscreen";be.registerComponent("FullscreenToggle",$w);var FB=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")})},BB=function(s){A._inheritsLoose(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",BB);var UB=function(s){A._inheritsLoose(e,s);function e(i,r){var n;return n=s.call(this,i,r)||this,n.update=En(xt(A._assertThisInitialized(n),n.update),wr),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=ho(this.el_),u=ho(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){Ys(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",UB);var qw=function(s){A._inheritsLoose(e,s);function e(i,r){var n;return n=s.call(this,i,r)||this,n.update=En(xt(A._assertThisInitialized(n),n.update),wr),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);qw.prototype.options_={children:["volumeLevelTooltip"]};be.registerComponent("MouseVolumeLevelDisplay",qw);var Xh=function(s){A._inheritsLoose(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){Fl(r)&&s.prototype.handleMouseDown.call(this,r)},t.handleMouseMove=function(r){var n=this.getChild("mouseVolumeLevelDisplay");if(n){var a=this.el(),o=ho(a),l=this.vertical(),u=qh(a,r);u=l?u.y:u.x,u=Kh(u,0,1),n.update(o,u,l)}Fl(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}(x0);Xh.prototype.options_={children:["volumeLevel"],barName:"volumeLevel"};!ki&&!wn&&Xh.prototype.options_.children.splice(0,0,"mouseVolumeLevelDisplay");Xh.prototype.playerEvent="volumechange";be.registerComponent("VolumeBar",Xh);var Hw=function(s){A._inheritsLoose(e,s);function e(i,r){var n;return r===void 0&&(r={}),r.vertical=r.vertical||!1,(typeof r.volumeBar>"u"||Ol(r.volumeBar))&&(r.volumeBar=r.volumeBar||{},r.volumeBar.vertical=r.vertical),n=s.call(this,i,r)||this,FB(A._assertThisInitialized(n),i),n.throttledHandleMouseMove=En(xt(A._assertThisInitialized(n),n.handleMouseMove),wr),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);Hw.prototype.options_={children:["volumeBar"]};be.registerComponent("VolumeControl",Hw);var jB=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")})},Vw=function(s){A._inheritsLoose(e,s);function e(i,r){var n;return n=s.call(this,i,r)||this,jB(A._assertThisInitialized(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;ki&&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++)Ql(this.el_,"vjs-vol-"+a);Sn(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}(Er);Vw.prototype.controlText_="Mute";be.registerComponent("MuteToggle",Vw);var zw=function(s){A._inheritsLoose(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"||Ol(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){ze.isEventKey(r,"Esc")&&this.muteToggle.focus()},t.handleMouseOver=function(r){this.addClass("vjs-hover"),Zi(ce,"keyup",this.handleKeyPressHandler_)},t.handleMouseOut=function(r){this.removeClass("vjs-hover"),pi(ce,"keyup",this.handleKeyPressHandler_)},t.handleKeyPress=function(r){ze.isEventKey(r,"Esc")&&this.handleMouseOut()},e}(be);zw.prototype.options_={children:["muteToggle","volumeControl"]};be.registerComponent("VolumePanel",zw);var Ww=function(s){A._inheritsLoose(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_=tt(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_),Zi(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){ze.isEventKey(r,"Left")||ze.isEventKey(r,"Down")?(r.preventDefault(),r.stopPropagation(),this.stepForward()):(ze.isEventKey(r,"Right")||ze.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",Ww);var w0=function(s){A._inheritsLoose(e,s);function e(i,r){var n;r===void 0&&(r={}),n=s.call(this,i,r)||this,n.menuButton_=new Er(i,r),n.menuButton_.controlText(n.controlText_),n.menuButton_.el_.setAttribute("aria-haspopup","true");var a=Er.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(),Zi(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 Ww(this.player_,{menuButton:this});if(this.hideThreshold_=0,this.options_.title){var n=tt("li",{className:"vjs-menu-title",textContent:$t(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=Er.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"),pi(ce,"keyup",this.handleMenuKeyUp_)},t.focus=function(){this.menuButton_.focus()},t.blur=function(){this.menuButton_.blur()},t.handleKeyDown=function(r){ze.isEventKey(r,"Esc")||ze.isEventKey(r,"Tab")?(this.buttonPressed_&&this.unpressButton(),ze.isEventKey(r,"Tab")||(r.preventDefault(),this.menuButton_.focus())):(ze.isEventKey(r,"Up")||ze.isEventKey(r,"Down"))&&(this.buttonPressed_||(r.preventDefault(),this.pressButton()))},t.handleMenuKeyUp=function(r){(ze.isEventKey(r,"Esc")||ze.isEventKey(r,"Tab"))&&this.removeClass("vjs-hover")},t.handleSubmenuKeyPress=function(r){this.handleSubmenuKeyDown(r)},t.handleSubmenuKeyDown=function(r){(ze.isEventKey(r,"Esc")||ze.isEventKey(r,"Tab"))&&(this.buttonPressed_&&this.unpressButton(),ze.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"),ki&&ow())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",w0);var k0=function(s){A._inheritsLoose(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 A._assertThisInitialized(r);var a=xt(A._assertThisInitialized(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}(w0);be.registerComponent("TrackButton",k0);var $B=["Tab","Esc","Up","Down","Right","Left"],Jl=function(s){A._inheritsLoose(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",Ft({className:"vjs-menu-item",tabIndex:-1},n),a);return o.replaceChild(tt("span",{className:"vjs-menu-item-text",textContent:this.localize(this.options_.label)}),o.querySelector(".vjs-icon-placeholder")),o},t.handleKeyDown=function(r){$B.some(function(n){return ze.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}(Gh);be.registerComponent("MenuItem",Jl);var Zl=function(s){A._inheritsLoose(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(A._assertThisInitialized(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(A._assertThisInitialized(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 R.Event!="object")try{c=new R.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}(Jl);be.registerComponent("TextTrackMenuItem",Zl);var Gw=function(s){A._inheritsLoose(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}(Zl);be.registerComponent("OffTextTrackMenuItem",Gw);var No=function(s){A._inheritsLoose(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=Zl);var a;this.label_&&(a=this.label_+" off"),r.push(new Gw(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}(k0);be.registerComponent("TextTrackButton",No);var Kw=function(s){A._inheritsLoose(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}(Jl);be.registerComponent("ChaptersTrackMenuItem",Kw);var A0=function(s){A._inheritsLoose(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($t(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 Kw(this.player_,{track:this.track_,cue:l});r.push(u)}return r},e}(No);A0.prototype.kind_="chapters";A0.prototype.controlText_="Chapters";be.registerComponent("ChaptersButton",A0);var I0=function(s){A._inheritsLoose(e,s);function e(i,r,n){var a;a=s.call(this,i,r,n)||this;var o=i.textTracks(),l=xt(A._assertThisInitialized(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}(No);I0.prototype.kind_="descriptions";I0.prototype.controlText_="Descriptions";be.registerComponent("DescriptionsButton",I0);var P0=function(s){A._inheritsLoose(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}(No);P0.prototype.kind_="subtitles";P0.prototype.controlText_="Subtitles";be.registerComponent("SubtitlesButton",P0);var D0=function(s){A._inheritsLoose(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}(Zl);be.registerComponent("CaptionSettingsMenuItem",D0);var N0=function(s){A._inheritsLoose(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 D0(this.player_,{kind:this.kind_})),this.hideThreshold_+=1),s.prototype.createItems.call(this,r)},e}(No);N0.prototype.kind_="captions";N0.prototype.controlText_="Captions";be.registerComponent("CaptionsButton",N0);var Xw=function(s){A._inheritsLoose(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(tt("span",{className:"vjs-icon-placeholder"},{"aria-hidden":!0})),l.appendChild(tt("span",{className:"vjs-control-text",textContent:" "+this.localize("Captions")}))),o},e}(Zl);be.registerComponent("SubsCapsMenuItem",Xw);var L0=function(s){A._inheritsLoose(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($t(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 D0(this.player_,{kind:this.label_})),this.hideThreshold_+=1),r=s.prototype.createItems.call(this,r,Xw),r},e}(No);L0.prototype.kinds_=["captions","subtitles"];L0.prototype.controlText_="Subtitles";be.registerComponent("SubsCapsButton",L0);var Qw=function(s){A._inheritsLoose(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(A._assertThisInitialized(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(tt("span",{className:"vjs-icon-placeholder"},{"aria-hidden":!0})),l.appendChild(tt("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}(Jl);be.registerComponent("AudioTrackMenuItem",Qw);var Yw=function(s){A._inheritsLoose(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 Qw(this.player_,{track:o,selectable:!0,multiSelectable:!1}))}return r},e}(k0);Yw.prototype.controlText_="Audio Track";be.registerComponent("AudioTrackButton",Yw);var O0=function(s){A._inheritsLoose(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}(Jl);O0.prototype.contentElType="button";be.registerComponent("PlaybackRateMenuItem",O0);var Jw=function(s){A._inheritsLoose(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_=tt("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 O0(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}(w0);Jw.prototype.controlText_="Playback Rate";be.registerComponent("PlaybackRateMenuButton",Jw);var Zw=function(s){A._inheritsLoose(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",Zw);var qB=function(s){A._inheritsLoose(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}(Zw);be.registerComponent("CustomControlSpacer",qB);var Kc=function(s){A._inheritsLoose(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);Kc.prototype.options_={children:["playToggle","volumePanel","currentTimeDisplay","timeDivider","durationDisplay","progressControl","liveDisplay","seekToLive","remainingTimeDisplay","customControlSpacer","playbackRateMenuButton","chaptersButton","descriptionsButton","subsCapsButton","audioTrackButton","fullscreenToggle"]};"exitPictureInPicture"in ce&&Kc.prototype.options_.children.splice(Kc.prototype.options_.children.length-1,0,"pictureInPictureToggle");be.registerComponent("ControlBar",Kc);var ek=function(s){A._inheritsLoose(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}(Io);ek.prototype.options_=A._extends({},Io.prototype.options_,{pauseOnOpen:!1,fillAlways:!0,temporary:!1,uncloseable:!0});be.registerComponent("ErrorDisplay",ek);var $f="vjs-text-track-settings",MT=["#000","Black"],FT=["#00F","Blue"],BT=["#0FF","Cyan"],UT=["#0F0","Green"],jT=["#F0F","Magenta"],$T=["#F00","Red"],qT=["#FFF","White"],HT=["#FF0","Yellow"],qf=["1","Opaque"],Hf=["0.5","Semi-Transparent"],VT=["0","Transparent"],Ds={backgroundColor:{selector:".vjs-bg-color > select",id:"captions-background-color-%s",label:"Color",options:[MT,qT,$T,UT,FT,HT,jT,BT]},backgroundOpacity:{selector:".vjs-bg-opacity > select",id:"captions-background-opacity-%s",label:"Transparency",options:[qf,Hf,VT]},color:{selector:".vjs-fg-color > select",id:"captions-foreground-color-%s",label:"Color",options:[qT,MT,$T,UT,FT,HT,jT,BT]},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:[qf,Hf]},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:[VT,Hf,qf]}};Ds.windowColor.options=Ds.backgroundColor.options;function tk(s,e){if(e&&(s=e(s)),s&&s!=="none")return s}function HB(s,e){var t=s.options[s.options.selectedIndex].value;return tk(t,e)}function VB(s,e,t){if(e){for(var i=0;i<s.options.length;i++)if(tk(s.options[i].value,t)===e){s.selectedIndex=i;break}}}var zB=function(s){A._inheritsLoose(e,s);function e(i,r){var n;return r.temporary=!1,n=s.call(this,i,r)||this,n.updateDisplay=n.updateDisplay.bind(A._assertThisInitialized(n)),n.fill(),n.hasBeenOpened_=n.hasBeenFilled_=!0,n.endDialog=tt("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()}),Ga(Ds,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=Ds[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 tt("div",{className:"vjs-track-settings-colors",innerHTML:[this.createElFgColor_(),this.createElBgColor_(),this.createElWinColor_()].join("")})},t.createElFont_=function(){return tt("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 tt("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 LF(Ds,function(n,a,o){var l=HB(r.$(a.selector),a.parser);return l!==void 0&&(n[o]=l),n},{})},t.setValues=function(r){var n=this;Ga(Ds,function(a,o){VB(n.$(a.selector),r[o],a.parser)})},t.setDefaults=function(){var r=this;Ga(Ds,function(n){var a=n.hasOwnProperty("default")?n.default:0;r.$(n.selector).selectedIndex=a})},t.restoreSettings=function(){var r;try{r=JSON.parse(R.localStorage.getItem($f))}catch(n){Ke.warn(n)}r&&this.setValues(r)},t.saveSettings=function(){if(this.options_.persistTextTrackSettings){var r=this.getValues();try{Object.keys(r).length?R.localStorage.setItem($f,JSON.stringify(r)):R.localStorage.removeItem($f)}catch(n){Ke.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}(Io);be.registerComponent("TextTrackSettings",zB);var WB=function(s){A._inheritsLoose(e,s);function e(i,r){var n,a=r.ResizeObserver||R.ResizeObserver;r.ResizeObserver===null&&(a=!1);var o=St({createEl:!a,reportTouchActivity:!1},r);return n=s.call(this,i,o)||this,n.ResizeObserver=r.ResizeObserver||R.ResizeObserver,n.loadListener_=null,n.resizeObserver_=null,n.debouncedHandler_=VF(function(){n.resizeHandler()},100,!1,A._assertThisInitialized(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(){pi(this,"resize",l),pi(this,"unload",u),u=null};Zi(n.el_.contentWindow,"unload",u),Zi(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",WB);var GB={trackingThreshold:20,liveTolerance:15},KB=function(s){A._inheritsLoose(e,s);function e(i,r){var n,a=St(GB,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()}),Xl&&"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(R.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_,wr),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",KB);var Vg=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},XB=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="",R.Element.prototype.appendChild.call(this,i),this.innerHTML}}),ik=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},QB=function(e){return ik([e.el(),R.HTMLMediaElement.prototype,R.Element.prototype,XB],"innerHTML")},zT=function(e){var t=e.el();if(!t.resetSourceWatch_){var i={},r=QB(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 Vg(e),h}};["append","appendChild","insertAdjacentHTML"].forEach(function(a){t[a]&&(i[a]=t[a],t[a]=n(i[a]))}),Object.defineProperty(t,"innerHTML",St(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_)}},YB=Object.defineProperty({},"src",{get:function(){return this.hasAttribute("src")?Iw(R.Element.prototype.getAttribute.call(this,"src")):""},set:function(e){return R.Element.prototype.setAttribute.call(this,"src",e),e}}),JB=function(e){return ik([e.el(),R.HTMLMediaElement.prototype,YB],"src")},ZB=function(e){if(e.featuresSourceset){var t=e.el();if(!t.resetSourceset_){var i=JB(e),r=t.setAttribute,n=t.load;Object.defineProperty(t,"src",St(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 Vg(e)||(e.triggerSourceset(""),zT(e)),a},t.currentSrc?e.triggerSourceset(t.currentSrc):Vg(e)||zT(e),t.resetSourceset_=function(){t.resetSourceset_=null,t.load=n,t.setAttribute=r,Object.defineProperty(t,"src",i),t.resetSourceWatch_&&t.resetSourceWatch_()}}}},R0=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)},Ae=function(s){A._inheritsLoose(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")&&Wh(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&&Ke.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_(),(uo||c0||iw)&&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(){ZB(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=ur[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[po.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;ur.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&&gn(this.options_.tag),o=St({},a);(!uo||this.options_.nativeControlsForTouch!==!0)&&delete o.controls,cw(r,Ft(o,{id:this.options_.techId,class:"vjs-tech"}))}r.playerId=this.options_.playerId}typeof this.options_.preload<"u"&&co(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?co(r,c,c):$h(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&&jh?this.el_.fastSeek(r):this.el_.currentTime=r}catch(n){Ke(n,"Video is not ready. (Video.js)")}},t.duration=function(){var r=this;if(this.el_.duration===1/0&&wn&&kn&&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=R.navigator&&R.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)Vr(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),R.performance&&typeof R.performance.now=="function"?r.creationTime=R.performance.now():R.performance&&R.performance.timing&&typeof R.performance.timing.navigationStart=="number"&&(r.creationTime=R.Date.now()-R.performance.timing.navigationStart),r},e}(mt);R0(Ae,"TEST_VID",function(){if(wo()){var s=ce.createElement("video"),e=ce.createElement("track");return e.kind="captions",e.srclang="en",e.label="English",s.appendChild(e),s}});Ae.isSupported=function(){try{Ae.TEST_VID.volume=.5}catch{return!1}return!!(Ae.TEST_VID&&Ae.TEST_VID.canPlayType)};Ae.canPlayType=function(s){return Ae.TEST_VID.canPlayType(s)};Ae.canPlaySource=function(s,e){return Ae.canPlayType(s.type)};Ae.canControlVolume=function(){try{var s=Ae.TEST_VID.volume;Ae.TEST_VID.volume=s/2+.1;var e=s!==Ae.TEST_VID.volume;return e&&ki?(R.setTimeout(function(){Ae&&Ae.prototype&&(Ae.prototype.featuresVolumeControl=s!==Ae.TEST_VID.volume)}),!1):e}catch{return!1}};Ae.canMuteVolume=function(){try{var s=Ae.TEST_VID.muted;return Ae.TEST_VID.muted=!s,Ae.TEST_VID.muted?co(Ae.TEST_VID,"muted","muted"):$h(Ae.TEST_VID,"muted","muted"),s!==Ae.TEST_VID.muted}catch{return!1}};Ae.canControlPlaybackRate=function(){if(wn&&kn&&nw<58)return!1;try{var s=Ae.TEST_VID.playbackRate;return Ae.TEST_VID.playbackRate=s/2+.1,s!==Ae.TEST_VID.playbackRate}catch{return!1}};Ae.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};Ae.supportsNativeTextTracks=function(){return jh||ki&&kn};Ae.supportsNativeVideoTracks=function(){return!!(Ae.TEST_VID&&Ae.TEST_VID.videoTracks)};Ae.supportsNativeAudioTracks=function(){return!!(Ae.TEST_VID&&Ae.TEST_VID.audioTracks)};Ae.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];R0(Ae.prototype,e,function(){return Ae[t]()},!0)});Ae.prototype.featuresVolumeControl=Ae.canControlVolume();Ae.prototype.movingMediaElementInDOM=!ki;Ae.prototype.featuresFullscreenResize=!0;Ae.prototype.featuresProgressEvents=!0;Ae.prototype.featuresTimeupdateEvents=!0;Ae.prototype.featuresVideoFrameCallback=!!(Ae.TEST_VID&&Ae.TEST_VID.requestVideoFrameCallback);var Xc;Ae.patchCanPlayType=function(){o0>=4&&!rw&&!kn&&(Xc=Ae.TEST_VID&&Ae.TEST_VID.constructor.prototype.canPlayType,Ae.TEST_VID.constructor.prototype.canPlayType=function(s){var e=/^application\/(?:x-|vnd\.apple\.)mpegurl/i;return s&&e.test(s)?"maybe":Xc.call(this,s)})};Ae.unpatchCanPlayType=function(){var s=Ae.TEST_VID.constructor.prototype.canPlayType;return Xc&&(Ae.TEST_VID.constructor.prototype.canPlayType=Xc),s};Ae.patchCanPlayType();Ae.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{}}()}};Ae.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){Ae.prototype[s]=function(){return this.el_[s]||this.el_.hasAttribute(s)}});["muted","defaultMuted","autoplay","loop","playsinline"].forEach(function(s){Ae.prototype["set"+$t(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){Ae.prototype[s]=function(){return this.el_[s]}});["volume","src","poster","preload","playbackRate","defaultPlaybackRate","disablePictureInPicture","crossOrigin"].forEach(function(s){Ae.prototype["set"+$t(s)]=function(e){this.el_[s]=e}});["pause","load","play"].forEach(function(s){Ae.prototype[s]=function(){return this.el_[s]()}});mt.withSourceHandlers(Ae);Ae.nativeSourceHandler={};Ae.nativeSourceHandler.canPlayType=function(s){try{return Ae.TEST_VID.canPlayType(s)}catch{return""}};Ae.nativeSourceHandler.canHandleSource=function(s,e){if(s.type)return Ae.nativeSourceHandler.canPlayType(s.type);if(s.src){var t=v0(s.src);return Ae.nativeSourceHandler.canPlayType("video/"+t)}return""};Ae.nativeSourceHandler.handleSource=function(s,e,t){e.setSrc(s.src)};Ae.nativeSourceHandler.dispose=function(){};Ae.registerSourceHandler(Ae.nativeSourceHandler);mt.registerTech("Html5",Ae);var rk=["progress","abort","suspend","emptied","stalled","loadedmetadata","loadeddata","timeupdate","resize","volumechange","texttrackchange"],Vf={canplay:"CanPlay",canplaythrough:"CanPlayThrough",playing:"Playing",seeked:"Seeked"},zg=["tiny","xsmall","small","medium","large","xlarge","huge"],fc={};zg.forEach(function(s){var e=s.charAt(0)==="x"?"x-"+s.substring(1):s;fc[s]="vjs-layout-"+e});var e4={tiny:210,xsmall:320,small:425,medium:768,large:1440,xlarge:2560,huge:1/0},Ht=function(s){A._inheritsLoose(e,s);function e(i,r,n){var a;if(i.id=i.id||r.id||"vjs_video_"+An(),r=Ft(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(gn(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=Z2(a.id_),a.fsApi_=Vc,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&&gn(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(),p0(A._assertThisInitialized(a),{eventBusKey:"el_"}),a.fsApi_.requestFullscreen&&(Zi(ce,a.fsApi_.fullscreenchange,a.boundDocumentFullscreenChange_),a.on(a.fsApi_.fullscreenchange,a.boundDocumentFullscreenChange_)),a.fluid_&&a.on(["playerreset","resize"],a.boundUpdateStyleEl_);var c=St(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"),uo&&a.addClass("vjs-touch-enabled"),ki||a.addClass("vjs-workinghover"),e.players[a.id_]=A._assertThisInitialized(a);var h=Q2.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"),pi(ce,this.fsApi_.fullscreenchange,this.boundDocumentFullscreenChange_),pi(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),TB(this),bi.names.forEach(function(n){var a=bi[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=gn(r);if(o){for(n=this.el_=r,r=this.tag=ce.createElement("video");n.children.length;)r.appendChild(n.firstChild);Vs(n,"video-js")||Sn(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",(Xl||kn&&sw)&&(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"),R.VIDEOJS_NO_DYNAMIC_STYLE!==!0){this.styleEl_=Tw("vjs-styles-dimensions");var u=ts(".vjs-styles-defaults"),c=ts("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);Sn(g,"vjs-hidden"),g.setAttribute("hidden","hidden")}return r.initNetworkState_=r.networkState,r.parentNode&&!a&&r.parentNode.insertBefore(n,r),Fg(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"){Ke.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)){Ke.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,xn(this)&&this.off(["playerreset","resize"],this.boundUpdateStyleEl_),r?(this.addClass("vjs-fluid"),this.fill(!1),zF(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(R.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),bw(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=$t(r),l=r.charAt(0).toLowerCase()+r.slice(1);o!=="Html5"&&this.tag&&(mt.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};bi.names.forEach(function(d){var g=bi[d];c[g.getterName]=a[g.privateName]}),Ft(c,this.options_[o]),Ft(c,this.options_[l]),Ft(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=mt.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(xt(this,this.handleTechReady_),!0),wT.jsonToTextTracks(this.textTracksJson_||[],this.tech_),rk.forEach(function(d){a.on(a.tech_,d,function(g){return a["handleTech"+$t(d)+"_"](g)})}),Object.keys(Vf).forEach(function(d){a.on(a.tech_,d,function(g){if(a.tech_.playbackRate()===0&&a.tech_.seeking()){a.queuedCallbacks_.push({callback:a["handleTech"+Vf[d]+"_"].bind(a),event:g});return}a["handleTech"+Vf[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)&&Fg(this.tech_.el(),this.el()),this.tag&&(this.tag.player=null,this.tag=null)},t.unloadTech_=function(){var r=this;bi.names.forEach(function(n){var a=bi[n];r[a.privateName]=r[a.getterName]()}),this.textTracksJson_=wT.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&&Ke.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(Cl(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(),Cl(o)&&(o=o.catch(a))):r==="muted"&&!this.muted()?o=a():o=this.play(),!!Cl(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=xB(this,n)),this.cache_.source=St({},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=gn(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&&(Ke.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()?Vr(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 yB)return gB(this.middleware_,this.tech_,r,n);if(r in NT)return DT(this.middleware_,this.tech_,r,n);try{this.tech_&&this.tech_[r](n)}catch(a){throw Ke(a),a}},!0)},t.techGet_=function(r){if(!(!this.tech_||!this.tech_.isReady_)){if(r in vB)return mB(this.middleware_,this.tech_,r);if(r in NT)return DT(this.middleware_,this.tech_,r);try{return this.tech_[r]()}catch(n){throw this.tech_[r]===void 0?(Ke("Video.js: "+r+" method not defined for "+this.techName_+" playback technology.",n),n):n.name==="TypeError"?(Ke("Video.js: "+r+" unavailable on "+this.techName_+" playback technology element.",n),this.tech_.isReady_=!1,n):(Ke(n),n)}}},t.play=function(){var r=this,n=this.options_.Promise||R.Promise;return n?new n(function(a){r.play_(a)}):this.play_()},t.play_=function(r){var n=this;r===void 0&&(r=Vr),this.playCallbacks_.push(r);var a=!!(!this.changingSrc_&&(this.src()||this.currentSrc())),o=!!(jh||ki);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")||zs(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=zs(0,0)),r},t.bufferedPercent=function(){return kw(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||R.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||R.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&&Vr(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,Zi(ce,"keydown",this.boundFullWindowOnEscKey_),ce.documentElement.style.overflow="hidden",Sn(ce.body,"vjs-full-window"),this.trigger("enterFullWindow")},t.fullWindowOnEscKey=function(r){ze.isEventKey(r,"Esc")&&this.isFullscreen()===!0&&(this.isFullWindow?this.exitFullWindow():this.exitFullscreen())},t.exitFullWindow=function(){this.isFullscreen(!1),this.isFullWindow=!1,pi(ce,"keydown",this.boundFullWindowOnEscKey_),ce.documentElement.style.overflow=this.docOrigOverflow,Ql(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 ze.isEventKey(p,"f")}:a,l=n.muteKey,u=l===void 0?function(p){return ze.isEventKey(p,"m")}:l,c=n.playPauseKey,h=c===void 0?function(p){return ze.isEventKey(p,"k")||ze.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=mt.getTech(l);if(u||(u=be.getComponent(l)),!u){Ke.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,mt.getTech(h)]}).filter(function(h){var d=h[0],g=h[1];return g?g.isSupported():(Ke.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=CB(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]),fB(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}pB(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?KF(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||R.Promise;if(this.paused()||!n)this.doReset_();else{var a=this.play();Vr(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_(),xn(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(es("beforeerror").forEach(function(o){var l=o(n,r);if(!(Cn(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 Ei(r),this.addClass("vjs-error"),Ke.error("(CODE:"+this.error_.code+" "+Ei.errorTypes[this.error_.code]+")",this.error_.message,this.error_),this.trigger("error"),es("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=xt(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&&!ki&&!wn&&(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||R.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||R.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(),xn(this)&&this.trigger("languagechange"))},t.languages=function(){return St(e.prototype.options_.languages,this.languages_)},t.toJSON=function(){var r=St(this.options_),n=r.tracks;r.tracks=[];for(var a=0;a<n.length;a++){var o=n[a];o=St(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 Io(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<zg.length;a++){var o=zg[a],l=this.breakpoints_[o];if(n<=l){if(r===o)return;r&&this.removeClass(fc[r]),this.addClass(fc[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?Ft(this.breakpoints_):(this.breakpoint_="",this.breakpoints_=Ft({},e4,r),this.updateCurrentBreakpoint_(),Ft(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 fc[this.breakpoint_]||""},t.loadMedia=function(r,n){var a=this;if(!(!r||typeof r!="object")){this.reset(),this.cache_.media=St(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:Gc(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:Gc(o.poster)}]),o}return St(this.cache_.media)},e.getTagSettings=function(r){var n={sources:[],tracks:[]},a=gn(r),o=a["data-setup"];if(Vs(r,"vjs-fill")&&(a.fill=!0),Vs(r,"vjs-fluid")&&(a.fluid=!0),o!==null){var l=VM(o||"{}"),u=l[0],c=l[1];u&&Ke.error(u),Ft(a,c)}if(Ft(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(gn(y)):p==="track"&&n.tracks.push(gn(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);bi.names.forEach(function(s){var e=bi[s];Ht.prototype[e.getterName]=function(){return this.tech_?this.tech_[e.getterName]():(this[e.privateName]=this[e.privateName]||new e.ListClass,this[e.privateName])}});Ht.prototype.crossorigin=Ht.prototype.crossOrigin;Ht.players={};var sl=R.navigator;Ht.prototype.options_={techOrder:mt.defaultTechOrder_,html5:{},inactivityTimeout:2e3,playbackRates:[],liveui:!1,children:["mediaLoader","posterImage","textTrackDisplay","loadingSpinner","bigPlayButton","liveTracker","controlBar","errorDisplay","textTrackSettings","resizeManager"],language:sl&&(sl.languages&&sl.languages[0]||sl.userLanguage||sl.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){Ht.prototype[s]=function(){return this.techGet_(s)}});rk.forEach(function(s){Ht.prototype["handleTech"+$t(s)+"_"]=function(){return this.trigger(s)}});be.registerComponent("Player",Ht);var Qc="plugin",Ka="activePlugins_",Ma={},Yc=function(e){return Ma.hasOwnProperty(e)},pc=function(e){return Yc(e)?Ma[e]:void 0},nk=function(e,t){e[Ka]=e[Ka]||{},e[Ka][t]=!0},Jc=function(e,t,i){var r=(i?"before":"")+"pluginsetup";e.trigger(r,t),e.trigger(r+":"+t.name,t)},t4=function(e,t){var i=function(){Jc(this,{name:e,plugin:t,instance:null},!0);var n=t.apply(this,arguments);return nk(this,e),Jc(this,{name:e,plugin:t,instance:n}),n};return Object.keys(t).forEach(function(r){i[r]=t[r]}),i},WT=function(e,t){return t.prototype.name=e,function(){Jc(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=M2(t,[this].concat(r));return this[e]=function(){return a},Jc(this,a.getEventHash()),a}},Jr=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)),p0(this),delete this.trigger,ww(this,this.constructor.defaultState),nk(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={}),Ao(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[Ka][i]=!1,this.player=this.state=null,r[i]=WT(i,Ma[i])},s.isBasic=function(i){var r=typeof i=="string"?pc(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(Yc(i))Ke.warn('A plugin named "'+i+'" already exists. You may want to avoid re-registering plugins!');else if(Ht.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 Ma[i]=r,i!==Qc&&(s.isBasic(r)?Ht.prototype[i]=t4(i,r):Ht.prototype[i]=WT(i,r)),r},s.deregisterPlugin=function(i){if(i===Qc)throw new Error("Cannot de-register base plugin.");Yc(i)&&(delete Ma[i],delete Ht.prototype[i])},s.getPlugins=function(i){i===void 0&&(i=Object.keys(Ma));var r;return i.forEach(function(n){var a=pc(n);a&&(r=r||{},r[n]=a)}),r},s.getPluginVersion=function(i){var r=pc(i);return r&&r.VERSION||""},s}();Jr.getPlugin=pc;Jr.BASE_PLUGIN_NAME=Qc;Jr.registerPlugin(Qc,Jr);Ht.prototype.usingPlugin=function(s){return!!this[Ka]&&this[Ka][s]===!0};Ht.prototype.hasPlugin=function(s){return!!Yc(s)};var GT=!1,i4=function(e,t){t===void 0&&(t={}),GT||(Ke.warn("videojs.extend is deprecated as of Video.js 7.22.0 and will be removed in Video.js 8.0.0"),GT=!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),KM(i,e),e&&(i.super_=e);for(var n in r)r.hasOwnProperty(n)&&(i.prototype[n]=r[n]);return i},sk=function(e){return e.indexOf("#")===0?e.slice(1):e};function oe(s,e,t){var i=oe.getPlayer(s);if(i)return e&&Ke.warn('Player "'+s+'" is already initialised. Options will not be applied.'),t&&i.ready(t),i;var r=typeof s=="string"?ts("#"+sk(s)):s;if(!ko(r))throw new TypeError("The element or ID supplied is not valid. (videojs)");(!r.ownerDocument.defaultView||!r.ownerDocument.body.contains(r))&&Ke.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)),es("beforesetup").forEach(function(a){var o=a(r,St(e));if(!Cn(o)||Array.isArray(o)){Ke.error("please return an object in beforesetup hooks");return}e=St(e,o)});var n=be.getComponent("Player");return i=new n(r,e,t),es("setup").forEach(function(a){return a(i)}),i}oe.hooks_=_n;oe.hooks=es;oe.hook=IF;oe.hookOnce=PF;oe.removeHook=Y2;if(R.VIDEOJS_NO_DYNAMIC_STYLE!==!0&&wo()){var Xu=ts(".vjs-styles-defaults");if(!Xu){Xu=Tw("vjs-styles-defaults");var zf=ts("head");zf&&zf.insertBefore(Xu,zf.firstChild),bw(Xu,`
|
|
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
|
+
`)}}Ug(1,oe);oe.VERSION=Q2;oe.options=Ht.prototype.options_;oe.getPlayers=function(){return Ht.players};oe.getPlayer=function(s){var e=Ht.players,t;if(typeof s=="string"){var i=sk(s),r=e[i];if(r)return r;t=ts("#"+i)}else t=s;if(ko(t)){var n=t,a=n.player,o=n.playerId;if(a||e[o])return a||e[o]}};oe.getAllPlayers=function(){return Object.keys(Ht.players).map(function(s){return Ht.players[s]}).filter(Boolean)};oe.players=Ht.players;oe.getComponent=be.getComponent;oe.registerComponent=function(s,e){mt.isTech(e)&&Ke.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)};oe.getTech=mt.getTech;oe.registerTech=mt.registerTech;oe.use=dB;Object.defineProperty(oe,"middleware",{value:{},writeable:!1,enumerable:!0});Object.defineProperty(oe.middleware,"TERMINATOR",{value:Wc,writeable:!1,enumerable:!0});oe.browser=MF;oe.TOUCH_ENABLED=uo;oe.extend=i4;oe.mergeOptions=St;oe.bind=xt;oe.registerPlugin=Jr.registerPlugin;oe.deregisterPlugin=Jr.deregisterPlugin;oe.plugin=function(s,e){return Ke.warn("videojs.plugin() is deprecated; use videojs.registerPlugin() instead"),Jr.registerPlugin(s,e)};oe.getPlugins=Jr.getPlugins;oe.getPlugin=Jr.getPlugin;oe.getPluginVersion=Jr.getPluginVersion;oe.addLanguage=function(s,e){var t;return s=(""+s).toLowerCase(),oe.options.languages=St(oe.options.languages,(t={},t[s]=e,t)),oe.options.languages[s]};oe.log=Ke;oe.createLogger=Z2;oe.createTimeRange=oe.createTimeRanges=zs;oe.formatTime=mo;oe.setFormatTime=DB;oe.resetFormatTime=NB;oe.parseUrl=g0;oe.isCrossOrigin=Wh;oe.EventTarget=ti;oe.on=Zi;oe.one=Vh;oe.off=pi;oe.trigger=Ao;oe.xhr=O2;oe.TextTrack=Yl;oe.AudioTrack=Pw;oe.VideoTrack=Dw;["isEl","isTextNode","createEl","hasClass","addClass","removeClass","toggleClass","setAttributes","getAttributes","emptyEl","appendContent","insertContent"].forEach(function(s){oe[s]=function(){return Ke.warn("videojs."+s+"() is deprecated; use videojs.dom."+s+"() instead"),yw[s].apply(null,arguments)}});oe.computedStyle=Rl;oe.dom=yw;oe.url=lB;oe.defineLazyProperty=R0;oe.addLanguage("en",{"Non-Fullscreen":"Exit Fullscreen"});/*! @name @videojs/http-streaming @version 2.16.3 @license Apache-2.0 */var Sr=Mh,Zc=function(e,t,i){return e&&i&&i.responseURL&&t!==i.responseURL?i.responseURL:t},Ar=function(e){return oe.log.debug?oe.log.debug.bind(oe,"VHS:",e+" >"):function(){}},is=1/30,zr=is*3,ak=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 oe.createTimeRanges(i)},Fa=function(e,t){return ak(e,function(i,r){return i-zr<=t&&r+zr>=t})},Qu=function(e,t){return ak(e,function(i){return i-is>=t})},r4=function(e){if(e.length<2)return oe.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 oe.createTimeRanges(t)},n4=function(e,t){var i=null,r=null,n=0,a=[],o=[];if(!e||!e.length||!t||!t.length)return oe.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 oe.createTimeRanges(o)},ok=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(", ")},s4=function(e,t,i){i===void 0&&(i=1);var r=e.length?e.end(e.length-1):0;return(r-t)/i},Rs=function(e){for(var t=[],i=0;i<e.length;i++)t.push({start:e.start(i),end:e.end(i)});return t},a4=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},KT=function(e){if(!(!e||!e.length||!e.end))return e.end(e.length-1)},M0=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},XT=oe.createTimeRange,F0=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},Wg=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},[])},lk=function(e){var t=e.segments&&e.segments.length&&e.segments[e.segments.length-1];return t&&t.parts||[]},uk=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}},ck=function(e,t){if(t.endList)return 0;if(e&&e.suggestedPresentationDelay)return e.suggestedPresentationDelay;var i=lk(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},o4=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+=F0(e,n),typeof n.start<"u")return{result:i+n.start,precise:!0}}return{result:i,precise:!1}},l4=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+=F0(e,r),typeof r.end<"u")return{result:r.end-i,precise:!0}}return{result:-1,precise:!1}},hk=function(e,t,i){if(typeof t>"u"&&(t=e.mediaSequence+e.segments.length),t<e.mediaSequence)return 0;var r=o4(e,t);if(r.precise)return r.result;var n=l4(e,t);return n.precise?n.result:r.result+i},dk=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 R.Infinity}return hk(e,t,i)},El=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},fk=function(e,t,i,r){if(!e||!e.segments)return null;if(e.endList)return dk(e);if(t===null)return null;t=t||0;var n=hk(e,e.mediaSequence+e.segments.length,t);return i&&(r=typeof r=="number"?r:ck(null,e),n-=r),Math.max(0,n)},u4=function(e,t,i){var r=!0,n=t||0,a=fk(e,t,r,i);return a===null?XT():XT(n,a)},c4=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=Wg(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+is<=0)continue;return{partIndex:y.partIndex,segmentIndex:y.segmentIndex,startTime:a-El({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-is>=0)continue;return{partIndex:k.partIndex,segmentIndex:k.segmentIndex,startTime:a+El({defaultDuration:t.targetDuration,durationList:u,startIndex:c,endIndex:_})}}return{segmentIndex:u[u.length-1].segmentIndex,partIndex:u[u.length-1].partIndex,startTime:i}},pk=function(e){return e.excludeUntil&&e.excludeUntil>Date.now()},B0=function(e){return e.excludeUntil&&e.excludeUntil===1/0},Qh=function(e){var t=pk(e);return!e.disabled&&!t},h4=function(e){return e.disabled},d4=function(e){for(var t=0;t<e.segments.length;t++)if(e.segments[t].key)return!0;return!1},mk=function(e,t){return t.attributes&&t.attributes[e]},f4=function(e,t,i,r){if(r===void 0&&(r=0),!mk("BANDWIDTH",i))return NaN;var n=e*i.attributes.BANDWIDTH;return(n-r*8)/t},Gg=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 Qh(r)?(r.attributes.BANDWIDTH||0)<i:!1}).length===0},U0=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)},QT=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},eu=function(e){if(!e||!e.playlists||!e.playlists.length){var t=QT(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 U2(h)}))return"continue";var c=QT(e,function(h){return U0(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},Mi={liveEdgeDelay:ck,duration:dk,seekable:u4,getMediaInfoForTime:c4,isEnabled:Qh,isDisabled:h4,isBlacklisted:pk,isIncompatible:B0,playlistEnd:fk,isAes:d4,hasAttribute:mk,estimateSegmentRequestTime:f4,isLowestEnabledRendition:Gg,isAudioOnly:eu,playlistMatch:U0,segmentDurationWithParts:F0},gk=oe.log,j0=function(e,t){return e+"-"+t},p4=function(e,t,i){return"placeholder-uri-"+e+"-"+t+"-"+i},m4=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 r3;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=lk(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),gk.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},Lo=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)}})},vk=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||{}},g4=function(e){for(var t=e.playlists.length;t--;){var i=e.playlists[t];vk({playlist:i,id:j0(t,i.uri)}),i.resolvedUri=Sr(e.uri,i.uri),e.playlists[i.id]=i,e.playlists[i.uri]=i,i.attributes.BANDWIDTH||gk.warn("Invalid playlist STREAM-INF detected. Missing BANDWIDTH attribute.")}},v4=function(e){Lo(e,function(t){t.uri&&(t.resolvedUri=Sr(e.uri,t.uri))})},y4=function(e,t){var i=j0(0,t),r={mediaGroups:{AUDIO:{},VIDEO:{},"CLOSED-CAPTIONS":{},SUBTITLES:{}},uri:R.location.href,resolvedUri:R.location.href,playlists:[{uri:t,id:i,resolvedUri:t,attributes:{}}]};return r.playlists[i]=r.playlists[0],r.playlists[t]=r.playlists[0],r},yk=function(e,t,i){i===void 0&&(i=p4),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=eu(e);Lo(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=[A._extends({},o)]}o.playlists.forEach(function(g,y){var p=i(l,u,c,g),_=j0(y,p);g.uri?g.resolvedUri=g.resolvedUri||Sr(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})}),g4(e),v4(e)},eh=oe.mergeOptions,_4=oe.EventTarget,T4=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=uk(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 R.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},b4=function(e,t){if(!e)return t;var i=eh(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]=eh(e.parts[r],t.parts[r]));return!e.skipped&&t.skipped&&(i.skipped=!1),e.preload&&!t.preload&&(i.preload=!1),i},S4=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(b4(u,c))):(o&&!c.map&&(c.map=o),a.push(c))}return a},_k=function(e,t){!e.resolvedUri&&e.uri&&(e.resolvedUri=Sr(t,e.uri)),e.key&&!e.key.resolvedUri&&(e.key.resolvedUri=Sr(t,e.key.uri)),e.map&&!e.map.resolvedUri&&(e.map.resolvedUri=Sr(t,e.map.uri)),e.map&&e.map.key&&!e.map.key.resolvedUri&&(e.map.key.resolvedUri=Sr(t,e.map.key.uri)),e.parts&&e.parts.length&&e.parts.forEach(function(i){i.resolvedUri||(i.resolvedUri=Sr(t,i.uri))}),e.preloadHints&&e.preloadHints.length&&e.preloadHints.forEach(function(i){i.resolvedUri||(i.resolvedUri=Sr(t,i.uri))})},Tk=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},bk=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},Kg=function(e,t,i){i===void 0&&(i=bk);var r=eh(e,{}),n=r.playlists[t.id];if(!n||i(n,t))return null;t.segments=Tk(t);var a=eh(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=S4(n.segments,t.segments,t.mediaSequence-n.mediaSequence)}a.segments.forEach(function(u){_k(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,Lo(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},Xg=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},Ba=function(s){A._inheritsLoose(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_=Ar("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,oe.browser.IE_VERSION&&(a.experimentalLLHLS=!1),a.state="HAVE_NOTHING",a.handleMediaupdatetimeout_=a.handleMediaupdatetimeout_.bind(A._assertThisInitialized(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=Sr(this.master.uri,n.uri);this.experimentalLLHLS&&(a=T4(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 m4({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(),vk({playlist:u,uri:o,id:l});var c=Kg(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_(Xg(this.media(),!!c)),this.trigger("loadedplaylist")},t.dispose=function(){this.trigger("dispose"),this.stopRequest(),R.clearTimeout(this.mediaUpdateTimeout),R.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(R.clearTimeout(this.finalRenditionTimeout),n){var o=(r.partTargetDuration||r.targetDuration)/2*1e3||5e3;this.finalRenditionTimeout=R.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_(Xg(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=Zc(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&&(R.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&&(R.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null);var a=this.media();if(r){var o=a?(a.partTargetDuration||a.targetDuration)/2*1e3:5e3;this.mediaUpdateTimeout=R.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&&(R.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null),!(!this.media()||this.media().endList)&&(this.mediaUpdateTimeout=R.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=R.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=Zc(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,yk(this.master,this.srcUri()),r.playlists.forEach(function(a){a.segments=Tk(a),a.segments.forEach(function(o){_k(o,a.resolvedUri)})}),this.trigger("loadedplaylist"),this.request||this.media(this.master.playlists[0]);return}var n=this.srcUri()||R.location.href;this.master=y4(r,n),this.haveMetadata({playlistObject:r,url:n,id:this.master.playlists[0].id}),this.trigger("loadedmetadata")},e}(_4),x4=oe.xhr,C4=oe.mergeOptions,Qg=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)},Sk=function(){var e=function t(i,r){i=C4({timeout:45e3},i);var n=t.beforeRequest||oe.Vhs.xhr.beforeRequest;if(n&&typeof n=="function"){var a=n(i);a&&(i=a)}var o=oe.Vhs.xhr.original===!0?x4:oe.Vhs.xhr,l=o(i,function(c,h){return Qg(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},E4=function(e){var t,i=e.offset;return typeof e.offset=="bigint"||typeof e.length=="bigint"?t=R.BigInt(e.offset)+R.BigInt(e.length)-R.BigInt(1):t=e.offset+e.length-1,"bytes="+i+"-"+t},Yg=function(e){var t={};return e.byterange&&(t.Range=E4(e.byterange)),t},w4=function(e,t){return e.start(t)+"-"+e.end(t)},k4=function(e,t){var i=e.toString(16);return"00".substring(0,2-i.length)+i+(t%2?" ":"")},A4=function(e){return e>=32&&e<126?String.fromCharCode(e):"."},xk=function(e){var t={};return Object.keys(e).forEach(function(i){var r=e[i];$2(r)?t[i]={bytes:r.buffer,byteOffset:r.byteOffset,byteLength:r.byteLength}:t[i]=r}),t},th=function(e){var t=e.byterange||{length:1/0,offset:0};return[t.length,t.offset,e.resolvedUri].join(",")},Ck=function(e){return e.resolvedUri},Ek=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(k4).join(""),a=t.slice(o*i,o*i+i).map(A4).join(""),r+=n+" "+a+`
|
|
279
|
+
`;return r},I4=function(e){var t=e.bytes;return Ek(t)},P4=function(e){var t="",i;for(i=0;i<e.length;i++)t+=w4(e,i)+" ";return t},D4=Object.freeze({__proto__:null,createTransferableMessage:xk,initSegmentId:th,segmentKeyId:Ck,hexDump:Ek,tagDump:I4,textRanges:P4}),wk=.25,N4=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)},L4=function(e){return e.transmuxedPresentationEnd-e.transmuxedPresentationStart-e.transmuxerPrependedSeconds},O4=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?L4(o.videoTimingInfo):o.duration+o.duration*wk,c=new Date(l.getTime()+u*1e3);return i>c?null:(i>l&&(r=o),{segment:r,estimatedStart:r.videoTimingInfo?r.videoTimingInfo.transmuxedPresentationStart:Mi.duration(t,t.mediaSequence+t.segments.indexOf(r)),type:r.videoTimingInfo?"accurate":"estimate"})},R4=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*wk)return null;r=a}return{segment:r,estimatedStart:r.videoTimingInfo?r.videoTimingInfo.transmuxedPresentationStart:i-r.duration,type:r.videoTimingInfo?"accurate":"estimate"}},M4=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},F4=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},B4=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=R4(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=N4(r,a.segment);return l&&(o.programDateTime=l.toISOString()),n(null,o)},U4=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(!F4(i))return c({message:"programDateTime tags must be provided in the manifest "+i.resolvedUri});var h=O4(t,i);if(!h)return c({message:t+" was not found in the stream"});var d=h.segment,g=M4(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)},Wf=function(e,t){if(e.readyState===4)return t()},j4=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=m3(r,q2(y,!0)),n=n||pl(r),r.length<10||n&&r.length<n+2)return Wf(g,function(){return o(d,g,"",r)});var p=a0(r);return p==="ts"&&r.length<188?Wf(g,function(){return o(d,g,"",r)}):!p&&r.length<376?Wf(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,Qg(d,null,{statusCode:d.status},l)})}},c=t(u,function(h,d){return Qg(c,h,d,l)});return c},$4=oe.EventTarget,kk=oe.mergeOptions,YT=function(e,t){if(!bk(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},q4=function(e,t,i,r){var n=r.attributes.NAME||i;return"placeholder-uri-"+e+"-"+t+"-"+n},H4=function(e){var t=e.masterXml,i=e.srcUrl,r=e.clientOffset,n=e.sidxMapping,a=e.previousManifest,o=aF(t,{manifestUri:i,clientOffset:r,sidxMapping:n,previousManifest:a});return yk(o,i,q4),o},V4=function(e,t){Lo(e,function(i,r,n,a){a in t.mediaGroups[r][n]||delete e.mediaGroups[r][n][a]})},z4=function(e,t,i){for(var r=!0,n=kk(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=Bh(o.sidx);i&&i[l]&&i[l].sidx&&i0(o,i[l].sidx,o.sidx.resolvedUri)}var u=Kg(n,o,YT);u&&(n=u,r=!1)}return Lo(t,function(c,h,d,g){if(c.playlists&&c.playlists.length){var y=c.playlists[0].id,p=Kg(n,c.playlists[0],YT);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)}}),V4(n,t),t.minimumUpdatePeriod!==e.minimumUpdatePeriod&&(r=!1),r?null:n},W4=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},JT=function(e,t){var i={};for(var r in e){var n=e[r],a=n.sidx;if(a){var o=Bh(a);if(!t[o])break;var l=t[o].sidxInfo;W4(l,a)&&(i[o]=t[o])}}return i},G4=function(e,t){var i=JT(e.playlists,t),r=i;return Lo(e,function(n,a,o,l){if(n.playlists&&n.playlists.length){var u=n.playlists;r=kk(r,JT(u,t))}}),r},Jg=function(s){A._inheritsLoose(e,s);function e(i,r,n,a){var o;n===void 0&&(n={}),o=s.call(this)||this,o.masterPlaylistLoader_=a||A._assertThisInitialized(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_=Ar("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&&Bh(r.sidx);if(!r.sidx||!l||this.masterPlaylistLoader_.sidxMapping_[l]){this.mediaRequest_=R.setTimeout(function(){return a(!1)},0);return}var u=Zc(this.handleManifestRedirects,r.sidx.resolvedUri),c=function(d,g){if(!o.requestErrored_(d,g,n)){var y=o.masterPlaylistLoader_.sidxMapping_,p;try{p=hF(je(g.response).subarray(8))}catch(_){o.requestErrored_(_,g,n);return}return y[l]={sidxInfo:r.sidx,sidx:p},i0(r,p,r.sidx.resolvedUri),a(!0)}};this.request=j4(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:Yg({byterange:r.sidx.byterange})},c)})},t.dispose=function(){this.trigger("dispose"),this.stopRequest(),this.loadedPlaylists_={},R.clearTimeout(this.minimumUpdatePeriodTimeout_),R.clearTimeout(this.mediaRequest_),R.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(),R.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null,this.isMaster_&&(R.clearTimeout(this.masterPlaylistLoader_.minimumUpdatePeriodTimeout_),this.masterPlaylistLoader_.minimumUpdatePeriodTimeout_=null),this.state==="HAVE_NOTHING"&&(this.started=!1)},t.load=function(r){var n=this;R.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null;var a=this.media();if(r){var o=a?a.targetDuration/2*1e3:5e3;this.mediaUpdateTimeout=R.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_=R.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=Zc(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=oF(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:Sr(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=H4({masterXml:this.masterPlaylistLoader_.masterXml_,srcUrl:this.masterPlaylistLoader_.srcUrl,clientOffset:this.masterPlaylistLoader_.clientOffset_,sidxMapping:this.masterPlaylistLoader_.sidxMapping_,previousManifest:r});r&&(n=z4(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_&&(R.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_=R.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_=G4(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=R.setTimeout(function(){n.trigger("mediaupdatetimeout"),u()},Xg(n.media(),!!o)))};l()}this.trigger("loadedplaylist")},e}($4),Yt={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},K4=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},Ak=function(e){return e.on=e.addEventListener,e.off=e.removeEventListener,e},X4=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())}},Ik=function(e){return function(){var t=X4(e),i=Ak(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}},Pk=function(e){return"var browserWorkerPolyFill = "+Ak.toString()+`;
|
|
280
|
+
browserWorkerPolyFill(self);
|
|
281
|
+
`+e},Dk=function(e){return e.toString().replace(/^function.+?{/,"").slice(0,-1)},Q4=Pk(Dk(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,D,M;if(T=m[x],!!T)if(arguments.length===2)for(D=T.length,E=0;E<D;++E)T[E].call(this,arguments[1]);else{for(M=[],E=arguments.length,E=1;E<arguments.length;++E)M.push(arguments[E]);for(D=T.length,E=0;E<D;++E)T[E].apply(this,M)}},this.dispose=function(){m={}}}};s.prototype.pipe=function(q){return this.on("data",function(m){q.push(m)}),this.on("done",function(m){q.flush(m)}),this.on("partialdone",function(m){q.partialFlush(m)}),this.on("endedtimeline",function(m){q.endTimeline(m)}),this.on("reset",function(m){q.reset(m)}),q},s.prototype.push=function(q){this.trigger("data",q)},s.prototype.flush=function(q){this.trigger("done",q)},s.prototype.partialFlush=function(q){this.trigger("partialdone",q)},s.prototype.endTimeline=function(q){this.trigger("endedtimeline",q)},s.prototype.reset=function(q){this.trigger("reset",q)};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,I,L,$,F,O,B,U,C,P,K,z,X,re,he,fe,ne,se,le,de,ve,we,Pe,Oe,De;(function(){var q;if(z={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(q in z)z.hasOwnProperty(q)&&(z[q]=[q.charCodeAt(0),q.charCodeAt(1),q.charCodeAt(2),q.charCodeAt(3)]);X=new Uint8Array([105,115,111,109]),he=new Uint8Array([97,118,99,49]),re=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]),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]),se={video:fe,audio:ne},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]),we=new Uint8Array([0,0,0,0,0,0,0,0]),Pe=we,Oe=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),De=we,le=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0])}})(),a=function(m){var x=[],T=0,E,D,M;for(E=1;E<arguments.length;E++)x.push(arguments[E]);for(E=x.length;E--;)T+=x[E].byteLength;for(D=new Uint8Array(T+8),M=new DataView(D.buffer,D.byteOffset,D.byteLength),M.setUint32(0,D.byteLength),D.set(m,4),E=0,T=8;E<x.length;E++)D.set(x[E],T),T+=x[E].byteLength;return D},o=function(){return a(z.dinf,a(z.dref,ve))},l=function(m){return a(z.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(z.ftyp,X,re,X,he)},F=function(m){return a(z.hdlr,se[m])},c=function(m){return a(z.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(z.mdhd,x)},L=function(m){return a(z.mdia,$(m),F(m.type),d(m))},h=function(m){return a(z.mfhd,new Uint8Array([0,0,0,0,(m&4278190080)>>24,(m&16711680)>>16,(m&65280)>>8,m&255]))},d=function(m){return a(z.minf,m.type==="video"?a(z.vmhd,le):a(z.smhd,de),o(),B(m))},g=function(m,x){for(var T=[],E=x.length;E--;)T[E]=C(x[E]);return a.apply(null,[z.moof,h(m)].concat(T))},y=function(m){for(var x=m.length,T=[];x--;)T[x]=k(m[x]);return a.apply(null,[z.moov,_(4294967295)].concat(T).concat(p(m)))},p=function(m){for(var x=m.length,T=[];x--;)T[x]=P(m[x]);return a.apply(null,[z.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(z.mvhd,x)},O=function(m){var x=m.samples||[],T=new Uint8Array(4+x.length),E,D;for(D=0;D<x.length;D++)E=x[D].flags,T[D+4]=E.dependsOn<<4|E.isDependedOn<<2|E.hasRedundancy;return a(z.sdtp,T)},B=function(m){return a(z.stbl,U(m),a(z.stts,De),a(z.stsc,Pe),a(z.stsz,Oe),a(z.stco,we))},function(){var q,m;U=function(T){return a(z.stsd,new Uint8Array([0,0,0,0,0,0,0,1]),T.type==="video"?q(T):m(T))},q=function(T){var E=T.sps||[],D=T.pps||[],M=[],W=[],Y,ie;for(Y=0;Y<E.length;Y++)M.push((E[Y].byteLength&65280)>>>8),M.push(E[Y].byteLength&255),M=M.concat(Array.prototype.slice.call(E[Y]));for(Y=0;Y<D.length;Y++)W.push((D[Y].byteLength&65280)>>>8),W.push(D[Y].byteLength&255),W=W.concat(Array.prototype.slice.call(D[Y]));if(ie=[z.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(z.avcC,new Uint8Array([1,T.profileIdc,T.profileCompatibility,T.levelIdc,255].concat([E.length],M,[D.length],W))),a(z.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192]))],T.sarRatio){var ee=T.sarRatio[0],ae=T.sarRatio[1];ie.push(a(z.pasp,new Uint8Array([(ee&4278190080)>>24,(ee&16711680)>>16,(ee&65280)>>8,ee&255,(ae&4278190080)>>24,(ae&16711680)>>16,(ae&65280)>>8,ae&255])))}return a.apply(null,ie)},m=function(T){return a(z.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))}}(),I=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(z.tkhd,x)},C=function(m){var x,T,E,D,M,W,Y;return x=a(z.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])),W=Math.floor(m.baseMediaDecodeTime/n),Y=Math.floor(m.baseMediaDecodeTime%n),T=a(z.tfdt,new Uint8Array([1,0,0,0,W>>>24&255,W>>>16&255,W>>>8&255,W&255,Y>>>24&255,Y>>>16&255,Y>>>8&255,Y&255])),M=92,m.type==="audio"?(E=K(m,M),a(z.traf,x,T,E)):(D=O(m),E=K(m,D.length+M),a(z.traf,x,T,E,D))},k=function(m){return m.duration=m.duration||4294967295,a(z.trak,I(m),L(m))},P=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(z.trex,x)},function(){var q,m,x;x=function(E,D){var M=0,W=0,Y=0,ie=0;return E.length&&(E[0].duration!==void 0&&(M=1),E[0].size!==void 0&&(W=2),E[0].flags!==void 0&&(Y=4),E[0].compositionTimeOffset!==void 0&&(ie=8)),[0,0,M|W|Y|ie,1,(E.length&4278190080)>>>24,(E.length&16711680)>>>16,(E.length&65280)>>>8,E.length&255,(D&4278190080)>>>24,(D&16711680)>>>16,(D&65280)>>>8,D&255]},m=function(E,D){var M,W,Y,ie,ee,ae;for(ie=E.samples||[],D+=20+16*ie.length,Y=x(ie,D),W=new Uint8Array(Y.length+ie.length*16),W.set(Y),M=Y.length,ae=0;ae<ie.length;ae++)ee=ie[ae],W[M++]=(ee.duration&4278190080)>>>24,W[M++]=(ee.duration&16711680)>>>16,W[M++]=(ee.duration&65280)>>>8,W[M++]=ee.duration&255,W[M++]=(ee.size&4278190080)>>>24,W[M++]=(ee.size&16711680)>>>16,W[M++]=(ee.size&65280)>>>8,W[M++]=ee.size&255,W[M++]=ee.flags.isLeading<<2|ee.flags.dependsOn,W[M++]=ee.flags.isDependedOn<<6|ee.flags.hasRedundancy<<4|ee.flags.paddingValue<<1|ee.flags.isNonSyncSample,W[M++]=ee.flags.degradationPriority&61440,W[M++]=ee.flags.degradationPriority&15,W[M++]=(ee.compositionTimeOffset&4278190080)>>>24,W[M++]=(ee.compositionTimeOffset&16711680)>>>16,W[M++]=(ee.compositionTimeOffset&65280)>>>8,W[M++]=ee.compositionTimeOffset&255;return a(z.trun,W)},q=function(E,D){var M,W,Y,ie,ee,ae;for(ie=E.samples||[],D+=20+8*ie.length,Y=x(ie,D),M=new Uint8Array(Y.length+ie.length*8),M.set(Y),W=Y.length,ae=0;ae<ie.length;ae++)ee=ie[ae],M[W++]=(ee.duration&4278190080)>>>24,M[W++]=(ee.duration&16711680)>>>16,M[W++]=(ee.duration&65280)>>>8,M[W++]=ee.duration&255,M[W++]=(ee.size&4278190080)>>>24,M[W++]=(ee.size&16711680)>>>16,M[W++]=(ee.size&65280)>>>8,M[W++]=ee.size&255;return a(z.trun,M)},K=function(E,D){return E.type==="audio"?q(E,D):m(E,D)}}();var Xe={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=[],D=[];for(D.byteLength=0,D.nalCount=0,D.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,D.byteLength+=E.byteLength,D.nalCount+=E.length,D.duration+=E.duration,D.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 D.length&&(!E.duration||E.duration<=0)&&(E.duration=D[D.length-1].duration),D.byteLength+=E.byteLength,D.nalCount+=E.length,D.duration+=E.duration,D.push(E),D},Le=function(m){var x,T,E=[],D=[];for(E.byteLength=0,E.nalCount=0,E.duration=0,E.pts=m[0].pts,E.dts=m[0].dts,D.byteLength=0,D.nalCount=0,D.duration=0,D.pts=m[0].pts,D.dts=m[0].dts,x=0;x<m.length;x++)T=m[x],T.keyFrame?(E.length&&(D.push(E),D.byteLength+=E.byteLength,D.nalCount+=E.nalCount,D.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 D.length&&E.duration<=0&&(E.duration=D[D.length-1].duration),D.byteLength+=E.byteLength,D.nalCount+=E.nalCount,D.duration+=E.duration,D.push(E),D},qe=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},it=function(){return{size:0,flags:{isLeading:0,dependsOn:1,isDependedOn:0,hasRedundancy:0,degradationPriority:0,isNonSyncSample:1}}},gt=function(m,x){var T=it();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},At=function(m,x){var T,E,D,M,W,Y=x||0,ie=[];for(T=0;T<m.length;T++)for(M=m[T],E=0;E<M.length;E++)W=M[E],D=gt(W,Y),Y+=D.size,ie.push(D);return ie},Ai=function(m){var x,T,E,D,M,W,Y=0,ie=m.byteLength,ee=m.nalCount,ae=ie+4*ee,ge=new Uint8Array(ae),xe=new DataView(ge.buffer);for(x=0;x<m.length;x++)for(D=m[x],T=0;T<D.length;T++)for(M=D[T],E=0;E<M.length;E++)W=M[E],xe.setUint32(Y,W.data.byteLength),Y+=4,ge.set(W.data,Y),Y+=W.data.byteLength;return ge},Lt=function(m,x){var T,E=x||0,D=[];return T=gt(m,E),D.push(T),D},Fi=function(m){var x,T,E=0,D=m.byteLength,M=m.length,W=D+4*M,Y=new Uint8Array(W),ie=new DataView(Y.buffer);for(x=0;x<m.length;x++)T=m[x],ie.setUint32(E,T.data.byteLength),E+=4,Y.set(T.data,E),E+=T.data.byteLength;return Y},Te={groupNalsIntoFrames:Re,groupFramesIntoGops:Le,extendFirstKeyFrame:qe,generateSampleTable:At,concatenateNalData:Ai,generateSampleTableForFrame:Lt,concatenateNalDataForFrame:Fi},Ce=[33,16,5,32,164,27],Fe=[33,65,108,84,1,2,4,8,168,2,4,8,17,191,252],Me=function(m){for(var x=[];m--;)x.push(0);return x},Ge=function(m){return Object.keys(m).reduce(function(x,T){return x[T]=new Uint8Array(m[T].reduce(function(E,D){return E.concat(D)},[])),x},{})},Qe,vt=function(){if(!Qe){var m={96e3:[Ce,[227,64],Me(154),[56]],88200:[Ce,[231],Me(170),[56]],64e3:[Ce,[248,192],Me(240),[56]],48e3:[Ce,[255,192],Me(268),[55,148,128],Me(54),[112]],44100:[Ce,[255,192],Me(268),[55,163,128],Me(84),[112]],32e3:[Ce,[255,192],Me(268),[55,234],Me(226),[112]],24e3:[Ce,[255,192],Me(268),[55,255,128],Me(268),[111,112],Me(126),[224]],16e3:[Ce,[255,192],Me(268),[55,255,128],Me(268),[111,255],Me(269),[223,108],Me(195),[1,192]],12e3:[Fe,Me(268),[3,127,248],Me(268),[6,255,240],Me(268),[13,255,224],Me(268),[27,253,128],Me(259),[56]],11025:[Fe,Me(268),[3,127,248],Me(268),[6,255,240],Me(268),[13,255,224],Me(268),[27,255,192],Me(268),[55,175,128],Me(108),[112]],8e3:[Fe,Me(268),[3,121,16],Me(47),[7]]};Qe=Ge(m)}return Qe},Bi=9e4,pr,mr,ir,Ui,tn,In,rn;pr=function(m){return m*Bi},mr=function(m,x){return m*x},ir=function(m){return m/Bi},Ui=function(m,x){return m/x},tn=function(m,x){return pr(Ui(m,x))},In=function(m,x){return mr(ir(m),x)},rn=function(m,x,T){return ir(T?m:m-x)};var Ye={ONE_SECOND_IN_TS:Bi,secondsToVideoTs:pr,secondsToAudioTs:mr,videoTsToSeconds:ir,audioTsToSeconds:Ui,audioTsToVideoTs:tn,videoTsToAudioTs:In,metadataTsToSeconds:rn},rt=function(m){var x,T,E=0;for(x=0;x<m.length;x++)T=m[x],E+=T.data.byteLength;return E},Zs=function(m,x,T,E){var D,M=0,W=0,Y=0,ie=0,ee,ae,ge;if(x.length&&(D=Ye.audioTsToVideoTs(m.baseMediaDecodeTime,m.samplerate),M=Math.ceil(Ye.ONE_SECOND_IN_TS/(m.samplerate/1024)),T&&E&&(W=D-Math.max(T,E),Y=Math.floor(W/M),ie=Y*M),!(Y<1||ie>Ye.ONE_SECOND_IN_TS/2))){for(ee=vt()[m.samplerate],ee||(ee=x[0].data),ae=0;ae<Y;ae++)ge=x[0],x.splice(0,0,{data:ee,dts:ge.dts-M,pts:ge.pts-M});return m.baseMediaDecodeTime-=Math.floor(Ye.videoTsToAudioTs(ie,m.samplerate)),ie}},nn=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}))},ea=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},ss=function(m){var x,T,E=0,D=new Uint8Array(rt(m));for(x=0;x<m.length;x++)T=m[x],D.set(T.data,E),E+=T.data.byteLength;return D},ji={prefixWithSilence:Zs,trimAdtsFramesByEarliestDts:nn,generateSampleTable:ea,concatenateFrameData:ss},ta=Ye.ONE_SECOND_IN_TS,as=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))},ia=function(m){delete m.minSegmentDts,delete m.maxSegmentDts,delete m.minSegmentPts,delete m.maxSegmentPts},H=function(m,x){var T,E,D=m.minSegmentDts;return x||(D-=m.timelineStartInfo.dts),T=m.timelineStartInfo.baseMediaDecodeTime,T+=D,T=Math.max(0,T),m.type==="audio"&&(E=m.samplerate/ta,T*=E,T=Math.floor(T)),T},V={clearDtsInfo:ia,calculateTrackBaseMediaDecodeTime:H,collectDtsInfo:as},te=4,pe=128,Ee=function(m){for(var x=0,T={payloadType:-1,payloadSize:0},E=0,D=0;x<m.byteLength&&m[x]!==pe;){for(;m[x]===255;)E+=255,x++;for(E+=m[x++];m[x]===255;)D+=255,x++;if(D+=m[x++],!T.payload&&E===te){var M=String.fromCharCode(m[x+3],m[x+4],m[x+5],m[x+6]);if(M==="GA94"){T.payloadType=E,T.payloadSize=D,T.payload=m.subarray(x,x+D);break}else T.payload=void 0}x+=D,E=0,D=0}return T},$e=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)},ot=function(m,x){var T=[],E,D,M,W;if(!(x[0]&64))return T;for(D=x[0]&31,E=0;E<D;E++)M=E*3,W={type:x[M+2]&3,pts:m},x[M+2]&4&&(W.ccData=x[M+3]<<8|x[M+4],T.push(W));return T},Gt=function(m){for(var x=m.byteLength,T=[],E=1,D,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;D=x-T.length,M=new Uint8Array(D);var W=0;for(E=0;E<D;W++,E++)W===T[0]&&(W++,T.shift()),M[E]=m[W];return M},ii={parseSei:Ee,parseUserData:$e,parseCaptionPackets:ot,discardEmulationPreventionBytes:Gt,USER_DATA_REGISTERED_ITU_T_T35:te},Ct=function q(m){m=m||{},q.prototype.init.call(this),this.parse708captions_=typeof m.parse708captions=="boolean"?m.parse708captions:!0,this.captionPackets_=[],this.ccStreams_=[new Tt(0,0),new Tt(0,1),new Tt(1,0),new Tt(1,1)],this.parse708captions_&&(this.cc708Stream_=new et({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")))};Ct.prototype=new e,Ct.prototype.push=function(q){var m,x,T;if(q.nalUnitType==="sei_rbsp"&&(m=ii.parseSei(q.escapedRBSP),!!m.payload&&m.payloadType===ii.USER_DATA_REGISTERED_ITU_T_T35&&(x=ii.parseUserData(m),!!x))){if(q.dts<this.latestDts_){this.ignoreNextEqualDts_=!0;return}else if(q.dts===this.latestDts_&&this.ignoreNextEqualDts_){this.numSameDts_--,this.numSameDts_||(this.ignoreNextEqualDts_=!1);return}T=ii.parseCaptionPackets(q.pts,x),this.captionPackets_=this.captionPackets_.concat(T),this.latestDts_!==q.dts&&(this.numSameDts_=0),this.numSameDts_++,this.latestDts_=q.dts}},Ct.prototype.flushCCStreams=function(q){this.ccStreams_.forEach(function(m){return q==="flush"?m.flush():m.partialFlush()},this)},Ct.prototype.flushStream=function(q){if(!this.captionPackets_.length){this.flushCCStreams(q);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(q)},Ct.prototype.flush=function(){return this.flushStream("flush")},Ct.prototype.partialFlush=function(){return this.flushStream("partialFlush")},Ct.prototype.reset=function(){this.latestDts_=null,this.ignoreNextEqualDts_=!1,this.numSameDts_=0,this.activeCea608Channel_=[null,null],this.ccStreams_.forEach(function(q){q.reset()})},Ct.prototype.dispatchCea608Packet=function(q){this.setsTextOrXDSActive(q)?this.activeCea608Channel_[q.type]=null:this.setsChannel1Active(q)?this.activeCea608Channel_[q.type]=0:this.setsChannel2Active(q)&&(this.activeCea608Channel_[q.type]=1),this.activeCea608Channel_[q.type]!==null&&this.ccStreams_[(q.type<<1)+this.activeCea608Channel_[q.type]].push(q)},Ct.prototype.setsChannel1Active=function(q){return(q.ccData&30720)===4096},Ct.prototype.setsChannel2Active=function(q){return(q.ccData&30720)===6144},Ct.prototype.setsTextOrXDSActive=function(q){return(q.ccData&28928)===256||(q.ccData&30974)===4138||(q.ccData&30974)===6186},Ct.prototype.dispatchCea708Packet=function(q){this.parse708captions_&&this.cc708Stream_.push(q)};var $i={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},rr=function(m){var x=$i[m]||m;return m&4096&&m===x?"":String.fromCharCode(x)},li=function(m){return 32<=m&&m<=127||160<=m&&m<=255},Ot=function(m){this.windowNum=m,this.reset()};Ot.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},Ot.prototype.getText=function(){return this.rows.join(`
|
|
282
|
+
`)},Ot.prototype.clearText=function(){this.rows=[""],this.rowIdx=0},Ot.prototype.newLine=function(q){for(this.rows.length>=this.virtualRowCount&&typeof this.beforeRowOverflow=="function"&&this.beforeRowOverflow(q),this.rows.length>0&&(this.rows.push(""),this.rowIdx++);this.rows.length>this.virtualRowCount;)this.rows.shift(),this.rowIdx--},Ot.prototype.isEmpty=function(){return this.rows.length===0?!0:this.rows.length===1?this.rows[0]==="":!1},Ot.prototype.addText=function(q){this.rows[this.rowIdx]+=q},Ot.prototype.backspace=function(){if(!this.isEmpty()){var q=this.rows[this.rowIdx];this.rows[this.rowIdx]=q.substr(0,q.length-1)}};var st=function(m,x,T){this.serviceNum=m,this.text="",this.currentWindow=new Ot(-1),this.windows=[],this.stream=T,typeof x=="string"&&this.createTextDecoder(x)};st.prototype.init=function(q,m){this.startPts=q;for(var x=0;x<8;x++)this.windows[x]=new Ot(x),typeof m=="function"&&(this.windows[x].beforeRowOverflow=m)},st.prototype.setCurrentWindow=function(q){this.currentWindow=this.windows[q]},st.prototype.createTextDecoder=function(q){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(q)}catch(m){this.stream.trigger("log",{level:"warn",message:"TextDecoder could not be created with "+q+" encoding. "+m})}};var et=function q(m){m=m||{},q.prototype.init.call(this);var x=this,T=m.captionServices||{},E={},D;Object.keys(T).forEach(function(M){D=T[M],/^SERVICE/.test(M)&&(E[M]=D.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))}};et.prototype=new e,et.prototype.new708Packet=function(){this.current708Packet!==null&&this.push708Packet(),this.current708Packet={data:[],ptsVals:[]}},et.prototype.add708Bytes=function(q){var m=q.ccData,x=m>>>8,T=m&255;this.current708Packet.ptsVals.push(q.pts),this.current708Packet.data.push(x),this.current708Packet.data.push(T)},et.prototype.push708Packet=function(){var q=this.current708Packet,m=q.data,x=null,T=null,E=0,D=m[E++];for(q.seq=D>>6,q.sizeCode=D&63;E<m.length;E++)D=m[E++],x=D>>5,T=D&31,x===7&&T>0&&(D=m[E++],x=D),this.pushServiceBlock(x,E,T),T>0&&(E+=T-1)},et.prototype.pushServiceBlock=function(q,m,x){var T,E=m,D=this.current708Packet.data,M=this.services[q];for(M||(M=this.initService(q,E));E<m+x&&E<D.length;E++)T=D[E],li(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++},et.prototype.extendedCommands=function(q,m){var x=this.current708Packet.data,T=x[++q];return li(T)&&(q=this.handleText(q,m,{isExtended:!0})),q},et.prototype.getPts=function(q){return this.current708Packet.ptsVals[Math.floor(q/2)]},et.prototype.initService=function(q,m){var T="SERVICE"+q,x=this,T,E;return T in this.serviceEncodings&&(E=this.serviceEncodings[T]),this.services[q]=new st(q,E,x),this.services[q].init(this.getPts(m),function(D){x.flushDisplayed(D,x.services[q])}),this.services[q]},et.prototype.handleText=function(q,m,x){var T=x&&x.isExtended,E=x&&x.isMultiByte,D=this.current708Packet.data,M=T?4096:0,W=D[q],Y=D[q+1],ie=m.currentWindow,ee,ae;return m.textDecoder_&&!T?(E?(ae=[W,Y],q++):ae=[W],ee=m.textDecoder_.decode(new Uint8Array(ae))):ee=rr(M|W),ie.pendingNewLine&&!ie.isEmpty()&&ie.newLine(this.getPts(q)),ie.pendingNewLine=!1,ie.addText(ee),q},et.prototype.multiByteCharacter=function(q,m){var x=this.current708Packet.data,T=x[q+1],E=x[q+2];return li(T)&&li(E)&&(q=this.handleText(++q,m,{isMultiByte:!0})),q},et.prototype.setCurrentWindow=function(q,m){var x=this.current708Packet.data,T=x[q],E=T&7;return m.setCurrentWindow(E),q},et.prototype.defineWindow=function(q,m){var x=this.current708Packet.data,T=x[q],E=T&7;m.setCurrentWindow(E);var D=m.currentWindow;return T=x[++q],D.visible=(T&32)>>5,D.rowLock=(T&16)>>4,D.columnLock=(T&8)>>3,D.priority=T&7,T=x[++q],D.relativePositioning=(T&128)>>7,D.anchorVertical=T&127,T=x[++q],D.anchorHorizontal=T,T=x[++q],D.anchorPoint=(T&240)>>4,D.rowCount=T&15,T=x[++q],D.columnCount=T&63,T=x[++q],D.windowStyle=(T&56)>>3,D.penStyle=T&7,D.virtualRowCount=D.rowCount+1,q},et.prototype.setWindowAttributes=function(q,m){var x=this.current708Packet.data,T=x[q],E=m.currentWindow.winAttr;return T=x[++q],E.fillOpacity=(T&192)>>6,E.fillRed=(T&48)>>4,E.fillGreen=(T&12)>>2,E.fillBlue=T&3,T=x[++q],E.borderType=(T&192)>>6,E.borderRed=(T&48)>>4,E.borderGreen=(T&12)>>2,E.borderBlue=T&3,T=x[++q],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[++q],E.effectSpeed=(T&240)>>4,E.effectDirection=(T&12)>>2,E.displayEffect=T&3,q},et.prototype.flushDisplayed=function(q,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=q,m.text=x.join(`
|
|
283
|
+
|
|
284
|
+
`),this.pushCaption(m),m.startPts=q},et.prototype.pushCaption=function(q){q.text!==""&&(this.trigger("data",{startPts:q.startPts,endPts:q.endPts,text:q.text,stream:"cc708_"+q.serviceNum}),q.text="",q.startPts=q.endPts)},et.prototype.displayWindows=function(q,m){var x=this.current708Packet.data,T=x[++q],E=this.getPts(q);this.flushDisplayed(E,m);for(var D=0;D<8;D++)T&1<<D&&(m.windows[D].visible=1);return q},et.prototype.hideWindows=function(q,m){var x=this.current708Packet.data,T=x[++q],E=this.getPts(q);this.flushDisplayed(E,m);for(var D=0;D<8;D++)T&1<<D&&(m.windows[D].visible=0);return q},et.prototype.toggleWindows=function(q,m){var x=this.current708Packet.data,T=x[++q],E=this.getPts(q);this.flushDisplayed(E,m);for(var D=0;D<8;D++)T&1<<D&&(m.windows[D].visible^=1);return q},et.prototype.clearWindows=function(q,m){var x=this.current708Packet.data,T=x[++q],E=this.getPts(q);this.flushDisplayed(E,m);for(var D=0;D<8;D++)T&1<<D&&m.windows[D].clearText();return q},et.prototype.deleteWindows=function(q,m){var x=this.current708Packet.data,T=x[++q],E=this.getPts(q);this.flushDisplayed(E,m);for(var D=0;D<8;D++)T&1<<D&&m.windows[D].reset();return q},et.prototype.setPenAttributes=function(q,m){var x=this.current708Packet.data,T=x[q],E=m.currentWindow.penAttr;return T=x[++q],E.textTag=(T&240)>>4,E.offset=(T&12)>>2,E.penSize=T&3,T=x[++q],E.italics=(T&128)>>7,E.underline=(T&64)>>6,E.edgeType=(T&56)>>3,E.fontStyle=T&7,q},et.prototype.setPenColor=function(q,m){var x=this.current708Packet.data,T=x[q],E=m.currentWindow.penColor;return T=x[++q],E.fgOpacity=(T&192)>>6,E.fgRed=(T&48)>>4,E.fgGreen=(T&12)>>2,E.fgBlue=T&3,T=x[++q],E.bgOpacity=(T&192)>>6,E.bgRed=(T&48)>>4,E.bgGreen=(T&12)>>2,E.bgBlue=T&3,T=x[++q],E.edgeRed=(T&48)>>4,E.edgeGreen=(T&12)>>2,E.edgeBlue=T&3,q},et.prototype.setPenLocation=function(q,m){var x=this.current708Packet.data,T=x[q],E=m.currentWindow.penLoc;return m.currentWindow.pendingNewLine=!0,T=x[++q],E.row=T&15,T=x[++q],E.column=T&63,q},et.prototype.reset=function(q,m){var x=this.getPts(q);return this.flushDisplayed(x,m),this.initService(m.serviceNum,q)};var sn={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},yt=function(m){return m===null?"":(m=sn[m]||m,String.fromCharCode(m))},ri=14,qi=[4352,4384,4608,4640,5376,5408,5632,5664,5888,5920,4096,4864,4896,5120,5152],Ze=function(){for(var m=[],x=ri+1;x--;)m.push("");return m},Tt=function q(m,x){q.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,D,M,W,Y;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,W=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),D=this.displayed_,this.displayed_=this.nonDisplayed_,this.nonDisplayed_=D,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_=Ze();else if(E===this.ERASE_NON_DISPLAYED_MEMORY_)this.nonDisplayed_=Ze();else if(E===this.RESUME_DIRECT_CAPTIONING_)this.mode_!=="paintOn"&&(this.flushDisplayed(T.pts),this.displayed_=Ze()),this.mode_="paintOn",this.startPts_=T.pts;else if(this.isSpecialCharacter(M,W))M=(M&3)<<8,Y=yt(M|W),this[this.mode_](T.pts,Y),this.column_++;else if(this.isExtCharacter(M,W))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,Y=yt(M|W),this[this.mode_](T.pts,Y),this.column_++;else if(this.isMidRowCode(M,W))this.clearFormatting(T.pts),this[this.mode_](T.pts," "),this.column_++,(W&14)===14&&this.addFormatting(T.pts,["i"]),(W&1)===1&&this.addFormatting(T.pts,["u"]);else if(this.isOffsetControlCode(M,W))this.column_+=W&3;else if(this.isPAC(M,W)){var ie=qi.indexOf(E&7968);this.mode_==="rollUp"&&(ie-this.rollUpRows_+1<0&&(ie=this.rollUpRows_-1),this.setRollUp(T.pts,ie)),ie!==this.row_&&(this.clearFormatting(T.pts),this.row_=ie),W&1&&this.formatting_.indexOf("u")===-1&&this.addFormatting(T.pts,["u"]),(E&16)===16&&(this.column_=((E&14)>>1)*4),this.isColorPAC(W)&&(W&14)===14&&this.addFormatting(T.pts,["i"])}else this.isNormalChar(M)&&(W===0&&(W=null),Y=yt(M),Y+=yt(W),this[this.mode_](T.pts,Y),this.column_+=Y.length)}};Tt.prototype=new e,Tt.prototype.flushDisplayed=function(q){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:q,text:m,stream:this.name_})},Tt.prototype.reset=function(){this.mode_="popOn",this.topRow_=0,this.startPts_=0,this.displayed_=Ze(),this.nonDisplayed_=Ze(),this.lastControlCode_=null,this.column_=0,this.row_=ri,this.rollUpRows_=2,this.formatting_=[]},Tt.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},Tt.prototype.isSpecialCharacter=function(q,m){return q===this.EXT_&&m>=48&&m<=63},Tt.prototype.isExtCharacter=function(q,m){return(q===this.EXT_+1||q===this.EXT_+2)&&m>=32&&m<=63},Tt.prototype.isMidRowCode=function(q,m){return q===this.EXT_&&m>=32&&m<=47},Tt.prototype.isOffsetControlCode=function(q,m){return q===this.OFFSET_&&m>=33&&m<=35},Tt.prototype.isPAC=function(q,m){return q>=this.BASE_&&q<this.BASE_+8&&m>=64&&m<=127},Tt.prototype.isColorPAC=function(q){return q>=64&&q<=79||q>=96&&q<=127},Tt.prototype.isNormalChar=function(q){return q>=32&&q<=127},Tt.prototype.setRollUp=function(q,m){if(this.mode_!=="rollUp"&&(this.row_=ri,this.mode_="rollUp",this.flushDisplayed(q),this.nonDisplayed_=Ze(),this.displayed_=Ze()),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},Tt.prototype.addFormatting=function(q,m){this.formatting_=this.formatting_.concat(m);var x=m.reduce(function(T,E){return T+"<"+E+">"},"");this[this.mode_](q,x)},Tt.prototype.clearFormatting=function(q){if(this.formatting_.length){var m=this.formatting_.reverse().reduce(function(x,T){return x+"</"+T+">"},"");this.formatting_=[],this[this.mode_](q,m)}},Tt.prototype.popOn=function(q,m){var x=this.nonDisplayed_[this.row_];x+=m,this.nonDisplayed_[this.row_]=x},Tt.prototype.rollUp=function(q,m){var x=this.displayed_[this.row_];x+=m,this.displayed_[this.row_]=x},Tt.prototype.shiftRowsUp_=function(){var q;for(q=0;q<this.topRow_;q++)this.displayed_[q]="";for(q=this.row_+1;q<ri+1;q++)this.displayed_[q]="";for(q=this.topRow_;q<this.row_;q++)this.displayed_[q]=this.displayed_[q+1];this.displayed_[this.row_]=""},Tt.prototype.paintOn=function(q,m){var x=this.displayed_[this.row_];x+=m,this.displayed_[this.row_]=x};var an={CaptionStream:Ct,Cea608Stream:Tt,Cea708Stream:et},Rt={H264_STREAM_TYPE:27,ADTS_STREAM_TYPE:15,METADATA_STREAM_TYPE:21},sd=8589934592,on=4294967296,ht="shared",ra=function(m,x){var T=1;for(m>x&&(T=-1);Math.abs(x-m)>on;)m+=T*sd;return m},os=function q(m){var x,T;q.prototype.init.call(this),this.type_=m||ht,this.push=function(E){this.type_!==ht&&E.type!==this.type_||(T===void 0&&(T=E.dts),E.dts=ra(E.dts,T),E.pts=ra(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")}};os.prototype=new e;var su={TimestampRolloverStream:os,handleRollover:ra},au=function(m,x,T){var E,D="";for(E=x;E<T;E++)D+="%"+("00"+m[E].toString(16)).slice(-2);return D},na=function(m,x,T){return decodeURIComponent(au(m,x,T))},ou=function(m,x,T){return unescape(au(m,x,T))},Pn=function(m){return m[0]<<21|m[1]<<14|m[2]<<7|m[3]},sa={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=na(m.data,1,x),m.value=na(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=na(m.data,1,x),m.url=na(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=ou(m.data,0,x);break}m.privateData=m.data.subarray(x+1),m.data=m.privateData}},ls;ls=function(m){var x={descriptor:m&&m.descriptor},T=0,E=[],D=0,M;if(ls.prototype.init.call(this),this.dispatchType=Rt.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(W){var Y,ie,ee,ae,ge,xe;if(W.type==="timed-metadata"){if(W.dataAlignmentIndicator&&(D=0,E.length=0),E.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(E.push(W),D+=W.data.byteLength,E.length===1&&(T=Pn(W.data.subarray(6,10)),T+=10),!(D<T)){for(Y={data:new Uint8Array(T),frames:[],pts:E[0].pts,dts:E[0].dts},ge=0;ge<T;)Y.data.set(E[0].data.subarray(0,T-ge),ge),ge+=E[0].data.byteLength,D-=E[0].data.byteLength,E.shift();ie=10,Y.data[5]&64&&(ie+=4,ie+=Pn(Y.data.subarray(10,14)),T-=Pn(Y.data.subarray(16,20)));do{if(ee=Pn(Y.data.subarray(ie+4,ie+8)),ee<1){this.trigger("log",{level:"warn",message:"Malformed ID3 frame encountered. Skipping metadata parsing."});return}if(xe=String.fromCharCode(Y.data[ie],Y.data[ie+1],Y.data[ie+2],Y.data[ie+3]),ae={id:xe,data:Y.data.subarray(ie+10,ie+ee+10)},ae.key=ae.id,sa[ae.id]&&(sa[ae.id](ae),ae.owner==="com.apple.streaming.transportStreamTimestamp")){var Ie=ae.data,Se=(Ie[3]&1)<<30|Ie[4]<<22|Ie[5]<<14|Ie[6]<<6|Ie[7]>>>2;Se*=4,Se+=Ie[7]&3,ae.timeStamp=Se,Y.pts===void 0&&Y.dts===void 0&&(Y.pts=ae.timeStamp,Y.dts=ae.timeStamp),this.trigger("timestamp",ae)}Y.frames.push(ae),ie+=10,ie+=ee}while(ie<T);this.trigger("data",Y)}}}},ls.prototype=new e;var ad=ls,od=su.TimestampRolloverStream,ln,Dr,us,nr=188,un=71;ln=function(){var m=new Uint8Array(nr),x=0;ln.prototype.init.call(this),this.push=function(T){var E=0,D=nr,M;for(x?(M=new Uint8Array(T.byteLength+x),M.set(m.subarray(0,x)),M.set(T,x),x=0):M=T;D<M.byteLength;){if(M[E]===un&&M[D]===un){this.trigger("data",M.subarray(E,D)),E+=nr,D+=nr;continue}E++,D++}E<M.byteLength&&(m.set(M.subarray(E),0),x=M.byteLength-E)},this.flush=function(){x===nr&&m[0]===un&&(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")}},ln.prototype=new e,Dr=function(){var m,x,T,E;Dr.prototype.init.call(this),E=this,this.packetsWaitingForPmt=[],this.programMapTable=void 0,m=function(M,W){var Y=0;W.payloadUnitStartIndicator&&(Y+=M[Y]+1),W.type==="pat"?x(M.subarray(Y),W):T(M.subarray(Y),W)},x=function(M,W){W.section_number=M[7],W.last_section_number=M[8],E.pmtPid=(M[10]&31)<<8|M[11],W.pmtPid=E.pmtPid},T=function(M,W){var Y,ie,ee,ae;if(M[5]&1){for(E.programMapTable={video:null,audio:null,"timed-metadata":{}},Y=(M[1]&15)<<8|M[2],ie=3+Y-4,ee=(M[10]&15)<<8|M[11],ae=12+ee;ae<ie;){var ge=M[ae],xe=(M[ae+1]&31)<<8|M[ae+2];ge===Rt.H264_STREAM_TYPE&&E.programMapTable.video===null?E.programMapTable.video=xe:ge===Rt.ADTS_STREAM_TYPE&&E.programMapTable.audio===null?E.programMapTable.audio=xe:ge===Rt.METADATA_STREAM_TYPE&&(E.programMapTable["timed-metadata"][xe]=ge),ae+=((M[ae+3]&15)<<8|M[ae+4])+5}W.programMapTable=E.programMapTable}},this.push=function(D){var M={},W=4;if(M.payloadUnitStartIndicator=!!(D[1]&64),M.pid=D[1]&31,M.pid<<=8,M.pid|=D[2],(D[3]&48)>>>4>1&&(W+=D[W]+1),M.pid===0)M.type="pat",m(D.subarray(W),M),this.trigger("data",M);else if(M.pid===this.pmtPid)for(M.type="pmt",m(D.subarray(W),M),this.trigger("data",M);this.packetsWaitingForPmt.length;)this.processPes_.apply(this,this.packetsWaitingForPmt.shift());else this.programMapTable===void 0?this.packetsWaitingForPmt.push([D,W,M]):this.processPes_(D,W,M)},this.processPes_=function(D,M,W){W.pid===this.programMapTable.video?W.streamType=Rt.H264_STREAM_TYPE:W.pid===this.programMapTable.audio?W.streamType=Rt.ADTS_STREAM_TYPE:W.streamType=this.programMapTable["timed-metadata"][W.pid],W.type="pes",W.data=D.subarray(M),this.trigger("data",W)}},Dr.prototype=new e,Dr.STREAM_TYPES={h264:27,adts:15},us=function(){var m=this,x=!1,T={data:[],size:0},E={data:[],size:0},D={data:[],size:0},M,W=function(ee,ae){var ge,xe=ee[0]<<16|ee[1]<<8|ee[2];ae.data=new Uint8Array,xe===1&&(ae.packetLength=6+(ee[4]<<8|ee[5]),ae.dataAlignmentIndicator=(ee[6]&4)!==0,ge=ee[7],ge&192&&(ae.pts=(ee[9]&14)<<27|(ee[10]&255)<<20|(ee[11]&254)<<12|(ee[12]&255)<<5|(ee[13]&254)>>>3,ae.pts*=4,ae.pts+=(ee[13]&6)>>>1,ae.dts=ae.pts,ge&64&&(ae.dts=(ee[14]&14)<<27|(ee[15]&255)<<20|(ee[16]&254)<<12|(ee[17]&255)<<5|(ee[18]&254)>>>3,ae.dts*=4,ae.dts+=(ee[18]&6)>>>1)),ae.data=ee.subarray(9+ee[8]))},Y=function(ee,ae,ge){var xe=new Uint8Array(ee.size),Ie={type:ae},Se=0,Ve=0,It=!1,ni;if(!(!ee.data.length||ee.size<9)){for(Ie.trackId=ee.data[0].pid,Se=0;Se<ee.data.length;Se++)ni=ee.data[Se],xe.set(ni.data,Ve),Ve+=ni.data.byteLength;W(xe,Ie),It=ae==="video"||Ie.packetLength<=ee.size,(ge||It)&&(ee.size=0,ee.data.length=0),It&&m.trigger("data",Ie)}};us.prototype.init.call(this),this.push=function(ie){({pat:function(){},pes:function(){var ae,ge;switch(ie.streamType){case Rt.H264_STREAM_TYPE:ae=T,ge="video";break;case Rt.ADTS_STREAM_TYPE:ae=E,ge="audio";break;case Rt.METADATA_STREAM_TYPE:ae=D,ge="timed-metadata";break;default:return}ie.payloadUnitStartIndicator&&Y(ae,ge,!0),ae.data.push(ie),ae.size+=ie.data.byteLength},pmt:function(){var ae={type:"metadata",tracks:[]};M=ie.programMapTable,M.video!==null&&ae.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+M.video,codec:"avc",type:"video"}),M.audio!==null&&ae.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+M.audio,codec:"adts",type:"audio"}),x=!0,m.trigger("data",ae)}})[ie.type]()},this.reset=function(){T.size=0,T.data.length=0,E.size=0,E.data.length=0,this.trigger("reset")},this.flushStreams_=function(){Y(T,"video"),Y(E,"audio"),Y(D,"timed-metadata")},this.flush=function(){if(!x&&M){var ie={type:"metadata",tracks:[]};M.video!==null&&ie.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+M.video,codec:"avc",type:"video"}),M.audio!==null&&ie.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+M.audio,codec:"adts",type:"audio"}),m.trigger("data",ie)}x=!1,this.flushStreams_(),this.trigger("done")}},us.prototype=new e;var Dn={PAT_PID:0,MP2T_PACKET_LENGTH:nr,TransportPacketStream:ln,TransportParseStream:Dr,ElementaryStream:us,TimestampRolloverStream:od,CaptionStream:an.CaptionStream,Cea608Stream:an.Cea608Stream,Cea708Stream:an.Cea708Stream,MetadataStream:ad};for(var cn in Rt)Rt.hasOwnProperty(cn)&&(Dn[cn]=Rt[cn]);var gr=Dn,lu=Ye.ONE_SECOND_IN_TS,aa,uu=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350];aa=function(m){var x,T=0;aa.prototype.init.call(this),this.skipWarn_=function(E,D){this.trigger("log",{level:"warn",message:"adts skiping bytes "+E+" to "+D+" in frame "+T+" outside syncword"})},this.push=function(E){var D=0,M,W,Y,ie,ee;if(m||(T=0),E.type==="audio"){x&&x.length?(Y=x,x=new Uint8Array(Y.byteLength+E.data.byteLength),x.set(Y),x.set(E.data,Y.byteLength)):x=E.data;for(var ae;D+7<x.length;){if(x[D]!==255||(x[D+1]&246)!==240){typeof ae!="number"&&(ae=D),D++;continue}if(typeof ae=="number"&&(this.skipWarn_(ae,D),ae=null),W=(~x[D+1]&1)*2,M=(x[D+3]&3)<<11|x[D+4]<<3|(x[D+5]&224)>>5,ie=((x[D+6]&3)+1)*1024,ee=ie*lu/uu[(x[D+2]&60)>>>2],x.byteLength-D<M)break;this.trigger("data",{pts:E.pts+T*ee,dts:E.dts+T*ee,sampleCount:ie,audioobjecttype:(x[D+2]>>>6&3)+1,channelcount:(x[D+2]&1)<<2|(x[D+3]&192)>>>6,samplerate:uu[(x[D+2]&60)>>>2],samplingfrequencyindex:(x[D+2]&60)>>>2,samplesize:16,data:x.subarray(D+7+W,D+M)}),T++,D+=M}typeof ae=="number"&&(this.skipWarn_(ae,D),ae=null),x=x.subarray(D)}},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")}},aa.prototype=new e;var vr=aa,cs;cs=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 D=m.byteLength-x,M=new Uint8Array(4),W=Math.min(4,x);if(W===0)throw new Error("no bytes available");M.set(m.subarray(D,D+W)),T=new DataView(M.buffer).getUint32(0),E=W*8,x-=W},this.skipBits=function(D){var M;E>D?(T<<=D,E-=D):(D-=E,M=Math.floor(D/8),D-=M*8,x-=M,this.loadWord(),T<<=D,E-=D)},this.readBits=function(D){var M=Math.min(E,D),W=T>>>32-M;return E-=M,E>0?T<<=M:x>0&&this.loadWord(),M=D-M,M>0?W<<M|this.readBits(M):W},this.skipLeadingZeros=function(){var D;for(D=0;D<E;++D)if((T&2147483648>>>D)!==0)return T<<=D,E-=D,D;return this.loadWord(),D+this.skipLeadingZeros()},this.skipUnsignedExpGolomb=function(){this.skipBits(1+this.skipLeadingZeros())},this.skipExpGolomb=function(){this.skipBits(1+this.skipLeadingZeros())},this.readUnsignedExpGolomb=function(){var D=this.skipLeadingZeros();return this.readBits(D+1)-1},this.readExpGolomb=function(){var D=this.readUnsignedExpGolomb();return 1&D?1+D>>>1:-1*(D>>>1)},this.readBoolean=function(){return this.readBits(1)===1},this.readUnsignedByte=function(){return this.readBits(8)},this.loadWord()};var ld=cs,Nn,Ln,Ii;Ln=function(){var m=0,x,T;Ln.prototype.init.call(this),this.push=function(E){var D;T?(D=new Uint8Array(T.byteLength+E.data.byteLength),D.set(T),D.set(E.data,T.byteLength),T=D):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")}},Ln.prototype=new e,Ii={100:!0,110:!0,122:!0,244:!0,44:!0,83:!0,86:!0,118:!0,128:!0,138:!0,139:!0,134:!0},Nn=function(){var m=new Ln,x,T,E,D,M,W,Y;Nn.prototype.init.call(this),x=this,this.push=function(ie){ie.type==="video"&&(T=ie.trackId,E=ie.pts,D=ie.dts,m.push(ie))},m.on("data",function(ie){var ee={trackId:T,pts:E,dts:D,data:ie,nalUnitTypeCode:ie[0]&31};switch(ee.nalUnitTypeCode){case 5:ee.nalUnitType="slice_layer_without_partitioning_rbsp_idr";break;case 6:ee.nalUnitType="sei_rbsp",ee.escapedRBSP=M(ie.subarray(1));break;case 7:ee.nalUnitType="seq_parameter_set_rbsp",ee.escapedRBSP=M(ie.subarray(1)),ee.config=W(ee.escapedRBSP);break;case 8:ee.nalUnitType="pic_parameter_set_rbsp";break;case 9:ee.nalUnitType="access_unit_delimiter_rbsp";break}x.trigger("data",ee)}),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()},Y=function(ee,ae){var ge=8,xe=8,Ie,Se;for(Ie=0;Ie<ee;Ie++)xe!==0&&(Se=ae.readExpGolomb(),xe=(ge+Se+256)%256),ge=xe===0?ge:xe},M=function(ee){for(var ae=ee.byteLength,ge=[],xe=1,Ie,Se;xe<ae-2;)ee[xe]===0&&ee[xe+1]===0&&ee[xe+2]===3?(ge.push(xe+2),xe+=2):xe++;if(ge.length===0)return ee;Ie=ae-ge.length,Se=new Uint8Array(Ie);var Ve=0;for(xe=0;xe<Ie;Ve++,xe++)Ve===ge[0]&&(Ve++,ge.shift()),Se[xe]=ee[Ve];return Se},W=function(ee){var ae=0,ge=0,xe=0,Ie=0,Se,Ve,It,ni,Vi,Ho,Vo,zo,Au,Wo,Go,Pt=[1,1],Iu,_r;if(Se=new ld(ee),Ve=Se.readUnsignedByte(),ni=Se.readUnsignedByte(),It=Se.readUnsignedByte(),Se.skipUnsignedExpGolomb(),Ii[Ve]&&(Vi=Se.readUnsignedExpGolomb(),Vi===3&&Se.skipBits(1),Se.skipUnsignedExpGolomb(),Se.skipUnsignedExpGolomb(),Se.skipBits(1),Se.readBoolean()))for(Go=Vi!==3?8:12,_r=0;_r<Go;_r++)Se.readBoolean()&&(_r<6?Y(16,Se):Y(64,Se));if(Se.skipUnsignedExpGolomb(),Ho=Se.readUnsignedExpGolomb(),Ho===0)Se.readUnsignedExpGolomb();else if(Ho===1)for(Se.skipBits(1),Se.skipExpGolomb(),Se.skipExpGolomb(),Vo=Se.readUnsignedExpGolomb(),_r=0;_r<Vo;_r++)Se.skipExpGolomb();if(Se.skipUnsignedExpGolomb(),Se.skipBits(1),zo=Se.readUnsignedExpGolomb(),Au=Se.readUnsignedExpGolomb(),Wo=Se.readBits(1),Wo===0&&Se.skipBits(1),Se.skipBits(1),Se.readBoolean()&&(ae=Se.readUnsignedExpGolomb(),ge=Se.readUnsignedExpGolomb(),xe=Se.readUnsignedExpGolomb(),Ie=Se.readUnsignedExpGolomb()),Se.readBoolean()&&Se.readBoolean()){switch(Iu=Se.readUnsignedByte(),Iu){case 1:Pt=[1,1];break;case 2:Pt=[12,11];break;case 3:Pt=[10,11];break;case 4:Pt=[16,11];break;case 5:Pt=[40,33];break;case 6:Pt=[24,11];break;case 7:Pt=[20,11];break;case 8:Pt=[32,11];break;case 9:Pt=[80,33];break;case 10:Pt=[18,11];break;case 11:Pt=[15,11];break;case 12:Pt=[64,33];break;case 13:Pt=[160,99];break;case 14:Pt=[4,3];break;case 15:Pt=[3,2];break;case 16:Pt=[2,1];break;case 255:{Pt=[Se.readUnsignedByte()<<8|Se.readUnsignedByte(),Se.readUnsignedByte()<<8|Se.readUnsignedByte()];break}}Pt&&Pt[0]/Pt[1]}return{profileIdc:Ve,levelIdc:It,profileCompatibility:ni,width:(zo+1)*16-ae*2-ge*2,height:(2-Wo)*(Au+1)*16-xe*2-Ie*2,sarRatio:Pt}}},Nn.prototype=new e;var ud={H264Stream:Nn},oa=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350],On=function(m,x){var T=m[x+6]<<21|m[x+7]<<14|m[x+8]<<7|m[x+9],E=m[x+5],D=(E&16)>>4;return T=T>=0?T:0,D?T+20:T+10},la=function q(m,x){return m.length-x<10||m[x]!==73||m[x+1]!==68||m[x+2]!==51?x:(x+=On(m,x),q(m,x))},Rn=function(m){var x=la(m,0);return m.length>=x+2&&(m[x]&255)===255&&(m[x+1]&240)===240&&(m[x+1]&22)===16},ua=function(m){return m[0]<<21|m[1]<<14|m[2]<<7|m[3]},cu=function(m,x,T){var E,D="";for(E=x;E<T;E++)D+="%"+("00"+m[E].toString(16)).slice(-2);return D},Uo=function(m,x,T){return unescape(cu(m,x,T))},cd=function(m,x){var T=(m[x+5]&224)>>5,E=m[x+4]<<3,D=m[x+3]&6144;return D|E|T},hd=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},dd=function(m){for(var x=0;x+5<m.length;){if(m[x]!==255||(m[x+1]&246)!==240){x++;continue}return oa[(m[x+2]&60)>>>2]}return null},ca=function(m){var x,T,E,D;x=10,m[5]&64&&(x+=4,x+=ua(m.subarray(10,14)));do{if(T=ua(m.subarray(x+4,x+8)),T<1)return null;if(D=String.fromCharCode(m[x],m[x+1],m[x+2],m[x+3]),D==="PRIV"){E=m.subarray(x+10,x+T+10);for(var M=0;M<E.byteLength;M++)if(E[M]===0){var W=Uo(E,0,M);if(W==="com.apple.streaming.transportStreamTimestamp"){var Y=E.subarray(M+1),ie=(Y[3]&1)<<30|Y[4]<<22|Y[5]<<14|Y[6]<<6|Y[7]>>>2;return ie*=4,ie+=Y[7]&3,ie}break}}x+=10,x+=T}while(x<m.byteLength);return null},hs={isLikelyAacData:Rn,parseId3TagSize:On,parseAdtsSize:cd,parseType:hd,parseSampleRate:dd,parseAacTimestamp:ca},ha;ha=function(){var m=new Uint8Array,x=0;ha.prototype.init.call(this),this.setTimestamp=function(T){x=T},this.push=function(T){var E=0,D=0,M,W,Y,ie;for(m.length?(ie=m.length,m=new Uint8Array(T.byteLength+ie),m.set(m.subarray(0,ie)),m.set(T,ie)):m=T;m.length-D>=3;){if(m[D]===73&&m[D+1]===68&&m[D+2]===51){if(m.length-D<10||(E=hs.parseId3TagSize(m,D),D+E>m.length))break;W={type:"timed-metadata",data:m.subarray(D,D+E)},this.trigger("data",W),D+=E;continue}else if((m[D]&255)===255&&(m[D+1]&240)===240){if(m.length-D<7||(E=hs.parseAdtsSize(m,D),D+E>m.length))break;Y={type:"audio",data:m.subarray(D,D+E),pts:x,dts:x},this.trigger("data",Y),D+=E;continue}D++}M=m.length-D,M>0?m=m.subarray(D):m=new Uint8Array},this.reset=function(){m=new Uint8Array,this.trigger("reset")},this.endTimeline=function(){m=new Uint8Array,this.trigger("endedtimeline")}},ha.prototype=new e;var hu=ha,fd=["audioobjecttype","channelcount","samplerate","samplingfrequencyindex","samplesize"],jo=fd,pd=["width","height","profileIdc","levelIdc","profileCompatibility","sarRatio"],ds=pd,da=ud.H264Stream,du=hs.isLikelyAacData,md=Ye.ONE_SECOND_IN_TS,fa,Mn,fs,hn,fu=function(m,x){x.stream=m,this.trigger("log",x)},pu=function(m,x){for(var T=Object.keys(x),E=0;E<T.length;E++){var D=T[E];D==="headOfPipeline"||!x[D].on||x[D].on("log",fu.bind(m,D))}},mu=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},gu=function(m,x,T,E,D,M){var W=T-x,Y=E-x,ie=D-T;return{start:{dts:m,pts:m+W},end:{dts:m+Y,pts:m+ie},prependedContentDuration:M,baseMediaDecodeTime:m}};Mn=function(m,x){var T=[],E,D=0,M=0,W=1/0;x=x||{},E=x.firstSequenceNumber||0,Mn.prototype.init.call(this),this.push=function(Y){V.collectDtsInfo(m,Y),m&&jo.forEach(function(ie){m[ie]=Y[ie]}),T.push(Y)},this.setEarliestDts=function(Y){D=Y},this.setVideoBaseMediaDecodeTime=function(Y){W=Y},this.setAudioAppendStart=function(Y){M=Y},this.flush=function(){var Y,ie,ee,ae,ge,xe,Ie;if(T.length===0){this.trigger("done","AudioSegmentStream");return}Y=ji.trimAdtsFramesByEarliestDts(T,m,D),m.baseMediaDecodeTime=V.calculateTrackBaseMediaDecodeTime(m,x.keepOriginalTimestamps),Ie=ji.prefixWithSilence(m,Y,M,W),m.samples=ji.generateSampleTable(Y),ee=Xe.mdat(ji.concatenateFrameData(Y)),T=[],ie=Xe.moof(E,[m]),ae=new Uint8Array(ie.byteLength+ee.byteLength),E++,ae.set(ie),ae.set(ee,ie.byteLength),V.clearDtsInfo(m),ge=Math.ceil(md*1024/m.samplerate),Y.length&&(xe=Y.length*ge,this.trigger("segmentTimingInfo",gu(Ye.audioTsToVideoTs(m.baseMediaDecodeTime,m.samplerate),Y[0].dts,Y[0].pts,Y[0].dts+xe,Y[0].pts+xe,Ie||0)),this.trigger("timingInfo",{start:Y[0].pts,end:Y[0].pts+xe})),this.trigger("data",{track:m,boxes:ae}),this.trigger("done","AudioSegmentStream")},this.reset=function(){V.clearDtsInfo(m),T=[],this.trigger("reset")}},Mn.prototype=new e,fa=function(m,x){var T,E=[],D=[],M,W;x=x||{},T=x.firstSequenceNumber||0,fa.prototype.init.call(this),delete m.minPTS,this.gopCache_=[],this.push=function(Y){V.collectDtsInfo(m,Y),Y.nalUnitType==="seq_parameter_set_rbsp"&&!M&&(M=Y.config,m.sps=[Y.data],ds.forEach(function(ie){m[ie]=M[ie]},this)),Y.nalUnitType==="pic_parameter_set_rbsp"&&!W&&(W=Y.data,m.pps=[Y.data]),E.push(Y)},this.flush=function(){for(var Y,ie,ee,ae,ge,xe,Ie=0,Se,Ve;E.length&&E[0].nalUnitType!=="access_unit_delimiter_rbsp";)E.shift();if(E.length===0){this.resetStream_(),this.trigger("done","VideoSegmentStream");return}if(Y=Te.groupNalsIntoFrames(E),ee=Te.groupFramesIntoGops(Y),ee[0][0].keyFrame||(ie=this.getGopForFusion_(E[0],m),ie?(Ie=ie.duration,ee.unshift(ie),ee.byteLength+=ie.byteLength,ee.nalCount+=ie.nalCount,ee.pts=ie.pts,ee.dts=ie.dts,ee.duration+=ie.duration):ee=Te.extendFirstKeyFrame(ee)),D.length){var It;if(x.alignGopsAtEnd?It=this.alignGopsAtEnd_(ee):It=this.alignGopsAtStart_(ee),!It){this.gopCache_.unshift({gop:ee.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),ee=It}V.collectDtsInfo(m,ee),m.samples=Te.generateSampleTable(ee),ge=Xe.mdat(Te.concatenateNalData(ee)),m.baseMediaDecodeTime=V.calculateTrackBaseMediaDecodeTime(m,x.keepOriginalTimestamps),this.trigger("processedGopsInfo",ee.map(function(ni){return{pts:ni.pts,dts:ni.dts,byteLength:ni.byteLength}})),Se=ee[0],Ve=ee[ee.length-1],this.trigger("segmentTimingInfo",gu(m.baseMediaDecodeTime,Se.dts,Se.pts,Ve.dts+Ve.duration,Ve.pts+Ve.duration,Ie)),this.trigger("timingInfo",{start:ee[0].pts,end:ee[ee.length-1].pts+ee[ee.length-1].duration}),this.gopCache_.unshift({gop:ee.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),ae=Xe.moof(T,[m]),xe=new Uint8Array(ae.byteLength+ge.byteLength),T++,xe.set(ae),xe.set(ge,ae.byteLength),this.trigger("data",{track:m,boxes:xe}),this.resetStream_(),this.trigger("done","VideoSegmentStream")},this.reset=function(){this.resetStream_(),E=[],this.gopCache_.length=0,D.length=0,this.trigger("reset")},this.resetStream_=function(){V.clearDtsInfo(m),M=void 0,W=void 0},this.getGopForFusion_=function(Y){var ie=45e3,ee=1/0,ae,ge,xe,Ie,Se;for(Se=0;Se<this.gopCache_.length;Se++)Ie=this.gopCache_[Se],xe=Ie.gop,!(!(m.pps&&mu(m.pps[0],Ie.pps[0]))||!(m.sps&&mu(m.sps[0],Ie.sps[0])))&&(xe.dts<m.timelineStartInfo.dts||(ae=Y.dts-xe.dts-xe.duration,ae>=-1e4&&ae<=ie&&(!ge||ee>ae)&&(ge=Ie,ee=ae)));return ge?ge.gop:null},this.alignGopsAtStart_=function(Y){var ie,ee,ae,ge,xe,Ie,Se,Ve;for(xe=Y.byteLength,Ie=Y.nalCount,Se=Y.duration,ie=ee=0;ie<D.length&&ee<Y.length&&(ae=D[ie],ge=Y[ee],ae.pts!==ge.pts);){if(ge.pts>ae.pts){ie++;continue}ee++,xe-=ge.byteLength,Ie-=ge.nalCount,Se-=ge.duration}return ee===0?Y:ee===Y.length?null:(Ve=Y.slice(ee),Ve.byteLength=xe,Ve.duration=Se,Ve.nalCount=Ie,Ve.pts=Ve[0].pts,Ve.dts=Ve[0].dts,Ve)},this.alignGopsAtEnd_=function(Y){var ie,ee,ae,ge,xe,Ie;for(ie=D.length-1,ee=Y.length-1,xe=null,Ie=!1;ie>=0&&ee>=0;){if(ae=D[ie],ge=Y[ee],ae.pts===ge.pts){Ie=!0;break}if(ae.pts>ge.pts){ie--;continue}ie===D.length-1&&(xe=ee),ee--}if(!Ie&&xe===null)return null;var Se;if(Ie?Se=ee:Se=xe,Se===0)return Y;var Ve=Y.slice(Se),It=Ve.reduce(function(ni,Vi){return ni.byteLength+=Vi.byteLength,ni.duration+=Vi.duration,ni.nalCount+=Vi.nalCount,ni},{byteLength:0,duration:0,nalCount:0});return Ve.byteLength=It.byteLength,Ve.duration=It.duration,Ve.nalCount=It.nalCount,Ve.pts=Ve[0].pts,Ve.dts=Ve[0].dts,Ve},this.alignGopsWith=function(Y){D=Y}},fa.prototype=new e,hn=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,hn.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))}},hn.prototype=new e,hn.prototype.flush=function(q){var m=0,x={captions:[],captionStreams:{},metadata:[],info:{}},T,E,D,M=0,W;if(this.pendingTracks.length<this.numberOfTracks){if(q!=="VideoSegmentStream"&&q!=="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,ds.forEach(function(Y){x.info[Y]=this.videoTrack[Y]},this)):this.audioTrack&&(M=this.audioTrack.timelineStartInfo.pts,jo.forEach(function(Y){x.info[Y]=this.audioTrack[Y]},this)),this.videoTrack||this.audioTrack){for(this.pendingTracks.length===1?x.type=this.pendingTracks[0].type:x.type="combined",this.emittedTracks+=this.pendingTracks.length,D=Xe.initSegment(this.pendingTracks),x.initSegment=new Uint8Array(D.byteLength),x.initSegment.set(D),x.data=new Uint8Array(this.pendingBytes),W=0;W<this.pendingBoxes.length;W++)x.data.set(this.pendingBoxes[W],m),m+=this.pendingBoxes[W].byteLength;for(W=0;W<this.pendingCaptions.length;W++)T=this.pendingCaptions[W],T.startTime=Ye.metadataTsToSeconds(T.startPts,M,this.keepOriginalTimestamps),T.endTime=Ye.metadataTsToSeconds(T.endPts,M,this.keepOriginalTimestamps),x.captionStreams[T.stream]=!0,x.captions.push(T);for(W=0;W<this.pendingMetadata.length;W++)E=this.pendingMetadata[W],E.cueTime=Ye.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),W=0;W<x.captions.length;W++)T=x.captions[W],this.trigger("caption",T);for(W=0;W<x.metadata.length;W++)E=x.metadata[W],this.trigger("id3Frame",E)}this.emittedTracks>=this.numberOfTracks&&(this.trigger("done"),this.emittedTracks=0)},hn.prototype.setRemux=function(q){this.remuxTracks=q},fs=function(m){var x=this,T=!0,E,D;fs.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 gr.MetadataStream,M.aacStream=new hu,M.audioTimestampRolloverStream=new gr.TimestampRolloverStream("audio"),M.timedMetadataTimestampRolloverStream=new gr.TimestampRolloverStream("timed-metadata"),M.adtsStream=new vr,M.coalesceStream=new hn(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(W){M.aacStream.setTimestamp(W.timeStamp)}),M.aacStream.on("data",function(W){W.type!=="timed-metadata"&&W.type!=="audio"||M.audioSegmentStream||(D=D||{timelineStartInfo:{baseMediaDecodeTime:x.baseMediaDecodeTime},codec:"adts",type:"audio"},M.coalesceStream.numberOfTracks++,M.audioSegmentStream=new Mn(D,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:!!D,hasVideo:!!E}))}),M.coalesceStream.on("data",this.trigger.bind(this,"data")),M.coalesceStream.on("done",this.trigger.bind(this,"done")),pu(this,M)},this.setupTsPipeline=function(){var M={};this.transmuxPipeline_=M,M.type="ts",M.metadataStream=new gr.MetadataStream,M.packetStream=new gr.TransportPacketStream,M.parseStream=new gr.TransportParseStream,M.elementaryStream=new gr.ElementaryStream,M.timestampRolloverStream=new gr.TimestampRolloverStream,M.adtsStream=new vr,M.h264Stream=new da,M.captionStream=new gr.CaptionStream(m),M.coalesceStream=new hn(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(W){var Y;if(W.type==="metadata"){for(Y=W.tracks.length;Y--;)!E&&W.tracks[Y].type==="video"?(E=W.tracks[Y],E.timelineStartInfo.baseMediaDecodeTime=x.baseMediaDecodeTime):!D&&W.tracks[Y].type==="audio"&&(D=W.tracks[Y],D.timelineStartInfo.baseMediaDecodeTime=x.baseMediaDecodeTime);E&&!M.videoSegmentStream&&(M.coalesceStream.numberOfTracks++,M.videoSegmentStream=new fa(E,m),M.videoSegmentStream.on("log",x.getLogTrigger_("videoSegmentStream")),M.videoSegmentStream.on("timelineStartInfo",function(ie){D&&!m.keepOriginalTimestamps&&(D.timelineStartInfo=ie,M.audioSegmentStream.setEarliestDts(ie.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(ie){D&&M.audioSegmentStream.setVideoBaseMediaDecodeTime(ie)}),M.videoSegmentStream.on("timingInfo",x.trigger.bind(x,"videoTimingInfo")),M.h264Stream.pipe(M.videoSegmentStream).pipe(M.coalesceStream)),D&&!M.audioSegmentStream&&(M.coalesceStream.numberOfTracks++,M.audioSegmentStream=new Mn(D,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:!!D,hasVideo:!!E})}}),M.coalesceStream.on("data",this.trigger.bind(this,"data")),M.coalesceStream.on("id3Frame",function(W){W.dispatchType=M.metadataStream.dispatchType,x.trigger("id3Frame",W)}),M.coalesceStream.on("caption",this.trigger.bind(this,"caption")),M.coalesceStream.on("done",this.trigger.bind(this,"done")),pu(this,M)},this.setBaseMediaDecodeTime=function(M){var W=this.transmuxPipeline_;m.keepOriginalTimestamps||(this.baseMediaDecodeTime=M),D&&(D.timelineStartInfo.dts=void 0,D.timelineStartInfo.pts=void 0,V.clearDtsInfo(D),W.audioTimestampRolloverStream&&W.audioTimestampRolloverStream.discontinuity()),E&&(W.videoSegmentStream&&(W.videoSegmentStream.gopCache_=[]),E.timelineStartInfo.dts=void 0,E.timelineStartInfo.pts=void 0,V.clearDtsInfo(E),W.captionStream.reset()),W.timestampRolloverStream&&W.timestampRolloverStream.discontinuity()},this.setAudioAppendStart=function(M){D&&this.transmuxPipeline_.audioSegmentStream.setAudioAppendStart(M)},this.setRemux=function(M){var W=this.transmuxPipeline_;m.remux=M,W&&W.coalesceStream&&W.coalesceStream.setRemux(M)},this.alignGopsWith=function(M){E&&this.transmuxPipeline_.videoSegmentStream&&this.transmuxPipeline_.videoSegmentStream.alignGopsWith(M)},this.getLogTrigger_=function(M){var W=this;return function(Y){Y.stream=M,W.trigger("log",Y)}},this.push=function(M){if(T){var W=du(M);W&&this.transmuxPipeline_.type!=="aac"?this.setupAacPipeline():!W&&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()}},fs.prototype=new e;var gd={Transmuxer:fs},vd=function(m){return m>>>0},yd=function(m){return("00"+m.toString(16)).slice(-2)},Fn={toUnsigned:vd,toHexString:yd},_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},Nr=_d,pa=Fn.toUnsigned,Td=function q(m,x){var T=[],E,D,M,W,Y;if(!x.length)return null;for(E=0;E<m.byteLength;)D=pa(m[E]<<24|m[E+1]<<16|m[E+2]<<8|m[E+3]),M=Nr(m.subarray(E+4,E+8)),W=D>1?E+D:m.byteLength,M===x[0]&&(x.length===1?T.push(m.subarray(E+8,W)):(Y=q(m.subarray(E+8,W),x.slice(1)),Y.length&&(T=T.concat(Y)))),E=W;return T},dt=Td,bd=Fn.toUnsigned,Sd=r.getUint64,xd=function(m){var x={version:m[0],flags:new Uint8Array(m.subarray(1,4))};return x.version===1?x.baseMediaDecodeTime=Sd(m.subarray(4)):x.baseMediaDecodeTime=bd(m[4]<<24|m[5]<<16|m[6]<<8|m[7]),x},ps=xd,ms=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]}},Bn=ms,ma=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,D=x.flags[2]&4,M=x.flags[1]&1,W=x.flags[1]&2,Y=x.flags[1]&4,ie=x.flags[1]&8,ee=T.getUint32(4),ae=8,ge;for(E&&(x.dataOffset=T.getInt32(ae),ae+=4),D&&ee&&(ge={flags:Bn(m.subarray(ae,ae+4))},ae+=4,M&&(ge.duration=T.getUint32(ae),ae+=4),W&&(ge.size=T.getUint32(ae),ae+=4),ie&&(x.version===1?ge.compositionTimeOffset=T.getInt32(ae):ge.compositionTimeOffset=T.getUint32(ae),ae+=4),x.samples.push(ge),ee--);ee--;)ge={},M&&(ge.duration=T.getUint32(ae),ae+=4),W&&(ge.size=T.getUint32(ae),ae+=4),Y&&(ge.flags=Bn(m.subarray(ae,ae+4)),ae+=4),ie&&(x.version===1?ge.compositionTimeOffset=T.getInt32(ae):ge.compositionTimeOffset=T.getUint32(ae),ae+=4),x.samples.push(ge);return x},Pi=ma,yr=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,D=T.flags[2]&2,M=T.flags[2]&8,W=T.flags[2]&16,Y=T.flags[2]&32,ie=T.flags[0]&65536,ee=T.flags[0]&131072,ae;return ae=8,E&&(ae+=4,T.baseDataOffset=x.getUint32(12),ae+=4),D&&(T.sampleDescriptionIndex=x.getUint32(ae),ae+=4),M&&(T.defaultSampleDuration=x.getUint32(ae),ae+=4),W&&(T.defaultSampleSize=x.getUint32(ae),ae+=4),Y&&(T.defaultSampleFlags=x.getUint32(ae)),ie&&(T.durationIsEmpty=!0),!E&&ee&&(T.baseDataOffsetIsMoof=!0),T},gs=yr,$o=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},vs;typeof window<"u"?vs=window:typeof $o<"u"?vs=$o:typeof self<"u"?vs=self:vs={};var ys=vs,Cd=ii.discardEmulationPreventionBytes,Ed=an.CaptionStream,vu=function(m,x){for(var T=m,E=0;E<x.length;E++){var D=x[E];if(T<D.size)return D;T-=D.size}return null},yu=function(m,x,T){var E=new DataView(m.buffer,m.byteOffset,m.byteLength),D={logs:[],seiNals:[]},M,W,Y,ie;for(W=0;W+4<m.length;W+=Y)if(Y=E.getUint32(W),W+=4,!(Y<=0))switch(m[W]&31){case 6:var ee=m.subarray(W+1,W+1+Y),ae=vu(W,x);if(M={nalUnitType:"sei_rbsp",size:Y,data:ee,escapedRBSP:Cd(ee),trackId:T},ae)M.pts=ae.pts,M.dts=ae.dts,ie=ae;else if(ie)M.pts=ie.pts,M.dts=ie.dts;else{D.logs.push({level:"warn",message:"We've encountered a nal unit without data at "+W+" for trackId "+T+". See mux.js#223."});break}D.seiNals.push(M);break}return D},ga=function(m,x,T){var E=x,D=T.defaultSampleDuration||0,M=T.defaultSampleSize||0,W=T.trackId,Y=[];return m.forEach(function(ie){var ee=Pi(ie),ae=ee.samples;ae.forEach(function(ge){ge.duration===void 0&&(ge.duration=D),ge.size===void 0&&(ge.size=M),ge.trackId=W,ge.dts=E,ge.compositionTimeOffset===void 0&&(ge.compositionTimeOffset=0),typeof E=="bigint"?(ge.pts=E+ys.BigInt(ge.compositionTimeOffset),E+=ys.BigInt(ge.duration)):(ge.pts=E+ge.compositionTimeOffset,E+=ge.duration)}),Y=Y.concat(ae)}),Y},_s=function(m,x){var T=dt(m,["moof","traf"]),E=dt(m,["mdat"]),D={},M=[];return E.forEach(function(W,Y){var ie=T[Y];M.push({mdat:W,traf:ie})}),M.forEach(function(W){var Y=W.mdat,ie=W.traf,ee=dt(ie,["tfhd"]),ae=gs(ee[0]),ge=ae.trackId,xe=dt(ie,["tfdt"]),Ie=xe.length>0?ps(xe[0]).baseMediaDecodeTime:0,Se=dt(ie,["trun"]),Ve,It;x===ge&&Se.length>0&&(Ve=ga(Se,Ie,ae),It=yu(Y,Ve,ge),D[ge]||(D[ge]={seiNals:[],logs:[]}),D[ge].seiNals=D[ge].seiNals.concat(It.seiNals),D[ge].logs=D[ge].logs.concat(It.logs))}),D},va=function(m,x,T){var E;if(x===null)return null;E=_s(m,x);var D=E[x]||{};return{seiNals:D.seiNals,logs:D.logs,timescale:T}},dn=function(){var m=!1,x,T,E,D,M,W;this.isInitialized=function(){return m},this.init=function(Y){x=new Ed,m=!0,W=Y?Y.isPartial:!1,x.on("data",function(ie){ie.startTime=ie.startPts/D,ie.endTime=ie.endPts/D,M.captions.push(ie),M.captionStreams[ie.stream]=!0}),x.on("log",function(ie){M.logs.push(ie)})},this.isNewInit=function(Y,ie){return Y&&Y.length===0||ie&&typeof ie=="object"&&Object.keys(ie).length===0?!1:E!==Y[0]||D!==ie[E]},this.parse=function(Y,ie,ee){var ae;if(this.isInitialized()){if(!ie||!ee)return null;if(this.isNewInit(ie,ee))E=ie[0],D=ee[E];else if(E===null||!D)return T.push(Y),null}else return null;for(;T.length>0;){var ge=T.shift();this.parse(ge,ie,ee)}return ae=va(Y,E,D),ae&&ae.logs&&(M.logs=M.logs.concat(ae.logs)),ae===null||!ae.seiNals?M.logs.length?{logs:M.logs,captions:[],captionStreams:[]}:null:(this.pushNals(ae.seiNals),this.flushStream(),M)},this.pushNals=function(Y){if(!this.isInitialized()||!Y||Y.length===0)return null;Y.forEach(function(ie){x.push(ie)})},this.flushStream=function(){if(!this.isInitialized())return null;W?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,D=null,M?this.clearParsedCaptions():M={captions:[],captionStreams:{},logs:[]},this.resetCaptionStream()},this.reset()},wd=dn,Ts=Fn.toUnsigned,Un=Fn.toHexString,_u=r.getUint64,Tu,bu,Su,bs,xu,ya;Tu=function(m){var x={},T=dt(m,["moov","trak"]);return T.reduce(function(E,D){var M,W,Y,ie,ee;return M=dt(D,["tkhd"])[0],!M||(W=M[0],Y=W===0?12:20,ie=Ts(M[Y]<<24|M[Y+1]<<16|M[Y+2]<<8|M[Y+3]),ee=dt(D,["mdia","mdhd"])[0],!ee)?null:(W=ee[0],Y=W===0?12:20,E[ie]=Ts(ee[Y]<<24|ee[Y+1]<<16|ee[Y+2]<<8|ee[Y+3]),E)},x)},bu=function(m,x){var T;T=dt(x,["moof","traf"]);var E=T.reduce(function(D,M){var W=dt(M,["tfhd"])[0],Y=Ts(W[4]<<24|W[5]<<16|W[6]<<8|W[7]),ie=m[Y]||9e4,ee=dt(M,["tfdt"])[0],ae=new DataView(ee.buffer,ee.byteOffset,ee.byteLength),ge;ee[0]===1?ge=_u(ee.subarray(4,12)):ge=ae.getUint32(4);var xe;return typeof ge=="bigint"?xe=ge/ys.BigInt(ie):typeof ge=="number"&&!isNaN(ge)&&(xe=ge/ie),xe<Number.MAX_SAFE_INTEGER&&(xe=Number(xe)),xe<D&&(D=xe),D},1/0);return typeof E=="bigint"||isFinite(E)?E:0},Su=function(m,x){var T=dt(x,["moof","traf"]),E=0,D=0,M;if(T&&T.length){var W=dt(T[0],["tfhd"])[0],Y=dt(T[0],["trun"])[0],ie=dt(T[0],["tfdt"])[0];if(W){var ee=gs(W);M=ee.trackId}if(ie){var ae=ps(ie);E=ae.baseMediaDecodeTime}if(Y){var ge=Pi(Y);ge.samples&&ge.samples.length&&(D=ge.samples[0].compositionTimeOffset||0)}}var xe=m[M]||9e4;typeof E=="bigint"&&(D=ys.BigInt(D),xe=ys.BigInt(xe));var Ie=(E+D)/xe;return typeof Ie=="bigint"&&Ie<Number.MAX_SAFE_INTEGER&&(Ie=Number(Ie)),Ie},bs=function(m){var x=dt(m,["moov","trak"]),T=[];return x.forEach(function(E){var D=dt(E,["mdia","hdlr"]),M=dt(E,["tkhd"]);D.forEach(function(W,Y){var ie=Nr(W.subarray(8,12)),ee=M[Y],ae,ge,xe;ie==="vide"&&(ae=new DataView(ee.buffer,ee.byteOffset,ee.byteLength),ge=ae.getUint8(0),xe=ge===0?ae.getUint32(12):ae.getUint32(20),T.push(xe))})}),T},ya=function(m){var x=m[0],T=x===0?12:20;return Ts(m[T]<<24|m[T+1]<<16|m[T+2]<<8|m[T+3])},xu=function(m){var x=dt(m,["moov","trak"]),T=[];return x.forEach(function(E){var D={},M=dt(E,["tkhd"])[0],W,Y;M&&(W=new DataView(M.buffer,M.byteOffset,M.byteLength),Y=W.getUint8(0),D.id=Y===0?W.getUint32(12):W.getUint32(20));var ie=dt(E,["mdia","hdlr"])[0];if(ie){var ee=Nr(ie.subarray(8,12));ee==="vide"?D.type="video":ee==="soun"?D.type="audio":D.type=ee}var ae=dt(E,["mdia","minf","stbl","stsd"])[0];if(ae){var ge=ae.subarray(8);D.codec=Nr(ge.subarray(4,8));var xe=dt(ge,[D.codec])[0],Ie,Se;xe&&(/^[asm]vc[1-9]$/i.test(D.codec)?(Ie=xe.subarray(78),Se=Nr(Ie.subarray(4,8)),Se==="avcC"&&Ie.length>11?(D.codec+=".",D.codec+=Un(Ie[9]),D.codec+=Un(Ie[10]),D.codec+=Un(Ie[11])):D.codec="avc1.4d400d"):/^mp4[a,v]$/i.test(D.codec)?(Ie=xe.subarray(28),Se=Nr(Ie.subarray(4,8)),Se==="esds"&&Ie.length>20&&Ie[19]!==0?(D.codec+="."+Un(Ie[19]),D.codec+="."+Un(Ie[20]>>>2&63).replace(/^0/,"")):D.codec="mp4a.40.2"):D.codec=D.codec.toLowerCase())}var Ve=dt(E,["mdia","mdhd"])[0];Ve&&(D.timescale=ya(Ve)),T.push(D)}),T};var Cu={findBox:dt,parseType:Nr,timescale:Tu,startTime:bu,compositionStartTime:Su,videoTrackIds:bs,tracks:xu,getTimescaleFromMediaHeader:ya},Eu=function(m){var x=m[1]&31;return x<<=8,x|=m[2],x},Ss=function(m){return!!(m[1]&64)},jn=function(m){var x=0;return(m[3]&48)>>>4>1&&(x+=m[4]+1),x},kd=function(m,x){var T=Eu(m);return T===0?"pat":T===x?"pmt":x?"pes":null},Ad=function(m){var x=Ss(m),T=4+jn(m);return x&&(T+=m[T]+1),(m[T+10]&31)<<8|m[T+11]},Id=function(m){var x={},T=Ss(m),E=4+jn(m);if(T&&(E+=m[E]+1),!!(m[E+5]&1)){var D,M,W;D=(m[E+1]&15)<<8|m[E+2],M=3+D-4,W=(m[E+10]&15)<<8|m[E+11];for(var Y=12+W;Y<M;){var ie=E+Y;x[(m[ie+1]&31)<<8|m[ie+2]]=m[ie],Y+=((m[ie+3]&15)<<8|m[ie+4])+5}return x}},qo=function(m,x){var T=Eu(m),E=x[T];switch(E){case Rt.H264_STREAM_TYPE:return"video";case Rt.ADTS_STREAM_TYPE:return"audio";case Rt.METADATA_STREAM_TYPE:return"timed-metadata";default:return null}},Pd=function(m){var x=Ss(m);if(!x)return null;var T=4+jn(m);if(T>=m.byteLength)return null;var E=null,D;return D=m[T+7],D&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,D&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},_a=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}},Dd=function(m){for(var x=4+jn(m),T=m.subarray(x),E=0,D=0,M=!1,W;D<T.byteLength-3;D++)if(T[D+2]===1){E=D+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}D+3!==E-2&&(W=_a(T[D+3]&31),W==="slice_layer_without_partitioning_rbsp_idr"&&(M=!0));do E++;while(T[E]!==1&&E<T.length);D=E-2,E+=3;break;case 1:if(T[E-1]!==0||T[E-2]!==0){E+=3;break}W=_a(T[D+3]&31),W==="slice_layer_without_partitioning_rbsp_idr"&&(M=!0),D=E-2,E+=3;break;default:E+=3;break}return T=T.subarray(D),E-=D,D=0,T&&T.byteLength>3&&(W=_a(T[D+3]&31),W==="slice_layer_without_partitioning_rbsp_idr"&&(M=!0)),M},Nd={parseType:kd,parsePat:Ad,parsePmt:Id,parsePayloadUnitStartIndicator:Ss,parsePesType:qo,parsePesTime:Pd,videoPacketContainsKeyFrame:Dd},fn=su.handleRollover,nt={};nt.ts=Nd,nt.aac=hs;var Lr=Ye.ONE_SECOND_IN_TS,Kt=188,Hi=71,Ld=function(m,x){for(var T=0,E=Kt,D,M;E<m.byteLength;){if(m[T]===Hi&&m[E]===Hi){switch(D=m.subarray(T,E),M=nt.ts.parseType(D,x.pid),M){case"pat":x.pid=nt.ts.parsePat(D);break;case"pmt":var W=nt.ts.parsePmt(D);x.table=x.table||{},Object.keys(W).forEach(function(Y){x.table[Y]=W[Y]});break}T+=Kt,E+=Kt;continue}T++,E++}},wu=function(m,x,T){for(var E=0,D=Kt,M,W,Y,ie,ee,ae=!1;D<=m.byteLength;){if(m[E]===Hi&&(m[D]===Hi||D===m.byteLength)){switch(M=m.subarray(E,D),W=nt.ts.parseType(M,x.pid),W){case"pes":Y=nt.ts.parsePesType(M,x.table),ie=nt.ts.parsePayloadUnitStartIndicator(M),Y==="audio"&&ie&&(ee=nt.ts.parsePesTime(M),ee&&(ee.type="audio",T.audio.push(ee),ae=!0));break}if(ae)break;E+=Kt,D+=Kt;continue}E++,D++}for(D=m.byteLength,E=D-Kt,ae=!1;E>=0;){if(m[E]===Hi&&(m[D]===Hi||D===m.byteLength)){switch(M=m.subarray(E,D),W=nt.ts.parseType(M,x.pid),W){case"pes":Y=nt.ts.parsePesType(M,x.table),ie=nt.ts.parsePayloadUnitStartIndicator(M),Y==="audio"&&ie&&(ee=nt.ts.parsePesTime(M),ee&&(ee.type="audio",T.audio.push(ee),ae=!0));break}if(ae)break;E-=Kt,D-=Kt;continue}E--,D--}},Ta=function(m,x,T){for(var E=0,D=Kt,M,W,Y,ie,ee,ae,ge,xe,Ie=!1,Se={data:[],size:0};D<m.byteLength;){if(m[E]===Hi&&m[D]===Hi){switch(M=m.subarray(E,D),W=nt.ts.parseType(M,x.pid),W){case"pes":if(Y=nt.ts.parsePesType(M,x.table),ie=nt.ts.parsePayloadUnitStartIndicator(M),Y==="video"&&(ie&&!Ie&&(ee=nt.ts.parsePesTime(M),ee&&(ee.type="video",T.video.push(ee),Ie=!0)),!T.firstKeyFrame)){if(ie&&Se.size!==0){for(ae=new Uint8Array(Se.size),ge=0;Se.data.length;)xe=Se.data.shift(),ae.set(xe,ge),ge+=xe.byteLength;if(nt.ts.videoPacketContainsKeyFrame(ae)){var Ve=nt.ts.parsePesTime(ae);Ve?(T.firstKeyFrame=Ve,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(Ie&&T.firstKeyFrame)break;E+=Kt,D+=Kt;continue}E++,D++}for(D=m.byteLength,E=D-Kt,Ie=!1;E>=0;){if(m[E]===Hi&&m[D]===Hi){switch(M=m.subarray(E,D),W=nt.ts.parseType(M,x.pid),W){case"pes":Y=nt.ts.parsePesType(M,x.table),ie=nt.ts.parsePayloadUnitStartIndicator(M),Y==="video"&&ie&&(ee=nt.ts.parsePesTime(M),ee&&(ee.type="video",T.video.push(ee),Ie=!0));break}if(Ie)break;E-=Kt,D-=Kt;continue}E--,D--}},Od=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=fn(M.dts,T),M.pts=fn(M.pts,T),M.dtsTime=M.dts/Lr,M.ptsTime=M.pts/Lr})}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=fn(M.dts,E),M.pts=fn(M.pts,E),M.dtsTime=M.dts/Lr,M.ptsTime=M.pts/Lr}),m.firstKeyFrame){var D=m.firstKeyFrame;D.dts=fn(D.dts,E),D.pts=fn(D.pts,E),D.dtsTime=D.dts/Lr,D.ptsTime=D.pts/Lr}}},Rd=function(m){for(var x=!1,T=0,E=null,D=null,M=0,W=0,Y;m.length-W>=3;){var ie=nt.aac.parseType(m,W);switch(ie){case"timed-metadata":if(m.length-W<10){x=!0;break}if(M=nt.aac.parseId3TagSize(m,W),M>m.length){x=!0;break}D===null&&(Y=m.subarray(W,W+M),D=nt.aac.parseAacTimestamp(Y)),W+=M;break;case"audio":if(m.length-W<7){x=!0;break}if(M=nt.aac.parseAdtsSize(m,W),M>m.length){x=!0;break}E===null&&(Y=m.subarray(W,W+M),E=nt.aac.parseSampleRate(Y)),T++,W+=M;break;default:W++;break}if(x)return null}if(E===null||D===null)return null;var ee=Lr/E,ae={audio:[{type:"audio",dts:D,pts:D},{type:"audio",dts:D+T*1024*ee,pts:D+T*1024*ee}]};return ae},Md=function(m){var x={pid:null,table:null},T={};Ld(m,x);for(var E in x.table)if(x.table.hasOwnProperty(E)){var D=x.table[E];switch(D){case Rt.H264_STREAM_TYPE:T.video=[],Ta(m,x,T),T.video.length===0&&delete T.video;break;case Rt.ADTS_STREAM_TYPE:T.audio=[],wu(m,x,T),T.audio.length===0&&delete T.audio;break}}return T},Fd=function(m,x){var T=nt.aac.isLikelyAacData(m),E;return T?E=Rd(m):E=Md(m),!E||!E.audio&&!E.video?null:(Od(E,x),E)},ku={inspect:Fd,parseAudioPes_:wu},Bd=function(m,x){x.on("data",function(T){var E=T.initSegment;T.initSegment={data:E.buffer,byteOffset:E.byteOffset,byteLength:E.byteLength};var D=T.data;T.data=D.buffer,m.postMessage({action:"data",segment:T,byteOffset:D.byteOffset,byteLength:D.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:Ye.videoTsToSeconds(T.start.dts),presentation:Ye.videoTsToSeconds(T.start.pts)},end:{decode:Ye.videoTsToSeconds(T.end.dts),presentation:Ye.videoTsToSeconds(T.end.pts)},baseMediaDecodeTime:Ye.videoTsToSeconds(T.baseMediaDecodeTime)};T.prependedContentDuration&&(E.prependedContentDuration=Ye.videoTsToSeconds(T.prependedContentDuration)),m.postMessage({action:"videoSegmentTimingInfo",videoSegmentTimingInfo:E})}),x.on("audioSegmentTimingInfo",function(T){var E={start:{decode:Ye.videoTsToSeconds(T.start.dts),presentation:Ye.videoTsToSeconds(T.start.pts)},end:{decode:Ye.videoTsToSeconds(T.end.dts),presentation:Ye.videoTsToSeconds(T.end.pts)},baseMediaDecodeTime:Ye.videoTsToSeconds(T.baseMediaDecodeTime)};T.prependedContentDuration&&(E.prependedContentDuration=Ye.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:Ye.videoTsToSeconds(T.start),end:Ye.videoTsToSeconds(T.end)}})}),x.on("videoTimingInfo",function(T){m.postMessage({action:"videoTimingInfo",videoTimingInfo:{start:Ye.videoTsToSeconds(T.start),end:Ye.videoTsToSeconds(T.end)}})}),x.on("log",function(T){m.postMessage({action:"log",log:T})})},$n=function(){function q(x,T){this.options=T||{},this.self=x,this.init()}var m=q.prototype;return m.init=function(){this.transmuxer&&this.transmuxer.dispose(),this.transmuxer=new gd.Transmuxer(this.options),Bd(this.self,this.transmuxer)},m.pushMp4Captions=function(T){this.captionParser||(this.captionParser=new wd,this.captionParser.init());var E=new Uint8Array(T.data,T.byteOffset,T.byteLength),D=this.captionParser.parse(E,T.trackIds,T.timescales);this.self.postMessage({action:"mp4Captions",captions:D&&D.captions||[],logs:D&&D.logs||[],data:E.buffer},[E.buffer])},m.probeMp4StartTime=function(T){var E=T.timescales,D=T.data,M=Cu.startTime(E,D);this.self.postMessage({action:"probeMp4StartTime",startTime:M,data:D},[D.buffer])},m.probeMp4Tracks=function(T){var E=T.data,D=Cu.tracks(E);this.self.postMessage({action:"probeMp4Tracks",tracks:D,data:E},[E.buffer])},m.probeTs=function(T){var E=T.data,D=T.baseStartTime,M=typeof D=="number"&&!isNaN(D)?D*Ye.ONE_SECOND_IN_TS:void 0,W=ku.inspect(E,M),Y=null;W&&(Y={hasVideo:W.video&&W.video.length===2||!1,hasAudio:W.audio&&W.audio.length===2||!1},Y.hasVideo&&(Y.videoStart=W.video[0].ptsTime),Y.hasAudio&&(Y.audioStart=W.audio[0].ptsTime)),this.self.postMessage({action:"probeTs",result:Y,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(Ye.secondsToVideoTs(E)))},m.setAudioAppendStart=function(T){this.transmuxer.setAudioAppendStart(Math.ceil(Ye.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())},q}();self.onmessage=function(q){if(q.data.action==="init"&&q.data.options){this.messageHandlers=new $n(self,q.data.options);return}this.messageHandlers||(this.messageHandlers=new $n(self)),q.data&&q.data.action&&q.data.action!=="init"&&this.messageHandlers[q.data.action]&&this.messageHandlers[q.data.action](q.data)}})),Y4=Ik(Q4),J4=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)},Z4=function(e){var t=e.transmuxedData,i=e.callback;t.buffer=[],i(t)},e8=function(e,t){t.gopInfo=e.data.gopInfo},Nk=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,I=e.isEndOfTimeline,L={buffer:[]},$=I,F=function(C){t.currentTransmux===e&&(C.data.action==="data"&&J4(C,L,o),C.data.action==="trackinfo"&&l(C.data.trackInfo),C.data.action==="gopInfo"&&e8(C,L),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,Z4({transmuxedData:L,callback:p}),Lk(t))))};if(t.onmessage=F,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 O=i instanceof ArrayBuffer?i:i.buffer,B=i instanceof ArrayBuffer?0:i.byteOffset;t.postMessage({action:"push",data:O,byteOffset:B,byteLength:i.byteLength},[O])}I&&t.postMessage({action:"endTimeline"}),t.postMessage({action:"flush"})},Lk=function(e){e.currentTransmux=null,e.transmuxQueue.length&&(e.currentTransmux=e.transmuxQueue.shift(),typeof e.currentTransmux=="function"?e.currentTransmux():Nk(e.currentTransmux))},ZT=function(e,t){e.postMessage({action:t}),Lk(e)},Ok=function(e,t){if(!t.currentTransmux){t.currentTransmux=e,ZT(t,e);return}t.transmuxQueue.push(ZT.bind(null,t,e))},t8=function(e){Ok("reset",e)},i8=function(e){Ok("endTimeline",e)},Rk=function(e){if(!e.transmuxer.currentTransmux){e.transmuxer.currentTransmux=e,Nk(e);return}e.transmuxer.transmuxQueue.push(e)},r8=function(e){var t=new Y4;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},Gf={reset:t8,endTimeline:i8,transmux:Rk,createTransmuxer:r8},ih=function(e){var t=e.transmuxer,i=e.endAction||e.action,r=e.callback,n=A._extends({},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)},Wr={FAILURE:2,TIMEOUT:-101,ABORTED:-102},Zg=function(e){e.forEach(function(t){t.abort()})},n8=function(e){return{bandwidth:e.bandwidth,bytesReceived:e.bytesReceived||0,roundTripTime:e.roundTripTime||0}},s8=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},$0=function(e,t){return t.timedout?{status:t.status,message:"HLS request timed-out at URL: "+t.uri,code:Wr.TIMEOUT,xhr:t}:t.aborted?{status:t.status,message:"HLS request aborted at URL: "+t.uri,code:Wr.ABORTED,xhr:t}:e?{status:t.status,message:"HLS request errored at URL: "+t.uri,code:Wr.FAILURE,xhr:t}:t.responseType==="arraybuffer"&&t.response.byteLength===0?{status:t.status,message:"Empty HLS response at URL: "+t.uri,code:Wr.FAILURE,xhr:t}:null},eb=function(e,t,i){return function(r,n){var a=n.response,o=$0(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:Wr.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)}},Mk=function(e,t){var i=a0(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:Wr.FAILURE})}ih({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)}})},a8=function(e){var t=e.segment,i=e.finishProcessingFn;return function(r,n){var a=$0(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,Mk(t,function(l){if(l)return l.xhr=n,l.status=n.status,i(l,t);i(null,t)})}},o8=function(e){var t=e.segment,i=e.finishProcessingFn,r=e.responseType;return function(n,a){var o=$0(n,a);if(o)return i(o,t);var l=r==="arraybuffer"||!a.responseText?a.response:K4(a.responseText.substring(t.lastReachedChar||0));return t.stats=n8(a),t.key?t.encryptedBytes=new Uint8Array(l):t.bytes=new Uint8Array(l),i(null,t)}},l8=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"),I=n.bind(null,t,"audio","end"),L=n.bind(null,t,"video","start"),$=n.bind(null,t,"video","end"),F=function(){return Rk({bytes:i,transmuxer:t.transmuxer,audioAppendStart:t.audioAppendStart,gopsToAlignWith:t.gopsToAlignWith,remux:_,onData:function(U){U.type=U.type==="combined"?"video":U.type,d(t,U)},onTrackInfo:function(U){r&&(_&&(U.isMuxed=!0),r(t,U))},onAudioTimingInfo:function(U){k&&typeof U.start<"u"&&(k(U.start),k=null),I&&typeof U.end<"u"&&I(U.end)},onVideoTimingInfo:function(U){L&&typeof U.start<"u"&&(L(U.start),L=null),$&&typeof U.end<"u"&&$(U.end)},onVideoSegmentTimingInfo:function(U){a(U)},onAudioSegmentTimingInfo:function(U){o(U)},onId3:function(U,C){l(t,U,C)},onCaptions:function(U){u(t,[U])},isEndOfTimeline:c,onEndedTimeline:function(){h()},onTransmuxerLog:y,onDone:function(U){g&&(U.type=U.type==="combined"?"video":U.type,g(null,t,U))}})};ih({action:"probeTs",transmuxer:t.transmuxer,data:i,baseStartTime:t.baseStartTime,callback:function(B){t.bytes=i=B.data;var U=B.result;U&&(r(t,{hasAudio:U.hasAudio,hasVideo:U.hasVideo,isMuxed:_}),r=null,U.hasAudio&&!_&&k(U.audioStart),U.hasVideo&&L(U.videoStart),k=null,L=null),F()}})},Fk=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(wF(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 I=function($){d(t,{data:p,type:k.hasAudio&&!k.isMuxed?"audio":"video"}),$&&$.length&&u(t,$),g(null,t,{})};ih({action:"probeMp4StartTime",timescales:t.map.timescales,data:p,transmuxer:t.transmuxer,callback:function($){var F=$.data,O=$.startTime;if(i=F.buffer,t.bytes=p=F,k.hasAudio&&!k.isMuxed&&n(t,"audio","start",O),k.hasVideo&&n(t,"video","start",O),!_.video||!F.byteLength||!t.transmuxer){I();return}ih({action:"pushMp4Captions",endAction:"mp4Captions",transmuxer:t.transmuxer,data:p,timescales:t.map.timescales,trackIds:[_.video.id],callback:function(U){i=U.data.buffer,t.bytes=p=U.data,U.logs.forEach(function(C){y(oe.mergeOptions(C,{stream:"mp4CaptionParser"}))}),I(U.captions)}})}});return}if(!t.transmuxer){g(null,t,{});return}if(typeof t.container>"u"&&(t.container=a0(p)),t.container!=="ts"&&t.container!=="aac"){r(t,{hasAudio:!1,hasVideo:!1}),g(null,t,{});return}l8({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})},Bk=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(xk({source:i,encrypted:n,key:l,iv:r.iv}),[n.buffer,l.buffer])},u8=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;Bk({id:i.requestId,key:i.key,encryptedBytes:i.encryptedBytes,decryptionWorker:t},function(p){i.bytes=p,Fk({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})})},c8=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,I){if(!_){if(k)return _=!0,Zg(t),g(k,I);if(p+=1,p===t.length){var L=function(){if(I.encryptedBytes)return u8({decryptionWorker:i,segment:I,trackInfoFn:r,timingInfoFn:n,videoSegmentTimingInfoFn:a,audioSegmentTimingInfoFn:o,id3Fn:l,captionsFn:u,isEndOfTimeline:c,endedTimelineFn:h,dataFn:d,doneFn:g,onTransmuxerLog:y});Fk({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})};if(I.endOfAllRequests=Date.now(),I.map&&I.map.encryptedBytes&&!I.map.bytes)return Bk({decryptionWorker:i,id:I.requestId+"-init",encryptedBytes:I.map.encryptedBytes,key:I.map.key},function($){I.map.bytes=$,Mk(I,function(F){if(F)return Zg(t),g(F,I);L()})});L()}}}},h8=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)}},d8=function(e){var t=e.segment,i=e.progressFn;return function(r){var n=r.target;if(!n.aborted)return t.stats=oe.mergeOptions(t.stats,s8(r)),!t.stats.firstBytesReceivedAt&&t.stats.bytesReceived&&(t.stats.firstBytesReceivedAt=Date.now()),i(r,t)}},f8=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,I=e.onTransmuxerLog,L=[],$=c8({activeXhrs:L,decryptionWorker:r,trackInfoFn:l,timingInfoFn:u,videoSegmentTimingInfoFn:c,audioSegmentTimingInfoFn:h,id3Fn:d,captionsFn:g,isEndOfTimeline:y,endedTimelineFn:p,dataFn:_,doneFn:k,onTransmuxerLog:I});if(n.key&&!n.key.bytes){var F=[n.key];n.map&&!n.map.bytes&&n.map.key&&n.map.key.resolvedUri===n.key.resolvedUri&&F.push(n.map.key);var O=oe.mergeOptions(i,{uri:n.key.resolvedUri,responseType:"arraybuffer"}),B=eb(n,F,$),U=t(O,B);L.push(U)}if(n.map&&!n.map.bytes){var C=n.map.key&&(!n.key||n.key.resolvedUri!==n.map.key.resolvedUri);if(C){var P=oe.mergeOptions(i,{uri:n.map.key.resolvedUri,responseType:"arraybuffer"}),K=eb(n,[n.map.key],$),z=t(P,K);L.push(z)}var X=oe.mergeOptions(i,{uri:n.map.resolvedUri,responseType:"arraybuffer",headers:Yg(n.map)}),re=a8({segment:n,finishProcessingFn:$}),he=t(X,re);L.push(he)}var fe=oe.mergeOptions(i,{uri:n.part&&n.part.resolvedUri||n.resolvedUri,responseType:"arraybuffer",headers:Yg(n)}),ne=o8({segment:n,finishProcessingFn:$,responseType:fe.responseType}),se=t(fe,ne);se.addEventListener("progress",d8({segment:n,progressFn:o})),L.push(se);var le={};return L.forEach(function(de){de.addEventListener("loadend",h8({loadendState:le,abortFn:a}))}),function(){return Zg(L)}},p8=Ar("CodecUtils"),m8=function(e){var t=e.attributes||{};if(t.CODECS)return Fr(t.CODECS)},Uk=function(e,t){var i=t.attributes||{};return e&&e.mediaGroups&&e.mediaGroups.AUDIO&&i.AUDIO&&e.mediaGroups.AUDIO[i.AUDIO]},g8=function(e,t){if(!Uk(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},rh=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(B2(""+n+a))}),Object.keys(t).forEach(function(i){if(t[i].length>1){p8("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},tb=function(e){var t=0;return e.audio&&t++,e.video&&t++,t},wl=function(e,t){var i=t.attributes||{},r=rh(m8(t)||[]);if(Uk(e,t)&&!r.audio&&!g8(e,t)){var n=rh(s3(e,i.AUDIO)||[]);n.audio&&(r.audio=n.audio)}return r},Yu=Ar("PlaylistSelector"),ib=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||""})}},nh=function(e,t){if(!e)return"";var i=R.getComputedStyle(e);return i?i[t]:""},Xa=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})},q0=function(e,t){var i,r;return e.attributes.BANDWIDTH&&(i=e.attributes.BANDWIDTH),i=i||R.Number.MAX_VALUE,t.attributes.BANDWIDTH&&(r=t.attributes.BANDWIDTH),r=r||R.Number.MAX_VALUE,i-r},v8=function(e,t){var i,r;return e.attributes.RESOLUTION&&e.attributes.RESOLUTION.width&&(i=e.attributes.RESOLUTION.width),i=i||R.Number.MAX_VALUE,t.attributes.RESOLUTION&&t.attributes.RESOLUTION.width&&(r=t.attributes.RESOLUTION.width),r=r||R.Number.MAX_VALUE,i===r&&e.attributes.BANDWIDTH&&t.attributes.BANDWIDTH?e.attributes.BANDWIDTH-t.attributes.BANDWIDTH:i-r},jk=function(e,t,i,r,n,a){if(e){var o={bandwidth:t,width:i,height:r,limitRenditionByPlayerDimensions:n},l=e.playlists;Mi.isAudioOnly(e)&&(l=a.getAudioTrackPlaylists_(),o.audioOnly=!0);var u=l.map(function(P){var K,z=P.attributes&&P.attributes.RESOLUTION&&P.attributes.RESOLUTION.width,X=P.attributes&&P.attributes.RESOLUTION&&P.attributes.RESOLUTION.height;return K=P.attributes&&P.attributes.BANDWIDTH,K=K||R.Number.MAX_VALUE,{bandwidth:K,width:z,height:X,playlist:P}});Xa(u,function(P,K){return P.bandwidth-K.bandwidth}),u=u.filter(function(P){return!Mi.isIncompatible(P.playlist)});var c=u.filter(function(P){return Mi.isEnabled(P.playlist)});c.length||(c=u.filter(function(P){return!Mi.isDisabled(P.playlist)}));var h=c.filter(function(P){return P.bandwidth*Yt.BANDWIDTH_VARIANCE<t}),d=h[h.length-1],g=h.filter(function(P){return P.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"),Yu("choosing "+ib(y)+" using "+p+" with options",o),y.playlist}return Yu("could not choose a playlist with options",o),null}var _=h.filter(function(P){return P.width&&P.height});Xa(_,function(P,K){return P.width-K.width});var k=_.filter(function(P){return P.width===i&&P.height===r});d=k[k.length-1];var I=k.filter(function(P){return P.bandwidth===d.bandwidth})[0],L,$,F;I||(L=_.filter(function(P){return P.width>i||P.height>r}),$=L.filter(function(P){return P.width===L[0].width&&P.height===L[0].height}),d=$[$.length-1],F=$.filter(function(P){return P.bandwidth===d.bandwidth})[0]);var O;if(a.experimentalLeastPixelDiffSelector){var B=_.map(function(P){return P.pixelDiff=Math.abs(P.width-i)+Math.abs(P.height-r),P});Xa(B,function(P,K){return P.pixelDiff===K.pixelDiff?K.bandwidth-P.bandwidth:P.pixelDiff-K.pixelDiff}),O=B[0]}var U=O||F||I||g||c[0]||u[0];if(U&&U.playlist){var C="sortedPlaylistReps";return O?C="leastPixelDiffRep":F?C="resolutionPlusOneRep":I?C="resolutionBestRep":g?C="bandwidthBestRep":c[0]&&(C="enabledPlaylistReps"),Yu("choosing "+ib(U)+" using "+C+" with options",o),U.playlist}return Yu("could not choose a playlist with options",o),null}},rb=function(){var e=this.useDevicePixelRatio&&R.devicePixelRatio||1;return jk(this.playlists.master,this.systemBandwidth,parseInt(nh(this.tech_.el(),"width"),10)*e,parseInt(nh(this.tech_.el(),"height"),10)*e,this.limitRenditionByPlayerDimensions,this.masterPlaylistController_)},y8=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&&R.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),jk(this.playlists.master,t,parseInt(nh(this.tech_.el(),"width"),10)*r,parseInt(nh(this.tech_.el(),"height"),10)*r,this.limitRenditionByPlayerDimensions,this.masterPlaylistController_)}},_8=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!Mi.isIncompatible(p)}),h=c.filter(Mi.isEnabled);h.length||(h=c.filter(function(p){return!Mi.isDisabled(p)}));var d=h.filter(Mi.hasAttribute.bind(null,"BANDWIDTH")),g=d.map(function(p){var _=u.getSyncPoint(p,n,l,i),k=_?1:2,I=Mi.estimateSegmentRequestTime(a,r,p),L=I*k-o;return{playlist:p,rebufferingImpact:L}}),y=g.filter(function(p){return p.rebufferingImpact<=0});return Xa(y,function(p,_){return q0(_.playlist,p.playlist)}),y.length?y[0]:(Xa(g,function(p,_){return p.rebufferingImpact-_.rebufferingImpact}),g[0]||null)},T8=function(){var e=this,t=this.playlists.master.playlists.filter(Mi.isEnabled);Xa(t,function(r,n){return q0(r,n)});var i=t.filter(function(r){return!!wl(e.playlists.master,r).video});return i[0]||null},b8=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},S8=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}}},x8=function(e){var t=e.inbandTextTracks,i=e.captionArray,r=e.timestampOffset;if(i){var n=R.WebKitDataCue||R.VTTCue;i.forEach(function(a){var o=a.stream;t[o].addCue(new n(a.startTime+r,a.endTime+r,a.text))})}},C8=function(e){Object.defineProperties(e.frame,{id:{get:function(){return oe.log.warn("cue.frame.id is deprecated. Use cue.value.key instead."),e.value.key}},value:{get:function(){return oe.log.warn("cue.frame.value is deprecated. Use cue.value.data instead."),e.value.data}},privateData:{get:function(){return oe.log.warn("cue.frame.privateData is deprecated. Use cue.value.data instead."),e.value.data}}})},E8=function(e){var t=e.inbandTextTracks,i=e.metadataArray,r=e.timestampOffset,n=e.videoDuration;if(i){var a=R.WebKitDataCue||R.VTTCue,o=t.metadataTrack_;if(o&&(i.forEach(function(g){var y=g.cueTime+r;typeof y!="number"||R.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,C8(_),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=_})})}}},w8=function(e,t,i){e.metadataTrack_||(e.metadataTrack_=i.addRemoteTextTrack({kind:"metadata",label:"Timed Metadata"},!1).track,e.metadataTrack_.inBandMetadataTrackDispatchType=t)},gl=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)},k8=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)})}},A8=function(e,t,i){if(typeof t>"u"||t===null||!e.length)return[];var r=Math.ceil((t-i+3)*Hc.ONE_SECOND_IN_TS),n;for(n=0;n<e.length&&!(e[n].pts>r);n++);return e.slice(n)},I8=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)},P8=function(e,t,i,r){for(var n=Math.ceil((t-r)*Hc.ONE_SECOND_IN_TS),a=Math.ceil((i-r)*Hc.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},D8=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},$k=22,N8=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]},al=1,L8=500,nb=function(e){return typeof e=="number"&&isFinite(e)},Ju=1/60,O8=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},R8=function(e,t,i){var r=t-Yt.BACK_BUFFER_LENGTH;e.length&&(r=Math.max(r,e.start(0)));var n=t-i;return Math.min(n,r)},Aa=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",I=_?uk({preloadSegment:r})-1:0;return k+" ["+(o+h)+"/"+(o+y)+"]"+(_?" part ["+d+"/"+I+"]":"")+(" 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+"]")},sb=function(e){return e+"TimingInfo"},M8=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},ab=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},F8=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=R.BigInt(a)-R.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},ob=function(e){var t=e.segmentDuration,i=e.maxDuration;return t?Math.round(t)>i+is:!1},B8=function(e,t){if(t!=="hls")return null;var i=F8({audioTimingInfo:e.audioTimingInfo,videoTimingInfo:e.videoTimingInfo});if(!i)return null;var r=e.playlist.targetDuration,n=ob({segmentDuration:i,maxDuration:r*2}),a=ob({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},ev=function(s){A._inheritsLoose(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_=oe.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_=Ar("SegmentLoader["+n.loaderType_+"]"),Object.defineProperty(A._assertThisInitialized(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 Gf.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_&&R.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,R.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_&&Gf.reset(this.transmuxer_),this.gopBuffer_.length=0,this.pause(),this.trigger("ended")},t.buffered_=function(){var r=this.getMediaInfo_();if(!this.sourceUpdater_||!r)return oe.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=th(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=Ck(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_&&(R.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_&&Gf.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_=P8(this.gopBuffer_,r,n,this.timeMapping_),l++,this.sourceUpdater_.removeVideo(r,n,u));for(var c in this.inbandTextTracks_)gl(r,n,this.inbandTextTracks_[c]);gl(r,n,this.segmentMetadataTrack_),u()},t.monitorBuffer_=function(){this.checkBufferTimeout_&&R.clearTimeout(this.checkBufferTimeout_),this.checkBufferTimeout_=R.setTimeout(this.monitorBufferTick_.bind(this),1)},t.monitorBufferTick_=function(){this.state==="READY"&&this.fillBuffer_(),this.checkBufferTimeout_&&R.clearTimeout(this.checkBufferTimeout_),this.checkBufferTimeout_=R.setTimeout(this.monitorBufferTick_.bind(this),L8)},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=KT(r)||0,a=M0(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=N8(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=Mi.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],I=k&&typeof c.partIndex=="number"&&k.parts&&k.parts[c.partIndex];if(!k||typeof c.partIndex=="number"&&!I)return null;if(typeof c.partIndex!="number"&&k.parts&&(c.partIndex=0,I=k.parts[0]),!a&&I&&!I.independent)if(c.partIndex===0){var L=u[c.mediaIndex-1],$=L.parts&&L.parts.length&&L.parts[L.parts.length-1];$&&$.independent&&(c.mediaIndex-=1,c.partIndex=L.parts.length-1,c.independent="previous segment")}else k.parts[c.partIndex-1].independent&&(c.partIndex-=1,c.independent="previous part");var F=this.mediaSource_&&this.mediaSource_.readyState==="ended";return c.mediaIndex>=u.length-1&&F&&!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=KT(this.sourceUpdater_.audioBuffered());return typeof k=="number"&&(p.audioAppendStart=k-this.sourceUpdater_.audioTimestampOffset()),this.sourceUpdater_.videoBuffered().length&&(p.gopsToAlignWith=A8(this.gopBuffer_,this.currentTime_()-this.sourceUpdater_.videoTimestampOffset(),this.timeMapping_)),p},t.timestampOffsetForSegment_=function(r){return M8(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=Mi.estimateSegmentRequestTime(o,a,this.playlist_,r.bytesReceived),u=s4(this.buffered_(),n,this.vhs_.tech_.playbackRate())-1;if(!(l<=u)){var c=_8({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<=is&&(g=1),!(!c.playlist||c.playlist.uri===this.playlist_.uri||d<g)&&(this.bandwidth=c.playlist.attributes.BANDWIDTH*Yt.BANDWIDTH_VARIANCE+1,this.trigger("earlyabort"))}}}},t.handleAbort_=function(r){this.logger_("Aborting "+Aa(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||{},D8(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=sb(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),S8(p,a.vhs_.tech_,c),gl(d,g,p[c]),x8({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();w8(this.inbandTextTracks_,a,this.vhs_.tech_),E8({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_()?!ab({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||ab({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[sb(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=th(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: "+Rs(c).join(", ")),h.length>1&&this.logger_("On QUOTA_EXCEEDED_ERR, found gaps in the video buffer: "+Rs(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<=al&&p-y<=al){this.logger_("On QUOTA_EXCEEDED_ERR, single segment too large to append to buffer, triggering an error. "+("Appended byte length: "+u.byteLength+", ")+("audio buffer: "+Rs(c).join(", ")+", ")+("video buffer: "+Rs(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=_-al;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 "+al+"s"),a.waitingOnRemove_=!1,a.quotaExceededErrorRetryTimeout_=R.setTimeout(function(){a.logger_("On QUOTA_EXCEEDED_ERR, re-processing call queue"),a.quotaExceededErrorRetryTimeout_=null,a.processCallQueue_()},al*1e3)},!0)},t.handleAppendError_=function(r,n){var a=r.segmentInfo,o=r.type,l=r.bytes;if(n){if(n.code===$k){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=b8({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=A._extends({},r,{forceTimestampOffset:!0});A._extends(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 "+Aa(r)),a.map&&!a.map.bytes&&(this.logger_("going to request init segment."),this.appendInitSegment_={video:!0,audio:!0}),r.abortRequests=f8({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_(Aa(r)+" logged from transmuxer stream "+p+" as a "+y+": "+g)}})},t.trimBackBuffer_=function(r){var n=R8(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<Ju){this.logger_("Ignoring segment's bandwidth because its duration of "+r+(" is less than the min to record "+Ju));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===Wr.ABORTED)return;if(this.pause(),r.code===Wr.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_=I8(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=O8(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=B8(r,this.sourceType_);if(n&&(n.severity==="warn"?oe.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 "+Aa(r));return}this.logger_("Appended "+Aa(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")+" "+Aa(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<Ju){this.logger_("Ignoring segment's throughput because its duration of "+r.duration+(" is less than the min to record "+Ju));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(!(!nb(a)||!nb(o))){gl(a,o,this.segmentMetadataTrack_);var l=R.WebKitDataCue||R.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}(oe.EventTarget);function Tn(){}var qk=function(e){return typeof e!="string"?e:e.replace(/./,function(t){return t.toUpperCase()})},U8=["video","audio"],tv=function(e,t){var i=t[e+"Buffer"];return i&&i.updating||t.queuePending[e]},j8=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},H0=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"||tv(e,t))){if(r.type!==e){if(i=j8(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}}}},Hk=function(e,t){var i=t[e+"Buffer"],r=qk(e);i&&(i.removeEventListener("updateend",t["on"+r+"UpdateEnd_"]),i.removeEventListener("error",t["on"+r+"Error_"]),t.codecs[e]=null,t[e+"Buffer"]=null)},Ur=function(e,t){return e&&t&&Array.prototype.indexOf.call(e.sourceBuffers,t)!==-1},Ki={appendBuffer:function(e,t,i){return function(r,n){var a=n[r+"Buffer"];if(Ur(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===$k?"(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(Ur(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"];Ur(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){oe.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){oe.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(Ur(t.mediaSource,i)){t.logger_("calling abort on "+e+"Buffer");try{i.abort()}catch(r){oe.log.warn("Failed to abort on "+e+"Buffer",r)}}}}},addSourceBuffer:function(e,t){return function(i){var r=qk(e),n=Nl(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(Hk(e,t),!!Ur(t.mediaSource,i)){t.logger_("Removing "+e+"Buffer with codec "+t.codecs[e]+" from mediaSource");try{t.mediaSource.removeSourceBuffer(i)}catch(r){oe.log.warn("Failed to removeSourceBuffer "+e+"Buffer",r)}}}},changeType:function(e){return function(t,i){var r=i[t+"Buffer"],n=Nl(e);if(Ur(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){oe.log.warn("Failed to changeType on "+t+"Buffer",a)}}}}},Xi=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}),H0(t,i)},lb=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_"])}H0(e,t)}},Vk=function(s){A._inheritsLoose(e,s);function e(i){var r;return r=s.call(this)||this,r.mediaSource=i,r.sourceopenListener_=function(){return H0("mediaSource",A._assertThisInitialized(r))},r.mediaSource.addEventListener("sourceopen",r.sourceopenListener_),r.logger_=Ar("SourceUpdater"),r.audioTimestampOffset_=0,r.videoTimestampOffset_=0,r.queue=[],r.queuePending={audio:null,video:null},r.delayedAudioAppendQueue_=[],r.videoAppendQueued_=!1,r.codecs={},r.onVideoUpdateEnd_=lb("video",A._assertThisInitialized(r)),r.onAudioUpdateEnd_=lb("audio",A._assertThisInitialized(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){Xi({type:"mediaSource",sourceUpdater:this,action:Ki.addSourceBuffer(r,n),name:"addSourceBuffer"})},t.abort=function(r){Xi({type:r,sourceUpdater:this,action:Ki.abort(r),name:"abort"})},t.removeSourceBuffer=function(r){if(!this.canRemoveSourceBuffer()){oe.log.error("removeSourceBuffer is not supported!");return}Xi({type:"mediaSource",sourceUpdater:this,action:Ki.removeSourceBuffer(r),name:"removeSourceBuffer"})},t.canRemoveSourceBuffer=function(){return!oe.browser.IE_VERSION&&!oe.browser.IS_FIREFOX&&R.MediaSource&&R.MediaSource.prototype&&typeof R.MediaSource.prototype.removeSourceBuffer=="function"},e.canChangeType=function(){return R.SourceBuffer&&R.SourceBuffer.prototype&&typeof R.SourceBuffer.prototype.changeType=="function"},t.canChangeType=function(){return this.constructor.canChangeType()},t.changeType=function(r,n){if(!this.canChangeType()){oe.log.error("changeType is not supported!");return}Xi({type:r,sourceUpdater:this,action:Ki.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(Xi({type:l,sourceUpdater:this,action:Ki.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 Ur(this.mediaSource,this.audioBuffer)&&this.audioBuffer.buffered?this.audioBuffer.buffered:oe.createTimeRange()},t.videoBuffered=function(){return Ur(this.mediaSource,this.videoBuffer)&&this.videoBuffer.buffered?this.videoBuffer.buffered:oe.createTimeRange()},t.buffered=function(){var r=Ur(this.mediaSource,this.videoBuffer)?this.videoBuffer:null,n=Ur(this.mediaSource,this.audioBuffer)?this.audioBuffer:null;return n&&!r?this.audioBuffered():r&&!n?this.videoBuffered():n4(this.audioBuffered(),this.videoBuffered())},t.setDuration=function(r,n){n===void 0&&(n=Tn),Xi({type:"mediaSource",sourceUpdater:this,action:Ki.duration(r),name:"duration",doneFn:n})},t.endOfStream=function(r,n){r===void 0&&(r=null),n===void 0&&(n=Tn),typeof r!="string"&&(r=void 0),Xi({type:"mediaSource",sourceUpdater:this,action:Ki.endOfStream(r),name:"endOfStream",doneFn:n})},t.removeAudio=function(r,n,a){if(a===void 0&&(a=Tn),!this.audioBuffered().length||this.audioBuffered().end(0)===0){a();return}Xi({type:"audio",sourceUpdater:this,action:Ki.remove(r,n),doneFn:a,name:"remove"})},t.removeVideo=function(r,n,a){if(a===void 0&&(a=Tn),!this.videoBuffered().length||this.videoBuffered().end(0)===0){a();return}Xi({type:"video",sourceUpdater:this,action:Ki.remove(r,n),doneFn:a,name:"remove"})},t.updating=function(){return!!(tv("audio",this)||tv("video",this))},t.audioTimestampOffset=function(r){return typeof r<"u"&&this.audioBuffer&&this.audioTimestampOffset_!==r&&(Xi({type:"audio",sourceUpdater:this,action:Ki.timestampOffset(r),name:"timestampOffset"}),this.audioTimestampOffset_=r),this.audioTimestampOffset_},t.videoTimestampOffset=function(r){return typeof r<"u"&&this.videoBuffer&&this.videoTimestampOffset!==r&&(Xi({type:"video",sourceUpdater:this,action:Ki.timestampOffset(r),name:"timestampOffset"}),this.videoTimestampOffset_=r),this.videoTimestampOffset_},t.audioQueueCallback=function(r){this.audioBuffer&&Xi({type:"audio",sourceUpdater:this,action:Ki.callback(r),name:"callback"})},t.videoQueueCallback=function(r){this.videoBuffer&&Xi({type:"video",sourceUpdater:this,action:Ki.callback(r),name:"callback"})},t.dispose=function(){var r=this;this.trigger("dispose"),U8.forEach(function(n){r.abort(n),r.canRemoveSourceBuffer()?r.removeSourceBuffer(n):r[n+"QueueCallback"](function(){return Hk(n,r)})}),this.videoAppendQueued_=!1,this.delayedAudioAppendQueue_.length=0,this.sourceopenListener_&&this.mediaSource.removeEventListener("sourceopen",this.sourceopenListener_),this.off()},e}(oe.EventTarget),ub=function(e){return decodeURIComponent(escape(String.fromCharCode.apply(null,e)))},cb=new Uint8Array(`
|
|
286
|
+
|
|
287
|
+
`.split("").map(function(s){return s.charCodeAt(0)})),$8=function(s){A._inheritsLoose(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}(Mg(Error)),q8=function(s){A._inheritsLoose(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 oe.createTimeRanges();var r=this.subtitlesTrack_.cues,n=r[0].startTime,a=r[r.length-1].startTime;return oe.createTimeRanges([[n,a]])},t.initSegmentForMap=function(r,n){if(n===void 0&&(n=!1),!r)return null;var a=th(r),o=this.initSegments_[a];if(n&&!o&&r.bytes){var l=cb.byteLength+r.bytes.byteLength,u=new Uint8Array(l);u.set(r.bytes),u.set(cb,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){gl(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===Wr.TIMEOUT&&this.handleTimeout_(),r.code===Wr.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 R.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 R.VTTCue(c.startTime,c.endTime,c.text):c)}),k8(this.subtitlesTrack_),this.handleAppendsDone_()},t.handleData_=function(){},t.updateTimingInfoEnd_=function(){},t.parseVTTCues_=function(r){var n,a=!1;if(typeof R.WebVTT!="function")throw new $8;typeof R.TextDecoder=="function"?n=new R.TextDecoder("utf8"):(n=R.WebVTT.StringDecoder(),a=!0);var o=new R.WebVTT.Parser(R,R.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){oe.log.warn("Error encountered when parsing cues: "+c.message)},r.segment.map){var l=r.segment.map.bytes;a&&(l=ub(l)),o.parse(l)}var u=r.bytes;a&&(u=ub(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/Hc.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}(ev),H8=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},V8=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=H8(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 R.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 R.VTTCue(r,r+o.duration,""),n.adStartTime=r-u,n.adEndTime=n.adStartTime+c,t.addCue(n)}r+=o.duration}},z8=86400,hb=[{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=Wg(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=Wg(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}}],W8=function(s){A._inheritsLoose(e,s);function e(i){var r;return r=s.call(this)||this,r.timelines=[],r.discontinuities=[],r.timelineToDatetimeMappings={},r.logger_=Ar("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+El({defaultDuration:r.targetDuration,durationList:r.segments,startIndex:o.segmentIndex,endIndex:0}))},t.runStrategies_=function(r,n,a,o){for(var l=[],u=0;u<hb.length;u++){var c=hb[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>z8){oe.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-El({defaultDuration:n.targetDuration,durationList:n.segments,startIndex:r.mediaIndex,endIndex:l}):d=a.end+El({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}(oe.EventTarget),G8=function(s){A._inheritsLoose(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}(oe.EventTarget),K8=Pk(Dk(function(){var s=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function e($,F,O){return O={path:F,exports:{},require:function(U,C){return t(U,C??O.path)}},$(O,O.exports),O.exports}function t(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}var i=e(function($){function F(B,U){for(var C=0;C<U.length;C++){var P=U[C];P.enumerable=P.enumerable||!1,P.configurable=!0,"value"in P&&(P.writable=!0),Object.defineProperty(B,P.key,P)}}function O(B,U,C){return U&&F(B.prototype,U),C&&F(B,C),B}$.exports=O,$.exports.default=$.exports,$.exports.__esModule=!0}),r=e(function($){function F(O,B){return $.exports=F=Object.setPrototypeOf||function(C,P){return C.__proto__=P,C},$.exports.default=$.exports,$.exports.__esModule=!0,F(O,B)}$.exports=F,$.exports.default=$.exports,$.exports.__esModule=!0}),n=e(function($){function F(O,B){O.prototype=Object.create(B.prototype),O.prototype.constructor=O,r(O,B)}$.exports=F,$.exports.default=$.exports,$.exports.__esModule=!0}),a=function(){function $(){this.listeners={}}var F=$.prototype;return F.on=function(B,U){this.listeners[B]||(this.listeners[B]=[]),this.listeners[B].push(U)},F.off=function(B,U){if(!this.listeners[B])return!1;var C=this.listeners[B].indexOf(U);return this.listeners[B]=this.listeners[B].slice(0),this.listeners[B].splice(C,1),C>-1},F.trigger=function(B){var U=this.listeners[B];if(U)if(arguments.length===2)for(var C=U.length,P=0;P<C;++P)U[P].call(this,arguments[1]);else for(var K=Array.prototype.slice.call(arguments,1),z=U.length,X=0;X<z;++X)U[X].apply(this,K)},F.dispose=function(){this.listeners={}},F.pipe=function(B){this.on("data",function(U){B.push(U)})},$}();/*! @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 F=[[[],[],[],[],[]],[[],[],[],[],[]]],O=F[0],B=F[1],U=O[4],C=B[4],P,K,z,X=[],re=[],he,fe,ne,se,le,de;for(P=0;P<256;P++)re[(X[P]=P<<1^(P>>7)*283)^P]=P;for(K=z=0;!U[K];K^=he||1,z=re[z]||1)for(se=z^z<<1^z<<2^z<<3^z<<4,se=se>>8^se&255^99,U[K]=se,C[se]=K,ne=X[fe=X[he=X[K]]],de=ne*16843009^fe*65537^he*257^K*16843008,le=X[se]*257^se*16843008,P=0;P<4;P++)O[P][K]=le=le<<24^le>>>8,B[P][se]=de=de<<24^de>>>8;for(P=0;P<5;P++)O[P]=O[P].slice(0),B[P]=B[P].slice(0);return F},u=null,c=function(){function $(O){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 B,U,C,P=this._tables[0][4],K=this._tables[1],z=O.length,X=1;if(z!==4&&z!==6&&z!==8)throw new Error("Invalid aes key size");var re=O.slice(0),he=[];for(this._key=[re,he],B=z;B<4*z+28;B++)C=re[B-1],(B%z===0||z===8&&B%z===4)&&(C=P[C>>>24]<<24^P[C>>16&255]<<16^P[C>>8&255]<<8^P[C&255],B%z===0&&(C=C<<8^C>>>24^X<<24,X=X<<1^(X>>7)*283)),re[B]=re[B-z]^C;for(U=0;B;U++,B--)C=re[U&3?B:B-4],B<=4||U<4?he[U]=C:he[U]=K[0][P[C>>>24]]^K[1][P[C>>16&255]]^K[2][P[C>>8&255]]^K[3][P[C&255]]}var F=$.prototype;return F.decrypt=function(B,U,C,P,K,z){var X=this._key[1],re=B^X[0],he=P^X[1],fe=C^X[2],ne=U^X[3],se,le,de,ve=X.length/4-2,we,Pe=4,Oe=this._tables[1],De=Oe[0],Xe=Oe[1],Re=Oe[2],Le=Oe[3],qe=Oe[4];for(we=0;we<ve;we++)se=De[re>>>24]^Xe[he>>16&255]^Re[fe>>8&255]^Le[ne&255]^X[Pe],le=De[he>>>24]^Xe[fe>>16&255]^Re[ne>>8&255]^Le[re&255]^X[Pe+1],de=De[fe>>>24]^Xe[ne>>16&255]^Re[re>>8&255]^Le[he&255]^X[Pe+2],ne=De[ne>>>24]^Xe[re>>16&255]^Re[he>>8&255]^Le[fe&255]^X[Pe+3],Pe+=4,re=se,he=le,fe=de;for(we=0;we<4;we++)K[(3&-we)+z]=qe[re>>>24]<<24^qe[he>>16&255]<<16^qe[fe>>8&255]<<8^qe[ne&255]^X[Pe++],se=re,re=he,he=fe,fe=ne,ne=se},$}(),h=function($){n(F,$);function F(){var B;return B=$.call(this,a)||this,B.jobs=[],B.delay=1,B.timeout_=null,B}var O=F.prototype;return O.processJob_=function(){this.jobs.shift()(),this.jobs.length?this.timeout_=setTimeout(this.processJob_.bind(this),this.delay):this.timeout_=null},O.push=function(U){this.jobs.push(U),this.timeout_||(this.timeout_=setTimeout(this.processJob_.bind(this),this.delay))},F}(a),d=function(F){return F<<24|(F&65280)<<8|(F&16711680)>>8|F>>>24},g=function(F,O,B){var U=new Int32Array(F.buffer,F.byteOffset,F.byteLength>>2),C=new c(Array.prototype.slice.call(O)),P=new Uint8Array(F.byteLength),K=new Int32Array(P.buffer),z,X,re,he,fe,ne,se,le,de;for(z=B[0],X=B[1],re=B[2],he=B[3],de=0;de<U.length;de+=4)fe=d(U[de]),ne=d(U[de+1]),se=d(U[de+2]),le=d(U[de+3]),C.decrypt(fe,ne,se,le,K,de),K[de]=d(K[de]^z),K[de+1]=d(K[de+1]^X),K[de+2]=d(K[de+2]^re),K[de+3]=d(K[de+3]^he),z=fe,X=ne,re=se,he=le;return P},y=function(){function $(O,B,U,C){var P=$.STEP,K=new Int32Array(O.buffer),z=new Uint8Array(O.byteLength),X=0;for(this.asyncStream_=new h,this.asyncStream_.push(this.decryptChunk_(K.subarray(X,X+P),B,U,z)),X=P;X<K.length;X+=P)U=new Uint32Array([d(K[X-4]),d(K[X-3]),d(K[X-2]),d(K[X-1])]),this.asyncStream_.push(this.decryptChunk_(K.subarray(X,X+P),B,U,z));this.asyncStream_.push(function(){C(null,o(z))})}var F=$.prototype;return F.decryptChunk_=function(B,U,C,P){return function(){var K=g(B,U,C);P.set(K,B.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(F){return ArrayBuffer.isView==="function"?ArrayBuffer.isView(F):F&&F.buffer instanceof ArrayBuffer},I=_.BigInt||Number;I("0x1"),I("0x100"),I("0x10000"),I("0x1000000"),I("0x100000000"),I("0x10000000000"),I("0x1000000000000"),I("0x100000000000000"),I("0x10000000000000000");var L=function(F){var O={};return Object.keys(F).forEach(function(B){var U=F[B];k(U)?O[B]={bytes:U.buffer,byteOffset:U.byteOffset,byteLength:U.byteLength}:O[B]=U}),O};self.onmessage=function($){var F=$.data,O=new Uint8Array(F.encrypted.bytes,F.encrypted.byteOffset,F.encrypted.byteLength),B=new Uint32Array(F.key.bytes,F.key.byteOffset,F.key.byteLength/4),U=new Uint32Array(F.iv.bytes,F.iv.byteOffset,F.iv.byteLength/4);new y(O,B,U,function(C,P){self.postMessage(L({source:F.source,decrypted:P}),[P.buffer])})}})),X8=Ik(K8),Q8=function(e){var t=e.default?"main":"alternative";return e.characteristics&&e.characteristics.indexOf("public.accessibility.describes-video")>=0&&(t="main-desc"),t},sh=function(e,t){e.abort(),e.pause(),t&&t.activePlaylistLoader&&(t.activePlaylistLoader.pause(),t.activePlaylistLoader=null)},iv=function(e,t){t.activePlaylistLoader=e,e.load()},Y8=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,sh(r,a),!(!l||l.isMasterPlaylist))){if(!l.playlistLoader){u&&n.resetEverything();return}r.resyncLoader(),iv(l.playlistLoader,a)}}},J8=function(e,t){return function(){var i=t.segmentLoaders[e],r=t.mediaTypes[e];r.lastGroup_=null,i.abort(),i.pause()}},Z8=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,sh(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){iv(u.playlistLoader,o);return}n.track&&n.track(l),n.resetEverything(),iv(u.playlistLoader,o)}}},ah={AUDIO:function(e,t){return function(){var i=t.segmentLoaders[e],r=t.mediaTypes[e],n=t.blacklistCurrentPlaylist;sh(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}oe.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];oe.log.warn("Problem encountered loading the subtitle track.Disabling subtitle track."),sh(i,r);var n=r.activeTrack();n&&(n.mode="disabled"),r.onTrackChanged()}}},db={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",ah[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",ah[e](e,i))}},eU={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=eu(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 Ba(_.playlists[0],i,a):_.resolvedUri?k=new Ba(_.resolvedUri,i,a):_.playlists&&r==="dash"?k=new Jg(_.playlists[0],i,a,d):k=null,_=oe.mergeOptions({id:p,playlistLoader:k},_),db[e](e,_.playlistLoader,t),u[y].push(_),typeof c[p]>"u"){var I=new oe.AudioTrack({id:p,kind:Q8(_),enabled:!1,language:_.language,default:_.default,label:p});c[p]=I}}}n.on("error",ah[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 Ba(p.resolvedUri,r,o);else if(n==="dash"){var k=p.playlists.filter(function(L){return L.excludeUntil!==1/0});if(!k.length)return;_=new Jg(p.playlists[0],r,o,d)}else n==="vhs-json"&&(_=new Ba(p.playlists?p.playlists[0]:p.resolvedUri,r,o));if(p=oe.mergeOptions({id:y,playlistLoader:_},p),db[e](e,p.playlistLoader,t),c[g].push(p),typeof h[y]>"u"){var I=i.addRemoteTextTrack({id:y,kind:"subtitles",default:p.default&&p.autoselect,language:p.language,label:y},!1).track;h[y]=I}}}a.on("error",ah[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=oe.mergeOptions(d,h[d.instreamId])),d.default===void 0&&delete d.default,a[l].push(oe.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}}}}}},tU=function s(e,t){for(var i=0;i<e.length;i++)if(U0(t,e[i])||e[i].playlists&&s(e[i].playlists,t))return!0;return!1},iU=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&&eu(t.master))for(var u=0;u<l.length;u++){var c=n[l[u]];if(tU(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}},rU={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}}},nU=function(e,t){var i=t.mediaTypes;return function(){var r=i[e].activeTrack();return r?i[e].activeGroup(r):null}},sU=function(e){["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(function(y){eU[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=iU(y,e),t[y].activeTrack=rU[y](y,e),t[y].onGroupChanged=Y8(y,e),t[y].onGroupChanging=J8(y,e),t[y].onTrackChanged=Z8(y,e),t[y].getActiveGroup=nU(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])},aU=function(){var e={};return["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(function(t){e[t]={groups:{},tracks:{},activePlaylistLoader:null,activeGroup:Tn,activeTrack:Tn,getActiveGroup:Tn,onGroupChanged:Tn,onTrackChanged:Tn,lastTrack_:null,logger_:Ar("MediaGroups["+t+"]")}}),e},oU=60*2,mn,lU=["mediaRequests","mediaRequestsAborted","mediaRequestsTimedout","mediaRequestsErrored","mediaTransferDuration","mediaBytesTransferred","mediaAppends"],uU=function(e){return this.audioSegmentLoader_[e]+this.mainSegmentLoader_[e]},cU=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 oe.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=!!Fa(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=M0(i,r),y=u?Yt.EXPERIMENTAL_MAX_BUFFER_LOW_WATER_LINE:Yt.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 I=h+" as forwardBuffer >= bufferLowWaterLine ("+g+" >= "+a+")";return u&&(I+=" and next bandwidth > current bandwidth ("+p+" > "+_+")"),c(I),!0}return c("not "+h+" as no switching criteria met"),!1},hU=function(s){A._inheritsLoose(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,I=i.captionServices;if(!n)throw new Error("A non-empty playlist URL or JSON manifest string is required");var L=i.maxPlaylistRetries;(L===null||typeof L>"u")&&(L=1/0),mn=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=L,r.enableLowInitialPlaylist=g,r.useCueTags_&&(r.cueTagsTrack_=r.tech_.addTextTrack("metadata","ad-cues"),r.cueTagsTrack_.inBandMetadataTrackDispatchType=""),r.requestOptions_={withCredentials:o,handleManifestRedirects:a,maxPlaylistRetries:L,timeout:null},r.on("error",r.pauseLoading),r.mediaTypes_=aU(),r.mediaSource=new R.MediaSource,r.handleDurationChange_=r.handleDurationChange_.bind(A._assertThisInitialized(r)),r.handleSourceOpen_=r.handleSourceOpen_.bind(A._assertThisInitialized(r)),r.handleSourceEnded_=r.handleSourceEnded_.bind(A._assertThisInitialized(r)),r.mediaSource.addEventListener("durationchange",r.handleDurationChange_),r.mediaSource.addEventListener("sourceopen",r.handleSourceOpen_),r.mediaSource.addEventListener("sourceended",r.handleSourceEnded_),r.seekable_=oe.createTimeRanges(),r.hasPlayed_=!1,r.syncController_=new W8(i),r.segmentMetadataTrack_=l.addRemoteTextTrack({kind:"metadata",label:"segment-metadata"},!1).track,r.decrypter_=new X8,r.sourceUpdater_=new Vk(r.mediaSource),r.inbandTextTracks_={},r.timelineChangeController_=new G8;var $={vhs:r.vhs_,parse708captions:i.parse708captions,useDtsForTimestampOffset:i.useDtsForTimestampOffset,captionServices:I,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 Jg(n,r.vhs_,r.requestOptions_):new Ba(n,r.vhs_,r.requestOptions_),r.setupMasterPlaylistLoaderListeners_(),r.mainSegmentLoader_=new ev(oe.mergeOptions($,{segmentMetadataTrack:r.segmentMetadataTrack_,loaderType:"main"}),i),r.audioSegmentLoader_=new ev(oe.mergeOptions($,{loaderType:"audio"}),i),r.subtitleSegmentLoader_=new q8(oe.mergeOptions($,{loaderType:"vtt",featuresNativeTextTracks:r.tech_.featuresNativeTextTracks,loadVttJs:function(){return new Promise(function(B,U){function C(){l.off("vttjserror",P),B()}function P(){l.off("vttjsloaded",C),U()}l.one("vttjsloaded",C),l.one("vttjserror",P),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_()})),lU.forEach(function(O){r[O+"_"]=uU.bind(A._assertThisInitialized(r),O)}),r.logger_=Ar("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 F=r.tech_.preload()==="none"?"play":"loadstart";return r.tech_.one(F,function(){var O=Date.now();r.tech_.one("loadeddata",function(){r.timeToLoadedData__=Date.now()-O,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_=R.setInterval(function(){return r.checkABR_()},250)},t.stopABRTimer_=function(){this.tech_.scrubbing&&this.tech_.scrubbing()||(R.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;Gg(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()),sU({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;Gg(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"})),mn.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 cU({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."},oU))});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(){oe.browser.IE_VERSION||oe.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(oe.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=mn.Playlist.playlistEnd(r,a),l=this.tech_.currentTime(),u=this.tech_.buffered();if(!u.length)return o-l<=zr;var c=u.end(u.length-1);return c-l<=zr&&o-c<=zr},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(Qh),u=l.length===1&&l[0]===a;if(o.length===1&&n!==1/0)return oe.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 I=k.excludeUntil;typeof I<"u"&&I!==1/0&&(c=!0,delete k.excludeUntil)}}),c&&(oe.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_:oe.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=Fa(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:mn.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=mn.Playlist.seekable(n,a,mn.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=mn.Playlist.seekable(n,a,mn.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_=oe.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 ["+ok(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=mn.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=wl(this.master(),a),l={},u=!!this.mediaTypes_.AUDIO.activePlaylistLoader;if(n.main.hasVideo&&(l.video=o.video||n.main.videoCodec||o3),n.main.isMuxed&&(l.video+=","+(o.audio||n.main.audioCodec||oT)),(n.main.hasAudio&&!n.main.isMuxed||n.audio.hasAudio||u)&&(l.audio=o.audio||n.main.audioCodec||n.audio.audioCodec||oT,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,I){return k?cc(I):kf(I)},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=(Fr(r.sourceUpdater_.codecs[_]||"")[0]||{}).type,I=(Fr(l[_]||"")[0]||{}).type;k&&I&&k.toLowerCase()!==I.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=wl(r.master,l),c=[];u.audio&&!kf(u.audio)&&!cc(u.audio)&&c.push("audio codec "+u.audio),u.video&&!kf(u.video)&&!cc(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=rh(Fr(r)),u=tb(l),c=l.video&&Fr(l.video)[0]||null,h=l.audio&&Fr(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=wl(n.masterPlaylistLoader_.master,g),_=tb(p);if(!(!p.audio&&!p.video)){if(_!==u&&y.push('codec count "'+_+'" !== "'+u+'"'),!n.sourceUpdater_.canChangeType()){var k=p.video&&Fr(p.video)[0]||null,I=p.audio&&Fr(p.audio)[0]||null;k&&c&&k.type.toLowerCase()!==c.type.toLowerCase()&&y.push('video codec "'+k.type+'" !== "'+c.type+'"'),I&&h&&I.type.toLowerCase()!==h.type.toLowerCase()&&y.push('audio codec "'+I.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)),V8(r,this.cueTagsTrack_,n)},t.goalBufferLength=function(){var r=this.tech_.currentTime(),n=Yt.GOAL_BUFFER_LENGTH,a=Yt.GOAL_BUFFER_LENGTH_RATE,o=Math.max(n,Yt.MAX_GOAL_BUFFER_LENGTH);return Math.min(n+r*a,o)},t.bufferLowWaterLine=function(){var r=this.tech_.currentTime(),n=Yt.BUFFER_LOW_WATER_LINE,a=Yt.BUFFER_LOW_WATER_LINE_RATE,o=Math.max(n,Yt.MAX_BUFFER_LOW_WATER_LINE),l=Math.max(n,Yt.EXPERIMENTAL_MAX_BUFFER_LOW_WATER_LINE);return Math.min(n+r*a,this.experimentalBufferBasedABR?l:o)},t.bufferHighWaterLine=function(){return Yt.BUFFER_HIGH_WATER_LINE},e}(oe.EventTarget),dU=function(e,t,i){return function(r){var n=e.master.playlists[t],a=B0(n),o=Qh(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)}},fU=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=wl(r.master(),t),this.playlist=t,this.id=i,this.enabled=dU(e.playlists,t.id,o)},pU=function(e){e.representations=function(){var t=e.masterPlaylistController_.master(),i=eu(t)?e.masterPlaylistController_.getAudioTrackPlaylists_():t.playlists;return i?i.filter(function(r){return!B0(r)}).map(function(r,n){return new fU(e,r,r.id)}):[]}},fb=["seeking","seeked","pause","playing","error"],mU=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_=Ar("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(fb,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(fb,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_&&R.clearTimeout(i.checkCurrentTimeTimeout_),i.cancelTimer_()}}var e=s.prototype;return e.monitorCurrentTime_=function(){this.checkCurrentTime_(),this.checkCurrentTimeTimeout_&&R.clearTimeout(this.checkCurrentTimeTimeout_),this.checkCurrentTimeTimeout_=R.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=a4(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:Rs(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+zr>=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:zr)}if(typeof o<"u")return this.logger_("Trying to seek outside of seekable at time "+n+" with "+("seekable range "+ok(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-is)*2,_=[d,g],k=0;k<_.length;k++)if(_[k]){var I=M0(_[k],n);if(I<p)return!1}var L=Qu(h,n);return L.length===0?!1:(o=L.start(0)+zr,this.logger_("Buffered region starts ("+L.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=Fa(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=Qu(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)+zr,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=Fa(r,a-3),u=Fa(r,a),c=Fa(n,a);c.length&&!u.length&&l.length&&(o={start:l.end(0),end:c.end(0)})}else{var h=Qu(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=Qu(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)+is),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=r4(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}(),gU={errorInterval:30,getSource:function(e){var t=this.tech({IWillNotUseThisInPlugins:!0}),i=t.currentSource_||this.currentSource();return e(i)}},vU=function s(e,t){var i=0,r=0,n=oe.mergeOptions(gU,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"){oe.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},yU=function(e){vU(this,e)},zk="2.16.3",_U="6.0.1",TU="0.22.1",bU="4.8.0",SU="3.1.3",oi={PlaylistLoader:Ba,Playlist:Mi,utils:D4,STANDARD_PLAYLIST_SELECTOR:rb,INITIAL_PLAYLIST_SELECTOR:T8,lastBandwidthSelector:rb,movingAverageBandwidthSelector:y8,comparePlaylistBandwidth:q0,comparePlaylistResolution:v8,xhr:Sk()};Object.keys(Yt).forEach(function(s){Object.defineProperty(oi,s,{get:function(){return oe.log.warn("using Vhs."+s+" is UNSAFE be sure you know what you are doing"),Yt[s]},set:function(t){if(oe.log.warn("using Vhs."+s+" is UNSAFE be sure you know what you are doing"),typeof t!="number"||t<0){oe.log.warn("value of Vhs."+s+" must be greater than or equal to 0");return}Yt[s]=t}})});var Wk="videojs-vhs",Gk=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"})},xU=function(e,t){t.representations().forEach(function(i){e.addQualityLevel(i)}),Gk(e,t.playlists)};oi.canPlaySource=function(){return oe.log.warn("HLS is no longer a tech. Please remove it from your player's techOrder.")};var CU=function(e,t,i){if(!e)return e;var r={};t&&t.attributes&&t.attributes.CODECS&&(r=rh(Fr(t.attributes.CODECS))),i&&i.attributes&&i.attributes.CODECS&&(r.audio=i.attributes.CODECS);var n=Nl(r.video),a=Nl(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 oe.mergeOptions(e,o)},EU=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},[])},wU=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=EU(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)])},kU=function(e){var t=e.player,i=e.sourceKeySystems,r=e.media,n=e.audioMedia,a=CU(i,r,n);return a?(t.currentSource().keySystems=a,a&&!t.eme?(oe.log.warn("DRM encrypted source cannot be decrypted without a DRM plugin"),!1):!0):!1},Kk=function(){if(!R.localStorage)return null;var e=R.localStorage.getItem(Wk);if(!e)return null;try{return JSON.parse(e)}catch{return null}},AU=function(e){if(!R.localStorage)return!1;var t=Kk();t=t?oe.mergeOptions(t,e):e;try{R.localStorage.setItem(Wk,JSON.stringify(t))}catch{return!1}return t},IU=function(e){return e.toLowerCase().indexOf("data:application/vnd.videojs.vhs+json,")===0?JSON.parse(e.substring(e.indexOf(",")+1)):e};oi.supportsNativeHls=function(){if(!ce||!ce.createElement)return!1;var s=ce.createElement("video");if(!oe.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))})}();oi.supportsNativeDash=function(){return!ce||!ce.createElement||!oe.getTech("Html5").isSupported()?!1:/maybe|probably/i.test(ce.createElement("video").canPlayType("application/dash+xml"))}();oi.supportsTypeNatively=function(s){return s==="hls"?oi.supportsNativeHls:s==="dash"?oi.supportsNativeDash:!1};oi.isSupported=function(){return oe.log.warn("HLS is no longer a tech. Please remove it from your player's techOrder.")};var PU=oe.getComponent("Component"),V0=function(s){A._inheritsLoose(e,s);function e(i,r,n){var a;if(a=s.call(this,r,oe.mergeOptions(n.hls,n.vhs))||this,n.hls&&Object.keys(n.hls).length&&oe.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_=Ar("VhsHandler"),r.options_&&r.options_.playerId){var o=oe(r.options_.playerId);o.hasOwnProperty("hls")||Object.defineProperty(o,"hls",{get:function(){return oe.log.warn("player.hls is deprecated. Use player.tech().vhs instead."),r.trigger({type:"usage",name:"hls-player-access"}),A._assertThisInitialized(a)},configurable:!0}),o.hasOwnProperty("vhs")||Object.defineProperty(o,"vhs",{get:function(){return oe.log.warn("player.vhs is deprecated. Use player.tech().vhs instead."),r.trigger({type:"usage",name:"vhs-player-access"}),A._assertThisInitialized(a)},configurable:!0}),o.hasOwnProperty("dash")||Object.defineProperty(o,"dash",{get:function(){return oe.log.warn("player.dash is deprecated. Use player.tech().vhs instead."),A._assertThisInitialized(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=Kk();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=Yt.INITIAL_BANDWIDTH),this.options_.enableLowInitialPlaylist=this.options_.enableLowInitialPlaylist&&this.options_.bandwidth===Yt.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=IU(this.source_.src),this.options_.tech=this.tech_,this.options_.externVhs=oi,this.options_.sourceType=j2(n),this.options_.seekTo=function(u){a.tech_.setCurrentTime(u)},this.options_.smoothQualityChange&&oe.log.warn("smoothQualityChange is deprecated and will be removed in the next major version"),this.masterPlaylistController_=new hU(this.options_);var o=oe.mergeOptions({liveRangeSafeTimeDelta:zr},this.options_,{seekable:function(){return a.seekable()},media:function(){return a.masterPlaylistController_.media()},masterPlaylistController:this.masterPlaylistController_});this.playbackWatcher_=new mU(o),this.masterPlaylistController_.on("error",function(){var u=oe.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?oi.movingAverageBandwidthSelector(.55):oi.STANDARD_PLAYLIST_SELECTOR;this.masterPlaylistController_.selectPlaylist=this.selectPlaylist?this.selectPlaylist.bind(this):l.bind(this),this.masterPlaylistController_.selectInitialPlaylist=oi.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=R.navigator.connection||R.navigator.mozConnection||R.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(){oe.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 Rs(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 Rs(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&&AU({bandwidth:a.bandwidth,throughput:Math.round(a.throughput)})}),this.masterPlaylistController_.on("selectedinitialmedia",function(){pU(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_=R.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"),wU({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=kU({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=oe.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_),oe.browser.IE_VERSION===11||!a){this.masterPlaylistController_.sourceUpdater_.initializedEme();return}this.createKeySessions_()},t.setupQualityLevels_=function(){var r=this,n=oe.players[this.tech_.options_.playerId];!n||!n.qualityLevels||this.qualityLevels_||(this.qualityLevels_=n.qualityLevels(),this.masterPlaylistController_.on("selectedinitialmedia",function(){xU(r.qualityLevels_,r)}),this.playlists.on("mediachange",function(){Gk(r.qualityLevels_,r.playlists)}))},e.version=function(){return{"@videojs/http-streaming":zk,"mux.js":_U,"mpd-parser":TU,"m3u8-parser":bU,"aes-decrypter":SU}},t.version=function(){return this.constructor.version()},t.canChangeType=function(){return Vk.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_&&R.URL.revokeObjectURL&&(R.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 B4({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),U4({programTime:r,playlist:this.masterPlaylistController_.media(),retryCount:o,pauseAfterSeek:a,seekTo:this.options_.seekTo,tech:this.options_.tech,callback:n})},e}(PU),Bl={name:"videojs-http-streaming",VERSION:zk,canHandleSource:function(e,t){t===void 0&&(t={});var i=oe.mergeOptions(oe.options,t);return Bl.canPlayType(e.type,i)},handleSource:function(e,t,i){i===void 0&&(i={});var r=oe.mergeOptions(oe.options,i);return t.vhs=new V0(e,t,r),oe.hasOwnProperty("hls")||Object.defineProperty(t,"hls",{get:function(){return oe.log.warn("player.tech().hls is deprecated. Use player.tech().vhs instead."),t.vhs},configurable:!0}),t.vhs.xhr=Sk(),t.vhs.src(e.src,e.type),t.vhs},canPlayType:function(e,t){var i=j2(e);if(!i)return"";var r=Bl.getOverrideNative(t),n=oi.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=!(oe.browser.IS_ANY_SAFARI||oe.browser.IS_IOS),l=r.overrideNative,u=l===void 0?o:l,c=a.overrideNative,h=c===void 0?!1:c;return h||u}},DU=function(){return cc("avc1.4d400d,mp4a.40.2")};DU()&&oe.getTech("Html5").registerSourceHandler(Bl,0);oe.VhsHandler=V0;Object.defineProperty(oe,"HlsHandler",{get:function(){return oe.log.warn("videojs.HlsHandler is deprecated. Use videojs.VhsHandler instead."),V0},configurable:!0});oe.VhsSourceHandler=Bl;Object.defineProperty(oe,"HlsSourceHandler",{get:function(){return oe.log.warn("videojs.HlsSourceHandler is deprecated. Use videojs.VhsSourceHandler instead."),Bl},configurable:!0});oe.Vhs=oi;Object.defineProperty(oe,"Hls",{get:function(){return oe.log.warn("videojs.Hls is deprecated. Use videojs.Vhs instead."),oi},configurable:!0});oe.use||(oe.registerComponent("Hls",oi),oe.registerComponent("Vhs",oi));oe.options.vhs=oe.options.vhs||{};oe.options.hls=oe.options.hls||{};if(!oe.getPlugin||!oe.getPlugin("reloadSourceOnError")){var NU=oe.registerPlugin||oe.plugin;NU("reloadSourceOnError",yU)}/*! @name videojs-contrib-quality-levels @version 2.0.9 @license Apache-2.0 */function LU(s,e){s.prototype=Object.create(e.prototype),s.prototype.constructor=s,s.__proto__=e}function Kf(s){if(s===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return s}var OU=function s(e){var t=this;if(oe.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},oh=function(s){LU(e,s);function e(){var i;i=s.call(this)||this;var r=Kf(Kf(i));if(oe.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||Kf(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 OU(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}(oe.EventTarget);oh.prototype.allowedEvents_={change:"change",addqualitylevel:"addqualitylevel",removequalitylevel:"removequalitylevel"};for(var RU in oh.prototype.allowedEvents_)oh.prototype["on"+RU]=null;var Xk="2.0.9",MU=oe.registerPlugin||oe.plugin,FU=function(e,t){var i=e.qualityLevels,r=new oh,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=Xk,r},Qk=function(e){return FU(this,oe.mergeOptions({},e))};MU("qualityLevels",Qk);Qk.VERSION=Xk;const BU={SMALL:450},UU=j.getPlugin("plugin");class jU extends UU{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<=BU.SMALL?this.player.addClass("cv-player-small"):this.player.removeClass("cv-player-small"))})}}j.registerPlugin("configureMenuDimensionsPlugin",jU);const pb="cv-persisttest",ut={hasLocalStorage:()=>{try{return window.localStorage.setItem(pb,"cv-player-storage-test"),window.localStorage.removeItem(pb),!0}catch{return!1}},get:s=>window.localStorage.getItem(s),set:(s,e)=>{window.localStorage.setItem(s,e)},remove:s=>{window.localStorage.removeItem(s)}},$U=j.getPlugin("plugin"),mb="cvplayer-volume",gb="cvplayer-mute";class qU extends $U{constructor(e){super(e),this.enabled=!0,this.player.ready(()=>this.initialize())}initialize(){if(this.player.options_.mobile){this.removeVolumeControl();return}ut.hasLocalStorage()&&(this.saveVolumeState=this.saveVolumeState.bind(this),this.player.on("volumechange",this.saveVolumeState),this.applyUserPreferences())}applyUserPreferences(){const e=ut.get(mb),t=ut.get(gb);e&&this.player.volume(+e),t&&this.player.muted(t==="true")}saveVolumeState(){this.enabled&&(ut.set(mb,this.player.volume().toString()),ut.set(gb,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()}}j.registerPlugin("persistVolumePlugin",qU);const HU=j.getPlugin("plugin"),vb="cvplayer-playback-rate";class VU extends HU{constructor(e,t){super(e),this.options=t,this.player.dataLoaded(()=>this.initialize())}initialize(){var i;if(!ut.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=+ut.get(vb);((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();ut.set(vb,e),(t=this.options.analyticsService)==null||t.logUserAction({rate:e},{actionType:A.UserAction.Select,workflowPhase:A.WorkflowPhase.Complete,descriptor:A.PlaybackDescriptor.ChangeSpeed,entity:A.EntityType.PlaybackSpeed,eventVersion:A.EventVersion.V3})}}j.registerPlugin("persistPlaybackRatePlugin",VU);const zU=j.getPlugin("plugin");class WU extends zU{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}}j.registerPlugin("fullscreenOnRotatePlugin",WU);const Yk=`
|
|
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
|
+
`,GU=j.getComponent("Button");class Jk extends GU{constructor(e,t){super(e,t),this.update=yM(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:Yk,className:this.buildCSSClass()},i={type:"button",href:this.options_.getExternalLink({currentTime:0}),target:"_blank"},r=j.dom.createEl(e,t,i);return this.createControlTextEl(r),r.addEventListener("click",this.pause.bind(this)),r}pause(){this.player_.pause()}}Jk.prototype.controlText_="Open in ClickView";j.registerComponent("OpenExternallyButton",Jk);const KU=j.getPlugin("plugin");class XU extends KU{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)}}j.registerPlugin("openExternallyPlugin",XU);const QU=j.getComponent("component");class YU extends QU{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=""}}j.registerComponent("TouchControls",YU);const JU=j.getPlugin("plugin"),ol=300;class ZU extends JU{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<ol){this.onDoubleTouch(e),this.lastTouchTime=e.timeStamp;return}if(this.resetProperties(),this.lastTouchTime=e.timeStamp,e.timeStamp-this.touchStartTime<ol){window.setTimeout(()=>{this.doubleTouchCount||(this.player.paused()?this.player.play():this.userActive&&this.player.pause())},ol);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,ol*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,ol*3),this.player.currentTime(this.player.currentTime()+10))}}j.registerPlugin("touchControls",ZU);class e5{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 t5=j.getPlugin("plugin");class i5 extends t5{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 e5(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"})}}j.registerPlugin("progressiveFiles",i5);class Zk{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 r5{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 n5{constructor(e){this.player=e,this.logger=j.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)}}j.use("*",s=>new n5(s));const eA='<?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>',s5=j.getComponent("Component");class a5 extends s5{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">${eA}</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()}}j.registerComponent("localCacheIndicator",a5);const o5=j.getPlugin("plugin");class l5 extends o5{constructor(e,t){if(super(e),this.logger_=j.log.createLogger("localcache"),t===void 0)throw Error("no options defined");this.localCaches_=t.localCacheAddresses.map(i=>new r5(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),Zk.enableProfileOrNextBest(this.player.qualityLevels(),e.playbackProfile),t=!0),t||this.player.src(this.player.src())}}j.registerPlugin("localCache",l5);const u5=9e5,c5=j.getPlugin("plugin");class h5 extends c5{constructor(e,t){super(e),this.playerApi=t.playerApi,this.fileToken=t.fileToken,this.logger=j.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+u5>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 Pg.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)}}j.registerPlugin("handleNetworkErrors",h5);const d5=j.getPlugin("plugin"),Xf="cvplayer-show-subtitles",Qf="cvplayer-selected-language",yb="cvplayer-subtitle-size";class f5 extends d5{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(Xf);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(yb);i||(i=this.options.subtitleSize),this.player.options_.mobile&&(i="medium"),i&&this.player.textTrackSettings.setSizeSetting(i)}safeGet(e){if(ut.hasLocalStorage())return ut.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"){ut.set(Xf,"true"),ut.set(Qf,n.language),(t=this.options.analyticsService)==null||t.logUserAction({language:n.language},{actionType:A.UserAction.Select,entity:A.EntityType.Subtitle,workflowPhase:A.WorkflowPhase.Complete,descriptor:A.ToggleDescriptor.On});return}}ut.set(Xf,"false"),ut.remove(Qf),(i=this.options.analyticsService)==null||i.logUserAction({language:""},{actionType:A.UserAction.Select,entity:A.EntityType.Subtitle,workflowPhase:A.WorkflowPhase.Complete,descriptor:A.ToggleDescriptor.Off,eventVersion:A.EventVersion.V3})}bindEventListeners(){ut.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();ut.set(yb,t)}guessWhichTrack(){const e=this.safeGet(Qf)||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)}}j.registerPlugin("persistSubtitleSettingsPlugin",f5);const p5=j.getPlugin("plugin"),m5="cvplayer-playback-quality",g5="cvplayer-localcache-playback-quality",v5="1080";class y5 extends p5{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=v5),ut.hasLocalStorage()){const r=ut.get(this.getStorageKey(!!e));r&&(t=r)}const i=this.player.qualityLevels();e!=null&&e.playbackProfile||Zk.enableProfileOrNextBest(i,t),ut.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];ut.set(this.getStorageKey(e),i.id),(r=this.options.analyticsService)==null||r.logUserAction({quality:i.id},{actionType:A.UserAction.Select,workflowPhase:A.WorkflowPhase.Complete,descriptor:A.PlaybackDescriptor.ChangeResolution,entity:A.EntityType.Resolution,eventVersion:A.EventVersion.V3})}async isLocalCacheActive(){return!!await this.player.localCache().getActiveLocalCache()}getActiveLocalCache(){return this.player.localCache().getActiveLocalCache()}getStorageKey(e){return e?g5:m5}}j.registerPlugin("persistQualitySettingsPlugin",y5);const tA=j.getComponent("Component");class _5 extends tA{constructor(e,t){super(e,t)}createEl(){return j.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 T5 extends tA{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 _5(this.player(),{event:t});this.addChild(i),i.update()})}addEvents(e){this.events_.push(...e),this.update()}createEl(){return j.dom.createEl("div",{className:"cv-progress-reporter-display"})}}const b5=j.getPlugin("plugin"),_b=5e3,S5="ArrowUpArrowUpArrowDownArrowDownArrowLeftArrowRightArrowLeftArrowRightba",Mt={PLAY:"play",PLAYING:"playing",PAUSE:"pause",SEEKING:"seeking",SEEK_START:"seekstart",SEEK_END:"seekend",ENDED:"ended",PAUSED_SEEK:"pausedseek",TIME_UPDATE:"timeupdate"};class x5 extends b5{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={[Mt.PLAY]:()=>this.onPlay(),[Mt.PAUSE]:()=>this.onPause(),[Mt.TIME_UPDATE]:()=>this.onTimeUpdate(),[Mt.SEEKING]:()=>this.onSeeking(),[Mt.ENDED]:()=>this.onEnded(),[Mt.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||_b;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===S5&&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 T5(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(Mt.SEEK_END),this.isSeeking=!1;return}if(this.hasEnded){this.shouldLogPlayOnTimeUpdate=!0,this.hasEnded=!1;return}this.logEvent(Mt.PLAY)}onPause(){this.isSeeking||(this.pauseTimeout=window.setTimeout(()=>{this.isPlaying=!1,this.logEvent(Mt.PAUSE),delete this.pauseTimeout},50))}onTimeUpdate(){this.shouldLogPlayOnTimeUpdate&&(this.shouldLogPlayOnTimeUpdate=!1,this.logEvent(Mt.PLAY)),!(!this.isPlaying||this.isSeeking)&&this.logEvent(Mt.PLAYING)}onSeeking(){this.pauseTimeout&&(this.latestTime=this.previousLatestTime,window.clearTimeout(this.pauseTimeout),delete this.pauseTimeout),this.isPlaying||this.logEvent(Mt.PAUSED_SEEK),!(this.isSeeking||!this.isPlaying)&&(this.isSeeking=!0,this.logEvent(Mt.SEEK_START))}onEnded(){this.hasEnded=!0,this.logEvent(Mt.ENDED)}onPlaying(){this.isSeeking=!1,this.isPlaying=!0}logEvent(e){if(!this.player)return;let t=this.player.currentTime();e===Mt.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===Mt.PLAYING||e===Mt.PLAY)}shouldSaveCarriedOverTime(e){return e===Mt.PLAYING||e===Mt.PAUSE}shouldClearCarriedOverTime(e){return e===Mt.ENDED||e===Mt.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===Mt.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||_b;return i=i/1e3,i+=.5,i=i*this.player.playbackRate(),t<i}}j.registerPlugin("progressReporterPlugin",x5);const C5=j.getComponent("Component");class E5 extends C5{createEl(){const e="span",t={innerHTML:'<span class="vjs-icon-placeholder"></span>',className:"cv-drag-handle vjs-control vjs-button"};return j.dom.createEl(e,t,{})}}const iA=["top","left","right","bottom"],Tb={top:"Top",left:"Left",right:"Right",bottom:"Bottom"},rA=j.getComponent("Component");class w5 extends rA{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 k5 extends rA{constructor(e,t){super(e,t),this.addChildren()}addChildren(){iA.forEach(e=>{this.addChild(new w5(this.player_,{side:e}))})}}const A5=j.getComponent("MenuItem");class I5 extends A5{constructor(e,t){super(e,t)}handleClick(){this.player_.whiteboardModePlugin().setWhiteboardMode(this.options_.side)}}const bb=j.getComponent("MenuButton");class P5 extends bb{constructor(){super(...arguments),this.alwaysCollapsed=!0,this.isCollapsed=!1,this.isCollabsible=!0}createItems(){const e=this.player_.whiteboardModePlugin().side,t=[new Qs(this.player_,{label:"Video Controls"})];return iA.forEach(i=>{t.push(new I5(this.player_,{side:i,label:Tb[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 Tb[e]}showInCollabsibleMenu(){return this.player_.whiteboardModePlugin().isEnabled()?this.player_.isFullscreen():!1}showCollapsibleMenu(){bb.prototype.handleClick.apply(this)}}const Sb="cv-whiteboard-side",D5=j.getPlugin("plugin");class N5 extends D5{constructor(e){super(e),this.side="bottom",this.enabled=!0,this.player.ready(()=>{this.initialize()})}initialize(){if(!this.player.options_.mobile){if(ut.hasLocalStorage()){const e=ut.get(Sb);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 E5(this.player),this.button=new P5(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 k5(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(),ut.hasLocalStorage()&&ut.set(Sb,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"),j.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}`),j.dom.addClass(window.document.documentElement,"cv-whiteboard-html-font-size"))}}j.registerPlugin("whiteboardModePlugin",N5);const L5=j.getPlugin("plugin");class O5 extends L5{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}))}}j.registerPlugin("deferMenusPlugin",O5);const R5="No skipping ahead!",lh="PreventScrubbingTooltip",nA=1e3,M5=j.getComponent("Component"),xb="cv-prevent-scrubbing-tooltip-show",Cb="cv-prevent-scrubbing-tooltip-remove-transition";class F5 extends M5{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:R5},i)}show(){this.isShowing||(this.player_.userActive(!0),this.addClass(xb),this.isShowing=!0)}hide(e=!1){this.isShowing&&(e&&(this.addClass(Cb),window.requestAnimationFrame(()=>{this.removeClass(Cb)})),this.player_.userActive(!1),this.removeClass(xb),this.isShowing=!1)}}j.registerComponent(lh,F5);const B5=j.getPlugin("plugin");class U5 extends B5{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(lh),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(),Gl(i.hide,nA,!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(lh)}getSeekBar(){var e;return(e=this.player.controlBar.getChild("ProgressControl"))==null?void 0:e.getChild("SeekBar")}}j.registerPlugin("preventScrubbingPlugin",U5);const j5=j.getComponent("Button"),Eb="cv-muted";class z0 extends j5{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(Eb):this.removeClass(Eb)}buildCSSClass(){return"cv-mute-button cv-muted"}}j.registerComponent("muteButton",z0);z0.prototype.controlText_="Mute";const $5=j.getComponent("Component");class sA extends $5{constructor(e,t){super(e,t),this._onClickHandler=t.onClickHandler,this.bindEventListeners()}createEl(){return j.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)}}j.registerComponent("playerOverlay",sA);var aA=(s=>(s.Default="play",s.Hover="hover",s))(aA||{});const q5=j.getPlugin("plugin"),wb="cv-preview-mode";class H5 extends q5{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(wb),this.enableSubtites(),this.mute(),this.removeActivityTimeout(),this.player.trigger("resize");return}i==="hover"&&(this.player.removeClass(wb),this.disableSubtitles(),this.unmute(),this.restoreActivityTimeout(),this.player.trigger("resize"))}addButtons(e){const t=new z0(this.player),i=new sA(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}}j.registerPlugin("playerModePlugin",H5);const rv=j.getComponent("Component"),V5=j.getComponent("ClickableComponent"),z5=`
|
|
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
|
+
`,W5=`
|
|
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 G5 extends rv{createEl(){return rv.prototype.createEl.call(this,"span",{className:"cv-favourite-button-svg",innerHTML:`<span class='cv-favourite-heart'>${z5}</span><span class='cv-favourite-outline'>${W5}</span>`})}}class oA extends V5{constructor(e,t){super(e,t),this.isFavourited=t.isFavourited,this.renderIcon(),this.update()}renderIcon(){this.icon&&this.removeChild(this.icon),this.icon=new G5(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=rv.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)}}oA.prototype.controlText_="Favourite";const K5=j.getPlugin("plugin");class X5 extends K5{setFavourite(e,t){if(this.initialized)return;const i=new oA(this.player,{isFavourited:e,onClick:t});this.player.addChild(i),this.initialized=!0}}j.registerPlugin("favouritePlugin",X5);const Q5=j.getComponent("MenuButton"),Y5=992,lA="Theatre mode (t)",uA="Default view (t)",kb="cv-theatre-mode-button";class J5 extends Q5{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<Y5)}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(uA):this.controlText(lA)}}j.registerComponent("theatreModeButton",J5);const Z5=j.getPlugin("plugin"),Ab=992;class e6 extends Z5{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<Ab||!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:A.UserAction.Click,descriptor:r?A.PlaybackDescriptor.EnableTheatreMode:A.PlaybackDescriptor.DisableTheatreMode,entity:A.EntityType.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<Ab?(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(kb),this.button.updateControlText(lA),this.button.setActive(!0)):((t=this.button)==null||t.removeClass(kb),this.button.updateControlText(uA),this.button.setActive(!1)))}}j.registerPlugin("theatreModePlugin",e6);var Ib={},Yf,Pb;function mi(){if(Pb)return Yf;Pb=1;var s=function(e){return e&&e.Math==Math&&e};return Yf=s(typeof globalThis=="object"&&globalThis)||s(typeof window=="object"&&window)||s(typeof self=="object"&&self)||s(typeof A.commonjsGlobal=="object"&&A.commonjsGlobal)||Function("return this")(),Yf}var Jf={},Zf,Db;function fr(){return Db||(Db=1,Zf=function(s){try{return!!s()}catch{return!0}}),Zf}var ep,Nb;function Js(){if(Nb)return ep;Nb=1;var s=fr();return ep=!s(function(){return Object.defineProperty({},"a",{get:function(){return 7}}).a!=7}),ep}var tp={},Lb;function cA(){if(Lb)return tp;Lb=1;var s={}.propertyIsEnumerable,e=Object.getOwnPropertyDescriptor,t=e&&!s.call({1:2},1);return tp.f=t?function(r){var n=e(this,r);return!!n&&n.enumerable}:s,tp}var ip,Ob;function W0(){return Ob||(Ob=1,ip=function(s,e){return{enumerable:!(s&1),configurable:!(s&2),writable:!(s&4),value:e}}),ip}var rp,Rb;function Yh(){if(Rb)return rp;Rb=1;var s={}.toString;return rp=function(e){return s.call(e).slice(8,-1)},rp}var np,Mb;function Jh(){if(Mb)return np;Mb=1;var s=fr(),e=Yh(),t="".split;return np=s(function(){return!Object("z").propertyIsEnumerable(0)})?function(i){return e(i)=="String"?t.call(i,""):Object(i)}:Object,np}var sp,Fb;function Oo(){return Fb||(Fb=1,sp=function(s){if(s==null)throw TypeError("Can't call method on "+s);return s}),sp}var ap,Bb;function Zh(){if(Bb)return ap;Bb=1;var s=Jh(),e=Oo();return ap=function(t){return s(e(t))},ap}var op,Ub;function Ir(){return Ub||(Ub=1,op=function(s){return typeof s=="object"?s!==null:typeof s=="function"}),op}var lp,jb;function hA(){if(jb)return lp;jb=1;var s=Ir();return lp=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")},lp}var up,$b;function Zr(){if($b)return up;$b=1;var s={}.hasOwnProperty;return up=function(e,t){return s.call(e,t)},up}var cp,qb;function dA(){if(qb)return cp;qb=1;var s=mi(),e=Ir(),t=s.document,i=e(t)&&e(t.createElement);return cp=function(r){return i?t.createElement(r):{}},cp}var hp,Hb;function fA(){if(Hb)return hp;Hb=1;var s=Js(),e=fr(),t=dA();return hp=!s&&!e(function(){return Object.defineProperty(t("div"),"a",{get:function(){return 7}}).a!=7}),hp}var Vb;function pA(){if(Vb)return Jf;Vb=1;var s=Js(),e=cA(),t=W0(),i=Zh(),r=hA(),n=Zr(),a=fA(),o=Object.getOwnPropertyDescriptor;return Jf.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])},Jf}var dp={},fp,zb;function Pr(){if(zb)return fp;zb=1;var s=Ir();return fp=function(e){if(!s(e))throw TypeError(String(e)+" is not an object");return e},fp}var Wb;function Ro(){if(Wb)return dp;Wb=1;var s=Js(),e=fA(),t=Pr(),i=hA(),r=Object.defineProperty;return dp.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},dp}var pp,Gb;function en(){if(Gb)return pp;Gb=1;var s=Js(),e=Ro(),t=W0();return pp=s?function(i,r,n){return e.f(i,r,t(1,n))}:function(i,r,n){return i[r]=n,i},pp}var mp={exports:{}},gp={exports:{}},vp,Kb;function G0(){return Kb||(Kb=1,vp=!1),vp}var yp,Xb;function K0(){if(Xb)return yp;Xb=1;var s=mi(),e=en();return yp=function(t,i){try{e(s,t,i)}catch{s[t]=i}return i},yp}var _p,Qb;function t6(){if(Qb)return _p;Qb=1;var s=mi(),e=K0(),t="__core-js_shared__",i=s[t]||e(t,{});return _p=i,_p}var Yb;function ed(){if(Yb)return gp.exports;Yb=1;var s=G0(),e=t6();return(gp.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)"}),gp.exports}var Tp,Jb;function mA(){if(Jb)return Tp;Jb=1;var s=ed();return Tp=s("native-function-to-string",Function.toString),Tp}var bp,Zb;function gA(){if(Zb)return bp;Zb=1;var s=mi(),e=mA(),t=s.WeakMap;return bp=typeof t=="function"&&/native code/.test(e.call(t)),bp}var Sp,eS;function X0(){if(eS)return Sp;eS=1;var s=0,e=Math.random();return Sp=function(t){return"Symbol("+String(t===void 0?"":t)+")_"+(++s+e).toString(36)},Sp}var xp,tS;function Q0(){if(tS)return xp;tS=1;var s=ed(),e=X0(),t=s("keys");return xp=function(i){return t[i]||(t[i]=e(i))},xp}var Cp,iS;function td(){return iS||(iS=1,Cp={}),Cp}var Ep,rS;function tu(){if(rS)return Ep;rS=1;var s=gA(),e=mi(),t=Ir(),i=en(),r=Zr(),n=Q0(),a=td(),o=e.WeakMap,l,u,c,h=function(I){return c(I)?u(I):l(I,{})},d=function(I){return function(L){var $;if(!t(L)||($=u(L)).type!==I)throw TypeError("Incompatible receiver, "+I+" required");return $}};if(s){var g=new o,y=g.get,p=g.has,_=g.set;l=function(I,L){return _.call(g,I,L),L},u=function(I){return y.call(g,I)||{}},c=function(I){return p.call(g,I)}}else{var k=n("state");a[k]=!0,l=function(I,L){return i(I,k,L),L},u=function(I){return r(I,k)?I[k]:{}},c=function(I){return r(I,k)}}return Ep={set:l,get:u,has:c,enforce:h,getterFor:d},Ep}var nS;function Mo(){if(nS)return mp.exports;nS=1;var s=mi(),e=ed(),t=en(),i=Zr(),r=K0(),n=mA(),a=tu(),o=a.get,l=a.enforce,u=String(n).split("toString");return e("inspectSource",function(c){return n.call(c)}),(mp.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)}),mp.exports}var wp,sS;function i6(){return sS||(sS=1,wp=mi()),wp}var kp,aS;function Y0(){if(aS)return kp;aS=1;var s=i6(),e=mi(),t=function(i){return typeof i=="function"?i:void 0};return kp=function(i,r){return arguments.length<2?t(s[i])||t(e[i]):s[i]&&s[i][r]||e[i]&&e[i][r]},kp}var Ap={},Ip,oS;function id(){if(oS)return Ip;oS=1;var s=Math.ceil,e=Math.floor;return Ip=function(t){return isNaN(t=+t)?0:(t>0?e:s)(t)},Ip}var Pp,lS;function Fo(){if(lS)return Pp;lS=1;var s=id(),e=Math.min;return Pp=function(t){return t>0?e(s(t),9007199254740991):0},Pp}var Dp,uS;function r6(){if(uS)return Dp;uS=1;var s=id(),e=Math.max,t=Math.min;return Dp=function(i,r){var n=s(i);return n<0?e(n+r,0):t(n,r)},Dp}var Np,cS;function n6(){if(cS)return Np;cS=1;var s=Zh(),e=Fo(),t=r6(),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 Np={includes:i(!0),indexOf:i(!1)},Np}var Lp,hS;function vA(){if(hS)return Lp;hS=1;var s=Zr(),e=Zh(),t=n6().indexOf,i=td();return Lp=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},Lp}var Op,dS;function J0(){return dS||(dS=1,Op=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]),Op}var fS;function s6(){if(fS)return Ap;fS=1;var s=vA(),e=J0(),t=e.concat("length","prototype");return Ap.f=Object.getOwnPropertyNames||function(r){return s(r,t)},Ap}var Rp={},pS;function yA(){return pS||(pS=1,Rp.f=Object.getOwnPropertySymbols),Rp}var Mp,mS;function a6(){if(mS)return Mp;mS=1;var s=Y0(),e=s6(),t=yA(),i=Pr();return Mp=s("Reflect","ownKeys")||function(n){var a=e.f(i(n)),o=t.f;return o?a.concat(o(n)):a},Mp}var Fp,gS;function o6(){if(gS)return Fp;gS=1;var s=Zr(),e=a6(),t=pA(),i=Ro();return Fp=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))}},Fp}var Bp,vS;function _A(){if(vS)return Bp;vS=1;var s=fr(),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 Bp=t,Bp}var Up,yS;function ns(){if(yS)return Up;yS=1;var s=mi(),e=pA().f,t=en(),i=Mo(),r=K0(),n=o6(),a=_A();return Up=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)}},Up}var jp,_S;function TA(){return _S||(_S=1,jp=function(s){if(typeof s!="function")throw TypeError(String(s)+" is not a function");return s}),jp}var $p,TS;function bA(){if(TS)return $p;TS=1;var s=TA();return $p=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)}},$p}var qp,bS;function iu(){if(bS)return qp;bS=1;var s=Oo();return qp=function(e){return Object(s(e))},qp}var Hp,SS;function l6(){if(SS)return Hp;SS=1;var s=Yh();return Hp=Array.isArray||function(t){return s(t)=="Array"},Hp}var Vp,xS;function u6(){if(xS)return Vp;xS=1;var s=fr();return Vp=!!Object.getOwnPropertySymbols&&!s(function(){return!String(Symbol())}),Vp}var zp,CS;function er(){if(CS)return zp;CS=1;var s=mi(),e=ed(),t=X0(),i=u6(),r=s.Symbol,n=e("wks");return zp=function(a){return n[a]||(n[a]=i&&r[a]||(i?r:t)("Symbol."+a))},zp}var Wp,ES;function c6(){if(ES)return Wp;ES=1;var s=Ir(),e=l6(),t=er(),i=t("species");return Wp=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)},Wp}var Gp,wS;function Z0(){if(wS)return Gp;wS=1;var s=bA(),e=Jh(),t=iu(),i=Fo(),r=c6(),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 I=t(y),L=e(I),$=s(p,_,3),F=i(L.length),O=0,B=k||r,U=l?B(y,F):u?B(y,0):void 0,C,P;F>O;O++)if((g||O in L)&&(C=L[O],P=$(C,O,I),o)){if(l)U[O]=P;else if(P)switch(o){case 3:return!0;case 5:return C;case 6:return O;case 2:n.call(U,C)}else if(h)return!1}return d?-1:c||h?h:U}};return Gp={forEach:a(0),map:a(1),filter:a(2),some:a(3),every:a(4),find:a(5),findIndex:a(6)},Gp}var Kp,kS;function SA(){if(kS)return Kp;kS=1;var s=fr();return Kp=function(e,t){var i=[][e];return!i||!s(function(){i.call(null,t||function(){throw 1},1)})},Kp}var Xp,AS;function xA(){if(AS)return Xp;AS=1;var s=Z0().forEach,e=SA();return Xp=e("forEach")?function(i){return s(this,i,arguments.length>1?arguments[1]:void 0)}:[].forEach,Xp}var IS;function h6(){if(IS)return Ib;IS=1;var s=ns(),e=xA();return s({target:"Array",proto:!0,forced:[].forEach!=e},{forEach:e}),Ib}h6();var PS={},Qp,DS;function CA(){return DS||(DS=1,Qp={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}),Qp}var NS;function d6(){if(NS)return PS;NS=1;var s=mi(),e=CA(),t=xA(),i=en();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 PS}d6();var Yp,LS;function f6(){if(LS)return Yp;LS=1;var s=!!(typeof window<"u"&&window.document&&window.document.createElement);return Yp=s,Yp}var p6=f6();const ey=A.getDefaultExportFromCjs(p6);var OS={},Jp,RS;function m6(){if(RS)return Jp;RS=1;var s=Y0();return Jp=s("navigator","userAgent")||"",Jp}var Zp,MS;function g6(){if(MS)return Zp;MS=1;var s=mi(),e=m6(),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]))),Zp=a&&+a,Zp}var em,FS;function v6(){if(FS)return em;FS=1;var s=fr(),e=er(),t=g6(),i=e("species");return em=function(r){return t>=51||!s(function(){var n=[],a=n.constructor={};return a[i]=function(){return{foo:1}},n[r](Boolean).foo!==1})},em}var BS;function y6(){if(BS)return OS;BS=1;var s=ns(),e=Z0().filter,t=v6();return s({target:"Array",proto:!0,forced:!t("filter")},{filter:function(r){return e(this,r,arguments.length>1?arguments[1]:void 0)}}),OS}y6();var tm,US;function EA(){if(US)return tm;US=1;var s=vA(),e=J0();return tm=Object.keys||function(i){return s(i,e)},tm}var im,jS;function _6(){if(jS)return im;jS=1;var s=Js(),e=Ro(),t=Pr(),i=EA();return im=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},im}var rm,$S;function T6(){if($S)return rm;$S=1;var s=Y0();return rm=s("document","documentElement"),rm}var nm,qS;function wA(){if(qS)return nm;qS=1;var s=Pr(),e=_6(),t=J0(),i=td(),r=T6(),n=dA(),a=Q0(),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 nm=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,nm}var sm,HS;function b6(){if(HS)return sm;HS=1;var s=er(),e=wA(),t=en(),i=s("unscopables"),r=Array.prototype;return r[i]==null&&t(r,i,e(null)),sm=function(n){r[i][n]=!0},sm}var am,VS;function ru(){return VS||(VS=1,am={}),am}var om,zS;function S6(){if(zS)return om;zS=1;var s=fr();return om=!s(function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype}),om}var lm,WS;function kA(){if(WS)return lm;WS=1;var s=Zr(),e=iu(),t=Q0(),i=S6(),r=t("IE_PROTO"),n=Object.prototype;return lm=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},lm}var um,GS;function AA(){if(GS)return um;GS=1;var s=kA(),e=en(),t=Zr(),i=er(),r=G0(),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),um={IteratorPrototype:l,BUGGY_SAFARI_ITERATORS:a},um}var cm,KS;function ty(){if(KS)return cm;KS=1;var s=Ro().f,e=Zr(),t=er(),i=t("toStringTag");return cm=function(r,n,a){r&&!e(r=a?r:r.prototype,i)&&s(r,i,{configurable:!0,value:n})},cm}var hm,XS;function x6(){if(XS)return hm;XS=1;var s=AA().IteratorPrototype,e=wA(),t=W0(),i=ty(),r=ru(),n=function(){return this};return hm=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},hm}var dm,QS;function C6(){if(QS)return dm;QS=1;var s=Ir();return dm=function(e){if(!s(e)&&e!==null)throw TypeError("Can't set "+String(e)+" as a prototype");return e},dm}var fm,YS;function IA(){if(YS)return fm;YS=1;var s=Pr(),e=C6();return fm=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),fm}var pm,JS;function PA(){if(JS)return pm;JS=1;var s=ns(),e=x6(),t=kA(),i=IA(),r=ty(),n=en(),a=Mo(),o=er(),l=G0(),u=ru(),c=AA(),h=c.IteratorPrototype,d=c.BUGGY_SAFARI_ITERATORS,g=o("iterator"),y="keys",p="values",_="entries",k=function(){return this};return pm=function(I,L,$,F,O,B,U){e($,L,F);var C=function(le){if(le===O&&re)return re;if(!d&&le in z)return z[le];switch(le){case y:return function(){return new $(this,le)};case p:return function(){return new $(this,le)};case _:return function(){return new $(this,le)}}return function(){return new $(this)}},P=L+" Iterator",K=!1,z=I.prototype,X=z[g]||z["@@iterator"]||O&&z[O],re=!d&&X||C(O),he=L=="Array"&&z.entries||X,fe,ne,se;if(he&&(fe=t(he.call(new I)),h!==Object.prototype&&fe.next&&(!l&&t(fe)!==h&&(i?i(fe,h):typeof fe[g]!="function"&&n(fe,g,k)),r(fe,P,!0,!0),l&&(u[P]=k))),O==p&&X&&X.name!==p&&(K=!0,re=function(){return X.call(this)}),(!l||U)&&z[g]!==re&&n(z,g,re),u[L]=re,O)if(ne={values:C(p),keys:B?re:C(y),entries:C(_)},U)for(se in ne)(d||K||!(se in z))&&a(z,se,ne[se]);else s({target:L,proto:!0,forced:d||K},ne);return ne},pm}var mm,ZS;function DA(){if(ZS)return mm;ZS=1;var s=Zh(),e=b6(),t=ru(),i=tu(),r=PA(),n="Array Iterator",a=i.set,o=i.getterFor(n);return mm=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"),mm}DA();var ex={},gm,tx;function E6(){if(tx)return gm;tx=1;var s=Js(),e=fr(),t=EA(),i=yA(),r=cA(),n=iu(),a=Jh(),o=Object.assign;return gm=!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(_),I=k.length,L=0,$;I>L;)$=k[L++],(!s||p.call(_,$))&&(h[$]=_[$]);return h}:o,gm}var ix;function w6(){if(ix)return ex;ix=1;var s=ns(),e=E6();return s({target:"Object",stat:!0,forced:Object.assign!==e},{assign:e}),ex}w6();var rx={},vm,nx;function NA(){if(nx)return vm;nx=1;var s=Yh(),e=er(),t=e("toStringTag"),i=s(function(){return arguments}())=="Arguments",r=function(n,a){try{return n[a]}catch{}};return vm=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},vm}var ym,sx;function k6(){if(sx)return ym;sx=1;var s=NA(),e=er(),t=e("toStringTag"),i={};return i[t]="z",ym=String(i)!=="[object z]"?function(){return"[object "+s(this)+"]"}:i.toString,ym}var ax;function A6(){if(ax)return rx;ax=1;var s=Mo(),e=k6(),t=Object.prototype;return e!==t.toString&&s(t,"toString",e,{unsafe:!0}),rx}A6();var ox={},_m,lx;function LA(){return lx||(lx=1,_m=`
|
|
309
|
+
\v\f\r \u2028\u2029\uFEFF`),_m}var Tm,ux;function I6(){if(ux)return Tm;ux=1;var s=Oo(),e=LA(),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 Tm={start:n(1),end:n(2),trim:n(3)},Tm}var bm,cx;function P6(){if(cx)return bm;cx=1;var s=mi(),e=I6().trim,t=LA(),i=s.parseInt,r=/^[+-]?0[Xx]/,n=i(t+"08")!==8||i(t+"0x16")!==22;return bm=n?function(o,l){var u=e(String(o));return i(u,l>>>0||(r.test(u)?16:10))}:i,bm}var hx;function D6(){if(hx)return ox;hx=1;var s=ns(),e=P6();return s({global:!0,forced:parseInt!=e},{parseInt:e}),ox}D6();var dx={},Sm,fx;function OA(){if(fx)return Sm;fx=1;var s=id(),e=Oo(),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 Sm={codeAt:t(!1),charAt:t(!0)},Sm}var px;function N6(){if(px)return dx;px=1;var s=OA().charAt,e=tu(),t=PA(),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})}),dx}N6();var xm={exports:{}},Cm,mx;function RA(){if(mx)return Cm;mx=1;var s=Mo();return Cm=function(e,t,i){for(var r in t)s(e,r,t[r],i);return e},Cm}var Em={exports:{}},wm,gx;function L6(){if(gx)return wm;gx=1;var s=fr();return wm=!s(function(){return Object.isExtensible(Object.preventExtensions({}))}),wm}var vx;function iy(){if(vx)return Em.exports;vx=1;var s=td(),e=Ir(),t=Zr(),i=Ro().f,r=X0(),n=L6(),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=Em.exports={REQUIRED:!1,fastKey:c,getWeakData:h,onFreeze:d};return s[a]=!0,Em.exports}var km={exports:{}},Am,yx;function O6(){if(yx)return Am;yx=1;var s=er(),e=ru(),t=s("iterator"),i=Array.prototype;return Am=function(r){return r!==void 0&&(e.Array===r||i[t]===r)},Am}var Im,_x;function R6(){if(_x)return Im;_x=1;var s=NA(),e=ru(),t=er(),i=t("iterator");return Im=function(r){if(r!=null)return r[i]||r["@@iterator"]||e[s(r)]},Im}var Pm,Tx;function M6(){if(Tx)return Pm;Tx=1;var s=Pr();return Pm=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}},Pm}var bx;function MA(){if(bx)return km.exports;bx=1;var s=Pr(),e=O6(),t=Fo(),i=bA(),r=R6(),n=M6(),a=function(l,u){this.stopped=l,this.result=u},o=km.exports=function(l,u,c,h,d){var g=i(u,c,h?2:1),y,p,_,k,I,L,$;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(I=h?g(s($=l[_])[0],$[1]):g(l[_]),I&&I instanceof a)return I;return new a(!1)}y=p.call(l)}for(L=y.next;!($=L.call(y)).done;)if(I=n(y,g,$.value,h),typeof I=="object"&&I&&I instanceof a)return I;return new a(!1)};return o.stop=function(l){return new a(!0,l)},km.exports}var Dm,Sx;function FA(){return Sx||(Sx=1,Dm=function(s,e,t){if(!(s instanceof e))throw TypeError("Incorrect "+(t?t+" ":"")+"invocation");return s}),Dm}var Nm,xx;function F6(){if(xx)return Nm;xx=1;var s=er(),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 Nm=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},Nm}var Lm,Cx;function B6(){if(Cx)return Lm;Cx=1;var s=Ir(),e=IA();return Lm=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},Lm}var Om,Ex;function U6(){if(Ex)return Om;Ex=1;var s=ns(),e=mi(),t=_A(),i=Mo(),r=iy(),n=MA(),a=FA(),o=Ir(),l=fr(),u=F6(),c=ty(),h=B6();return Om=function(d,g,y,p,_){var k=e[d],I=k&&k.prototype,L=k,$=p?"set":"add",F={},O=function(z){var X=I[z];i(I,z,z=="add"?function(he){return X.call(this,he===0?0:he),this}:z=="delete"?function(re){return _&&!o(re)?!1:X.call(this,re===0?0:re)}:z=="get"?function(he){return _&&!o(he)?void 0:X.call(this,he===0?0:he)}:z=="has"?function(he){return _&&!o(he)?!1:X.call(this,he===0?0:he)}:function(he,fe){return X.call(this,he===0?0:he,fe),this})};if(t(d,typeof k!="function"||!(_||I.forEach&&!l(function(){new k().entries().next()}))))L=y.getConstructor(g,d,p,$),r.REQUIRED=!0;else if(t(d,!0)){var B=new L,U=B[$](_?{}:-0,1)!=B,C=l(function(){B.has(1)}),P=u(function(z){new k(z)}),K=!_&&l(function(){for(var z=new k,X=5;X--;)z[$](X,X);return!z.has(-0)});P||(L=g(function(z,X){a(z,L,d);var re=h(new k,z,L);return X!=null&&n(X,re[$],re,p),re}),L.prototype=I,I.constructor=L),(C||K)&&(O("delete"),O("has"),p&&O("get")),(K||U)&&O($),_&&I.clear&&delete I.clear}return F[d]=L,s({global:!0,forced:L!=k},F),c(L,d),_||y.setStrong(L,d,p),L},Om}var Rm,wx;function j6(){if(wx)return Rm;wx=1;var s=RA(),e=iy().getWeakData,t=Pr(),i=Ir(),r=FA(),n=MA(),a=Z0(),o=Zr(),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,I){return h(k.entries,function(L){return L[0]===I})};return p.prototype={get:function(k){var I=_(this,k);if(I)return I[1]},has:function(k){return!!_(this,k)},set:function(k,I){var L=_(this,k);L?L[1]=I:this.entries.push([k,I])},delete:function(k){var I=d(this.entries,function(L){return L[0]===k});return~I&&this.entries.splice(I,1),!!~I}},Rm={getConstructor:function(k,I,L,$){var F=k(function(U,C){r(U,F,I),u(U,{type:I,id:g++,frozen:void 0}),C!=null&&n(C,U[$],U,L)}),O=c(I),B=function(U,C,P){var K=O(U),z=e(t(C),!0);return z===!0?y(K).set(C,P):z[K.id]=P,U};return s(F.prototype,{delete:function(U){var C=O(this);if(!i(U))return!1;var P=e(U);return P===!0?y(C).delete(U):P&&o(P,C.id)&&delete P[C.id]},has:function(C){var P=O(this);if(!i(C))return!1;var K=e(C);return K===!0?y(P).has(C):K&&o(K,P.id)}}),s(F.prototype,L?{get:function(C){var P=O(this);if(i(C)){var K=e(C);return K===!0?y(P).get(C):K?K[P.id]:void 0}},set:function(C,P){return B(this,C,P)}}:{add:function(C){return B(this,C,!0)}}),F}},Rm}var kx;function $6(){if(kx)return xm.exports;kx=1;var s=mi(),e=RA(),t=iy(),i=U6(),r=j6(),n=Ir(),a=tu().enforce,o=gA(),l=!s.ActiveXObject&&"ActiveXObject"in s,u=Object.isExtensible,c,h=function(I){return function(){return I(this,arguments.length?arguments[0]:void 0)}},d=xm.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(I){if(n(I)&&!u(I)){var L=a(this);return L.frozen||(L.frozen=new c),y.call(this,I)||L.frozen.delete(I)}return y.call(this,I)},has:function(L){if(n(L)&&!u(L)){var $=a(this);return $.frozen||($.frozen=new c),p.call(this,L)||$.frozen.has(L)}return p.call(this,L)},get:function(L){if(n(L)&&!u(L)){var $=a(this);return $.frozen||($.frozen=new c),p.call(this,L)?_.call(this,L):$.frozen.get(L)}return _.call(this,L)},set:function(L,$){if(n(L)&&!u(L)){var F=a(this);F.frozen||(F.frozen=new c),p.call(this,L)?k.call(this,L,$):F.frozen.set(L,$)}else k.call(this,L,$);return this}})}return xm.exports}$6();var Ax={},Ix;function q6(){if(Ix)return Ax;Ix=1;var s=mi(),e=CA(),t=DA(),i=en(),r=er(),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 Ax}q6();var Mm,Px;function H6(){if(Px)return Mm;Px=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 A.commonjsGlobal=="object"&&A.commonjsGlobal&&A.commonjsGlobal.Object===Object&&A.commonjsGlobal,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 _(O,B,U){var C,P,K,z,X,re,he=0,fe=!1,ne=!1,se=!0;if(typeof O!="function")throw new TypeError(s);B=F(B)||0,I(U)&&(fe=!!U.leading,ne="maxWait"in U,K=ne?g(F(U.maxWait)||0,B):K,se="trailing"in U?!!U.trailing:se);function le(Le){var qe=C,it=P;return C=P=void 0,he=Le,z=O.apply(it,qe),z}function de(Le){return he=Le,X=setTimeout(Pe,B),fe?le(Le):z}function ve(Le){var qe=Le-re,it=Le-he,gt=B-qe;return ne?y(gt,K-it):gt}function we(Le){var qe=Le-re,it=Le-he;return re===void 0||qe>=B||qe<0||ne&&it>=K}function Pe(){var Le=p();if(we(Le))return Oe(Le);X=setTimeout(Pe,ve(Le))}function Oe(Le){return X=void 0,se&&C?le(Le):(C=P=void 0,z)}function De(){X!==void 0&&clearTimeout(X),he=0,C=re=P=X=void 0}function Xe(){return X===void 0?z:Oe(p())}function Re(){var Le=p(),qe=we(Le);if(C=arguments,P=this,re=Le,qe){if(X===void 0)return de(re);if(ne)return X=setTimeout(Pe,B),le(re)}return X===void 0&&(X=setTimeout(Pe,B)),z}return Re.cancel=De,Re.flush=Xe,Re}function k(O,B,U){var C=!0,P=!0;if(typeof O!="function")throw new TypeError(s);return I(U)&&(C="leading"in U?!!U.leading:C,P="trailing"in U?!!U.trailing:P),_(O,B,{leading:C,maxWait:B,trailing:P})}function I(O){var B=typeof O;return!!O&&(B=="object"||B=="function")}function L(O){return!!O&&typeof O=="object"}function $(O){return typeof O=="symbol"||L(O)&&d.call(O)==t}function F(O){if(typeof O=="number")return O;if($(O))return e;if(I(O)){var B=typeof O.valueOf=="function"?O.valueOf():O;O=I(B)?B+"":B}if(typeof O!="string")return O===0?O:+O;O=O.replace(i,"");var U=n.test(O);return U||a.test(O)?o(O.slice(2),U?2:8):r.test(O)?e:+O}return Mm=k,Mm}var V6=H6();const Dx=A.getDefaultExportFromCjs(V6);var Fm,Nx;function z6(){if(Nx)return Fm;Nx=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 A.commonjsGlobal=="object"&&A.commonjsGlobal&&A.commonjsGlobal.Object===Object&&A.commonjsGlobal,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 _(F,O,B){var U,C,P,K,z,X,re=0,he=!1,fe=!1,ne=!0;if(typeof F!="function")throw new TypeError(s);O=$(O)||0,k(B)&&(he=!!B.leading,fe="maxWait"in B,P=fe?g($(B.maxWait)||0,O):P,ne="trailing"in B?!!B.trailing:ne);function se(Re){var Le=U,qe=C;return U=C=void 0,re=Re,K=F.apply(qe,Le),K}function le(Re){return re=Re,z=setTimeout(we,O),he?se(Re):K}function de(Re){var Le=Re-X,qe=Re-re,it=O-Le;return fe?y(it,P-qe):it}function ve(Re){var Le=Re-X,qe=Re-re;return X===void 0||Le>=O||Le<0||fe&&qe>=P}function we(){var Re=p();if(ve(Re))return Pe(Re);z=setTimeout(we,de(Re))}function Pe(Re){return z=void 0,ne&&U?se(Re):(U=C=void 0,K)}function Oe(){z!==void 0&&clearTimeout(z),re=0,U=X=C=z=void 0}function De(){return z===void 0?K:Pe(p())}function Xe(){var Re=p(),Le=ve(Re);if(U=arguments,C=this,X=Re,Le){if(z===void 0)return le(X);if(fe)return z=setTimeout(we,O),se(X)}return z===void 0&&(z=setTimeout(we,O)),K}return Xe.cancel=Oe,Xe.flush=De,Xe}function k(F){var O=typeof F;return!!F&&(O=="object"||O=="function")}function I(F){return!!F&&typeof F=="object"}function L(F){return typeof F=="symbol"||I(F)&&d.call(F)==t}function $(F){if(typeof F=="number")return F;if(L(F))return e;if(k(F)){var O=typeof F.valueOf=="function"?F.valueOf():F;F=k(O)?O+"":O}if(typeof F!="string")return F===0?F:+F;F=F.replace(i,"");var B=n.test(F);return B||a.test(F)?o(F.slice(2),B?2:8):r.test(F)?e:+F}return Fm=_,Fm}var W6=z6();const Lx=A.getDefaultExportFromCjs(W6);var Bm,Ox;function G6(){if(Ox)return Bm;Ox=1;var s="Expected a function",e="__lodash_hash_undefined__",t="[object Function]",i="[object GeneratorFunction]",r=/[\\^$.*+?()[\]{}|]/g,n=/^\[object .+?Constructor\]$/,a=typeof A.commonjsGlobal=="object"&&A.commonjsGlobal&&A.commonjsGlobal.Object===Object&&A.commonjsGlobal,o=typeof self=="object"&&self&&self.Object===Object&&self,l=a||o||Function("return this")();function u(Te,Ce){return Te==null?void 0:Te[Ce]}function c(Te){var Ce=!1;if(Te!=null&&typeof Te.toString!="function")try{Ce=!!(Te+"")}catch{}return Ce}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,I=g.toString,L=RegExp("^"+_.call(k).replace(r,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),$=h.splice,F=Le(l,"Map"),O=Le(Object,"create");function B(Te){var Ce=-1,Fe=Te?Te.length:0;for(this.clear();++Ce<Fe;){var Me=Te[Ce];this.set(Me[0],Me[1])}}function U(){this.__data__=O?O(null):{}}function C(Te){return this.has(Te)&&delete this.__data__[Te]}function P(Te){var Ce=this.__data__;if(O){var Fe=Ce[Te];return Fe===e?void 0:Fe}return k.call(Ce,Te)?Ce[Te]:void 0}function K(Te){var Ce=this.__data__;return O?Ce[Te]!==void 0:k.call(Ce,Te)}function z(Te,Ce){var Fe=this.__data__;return Fe[Te]=O&&Ce===void 0?e:Ce,this}B.prototype.clear=U,B.prototype.delete=C,B.prototype.get=P,B.prototype.has=K,B.prototype.set=z;function X(Te){var Ce=-1,Fe=Te?Te.length:0;for(this.clear();++Ce<Fe;){var Me=Te[Ce];this.set(Me[0],Me[1])}}function re(){this.__data__=[]}function he(Te){var Ce=this.__data__,Fe=De(Ce,Te);if(Fe<0)return!1;var Me=Ce.length-1;return Fe==Me?Ce.pop():$.call(Ce,Fe,1),!0}function fe(Te){var Ce=this.__data__,Fe=De(Ce,Te);return Fe<0?void 0:Ce[Fe][1]}function ne(Te){return De(this.__data__,Te)>-1}function se(Te,Ce){var Fe=this.__data__,Me=De(Fe,Te);return Me<0?Fe.push([Te,Ce]):Fe[Me][1]=Ce,this}X.prototype.clear=re,X.prototype.delete=he,X.prototype.get=fe,X.prototype.has=ne,X.prototype.set=se;function le(Te){var Ce=-1,Fe=Te?Te.length:0;for(this.clear();++Ce<Fe;){var Me=Te[Ce];this.set(Me[0],Me[1])}}function de(){this.__data__={hash:new B,map:new(F||X),string:new B}}function ve(Te){return Re(this,Te).delete(Te)}function we(Te){return Re(this,Te).get(Te)}function Pe(Te){return Re(this,Te).has(Te)}function Oe(Te,Ce){return Re(this,Te).set(Te,Ce),this}le.prototype.clear=de,le.prototype.delete=ve,le.prototype.get=we,le.prototype.has=Pe,le.prototype.set=Oe;function De(Te,Ce){for(var Fe=Te.length;Fe--;)if(Ai(Te[Fe][0],Ce))return Fe;return-1}function Xe(Te){if(!Fi(Te)||it(Te))return!1;var Ce=Lt(Te)||c(Te)?L:n;return Ce.test(gt(Te))}function Re(Te,Ce){var Fe=Te.__data__;return qe(Ce)?Fe[typeof Ce=="string"?"string":"hash"]:Fe.map}function Le(Te,Ce){var Fe=u(Te,Ce);return Xe(Fe)?Fe:void 0}function qe(Te){var Ce=typeof Te;return Ce=="string"||Ce=="number"||Ce=="symbol"||Ce=="boolean"?Te!=="__proto__":Te===null}function it(Te){return!!p&&p in Te}function gt(Te){if(Te!=null){try{return _.call(Te)}catch{}try{return Te+""}catch{}}return""}function At(Te,Ce){if(typeof Te!="function"||Ce&&typeof Ce!="function")throw new TypeError(s);var Fe=function(){var Me=arguments,Ge=Ce?Ce.apply(this,Me):Me[0],Qe=Fe.cache;if(Qe.has(Ge))return Qe.get(Ge);var vt=Te.apply(this,Me);return Fe.cache=Qe.set(Ge,vt),vt};return Fe.cache=new(At.Cache||le),Fe}At.Cache=le;function Ai(Te,Ce){return Te===Ce||Te!==Te&&Ce!==Ce}function Lt(Te){var Ce=Fi(Te)?I.call(Te):"";return Ce==t||Ce==i}function Fi(Te){var Ce=typeof Te;return!!Te&&(Ce=="object"||Ce=="function")}return Bm=At,Bm}var K6=G6();const X6=A.getDefaultExportFromCjs(K6);var BA=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}()}(),nv=typeof window<"u"&&typeof document<"u"&&window.document===document,uh=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")()}(),Q6=function(){return typeof requestAnimationFrame=="function"?requestAnimationFrame.bind(uh):function(s){return setTimeout(function(){return s(Date.now())},1e3/60)}}(),Y6=2;function J6(s,e){var t=!1,i=!1,r=0;function n(){t&&(t=!1,s()),i&&o()}function a(){Q6(n)}function o(){var l=Date.now();if(t){if(l-r<Y6)return;i=!0}else t=!0,i=!1,setTimeout(a,e);r=l}return o}var Z6=20,ej=["top","right","bottom","left","width","height","size","weight"],tj=typeof MutationObserver<"u",ij=function(){function s(){this.connected_=!1,this.mutationEventsAdded_=!1,this.mutationsObserver_=null,this.observers_=[],this.onTransitionEnd_=this.onTransitionEnd_.bind(this),this.refresh=J6(this.refresh.bind(this),Z6)}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(){!nv||this.connected_||(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),tj?(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(){!nv||!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=ej.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}(),UA=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},go=function(s){var e=s&&s.ownerDocument&&s.ownerDocument.defaultView;return e||uh},jA=rd(0,0,0,0);function ch(s){return parseFloat(s)||0}function Rx(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+ch(n)},0)}function rj(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]=ch(a)}return t}function nj(s){var e=s.getBBox();return rd(0,0,e.width,e.height)}function sj(s){var e=s.clientWidth,t=s.clientHeight;if(!e&&!t)return jA;var i=go(s).getComputedStyle(s),r=rj(i),n=r.left+r.right,a=r.top+r.bottom,o=ch(i.width),l=ch(i.height);if(i.boxSizing==="border-box"&&(Math.round(o+n)!==e&&(o-=Rx(i,"left","right")+n),Math.round(l+a)!==t&&(l-=Rx(i,"top","bottom")+a)),!oj(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 rd(r.left,r.top,o,l)}var aj=function(){return typeof SVGGraphicsElement<"u"?function(s){return s instanceof go(s).SVGGraphicsElement}:function(s){return s instanceof go(s).SVGElement&&typeof s.getBBox=="function"}}();function oj(s){return s===go(s).document.documentElement}function lj(s){return nv?aj(s)?nj(s):sj(s):jA}function uj(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 UA(a,{x:e,y:t,width:i,height:r,top:t,right:e+i,bottom:r+t,left:e}),a}function rd(s,e,t,i){return{x:s,y:e,width:t,height:i}}var cj=function(){function s(e){this.broadcastWidth=0,this.broadcastHeight=0,this.contentRect_=rd(0,0,0,0),this.target=e}return s.prototype.isActive=function(){var e=lj(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}(),hj=function(){function s(e,t){var i=uj(t);UA(this,{target:e,contentRect:i})}return s}(),dj=function(){function s(e,t,i){if(this.activeObservations_=[],this.observations_=new BA,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 go(e).Element))throw new TypeError('parameter 1 is not of type "Element".');var t=this.observations_;t.has(e)||(t.set(e,new cj(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 go(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 hj(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}(),$A=typeof WeakMap<"u"?new WeakMap:new BA,qA=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=ij.getInstance(),i=new dj(e,t,this);$A.set(this,i)}return s}();["observe","unobserve","disconnect"].forEach(function(s){qA.prototype[s]=function(){var e;return(e=$A.get(this))[s].apply(e,arguments)}});var fj=function(){return typeof uh.ResizeObserver<"u"?uh.ResizeObserver:qA}(),Mx={},Um,Fx;function pj(){if(Fx)return Um;Fx=1;var s=TA(),e=iu(),t=Jh(),i=Fo(),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 Um={left:r(!1),right:r(!0)},Um}var Bx;function mj(){if(Bx)return Mx;Bx=1;var s=ns(),e=pj().left,t=SA();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)}}),Mx}mj();var Ux={},jx;function gj(){if(jx)return Ux;jx=1;var s=Js(),e=Ro().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""}}}),Ux}gj();var $x={},jm,qx;function vj(){if(qx)return jm;qx=1;var s=Pr();return jm=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},jm}var $m,Hx;function ry(){if(Hx)return $m;Hx=1;var s=vj(),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}),$m=i,$m}var Vx;function yj(){if(Vx)return $x;Vx=1;var s=ns(),e=ry();return s({target:"RegExp",proto:!0,forced:/./.exec!==e},{exec:e}),$x}yj();var zx={},qm,Wx;function HA(){if(Wx)return qm;Wx=1;var s=en(),e=Mo(),t=fr(),i=er(),r=ry(),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 qm=function(l,u,c,h){var d=i(l),g=!t(function(){var L={};return L[d]=function(){return 7},""[l](L)!=7}),y=g&&!t(function(){var L=!1,$=/a/;return l==="split"&&($={},$.constructor={},$.constructor[n]=function(){return $},$.flags="",$[d]=/./[d]),$.exec=function(){return L=!0,null},$[d](""),!L});if(!g||!y||l==="replace"&&!a||l==="split"&&!o){var p=/./[d],_=c(d,""[l],function(L,$,F,O,B){return $.exec===r?g&&!B?{done:!0,value:p.call($,F,O)}:{done:!0,value:L.call(F,$,O)}:{done:!1}}),k=_[0],I=_[1];e(String.prototype,l,k),e(RegExp.prototype,d,u==2?function(L,$){return I.call(L,this,$)}:function(L){return I.call(L,this)}),h&&s(RegExp.prototype[d],"sham",!0)}},qm}var Hm,Gx;function VA(){if(Gx)return Hm;Gx=1;var s=OA().charAt;return Hm=function(e,t,i){return t+(i?s(e,t).length:1)},Hm}var Vm,Kx;function zA(){if(Kx)return Vm;Kx=1;var s=Yh(),e=ry();return Vm=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)},Vm}var Xx;function _j(){if(Xx)return zx;Xx=1;var s=HA(),e=Pr(),t=Fo(),i=Oo(),r=VA(),n=zA();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}]}),zx}_j();var Qx={},Yx;function Tj(){if(Yx)return Qx;Yx=1;var s=HA(),e=Pr(),t=iu(),i=Fo(),r=id(),n=Oo(),a=VA(),o=zA(),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(L,$){var F=n(this),O=L==null?void 0:L[y];return O!==void 0?O.call(L,F,$):p.call(String(F),L,$)},function(I,L){var $=_(p,I,this,L);if($.done)return $.value;var F=e(I),O=String(this),B=typeof L=="function";B||(L=String(L));var U=F.global;if(U){var C=F.unicode;F.lastIndex=0}for(var P=[];;){var K=o(F,O);if(K===null||(P.push(K),!U))break;var z=String(K[0]);z===""&&(F.lastIndex=a(O,i(F.lastIndex),C))}for(var X="",re=0,he=0;he<P.length;he++){K=P[he];for(var fe=String(K[0]),ne=l(u(r(K.index),O.length),0),se=[],le=1;le<K.length;le++)se.push(g(K[le]));var de=K.groups;if(B){var ve=[fe].concat(se,ne,O);de!==void 0&&ve.push(de);var we=String(L.apply(void 0,ve))}else we=k(fe,O,ne,se,de,L);ne>=re&&(X+=O.slice(re,ne)+we,re=ne+fe.length)}return X+O.slice(re)}];function k(I,L,$,F,O,B){var U=$+I.length,C=F.length,P=d;return O!==void 0&&(O=t(O),P=h),p.call(B,P,function(K,z){var X;switch(z.charAt(0)){case"$":return"$";case"&":return I;case"`":return L.slice(0,$);case"'":return L.slice(U);case"<":X=O[z.slice(1,-1)];break;default:var re=+z;if(re===0)return K;if(re>C){var he=c(re/10);return he===0?K:he<=C?F[he-1]===void 0?z.charAt(1):F[he-1]+z.charAt(1):K}X=F[re-1]}return X===void 0?"":X})}}),Qx}Tj();var Na=null,Jx=null;ey&&window.addEventListener("resize",function(){Jx!==window.devicePixelRatio&&(Jx=window.devicePixelRatio,Na=null)});function Zx(){if(Na===null){if(typeof document>"u")return Na=0,Na;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),Na=t}return Na}var hh=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 Kn(s){return!s||!s.ownerDocument||!s.ownerDocument.defaultView?window:s.ownerDocument.defaultView}function zm(s){return!s||!s.ownerDocument?document:s.ownerDocument}var Ut=function(){function s(t,i){var r=this;this.onScroll=function(){var n=Kn(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=zm(r.el),o=Kn(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=Dx(this.recalculate.bind(this),64),this.onMouseMove=Dx(this.onMouseMove.bind(this),64),this.hideScrollbars=Lx(this.hideScrollbars.bind(this),this.options.timeout),this.onWindowResize=Lx(this.onWindowResize.bind(this),64,{leading:!0}),s.getRtlHelpers=X6(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=zm(i),a=Kn(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),ey&&(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=Kn(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||fj;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=Kn(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=zm(this.el),a=Kn(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=Kn(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:Zx()}catch{return Zx()}},e.removeListeners=function(){var i=this,r=Kn(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}();Ut.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};Ut.instances=new WeakMap;Ut.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"&&!Ut.instances.has(s)&&new Ut(s,hh(s.attributes))})};Ut.removeObserver=function(){this.globalObserver.disconnect()};Ut.initHtmlApi=function(){this.initDOMLoadedElements=this.initDOMLoadedElements.bind(this),typeof MutationObserver<"u"&&(this.globalObserver=new MutationObserver(Ut.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))};Ut.handleMutations=function(s){s.forEach(function(e){Array.prototype.forEach.call(e.addedNodes,function(t){t.nodeType===1&&(t.hasAttribute("data-simplebar")?!Ut.instances.has(t)&&new Ut(t,hh(t.attributes)):Array.prototype.forEach.call(t.querySelectorAll("[data-simplebar]"),function(i){i.getAttribute("data-simplebar")!=="init"&&!Ut.instances.has(i)&&new Ut(i,hh(i.attributes))}))}),Array.prototype.forEach.call(e.removedNodes,function(t){t.nodeType===1&&(t.hasAttribute('[data-simplebar="init"]')?Ut.instances.has(t)&&Ut.instances.get(t).unMount():Array.prototype.forEach.call(t.querySelectorAll('[data-simplebar="init"]'),function(i){Ut.instances.has(i)&&Ut.instances.get(i).unMount()}))})})};Ut.getOptions=hh;ey&&Ut.initHtmlApi();const tr=j.getComponent("Menu"),WA=tr.prototype.createEl;tr.prototype.createEl=function(){const e=WA.call(this);return this.simpleBar=new Ut(this.contentEl(),{autoHide:!1}),e};const bj=tr.prototype.contentEl;tr.prototype.contentEl=function(){return this.simpleBar?this.simpleBar.getContentElement():bj.call(this)};const Sj=tr.prototype.dispose;tr.prototype.dispose=function(){this.simpleBar&&(this.simpleBar.unMount(),delete this.simpleBar),Sj.call(this)};const xj=tr.prototype.addItem;tr.prototype.addItem=function(e){xj.call(this,e),this.simpleBar.recalculate()};const Cj=tr.prototype.lockShowing;tr.prototype.lockShowing=function(){Cj.call(this),this.simpleBar.recalculate()};tr.prototype.recalculateScrollBar=function(){this.simpleBar.recalculate()};const Ej=tr.prototype.handleBlur;tr.prototype.handleBlur=function(e){const t=e.relatedTarget||document.activeElement;this.el().contains(t)||Ej.call(this,e)};const eC="cv-active-button",wj=j.getComponent("Menu"),kj=function(s){return typeof s!="string"?s:s.replace(/./,e=>e.toUpperCase())},Aj=j.getComponent("Component"),Bo=j.getComponent("MenuButton");let Ij=class extends Bo{createMenu(){const e=new wj(this.player_,{menuButton:this});if(this.hideThreshold_=0,this.options_.title){const t=j.dom.createEl("li",{className:"vjs-menu-title",innerHTML:kj(this.options_.title),tabIndex:-1});this.hideThreshold_+=1;const i=new Aj(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 Pj=Bo.prototype.pressButton;Bo.prototype.pressButton=function(){Pj.call(this),this.inactivityTimeout=this.player_.cache_.inactivityTimeout,this.player_.cache_.inactivityTimeout=0,this.player_.options_.inactivityTimeout=0};const Dj=Bo.prototype.unpressButton;Bo.prototype.unpressButton=function(){Dj.call(this),this.player_.cache_.inactivityTimeout=this.inactivityTimeout,this.player_.options_.inactivityTimeout=this.inactivityTimeout,this.player_.reportUserActivity()};Bo.prototype.setActive=function(e){e?this.addClass(eC):this.removeClass(eC)};j.registerComponent("MenuButton",Ij);const Nj=j.getComponent("Component");class GA extends Nj{buildCSSClass(){return`cv-time-wrapper ${super.buildCSSClass()}`}createEl(e,t,i){return super.createEl(e,{...t,className:this.buildCSSClass()},i)}}GA.prototype.options_={children:["currentTimeDisplay","remainingTimeDisplay"]};j.registerComponent("TimeWrapper",GA);const ll=j.getComponent("SeekBar");let Lj=class extends ll{handleMouseDown(e){const t=this.player_.preventScrubbingPlugin();t.isEnabled&&this.getMouseTime(e)>t.furthestVisitedTime||(ll.prototype.handleMouseDown.call(this,e),this.player_.addClass("cv-disable-play-pause-feedback"))}handleMouseMove(e){ll.prototype.handleMouseMove.call(this,e),this.update()}getPercent(){const t=this.player_.currentTime()/this.player_.duration();return t>=1?1:t}handleMouseUp(e){ll.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(ll.prototype.calculateDistance.call(this,e).x,0,1)*this.player_.duration()}};j.registerComponent("SeekBar",Lj);const Oj=j.getComponent("Component");class Rj extends Oj{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 Mj=j.getComponent("Component");class Fj extends Mj{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 Bj=j.getComponent("Component");class tC extends Bj{constructor(e,t){super(e,t),this.playProgress=new Fj(this.player_),this.addChild(this.playProgress),this.loadProgress=new Rj(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 KA(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 Uj=j.getComponent("Component");class jj extends Uj{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(KA(this.player_))})}}const $j=j.getComponent("SeekBar");class ny 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),Wt.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 j.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 jj(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 tC(this.player_,{startTime:o,endTime:l});if(t.addChild(c),u&&l===u)break}else t.addChild(new tC(this.player_,{startTime:0,endTime:this.player_.duration()||3600}));this.chapterBarItems&&this.removeChild(this.chapterBarItems),this.chapterBarItems=t,this.addChild(this.chapterBarItems)}}ny.prototype.options_={children:["playProgressBar"],barName:"playProgressBar"};!j.browser.IS_IOS&&!j.browser.IS_ANDROID&&ny.prototype.options_.children.splice(1,0,"mouseTimeDisplay");j.registerComponent("ChapterSeekBar",ny);const qj=j.getComponent("ProgressControl"),iC="seekBar";class XA extends qj{constructor(){super(...arguments),this.seekBarName_=iC}setSeekBarName(e){this.seekBarName_=e}getChild(e){return(e==null?void 0:e.toLowerCase())===iC.toLowerCase()&&(e=this.seekBarName_),super.getChild(e)}}XA.prototype.options_={children:[]};j.registerComponent("ProgressControl",XA);function QA(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 Hj=j.getComponent("TimeTooltip");class Vj extends Hj{constructor(e,t){super(e,t),this.hasCustomChapterText=!1,Wt.useChapters(this.player_,i=>{this.track_=i})}createEl(){const e=super.createEl();return this.chapter_=j.dom.createEl("div"),e.appendChild(this.chapter_),this.time_=j.dom.createEl("div"),e.appendChild(this.time_),e}updateTime(e){const t=this.player_.duration();if(j.dom.textContent(this.time_,QA(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){j.dom.textContent(this.chapter_,r.text);return}}j.dom.textContent(this.chapter_,"")}}clearChapterContent(){j.dom.textContent(this.chapter_,"")}updateText(e){j.dom.textContent(this.time_,e)}setCustomChapterText(e){this.hasCustomChapterText=!!e,j.dom.textContent(this.chapter_,e??"")}}j.registerComponent("TimeTooltip",Vj);const zj=j.getComponent("Component");class sy extends zj{constructor(e,t){super(e,t)}setTrack(e){this.track_=e}createEl(){const e=super.createEl("div",{className:"cv-thumbnail-display"});return this.img_=j.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"}}sy.prototype.options_={scaleFactor:1};j.registerComponent("ThumbnailDisplay",sy);const Wj=j.getComponent("MouseTimeDisplay"),rC="cv-mouse-time-display-force-show";class YA extends Wj{constructor(e,t){super(e,t),Wt.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(lh);let l=!1;a.isEnabled&&(l=n>a.furthestVisitedTime),l?(this.hide(),o.show(),Gl(o.hide,nA,!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(rC)}removeForceShow(){this.removeClass(rC)}}YA.prototype.options_={children:["ThumbnailDisplay","TimeTooltip"]};j.registerComponent("MouseTimeDisplay",YA);const nC=j.getComponent("ChaptersTrackMenuItem");class Gj extends nC{constructor(e,t){super(e,t),this.nonIconControl=!1,this.thumbnailDisplay=new sy(this.player_,{scaleFactor:.5}),this.el().insertBefore(this.thumbnailDisplay.el(),this.el().firstChild),Wt.useMetadataTrack(this.player_,"thumbnails",i=>{this.addClass("cv-has-thumbnails"),this.thumbnailDisplay.setTrack(i),this.thumbnailDisplay.update(this.options_.cue.startTime)})}update(){this.player_&&nC.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>(${QA(this.options_.cue.startTime,e)})</p></span>`}}const Kj=j.getComponent("ChaptersButton");class Xj extends Kj{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 Gj(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)}}j.registerComponent("ChaptersButton",Xj);const sC=j.getComponent("OffTextTrackMenuItem");let Qj=class extends sC{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){sC.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)}};j.registerComponent("OffTextTrackMenuItem",Qj);const Yj=j.getComponent("TextTrackButton"),Jj=j.getComponent("TextTrackMenuItem"),Zj=j.getComponent("OffTextTrackMenuItem");let e7=class extends Yj{createItems(e=[],t=Jj){let i;this.label_&&(i=`${this.label_} off`),e.push(new Zj(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}};j.registerComponent("TextTrackButton",e7);const t7={englishName:"Afar",nativeName:"Qafar"},i7={englishName:"Afrikaans",nativeName:"Afrikaans"},r7={englishName:"Aghem",nativeName:"Aghem"},n7={englishName:"Akan",nativeName:"Akan"},s7={englishName:"Amharic",nativeName:"�� ማáˆáŠ›"},a7={englishName:"Arabic",nativeName:"العربية"},o7={englishName:"Mapudungun",nativeName:"Mapudungun"},l7={englishName:"Assamese",nativeName:"অসমীয়া"},u7={englishName:"Asu",nativeName:"Kipare"},c7={englishName:"Asturian",nativeName:"asturianu"},h7={englishName:"Azerbaijani",nativeName:"azÉ™rbaycan dili"},d7={englishName:"Bashkir",nativeName:"Башҡорт"},f7={englishName:"Basaa",nativeName:"Æï¿½ s� a"},p7={englishName:"Belarusian",nativeName:"БеларуÑкаÑ"},m7={englishName:"Bemba",nativeName:"Ichibemba"},g7={englishName:"Bena",nativeName:"Hibena"},v7={englishName:"Bulgarian",nativeName:"българÑки"},y7={englishName:"Edo",nativeName:"Ẹ̀dó"},_7={englishName:"Bamanankan",nativeName:"bamanakan"},T7={englishName:"Bangla",nativeName:"বাংলা"},b7={englishName:"Tibetan",nativeName:"བོད་ཡིག"},S7={englishName:"Breton",nativeName:"brezhoneg"},x7={englishName:"Bodo",nativeName:"बड़ो"},C7={englishName:"Bosnian",nativeName:"bosanski"},E7={englishName:"Blin",nativeName:"ብሊን"},w7={englishName:"Catalan",nativeName:"catal� "},k7={englishName:"Chechen",nativeName:"нохчийн"},A7={englishName:"Chiga",nativeName:"Rukiga"},I7={englishName:"Cherokee",nativeName:"á£áŽ³áŽ©"},P7={englishName:"Corsican",nativeName:"Corsu"},D7={englishName:"Czech",nativeName:"ÄeÅ¡tina"},N7={englishName:"Church Slavic",nativeName:"церковноÑловеÌнÑкїй"},L7={englishName:"Welsh",nativeName:"Cymraeg"},O7={englishName:"Danish",nativeName:"dansk"},R7={englishName:"Taita",nativeName:"Kitaita"},M7={englishName:"German",nativeName:"Deutsch"},F7={englishName:"Zarma",nativeName:"Zarmaciine"},B7={englishName:"Lower Sorbian",nativeName:"dolnoserbšćina"},U7={englishName:"Duala",nativeName:"duálá"},j7={englishName:"Divehi",nativeName:"Þ‹Þ¨ÞˆÞ¬Þ€Þ¨Þ„Þ¦ÞÞ°"},$7={englishName:"Jola-Fonyi",nativeName:"joola"},q7={englishName:"Dzongkha",nativeName:"རྫོང་à½"},H7={englishName:"Embu",nativeName:"KÄ©embu"},V7={englishName:"Ewe",nativeName:"EÊ‹egbe"},z7={englishName:"Greek",nativeName:"Ελληνικά"},W7={englishName:"English",nativeName:"English"},G7={englishName:"Esperanto",nativeName:"esperanto"},K7={englishName:"Spanish",nativeName:"español"},X7={englishName:"Estonian",nativeName:"eesti"},Q7={englishName:"Basque",nativeName:"euskara"},Y7={englishName:"Ewondo",nativeName:"ewondo"},J7={englishName:"Persian",nativeName:"ÙØ§Ø±Ø³Ù‰"},Z7={englishName:"Fulah",nativeName:"Fulah"},e$={englishName:"Finnish",nativeName:"suomi"},t$={englishName:"Filipino",nativeName:"Filipino"},i$={englishName:"Faroese",nativeName:"føroyskt"},r$={englishName:"French",nativeName:"français"},n$={englishName:"Friulian",nativeName:"furlan"},s$={englishName:"Western Frisian",nativeName:"Frysk"},a$={englishName:"Irish",nativeName:"Gaeilge"},o$={englishName:"Scottish Gaelic",nativeName:"G� idhlig"},l$={englishName:"Galician",nativeName:"galego"},u$={englishName:"Guarani",nativeName:"Avañe’ẽ"},c$={englishName:"Alsatian",nativeName:"Elsässisch"},h$={englishName:"Gujarati",nativeName:"ગà«àªœàª°àª¾àª¤à«€"},d$={englishName:"Gusii",nativeName:"Ekegusii"},f$={englishName:"Manx",nativeName:"Gaelg"},p$={englishName:"Hausa",nativeName:"Hausa"},m$={englishName:"Hawaiian",nativeName:"ʻŌlelo HawaiÊ»i"},g$={englishName:"Hebrew",nativeName:"עברית"},v$={englishName:"Hindi",nativeName:"हिंदी"},y$={englishName:"Croatian",nativeName:"hrvatski"},_$={englishName:"Upper Sorbian",nativeName:"hornjoserbšćina"},T$={englishName:"Hungarian",nativeName:"magyar"},b$={englishName:"Armenian",nativeName:"Õ€Õ¡ÕµÕ¥Ö€Õ¥Õ¶"},S$={englishName:"Interlingua",nativeName:"interlingua"},x$={englishName:"Ibibio",nativeName:"Ibibio-Efik"},C$={englishName:"Indonesian",nativeName:"Indonesia"},E$={englishName:"Igbo",nativeName:"Igbo"},w$={englishName:"Yi",nativeName:"ꆈ�� ê±ê‚·"},k$={englishName:"Icelandic",nativeName:"Ãslenska"},A$={englishName:"Italian",nativeName:"italiano"},I$={englishName:"Inuktitut",nativeName:"Inuktitut"},P$={englishName:"Japanese",nativeName:"日本語"},D$={englishName:"Ngomba",nativeName:"Ndaꞌa"},N$={englishName:"Machame",nativeName:"Kimachame"},L$={englishName:"Javanese",nativeName:"Basa Jawa"},O$={englishName:"Georgian",nativeName:"ქáƒï¿½ï¿½ თული"},R$={englishName:"Kabyle",nativeName:"Taqbaylit"},M$={englishName:"Kamba",nativeName:"Kikamba"},F$={englishName:"Makonde",nativeName:"Chimakonde"},B$={englishName:"Kabuverdianu",nativeName:"kabuverdianu"},U$={englishName:"Koyra Chiini",nativeName:"Koyra ciini"},j$={englishName:"Kikuyu",nativeName:"Gikuyu"},$$={englishName:"Kazakh",nativeName:"қазақ тілі"},q$={englishName:"Kako",nativeName:"kakÉ”"},H$={englishName:"Greenlandic",nativeName:"kalaallisut"},V$={englishName:"Kalenjin",nativeName:"Kalenjin"},z$={englishName:"Khmer",nativeName:"ភាសាážáŸ’មែរ"},W$={englishName:"Kannada",nativeName:"ಕನà³à²¨à²¡"},G$={englishName:"Korean",nativeName:"한êµì–´"},K$={englishName:"Konkani",nativeName:"कोंकणी"},X$={englishName:"Kanuri",nativeName:"Kanuri"},Q$={englishName:"Kashmiri",nativeName:"Ú©Ù²Ø´ÙØ±"},Y$={englishName:"Shambala",nativeName:"Kishambaa"},J$={englishName:"Bafia",nativeName:"rikpa"},Z$={englishName:"Ripuarian",nativeName:"Kölsch"},e9={englishName:"Central Kurdish",nativeName:"کوردیی ناوەڕاست"},t9={englishName:"Cornish",nativeName:"kernewek"},i9={englishName:"Kyrgyz",nativeName:"Кыргыз"},r9={englishName:"Latin",nativeName:"lingua latÄ«na"},n9={englishName:"Langi",nativeName:"Kɨlaangi"},s9={englishName:"Luxembourgish",nativeName:"Lëtzebuergesch"},a9={englishName:"Ganda",nativeName:"Luganda"},o9={englishName:"Lakota",nativeName:"Lakȟólʼiyapi"},l9={englishName:"Lingala",nativeName:"lingála"},u9={englishName:"Lao",nativeName:"ລາວ"},c9={englishName:"Northern Luri",nativeName:"لۊری شومالی"},h9={englishName:"Lithuanian",nativeName:"lietuvių"},d9={englishName:"Luba-Katanga",nativeName:"Tshiluba"},f9={englishName:"Luo",nativeName:"Dholuo"},p9={englishName:"Luyia",nativeName:"Luluhia"},m9={englishName:"Latvian",nativeName:"latvieÅ¡u"},g9={englishName:"Masai",nativeName:"Maa"},v9={englishName:"Meru",nativeName:"KÄ©mÄ©rÅ©"},y9={englishName:"Morisyen",nativeName:"kreol morisien"},_9={englishName:"Malagasy",nativeName:"Malagasy"},T9={englishName:"Makhuwa-Meetto",nativeName:"Makua"},b9={englishName:"Metaʼ",nativeName:"metaʼ"},S9={englishName:"Maori",nativeName:"Reo MÄori"},x9={englishName:"Macedonian",nativeName:"македонÑки"},C9={englishName:"Malayalam",nativeName:"മലയാളം"},E9={englishName:"Mongolian",nativeName:"Монгол Ñ…Ñл"},w9={englishName:"Manipuri",nativeName:"মৈতৈলোনà§"},k9={englishName:"Mohawk",nativeName:"Kanien’kéha"},A9={englishName:"Marathi",nativeName:"मरा�� ी"},I9={englishName:"Malay",nativeName:"Bahasa Melayu"},P9={englishName:"Maltese",nativeName:"Malti"},D9={englishName:"Mundang",nativeName:"MUNDAÅŠ"},N9={englishName:"Burmese",nativeName:"ဗမာ"},L9={englishName:"Mazanderani",nativeName:"مازرونی"},O9={englishName:"Nama",nativeName:"Khoekhoegowab"},R9={englishName:"Norwegian BokmÃ¥l",nativeName:"norsk bokmÃ¥l"},M9={englishName:"North Ndebele",nativeName:"isiNdebele"},F9={englishName:"Nepali",nativeName:"नेपाली"},B9={englishName:"Dutch",nativeName:"Nederlands"},U9={englishName:"Kwasio",nativeName:"Kwasio"},j9={englishName:"Norwegian Nynorsk",nativeName:"nynorsk"},$9={englishName:"Ngiemboon",nativeName:"Shwóŋò ngiembɔɔn"},q9={englishName:"Norwegian",nativeName:"norsk"},H9={englishName:"N'ko",nativeName:"ß’ßžß"},V9={englishName:"South Ndebele",nativeName:"isiNdebele"},z9={englishName:"Sesotho sa Leboa",nativeName:"Sesotho sa Leboa"},W9={englishName:"Nuer",nativeName:"Thok Nath"},G9={englishName:"Nyankole",nativeName:"Runyankore"},K9={englishName:"Occitan",nativeName:"Occitan"},X9={englishName:"Oromo",nativeName:"Oromoo"},Q9={englishName:"Odia",nativeName:"ଓàœà¬¿à¬†"},Y9={englishName:"Ossetian",nativeName:"Ирон æвзаг"},J9={englishName:"Punjabi",nativeName:"ਪੰਜਾਬੀ"},Z9={englishName:"Papiamento",nativeName:"Papiamentu"},eq={englishName:"Polish",nativeName:"polski"},tq={englishName:"Prussian",nativeName:"prÅ«siskan"},iq={englishName:"Dari",nativeName:"درى"},rq={englishName:"Pashto",nativeName:"پښتو"},nq={englishName:"Portuguese",nativeName:"português"},sq={englishName:"K'iche'",nativeName:"K'iche'"},aq={englishName:"Quechua",nativeName:"runasimi"},oq={englishName:"Romansh",nativeName:"rumantsch"},lq={englishName:"Rundi",nativeName:"Ikirundi"},uq={englishName:"Romanian",nativeName:"română"},cq={englishName:"Rombo",nativeName:"Kihorombo"},hq={englishName:"Russian",nativeName:"руÑÑкий"},dq={englishName:"Kinyarwanda",nativeName:"Kinyarwanda"},fq={englishName:"Rwa",nativeName:"Kiruwa"},pq={englishName:"Sanskrit",nativeName:"संसà¥à¤•ृत"},mq={englishName:"Sakha",nativeName:"Саха"},gq={englishName:"Samburu",nativeName:"Kisampur"},vq={englishName:"Sangu",nativeName:"Ishisangu"},yq={englishName:"Sindhi",nativeName:"سنڌي"},_q={englishName:"Northern Sami",nativeName:"davvisámegiella"},Tq={englishName:"Sena",nativeName:"sena"},bq={englishName:"Koyraboro Senni",nativeName:"Koyraboro senni"},Sq={englishName:"Sango",nativeName:"Sängö"},xq={englishName:"Tachelhit",nativeName:"ⵜⴰⵛâµâµƒâµ‰âµœ"},Cq={englishName:"Sinhala",nativeName:"සිංහල"},Eq={englishName:"Slovak",nativeName:"slovenÄina"},wq={englishName:"Slovenian",nativeName:"slovenÅ¡Äina"},kq={englishName:"Sami (Southern)",nativeName:"Ã¥arjelsaemiengïele"},Aq={englishName:"Sami (Lule)",nativeName:"julevusámegiella"},Iq={englishName:"Sami (Inari)",nativeName:"anarâškielâ"},Pq={englishName:"Sami (Skolt)",nativeName:"sää´mÇ©iõll"},Dq={englishName:"Shona",nativeName:"chiShona"},Nq={englishName:"Somali",nativeName:"Soomaali"},Lq={englishName:"Albanian",nativeName:"shqip"},Oq={englishName:"Serbian",nativeName:"srpski"},Rq={englishName:"siSwati",nativeName:"Siswati"},Mq={englishName:"Saho",nativeName:"Saho"},Fq={englishName:"Sesotho",nativeName:"Sesotho"},Bq={englishName:"Swedish",nativeName:"svenska"},Uq={englishName:"Kiswahili",nativeName:"Kiswahili"},jq={englishName:"Syriac",nativeName:"ܣܘܪÜÜÜ"},$q={englishName:"Tamil",nativeName:"தமிழà¯"},qq={englishName:"Telugu",nativeName:"తెలà±à°—à±"},Hq={englishName:"Teso",nativeName:"Kiteso"},Vq={englishName:"Tajik",nativeName:"Тоҷикӣ"},zq={englishName:"Thai",nativeName:"ไทย"},Wq={englishName:"Tigrinya",nativeName:"ትáŒáˆáŠ›"},Gq={englishName:"Tigre",nativeName:"ትáŒáˆ¨"},Kq={englishName:"Turkmen",nativeName:"Türkmen dili"},Xq={englishName:"Setswana",nativeName:"Setswana"},Qq={englishName:"Tongan",nativeName:"lea fakatonga"},Yq={englishName:"Turkish",nativeName:"Türkçe"},Jq={englishName:"Tsonga",nativeName:"Xitsonga"},Zq={englishName:"Tatar",nativeName:"Татар"},eH={englishName:"Tasawaq",nativeName:"Tasawaq senni"},tH={englishName:"Central Atlas Tamazight",nativeName:"TamaziÉ£t n laá¹laá¹£"},iH={englishName:"Uyghur",nativeName:"ئۇيغۇرچە"},rH={englishName:"Ukrainian",nativeName:"українÑька"},nH={englishName:"Urdu",nativeName:"Ø§ÙØ±Ø¯Ùˆ"},sH={englishName:"Uzbek",nativeName:"o‘zbek"},aH={englishName:"Vai",nativeName:"ꕙꔤ"},oH={englishName:"Venda",nativeName:"Tshivenḓa"},lH={englishName:"Vietnamese",nativeName:"TiêÌng Việt"},uH={englishName:"Volapük",nativeName:"Volapük"},cH={englishName:"Vunjo",nativeName:"Kyivunjo"},hH={englishName:"Walser",nativeName:"Walser"},dH={englishName:"Wolaytta",nativeName:"ወላá‹á‰³á‰±"},fH={englishName:"Wolof",nativeName:"Wolof"},pH={englishName:"isiXhosa",nativeName:"isiXhosa"},mH={englishName:"Soga",nativeName:"Olusoga"},gH={englishName:"Yangben",nativeName:"nuasue"},vH={englishName:"Yiddish",nativeName:"ייִדיש"},yH={englishName:"Yoruba",nativeName:"Èdè Yorùbá"},_H={englishName:"Standard Moroccan Tamazight",nativeName:"ⵜⴰⵎⴰⵣⵉⵖⵜ"},TH={englishName:"Chinese",nativeName:"䏿–‡"},bH={englishName:"isiZulu",nativeName:"isiZulu"},sv={aa:t7,"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:i7,"af-na":{englishName:"Afrikaans (Namibia)",nativeName:"Afrikaans (Namibië)"},"af-za":{englishName:"Afrikaans (South Africa)",nativeName:"Afrikaans (Suid-Afrika)"},agq:r7,"agq-cm":{englishName:"Aghem (Cameroon)",nativeName:"Aghem (K� m� lûŋ)"},ak:n7,"ak-gh":{englishName:"Akan (Ghana)",nativeName:"Akan (Gaana)"},am:s7,"am-et":{englishName:"Amharic (Ethiopia)",nativeName:"�� ማáˆáŠ› (ኢትዮጵያ)"},ar:a7,"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:o7,"arn-cl":{englishName:"Mapudungun (Chile)",nativeName:"Mapudungun (Chile)"},as:l7,"as-in":{englishName:"Assamese (India)",nativeName:"অসমীয়া (à¦à¦¾à§°à¦¤)"},asa:u7,"asa-tz":{englishName:"Asu (Tanzania)",nativeName:"Kipare (Tadhania)"},ast:c7,"ast-es":{englishName:"Asturian (Spain)",nativeName:"asturianu (España)"},az:h7,"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:d7,"ba-ru":{englishName:"Bashkir (Russia)",nativeName:"Башҡорт (� Ó™Ñәй)"},bas:f7,"bas-cm":{englishName:"Basaa (Cameroon)",nativeName:"Æï¿½ s� a (K� mɛ̀rûn)"},be:p7,"be-by":{englishName:"Belarusian (Belarus)",nativeName:"БеларуÑÐºÐ°Ñ (БеларуÑÑŒ)"},bem:m7,"bem-zm":{englishName:"Bemba (Zambia)",nativeName:"Ichibemba (Zambia)"},bez:g7,"bez-tz":{englishName:"Bena (Tanzania)",nativeName:"Hibena (Hutanzania)"},bg:v7,"bg-bg":{englishName:"Bulgarian (Bulgaria)",nativeName:"българÑки (БългариÑ)"},bin:y7,"bin-ng":{englishName:"Edo (Nigeria)",nativeName:"Ẹ̀dó (Nigeria)"},bm:_7,"bm-latn":{englishName:"Bamanankan (Latin)",nativeName:"bamanakan"},"bm-latn-ml":{englishName:"Bamanankan (Latin, Mali)",nativeName:"bamanakan (Mali)"},bn:T7,"bn-bd":{englishName:"Bangla (Bangladesh)",nativeName:"বাংলা (বাংলাদেশ)"},"bn-in":{englishName:"Bangla (India)",nativeName:"বাংলা (à¦à¦¾à¦°à¦¤)"},bo:b7,"bo-cn":{englishName:"Tibetan (China)",nativeName:"བོད་ཡིག (ཀྲུང་ཧà¾à¼‹à½˜à½²à¼‹à½‘མངས་སྤྱི་མà½à½´à½“་རྒྱལ་à½à½–à¼)"},"bo-in":{englishName:"Tibetan (India)",nativeName:"བོད་སà¾à½‘་ (རྒྱ་གར་)"},br:S7,"br-fr":{englishName:"Breton (France)",nativeName:"brezhoneg (Frañs)"},brx:x7,"brx-in":{englishName:"Bodo (India)",nativeName:"बड़ो (à¤à¤¾à¤°à¤¤)"},bs:C7,"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:E7,"byn-er":{englishName:"Blin (Eritrea)",nativeName:"ብሊን (ኤáˆá‰µáˆ«)"},ca:w7,"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:k7,"ce-ru":{englishName:"Chechen (Russia)",nativeName:"нохчийн (� оÑÑи)"},cgg:A7,"cgg-ug":{englishName:"Chiga (Uganda)",nativeName:"Rukiga (Uganda)"},chr:I7,"chr-cher":{englishName:"Cherokee",nativeName:"á£áŽ³áŽ©"},"chr-cher-us":{englishName:"Cherokee (Cherokee)",nativeName:"á£áŽ³áŽ© (á£áŽ³áŽ©)"},co:P7,"co-fr":{englishName:"Corsican (France)",nativeName:"Corsu (Francia)"},cs:D7,"cs-cz":{englishName:"Czech (Czech Republic)",nativeName:"ÄeÅ¡tina (ÄŒeská republika)"},cu:N7,"cu-ru":{englishName:"Church Slavic (Russia)",nativeName:"церковноÑловеÌнÑкїй (рѡÑÑÑ–Ìа)"},cy:L7,"cy-gb":{englishName:"Welsh (United Kingdom)",nativeName:"Cymraeg (Y Deyrnas Unedig)"},da:O7,"da-dk":{englishName:"Danish (Denmark)",nativeName:"dansk (Danmark)"},"da-gl":{englishName:"Danish (Greenland)",nativeName:"dansk (Grønland)"},dav:R7,"dav-ke":{englishName:"Taita (Kenya)",nativeName:"Kitaita (Kenya)"},de:M7,"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:F7,"dje-ne":{englishName:"Zarma (Niger)",nativeName:"Zarmaciine (Nižer)"},dsb:B7,"dsb-de":{englishName:"Lower Sorbian (Germany)",nativeName:"dolnoserbšćina (Nimska)"},dua:U7,"dua-cm":{englishName:"Duala (Cameroon)",nativeName:"duálá (Cameroun)"},dv:j7,"dv-mv":{englishName:"Divehi (Maldives)",nativeName:"Þ‹Þ¨ÞˆÞ¬Þ€Þ¨Þ„Þ¦ÞÞ° (Þ‹Þ¨ÞˆÞ¬Þ€Þ¨ ÞƒÞ§Þ‡Þ°Þ–Þ¬)"},dyo:$7,"dyo-sn":{englishName:"Jola-Fonyi (Senegal)",nativeName:"joola (Senegal)"},dz:q7,"dz-bt":{englishName:"Dzongkha (Bhutan)",nativeName:"རྫོང་འ(�� བྲུག)"},ebu:H7,"ebu-ke":{englishName:"Embu (Kenya)",nativeName:"KÄ©embu (Kenya)"},ee:V7,"ee-gh":{englishName:"Ewe (Ghana)",nativeName:"EÊ‹egbe (Ghana nutome)"},"ee-tg":{englishName:"Ewe (Togo)",nativeName:"EÊ‹egbe (Togo nutome)"},el:z7,"el-cy":{englishName:"Greek (Cyprus)",nativeName:"Ελληνικά (ΚÏÏ€Ïος)"},"el-gr":{englishName:"Greek (Greece)",nativeName:"Ελληνικά (Ελλάδα)"},en:W7,"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:G7,"eo-001":{englishName:"Esperanto (World)",nativeName:"esperanto (World)"},es:K7,"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:X7,"et-ee":{englishName:"Estonian (Estonia)",nativeName:"eesti (Eesti)"},eu:Q7,"eu-es":{englishName:"Basque (Basque)",nativeName:"euskara (euskara)"},ewo:Y7,"ewo-cm":{englishName:"Ewondo (Cameroon)",nativeName:"ewondo (KamÉ™rún)"},fa:J7,"fa-ir":{englishName:"Persian (Iran)",nativeName:"ÙØ§Ø±Ø³Ù‰ (ایران)"},ff:Z7,"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:e$,"fi-fi":{englishName:"Finnish (Finland)",nativeName:"suomi (Suomi)"},fil:t$,"fil-ph":{englishName:"Filipino (Philippines)",nativeName:"Filipino (Pilipinas)"},fo:i$,"fo-dk":{englishName:"Faroese (Denmark)",nativeName:"føroyskt (Danmark)"},"fo-fo":{englishName:"Faroese (Faroe Islands)",nativeName:"føroyskt (Føroyar)"},fr:r$,"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:n$,"fur-it":{englishName:"Friulian (Italy)",nativeName:"furlan (Italie)"},fy:s$,"fy-nl":{englishName:"Western Frisian (Netherlands)",nativeName:"Frysk (Nederlân)"},ga:a$,"ga-ie":{englishName:"Irish (Ireland)",nativeName:"Gaeilge (Éire)"},gd:o$,"gd-gb":{englishName:"Scottish Gaelic (United Kingdom)",nativeName:"G� idhlig (An Rìoghachd Aonaichte)"},gl:l$,"gl-es":{englishName:"Galician (Galician)",nativeName:"galego (galego)"},gn:u$,"gn-py":{englishName:"Guarani (Paraguay)",nativeName:"Avañe’ẽ (Paraguái)"},gsw:c$,"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:h$,"gu-in":{englishName:"Gujarati (India)",nativeName:"ગà«àªœàª°àª¾àª¤à«€ (àªàª¾àª°àª¤)"},guz:d$,"guz-ke":{englishName:"Gusii (Kenya)",nativeName:"Ekegusii (Kenya)"},gv:f$,"gv-im":{englishName:"Manx (Isle of Man)",nativeName:"Gaelg (Ellan Vannin)"},ha:p$,"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:m$,"haw-us":{englishName:"Hawaiian (United States)",nativeName:"ʻŌlelo HawaiÊ»i (Ê»Amelika Hui PÅ« Ê»Ia)"},he:g$,"he-il":{englishName:"Hebrew (Israel)",nativeName:"עברית (ישר×ל)"},hi:v$,"hi-in":{englishName:"Hindi (India)",nativeName:"हिंदी (à¤à¤¾à¤°à¤¤)"},hr:y$,"hr-ba":{englishName:"Croatian (Bosnia and Herzegovina)",nativeName:"hrvatski (Bosna i Hercegovina)"},"hr-hr":{englishName:"Croatian (Croatia)",nativeName:"hrvatski (Hrvatska)"},hsb:_$,"hsb-de":{englishName:"Upper Sorbian (Germany)",nativeName:"hornjoserbšćina (NÄ›mska)"},hu:T$,"hu-hu":{englishName:"Hungarian (Hungary)",nativeName:"magyar (Magyarország)"},hy:b$,"hy-am":{englishName:"Armenian (Armenia)",nativeName:"Õ€Õ¡ÕµÕ¥Ö€Õ¥Õ¶ (Õ€Õ¡ÕµÕ¡Õ½Õ¿Õ¡Õ¶)"},ia:S$,"ia-001":{englishName:"Interlingua (World)",nativeName:"interlingua (World)"},"ia-fr":{englishName:"Interlingua (France)",nativeName:"interlingua (Francia)"},ibb:x$,"ibb-ng":{englishName:"Ibibio (Nigeria)",nativeName:"Ibibio-Efik (Nigeria)"},id:C$,"id-id":{englishName:"Indonesian (Indonesia)",nativeName:"Indonesia (Indonesia)"},ig:E$,"ig-ng":{englishName:"Igbo (Nigeria)",nativeName:"Igbo (Nigeria)"},ii:w$,"ii-cn":{englishName:"Yi (China)",nativeName:"ꆈ�� ê±ê‚· (êꉸê“ꂱê‡ê‰¼ê‡©)"},is:k$,"is-is":{englishName:"Icelandic (Iceland)",nativeName:"Ãslenska (Ãsland)"},it:A$,"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:I$,"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:P$,"ja-jp":{englishName:"Japanese (Japan)",nativeName:"日本語 (日本)"},jgo:D$,"jgo-cm":{englishName:"Ngomba (Cameroon)",nativeName:"Ndaꞌa (KamÉ›lûn)"},jmc:N$,"jmc-tz":{englishName:"Machame (Tanzania)",nativeName:"Kimachame (Tanzania)"},jv:L$,"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:O$,"ka-ge":{englishName:"Georgian (Georgia)",nativeName:"ქáƒï¿½ï¿½ თული (სáƒáƒ¥áƒï¿½ï¿½ თველáƒ)"},kab:R$,"kab-dz":{englishName:"Kabyle (Algeria)",nativeName:"Taqbaylit (Lezzayer)"},kam:M$,"kam-ke":{englishName:"Kamba (Kenya)",nativeName:"Kikamba (Kenya)"},kde:F$,"kde-tz":{englishName:"Makonde (Tanzania)",nativeName:"Chimakonde (Tanzania)"},kea:B$,"kea-cv":{englishName:"Kabuverdianu (Cabo Verde)",nativeName:"kabuverdianu (Kabu Verdi)"},khq:U$,"khq-ml":{englishName:"Koyra Chiini (Mali)",nativeName:"Koyra ciini (Maali)"},ki:j$,"ki-ke":{englishName:"Kikuyu (Kenya)",nativeName:"Gikuyu (Kenya)"},kk:$$,"kk-kz":{englishName:"Kazakh (Kazakhstan)",nativeName:"қазақ тілі (ҚазақÑтан)"},kkj:q$,"kkj-cm":{englishName:"Kako (Cameroon)",nativeName:"kakÉ” (KamÉ›run)"},kl:H$,"kl-gl":{englishName:"Greenlandic (Greenland)",nativeName:"kalaallisut (Kalaallit Nunaat)"},kln:V$,"kln-ke":{englishName:"Kalenjin (Kenya)",nativeName:"Kalenjin (Emetab Kenya)"},km:z$,"km-kh":{englishName:"Khmer (Cambodia)",nativeName:"ភាសាážáŸ’មែរ (កម្ពុជា)"},kn:W$,"kn-in":{englishName:"Kannada (India)",nativeName:"ಕನà³à²¨à²¡ (à²à²¾à²°à²¤)"},ko:G$,"ko-kp":{englishName:"Korean (North Korea)",nativeName:"한êµì–´ (조�� 민주주ì˜ì¸ë¯¼ê³µí™”êµ)"},"ko-kr":{englishName:"Korean (Korea)",nativeName:"한êµì–´(대한민êµ)"},kok:K$,"kok-in":{englishName:"Konkani (India)",nativeName:"कोंकणी (à¤à¤¾à¤°à¤¤)"},kr:X$,"kr-ng":{englishName:"Kanuri (Nigeria)",nativeName:"Kanuri (Nigeria)"},ks:Q$,"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:Y$,"ksb-tz":{englishName:"Shambala (Tanzania)",nativeName:"Kishambaa (Tanzania)"},ksf:J$,"ksf-cm":{englishName:"Bafia (Cameroon)",nativeName:"rikpa (kamÉ›rún)"},ksh:Z$,"ksh-de":{englishName:"Ripuarian (Germany)",nativeName:"Kölsch (Doütschland)"},ku:e9,"ku-arab":{englishName:"Central Kurdish",nativeName:"کوردیی ناوەڕاست"},"ku-arab-iq":{englishName:"Central Kurdish (Iraq)",nativeName:"کوردیی ناوەڕاست (کوردستان)"},"ku-arab-ir":{englishName:"Kurdish (Perso-Arabic, Iran)",nativeName:"کوردی (ئێران)"},kw:t9,"kw-gb":{englishName:"Cornish (United Kingdom)",nativeName:"kernewek (Rywvaneth Unys)"},ky:i9,"ky-kg":{englishName:"Kyrgyz (Kyrgyzstan)",nativeName:"Кыргыз (КыргызÑтан)"},la:r9,"la-001":{englishName:"Latin (World)",nativeName:"lingua latÄ«na (World)"},lag:n9,"lag-tz":{englishName:"Langi (Tanzania)",nativeName:"Kɨlaangi (TaansanÃa)"},lb:s9,"lb-lu":{englishName:"Luxembourgish (Luxembourg)",nativeName:"Lëtzebuergesch (Lëtzebuerg)"},lg:a9,"lg-ug":{englishName:"Ganda (Uganda)",nativeName:"Luganda (Yuganda)"},lkt:o9,"lkt-us":{englishName:"Lakota (United States)",nativeName:"Lakȟólʼiyapi (MÃlahaÅ‹ska TÈŸamákÈŸoÄhe)"},ln:l9,"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:u9,"lo-la":{englishName:"Lao (Laos)",nativeName:"ລາວ (ລາວ)"},lrc:c9,"lrc-iq":{englishName:"Northern Luri (Iraq)",nativeName:"لۊری شومالی (Iraq)"},"lrc-ir":{englishName:"Northern Luri (Iran)",nativeName:"لۊری شومالی (Iran)"},lt:h9,"lt-lt":{englishName:"Lithuanian (Lithuania)",nativeName:"lietuvių (Lietuva)"},lu:d9,"lu-cd":{englishName:"Luba-Katanga (Congo DRC)",nativeName:"Tshiluba (Ditunga wa Kongu)"},luo:f9,"luo-ke":{englishName:"Luo (Kenya)",nativeName:"Dholuo (Kenya)"},luy:p9,"luy-ke":{englishName:"Luyia (Kenya)",nativeName:"Luluhia (Kenya)"},lv:m9,"lv-lv":{englishName:"Latvian (Latvia)",nativeName:"latvieÅ¡u (Latvija)"},mas:g9,"mas-ke":{englishName:"Masai (Kenya)",nativeName:"Maa (Kenya)"},"mas-tz":{englishName:"Masai (Tanzania)",nativeName:"Maa (Tansania)"},mer:v9,"mer-ke":{englishName:"Meru (Kenya)",nativeName:"KÄ©mÄ©rÅ© (Kenya)"},mfe:y9,"mfe-mu":{englishName:"Morisyen (Mauritius)",nativeName:"kreol morisien (Moris)"},mg:_9,"mg-mg":{englishName:"Malagasy (Madagascar)",nativeName:"Malagasy (Madagasikara)"},mgh:T9,"mgh-mz":{englishName:"Makhuwa-Meetto (Mozambique)",nativeName:"Makua (Umozambiki)"},mgo:b9,"mgo-cm":{englishName:"Metaʼ (Cameroon)",nativeName:"metaʼ (Kamalun)"},mi:S9,"mi-nz":{englishName:"Maori (New Zealand)",nativeName:"Reo MÄori (Aotearoa)"},mk:x9,"mk-mk":{englishName:"Macedonian (Macedonia, FYRO)",nativeName:"македонÑки (� епублика Македонија)"},ml:C9,"ml-in":{englishName:"Malayalam (India)",nativeName:"മലയാളം (ഇനàµà´¤àµà´¯)"},mn:E9,"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:w9,"mni-in":{englishName:"Manipuri (India)",nativeName:"মৈতৈলোনৠ(India)"},moh:k9,"moh-ca":{englishName:"Mohawk (Mohawk)",nativeName:"Kanien'kéha"},mr:A9,"mr-in":{englishName:"Marathi (India)",nativeName:"मरा�� ी (à¤à¤¾à¤°à¤¤)"},ms:I9,"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:P9,"mt-mt":{englishName:"Maltese (Malta)",nativeName:"Malti (Malta)"},mua:D9,"mua-cm":{englishName:"Mundang (Cameroon)",nativeName:"MUNDAÅŠ (kameruÅ‹)"},my:N9,"my-mm":{englishName:"Burmese (Myanmar)",nativeName:"ဗမာ (မြန်မာ)"},mzn:L9,"mzn-ir":{englishName:"Mazanderani (Iran)",nativeName:"مازرونی (ایران)"},naq:O9,"naq-na":{englishName:"Nama (Namibia)",nativeName:"Khoekhoegowab (Namibiab)"},nb:R9,"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:M9,"nd-zw":{englishName:"North Ndebele (Zimbabwe)",nativeName:"isiNdebele (Zimbabwe)"},ne:F9,"ne-in":{englishName:"Nepali (India)",nativeName:"नेपाली (à¤à¤¾à¤°à¤¤)"},"ne-np":{englishName:"Nepali (Nepal)",nativeName:"नेपाली (नेपाल)"},nl:B9,"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:U9,"nmg-cm":{englishName:"Kwasio (Cameroon)",nativeName:"Kwasio (Kamerun)"},nn:j9,"nn-no":{englishName:"Norwegian Nynorsk (Norway)",nativeName:"nynorsk (Noreg)"},nnh:$9,"nnh-cm":{englishName:"Ngiemboon (Cameroon)",nativeName:"Shwóŋò ngiembɔɔn (K� malûm)"},no:q9,nqo:H9,"nqo-gn":{englishName:"N'ko (Guinea)",nativeName:"ß’ßžß (ߖߌ߬ߣß߬ ߞߊ߲ߓßß²)"},nr:V9,"nr-za":{englishName:"South Ndebele (South Africa)",nativeName:"isiNdebele (South Africa)"},nso:z9,"nso-za":{englishName:"Sesotho sa Leboa (South Africa)",nativeName:"Sesotho sa Leboa (Afrika Borwa)"},nus:W9,"nus-ss":{englishName:"Nuer (South Sudan)",nativeName:"Thok Nath (South Sudan)"},nyn:G9,"nyn-ug":{englishName:"Nyankole (Uganda)",nativeName:"Runyankore (Uganda)"},oc:K9,"oc-fr":{englishName:"Occitan (France)",nativeName:"Occitan (França)"},om:X9,"om-et":{englishName:"Oromo (Ethiopia)",nativeName:"Oromoo (Itoophiyaa)"},"om-ke":{englishName:"Oromo (Kenya)",nativeName:"Oromoo (Keeniyaa)"},or:Q9,"or-in":{englishName:"Odia (India)",nativeName:"ଓàœà¬¿à¬† (à¬à¬¾à¬°à¬¤)"},os:Y9,"os-ge":{englishName:"Ossetian (Georgia)",nativeName:"Ирон æвзаг (ГуырдзыÑтон)"},"os-ru":{englishName:"Ossetian (Russia)",nativeName:"Ирон æвзаг (УӕрӕÑе)"},pa:J9,"pa-arab":{englishName:"Punjabi",nativeName:"پنجابی"},"pa-arab-pk":{englishName:"Punjabi (Pakistan)",nativeName:"پنجابی (پاکستان)"},"pa-in":{englishName:"Punjabi (India)",nativeName:"ਪੰਜਾਬੀ (à¨à¨¾à¨°à¨¤)"},pap:Z9,"pap-029":{englishName:"Papiamento (Caribbean)",nativeName:"Papiamentu (Caribbean)"},pl:eq,"pl-pl":{englishName:"Polish (Poland)",nativeName:"polski (Polska)"},prg:tq,"prg-001":{englishName:"Prussian (World)",nativeName:"prÅ«siskan (swÄ«tai)"},prs:iq,"prs-af":{englishName:"Dari (Afghanistan)",nativeName:"درى (Ø§ÙØºØ§Ù†Ø³ØªØ§Ù†)"},ps:rq,"ps-af":{englishName:"Pashto (Afghanistan)",nativeName:"پښتو (Ø§ÙØºØ§Ù†Ø³ØªØ§Ù†)"},pt:nq,"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:sq,"quc-latn":{englishName:"K'iche'",nativeName:"K'iche'"},"quc-latn-gt":{englishName:"K'iche' (Guatemala)",nativeName:"K'iche' (Guatemala)"},quz:aq,"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:oq,"rm-ch":{englishName:"Romansh (Switzerland)",nativeName:"rumantsch (Svizra)"},rn:lq,"rn-bi":{englishName:"Rundi (Burundi)",nativeName:"Ikirundi (Uburundi)"},ro:uq,"ro-md":{englishName:"Romanian (Moldova)",nativeName:"română (Republica Moldova)"},"ro-ro":{englishName:"Romanian (Romania)",nativeName:"română (România)"},rof:cq,"rof-tz":{englishName:"Rombo (Tanzania)",nativeName:"Kihorombo (Tanzania)"},ru:hq,"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:dq,"rw-rw":{englishName:"Kinyarwanda (Rwanda)",nativeName:"Kinyarwanda (Rwanda)"},rwk:fq,"rwk-tz":{englishName:"Rwa (Tanzania)",nativeName:"Kiruwa (Tanzania)"},sa:pq,"sa-in":{englishName:"Sanskrit (India)",nativeName:"संसà¥à¤•ृत (à¤à¤¾à¤°à¤¤à¤®à¥)"},sah:mq,"sah-ru":{englishName:"Sakha (Russia)",nativeName:"Саха (� оÑÑиÑ)"},saq:gq,"saq-ke":{englishName:"Samburu (Kenya)",nativeName:"Kisampur (Kenya)"},sbp:vq,"sbp-tz":{englishName:"Sangu (Tanzania)",nativeName:"Ishisangu (Tansaniya)"},sd:yq,"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:_q,"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:Tq,"seh-mz":{englishName:"Sena (Mozambique)",nativeName:"sena (Moçambique)"},ses:bq,"ses-ml":{englishName:"Koyraboro Senni (Mali)",nativeName:"Koyraboro senni (Maali)"},sg:Sq,"sg-cf":{englishName:"Sango (Central African Republic)",nativeName:"Sängö (Ködörösêse tî Bêafrîka)"},shi:xq,"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:Cq,"si-lk":{englishName:"Sinhala (Sri Lanka)",nativeName:"සිංහල (à·à·Šâ€à¶»à·“ ලංකà·à·€)"},sk:Eq,"sk-sk":{englishName:"Slovak (Slovakia)",nativeName:"slovenÄina (Slovensko)"},sl:wq,"sl-si":{englishName:"Slovenian (Slovenia)",nativeName:"slovenÅ¡Äina (Slovenija)"},sma:kq,"sma-no":{englishName:"Sami, Southern (Norway)",nativeName:"Ã¥arjelsaemiengïele (Nöörje)"},"sma-se":{englishName:"Sami, Southern (Sweden)",nativeName:"Ã¥arjelsaemiengïele (Sveerje)"},smj:Aq,"smj-no":{englishName:"Sami, Lule (Norway)",nativeName:"julevusámegiella (Vuodna)"},"smj-se":{englishName:"Sami, Lule (Sweden)",nativeName:"julevusámegiella (Svierik)"},smn:Iq,"smn-fi":{englishName:"Sami, Inari (Finland)",nativeName:"anarâškielâ (Suomâ)"},sms:Pq,"sms-fi":{englishName:"Sami, Skolt (Finland)",nativeName:"sää´mÇ©iõll (Lää´ddjânnam)"},sn:Dq,"sn-latn":{englishName:"Shona (Latin)",nativeName:"chiShona (Latin)"},"sn-latn-zw":{englishName:"Shona (Latin, Zimbabwe)",nativeName:"chiShona (Zimbabwe)"},so:Nq,"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:Lq,"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:Oq,"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:Rq,"ss-sz":{englishName:"siSwati (Swaziland)",nativeName:"siSwati (Swaziland)"},"ss-za":{englishName:"siSwati (South Africa)",nativeName:"siSwati (South Africa)"},ssy:Mq,"ssy-er":{englishName:"Saho (Eritrea)",nativeName:"Saho (Eretria)"},st:Fq,"st-ls":{englishName:"Sesotho (Lesotho)",nativeName:"Sesotho (Lesotho)"},"st-za":{englishName:"Sesotho (South Africa)",nativeName:"Sesotho (South Africa)"},sv:Bq,"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:Uq,"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:jq,"syr-sy":{englishName:"Syriac (Syria)",nativeName:"ܣܘܪÜÜÜ (ܣܘܪÜÜ)"},ta:$q,"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:qq,"te-in":{englishName:"Telugu (India)",nativeName:"తెలà±à°—à± (à°à°¾à°°à°¤ దేశం)"},teo:Hq,"teo-ke":{englishName:"Teso (Kenya)",nativeName:"Kiteso (Kenia)"},"teo-ug":{englishName:"Teso (Uganda)",nativeName:"Kiteso (Uganda)"},tg:Vq,"tg-cyrl":{englishName:"Tajik (Cyrillic)",nativeName:"Тоҷикӣ"},"tg-cyrl-tj":{englishName:"Tajik (Cyrillic, Tajikistan)",nativeName:"Тоҷикӣ (ТоҷикиÑтон)"},th:zq,"th-th":{englishName:"Thai (Thailand)",nativeName:"ไทย (ไทย)"},ti:Wq,"ti-er":{englishName:"Tigrinya (Eritrea)",nativeName:"ትáŒáˆáŠ› (ኤáˆá‰µáˆ«)"},"ti-et":{englishName:"Tigrinya (Ethiopia)",nativeName:"ትáŒáˆáŠ› (ኢትዮጵያ)"},tig:Gq,"tig-er":{englishName:"Tigre (Eritrea)",nativeName:"ትáŒáˆ¨ (ኤáˆá‰µáˆ«)"},tk:Kq,"tk-tm":{englishName:"Turkmen (Turkmenistan)",nativeName:"Türkmen dili (Türkmenistan)"},tn:Xq,"tn-bw":{englishName:"Setswana (Botswana)",nativeName:"Setswana (Botswana)"},"tn-za":{englishName:"Setswana (South Africa)",nativeName:"Setswana (Aforika Borwa)"},to:Qq,"to-to":{englishName:"Tongan (Tonga)",nativeName:"lea fakatonga (Tonga)"},tr:Yq,"tr-cy":{englishName:"Turkish (Cyprus)",nativeName:"Türkçe (Kıbrıs)"},"tr-tr":{englishName:"Turkish (Turkey)",nativeName:"Türkçe (Türkiye)"},ts:Jq,"ts-za":{englishName:"Xitsonga (South Africa)",nativeName:"Xitsonga (South Africa)"},tt:Zq,"tt-ru":{englishName:"Tatar (Russia)",nativeName:"Татар (� оÑÑиÑ)"},twq:eH,"twq-ne":{englishName:"Tasawaq (Niger)",nativeName:"Tasawaq senni (Nižer)"},tzm:tH,"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:iH,"ug-cn":{englishName:"Uyghur (China)",nativeName:"ئۇيغۇرچە (Ø¬Û‡ÚØ®Û‡Ø§ خەلق جۇمھۇرىيىتى)"},uk:rH,"uk-ua":{englishName:"Ukrainian (Ukraine)",nativeName:"українÑька (Україна)"},ur:nH,"ur-in":{englishName:"Urdu (India)",nativeName:"اردو (بھارت)"},"ur-pk":{englishName:"Urdu (Pakistan)",nativeName:"Ø§ÙØ±Ø¯Ùˆ (پاکستان)"},uz:sH,"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:aH,"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:oH,"ve-za":{englishName:"Venda (South Africa)",nativeName:"Tshivenḓa (South Africa)"},vi:lH,"vi-vn":{englishName:"Vietnamese (Vietnam)",nativeName:"TiêÌng Việt (Việt Nam)"},vo:uH,"vo-001":{englishName:"Volapük (World)",nativeName:"Volapük (World)"},vun:cH,"vun-tz":{englishName:"Vunjo (Tanzania)",nativeName:"Kyivunjo (Tanzania)"},wae:hH,"wae-ch":{englishName:"Walser (Switzerland)",nativeName:"Walser (Schwiz)"},wal:dH,"wal-et":{englishName:"Wolaytta (Ethiopia)",nativeName:"ወላá‹á‰³á‰± (ኢትዮጵያ)"},wo:fH,"wo-sn":{englishName:"Wolof (Senegal)",nativeName:"Wolof (Senegaal)"},xh:pH,"xh-za":{englishName:"isiXhosa (South Africa)",nativeName:"isiXhosa (eMzantsi Afrika)"},xog:mH,"xog-ug":{englishName:"Soga (Uganda)",nativeName:"Olusoga (Yuganda)"},yav:gH,"yav-cm":{englishName:"Yangben (Cameroon)",nativeName:"nuasue (Kemelún)"},yi:vH,"yi-001":{englishName:"Yiddish (World)",nativeName:"ייִדיש (וועלט)"},yo:yH,"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:_H,"zgh-tfng":{englishName:"Standard Moroccan Tamazight (Tifinagh)",nativeName:"ⵜⴰⵎⴰⵣⵉⵖⵜ"},"zgh-tfng-ma":{englishName:"Standard Moroccan Tamazight (Tifinagh, Morocco)",nativeName:"ⵜⴰⵎⴰⵣⵉⵖⵜ (âµâµŽâµ–ⵔⵉⴱ)"},zh:TH,"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:bH,"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 dh(s){return sv[s.toLowerCase()]}function aC(s){const e=s.indexOf("-");if(e===-1)return dh(s);const t=s.substring(0,e);return dh(t)}function SH(s){const e={},t=s.toLowerCase();for(const i in sv){const r=sv[i];r.englishName.toLowerCase().indexOf(t)>-1&&(e[i]=r)}return e}const av={getEnglishName(s){var e;return(e=aC(s))==null?void 0:e.englishName},getNativeName(s){var e;return(e=aC(s))==null?void 0:e.nativeName},getFullEnglishName(s){var e;return(e=dh(s))==null?void 0:e.englishName},getFullNativeName(s){var e;return(e=dh(s))==null?void 0:e.nativeName},getEnglishNameContains(s){return SH(s)},VERSION:"1.2.0"},xH="shared.shared-utils",CH={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=av.getFullEnglishName(t):r=av.getEnglishName(t),(n=s.metadata)!=null&&n.autoGenerated?A.LanguageService.getPhrase(xH,"autoGeneratedSubtitle",{name:r}):r}},EH={ALLOWED_TAGS:["i","b","u","ruby","rt"]},oC="en-US",wH="English",kH="subtitles",Wm=new Map,mc={getLanguagesOptions:s=>{if(!s)return[];const e=s.filter(t=>!t.customer);return e.map(t=>({label:CH.getEnglishName(t,e),value:t.language,id:t.id})).sort((t,i)=>{const r=t.value.includes(Ul)?1:0;return(i.value.includes(Ul)?1:0)-r})},transformVtt:s=>{if(!s)return[];const e=[],t=new Qa.WebVTT.Parser(window,Qa.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&&A.ErrorHelper.throw(new A.DevError(`Failed to parse vtt, ${e.map(r=>r.message)}`)),i},createTextTrackList:(s,e)=>{const t=document.createElement("video"),i=t.addTextTrack(kH,e?av.getEnglishName(e):wH,e||oC);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||oC),r=mc.transformVtt(e);return r==null||r.forEach(a=>{i==null||i.addCue(a)}),i},transformVttToTextTrackList:(s,e,t)=>{const i=`${t}-${e}`;if(Wm.has(i))return Wm.get(i);if(!s)return null;const r=mc.transformVtt(s),n=mc.createTextTrackList(r,e);return Wm.set(i,n),n},sanitizeCueText:s=>A.purify.sanitize(s,EH)},lC="transcript-selected-language",Ul="en";function uC(s){var e,t;return((e=s.find(i=>i.language.includes(Ul)))==null?void 0:e.language)||((t=s[0])==null?void 0:t.language)}function Ia(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,I)=>{for(k=String(k);k.length<I;)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 Gm(s,e){if(s===void 0)throw new Error("Unexpected undefined");return s}const AH=(s,e)=>Math.abs(s-e)<1,IH=(s,e,t)=>{let i;return function(...r){s.clearTimeout(i),i=s.setTimeout(()=>e.apply(this,r),t)}},PH=s=>s,DH=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},NH=(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)}},cC={passive:!0},hC=typeof window>"u"?!0:"onscrollend"in window,LH=(s,e)=>{const t=s.scrollElement;if(!t)return;const i=s.targetWindow;if(!i)return;let r=0;const n=s.options.useScrollendEvent&&hC?()=>{}:IH(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,cC);const u=s.options.useScrollendEvent&&hC;return u&&t.addEventListener("scrollend",l,cC),()=>{t.removeEventListener("scroll",o),u&&t.removeEventListener("scrollend",l)}},OH=(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"])},RH=(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 MH{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:PH,rangeExtractor:DH,onChange:()=>{},measureElement:OH,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=Ia(()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]),t=>{this.notify(t)},{key:process.env.NODE_ENV!=="production"&&"maybeNotify",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=Ia(()=>[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=Ia(()=>[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:process.env.NODE_ENV!=="production"&&"getMeasurements",debug:()=>this.options.debug}),this.calculateRange=Ia(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(t,i,r,n)=>this.range=t.length>0&&i>0?FH({measurements:t,outerSize:i,scrollOffset:r,lanes:n}):null,{key:process.env.NODE_ENV!=="production"&&"calculateRange",debug:()=>this.options.debug}),this.getVirtualIndexes=Ia(()=>{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:process.env.NODE_ENV!=="production"&&"getVirtualIndexes",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)&&(process.env.NODE_ENV!=="production"&&this.options.debug&&console.info("correction",a),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=Ia(()=>[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:process.env.NODE_ENV!=="production"&&"getVirtualItems",debug:()=>this.options.debug}),this.getVirtualItemForOffset=t=>{const i=this.getMeasurements();if(i.length!==0)return Gm(i[JA(0,i.length-1,r=>Gm(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]=Gm(this.getOffsetForIndex(t,o));AH(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 JA=(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 FH({measurements:s,outerSize:e,scrollOffset:t,lanes:i}){const r=s.length-1;let a=JA(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 dC=typeof document<"u"?A.reactExports.useLayoutEffect:A.reactExports.useEffect;function BH(s){const e=A.reactExports.useReducer(()=>({}),{})[1],t={...s,onChange:(r,n)=>{var a;n?A.reactDomExports.flushSync(e):e(),(a=s.onChange)==null||a.call(s,r,n)}},[i]=A.reactExports.useState(()=>new MH(t));return i.setOptions(t),dC(()=>i._didMount(),[]),dC(()=>i._willUpdate()),i}function UH(s){return BH({observeElementRect:NH,observeElementOffset:LH,scrollToFn:RH,...s})}function jH(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===A.ArrayHelper.last(r).startTime);if(n===-1){s.setCurrentCueIndex(null);return}s.setCurrentCueIndex(n)}A.React.useEffect(()=>{s.hasStarted&&e(s.currentTranscriptTrack)},[s.hasStarted]);function t(){e(s.currentTranscriptTrack)}A.React.useEffect(()=>(s.currentTranscriptTrack&&s.currentTranscriptTrack.addEventListener("cuechange",t),()=>{var i;return(i=s.currentTranscriptTrack)==null?void 0:i.removeEventListener("cuechange",t)}),[s.currentTranscriptTrack])}function $H(s,e,t){function i(r){t&&t.scrollToIndex(r,{align:"start"})}return A.React.useEffect(()=>{!e||typeof s!="number"||i(s)},[s,e,t]),i}const fC=/\n/g;function qH({cuesToDisplay:s,resetHighlightedCues:e,setHighlightedCues:t,scrollToCue:i}){const[r,n]=A.React.useState(""),[a,o]=A.React.useState(null),[l,u]=A.React.useState(0),[,c]=A.React.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(fC," "),"gi"),k=[];let I=0;const L=s.map(($,F)=>{const O=$.text,B=O.replace(fC," ").matchAll(_);if(B.length===0)return Object.assign($,{nodes:[{text:O,searchResultIndex:null}]});const U=[];let C=0;return B.forEach((P,K)=>{const z=P[0],X=P.index;X>C&&U.push({text:O.substring(C,X),searchResultIndex:null}),U.push({text:z,searchResultIndex:I}),I++,k.push({cueIndex:F,cueMatchIndex:K}),C=X+z.length}),C<O.length&&U.push({text:O.substring(C),searchResultIndex:null}),Object.assign($,{nodes:U})});o(k),t(L),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 HH(s){return A.jsxRuntimeExports.jsx("svg",{...s,children:A.jsxRuntimeExports.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 VH="_hide_i94hz_1",zH="_show_i94hz_4",pC={hide:VH,show:zH},WH="shared.copyContentIconButton",mC=A.LanguageService.encloseNamespace(WH);function GH(s){const[e,t]=A.React.useState(!1);return A.React.useEffect(()=>{if(!e)return;const i=window.setTimeout(()=>{t(!1)},1e3);return()=>window.clearTimeout(i)},[e]),A.jsxRuntimeExports.jsx(A.Tooltip,{title:mC(e?"copied":"copy"),spanHack:!0,spanHackClassName:s.tooltipClassName||"",children:A.jsxRuntimeExports.jsx(A.DivButton,{"aria-label":"Copy to clipboard",className:s.visible?pC.show:pC.hide,onClick:i=>{i.stopPropagation(),navigator.clipboard.writeText(s.copyableContent).then(()=>{var r;t(!0),(r=s.onClick)==null||r.call(s)})},children:A.jsxRuntimeExports.jsx(A.SvgContainer,{svg:HH,size:A.SvgContainerSize.Small})})})}const KH="_timePoint_1jw83_1",XH="_wide_1jw83_6",QH="_item_1jw83_9",YH="_inPlayer_1jw83_9",Pa={timePoint:KH,wide:XH,item:QH,inPlayer:YH};function JH(s){const e=s.currentTimePoint===s.timePoint,[t,i]=dv.useHover();return A.jsxRuntimeExports.jsxs("div",{...s.isAuthenticated&&{role:"button"},className:`d-flex p-2 align-items-center cursor-pointer rounded text-dark ${s.inPlayer?Pa.inPlayer:""} ${s.isAuthenticated?"cursor-pointer":""} ${Pa.item} ${e?"bg-gray-100":""}`,id:s.timePoint.toString(),onClick:()=>{s.onClick(),A.AnalyticsHelper.logUserAction({...s.analyticsData,cueIndex:s.cueIndex},{...s.analyticsOptions,descriptor:A.VideoActionDescriptor.TranscriptTimepoint,actionType:A.UserAction.Click})},ref:t,children:[A.jsxRuntimeExports.jsx("div",{className:"d-flex flex-column align-items-center",children:A.jsxRuntimeExports.jsx("div",{className:`bg-light-blue text-info rounded-pill d-inline py-1 text-center ${Pa.timePoint} ${s.wideTimeTag?Pa.wide:""} ${e?"bg-white":""}`,children:xr.DurationHelper.ToDisplayDuration(s.timePoint*1e3)})}),A.jsxRuntimeExports.jsx("div",{className:`${Pa.transcript} ms-3 w-100`,children:s.nodes.map((r,n)=>{const a=mc.sanitizeCueText(r.text);return r.searchResultIndex===null?A.jsxRuntimeExports.jsx("span",{dangerouslySetInnerHTML:{__html:a}},n):A.jsxRuntimeExports.jsx("mark",{className:`${Pa.mark} ${r.searchResultIndex===s.currentSearchResultIndex?"bg-orange":"bg-yellow"}`,dangerouslySetInnerHTML:{__html:a}},n)})}),A.jsxRuntimeExports.jsx(GH,{copyableContent:s.transcript,visible:i,onClick:()=>{A.AnalyticsHelper.logUserAction({...s.analyticsData,cueIndex:s.cueIndex},{...s.analyticsOptions,actionType:A.UserAction.Copy})}})]})}function ZH(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)}),A.jsxRuntimeExports.jsx("div",{className:"w-100 position-relative",style:{height:s.virtualizer.getTotalSize()},children:A.jsxRuntimeExports.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),A.jsxRuntimeExports.jsxs("div",{className:s.inPlayer?"":"px-3",ref:s.virtualizer.measureElement,"data-index":n,children:[o&&A.jsxRuntimeExports.jsx("h3",{className:`${t.get(n)!==0?"mt-2":""} my-2 h6 ${s.inPlayer?"px-2":""}`,children:A.jsxRuntimeExports.jsxs("span",{children:[t.get(n)+1,". ",l]})}),A.jsxRuntimeExports.jsx(JH,{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 eV(s){return A.jsxRuntimeExports.jsx("svg",{...s,children:A.jsxRuntimeExports.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 tV="_inputWithoutHighlight_1bbmu_1",iV="_inputFocus_1bbmu_5",rV="_inputBlur_1bbmu_9",nV="_cursor_1bbmu_13",Zu={inputWithoutHighlight:tV,inputFocus:iV,inputBlur:rV,cursor:nV},sV="playPage.transcriptSearchBar",ec=A.LanguageService.encloseNamespace(sV);function aV(s){const e=A.React.useRef(null),[t,i]=A.React.useState(!1);function r(y){A.AnalyticsHelper.logUserAction({...s.analyticsData,query:y},{...s.analyticsOptions,actionType:A.UserAction.Search,descriptor:y?A.SearchTranscriptDescriptor.SearchTranscript:A.SearchTranscriptDescriptor.ResetResults})}const n=A.React.useCallback(A.FunctionHelper.debounce(y=>r(y),500),[]);function a(){A.AnalyticsHelper.logUserAction({...s.analyticsData,query:s.query},{...s.analyticsOptions,actionType:A.UserAction.Search,descriptor:A.SearchTranscriptDescriptor.NextResult}),s.currentSearchResultIndex===s.totalSearchResults-1?s.jumpToSearchResult(0):s.jumpToSearchResult(s.currentSearchResultIndex+1)}function o(){A.AnalyticsHelper.logUserAction({...s.analyticsData,query:s.query},{...s.analyticsOptions,actionType:A.UserAction.Search,descriptor:A.SearchTranscriptDescriptor.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 A.jsxRuntimeExports.jsxs("div",{className:GI.classNames("form-control py-0 px-1 d-flex align-items-center",t?Zu.inputFocus:Zu.inputBlur,Zu.cursor),onClick:()=>{var y;return(y=e.current)==null?void 0:y.focus()},role:"search",children:[A.jsxRuntimeExports.jsx("div",{"aria-hidden":"true",children:A.jsxRuntimeExports.jsx(A.SvgContainer,{svg:KI.SearchSvg})}),A.jsxRuntimeExports.jsx("input",{className:`form-control border-0 px-1 ${Zu.inputWithoutHighlight}`,value:s.query,onChange:l,autoComplete:"off",placeholder:ec("searchPlaceholder"),ref:e,onKeyDown:d,onFocus:()=>g("focus"),onBlur:()=>g("blur")}),!!s.query&&A.jsxRuntimeExports.jsxs("div",{className:"d-flex align-items-center",children:[A.jsxRuntimeExports.jsx("div",{children:s.totalSearchResults?`${s.currentSearchResultIndex+1}/${s.totalSearchResults}`:"0/0"}),A.jsxRuntimeExports.jsx(A.DivButton,{"aria-label":ec("previousResult"),onClick:()=>c({keepFocus:!1}),onKeyDown:y=>{(y.key==="Enter"||y.key===" ")&&c({keepFocus:!0})},children:A.jsxRuntimeExports.jsx(A.SvgContainer,{svg:eV})}),A.jsxRuntimeExports.jsx(A.DivButton,{"aria-label":ec("nextResult"),onClick:()=>u({keepFocus:!1}),onKeyDown:y=>{(y.key==="Enter"||y.key===" ")&&u({keepFocus:!0})},children:A.jsxRuntimeExports.jsx(A.SvgContainer,{svg:XI.ChevronDownSvg})}),A.jsxRuntimeExports.jsx(A.DivButton,{"aria-label":ec("clearSearch"),onClick:h,children:A.jsxRuntimeExports.jsx(A.SvgContainer,{svg:hv.CloseSvg})})]})]})}function ZA(s){return A.jsxRuntimeExports.jsx("svg",{...s,children:A.jsxRuntimeExports.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 oV(s){return A.jsxRuntimeExports.jsx("svg",{...s,children:A.jsxRuntimeExports.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 lV="shared.playPageTranscription";A.LanguageService.encloseNamespace(lV);function uV(s){return s.map(e=>Object.assign(e,{nodes:[{text:e.text,searchResultIndex:null}]}))}const cV="_languageSelect_1ws0w_1",gC={languageSelect:cV};function hV(s){var n,a;const e=(n=s.languageOptions[0])==null?void 0:n.label,t=s.track.src,i=QI.useAlerts();async function r(){A.AnalyticsHelper.logUserAction(s.analyticsData,{...s.analyticsOptions,actionType:A.UserAction.Download});try{await YI.DownloadHelper.downloadBlob(t,`Subtitles-${s.selectedLanguage}.vtt`)}catch{i.error("Error downloading transcript")}}return A.jsxRuntimeExports.jsxs("div",{className:"d-flex px-1 mb-3",children:[A.jsxRuntimeExports.jsx(aV,{query:s.searchQuery,currentSearchResultIndex:s.currentSearchResultIndex,onSearch:s.onSearch,totalSearchResults:s.totalSearchResults,jumpToSearchResult:s.jumpToSearchResult,analyticsData:s.analyticsData,analyticsOptions:s.analyticsOptions}),A.jsxRuntimeExports.jsx(A.Tooltip,{spanHack:!0,title:s.languageOptions.length>1?"":`Only available in ${e}`,children:A.jsxRuntimeExports.jsxs(A.Dropdown,{children:[A.jsxRuntimeExports.jsx(A.Dropdown.Toggle,{className:`text-dark ${gC.languageSelect}`,id:"language-select",disabled:((a=s.languageOptions)==null?void 0:a.length)<=1,variant:"outline-dark",children:A.jsxRuntimeExports.jsx(A.SvgContainer,{svg:oV})}),A.jsxRuntimeExports.jsx(A.Dropdown.Menu,{className:gC.menu,"aria-labelledby":"language-select",children:s.languageOptions.map((o,l)=>A.jsxRuntimeExports.jsx(A.Dropdown.Item,{onClick:()=>{var u;(u=s.onChangeLanguage)==null||u.call(s,o.value),A.AnalyticsHelper.logUserAction({...s.analyticsData,language:o.value,previousLanguageName:s.selectedLanguage},{...s.analyticsOptions,actionType:A.UserAction.Select})},className:"cursor-pointer",active:o.value===s.selectedLanguage,children:o.label},l))})]})}),A.jsxRuntimeExports.jsx(A.IconButton,{svg:ZA,onClick:r,className:"position-relative d-flex align-items-center text-dark"})]})}const dV=j.getComponent("Component");class fV extends dV{constructor(e,t){super(e,t)}dispose(){setImmediate(()=>{var e;(e=this.root)==null||e.unmount()}),super.dispose()}}const pV={tagName:"div"};function nd(s,e=pV){if(!s)throw new Error("componentCtor is required");class t extends fV{createEl(){const r=j.dom.createEl(e.tagName,e.properties,e.attributes),n=A.clientExports.createRoot(r);return n.render(s(this.player_,this.options_)),this.root=n,r}}return t}function mV(s){const e=ut.get(lC)||uC(s.allTracks);function t(){return s.allTracks.find(le=>le.language===e)||s.allTracks.find(le=>le.language===uC(s.allTracks))}const[i,r]=A.React.useState(()=>t()),[n,a]=A.React.useState(e),[o,l]=A.React.useState(-1),[u,c]=A.React.useState(!0),[h,d]=A.React.useState([]),g=A.React.useMemo(()=>Array.from((i==null?void 0:i.cues)||[]),[n]),y={videoId:s.playbackObject.videoId,videoName:s.playbackObject.title,language:n},p={location:A.LocationContext.Player,entity:A.EntityType.Transcript},_=s.player.hasStarted();jH({currentTranscriptTrack:i,cuesToDisplay:g,setCurrentCueIndex:l,hasStarted:_});const k=A.React.useRef(),I=UH({count:h.length,getScrollElement:()=>{var le;return(le=k.current)==null?void 0:le.view},estimateSize:()=>40,enabled:h.length>0}),L=I.getVirtualItems(),$=$H(o,u,I),{isSearching:F,searchQuery:O,totalSearchResults:B,jumpToSearchResult:U,onSearch:C,currentSearchResultIndex:P,resetSearchResults:K}=qH({cuesToDisplay:g,resetHighlightedCues:he,setHighlightedCues:d,scrollToCue:$}),z=s.player.paused(),[X,re]=dv.useHover();A.React.useEffect(()=>{c(!re&&!F&&_&&!z)},[re,F,_,z]);function he(){d(uV(g))}A.React.useEffect(()=>{he()},[g]);function fe(){s.toggleTranscript(!1)}function ne(le){r(s.allTracks.find(de=>de.language===le)),a(le),ut.set(lC,le),K()}function se(le){var de;(de=s.setStartTime)==null||de.call(s,le.startTime)}return!i||!g.length?A.jsxRuntimeExports.jsx(A.jsxRuntimeExports.Fragment,{}):A.jsxRuntimeExports.jsxs("div",{ref:X,className:`cv-transcript py-3 px-2 ${s.showTranscript?"cv-open":""}`,children:[A.jsxRuntimeExports.jsxs("div",{className:"text-dark d-flex justify-content-between px-1",children:[A.jsxRuntimeExports.jsx("h3",{children:"Transcript"}),A.jsxRuntimeExports.jsx(A.IconButton,{svg:hv.CloseSvg,onClick:fe,ariaLabel:"Close transcript"})]}),A.jsxRuntimeExports.jsx(hV,{selectedLanguage:n,languageOptions:s.languageOptions,onChangeLanguage:ne,track:i,onSearch:C,searchQuery:O,currentSearchResultIndex:P,totalSearchResults:B,jumpToSearchResult:U,analyticsData:y,analyticsOptions:p}),A.jsxRuntimeExports.jsx("div",{className:"cv-transcript-list-wrapper text-dark",children:A.jsxRuntimeExports.jsx(VC.Scrollbars,{ref:k,children:A.jsxRuntimeExports.jsx(ZH,{timepoint:g[o],onClickTranscriptionItem:se,cuesToDisplay:h,chapters:s.chapters,currentSearchResultIndex:P,inPlayer:!0,virtualizer:I,items:L,analyticsOptions:p,analyticsData:y,isAuthenticated:!1})})})]})}j.registerComponent("Transcript",nd((s,e)=>A.jsxRuntimeExports.jsx(mV,{player:s,...e})));const gV=j.getPlugin("plugin"),ay=992;class vV extends gV{constructor(e){super(e),this.allClickViewTracks=[],this.player=e,this.bindListeners(),e.ready(()=>this.initialize())}bindListeners(){this.onResize=this.onResize.bind(this),Wt.useMetadataTracks(this.player,"transcript",()=>this.player.trigger("resizemenus")),this.player.on("playerresize",this.onResize)}dispose(){this.player.off("playerresize",this.onResize),super.dispose()}initialize(){Wt.useSubtitles(this.player,this.onTrackLoaded.bind(this)),Wt.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(Ul)?1:0;return(i.value.includes(Ul)?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:A.UserAction.Click,descriptor:i?A.PlaybackDescriptor.ShowTranscript:A.PlaybackDescriptor.HideTranscript,entity:A.EntityType.Transcript}))}setStartTime(e){this.player.currentTime(e)}isTranscriptOn(){return!!this.showTranscript}onResize(){if(window.innerWidth<ay){this.player.addClass("hide-transcript");return}this.showTranscript&&this.player.removeClass("hide-transcript")}registerAnalytics(e,t){this.analyticsService=e,this.playbackObject=t}}j.registerPlugin("viewTranscriptPlugin",vV);const vC=j.getComponent("SubsCapsMenuItem");class yV extends vC{handleClick(e){vC.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 _V=j.getComponent("TextTrackMenuItem");class TV extends _V{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=Wt.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=Wt.getCurrentTextTrack(this.player_);(t=e==null?void 0:e.cues)!=null&&t.length&&this.requestAnimationFrame(()=>{this.player_.getChild("collapserator").getChild("subtitleSearchButton").showCollapsibleMenu()})}}const bV=j.getComponent("TextTrackMenuItem");class SV extends bV{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 xV=j.getComponent("TextTrackMenuItem");class eI extends xV{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<ay;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,j.dom.addClass(this.toggleEl,"on")):(this.transcriptOn=!1,(r=(i=j.dom).removeClass)==null||r.call(i,this.toggleEl,"on"))}toggleOn(){var e,t;this.transcriptOn=!0,j.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=j.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=j.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=j.dom.createEl("li",{className:"vjs-menu-item cv-transcript-toggle",innerHTML:r,tabIndex:-1},i),this.item.children[1].appendChild(this.toggleEl),this.item}}j.registerComponent("ToggleTranscriptMenuItem",eI);const CV=j.getComponent("TextTrackButton"),yC=j.getComponent("SubsCapsButton");class EV extends yC{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>=ay&&e.push(new eI(this.player_)),this.player_.options_.allowTranscript||e.push(new TV(this.player_)),e.push(new SV(this.player_)),this.hideThreshold_=this.hideThreshold_+2}return this.player().trigger("resizemenus"),CV.prototype.createItems.call(this,e,yV)}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(){yC.prototype.handleClick.apply(this)}}j.registerComponent("SubsCapsButton",EV);const wV=`<span class='vjs-local-cache-indicator-icon' title='Streaming from ClickView Local Cache'>${eA}</span>`,kV=j.getComponent("MenuItem");class AV extends kV{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+wV)}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 _C={144:"144p (Preview)",240:"240p",360:"360p",480:"480p",720:"720p",1080:"1080p"},TC=j.getComponent("MenuButton");class IV extends TC{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 Qs(this.player_,{label:"Quality"}));for(let i=0;i<t.length;i++){const r=t[i];if(!r)continue;const n=_C[r.id];n&&e.push(new AV(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?_C[t.id]:""}showInCollabsibleMenu(){return!!this.player_.qualityLevels().length}showCollapsibleMenu(){TC.prototype.handleClick.apply(this)}}j.registerComponent("QualityButton",IV);const PV=j.getComponent("Menu"),bC=j.getComponent("MenuButton"),DV=j.getComponent("PlaybackRateMenuItem"),SC=j.getComponent("PlaybackRateMenuButton");class NV extends SC{constructor(){super(...arguments),this.alwaysCollapsed=!0,this.isCollapsed=!1,this.isCollabsible=!0,this.className="cv-playback-rate-menu-button"}createEl(...e){return bC.prototype.createEl.apply(this,...e)}buildWrapperCSSClass(){return`cv-menu-small cv-has-left-icons ${super.buildWrapperCSSClass()}`}createMenu(){const e=new PV(this.player(),{menuButton:this});e.addItem(new Qs(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 DV(this.player(),{rate:r}))}return e}handleClick(...e){return bC.prototype.handleClick.apply(this,...e)}updateLabel(...e){return this.setupLabelEl(),SC.prototype.updateLabel.apply(this,...e)}setupLabelEl(){if(this.labelEl_)return;const e=this.$("button");e&&(this.labelEl_=j.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)}}j.registerComponent("PlaybackRateMenuButton",NV);const LV=j.getComponent("TextTrackSettings"),gc={backgroundColor:"#000",backgroundOpacity:"1",color:"#FFF",edgeStyle:void 0,fontFamily:"proportionalSansSerif",fontPercent:1,textOpacity:"1",windowColor:"#000",windowOpacity:"0"},xC={small:gc,medium:{...gc,fontPercent:1.5},large:{...gc,fontPercent:2}};class OV extends LV{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 xC[this.size_]?xC[this.size_]:gc}}j.registerComponent("TextTrackSettings",OV);const RV="cv-video-wrapper",vc=j.getComponent("Player");class tI extends vc{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=j.dom.createEl("div",{className:RV}),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(vc.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()===aA.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_(){vc.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})}}tI.prototype.options_={...vc.prototype.options_,setMaxHeight:!0};j.registerComponent("player",tI);const MV=j.getComponent("Component");class FV extends MV{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 j.dom.createEl("div",{className:"cv-play-pause-feedback"})}}j.registerComponent("PlayPauseFeedback",FV);const tc=j.getComponent("PlayToggle"),iI="Play (space)",BV="Pause (space)";let rI=class extends tc{handlePlay(){tc.prototype.handlePlay.call(this),this.controlText(BV)}handlePause(){tc.prototype.handlePause.call(this),this.controlText(iI)}handleClick(e){tc.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)}};j.registerComponent("PlayToggle",rI);rI.prototype.controlText_=iI;const CC=j.getComponent("TextTrackDisplay"),UV=.025;class jV extends CC{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){CC.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*UV*100/100;a.style.fontSize=l*t.fontPercent+"px"}}}}j.registerComponent("TextTrackDisplay",jV);const $V=j.getComponent("Component");class qV extends $V{createEl(){return j.dom.createEl("div",{className:"cv-control-bar-gradient-container",innerHTML:'<div class="cv-control-bar-gradient"></div>'})}}j.registerComponent("ControlBarGradient",qV);const HV=j.getComponent("Component");class VV extends HV{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 zV(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 WV=j.getComponent("Component");class GV extends WV{constructor(e,t){super(e,t),this.options_=t}buildCSSClass(){return`cv-splash-rating ${zV(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 KV=j.getComponent("Component");class XV extends KV{constructor(e,t){if(super(e,t),!t.embed)return this;this.addChild(new VV(e,t)),this.addChild(new GV(e,t))}createEl(){return j.dom.createEl("div",{className:"cv-splash-metadata"})}}const QV=j.getComponent("posterImage");class YV extends QV{constructor(e,t){super(e,t),this.addChild(new XV(e,t))}createEl(){let e="<div class='cv-splash-mask'></div>";return this.options_.embed&&(e+=`<div class='cv-splash-logo'>${Yk}</div>`),j.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}}j.registerComponent("posterImage",YV);const JV=j.getComponent("ErrorDisplay");class ZV extends JV{constructor(e,t){super(e,t),this.el().prepend(this.getErrorImage())}getErrorImage(){return j.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
|
+
`})}}j.registerComponent("ErrorDisplay",ZV);const EC=j.getComponent("FullscreenToggle"),nI="Fullscreen (f)";class sI extends EC{handleFullscreenChange(){EC.prototype.handleFullscreenChange.call(this),this.controlText(nI)}}j.registerComponent("FullscreenToggle",sI);sI.prototype.controlText_=nI;const ez=j.getComponent("MuteToggle"),aI="Mute (m)",tz="Unmute (m)";class oI extends ez{updateControlText_(){const t=this.player_.muted()||this.player_.volume()===0?tz:aI;this.controlText_!==t&&this.controlText(t)}}j.registerComponent("MuteToggle",oI);oI.prototype.controlText_=aI;const iz=j.getComponent("Player"),rz=s=>s.indexOf("#")===0?s.slice(1):s,nz=3;let ul;const ph=class ph{constructor(e,t){if(this.streamLogged=!1,this.options=j.obj.merge({},ph.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=j(this.el,this.getPlayerOptions())}getInactivityTimeout(){if(typeof this.options.inactivityTimeout=="number")return this.options.inactivityTimeout;let e=500;return(this.options.mobile||j.browser.IS_IOS||j.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=iz.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:PM.filter(t=>!(t==="fullscreenToggle"&&!this.options.allowFullscreen))},"playPauseFeedback","controlBarGradient"],userActions:{hotkeys:t=>UM(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 Pg.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=Wt.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,Wt.sanitizeTrack(l.track,this.player),Wt.activeTextTrack(l.track)}),e.posterUrl&&this.player.poster(A.ImageHelper.createUrl(e.posterUrl,{size:A.ImageSize.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 Ig&&((i=e.response)==null?void 0:i.type)===L2.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(ul||this.options.fetch||this.options.offlinePlaybackObject)return;const e=`${this.options.playerApi.origin}/api/config`;ul=await Pg.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);ul?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 DM({player:this.player,collectionApiUrls:ul.collectionApi.urls,collectionApiClientId:ul.collectionApi.clientId,productVersion:$M.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||A.RegionName.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()<nz||this.streamLogged||(this.analyticsService.logStream(),this.streamLogged=!0,this.off("timeupdate",this.logStream)))}getAnalyticsPlayerType(){return"player"}createEl(e){let t;typeof e=="string"?(e=rz(e),t=j.dom.$("#"+e)):t=e;let i="video-js";return this.getPlayerClassName()&&(i+=` ${this.getPlayerClassName()}`),this.el=j.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=j.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"}};ph.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 ov=ph;const sz=j.getPlugin("plugin"),az=10;class oz extends sz{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-az&&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 j.createTimeRanges(t)}}j.registerPlugin("clipPlugin",oz);const lz=j.getComponent("Button");class lI extends lz{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)}}lI.prototype.controlText_="Create clip";j.registerComponent("CreateClipButton",lI);const uz=j.getPlugin("plugin");class cz extends uz{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)}}j.registerPlugin("createClipButtonPlugin",cz);const hz=j.getComponent("PictureInPictureToggle");class dz extends hz{handlePictureInPictureEnabledChange(){this.enable()}}j.registerComponent("PictureInPictureToggle",dz);const fz=j.getComponent("PlayToggle"),pz=j.getPlugin("plugin"),mz=800;class gz extends pz{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<mz?(t=this.toggle)==null||t.hide():(i=this.toggle)==null||i.show())}addPipStyles(){this.player.addClass("cv-picture-in-picture"),this.playToggle=new fz(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()}}j.registerPlugin("pictureInPicture",gz);class vz{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 yz=new vz,_z=j.getComponent("Component");class Tz extends _z{constructor(e,t){super(e,t),this.hasBuffered=!1,this.hasPlayed=!1,this.eventsService=yz,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=j.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 bz=j.getComponent("MenuItem");class uI extends bz{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(){j.dom.addClass(this.toggleEl,"on"),j.dom.setAttribute(this.toggleEl,"aria-checked","true"),this.pointsOfInterestVisible=!0,this.player().pointsOfInterestPlugin().togglePointsOfInterest(this.pointsOfInterestVisible)}toggleOff(){j.dom.removeClass(this.toggleEl,"on"),j.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=j.dom.createEl("div",{className:"custom-toggle custom-toggle-info toggle-option float-end",innerHTML:'<span class="handle"></span></div>'}),j.dom.setAttribute(this.toggleEl,"id","poi-toggle"),j.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}}j.registerComponent("PointsOfInterestMenuItem",uI);const Sz=j.getPlugin("plugin"),wC="cvplayer-points-of-interest";class xz extends Sz{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&&(ut.hasLocalStorage()&&ut.get(wC)==="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){ut.set(wC,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 Tz(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:uI,name:"PointsOfInterestMenuItem",options:{pointsOfInterestVisible:this.enabled}})}updateBuffered(){this.pointOfInterestIndicators.forEach(e=>e.updateBuffered(KA(this.player)))}updatePlaybackProgress(){this.pointOfInterestIndicators.forEach(e=>e.updatePlaybackProgress(this.player.currentTime()))}}j.registerPlugin("pointsOfInterestPlugin",xz);var Is=(s=>(s.None="None",s.Complete="Complete",s.Incomplete="Incomplete",s))(Is||{});const Cz=j.getComponent("Button");class cI extends Cz{constructor(e,t){super(e,t),this.update()}update(){this.options_.activityStatus===Is.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===Is.None||this.options_.activityStatus===Is.Incomplete)return Is.Complete;if(this.options_.activityStatus===Is.Complete)return Is.Incomplete}}cI.prototype.controlText_="Complete";const Ez=j.getPlugin("plugin");class wz extends Ez{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 cI(this.player,{activityStatus:this.activityStatus,clickHandler:this.onToggleStatus}),this.player.addChild(this.button)}}j.registerPlugin("activityStatusPlugin",wz);const kz=j.getComponent("Component");class kC extends kz{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 Az=j.getComponent("ClickableComponent");class AC extends Az{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 Iz=j.getComponent("Component");class Pz extends Iz{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=j.dom.createEl("h5",{innerHTML:this.localize("This clip has finished"),className:"cv-replay-heading"}),a=j.dom.createEl("div",{className:"cv-button-container"}),o=new AC(this.player_,{label:this.localize("Replay clip"),iconClassName:"cv-replay-icon",onPress:this.options_.onReplayPress}),l=new AC(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 Dz=j.getPlugin("plugin");class Nz extends Dz{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 kC(this.player,{time:this.startTime}),e==null||e.addChild(this.startTimeIndicator)),this.endTimeIndicator||(this.endTimeIndicator=new kC(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 Pz(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()}}j.registerPlugin("rangeIndicatorPlugin",Nz);const Lz=j.getComponent("MenuItem");let Oz=class extends Lz{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(){j.dom.addClass(this.toggleEl,"on")}toggleOff(){j.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=j.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()}};j.registerComponent("LoopVideoMenuItem",Oz);const Rz=j.getPlugin("plugin");j.getComponent("MenuItem");const Mz=j.getComponent("LoopVideoMenuItem");class Fz extends Rz{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:Mz,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()}}j.registerPlugin("loopVideoPlugin",Fz);const hI={generateRandomId:()=>{var s,e;return((e=(s=window.crypto)==null?void 0:s.randomUUID)==null?void 0:e.call(s))??Math.random().toString()}};class Bz extends ov{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:hI.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 Wt.getTrack(this.player,"metadata","transcript",e)?null:this.player.addTextTrack("metadata","transcript",e)}useCurrentTranscript(e,t){return Wt.useMetadataTracks(this.player,"transcript",e,t)}}function Uz(s){return new Proxy(s,{get(e,t,i){if(!(t!=="off"&&e.isDisposed()))return Reflect.get(e,t,i)}})}var cl={},Km={exports:{}},Xm={exports:{}},Qm={exports:{}},IC;function jz(){if(IC)return Qm.exports;IC=1;var s=Qm.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,I=!1;for(typeof p=="boolean"&&(I=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&&(I&&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(I,y,d)):d!==void 0&&(p[c]=d));return p}return Qm.exports}var PC;function $z(){if(PC)return Xm.exports;PC=1;var s=Xm.exports=jz(),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(I,L){var $=s.type(L);$==="function"?(!r.unique||!y.has(L))&&h.push(L):L&&L.length&&$!=="string"&&_(L)})})(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},Xm.exports}var DC;function qz(){if(DC)return Km.exports;DC=1;/*!
|
|
328
|
+
* jquery-deferred
|
|
329
|
+
* Copyright(c) 2011 Hidden <zzdhidden@gmail.com>
|
|
330
|
+
* MIT Licensed
|
|
331
|
+
*/var s=Km.exports=$z(),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()}}),Km.exports}var Ym,NC;function Hz(){return NC||(NC=1,Ym=qz()),Ym}var Jm={exports:{}};/**
|
|
332
|
+
* @preserve jquery-param (c) 2015 KNOWLEDGECODE | MIT
|
|
333
|
+
*/var LC;function Vz(){return LC||(LC=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})()}(Jm)),Jm.exports}var Zm,OC;function zz(){if(OC)return Zm;OC=1;var s=Hz(),e=Vz(),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 Zm=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}()}}),Zm}var RC;function Wz(){if(RC)return cl;RC=1,Object.defineProperty(cl,"__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=zz();/*!
|
|
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(B,U){if(U!==!1){var C;typeof i.console>"u"||(C="["+new Date().toTimeString()+"] SignalR: "+B,i.console.debug?i.console.debug(C):i.console.log&&i.console.log(C))}},y=function(B,U,C){return U===B.state?(B.state=C,t(B).triggerHandler(h.onStateChanged,[{oldState:U,newState:C}]),!0):!1},p=function(B){return B.state===a.connectionState.disconnected},_=function(B){return B._.keepAliveData.activated&&B.transport.supportsKeepAlive(B)},k=function(B){var U,C;B._.configuredStopReconnectingTimeout||(C=function(K){var z=a._.format(a.resources.reconnectTimeout,K.disconnectTimeout);K.log(z),t(K).triggerHandler(h.onError,[a._.error(z,"TimeoutException")]),K.stop(!1,!1)},B.reconnecting(function(){var P=this;P.state===a.connectionState.reconnecting&&(U=i.setTimeout(function(){C(P)},P.disconnectTimeout))}),B.stateChanged(function(P){P.oldState===a.connectionState.reconnecting&&i.clearTimeout(U)}),B._.configuredStopReconnectingTimeout=!0)};a=function(B,U,C){return new a.fn.init(B,U,C)},a._={defaultContentType:"application/x-www-form-urlencoded; charset=UTF-8",ieVersion:function(){var O,B;return i.navigator.appName==="Microsoft Internet Explorer"&&(B=/MSIE ([0-9]+\.[0-9]+)/.exec(i.navigator.userAgent),B&&(O=i.parseFloat(B[1]))),O}(),error:function(B,U,C){var P=new Error(B);return P.source=U,typeof C<"u"&&(P.context=C),P},transportError:function(B,U,C,P){var K=this.error(B,C,P);return K.transport=U?U.name:r,K},format:function(){for(var B=arguments[0],U=0;U<arguments.length-1;U++)B=B.replace("{"+U+"}",arguments[U+1]);return B},firefoxMajorVersion:function(B){var U=B.match(/Firefox\/(\d+)/);return!U||!U.length||U.length<2?0:parseInt(U[1],10)},configurePingInterval:function(B){var U=B._.config,C=function(K){t(B).triggerHandler(h.onError,[K])};U&&!B._.pingIntervalId&&U.pingInterval&&(B._.pingIntervalId=i.setInterval(function(){a.transports._logic.pingServer(B).fail(C)},U.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 I(O,B){if(t.isArray(O)){for(var U=O.length-1;U>=0;U--){var C=O[U];(t.type(C)!=="string"||!a.transports[C])&&(B.log("Invalid transport: "+C+", removing it from the transports list."),O.splice(U,1))}O.length===0&&(B.log("No transports remain within the specified transport array."),O=null)}else if(!a.transports[O]&&O!=="auto")B.log("Invalid transport: "+O.toString()+"."),O=null;else if(O==="auto"&&a._.ieVersion<=8)return["longPolling"];return O}function L(O){if(O==="http:")return 80;if(O==="https:")return 443}function $(O,B){return B.match(/:\d+$/)?B:B+":"+L(O)}function F(O,B){var U=this,C=[];U.tryBuffer=function(P){return O.state===t.signalR.connectionState.connecting?(C.push(P),!0):!1},U.drain=function(){if(O.state===t.signalR.connectionState.connected)for(;C.length>0;)B(C.shift())},U.clear=function(){C=[]}}a.fn=a.prototype={init:function(B,U,C){var P=t(this);this.url=B,this.qs=U,this.lastError=null,this._={keepAliveData:{},connectingMessageBuffer:new F(this,function(K){P.triggerHandler(h.onReceived,[K])}),lastMessageAt:new Date().getTime(),lastActiveAt:new Date().getTime(),beatInterval:5e3,beatHandle:null,totalTransportConnectTimeout:0,redirectQs:null},typeof C=="boolean"&&(this.logging=C)},_parseResponse:function(B){var U=this;return B&&(typeof B=="string"?U.json.parse(B):B)},_originalJson:i.JSON,json:i.JSON,isCrossDomain:function(B,U){var C;return B=t.trim(B),U=U||i.location,B.indexOf("http")!==0?!1:(C=i.document.createElement("a"),C.href=B,C.protocol+$(C.protocol,C.host)!==U.protocol+$(U.protocol,U.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(B,U){var C=this,P={pingInterval:3e5,waitForPageLoad:!0,transport:"auto",jsonp:!1},K,z=C._deferral||t.Deferred(),X=i.document.createElement("a"),re=function(se,le){se.url===le&&se.baseUrl||(se.url=le,X.href=se.url,!X.protocol||X.protocol===":"?(se.protocol=i.document.location.protocol,se.host=X.host||i.document.location.host):(se.protocol=X.protocol,se.host=X.host),se.baseUrl=se.protocol+"//"+se.host,se.wsProtocol=se.protocol==="https:"?"wss://":"ws://",se.url.indexOf("//")===0&&(se.url=i.location.protocol+se.url,se.log("Protocol relative URL detected, normalizing it to '"+se.url+"'.")),se.isCrossDomain(se.url)&&(se.log("Auto detected cross domain url."),P.transport==="auto"&&(P.transport=["webSockets","serverSentEvents","longPolling"]),typeof se.withCredentials>"u"&&(se.withCredentials=!0),t.support.cors||(se.ajaxDataType="jsonp",se.log("Using jsonp because this browser doesn't support CORS.")),se.contentType=a._.defaultContentType))};if(C.lastError=null,C._deferral=z,!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(B)==="function"?U=B:t.type(B)==="object"&&(t.extend(P,B),t.type(P.callback)==="function"&&(U=P.callback)),P.transport=I(P.transport,C),!P.transport)throw new Error("SignalR: Invalid transport(s) specified, aborting start.");if(C._.config=P,!l&&P.waitForPageLoad===!0)return C._.deferredStartHandler=function(){C.start(B,U)},u.bind("load",C._.deferredStartHandler),z.promise();if(C.state===a.connectionState.connecting)return z.promise();if(y(C,a.connectionState.disconnected,a.connectionState.connecting)===!1)return z.resolve(C),z.promise();k(C),P.transport==="auto"&&P.jsonp===!0&&(P.transport="longPolling"),C.withCredentials=P.withCredentials,C._originalUrl=C.url,C.ajaxDataType=P.jsonp?"jsonp":"text",re(C,C.url),t(C).bind(h.onStart,function(ne,se){t.type(U)==="function"&&U.call(C),z.resolve(C)}),C._.initHandler=a.transports._logic.initHandler(C),K=function(se,le){var de=a._.error(n.noTransportOnInit);if(le=le||0,le>=se.length){le===0?C.log("No transports supported by the server were selected."):le===1?C.log("No fallback transports were selected."):C.log("Fallback transports exhausted."),t(C).triggerHandler(h.onError,[de]),z.reject(de),C.stop();return}if(C.state!==a.connectionState.disconnected){var ve=se[le],we=a.transports[ve],Pe=function(){K(se,le+1)};C.transport=we;try{C._.initHandler.start(we,function(){var Oe=a._.firefoxMajorVersion(i.navigator.userAgent)>=11,De=!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(De)}),Oe&&u.bind("beforeunload",function(){i.setTimeout(function(){C.stop(De)},0)})},Pe)}catch(Oe){C.log(we.name+" transport threw '"+Oe.message+"' when attempting to start."),Pe()}}};var he=C.url+"/negotiate",fe=function(se,le){var de=a._.error(n.errorOnNegotiate,se,le._.negotiateRequest);t(le).triggerHandler(h.onError,de),z.reject(de),le.stop()};return t(C).triggerHandler(h.onStarting),he=a.transports._logic.prepareQueryString(C,he),C.log("Negotiating with '"+he+"'."),C._.negotiateRequest=function(){var ne,se=0,le=100,de,ve,we=[],Pe=[],Oe=function(Re,Le){var qe=a.transports._logic.prepareQueryString(Re,Re.url+"/negotiate");Re.log("Negotiating with '"+qe+"'.");var it={url:qe,error:function(At,Ai){Ai!==c?fe(At,Re):z.reject(a._.error(n.stoppedWhileNegotiating,null,Re._.negotiateRequest))},success:Le};return Re.accessToken&&(it.headers={Authorization:"Bearer "+Re.accessToken}),a.transports._logic.ajax(Re,it)},De=function Xe(Re){try{ne=C._parseResponse(Re)}catch(qe){fe(a._.error(n.errorParsingNegotiateResponse,qe),C);return}if(ne.availableTransports){ve=a._.error(n.aspnetCoreSignalrServer),t(C).triggerHandler(h.onError,[ve]),z.reject(ve);return}if(!ne.ProtocolVersion||C.supportedProtocols.indexOf(ne.ProtocolVersion)===-1){ve=a._.error(a._.format(n.protocolIncompatible,C.clientProtocol,ne.ProtocolVersion)),t(C).triggerHandler(h.onError,[ve]),z.reject(ve);return}if(C.negotiateRedirectSupportedProtocols.indexOf(ne.ProtocolVersion)!==-1){if(ne.Error){ve=a._.error(a._.format(n.errorFromServer,ne.Error)),t(C).triggerHandler(h.onError,[ve]),z.reject(ve);return}else if(ne.RedirectUrl){if(se===le){fe(a._.error(n.errorRedirectionExceedsLimit),C);return}P.transport==="auto"&&(P.transport=["webSockets","serverSentEvents","longPolling"]),C.log("Received redirect to: "+ne.RedirectUrl),C.accessToken=ne.AccessToken;var Le=ne.RedirectUrl.split("?",2);if(re(C,Le[0]),C._.redirectQs=Le.length===2?Le[1]:null,C.ajaxDataType==="jsonp"&&C.accessToken){fe(a._.error(n.jsonpNotSupportedWithAccessToken),C);return}se++,Oe(C,Xe);return}}de=C._.keepAliveData,C.appRelativeUrl=ne.Url,C.id=ne.ConnectionId,C.token=ne.ConnectionToken,C.webSocketServerUrl=ne.WebSocketServerUrl,C._.pollTimeout=ne.ConnectionTimeout*1e3+1e4,C.disconnectTimeout=ne.DisconnectTimeout*1e3,C._.totalTransportConnectTimeout=C.transportConnectTimeout+ne.TransportConnectTimeout*1e3,ne.KeepAliveTimeout?(de.activated=!0,de.timeout=ne.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(qe){if(qe.indexOf("_")===0||qe==="webSockets"&&!ne.TryWebSockets)return!0;Pe.push(qe)}),t.isArray(P.transport)?t.each(P.transport,function(qe,it){t.inArray(it,Pe)>=0&&we.push(it)}):P.transport==="auto"?we=Pe:t.inArray(P.transport,Pe)>=0&&we.push(P.transport),K(we)};return Oe(C,De)}(),z.promise()},starting:function(B){var U=this;return t(U).bind(h.onStarting,function(C,P){B.call(U)}),U},send:function(B){var U=this;if(U.state===a.connectionState.disconnected)throw new Error("SignalR: Connection must be started before data can be sent. Call .start() before .send()");if(U.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 U.transport.send(U,B),U},received:function(B){var U=this;return t(U).bind(h.onReceived,function(C,P){B.call(U,P)}),U},stateChanged:function(B){var U=this;return t(U).bind(h.onStateChanged,function(C,P){B.call(U,P)}),U},error:function(B){var U=this;return t(U).bind(h.onError,function(C,P,K){U.lastError=P,B.call(U,P,K)}),U},disconnected:function(B){var U=this;return t(U).bind(h.onDisconnect,function(C,P){B.call(U)}),U},connectionSlow:function(B){var U=this;return t(U).bind(h.onConnectionSlow,function(C,P){B.call(U)}),U},reconnecting:function(B){var U=this;return t(U).bind(h.onReconnecting,function(C,P){B.call(U)}),U},reconnected:function(B){var U=this;return t(U).bind(h.onReconnect,function(C,P){B.call(U)}),U},stop:function(B,U){var C=this,P=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."),P&&P.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),U!==!1&&C.transport.abort(C,B),_(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(B){g(B,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 I=this,L=I.connection,$=!1;if(I.startRequested||I.connectionStopped){L.log("WARNING! "+p.name+" transport cannot be started. Initialization ongoing or completed.");return}L.log(p.name+" transport starting."),p.start(L,function(){$||I.initReceived(p,_)},function(F){return $||($=!0,I.transportFailed(p,F,k)),!I.startCompleted||I.connectionStopped}),I.transportTimeoutHandle=i.setTimeout(function(){$||($=!0,L.log(p.name+" transport timed out when trying to connect."),I.transportFailed(p,r,k))},L._.totalTransportConnectTimeout)},stop:function(){this.connectionStopped=!0,i.clearTimeout(this.transportTimeoutHandle),n.transports._logic.tryAbortStartRequest(this.connection)},initReceived:function(p,_){var k=this,I=k.connection;if(k.startRequested){I.log("WARNING! The client received multiple init messages.");return}k.connectionStopped||(k.startRequested=!0,i.clearTimeout(k.transportTimeoutHandle),I.log(p.name+" transport connected. Initiating start request."),n.transports._logic.ajaxStart(I,function(){k.startCompleted=!0,_()}))},transportFailed:function(p,_,k){var I=this.connection,L=I._deferral,$;this.connectionStopped||(i.clearTimeout(this.transportTimeoutHandle),this.startRequested?this.startCompleted||($=n._.error(n.resources.errorDuringStartRequest,_),I.log(p.name+" transport failed during the start request. Stopping the connection."),t(I).triggerHandler(a.onError,[$]),L&&L.reject($),I.stop()):(p.stop(I),I.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,I=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 F;try{F=p._parseResponse($)}catch(O){I.reject(n._.transportError(n.resources.pingServerFailedParse,p.transport,O,k)),p.stop();return}F.Response==="pong"?I.resolve():I.reject(n._.transportError(n._.format(n.resources.pingServerFailedInvalidResponse,$),p.transport,null,k))},error:function($){$.status===401||$.status===403?(I.reject(n._.transportError(n._.format(n.resources.pingServerFailedStatusCode,$.status),p.transport,$,k)),p.stop()):I.reject(n._.transportError(n.resources.pingServerFailed,p.transport,$,k))}})):I.reject(n._.transportError(n.resources.noConnectionTransport,p.transport)),I.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?"&":"?",I;if(!_)return p;if((typeof _>"u"?"undefined":s(_))==="object")return p+k+t.param(_);if(typeof _=="string")return I=_.charAt(0),(I==="?"||I==="&")&&(k=""),p+k+_;throw new Error("Query string property must be either a string or object.")},getUrl:function(p,_,k,I,L){var $=_==="webSockets"?"":p.baseUrl,F=$+p.appRelativeUrl,O="transport="+_;return!L&&p.groupsToken&&(O+="&groupsToken="+i.encodeURIComponent(p.groupsToken)),k?(I?F+="/poll":F+="/reconnect",!L&&p.messageId&&(O+="&messageId="+i.encodeURIComponent(p.messageId))):F+="/connect",F+="?"+O,F=u.prepareQueryString(p,F),p.transport&&p.accessToken&&(p.transport.name==="serverSentEvents"||p.transport.name==="webSockets")&&(F+="&access_token="+i.encodeURIComponent(p.accessToken)),L||(F+="&tid="+Math.floor(Math.random()*11)),F},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,_),I=d(p,"/send"),L,$=function(O,B){t(B).triggerHandler(a.onError,[n._.transportError(n.resources.sendFailed,B.transport,O,L),_])};return L=u.ajax(p,{url:I,type:p.ajaxDataType==="jsonp"?"GET":"POST",contentType:n._.defaultContentType,headers:p.accessToken?{Authorization:"Bearer "+p.accessToken}:{},data:{data:k},success:function(O){var B;if(O){try{B=p._parseResponse(O)}catch(U){$(U,p),p.stop();return}u.triggerReceived(p,B)}},error:function(O,B){B==="abort"||B==="parsererror"||$(O,p)}}),L},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 F=p._deferral;F&&F.reject($)},I=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($,F,O){var B;try{B=p._parseResponse($)}catch(U){I(n._.error(n._.format(n.resources.errorParsingStartResponse,$),U,O));return}B.Response==="started"?_():I(n._.error(n._.format(n.resources.invalidStartResponse,$),null,O))},error:function($,F,O){F!==l?I(n._.error(n.resources.errorDuringStartRequest,O,$)):(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 I;if(_&&typeof _.I<"u"){u.triggerReceived(p,_);return}if(u.markLastMessage(p),_){if(I=u.maximizePersistentResponse(_),I.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,I.GroupsToken),I.MessageId&&(p.messageId=I.MessageId),I.Messages&&(t.each(I.Messages,function(L,$){u.triggerReceived(p,$)}),u.tryInitialize(p,I,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,I,L){var $=n._.transportError(n._.format(n.resources.parseFailed,_),p.transport,k,L);I&&I($)?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(I){var L;this===c.socket&&(y&&typeof I.wasClean<"u"&&I.wasClean===!1?(L=n._.transportError(n.resources.webSocketClosed,c.transport,I),c.log("Unclean disconnect from websocket: "+(I.reason||"[no reason given]."))):c.log("Websocket closed."),(!d||!d(L))&&(L&&t(c).triggerHandler(a.onError,[L]),p.reconnect(c)))},c.socket.onmessage=function(I){var L;try{L=c._parseResponse(I.data)}catch($){l.handleParseFailure(c,I.data,$,d,I);return}L&&l.processMessages(c,L,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,I;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}I=l.getUrl(h,this.name,k);try{h.log("Attempting to connect to SSE endpoint '"+I+"'."),h.eventSource=new i.EventSource(I,{withCredentials:h.withCredentials})}catch(L){h.log("EventSource failed trying to connect with error "+L.Message+"."),g?g():(_.triggerHandler(a.onError,[n._.transportError(n.resources.eventSourceFailedToConnect,h.transport,L)]),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(L){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(L){var $;if(L.data!=="initialized"){try{$=h._parseResponse(L.data)}catch(F){l.handleParseFailure(h,L.data,F,g,L);return}l.processMessages(h,$,d)}},!1),h.eventSource.addEventListener("error",function(L){var $=n._.transportError(n.resources.eventSourceError,h.transport,L);this===h.eventSource&&(g&&g($)||(h.log("EventSource readyState: "+h.eventSource.readyState+"."),L.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,I=u(),L=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}I.setAttribute("data-signalr-connection-id",d.id),c.prevent(),k=l.getUrl(d,this.name),k+="&frameId="+_,i.document.documentElement.appendChild(I),d.log("Binding to iframe's load event."),I.addEventListener?I.addEventListener("load",L,!1):I.attachEvent&&I.attachEvent("onload",L),I.src=k,l.foreverFrame.connections[_]=d,d.frame=I,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(O){return g(O)?(h.log("LongPolling failed to connect."),!0):!1},k=h._,I=0,L=function(O){i.clearTimeout(k.reconnectTimeoutId),k.reconnectTimeoutId=null,o(O,n.connectionState.reconnecting,n.connectionState.connected)===!0&&(O.log("Raising the reconnect event"),t(O).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 F(O,B){var U=O.messageId,C=U===null,P=!C,K=!B,z=u.getUrl(O,y.name,P,K,!0),X={};O.messageId&&(X.messageId=O.messageId),O.groupsToken&&(X.groupsToken=O.groupsToken),l(O)!==!0&&(h.log("Opening long polling request to '"+z+"'."),O.pollXhr=u.ajax(h,{xhrFields:{onprogress:function(){u.markLastMessage(h)}},url:z,type:"POST",contentType:n._.defaultContentType,data:X,timeout:h._.pollTimeout,headers:h.accessToken?{Authorization:"Bearer "+h.accessToken}:{},success:function(he){var fe,ne=0,se,le;h.log("Long poll complete."),I=0;try{fe=h._parseResponse(he)}catch(de){u.handleParseFailure(O,he,de,_,O.pollXhr);return}k.reconnectTimeoutId!==null&&L(O),fe&&(se=u.maximizePersistentResponse(fe)),u.processMessages(O,fe,p),se&&t.type(se.LongPollDelay)==="number"&&(ne=se.LongPollDelay),l(O)!==!0&&(le=se&&se.ShouldReconnect,!(le&&!u.ensureReconnectingState(O))&&(ne>0?k.pollTimeoutId=i.setTimeout(function(){F(O,le)},ne):F(O,le)))},error:function(he,fe){var ne=n._.transportError(n.resources.longPollFailed,h.transport,he,O.pollXhr);if(i.clearTimeout(k.reconnectTimeoutId),k.reconnectTimeoutId=null,fe==="abort"){h.log("Aborted xhr request.");return}if(!_(ne)){if(I++,h.state!==n.connectionState.reconnecting&&(h.log("An error occurred using longPolling. Status = "+fe+". Response = "+he.responseText+"."),t(O).triggerHandler(a.onError,[ne])),(h.state===n.connectionState.connected||h.state===n.connectionState.reconnecting)&&!u.verifyLastActive(h)||!u.ensureReconnectingState(O))return;k.pollTimeoutId=i.setTimeout(function(){F(O,!0)},y.reconnectDelay)}}}),P&&B===!0&&(k.reconnectTimeoutId=i.setTimeout(function(){L(O)},Math.min(1e3*(Math.pow(2,I)-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,I){var L,$=_.length,F=[];for(L=0;L<$;L+=1)_.hasOwnProperty(L)&&(F[L]=k.call(I,_[L],L,_));return F}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 I=_._.invocationCallbacks,L;h(I)&&_.log("Clearing hub invocation callbacks with error: "+k+"."),_._.invocationCallbackId=0,delete _._.invocationCallbacks,_._.invocationCallbacks={};for(var $ in I)L=I[$],L.method.call(L.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,I){this.state={},this.connection=k,this.hubName=I,this._={callbackMap:{}}},constructor:y,hasSubscriptions:function(){return h(this._.callbackMap)},on:function(k,I,L){var $=this,F=$._.callbackMap,O=!L&&g(I);L=L||I,L._signalRGuid||(L._signalRGuid=n++),k=k.toLowerCase();var B=F[k];B||(B=[],F[k]=B);for(var U,C=0;C<B.length;C++)(B[C].guid===L._signalRGuid||O&&B[C].isFromOldGeneratedHubProxy)&&(U=B[C]);U||(U={guid:L._signalRGuid,eventHandlers:[],isFromOldGeneratedHubProxy:O},F[k].push(U));var P=function(z,X){I.apply($,X)};return U.eventHandlers.push(P),t($).bind(l(k),P),$},off:function(k,I,L){var $=this,F=$._.callbackMap,O,B=!L&&g(I);if(L=L||I,k=k.toLowerCase(),O=F[k],O)if(I){for(var U,C=0;C<O.length;C++)(O[C].guid===L._signalRGuid||B&&O[C].isFromOldGeneratedHubProxy)&&(U=O[C]);if(U){for(var P=0;P<U.eventHandlers.length;P++)t($).unbind(l(k),U.eventHandlers[P]);O.splice(C,1),O.length===0&&delete F[k]}}else I||(t($).unbind(l(k)),delete F[k]);return $},invoke:function(k){var I=this,L=I.connection,$=t.makeArray(arguments).slice(1),F=u($,c),O={H:I.hubName,M:k,A:F,I:L._.invocationCallbackId},B=t.Deferred(),U=function(P){var K=I._maximizeHubResponse(P),z,X;t.extend(I.state,K.State),K.Progress?B.notifyWith?B.notifyWith(I,[K.Progress.Data]):L._.progressjQueryVersionLogged||(L.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."),L._.progressjQueryVersionLogged=!0):K.Error?(K.StackTrace&&L.log(K.Error+`
|
|
341
|
+
`+K.StackTrace+"."),z=K.IsHubException?"HubException":"Exception",X=o._.error(K.Error,z),X.data=K.ErrorData,L.log(I.hubName+"."+k+" failed to execute. Error: "+X.message),B.rejectWith(I,[X])):(L.log("Invoked "+I.hubName+"."+k),B.resolveWith(I,[K.Result]))};return L._.invocationCallbacks[L._.invocationCallbackId.toString()]={scope:I,method:U},L._.invocationCallbackId+=1,t.isEmptyObject(I.state)||(O.S=I.state),L.log("Invoking "+I.hubName+"."+k),L.send(O),B.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 I={qs:null,logging:!1,useDefaultPath:!0};return t.extend(I,k),(!_||I.useDefaultPath)&&(_=(_||"")+"/signalr"),new p.fn.init(_,I)}p.fn=p.prototype=t.connection(),p.fn.init=function(_,k){var I={qs:null,logging:!1,useDefaultPath:!0},L=this;t.extend(I,k),t.signalR.fn.init.call(L,_,I.qs,I.logging),L.proxies={},L._.invocationCallbackId=0,L._.invocationCallbacks={},L.received(function($){var F,O,B,U,C,P;$&&(typeof $.P<"u"?(B=$.P.I.toString(),U=L._.invocationCallbacks[B],U&&U.method.call(U.scope,$)):typeof $.I<"u"?(B=$.I.toString(),U=L._.invocationCallbacks[B],U&&(L._.invocationCallbacks[B]=null,delete L._.invocationCallbacks[B],U.method.call(U.scope,$))):(F=this._maximizeClientHubInvocation($),L.log("Triggering client hub event '"+F.Method+"' on hub '"+F.Hub+"'."),C=F.Hub.toLowerCase(),P=F.Method.toLowerCase(),O=this.proxies[C],t.extend(O.state,F.State),t(O).triggerHandler(l(P),[F.Args])))}),L.error(function($,F){var O,B;F&&(O=F.I,B=L._.invocationCallbacks[O],B&&(L._.invocationCallbacks[O]=null,delete L._.invocationCallbacks[O],B.method.call(B.scope,{E:$})))}),L.reconnecting(function(){L.transport&&L.transport.name==="webSockets"&&d(L,"Connection started reconnecting before invocation result was received.")}),L.disconnected(function(){d(L,"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(I){this.hasSubscriptions()&&(k.push({name:I}),_.log("Client subscribed to hub '"+I+"'."))}),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),cl.hubConnection=e.hubConnection,cl.signalR=e.signalR,cl}var Gz=Wz(),Qi=(s=>(s.AppleTv="apple-tv",s.Vivi="vivi",s))(Qi||{}),Gs=(s=>(s.Available="available",s.Offline="offline",s.Busy="busy",s))(Gs||{});const Kz=class lv{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 lv(Promise.reject(e))}static fromPromise(e){return new lv(e)}};let uv=Kz;class Xz{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 uv.reject(new Error("This EventChannel instance has been disposed"));let t;return new uv(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 nu{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",ct.void),Object.values(this.channels).forEach(e=>e.dispose()),this.channels={}}getChannel(e){return this.channels[e]||(this.channels[e]=new Xz),this.channels[e]}}const ct={void:void 0};class oy{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 Qz(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 Yz(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 fh={withDebouncedSetters:Qz,withTimestampedSetters:Yz};var vl=(s=>(s[s.Offline=0]="Offline",s[s.Online=1]="Online",s[s.Locked=2]="Locked",s[s.Suspended=3]="Suspended",s))(vl||{}),jl=(s=>(s[s.PlaybackStatusChange=0]="PlaybackStatusChange",s[s.PositionChange=1]="PositionChange",s))(jl||{}),ci=(s=>(s.Begin="BEGIN",s.Play="PLAY",s.Pause="PAUSE",s.Load="LOAD",s.Scan="SCAN",s.Stop="STOP",s))(ci||{});const Jz=2e3;class Zz{constructor(e,t){return this.title=e,this.device=t,this.locked=!1,this.position=0,this.playbackStatus=ci.Load,this.debounced=fh.withDebouncedSetters(this,Jz),fh.withTimestampedSetters(this)}}class eW extends nu{constructor(e,t){super(),this.client=e,this.localState=new Zz(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 jl.PlaybackStatusChange:this.handlePlaybackChange(t,e);break;case jl.PositionChange:this.handlePositionChange(t,e);break}}handlePlaybackChange(e,t){e.playbackStatus!==t.params.playbackStatus&&(e.playbackStatus=t.params.playbackStatus,this.trigger("playingchange",ct.void),e.playbackStatus===ci.Stop&&this.dispose())}handlePositionChange(e,t){e.position!==t.params.position&&(e.position=t.params.position,this.trigger("positionchange",ct.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",ct.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!==ci.Play&&(this.localState.playbackStatus=ci.Play,this.client.play(this.getDevice().id),this.trigger("playingchange",ct.void))}pause(){this.localState.locked&&this.localState.playbackStatus!==ci.Pause&&(this.localState.playbackStatus=ci.Pause,this.client.pause(this.getDevice().id),this.trigger("playingchange",ct.void))}seek(e){this.localState.locked&&this.localState.position!==e&&(this.localState.position=e,this.client.seek(this.getDevice().id,e),this.trigger("positionchange",ct.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===ci.Play||this.localState.playbackStatus===ci.Begin||this.localState.playbackStatus===ci.Load}isPlaybackFinished(){return this.localState.playbackStatus===ci.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 tW=2e4,iW=500,rW="DeviceUserHub",nW=5e3;class Ms extends nu{constructor(e){super(),this.options=e,this.accessToken=void 0,this.devices=[],this.heartbeat=new oy,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=Gl(this.invoke,iW,!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=Gz.hubConnection(this.accessToken.host,{logging:!1}),this.hubProxy=this.connection.createHubProxy(rW),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(nW).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 uv.fromPromise(i).timeout(tW)}handleDeviceList(e){this.devices=e.filter(t=>t.type!=="vivi").map(Ms.convertToGenericDevice),this.trigger("deviceschange",ct.void)}handleDeviceStateChange(e){const t=this.devices.findIndex(i=>i.id===e.deviceId);t>=0&&(this.devices[t]=Ms.convertToGenericDevice(e),this.trigger("deviceschange",ct.void))}handleDevicePaired(e){e.type!=="vivi"&&(this.devices.push(Ms.convertToGenericDevice(e)),this.trigger("deviceschange",ct.void))}handleDeviceUnpaired(e){this.devices=this.devices.filter(t=>t.id!==e),this.trigger("deviceschange",ct.void)}handlePlayStatusChange(e,t){this.trigger("message",{event:jl.PlaybackStatusChange,deviceId:e,params:{playbackStatus:t.commandType}})}handleTimeSync(e,t){this.trigger("message",{event:jl.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===Qi.AppleTv}getDevices(){return this.devices}startCastSession(e){return new eW(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:ci.Play,Data:this.options.trackingCode})}async play(e){await this.invoke("Command",{DeviceId:e,CommandType:ci.Play})}async pause(e){await this.invoke("Command",{DeviceId:e,CommandType:ci.Pause})}seek(e,t){this.invokeDebounced("Command",{DeviceId:e,CommandType:ci.Play,Params:`1,${Math.trunc(t)}`})}async stop(e){await this.invoke("Command",{DeviceId:e,CommandType:ci.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 vl.Online:return Gs.Available;case vl.Locked:return Gs.Busy;case vl.Suspended:case vl.Offline:return Gs.Offline}}static convertToGenericDevice(e){return{id:e.deviceId,name:e.name,type:Qi.AppleTv,status:Ms.convertToGenericDeviceStatus(e.status)}}}const MC={reconnectIntervalInMilliseconds:3e3,heartbeatEnabled:!1,heartbeatIntervalInMillseconds:1e4,heartbeatMessage:""};class sW{constructor(e,t=MC){this.bindFunctions(),this.url=e,this.options={...MC,...t},this.webSocket=this.connect(),this.heartbeat=new oy().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 aW=2e3;class oW{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=fh.withDebouncedSetters(this,aW),fh.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 Xn=(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))(Xn||{});class lW extends nu{constructor(e,t){super(),this.client=e,this.localState=new oW(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 Xn.Update:this.handleUpdateMessage(t,i);break;case Xn.NewChapter:this.handleNewChapterMessage(t,i);break;case Xn.Volume:this.handleVolumeMessage(t,i);break;case Xn.Playing:this.handlePlayingMessage(t);break;case Xn.Paused:this.handlePausedMessage(t);break;case Xn.Finished:this.handleFinishedMessage(t);break;case Xn.Stopped:this.handleStoppedMessage();break}}handleUpdateMessage(e,t){e.duration!==t.duration&&(e.duration=t.duration,this.trigger("durationchange",ct.void)),e.position!==t.position&&(e.position=t.position,this.trigger("positionchange",ct.void)),e.subtitles!==t.subtitles&&(e.subtitles=t.subtitles,this.trigger("subtitleschange",ct.void))}handleVolumeMessage(e,t){e.volume!==t.level&&(e.volume=t.level,e.mute=t.level===0,this.trigger("volumechange",ct.void))}handlePlayingMessage(e){e.playing!==!0&&(e.playing=!0,e.playbackFinished=!1,this.trigger("playingchange",ct.void))}handlePausedMessage(e){e.playing!==!1&&(e.playing=!1,this.trigger("playingchange",ct.void))}handleFinishedMessage(e){e.playbackFinished!==!0&&(e.playing=!1,e.playbackFinished=!0,this.trigger("playingchange",ct.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",ct.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",ct.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",ct.void))}pause(){this.localState.ready&&this.localState.playing!==!1&&(this.localState.playing=!1,this.client.pause(this.getDevice().id),this.trigger("playingchange",ct.void))}seek(e){this.localState.ready&&this.localState.position!==e&&(this.localState.position=e,this.client.seek(this.getDevice().id,e),this.trigger("positionchange",ct.void))}setVolume(e){this.localState.ready&&this.localState.volume!==e&&(this.localState.volume=e,this.client.setVolume(this.getDevice().id,e),this.trigger("volumechange",ct.void))}setMuted(e){this.localState.ready&&this.localState.mute!==e&&(this.localState.mute=e,this.client.setMuted(this.getDevice().id,e),this.trigger("volumechange",ct.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",ct.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 or=1e4,uW=500,cW=1e4;class Fs extends nu{constructor(e){super(),this.options=e,this.accessToken="",this.devices=[],this.devicesFingerprint="",this.deviceDiscovery=new oy,this.bindFunctions(),this.initialize()}bindFunctions(){this.initialize=this.initialize.bind(this),this.sendMessage=this.sendMessage.bind(this),this.sendMessageDebounced=Gl(this.sendMessage,uW,!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 sW(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",ct.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(cW).schedule(async()=>{try{const e=await this.getRoomList(),t=Fs.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:Qi.Vivi,status:Gs.Available})),this.devicesFingerprint=t,this.trigger("deviceschange",ct.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===Qi.Vivi}getDevices(){return this.devices}startCastSession(e){return new lW(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(or).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(or).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(or).catch(()=>{throw new Error("Failed to join room")})}async query(e){const t=Fs.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(or).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:Fs.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(or).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(or).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(or).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(or).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(or).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(or).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(or).catch(()=>{throw new Error("Failed to set mute")})}async setSubtitles(e,t){const i=Fs.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(or).catch(()=>{throw new Error("Failed to set subtitles")})}static createAckId(){return hI.generateRandomId()}static calculateFingerprint(e){return e.map(t=>t.id).sort().join(",")}}const mh=class mh extends nu{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 mh(e)),this.instances[e]}static disposeAndRemoveInstance(e){e.dispose(),delete this.instances[e.instanceId]}static isActive(){return Object.keys(this.instances).length>0}};mh.instances={};let Ks=mh;const hW=j.getComponent("MenuItem");class FC extends hW{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=j.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 dW=j.getComponent("Menu");class dI extends dW{createEl(){const e=WA.apply(this),t=this.contentEl_;return this.contentWrapper=j.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 Ut(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"))}}j.registerComponent("DevicesMenu",dI);function fW({inactiveIntegrations:s,canUserManageIntegrations:e,player:t,onDismiss:i,onInstall:r,onLearnMore:n,onContactSupport:a}){if(s.length===0)return A.jsxRuntimeExports.jsx(A.jsxRuntimeExports.Fragment,{});const o=c=>t.localize(c),l=c=>s.indexOf(c)!==-1;let u;return l(Qi.AppleTv)&&l(Qi.Vivi)?u="vivi_and_apple_tv":l(Qi.Vivi)?u="vivi":u="apple_tv",A.jsxRuntimeExports.jsxs("div",{className:"cv-devices-cta",tabIndex:-1,children:[A.jsxRuntimeExports.jsx(pW,{context:u,localize:o,onDismiss:()=>i(u)}),A.jsxRuntimeExports.jsx(mW,{context:u}),A.jsxRuntimeExports.jsx(gW,{context:u,canUserManageIntegrations:e,localize:o,onContactSupport:()=>a(u),onInstall:()=>r(u),onLearnMore:()=>n(u)})]})}function pW({context:s,localize:e,onDismiss:t}){return A.jsxRuntimeExports.jsxs("div",{className:"cv-devices-cta-header",children:[A.jsxRuntimeExports.jsx("span",{className:"cv-devices-badge",children:e("New")}),A.jsxRuntimeExports.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")]}),A.jsxRuntimeExports.jsx("span",{className:"cv-devices-close",onClick:t,children:A.jsxRuntimeExports.jsx("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:A.jsxRuntimeExports.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 mW({context:s}){const e=s==="vivi_and_apple_tv"?"bg-vivi-and-apple":s==="vivi"?"bg-vivi":"bg-apple";return A.jsxRuntimeExports.jsxs("div",{className:`cv-devices-cta-body ${e}`,children:[(s==="vivi_and_apple_tv"||s==="apple_tv")&&A.jsxRuntimeExports.jsx("div",{className:"cv-devices-icon-container",children:A.jsxRuntimeExports.jsx("span",{className:"cv-devices-icon apple"})}),(s==="vivi_and_apple_tv"||s==="vivi")&&A.jsxRuntimeExports.jsx("div",{className:"cv-devices-icon-container",children:A.jsxRuntimeExports.jsx("span",{className:"cv-devices-icon vivi"})})]})}function gW({context:s,canUserManageIntegrations:e,localize:t,onInstall:i,onLearnMore:r,onContactSupport:n}){return e?A.jsxRuntimeExports.jsxs("div",{className:"cv-devices-cta-footer",children:[A.jsxRuntimeExports.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.")]}),A.jsxRuntimeExports.jsx("br",{}),A.jsxRuntimeExports.jsx("span",{className:"cv-devices-link",onClick:i,children:t("Click here to install")})]}):A.jsxRuntimeExports.jsxs("div",{className:"cv-devices-cta-footer",children:[A.jsxRuntimeExports.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 ")]}),A.jsxRuntimeExports.jsx("span",{className:"cv-devices-link",onClick:n,children:"ClickView Support"}),A.jsxRuntimeExports.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.")]}),A.jsxRuntimeExports.jsx("br",{}),A.jsxRuntimeExports.jsx("span",{className:"cv-devices-link",onClick:r,children:"Learn more"})]})}j.registerComponent("DevicesCta",nd((s,e)=>A.jsxRuntimeExports.jsx(fW,{player:s,...e}),{properties:{className:"cv-devices-cta-wrapper"}}));const vW=20,yW=j.getComponent("DevicesCta"),BC=j.getComponent("MenuButton");class fI extends BC{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 BC.prototype.createEl.apply(this,...e)}buildWrapperCSSClass(){return`cv-menu-small cv-devices-button ${super.buildWrapperCSSClass()}`}createMenu(){const e=new dI(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 yW(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 Qs(this.player_,{label:this.localize("Select a device"),selectable:!1}),this.searchInputItem=new Jv(this.player_,{menuButton:this,search:t=>this.setSearchText(t),className:"cv-devices-search-input"}),this.emptyPlaceholder=new Zv(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 FC)}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 FC(this.player(),{id:i.id,label:i.name,schoolName:i.schoolName,description:i.description,selected:!1,multiSelectable:!1,selectable:!0,available:i.status===Gs.Available,type:i.type,onClick:()=>{this.options_.onDeviceMenuItemClick(r,i)}});this.menu.addItem(r)})}shouldShowSearchInput(){return this.getDeviceMenuItems().length>=vW}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===Gs.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()}}fI.prototype.controlText_="Devices";j.registerComponent("DevicesButton",fI);const _W=j.getComponent("Component");class TW extends _W{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)??Qi.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 bW=j.getComponent("Tech");class SW extends bW{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=j(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 Wt.findTrackByPredicate(this.videojsPlayer.player_,e=>e.mode==="showing"&&!!e.src)}setSelectedTextTrack(e){Wt.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 TW({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 Ks.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 j.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!!Ks.getOrCreateInstance((t==null?void 0:t.instanceId)??"").getCastSession()}static isSupported(){return Ks.isActive()}}j.registerTech("devices",SW);const xW=j.getPlugin("plugin");class CW extends xW{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:A.UserAction.Select,workflowPhase:A.WorkflowPhase.Complete,descriptor:A.PlaybackDescriptor.ChangeDevice,entity:A.EntityType.Device,eventVersion:A.EventVersion.V3})},l=this.options.ctaOptions,u=this.options.vivi,c=this.options.appleTv,h=[];c.enabled||h.push(Qi.AppleTv),(!u.enabled||!u.accountConnected)&&h.push(Qi.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-${Qi.AppleTv}`),this.player.removeClass(`cv-device-${Qi.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(Fs))return;const t=new Fs({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(Ms))return;const t=new Ms({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 Ks.getOrCreateInstance(this.instanceId)}dispose(){const e=this.getSessionManager();e&&(e.off("deviceschange",this.onDevicesChanged),e.off("castsessionchange",this.onCastSessionChanged),e.off("error",this.onDevicesError),Ks.disposeAndRemoveInstance(e),super.dispose())}}j.registerPlugin("devicesPlugin",CW);function EW(s){var n;const[e,t]=A.reactExports.useState(5);if(A.reactExports.useEffect(()=>{const a=setInterval(()=>{t(o=>o-1)},1e3);return()=>{clearInterval(a)}},[]),A.reactExports.useEffect(()=>{e===0&&s.onPlayNext()},[e]),!s.nextVideo||!s.onPlayNext)return A.jsxRuntimeExports.jsx(A.jsxRuntimeExports.Fragment,{});const i=Math.ceil(e),r=i===1?"second":"seconds";return A.jsxRuntimeExports.jsx(A.jsxRuntimeExports.Fragment,{children:A.jsxRuntimeExports.jsxs("div",{className:"cv-up-next-container",children:[A.jsxRuntimeExports.jsx("div",{className:"cv-cancel-up-next cursor-pointer",role:"button",onClick:s.onCancel,children:"×"}),A.jsxRuntimeExports.jsxs("div",{className:"cv-up-next-heading",children:["Up next in ",i," ",r,":"]}),A.jsxRuntimeExports.jsx("div",{className:"cv-up-next-image cursor-pointer",onClick:s.onPlayNext,style:{backgroundImage:`url(${(n=s.nextVideo)==null?void 0:n.thumbnailUrl})`}}),A.jsxRuntimeExports.jsx("div",{className:"cv-up-next-title",children:s.nextVideo.name})]})})}j.registerComponent("UpNext",nd((s,e)=>A.jsxRuntimeExports.jsx(EW,{player:s,...e})));const wW=j.getComponent("MenuItem");let kW=class extends wW{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(){j.dom.addClass(this.toggleEl,"on")}toggleOff(){j.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=j.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()}};j.registerComponent("NextVideoMenuItem",kW);const UC="cv-persisttest",jC="cv-play-next-video",AW=j.getPlugin("plugin");j.getComponent("MenuItem");const IW=j.getComponent("NextVideoMenuItem");class PW extends AW{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(jC);this.shouldPlayNextVideo=t==="true"}e.ready(()=>{this.initialize()})}initialize(){this.player.isDisposed()||this.bindListeners()}getChapterTrack(){return Wt.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:IW,name:"NextVideoMenuItem"})}getShouldPlayNext(){return this.shouldPlayNextVideo}setShouldPlayNext(e,t){this.shouldPlayNextVideo=e,this.player.trigger("cv:playnext",e),this.hasLocalStorage&&t&&window.localStorage.setItem(jC,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(UC,"persistPlayNext"),window.localStorage.removeItem(UC),!0}catch{return!1}}}j.registerPlugin("nextVideoPlugin",PW);const DW="_imageStyle_9s5en_1",NW="_imageTypeResource_9s5en_6",LW="_fallBackImage_9s5en_12",eg={imageStyle:DW,imageTypeResource:NW,fallBackImage:LW},OW={width:200,resizeType:A.ResizeType.Cover};function RW(s,e,t=OW){var n,a,o;const i=pI(e);if("thumbnail"in e&&((n=e.thumbnail)!=null&&n.url))return A.ImageHelper.createUrl((a=e.thumbnail)==null?void 0:a.url,{...t});const r=A.UrlHelper$1.safeUrlConcat(s,"/v1/previews");return kl.MasterTypeHelper.isResource(e)?i===A.ImageType.Pdf?e.metadata.type===xr.ResourceFileType.Pdf?A.ImageHelper.createResourceImage(r,e.url,{...t}):A.ImageHelper.createResourceImage(r,(o=e.pdf)==null?void 0:o.url,{...t}):e.metadata.type!==xr.ResourceFileType.Zip?A.ImageHelper.createUrl(e.url,{size:A.ImageSize.Medium,resizeType:A.ResizeType.Cover}):"/images/zip-resource.png":A.ImageHelper.createResourceImage(r,e.url,{...t})}function pI(s){var e;return kl.MasterTypeHelper.isResource(s)?s.metadata.type===xr.ResourceFileType.Pdf||(e=s.pdf)!=null&&e.url?A.ImageType.Pdf:A.ImageType.Thumbnails:A.ImageType.Link}function MW(s){var r,n;let e=null,t=0;kl.MasterTypeHelper.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=RW(s.imageCdnUrl,s.resource,s.dynamicRatioImageOptions);return A.jsxRuntimeExports.jsx(zC.BaseImage,{data:i,imageType:pI(s.resource),imageStyle:{transform:`rotate(${t}deg)`},alt:s.resource.name,errorFallbackImageSrc:s.imageErrorFallbackUrl,errorFallbackImageClassName:eg.fallBackImage,imageClassName:(e==null?void 0:e.type)===xr.ResourceFileType.Image?`${eg.imageTypeResource} ${eg.imageStyle}`:"",preload:s.preloadImage,preventLoad:!s.preloadImage})}const FW={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"}}},BW="_imageStyle_1xd89_1",UW="_item_1xd89_6",jW="_dashboard_1xd89_10",$W="_playPage_1xd89_25",qW="_aspectRatio_1xd89_34",HW="_outerContainer_1xd89_39",VW="_innerContainer_1xd89_46",zW="_actions_1xd89_46",WW="_titleBelow_1xd89_56",GW="_thumbnailContainer_1xd89_59",KW="_titleAbove_1xd89_62",XW="_teacherPack_1xd89_65",QW="_text_1xd89_68",YW="_hoverState_1xd89_71",JW="_atomGuide_1xd89_74",ZW="_studentActivity_1xd89_83",eG="_additionalMaterials_1xd89_92",tG="_userUploaded_1xd89_101",iG="_download_1xd89_116",Vt={imageStyle:BW,item:UW,dashboard:jW,playPage:$W,aspectRatio:qW,outerContainer:HW,innerContainer:VW,actions:zW,titleBelow:WW,thumbnailContainer:GW,titleAbove:KW,teacherPack:XW,text:QW,hoverState:YW,atomGuide:JW,studentActivity:ZW,additionalMaterials:eG,userUploaded:tG,download:iG};function rG(s){switch(s){case"atom-guide":return Vt.atomGuide;case"student-activity":return Vt.studentActivity;case"teacher-pack":return Vt.teacherPack;case"additional-materials":return Vt.additionalMaterials;default:return Vt.userUploaded}}function nG(s,e){var i;const t=zC.useBreakpoints();return e==="public"?!0:t.xs||t.sm||s.type!=="resource"||!("metadata"in s)?!1:s.metadata.type===xr.ResourceFileType.Image?!0:s.metadata.type===xr.ResourceFileType.Pdf?!!s.url:!!((i=s.pdf)!=null&&i.url)}Ns.defaultProps={preloadImage:!0,actionBehaviour:"normal"};function Ns(s){var r,n,a;let e=null;"metadata"in s.data&&(e=s.data.metadata);const t=kl.MasterTypeHelper.isType(s.data,A.MasterType.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 ${rG(o)} ${Vt.innerContainer}`;return(u=s.theme)!=null&&u.containerClass?l+=` ${s.theme.containerClass}`:l+=" pt-3 px-3",s.applyHoverState&&(l+=` ${Vt.hoverState}`),l}return A.jsxRuntimeExports.jsxs(A.jsxRuntimeExports.Fragment,{children:[A.jsxRuntimeExports.jsx("div",{className:Vt.aspectRatio,children:A.jsxRuntimeExports.jsx("div",{className:Vt.outerContainer,children:A.jsxRuntimeExports.jsxs("div",{className:i(e==null?void 0:e.resourceType),children:[s.titlePosition==="above"&&A.jsxRuntimeExports.jsx(A.Tooltip,{title:s.data.name,children:A.jsxRuntimeExports.jsx("h3",{className:`text-center text-break h5 mb-3 ${Vt.text}`,children:A.jsxRuntimeExports.jsx("span",{className:"clamp-1",children:s.data.name})})}),A.jsxRuntimeExports.jsx("div",{className:`
|
|
359
|
+
${((r=s.theme)==null?void 0:r.thumbnailContainerClass)??""} w-75 overflow-hidden
|
|
360
|
+
${Vt.thumbnailContainer} ${s.titlePosition==="above"?Vt.titleAbove:""}
|
|
361
|
+
${Vt.imageStyle}
|
|
362
|
+
`,children:A.jsxRuntimeExports.jsx(MW,{resource:s.data,imageCdnUrl:s.imageCdnUrl,imageErrorFallbackUrl:s.imageErrorFallbackUrl,preloadImage:s.preloadImage})}),t&&s.onClickDownload&&s.actionBehaviour==="normal"&&A.jsxRuntimeExports.jsx("div",{className:Vt.actions,children:A.jsxRuntimeExports.jsx(A.DivButton,{onClick:o=>s.onClickDownload(o,s.data),className:`${Vt.download} d-flex align-items-center justify-content-center`,children:A.jsxRuntimeExports.jsx(A.SvgContainer,{svg:ZA})})}),!s.hideTypeBadge&&t&&A.jsxRuntimeExports.jsx(yc.TypeBadge,{typeId:A.MasterType.Resource})]})})}),s.titlePosition==="below"&&A.jsxRuntimeExports.jsxs("div",{className:`mt-1 ${Vt.titleBelow}`,children:[kl.MasterTypeHelper.isType(s.data,A.MasterType.Resource)&&!!((a=(n=s.data)==null?void 0:n.metadata)!=null&&a.resourceType)&&A.jsxRuntimeExports.jsx(yc.TitleSubText,{children:FW.getResourceTypeName(s.data.metadata.resourceType)}),A.jsxRuntimeExports.jsx("h3",{className:"h6 clamp-2",children:s.data.name})]})]})}A.React.memo(function(s){const e=nG(s.data,s.actionBehaviour);function t(){return s.location==="play-page"?Vt.playPage:Vt.dashboard}const i={...s.analyticsData,...s.data},r={...s.analyticsOptions,actionType:A.UserAction.Click,entity:s.data.typeId===A.MasterType.Resource?A.EntityType.Resource:A.EntityType.Link};function n(){A.AnalyticsHelper.logUserAction(i,r)}const a={...s,applyHoverState:e||!!s.data.url};return A.jsxRuntimeExports.jsx("div",{className:`px-1 flex-shrink-0 ${Vt.item} ${t()} ${A.SeoConstants.RESOURCE_ITEM_SELECTOR}`,children:(()=>{const o="d-block no-decoration";return s.data.type==="link"?A.jsxRuntimeExports.jsx("a",{href:s.data.url,target:"_blank",className:o,onClick:n,children:A.jsxRuntimeExports.jsx(Ns,{...a})}):e?s.actionBehaviour==="public"?A.jsxRuntimeExports.jsx("div",{className:`${o} cursor-pointer d-inline`,onClick:()=>{n(),A.AppLinkHelper.trigger(s.getAppLink(s.data))},children:A.jsxRuntimeExports.jsx(Ns,{...a})}):A.jsxRuntimeExports.jsx(A.AppLink,{appLink:s.getAppLink(s.data),className:o,analyticsData:i,analyticsOptions:r,children:A.jsxRuntimeExports.jsx(Ns,{...a})}):s.data.url?A.jsxRuntimeExports.jsx("a",{href:s.data.url,className:o,onClick:n,children:A.jsxRuntimeExports.jsx(Ns,{...a})}):A.jsxRuntimeExports.jsx("div",{className:o,children:A.jsxRuntimeExports.jsx(Ns,{...a})})})()})});function sG(s){return A.jsxRuntimeExports.jsx("div",{className:"cv-resource-item",children:A.jsxRuntimeExports.jsx(Ns,{data:s.resource,imageCdnUrl:s.imageCdnUrl,titlePosition:"above",hideTypeBadge:!0})})}const aG=nd((s,e)=>A.jsxRuntimeExports.jsx(sG,{...e})),oG=j.getComponent("MenuItem");class lG extends oG{constructor(e,t){super(e,t);const i=new aG(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 uG=j.getComponent("MenuButton");class mI extends uG{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 Qs(this.player_,{label:"Resources"})),this.options_.resources.forEach(t=>{const i=new lG(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"){A.LocationUtils.PageLoad(e.url,!0);return}this.getDownloadIframe().src=e.url}getDownloadIframe(){return this.downloadIframe?this.downloadIframe:(this.downloadIframe=j.dom.createEl("iframe"),this.downloadIframe.style.display="none",j.dom.appendContent(j.dom.$("body"),this.downloadIframe),this.downloadIframe)}getCollabsibleName(){return this.controlText_}getCollabsibleValue(){return""}showInCollabsibleMenu(){return!0}showCollapsibleMenu(){super.handleClick(null)}}mI.prototype.controlText_="Resources";j.registerComponent("ResourcesButton",mI);const cG=j.getPlugin("plugin");class hG extends cG{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)}}j.registerPlugin("resourcesPlugin",hG);function dG(s){const{className:e="",playerApi:t,onReady:i,onDispose:r,...n}=s,a=A.React.useRef(null);return A.React.useEffect(()=>{if(!a)return;const o=new Bz(a.current,{...n,playerApi:t});return i&&o.ready(()=>{i(Uz(o))}),r&&o.one("dispose",r),()=>{o==null||o.dispose()}},[s.viewKey]),A.jsxRuntimeExports.jsx("div",{ref:a,className:e})}const fG="_overlay_rtlcs_1",pG="_close_rtlcs_10",mG="_preview_rtlcs_15",ic={overlay:fG,close:pG,preview:mG};function gG(s){return A.jsxRuntimeExports.jsxs(A.jsxRuntimeExports.Fragment,{children:[A.jsxRuntimeExports.jsx("div",{className:`${ic.overlay} ${ic.preview} d-flex align-items-center justify-content-start`,children:A.jsxRuntimeExports.jsx(A.SvgContainer,{svg:cv.VisibleOnSvg,size:A.SvgContainerSize.Large})}),A.jsxRuntimeExports.jsx(A.DivButton,{className:`${ic.overlay} ${ic.close} d-flex align-items-center justify-content-center`,onClick:s.closePopup,children:A.jsxRuntimeExports.jsx(A.SvgContainer,{svg:hv.CloseSvg,size:A.SvgContainerSize.Large})})]})}const vG="_copyrightDisclaimer_yyjul_1",yG="_overlayContainer_yyjul_4",$C={copyrightDisclaimer:vG,overlayContainer:yG},tg="shared.copyrightDisclaimer",_G=150;function TG(s){const[e,t]=dv.useHoverIntent({});function i(){var n;return document.documentElement.clientHeight-((n=e.current)==null?void 0:n.getBoundingClientRect().bottom)<_G}return A.jsxRuntimeExports.jsxs("div",{ref:e,className:s.className,children:[A.jsxRuntimeExports.jsx("p",{className:`${$C.copyrightDisclaimer} ${s.phraseClassName??"mb-1"}`,children:A.jsxRuntimeExports.jsx(A.Text,{namespace:tg,phrase:"copyrightDisclaimer"})}),A.jsxRuntimeExports.jsx(A.Overlay,{target:e.current,show:t,placement:s.overflowPlacement&&i()?s.overflowPlacement:s.placement,children:A.jsxRuntimeExports.jsxs("div",{className:`${$C.overlayContainer} mw-100 bg-white border rounded-3 p-2`,children:[A.jsxRuntimeExports.jsx("p",{children:A.jsxRuntimeExports.jsx(A.Text,{namespace:tg,phrase:"warning"})}),A.jsxRuntimeExports.jsx("p",{className:"fw-semibold mb-0",children:A.jsxRuntimeExports.jsx(A.Text,{namespace:tg,phrase:"sharing"})})]})})]})}function bG(s){const{page:e,totalPages:t}=s,i=fy.TypeHelper.isNumber(e)&&e>0&&e<t&&e+1,r=fy.TypeHelper.isNumber(e)&&e>1&&e-1,n={};if(i&&i<=t&&(n.next=i.toString()),r&&(n.previous=r.toString()),!A.ObjectHelper.isEmpty(n))return n}const gI={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:bG(s.pagination),limit:s.pagination.pageSize}}},hasData(s){return!gI.isEmpty(s)}};function qC(s){var e;switch((e=s.tagType)==null?void 0:e.toLowerCase()){case _c.TagType.Pedagogy:return 0;case _c.TagType.Skill:return 1;default:return 2}}function SG(s){if(!s.tags)return A.jsxRuntimeExports.jsx(A.jsxRuntimeExports.Fragment,{});const e=[...s.tags].sort((t,i)=>qC(t)-qC(i));return A.jsxRuntimeExports.jsx("div",{className:`${_c.styles.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 A.jsxRuntimeExports.jsx(_c.TagItem,{tag:t,appLink:i,themeColours:s.themeColours,onRemove:r,onClick:n},t.id||t.name)})})}function rc(s){const{label:e,items:t}=s;if(!(t&&t.data&&t.data.length))return A.jsxRuntimeExports.jsx(A.jsxRuntimeExports.Fragment,{});const r=t.data.map(n=>n.name).join(", ");return A.jsxRuntimeExports.jsxs("div",{className:"mb-2",children:[e,": ",r]})}const vI="exchange.detailsSection",nc=A.LanguageService.encloseNamespace(vI);function xG(s){var r,n,a,o,l,u,c,h,d,g;const{video:e,hasPPDD:t,description:i}=s;return A.jsxRuntimeExports.jsxs("div",{className:i?"col-md-5 ps-md-3 pt-3 pt-md-0":"col-12",children:[A.jsxRuntimeExports.jsx("h2",{className:"h6 mb-2",children:A.jsxRuntimeExports.jsx(A.Text,{namespace:vI,phrase:"details"})}),t&&A.jsxRuntimeExports.jsxs("div",{children:[A.jsxRuntimeExports.jsx(rc,{label:nc("productionCompanies",{smartCount:(n=(r=e.productionCompanies)==null?void 0:r.data)==null?void 0:n.length}),items:e.productionCompanies}),A.jsxRuntimeExports.jsx(rc,{label:nc("distributors",{smartCount:(o=(a=e.distributors)==null?void 0:a.data)==null?void 0:o.length}),items:e.distributors}),A.jsxRuntimeExports.jsx(rc,{label:nc("producers",{smartCount:(u=(l=e.producers)==null?void 0:l.data)==null?void 0:u.length}),items:e.producers}),A.jsxRuntimeExports.jsx(rc,{label:nc("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)&&A.jsxRuntimeExports.jsx(SG,{tags:e.tags.data})]})}const CG="_previewBadge_1mq7j_1",HC={previewBadge:CG},EG="exchange.previewVideoDetails",wG=200;function kG(s){var h,d,g,y,p;const{title:e,description:t,video:i,videoActions:r}=s,n=_=>_?!gI.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 A.jsxRuntimeExports.jsxs("div",{className:"p-3",children:[A.jsxRuntimeExports.jsxs("div",{className:`${!a&&!o?"mb-2":"mb-3"} position-relative`,children:[A.jsxRuntimeExports.jsxs("div",{className:"w-100",children:[A.jsxRuntimeExports.jsx("div",{className:"ms-2 float-end",children:A.jsxRuntimeExports.jsx(JI.Actions,{actions:r,actionsDropdownClassName:"btn btn-outline-dark px-1"})}),!!i&&A.jsxRuntimeExports.jsx(yc.VideoSubText,{type:"series",video:i,appLink:eP.getSeriesAppLink(i.series),className:"text-wrap",analyticsOptions:{location:A.LocationContext.PlayPage}}),A.jsxRuntimeExports.jsx("h1",{className:`h4 mb-1 ${!a&&!o?"mb-0 pt-2":""}`,children:A.jsxRuntimeExports.jsx("span",{className:"align-self-center",children:e})})]}),o&&A.jsxRuntimeExports.jsxs(ZI.BadgeListContainer,{children:[A.jsxRuntimeExports.jsx(xr.Badge,{type:xr.BadgeType.Rating,data:i==null?void 0:i.rating,className:`${HC.previewBadge} fw-semibold py-0 font-size-normal align-items-center px-2`}),A.jsxRuntimeExports.jsx(xr.Badge,{type:xr.BadgeType.ProductionYear,data:i==null?void 0:i.productionYear,className:`${HC.previewBadge} fw-semibold font-size-sm align-items-center px-1`}),((y=s.program)==null?void 0:y.channelLogoUrl)&&A.jsxRuntimeExports.jsx(iP.TvChannelBadge,{logoUrl:s.program.channelLogoUrl,className:"me-1"}),((p=s.program)==null?void 0:p.hasAdsFree)&&A.jsxRuntimeExports.jsx(tP.TvAdFreeBadge,{className:"me-1"}),s.program&&A.jsxRuntimeExports.jsx(rP.TvProgramTimeBadge,{program:s.program,showDate:!0,showEndTime:!0})]})]}),A.jsxRuntimeExports.jsxs("div",{children:[A.jsxRuntimeExports.jsx(VC.libExports.Scrollbars,{autoHeight:!0,autoHeightMax:wG,children:A.jsxRuntimeExports.jsxs("div",{className:"row g-0",children:[u&&A.jsxRuntimeExports.jsxs("div",{className:c?"border-end pe-3 col-md-7":"col-12",children:[A.jsxRuntimeExports.jsx("div",{className:"d-flex align-items-center",children:A.jsxRuntimeExports.jsx("h2",{className:"h6 mb-2",children:A.jsxRuntimeExports.jsx(A.Text,{namespace:EG,phrase:"description"})})}),A.jsxRuntimeExports.jsx("p",{className:"mb-2",dangerouslySetInnerHTML:{__html:yc.LinkifyHelper.linkifyText(t,{nl2br:!0})}})]}),c&&A.jsxRuntimeExports.jsx(xG,{video:i,hasPPDD:l,description:t})]})}),s.video&&A.jsxRuntimeExports.jsxs("div",{className:"row",children:[A.jsxRuntimeExports.jsx("div",{className:`${l?"d-md-block col-7":""} d-none`}),A.jsxRuntimeExports.jsx("div",{className:`${l?"col-md-5 ps-md-3":"ps-2 "} `,children:A.jsxRuntimeExports.jsx(TG,{placement:l?"bottom-end":"bottom-start",overflowPlacement:l?"top-end":"top-start"})})]})]})]})}exports.ClickViewPlayer=dG;exports.PlayerOverlayButtons=gG;exports.PreviewVideoDetails=kG;
|