@content-blocks/js 0.7.6 → 0.8.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/LICENSE +1 -1
- package/README.md +111 -3
- package/THIRD-PARTY-NOTICES.md +21 -0
- package/dist/cjs/{app-globals-3a1e7e63.js → app-globals-V2Kpy_OQ.js} +0 -2
- package/dist/cjs/content-accordion.cjs.entry.js +87 -0
- package/dist/cjs/content-blocks.cjs.js +35 -11
- package/dist/cjs/content-button.cjs.entry.js +113 -0
- package/dist/cjs/content-carousel.cjs.entry.js +153 -47
- package/dist/cjs/content-grid-formatter.cjs.entry.js +102 -0
- package/dist/cjs/content-hero-block.cjs.entry.js +45 -0
- package/dist/cjs/content-image.cjs.entry.js +153 -0
- package/dist/cjs/content-line.cjs.entry.js +61 -0
- package/dist/cjs/content-navigation-block.cjs.entry.js +51 -34
- package/dist/cjs/content-overlay.cjs.entry.js +641 -0
- package/dist/cjs/content-spacer.cjs.entry.js +75 -0
- package/dist/cjs/content-split-block.cjs.entry.js +22 -19
- package/dist/cjs/content-tabs.cjs.entry.js +38 -21
- package/dist/cjs/content-text-block.cjs.entry.js +63 -0
- package/dist/cjs/content-tout-block.cjs.entry.js +34 -0
- package/dist/cjs/{content-accordion_11.cjs.entry.js → content-video.cjs.entry.js} +14560 -12927
- package/dist/cjs/{focus-trap.esm-7bc384a0.js → focus-trap.esm-ZwN-anf1.js} +484 -190
- package/dist/cjs/{index-2e0ce692.js → index-B1U6Gweq.js} +348 -246
- package/dist/cjs/index-ClnpH9XB.js +2170 -0
- package/dist/cjs/index-CyalvZJn.js +1719 -0
- package/dist/cjs/index-DUvWvBDN.js +290 -0
- package/dist/cjs/index-voGY4Tkl.js +4705 -0
- package/dist/cjs/index.cjs.js +2 -5
- package/dist/cjs/loader.cjs.js +3 -8
- package/dist/cjs/responsive-component-C5eJS82z.js +171 -0
- package/dist/cjs/responsive-component-DMdnQIPV.js +171 -0
- package/dist/cjs/swiper-KLYbvU1K.js +3931 -0
- package/dist/cjs/{swiper-8221f4e8.js → swiper-_Z8Y4IJI.js} +269 -236
- package/dist/cjs/utils-BCHaRGm_.js +462 -0
- package/dist/cjs/{utils-df044337.js → utils-C3gXIS2t.js} +51 -49
- package/dist/cjs/utils-DUvWvBDN.js +290 -0
- package/dist/collection/blocks/content-hero-block/content-hero-block.css +1 -1
- package/dist/collection/blocks/content-hero-block/content-hero-block.js +33 -48
- package/dist/collection/blocks/content-split-block/content-split-block.css +16 -5
- package/dist/collection/blocks/content-split-block/content-split-block.js +29 -48
- package/dist/collection/blocks/content-text-block/content-text-block.js +65 -59
- package/dist/collection/blocks/content-tout-block/content-tout-block.css +3 -0
- package/dist/collection/blocks/content-tout-block/content-tout-block.js +22 -47
- package/dist/collection/collection-manifest.json +8 -5
- package/dist/collection/components/content-accordion/content-accordion.css +20 -1
- package/dist/collection/components/content-accordion/content-accordion.js +67 -33
- package/dist/collection/components/content-accordion/libraries/w3_disclosure_button.js +0 -1
- package/dist/collection/components/content-carousel/content-carousel.css +60 -4
- package/dist/collection/components/content-carousel/content-carousel.js +294 -44
- package/dist/collection/components/content-navigation-block/content-navigation-block.css +15 -1
- package/dist/collection/components/content-navigation-block/content-navigation-block.js +86 -42
- package/dist/collection/components/content-overlay/content-overlay.css +36 -5
- package/dist/collection/components/content-overlay/content-overlay.js +181 -120
- package/dist/collection/components/content-overlay/libraries/aria-dialog.js +0 -1
- package/dist/collection/components/content-overlay/libraries/aria-utilities.js +0 -1
- package/dist/collection/components/content-tabs/content-tabs.js +7 -49
- package/dist/collection/components/content-tabs/libraries/w3_tabs.js +0 -1
- package/dist/collection/elements/content-button/content-button.css +8 -7
- package/dist/collection/elements/content-button/content-button.js +103 -84
- package/dist/collection/elements/content-image/content-image.css +3 -1
- package/dist/collection/elements/content-image/content-image.js +176 -95
- package/dist/collection/elements/content-line/content-line.js +63 -54
- package/dist/collection/elements/content-video/content-video.css +1 -1
- package/dist/collection/elements/content-video/content-video.js +165 -92
- package/dist/collection/formatters/content-grid-formatter/content-grid-formatter.css +8 -2
- package/dist/collection/formatters/content-grid-formatter/content-grid-formatter.js +167 -89
- package/dist/collection/formatters/content-spacer/content-spacer.js +86 -209
- package/dist/collection/global/content-blocks-reset.css +77 -0
- package/dist/collection/index.js +1 -1
- package/dist/collection/sass/_mixins.scss +21 -5
- package/dist/collection/sass/_variables.scss +15 -15
- package/dist/collection/setupFiles.js +0 -1
- package/dist/collection/site/site.js +67 -0
- package/dist/collection/utils/breakpoints.js +162 -0
- package/dist/collection/utils/responsive-component.js +249 -0
- package/dist/collection/utils/utils.js +32 -42
- package/dist/components/content-accordion.js +65 -44
- package/dist/components/content-button.js +89 -43
- package/dist/components/content-carousel.js +172 -55
- package/dist/components/content-grid-formatter.js +127 -3
- package/dist/components/content-hero-block.js +33 -26
- package/dist/components/content-image.js +127 -71
- package/dist/components/content-line.js +56 -35
- package/dist/components/content-navigation-block.js +62 -39
- package/dist/components/content-overlay.js +128 -67
- package/dist/components/content-spacer.js +70 -54
- package/dist/components/content-split-block.js +33 -32
- package/dist/components/content-tabs.js +46 -25
- package/dist/components/content-text-block.js +55 -35
- package/dist/components/content-tout-block.js +29 -27
- package/dist/components/content-video.js +14624 -11972
- package/dist/{esm/focus-trap.esm-8fb54175.js → components/focus-trap.esm.js} +484 -190
- package/dist/components/index.d.ts +2 -0
- package/dist/components/index.js +3 -3
- package/dist/components/{p-5a91aa1b.js → index2.js} +348 -246
- package/dist/components/p-BWRCeMvO.js +1 -0
- package/dist/components/p-CYF5GU_q.js +1 -0
- package/dist/components/p-DXUoPIwl.js +10 -0
- package/dist/components/p-D_Ll4QNj.js +1 -0
- package/dist/components/p-DhIoW7H3.js +1 -0
- package/dist/components/responsive-component.js +168 -0
- package/dist/components/{p-e5dc4ea4.js → swiper.js} +268 -235
- package/dist/components/utils.js +4969 -0
- package/dist/{esm/utils-1c9f0ec1.js → components/utils2.js} +51 -50
- package/dist/content-blocks/content-accordion.entry.js +85 -0
- package/dist/content-blocks/content-blocks.esm.js +47 -2
- package/dist/content-blocks/content-button.entry.js +111 -0
- package/dist/content-blocks/content-carousel.entry.js +188 -0
- package/dist/content-blocks/content-grid-formatter.entry.js +100 -0
- package/dist/content-blocks/content-hero-block.entry.js +43 -0
- package/dist/content-blocks/content-image.entry.js +151 -0
- package/dist/content-blocks/content-line.entry.js +59 -0
- package/dist/content-blocks/content-navigation-block.entry.js +105 -0
- package/dist/content-blocks/content-overlay.entry.js +639 -0
- package/dist/content-blocks/content-spacer.entry.js +73 -0
- package/dist/content-blocks/content-split-block.entry.js +34 -0
- package/dist/content-blocks/content-tabs.entry.js +245 -0
- package/dist/content-blocks/content-text-block.entry.js +61 -0
- package/dist/content-blocks/content-tout-block.entry.js +32 -0
- package/dist/{esm/content-accordion_11.entry.js → content-blocks/content-video.entry.js} +14535 -12890
- package/dist/{components/p-a2fedf8a.js → content-blocks/focus-trap.esm-DXUoPIwl.js} +484 -190
- package/dist/content-blocks/global/content-blocks-reset.css +77 -0
- package/dist/content-blocks/index-BFDJMblF.js +4690 -0
- package/dist/{esm/index-f45a9c45.js → content-blocks/index-P1YnSd-O.js} +348 -246
- package/dist/content-blocks/index.esm.js +1 -2
- package/dist/content-blocks/p-008457f0.entry.js +1 -0
- package/dist/content-blocks/p-052692f1.entry.js +1 -0
- package/dist/content-blocks/p-0f71bd32.entry.js +1 -0
- package/dist/content-blocks/p-1f154617.entry.js +1 -0
- package/dist/content-blocks/p-2554ebd8.entry.js +1 -0
- package/dist/content-blocks/p-4afd6511.entry.js +1 -0
- package/dist/content-blocks/p-78d5de9f.entry.js +1 -0
- package/dist/content-blocks/p-7bcf7e7e.entry.js +1 -0
- package/dist/content-blocks/p-9058031c.entry.js +1 -0
- package/dist/content-blocks/p-9c41ac23.entry.js +17 -0
- package/dist/content-blocks/p-CLwOzPEO.js +3 -0
- package/dist/content-blocks/p-CYF5GU_q.js +1 -0
- package/dist/content-blocks/p-CjR_4mPu.js +1 -0
- package/dist/content-blocks/p-DQuL1Twl.js +1 -0
- package/dist/content-blocks/p-DXUoPIwl.js +10 -0
- package/dist/content-blocks/p-D_Ll4QNj.js +1 -0
- package/dist/content-blocks/p-DhIoW7H3.js +1 -0
- package/dist/content-blocks/p-DzYwy_62.js +1 -0
- package/dist/content-blocks/p-b2e6358a.entry.js +1 -0
- package/dist/content-blocks/p-c783bc68.entry.js +1 -0
- package/dist/content-blocks/p-e3d81e15.entry.js +1 -0
- package/dist/content-blocks/p-f23b4aae.entry.js +1 -0
- package/dist/content-blocks/p-f75c9094.entry.js +1 -0
- package/dist/content-blocks/responsive-component-BsLrcKbS.js +169 -0
- package/dist/content-blocks/sass/_mixins.scss +21 -5
- package/dist/content-blocks/sass/_variables.scss +15 -15
- package/dist/{esm/swiper-e9621adb.js → content-blocks/swiper-nBv069TB.js} +268 -235
- package/dist/{components/p-b85cfa86.js → content-blocks/utils--SDsQnWS.js} +51 -50
- package/dist/content-blocks/utils-Bak__24s.js +280 -0
- package/dist/docs.d.ts +480 -0
- package/dist/docs.json +5312 -0
- package/dist/esm/{app-globals-0f993ce5.js → app-globals-DQuL1Twl.js} +0 -2
- package/dist/esm/content-accordion.entry.js +85 -0
- package/dist/esm/content-blocks.js +33 -8
- package/dist/esm/content-button.entry.js +111 -0
- package/dist/esm/content-carousel.entry.js +153 -45
- package/dist/esm/content-grid-formatter.entry.js +100 -0
- package/dist/esm/content-hero-block.entry.js +43 -0
- package/dist/esm/content-image.entry.js +151 -0
- package/dist/esm/content-line.entry.js +59 -0
- package/dist/esm/content-navigation-block.entry.js +51 -32
- package/dist/esm/content-overlay.entry.js +639 -0
- package/dist/esm/content-spacer.entry.js +73 -0
- package/dist/esm/content-split-block.entry.js +22 -17
- package/dist/esm/content-tabs.entry.js +38 -19
- package/dist/esm/content-text-block.entry.js +61 -0
- package/dist/esm/content-tout-block.entry.js +32 -0
- package/dist/esm/content-video.entry.js +72033 -0
- package/dist/esm/focus-trap.esm-DXUoPIwl.js +1801 -0
- package/dist/esm/index-BASCLGuP.js +1713 -0
- package/dist/esm/index-BFDJMblF.js +4690 -0
- package/dist/esm/index-CLwOzPEO.js +2161 -0
- package/dist/esm/index-CjR_4mPu.js +280 -0
- package/dist/esm/index-P1YnSd-O.js +5397 -0
- package/dist/esm/index.js +1 -3
- package/dist/esm/loader.js +3 -6
- package/dist/esm/responsive-component-BsLrcKbS.js +169 -0
- package/dist/esm/responsive-component-D7dJHMp0.js +169 -0
- package/dist/esm/swiper-CtypHPwF.js +3928 -0
- package/dist/esm/swiper-nBv069TB.js +3941 -0
- package/dist/esm/utils--SDsQnWS.js +460 -0
- package/dist/esm/utils-Bak__24s.js +280 -0
- package/dist/esm/utils-CYF5GU_q.js +438 -0
- package/dist/node_modules/video.js/dist/video-js.min.css +1 -0
- package/dist/test/axe.js +60 -0
- package/dist/types/Users/shahrukceo/Developer/content-blocks/packages/js/.stencil/test/axe.d.ts +16 -0
- package/dist/types/blocks/content-hero-block/content-hero-block.d.ts +7 -11
- package/dist/types/blocks/content-split-block/content-split-block.d.ts +5 -9
- package/dist/types/blocks/content-text-block/content-text-block.d.ts +4 -9
- package/dist/types/blocks/content-tout-block/content-tout-block.d.ts +5 -10
- package/dist/types/components/content-accordion/content-accordion.d.ts +4 -3
- package/dist/types/components/content-accordion/libraries/w3_disclosure_button.d.ts +0 -1
- package/dist/types/components/content-carousel/content-carousel.d.ts +44 -7
- package/dist/types/components/content-navigation-block/content-navigation-block.d.ts +14 -8
- package/dist/types/components/content-overlay/content-overlay.d.ts +15 -16
- package/dist/types/components/content-overlay/libraries/aria-dialog.d.ts +0 -1
- package/dist/types/components/content-overlay/libraries/aria-utilities.d.ts +0 -1
- package/dist/types/components/content-tabs/content-tabs.d.ts +4 -10
- package/dist/types/components/content-tabs/libraries/w3_tabs.d.ts +0 -1
- package/dist/types/components.d.ts +900 -196
- package/dist/types/elements/content-button/content-button.d.ts +8 -13
- package/dist/types/elements/content-image/content-image.d.ts +15 -9
- package/dist/types/elements/content-line/content-line.d.ts +5 -12
- package/dist/types/elements/content-video/content-video.d.ts +12 -11
- package/dist/types/formatters/content-grid-formatter/content-grid-formatter.d.ts +14 -9
- package/dist/types/formatters/content-spacer/content-spacer.d.ts +4 -36
- package/dist/types/index.d.ts +3 -1
- package/dist/types/setupFiles.d.ts +0 -1
- package/dist/types/stencil-public-runtime.d.ts +265 -60
- package/dist/types/typings.d.ts +10 -0
- package/dist/types/utils/breakpoints.d.ts +57 -0
- package/dist/types/utils/responsive-component.d.ts +49 -0
- package/dist/types/utils/utils.d.ts +11 -8
- package/loader/cdn.js +1 -0
- package/loader/index.cjs.js +1 -0
- package/loader/index.d.ts +24 -0
- package/loader/index.es2017.js +1 -0
- package/loader/index.js +2 -0
- package/package.json +75 -65
- package/dist/cjs/BehaviorSubject-12116537.js +0 -655
- package/dist/cjs/BehaviorSubject-12116537.js.map +0 -1
- package/dist/cjs/app-globals-3a1e7e63.js.map +0 -1
- package/dist/cjs/content-accordion_11.cjs.entry.js.map +0 -1
- package/dist/cjs/content-blocks.cjs.js.map +0 -1
- package/dist/cjs/content-carousel.cjs.entry.js.map +0 -1
- package/dist/cjs/content-navigation-block.cjs.entry.js.map +0 -1
- package/dist/cjs/content-split-block.cjs.entry.js.map +0 -1
- package/dist/cjs/content-tabs.cjs.entry.js.map +0 -1
- package/dist/cjs/focus-trap.esm-7bc384a0.js.map +0 -1
- package/dist/cjs/index-2e0ce692.js.map +0 -1
- package/dist/cjs/index-8af2820a.js +0 -1650
- package/dist/cjs/index-8af2820a.js.map +0 -1
- package/dist/cjs/index.cjs.js.map +0 -1
- package/dist/cjs/loader.cjs.js.map +0 -1
- package/dist/cjs/swiper-8221f4e8.js.map +0 -1
- package/dist/cjs/utils-df044337.js.map +0 -1
- package/dist/cjs/utils-f8ccab0a.js +0 -126
- package/dist/cjs/utils-f8ccab0a.js.map +0 -1
- package/dist/cjs/window-resize-service-65a5a370.js +0 -37
- package/dist/cjs/window-resize-service-65a5a370.js.map +0 -1
- package/dist/collection/blocks/content-hero-block/content-hero-block.js.map +0 -1
- package/dist/collection/blocks/content-split-block/content-split-block.js.map +0 -1
- package/dist/collection/blocks/content-text-block/content-text-block.js.map +0 -1
- package/dist/collection/blocks/content-tout-block/content-tout-block.js.map +0 -1
- package/dist/collection/components/content-accordion/content-accordion.js.map +0 -1
- package/dist/collection/components/content-accordion/libraries/w3_disclosure_button.js.map +0 -1
- package/dist/collection/components/content-carousel/content-carousel.js.map +0 -1
- package/dist/collection/components/content-navigation-block/content-navigation-block.js.map +0 -1
- package/dist/collection/components/content-overlay/content-overlay.js.map +0 -1
- package/dist/collection/components/content-overlay/libraries/aria-dialog.js.map +0 -1
- package/dist/collection/components/content-overlay/libraries/aria-utilities.js.map +0 -1
- package/dist/collection/components/content-tabs/content-tabs.js.map +0 -1
- package/dist/collection/components/content-tabs/libraries/w3_tabs.js.map +0 -1
- package/dist/collection/elements/content-button/content-button.js.map +0 -1
- package/dist/collection/elements/content-image/content-image.js.map +0 -1
- package/dist/collection/elements/content-line/content-line.js.map +0 -1
- package/dist/collection/elements/content-video/content-video.js.map +0 -1
- package/dist/collection/formatters/content-grid-formatter/content-grid-formatter.js.map +0 -1
- package/dist/collection/formatters/content-spacer/content-spacer.js.map +0 -1
- package/dist/collection/globalScript.js +0 -15
- package/dist/collection/globalScript.js.map +0 -1
- package/dist/collection/index.js.map +0 -1
- package/dist/collection/services/content-events-service.js +0 -23
- package/dist/collection/services/content-events-service.js.map +0 -1
- package/dist/collection/services/window-resize-service.js +0 -31
- package/dist/collection/services/window-resize-service.js.map +0 -1
- package/dist/collection/setupFiles.js.map +0 -1
- package/dist/collection/stories/ContentHeroBlock.stories.js +0 -51
- package/dist/collection/stories/ContentHeroBlock.stories.js.map +0 -1
- package/dist/collection/stories/ContentNavigationBlock.stories.js +0 -33
- package/dist/collection/stories/ContentNavigationBlock.stories.js.map +0 -1
- package/dist/collection/stories/ContentSpacer.stories.js +0 -20
- package/dist/collection/stories/ContentSpacer.stories.js.map +0 -1
- package/dist/collection/stories/ContentTextBlock.stories.js +0 -17
- package/dist/collection/stories/ContentTextBlock.stories.js.map +0 -1
- package/dist/collection/stories/ContentToutBlock.stories.js +0 -17
- package/dist/collection/stories/ContentToutBlock.stories.js.map +0 -1
- package/dist/collection/stories/FullPageExample.stories.js +0 -432
- package/dist/collection/stories/FullPageExample.stories.js.map +0 -1
- package/dist/collection/stories/assets/accessibility.svg +0 -5
- package/dist/collection/stories/assets/discord.svg +0 -15
- package/dist/collection/stories/assets/github.svg +0 -3
- package/dist/collection/stories/assets/tutorials.svg +0 -12
- package/dist/collection/stories/assets/youtube.svg +0 -4
- package/dist/collection/utils/utils.js.map +0 -1
- package/dist/components/content-accordion.js.map +0 -1
- package/dist/components/content-button.js.map +0 -1
- package/dist/components/content-carousel.js.map +0 -1
- package/dist/components/content-grid-formatter.js.map +0 -1
- package/dist/components/content-hero-block.js.map +0 -1
- package/dist/components/content-image.js.map +0 -1
- package/dist/components/content-line.js.map +0 -1
- package/dist/components/content-navigation-block.js.map +0 -1
- package/dist/components/content-overlay.js.map +0 -1
- package/dist/components/content-spacer.js.map +0 -1
- package/dist/components/content-split-block.js.map +0 -1
- package/dist/components/content-tabs.js.map +0 -1
- package/dist/components/content-text-block.js.map +0 -1
- package/dist/components/content-tout-block.js.map +0 -1
- package/dist/components/content-video.js.map +0 -1
- package/dist/components/index.js.map +0 -1
- package/dist/components/p-26483b46.js +0 -35
- package/dist/components/p-26483b46.js.map +0 -1
- package/dist/components/p-5a91aa1b.js.map +0 -1
- package/dist/components/p-74be971f.js +0 -652
- package/dist/components/p-74be971f.js.map +0 -1
- package/dist/components/p-7a436263.js +0 -122
- package/dist/components/p-7a436263.js.map +0 -1
- package/dist/components/p-a2fedf8a.js.map +0 -1
- package/dist/components/p-b85cfa86.js.map +0 -1
- package/dist/components/p-e28db040.js +0 -1452
- package/dist/components/p-e28db040.js.map +0 -1
- package/dist/components/p-e5dc4ea4.js.map +0 -1
- package/dist/components/p-e9bce2ab.js +0 -88
- package/dist/components/p-e9bce2ab.js.map +0 -1
- package/dist/content-blocks/content-blocks.esm.js.map +0 -1
- package/dist/content-blocks/index.esm.js.map +0 -1
- package/dist/content-blocks/p-13c3cc4f.js +0 -3
- package/dist/content-blocks/p-13c3cc4f.js.map +0 -1
- package/dist/content-blocks/p-5422c25b.entry.js +0 -2
- package/dist/content-blocks/p-5422c25b.entry.js.map +0 -1
- package/dist/content-blocks/p-5a91aa1b.js +0 -2
- package/dist/content-blocks/p-5a91aa1b.js.map +0 -1
- package/dist/content-blocks/p-650d1757.js +0 -2
- package/dist/content-blocks/p-650d1757.js.map +0 -1
- package/dist/content-blocks/p-74be971f.js +0 -2
- package/dist/content-blocks/p-74be971f.js.map +0 -1
- package/dist/content-blocks/p-8deb755c.entry.js +0 -26
- package/dist/content-blocks/p-8deb755c.entry.js.map +0 -1
- package/dist/content-blocks/p-a2fedf8a.js +0 -10
- package/dist/content-blocks/p-a2fedf8a.js.map +0 -1
- package/dist/content-blocks/p-b305392e.entry.js +0 -2
- package/dist/content-blocks/p-b305392e.entry.js.map +0 -1
- package/dist/content-blocks/p-b85cfa86.js +0 -2
- package/dist/content-blocks/p-b85cfa86.js.map +0 -1
- package/dist/content-blocks/p-cc7397cf.js +0 -2
- package/dist/content-blocks/p-cc7397cf.js.map +0 -1
- package/dist/content-blocks/p-d62775d7.entry.js +0 -2
- package/dist/content-blocks/p-d62775d7.entry.js.map +0 -1
- package/dist/content-blocks/p-e1255160.js +0 -2
- package/dist/content-blocks/p-e1255160.js.map +0 -1
- package/dist/content-blocks/p-e5dc4ea4.js +0 -2
- package/dist/content-blocks/p-e5dc4ea4.js.map +0 -1
- package/dist/content-blocks/p-f73f934a.entry.js +0 -2
- package/dist/content-blocks/p-f73f934a.entry.js.map +0 -1
- package/dist/esm/BehaviorSubject-f7a12fd8.js +0 -652
- package/dist/esm/BehaviorSubject-f7a12fd8.js.map +0 -1
- package/dist/esm/app-globals-0f993ce5.js.map +0 -1
- package/dist/esm/content-accordion_11.entry.js.map +0 -1
- package/dist/esm/content-blocks.js.map +0 -1
- package/dist/esm/content-carousel.entry.js.map +0 -1
- package/dist/esm/content-navigation-block.entry.js.map +0 -1
- package/dist/esm/content-split-block.entry.js.map +0 -1
- package/dist/esm/content-tabs.entry.js.map +0 -1
- package/dist/esm/focus-trap.esm-8fb54175.js.map +0 -1
- package/dist/esm/index-ec24af7a.js +0 -1621
- package/dist/esm/index-ec24af7a.js.map +0 -1
- package/dist/esm/index-f45a9c45.js.map +0 -1
- package/dist/esm/index.js.map +0 -1
- package/dist/esm/loader.js.map +0 -1
- package/dist/esm/swiper-e9621adb.js.map +0 -1
- package/dist/esm/utils-1c9f0ec1.js.map +0 -1
- package/dist/esm/utils-9a901aa9.js +0 -122
- package/dist/esm/utils-9a901aa9.js.map +0 -1
- package/dist/esm/window-resize-service-354f2ac5.js +0 -35
- package/dist/esm/window-resize-service-354f2ac5.js.map +0 -1
- package/dist/types/globalScript.d.ts +0 -1
- package/dist/types/old-components.d.ts +0 -1239
- package/dist/types/services/content-events-service.d.ts +0 -11
- package/dist/types/services/window-resize-service.d.ts +0 -11
- package/dist/types/stories/ContentHeroBlock.stories.d.ts +0 -11
- package/dist/types/stories/ContentNavigationBlock.stories.d.ts +0 -9
- package/dist/types/stories/ContentSpacer.stories.d.ts +0 -15
- package/dist/types/stories/ContentTextBlock.stories.d.ts +0 -9
- package/dist/types/stories/ContentToutBlock.stories.d.ts +0 -9
- package/dist/types/stories/FullPageExample.stories.d.ts +0 -10
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import{r as t,h as e,H as i,g as s,c as n}from"./p-13c3cc4f.js";import{W as r}from"./p-650d1757.js";import{g as o}from"./p-cc7397cf.js";import{c as a}from"./p-a2fedf8a.js";import"./p-74be971f.js";const h="*{box-sizing:border-box}content-accordion{display:block}content-accordion>button{display:block;width:100%;padding:0;border:none;font:inherit;color:inherit;background-color:transparent;cursor:pointer}content-accordion[expanded]>.content-accordion__reveal{display:block}content-accordion>.content-accordion__reveal{display:none}";const c=h;const l=class{constructor(e){t(this,e);this.revealElement=undefined;this.open="false";this.animationStart="animation-start";this.animationEnd="animation-end";this.triggerClass="";this.animationTime=0;this.isOpen=false;this.randomID="";this.classString=""}handleClickEvent(t){this.animateAccordion(!this.isOpen)}animateAccordion(t,e=this.animationTime){if(this.timeoutHolder){clearTimeout(this.timeoutHolder)}if(t){this.isOpen=true;this.timeoutHolder=setTimeout((()=>{this.hostElement.classList.add(this.animationStart)}),0)}else{this.hostElement.classList.add(this.animationEnd);this.timeoutHolder=setTimeout((()=>{this.hostElement.classList.remove(this.animationStart,this.animationEnd);this.isOpen=false}),e)}}componentWillLoad(){this.revealElement=this.hostElement.querySelector(".js-content-accordion-reveal");if(this.hostElement.id){this.randomID=`${this.hostElement.tagName}_${this.hostElement.id}`}else{this.randomID=`${this.hostElement.tagName}_${Math.floor(Math.random()*document.querySelectorAll(this.hostElement.tagName).length)}`}r.registerProp(this.open).subscribe((t=>{this.isOpen=t==="true";if(this.isOpen){this.animateAccordion(true)}}))}render(){return e(i,{key:"e2c74da4422159599813e36f564a13e2632e1fd4",class:this.classString,expanded:this.isOpen},e("button",{key:"9096a0b08f0d1dddb0e7993d2156ea434dcff50f",class:this.triggerClass,onClick:t=>this.handleClickEvent(t),"aria-expanded":this.isOpen,"aria-controls":this.randomID},e("slot",{key:"70246b4f77596110f4acdff1efaaae9e55011023",name:"trigger"})),e("div",{key:"3bfc780073eb30a1d90b6d48ced09e0f178f6e02",id:this.randomID,class:"js-content-accordion-reveal content-accordion__reveal"},e("slot",{key:"0a16c47e42329443d8228483a0e23d26563aeb3c",name:"content"}),e("slot",{key:"0119746c82beb4872b597b2546d3a1ffebb51002"})))}get hostElement(){return s(this)}};l.style=c;const u="*{box-sizing:border-box}content-button{display:inline-block}content-button>a,content-button>button{display:flex;width:100%;align-items:center;justify-content:center}content-button>button{appearance:none;background:inherit;cursor:pointer}content-button[clickable-block=true]{display:block;width:100%;height:100%}content-button[clickable-block=true]>a,content-button[clickable-block=true]>button{height:100%;width:100%}content-button[clickable-block=true]>a>*,content-button[clickable-block=true]>button>*{display:block;width:100%}content-button[clickable-block=true] .content-button__clickable-content{width:100%;height:100%}";const f=u;const d=class{constructor(e){t(this,e);this.href=undefined;this.target=undefined;this.classes="";this.classString="";this.clickableBlock=false;this.expanded=undefined;this.controls=undefined;this.linkLabel=undefined;this.linkClass=undefined;this.hasContentToActivate=undefined}componentWillLoad(){this.activatedContent=this.hostElement.querySelector('[slot="activatedContent"]');this.hasContentToActivate=!!this.activatedContent;if(!this.href||this.href==="#"){this.href="javascript:void(0);"}r.registerProp(this.linkClass).subscribe((t=>{this.linkClass=t}));r.registerProp(this.classes).subscribe((t=>{this.classString=t}))}onHandleClickEvent(t){if(this.hasContentToActivate){t.preventDefault();this.activatedContent.dispatchEvent(new CustomEvent("open",{detail:this.activatedContent}));setTimeout((()=>{this.activatedContent.scrollIntoView({behavior:"smooth"})}),0)}else if(this.href&&this.href.length>1&&this.href.substring(0,1)==="#"){let e=document.getElementById(this.href.substring(1));t.preventDefault();if(e){t.preventDefault();e.dispatchEvent(new CustomEvent("open",{detail:e}));setTimeout((()=>{e.scrollIntoView({behavior:"smooth"})}),0)}}}render(){return e(i,{key:"32645cce0c5d64972be5614a9d8c08af7212dca8",class:this.classString},e("a",{key:"d199235db6ba6690db54e4021938ee8b3b57fe74","aria-label":this.linkLabel,class:this.linkClass,role:this.href==="javascript:void(0);"?"button":"",onClick:t=>this.onHandleClickEvent(t),"aria-expanded":this.expanded,"aria-controls":this.controls,href:this.href,target:this.target},!this.clickableBlock?e("span",null,e("slot",{name:"content"}),e("slot",null)):e("div",{class:"content-button__clickable-content"},e("slot",{name:"content"}),e("slot",null))),e("slot",{key:"424adf7f2642fd10291a2974a4a41e8148240654",name:"activatedContent"}))}get hostElement(){return s(this)}};d.style=f;const p="*{box-sizing:border-box}content-grid-formatter{width:100%;align-items:var(--align-items, flex-start);justify-content:var(--justify-content);grid-template-columns:repeat(var(--columns), 1fr);column-gap:var(--column-gap, 0);row-gap:var(--row-gap, 0)}content-grid-formatter *{box-sizing:border-box}content-grid-formatter[type=grid]{display:grid}content-grid-formatter[type=flex]{display:flex;flex-wrap:wrap}content-grid-formatter[type=flex]>*{overflow:auto;flex:0 0 auto;width:calc(100% / var(--columns))}content-grid-formatter>[flex-shrink=true]{width:auto;flex-shrink:1}content-grid-formatter[flex-shrink=true]>*{flex-shrink:1}content-grid-formatter[flex-grow=true]>*{flex-grow:1}content-grid-formatter>[flex-grow=true]{width:auto;flex-grow:1}";const v=p;const m=class{constructor(e){t(this,e);this.classes=undefined;this.classString=undefined;this.type="flex";this.flexGrow="false";this.flexShrink="false";this.vertical="space-between";this.horizontal="space-between";this.columns="1";this.columnGap="0";this.rowGap="0";this.activeClassString=undefined;this.inlineStyle={}}componentWillLoad(){return Promise.allSettled([r.registerProp(this.type).subscribe((t=>this.type=t)),r.registerProp(this.vertical).subscribe((t=>{this.vertical=t;this.inlineStyle=Object.assign(Object.assign({},this.inlineStyle),{"--align-items":this.vertical})})),r.registerProp(this.horizontal).subscribe((t=>{this.horizontal=t;this.inlineStyle=Object.assign(Object.assign({},this.inlineStyle),{"--justify-content":this.horizontal})})),r.registerProp(this.flexShrink).subscribe((t=>this.flexShrink=t)),r.registerProp(this.flexGrow).subscribe((t=>this.flexGrow=t)),r.registerProp(this.columns).subscribe((t=>{this.columns=t;this.inlineStyle=Object.assign(Object.assign({},this.inlineStyle),{"--columns":t})})),r.registerProp(this.columnGap).subscribe((t=>{this.columnGap=t;this.inlineStyle=Object.assign(Object.assign({},this.inlineStyle),{"--column-gap":t})})),r.registerProp(this.rowGap).subscribe((t=>{this.rowGap=t;this.inlineStyle=Object.assign(Object.assign({},this.inlineStyle),{"--row-gap":t})})),r.registerProp(this.classes).subscribe((t=>this.classString=t))])}render(){return e(i,{key:"0f4c01fb1b73a7b9fa3994a198d56e43fbadd7cc",class:this.classString,style:this.inlineStyle},e("slot",{key:"cf16d48ab340f5612a66e189d936dba2e69ccee7"}))}get hostElement(){return s(this)}};m.style=v;const g="*{box-sizing:border-box}content-hero-block{position:relative}content-hero-block[content-position=above]{display:grid;grid-template-columns:1fr}content-hero-block[content-position=above] .content-hero-block__background,content-hero-block[content-position=above] .content-hero-block__content{grid-row-start:1;grid-column-start:1}content-hero-block[content-position=above] .content-hero-block__background{height:100%;overflow:hidden}content-hero-block[content-position=above] .content-hero-block__background content-image,content-hero-block[content-position=above] .content-hero-block__background content-image picture,content-hero-block[content-position=above] .content-hero-block__background content-image img,content-hero-block[content-position=above] .content-hero-block__background content-image video{height:100%}content-hero-block[content-position=above] .content-hero-block__content{display:flex;top:0;left:0;width:100%;height:100%;grid-row-start:1;grid-column-start:1}content-hero-block[content-position=above] .content-hero-block__content>*{width:100%}content-hero-block[content-position=above] .content-hero-block__content{position:relative;z-index:1}content-hero-block[content-position=below]{display:block}";const b=g;const y=class{constructor(e){t(this,e);this.hasBackground=false;this.contentPosition="below|above";this.classes=undefined;this.classString=undefined;this.revealHiddenContent=false}componentWillLoad(){this.hasBackground=!!this.hostElement.querySelector('[slot="background"]');this.hasHiddenContent=!!this.hostElement.querySelector('[slot="activatedContent"]');r.registerProp(this.contentPosition).subscribe((t=>this.contentPosition=t));r.registerProp(this.classes).subscribe((t=>this.classString=t))}contentBlockActivationHandler(t){if(this.hostElement===t.detail){this.hostElement.setAttribute("activated","true")}}render(){return e(i,{key:"453139dde7f5f37fe4b246b65f85c5b4252eb25b",class:this.classString},this.hasBackground&&e("div",{key:"61af0bcd5932c1678424f8d8d39b9374c848eac5",class:"content-hero-block__background"},e("slot",{key:"5b565590f57803ab199f847aa37b221df4795b8b",name:"background"})),e("div",{key:"c25011a540f9d35d3635d47fca259aeefc1b6ca6",class:"content-hero-block__content"},e("slot",{key:"8c4e12fcb9a805445b879f8ac642e2894c1a2b31",name:"content"}),e("slot",{key:"75560112753c4b2ab546bf5caf2b32701917e6c6"})))}get hostElement(){return s(this)}};y.style=b;const j="*{box-sizing:border-box}content-image{display:block;height:auto;transition:opacity 0.3s;position:relative}content-image.content-image-loading{opacity:0}content-image.content-image-loaded{opacity:1}content-image[aspect-ratio] img,content-image[aspect-ratio] picture,content-image[aspect-ratio] video{aspect-ratio:var(--aspect-ratio);object-fit:cover}content-image img,content-image picture,content-image video{display:block;width:100%;height:100%}content-image .content-image__media-content{display:none;position:absolute;width:100%;height:100%;top:0;left:0;align-items:center;justify-content:center;overflow:hidden}content-image .content-image__media-content [slot=mediaContent]{height:100%;width:100%}content-image[content=true] .content-image__media-content{display:flex}";const w=j;const T=class{constructor(e){t(this,e);this.classes=undefined;this.lazyLoad=true;this.src=undefined;this.activeSrc=undefined;this.alt=undefined;this.width="16";this.height="9";this.aspectRatio=undefined;this.type="image";this.videoType="video/mp4";this.showContent="false|true";this.lazyLoadIsComplete=false;this.showVideoAsGif=false;this.activeLazyLoadClass="";this.classString="";this.inlineStyle={};this.hasMediaContent=false;this.pictureImageSrc=undefined}preloadImage(t){return new Promise((e=>{const i=new Image;i.onload=e;i.onerror=e;i.src=t}))}componentWillLoad(){this.hasMediaContent=!!this.hostElement.querySelector('[slot="mediaContent"]');r.registerProp(this.aspectRatio).subscribe((t=>{this.inlineStyle=Object.assign(Object.assign({},this.inlineStyle),{"--aspect-ratio":`${t}`})}));r.registerProp(this.alt).subscribe((t=>{this.alt=t}));r.registerProp(this.height).subscribe((t=>{this.height=t}));r.registerProp(this.showContent).subscribe((t=>{this.showContent=t}));r.registerProp(this.classes).subscribe((t=>{this.classString=`${t}`}))}componentDidLoad(){let t=new IntersectionObserver((t=>{t.forEach((async t=>{if(t.isIntersecting){this.lazyLoadIsComplete=true;this.pictureImageSrc=o(this.src);this.showVideoAsGif=this.pictureImageSrc.indexOf(".mp4")>=0||o(this.type)==="video"}}))}),{root:null,rootMargin:`${Math.max(100,window.innerHeight*1)}px`,threshold:0});t.observe(this.hostElement)}watchLazyLoadIsComplete(t){if(t===true){this.activeLazyLoadClass="content-image-loaded"}else{if(!this.lazyLoad){this.activeLazyLoadClass="content-image-no-lazyload"}else{this.activeLazyLoadClass="content-image-loading"}}}render(){return e(i,{key:"7a29a891d8d81398e91b2cbdd6c7e6fb7c2c6b3b",class:`${this.activeLazyLoadClass} ${this.classString}`,style:this.inlineStyle,content:this.showContent},this.hasMediaContent&&e("div",{key:"44b05149260cf7e3449b0e03843dfc220989dd4d",class:"content-image__media-content"},e("slot",{key:"225ded4cd89e04b7c7c71969cc391567b449a682",name:"mediaContent"})),this.showVideoAsGif&&e("video",{key:"5b379113637e6a9b077a5572e3b97b48de244b4d",autoplay:true,muted:true,loop:true,preload:"none",playsinline:true,width:this.width,height:this.height},e("source",{key:"4348f929ee94dd2e0194fbbeba31f1a69569d87a",src:this.lazyLoadIsComplete?this.pictureImageSrc:null,type:this.videoType})),this.pictureImageSrc&&!this.showVideoAsGif&&e("img",{key:"57a1310b8185e6a8f0bd592d63094c535699364a",width:this.width,height:this.height,src:this.pictureImageSrc,alt:this.alt}))}get hostElement(){return s(this)}static get watchers(){return{lazyLoadIsComplete:["watchLazyLoadIsComplete"]}}};T.style=w;const k="*{box-sizing:border-box}content-line{--text-align:default;--inner-max-width:100%;display:block;text-align:var(--text-align);word-break:break-word;white-space:normal}content-line .content-line__inner{display:inline-block;width:auto;max-width:var(--max-width)}";const S=k;const x=class{constructor(e){t(this,e);this.tag="div";this.textAlign="default";this.classes=undefined;this.classString=undefined;this.maxWidth="100%";this.inlineStyle={}}componentWillLoad(){r.registerProp(this.textAlign).subscribe((t=>{this.inlineStyle=Object.assign(Object.assign({},this.inlineStyle),{"--text-align":t})}));r.registerProp(this.maxWidth).subscribe((t=>{this.inlineStyle=Object.assign(Object.assign({},this.inlineStyle),{"--max-width":isNaN(t)?t:t+"%"})}));r.registerProp(this.classes).subscribe((t=>{this.classString=t}))}render(){const t=`${this.tag}`;return e(i,{key:"f810a0a780d8bc063d340114a2ad0817de12e235",class:this.classString,style:this.inlineStyle},e(t,{key:"1b003bf1daa171d768597de9d47443e286fd20fa",class:"content-line__inner"},e("slot",{key:"aead059a6b1421d0e84a56c72c84a3d24889f126",name:"content"}),e("slot",{key:"eda8aaa9eebdd2ac42ef0768c4b4ebe1fe5d6927"})))}};x.style=S;var A=A||{};A.Utils=A.Utils||{};A.Utils.matches=function(t,e){return t.matches(e)};A.Utils.remove=function(t){if(t.remove&&typeof t.remove==="function"){return t.remove()}if(t.parentNode&&t.parentNode.removeChild&&typeof t.parentNode.removeChild==="function"){return t.parentNode.removeChild(t)}return false};A.Utils.isFocusable=function(t){if(t.tabIndex>0||t.tabIndex===0&&t.getAttribute("tabIndex")!==null){return true}if(t.disabled){return false}switch(t.nodeName){case"A":return!!t.href&&t.rel!="ignore";case"INPUT":return t.type!="hidden"&&t.type!="file";case"BUTTON":case"SELECT":case"TEXTAREA":return true;default:return false}};A.Utils.getAncestorBySelector=function(t,e){if(!A.Utils.matches(t,e+" "+t.tagName)){return null}var i=t;var s=null;while(s===null){if(A.Utils.matches(i.parentNode,e)){s=i.parentNode}else{i=i.parentNode}}return s};A.Utils.hasClass=function(t,e){return new RegExp("(\\s|^)"+e+"(\\s|$)").test(t.className)};A.Utils.addClass=function(t,e){if(!A.Utils.hasClass(t,e)){t.className+=" "+e}};A.Utils.removeClass=function(t,e){var i=new RegExp("(\\s|^)"+e+"(\\s|$)");t.className=t.className.replace(i," ").trim()};A.Utils.bindMethods=function(t){var e=Array.prototype.slice.call(arguments,1);e.forEach((function(e){t[e]=t[e].bind(t)}))};window.aria=A;var E=E||{};E.Utils=E.Utils||{};E.Utils.matches=function(t,e){return t.matches(e)};E.Utils.remove=function(t){if(t.remove&&typeof t.remove==="function"){return t.remove()}if(t.parentNode&&t.parentNode.removeChild&&typeof t.parentNode.removeChild==="function"){return t.parentNode.removeChild(t)}return false};E.Utils.isFocusable=function(t){if(t.tabIndex>0||t.tabIndex===0&&t.getAttribute("tabIndex")!==null){return true}if(t.disabled){return false}switch(t.nodeName){case"A":return!!t.href&&t.rel!="ignore";case"INPUT":return t.type!="hidden"&&t.type!="file";case"BUTTON":case"SELECT":case"TEXTAREA":return true;default:return false}};E.Utils.getAncestorBySelector=function(t,e){if(!E.Utils.matches(t,e+" "+t.tagName)){return null}var i=t;var s=null;while(s===null){if(E.Utils.matches(i.parentNode,e)){s=i.parentNode}else{i=i.parentNode}}return s};E.Utils.hasClass=function(t,e){return new RegExp("(\\s|^)"+e+"(\\s|$)").test(t.className)};E.Utils.addClass=function(t,e){if(!E.Utils.hasClass(t,e)){t.className+=" "+e}};E.Utils.removeClass=function(t,e){var i=new RegExp("(\\s|^)"+e+"(\\s|$)");t.className=t.className.replace(i," ").trim()};E.Utils.bindMethods=function(t){var e=Array.prototype.slice.call(arguments,1);e.forEach((function(e){t[e]=t[e].bind(t)}))};E.Utils.IgnoreUtilFocusChanges=false;E.Utils.dialogOpenClass="has-dialog";E.Utils.focusFirstDescendant=function(t){for(var e=0;e<t.childNodes.length;e++){var i=t.childNodes[e];if(E.Utils.attemptFocus(i)||E.Utils.focusFirstDescendant(i)){return true}}return false};E.Utils.focusLastDescendant=function(t){for(var e=t.childNodes.length-1;e>=0;e--){var i=t.childNodes[e];if(E.Utils.attemptFocus(i)||E.Utils.focusLastDescendant(i)){return true}}return false};E.Utils.attemptFocus=function(t){if(!E.Utils.isFocusable(t)){return false}E.Utils.IgnoreUtilFocusChanges=true;try{t.focus()}catch(t){}E.Utils.IgnoreUtilFocusChanges=false;return document.activeElement===t};E.OpenDialogList=E.OpenDialogList||new Array(0);E.getCurrentDialog=function(){if(E.OpenDialogList&&E.OpenDialogList.length){return E.OpenDialogList[E.OpenDialogList.length-1]}};E.closeCurrentDialog=function(){var t=E.getCurrentDialog();if(t){t.close();return true}return false};E.handleEscape=function(t){if(t.key==="Escape"&&E.closeCurrentDialog()){t.stopPropagation()}};document.addEventListener("keyup",E.handleEscape);E.Dialog=function(t,e,i,s){this.dialogNode=t;if(this.dialogNode===null){throw new Error("No element found")}var n=["dialog","alertdialog"];var r=(this.dialogNode.getAttribute("role")||"").trim().split(/\s+/g).some((function(t){return n.some((function(e){return t===e}))}));if(!r){throw new Error("Dialog() requires a DOM element with ARIA role of dialog or alertdialog.")}var o="content-overlay-background";if(this.dialogNode.parentNode.classList.contains(o)){this.backdropNode=this.dialogNode.parentNode}else{this.backdropNode=document.createElement("div");this.backdropNode.className=o;this.dialogNode.parentNode.insertBefore(this.backdropNode,this.dialogNode);this.backdropNode.appendChild(this.dialogNode)}this.backdropNode.classList.add("active");setTimeout((()=>{this.backdropNode.classList.add("transition")}),1);this.isFullscreen=s;if(s){document.body.classList.add(E.Utils.dialogOpenClass)}if(typeof e==="string"){this.focusAfterClosed=document.getElementById(e)}else if(typeof e==="object"){this.focusAfterClosed=e}else{throw new Error("the focusAfterClosed parameter is required for the aria.Dialog constructor.")}if(typeof i==="string"){this.focusFirst=document.getElementById(i)}else if(typeof i==="object"){this.focusFirst=i}else{this.focusFirst=null}var a=document.createElement("div");this.preNode=this.dialogNode.parentNode.insertBefore(a,this.dialogNode);this.preNode.tabIndex=0;var h=document.createElement("div");this.postNode=this.dialogNode.parentNode.insertBefore(h,this.dialogNode.nextSibling);this.postNode.tabIndex=0;if(E.OpenDialogList.length>0){E.getCurrentDialog().removeListeners()}if(s){this.addListeners()}E.OpenDialogList.push(this);this.dialogNode.className="content-overlay-dialog";if(this.focusFirst){this.focusFirst.focus()}else{E.Utils.focusFirstDescendant(this.dialogNode)}this.lastFocus=document.activeElement};E.Dialog.prototype.close=function(){E.OpenDialogList.pop();this.removeListeners();E.Utils.remove(this.preNode);E.Utils.remove(this.postNode);this.dialogNode.className="hidden";this.backdropNode.classList.remove("active");this.backdropNode.classList.remove("transition");this.focusAfterClosed.focus();if(E.OpenDialogList.length>0&&E.OpenDialogList.filter((t=>t.isFullscreen===true)).length){E.getCurrentDialog().addListeners()}else{document.body.classList.remove(E.Utils.dialogOpenClass)}this.dialogNode.dispatchEvent(new CustomEvent("ariaDialog.closed",{bubbles:true,detail:{}}))};E.Dialog.prototype.replace=function(t,e,i){E.OpenDialogList.pop();this.removeListeners();E.Utils.remove(this.preNode);E.Utils.remove(this.postNode);this.dialogNode.className="hidden";this.backdropNode.classList.remove("active");this.backdropNode.classList.remove("transition");var s=e||this.focusAfterClosed;new E.Dialog(t,s,i)};E.Dialog.prototype.addListeners=function(){document.addEventListener("focus",this.trapFocus,true)};E.Dialog.prototype.removeListeners=function(){document.removeEventListener("focus",this.trapFocus,true)};E.Dialog.prototype.trapFocus=function(t){if(E.Utils.IgnoreUtilFocusChanges){return}var e=E.getCurrentDialog();if(e.dialogNode.contains(t.target)){e.lastFocus=t.target}else{E.Utils.focusFirstDescendant(e.dialogNode);if(e.lastFocus==document.activeElement){E.Utils.focusLastDescendant(e.dialogNode)}e.lastFocus=document.activeElement}};E.closeDialog=function(t){var e=E.getCurrentDialog();if(e.dialogNode.contains(t)){e.close()}};E.replaceDialog=function(t,e,i){var s=E.getCurrentDialog();if(s.dialogNode.contains(document.activeElement)){s.replace(t,e,i)}};window.aria=E;const I="*{box-sizing:border-box}.content-overlay-open--fixed{overflow:hidden}.content-block-overlay-container{position:relative;display:block;width:100%;height:100%}content-overlay{display:none;position:relative;flex:0}content-overlay .content-overlay__content>*[slot=content]{height:100%;overflow:auto}content-overlay.content-overlay-active{display:flex}content-overlay[vertical=left]{align-items:flex-start}content-overlay[vertical=center]{align-items:center}content-overlay[vertical=right]{align-items:flex-end}content-overlay[vertical=top]{justify-content:flex-start;top:0}content-overlay[vertical=center]{justify-content:center}content-overlay[vertical=bottom]{justify-content:flex-end;bottom:0}content-overlay .content-overlay-background{background:rgba(255, 255, 255, 0.6);bottom:0;display:none;top:0;z-index:100000;right:0;left:0;width:100%}content-overlay .content-overlay-background.active{display:block}content-overlay .content-overlay__header{display:flex;align-items:center}content-overlay .content-overlay__close{order:2;margin-left:auto;cursor:pointer;z-index:1;appearance:none;background:none;border:none;min-width:40px}content-overlay[position=fixed] .content-overlay-background{position:fixed}content-overlay[position=absolute]{position:absolute;box-sizing:border-box;z-index:100000;height:100%;width:100%;left:0}content-overlay[position=absolute] .content-overlay-background{position:static}content-overlay[position=absolute] .content-overlay__content,content-overlay[position=fixed] .content-overlay__content{flex:1;overflow:auto}content-overlay [role=dialog]{display:flex;flex-direction:column;height:100%;justify-content:flex-start}content-overlay [role=dialog].hidden{display:none}content-overlay[full-screen=true]{height:100%}content-overlay[full-screen=true] .content-overlay-background{height:100%}body.has-dialog{overflow:hidden}";const D=I;const C=class{constructor(e){t(this,e);this.contentOverlayActivated=n(this,"contentOverlayActivated",7);this.target=undefined;this.open="false";this.fullScreen="true";this.classes=undefined;this.horizontal="center";this.vertical="center";this.closeTitle="Close Overlay";this.position="fixed";this.isActive=false;this.activeClass="";this.classString="";this.contentSlot=undefined;this.isFullScreen=false;this.hasCloseButton=false;this.originalMarkup=undefined}onContentBlockToggle(t){if(this.hostElement.getAttribute("id")===t.detail.getAttribute("id")){t.preventDefault();if(!this.isActive){this.openOverlay()}else{this.closeOverlay()}}}onContentBlockActivated(t){if(this.hostElement.getAttribute("id")===t.detail.getAttribute("id")){t.preventDefault();this.openOverlay()}}onContentBlockDeactivated(t){if(this.hostElement.getAttribute("id")===t.detail.getAttribute("id")){t.preventDefault();this.closeOverlay()}}async openOverlay(){this.isActive=true;document.body.classList.add(`content-overlay-open`,`content-overlay-open--${this.position}`);document.body.classList.remove("content-overlay-close");if(!this.originalMarkup){this.originalMarkup=this.contentSlot.innerHTML}if(this.target){let t=this.target==="#"?this.hostElement.parentElement:document.querySelector(this.target);if(t){t.classList.add("content-block-overlay-container");t.appendChild(this.hostElement)}}if(this.originalMarkup){this.contentSlot.innerHTML=this.originalMarkup;if(this.contentSlot.children[0]===this.contentSlot.querySelector('script[slot="content"][type="text/template"]')){this.contentSlot.innerHTML=this.contentSlot.children[0].innerHTML}this.setComputedActiveClass();this.focusTrap=a(this.hostElement,{fallbackFocus:this.hostElement,allowOutsideClick:true,clickOutsideDeactivates:true,onDeactivate:()=>{this.isActive=false;document.body.classList.add("content-overlay-close");document.body.classList.remove(`content-overlay-open`,`content-overlay-open--${this.position}`);this.activeClass="";this.setComputedActiveClass();this.contentSlot.innerHTML=""}})}this.contentOverlayActivated.emit(this.hostElement)}async closeOverlay(){if(this.focusTrap){try{this.focusTrap.deactivate()}catch(t){console.log(t)}}}setComputedActiveClass(){this.activeClass=`content-overlay ${this.isActive?"content-overlay-active":"content-overlay-inactive"} content-overlay--${this.position}`}componentWillLoad(){r.registerProp(this.classes).subscribe((t=>this.classString=`${t}`));r.registerProp(this.position).subscribe((t=>this.position=t));r.registerProp(this.horizontal).subscribe((t=>this.hostElement.setAttribute("horizontal",t)));r.registerProp(this.vertical).subscribe((t=>this.hostElement.setAttribute("vertical",t)));r.registerProp(this.fullScreen).subscribe((t=>{this.fullScreen=t;this.isFullScreen=t==="true"}));r.registerProp(this.open).subscribe((t=>{this.hostElement.setAttribute("open",t)}));this.hasCloseButton=!!this.hostElement.querySelector('[slot="closeButton"]')}closeOverlayButtonClicked(t){t.preventDefault();this.closeOverlay()}render(){return e(i,{key:"70525d441fef22dfd54c93047776b293411de805",class:`${this.activeClass} ${this.classString}`,position:this.position},e("div",{key:"f69a2d0a9f62b9a8c6a73106b419023b70528152",class:"content-block-overlay-container"},e("div",{key:"3eda44dcc57d4704258751e4287baf1223e4b393",class:`content-overlay-background ${this.isActive?"active":""}`},e("div",{key:"5ceaa528e484ee2de56093dae89f9a6138a06f50",ref:t=>this.dialogElement=t,role:"dialog","aria-modal":"true",class:this.isActive?"active":"hidden","aria-expanded":this.isActive},e("div",{key:"7af296f91887e14978090474e1e60e0807bc2684",class:"content-overlay__header"},e("button",{key:"e312a9a53f4d8400d8f99b3b85a252a4713d9c24",onClick:t=>{this.closeOverlayButtonClicked(t)},class:"content-overlay__close",title:this.closeTitle},!this.hasCloseButton&&e("svg",{key:"ab3a9eae967ae1aa65a62c4f97bf346ff5b7ae56",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"},e("path",{key:"66e8c160d73fa53abb9d9d1e1b10421003fd13f9","stroke-linecap":"round","stroke-linejoin":"round",d:"M6 18 18 6M6 6l12 12"})),e("slot",{key:"680eda3171fd38dd5b00963eef82c1221b94d663",name:"closeButton"})),e("slot",{key:"d8c34c5bb0e24a35b8351c3ea364c09509211c2c",name:"header"})),e("div",{key:"10415922744fe91d30afc2d7d51f379275658e0f",class:"content-overlay__content",ref:t=>this.contentSlot=t},e("slot",{key:"6564b04487863aaaeb121ab90e1361aca5fa2adc",name:"content"}),e("slot",{key:"dac056b616dc5468eca8603c8ad7c48489224411"}))))))}componentDidRender(){if(this.open==="true"){this.openOverlay()}if(this.isActive&&this.focusTrap&&!this.focusTrap.active){try{this.focusTrap.activate()}catch(t){console.log(t)}}}get hostElement(){return s(this)}};C.style=D;const N="*{box-sizing:border-box}content-spacer{display:block;width:100%;height:auto}content-spacer .content-spacer__content{width:100%}content-spacer[full-height=true]{height:100%}content-spacer[text-align=left]{text-align:left}content-spacer[text-align=center]{text-align:center}content-spacer[text-align=right]{text-align:right}content-spacer[horizontal=left]{margin-left:0;margin-right:auto}content-spacer[horizontal=center]{margin-left:auto;margin-right:auto}content-spacer[horizontal=right]{margin-left:auto;margin-right:0}content-spacer[vertical]{display:flex}content-spacer[vertical=top]{align-items:flex-start}content-spacer[vertical=center]{align-items:center}content-spacer[vertical=bottom]{align-items:flex-end}";const _=N;const O=class{constructor(e){t(this,e);this.classes=undefined;this.classString=undefined;this.maxWidth="100";this.fullHeight="false";this.textAlign="default";this.horizontal="default";this.vertical="";this.topOffset="0";this.bottomOffset="0";this.leftOffset="0";this.rightOffset="0";this.inlineStyle={}}componentWillLoad(){r.registerProp(this.fullHeight).subscribe((t=>this.fullHeight=t));r.registerProp(this.textAlign).subscribe((t=>this.textAlign=t));r.registerProp(this.horizontal).subscribe((t=>this.horizontal=t));r.registerProp(this.vertical).subscribe((t=>this.vertical=t));r.registerProp(this.maxWidth).subscribe((t=>{this.inlineStyle=Object.assign(Object.assign({},this.inlineStyle),{"max-width":isNaN(t)?t:t+"%"})}));r.registerProp(this.topOffset).subscribe((t=>{this.inlineStyle=Object.assign(Object.assign({},this.inlineStyle),{"padding-top":isNaN(t)?t:t+"%"})}));r.registerProp(this.bottomOffset).subscribe((t=>{this.inlineStyle=Object.assign(Object.assign({},this.inlineStyle),{"padding-bottom":isNaN(t)?t:t+"%"})}));r.registerProp(this.leftOffset).subscribe((t=>{this.inlineStyle=Object.assign(Object.assign({},this.inlineStyle),{"padding-left":isNaN(t)?t:t+"%"})}));r.registerProp(this.rightOffset).subscribe((t=>{this.inlineStyle=Object.assign(Object.assign({},this.inlineStyle),{"padding-right":isNaN(t)?t:t+"%"})}));r.registerProp(this.classes).subscribe((t=>this.classString=t))}render(){return e(i,{key:"d77bbf3aceceac17d3a2b139b631d6b44f618176",class:this.classString,style:this.inlineStyle},e("div",{key:"54ab935fa44a783060e67780a68e5ae2d5ad216a",class:"content-spacer__content"},e("slot",{key:"dee136bc8ce06c4445a1df2536735cc756ee5cb2",name:"content"}),e("slot",{key:"244e9656209c313c4ae989c5ad49995dd66c9638"})))}};O.style=_;const M="*{box-sizing:border-box}content-text-block{display:block;width:100%;text-align:initial}content-text-block[full-height=true]{height:100%}content-text-block>*[slot=footer]{margin-top:auto;margin-bottom:0;width:100%;padding-top:1rem;height:auto}content-text-block[vertical=bottom]>[slot=footer]{position:static;height:auto}content-text-block[vertical]{display:flex;flex-direction:column}content-text-block[vertical=top]{justify-content:flex-start}content-text-block[vertical=center]{justify-content:center}content-text-block[vertical=center][footer=true] .content-text-block__content{margin-top:auto;margin-bottom:0}content-text-block[vertical=bottom]{justify-content:flex-end}content-text-block[vertical=bottom][footer=true] .content-text-block__content{margin-top:auto;margin-bottom:0}content-text-block[vertical=bottom][footer=true]>[slot=footer]{margin-top:0}content-text-block[text-align=left]{text-align:left}content-text-block[text-align=center]{text-align:center}content-text-block[text-align=right]{text-align:right}";const R=M;const L=class{constructor(e){t(this,e);this.classes=undefined;this.classString=undefined;this.minHeight=undefined;this.vertical="top";this.fullHeight="false";this.textAlign="default";this.inlineStyle={}}componentWillLoad(){if(!!this.hostElement.querySelector('[slot="footer"]')){this.hostElement.setAttribute("footer","true")}r.registerProp(this.minHeight).subscribe((t=>{this.inlineStyle=Object.assign(Object.assign({},this.inlineStyle),{"min-height":isNaN(t)?t:t+"px"})}));r.registerProp(this.textAlign).subscribe((t=>this.hostElement.setAttribute("text-align",t)));r.registerProp(this.vertical).subscribe((t=>this.hostElement.setAttribute("vertical",t)));r.registerProp(this.fullHeight).subscribe((t=>{this.hostElement.setAttribute("full-height",t)}));r.registerProp(this.classes).subscribe((t=>this.classString=t))}render(){return e(i,{key:"116ebc47c5f89f06424fbe67e76052160fc2291d",class:this.classString,style:this.inlineStyle},e("div",{key:"31647851675daf77d948fd1b401302d79b134051",class:"content-text-block__content"},e("slot",{key:"33b09d8504765218eb85883ba44435247a375593",name:"content"}),e("slot",{key:"3a6b285567c0023f1e4ada56df5e2ad3c418861c"})),e("slot",{key:"689f93bc46db8c458a0fa0d827503cbc2449da9a",name:"footer"}))}get hostElement(){return s(this)}};L.style=R;const P="*{box-sizing:border-box}content-tout-block .content-tout-block__media{position:relative}content-tout-block .content-tout-block__media-content{position:absolute;width:100%;height:100%;top:0;left:0;display:flex;align-items:center;justify-content:center;overflow:hidden}content-tout-block .content-tout-block__media-content [slot=mediaContent]{height:100%;width:100%}content-tout-block[hover=true] .content-tout-block__media-content{transition:opacity 0.3s}@media (hover: hover){content-tout-block[hover=true] .content-tout-block__media-content{opacity:0}content-tout-block[hover=true] .content-tout-block__media-content:hover,content-tout-block[hover=true] .content-tout-block__media-content:focus,content-tout-block[hover=true] .content-tout-block__media-content:focus-within{opacity:1}}";const $=P;const F=class{constructor(e){t(this,e);this.hover="false|true";this.classes=undefined;this.classString=undefined;this.hasHoverContent=false}componentWillLoad(){this.hasMediaContent=!!this.hostElement.querySelector('[slot="mediaContent"]');r.registerProp(this.hover).subscribe((t=>this.hover=t));r.registerProp(this.classes).subscribe((t=>this.classString=t))}render(){return e(i,{key:"69ebec1035055bb7a249e595342a0d79438181bb",hover:this.hover,class:this.classString},e("div",{key:"c743bc1ff43b2c943b955f0b7ea00f532041aa0d",class:"content-tout-block__media"},e("slot",{key:"ac975a64066064eee82b7cbb35578f9cc6f3529a",name:"media"}),this.hasMediaContent&&e("div",{key:"9d00d6821314a5b95330a911e6a829c1e310ead7",class:"content-tout-block__media-content"},e("slot",{key:"0daf8cb6fd837e0949e293765e70b6511701fa5c",name:"mediaContent"}))),e("div",{key:"399f773abf22662d4f923114c3cdbb752508ad82",class:"content-tout-block__content"},e("slot",{key:"bb48528101de40fa8d6f02fa21cab6027ff0ba39",name:"content"}),e("slot",{key:"4b4cd77dc3c31741b8d81d5f267547424b3d459a"})))}get hostElement(){return s(this)}};F.style=$;var U=typeof globalThis!=="undefined"?globalThis:typeof window!=="undefined"?window:typeof global!=="undefined"?global:typeof self!=="undefined"?self:{};function B(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t["default"]:t}function q(t){if(t.__esModule)return t;var e=Object.defineProperty({},"__esModule",{value:true});Object.keys(t).forEach((function(i){var s=Object.getOwnPropertyDescriptor(t,i);Object.defineProperty(e,i,s.get?s:{enumerable:true,get:function(){return t[i]}})}));return e}var V;if(typeof window!=="undefined"){V=window}else if(typeof U!=="undefined"){V=U}else if(typeof self!=="undefined"){V=self}else{V={}}var z=V;const H={};const X=Object.freeze({__proto__:null,default:H});const G=q(X);var Y=typeof U!=="undefined"?U:typeof window!=="undefined"?window:{};var W=G;var J;if(typeof document!=="undefined"){J=document}else{J=Y["__GLOBAL_DOCUMENT_CACHE@4"];if(!J){J=Y["__GLOBAL_DOCUMENT_CACHE@4"]=W}}var K=J;var Q=Z;function Z(t,e){var i;var s=null;try{i=JSON.parse(t,e)}catch(t){s=t}return[s,i]}var tt={exports:{}};var et={exports:{}};(function(t){function e(){return t.exports=e=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var i=arguments[e];for(var s in i)({}).hasOwnProperty.call(i,s)&&(t[s]=i[s])}return t},t.exports.__esModule=true,t.exports["default"]=t.exports,e.apply(null,arguments)}t.exports=e,t.exports.__esModule=true,t.exports["default"]=t.exports})(et);const it=B(et.exports);var st=rt;var nt=Object.prototype.toString;function rt(t){if(!t){return false}var e=nt.call(t);return e==="[object Function]"||typeof t==="function"&&e!=="[object RegExp]"||typeof window!=="undefined"&&(t===window.setTimeout||t===window.alert||t===window.confirm||t===window.prompt)}function ot(t,e){var i=typeof Symbol!=="undefined"&&t[Symbol.iterator]||t["@@iterator"];if(i)return(i=i.call(t)).next.bind(i);if(Array.isArray(t)||(i=at(t))||e&&t&&typeof t.length==="number"){if(i)t=i;var s=0;return function(){if(s>=t.length)return{done:true};return{done:false,value:t[s++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function at(t,e){if(!t)return;if(typeof t==="string")return ht(t,e);var i=Object.prototype.toString.call(t).slice(8,-1);if(i==="Object"&&t.constructor)i=t.constructor.name;if(i==="Map"||i==="Set")return Array.from(t);if(i==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i))return ht(t,e)}function ht(t,e){if(e==null||e>t.length)e=t.length;for(var i=0,s=new Array(e);i<e;i++){s[i]=t[i]}return s}var ct=function(){function t(){this.typeToInterceptorsMap_=new Map;this.enabled_=false}var e=t.prototype;e.getIsEnabled=function t(){return this.enabled_};e.enable=function t(){this.enabled_=true};e.disable=function t(){this.enabled_=false};e.reset=function t(){this.typeToInterceptorsMap_=new Map;this.enabled_=false};e.addInterceptor=function t(e,i){if(!this.typeToInterceptorsMap_.has(e)){this.typeToInterceptorsMap_.set(e,new Set)}var s=this.typeToInterceptorsMap_.get(e);if(s.has(i)){return false}s.add(i);return true};e.removeInterceptor=function t(e,i){var s=this.typeToInterceptorsMap_.get(e);if(s&&s.has(i)){s.delete(i);return true}return false};e.clearInterceptorsByType=function t(e){var i=this.typeToInterceptorsMap_.get(e);if(!i){return false}this.typeToInterceptorsMap_.delete(e);this.typeToInterceptorsMap_.set(e,new Set);return true};e.clear=function t(){if(!this.typeToInterceptorsMap_.size){return false}this.typeToInterceptorsMap_=new Map;return true};e.getForType=function t(e){return this.typeToInterceptorsMap_.get(e)||new Set};e.execute=function t(e,i){var s=this.getForType(e);for(var n=ot(s),r;!(r=n()).done;){var o=r.value;try{i=o(i)}catch(t){}}return i};return t}();var lt=ct;var ut=function(){function t(){this.maxAttempts_=1;this.delayFactor_=.1;this.fuzzFactor_=.1;this.initialDelay_=1e3;this.enabled_=false}var e=t.prototype;e.getIsEnabled=function t(){return this.enabled_};e.enable=function t(){this.enabled_=true};e.disable=function t(){this.enabled_=false};e.reset=function t(){this.maxAttempts_=1;this.delayFactor_=.1;this.fuzzFactor_=.1;this.initialDelay_=1e3;this.enabled_=false};e.getMaxAttempts=function t(){return this.maxAttempts_};e.setMaxAttempts=function t(e){this.maxAttempts_=e};e.getDelayFactor=function t(){return this.delayFactor_};e.setDelayFactor=function t(e){this.delayFactor_=e};e.getFuzzFactor=function t(){return this.fuzzFactor_};e.setFuzzFactor=function t(e){this.fuzzFactor_=e};e.getInitialDelay=function t(){return this.initialDelay_};e.setInitialDelay=function t(e){this.initialDelay_=e};e.createRetry=function t(e){var i=e===void 0?{}:e,s=i.maxAttempts,n=i.delayFactor,r=i.fuzzFactor,o=i.initialDelay;return new ft({maxAttempts:s||this.maxAttempts_,delayFactor:n||this.delayFactor_,fuzzFactor:r||this.fuzzFactor_,initialDelay:o||this.initialDelay_})};return t}();var ft=function(){function t(t){this.maxAttempts_=t.maxAttempts;this.delayFactor_=t.delayFactor;this.fuzzFactor_=t.fuzzFactor;this.currentDelay_=t.initialDelay;this.currentAttempt_=1}var e=t.prototype;e.moveToNextAttempt=function t(){this.currentAttempt_++;var e=this.currentDelay_*this.delayFactor_;this.currentDelay_=this.currentDelay_+e};e.shouldRetry=function t(){return this.currentAttempt_<this.maxAttempts_};e.getCurrentDelay=function t(){return this.currentDelay_};e.getCurrentMinPossibleDelay=function t(){return(1-this.fuzzFactor_)*this.currentDelay_};e.getCurrentMaxPossibleDelay=function t(){return(1+this.fuzzFactor_)*this.currentDelay_};e.getCurrentFuzzedDelay=function t(){var e=this.getCurrentMinPossibleDelay();var i=this.getCurrentMaxPossibleDelay();return e+Math.random()*(i-e)};return t}();var dt=ut;var pt=z;var vt=function t(e,i){if(i===void 0){i=false}return function(t,s,n){if(t){e(t);return}if(s.statusCode>=400&&s.statusCode<=599){var r=n;if(i){if(pt.TextDecoder){var o=mt(s.headers&&s.headers["content-type"]);try{r=new TextDecoder(o).decode(n)}catch(t){}}else{r=String.fromCharCode.apply(null,new Uint8Array(n))}}e({cause:r});return}e(null,n)}};function mt(t){if(t===void 0){t=""}return t.toLowerCase().split(";").reduce((function(t,e){var i=e.split("="),s=i[0],n=i[1];if(s.trim()==="charset"){return n.trim()}return t}),"utf-8")}var gt=vt;var bt=z;var yt=et.exports;var jt=st;var wt=lt;var Tt=dt;Et.httpHandler=gt;Et.requestInterceptorsStorage=new wt;Et.responseInterceptorsStorage=new wt;Et.retryManager=new Tt;
|
|
2
|
-
/**
|
|
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 kt=function t(e){var i={};if(!e){return i}e.trim().split("\n").forEach((function(t){var e=t.indexOf(":");var s=t.slice(0,e).trim().toLowerCase();var n=t.slice(e+1).trim();if(typeof i[s]==="undefined"){i[s]=n}else if(Array.isArray(i[s])){i[s].push(n)}else{i[s]=[i[s],n]}}));return i};tt.exports=Et;tt.exports.default=Et;Et.XMLHttpRequest=bt.XMLHttpRequest||Ct;Et.XDomainRequest="withCredentials"in new Et.XMLHttpRequest?Et.XMLHttpRequest:bt.XDomainRequest;St(["get","put","post","patch","head","delete"],(function(t){Et[t==="delete"?"del":t]=function(e,i,s){i=At(e,i,s);i.method=t.toUpperCase();return It(i)}}));function St(t,e){for(var i=0;i<t.length;i++){e(t[i])}}function xt(t){for(var e in t){if(t.hasOwnProperty(e))return false}return true}function At(t,e,i){var s=t;if(jt(e)){i=e;if(typeof t==="string"){s={uri:t}}}else{s=yt({},e,{uri:t})}s.callback=i;return s}function Et(t,e,i){e=At(t,e,i);return It(e)}function It(t){if(typeof t.callback==="undefined"){throw new Error("callback argument missing")}if(t.requestType&&Et.requestInterceptorsStorage.getIsEnabled()){var e={uri:t.uri||t.url,headers:t.headers||{},body:t.body,metadata:t.metadata||{},retry:t.retry,timeout:t.timeout};var i=Et.requestInterceptorsStorage.execute(t.requestType,e);t.uri=i.uri;t.headers=i.headers;t.body=i.body;t.metadata=i.metadata;t.retry=i.retry;t.timeout=i.timeout}var s=false;var n=function e(i,n,r){if(!s){s=true;t.callback(i,n,r)}};function r(){if(c.readyState===4&&!Et.responseInterceptorsStorage.getIsEnabled()){setTimeout(h,0)}}function o(){var t=undefined;if(c.response){t=c.response}else{t=c.responseText||Dt(c)}if(g){try{t=JSON.parse(t)}catch(t){}}return t}function a(e){clearTimeout(b);clearTimeout(t.retryTimeout);if(!(e instanceof Error)){e=new Error(""+(e||"Unknown XMLHttpRequest Error"))}e.statusCode=0;if(!u&&Et.retryManager.getIsEnabled()&&t.retry&&t.retry.shouldRetry()){t.retryTimeout=setTimeout((function(){t.retry.moveToNextAttempt();t.xhr=c;It(t)}),t.retry.getCurrentFuzzedDelay());return}if(t.requestType&&Et.responseInterceptorsStorage.getIsEnabled()){var i={headers:y.headers||{},body:y.body,responseUrl:c.responseURL,responseType:c.responseType};var s=Et.responseInterceptorsStorage.execute(t.requestType,i);y.body=s.body;y.headers=s.headers}return n(e,y)}function h(){if(u)return;var e;clearTimeout(b);clearTimeout(t.retryTimeout);if(t.useXDR&&c.status===undefined){e=200}else{e=c.status===1223?204:c.status}var i=y;var s=null;if(e!==0){i={body:o(),statusCode:e,method:d,headers:{},url:f,rawRequest:c};if(c.getAllResponseHeaders){i.headers=kt(c.getAllResponseHeaders())}}else{s=new Error("Internal XMLHttpRequest Error")}if(t.requestType&&Et.responseInterceptorsStorage.getIsEnabled()){var r={headers:i.headers||{},body:i.body,responseUrl:c.responseURL,responseType:c.responseType};var a=Et.responseInterceptorsStorage.execute(t.requestType,r);i.body=a.body;i.headers=a.headers}return n(s,i,i.body)}var c=t.xhr||null;if(!c){if(t.cors||t.useXDR){c=new Et.XDomainRequest}else{c=new Et.XMLHttpRequest}}var l;var u;var f=c.url=t.uri||t.url;var d=c.method=t.method||"GET";var p=t.body||t.data;var v=c.headers=t.headers||{};var m=!!t.sync;var g=false;var b;var y={body:undefined,headers:{},statusCode:0,method:d,url:f,rawRequest:c};if("json"in t&&t.json!==false){g=true;v["accept"]||v["Accept"]||(v["Accept"]="application/json");if(d!=="GET"&&d!=="HEAD"){v["content-type"]||v["Content-Type"]||(v["Content-Type"]="application/json");p=JSON.stringify(t.json===true?p:t.json)}}c.onreadystatechange=r;c.onload=h;c.onerror=a;c.onprogress=function(){};c.onabort=function(){u=true;clearTimeout(t.retryTimeout)};c.ontimeout=a;c.open(d,f,!m,t.username,t.password);if(!m){c.withCredentials=!!t.withCredentials}if(!m&&t.timeout>0){b=setTimeout((function(){if(u)return;u=true;c.abort("timeout");var t=new Error("XMLHttpRequest timeout");t.code="ETIMEDOUT";a(t)}),t.timeout)}if(c.setRequestHeader){for(l in v){if(v.hasOwnProperty(l)){c.setRequestHeader(l,v[l])}}}else if(t.headers&&!xt(t.headers)){throw new Error("Headers cannot be set on an XDomainRequest object")}if("responseType"in t){c.responseType=t.responseType}if("beforeSend"in t&&typeof t.beforeSend==="function"){t.beforeSend(c)}c.send(p||null);return c}function Dt(t){try{if(t.responseType==="document"){return t.responseXML}var e=t.responseXML&&t.responseXML.documentElement.nodeName==="parsererror";if(t.responseType===""&&!e){return t.responseXML}}catch(t){}return null}function Ct(){}const Nt=tt.exports;var _t={exports:{}};var Ot=K;var Mt=Object.create||function(){function t(){}return function(e){if(arguments.length!==1){throw new Error("Object.create shim only accepts one parameter.")}t.prototype=e;return new t}}();function Rt(t,e){this.name="ParsingError";this.code=t.code;this.message=e||t.message}Rt.prototype=Mt(Error.prototype);Rt.prototype.constructor=Rt;Rt.Errors={BadSignature:{code:0,message:"Malformed WebVTT signature."},BadTimeStamp:{code:1,message:"Malformed time stamp."}};function Lt(t){function e(t,e,i,s){return(t|0)*3600+(e|0)*60+(i|0)+(s|0)/1e3}var i=t.match(/^(\d+):(\d{1,2})(:\d{1,2})?\.(\d{3})/);if(!i){return null}if(i[3]){return e(i[1],i[2],i[3].replace(":",""),i[4])}else if(i[1]>59){return e(i[1],i[2],0,i[4])}else{return e(0,i[1],i[2],i[4])}}function Pt(){this.values=Mt(null)}Pt.prototype={set:function(t,e){if(!this.get(t)&&e!==""){this.values[t]=e}},get:function(t,e,i){if(i){return this.has(t)?this.values[t]:e[i]}return this.has(t)?this.values[t]:e},has:function(t){return t in this.values},alt:function(t,e,i){for(var s=0;s<i.length;++s){if(e===i[s]){this.set(t,e);break}}},integer:function(t,e){if(/^-?\d+$/.test(e)){this.set(t,parseInt(e,10))}},percent:function(t,e){if(e.match(/^([\d]{1,3})(\.[\d]*)?%$/)){e=parseFloat(e);if(e>=0&&e<=100){this.set(t,e);return true}}return false}};function $t(t,e,i,s){var n=s?t.split(s):[t];for(var r in n){if(typeof n[r]!=="string"){continue}var o=n[r].split(i);if(o.length!==2){continue}var a=o[0].trim();var h=o[1].trim();e(a,h)}}function Ft(t,e,i){var s=t;function n(){var e=Lt(t);if(e===null){throw new Rt(Rt.Errors.BadTimeStamp,"Malformed timestamp: "+s)}t=t.replace(/^[^\sa-zA-Z-]+/,"");return e}function r(t,e){var s=new Pt;$t(t,(function(t,e){switch(t){case"region":for(var n=i.length-1;n>=0;n--){if(i[n].id===e){s.set(t,i[n].region);break}}break;case"vertical":s.alt(t,e,["rl","lr"]);break;case"line":var r=e.split(","),o=r[0];s.integer(t,o);s.percent(t,o)?s.set("snapToLines",false):null;s.alt(t,o,["auto"]);if(r.length===2){s.alt("lineAlign",r[1],["start","center","end"])}break;case"position":r=e.split(",");s.percent(t,r[0]);if(r.length===2){s.alt("positionAlign",r[1],["start","center","end"])}break;case"size":s.percent(t,e);break;case"align":s.alt(t,e,["start","center","end","left","right"]);break}}),/:/,/\s/);e.region=s.get("region",null);e.vertical=s.get("vertical","");try{e.line=s.get("line","auto")}catch(t){}e.lineAlign=s.get("lineAlign","start");e.snapToLines=s.get("snapToLines",true);e.size=s.get("size",100);try{e.align=s.get("align","center")}catch(t){e.align=s.get("align","middle")}try{e.position=s.get("position","auto")}catch(t){e.position=s.get("position",{start:0,left:0,center:50,middle:50,end:100,right:100},e.align)}e.positionAlign=s.get("positionAlign",{start:"start",left:"start",center:"center",middle:"center",end:"end",right:"end"},e.align)}function o(){t=t.replace(/^\s+/,"")}o();e.startTime=n();o();if(t.substr(0,3)!=="--\x3e"){throw new Rt(Rt.Errors.BadTimeStamp,"Malformed time stamp (time stamps must be separated by '--\x3e'): "+s)}t=t.substr(3);o();e.endTime=n();o();r(t,e)}var Ut=Ot.createElement&&Ot.createElement("textarea");var Bt={c:"span",i:"i",b:"b",u:"u",ruby:"ruby",rt:"rt",v:"span",lang:"span"};var qt={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)"};var Vt={v:"title",lang:"lang"};var zt={rt:"ruby"};function Ht(t,e){function i(){if(!e){return null}function t(t){e=e.substr(t.length);return t}var i=e.match(/^([^<]*)(<[^>]*>?)?/);return t(i[1]?i[1]:i[2])}function s(t){Ut.innerHTML=t;t=Ut.textContent;Ut.textContent="";return t}function n(t,e){return!zt[e.localName]||zt[e.localName]===t.localName}function r(e,i){var s=Bt[e];if(!s){return null}var n=t.document.createElement(s);var r=Vt[e];if(r&&i){n[r]=i.trim()}return n}var o=t.document.createElement("div"),a=o,h,c=[];while((h=i())!==null){if(h[0]==="<"){if(h[1]==="/"){if(c.length&&c[c.length-1]===h.substr(2).replace(">","")){c.pop();a=a.parentNode}continue}var l=Lt(h.substr(1,h.length-2));var u;if(l){u=t.document.createProcessingInstruction("timestamp",l);a.appendChild(u);continue}var f=h.match(/^<([^.\s/0-9>]+)(\.[^\s\\>]+)?([^>\\]+)?(\\?)>?$/);if(!f){continue}u=r(f[1],f[3]);if(!u){continue}if(!n(a,u)){continue}if(f[2]){var d=f[2].split(".");d.forEach((function(t){var e=/^bg_/.test(t);var i=e?t.slice(3):t;if(qt.hasOwnProperty(i)){var s=e?"background-color":"color";var n=qt[i];u.style[s]=n}}));u.className=d.join(" ")}c.push(f[1]);a.appendChild(u);a=u;continue}a.appendChild(t.document.createTextNode(s(h)))}return o}var Xt=[[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 Gt(t){for(var e=0;e<Xt.length;e++){var i=Xt[e];if(t>=i[0]&&t<=i[1]){return true}}return false}function Yt(t){var e=[],i="",s;if(!t||!t.childNodes){return"ltr"}function n(t,e){for(var i=e.childNodes.length-1;i>=0;i--){t.push(e.childNodes[i])}}function r(t){if(!t||!t.length){return null}var e=t.pop(),i=e.textContent||e.innerText;if(i){var s=i.match(/^.*(\n|\r)/);if(s){t.length=0;return s[0]}return i}if(e.tagName==="ruby"){return r(t)}if(e.childNodes){n(t,e);return r(t)}}n(e,t);while(i=r(e)){for(var o=0;o<i.length;o++){s=i.charCodeAt(o);if(Gt(s)){return"rtl"}}}return"ltr"}function Wt(t){if(typeof t.line==="number"&&(t.snapToLines||t.line>=0&&t.line<=100)){return t.line}if(!t.track||!t.track.textTrackList||!t.track.textTrackList.mediaElement){return-1}var e=t.track,i=e.textTrackList,s=0;for(var n=0;n<i.length&&i[n]!==e;n++){if(i[n].mode==="showing"){s++}}return++s*-1}function Jt(){}Jt.prototype.applyStyles=function(t,e){e=e||this.div;for(var i in t){if(t.hasOwnProperty(i)){e.style[i]=t[i]}}};Jt.prototype.formatStyle=function(t,e){return t===0?0:t+e};function Kt(t,e,i){Jt.call(this);this.cue=e;this.cueDiv=Ht(t,e.text);var s={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:e.vertical===""?"horizontal-tb":e.vertical==="lr"?"vertical-lr":"vertical-rl",unicodeBidi:"plaintext"};this.applyStyles(s,this.cueDiv);this.div=t.document.createElement("div");s={direction:Yt(this.cueDiv),writingMode:e.vertical===""?"horizontal-tb":e.vertical==="lr"?"vertical-lr":"vertical-rl",unicodeBidi:"plaintext",textAlign:e.align==="middle"?"center":e.align,font:i.font,whiteSpace:"pre-line",position:"absolute"};this.applyStyles(s);this.div.appendChild(this.cueDiv);var n=0;switch(e.positionAlign){case"start":case"line-left":n=e.position;break;case"center":n=e.position-e.size/2;break;case"end":case"line-right":n=e.position-e.size;break}if(e.vertical===""){this.applyStyles({left:this.formatStyle(n,"%"),width:this.formatStyle(e.size,"%")})}else{this.applyStyles({top:this.formatStyle(n,"%"),height:this.formatStyle(e.size,"%")})}this.move=function(t){this.applyStyles({top:this.formatStyle(t.top,"px"),bottom:this.formatStyle(t.bottom,"px"),left:this.formatStyle(t.left,"px"),right:this.formatStyle(t.right,"px"),height:this.formatStyle(t.height,"px"),width:this.formatStyle(t.width,"px")})}}Kt.prototype=Mt(Jt.prototype);Kt.prototype.constructor=Kt;function Qt(t){var e,i,s,n;if(t.div){i=t.div.offsetHeight;s=t.div.offsetWidth;n=t.div.offsetTop;var r=(r=t.div.childNodes)&&(r=r[0])&&r.getClientRects&&r.getClientRects();t=t.div.getBoundingClientRect();e=r?Math.max(r[0]&&r[0].height||0,t.height/r.length):0}this.left=t.left;this.right=t.right;this.top=t.top||n;this.height=t.height||i;this.bottom=t.bottom||n+(t.height||i);this.width=t.width||s;this.lineHeight=e!==undefined?e:t.lineHeight}Qt.prototype.move=function(t,e){e=e!==undefined?e:this.lineHeight;switch(t){case"+x":this.left+=e;this.right+=e;break;case"-x":this.left-=e;this.right-=e;break;case"+y":this.top+=e;this.bottom+=e;break;case"-y":this.top-=e;this.bottom-=e;break}};Qt.prototype.overlaps=function(t){return this.left<t.right&&this.right>t.left&&this.top<t.bottom&&this.bottom>t.top};Qt.prototype.overlapsAny=function(t){for(var e=0;e<t.length;e++){if(this.overlaps(t[e])){return true}}return false};Qt.prototype.within=function(t){return this.top>=t.top&&this.bottom<=t.bottom&&this.left>=t.left&&this.right<=t.right};Qt.prototype.overlapsOppositeAxis=function(t,e){switch(e){case"+x":return this.left<t.left;case"-x":return this.right>t.right;case"+y":return this.top<t.top;case"-y":return this.bottom>t.bottom}};Qt.prototype.intersectPercentage=function(t){var e=Math.max(0,Math.min(this.right,t.right)-Math.max(this.left,t.left)),i=Math.max(0,Math.min(this.bottom,t.bottom)-Math.max(this.top,t.top)),s=e*i;return s/(this.height*this.width)};Qt.prototype.toCSSCompatValues=function(t){return{top:this.top-t.top,bottom:t.bottom-this.bottom,left:this.left-t.left,right:t.right-this.right,height:this.height,width:this.width}};Qt.getSimpleBoxPosition=function(t){var e=t.div?t.div.offsetHeight:t.tagName?t.offsetHeight:0;var i=t.div?t.div.offsetWidth:t.tagName?t.offsetWidth:0;var s=t.div?t.div.offsetTop:t.tagName?t.offsetTop:0;t=t.div?t.div.getBoundingClientRect():t.tagName?t.getBoundingClientRect():t;var n={left:t.left,right:t.right,top:t.top||s,height:t.height||e,bottom:t.bottom||s+(t.height||e),width:t.width||i};return n};function Zt(t,e,i,s){function n(t,e){var n,r=new Qt(t),o=1;for(var a=0;a<e.length;a++){while(t.overlapsOppositeAxis(i,e[a])||t.within(i)&&t.overlapsAny(s)){t.move(e[a])}if(t.within(i)){return t}var h=t.intersectPercentage(i);if(o>h){n=new Qt(t);o=h}t=new Qt(r)}return n||r}var r=new Qt(e),o=e.cue,a=Wt(o),h=[];if(o.snapToLines){var c;switch(o.vertical){case"":h=["+y","-y"];c="height";break;case"rl":h=["+x","-x"];c="width";break;case"lr":h=["-x","+x"];c="width";break}var l=r.lineHeight,u=l*Math.round(a),f=i[c]+l,d=h[0];if(Math.abs(u)>f){u=u<0?-1:1;u*=Math.ceil(f/l)*l}if(a<0){u+=o.vertical===""?i.height:i.width;h=h.reverse()}r.move(d,u)}else{var p=r.lineHeight/i.height*100;switch(o.lineAlign){case"center":a-=p/2;break;case"end":a-=p;break}switch(o.vertical){case"":e.applyStyles({top:e.formatStyle(a,"%")});break;case"rl":e.applyStyles({left:e.formatStyle(a,"%")});break;case"lr":e.applyStyles({right:e.formatStyle(a,"%")});break}h=["+y","-x","+x","-y"];r=new Qt(e)}var v=n(r,h);e.move(v.toCSSCompatValues(i))}function te(){}te.StringDecoder=function(){return{decode:function(t){if(!t){return""}if(typeof t!=="string"){throw new Error("Error - expected string data.")}return decodeURIComponent(encodeURIComponent(t))}}};te.convertCueToDOMTree=function(t,e){if(!t||!e){return null}return Ht(t,e)};var ee=.05;var ie="sans-serif";var se="1.5%";te.processCues=function(t,e,i){if(!t||!e||!i){return null}while(i.firstChild){i.removeChild(i.firstChild)}var s=t.document.createElement("div");s.style.position="absolute";s.style.left="0";s.style.right="0";s.style.top="0";s.style.bottom="0";s.style.margin=se;i.appendChild(s);function n(t){for(var e=0;e<t.length;e++){if(t[e].hasBeenReset||!t[e].displayState){return true}}return false}if(!n(e)){for(var r=0;r<e.length;r++){s.appendChild(e[r].displayState)}return}var o=[],a=Qt.getSimpleBoxPosition(s),h=Math.round(a.height*ee*100)/100;var c={font:h+"px "+ie};(function(){var i,n;for(var r=0;r<e.length;r++){n=e[r];i=new Kt(t,n,c);s.appendChild(i.div);Zt(t,i,a,o);n.displayState=i.div;o.push(Qt.getSimpleBoxPosition(i))}})()};te.Parser=function(t,e,i){if(!i){i=e;e={}}if(!e){e={}}this.window=t;this.vttjs=e;this.state="INITIAL";this.buffer="";this.decoder=i||new TextDecoder("utf8");this.regionList=[]};te.Parser.prototype={reportOrThrowError:function(t){if(t instanceof Rt){this.onparsingerror&&this.onparsingerror(t)}else{throw t}},parse:function(t){var e=this;if(t){e.buffer+=e.decoder.decode(t,{stream:true})}function i(){var t=e.buffer;var i=0;while(i<t.length&&t[i]!=="\r"&&t[i]!=="\n"){++i}var s=t.substr(0,i);if(t[i]==="\r"){++i}if(t[i]==="\n"){++i}e.buffer=t.substr(i);return s}function s(t){var i=new Pt;$t(t,(function(t,e){switch(t){case"id":i.set(t,e);break;case"width":i.percent(t,e);break;case"lines":i.integer(t,e);break;case"regionanchor":case"viewportanchor":var s=e.split(",");if(s.length!==2){break}var n=new Pt;n.percent("x",s[0]);n.percent("y",s[1]);if(!n.has("x")||!n.has("y")){break}i.set(t+"X",n.get("x"));i.set(t+"Y",n.get("y"));break;case"scroll":i.alt(t,e,["up"]);break}}),/=/,/\s/);if(i.has("id")){var s=new(e.vttjs.VTTRegion||e.window.VTTRegion);s.width=i.get("width",100);s.lines=i.get("lines",3);s.regionAnchorX=i.get("regionanchorX",0);s.regionAnchorY=i.get("regionanchorY",100);s.viewportAnchorX=i.get("viewportanchorX",0);s.viewportAnchorY=i.get("viewportanchorY",100);s.scroll=i.get("scroll","");e.onregion&&e.onregion(s);e.regionList.push({id:i.get("id"),region:s})}}function n(t){var i=new Pt;$t(t,(function(t,e){switch(t){case"MPEGT":i.integer(t+"S",e);break;case"LOCA":i.set(t+"L",Lt(e));break}}),/[^\d]:/,/,/);e.ontimestampmap&&e.ontimestampmap({MPEGTS:i.get("MPEGTS"),LOCAL:i.get("LOCAL")})}function r(t){if(t.match(/X-TIMESTAMP-MAP/)){$t(t,(function(t,e){switch(t){case"X-TIMESTAMP-MAP":n(e);break}}),/=/)}else{$t(t,(function(t,e){switch(t){case"Region":s(e);break}}),/:/)}}try{var o;if(e.state==="INITIAL"){if(!/\r\n|\n/.test(e.buffer)){return this}o=i();var a=o.match(/^WEBVTT([ \t].*)?$/);if(!a||!a[0]){throw new Rt(Rt.Errors.BadSignature)}e.state="HEADER"}var h=false;while(e.buffer){if(!/\r\n|\n/.test(e.buffer)){return this}if(!h){o=i()}else{h=false}switch(e.state){case"HEADER":if(/:/.test(o)){r(o)}else if(!o){e.state="ID"}continue;case"NOTE":if(!o){e.state="ID"}continue;case"ID":if(/^NOTE($|[ \t])/.test(o)){e.state="NOTE";break}if(!o){continue}e.cue=new(e.vttjs.VTTCue||e.window.VTTCue)(0,0,"");try{e.cue.align="center"}catch(t){e.cue.align="middle"}e.state="CUE";if(o.indexOf("--\x3e")===-1){e.cue.id=o;continue}case"CUE":try{Ft(o,e.cue,e.regionList)}catch(t){e.reportOrThrowError(t);e.cue=null;e.state="BADCUE";continue}e.state="CUETEXT";continue;case"CUETEXT":var c=o.indexOf("--\x3e")!==-1;if(!o||c&&(h=true)){e.oncue&&e.oncue(e.cue);e.cue=null;e.state="ID";continue}if(e.cue.text){e.cue.text+="\n"}e.cue.text+=o.replace(/\u2028/g,"\n").replace(/u2029/g,"\n");continue;case"BADCUE":if(!o){e.state="ID"}continue}}}catch(t){e.reportOrThrowError(t);if(e.state==="CUETEXT"&&e.cue&&e.oncue){e.oncue(e.cue)}e.cue=null;e.state=e.state==="INITIAL"?"BADWEBVTT":"BADCUE"}return this},flush:function(){var t=this;try{t.buffer+=t.decoder.decode();if(t.cue||t.state==="HEADER"){t.buffer+="\n\n";t.parse()}if(t.state==="INITIAL"){throw new Rt(Rt.Errors.BadSignature)}}catch(e){t.reportOrThrowError(e)}t.onflush&&t.onflush();return this}};var ne=te;var re="auto";var oe={"":1,lr:1,rl:1};var ae={start:1,center:1,end:1,left:1,right:1,auto:1,"line-left":1,"line-right":1};function he(t){if(typeof t!=="string"){return false}var e=oe[t.toLowerCase()];return e?t.toLowerCase():false}function ce(t){if(typeof t!=="string"){return false}var e=ae[t.toLowerCase()];return e?t.toLowerCase():false}function le(t,e,i){this.hasBeenReset=false;var s="";var n=false;var r=t;var o=e;var a=i;var h=null;var c="";var l=true;var u="auto";var f="start";var d="auto";var p="auto";var v=100;var m="center";Object.defineProperties(this,{id:{enumerable:true,get:function(){return s},set:function(t){s=""+t}},pauseOnExit:{enumerable:true,get:function(){return n},set:function(t){n=!!t}},startTime:{enumerable:true,get:function(){return r},set:function(t){if(typeof t!=="number"){throw new TypeError("Start time must be set to a number.")}r=t;this.hasBeenReset=true}},endTime:{enumerable:true,get:function(){return o},set:function(t){if(typeof t!=="number"){throw new TypeError("End time must be set to a number.")}o=t;this.hasBeenReset=true}},text:{enumerable:true,get:function(){return a},set:function(t){a=""+t;this.hasBeenReset=true}},region:{enumerable:true,get:function(){return h},set:function(t){h=t;this.hasBeenReset=true}},vertical:{enumerable:true,get:function(){return c},set:function(t){var e=he(t);if(e===false){throw new SyntaxError("Vertical: an invalid or illegal direction string was specified.")}c=e;this.hasBeenReset=true}},snapToLines:{enumerable:true,get:function(){return l},set:function(t){l=!!t;this.hasBeenReset=true}},line:{enumerable:true,get:function(){return u},set:function(t){if(typeof t!=="number"&&t!==re){throw new SyntaxError("Line: an invalid number or illegal string was specified.")}u=t;this.hasBeenReset=true}},lineAlign:{enumerable:true,get:function(){return f},set:function(t){var e=ce(t);if(!e){console.warn("lineAlign: an invalid or illegal string was specified.")}else{f=e;this.hasBeenReset=true}}},position:{enumerable:true,get:function(){return d},set:function(t){if(t<0||t>100){throw new Error("Position must be between 0 and 100.")}d=t;this.hasBeenReset=true}},positionAlign:{enumerable:true,get:function(){return p},set:function(t){var e=ce(t);if(!e){console.warn("positionAlign: an invalid or illegal string was specified.")}else{p=e;this.hasBeenReset=true}}},size:{enumerable:true,get:function(){return v},set:function(t){if(t<0||t>100){throw new Error("Size must be between 0 and 100.")}v=t;this.hasBeenReset=true}},align:{enumerable:true,get:function(){return m},set:function(t){var e=ce(t);if(!e){throw new SyntaxError("align: an invalid or illegal alignment string was specified.")}m=e;this.hasBeenReset=true}}});this.displayState=undefined}le.prototype.getCueAsHTML=function(){return WebVTT.convertCueToDOMTree(window,this.text)};var ue=le;var fe={"":true,up:true};function de(t){if(typeof t!=="string"){return false}var e=fe[t.toLowerCase()];return e?t.toLowerCase():false}function pe(t){return typeof t==="number"&&(t>=0&&t<=100)}function ve(){var t=100;var e=3;var i=0;var s=100;var n=0;var r=100;var o="";Object.defineProperties(this,{width:{enumerable:true,get:function(){return t},set:function(e){if(!pe(e)){throw new Error("Width must be between 0 and 100.")}t=e}},lines:{enumerable:true,get:function(){return e},set:function(t){if(typeof t!=="number"){throw new TypeError("Lines must be set to a number.")}e=t}},regionAnchorY:{enumerable:true,get:function(){return s},set:function(t){if(!pe(t)){throw new Error("RegionAnchorX must be between 0 and 100.")}s=t}},regionAnchorX:{enumerable:true,get:function(){return i},set:function(t){if(!pe(t)){throw new Error("RegionAnchorY must be between 0 and 100.")}i=t}},viewportAnchorY:{enumerable:true,get:function(){return r},set:function(t){if(!pe(t)){throw new Error("ViewportAnchorY must be between 0 and 100.")}r=t}},viewportAnchorX:{enumerable:true,get:function(){return n},set:function(t){if(!pe(t)){throw new Error("ViewportAnchorX must be between 0 and 100.")}n=t}},scroll:{enumerable:true,get:function(){return o},set:function(t){var e=de(t);if(e===false){console.warn("Scroll: an invalid or illegal string was specified.")}else{o=e}}}})}var me=ve;var ge=z;var be=_t.exports={WebVTT:ne,VTTCue:ue,VTTRegion:me};ge.vttjs=be;ge.WebVTT=be.WebVTT;var ye=be.VTTCue;var je=be.VTTRegion;var we=ge.VTTCue;var Te=ge.VTTRegion;be.shim=function(){ge.VTTCue=ye;ge.VTTRegion=je};be.restore=function(){ge.VTTCue=we;ge.VTTRegion=Te};if(!ge.VTTCue){be.shim()}const ke=_t.exports;var Se={exports:{}};(function(t,e){(function(e){var i=/^(?=((?:[a-zA-Z0-9+\-.]+:)?))\1(?=((?:\/\/[^\/?#]*)?))\2(?=((?:(?:[^?#\/]*\/)*[^;?#\/]*)?))\3((?:;[^?#]*)?)(\?[^#]*)?(#[^]*)?$/;var s=/^(?=([^\/?#]*))\1([^]*)$/;var n=/(?:\/|^)\.(?=\/)/g;var r=/(?:\/|^)\.\.\/(?!\.\.\/)[^\/]*(?=\/)/g;var o={buildAbsoluteURL:function(t,e,i){i=i||{};t=t.trim();e=e.trim();if(!e){if(!i.alwaysNormalize){return t}var n=o.parseURL(t);if(!n){throw new Error("Error trying to parse base URL.")}n.path=o.normalizePath(n.path);return o.buildURLFromParts(n)}var r=o.parseURL(e);if(!r){throw new Error("Error trying to parse relative URL.")}if(r.scheme){if(!i.alwaysNormalize){return e}r.path=o.normalizePath(r.path);return o.buildURLFromParts(r)}var a=o.parseURL(t);if(!a){throw new Error("Error trying to parse base URL.")}if(!a.netLoc&&a.path&&a.path[0]!=="/"){var h=s.exec(a.path);a.netLoc=h[1];a.path=h[2]}if(a.netLoc&&!a.path){a.path="/"}var c={scheme:a.scheme,netLoc:r.netLoc,path:null,params:r.params,query:r.query,fragment:r.fragment};if(!r.netLoc){c.netLoc=a.netLoc;if(r.path[0]!=="/"){if(!r.path){c.path=a.path;if(!r.params){c.params=a.params;if(!r.query){c.query=a.query}}}else{var l=a.path;var u=l.substring(0,l.lastIndexOf("/")+1)+r.path;c.path=o.normalizePath(u)}}}if(c.path===null){c.path=i.alwaysNormalize?o.normalizePath(r.path):r.path}return o.buildURLFromParts(c)},parseURL:function(t){var e=i.exec(t);if(!e){return null}return{scheme:e[1]||"",netLoc:e[2]||"",path:e[3]||"",params:e[4]||"",query:e[5]||"",fragment:e[6]||""}},normalizePath:function(t){t=t.split("").reverse().join("").replace(n,"");while(t.length!==(t=t.replace(r,"")).length){}return t.split("").reverse().join("")},buildURLFromParts:function(t){return t.scheme+t.netLoc+t.path+t.params+t.query+t.fragment}};t.exports=o})()})(Se);const xe=Se.exports;var Ae="http://example.com";var Ee=function t(e,i){if(/^[a-z]+:/i.test(i)){return i}if(/^data:/.test(e)){e=z.location&&z.location.href||""}var s=typeof z.URL==="function";var n=/^\/\//.test(e);var r=!z.location&&!/\/\//i.test(e);if(s){e=new z.URL(e,z.location||Ae)}else if(!/\/\//i.test(e)){e=xe.buildAbsoluteURL(z.location&&z.location.href||"",e)}if(s){var o=new URL(i,e);if(r){return o.href.slice(Ae.length)}else if(n){return o.href.slice(o.protocol.length)}return o.href}return xe.buildAbsoluteURL(e,i)};var Ie=function(){function t(){this.listeners={}}var e=t.prototype;e.on=function t(e,i){if(!this.listeners[e]){this.listeners[e]=[]}this.listeners[e].push(i)};e.off=function t(e,i){if(!this.listeners[e]){return false}var s=this.listeners[e].indexOf(i);this.listeners[e]=this.listeners[e].slice(0);this.listeners[e].splice(s,1);return s>-1};e.trigger=function t(e){var i=this.listeners[e];if(!i){return}if(arguments.length===2){var s=i.length;for(var n=0;n<s;++n){i[n].call(this,arguments[1])}}else{var r=Array.prototype.slice.call(arguments,1);var o=i.length;for(var a=0;a<o;++a){i[a].apply(this,r)}}};e.dispose=function t(){this.listeners={}};e.pipe=function t(e){this.on("data",(function(t){e.push(t)}))};return t}();var De=function t(e){return z.atob?z.atob(e):Buffer.from(e,"base64").toString("binary")};function Ce(t){var e=De(t);var i=new Uint8Array(e.length);for(var s=0;s<e.length;s++){i[s]=e.charCodeAt(s)}return i}
|
|
9
|
-
/*! @name m3u8-parser @version 7.2.0 @license Apache-2.0 */class Ne extends Ie{constructor(){super();this.buffer=""}push(t){let e;this.buffer+=t;e=this.buffer.indexOf("\n");for(;e>-1;e=this.buffer.indexOf("\n")){this.trigger("data",this.buffer.substring(0,e));this.buffer=this.buffer.substring(e+1)}}}const _e=String.fromCharCode(9);const Oe=function(t){const e=/([0-9.]*)?@?([0-9.]*)?/.exec(t||"");const i={};if(e[1]){i.length=parseInt(e[1],10)}if(e[2]){i.offset=parseInt(e[2],10)}return i};const Me=function(){const t="[^=]*";const e='"[^"]*"|[^,]*';const i="(?:"+t+")=(?:"+e+")";return new RegExp("(?:^|,)("+i+")")};const Re=function(t){const e={};if(!t){return e}const i=t.split(Me());let s=i.length;let n;while(s--){if(i[s]===""){continue}n=/([^=]*)=(.*)/.exec(i[s]).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");e[n[0]]=n[1]}return e};const Le=t=>{const e=t.split("x");const i={};if(e[0]){i.width=parseInt(e[0],10)}if(e[1]){i.height=parseInt(e[1],10)}return i};class Pe extends Ie{constructor(){super();this.customParsers=[];this.tagMappers=[]}push(t){let e;let i;t=t.trim();if(t.length===0){return}if(t[0]!=="#"){this.trigger("data",{type:"uri",uri:t});return}const s=this.tagMappers.reduce(((e,i)=>{const s=i(t);if(s===t){return e}return e.concat([s])}),[t]);s.forEach((t=>{for(let e=0;e<this.customParsers.length;e++){if(this.customParsers[e].call(this,t)){return}}if(t.indexOf("#EXT")!==0){this.trigger("data",{type:"comment",text:t.slice(1)});return}t=t.replace("\r","");e=/^#EXTM3U/.exec(t);if(e){this.trigger("data",{type:"tag",tagType:"m3u"});return}e=/^#EXTINF:([0-9\.]*)?,?(.*)?$/.exec(t);if(e){i={type:"tag",tagType:"inf"};if(e[1]){i.duration=parseFloat(e[1])}if(e[2]){i.title=e[2]}this.trigger("data",i);return}e=/^#EXT-X-TARGETDURATION:([0-9.]*)?/.exec(t);if(e){i={type:"tag",tagType:"targetduration"};if(e[1]){i.duration=parseInt(e[1],10)}this.trigger("data",i);return}e=/^#EXT-X-VERSION:([0-9.]*)?/.exec(t);if(e){i={type:"tag",tagType:"version"};if(e[1]){i.version=parseInt(e[1],10)}this.trigger("data",i);return}e=/^#EXT-X-MEDIA-SEQUENCE:(\-?[0-9.]*)?/.exec(t);if(e){i={type:"tag",tagType:"media-sequence"};if(e[1]){i.number=parseInt(e[1],10)}this.trigger("data",i);return}e=/^#EXT-X-DISCONTINUITY-SEQUENCE:(\-?[0-9.]*)?/.exec(t);if(e){i={type:"tag",tagType:"discontinuity-sequence"};if(e[1]){i.number=parseInt(e[1],10)}this.trigger("data",i);return}e=/^#EXT-X-PLAYLIST-TYPE:(.*)?$/.exec(t);if(e){i={type:"tag",tagType:"playlist-type"};if(e[1]){i.playlistType=e[1]}this.trigger("data",i);return}e=/^#EXT-X-BYTERANGE:(.*)?$/.exec(t);if(e){i=it(Oe(e[1]),{type:"tag",tagType:"byterange"});this.trigger("data",i);return}e=/^#EXT-X-ALLOW-CACHE:(YES|NO)?/.exec(t);if(e){i={type:"tag",tagType:"allow-cache"};if(e[1]){i.allowed=!/NO/.test(e[1])}this.trigger("data",i);return}e=/^#EXT-X-MAP:(.*)$/.exec(t);if(e){i={type:"tag",tagType:"map"};if(e[1]){const t=Re(e[1]);if(t.URI){i.uri=t.URI}if(t.BYTERANGE){i.byterange=Oe(t.BYTERANGE)}}this.trigger("data",i);return}e=/^#EXT-X-STREAM-INF:(.*)$/.exec(t);if(e){i={type:"tag",tagType:"stream-inf"};if(e[1]){i.attributes=Re(e[1]);if(i.attributes.RESOLUTION){i.attributes.RESOLUTION=Le(i.attributes.RESOLUTION)}if(i.attributes.BANDWIDTH){i.attributes.BANDWIDTH=parseInt(i.attributes.BANDWIDTH,10)}if(i.attributes["FRAME-RATE"]){i.attributes["FRAME-RATE"]=parseFloat(i.attributes["FRAME-RATE"])}if(i.attributes["PROGRAM-ID"]){i.attributes["PROGRAM-ID"]=parseInt(i.attributes["PROGRAM-ID"],10)}}this.trigger("data",i);return}e=/^#EXT-X-MEDIA:(.*)$/.exec(t);if(e){i={type:"tag",tagType:"media"};if(e[1]){i.attributes=Re(e[1])}this.trigger("data",i);return}e=/^#EXT-X-ENDLIST/.exec(t);if(e){this.trigger("data",{type:"tag",tagType:"endlist"});return}e=/^#EXT-X-DISCONTINUITY/.exec(t);if(e){this.trigger("data",{type:"tag",tagType:"discontinuity"});return}e=/^#EXT-X-PROGRAM-DATE-TIME:(.*)$/.exec(t);if(e){i={type:"tag",tagType:"program-date-time"};if(e[1]){i.dateTimeString=e[1];i.dateTimeObject=new Date(e[1])}this.trigger("data",i);return}e=/^#EXT-X-KEY:(.*)$/.exec(t);if(e){i={type:"tag",tagType:"key"};if(e[1]){i.attributes=Re(e[1]);if(i.attributes.IV){if(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}e=/^#EXT-X-START:(.*)$/.exec(t);if(e){i={type:"tag",tagType:"start"};if(e[1]){i.attributes=Re(e[1]);i.attributes["TIME-OFFSET"]=parseFloat(i.attributes["TIME-OFFSET"]);i.attributes.PRECISE=/YES/.test(i.attributes.PRECISE)}this.trigger("data",i);return}e=/^#EXT-X-CUE-OUT-CONT:(.*)?$/.exec(t);if(e){i={type:"tag",tagType:"cue-out-cont"};if(e[1]){i.data=e[1]}else{i.data=""}this.trigger("data",i);return}e=/^#EXT-X-CUE-OUT:(.*)?$/.exec(t);if(e){i={type:"tag",tagType:"cue-out"};if(e[1]){i.data=e[1]}else{i.data=""}this.trigger("data",i);return}e=/^#EXT-X-CUE-IN:?(.*)?$/.exec(t);if(e){i={type:"tag",tagType:"cue-in"};if(e[1]){i.data=e[1]}else{i.data=""}this.trigger("data",i);return}e=/^#EXT-X-SKIP:(.*)$/.exec(t);if(e&&e[1]){i={type:"tag",tagType:"skip"};i.attributes=Re(e[1]);if(i.attributes.hasOwnProperty("SKIPPED-SEGMENTS")){i.attributes["SKIPPED-SEGMENTS"]=parseInt(i.attributes["SKIPPED-SEGMENTS"],10)}if(i.attributes.hasOwnProperty("RECENTLY-REMOVED-DATERANGES")){i.attributes["RECENTLY-REMOVED-DATERANGES"]=i.attributes["RECENTLY-REMOVED-DATERANGES"].split(_e)}this.trigger("data",i);return}e=/^#EXT-X-PART:(.*)$/.exec(t);if(e&&e[1]){i={type:"tag",tagType:"part"};i.attributes=Re(e[1]);["DURATION"].forEach((function(t){if(i.attributes.hasOwnProperty(t)){i.attributes[t]=parseFloat(i.attributes[t])}}));["INDEPENDENT","GAP"].forEach((function(t){if(i.attributes.hasOwnProperty(t)){i.attributes[t]=/YES/.test(i.attributes[t])}}));if(i.attributes.hasOwnProperty("BYTERANGE")){i.attributes.byterange=Oe(i.attributes.BYTERANGE)}this.trigger("data",i);return}e=/^#EXT-X-SERVER-CONTROL:(.*)$/.exec(t);if(e&&e[1]){i={type:"tag",tagType:"server-control"};i.attributes=Re(e[1]);["CAN-SKIP-UNTIL","PART-HOLD-BACK","HOLD-BACK"].forEach((function(t){if(i.attributes.hasOwnProperty(t)){i.attributes[t]=parseFloat(i.attributes[t])}}));["CAN-SKIP-DATERANGES","CAN-BLOCK-RELOAD"].forEach((function(t){if(i.attributes.hasOwnProperty(t)){i.attributes[t]=/YES/.test(i.attributes[t])}}));this.trigger("data",i);return}e=/^#EXT-X-PART-INF:(.*)$/.exec(t);if(e&&e[1]){i={type:"tag",tagType:"part-inf"};i.attributes=Re(e[1]);["PART-TARGET"].forEach((function(t){if(i.attributes.hasOwnProperty(t)){i.attributes[t]=parseFloat(i.attributes[t])}}));this.trigger("data",i);return}e=/^#EXT-X-PRELOAD-HINT:(.*)$/.exec(t);if(e&&e[1]){i={type:"tag",tagType:"preload-hint"};i.attributes=Re(e[1]);["BYTERANGE-START","BYTERANGE-LENGTH"].forEach((function(t){if(i.attributes.hasOwnProperty(t)){i.attributes[t]=parseInt(i.attributes[t],10);const e=t==="BYTERANGE-LENGTH"?"length":"offset";i.attributes.byterange=i.attributes.byterange||{};i.attributes.byterange[e]=i.attributes[t];delete i.attributes[t]}}));this.trigger("data",i);return}e=/^#EXT-X-RENDITION-REPORT:(.*)$/.exec(t);if(e&&e[1]){i={type:"tag",tagType:"rendition-report"};i.attributes=Re(e[1]);["LAST-MSN","LAST-PART"].forEach((function(t){if(i.attributes.hasOwnProperty(t)){i.attributes[t]=parseInt(i.attributes[t],10)}}));this.trigger("data",i);return}e=/^#EXT-X-DATERANGE:(.*)$/.exec(t);if(e&&e[1]){i={type:"tag",tagType:"daterange"};i.attributes=Re(e[1]);["ID","CLASS"].forEach((function(t){if(i.attributes.hasOwnProperty(t)){i.attributes[t]=String(i.attributes[t])}}));["START-DATE","END-DATE"].forEach((function(t){if(i.attributes.hasOwnProperty(t)){i.attributes[t]=new Date(i.attributes[t])}}));["DURATION","PLANNED-DURATION"].forEach((function(t){if(i.attributes.hasOwnProperty(t)){i.attributes[t]=parseFloat(i.attributes[t])}}));["END-ON-NEXT"].forEach((function(t){if(i.attributes.hasOwnProperty(t)){i.attributes[t]=/YES/i.test(i.attributes[t])}}));["SCTE35-CMD"," SCTE35-OUT","SCTE35-IN"].forEach((function(t){if(i.attributes.hasOwnProperty(t)){i.attributes[t]=i.attributes[t].toString(16)}}));const t=/^X-([A-Z]+-)+[A-Z]+$/;for(const e in i.attributes){if(!t.test(e)){continue}const s=/[0-9A-Fa-f]{6}/g.test(i.attributes[e]);const n=/^\d+(\.\d+)?$/.test(i.attributes[e]);i.attributes[e]=s?i.attributes[e].toString(16):n?parseFloat(i.attributes[e]):String(i.attributes[e])}this.trigger("data",i);return}e=/^#EXT-X-INDEPENDENT-SEGMENTS/.exec(t);if(e){this.trigger("data",{type:"tag",tagType:"independent-segments"});return}e=/^#EXT-X-I-FRAMES-ONLY/.exec(t);if(e){this.trigger("data",{type:"tag",tagType:"i-frames-only"});return}e=/^#EXT-X-CONTENT-STEERING:(.*)$/.exec(t);if(e){i={type:"tag",tagType:"content-steering"};i.attributes=Re(e[1]);this.trigger("data",i);return}e=/^#EXT-X-I-FRAME-STREAM-INF:(.*)$/.exec(t);if(e){i={type:"tag",tagType:"i-frame-playlist"};i.attributes=Re(e[1]);if(i.attributes.URI){i.uri=i.attributes.URI}if(i.attributes.BANDWIDTH){i.attributes.BANDWIDTH=parseInt(i.attributes.BANDWIDTH,10)}if(i.attributes.RESOLUTION){i.attributes.RESOLUTION=Le(i.attributes.RESOLUTION)}if(i.attributes["AVERAGE-BANDWIDTH"]){i.attributes["AVERAGE-BANDWIDTH"]=parseInt(i.attributes["AVERAGE-BANDWIDTH"],10)}if(i.attributes["FRAME-RATE"]){i.attributes["FRAME-RATE"]=parseFloat(i.attributes["FRAME-RATE"])}this.trigger("data",i);return}e=/^#EXT-X-DEFINE:(.*)$/.exec(t);if(e){i={type:"tag",tagType:"define"};i.attributes=Re(e[1]);this.trigger("data",i);return}this.trigger("data",{type:"tag",data:t.slice(4)})}))}addParser({expression:t,customType:e,dataParser:i,segment:s}){if(typeof i!=="function"){i=t=>t}this.customParsers.push((n=>{const r=t.exec(n);if(r){this.trigger("data",{type:"custom",data:i(n),customType:e,segment:s});return true}}))}addTagMapper({expression:t,map:e}){const i=i=>{if(t.test(i)){return e(i)}return i};this.tagMappers.push(i)}}const $e=t=>t.toLowerCase().replace(/-(\w)/g,(t=>t[1].toUpperCase()));const Fe=function(t){const e={};Object.keys(t).forEach((function(i){e[$e(i)]=t[i]}));return e};const Ue=function(t){const{serverControl:e,targetDuration:i,partTargetDuration:s}=t;if(!e){return}const n="#EXT-X-SERVER-CONTROL";const r="holdBack";const o="partHoldBack";const a=i&&i*3;const h=s&&s*2;if(i&&!e.hasOwnProperty(r)){e[r]=a;this.trigger("info",{message:`${n} defaulting HOLD-BACK to targetDuration * 3 (${a}).`})}if(a&&e[r]<a){this.trigger("warn",{message:`${n} clamping HOLD-BACK (${e[r]}) to targetDuration * 3 (${a})`});e[r]=a}if(s&&!e.hasOwnProperty(o)){e[o]=s*3;this.trigger("info",{message:`${n} defaulting PART-HOLD-BACK to partTargetDuration * 3 (${e[o]}).`})}if(s&&e[o]<h){this.trigger("warn",{message:`${n} clamping PART-HOLD-BACK (${e[o]}) to partTargetDuration * 2 (${h}).`});e[o]=h}};class Be extends Ie{constructor(t={}){super();this.lineStream=new Ne;this.parseStream=new Pe;this.lineStream.pipe(this.parseStream);this.mainDefinitions=t.mainDefinitions||{};this.params=new URL(t.uri,"https://a.com").searchParams;this.lastProgramDateTime=null;const e=this;const i=[];let s={};let n;let r;let o=false;const a=function(){};const h={AUDIO:{},VIDEO:{},"CLOSED-CAPTIONS":{},SUBTITLES:{}};const c="urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed";let l=0;this.manifest={allowCache:true,discontinuityStarts:[],dateRanges:[],iFramePlaylists:[],segments:[]};let u=0;let f=0;const d={};this.on("end",(()=>{if(s.uri||!s.parts&&!s.preloadHints){return}if(!s.map&&n){s.map=n}if(!s.key&&r){s.key=r}if(!s.timeline&&typeof l==="number"){s.timeline=l}this.manifest.preloadSegment=s}));this.parseStream.on("data",(function(t){let p;let v;if(e.manifest.definitions){for(const i in e.manifest.definitions){if(t.uri){t.uri=t.uri.replace(`{$${i}}`,e.manifest.definitions[i])}if(t.attributes){for(const s in t.attributes){if(typeof t.attributes[s]==="string"){t.attributes[s]=t.attributes[s].replace(`{$${i}}`,e.manifest.definitions[i])}}}}}({tag(){({version(){if(t.version){this.manifest.version=t.version}},"allow-cache"(){this.manifest.allowCache=t.allowed;if(!("allowed"in t)){this.trigger("info",{message:"defaulting allowCache to YES"});this.manifest.allowCache=true}},byterange(){const e={};if("length"in t){s.byterange=e;e.length=t.length;if(!("offset"in t)){t.offset=u}}if("offset"in t){s.byterange=e;e.offset=t.offset}u=e.offset+e.length},endlist(){this.manifest.endList=true},inf(){if(!("mediaSequence"in this.manifest)){this.manifest.mediaSequence=0;this.trigger("info",{message:"defaulting media sequence to zero"})}if(!("discontinuitySequence"in this.manifest)){this.manifest.discontinuitySequence=0;this.trigger("info",{message:"defaulting discontinuity sequence to zero"})}if(t.title){s.title=t.title}if(t.duration>0){s.duration=t.duration}if(t.duration===0){s.duration=.01;this.trigger("info",{message:"updating zero segment duration to a small value"})}this.manifest.segments=i},key(){if(!t.attributes){this.trigger("warn",{message:"ignoring key declaration without attribute list"});return}if(t.attributes.METHOD==="NONE"){r=null;return}if(!t.attributes.URI){this.trigger("warn",{message:"ignoring key declaration without URI"});return}if(t.attributes.KEYFORMAT==="com.apple.streamingkeydelivery"){this.manifest.contentProtection=this.manifest.contentProtection||{};this.manifest.contentProtection["com.apple.fps.1_0"]={attributes:t.attributes};return}if(t.attributes.KEYFORMAT==="com.microsoft.playready"){this.manifest.contentProtection=this.manifest.contentProtection||{};this.manifest.contentProtection["com.microsoft.playready"]={uri:t.attributes.URI};return}if(t.attributes.KEYFORMAT===c){const e=["SAMPLE-AES","SAMPLE-AES-CTR","SAMPLE-AES-CENC"];if(e.indexOf(t.attributes.METHOD)===-1){this.trigger("warn",{message:"invalid key method provided for Widevine"});return}if(t.attributes.METHOD==="SAMPLE-AES-CENC"){this.trigger("warn",{message:"SAMPLE-AES-CENC is deprecated, please use SAMPLE-AES-CTR instead"})}if(t.attributes.URI.substring(0,23)!=="data:text/plain;base64,"){this.trigger("warn",{message:"invalid key URI provided for Widevine"});return}if(!(t.attributes.KEYID&&t.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:t.attributes.KEYFORMAT,keyId:t.attributes.KEYID.substring(2)},pssh:Ce(t.attributes.URI.split(",")[1])};return}if(!t.attributes.METHOD){this.trigger("warn",{message:"defaulting key method to AES-128"})}r={method:t.attributes.METHOD||"AES-128",uri:t.attributes.URI};if(typeof t.attributes.IV!=="undefined"){r.iv=t.attributes.IV}},"media-sequence"(){if(!isFinite(t.number)){this.trigger("warn",{message:"ignoring invalid media sequence: "+t.number});return}this.manifest.mediaSequence=t.number},"discontinuity-sequence"(){if(!isFinite(t.number)){this.trigger("warn",{message:"ignoring invalid discontinuity sequence: "+t.number});return}this.manifest.discontinuitySequence=t.number;l=t.number},"playlist-type"(){if(!/VOD|EVENT/.test(t.playlistType)){this.trigger("warn",{message:"ignoring unknown playlist type: "+t.playlist});return}this.manifest.playlistType=t.playlistType},map(){n={};if(t.uri){n.uri=t.uri}if(t.byterange){n.byterange=t.byterange}if(r){n.key=r}},"stream-inf"(){this.manifest.playlists=i;this.manifest.mediaGroups=this.manifest.mediaGroups||h;if(!t.attributes){this.trigger("warn",{message:"ignoring empty stream-inf attributes"});return}if(!s.attributes){s.attributes={}}it(s.attributes,t.attributes)},media(){this.manifest.mediaGroups=this.manifest.mediaGroups||h;if(!(t.attributes&&t.attributes.TYPE&&t.attributes["GROUP-ID"]&&t.attributes.NAME)){this.trigger("warn",{message:"ignoring incomplete or missing media group"});return}const e=this.manifest.mediaGroups[t.attributes.TYPE];e[t.attributes["GROUP-ID"]]=e[t.attributes["GROUP-ID"]]||{};p=e[t.attributes["GROUP-ID"]];v={default:/yes/i.test(t.attributes.DEFAULT)};if(v.default){v.autoselect=true}else{v.autoselect=/yes/i.test(t.attributes.AUTOSELECT)}if(t.attributes.LANGUAGE){v.language=t.attributes.LANGUAGE}if(t.attributes.URI){v.uri=t.attributes.URI}if(t.attributes["INSTREAM-ID"]){v.instreamId=t.attributes["INSTREAM-ID"]}if(t.attributes.CHARACTERISTICS){v.characteristics=t.attributes.CHARACTERISTICS}if(t.attributes.FORCED){v.forced=/yes/i.test(t.attributes.FORCED)}p[t.attributes.NAME]=v},discontinuity(){l+=1;s.discontinuity=true;this.manifest.discontinuityStarts.push(i.length)},"program-date-time"(){if(typeof this.manifest.dateTimeString==="undefined"){this.manifest.dateTimeString=t.dateTimeString;this.manifest.dateTimeObject=t.dateTimeObject}s.dateTimeString=t.dateTimeString;s.dateTimeObject=t.dateTimeObject;const{lastProgramDateTime:e}=this;this.lastProgramDateTime=new Date(t.dateTimeString).getTime();if(e===null){this.manifest.segments.reduceRight(((t,e)=>{e.programDateTime=t-e.duration*1e3;return e.programDateTime}),this.lastProgramDateTime)}},targetduration(){if(!isFinite(t.duration)||t.duration<0){this.trigger("warn",{message:"ignoring invalid target duration: "+t.duration});return}this.manifest.targetDuration=t.duration;Ue.call(this,this.manifest)},start(){if(!t.attributes||isNaN(t.attributes["TIME-OFFSET"])){this.trigger("warn",{message:"ignoring start declaration without appropriate attribute list"});return}this.manifest.start={timeOffset:t.attributes["TIME-OFFSET"],precise:t.attributes.PRECISE}},"cue-out"(){s.cueOut=t.data},"cue-out-cont"(){s.cueOutCont=t.data},"cue-in"(){s.cueIn=t.data},skip(){this.manifest.skip=Fe(t.attributes);this.warnOnMissingAttributes_("#EXT-X-SKIP",t.attributes,["SKIPPED-SEGMENTS"])},part(){o=true;const e=this.manifest.segments.length;const i=Fe(t.attributes);s.parts=s.parts||[];s.parts.push(i);if(i.byterange){if(!i.byterange.hasOwnProperty("offset")){i.byterange.offset=f}f=i.byterange.offset+i.byterange.length}const n=s.parts.length-1;this.warnOnMissingAttributes_(`#EXT-X-PART #${n} for segment #${e}`,t.attributes,["URI","DURATION"]);if(this.manifest.renditionReports){this.manifest.renditionReports.forEach(((t,e)=>{if(!t.hasOwnProperty("lastPart")){this.trigger("warn",{message:`#EXT-X-RENDITION-REPORT #${e} lacks required attribute(s): LAST-PART`})}}))}},"server-control"(){const e=this.manifest.serverControl=Fe(t.attributes);if(!e.hasOwnProperty("canBlockReload")){e.canBlockReload=false;this.trigger("info",{message:"#EXT-X-SERVER-CONTROL defaulting CAN-BLOCK-RELOAD to false"})}Ue.call(this,this.manifest);if(e.canSkipDateranges&&!e.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 e=this.manifest.segments.length;const i=Fe(t.attributes);const n=i.type&&i.type==="PART";s.preloadHints=s.preloadHints||[];s.preloadHints.push(i);if(i.byterange){if(!i.byterange.hasOwnProperty("offset")){i.byterange.offset=n?f:0;if(n){f=i.byterange.offset+i.byterange.length}}}const r=s.preloadHints.length-1;this.warnOnMissingAttributes_(`#EXT-X-PRELOAD-HINT #${r} for segment #${e}`,t.attributes,["TYPE","URI"]);if(!i.type){return}for(let t=0;t<s.preloadHints.length-1;t++){const n=s.preloadHints[t];if(!n.type){continue}if(n.type===i.type){this.trigger("warn",{message:`#EXT-X-PRELOAD-HINT #${r} for segment #${e} has the same TYPE ${i.type} as preload hint #${t}`})}}},"rendition-report"(){const e=Fe(t.attributes);this.manifest.renditionReports=this.manifest.renditionReports||[];this.manifest.renditionReports.push(e);const i=this.manifest.renditionReports.length-1;const s=["LAST-MSN","URI"];if(o){s.push("LAST-PART")}this.warnOnMissingAttributes_(`#EXT-X-RENDITION-REPORT #${i}`,t.attributes,s)},"part-inf"(){this.manifest.partInf=Fe(t.attributes);this.warnOnMissingAttributes_("#EXT-X-PART-INF",t.attributes,["PART-TARGET"]);if(this.manifest.partInf.partTarget){this.manifest.partTargetDuration=this.manifest.partInf.partTarget}Ue.call(this,this.manifest)},daterange(){this.manifest.dateRanges.push(Fe(t.attributes));const e=this.manifest.dateRanges.length-1;this.warnOnMissingAttributes_(`#EXT-X-DATERANGE #${e}`,t.attributes,["ID","START-DATE"]);const i=this.manifest.dateRanges[e];if(i.endDate&&i.startDate&&new Date(i.endDate)<new Date(i.startDate)){this.trigger("warn",{message:"EXT-X-DATERANGE END-DATE must be equal to or later than the value of the START-DATE"})}if(i.duration&&i.duration<0){this.trigger("warn",{message:"EXT-X-DATERANGE DURATION must not be negative"})}if(i.plannedDuration&&i.plannedDuration<0){this.trigger("warn",{message:"EXT-X-DATERANGE PLANNED-DURATION must not be negative"})}const s=!!i.endOnNext;if(s&&!i.class){this.trigger("warn",{message:"EXT-X-DATERANGE with an END-ON-NEXT=YES attribute must have a CLASS attribute"})}if(s&&(i.duration||i.endDate)){this.trigger("warn",{message:"EXT-X-DATERANGE with an END-ON-NEXT=YES attribute must not contain DURATION or END-DATE attributes"})}if(i.duration&&i.endDate){const t=i.startDate;const s=t.getTime()+i.duration*1e3;this.manifest.dateRanges[e].endDate=new Date(s)}if(!d[i.id]){d[i.id]=i}else{for(const t in d[i.id]){if(!!i[t]&&JSON.stringify(d[i.id][t])!==JSON.stringify(i[t])){this.trigger("warn",{message:"EXT-X-DATERANGE tags with the same ID in a playlist must have the same attributes values"});break}}const t=this.manifest.dateRanges.findIndex((t=>t.id===i.id));this.manifest.dateRanges[t]=it(this.manifest.dateRanges[t],i);d[i.id]=it(d[i.id],i);this.manifest.dateRanges.pop()}},"independent-segments"(){this.manifest.independentSegments=true},"i-frames-only"(){this.manifest.iFramesOnly=true;this.requiredCompatibilityversion(this.manifest.version,4)},"content-steering"(){this.manifest.contentSteering=Fe(t.attributes);this.warnOnMissingAttributes_("#EXT-X-CONTENT-STEERING",t.attributes,["SERVER-URI"])},define(){this.manifest.definitions=this.manifest.definitions||{};const e=(t,e)=>{if(t in this.manifest.definitions){this.trigger("error",{message:`EXT-X-DEFINE: Duplicate name ${t}`});return}this.manifest.definitions[t]=e};if("QUERYPARAM"in t.attributes){if("NAME"in t.attributes||"IMPORT"in t.attributes){this.trigger("error",{message:"EXT-X-DEFINE: Invalid attributes"});return}const i=this.params.get(t.attributes.QUERYPARAM);if(!i){this.trigger("error",{message:`EXT-X-DEFINE: No query param ${t.attributes.QUERYPARAM}`});return}e(t.attributes.QUERYPARAM,decodeURIComponent(i));return}if("NAME"in t.attributes){if("IMPORT"in t.attributes){this.trigger("error",{message:"EXT-X-DEFINE: Invalid attributes"});return}if(!("VALUE"in t.attributes)||typeof t.attributes.VALUE!=="string"){this.trigger("error",{message:`EXT-X-DEFINE: No value for ${t.attributes.NAME}`});return}e(t.attributes.NAME,t.attributes.VALUE);return}if("IMPORT"in t.attributes){if(!this.mainDefinitions[t.attributes.IMPORT]){this.trigger("error",{message:`EXT-X-DEFINE: No value ${t.attributes.IMPORT} to import, or IMPORT used on main playlist`});return}e(t.attributes.IMPORT,this.mainDefinitions[t.attributes.IMPORT]);return}this.trigger("error",{message:"EXT-X-DEFINE: No attribute"})},"i-frame-playlist"(){this.manifest.iFramePlaylists.push({attributes:t.attributes,uri:t.uri,timeline:l});this.warnOnMissingAttributes_("#EXT-X-I-FRAME-STREAM-INF",t.attributes,["BANDWIDTH","URI"])}}[t.tagType]||a).call(e)},uri(){s.uri=t.uri;i.push(s);if(this.manifest.targetDuration&&!("duration"in s)){this.trigger("warn",{message:"defaulting segment duration to the target duration"});s.duration=this.manifest.targetDuration}if(r){s.key=r}s.timeline=l;if(n){s.map=n}f=0;if(this.lastProgramDateTime!==null){s.programDateTime=this.lastProgramDateTime;this.lastProgramDateTime+=s.duration*1e3}s={}},comment(){},custom(){if(t.segment){s.custom=s.custom||{};s.custom[t.customType]=t.data}else{this.manifest.custom=this.manifest.custom||{};this.manifest.custom[t.customType]=t.data}}})[t.type].call(e)}))}requiredCompatibilityversion(t,e){if(t<e||!t){this.trigger("warn",{message:`manifest must be at least version ${e}`})}}warnOnMissingAttributes_(t,e,i){const s=[];i.forEach((function(t){if(!e.hasOwnProperty(t)){s.push(t)}}));if(s.length){this.trigger("warn",{message:`${t} lacks required attribute(s): ${s.join(", ")}`})}}push(t){this.lineStream.push(t)}end(){this.lineStream.push("\n");if(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(t){this.parseStream.addParser(t)}addTagMapper(t){this.parseStream.addTagMapper(t)}}var qe={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^/};var Ve=["video","audio","text"];var ze=["Video","Audio","Text"];var He=function t(e){if(!e){return e}return e.replace(/avc1\.(\d+)\.(\d+)/i,(function(t,e,i){var s=("00"+Number(e).toString(16)).slice(-2);var n=("00"+Number(i).toString(16)).slice(-2);return"avc1."+s+"00"+n}))};var Xe=function t(e){if(e===void 0){e=""}var i=e.split(",");var s=[];i.forEach((function(t){t=t.trim();var e;Ve.forEach((function(i){var n=qe[i].exec(t.toLowerCase());if(!n||n.length<=1){return}e=i;var r=t.substring(0,n[1].length);var o=t.replace(r,"");s.push({type:r,details:o,mediaType:i})}));if(!e){s.push({type:t,details:"",mediaType:"unknown"})}}));return s};var Ge=function t(e,i){if(!e.mediaGroups.AUDIO||!i){return null}var s=e.mediaGroups.AUDIO[i];if(!s){return null}for(var n in s){var r=s[n];if(r.default&&r.playlists){return Xe(r.playlists[0].attributes.CODECS)}}return null};var Ye=function t(e){if(e===void 0){e=""}return qe.audio.test(e.trim().toLowerCase())};var We=function t(e){if(e===void 0){e=""}return qe.text.test(e.trim().toLowerCase())};var Je=function t(e){if(!e||typeof e!=="string"){return}var i=e.toLowerCase().split(",").map((function(t){return He(t.trim())}));var s="video";if(i.length===1&&Ye(i[0])){s="audio"}else if(i.length===1&&We(i[0])){s="application"}var n="mp4";if(i.every((function(t){return qe.mp4.test(t)}))){n="mp4"}else if(i.every((function(t){return qe.webm.test(t)}))){n="webm"}else if(i.every((function(t){return qe.ogg.test(t)}))){n="ogg"}return s+"/"+n+';codecs="'+e+'"'};var Ke=function t(e){if(e===void 0){e=""}return z.MediaSource&&z.MediaSource.isTypeSupported&&z.MediaSource.isTypeSupported(Je(e))||false};var Qe=function t(e){if(e===void 0){e=""}return e.toLowerCase().split(",").every((function(t){t=t.trim();for(var e=0;e<ze.length;e++){var i=ze[e];if(qe["muxer"+i].test(t)){return true}}return false}))};var Ze="mp4a.40.2";var ti="avc1.4d400d";var ei=/^(audio|video|application)\/(x-|vnd\.apple\.)?mpegurl/i;var ii=/^application\/dash\+xml/i;var si=function t(e){if(ei.test(e)){return"hls"}if(ii.test(e)){return"dash"}if(e==="application/vnd.videojs.vhs+json"){return"vhs-json"}return null};var ni=function t(e){return e.toString(2).length};var ri=function t(e){return Math.ceil(ni(e)/8)};var oi=function t(e){if(ArrayBuffer.isView==="function"){return ArrayBuffer.isView(e)}return e&&e.buffer instanceof ArrayBuffer};var ai=function t(e){return oi(e)};var hi=function t(e){if(e instanceof Uint8Array){return e}if(!Array.isArray(e)&&!ai(e)&&!(e instanceof ArrayBuffer)){if(typeof e!=="number"||typeof e==="number"&&e!==e){e=0}else{e=[e]}}return new Uint8Array(e&&e.buffer||e,e&&e.byteOffset||0,e&&e.byteLength||0)};var ci=z.BigInt||Number;var li=[ci("0x1"),ci("0x100"),ci("0x10000"),ci("0x1000000"),ci("0x100000000"),ci("0x10000000000"),ci("0x1000000000000"),ci("0x100000000000000"),ci("0x10000000000000000")];var ui=function t(e,i){var s=i===void 0?{}:i,n=s.signed,r=n===void 0?false:n,o=s.le,a=o===void 0?false:o;e=hi(e);var h=a?"reduce":"reduceRight";var c=e[h]?e[h]:Array.prototype[h];var l=c.call(e,(function(t,i,s){var n=a?s:Math.abs(s+1-e.length);return t+ci(i)*li[n]}),ci(0));if(r){var u=li[e.length]/ci(2)-ci(1);l=ci(l);if(l>u){l-=u;l-=u;l-=ci(2)}}return Number(l)};var fi=function t(e,i){var s=i===void 0?{}:i,n=s.le,r=n===void 0?false:n;if(typeof e!=="bigint"&&typeof e!=="number"||typeof e==="number"&&e!==e){e=0}e=ci(e);var o=ri(e);var a=new Uint8Array(new ArrayBuffer(o));for(var h=0;h<o;h++){var c=r?h:Math.abs(h+1-a.length);a[c]=Number(e/li[h]&ci(255));if(e<0){a[c]=Math.abs(~a[c]);a[c]-=h===0?1:2}}return a};var di=function t(e,i){if(typeof e!=="string"&&e&&typeof e.toString==="function"){e=e.toString()}if(typeof e!=="string"){return new Uint8Array}if(!i){e=unescape(encodeURIComponent(e))}var s=new Uint8Array(e.length);for(var n=0;n<e.length;n++){s[n]=e.charCodeAt(n)}return s};var pi=function t(){for(var e=arguments.length,i=new Array(e),s=0;s<e;s++){i[s]=arguments[s]}i=i.filter((function(t){return t&&(t.byteLength||t.length)&&typeof t!=="string"}));if(i.length<=1){return hi(i[0])}var n=i.reduce((function(t,e,i){return t+(e.byteLength||e.length)}),0);var r=new Uint8Array(n);var o=0;i.forEach((function(t){t=hi(t);r.set(t,o);o+=t.byteLength}));return r};var vi=function t(e,i,s){var n=s===void 0?{}:s,r=n.offset,o=r===void 0?0:r,a=n.mask,h=a===void 0?[]:a;e=hi(e);i=hi(i);var c=i.every?i.every:Array.prototype.every;return i.length&&e.length-o>=i.length&&c.call(i,(function(t,i){var s=h[i]?h[i]&e[o+i]:e[o+i];return t===s}))};var mi=function t(e,i,s){i.forEach((function(t){for(var i in e.mediaGroups[t]){for(var n in e.mediaGroups[t][i]){var r=e.mediaGroups[t][i][n];s(r,t,i,n)}}}))};var gi=function t(e){return z.atob?z.atob(e):Buffer.from(e,"base64").toString("binary")};function bi(t){var e=gi(t);var i=new Uint8Array(e.length);for(var s=0;s<e.length;s++){i[s]=e.charCodeAt(s)}return i}var yi={};var ji={};function wi(t,e,i){if(i===undefined){i=Array.prototype}if(t&&typeof i.find==="function"){return i.find.call(t,e)}for(var s=0;s<t.length;s++){if(Object.prototype.hasOwnProperty.call(t,s)){var n=t[s];if(e.call(undefined,n,s,t)){return n}}}}function Ti(t,e){if(e===undefined){e=Object}return e&&typeof e.freeze==="function"?e.freeze(t):t}function ki(t,e){if(t===null||typeof t!=="object"){throw new TypeError("target is not an object")}for(var i in e){if(Object.prototype.hasOwnProperty.call(e,i)){t[i]=e[i]}}return t}var Si=Ti({HTML:"text/html",isHTML:function(t){return t===Si.HTML},XML_APPLICATION:"application/xml",XML_TEXT:"text/xml",XML_XHTML_APPLICATION:"application/xhtml+xml",XML_SVG_IMAGE:"image/svg+xml"});var xi=Ti({HTML:"http://www.w3.org/1999/xhtml",isHTML:function(t){return t===xi.HTML},SVG:"http://www.w3.org/2000/svg",XML:"http://www.w3.org/XML/1998/namespace",XMLNS:"http://www.w3.org/2000/xmlns/"});ji.assign=ki;ji.find=wi;ji.freeze=Ti;ji.MIME_TYPE=Si;ji.NAMESPACE=xi;var Ai=ji;var Ei=Ai.find;var Ii=Ai.NAMESPACE;function Di(t){return t!==""}function Ci(t){return t?t.split(/[\t\n\f\r ]+/).filter(Di):[]}function Ni(t,e){if(!t.hasOwnProperty(e)){t[e]=true}return t}function _i(t){if(!t)return[];var e=Ci(t);return Object.keys(e.reduce(Ni,{}))}function Oi(t){return function(e){return t&&t.indexOf(e)!==-1}}function Mi(t,e){for(var i in t){if(Object.prototype.hasOwnProperty.call(t,i)){e[i]=t[i]}}}function Ri(t,e){var i=t.prototype;if(!(i instanceof e)){function s(){}s.prototype=e.prototype;s=new s;Mi(i,s);t.prototype=i=s}if(i.constructor!=t){if(typeof t!="function"){console.error("unknown Class:"+t)}i.constructor=t}}var Li={};var Pi=Li.ELEMENT_NODE=1;var $i=Li.ATTRIBUTE_NODE=2;var Fi=Li.TEXT_NODE=3;var Ui=Li.CDATA_SECTION_NODE=4;var Bi=Li.ENTITY_REFERENCE_NODE=5;var qi=Li.ENTITY_NODE=6;var Vi=Li.PROCESSING_INSTRUCTION_NODE=7;var zi=Li.COMMENT_NODE=8;var Hi=Li.DOCUMENT_NODE=9;var Xi=Li.DOCUMENT_TYPE_NODE=10;var Gi=Li.DOCUMENT_FRAGMENT_NODE=11;var Yi=Li.NOTATION_NODE=12;var Wi={};var Ji={};Wi.INDEX_SIZE_ERR=(Ji[1]="Index size error",1);Wi.DOMSTRING_SIZE_ERR=(Ji[2]="DOMString size error",2);var Ki=Wi.HIERARCHY_REQUEST_ERR=(Ji[3]="Hierarchy request error",3);Wi.WRONG_DOCUMENT_ERR=(Ji[4]="Wrong document",4);Wi.INVALID_CHARACTER_ERR=(Ji[5]="Invalid character",5);Wi.NO_DATA_ALLOWED_ERR=(Ji[6]="No data allowed",6);Wi.NO_MODIFICATION_ALLOWED_ERR=(Ji[7]="No modification allowed",7);var Qi=Wi.NOT_FOUND_ERR=(Ji[8]="Not found",8);Wi.NOT_SUPPORTED_ERR=(Ji[9]="Not supported",9);var Zi=Wi.INUSE_ATTRIBUTE_ERR=(Ji[10]="Attribute in use",10);Wi.INVALID_STATE_ERR=(Ji[11]="Invalid state",11);Wi.SYNTAX_ERR=(Ji[12]="Syntax error",12);Wi.INVALID_MODIFICATION_ERR=(Ji[13]="Invalid modification",13);Wi.NAMESPACE_ERR=(Ji[14]="Invalid namespace",14);Wi.INVALID_ACCESS_ERR=(Ji[15]="Invalid access",15);function ts(t,e){if(e instanceof Error){var i=e}else{i=this;Error.call(this,Ji[t]);this.message=Ji[t];if(Error.captureStackTrace)Error.captureStackTrace(this,ts)}i.code=t;if(e)this.message=this.message+": "+e;return i}ts.prototype=Error.prototype;Mi(Wi,ts);function es(){}es.prototype={length:0,item:function(t){return t>=0&&t<this.length?this[t]:null},toString:function(t,e){for(var i=[],s=0;s<this.length;s++){Hs(this[s],i,t,e)}return i.join("")},filter:function(t){return Array.prototype.filter.call(this,t)},indexOf:function(t){return Array.prototype.indexOf.call(this,t)}};function is(t,e){this._node=t;this._refresh=e;ss(this)}function ss(t){var e=t._node._inc||t._node.ownerDocument._inc;if(t._inc!==e){var i=t._refresh(t._node);Ys(t,"length",i.length);if(!t.$$length||i.length<t.$$length){for(var s=i.length;s in t;s++){if(Object.prototype.hasOwnProperty.call(t,s)){delete t[s]}}}Mi(i,t);t._inc=e}}is.prototype.item=function(t){ss(this);return this[t]||null};Ri(is,es);function ns(){}function rs(t,e){var i=t.length;while(i--){if(t[i]===e){return i}}}function os(t,e,i,s){if(s){e[rs(e,s)]=i}else{e[e.length++]=i}if(t){i.ownerElement=t;var n=t.ownerDocument;if(n){s&&ps(n,t,s);ds(n,t,i)}}}function as(t,e,i){var s=rs(e,i);if(s>=0){var n=e.length-1;while(s<n){e[s]=e[++s]}e.length=n;if(t){var r=t.ownerDocument;if(r){ps(r,t,i);i.ownerElement=null}}}else{throw new ts(Qi,new Error(t.tagName+"@"+i))}}ns.prototype={length:0,item:es.prototype.item,getNamedItem:function(t){var e=this.length;while(e--){var i=this[e];if(i.nodeName==t){return i}}},setNamedItem:function(t){var e=t.ownerElement;if(e&&e!=this._ownerElement){throw new ts(Zi)}var i=this.getNamedItem(t.nodeName);os(this._ownerElement,this,t,i);return i},setNamedItemNS:function(t){var e=t.ownerElement,i;if(e&&e!=this._ownerElement){throw new ts(Zi)}i=this.getNamedItemNS(t.namespaceURI,t.localName);os(this._ownerElement,this,t,i);return i},removeNamedItem:function(t){var e=this.getNamedItem(t);as(this._ownerElement,this,e);return e},removeNamedItemNS:function(t,e){var i=this.getNamedItemNS(t,e);as(this._ownerElement,this,i);return i},getNamedItemNS:function(t,e){var i=this.length;while(i--){var s=this[i];if(s.localName==e&&s.namespaceURI==t){return s}}return null}};function hs(){}hs.prototype={hasFeature:function(t,e){return true},createDocument:function(t,e,i){var s=new fs;s.implementation=this;s.childNodes=new es;s.doctype=i||null;if(i){s.appendChild(i)}if(e){var n=s.createElementNS(t,e);s.appendChild(n)}return s},createDocumentType:function(t,e,i){var s=new Rs;s.name=t;s.nodeName=t;s.publicId=e||"";s.systemId=i||"";return s}};function cs(){}cs.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(t,e){return Es(this,t,e)},replaceChild:function(t,e){Es(this,t,e,As);if(e){this.removeChild(e)}},removeChild:function(t){return ms(this,t)},appendChild:function(t){return this.insertBefore(t,null)},hasChildNodes:function(){return this.firstChild!=null},cloneNode:function(t){return Gs(this.ownerDocument||this,this,t)},normalize:function(){var t=this.firstChild;while(t){var e=t.nextSibling;if(e&&e.nodeType==Fi&&t.nodeType==Fi){this.removeChild(e);t.appendData(e.data)}else{t.normalize();t=e}}},isSupported:function(t,e){return this.ownerDocument.implementation.hasFeature(t,e)},hasAttributes:function(){return this.attributes.length>0},lookupPrefix:function(t){var e=this;while(e){var i=e._nsMap;if(i){for(var s in i){if(Object.prototype.hasOwnProperty.call(i,s)&&i[s]===t){return s}}}e=e.nodeType==$i?e.ownerDocument:e.parentNode}return null},lookupNamespaceURI:function(t){var e=this;while(e){var i=e._nsMap;if(i){if(Object.prototype.hasOwnProperty.call(i,t)){return i[t]}}e=e.nodeType==$i?e.ownerDocument:e.parentNode}return null},isDefaultNamespace:function(t){var e=this.lookupPrefix(t);return e==null}};function ls(t){return t=="<"&&"<"||t==">"&&">"||t=="&"&&"&"||t=='"'&&"""||"&#"+t.charCodeAt()+";"}Mi(Li,cs);Mi(Li,cs.prototype);function us(t,e){if(e(t)){return true}if(t=t.firstChild){do{if(us(t,e)){return true}}while(t=t.nextSibling)}}function fs(){this.ownerDocument=this}function ds(t,e,i){t&&t._inc++;var s=i.namespaceURI;if(s===Ii.XMLNS){e._nsMap[i.prefix?i.localName:""]=i.value}}function ps(t,e,i,s){t&&t._inc++;var n=i.namespaceURI;if(n===Ii.XMLNS){delete e._nsMap[i.prefix?i.localName:""]}}function vs(t,e,i){if(t&&t._inc){t._inc++;var s=e.childNodes;if(i){s[s.length++]=i}else{var n=e.firstChild;var r=0;while(n){s[r++]=n;n=n.nextSibling}s.length=r;delete s[s.length]}}}function ms(t,e){var i=e.previousSibling;var s=e.nextSibling;if(i){i.nextSibling=s}else{t.firstChild=s}if(s){s.previousSibling=i}else{t.lastChild=i}e.parentNode=null;e.previousSibling=null;e.nextSibling=null;vs(t.ownerDocument,t);return e}function gs(t){return t&&(t.nodeType===cs.DOCUMENT_NODE||t.nodeType===cs.DOCUMENT_FRAGMENT_NODE||t.nodeType===cs.ELEMENT_NODE)}function bs(t){return t&&(js(t)||ws(t)||ys(t)||t.nodeType===cs.DOCUMENT_FRAGMENT_NODE||t.nodeType===cs.COMMENT_NODE||t.nodeType===cs.PROCESSING_INSTRUCTION_NODE)}function ys(t){return t&&t.nodeType===cs.DOCUMENT_TYPE_NODE}function js(t){return t&&t.nodeType===cs.ELEMENT_NODE}function ws(t){return t&&t.nodeType===cs.TEXT_NODE}function Ts(t,e){var i=t.childNodes||[];if(Ei(i,js)||ys(e)){return false}var s=Ei(i,ys);return!(e&&s&&i.indexOf(s)>i.indexOf(e))}function ks(t,e){var i=t.childNodes||[];function s(t){return js(t)&&t!==e}if(Ei(i,s)){return false}var n=Ei(i,ys);return!(e&&n&&i.indexOf(n)>i.indexOf(e))}function Ss(t,e,i){if(!gs(t)){throw new ts(Ki,"Unexpected parent node type "+t.nodeType)}if(i&&i.parentNode!==t){throw new ts(Qi,"child not in parent")}if(!bs(e)||ys(e)&&t.nodeType!==cs.DOCUMENT_NODE){throw new ts(Ki,"Unexpected node type "+e.nodeType+" for parent node type "+t.nodeType)}}function xs(t,e,i){var s=t.childNodes||[];var n=e.childNodes||[];if(e.nodeType===cs.DOCUMENT_FRAGMENT_NODE){var r=n.filter(js);if(r.length>1||Ei(n,ws)){throw new ts(Ki,"More than one element or text in fragment")}if(r.length===1&&!Ts(t,i)){throw new ts(Ki,"Element in fragment can not be inserted before doctype")}}if(js(e)){if(!Ts(t,i)){throw new ts(Ki,"Only one element can be added and only after doctype")}}if(ys(e)){if(Ei(s,ys)){throw new ts(Ki,"Only one doctype is allowed")}var o=Ei(s,js);if(i&&s.indexOf(o)<s.indexOf(i)){throw new ts(Ki,"Doctype can only be inserted before an element")}if(!i&&o){throw new ts(Ki,"Doctype can not be appended since element is present")}}}function As(t,e,i){var s=t.childNodes||[];var n=e.childNodes||[];if(e.nodeType===cs.DOCUMENT_FRAGMENT_NODE){var r=n.filter(js);if(r.length>1||Ei(n,ws)){throw new ts(Ki,"More than one element or text in fragment")}if(r.length===1&&!ks(t,i)){throw new ts(Ki,"Element in fragment can not be inserted before doctype")}}if(js(e)){if(!ks(t,i)){throw new ts(Ki,"Only one element can be added and only after doctype")}}if(ys(e)){function a(t){return ys(t)&&t!==i}if(Ei(s,a)){throw new ts(Ki,"Only one doctype is allowed")}var o=Ei(s,js);if(i&&s.indexOf(o)<s.indexOf(i)){throw new ts(Ki,"Doctype can only be inserted before an element")}}}function Es(t,e,i,s){Ss(t,e,i);if(t.nodeType===cs.DOCUMENT_NODE){(s||xs)(t,e,i)}var n=e.parentNode;if(n){n.removeChild(e)}if(e.nodeType===Gi){var r=e.firstChild;if(r==null){return e}var o=e.lastChild}else{r=o=e}var a=i?i.previousSibling:t.lastChild;r.previousSibling=a;o.nextSibling=i;if(a){a.nextSibling=r}else{t.firstChild=r}if(i==null){t.lastChild=o}else{i.previousSibling=o}do{r.parentNode=t}while(r!==o&&(r=r.nextSibling));vs(t.ownerDocument||t,t);if(e.nodeType==Gi){e.firstChild=e.lastChild=null}return e}function Is(t,e){if(e.parentNode){e.parentNode.removeChild(e)}e.parentNode=t;e.previousSibling=t.lastChild;e.nextSibling=null;if(e.previousSibling){e.previousSibling.nextSibling=e}else{t.firstChild=e}t.lastChild=e;vs(t.ownerDocument,t,e);return e}fs.prototype={nodeName:"#document",nodeType:Hi,doctype:null,documentElement:null,_inc:1,insertBefore:function(t,e){if(t.nodeType==Gi){var i=t.firstChild;while(i){var s=i.nextSibling;this.insertBefore(i,e);i=s}return t}Es(this,t,e);t.ownerDocument=this;if(this.documentElement===null&&t.nodeType===Pi){this.documentElement=t}return t},removeChild:function(t){if(this.documentElement==t){this.documentElement=null}return ms(this,t)},replaceChild:function(t,e){Es(this,t,e,As);t.ownerDocument=this;if(e){this.removeChild(e)}if(js(t)){this.documentElement=t}},importNode:function(t,e){return Xs(this,t,e)},getElementById:function(t){var e=null;us(this.documentElement,(function(i){if(i.nodeType==Pi){if(i.getAttribute("id")==t){e=i;return true}}}));return e},getElementsByClassName:function(t){var e=_i(t);return new is(this,(function(i){var s=[];if(e.length>0){us(i.documentElement,(function(n){if(n!==i&&n.nodeType===Pi){var r=n.getAttribute("class");if(r){var o=t===r;if(!o){var a=_i(r);o=e.every(Oi(a))}if(o){s.push(n)}}}}))}return s}))},createElement:function(t){var e=new Ds;e.ownerDocument=this;e.nodeName=t;e.tagName=t;e.localName=t;e.childNodes=new es;var i=e.attributes=new ns;i._ownerElement=e;return e},createDocumentFragment:function(){var t=new Fs;t.ownerDocument=this;t.childNodes=new es;return t},createTextNode:function(t){var e=new _s;e.ownerDocument=this;e.appendData(t);return e},createComment:function(t){var e=new Os;e.ownerDocument=this;e.appendData(t);return e},createCDATASection:function(t){var e=new Ms;e.ownerDocument=this;e.appendData(t);return e},createProcessingInstruction:function(t,e){var i=new Us;i.ownerDocument=this;i.tagName=i.nodeName=i.target=t;i.nodeValue=i.data=e;return i},createAttribute:function(t){var e=new Cs;e.ownerDocument=this;e.name=t;e.nodeName=t;e.localName=t;e.specified=true;return e},createEntityReference:function(t){var e=new $s;e.ownerDocument=this;e.nodeName=t;return e},createElementNS:function(t,e){var i=new Ds;var s=e.split(":");var n=i.attributes=new ns;i.childNodes=new es;i.ownerDocument=this;i.nodeName=e;i.tagName=e;i.namespaceURI=t;if(s.length==2){i.prefix=s[0];i.localName=s[1]}else{i.localName=e}n._ownerElement=i;return i},createAttributeNS:function(t,e){var i=new Cs;var s=e.split(":");i.ownerDocument=this;i.nodeName=e;i.name=e;i.namespaceURI=t;i.specified=true;if(s.length==2){i.prefix=s[0];i.localName=s[1]}else{i.localName=e}return i}};Ri(fs,cs);function Ds(){this._nsMap={}}Ds.prototype={nodeType:Pi,hasAttribute:function(t){return this.getAttributeNode(t)!=null},getAttribute:function(t){var e=this.getAttributeNode(t);return e&&e.value||""},getAttributeNode:function(t){return this.attributes.getNamedItem(t)},setAttribute:function(t,e){var i=this.ownerDocument.createAttribute(t);i.value=i.nodeValue=""+e;this.setAttributeNode(i)},removeAttribute:function(t){var e=this.getAttributeNode(t);e&&this.removeAttributeNode(e)},appendChild:function(t){if(t.nodeType===Gi){return this.insertBefore(t,null)}else{return Is(this,t)}},setAttributeNode:function(t){return this.attributes.setNamedItem(t)},setAttributeNodeNS:function(t){return this.attributes.setNamedItemNS(t)},removeAttributeNode:function(t){return this.attributes.removeNamedItem(t.nodeName)},removeAttributeNS:function(t,e){var i=this.getAttributeNodeNS(t,e);i&&this.removeAttributeNode(i)},hasAttributeNS:function(t,e){return this.getAttributeNodeNS(t,e)!=null},getAttributeNS:function(t,e){var i=this.getAttributeNodeNS(t,e);return i&&i.value||""},setAttributeNS:function(t,e,i){var s=this.ownerDocument.createAttributeNS(t,e);s.value=s.nodeValue=""+i;this.setAttributeNode(s)},getAttributeNodeNS:function(t,e){return this.attributes.getNamedItemNS(t,e)},getElementsByTagName:function(t){return new is(this,(function(e){var i=[];us(e,(function(s){if(s!==e&&s.nodeType==Pi&&(t==="*"||s.tagName==t)){i.push(s)}}));return i}))},getElementsByTagNameNS:function(t,e){return new is(this,(function(i){var s=[];us(i,(function(n){if(n!==i&&n.nodeType===Pi&&(t==="*"||n.namespaceURI===t)&&(e==="*"||n.localName==e)){s.push(n)}}));return s}))}};fs.prototype.getElementsByTagName=Ds.prototype.getElementsByTagName;fs.prototype.getElementsByTagNameNS=Ds.prototype.getElementsByTagNameNS;Ri(Ds,cs);function Cs(){}Cs.prototype.nodeType=$i;Ri(Cs,cs);function Ns(){}Ns.prototype={data:"",substringData:function(t,e){return this.data.substring(t,t+e)},appendData:function(t){t=this.data+t;this.nodeValue=this.data=t;this.length=t.length},insertData:function(t,e){this.replaceData(t,0,e)},appendChild:function(t){throw new Error(Ji[Ki])},deleteData:function(t,e){this.replaceData(t,e,"")},replaceData:function(t,e,i){var s=this.data.substring(0,t);var n=this.data.substring(t+e);i=s+i+n;this.nodeValue=this.data=i;this.length=i.length}};Ri(Ns,cs);function _s(){}_s.prototype={nodeName:"#text",nodeType:Fi,splitText:function(t){var e=this.data;var i=e.substring(t);e=e.substring(0,t);this.data=this.nodeValue=e;this.length=e.length;var s=this.ownerDocument.createTextNode(i);if(this.parentNode){this.parentNode.insertBefore(s,this.nextSibling)}return s}};Ri(_s,Ns);function Os(){}Os.prototype={nodeName:"#comment",nodeType:zi};Ri(Os,Ns);function Ms(){}Ms.prototype={nodeName:"#cdata-section",nodeType:Ui};Ri(Ms,Ns);function Rs(){}Rs.prototype.nodeType=Xi;Ri(Rs,cs);function Ls(){}Ls.prototype.nodeType=Yi;Ri(Ls,cs);function Ps(){}Ps.prototype.nodeType=qi;Ri(Ps,cs);function $s(){}$s.prototype.nodeType=Bi;Ri($s,cs);function Fs(){}Fs.prototype.nodeName="#document-fragment";Fs.prototype.nodeType=Gi;Ri(Fs,cs);function Us(){}Us.prototype.nodeType=Vi;Ri(Us,cs);function Bs(){}Bs.prototype.serializeToString=function(t,e,i){return qs.call(t,e,i)};cs.prototype.toString=qs;function qs(t,e){var i=[];var s=this.nodeType==9&&this.documentElement||this;var n=s.prefix;var r=s.namespaceURI;if(r&&n==null){var n=s.lookupPrefix(r);if(n==null){var o=[{namespace:r,prefix:null}]}}Hs(this,i,t,e,o);return i.join("")}function Vs(t,e,i){var s=t.prefix||"";var n=t.namespaceURI;if(!n){return false}if(s==="xml"&&n===Ii.XML||n===Ii.XMLNS){return false}var r=i.length;while(r--){var o=i[r];if(o.prefix===s){return o.namespace!==n}}return true}function zs(t,e,i){t.push(" ",e,'="',i.replace(/[<>&"\t\n\r]/g,ls),'"')}function Hs(t,e,i,s,n){if(!n){n=[]}if(s){t=s(t);if(t){if(typeof t=="string"){e.push(t);return}}else{return}}switch(t.nodeType){case Pi:var r=t.attributes;var o=r.length;var a=t.firstChild;var h=t.tagName;i=Ii.isHTML(t.namespaceURI)||i;var c=h;if(!i&&!t.prefix&&t.namespaceURI){var l;for(var u=0;u<r.length;u++){if(r.item(u).name==="xmlns"){l=r.item(u).value;break}}if(!l){for(var f=n.length-1;f>=0;f--){var d=n[f];if(d.prefix===""&&d.namespace===t.namespaceURI){l=d.namespace;break}}}if(l!==t.namespaceURI){for(var f=n.length-1;f>=0;f--){var d=n[f];if(d.namespace===t.namespaceURI){if(d.prefix){c=d.prefix+":"+h}break}}}}e.push("<",c);for(var p=0;p<o;p++){var v=r.item(p);if(v.prefix=="xmlns"){n.push({prefix:v.localName,namespace:v.value})}else if(v.nodeName=="xmlns"){n.push({prefix:"",namespace:v.value})}}for(var p=0;p<o;p++){var v=r.item(p);if(Vs(v,i,n)){var m=v.prefix||"";var g=v.namespaceURI;zs(e,m?"xmlns:"+m:"xmlns",g);n.push({prefix:m,namespace:g})}Hs(v,e,i,s,n)}if(h===c&&Vs(t,i,n)){var m=t.prefix||"";var g=t.namespaceURI;zs(e,m?"xmlns:"+m:"xmlns",g);n.push({prefix:m,namespace:g})}if(a||i&&!/^(?:meta|link|img|br|hr|input)$/i.test(h)){e.push(">");if(i&&/^script$/i.test(h)){while(a){if(a.data){e.push(a.data)}else{Hs(a,e,i,s,n.slice())}a=a.nextSibling}}else{while(a){Hs(a,e,i,s,n.slice());a=a.nextSibling}}e.push("</",c,">")}else{e.push("/>")}return;case Hi:case Gi:var a=t.firstChild;while(a){Hs(a,e,i,s,n.slice());a=a.nextSibling}return;case $i:return zs(e,t.name,t.value);case Fi:return e.push(t.data.replace(/[<&>]/g,ls));case Ui:return e.push("<![CDATA[",t.data,"]]>");case zi:return e.push("\x3c!--",t.data,"--\x3e");case Xi:var b=t.publicId;var y=t.systemId;e.push("<!DOCTYPE ",t.name);if(b){e.push(" PUBLIC ",b);if(y&&y!="."){e.push(" ",y)}e.push(">")}else if(y&&y!="."){e.push(" SYSTEM ",y,">")}else{var j=t.internalSubset;if(j){e.push(" [",j,"]")}e.push(">")}return;case Vi:return e.push("<?",t.target," ",t.data,"?>");case Bi:return e.push("&",t.nodeName,";");default:e.push("??",t.nodeName)}}function Xs(t,e,i){var s;switch(e.nodeType){case Pi:s=e.cloneNode(false);s.ownerDocument=t;case Gi:break;case $i:i=true;break}if(!s){s=e.cloneNode(false)}s.ownerDocument=t;s.parentNode=null;if(i){var n=e.firstChild;while(n){s.appendChild(Xs(t,n,i));n=n.nextSibling}}return s}function Gs(t,e,i){var s=new e.constructor;for(var n in e){if(Object.prototype.hasOwnProperty.call(e,n)){var r=e[n];if(typeof r!="object"){if(r!=s[n]){s[n]=r}}}}if(e.childNodes){s.childNodes=new es}s.ownerDocument=t;switch(s.nodeType){case Pi:var o=e.attributes;var a=s.attributes=new ns;var h=o.length;a._ownerElement=s;for(var c=0;c<h;c++){s.setAttributeNode(Gs(t,o.item(c),true))}break;case $i:i=true}if(i){var l=e.firstChild;while(l){s.appendChild(Gs(t,l,i));l=l.nextSibling}}return s}function Ys(t,e,i){t[e]=i}try{if(Object.defineProperty){Object.defineProperty(is.prototype,"length",{get:function(){ss(this);return this.$$length}});Object.defineProperty(cs.prototype,"textContent",{get:function(){return Nb(this)},set:function(t){switch(this.nodeType){case Pi:case Gi:while(this.firstChild){this.removeChild(this.firstChild)}if(t||String(t)){this.appendChild(this.ownerDocument.createTextNode(t))}break;default:this.data=t;this.value=t;this.nodeValue=t}}});function Nb(t){switch(t.nodeType){case Pi:case Gi:var e=[];t=t.firstChild;while(t){if(t.nodeType!==7&&t.nodeType!==8){e.push(Nb(t))}t=t.nextSibling}return e.join("");default:return t.nodeValue}}Ys=function(t,e,i){t["$$"+e]=i}}}catch(_b){}yi.DocumentType=Rs;yi.DOMException=ts;yi.DOMImplementation=hs;yi.Element=Ds;yi.Node=cs;yi.NodeList=es;yi.XMLSerializer=Bs;var Ws={};var Js={};(function(t){var e=ji.freeze;t.XML_ENTITIES=e({amp:"&",apos:"'",gt:">",lt:"<",quot:'"'});t.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:"\n",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:"\t",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:""});t.entityMap=t.HTML_ENTITIES})(Js);var Ks={};var Qs=ji.NAMESPACE;var Zs=/[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]/;var tn=new RegExp("[\\-\\.0-9"+Zs.source.slice(1,-1)+"\\u00B7\\u0300-\\u036F\\u203F-\\u2040]");var en=new RegExp("^"+Zs.source+tn.source+"*(?::"+Zs.source+tn.source+"*)?$");var sn=0;var nn=1;var rn=2;var on=3;var an=4;var hn=5;var cn=6;var ln=7;function un(t,e){this.message=t;this.locator=e;if(Error.captureStackTrace)Error.captureStackTrace(this,un)}un.prototype=new Error;un.prototype.name=un.name;function fn(){}fn.prototype={parse:function(t,e,i){var s=this.domBuilder;s.startDocument();yn(e,e={});dn(t,e,i,s,this.errorHandler);s.endDocument()}};function dn(t,e,i,s,n){function r(t){if(t>65535){t-=65536;var e=55296+(t>>10),i=56320+(t&1023);return String.fromCharCode(e,i)}else{return String.fromCharCode(t)}}function o(t){var e=t.slice(1,-1);if(Object.hasOwnProperty.call(i,e)){return i[e]}else if(e.charAt(0)==="#"){return r(parseInt(e.substr(1).replace("x","0x")))}else{n.error("entity not found:"+t);return t}}function a(e){if(e>v){var i=t.substring(v,e).replace(/&#?\w+;/g,o);f&&h(v);s.characters(i,0,e-v);v=e}}function h(e,i){while(e>=l&&(i=u.exec(t))){c=i.index;l=c+i[0].length;f.lineNumber++}f.columnNumber=e-c+1}var c=0;var l=0;var u=/.*(?:\r\n?|\n)|.*$/g;var f=s.locator;var d=[{currentNSMap:e}];var p={};var v=0;while(true){try{var m=t.indexOf("<",v);if(m<0){if(!t.substr(v).match(/^\s*$/)){var g=s.doc;var b=g.createTextNode(t.substr(v));g.appendChild(b);s.currentElement=b}return}if(m>v){a(m)}switch(t.charAt(m+1)){case"/":var y=t.indexOf(">",m+3);var j=t.substring(m+2,y).replace(/[ \t\n\r]+$/g,"");var w=d.pop();if(y<0){j=t.substring(m+2).replace(/[\s<].*/,"");n.error("end tag name: "+j+" is not complete:"+w.tagName);y=m+1+j.length}else if(j.match(/\s</)){j=j.replace(/[\s<].*/,"");n.error("end tag name: "+j+" maybe not complete");y=m+1+j.length}var T=w.localNSMap;var k=w.tagName==j;var S=k||w.tagName&&w.tagName.toLowerCase()==j.toLowerCase();if(S){s.endElement(w.uri,w.localName,j);if(T){for(var x in T){if(Object.prototype.hasOwnProperty.call(T,x)){s.endPrefixMapping(x)}}}if(!k){n.fatalError("end tag name: "+j+" is not match the current start tagName:"+w.tagName)}}else{d.push(w)}y++;break;case"?":f&&h(m);y=wn(t,m,s);break;case"!":f&&h(m);y=jn(t,m,s,n);break;default:f&&h(m);var A=new Tn;var E=d[d.length-1].currentNSMap;var y=vn(t,m,A,E,o,n);var I=A.length;if(!A.closed&&bn(t,y,A.tagName,p)){A.closed=true;if(!i.nbsp){n.warning("unclosed xml attribute")}}if(f&&I){var D=pn(f,{});for(var C=0;C<I;C++){var N=A[C];h(N.offset);N.locator=pn(f,{})}s.locator=D;if(mn(A,s,E)){d.push(A)}s.locator=f}else{if(mn(A,s,E)){d.push(A)}}if(Qs.isHTML(A.uri)&&!A.closed){y=gn(t,y,A.tagName,o,s)}else{y++}}}catch(t){if(t instanceof un){throw t}n.error("element parse error: "+t);y=-1}if(y>v){v=y}else{a(Math.max(m,v)+1)}}}function pn(t,e){e.lineNumber=t.lineNumber;e.columnNumber=t.columnNumber;return e}function vn(t,e,i,s,n,r){function o(t,e,s){if(i.attributeNames.hasOwnProperty(t)){r.fatalError("Attribute "+t+" redefined")}i.addValue(t,e.replace(/[\t\n\r]/g," ").replace(/&#?\w+;/g,n),s)}var a;var h;var c=++e;var l=sn;while(true){var u=t.charAt(c);switch(u){case"=":if(l===nn){a=t.slice(e,c);l=on}else if(l===rn){l=on}else{throw new Error("attribute equal must after attrName")}break;case"'":case'"':if(l===on||l===nn){if(l===nn){r.warning('attribute value must after "="');a=t.slice(e,c)}e=c+1;c=t.indexOf(u,e);if(c>0){h=t.slice(e,c);o(a,h,e-1);l=hn}else{throw new Error("attribute value no end '"+u+"' match")}}else if(l==an){h=t.slice(e,c);o(a,h,e);r.warning('attribute "'+a+'" missed start quot('+u+")!!");e=c+1;l=hn}else{throw new Error('attribute value must after "="')}break;case"/":switch(l){case sn:i.setTagName(t.slice(e,c));case hn:case cn:case ln:l=ln;i.closed=true;case an:case nn:break;case rn:i.closed=true;break;default:throw new Error("attribute invalid close char('/')")}break;case"":r.error("unexpected end of input");if(l==sn){i.setTagName(t.slice(e,c))}return c;case">":switch(l){case sn:i.setTagName(t.slice(e,c));case hn:case cn:case ln:break;case an:case nn:h=t.slice(e,c);if(h.slice(-1)==="/"){i.closed=true;h=h.slice(0,-1)}case rn:if(l===rn){h=a}if(l==an){r.warning('attribute "'+h+'" missed quot(")!');o(a,h,e)}else{if(!Qs.isHTML(s[""])||!h.match(/^(?:disabled|checked|selected)$/i)){r.warning('attribute "'+h+'" missed value!! "'+h+'" instead!!')}o(h,h,e)}break;case on:throw new Error("attribute value missed!!")}return c;case"":u=" ";default:if(u<=" "){switch(l){case sn:i.setTagName(t.slice(e,c));l=cn;break;case nn:a=t.slice(e,c);l=rn;break;case an:var h=t.slice(e,c);r.warning('attribute "'+h+'" missed quot(")!!');o(a,h,e);case hn:l=cn;break}}else{switch(l){case rn:if(!Qs.isHTML(s[""])||!a.match(/^(?:disabled|checked|selected)$/i)){r.warning('attribute "'+a+'" missed value!! "'+a+'" instead2!!')}o(a,a,e);e=c;l=nn;break;case hn:r.warning('attribute space is required"'+a+'"!!');case cn:l=nn;e=c;break;case on:l=an;e=c;break;case ln:throw new Error("elements closed character '/' and '>' must be connected to")}}}c++}}function mn(t,e,i){var s=t.tagName;var n=null;var r=t.length;while(r--){var o=t[r];var a=o.qName;var h=o.value;var c=a.indexOf(":");if(c>0){var l=o.prefix=a.slice(0,c);var u=a.slice(c+1);var f=l==="xmlns"&&u}else{u=a;l=null;f=a==="xmlns"&&""}o.localName=u;if(f!==false){if(n==null){n={};yn(i,i={})}i[f]=n[f]=h;o.uri=Qs.XMLNS;e.startPrefixMapping(f,h)}}var r=t.length;while(r--){o=t[r];var l=o.prefix;if(l){if(l==="xml"){o.uri=Qs.XML}if(l!=="xmlns"){o.uri=i[l||""]}}}var c=s.indexOf(":");if(c>0){l=t.prefix=s.slice(0,c);u=t.localName=s.slice(c+1)}else{l=null;u=t.localName=s}var d=t.uri=i[l||""];e.startElement(d,u,s,t);if(t.closed){e.endElement(d,u,s);if(n){for(l in n){if(Object.prototype.hasOwnProperty.call(n,l)){e.endPrefixMapping(l)}}}}else{t.currentNSMap=i;t.localNSMap=n;return true}}function gn(t,e,i,s,n){if(/^(?:script|textarea)$/i.test(i)){var r=t.indexOf("</"+i+">",e);var o=t.substring(e+1,r);if(/[&<]/.test(o)){if(/^script$/i.test(i)){n.characters(o,0,o.length);return r}o=o.replace(/&#?\w+;/g,s);n.characters(o,0,o.length);return r}}return e+1}function bn(t,e,i,s){var n=s[i];if(n==null){n=t.lastIndexOf("</"+i+">");if(n<e){n=t.lastIndexOf("</"+i)}s[i]=n}return n<e}function yn(t,e){for(var i in t){if(Object.prototype.hasOwnProperty.call(t,i)){e[i]=t[i]}}}function jn(t,e,i,s){var n=t.charAt(e+2);switch(n){case"-":if(t.charAt(e+3)==="-"){var r=t.indexOf("--\x3e",e+4);if(r>e){i.comment(t,e+4,r-e-4);return r+3}else{s.error("Unclosed comment");return-1}}else{return-1}default:if(t.substr(e+3,6)=="CDATA["){var r=t.indexOf("]]>",e+9);i.startCDATA();i.characters(t,e+9,r-e-9);i.endCDATA();return r+3}var o=kn(t,e);var a=o.length;if(a>1&&/!doctype/i.test(o[0][0])){var h=o[1][0];var c=false;var l=false;if(a>3){if(/^public$/i.test(o[2][0])){c=o[3][0];l=a>4&&o[4][0]}else if(/^system$/i.test(o[2][0])){l=o[3][0]}}var u=o[a-1];i.startDTD(h,c,l);i.endDTD();return u.index+u[0].length}}return-1}function wn(t,e,i){var s=t.indexOf("?>",e);if(s){var n=t.substring(e,s).match(/^<\?(\S*)\s*([\s\S]*?)\s*$/);if(n){i.processingInstruction(n[1],n[2]);return s+2}else{return-1}}return-1}function Tn(){this.attributeNames={}}Tn.prototype={setTagName:function(t){if(!en.test(t)){throw new Error("invalid tagName:"+t)}this.tagName=t},addValue:function(t,e,i){if(!en.test(t)){throw new Error("invalid attribute:"+t)}this.attributeNames[t]=this.length;this[this.length++]={qName:t,value:e,offset:i}},length:0,getLocalName:function(t){return this[t].localName},getLocator:function(t){return this[t].locator},getQName:function(t){return this[t].qName},getURI:function(t){return this[t].uri},getValue:function(t){return this[t].value}};function kn(t,e){var i;var s=[];var n=/'[^']+'|"[^"]+"|[^\s<>\/=]+=?|(\/?\s*>|<)/g;n.lastIndex=e;n.exec(t);while(i=n.exec(t)){s.push(i);if(i[1])return s}}Ks.XMLReader=fn;Ks.ParseError=un;var Sn=ji;var xn=yi;var An=Js;var En=Ks;var In=xn.DOMImplementation;var Dn=Sn.NAMESPACE;var Cn=En.ParseError;var Nn=En.XMLReader;function _n(t){return t.replace(/\r[\n\u0085]/g,"\n").replace(/[\r\u0085\u2028]/g,"\n")}function On(t){this.options=t||{locator:{}}}On.prototype.parseFromString=function(t,e){var i=this.options;var s=new Nn;var n=i.domBuilder||new Rn;var r=i.errorHandler;var o=i.locator;var a=i.xmlns||{};var h=/\/x?html?$/.test(e);var c=h?An.HTML_ENTITIES:An.XML_ENTITIES;if(o){n.setDocumentLocator(o)}s.errorHandler=Mn(r,n,o);s.domBuilder=i.domBuilder||n;if(h){a[""]=Dn.HTML}a.xml=a.xml||Dn.XML;var l=i.normalizeLineEndings||_n;if(t&&typeof t==="string"){s.parse(l(t),a,c)}else{s.errorHandler.error("invalid doc source")}return n.doc};function Mn(t,e,i){if(!t){if(e instanceof Rn){return e}t=e}var s={};var n=t instanceof Function;i=i||{};function r(e){var r=t[e];if(!r&&n){r=t.length==2?function(i){t(e,i)}:t}s[e]=r&&function(t){r("[xmldom "+e+"]\t"+t+Pn(i))}||function(){}}r("warning");r("error");r("fatalError");return s}function Rn(){this.cdata=false}function Ln(t,e){e.lineNumber=t.lineNumber;e.columnNumber=t.columnNumber}Rn.prototype={startDocument:function(){this.doc=(new In).createDocument(null,null,null);if(this.locator){this.doc.documentURI=this.locator.systemId}},startElement:function(t,e,i,s){var n=this.doc;var r=n.createElementNS(t,i||e);var o=s.length;Fn(this,r);this.currentElement=r;this.locator&&Ln(this.locator,r);for(var a=0;a<o;a++){var t=s.getURI(a);var h=s.getValue(a);var i=s.getQName(a);var c=n.createAttributeNS(t,i);this.locator&&Ln(s.getLocator(a),c);c.value=c.nodeValue=h;r.setAttributeNode(c)}},endElement:function(t,e,i){var s=this.currentElement;this.currentElement=s.parentNode},startPrefixMapping:function(t,e){},endPrefixMapping:function(t){},processingInstruction:function(t,e){var i=this.doc.createProcessingInstruction(t,e);this.locator&&Ln(this.locator,i);Fn(this,i)},ignorableWhitespace:function(t,e,i){},characters:function(t,e,i){t=$n.apply(this,arguments);if(t){if(this.cdata){var s=this.doc.createCDATASection(t)}else{var s=this.doc.createTextNode(t)}if(this.currentElement){this.currentElement.appendChild(s)}else if(/^\s*$/.test(t)){this.doc.appendChild(s)}this.locator&&Ln(this.locator,s)}},skippedEntity:function(t){},endDocument:function(){this.doc.normalize()},setDocumentLocator:function(t){if(this.locator=t){t.lineNumber=0}},comment:function(t,e,i){t=$n.apply(this,arguments);var s=this.doc.createComment(t);this.locator&&Ln(this.locator,s);Fn(this,s)},startCDATA:function(){this.cdata=true},endCDATA:function(){this.cdata=false},startDTD:function(t,e,i){var s=this.doc.implementation;if(s&&s.createDocumentType){var n=s.createDocumentType(t,e,i);this.locator&&Ln(this.locator,n);Fn(this,n);this.doc.doctype=n}},warning:function(t){console.warn("[xmldom warning]\t"+t,Pn(this.locator))},error:function(t){console.error("[xmldom error]\t"+t,Pn(this.locator))},fatalError:function(t){throw new Cn(t,this.locator)}};function Pn(t){if(t){return"\n@"+(t.systemId||"")+"#[line:"+t.lineNumber+",col:"+t.columnNumber+"]"}}function $n(t,e,i){if(typeof t=="string"){return t.substr(e,i)}else{if(t.length>=e+i||e){return new java.lang.String(t,e,i)+""}return t}}"endDTD,startEntity,endEntity,attributeDecl,elementDecl,externalEntityDecl,internalEntityDecl,resolveEntity,getExternalSubset,notationDecl,unparsedEntityDecl".replace(/\w+/g,(function(t){Rn.prototype[t]=function(){return null}}));function Fn(t,e){if(!t.currentElement){t.doc.appendChild(e)}else{t.currentElement.appendChild(e)}}Ws.__DOMHandler=Rn;Ws.normalizeLineEndings=_n;Ws.DOMParser=On;var Un=Ws.DOMParser;
|
|
10
|
-
/*! @name mpd-parser @version 1.3.0 @license Apache-2.0 */const Bn=t=>!!t&&typeof t==="object";const qn=(...t)=>t.reduce(((t,e)=>{if(typeof e!=="object"){return t}Object.keys(e).forEach((i=>{if(Array.isArray(t[i])&&Array.isArray(e[i])){t[i]=t[i].concat(e[i])}else if(Bn(t[i])&&Bn(e[i])){t[i]=qn(t[i],e[i])}else{t[i]=e[i]}}));return t}),{});const Vn=t=>Object.keys(t).map((e=>t[e]));const zn=(t,e)=>{const i=[];for(let s=t;s<e;s++){i.push(s)}return i};const Hn=t=>t.reduce(((t,e)=>t.concat(e)),[]);const Xn=t=>{if(!t.length){return[]}const e=[];for(let i=0;i<t.length;i++){e.push(t[i])}return e};const Gn=(t,e)=>t.reduce(((t,i,s)=>{if(i[e]){t.push(s)}return t}),[]);const Yn=(t,e)=>Vn(t.reduce(((t,i)=>{i.forEach((i=>{t[e(i)]=i}));return t}),{}));var Wn={INVALID_NUMBER_OF_PERIOD:"INVALID_NUMBER_OF_PERIOD",INVALID_NUMBER_OF_CONTENT_STEERING:"INVALID_NUMBER_OF_CONTENT_STEERING",DASH_EMPTY_MANIFEST:"DASH_EMPTY_MANIFEST",DASH_INVALID_XML:"DASH_INVALID_XML",NO_BASE_URL:"NO_BASE_URL",MISSING_SEGMENT_INFORMATION:"MISSING_SEGMENT_INFORMATION",SEGMENT_TIME_UNSPECIFIED:"SEGMENT_TIME_UNSPECIFIED",UNSUPPORTED_UTC_TIMING_SCHEME:"UNSUPPORTED_UTC_TIMING_SCHEME"};const Jn=({baseUrl:t="",source:e="",range:i="",indexRange:s=""})=>{const n={uri:e,resolvedUri:Ee(t||"",e)};if(i||s){const t=i?i:s;const e=t.split("-");let r=z.BigInt?z.BigInt(e[0]):parseInt(e[0],10);let o=z.BigInt?z.BigInt(e[1]):parseInt(e[1],10);if(r<Number.MAX_SAFE_INTEGER&&typeof r==="bigint"){r=Number(r)}if(o<Number.MAX_SAFE_INTEGER&&typeof o==="bigint"){o=Number(o)}let a;if(typeof o==="bigint"||typeof r==="bigint"){a=z.BigInt(o)-z.BigInt(r)+z.BigInt(1)}else{a=o-r+1}if(typeof a==="bigint"&&a<Number.MAX_SAFE_INTEGER){a=Number(a)}n.byterange={length:a,offset:r}}return n};const Kn=t=>{let e;if(typeof t.offset==="bigint"||typeof t.length==="bigint"){e=z.BigInt(t.offset)+z.BigInt(t.length)-z.BigInt(1)}else{e=t.offset+t.length-1}return`${t.offset}-${e}`};const Qn=t=>{if(t&&typeof t!=="number"){t=parseInt(t,10)}if(isNaN(t)){return null}return t};const Zn={static(t){const{duration:e,timescale:i=1,sourceDuration:s,periodDuration:n}=t;const r=Qn(t.endNumber);const o=e/i;if(typeof r==="number"){return{start:0,end:r}}if(typeof n==="number"){return{start:0,end:n/o}}return{start:0,end:s/o}},dynamic(t){const{NOW:e,clientOffset:i,availabilityStartTime:s,timescale:n=1,duration:r,periodStart:o=0,minimumUpdatePeriod:a=0,timeShiftBufferDepth:h=Infinity}=t;const c=Qn(t.endNumber);const l=(e+i)/1e3;const u=s+o;const f=l+a;const d=f-u;const p=Math.ceil(d*n/r);const v=Math.floor((l-u-h)*n/r);const m=Math.floor((l-u)*n/r);return{start:Math.max(0,v),end:typeof c==="number"?c:Math.min(p,m)}}};const tr=t=>e=>{const{duration:i,timescale:s=1,periodStart:n,startNumber:r=1}=t;return{number:r+e,duration:i/s,timeline:n,time:e*i}};const er=t=>{const{type:e,duration:i,timescale:s=1,periodDuration:n,sourceDuration:r}=t;const{start:o,end:a}=Zn[e](t);const h=zn(o,a).map(tr(t));if(e==="static"){const t=h.length-1;const e=typeof n==="number"?n:r;h[t].duration=e-i/s*t}return h};const ir=t=>{const{baseUrl:e,initialization:i={},sourceDuration:s,indexRange:n="",periodStart:r,presentationTime:o,number:a=0,duration:h}=t;if(!e){throw new Error(Wn.NO_BASE_URL)}const c=Jn({baseUrl:e,source:i.sourceURL,range:i.range});const l=Jn({baseUrl:e,source:e,indexRange:n});l.map=c;if(h){const e=er(t);if(e.length){l.duration=e[0].duration;l.timeline=e[0].timeline}}else if(s){l.duration=s;l.timeline=r}l.presentationTime=o||r;l.number=a;return[l]};const sr=(t,e,i)=>{const s=t.sidx.map?t.sidx.map:null;const n=t.sidx.duration;const r=t.timeline||0;const o=t.sidx.byterange;const a=o.offset+o.length;const h=e.timescale;const c=e.references.filter((t=>t.referenceType!==1));const l=[];const u=t.endList?"static":"dynamic";const f=t.sidx.timeline;let d=f;let p=t.mediaSequence||0;let v;if(typeof e.firstOffset==="bigint"){v=z.BigInt(a)+e.firstOffset}else{v=a+e.firstOffset}for(let t=0;t<c.length;t++){const o=e.references[t];const a=o.referencedSize;const c=o.subsegmentDuration;let m;if(typeof v==="bigint"){m=v+z.BigInt(a)-z.BigInt(1)}else{m=v+a-1}const g=`${v}-${m}`;const b={baseUrl:i,timescale:h,timeline:r,periodStart:f,presentationTime:d,number:p,duration:c,sourceDuration:n,indexRange:g,type:u};const y=ir(b)[0];if(s){y.map=s}l.push(y);if(typeof v==="bigint"){v+=z.BigInt(a)}else{v+=a}d+=c/h;p++}t.segments=l;return t};const nr=["AUDIO","SUBTITLES"];const rr=1/60;const or=t=>Yn(t,(({timeline:t})=>t)).sort(((t,e)=>t.timeline>e.timeline?1:-1));const ar=(t,e)=>{for(let i=0;i<t.length;i++){if(t[i].attributes.NAME===e){return t[i]}}return null};const hr=t=>{let e=[];mi(t,nr,((t,i,s,n)=>{e=e.concat(t.playlists||[])}));return e};const cr=({playlist:t,mediaSequence:e})=>{t.mediaSequence=e;t.segments.forEach(((e,i)=>{e.number=t.mediaSequence+i}))};const lr=({oldPlaylists:t,newPlaylists:e,timelineStarts:i})=>{e.forEach((e=>{e.discontinuitySequence=i.findIndex((function({timeline:t}){return t===e.timeline}));const s=ar(t,e.attributes.NAME);if(!s){return}if(e.sidx){return}const n=e.segments[0];const r=s.segments.findIndex((function(t){return Math.abs(t.presentationTime-n.presentationTime)<rr}));if(r===-1){cr({playlist:e,mediaSequence:s.mediaSequence+s.segments.length});e.segments[0].discontinuity=true;e.discontinuityStarts.unshift(0);if(!s.segments.length&&e.timeline>s.timeline||s.segments.length&&e.timeline>s.segments[s.segments.length-1].timeline){e.discontinuitySequence--}return}const o=s.segments[r];if(o.discontinuity&&!n.discontinuity){n.discontinuity=true;e.discontinuityStarts.unshift(0);e.discontinuitySequence--}cr({playlist:e,mediaSequence:s.segments[r].number})}))};const ur=({oldManifest:t,newManifest:e})=>{const i=t.playlists.concat(hr(t));const s=e.playlists.concat(hr(e));e.timelineStarts=or([t.timelineStarts,e.timelineStarts]);lr({oldPlaylists:i,newPlaylists:s,timelineStarts:e.timelineStarts});return e};const fr=t=>t&&t.uri+"-"+Kn(t.byterange);const dr=t=>{const e=t.reduce((function(t,e){if(!t[e.attributes.baseUrl]){t[e.attributes.baseUrl]=[]}t[e.attributes.baseUrl].push(e);return t}),{});let i=[];Object.values(e).forEach((t=>{const e=Vn(t.reduce(((t,e)=>{const i=e.attributes.id+(e.attributes.lang||"");if(!t[i]){t[i]=e;t[i].attributes.timelineStarts=[]}else{if(e.segments){if(e.segments[0]){e.segments[0].discontinuity=true}t[i].segments.push(...e.segments)}if(e.attributes.contentProtection){t[i].attributes.contentProtection=e.attributes.contentProtection}}t[i].attributes.timelineStarts.push({start:e.attributes.periodStart,timeline:e.attributes.periodStart});return t}),{}));i=i.concat(e)}));return i.map((t=>{t.discontinuityStarts=Gn(t.segments||[],"discontinuity");return t}))};const pr=(t,e)=>{const i=fr(t.sidx);const s=i&&e[i]&&e[i].sidx;if(s){sr(t,s,t.sidx.resolvedUri)}return t};const vr=(t,e={})=>{if(!Object.keys(e).length){return t}for(const i in t){t[i]=pr(t[i],e)}return t};const mr=({attributes:t,segments:e,sidx:i,mediaSequence:s,discontinuitySequence:n,discontinuityStarts:r},o)=>{const a={attributes:{NAME:t.id,BANDWIDTH:t.bandwidth,CODECS:t.codecs,["PROGRAM-ID"]:1},uri:"",endList:t.type==="static",timeline:t.periodStart,resolvedUri:t.baseUrl||"",targetDuration:t.duration,discontinuitySequence:n,discontinuityStarts:r,timelineStarts:t.timelineStarts,mediaSequence:s,segments:e};if(t.contentProtection){a.contentProtection=t.contentProtection}if(t.serviceLocation){a.attributes.serviceLocation=t.serviceLocation}if(i){a.sidx=i}if(o){a.attributes.AUDIO="audio";a.attributes.SUBTITLES="subs"}return a};const gr=({attributes:t,segments:e,mediaSequence:i,discontinuityStarts:s,discontinuitySequence:n})=>{if(typeof e==="undefined"){e=[{uri:t.baseUrl,timeline:t.periodStart,resolvedUri:t.baseUrl||"",duration:t.sourceDuration,number:0}];t.duration=t.sourceDuration}const r={NAME:t.id,BANDWIDTH:t.bandwidth,["PROGRAM-ID"]:1};if(t.codecs){r.CODECS=t.codecs}const o={attributes:r,uri:"",endList:t.type==="static",timeline:t.periodStart,resolvedUri:t.baseUrl||"",targetDuration:t.duration,timelineStarts:t.timelineStarts,discontinuityStarts:s,discontinuitySequence:n,mediaSequence:i,segments:e};if(t.serviceLocation){o.attributes.serviceLocation=t.serviceLocation}return o};const br=(t,e={},i=false)=>{let s;const n=t.reduce(((t,n)=>{const r=n.attributes.role&&n.attributes.role.value||"";const o=n.attributes.lang||"";let a=n.attributes.label||"main";if(o&&!n.attributes.label){const t=r?` (${r})`:"";a=`${n.attributes.lang}${t}`}if(!t[a]){t[a]={language:o,autoselect:true,default:r==="main",playlists:[],uri:""}}const h=pr(mr(n,i),e);t[a].playlists.push(h);if(typeof s==="undefined"&&r==="main"){s=n;s.default=true}return t}),{});if(!s){const t=Object.keys(n)[0];n[t].default=true}return n};const yr=(t,e={})=>t.reduce(((t,i)=>{const s=i.attributes.label||i.attributes.lang||"text";if(!t[s]){t[s]={language:s,default:false,autoselect:false,playlists:[],uri:""}}t[s].playlists.push(pr(gr(i),e));return t}),{});const jr=t=>t.reduce(((t,e)=>{if(!e){return t}e.forEach((e=>{const{channel:i,language:s}=e;t[s]={autoselect:false,default:false,instreamId:i,language:s};if(e.hasOwnProperty("aspectRatio")){t[s].aspectRatio=e.aspectRatio}if(e.hasOwnProperty("easyReader")){t[s].easyReader=e.easyReader}if(e.hasOwnProperty("3D")){t[s]["3D"]=e["3D"]}}));return t}),{});const wr=({attributes:t,segments:e,sidx:i,discontinuityStarts:s})=>{const n={attributes:{NAME:t.id,AUDIO:"audio",SUBTITLES:"subs",RESOLUTION:{width:t.width,height:t.height},CODECS:t.codecs,BANDWIDTH:t.bandwidth,["PROGRAM-ID"]:1},uri:"",endList:t.type==="static",timeline:t.periodStart,resolvedUri:t.baseUrl||"",targetDuration:t.duration,discontinuityStarts:s,timelineStarts:t.timelineStarts,segments:e};if(t.frameRate){n.attributes["FRAME-RATE"]=t.frameRate}if(t.contentProtection){n.contentProtection=t.contentProtection}if(t.serviceLocation){n.attributes.serviceLocation=t.serviceLocation}if(i){n.sidx=i}return n};const Tr=({attributes:t})=>t.mimeType==="video/mp4"||t.mimeType==="video/webm"||t.contentType==="video";const kr=({attributes:t})=>t.mimeType==="audio/mp4"||t.mimeType==="audio/webm"||t.contentType==="audio";const Sr=({attributes:t})=>t.mimeType==="text/vtt"||t.contentType==="text";const xr=(t,e)=>{t.forEach((t=>{t.mediaSequence=0;t.discontinuitySequence=e.findIndex((function({timeline:e}){return e===t.timeline}));if(!t.segments){return}t.segments.forEach(((t,e)=>{t.number=e}))}))};const Ar=t=>{if(!t){return[]}return Object.keys(t).reduce(((e,i)=>{const s=t[i];return e.concat(s.playlists)}),[])};const Er=({dashPlaylists:t,locations:e,contentSteering:i,sidxMapping:s={},previousManifest:n,eventStream:r})=>{if(!t.length){return{}}const{sourceDuration:o,type:a,suggestedPresentationDelay:h,minimumUpdatePeriod:c}=t[0].attributes;const l=dr(t.filter(Tr)).map(wr);const u=dr(t.filter(kr));const f=dr(t.filter(Sr));const d=t.map((t=>t.attributes.captionServices)).filter(Boolean);const p={allowCache:true,discontinuityStarts:[],segments:[],endList:true,mediaGroups:{AUDIO:{},VIDEO:{},["CLOSED-CAPTIONS"]:{},SUBTITLES:{}},uri:"",duration:o,playlists:vr(l,s)};if(c>=0){p.minimumUpdatePeriod=c*1e3}if(e){p.locations=e}if(i){p.contentSteering=i}if(a==="dynamic"){p.suggestedPresentationDelay=h}if(r&&r.length>0){p.eventStream=r}const v=p.playlists.length===0;const m=u.length?br(u,s,v):null;const g=f.length?yr(f,s):null;const b=l.concat(Ar(m),Ar(g));const y=b.map((({timelineStarts:t})=>t));p.timelineStarts=or(y);xr(b,p.timelineStarts);if(m){p.mediaGroups.AUDIO.audio=m}if(g){p.mediaGroups.SUBTITLES.subs=g}if(d.length){p.mediaGroups["CLOSED-CAPTIONS"].cc=jr(d)}if(n){return ur({oldManifest:n,newManifest:p})}return p};const Ir=(t,e,i)=>{const{NOW:s,clientOffset:n,availabilityStartTime:r,timescale:o=1,periodStart:a=0,minimumUpdatePeriod:h=0}=t;const c=(s+n)/1e3;const l=r+a;const u=c+h;const f=u-l;return Math.ceil((f*o-e)/i)};const Dr=(t,e)=>{const{type:i,minimumUpdatePeriod:s=0,media:n="",sourceDuration:r,timescale:o=1,startNumber:a=1,periodStart:h}=t;const c=[];let l=-1;for(let u=0;u<e.length;u++){const f=e[u];const d=f.d;const p=f.r||0;const v=f.t||0;if(l<0){l=v}if(v&&v>l){l=v}let m;if(p<0){const a=u+1;if(a===e.length){if(i==="dynamic"&&s>0&&n.indexOf("$Number$")>0){m=Ir(t,l,d)}else{m=(r*o-l)/d}}else{m=(e[a].t-l)/d}}else{m=p+1}const g=a+c.length+m;let b=a+c.length;while(b<g){c.push({number:b,duration:d/o,time:l,timeline:h});l+=d;b++}}return c};const Cr=/\$([A-z]*)(?:(%0)([0-9]+)d)?\$/g;const Nr=t=>(e,i,s,n)=>{if(e==="$$"){return"$"}if(typeof t[i]==="undefined"){return e}const r=""+t[i];if(i==="RepresentationID"){return r}if(!s){n=1}else{n=parseInt(n,10)}if(r.length>=n){return r}return`${new Array(n-r.length+1).join("0")}${r}`};const _r=(t,e)=>t.replace(Cr,Nr(e));const Or=(t,e)=>{if(!t.duration&&!e){return[{number:t.startNumber||1,duration:t.sourceDuration,time:0,timeline:t.periodStart}]}if(t.duration){return er(t)}return Dr(t,e)};const Mr=(t,e)=>{const i={RepresentationID:t.id,Bandwidth:t.bandwidth||0};const{initialization:s={sourceURL:"",range:""}}=t;const n=Jn({baseUrl:t.baseUrl,source:_r(s.sourceURL,i),range:s.range});const r=Or(t,e);return r.map((e=>{i.Number=e.number;i.Time=e.time;const s=_r(t.media||"",i);const r=t.timescale||1;const o=t.presentationTimeOffset||0;const a=t.periodStart+(e.time-o)/r;const h={uri:s,timeline:e.timeline,duration:e.duration,resolvedUri:Ee(t.baseUrl||"",s),map:n,number:e.number,presentationTime:a};return h}))};const Rr=(t,e)=>{const{baseUrl:i,initialization:s={}}=t;const n=Jn({baseUrl:i,source:s.sourceURL,range:s.range});const r=Jn({baseUrl:i,source:e.media,range:e.mediaRange});r.map=n;return r};const Lr=(t,e)=>{const{duration:i,segmentUrls:s=[],periodStart:n}=t;if(!i&&!e||i&&e){throw new Error(Wn.SEGMENT_TIME_UNSPECIFIED)}const r=s.map((e=>Rr(t,e)));let o;if(i){o=er(t)}if(e){o=Dr(t,e)}const a=o.map(((e,i)=>{if(r[i]){const s=r[i];const o=t.timescale||1;const a=t.presentationTimeOffset||0;s.timeline=e.timeline;s.duration=e.duration;s.number=e.number;s.presentationTime=n+(e.time-a)/o;return s}})).filter((t=>t));return a};const Pr=({attributes:t,segmentInfo:e})=>{let i;let s;if(e.template){s=Mr;i=qn(t,e.template)}else if(e.base){s=ir;i=qn(t,e.base)}else if(e.list){s=Lr;i=qn(t,e.list)}const n={attributes:t};if(!s){return n}const r=s(i,e.segmentTimeline);if(i.duration){const{duration:t,timescale:e=1}=i;i.duration=t/e}else if(r.length){i.duration=r.reduce(((t,e)=>Math.max(t,Math.ceil(e.duration))),0)}else{i.duration=0}n.attributes=i;n.segments=r;if(e.base&&i.indexRange){n.sidx=r[0];n.segments=[]}return n};const $r=t=>t.map(Pr);const Fr=(t,e)=>Xn(t.childNodes).filter((({tagName:t})=>t===e));const Ur=t=>t.textContent.trim();const Br=t=>parseFloat(t.split("/").reduce(((t,e)=>t/e)));const qr=t=>{const e=365*24*60*60;const i=30*24*60*60;const s=24*60*60;const n=60*60;const r=60;const o=/P(?:(\d*)Y)?(?:(\d*)M)?(?:(\d*)D)?(?:T(?:(\d*)H)?(?:(\d*)M)?(?:([\d.]*)S)?)?/;const a=o.exec(t);if(!a){return 0}const[h,c,l,u,f,d]=a.slice(1);return parseFloat(h||0)*e+parseFloat(c||0)*i+parseFloat(l||0)*s+parseFloat(u||0)*n+parseFloat(f||0)*r+parseFloat(d||0)};const Vr=t=>{const e=/^\d+-\d+-\d+T\d+:\d+:\d+(\.\d+)?$/;if(e.test(t)){t+="Z"}return Date.parse(t)};const zr={mediaPresentationDuration(t){return qr(t)},availabilityStartTime(t){return Vr(t)/1e3},minimumUpdatePeriod(t){return qr(t)},suggestedPresentationDelay(t){return qr(t)},type(t){return t},timeShiftBufferDepth(t){return qr(t)},start(t){return qr(t)},width(t){return parseInt(t,10)},height(t){return parseInt(t,10)},bandwidth(t){return parseInt(t,10)},frameRate(t){return Br(t)},startNumber(t){return parseInt(t,10)},timescale(t){return parseInt(t,10)},presentationTimeOffset(t){return parseInt(t,10)},duration(t){const e=parseInt(t,10);if(isNaN(e)){return qr(t)}return e},d(t){return parseInt(t,10)},t(t){return parseInt(t,10)},r(t){return parseInt(t,10)},presentationTime(t){return parseInt(t,10)},DEFAULT(t){return t}};const Hr=t=>{if(!(t&&t.attributes)){return{}}return Xn(t.attributes).reduce(((t,e)=>{const i=zr[e.name]||zr.DEFAULT;t[e.name]=i(e.value);return t}),{})};const Xr={"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"};const Gr=(t,e)=>{if(!e.length){return t}return Hn(t.map((function(t){return e.map((function(e){const i=Ur(e);const s=Ee(t.baseUrl,i);const n=qn(Hr(e),{baseUrl:s});if(s!==i&&!n.serviceLocation&&t.serviceLocation){n.serviceLocation=t.serviceLocation}return n}))})))};const Yr=t=>{const e=Fr(t,"SegmentTemplate")[0];const i=Fr(t,"SegmentList")[0];const s=i&&Fr(i,"SegmentURL").map((t=>qn({tag:"SegmentURL"},Hr(t))));const n=Fr(t,"SegmentBase")[0];const r=i||e;const o=r&&Fr(r,"SegmentTimeline")[0];const a=i||n||e;const h=a&&Fr(a,"Initialization")[0];const c=e&&Hr(e);if(c&&h){c.initialization=h&&Hr(h)}else if(c&&c.initialization){c.initialization={sourceURL:c.initialization}}const l={template:c,segmentTimeline:o&&Fr(o,"S").map((t=>Hr(t))),list:i&&qn(Hr(i),{segmentUrls:s,initialization:Hr(h)}),base:n&&qn(Hr(n),{initialization:Hr(h)})};Object.keys(l).forEach((t=>{if(!l[t]){delete l[t]}}));return l};const Wr=(t,e,i)=>s=>{const n=Fr(s,"BaseURL");const r=Gr(e,n);const o=qn(t,Hr(s));const a=Yr(s);return r.map((t=>({segmentInfo:qn(i,a),attributes:qn(o,t)})))};const Jr=t=>t.reduce(((t,e)=>{const i=Hr(e);if(i.schemeIdUri){i.schemeIdUri=i.schemeIdUri.toLowerCase()}const s=Xr[i.schemeIdUri];if(s){t[s]={attributes:i};const n=Fr(e,"cenc:pssh")[0];if(n){const e=Ur(n);t[s].pssh=e&&bi(e)}}return t}),{});const Kr=t=>{if(t.schemeIdUri==="urn:scte:dash:cc:cea-608:2015"){const e=typeof t.value!=="string"?[]:t.value.split(";");return e.map((t=>{let e;let i;i=t;if(/^CC\d=/.test(t)){[e,i]=t.split("=")}else if(/^CC\d$/.test(t)){e=t}return{channel:e,language:i}}))}else if(t.schemeIdUri==="urn:scte:dash:cc:cea-708:2015"){const e=typeof t.value!=="string"?[]:t.value.split(";");return e.map((t=>{const e={channel:undefined,language:undefined,aspectRatio:1,easyReader:0,"3D":0};if(/=/.test(t)){const[i,s=""]=t.split("=");e.channel=i;e.language=t;s.split(",").forEach((t=>{const[i,s]=t.split(":");if(i==="lang"){e.language=s}else if(i==="er"){e.easyReader=Number(s)}else if(i==="war"){e.aspectRatio=Number(s)}else if(i==="3D"){e["3D"]=Number(s)}}))}else{e.language=t}if(e.channel){e.channel="SERVICE"+e.channel}return e}))}};const Qr=t=>Hn(Fr(t.node,"EventStream").map((e=>{const i=Hr(e);const s=i.schemeIdUri;return Fr(e,"Event").map((e=>{const n=Hr(e);const r=n.presentationTime||0;const o=i.timescale||1;const a=n.duration||0;const h=r/o+t.attributes.start;return{schemeIdUri:s,value:i.value,id:n.id,start:h,end:h+a/o,messageData:Ur(e)||n.messageData,contentEncoding:i.contentEncoding,presentationTimeOffset:i.presentationTimeOffset||0}}))})));const Zr=(t,e,i)=>s=>{const n=Hr(s);const r=Gr(e,Fr(s,"BaseURL"));const o=Fr(s,"Role")[0];const a={role:Hr(o)};let h=qn(t,n,a);const c=Fr(s,"Accessibility")[0];const l=Kr(Hr(c));if(l){h=qn(h,{captionServices:l})}const u=Fr(s,"Label")[0];if(u&&u.childNodes.length){const t=u.childNodes[0].nodeValue.trim();h=qn(h,{label:t})}const f=Jr(Fr(s,"ContentProtection"));if(Object.keys(f).length){h=qn(h,{contentProtection:f})}const d=Yr(s);const p=Fr(s,"Representation");const v=qn(i,d);return Hn(p.map(Wr(h,r,v)))};const to=(t,e)=>(i,s)=>{const n=Gr(e,Fr(i.node,"BaseURL"));const r=qn(t,{periodStart:i.attributes.start});if(typeof i.attributes.duration==="number"){r.periodDuration=i.attributes.duration}const o=Fr(i.node,"AdaptationSet");const a=Yr(i.node);return Hn(o.map(Zr(r,n,a)))};const eo=(t,e)=>{if(t.length>1){e({type:"warn",message:"The MPD manifest should contain no more than one ContentSteering tag"})}if(!t.length){return null}const i=qn({serverURL:Ur(t[0])},Hr(t[0]));i.queryBeforeStart=i.queryBeforeStart==="true";return i};const io=({attributes:t,priorPeriodAttributes:e,mpdType:i})=>{if(typeof t.start==="number"){return t.start}if(e&&typeof e.start==="number"&&typeof e.duration==="number"){return e.start+e.duration}if(!e&&i==="static"){return 0}return null};const so=(t,e={})=>{const{manifestUri:i="",NOW:s=Date.now(),clientOffset:n=0,eventHandler:r=function(){}}=e;const o=Fr(t,"Period");if(!o.length){throw new Error(Wn.INVALID_NUMBER_OF_PERIOD)}const a=Fr(t,"Location");const h=Hr(t);const c=Gr([{baseUrl:i}],Fr(t,"BaseURL"));const l=Fr(t,"ContentSteering");h.type=h.type||"static";h.sourceDuration=h.mediaPresentationDuration||0;h.NOW=s;h.clientOffset=n;if(a.length){h.locations=a.map(Ur)}const u=[];o.forEach(((t,e)=>{const i=Hr(t);const s=u[e-1];i.start=io({attributes:i,priorPeriodAttributes:s?s.attributes:null,mpdType:h.type});u.push({node:t,attributes:i})}));return{locations:h.locations,contentSteeringInfo:eo(l,r),representationInfo:Hn(u.map(to(h,c))),eventStream:Hn(u.map(Qr))}};const no=t=>{if(t===""){throw new Error(Wn.DASH_EMPTY_MANIFEST)}const e=new Un;let i;let s;try{i=e.parseFromString(t,"application/xml");s=i&&i.documentElement.tagName==="MPD"?i.documentElement:null}catch(t){}if(!s||s&&s.getElementsByTagName("parsererror").length>0){throw new Error(Wn.DASH_INVALID_XML)}return s};const ro=t=>{const e=Fr(t,"UTCTiming")[0];if(!e){return null}const i=Hr(e);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(Wn.UNSUPPORTED_UTC_TIMING_SCHEME)}return i};const oo=(t,e={})=>{const i=so(no(t),e);const s=$r(i.representationInfo);return Er({dashPlaylists:s,locations:i.locations,contentSteering:i.contentSteeringInfo,sidxMapping:e.sidxMapping,previousManifest:e.previousManifest,eventStream:i.eventStream})};const ao=t=>ro(no(t));var ho=Math.pow(2,32);var co=function(t){var e=new DataView(t.buffer,t.byteOffset,t.byteLength);var i;if(e.getBigUint64){i=e.getBigUint64(0);if(i<Number.MAX_SAFE_INTEGER){return Number(i)}return i}return e.getUint32(0)*ho+e.getUint32(4)};var lo={getUint64:co,MAX_UINT32:ho};var uo=lo.getUint64;var fo=function(t){var e=new DataView(t.buffer,t.byteOffset,t.byteLength),i={version:t[0],flags:new Uint8Array(t.subarray(1,4)),references:[],referenceId:e.getUint32(4),timescale:e.getUint32(8)},s=12;if(i.version===0){i.earliestPresentationTime=e.getUint32(s);i.firstOffset=e.getUint32(s+4);s+=8}else{i.earliestPresentationTime=uo(t.subarray(s));i.firstOffset=uo(t.subarray(s+8));s+=16}s+=2;var n=e.getUint16(s);s+=2;for(;n>0;s+=12,n--){i.references.push({referenceType:(t[s]&128)>>>7,referencedSize:e.getUint32(s)&2147483647,subsegmentDuration:e.getUint32(s+4),startsWithSap:!!(t[s+8]&128),sapType:(t[s+8]&112)>>>4,sapDeltaTime:e.getUint32(s+8)&268435455})}return i};var po=fo;var vo=hi([73,68,51]);var mo=function t(e,i){if(i===void 0){i=0}e=hi(e);var s=e[i+5];var n=e[i+6]<<21|e[i+7]<<14|e[i+8]<<7|e[i+9];var r=(s&16)>>4;if(r){return n+20}return n+10};var go=function t(e,i){if(i===void 0){i=0}e=hi(e);if(e.length-i<10||!vi(e,vo,{offset:i})){return i}i+=mo(e,i);return t(e,i)};var bo=function t(e){if(typeof e==="string"){return di(e)}if(typeof e==="number"){return e}return e};var yo=function t(e){if(!Array.isArray(e)){return[bo(e)]}return e.map((function(t){return bo(t)}))};var jo=function t(e,i,s){if(s===void 0){s=false}i=yo(i);e=hi(e);var n=[];if(!i.length){return n}var r=0;while(r<e.length){var o=(e[r]<<24|e[r+1]<<16|e[r+2]<<8|e[r+3])>>>0;var a=e.subarray(r+4,r+8);if(o===0){break}var h=r+o;if(h>e.length){if(s){break}h=e.length}var c=e.subarray(r+8,h);if(vi(a,i[0])){if(i.length===1){n.push(c)}else{n.push.apply(n,t(c,i.slice(1),s))}}r=h}return n};var wo={EBML:hi([26,69,223,163]),DocType:hi([66,130]),Segment:hi([24,83,128,103]),SegmentInfo:hi([21,73,169,102]),Tracks:hi([22,84,174,107]),Track:hi([174]),TrackNumber:hi([215]),DefaultDuration:hi([35,227,131]),TrackEntry:hi([174]),TrackType:hi([131]),FlagDefault:hi([136]),CodecID:hi([134]),CodecPrivate:hi([99,162]),VideoTrack:hi([224]),AudioTrack:hi([225]),Cluster:hi([31,67,182,117]),Timestamp:hi([231]),TimestampScale:hi([42,215,177]),BlockGroup:hi([160]),BlockDuration:hi([155]),Block:hi([161]),SimpleBlock:hi([163])};var To=[128,64,32,16,8,4,2,1];var ko=function t(e){var i=1;for(var s=0;s<To.length;s++){if(e&To[s]){break}i++}return i};var So=function t(e,i,s,n){if(s===void 0){s=true}if(n===void 0){n=false}var r=ko(e[i]);var o=e.subarray(i,i+r);if(s){o=Array.prototype.slice.call(e,i,i+r);o[0]^=To[r-1]}return{length:r,value:ui(o,{signed:n}),bytes:o}};var xo=function t(e){if(typeof e==="string"){return e.match(/.{1,2}/g).map((function(e){return t(e)}))}if(typeof e==="number"){return fi(e)}return e};var Ao=function t(e){if(!Array.isArray(e)){return[xo(e)]}return e.map((function(t){return xo(t)}))};var Eo=function t(e,i,s){if(s>=i.length){return i.length}var n=So(i,s,false);if(vi(e.bytes,n.bytes)){return s}var r=So(i,s+n.length);return t(e,i,s+r.length+r.value+n.length)};var Io=function t(e,i){i=Ao(i);e=hi(e);var s=[];if(!i.length){return s}var n=0;while(n<e.length){var r=So(e,n,false);var o=So(e,n+r.length);var a=n+r.length+o.length;if(o.value===127){o.value=Eo(r,e,a);if(o.value!==e.length){o.value-=a}}var h=a+o.value>e.length?e.length:a+o.value;var c=e.subarray(a,h);if(vi(i[0],r.bytes)){if(i.length===1){s.push(c)}else{s=s.concat(t(c,i.slice(1)))}}var l=r.length+o.length+c.length;n+=l}return s};var Do=hi([0,0,0,1]);var Co=hi([0,0,1]);var No=hi([0,0,3]);var _o=function t(e){var i=[];var s=1;while(s<e.length-2){if(vi(e.subarray(s,s+3),No)){i.push(s+2);s++}s++}if(i.length===0){return e}var n=e.length-i.length;var r=new Uint8Array(n);var o=0;for(s=0;s<n;o++,s++){if(o===i[0]){o++;i.shift()}r[s]=e[o]}return r};var Oo=function t(e,i,s,n){if(n===void 0){n=Infinity}e=hi(e);s=[].concat(s);var r=0;var o;var a=0;while(r<e.length&&(a<n||o)){var h=void 0;if(vi(e.subarray(r),Do)){h=4}else if(vi(e.subarray(r),Co)){h=3}if(!h){r++;continue}a++;if(o){return _o(e.subarray(o,r))}var c=void 0;if(i==="h264"){c=e[r+h]&31}else if(i==="h265"){c=e[r+h]>>1&63}if(s.indexOf(c)!==-1){o=r+h}r+=h+(i==="h264"?1:2)}return e.subarray(0,0)};var Mo=function t(e,i,s){return Oo(e,"h264",i,s)};var Ro=function t(e,i,s){return Oo(e,"h265",i,s)};var Lo={webm:hi([119,101,98,109]),matroska:hi([109,97,116,114,111,115,107,97]),flac:hi([102,76,97,67]),ogg:hi([79,103,103,83]),ac3:hi([11,119]),riff:hi([82,73,70,70]),avi:hi([65,86,73]),wav:hi([87,65,86,69]),"3gp":hi([102,116,121,112,51,103]),mp4:hi([102,116,121,112]),fmp4:hi([115,116,121,112]),mov:hi([102,116,121,112,113,116]),moov:hi([109,111,111,118]),moof:hi([109,111,111,102])};var Po={aac:function t(e){var i=go(e);return vi(e,[255,16],{offset:i,mask:[255,22]})},mp3:function t(e){var i=go(e);return vi(e,[255,2],{offset:i,mask:[255,6]})},webm:function t(e){var i=Io(e,[wo.EBML,wo.DocType])[0];return vi(i,Lo.webm)},mkv:function t(e){var i=Io(e,[wo.EBML,wo.DocType])[0];return vi(i,Lo.matroska)},mp4:function t(e){if(Po["3gp"](e)||Po.mov(e)){return false}if(vi(e,Lo.mp4,{offset:4})||vi(e,Lo.fmp4,{offset:4})){return true}if(vi(e,Lo.moof,{offset:4})||vi(e,Lo.moov,{offset:4})){return true}},mov:function t(e){return vi(e,Lo.mov,{offset:4})},"3gp":function t(e){return vi(e,Lo["3gp"],{offset:4})},ac3:function t(e){var i=go(e);return vi(e,Lo.ac3,{offset:i})},ts:function t(e){if(e.length<189&&e.length>=1){return e[0]===71}var i=0;while(i+188<e.length&&i<188){if(e[i]===71&&e[i+188]===71){return true}i+=1}return false},flac:function t(e){var i=go(e);return vi(e,Lo.flac,{offset:i})},ogg:function t(e){return vi(e,Lo.ogg)},avi:function t(e){return vi(e,Lo.riff)&&vi(e,Lo.avi,{offset:8})},wav:function t(e){return vi(e,Lo.riff)&&vi(e,Lo.wav,{offset:8})},h264:function t(e){return Mo(e,7,3).length},h265:function t(e){return Ro(e,[32,33],3).length}};var $o=Object.keys(Po).filter((function(t){return t!=="ts"&&t!=="h264"&&t!=="h265"})).concat(["ts","h264","h265"]);$o.forEach((function(t){var e=Po[t];Po[t]=function(t){return e(hi(t))}}));var Fo=Po;var Uo=function t(e){e=hi(e);for(var i=0;i<$o.length;i++){var s=$o[i];if(Fo[s](e)){return s}}return""};var Bo=function t(e){return jo(e,["moof"]).length>0};var qo=9e4,Vo,zo,Ho,Xo,Go,Yo,Wo;Vo=function(t){return t*qo};zo=function(t,e){return t*e};Ho=function(t){return t/qo};Xo=function(t,e){return t/e};Go=function(t,e){return Vo(Xo(t,e))};Yo=function(t,e){return zo(Ho(t),e)};Wo=function(t,e,i){return Ho(i?t:t-e)};var Jo={ONE_SECOND_IN_TS:qo,secondsToVideoTs:Vo,secondsToAudioTs:zo,videoTsToSeconds:Ho,audioTsToSeconds:Xo,audioTsToVideoTs:Go,videoTsToAudioTs:Yo,metadataTsToSeconds:Wo};
|
|
11
|
-
/**
|
|
12
|
-
* @license
|
|
13
|
-
* Video.js 8.17.3 <http://videojs.com/>
|
|
14
|
-
* Copyright Brightcove, Inc. <https://www.brightcove.com/>
|
|
15
|
-
* Available under Apache License Version 2.0
|
|
16
|
-
* <https://github.com/videojs/video.js/blob/main/LICENSE>
|
|
17
|
-
*
|
|
18
|
-
* Includes vtt.js <https://github.com/mozilla/vtt.js>
|
|
19
|
-
* Available under Apache License Version 2.0
|
|
20
|
-
* <https://github.com/mozilla/vtt.js/blob/main/LICENSE>
|
|
21
|
-
*/var Ko="8.17.3";const Qo={};const Zo=function(t,e){Qo[t]=Qo[t]||[];if(e){Qo[t]=Qo[t].concat(e)}return Qo[t]};const ta=function(t,e){Zo(t,e)};const ea=function(t,e){const i=Zo(t).indexOf(e);if(i<=-1){return false}Qo[t]=Qo[t].slice();Qo[t].splice(i,1);return true};const ia=function(t,e){Zo(t,[].concat(e).map((e=>{const i=(...s)=>{ea(t,i);return e(...s)};return i})))};const sa={prefixed:true};const na=[["requestFullscreen","exitFullscreen","fullscreenElement","fullscreenEnabled","fullscreenchange","fullscreenerror","fullscreen"],["webkitRequestFullscreen","webkitExitFullscreen","webkitFullscreenElement","webkitFullscreenEnabled","webkitfullscreenchange","webkitfullscreenerror","-webkit-full-screen"]];const ra=na[0];let oa;for(let Ob=0;Ob<na.length;Ob++){if(na[Ob][1]in K){oa=na[Ob];break}}if(oa){for(let Mb=0;Mb<oa.length;Mb++){sa[ra[Mb]]=oa[Mb]}sa.prefixed=oa[0]!==ra[0]}let aa=[];const ha=(t,e,i)=>(s,n,r)=>{const o=e.levels[n];const a=new RegExp(`^(${o})$`);let h=t;if(s!=="log"){r.unshift(s.toUpperCase()+":")}if(i){h=`%c${t}`;r.unshift(i)}r.unshift(h+":");if(aa){aa.push([].concat(r));const t=aa.length-1e3;aa.splice(0,t>0?t:0)}if(!z.console){return}let c=z.console[s];if(!c&&s==="debug"){c=z.console.info||z.console.log}if(!c||!o||!a.test(s)){return}c[Array.isArray(r)?"apply":"call"](z.console,r)};function ca(t,e=":",i=""){let s="info";let n;function r(...t){n("log",s,t)}n=ha(t,r,i);r.createLogger=(s,n,r)=>{const o=n!==undefined?n:e;const a=r!==undefined?r:i;const h=`${t} ${o} ${s}`;return ca(h,o,a)};r.createNewLogger=(t,e,i)=>ca(t,e,i);r.levels={all:"debug|log|warn|error",off:"",debug:"debug|log|warn|error",info:"log|warn|error",warn:"warn|error",error:"error",DEFAULT:s};r.level=t=>{if(typeof t==="string"){if(!r.levels.hasOwnProperty(t)){throw new Error(`"${t}" in not a valid log level`)}s=t}return s};r.history=()=>aa?[].concat(aa):[];r.history.filter=t=>(aa||[]).filter((e=>new RegExp(`.*${t}.*`).test(e[0])));r.history.clear=()=>{if(aa){aa.length=0}};r.history.disable=()=>{if(aa!==null){aa.length=0;aa=null}};r.history.enable=()=>{if(aa===null){aa=[]}};r.error=(...t)=>n("error",s,t);r.warn=(...t)=>n("warn",s,t);r.debug=(...t)=>n("debug",s,t);return r}const la=ca("VIDEOJS");const ua=la.createLogger;const fa=Object.prototype.toString;const da=function(t){return ma(t)?Object.keys(t):[]};function pa(t,e){da(t).forEach((i=>e(t[i],i)))}function va(t,e,i=0){return da(t).reduce(((i,s)=>e(i,t[s],s)),i)}function ma(t){return!!t&&typeof t==="object"}function ga(t){return ma(t)&&fa.call(t)==="[object Object]"&&t.constructor===Object}function ba(...t){const e={};t.forEach((t=>{if(!t){return}pa(t,((t,i)=>{if(!ga(t)){e[i]=t;return}if(!ga(e[i])){e[i]={}}e[i]=ba(e[i],t)}))}));return e}function ya(t={}){const e=[];for(const i in t){if(t.hasOwnProperty(i)){const s=t[i];e.push(s)}}return e}function ja(t,e,i,s=true){const n=i=>Object.defineProperty(t,e,{value:i,enumerable:true,writable:true});const r={configurable:true,enumerable:true,get(){const t=i();n(t);return t}};if(s){r.set=n}return Object.defineProperty(t,e,r)}var wa=Object.freeze({__proto__:null,each:pa,reduce:va,isObject:ma,isPlain:ga,merge:ba,values:ya,defineLazyProperty:ja});let Ta=false;let ka=null;let Sa=false;let xa;let Aa=false;let Ea=false;let Ia=false;let Da=false;let Ca=null;let Na=null;const _a=Boolean(z.cast&&z.cast.framework&&z.cast.framework.CastReceiverContext);let Oa=null;let Ma=false;let Ra=false;let La=false;let Pa=false;let $a=false;let Fa=false;let Ua=false;const Ba=Boolean(Ya()&&("ontouchstart"in z||z.navigator.maxTouchPoints||z.DocumentTouch&&z.document instanceof z.DocumentTouch));const qa=z.navigator&&z.navigator.userAgentData;if(qa&&qa.platform&&qa.brands){Sa=qa.platform==="Android";Ea=Boolean(qa.brands.find((t=>t.brand==="Microsoft Edge")));Ia=Boolean(qa.brands.find((t=>t.brand==="Chromium")));Da=!Ea&&Ia;Ca=Na=(qa.brands.find((t=>t.brand==="Chromium"))||{}).version||null;Ra=qa.platform==="Windows"}if(!Ia){const Rb=z.navigator&&z.navigator.userAgent||"";Ta=/iPod/i.test(Rb);ka=function(){const t=Rb.match(/OS (\d+)_/i);if(t&&t[1]){return t[1]}return null}();Sa=/Android/i.test(Rb);xa=function(){const t=Rb.match(/Android (\d+)(?:\.(\d+))?(?:\.(\d+))*/i);if(!t){return null}const e=t[1]&&parseFloat(t[1]);const i=t[2]&&parseFloat(t[2]);if(e&&i){return parseFloat(t[1]+"."+t[2])}else if(e){return e}return null}();Aa=/Firefox/i.test(Rb);Ea=/Edg/i.test(Rb);Ia=/Chrome/i.test(Rb)||/CriOS/i.test(Rb);Da=!Ea&&Ia;Ca=Na=function(){const t=Rb.match(/(Chrome|CriOS)\/(\d+)/);if(t&&t[2]){return parseFloat(t[2])}return null}();Oa=function(){const t=/MSIE\s(\d+)\.\d/.exec(Rb);let e=t&&parseFloat(t[1]);if(!e&&/Trident\/7.0/i.test(Rb)&&/rv:11.0/.test(Rb)){e=11}return e}();$a=/Tizen/i.test(Rb);Fa=/Web0S/i.test(Rb);Ua=$a||Fa;Ma=/Safari/i.test(Rb)&&!Da&&!Sa&&!Ea&&!Ua;Ra=/Windows/i.test(Rb);La=/iPad/i.test(Rb)||Ma&&Ba&&!/iPhone/i.test(Rb);Pa=/iPhone/i.test(Rb)&&!La}const Va=Pa||La||Ta;const za=(Ma||Va)&&!Da;var Ha=Object.freeze({__proto__:null,get IS_IPOD(){return Ta},get IOS_VERSION(){return ka},get IS_ANDROID(){return Sa},get ANDROID_VERSION(){return xa},get IS_FIREFOX(){return Aa},get IS_EDGE(){return Ea},get IS_CHROMIUM(){return Ia},get IS_CHROME(){return Da},get CHROMIUM_VERSION(){return Ca},get CHROME_VERSION(){return Na},IS_CHROMECAST_RECEIVER:_a,get IE_VERSION(){return Oa},get IS_SAFARI(){return Ma},get IS_WINDOWS(){return Ra},get IS_IPAD(){return La},get IS_IPHONE(){return Pa},get IS_TIZEN(){return $a},get IS_WEBOS(){return Fa},get IS_SMART_TV(){return Ua},TOUCH_ENABLED:Ba,IS_IOS:Va,IS_ANY_SAFARI:za});function Xa(t){return typeof t==="string"&&Boolean(t.trim())}function Ga(t){if(t.indexOf(" ")>=0){throw new Error("class has illegal whitespace characters")}}function Ya(){return K===z.document}function Wa(t){return ma(t)&&t.nodeType===1}function Ja(){try{return z.parent!==z.self}catch(t){return true}}function Ka(t){return function(e,i){if(!Xa(e)){return K[t](null)}if(Xa(i)){i=K.querySelector(i)}const s=Wa(i)?i:K;return s[t]&&s[t](e)}}function Qa(t="div",e={},i={},s){const n=K.createElement(t);Object.getOwnPropertyNames(e).forEach((function(t){const i=e[t];if(t==="textContent"){Za(n,i)}else if(n[t]!==i||t==="tabIndex"){n[t]=i}}));Object.getOwnPropertyNames(i).forEach((function(t){n.setAttribute(t,i[t])}));if(s){bh(n,s)}return n}function Za(t,e){if(typeof t.textContent==="undefined"){t.innerText=e}else{t.textContent=e}return t}function th(t,e){if(e.firstChild){e.insertBefore(t,e.firstChild)}else{e.appendChild(t)}}function eh(t,e){Ga(e);return t.classList.contains(e)}function ih(t,...e){t.classList.add(...e.reduce(((t,e)=>t.concat(e.split(/\s+/))),[]));return t}function sh(t,...e){if(!t){la.warn("removeClass was called with an element that doesn't exist");return null}t.classList.remove(...e.reduce(((t,e)=>t.concat(e.split(/\s+/))),[]));return t}function nh(t,e,i){if(typeof i==="function"){i=i(t,e)}if(typeof i!=="boolean"){i=undefined}e.split(/\s+/).forEach((e=>t.classList.toggle(e,i)));return t}function rh(t,e){Object.getOwnPropertyNames(e).forEach((function(i){const s=e[i];if(s===null||typeof s==="undefined"||s===false){t.removeAttribute(i)}else{t.setAttribute(i,s===true?"":s)}}))}function oh(t){const e={};const i=["autoplay","controls","playsinline","loop","muted","default","defaultMuted"];if(t&&t.attributes&&t.attributes.length>0){const s=t.attributes;for(let t=s.length-1;t>=0;t--){const n=s[t].name;let r=s[t].value;if(i.includes(n)){r=r!==null?true:false}e[n]=r}}return e}function ah(t,e){return t.getAttribute(e)}function hh(t,e,i){t.setAttribute(e,i)}function ch(t,e){t.removeAttribute(e)}function lh(){K.body.focus();K.onselectstart=function(){return false}}function uh(){K.onselectstart=function(){return true}}function fh(t){if(t&&t.getBoundingClientRect&&t.parentNode){const e=t.getBoundingClientRect();const i={};["bottom","height","left","right","top","width"].forEach((t=>{if(e[t]!==undefined){i[t]=e[t]}}));if(!i.height){i.height=parseFloat(kh(t,"height"))}if(!i.width){i.width=parseFloat(kh(t,"width"))}return i}}function dh(t){if(!t||t&&!t.offsetParent){return{left:0,top:0,width:0,height:0}}const e=t.offsetWidth;const i=t.offsetHeight;let s=0;let n=0;while(t.offsetParent&&t!==K[sa.fullscreenElement]){s+=t.offsetLeft;n+=t.offsetTop;t=t.offsetParent}return{left:s,top:n,width:e,height:i}}function ph(t,e){const i={x:0,y:0};if(Va){let e=t;while(e&&e.nodeName.toLowerCase()!=="html"){const t=kh(e,"transform");if(/^matrix/.test(t)){const e=t.slice(7,-1).split(/,\s/).map(Number);i.x+=e[4];i.y+=e[5]}else if(/^matrix3d/.test(t)){const e=t.slice(9,-1).split(/,\s/).map(Number);i.x+=e[12];i.y+=e[13]}if(e.assignedSlot&&e.assignedSlot.parentElement&&z.WebKitCSSMatrix){const t=z.getComputedStyle(e.assignedSlot.parentElement).transform;const s=new z.WebKitCSSMatrix(t);i.x+=s.m41;i.y+=s.m42}e=e.parentNode||e.host}}const s={};const n=dh(e.target);const r=dh(t);const o=r.width;const a=r.height;let h=e.offsetY-(r.top-n.top);let c=e.offsetX-(r.left-n.left);if(e.changedTouches){c=e.changedTouches[0].pageX-r.left;h=e.changedTouches[0].pageY+r.top;if(Va){c-=i.x;h-=i.y}}s.y=1-Math.max(0,Math.min(1,h/a));s.x=Math.max(0,Math.min(1,c/o));return s}function vh(t){return ma(t)&&t.nodeType===3}function mh(t){while(t.firstChild){t.removeChild(t.firstChild)}return t}function gh(t){if(typeof t==="function"){t=t()}return(Array.isArray(t)?t:[t]).map((t=>{if(typeof t==="function"){t=t()}if(Wa(t)||vh(t)){return t}if(typeof t==="string"&&/\S/.test(t)){return K.createTextNode(t)}})).filter((t=>t))}function bh(t,e){gh(e).forEach((e=>t.appendChild(e)));return t}function yh(t,e){return bh(mh(t),e)}function jh(t){if(t.button===undefined&&t.buttons===undefined){return true}if(t.button===0&&t.buttons===undefined){return true}if(t.type==="mouseup"&&t.button===0&&t.buttons===0){return true}if(t.type==="mousedown"&&t.button===0&&t.buttons===0){return true}if(t.button!==0||t.buttons!==1){return false}return true}const wh=Ka("querySelector");const Th=Ka("querySelectorAll");function kh(t,e){if(!t||!e){return""}if(typeof z.getComputedStyle==="function"){let i;try{i=z.getComputedStyle(t)}catch(t){return""}return i?i.getPropertyValue(e)||i[e]:""}return""}function Sh(t){[...K.styleSheets].forEach((e=>{try{const i=[...e.cssRules].map((t=>t.cssText)).join("");const s=K.createElement("style");s.textContent=i;t.document.head.appendChild(s)}catch(i){const s=K.createElement("link");s.rel="stylesheet";s.type=e.type;s.media=e.media.mediaText;s.href=e.href;t.document.head.appendChild(s)}}))}var xh=Object.freeze({__proto__:null,isReal:Ya,isEl:Wa,isInFrame:Ja,createEl:Qa,textContent:Za,prependTo:th,hasClass:eh,addClass:ih,removeClass:sh,toggleClass:nh,setAttributes:rh,getAttributes:oh,getAttribute:ah,setAttribute:hh,removeAttribute:ch,blockTextSelection:lh,unblockTextSelection:uh,getBoundingClientRect:fh,findPosition:dh,getPointerPosition:ph,isTextNode:vh,emptyEl:mh,normalizeContent:gh,appendContent:bh,insertContent:yh,isSingleLeftClick:jh,$:wh,$$:Th,computedStyle:kh,copyStyleSheetsToWindow:Sh});let Ah=false;let Eh;const Ih=function(){if(Eh.options.autoSetup===false){return}const t=Array.prototype.slice.call(K.getElementsByTagName("video"));const e=Array.prototype.slice.call(K.getElementsByTagName("audio"));const i=Array.prototype.slice.call(K.getElementsByTagName("video-js"));const s=t.concat(e,i);if(s&&s.length>0){for(let t=0,e=s.length;t<e;t++){const e=s[t];if(e&&e.getAttribute){if(e.player===undefined){const t=e.getAttribute("data-setup");if(t!==null){Eh(e)}}}else{Dh(1);break}}}else if(!Ah){Dh(1)}};function Dh(t,e){if(!Ya()){return}if(e){Eh=e}z.setTimeout(Ih,t)}function Ch(){Ah=true;z.removeEventListener("load",Ch)}if(Ya()){if(K.readyState==="complete"){Ch()}else{z.addEventListener("load",Ch)}}const Nh=function(t){const e=K.createElement("style");e.className=t;return e};const _h=function(t,e){if(t.styleSheet){t.styleSheet.cssText=e}else{t.textContent=e}};var Oh=new WeakMap;const Mh=3;let Rh=Mh;function Lh(){return Rh++}function Ph(t,e){if(!Oh.has(t)){return}const i=Oh.get(t);if(i.handlers[e].length===0){delete i.handlers[e];if(t.removeEventListener){t.removeEventListener(e,i.dispatcher,false)}else if(t.detachEvent){t.detachEvent("on"+e,i.dispatcher)}}if(Object.getOwnPropertyNames(i.handlers).length<=0){delete i.handlers;delete i.dispatcher;delete i.disabled}if(Object.getOwnPropertyNames(i).length===0){Oh.delete(t)}}function $h(t,e,i,s){i.forEach((function(i){t(e,i,s)}))}function Fh(t){if(t.fixed_){return t}function e(){return true}function i(){return false}if(!t||!t.isPropagationStopped||!t.isImmediatePropagationStopped){const s=t||z.event;t={};const n=["layerX","layerY","keyLocation","path","webkitMovementX","webkitMovementY","mozPressure","mozInputSource"];for(const e in s){if(!n.includes(e)){if(!(e==="returnValue"&&s.preventDefault)){t[e]=s[e]}}}if(!t.target){t.target=t.srcElement||K}if(!t.relatedTarget){t.relatedTarget=t.fromElement===t.target?t.toElement:t.fromElement}t.preventDefault=function(){if(s.preventDefault){s.preventDefault()}t.returnValue=false;s.returnValue=false;t.defaultPrevented=true};t.defaultPrevented=false;t.stopPropagation=function(){if(s.stopPropagation){s.stopPropagation()}t.cancelBubble=true;s.cancelBubble=true;t.isPropagationStopped=e};t.isPropagationStopped=i;t.stopImmediatePropagation=function(){if(s.stopImmediatePropagation){s.stopImmediatePropagation()}t.isImmediatePropagationStopped=e;t.stopPropagation()};t.isImmediatePropagationStopped=i;if(t.clientX!==null&&t.clientX!==undefined){const e=K.documentElement;const i=K.body;t.pageX=t.clientX+(e&&e.scrollLeft||i&&i.scrollLeft||0)-(e&&e.clientLeft||i&&i.clientLeft||0);t.pageY=t.clientY+(e&&e.scrollTop||i&&i.scrollTop||0)-(e&&e.clientTop||i&&i.clientTop||0)}t.which=t.charCode||t.keyCode;if(t.button!==null&&t.button!==undefined){t.button=t.button&1?0:t.button&4?1:t.button&2?2:0}}t.fixed_=true;return t}let Uh;const Bh=function(){if(typeof Uh!=="boolean"){Uh=false;try{const t=Object.defineProperty({},"passive",{get(){Uh=true}});z.addEventListener("test",null,t);z.removeEventListener("test",null,t)}catch(t){}}return Uh};const qh=["touchstart","touchmove"];function Vh(t,e,i){if(Array.isArray(e)){return $h(Vh,t,e,i)}if(!Oh.has(t)){Oh.set(t,{})}const s=Oh.get(t);if(!s.handlers){s.handlers={}}if(!s.handlers[e]){s.handlers[e]=[]}if(!i.guid){i.guid=Lh()}s.handlers[e].push(i);if(!s.dispatcher){s.disabled=false;s.dispatcher=function(e,i){if(s.disabled){return}e=Fh(e);const n=s.handlers[e.type];if(n){const s=n.slice(0);for(let n=0,r=s.length;n<r;n++){if(e.isImmediatePropagationStopped()){break}else{try{s[n].call(t,e,i)}catch(t){la.error(t)}}}}}}if(s.handlers[e].length===1){if(t.addEventListener){let i=false;if(Bh()&&qh.indexOf(e)>-1){i={passive:true}}t.addEventListener(e,s.dispatcher,i)}else if(t.attachEvent){t.attachEvent("on"+e,s.dispatcher)}}}function zh(t,e,i){if(!Oh.has(t)){return}const s=Oh.get(t);if(!s.handlers){return}if(Array.isArray(e)){return $h(zh,t,e,i)}const n=function(t,e){s.handlers[e]=[];Ph(t,e)};if(e===undefined){for(const e in s.handlers){if(Object.prototype.hasOwnProperty.call(s.handlers||{},e)){n(t,e)}}return}const r=s.handlers[e];if(!r){return}if(!i){n(t,e);return}if(i.guid){for(let t=0;t<r.length;t++){if(r[t].guid===i.guid){r.splice(t--,1)}}}Ph(t,e)}function Hh(t,e,i){const s=Oh.has(t)?Oh.get(t):{};const n=t.parentNode||t.ownerDocument;if(typeof e==="string"){e={type:e,target:t}}else if(!e.target){e.target=t}e=Fh(e);if(s.dispatcher){s.dispatcher.call(t,e,i)}if(n&&!e.isPropagationStopped()&&e.bubbles===true){Hh.call(null,n,e,i)}else if(!n&&!e.defaultPrevented&&e.target&&e.target[e.type]){if(!Oh.has(e.target)){Oh.set(e.target,{})}const t=Oh.get(e.target);if(e.target[e.type]){t.disabled=true;if(typeof e.target[e.type]==="function"){e.target[e.type]()}t.disabled=false}}return!e.defaultPrevented}function Xh(t,e,i){if(Array.isArray(e)){return $h(Xh,t,e,i)}const s=function(){zh(t,e,s);i.apply(this,arguments)};s.guid=i.guid=i.guid||Lh();Vh(t,e,s)}function Gh(t,e,i){const s=function(){zh(t,e,s);i.apply(this,arguments)};s.guid=i.guid=i.guid||Lh();Vh(t,e,s)}var Yh=Object.freeze({__proto__:null,fixEvent:Fh,on:Vh,off:zh,trigger:Hh,one:Xh,any:Gh});const Wh=30;const Jh=function(t,e,i){if(!e.guid){e.guid=Lh()}const s=e.bind(t);s.guid=i?i+"_"+e.guid:e.guid;return s};const Kh=function(t,e){let i=z.performance.now();const s=function(...s){const n=z.performance.now();if(n-i>=e){t(...s);i=n}};return s};const Qh=function(t,e,i,s=z){let n;const r=()=>{s.clearTimeout(n);n=null};const o=function(){const r=this;const o=arguments;let a=function(){n=null;a=null;if(!i){t.apply(r,o)}};if(!n&&i){t.apply(r,o)}s.clearTimeout(n);n=s.setTimeout(a,e)};o.cancel=r;return o};var Zh=Object.freeze({__proto__:null,UPDATE_REFRESH_INTERVAL:Wh,bind_:Jh,throttle:Kh,debounce:Qh});let tc;class ec{on(t,e){const i=this.addEventListener;this.addEventListener=()=>{};Vh(this,t,e);this.addEventListener=i}off(t,e){zh(this,t,e)}one(t,e){const i=this.addEventListener;this.addEventListener=()=>{};Xh(this,t,e);this.addEventListener=i}any(t,e){const i=this.addEventListener;this.addEventListener=()=>{};Gh(this,t,e);this.addEventListener=i}trigger(t){const e=t.type||t;if(typeof t==="string"){t={type:e}}t=Fh(t);if(this.allowedEvents_[e]&&this["on"+e]){this["on"+e](t)}Hh(this,t)}queueTrigger(t){if(!tc){tc=new Map}const e=t.type||t;let i=tc.get(this);if(!i){i=new Map;tc.set(this,i)}const s=i.get(e);i.delete(e);z.clearTimeout(s);const n=z.setTimeout((()=>{i.delete(e);if(i.size===0){i=null;tc.delete(this)}this.trigger(t)}),0);i.set(e,n)}}ec.prototype.allowedEvents_={};ec.prototype.addEventListener=ec.prototype.on;ec.prototype.removeEventListener=ec.prototype.off;ec.prototype.dispatchEvent=ec.prototype.trigger;const ic=t=>{if(typeof t.name==="function"){return t.name()}if(typeof t.name==="string"){return t.name}if(t.name_){return t.name_}if(t.constructor&&t.constructor.name){return t.constructor.name}return typeof t};const sc=t=>t instanceof ec||!!t.eventBusEl_&&["on","one","off","trigger"].every((e=>typeof t[e]==="function"));const nc=(t,e)=>{if(sc(t)){e()}else{if(!t.eventedCallbacks){t.eventedCallbacks=[]}t.eventedCallbacks.push(e)}};const rc=t=>typeof t==="string"&&/\S/.test(t)||Array.isArray(t)&&!!t.length;const oc=(t,e,i)=>{if(!t||!t.nodeName&&!sc(t)){throw new Error(`Invalid target for ${ic(e)}#${i}; must be a DOM node or evented object.`)}};const ac=(t,e,i)=>{if(!rc(t)){throw new Error(`Invalid event type for ${ic(e)}#${i}; must be a non-empty string or array.`)}};const hc=(t,e,i)=>{if(typeof t!=="function"){throw new Error(`Invalid listener for ${ic(e)}#${i}; must be a function.`)}};const cc=(t,e,i)=>{const s=e.length<3||e[0]===t||e[0]===t.eventBusEl_;let n;let r;let o;if(s){n=t.eventBusEl_;if(e.length>=3){e.shift()}[r,o]=e}else{n=e[0];r=e[1];o=e[2]}oc(n,t,i);ac(r,t,i);hc(o,t,i);o=Jh(t,o);return{isTargetingSelf:s,target:n,type:r,listener:o}};const lc=(t,e,i,s)=>{oc(t,t,e);if(t.nodeName){Yh[e](t,i,s)}else{t[e](i,s)}};const uc={on(...t){const{isTargetingSelf:e,target:i,type:s,listener:n}=cc(this,t,"on");lc(i,"on",s,n);if(!e){const t=()=>this.off(i,s,n);t.guid=n.guid;const e=()=>this.off("dispose",t);e.guid=n.guid;lc(this,"on","dispose",t);lc(i,"on","dispose",e)}},one(...t){const{isTargetingSelf:e,target:i,type:s,listener:n}=cc(this,t,"one");if(e){lc(i,"one",s,n)}else{const t=(...e)=>{this.off(i,s,t);n.apply(null,e)};t.guid=n.guid;lc(i,"one",s,t)}},any(...t){const{isTargetingSelf:e,target:i,type:s,listener:n}=cc(this,t,"any");if(e){lc(i,"any",s,n)}else{const t=(...e)=>{this.off(i,s,t);n.apply(null,e)};t.guid=n.guid;lc(i,"any",s,t)}},off(t,e,i){if(!t||rc(t)){zh(this.eventBusEl_,t,e)}else{const s=t;const n=e;oc(s,this,"off");ac(n,this,"off");hc(i,this,"off");i=Jh(this,i);this.off("dispose",i);if(s.nodeName){zh(s,n,i);zh(s,"dispose",i)}else if(sc(s)){s.off(n,i);s.off("dispose",i)}}},trigger(t,e){oc(this.eventBusEl_,this,"trigger");const i=t&&typeof t!=="string"?t.type:t;if(!rc(i)){throw new Error(`Invalid event type for ${ic(this)}#trigger; `+"must be a non-empty string or object with a type key that has a non-empty value.")}return Hh(this.eventBusEl_,t,e)}};function fc(t,e={}){const{eventBusKey:i}=e;if(i){if(!t[i].nodeName){throw new Error(`The eventBusKey "${i}" does not refer to an element.`)}t.eventBusEl_=t[i]}else{t.eventBusEl_=Qa("span",{className:"vjs-event-bus"})}Object.assign(t,uc);if(t.eventedCallbacks){t.eventedCallbacks.forEach((t=>{t()}))}t.on("dispose",(()=>{t.off();[t,t.el_,t.eventBusEl_].forEach((function(t){if(t&&Oh.has(t)){Oh.delete(t)}}));z.setTimeout((()=>{t.eventBusEl_=null}),0)}));return t}const dc={state:{},setState(t){if(typeof t==="function"){t=t()}let e;pa(t,((t,i)=>{if(this.state[i]!==t){e=e||{};e[i]={from:this.state[i],to:t}}this.state[i]=t}));if(e&&sc(this)){this.trigger({changes:e,type:"statechanged"})}return e}};function pc(t,e){Object.assign(t,dc);t.state=Object.assign({},t.state,e);if(typeof t.handleStateChanged==="function"&&sc(t)){t.on("statechanged",t.handleStateChanged)}return t}const vc=function(t){if(typeof t!=="string"){return t}return t.replace(/./,(t=>t.toLowerCase()))};const mc=function(t){if(typeof t!=="string"){return t}return t.replace(/./,(t=>t.toUpperCase()))};const gc=function(t,e){return mc(t)===mc(e)};var bc=Object.freeze({__proto__:null,toLowerCase:vc,toTitleCase:mc,titleCaseEquals:gc});class yc{constructor(t,e,i){if(!t&&this.play){this.player_=t=this}else{this.player_=t}this.isDisposed_=false;this.parentComponent_=null;this.options_=ba({},this.options_);e=this.options_=ba(this.options_,e);this.id_=e.id||e.el&&e.el.id;if(!this.id_){const e=t&&t.id&&t.id()||"no_player";this.id_=`${e}_component_${Lh()}`}this.name_=e.name||null;if(e.el){this.el_=e.el}else if(e.createEl!==false){this.el_=this.createEl()}if(e.className&&this.el_){e.className.split(" ").forEach((t=>this.addClass(t)))}["on","off","one","any","trigger"].forEach((t=>{this[t]=undefined}));if(e.evented!==false){fc(this,{eventBusKey:this.el_?"el_":null});this.handleLanguagechange=this.handleLanguagechange.bind(this);this.on(this.player_,"languagechange",this.handleLanguagechange)}pc(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_=false;if(e.initChildren!==false){this.initChildren()}this.ready(i);if(e.reportTouchActivity!==false){this.enableTouchActivity()}}on(t,e){}off(t,e){}one(t,e){}any(t,e){}trigger(t,e){}dispose(t={}){if(this.isDisposed_){return}if(this.readyQueue_){this.readyQueue_.length=0}this.trigger({type:"dispose",bubbles:false});this.isDisposed_=true;if(this.children_){for(let t=this.children_.length-1;t>=0;t--){if(this.children_[t].dispose){this.children_[t].dispose()}}}this.children_=null;this.childIndex_=null;this.childNameIndex_=null;this.parentComponent_=null;if(this.el_){if(this.el_.parentNode){if(t.restoreEl){this.el_.parentNode.replaceChild(t.restoreEl,this.el_)}else{this.el_.parentNode.removeChild(this.el_)}}this.el_=null}this.player_=null}isDisposed(){return Boolean(this.isDisposed_)}player(){return this.player_}options(t){if(!t){return this.options_}this.options_=ba(this.options_,t);return this.options_}el(){return this.el_}createEl(t,e,i){return Qa(t,e,i)}localize(t,e,i=t){const s=this.player_.language&&this.player_.language();const n=this.player_.languages&&this.player_.languages();const r=n&&n[s];const o=s&&s.split("-")[0];const a=n&&n[o];let h=i;if(r&&r[t]){h=r[t]}else if(a&&a[t]){h=a[t]}if(e){h=h.replace(/\{(\d+)\}/g,(function(t,i){const s=e[i-1];let n=s;if(typeof s==="undefined"){n=t}return n}))}return h}handleLanguagechange(){}contentEl(){return this.contentEl_||this.el_}id(){return this.id_}name(){return this.name_}children(){return this.children_}getChildById(t){return this.childIndex_[t]}getChild(t){if(!t){return}return this.childNameIndex_[t]}getDescendant(...t){t=t.reduce(((t,e)=>t.concat(e)),[]);let e=this;for(let i=0;i<t.length;i++){e=e.getChild(t[i]);if(!e||!e.getChild){return}}return e}setIcon(t,e=this.el()){if(!this.player_.options_.experimentalSvgIcons){return}const i="http://www.w3.org/2000/svg";const s=Qa("span",{className:"vjs-icon-placeholder vjs-svg-icon"},{"aria-hidden":"true"});const n=K.createElementNS(i,"svg");n.setAttributeNS(null,"viewBox","0 0 512 512");const r=K.createElementNS(i,"use");n.appendChild(r);r.setAttributeNS(null,"href",`#vjs-icon-${t}`);s.appendChild(n);if(this.iconIsSet_){e.replaceChild(s,e.querySelector(".vjs-icon-placeholder"))}else{e.appendChild(s)}this.iconIsSet_=true;return s}addChild(t,e={},i=this.children_.length){let s;let n;if(typeof t==="string"){n=mc(t);const i=e.componentClass||n;e.name=n;const r=yc.getComponent(i);if(!r){throw new Error(`Component ${i} does not exist`)}if(typeof r!=="function"){return null}s=new r(this.player_||this,e)}else{s=t}if(s.parentComponent_){s.parentComponent_.removeChild(s)}this.children_.splice(i,0,s);s.parentComponent_=this;if(typeof s.id==="function"){this.childIndex_[s.id()]=s}n=n||s.name&&mc(s.name());if(n){this.childNameIndex_[n]=s;this.childNameIndex_[vc(n)]=s}if(typeof s.el==="function"&&s.el()){let t=null;if(this.children_[i+1]){if(this.children_[i+1].el_){t=this.children_[i+1].el_}else if(Wa(this.children_[i+1])){t=this.children_[i+1]}}this.contentEl().insertBefore(s.el(),t)}return s}removeChild(t){if(typeof t==="string"){t=this.getChild(t)}if(!t||!this.children_){return}let e=false;for(let i=this.children_.length-1;i>=0;i--){if(this.children_[i]===t){e=true;this.children_.splice(i,1);break}}if(!e){return}t.parentComponent_=null;this.childIndex_[t.id()]=null;this.childNameIndex_[mc(t.name())]=null;this.childNameIndex_[vc(t.name())]=null;const i=t.el();if(i&&i.parentNode===this.contentEl()){this.contentEl().removeChild(t.el())}}initChildren(){const t=this.options_.children;if(t){const e=this.options_;const i=t=>{const i=t.name;let s=t.opts;if(e[i]!==undefined){s=e[i]}if(s===false){return}if(s===true){s={}}s.playerOptions=this.options_.playerOptions;const n=this.addChild(i,s);if(n){this[i]=n}};let s;const n=yc.getComponent("Tech");if(Array.isArray(t)){s=t}else{s=Object.keys(t)}s.concat(Object.keys(this.options_).filter((function(t){return!s.some((function(e){if(typeof e==="string"){return t===e}return t===e.name}))}))).map((e=>{let i;let s;if(typeof e==="string"){i=e;s=t[i]||this.options_[i]||{}}else{i=e.name;s=e}return{name:i,opts:s}})).filter((t=>{const e=yc.getComponent(t.opts.componentClass||mc(t.name));return e&&!n.isTech(e)})).forEach(i)}}buildCSSClass(){return""}ready(t,e=false){if(!t){return}if(!this.isReady_){this.readyQueue_=this.readyQueue_||[];this.readyQueue_.push(t);return}if(e){t.call(this)}else{this.setTimeout(t,1)}}triggerReady(){this.isReady_=true;this.setTimeout((function(){const t=this.readyQueue_;this.readyQueue_=[];if(t&&t.length>0){t.forEach((function(t){t.call(this)}),this)}this.trigger("ready")}),1)}$(t,e){return wh(t,e||this.contentEl())}$$(t,e){return Th(t,e||this.contentEl())}hasClass(t){return eh(this.el_,t)}addClass(...t){ih(this.el_,...t)}removeClass(...t){sh(this.el_,...t)}toggleClass(t,e){nh(this.el_,t,e)}show(){this.removeClass("vjs-hidden")}hide(){this.addClass("vjs-hidden")}lockShowing(){this.addClass("vjs-lock-showing")}unlockShowing(){this.removeClass("vjs-lock-showing")}getAttribute(t){return ah(this.el_,t)}setAttribute(t,e){hh(this.el_,t,e)}removeAttribute(t){ch(this.el_,t)}width(t,e){return this.dimension("width",t,e)}height(t,e){return this.dimension("height",t,e)}dimensions(t,e){this.width(t,true);this.height(e)}dimension(t,e,i){if(e!==undefined){if(e===null||e!==e){e=0}if((""+e).indexOf("%")!==-1||(""+e).indexOf("px")!==-1){this.el_.style[t]=e}else if(e==="auto"){this.el_.style[t]=""}else{this.el_.style[t]=e+"px"}if(!i){this.trigger("componentresize")}return}if(!this.el_){return 0}const s=this.el_.style[t];const n=s.indexOf("px");if(n!==-1){return parseInt(s.slice(0,n),10)}return parseInt(this.el_["offset"+mc(t)],10)}currentDimension(t){let e=0;if(t!=="width"&&t!=="height"){throw new Error("currentDimension only accepts width or height value")}e=kh(this.el_,t);e=parseFloat(e);if(e===0||isNaN(e)){const i=`offset${mc(t)}`;e=this.el_[i]}return e}currentDimensions(){return{width:this.currentDimension("width"),height:this.currentDimension("height")}}currentWidth(){return this.currentDimension("width")}currentHeight(){return this.currentDimension("height")}getPositions(){const t=this.el_.getBoundingClientRect();const e={x:t.x,y:t.y,width:t.width,height:t.height,top:t.top,right:t.right,bottom:t.bottom,left:t.left};const i={x:t.left+t.width/2,y:t.top+t.height/2,width:0,height:0,top:t.top+t.height/2,right:t.left+t.width/2,bottom:t.top+t.height/2,left:t.left+t.width/2};return{boundingClientRect:e,center:i}}focus(){this.el_.focus()}blur(){this.el_.blur()}handleKeyDown(t){if(this.player_){if(t.key!=="Tab"&&!(this.player_.options_.playerOptions.spatialNavigation&&this.player_.options_.playerOptions.spatialNavigation.enabled)){t.stopPropagation()}this.player_.handleKeyDown(t)}}handleKeyPress(t){this.handleKeyDown(t)}emitTapEvents(){let t=0;let e=null;const i=10;const s=200;let n;this.on("touchstart",(function(i){if(i.touches.length===1){e={pageX:i.touches[0].pageX,pageY:i.touches[0].pageY};t=z.performance.now();n=true}}));this.on("touchmove",(function(t){if(t.touches.length>1){n=false}else if(e){const s=t.touches[0].pageX-e.pageX;const r=t.touches[0].pageY-e.pageY;const o=Math.sqrt(s*s+r*r);if(o>i){n=false}}}));const r=function(){n=false};this.on("touchleave",r);this.on("touchcancel",r);this.on("touchend",(function(i){e=null;if(n===true){const e=z.performance.now()-t;if(e<s){i.preventDefault();this.trigger("tap")}}}))}enableTouchActivity(){if(!this.player()||!this.player().reportUserActivity){return}const t=Jh(this.player(),this.player().reportUserActivity);let e;this.on("touchstart",(function(){t();this.clearInterval(e);e=this.setInterval(t,250)}));const i=function(i){t();this.clearInterval(e)};this.on("touchmove",t);this.on("touchend",i);this.on("touchcancel",i)}setTimeout(t,e){var i;t=Jh(this,t);this.clearTimersOnDispose_();i=z.setTimeout((()=>{if(this.setTimeoutIds_.has(i)){this.setTimeoutIds_.delete(i)}t()}),e);this.setTimeoutIds_.add(i);return i}clearTimeout(t){if(this.setTimeoutIds_.has(t)){this.setTimeoutIds_.delete(t);z.clearTimeout(t)}return t}setInterval(t,e){t=Jh(this,t);this.clearTimersOnDispose_();const i=z.setInterval(t,e);this.setIntervalIds_.add(i);return i}clearInterval(t){if(this.setIntervalIds_.has(t)){this.setIntervalIds_.delete(t);z.clearInterval(t)}return t}requestAnimationFrame(t){this.clearTimersOnDispose_();var e;t=Jh(this,t);e=z.requestAnimationFrame((()=>{if(this.rafIds_.has(e)){this.rafIds_.delete(e)}t()}));this.rafIds_.add(e);return e}requestNamedAnimationFrame(t,e){if(this.namedRafs_.has(t)){return}this.clearTimersOnDispose_();e=Jh(this,e);const i=this.requestAnimationFrame((()=>{e();if(this.namedRafs_.has(t)){this.namedRafs_.delete(t)}}));this.namedRafs_.set(t,i);return t}cancelNamedAnimationFrame(t){if(!this.namedRafs_.has(t)){return}this.cancelAnimationFrame(this.namedRafs_.get(t));this.namedRafs_.delete(t)}cancelAnimationFrame(t){if(this.rafIds_.has(t)){this.rafIds_.delete(t);z.cancelAnimationFrame(t)}return t}clearTimersOnDispose_(){if(this.clearingTimersOnDispose_){return}this.clearingTimersOnDispose_=true;this.one("dispose",(()=>{[["namedRafs_","cancelNamedAnimationFrame"],["rafIds_","cancelAnimationFrame"],["setTimeoutIds_","clearTimeout"],["setIntervalIds_","clearInterval"]].forEach((([t,e])=>{this[t].forEach(((t,i)=>this[e](i)))}));this.clearingTimersOnDispose_=false}))}getIsDisabled(){return Boolean(this.el_.disabled)}getIsExpresslyInert(){return this.el_.inert&&!this.el_.ownerDocument.documentElement.inert}getIsFocusable(t){const e=t||this.el_;return e.tabIndex>=0&&!(this.getIsDisabled()||this.getIsExpresslyInert())}getIsAvailableToBeFocused(t){function e(t){const e=z.getComputedStyle(t,null);const i=e.getPropertyValue("visibility");const s=e.getPropertyValue("display");const n=["hidden","collapse"];return s!=="none"&&!n.includes(i)}function i(t){if(!e(t.parentElement)){return false}if(!e(t)||t.style.opacity==="0"||z.getComputedStyle(t).height==="0px"||z.getComputedStyle(t).width==="0px"){return false}return true}function s(t){if(t.offsetWidth+t.offsetHeight+t.getBoundingClientRect().height+t.getBoundingClientRect().width===0){return false}const e={x:t.getBoundingClientRect().left+t.offsetWidth/2,y:t.getBoundingClientRect().top+t.offsetHeight/2};if(e.x<0){return false}if(e.x>(K.documentElement.clientWidth||z.innerWidth)){return false}if(e.y<0){return false}if(e.y>(K.documentElement.clientHeight||z.innerHeight)){return false}let i=K.elementFromPoint(e.x,e.y);while(i){if(i===t){return true}if(i.parentNode){i=i.parentNode}else{return false}}}if(!t){t=this.el()}if(s(t)&&i(t)&&(!t.parentElement||t.tabIndex>=0)){return true}return false}static registerComponent(t,e){if(typeof t!=="string"||!t){throw new Error(`Illegal component name, "${t}"; must be a non-empty string.`)}const i=yc.getComponent("Tech");const s=i&&i.isTech(e);const n=yc===e||yc.prototype.isPrototypeOf(e.prototype);if(s||!n){let e;if(s){e="techs must be registered using Tech.registerTech()"}else{e="must be a Component subclass"}throw new Error(`Illegal component, "${t}"; ${e}.`)}t=mc(t);if(!yc.components_){yc.components_={}}const r=yc.getComponent("Player");if(t==="Player"&&r&&r.players){const t=r.players;const e=Object.keys(t);if(t&&e.length>0&&e.map((e=>t[e])).every(Boolean)){throw new Error("Can not register Player component after player has been created.")}}yc.components_[t]=e;yc.components_[vc(t)]=e;return e}static getComponent(t){if(!t||!yc.components_){return}return yc.components_[t]}}yc.registerComponent("Component",yc);function jc(t,e,i){if(typeof e!=="number"||e<0||e>i){throw new Error(`Failed to execute '${t}' on 'TimeRanges': The index provided (${e}) is non-numeric or out of bounds (0-${i}).`)}}function wc(t,e,i,s){jc(t,s,i.length-1);return i[s][e]}function Tc(t){let e;if(t===undefined||t.length===0){e={length:0,start(){throw new Error("This TimeRanges object is empty")},end(){throw new Error("This TimeRanges object is empty")}}}else{e={length:t.length,start:wc.bind(null,"start",0,t),end:wc.bind(null,"end",1,t)}}if(z.Symbol&&z.Symbol.iterator){e[z.Symbol.iterator]=()=>(t||[]).values()}return e}function kc(t,e){if(Array.isArray(t)){return Tc(t)}else if(t===undefined||e===undefined){return Tc()}return Tc([[t,e]])}const Sc=function(t,e){t=t<0?0:t;let i=Math.floor(t%60);let s=Math.floor(t/60%60);let n=Math.floor(t/3600);const r=Math.floor(e/60%60);const o=Math.floor(e/3600);if(isNaN(t)||t===Infinity){n=s=i="-"}n=n>0||o>0?n+":":"";s=((n||r>=10)&&s<10?"0"+s:s)+":";i=i<10?"0"+i:i;return n+s+i};let xc=Sc;function Ac(t){xc=t}function Ec(){xc=Sc}function Ic(t,e=t){return xc(t,e)}var Dc=Object.freeze({__proto__:null,createTimeRanges:kc,createTimeRange:kc,setFormatTime:Ac,resetFormatTime:Ec,formatTime:Ic});function Cc(t,e){let i=0;let s;let n;if(!e){return 0}if(!t||!t.length){t=kc(0,0)}for(let r=0;r<t.length;r++){s=t.start(r);n=t.end(r);if(n>e){n=e}i+=n-s}return i/e}function Nc(t){if(t instanceof Nc){return t}if(typeof t==="number"){this.code=t}else if(typeof t==="string"){this.message=t}else if(ma(t)){if(typeof t.code==="number"){this.code=t.code}Object.assign(this,t)}if(!this.message){this.message=Nc.defaultMessages[this.code]||""}}Nc.prototype.code=0;Nc.prototype.message="";Nc.prototype.status=null;Nc.prototype.metadata=null;Nc.errorTypes=["MEDIA_ERR_CUSTOM","MEDIA_ERR_ABORTED","MEDIA_ERR_NETWORK","MEDIA_ERR_DECODE","MEDIA_ERR_SRC_NOT_SUPPORTED","MEDIA_ERR_ENCRYPTED"];Nc.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."};Nc.MEDIA_ERR_CUSTOM=0;Nc.prototype.MEDIA_ERR_CUSTOM=0;Nc.MEDIA_ERR_ABORTED=1;Nc.prototype.MEDIA_ERR_ABORTED=1;Nc.MEDIA_ERR_NETWORK=2;Nc.prototype.MEDIA_ERR_NETWORK=2;Nc.MEDIA_ERR_DECODE=3;Nc.prototype.MEDIA_ERR_DECODE=3;Nc.MEDIA_ERR_SRC_NOT_SUPPORTED=4;Nc.prototype.MEDIA_ERR_SRC_NOT_SUPPORTED=4;Nc.MEDIA_ERR_ENCRYPTED=5;Nc.prototype.MEDIA_ERR_ENCRYPTED=5;function _c(t){return t!==undefined&&t!==null&&typeof t.then==="function"}function Oc(t){if(_c(t)){t.then(null,(t=>{}))}}const Mc=function(t){const e=["kind","label","language","id","inBandMetadataTrackDispatchType","mode","src"].reduce(((e,i,s)=>{if(t[i]){e[i]=t[i]}return e}),{cues:t.cues&&Array.prototype.map.call(t.cues,(function(t){return{startTime:t.startTime,endTime:t.endTime,text:t.text,id:t.id}}))});return e};const Rc=function(t){const e=t.$$("track");const i=Array.prototype.map.call(e,(t=>t.track));const s=Array.prototype.map.call(e,(function(t){const e=Mc(t.track);if(t.src){e.src=t.src}return e}));return s.concat(Array.prototype.filter.call(t.textTracks(),(function(t){return i.indexOf(t)===-1})).map(Mc))};const Lc=function(t,e){t.forEach((function(t){const i=e.addRemoteTextTrack(t).track;if(!t.src&&t.cues){t.cues.forEach((t=>i.addCue(t)))}}));return e.textTracks()};var Pc={textTracksToJson:Rc,jsonToTextTracks:Lc,trackToJson_:Mc};const $c="vjs-modal-dialog";class Fc extends yc{constructor(t,e){super(t,e);this.handleKeyDown_=t=>this.handleKeyDown(t);this.close_=t=>this.close(t);this.opened_=this.hasBeenOpened_=this.hasBeenFilled_=false;this.closeable(!this.options_.uncloseable);this.content(this.options_.content);this.contentEl_=Qa("div",{className:`${$c}-content`},{role:"document"});this.descEl_=Qa("p",{className:`${$c}-description vjs-control-text`,id:this.el().getAttribute("aria-describedby")});Za(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`${$c} vjs-hidden ${super.buildCSSClass()}`}label(){return this.localize(this.options_.label||"Modal Window")}description(){let t=this.options_.description||this.localize("This is a modal window.");if(this.closeable()){t+=" "+this.localize("This modal can be closed by pressing the Escape key or activating the close button.")}return t}open(){if(this.opened_){if(this.options_.fillAlways){this.fill()}return}const t=this.player();this.trigger("beforemodalopen");this.opened_=true;if(this.options_.fillAlways||!this.hasBeenOpened_&&!this.hasBeenFilled_){this.fill()}this.wasPlaying_=!t.paused();if(this.options_.pauseOnOpen&&this.wasPlaying_){t.pause()}this.on("keydown",this.handleKeyDown_);this.hadControls_=t.controls();t.controls(false);this.show();this.conditionalFocus_();this.el().setAttribute("aria-hidden","false");this.trigger("modalopen");this.hasBeenOpened_=true}opened(t){if(typeof t==="boolean"){this[t?"open":"close"]()}return this.opened_}close(){if(!this.opened_){return}const t=this.player();this.trigger("beforemodalclose");this.opened_=false;if(this.wasPlaying_&&this.options_.pauseOnOpen){t.play()}this.off("keydown",this.handleKeyDown_);if(this.hadControls_){t.controls(true)}this.hide();this.el().setAttribute("aria-hidden","true");this.trigger({type:"modalclose",bubbles:true});this.conditionalBlur_();if(this.options_.temporary){this.dispose()}}closeable(t){if(typeof t==="boolean"){const e=this.closeable_=!!t;let i=this.getChild("closeButton");if(e&&!i){const t=this.contentEl_;this.contentEl_=this.el_;i=this.addChild("closeButton",{controlText:"Close Modal Dialog"});this.contentEl_=t;this.on(i,"close",this.close_)}if(!e&&i){this.off(i,"close",this.close_);this.removeChild(i);i.dispose()}}return this.closeable_}fill(){this.fillWith(this.content())}fillWith(t){const e=this.contentEl();const i=e.parentNode;const s=e.nextSibling;this.trigger("beforemodalfill");this.hasBeenFilled_=true;i.removeChild(e);this.empty();yh(e,t);this.trigger("modalfill");if(s){i.insertBefore(e,s)}else{i.appendChild(e)}const n=this.getChild("closeButton");if(n){i.appendChild(n.el_)}this.trigger("aftermodalfill")}empty(){this.trigger("beforemodalempty");mh(this.contentEl());this.trigger("modalempty")}content(t){if(typeof t!=="undefined"){this.content_=t}return this.content_}conditionalFocus_(){const t=K.activeElement;const e=this.player_.el_;this.previouslyActiveEl_=null;if(e.contains(t)||e===t){this.previouslyActiveEl_=t;this.focus()}}conditionalBlur_(){if(this.previouslyActiveEl_){this.previouslyActiveEl_.focus();this.previouslyActiveEl_=null}}handleKeyDown(t){this.trigger({type:"modalKeydown",originalEvent:t,target:this,bubbles:true});t.stopPropagation();if(t.key==="Escape"&&this.closeable()){t.preventDefault();this.close();return}if(t.key!=="Tab"){return}const e=this.focusableEls_();const i=this.el_.querySelector(":focus");let s;for(let t=0;t<e.length;t++){if(i===e[t]){s=t;break}}if(K.activeElement===this.el_){s=0}if(t.shiftKey&&s===0){e[e.length-1].focus();t.preventDefault()}else if(!t.shiftKey&&s===e.length-1){e[0].focus();t.preventDefault()}}focusableEls_(){const t=this.el_.querySelectorAll("*");return Array.prototype.filter.call(t,(t=>(t instanceof z.HTMLAnchorElement||t instanceof z.HTMLAreaElement)&&t.hasAttribute("href")||(t instanceof z.HTMLInputElement||t instanceof z.HTMLSelectElement||t instanceof z.HTMLTextAreaElement||t instanceof z.HTMLButtonElement)&&!t.hasAttribute("disabled")||t instanceof z.HTMLIFrameElement||t instanceof z.HTMLObjectElement||t instanceof z.HTMLEmbedElement||t.hasAttribute("tabindex")&&t.getAttribute("tabindex")!==-1||t.hasAttribute("contenteditable")))}}Fc.prototype.options_={pauseOnOpen:true,temporary:true};yc.registerComponent("ModalDialog",Fc);class Uc extends ec{constructor(t=[]){super();this.tracks_=[];Object.defineProperty(this,"length",{get(){return this.tracks_.length}});for(let e=0;e<t.length;e++){this.addTrack(t[e])}}addTrack(t){const e=this.tracks_.length;if(!(""+e in this)){Object.defineProperty(this,e,{get(){return this.tracks_[e]}})}if(this.tracks_.indexOf(t)===-1){this.tracks_.push(t);this.trigger({track:t,type:"addtrack",target:this})}t.labelchange_=()=>{this.trigger({track:t,type:"labelchange",target:this})};if(sc(t)){t.addEventListener("labelchange",t.labelchange_)}}removeTrack(t){let e;for(let i=0,s=this.length;i<s;i++){if(this[i]===t){e=this[i];if(e.off){e.off()}this.tracks_.splice(i,1);break}}if(!e){return}this.trigger({track:e,type:"removetrack",target:this})}getTrackById(t){let e=null;for(let i=0,s=this.length;i<s;i++){const s=this[i];if(s.id===t){e=s;break}}return e}}Uc.prototype.allowedEvents_={change:"change",addtrack:"addtrack",removetrack:"removetrack",labelchange:"labelchange"};for(const Lb in Uc.prototype.allowedEvents_){Uc.prototype["on"+Lb]=null}const Bc=function(t,e){for(let i=0;i<t.length;i++){if(!Object.keys(t[i]).length||e.id===t[i].id){continue}t[i].enabled=false}};class qc extends Uc{constructor(t=[]){for(let e=t.length-1;e>=0;e--){if(t[e].enabled){Bc(t,t[e]);break}}super(t);this.changing_=false}addTrack(t){if(t.enabled){Bc(this,t)}super.addTrack(t);if(!t.addEventListener){return}t.enabledChange_=()=>{if(this.changing_){return}this.changing_=true;Bc(this,t);this.changing_=false;this.trigger("change")};t.addEventListener("enabledchange",t.enabledChange_)}removeTrack(t){super.removeTrack(t);if(t.removeEventListener&&t.enabledChange_){t.removeEventListener("enabledchange",t.enabledChange_);t.enabledChange_=null}}}const Vc=function(t,e){for(let i=0;i<t.length;i++){if(!Object.keys(t[i]).length||e.id===t[i].id){continue}t[i].selected=false}};class zc extends Uc{constructor(t=[]){for(let e=t.length-1;e>=0;e--){if(t[e].selected){Vc(t,t[e]);break}}super(t);this.changing_=false;Object.defineProperty(this,"selectedIndex",{get(){for(let t=0;t<this.length;t++){if(this[t].selected){return t}}return-1},set(){}})}addTrack(t){if(t.selected){Vc(this,t)}super.addTrack(t);if(!t.addEventListener){return}t.selectedChange_=()=>{if(this.changing_){return}this.changing_=true;Vc(this,t);this.changing_=false;this.trigger("change")};t.addEventListener("selectedchange",t.selectedChange_)}removeTrack(t){super.removeTrack(t);if(t.removeEventListener&&t.selectedChange_){t.removeEventListener("selectedchange",t.selectedChange_);t.selectedChange_=null}}}class Hc extends Uc{addTrack(t){super.addTrack(t);if(!this.queueChange_){this.queueChange_=()=>this.queueTrigger("change")}if(!this.triggerSelectedlanguagechange){this.triggerSelectedlanguagechange_=()=>this.trigger("selectedlanguagechange")}t.addEventListener("modechange",this.queueChange_);const e=["metadata","chapters"];if(e.indexOf(t.kind)===-1){t.addEventListener("modechange",this.triggerSelectedlanguagechange_)}}removeTrack(t){super.removeTrack(t);if(t.removeEventListener){if(this.queueChange_){t.removeEventListener("modechange",this.queueChange_)}if(this.selectedlanguagechange_){t.removeEventListener("modechange",this.triggerSelectedlanguagechange_)}}}}class Xc{constructor(t=[]){this.trackElements_=[];Object.defineProperty(this,"length",{get(){return this.trackElements_.length}});for(let e=0,i=t.length;e<i;e++){this.addTrackElement_(t[e])}}addTrackElement_(t){const e=this.trackElements_.length;if(!(""+e in this)){Object.defineProperty(this,e,{get(){return this.trackElements_[e]}})}if(this.trackElements_.indexOf(t)===-1){this.trackElements_.push(t)}}getTrackElementByTrack_(t){let e;for(let i=0,s=this.trackElements_.length;i<s;i++){if(t===this.trackElements_[i].track){e=this.trackElements_[i];break}}return e}removeTrackElement_(t){for(let e=0,i=this.trackElements_.length;e<i;e++){if(t===this.trackElements_[e]){if(this.trackElements_[e].track&&typeof this.trackElements_[e].track.off==="function"){this.trackElements_[e].track.off()}if(typeof this.trackElements_[e].off==="function"){this.trackElements_[e].off()}this.trackElements_.splice(e,1);break}}}}class Gc{constructor(t){Gc.prototype.setCues_.call(this,t);Object.defineProperty(this,"length",{get(){return this.length_}})}setCues_(t){const e=this.length||0;let i=0;const s=t.length;this.cues_=t;this.length_=t.length;const n=function(t){if(!(""+t in this)){Object.defineProperty(this,""+t,{get(){return this.cues_[t]}})}};if(e<s){i=e;for(;i<s;i++){n.call(this,i)}}}getCueById(t){let e=null;for(let i=0,s=this.length;i<s;i++){const s=this[i];if(s.id===t){e=s;break}}return e}}const Yc={alternative:"alternative",captions:"captions",main:"main",sign:"sign",subtitles:"subtitles",commentary:"commentary"};const Wc={alternative:"alternative",descriptions:"descriptions",main:"main","main-desc":"main-desc",translation:"translation",commentary:"commentary"};const Jc={subtitles:"subtitles",captions:"captions",descriptions:"descriptions",chapters:"chapters",metadata:"metadata"};const Kc={disabled:"disabled",hidden:"hidden",showing:"showing"};class Qc extends ec{constructor(t={}){super();const e={id:t.id||"vjs_track_"+Lh(),kind:t.kind||"",language:t.language||""};let i=t.label||"";for(const t in e){Object.defineProperty(this,t,{get(){return e[t]},set(){}})}Object.defineProperty(this,"label",{get(){return i},set(t){if(t!==i){i=t;this.trigger("labelchange")}}})}}const Zc=function(t){return new URL(t,K.baseURI)};const tl=function(t){return new URL(t,K.baseURI).href};const el=function(t){if(typeof t==="string"){const e=/^(\/?)([\s\S]*?)((?:\.{1,2}|[^\/]+?)(\.([^\.\/\?]+)))(?:[\/]*|[\?].*)$/;const i=e.exec(t);if(i){return i.pop().toLowerCase()}}return""};const il=function(t,e=z.location){return Zc(t).origin!==e.origin};var sl=Object.freeze({__proto__:null,parseUrl:Zc,getAbsoluteURL:tl,getFileExtension:el,isCrossOrigin:il});const nl=function(t,e){const i=new z.WebVTT.Parser(z,z.vttjs,z.WebVTT.StringDecoder());const s=[];i.oncue=function(t){e.addCue(t)};i.onparsingerror=function(t){s.push(t)};i.onflush=function(){e.trigger({type:"loadeddata",target:e})};i.parse(t);if(s.length>0){if(z.console&&z.console.groupCollapsed){z.console.groupCollapsed(`Text Track parsing errors for ${e.src}`)}s.forEach((t=>la.error(t)));if(z.console&&z.console.groupEnd){z.console.groupEnd()}}i.flush()};const rl=function(t,e){const i={uri:t};const s=il(t);if(s){i.cors=s}const n=e.tech_.crossOrigin()==="use-credentials";if(n){i.withCredentials=n}Nt(i,Jh(this,(function(t,i,s){if(t){return la.error(t,i)}e.loaded_=true;if(typeof z.WebVTT!=="function"){if(e.tech_){e.tech_.any(["vttjsloaded","vttjserror"],(t=>{if(t.type==="vttjserror"){la.error(`vttjs failed to load, stopping trying to process ${e.src}`);return}return nl(s,e)}))}}else{nl(s,e)}})))};class ol extends Qc{constructor(t={}){if(!t.tech){throw new Error("A tech was not provided.")}const e=ba(t,{kind:Jc[t.kind]||"subtitles",language:t.language||t.srclang||""});let i=Kc[e.mode]||"disabled";const s=e.default;if(e.kind==="metadata"||e.kind==="chapters"){i="hidden"}super(e);this.tech_=e.tech;this.cues_=[];this.activeCues_=[];this.preload_=this.tech_.preloadTextTracks!==false;const n=new Gc(this.cues_);const r=new Gc(this.activeCues_);let o=false;this.timeupdateHandler=Jh(this,(function(t={}){if(this.tech_.isDisposed()){return}if(!this.tech_.isReady_){if(t.type!=="timeupdate"){this.rvf_=this.tech_.requestVideoFrameCallback(this.timeupdateHandler)}return}this.activeCues=this.activeCues;if(o){this.trigger("cuechange");o=false}if(t.type!=="timeupdate"){this.rvf_=this.tech_.requestVideoFrameCallback(this.timeupdateHandler)}}));const a=()=>{this.stopTracking()};this.tech_.one("dispose",a);if(i!=="disabled"){this.startTracking()}Object.defineProperties(this,{default:{get(){return s},set(){}},mode:{get(){return i},set(t){if(!Kc[t]){return}if(i===t){return}i=t;if(!this.preload_&&i!=="disabled"&&this.cues.length===0){rl(this.src,this)}this.stopTracking();if(i!=="disabled"){this.startTracking()}this.trigger("modechange")}},cues:{get(){if(!this.loaded_){return null}return n},set(){}},activeCues:{get(){if(!this.loaded_){return null}if(this.cues.length===0){return r}const t=this.tech_.currentTime();const e=[];for(let i=0,s=this.cues.length;i<s;i++){const s=this.cues[i];if(s.startTime<=t&&s.endTime>=t){e.push(s)}}o=false;if(e.length!==this.activeCues_.length){o=true}else{for(let t=0;t<e.length;t++){if(this.activeCues_.indexOf(e[t])===-1){o=true}}}this.activeCues_=e;r.setCues_(this.activeCues_);return r},set(){}}});if(e.src){this.src=e.src;if(!this.preload_){this.loaded_=true}if(this.preload_||e.kind!=="subtitles"&&e.kind!=="captions"){rl(this.src,this)}}else{this.loaded_=true}}startTracking(){this.rvf_=this.tech_.requestVideoFrameCallback(this.timeupdateHandler);this.tech_.on("timeupdate",this.timeupdateHandler)}stopTracking(){if(this.rvf_){this.tech_.cancelVideoFrameCallback(this.rvf_);this.rvf_=undefined}this.tech_.off("timeupdate",this.timeupdateHandler)}addCue(t){let e=t;if(!("getCueAsHTML"in e)){e=new z.vttjs.VTTCue(t.startTime,t.endTime,t.text);for(const i in t){if(!(i in e)){e[i]=t[i]}}e.id=t.id;e.originalCue_=t}const i=this.tech_.textTracks();for(let t=0;t<i.length;t++){if(i[t]!==this){i[t].removeCue(e)}}this.cues_.push(e);this.cues.setCues_(this.cues_)}removeCue(t){let e=this.cues_.length;while(e--){const i=this.cues_[e];if(i===t||i.originalCue_&&i.originalCue_===t){this.cues_.splice(e,1);this.cues.setCues_(this.cues_);break}}}}ol.prototype.allowedEvents_={cuechange:"cuechange"};class al extends Qc{constructor(t={}){const e=ba(t,{kind:Wc[t.kind]||""});super(e);let i=false;Object.defineProperty(this,"enabled",{get(){return i},set(t){if(typeof t!=="boolean"||t===i){return}i=t;this.trigger("enabledchange")}});if(e.enabled){this.enabled=e.enabled}this.loaded_=true}}class hl extends Qc{constructor(t={}){const e=ba(t,{kind:Yc[t.kind]||""});super(e);let i=false;Object.defineProperty(this,"selected",{get(){return i},set(t){if(typeof t!=="boolean"||t===i){return}i=t;this.trigger("selectedchange")}});if(e.selected){this.selected=e.selected}}}class cl extends ec{constructor(t={}){super();let e;const i=new ol(t);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 e}},track:{get(){return i}}});e=cl.NONE;i.addEventListener("loadeddata",(()=>{e=cl.LOADED;this.trigger({type:"load",target:this})}))}}cl.prototype.allowedEvents_={load:"load"};cl.NONE=0;cl.LOADING=1;cl.LOADED=2;cl.ERROR=3;const ll={audio:{ListClass:qc,TrackClass:al,capitalName:"Audio"},video:{ListClass:zc,TrackClass:hl,capitalName:"Video"},text:{ListClass:Hc,TrackClass:ol,capitalName:"Text"}};Object.keys(ll).forEach((function(t){ll[t].getterName=`${t}Tracks`;ll[t].privateName=`${t}Tracks_`}));const ul={remoteText:{ListClass:Hc,TrackClass:ol,capitalName:"RemoteText",getterName:"remoteTextTracks",privateName:"remoteTextTracks_"},remoteTextEl:{ListClass:Xc,TrackClass:cl,capitalName:"RemoteTextTrackEls",getterName:"remoteTextTrackEls",privateName:"remoteTextTrackEls_"}};const fl=Object.assign({},ll,ul);ul.names=Object.keys(ul);ll.names=Object.keys(ll);fl.names=[].concat(ul.names).concat(ll.names);function dl(t,e,i,s,n={}){const r=t.textTracks();n.kind=e;if(i){n.label=i}if(s){n.language=s}n.tech=t;const o=new fl.text.TrackClass(n);r.addTrack(o);return o}class pl extends yc{constructor(t={},e=function(){}){t.reportTouchActivity=false;super(null,t,e);this.onDurationChange_=t=>this.onDurationChange(t);this.trackProgress_=t=>this.trackProgress(t);this.trackCurrentTime_=t=>this.trackCurrentTime(t);this.stopTrackingCurrentTime_=t=>this.stopTrackingCurrentTime(t);this.disposeSourceHandler_=t=>this.disposeSourceHandler(t);this.queuedHanders_=new Set;this.hasStarted_=false;this.on("playing",(function(){this.hasStarted_=true}));this.on("loadstart",(function(){this.hasStarted_=false}));fl.names.forEach((e=>{const i=fl[e];if(t&&t[i.getterName]){this[i.privateName]=t[i.getterName]}}));if(!this.featuresProgressEvents){this.manualProgressOn()}if(!this.featuresTimeupdateEvents){this.manualTimeUpdatesOn()}["Text","Audio","Video"].forEach((e=>{if(t[`native${e}Tracks`]===false){this[`featuresNative${e}Tracks`]=false}}));if(t.nativeCaptions===false||t.nativeTextTracks===false){this.featuresNativeTextTracks=false}else if(t.nativeCaptions===true||t.nativeTextTracks===true){this.featuresNativeTextTracks=true}if(!this.featuresNativeTextTracks){this.emulateTextTracks()}this.preloadTextTracks=t.preloadTextTracks!==false;this.autoRemoteTextTracks_=new fl.text.ListClass;this.initTrackListeners();if(!t.nativeControlsForTouch){this.emitTapEvents()}if(this.constructor){this.name_=this.constructor.name||"Unknown Tech"}}triggerSourceset(t){if(!this.isReady_){this.one("ready",(()=>this.setTimeout((()=>this.triggerSourceset(t)),1)))}this.trigger({src:t,type:"sourceset"})}manualProgressOn(){this.on("durationchange",this.onDurationChange_);this.manualProgress=true;this.one("ready",this.trackProgress_)}manualProgressOff(){this.manualProgress=false;this.stopTrackingProgress();this.off("durationchange",this.onDurationChange_)}trackProgress(t){this.stopTrackingProgress();this.progressInterval=this.setInterval(Jh(this,(function(){const t=this.bufferedPercent();if(this.bufferedPercent_!==t){this.trigger("progress")}this.bufferedPercent_=t;if(t===1){this.stopTrackingProgress()}})),500)}onDurationChange(t){this.duration_=this.duration()}buffered(){return kc(0,0)}bufferedPercent(){return Cc(this.buffered(),this.duration_)}stopTrackingProgress(){this.clearInterval(this.progressInterval)}manualTimeUpdatesOn(){this.manualTimeUpdates=true;this.on("play",this.trackCurrentTime_);this.on("pause",this.stopTrackingCurrentTime_)}manualTimeUpdatesOff(){this.manualTimeUpdates=false;this.stopTrackingCurrentTime();this.off("play",this.trackCurrentTime_);this.off("pause",this.stopTrackingCurrentTime_)}trackCurrentTime(){if(this.currentTimeInterval){this.stopTrackingCurrentTime()}this.currentTimeInterval=this.setInterval((function(){this.trigger({type:"timeupdate",target:this,manuallyTriggered:true})}),250)}stopTrackingCurrentTime(){this.clearInterval(this.currentTimeInterval);this.trigger({type:"timeupdate",target:this,manuallyTriggered:true})}dispose(){this.clearTracks(ll.names);if(this.manualProgress){this.manualProgressOff()}if(this.manualTimeUpdates){this.manualTimeUpdatesOff()}super.dispose()}clearTracks(t){t=[].concat(t);t.forEach((t=>{const e=this[`${t}Tracks`]()||[];let i=e.length;while(i--){const s=e[i];if(t==="text"){this.removeRemoteTextTrack(s)}e.removeTrack(s)}}))}cleanupAutoTextTracks(){const t=this.autoRemoteTextTracks_||[];let e=t.length;while(e--){const i=t[e];this.removeRemoteTextTrack(i)}}reset(){}crossOrigin(){}setCrossOrigin(){}error(t){if(t!==undefined){this.error_=new Nc(t);this.trigger("error")}return this.error_}played(){if(this.hasStarted_){return kc(0,0)}return kc()}play(){}setScrubbing(t){}scrubbing(){}setCurrentTime(t){if(this.manualTimeUpdates){this.trigger({type:"timeupdate",target:this,manuallyTriggered:true})}}initTrackListeners(){ll.names.forEach((t=>{const e=ll[t];const i=()=>{this.trigger(`${t}trackchange`)};const s=this[e.getterName]();s.addEventListener("removetrack",i);s.addEventListener("addtrack",i);this.on("dispose",(()=>{s.removeEventListener("removetrack",i);s.removeEventListener("addtrack",i)}))}))}addWebVttScript_(){if(z.WebVTT){return}if(K.body.contains(this.el())){if(!this.options_["vtt.js"]&&ga(ke)&&Object.keys(ke).length>0){this.trigger("vttjsloaded");return}const t=K.createElement("script");t.src=this.options_["vtt.js"]||"https://vjs.zencdn.net/vttjs/0.14.1/vtt.min.js";t.onload=()=>{this.trigger("vttjsloaded")};t.onerror=()=>{this.trigger("vttjserror")};this.on("dispose",(()=>{t.onload=null;t.onerror=null}));z.WebVTT=true;this.el().parentNode.appendChild(t)}else{this.ready(this.addWebVttScript_)}}emulateTextTracks(){const t=this.textTracks();const e=this.remoteTextTracks();const i=e=>t.addTrack(e.track);const s=e=>t.removeTrack(e.track);e.on("addtrack",i);e.on("removetrack",s);this.addWebVttScript_();const n=()=>this.trigger("texttrackchange");const r=()=>{n();for(let e=0;e<t.length;e++){const i=t[e];i.removeEventListener("cuechange",n);if(i.mode==="showing"){i.addEventListener("cuechange",n)}}};r();t.addEventListener("change",r);t.addEventListener("addtrack",r);t.addEventListener("removetrack",r);this.on("dispose",(function(){e.off("addtrack",i);e.off("removetrack",s);t.removeEventListener("change",r);t.removeEventListener("addtrack",r);t.removeEventListener("removetrack",r);for(let e=0;e<t.length;e++){const i=t[e];i.removeEventListener("cuechange",n)}}))}addTextTrack(t,e,i){if(!t){throw new Error("TextTrack kind is required but was not provided")}return dl(this,t,e,i)}createRemoteTextTrack(t){const e=ba(t,{tech:this});return new ul.remoteTextEl.TrackClass(e)}addRemoteTextTrack(t={},e){const i=this.createRemoteTextTrack(t);if(typeof e!=="boolean"){e=false}this.remoteTextTrackEls().addTrackElement_(i);this.remoteTextTracks().addTrack(i.track);if(e===false){this.ready((()=>this.autoRemoteTextTracks_.addTrack(i.track)))}return i}removeRemoteTextTrack(t){const e=this.remoteTextTrackEls().getTrackElementByTrack_(t);this.remoteTextTrackEls().removeTrackElement_(e);this.remoteTextTracks().removeTrack(t);this.autoRemoteTextTracks_.removeTrack(t)}getVideoPlaybackQuality(){return{}}requestPictureInPicture(){return Promise.reject()}disablePictureInPicture(){return true}setDisablePictureInPicture(){}requestVideoFrameCallback(t){const e=Lh();if(!this.isReady_||this.paused()){this.queuedHanders_.add(e);this.one("playing",(()=>{if(this.queuedHanders_.has(e)){this.queuedHanders_.delete(e);t()}}))}else{this.requestNamedAnimationFrame(e,t)}return e}cancelVideoFrameCallback(t){if(this.queuedHanders_.has(t)){this.queuedHanders_.delete(t)}else{this.cancelNamedAnimationFrame(t)}}setPoster(){}playsinline(){}setPlaysinline(){}overrideNativeAudioTracks(t){}overrideNativeVideoTracks(t){}canPlayType(t){return""}static canPlayType(t){return""}static canPlaySource(t,e){return pl.canPlayType(t.type)}static isTech(t){return t.prototype instanceof pl||t instanceof pl||t===pl}static registerTech(t,e){if(!pl.techs_){pl.techs_={}}if(!pl.isTech(e)){throw new Error(`Tech ${t} must be a Tech`)}if(!pl.canPlayType){throw new Error("Techs must have a static canPlayType method on them")}if(!pl.canPlaySource){throw new Error("Techs must have a static canPlaySource method on them")}t=mc(t);pl.techs_[t]=e;pl.techs_[vc(t)]=e;if(t!=="Tech"){pl.defaultTechOrder_.push(t)}return e}static getTech(t){if(!t){return}if(pl.techs_&&pl.techs_[t]){return pl.techs_[t]}t=mc(t);if(z&&z.videojs&&z.videojs[t]){la.warn(`The ${t} tech was added to the videojs object when it should be registered using videojs.registerTech(name, tech)`);return z.videojs[t]}}}fl.names.forEach((function(t){const e=fl[t];pl.prototype[e.getterName]=function(){this[e.privateName]=this[e.privateName]||new e.ListClass;return this[e.privateName]}}));pl.prototype.featuresVolumeControl=true;pl.prototype.featuresMuteControl=true;pl.prototype.featuresFullscreenResize=false;pl.prototype.featuresPlaybackRate=false;pl.prototype.featuresProgressEvents=false;pl.prototype.featuresSourceset=false;pl.prototype.featuresTimeupdateEvents=false;pl.prototype.featuresNativeTextTracks=false;pl.prototype.featuresVideoFrameCallback=false;pl.withSourceHandlers=function(t){t.registerSourceHandler=function(e,i){let s=t.sourceHandlers;if(!s){s=t.sourceHandlers=[]}if(i===undefined){i=s.length}s.splice(i,0,e)};t.canPlayType=function(e){const i=t.sourceHandlers||[];let s;for(let t=0;t<i.length;t++){s=i[t].canPlayType(e);if(s){return s}}return""};t.selectSourceHandler=function(e,i){const s=t.sourceHandlers||[];let n;for(let t=0;t<s.length;t++){n=s[t].canHandleSource(e,i);if(n){return s[t]}}return null};t.canPlaySource=function(e,i){const s=t.selectSourceHandler(e,i);if(s){return s.canHandleSource(e,i)}return""};const e=["seekable","seeking","duration"];e.forEach((function(t){const e=this[t];if(typeof e!=="function"){return}this[t]=function(){if(this.sourceHandler_&&this.sourceHandler_[t]){return this.sourceHandler_[t].apply(this.sourceHandler_,arguments)}return e.apply(this,arguments)}}),t.prototype);t.prototype.setSource=function(e){let i=t.selectSourceHandler(e,this.options_);if(!i){if(t.nativeSourceHandler){i=t.nativeSourceHandler}else{la.error("No source handler found for the current source.")}}this.disposeSourceHandler();this.off("dispose",this.disposeSourceHandler_);if(i!==t.nativeSourceHandler){this.currentSource_=e}this.sourceHandler_=i.handleSource(e,this,this.options_);this.one("dispose",this.disposeSourceHandler_)};t.prototype.disposeSourceHandler=function(){if(this.currentSource_){this.clearTracks(["audio","video"]);this.currentSource_=null}this.cleanupAutoTextTracks();if(this.sourceHandler_){if(this.sourceHandler_.dispose){this.sourceHandler_.dispose()}this.sourceHandler_=null}}};yc.registerComponent("Tech",pl);pl.registerTech("Tech",pl);pl.defaultTechOrder_=[];const vl={};const ml={};const gl={};function bl(t,e){vl[t]=vl[t]||[];vl[t].push(e)}function yl(t,e,i){t.setTimeout((()=>Nl(e,vl[e.type],i,t)),1)}function jl(t,e){t.forEach((t=>t.setTech&&t.setTech(e)))}function wl(t,e,i){return t.reduceRight(El(i),e[i]())}function Tl(t,e,i,s){return e[i](t.reduce(El(i),s))}function kl(t,e,i,s=null){const n="call"+mc(i);const r=t.reduce(El(n),s);const o=r===gl;const a=o?null:e[i](r);Il(t,i,a,o);return a}const Sl={buffered:1,currentTime:1,duration:1,muted:1,played:1,paused:1,seekable:1,volume:1,ended:1};const xl={setCurrentTime:1,setMuted:1,setVolume:1};const Al={play:1,pause:1};function El(t){return(e,i)=>{if(e===gl){return gl}if(i[t]){return i[t](e)}return e}}function Il(t,e,i,s){for(let n=t.length-1;n>=0;n--){const r=t[n];if(r[e]){r[e](s,i)}}}function Dl(t){if(ml.hasOwnProperty(t.id())){delete ml[t.id()]}}function Cl(t,e){const i=ml[t.id()];let s=null;if(i===undefined||i===null){s=e(t);ml[t.id()]=[[e,s]];return s}for(let t=0;t<i.length;t++){const[n,r]=i[t];if(n!==e){continue}s=r}if(s===null){s=e(t);i.push([e,s])}return s}function Nl(t={},e=[],i,s,n=[],r=false){const[o,...a]=e;if(typeof o==="string"){Nl(t,vl[o],i,s,n,r)}else if(o){const e=Cl(s,o);if(!e.setSource){n.push(e);return Nl(t,a,i,s,n,r)}e.setSource(Object.assign({},t),(function(o,h){if(o){return Nl(t,a,i,s,n,r)}n.push(e);Nl(h,t.type===h.type?a:vl[h.type],i,s,n,r)}))}else if(a.length){Nl(t,a,i,s,n,r)}else if(r){i(t,n)}else{Nl(t,vl["*"],i,s,n,true)}}const _l={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"};const Ol=function(t=""){const e=el(t);const i=_l[e.toLowerCase()];return i||""};const Ml=(t,e)=>{if(!e){return""}if(t.cache_.source.src===e&&t.cache_.source.type){return t.cache_.source.type}const i=t.cache_.sources.filter((t=>t.src===e));if(i.length){return i[0].type}const s=t.$$("source");for(let t=0;t<s.length;t++){const i=s[t];if(i.type&&i.src&&i.src===e){return i.type}}return Ol(e)};const Rl=function(t){if(Array.isArray(t)){let e=[];t.forEach((function(t){t=Rl(t);if(Array.isArray(t)){e=e.concat(t)}else if(ma(t)){e.push(t)}}));t=e}else if(typeof t==="string"&&t.trim()){t=[Ll({src:t})]}else if(ma(t)&&typeof t.src==="string"&&t.src&&t.src.trim()){t=[Ll(t)]}else{t=[]}return t};function Ll(t){if(!t.type){const e=Ol(t.src);if(e){t.type=e}}return t}var Pl='<svg xmlns="http://www.w3.org/2000/svg">\n <defs>\n <symbol viewBox="0 0 48 48" id="vjs-icon-play">\n <path d="M16 10v28l22-14z"></path>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-pause">\n <path d="M12 38h8V10h-8v28zm16-28v28h8V10h-8z"></path>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-audio">\n <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>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-captions">\n <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>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-subtitles">\n <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>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-fullscreen-enter">\n <path d="M14 28h-4v10h10v-4h-6v-6zm-4-8h4v-6h6v-4H10v10zm24 14h-6v4h10V28h-4v6zm-6-24v4h6v6h4V10H28z"></path>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-fullscreen-exit">\n <path d="M10 32h6v6h4V28H10v4zm6-16h-6v4h10V10h-4v6zm12 22h4v-6h6v-4H28v10zm4-22v-6h-4v10h10v-4h-6z"></path>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-play-circle">\n <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>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-volume-mute">\n <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>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-volume-low">\n <path d="M14 18v12h8l10 10V8L22 18h-8z"></path>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-volume-medium">\n <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>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-volume-high">\n <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>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-spinner">\n <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>\n </symbol>\n <symbol viewBox="0 0 24 24" id="vjs-icon-hd">\n <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>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-chapters">\n <path d="M6 26h4v-4H6v4zm0 8h4v-4H6v4zm0-16h4v-4H6v4zm8 8h28v-4H14v4zm0 8h28v-4H14v4zm0-20v4h28v-4H14z"></path>\n </symbol>\n <symbol viewBox="0 0 40 40" id="vjs-icon-downloading">\n <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>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-file-download">\n <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>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-file-download-done">\n <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>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-file-download-off">\n <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>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-share">\n <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>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-cog">\n <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>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-square">\n <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>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-circle">\n <circle cx="24" cy="24" r="20"></circle>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-circle-outline">\n <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>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-circle-inner-circle">\n <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>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-cancel">\n <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>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-replay">\n <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>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-repeat">\n <path d="M14 14h20v6l8-8-8-8v6H10v12h4v-8zm20 20H14v-6l-8 8 8 8v-6h24V26h-4v8z"></path>\n </symbol>\n <symbol viewBox="0 96 48 48" id="vjs-icon-replay-5">\n <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>\n </symbol>\n <symbol viewBox="0 96 48 48" id="vjs-icon-replay-10">\n <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>\n </symbol>\n <symbol viewBox="0 96 48 48" id="vjs-icon-replay-30">\n <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>\n </symbol>\n <symbol viewBox="0 96 48 48" id="vjs-icon-forward-5">\n <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>\n </symbol>\n <symbol viewBox="0 96 48 48" id="vjs-icon-forward-10">\n <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>\n </symbol>\n <symbol viewBox="0 96 48 48" id="vjs-icon-forward-30">\n <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>\n </symbol>\n <symbol viewBox="0 0 512 512" id="vjs-icon-audio-description">\n <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>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-next-item">\n <path d="M12 36l17-12-17-12v24zm20-24v24h4V12h-4z"></path>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-previous-item">\n <path d="M12 12h4v24h-4zm7 12l17 12V12z"></path>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-shuffle">\n <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>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-cast">\n <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>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-picture-in-picture-enter">\n <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>\n </symbol>\n <symbol viewBox="0 0 22 18" id="vjs-icon-picture-in-picture-exit">\n <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>\n <path fill="none" d="M-1-3h24v24H-1z"></path>\n </symbol>\n <symbol viewBox="0 0 1792 1792" id="vjs-icon-facebook">\n <path d="M1343 12v264h-157q-86 0-116 36t-30 108v189h293l-39 296h-254v759H734V905H479V609h255V391q0-186 104-288.5T1115 0q147 0 228 12z"></path>\n </symbol>\n <symbol viewBox="0 0 1792 1792" id="vjs-icon-linkedin">\n <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>\n </symbol>\n <symbol viewBox="0 0 1200 1227" id="vjs-icon-twitter">\n <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"/>\n </symbol>\n <symbol viewBox="0 0 1792 1792" id="vjs-icon-tumblr">\n <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>\n </symbol>\n <symbol viewBox="0 0 1792 1792" id="vjs-icon-pinterest">\n <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>\n </symbol>\n </defs>\n</svg>';const $l=$a?10009:Fa?461:8;const Fl={codes:{play:415,pause:19,ff:417,rw:412,back:$l},names:{415:"play",19:"pause",417:"ff",412:"rw",[$l]:"back"},isEventKey(t,e){e=e.toLowerCase();if(this.names[t.keyCode]&&this.names[t.keyCode]===e){return true}return false},getEventName(t){if(this.names[t.keyCode]){return this.names[t.keyCode]}else if(this.codes[t.code]){const e=this.codes[t.code];return this.names[e]}return null}};const Ul=5;class Bl extends ec{constructor(t){super();this.player_=t;this.focusableComponents=[];this.isListening_=false;this.isPaused_=false;this.onKeyDown_=this.onKeyDown_.bind(this);this.lastFocusedComponent_=null}start(){if(this.isListening_){return}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_=true;this.player_.errorDisplay.on("aftermodalfill",(()=>{this.updateFocusableComponents();if(this.focusableComponents.length){if(this.focusableComponents.length>1){this.focusableComponents[1].focus()}else{this.focusableComponents[0].focus()}}}))}stop(){this.player_.off("keydown",this.onKeyDown_);this.isListening_=false}onKeyDown_(t){const e=t.originalEvent?t.originalEvent:t;if(["ArrowLeft","ArrowRight","ArrowUp","ArrowDown"].includes(e.key)){if(this.isPaused_){return}e.preventDefault();const t=e.key.substring(5).toLowerCase();this.move(t)}else if(Fl.isEventKey(e,"play")||Fl.isEventKey(e,"pause")||Fl.isEventKey(e,"ff")||Fl.isEventKey(e,"rw")){e.preventDefault();const t=Fl.getEventName(e);this.performMediaAction_(t)}else if(Fl.isEventKey(e,"Back")&&t.target&&t.target.closeable()){e.preventDefault();t.target.close()}}performMediaAction_(t){if(this.player_){switch(t){case"play":if(this.player_.paused()){this.player_.play()}break;case"pause":if(!this.player_.paused()){this.player_.pause()}break;case"ff":this.userSeek_(this.player_.currentTime()+Ul);break;case"rw":this.userSeek_(this.player_.currentTime()-Ul);break}}}userSeek_(t){if(this.player_.liveTracker&&this.player_.liveTracker.isLive()){this.player_.liveTracker.nextSeekedFromUser()}this.player_.currentTime(t)}pause(){this.isPaused_=true}resume(){this.isPaused_=false}handlePlayerBlur_(t){const e=t.relatedTarget;let i=null;const s=this.getCurrentComponent(t.target);if(e){i=Boolean(e.closest(".video-js"));if(e.classList.contains("vjs-text-track-settings")&&!this.isPaused_){this.searchForTrackSelect_()}}if(!t.currentTarget.contains(t.relatedTarget)&&!i||!e){if(s&&s.name()==="CloseButton"){this.refocusComponent()}else{this.pause();if(s&&s.el()){this.lastFocusedComponent_=s}}}}handlePlayerFocus_(){if(this.getCurrentComponent()&&this.getCurrentComponent().getIsFocusable()){this.resume()}}updateFocusableComponents(){const t=this.player_;const e=[];function i(t){for(const s of t){if(s.hasOwnProperty("el_")&&s.getIsFocusable()&&s.getIsAvailableToBeFocused(s.el())){e.push(s)}if(s.hasOwnProperty("children_")&&s.children_.length>0){i(s.children_)}}}t.children_.forEach((t=>{if(t.hasOwnProperty("el_")){if(t.getIsFocusable&&t.getIsAvailableToBeFocused&&t.getIsFocusable()&&t.getIsAvailableToBeFocused(t.el())){e.push(t);return}else if(t.hasOwnProperty("children_")&&t.children_.length>0){i(t.children_)}else if(t.hasOwnProperty("items")&&t.items.length>0){i(t.items)}else if(this.findSuitableDOMChild(t)){e.push(t)}}if(t.name_==="ErrorDisplay"&&t.opened_){const i=t.el_.querySelector(".vjs-errors-ok-button-container");if(i){const t=i.querySelectorAll("button");t.forEach(((t,i)=>{e.push({name:()=>"ModalButton"+(i+1),el:()=>t,getPositions:()=>{const e=t.getBoundingClientRect();const i={x:e.x,y:e.y,width:e.width,height:e.height,top:e.top,right:e.right,bottom:e.bottom,left:e.left};const s={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:i,center:s}},getIsAvailableToBeFocused:()=>true,getIsFocusable:t=>true,focus:()=>t.focus()})}))}}}));this.focusableComponents=e;return this.focusableComponents}findSuitableDOMChild(t){function e(i){if(t.getIsFocusable(i)&&t.getIsAvailableToBeFocused(i)){return i}for(let t=0;t<i.children.length;t++){const s=i.children[t];const n=e(s);if(n){return n}}return null}if(t.el()){return e(t.el())}return null}getCurrentComponent(t){this.updateFocusableComponents();const e=t||document.activeElement;if(this.focusableComponents.length){for(const t of this.focusableComponents){if(t.el()===e){return t}}}}add(t){const e=[...this.focusableComponents];if(t.hasOwnProperty("el_")&&t.getIsFocusable()&&t.getIsAvailableToBeFocused(t.el())){e.push(t)}this.focusableComponents=e;this.trigger({type:"focusableComponentsChanged",focusableComponents:this.focusableComponents})}remove(t){for(let e=0;e<this.focusableComponents.length;e++){if(this.focusableComponents[e].name()===t.name()){this.focusableComponents.splice(e,1);this.trigger({type:"focusableComponentsChanged",focusableComponents:this.focusableComponents});return}}}clear(){if(this.focusableComponents.length>0){this.focusableComponents=[];this.trigger({type:"focusableComponentsChanged",focusableComponents:this.focusableComponents})}}move(t){const e=this.getCurrentComponent();if(!e){return}const i=e.getPositions();const s=this.focusableComponents.filter((s=>s!==e&&this.isInDirection_(i.boundingClientRect,s.getPositions().boundingClientRect,t)));const n=this.findBestCandidate_(i.center,s,t);if(n){this.focus(n)}else{this.trigger({type:"endOfFocusableComponents",direction:t,focusedComponent:e})}}findBestCandidate_(t,e,i){let s=Infinity;let n=null;for(const r of e){const e=r.getPositions().center;const o=this.calculateDistance_(t,e,i);if(o<s){s=o;n=r}}return n}isInDirection_(t,e,i){switch(i){case"right":return e.left>=t.right;case"left":return e.right<=t.left;case"down":return e.top>=t.bottom;case"up":return e.bottom<=t.top;default:return false}}refocusComponent(){if(this.lastFocusedComponent_){if(!this.player_.userActive()){this.player_.userActive(true)}this.updateFocusableComponents();for(let t=0;t<this.focusableComponents.length;t++){if(this.focusableComponents[t].name()===this.lastFocusedComponent_.name()){this.focus(this.focusableComponents[t]);return}}}else{this.focus(this.updateFocusableComponents()[0])}}focus(t){if(typeof t!=="object"){return}if(t.getIsAvailableToBeFocused(t.el())){t.focus()}else if(this.findSuitableDOMChild(t)){this.findSuitableDOMChild(t).focus()}}calculateDistance_(t,e,i){const s=Math.abs(t.x-e.x);const n=Math.abs(t.y-e.y);let r;switch(i){case"right":case"left":r=s+n*100;break;case"up":r=n*2+s*.5;break;case"down":r=n*5+s;break;default:r=s+n}return r}searchForTrackSelect_(){const t=this;for(const e of t.updateFocusableComponents()){if(e.constructor.name==="TextTrackSelect"){t.focus(e);break}}}}class ql extends yc{constructor(t,e,i){const s=ba({createEl:false},e);super(t,s,i);if(!e.playerOptions.sources||e.playerOptions.sources.length===0){for(let i=0,s=e.playerOptions.techOrder;i<s.length;i++){const e=mc(s[i]);let n=pl.getTech(e);if(!e){n=yc.getComponent(e)}if(n&&n.isSupported()){t.loadTech_(e);break}}}else{t.src(e.playerOptions.sources)}}}yc.registerComponent("MediaLoader",ql);class Vl extends yc{constructor(t,e){super(t,e);if(this.options_.controlText){this.controlText(this.options_.controlText)}this.handleMouseOver_=t=>this.handleMouseOver(t);this.handleMouseOut_=t=>this.handleMouseOut(t);this.handleClick_=t=>this.handleClick(t);this.handleKeyDown_=t=>this.handleKeyDown(t);this.emitTapEvents();this.enable()}createEl(t="div",e={},i={}){e=Object.assign({className:this.buildCSSClass(),tabIndex:0},e);if(t==="button"){la.error(`Creating a ClickableComponent with an HTML element of ${t} is not supported; use a Button instead.`)}i=Object.assign({role:"button"},i);this.tabIndex_=e.tabIndex;const s=Qa(t,e,i);if(!this.player_.options_.experimentalSvgIcons){s.appendChild(Qa("span",{className:"vjs-icon-placeholder"},{"aria-hidden":true}))}this.createControlTextEl(s);return s}dispose(){this.controlTextEl_=null;super.dispose()}createControlTextEl(t){this.controlTextEl_=Qa("span",{className:"vjs-control-text"},{"aria-live":"polite"});if(t){t.appendChild(this.controlTextEl_)}this.controlText(this.controlText_,t);return this.controlTextEl_}controlText(t,e=this.el()){if(t===undefined){return this.controlText_||"Need Text"}const i=this.localize(t);this.controlText_=t;Za(this.controlTextEl_,i);if(!this.nonIconControl&&!this.player_.options_.noUITitleAttributes){e.setAttribute("title",i)}}buildCSSClass(){return`vjs-control vjs-button ${super.buildCSSClass()}`}enable(){if(!this.enabled_){this.enabled_=true;this.removeClass("vjs-disabled");this.el_.setAttribute("aria-disabled","false");if(typeof this.tabIndex_!=="undefined"){this.el_.setAttribute("tabIndex",this.tabIndex_)}this.on(["tap","click"],this.handleClick_);this.on("keydown",this.handleKeyDown_)}}disable(){this.enabled_=false;this.addClass("vjs-disabled");this.el_.setAttribute("aria-disabled","true");if(typeof this.tabIndex_!=="undefined"){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(t){if(this.options_.clickHandler){this.options_.clickHandler.call(this,arguments)}}handleKeyDown(t){if(t.key===" "||t.key==="Enter"){t.preventDefault();t.stopPropagation();this.trigger("click")}else{super.handleKeyDown(t)}}}yc.registerComponent("ClickableComponent",Vl);class zl extends Vl{constructor(t,e){super(t,e);this.update();this.update_=t=>this.update(t);t.on("posterchange",this.update_)}dispose(){this.player().off("posterchange",this.update_);super.dispose()}createEl(){return Qa("div",{className:"vjs-poster"})}crossOrigin(t){if(typeof t==="undefined"){if(this.$("img")){return this.$("img").crossOrigin}else if(this.player_.tech_&&this.player_.tech_.isReady_){return this.player_.crossOrigin()}return this.player_.options_.crossOrigin||this.player_.options_.crossorigin||null}if(t!==null&&t!=="anonymous"&&t!=="use-credentials"){this.player_.log.warn(`crossOrigin must be null, "anonymous" or "use-credentials", given "${t}"`);return}if(this.$("img")){this.$("img").crossOrigin=t}return}update(t){const e=this.player().poster();this.setSrc(e);if(e){this.show()}else{this.hide()}}setSrc(t){if(!t){this.el_.textContent="";return}if(!this.$("img")){this.el_.appendChild(Qa("picture",{className:"vjs-poster",tabIndex:-1},{},Qa("img",{loading:"lazy",crossOrigin:this.crossOrigin()},{alt:""})))}this.$("img").src=t}handleClick(t){if(!this.player_.controls()){return}if(this.player_.tech(true)){this.player_.tech(true).focus()}if(this.player_.paused()){Oc(this.player_.play())}else{this.player_.pause()}}}zl.prototype.crossorigin=zl.prototype.crossOrigin;yc.registerComponent("PosterImage",zl);const Hl="#222";const Xl="#ccc";const Gl={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 Yl(t,e){let i;if(t.length===4){i=t[1]+t[1]+t[2]+t[2]+t[3]+t[3]}else if(t.length===7){i=t.slice(1)}else{throw new Error("Invalid color code provided, "+t+"; must be formatted as e.g. #f0e or #f604e2.")}return"rgba("+parseInt(i.slice(0,2),16)+","+parseInt(i.slice(2,4),16)+","+parseInt(i.slice(4,6),16)+","+e+")"}function Wl(t,e,i){try{t.style[e]=i}catch(t){return}}function Jl(t){return t?`${t}px`:""}class Kl extends yc{constructor(t,e,i){super(t,e,i);const s=t=>this.updateDisplay(t);const n=t=>{this.updateDisplayOverlay();this.updateDisplay(t)};t.on("loadstart",(t=>this.toggleDisplay(t)));t.on("texttrackchange",s);t.on("loadedmetadata",(t=>{this.updateDisplayOverlay();this.preselectTrack(t)}));t.ready(Jh(this,(function(){if(t.tech_&&t.tech_.featuresNativeTextTracks){this.hide();return}t.on("fullscreenchange",n);t.on("playerresize",n);const e=z.screen.orientation||z;const i=z.screen.orientation?"change":"orientationchange";e.addEventListener(i,n);t.on("dispose",(()=>e.removeEventListener(i,n)));const s=this.options_.playerOptions.tracks||[];for(let t=0;t<s.length;t++){this.player_.addRemoteTextTrack(s[t],true)}this.preselectTrack()})))}preselectTrack(){const t={captions:1,subtitles:1};const e=this.player_.textTracks();const i=this.player_.cache_.selectedLanguage;let s;let n;let r;for(let o=0;o<e.length;o++){const a=e[o];if(i&&i.enabled&&i.language&&i.language===a.language&&a.kind in t){if(a.kind===i.kind){r=a}else if(!r){r=a}}else if(i&&!i.enabled){r=null;s=null;n=null}else if(a.default){if(a.kind==="descriptions"&&!s){s=a}else if(a.kind in t&&!n){n=a}}}if(r){r.mode="showing"}else if(n){n.mode="showing"}else if(s){s.mode="showing"}}toggleDisplay(){if(this.player_.tech_&&this.player_.tech_.featuresNativeTextTracks){this.hide()}else{this.show()}}createEl(){return super.createEl("div",{className:"vjs-text-track-display"},{translate:"yes","aria-live":"off","aria-atomic":"true"})}clearDisplay(){if(typeof z.WebVTT==="function"){z.WebVTT.processCues(z,[],this.el_)}}updateDisplay(){const t=this.player_.textTracks();const e=this.options_.allowMultipleShowingTracks;this.clearDisplay();if(e){const e=[];for(let i=0;i<t.length;++i){const s=t[i];if(s.mode!=="showing"){continue}e.push(s)}this.updateForTrack(e);return}let i=null;let s=null;let n=t.length;while(n--){const e=t[n];if(e.mode==="showing"){if(e.kind==="descriptions"){i=e}else{s=e}}}if(s){if(this.getAttribute("aria-live")!=="off"){this.setAttribute("aria-live","off")}this.updateForTrack(s)}else if(i){if(this.getAttribute("aria-live")!=="assertive"){this.setAttribute("aria-live","assertive")}this.updateForTrack(i)}}updateDisplayOverlay(){if(!this.player_.videoHeight()||!z.CSS.supports("inset-inline: 10px")){return}const t=this.player_.currentWidth();const e=this.player_.currentHeight();const i=t/e;const s=this.player_.videoWidth()/this.player_.videoHeight();let n=0;let r=0;if(Math.abs(i-s)>.1){if(i>s){n=Math.round((t-e*s)/2)}else{r=Math.round((e-t/s)/2)}}Wl(this.el_,"insetInline",Jl(n));Wl(this.el_,"insetBlock",Jl(r))}updateDisplayState(t){const e=this.player_.textTrackSettings.getValues();const i=t.activeCues;let s=i.length;while(s--){const t=i[s];if(!t){continue}const n=t.displayState;if(e.color){n.firstChild.style.color=e.color}if(e.textOpacity){Wl(n.firstChild,"color",Yl(e.color||"#fff",e.textOpacity))}if(e.backgroundColor){n.firstChild.style.backgroundColor=e.backgroundColor}if(e.backgroundOpacity){Wl(n.firstChild,"backgroundColor",Yl(e.backgroundColor||"#000",e.backgroundOpacity))}if(e.windowColor){if(e.windowOpacity){Wl(n,"backgroundColor",Yl(e.windowColor,e.windowOpacity))}else{n.style.backgroundColor=e.windowColor}}if(e.edgeStyle){if(e.edgeStyle==="dropshadow"){n.firstChild.style.textShadow=`2px 2px 3px ${Hl}, 2px 2px 4px ${Hl}, 2px 2px 5px ${Hl}`}else if(e.edgeStyle==="raised"){n.firstChild.style.textShadow=`1px 1px ${Hl}, 2px 2px ${Hl}, 3px 3px ${Hl}`}else if(e.edgeStyle==="depressed"){n.firstChild.style.textShadow=`1px 1px ${Xl}, 0 1px ${Xl}, -1px -1px ${Hl}, 0 -1px ${Hl}`}else if(e.edgeStyle==="uniform"){n.firstChild.style.textShadow=`0 0 4px ${Hl}, 0 0 4px ${Hl}, 0 0 4px ${Hl}, 0 0 4px ${Hl}`}}if(e.fontPercent&&e.fontPercent!==1){const t=z.parseFloat(n.style.fontSize);n.style.fontSize=t*e.fontPercent+"px";n.style.height="auto";n.style.top="auto"}if(e.fontFamily&&e.fontFamily!=="default"){if(e.fontFamily==="small-caps"){n.firstChild.style.fontVariant="small-caps"}else{n.firstChild.style.fontFamily=Gl[e.fontFamily]}}}}updateForTrack(t){if(!Array.isArray(t)){t=[t]}if(typeof z.WebVTT!=="function"||t.every((t=>!t.activeCues))){return}const e=[];for(let i=0;i<t.length;++i){const s=t[i];for(let t=0;t<s.activeCues.length;++t){e.push(s.activeCues[t])}}z.WebVTT.processCues(z,e,this.el_);for(let e=0;e<t.length;++e){const i=t[e];for(let t=0;t<i.activeCues.length;++t){const s=i.activeCues[t].displayState;ih(s,"vjs-text-track-cue","vjs-text-track-cue-"+(i.language?i.language:e));if(i.language){hh(s,"lang",i.language)}}if(this.player_.textTrackSettings){this.updateDisplayState(i)}}}}yc.registerComponent("TextTrackDisplay",Kl);class Ql extends yc{createEl(){const t=this.player_.isAudio();const e=this.localize(t?"Audio Player":"Video Player");const i=Qa("span",{className:"vjs-control-text",textContent:this.localize("{1} is loading.",[e])});const s=super.createEl("div",{className:"vjs-loading-spinner",dir:"ltr"});s.appendChild(i);return s}handleLanguagechange(){this.$(".vjs-control-text").textContent=this.localize("{1} is loading.",[this.player_.isAudio()?"Audio Player":"Video Player"])}}yc.registerComponent("LoadingSpinner",Ql);class Zl extends Vl{createEl(t,e={},i={}){t="button";e=Object.assign({className:this.buildCSSClass()},e);i=Object.assign({type:"button"},i);const s=Qa(t,e,i);if(!this.player_.options_.experimentalSvgIcons){s.appendChild(Qa("span",{className:"vjs-icon-placeholder"},{"aria-hidden":true}))}this.createControlTextEl(s);return s}addChild(t,e={}){const i=this.constructor.name;la.warn(`Adding an actionable (user controllable) child to a Button (${i}) is not supported; use a ClickableComponent instead.`);return yc.prototype.addChild.call(this,t,e)}enable(){super.enable();this.el_.removeAttribute("disabled")}disable(){super.disable();this.el_.setAttribute("disabled","disabled")}handleKeyDown(t){if(t.key===" "||t.key==="Enter"){t.stopPropagation();return}super.handleKeyDown(t)}}yc.registerComponent("Button",Zl);class tu extends Zl{constructor(t,e){super(t,e);this.mouseused_=false;this.setIcon("play");this.on("mousedown",(t=>this.handleMouseDown(t)))}buildCSSClass(){return"vjs-big-play-button"}handleClick(t){const e=this.player_.play();if(this.mouseused_&&"clientX"in t&&"clientY"in t){Oc(e);if(this.player_.tech(true)){this.player_.tech(true).focus()}return}const i=this.player_.getChild("controlBar");const s=i&&i.getChild("playToggle");if(!s){this.player_.tech(true).focus();return}const n=()=>s.focus();if(_c(e)){e.then(n,(()=>{}))}else{this.setTimeout(n,1)}}handleKeyDown(t){this.mouseused_=false;super.handleKeyDown(t)}handleMouseDown(t){this.mouseused_=true}}tu.prototype.controlText_="Play Video";yc.registerComponent("BigPlayButton",tu);class eu extends Zl{constructor(t,e){super(t,e);this.setIcon("cancel");this.controlText(e&&e.controlText||this.localize("Close"))}buildCSSClass(){return`vjs-close-button ${super.buildCSSClass()}`}handleClick(t){this.trigger({type:"close",bubbles:false})}handleKeyDown(t){if(t.key==="Escape"){t.preventDefault();t.stopPropagation();this.trigger("click")}else{super.handleKeyDown(t)}}}yc.registerComponent("CloseButton",eu);class iu extends Zl{constructor(t,e={}){super(t,e);e.replay=e.replay===undefined||e.replay;this.setIcon("play");this.on(t,"play",(t=>this.handlePlay(t)));this.on(t,"pause",(t=>this.handlePause(t)));if(e.replay){this.on(t,"ended",(t=>this.handleEnded(t)))}}buildCSSClass(){return`vjs-play-control ${super.buildCSSClass()}`}handleClick(t){if(this.player_.paused()){Oc(this.player_.play())}else{this.player_.pause()}}handleSeeked(t){this.removeClass("vjs-ended");if(this.player_.paused()){this.handlePause(t)}else{this.handlePlay(t)}}handlePlay(t){this.removeClass("vjs-ended","vjs-paused");this.addClass("vjs-playing");this.setIcon("pause");this.controlText("Pause")}handlePause(t){this.removeClass("vjs-playing");this.addClass("vjs-paused");this.setIcon("play");this.controlText("Play")}handleEnded(t){this.removeClass("vjs-playing");this.addClass("vjs-ended");this.setIcon("replay");this.controlText("Replay");this.one(this.player_,"seeked",(t=>this.handleSeeked(t)))}}iu.prototype.controlText_="Play";yc.registerComponent("PlayToggle",iu);class su extends yc{constructor(t,e){super(t,e);this.on(t,["timeupdate","ended","seeking"],(t=>this.update(t)));this.updateTextNode_()}createEl(){const t=this.buildCSSClass();const e=super.createEl("div",{className:`${t} vjs-time-control vjs-control`});const i=Qa("span",{className:"vjs-control-text",textContent:`${this.localize(this.labelText_)} `},{role:"presentation"});e.appendChild(i);this.contentEl_=Qa("span",{className:`${t}-display`},{role:"presentation"});e.appendChild(this.contentEl_);return e}dispose(){this.contentEl_=null;this.textNode_=null;super.dispose()}update(t){if(!this.player_.options_.enableSmoothSeeking&&t.type==="seeking"){return}this.updateContent(t)}updateTextNode_(t=0){t=Ic(t);if(this.formattedTime_===t){return}this.formattedTime_=t;this.requestNamedAnimationFrame("TimeDisplay#updateTextNode_",(()=>{if(!this.contentEl_){return}let t=this.textNode_;if(t&&this.contentEl_.firstChild!==t){t=null;la.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_=K.createTextNode(this.formattedTime_);if(!this.textNode_){return}if(t){this.contentEl_.replaceChild(this.textNode_,t)}else{this.contentEl_.appendChild(this.textNode_)}}))}updateContent(t){}}su.prototype.labelText_="Time";su.prototype.controlText_="Time";yc.registerComponent("TimeDisplay",su);class nu extends su{buildCSSClass(){return"vjs-current-time"}updateContent(t){let e;if(this.player_.ended()){e=this.player_.duration()}else{e=this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime()}this.updateTextNode_(e)}}nu.prototype.labelText_="Current Time";nu.prototype.controlText_="Current Time";yc.registerComponent("CurrentTimeDisplay",nu);class ru extends su{constructor(t,e){super(t,e);const i=t=>this.updateContent(t);this.on(t,"durationchange",i);this.on(t,"loadstart",i);this.on(t,"loadedmetadata",i)}buildCSSClass(){return"vjs-duration"}updateContent(t){const e=this.player_.duration();this.updateTextNode_(e)}}ru.prototype.labelText_="Duration";ru.prototype.controlText_="Duration";yc.registerComponent("DurationDisplay",ru);class ou extends yc{createEl(){const t=super.createEl("div",{className:"vjs-time-control vjs-time-divider"},{"aria-hidden":true});const e=super.createEl("div");const i=super.createEl("span",{textContent:"/"});e.appendChild(i);t.appendChild(e);return t}}yc.registerComponent("TimeDivider",ou);class au extends su{constructor(t,e){super(t,e);this.on(t,"durationchange",(t=>this.updateContent(t)))}buildCSSClass(){return"vjs-remaining-time"}createEl(){const t=super.createEl();if(this.options_.displayNegative!==false){t.insertBefore(Qa("span",{},{"aria-hidden":true},"-"),this.contentEl_)}return t}updateContent(t){if(typeof this.player_.duration()!=="number"){return}let e;if(this.player_.ended()){e=0}else if(this.player_.remainingTimeDisplay){e=this.player_.remainingTimeDisplay()}else{e=this.player_.remainingTime()}this.updateTextNode_(e)}}au.prototype.labelText_="Remaining Time";au.prototype.controlText_="Remaining Time";yc.registerComponent("RemainingTimeDisplay",au);class hu extends yc{constructor(t,e){super(t,e);this.updateShowing();this.on(this.player(),"durationchange",(t=>this.updateShowing(t)))}createEl(){const t=super.createEl("div",{className:"vjs-live-control vjs-control"});this.contentEl_=Qa("div",{className:"vjs-live-display"},{"aria-live":"off"});this.contentEl_.appendChild(Qa("span",{className:"vjs-control-text",textContent:`${this.localize("Stream Type")} `}));this.contentEl_.appendChild(K.createTextNode(this.localize("LIVE")));t.appendChild(this.contentEl_);return t}dispose(){this.contentEl_=null;super.dispose()}updateShowing(t){if(this.player().duration()===Infinity){this.show()}else{this.hide()}}}yc.registerComponent("LiveDisplay",hu);class cu extends Zl{constructor(t,e){super(t,e);this.updateLiveEdgeStatus();if(this.player_.liveTracker){this.updateLiveEdgeStatusHandler_=t=>this.updateLiveEdgeStatus(t);this.on(this.player_.liveTracker,"liveedgechange",this.updateLiveEdgeStatusHandler_)}}createEl(){const t=super.createEl("button",{className:"vjs-seek-to-live-control vjs-control"});this.setIcon("circle",t);this.textEl_=Qa("span",{className:"vjs-seek-to-live-text",textContent:this.localize("LIVE")},{"aria-hidden":"true"});t.appendChild(this.textEl_);return t}updateLiveEdgeStatus(){if(!this.player_.liveTracker||this.player_.liveTracker.atLiveEdge()){this.setAttribute("aria-disabled",true);this.addClass("vjs-at-live-edge");this.controlText("Seek to live, currently playing live")}else{this.setAttribute("aria-disabled",false);this.removeClass("vjs-at-live-edge");this.controlText("Seek to live, currently behind live")}}handleClick(){this.player_.liveTracker.seekToLiveEdge()}dispose(){if(this.player_.liveTracker){this.off(this.player_.liveTracker,"liveedgechange",this.updateLiveEdgeStatusHandler_)}this.textEl_=null;super.dispose()}}cu.prototype.controlText_="Seek to live, currently playing live";yc.registerComponent("SeekToLive",cu);function lu(t,e,i){t=Number(t);return Math.min(i,Math.max(e,isNaN(t)?e:t))}var uu=Object.freeze({__proto__:null,clamp:lu});class fu extends yc{constructor(t,e){super(t,e);this.handleMouseDown_=t=>this.handleMouseDown(t);this.handleMouseUp_=t=>this.handleMouseUp(t);this.handleKeyDown_=t=>this.handleKeyDown(t);this.handleClick_=t=>this.handleClick(t);this.handleMouseMove_=t=>this.handleMouseMove(t);this.update_=t=>this.update(t);this.bar=this.getChild(this.options_.barName);this.vertical(!!this.options_.vertical);this.enable()}enabled(){return this.enabled_}enable(){if(this.enabled()){return}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);if(this.playerEvent){this.on(this.player_,this.playerEvent,this.update)}this.removeClass("disabled");this.setAttribute("tabindex",0);this.enabled_=true}disable(){if(!this.enabled()){return}const t=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(t,"mousemove",this.handleMouseMove_);this.off(t,"mouseup",this.handleMouseUp_);this.off(t,"touchmove",this.handleMouseMove_);this.off(t,"touchend",this.handleMouseUp_);this.removeAttribute("tabindex");this.addClass("disabled");if(this.playerEvent){this.off(this.player_,this.playerEvent,this.update)}this.enabled_=false}createEl(t,e={},i={}){e.className=e.className+" vjs-slider";e=Object.assign({tabIndex:0},e);i=Object.assign({role:"slider","aria-valuenow":0,"aria-valuemin":0,"aria-valuemax":100},i);return super.createEl(t,e,i)}handleMouseDown(t){const e=this.bar.el_.ownerDocument;if(t.type==="mousedown"){t.preventDefault()}if(t.type==="touchstart"&&!Da){t.preventDefault()}lh();this.addClass("vjs-sliding");this.trigger("slideractive");this.on(e,"mousemove",this.handleMouseMove_);this.on(e,"mouseup",this.handleMouseUp_);this.on(e,"touchmove",this.handleMouseMove_);this.on(e,"touchend",this.handleMouseUp_);this.handleMouseMove(t,true)}handleMouseMove(t){}handleMouseUp(t){const e=this.bar.el_.ownerDocument;uh();this.removeClass("vjs-sliding");this.trigger("sliderinactive");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.update()}update(){if(!this.el_||!this.bar){return}const t=this.getProgress();if(t===this.progress_){return t}this.progress_=t;this.requestNamedAnimationFrame("Slider#update",(()=>{const e=this.vertical()?"height":"width";this.bar.el().style[e]=(t*100).toFixed(2)+"%"}));return t}getProgress(){return Number(lu(this.getPercent(),0,1).toFixed(4))}calculateDistance(t){const e=ph(this.el_,t);if(this.vertical()){return e.y}return e.x}handleKeyDown(t){const e=this.options_.playerOptions.spatialNavigation;const i=e&&e.enabled;const s=e&&e.horizontalSeek;if(i){if(s&&t.key==="ArrowLeft"||!s&&t.key==="ArrowDown"){t.preventDefault();t.stopPropagation();this.stepBack()}else if(s&&t.key==="ArrowRight"||!s&&t.key==="ArrowUp"){t.preventDefault();t.stopPropagation();this.stepForward()}else{super.handleKeyDown(t)}}else if(t.key==="ArrowLeft"||t.key==="ArrowDown"){t.preventDefault();t.stopPropagation();this.stepBack()}else if(t.key==="ArrowUp"||t.key==="ArrowRight"){t.preventDefault();t.stopPropagation();this.stepForward()}else{super.handleKeyDown(t)}}handleClick(t){t.stopPropagation();t.preventDefault()}vertical(t){if(t===undefined){return this.vertical_||false}this.vertical_=!!t;if(this.vertical_){this.addClass("vjs-slider-vertical")}else{this.addClass("vjs-slider-horizontal")}}}yc.registerComponent("Slider",fu);const du=(t,e)=>lu(t/e*100,0,100).toFixed(2)+"%";class pu extends yc{constructor(t,e){super(t,e);this.partEls_=[];this.on(t,"progress",(t=>this.update(t)))}createEl(){const t=super.createEl("div",{className:"vjs-load-progress"});const e=Qa("span",{className:"vjs-control-text"});const i=Qa("span",{textContent:this.localize("Loaded")});const s=K.createTextNode(": ");this.percentageEl_=Qa("span",{className:"vjs-control-text-loaded-percentage",textContent:"0%"});t.appendChild(e);e.appendChild(i);e.appendChild(s);e.appendChild(this.percentageEl_);return t}dispose(){this.partEls_=null;this.percentageEl_=null;super.dispose()}update(t){this.requestNamedAnimationFrame("LoadProgressBar#update",(()=>{const t=this.player_.liveTracker;const e=this.player_.buffered();const i=t&&t.isLive()?t.seekableEnd():this.player_.duration();const s=this.player_.bufferedEnd();const n=this.partEls_;const r=du(s,i);if(this.percent_!==r){this.el_.style.width=r;Za(this.percentageEl_,r);this.percent_=r}for(let t=0;t<e.length;t++){const i=e.start(t);const r=e.end(t);let o=n[t];if(!o){o=this.el_.appendChild(Qa());n[t]=o}if(o.dataset.start===i&&o.dataset.end===r){continue}o.dataset.start=i;o.dataset.end=r;o.style.left=du(i,s);o.style.width=du(r-i,s)}for(let t=n.length;t>e.length;t--){this.el_.removeChild(n[t-1])}n.length=e.length}))}}yc.registerComponent("LoadProgressBar",pu);class vu extends yc{constructor(t,e){super(t,e);this.update=Kh(Jh(this,this.update),Wh)}createEl(){return super.createEl("div",{className:"vjs-time-tooltip"},{"aria-hidden":"true"})}update(t,e,i){const s=dh(this.el_);const n=fh(this.player_.el());const r=t.width*e;if(!n||!s){return}let o=t.left-n.left+r;let a=t.width-r+(n.right-t.right);if(!a){a=t.width-r;o=r}let h=s.width/2;if(o<h){h+=h-o}else if(a<h){h=a}if(h<0){h=0}else if(h>s.width){h=s.width}h=Math.round(h);this.el_.style.right=`-${h}px`;this.write(i)}write(t){Za(this.el_,t)}updateTime(t,e,i,s){this.requestNamedAnimationFrame("TimeTooltip#updateTime",(()=>{let n;const r=this.player_.duration();if(this.player_.liveTracker&&this.player_.liveTracker.isLive()){const t=this.player_.liveTracker.liveWindow();const i=t-e*t;n=(i<1?"":"-")+Ic(i,t)}else{n=Ic(i,r)}this.update(t,e,n);if(s){s()}}))}}yc.registerComponent("TimeTooltip",vu);class mu extends yc{constructor(t,e){super(t,e);this.setIcon("circle");this.update=Kh(Jh(this,this.update),Wh)}createEl(){return super.createEl("div",{className:"vjs-play-progress vjs-slider-bar"},{"aria-hidden":"true"})}update(t,e){const i=this.getChild("timeTooltip");if(!i){return}const s=this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime();i.updateTime(t,e,s)}}mu.prototype.options_={children:[]};if(!Va&&!Sa){mu.prototype.options_.children.push("timeTooltip")}yc.registerComponent("PlayProgressBar",mu);class gu extends yc{constructor(t,e){super(t,e);this.update=Kh(Jh(this,this.update),Wh)}createEl(){return super.createEl("div",{className:"vjs-mouse-display"})}update(t,e){const i=e*this.player_.duration();this.getChild("timeTooltip").updateTime(t,e,i,(()=>{this.el_.style.left=`${t.width*e}px`}))}}gu.prototype.options_={children:["timeTooltip"]};yc.registerComponent("MouseTimeDisplay",gu);const bu=5;const yu=12;class ju extends fu{constructor(t,e){super(t,e);this.setEventHandlers_()}setEventHandlers_(){this.update_=Jh(this,this.update);this.update=Kh(this.update_,Wh);this.on(this.player_,["durationchange","timeupdate"],this.update);this.on(this.player_,["ended"],this.update_);if(this.player_.liveTracker){this.on(this.player_.liveTracker,"liveedgechange",this.update)}this.updateInterval=null;this.enableIntervalHandler_=t=>this.enableInterval_(t);this.disableIntervalHandler_=t=>this.disableInterval_(t);this.on(this.player_,["playing"],this.enableIntervalHandler_);this.on(this.player_,["ended","pause","waiting"],this.disableIntervalHandler_);if("hidden"in K&&"visibilityState"in K){this.on(K,"visibilitychange",this.toggleVisibility_)}}toggleVisibility_(t){if(K.visibilityState==="hidden"){this.cancelNamedAnimationFrame("SeekBar#update");this.cancelNamedAnimationFrame("Slider#update");this.disableInterval_(t)}else{if(!this.player_.ended()&&!this.player_.paused()){this.enableInterval_()}this.update()}}enableInterval_(){if(this.updateInterval){return}this.updateInterval=this.setInterval(this.update,Wh)}disableInterval_(t){if(this.player_.liveTracker&&this.player_.liveTracker.isLive()&&t&&t.type!=="ended"){return}if(!this.updateInterval){return}this.clearInterval(this.updateInterval);this.updateInterval=null}createEl(){return super.createEl("div",{className:"vjs-progress-holder"},{"aria-label":this.localize("Progress Bar")})}update(t){if(K.visibilityState==="hidden"){return}const e=super.update();this.requestNamedAnimationFrame("SeekBar#update",(()=>{const t=this.player_.ended()?this.player_.duration():this.getCurrentTime_();const i=this.player_.liveTracker;let s=this.player_.duration();if(i&&i.isLive()){s=this.player_.liveTracker.liveCurrentTime()}if(this.percent_!==e){this.el_.setAttribute("aria-valuenow",(e*100).toFixed(2));this.percent_=e}if(this.currentTime_!==t||this.duration_!==s){this.el_.setAttribute("aria-valuetext",this.localize("progress bar timing: currentTime={1} duration={2}",[Ic(t,s),Ic(s,s)],"{1} of {2}"));this.currentTime_=t;this.duration_=s}if(this.bar){this.bar.update(fh(this.el()),this.getProgress())}}));return e}userSeek_(t){if(this.player_.liveTracker&&this.player_.liveTracker.isLive()){this.player_.liveTracker.nextSeekedFromUser()}this.player_.currentTime(t)}getCurrentTime_(){return this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime()}getPercent(){const t=this.getCurrentTime_();let e;const i=this.player_.liveTracker;if(i&&i.isLive()){e=(t-i.seekableStart())/i.liveWindow();if(i.atLiveEdge()){e=1}}else{e=t/this.player_.duration()}return e}handleMouseDown(t){if(!jh(t)){return}t.stopPropagation();this.videoWasPlaying=!this.player_.paused();this.player_.pause();super.handleMouseDown(t)}handleMouseMove(t,e=false){if(!jh(t)||isNaN(this.player_.duration())){return}if(!e&&!this.player_.scrubbing()){this.player_.scrubbing(true)}let i;const s=this.calculateDistance(t);const n=this.player_.liveTracker;if(!n||!n.isLive()){i=s*this.player_.duration();if(i===this.player_.duration()){i=i-.1}}else{if(s>=.99){n.seekToLiveEdge();return}const t=n.seekableStart();const e=n.liveCurrentTime();i=t+s*n.liveWindow();if(i>=e){i=e}if(i<=t){i=t+.1}if(i===Infinity){return}}this.userSeek_(i);if(this.player_.options_.enableSmoothSeeking){this.update()}}enable(){super.enable();const t=this.getChild("mouseTimeDisplay");if(!t){return}t.show()}disable(){super.disable();const t=this.getChild("mouseTimeDisplay");if(!t){return}t.hide()}handleMouseUp(t){super.handleMouseUp(t);if(t){t.stopPropagation()}this.player_.scrubbing(false);this.player_.trigger({type:"timeupdate",target:this,manuallyTriggered:true});if(this.videoWasPlaying){Oc(this.player_.play())}else{this.update_()}}stepForward(){this.userSeek_(this.player_.currentTime()+bu)}stepBack(){this.userSeek_(this.player_.currentTime()-bu)}handleAction(t){if(this.player_.paused()){this.player_.play()}else{this.player_.pause()}}handleKeyDown(t){const e=this.player_.liveTracker;if(t.key===" "||t.key==="Enter"){t.preventDefault();t.stopPropagation();this.handleAction(t)}else if(t.key==="Home"){t.preventDefault();t.stopPropagation();this.userSeek_(0)}else if(t.key==="End"){t.preventDefault();t.stopPropagation();if(e&&e.isLive()){this.userSeek_(e.liveCurrentTime())}else{this.userSeek_(this.player_.duration())}}else if(/^[0-9]$/.test(t.key)){t.preventDefault();t.stopPropagation();const i=parseInt(t.key,10)*.1;if(e&&e.isLive()){this.userSeek_(e.seekableStart()+e.liveWindow()*i)}else{this.userSeek_(this.player_.duration()*i)}}else if(t.key==="PageDown"){t.preventDefault();t.stopPropagation();this.userSeek_(this.player_.currentTime()-bu*yu)}else if(t.key==="PageUp"){t.preventDefault();t.stopPropagation();this.userSeek_(this.player_.currentTime()+bu*yu)}else{super.handleKeyDown(t)}}dispose(){this.disableInterval_();this.off(this.player_,["durationchange","timeupdate"],this.update);this.off(this.player_,["ended"],this.update_);if(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_);if("hidden"in K&&"visibilityState"in K){this.off(K,"visibilitychange",this.toggleVisibility_)}super.dispose()}}ju.prototype.options_={children:["loadProgressBar","playProgressBar"],barName:"playProgressBar"};if(!Va&&!Sa){ju.prototype.options_.children.splice(1,0,"mouseTimeDisplay")}yc.registerComponent("SeekBar",ju);class wu extends yc{constructor(t,e){super(t,e);this.handleMouseMove=Kh(Jh(this,this.handleMouseMove),Wh);this.throttledHandleMouseSeek=Kh(Jh(this,this.handleMouseSeek),Wh);this.handleMouseUpHandler_=t=>this.handleMouseUp(t);this.handleMouseDownHandler_=t=>this.handleMouseDown(t);this.enable()}createEl(){return super.createEl("div",{className:"vjs-progress-control vjs-control"})}handleMouseMove(t){const e=this.getChild("seekBar");if(!e){return}const i=e.getChild("playProgressBar");const s=e.getChild("mouseTimeDisplay");if(!i&&!s){return}const n=e.el();const r=dh(n);let o=ph(n,t).x;o=lu(o,0,1);if(s){s.update(r,o)}if(i){i.update(r,e.getProgress())}}handleMouseSeek(t){const e=this.getChild("seekBar");if(e){e.handleMouseMove(t)}}enabled(){return this.enabled_}disable(){this.children().forEach((t=>t.disable&&t.disable()));if(!this.enabled()){return}this.off(["mousedown","touchstart"],this.handleMouseDownHandler_);this.off(this.el_,"mousemove",this.handleMouseMove);this.removeListenersAddedOnMousedownAndTouchstart();this.addClass("disabled");this.enabled_=false;if(this.player_.scrubbing()){const t=this.getChild("seekBar");this.player_.scrubbing(false);if(t.videoWasPlaying){Oc(this.player_.play())}}}enable(){this.children().forEach((t=>t.enable&&t.enable()));if(this.enabled()){return}this.on(["mousedown","touchstart"],this.handleMouseDownHandler_);this.on(this.el_,"mousemove",this.handleMouseMove);this.removeClass("disabled");this.enabled_=true}removeListenersAddedOnMousedownAndTouchstart(){const t=this.el_.ownerDocument;this.off(t,"mousemove",this.throttledHandleMouseSeek);this.off(t,"touchmove",this.throttledHandleMouseSeek);this.off(t,"mouseup",this.handleMouseUpHandler_);this.off(t,"touchend",this.handleMouseUpHandler_)}handleMouseDown(t){const e=this.el_.ownerDocument;const i=this.getChild("seekBar");if(i){i.handleMouseDown(t)}this.on(e,"mousemove",this.throttledHandleMouseSeek);this.on(e,"touchmove",this.throttledHandleMouseSeek);this.on(e,"mouseup",this.handleMouseUpHandler_);this.on(e,"touchend",this.handleMouseUpHandler_)}handleMouseUp(t){const e=this.getChild("seekBar");if(e){e.handleMouseUp(t)}this.removeListenersAddedOnMousedownAndTouchstart()}}wu.prototype.options_={children:["seekBar"]};yc.registerComponent("ProgressControl",wu);class Tu extends Zl{constructor(t,e){super(t,e);this.setIcon("picture-in-picture-enter");this.on(t,["enterpictureinpicture","leavepictureinpicture"],(t=>this.handlePictureInPictureChange(t)));this.on(t,["disablepictureinpicturechanged","loadedmetadata"],(t=>this.handlePictureInPictureEnabledChange(t)));this.on(t,["loadedmetadata","audioonlymodechange","audiopostermodechange"],(()=>this.handlePictureInPictureAudioModeChange()));this.disable()}buildCSSClass(){return`vjs-picture-in-picture-control vjs-hidden ${super.buildCSSClass()}`}handlePictureInPictureAudioModeChange(){const t=this.player_.currentType().substring(0,5)==="audio";const e=t||this.player_.audioPosterMode()||this.player_.audioOnlyMode();if(!e){this.show();return}if(this.player_.isInPictureInPicture()){this.player_.exitPictureInPicture()}this.hide()}handlePictureInPictureEnabledChange(){if(K.pictureInPictureEnabled&&this.player_.disablePictureInPicture()===false||this.player_.options_.enableDocumentPictureInPicture&&"documentPictureInPicture"in z){this.enable()}else{this.disable()}}handlePictureInPictureChange(t){if(this.player_.isInPictureInPicture()){this.setIcon("picture-in-picture-exit");this.controlText("Exit Picture-in-Picture")}else{this.setIcon("picture-in-picture-enter");this.controlText("Picture-in-Picture")}this.handlePictureInPictureEnabledChange()}handleClick(t){if(!this.player_.isInPictureInPicture()){this.player_.requestPictureInPicture()}else{this.player_.exitPictureInPicture()}}show(){if(typeof K.exitPictureInPicture!=="function"){return}super.show()}}Tu.prototype.controlText_="Picture-in-Picture";yc.registerComponent("PictureInPictureToggle",Tu);class ku extends Zl{constructor(t,e){super(t,e);this.setIcon("fullscreen-enter");this.on(t,"fullscreenchange",(t=>this.handleFullscreenChange(t)));if(K[t.fsApi_.fullscreenEnabled]===false){this.disable()}}buildCSSClass(){return`vjs-fullscreen-control ${super.buildCSSClass()}`}handleFullscreenChange(t){if(this.player_.isFullscreen()){this.controlText("Exit Fullscreen");this.setIcon("fullscreen-exit")}else{this.controlText("Fullscreen");this.setIcon("fullscreen-enter")}}handleClick(t){if(!this.player_.isFullscreen()){this.player_.requestFullscreen()}else{this.player_.exitFullscreen()}}}ku.prototype.controlText_="Fullscreen";yc.registerComponent("FullscreenToggle",ku);const Su=function(t,e){if(e.tech_&&!e.tech_.featuresVolumeControl){t.addClass("vjs-hidden")}t.on(e,"loadstart",(function(){if(!e.tech_.featuresVolumeControl){t.addClass("vjs-hidden")}else{t.removeClass("vjs-hidden")}}))};class xu extends yc{createEl(){const t=super.createEl("div",{className:"vjs-volume-level"});this.setIcon("circle",t);t.appendChild(super.createEl("span",{className:"vjs-control-text"}));return t}}yc.registerComponent("VolumeLevel",xu);class Au extends yc{constructor(t,e){super(t,e);this.update=Kh(Jh(this,this.update),Wh)}createEl(){return super.createEl("div",{className:"vjs-volume-tooltip"},{"aria-hidden":"true"})}update(t,e,i,s){if(!i){const i=fh(this.el_);const s=fh(this.player_.el());const n=t.width*e;if(!s||!i){return}const r=t.left-s.left+n;const o=t.width-n+(s.right-t.right);let a=i.width/2;if(r<a){a+=a-r}else if(o<a){a=o}if(a<0){a=0}else if(a>i.width){a=i.width}this.el_.style.right=`-${a}px`}this.write(`${s}%`)}write(t){Za(this.el_,t)}updateVolume(t,e,i,s,n){this.requestNamedAnimationFrame("VolumeLevelTooltip#updateVolume",(()=>{this.update(t,e,i,s.toFixed(0));if(n){n()}}))}}yc.registerComponent("VolumeLevelTooltip",Au);class Eu extends yc{constructor(t,e){super(t,e);this.update=Kh(Jh(this,this.update),Wh)}createEl(){return super.createEl("div",{className:"vjs-mouse-display"})}update(t,e,i){const s=100*e;this.getChild("volumeLevelTooltip").updateVolume(t,e,i,s,(()=>{if(i){this.el_.style.bottom=`${t.height*e}px`}else{this.el_.style.left=`${t.width*e}px`}}))}}Eu.prototype.options_={children:["volumeLevelTooltip"]};yc.registerComponent("MouseVolumeLevelDisplay",Eu);class Iu extends fu{constructor(t,e){super(t,e);this.on("slideractive",(t=>this.updateLastVolume_(t)));this.on(t,"volumechange",(t=>this.updateARIAAttributes(t)));t.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(t){if(!jh(t)){return}super.handleMouseDown(t)}handleMouseMove(t){const e=this.getChild("mouseVolumeLevelDisplay");if(e){const i=this.el();const s=fh(i);const n=this.vertical();let r=ph(i,t);r=n?r.y:r.x;r=lu(r,0,1);e.update(s,r,n)}if(!jh(t)){return}this.checkMuted();this.player_.volume(this.calculateDistance(t))}checkMuted(){if(this.player_.muted()){this.player_.muted(false)}}getPercent(){if(this.player_.muted()){return 0}return this.player_.volume()}stepForward(){this.checkMuted();this.player_.volume(this.player_.volume()+.1)}stepBack(){this.checkMuted();this.player_.volume(this.player_.volume()-.1)}updateARIAAttributes(t){const e=this.player_.muted()?0:this.volumeAsPercentage_();this.el_.setAttribute("aria-valuenow",e);this.el_.setAttribute("aria-valuetext",e+"%")}volumeAsPercentage_(){return Math.round(this.player_.volume()*100)}updateLastVolume_(){const t=this.player_.volume();this.one("sliderinactive",(()=>{if(this.player_.volume()===0){this.player_.lastVolume_(t)}}))}}Iu.prototype.options_={children:["volumeLevel"],barName:"volumeLevel"};if(!Va&&!Sa){Iu.prototype.options_.children.splice(0,0,"mouseVolumeLevelDisplay")}Iu.prototype.playerEvent="volumechange";yc.registerComponent("VolumeBar",Iu);class Du extends yc{constructor(t,e={}){e.vertical=e.vertical||false;if(typeof e.volumeBar==="undefined"||ga(e.volumeBar)){e.volumeBar=e.volumeBar||{};e.volumeBar.vertical=e.vertical}super(t,e);Su(this,t);this.throttledHandleMouseMove=Kh(Jh(this,this.handleMouseMove),Wh);this.handleMouseUpHandler_=t=>this.handleMouseUp(t);this.on("mousedown",(t=>this.handleMouseDown(t)));this.on("touchstart",(t=>this.handleMouseDown(t)));this.on("mousemove",(t=>this.handleMouseMove(t)));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 t="vjs-volume-horizontal";if(this.options_.vertical){t="vjs-volume-vertical"}return super.createEl("div",{className:`vjs-volume-control vjs-control ${t}`})}handleMouseDown(t){const e=this.el_.ownerDocument;this.on(e,"mousemove",this.throttledHandleMouseMove);this.on(e,"touchmove",this.throttledHandleMouseMove);this.on(e,"mouseup",this.handleMouseUpHandler_);this.on(e,"touchend",this.handleMouseUpHandler_)}handleMouseUp(t){const e=this.el_.ownerDocument;this.off(e,"mousemove",this.throttledHandleMouseMove);this.off(e,"touchmove",this.throttledHandleMouseMove);this.off(e,"mouseup",this.handleMouseUpHandler_);this.off(e,"touchend",this.handleMouseUpHandler_)}handleMouseMove(t){this.volumeBar.handleMouseMove(t)}}Du.prototype.options_={children:["volumeBar"]};yc.registerComponent("VolumeControl",Du);const Cu=function(t,e){if(e.tech_&&!e.tech_.featuresMuteControl){t.addClass("vjs-hidden")}t.on(e,"loadstart",(function(){if(!e.tech_.featuresMuteControl){t.addClass("vjs-hidden")}else{t.removeClass("vjs-hidden")}}))};class Nu extends Zl{constructor(t,e){super(t,e);Cu(this,t);this.on(t,["loadstart","volumechange"],(t=>this.update(t)))}buildCSSClass(){return`vjs-mute-control ${super.buildCSSClass()}`}handleClick(t){const e=this.player_.volume();const i=this.player_.lastVolume_();if(e===0){const t=i<.1?.1:i;this.player_.volume(t);this.player_.muted(false)}else{this.player_.muted(this.player_.muted()?false:true)}}update(t){this.updateIcon_();this.updateControlText_()}updateIcon_(){const t=this.player_.volume();let e=3;this.setIcon("volume-high");if(Va&&this.player_.tech_&&this.player_.tech_.el_){this.player_.muted(this.player_.tech_.el_.muted)}if(t===0||this.player_.muted()){this.setIcon("volume-mute");e=0}else if(t<.33){this.setIcon("volume-low");e=1}else if(t<.67){this.setIcon("volume-medium");e=2}sh(this.el_,[0,1,2,3].reduce(((t,e)=>t+`${e?" ":""}vjs-vol-${e}`),""));ih(this.el_,`vjs-vol-${e}`)}updateControlText_(){const t=this.player_.muted()||this.player_.volume()===0;const e=t?"Unmute":"Mute";if(this.controlText()!==e){this.controlText(e)}}}Nu.prototype.controlText_="Mute";yc.registerComponent("MuteToggle",Nu);class _u extends yc{constructor(t,e={}){if(typeof e.inline!=="undefined"){e.inline=e.inline}else{e.inline=true}if(typeof e.volumeControl==="undefined"||ga(e.volumeControl)){e.volumeControl=e.volumeControl||{};e.volumeControl.vertical=!e.inline}super(t,e);this.handleKeyPressHandler_=t=>this.handleKeyPress(t);this.on(t,["loadstart"],(t=>this.volumePanelState_(t)));this.on(this.muteToggle,"keyup",(t=>this.handleKeyPress(t)));this.on(this.volumeControl,"keyup",(t=>this.handleVolumeControlKeyUp(t)));this.on("keydown",(t=>this.handleKeyPress(t)));this.on("mouseover",(t=>this.handleMouseOver(t)));this.on("mouseout",(t=>this.handleMouseOut(t)));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_(){if(this.volumeControl.hasClass("vjs-hidden")&&this.muteToggle.hasClass("vjs-hidden")){this.addClass("vjs-hidden")}if(this.volumeControl.hasClass("vjs-hidden")&&!this.muteToggle.hasClass("vjs-hidden")){this.addClass("vjs-mute-toggle-only")}}createEl(){let t="vjs-volume-panel-horizontal";if(!this.options_.inline){t="vjs-volume-panel-vertical"}return super.createEl("div",{className:`vjs-volume-panel vjs-control ${t}`})}dispose(){this.handleMouseOut();super.dispose()}handleVolumeControlKeyUp(t){if(t.key==="Escape"){this.muteToggle.focus()}}handleMouseOver(t){this.addClass("vjs-hover");Vh(K,"keyup",this.handleKeyPressHandler_)}handleMouseOut(t){this.removeClass("vjs-hover");zh(K,"keyup",this.handleKeyPressHandler_)}handleKeyPress(t){if(t.key==="Escape"){this.handleMouseOut()}}}_u.prototype.options_={children:["muteToggle","volumeControl"]};yc.registerComponent("VolumePanel",_u);class Ou extends Zl{constructor(t,e){super(t,e);this.validOptions=[5,10,30];this.skipTime=this.getSkipForwardTime();if(this.skipTime&&this.validOptions.includes(this.skipTime)){this.setIcon(`forward-${this.skipTime}`);this.controlText(this.localize("Skip forward {1} seconds",[this.skipTime.toLocaleString(t.language())]));this.show()}else{this.hide()}}getSkipForwardTime(){const t=this.options_.playerOptions;return t.controlBar&&t.controlBar.skipButtons&&t.controlBar.skipButtons.forward}buildCSSClass(){return`vjs-skip-forward-${this.getSkipForwardTime()} ${super.buildCSSClass()}`}handleClick(t){if(isNaN(this.player_.duration())){return}const e=this.player_.currentTime();const i=this.player_.liveTracker;const s=i&&i.isLive()?i.seekableEnd():this.player_.duration();let n;if(e+this.skipTime<=s){n=e+this.skipTime}else{n=s}this.player_.currentTime(n)}handleLanguagechange(){this.controlText(this.localize("Skip forward {1} seconds",[this.skipTime]))}}Ou.prototype.controlText_="Skip Forward";yc.registerComponent("SkipForward",Ou);class Mu extends Zl{constructor(t,e){super(t,e);this.validOptions=[5,10,30];this.skipTime=this.getSkipBackwardTime();if(this.skipTime&&this.validOptions.includes(this.skipTime)){this.setIcon(`replay-${this.skipTime}`);this.controlText(this.localize("Skip backward {1} seconds",[this.skipTime.toLocaleString(t.language())]));this.show()}else{this.hide()}}getSkipBackwardTime(){const t=this.options_.playerOptions;return t.controlBar&&t.controlBar.skipButtons&&t.controlBar.skipButtons.backward}buildCSSClass(){return`vjs-skip-backward-${this.getSkipBackwardTime()} ${super.buildCSSClass()}`}handleClick(t){const e=this.player_.currentTime();const i=this.player_.liveTracker;const s=i&&i.isLive()&&i.seekableStart();let n;if(s&&e-this.skipTime<=s){n=s}else if(e>=this.skipTime){n=e-this.skipTime}else{n=0}this.player_.currentTime(n)}handleLanguagechange(){this.controlText(this.localize("Skip backward {1} seconds",[this.skipTime]))}}Mu.prototype.controlText_="Skip Backward";yc.registerComponent("SkipBackward",Mu);class Ru extends yc{constructor(t,e){super(t,e);if(e){this.menuButton_=e.menuButton}this.focusedChild_=-1;this.on("keydown",(t=>this.handleKeyDown(t)));this.boundHandleBlur_=t=>this.handleBlur(t);this.boundHandleTapClick_=t=>this.handleTapClick(t)}addEventListenerForItem(t){if(!(t instanceof yc)){return}this.on(t,"blur",this.boundHandleBlur_);this.on(t,["tap","click"],this.boundHandleTapClick_)}removeEventListenerForItem(t){if(!(t instanceof yc)){return}this.off(t,"blur",this.boundHandleBlur_);this.off(t,["tap","click"],this.boundHandleTapClick_)}removeChild(t){if(typeof t==="string"){t=this.getChild(t)}this.removeEventListenerForItem(t);super.removeChild(t)}addItem(t){const e=this.addChild(t);if(e){this.addEventListenerForItem(e)}}createEl(){const t=this.options_.contentElType||"ul";this.contentEl_=Qa(t,{className:"vjs-menu-content"});this.contentEl_.setAttribute("role","menu");const e=super.createEl("div",{append:this.contentEl_,className:"vjs-menu"});e.appendChild(this.contentEl_);Vh(e,"click",(function(t){t.preventDefault();t.stopImmediatePropagation()}));return e}dispose(){this.contentEl_=null;this.boundHandleBlur_=null;this.boundHandleTapClick_=null;super.dispose()}handleBlur(t){const e=t.relatedTarget||K.activeElement;if(!this.children().some((t=>t.el()===e))){const t=this.menuButton_;if(t&&t.buttonPressed_&&e!==t.el().firstChild){t.unpressButton()}}}handleTapClick(t){if(this.menuButton_){this.menuButton_.unpressButton();const e=this.children();if(!Array.isArray(e)){return}const i=e.filter((e=>e.el()===t.target))[0];if(!i){return}if(i.name()!=="CaptionSettingsMenuItem"){this.menuButton_.focus()}}}handleKeyDown(t){if(t.key==="ArrowLeft"||t.key==="ArrowDown"){t.preventDefault();t.stopPropagation();this.stepForward()}else if(t.key==="ArrowRight"||t.key==="ArrowUp"){t.preventDefault();t.stopPropagation();this.stepBack()}}stepForward(){let t=0;if(this.focusedChild_!==undefined){t=this.focusedChild_+1}this.focus(t)}stepBack(){let t=0;if(this.focusedChild_!==undefined){t=this.focusedChild_-1}this.focus(t)}focus(t=0){const e=this.children().slice();const i=e.length&&e[0].hasClass("vjs-menu-title");if(i){e.shift()}if(e.length>0){if(t<0){t=0}else if(t>=e.length){t=e.length-1}this.focusedChild_=t;e[t].el_.focus()}}}yc.registerComponent("Menu",Ru);class Lu extends yc{constructor(t,e={}){super(t,e);this.menuButton_=new Zl(t,e);this.menuButton_.controlText(this.controlText_);this.menuButton_.el_.setAttribute("aria-haspopup","true");const i=Zl.prototype.buildCSSClass();this.menuButton_.el_.className=this.buildCSSClass()+" "+i;this.menuButton_.removeClass("vjs-control");this.addChild(this.menuButton_);this.update();this.enabled_=true;const s=t=>this.handleClick(t);this.handleMenuKeyUp_=t=>this.handleMenuKeyUp(t);this.on(this.menuButton_,"tap",s);this.on(this.menuButton_,"click",s);this.on(this.menuButton_,"keydown",(t=>this.handleKeyDown(t)));this.on(this.menuButton_,"mouseenter",(()=>{this.addClass("vjs-hover");this.menu.show();Vh(K,"keyup",this.handleMenuKeyUp_)}));this.on("mouseleave",(t=>this.handleMouseLeave(t)));this.on("keydown",(t=>this.handleSubmenuKeyDown(t)))}update(){const t=this.createMenu();if(this.menu){this.menu.dispose();this.removeChild(this.menu)}this.menu=t;this.addChild(t);this.buttonPressed_=false;this.menuButton_.el_.setAttribute("aria-expanded","false");if(this.items&&this.items.length<=this.hideThreshold_){this.hide();this.menu.contentEl_.removeAttribute("role")}else{this.show();this.menu.contentEl_.setAttribute("role","menu")}}createMenu(){const t=new Ru(this.player_,{menuButton:this});this.hideThreshold_=0;if(this.options_.title){const e=Qa("li",{className:"vjs-menu-title",textContent:mc(this.options_.title),tabIndex:-1});const i=new yc(this.player_,{el:e});t.addItem(i)}this.items=this.createItems();if(this.items){for(let e=0;e<this.items.length;e++){t.addItem(this.items[e])}}return t}createItems(){}createEl(){return super.createEl("div",{className:this.buildWrapperCSSClass()},{})}setIcon(t){super.setIcon(t,this.menuButton_.el_)}buildWrapperCSSClass(){let t="vjs-menu-button";if(this.options_.inline===true){t+="-inline"}else{t+="-popup"}const e=Zl.prototype.buildCSSClass();return`vjs-menu-button ${t} ${e} ${super.buildCSSClass()}`}buildCSSClass(){let t="vjs-menu-button";if(this.options_.inline===true){t+="-inline"}else{t+="-popup"}return`vjs-menu-button ${t} ${super.buildCSSClass()}`}controlText(t,e=this.menuButton_.el()){return this.menuButton_.controlText(t,e)}dispose(){this.handleMouseLeave();super.dispose()}handleClick(t){if(this.buttonPressed_){this.unpressButton()}else{this.pressButton()}}handleMouseLeave(t){this.removeClass("vjs-hover");zh(K,"keyup",this.handleMenuKeyUp_)}focus(){this.menuButton_.focus()}blur(){this.menuButton_.blur()}handleKeyDown(t){if(t.key==="Esc"||t.key==="Tab"){if(this.buttonPressed_){this.unpressButton()}if(!t.key==="Tab"){t.preventDefault();this.menuButton_.focus()}}else if(t.key==="Up"||t.key==="Down"&&!(this.player_.options_.playerOptions.spatialNavigation&&this.player_.options_.playerOptions.spatialNavigation.enabled)){if(!this.buttonPressed_){t.preventDefault();this.pressButton()}}}handleMenuKeyUp(t){if(t.key==="Esc"||t.key==="Tab"){this.removeClass("vjs-hover")}}handleSubmenuKeyPress(t){this.handleSubmenuKeyDown(t)}handleSubmenuKeyDown(t){if(t.key==="Esc"||t.key==="Tab"){if(this.buttonPressed_){this.unpressButton()}if(!t.key==="Tab"){t.preventDefault();this.menuButton_.focus()}}}pressButton(){if(this.enabled_){this.buttonPressed_=true;this.menu.show();this.menu.lockShowing();this.menuButton_.el_.setAttribute("aria-expanded","true");if(Va&&Ja()){return}this.menu.focus()}}unpressButton(){if(this.enabled_){this.buttonPressed_=false;this.menu.unlockShowing();this.menu.hide();this.menuButton_.el_.setAttribute("aria-expanded","false")}}disable(){this.unpressButton();this.enabled_=false;this.addClass("vjs-disabled");this.menuButton_.disable()}enable(){this.enabled_=true;this.removeClass("vjs-disabled");this.menuButton_.enable()}}yc.registerComponent("MenuButton",Lu);class Pu extends Lu{constructor(t,e){const i=e.tracks;super(t,e);if(this.items.length<=1){this.hide()}if(!i){return}const s=Jh(this,this.update);i.addEventListener("removetrack",s);i.addEventListener("addtrack",s);i.addEventListener("labelchange",s);this.player_.on("ready",s);this.player_.on("dispose",(function(){i.removeEventListener("removetrack",s);i.removeEventListener("addtrack",s);i.removeEventListener("labelchange",s)}))}}yc.registerComponent("TrackButton",Pu);class $u extends Vl{constructor(t,e){super(t,e);this.selectable=e.selectable;this.isSelected_=e.selected||false;this.multiSelectable=e.multiSelectable;this.selected(this.isSelected_);if(this.selectable){if(this.multiSelectable){this.el_.setAttribute("role","menuitemcheckbox")}else{this.el_.setAttribute("role","menuitemradio")}}else{this.el_.setAttribute("role","menuitem")}}createEl(t,e,i){this.nonIconControl=true;const s=super.createEl("li",Object.assign({className:"vjs-menu-item",tabIndex:-1},e),i);const n=Qa("span",{className:"vjs-menu-item-text",textContent:this.localize(this.options_.label)});if(this.player_.options_.experimentalSvgIcons){s.appendChild(n)}else{s.replaceChild(n,s.querySelector(".vjs-icon-placeholder"))}return s}handleKeyDown(t){if(!["Tab","Escape","ArrowUp","ArrowLeft","ArrowRight","ArrowDown"].includes(t.key)){super.handleKeyDown(t)}}handleClick(t){this.selected(true)}selected(t){if(this.selectable){if(t){this.addClass("vjs-selected");this.el_.setAttribute("aria-checked","true");this.controlText(", selected");this.isSelected_=true}else{this.removeClass("vjs-selected");this.el_.setAttribute("aria-checked","false");this.controlText("");this.isSelected_=false}}}}yc.registerComponent("MenuItem",$u);class Fu extends $u{constructor(t,e){const i=e.track;const s=t.textTracks();e.label=i.label||i.language||"Unknown";e.selected=i.mode==="showing";super(t,e);this.track=i;this.kinds=(e.kinds||[e.kind||this.track.kind]).filter(Boolean);const n=(...t)=>{this.handleTracksChange.apply(this,t)};const r=(...t)=>{this.handleSelectedLanguageChange.apply(this,t)};t.on(["loadstart","texttrackchange"],n);s.addEventListener("change",n);s.addEventListener("selectedlanguagechange",r);this.on("dispose",(function(){t.off(["loadstart","texttrackchange"],n);s.removeEventListener("change",n);s.removeEventListener("selectedlanguagechange",r)}));if(s.onchange===undefined){let t;this.on(["tap","click"],(function(){if(typeof z.Event!=="object"){try{t=new z.Event("change")}catch(t){}}if(!t){t=K.createEvent("Event");t.initEvent("change",true,true)}s.dispatchEvent(t)}))}this.handleTracksChange()}handleClick(t){const e=this.track;const i=this.player_.textTracks();super.handleClick(t);if(!i){return}for(let t=0;t<i.length;t++){const s=i[t];if(this.kinds.indexOf(s.kind)===-1){continue}if(s===e){if(s.mode!=="showing"){s.mode="showing"}}else if(s.mode!=="disabled"){s.mode="disabled"}}}handleTracksChange(t){const e=this.track.mode==="showing";if(e!==this.isSelected_){this.selected(e)}}handleSelectedLanguageChange(t){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:true,language:this.track.language,kind:this.track.kind}}}dispose(){this.track=null;super.dispose()}}yc.registerComponent("TextTrackMenuItem",Fu);class Uu extends Fu{constructor(t,e){e.track={player:t,kind:e.kind,kinds:e.kinds,default:false,mode:"disabled"};if(!e.kinds){e.kinds=[e.kind]}if(e.label){e.track.label=e.label}else{e.track.label=e.kinds.join(" and ")+" off"}e.selectable=true;e.multiSelectable=false;super(t,e)}handleTracksChange(t){const e=this.player().textTracks();let i=true;for(let t=0,s=e.length;t<s;t++){const s=e[t];if(this.options_.kinds.indexOf(s.kind)>-1&&s.mode==="showing"){i=false;break}}if(i!==this.isSelected_){this.selected(i)}}handleSelectedLanguageChange(t){const e=this.player().textTracks();let i=true;for(let t=0,s=e.length;t<s;t++){const s=e[t];if(["captions","descriptions","subtitles"].indexOf(s.kind)>-1&&s.mode==="showing"){i=false;break}}if(i){this.player_.cache_.selectedLanguage={enabled:false}}}handleLanguagechange(){this.$(".vjs-menu-item-text").textContent=this.player_.localize(this.options_.label);super.handleLanguagechange()}}yc.registerComponent("OffTextTrackMenuItem",Uu);class Bu extends Pu{constructor(t,e={}){e.tracks=t.textTracks();super(t,e)}createItems(t=[],e=Fu){let i;if(this.label_){i=`${this.label_} off`}t.push(new Uu(this.player_,{kinds:this.kinds_,kind:this.kind_,label:i}));this.hideThreshold_+=1;const s=this.player_.textTracks();if(!Array.isArray(this.kinds_)){this.kinds_=[this.kind_]}for(let i=0;i<s.length;i++){const n=s[i];if(this.kinds_.indexOf(n.kind)>-1){const i=new e(this.player_,{track:n,kinds:this.kinds_,kind:this.kind_,selectable:true,multiSelectable:false});i.addClass(`vjs-${n.kind}-menu-item`);t.push(i)}}return t}}yc.registerComponent("TextTrackButton",Bu);class qu extends $u{constructor(t,e){const i=e.track;const s=e.cue;const n=t.currentTime();e.selectable=true;e.multiSelectable=false;e.label=s.text;e.selected=s.startTime<=n&&n<s.endTime;super(t,e);this.track=i;this.cue=s}handleClick(t){super.handleClick();this.player_.currentTime(this.cue.startTime)}}yc.registerComponent("ChaptersTrackMenuItem",qu);class Vu extends Bu{constructor(t,e,i){super(t,e,i);this.setIcon("chapters");this.selectCurrentItem_=()=>{this.items.forEach((t=>{t.selected(this.track_.activeCues[0]===t.cue)}))}}buildCSSClass(){return`vjs-chapters-button ${super.buildCSSClass()}`}buildWrapperCSSClass(){return`vjs-chapters-button ${super.buildWrapperCSSClass()}`}update(t){if(t&&t.track&&t.track.kind!=="chapters"){return}const e=this.findChaptersTrack();if(e!==this.track_){this.setTrack(e);super.update()}else if(!this.items||e&&e.cues&&e.cues.length!==this.items.length){super.update()}}setTrack(t){if(this.track_===t){return}if(!this.updateHandler_){this.updateHandler_=this.update.bind(this)}if(this.track_){const t=this.player_.remoteTextTrackEls().getTrackElementByTrack_(this.track_);if(t){t.removeEventListener("load",this.updateHandler_)}this.track_.removeEventListener("cuechange",this.selectCurrentItem_);this.track_=null}this.track_=t;if(this.track_){this.track_.mode="hidden";const t=this.player_.remoteTextTrackEls().getTrackElementByTrack_(this.track_);if(t){t.addEventListener("load",this.updateHandler_)}this.track_.addEventListener("cuechange",this.selectCurrentItem_)}}findChaptersTrack(){const t=this.player_.textTracks()||[];for(let e=t.length-1;e>=0;e--){const i=t[e];if(i.kind===this.kind_){return i}}}getMenuCaption(){if(this.track_&&this.track_.label){return this.track_.label}return this.localize(mc(this.kind_))}createMenu(){this.options_.title=this.getMenuCaption();return super.createMenu()}createItems(){const t=[];if(!this.track_){return t}const e=this.track_.cues;if(!e){return t}for(let i=0,s=e.length;i<s;i++){const s=e[i];const n=new qu(this.player_,{track:this.track_,cue:s});t.push(n)}return t}}Vu.prototype.kind_="chapters";Vu.prototype.controlText_="Chapters";yc.registerComponent("ChaptersButton",Vu);class zu extends Bu{constructor(t,e,i){super(t,e,i);this.setIcon("audio-description");const s=t.textTracks();const n=Jh(this,this.handleTracksChange);s.addEventListener("change",n);this.on("dispose",(function(){s.removeEventListener("change",n)}))}handleTracksChange(t){const e=this.player().textTracks();let i=false;for(let t=0,s=e.length;t<s;t++){const s=e[t];if(s.kind!==this.kind_&&s.mode==="showing"){i=true;break}}if(i){this.disable()}else{this.enable()}}buildCSSClass(){return`vjs-descriptions-button ${super.buildCSSClass()}`}buildWrapperCSSClass(){return`vjs-descriptions-button ${super.buildWrapperCSSClass()}`}}zu.prototype.kind_="descriptions";zu.prototype.controlText_="Descriptions";yc.registerComponent("DescriptionsButton",zu);class Hu extends Bu{constructor(t,e,i){super(t,e,i);this.setIcon("subtitles")}buildCSSClass(){return`vjs-subtitles-button ${super.buildCSSClass()}`}buildWrapperCSSClass(){return`vjs-subtitles-button ${super.buildWrapperCSSClass()}`}}Hu.prototype.kind_="subtitles";Hu.prototype.controlText_="Subtitles";yc.registerComponent("SubtitlesButton",Hu);class Xu extends Fu{constructor(t,e){e.track={player:t,kind:e.kind,label:e.kind+" settings",selectable:false,default:false,mode:"disabled"};e.selectable=false;e.name="CaptionSettingsMenuItem";super(t,e);this.addClass("vjs-texttrack-settings");this.controlText(", opens "+e.kind+" settings dialog")}handleClick(t){this.player().getChild("textTrackSettings").open()}handleLanguagechange(){this.$(".vjs-menu-item-text").textContent=this.player_.localize(this.options_.kind+" settings");super.handleLanguagechange()}}yc.registerComponent("CaptionSettingsMenuItem",Xu);class Gu extends Bu{constructor(t,e,i){super(t,e,i);this.setIcon("captions")}buildCSSClass(){return`vjs-captions-button ${super.buildCSSClass()}`}buildWrapperCSSClass(){return`vjs-captions-button ${super.buildWrapperCSSClass()}`}createItems(){const t=[];if(!(this.player().tech_&&this.player().tech_.featuresNativeTextTracks)&&this.player().getChild("textTrackSettings")){t.push(new Xu(this.player_,{kind:this.kind_}));this.hideThreshold_+=1}return super.createItems(t)}}Gu.prototype.kind_="captions";Gu.prototype.controlText_="Captions";yc.registerComponent("CaptionsButton",Gu);class Yu extends Fu{createEl(t,e,i){const s=super.createEl(t,e,i);const n=s.querySelector(".vjs-menu-item-text");if(this.options_.track.kind==="captions"){if(this.player_.options_.experimentalSvgIcons){this.setIcon("captions",s)}else{n.appendChild(Qa("span",{className:"vjs-icon-placeholder"},{"aria-hidden":true}))}n.appendChild(Qa("span",{className:"vjs-control-text",textContent:` ${this.localize("Captions")}`}))}return s}}yc.registerComponent("SubsCapsMenuItem",Yu);class Wu extends Bu{constructor(t,e={}){super(t,e);this.label_="subtitles";this.setIcon("subtitles");if(["en","en-us","en-ca","fr-ca"].indexOf(this.player_.language_)>-1){this.label_="captions";this.setIcon("captions")}this.menuButton_.controlText(mc(this.label_))}buildCSSClass(){return`vjs-subs-caps-button ${super.buildCSSClass()}`}buildWrapperCSSClass(){return`vjs-subs-caps-button ${super.buildWrapperCSSClass()}`}createItems(){let t=[];if(!(this.player().tech_&&this.player().tech_.featuresNativeTextTracks)&&this.player().getChild("textTrackSettings")){t.push(new Xu(this.player_,{kind:this.label_}));this.hideThreshold_+=1}t=super.createItems(t,Yu);return t}}Wu.prototype.kinds_=["captions","subtitles"];Wu.prototype.controlText_="Subtitles";yc.registerComponent("SubsCapsButton",Wu);class Ju extends $u{constructor(t,e){const i=e.track;const s=t.audioTracks();e.label=i.label||i.language||"Unknown";e.selected=i.enabled;super(t,e);this.track=i;this.addClass(`vjs-${i.kind}-menu-item`);const n=(...t)=>{this.handleTracksChange.apply(this,t)};s.addEventListener("change",n);this.on("dispose",(()=>{s.removeEventListener("change",n)}))}createEl(t,e,i){const s=super.createEl(t,e,i);const n=s.querySelector(".vjs-menu-item-text");if(["main-desc","descriptions"].indexOf(this.options_.track.kind)>=0){n.appendChild(Qa("span",{className:"vjs-icon-placeholder"},{"aria-hidden":true}));n.appendChild(Qa("span",{className:"vjs-control-text",textContent:" "+this.localize("Descriptions")}))}return s}handleClick(t){super.handleClick(t);this.track.enabled=true;if(this.player_.tech_.featuresNativeAudioTracks){const t=this.player_.audioTracks();for(let e=0;e<t.length;e++){const i=t[e];if(i===this.track){continue}i.enabled=i===this.track}}}handleTracksChange(t){this.selected(this.track.enabled)}}yc.registerComponent("AudioTrackMenuItem",Ju);class Ku extends Pu{constructor(t,e={}){e.tracks=t.audioTracks();super(t,e);this.setIcon("audio")}buildCSSClass(){return`vjs-audio-button ${super.buildCSSClass()}`}buildWrapperCSSClass(){return`vjs-audio-button ${super.buildWrapperCSSClass()}`}createItems(t=[]){this.hideThreshold_=1;const e=this.player_.audioTracks();for(let i=0;i<e.length;i++){const s=e[i];t.push(new Ju(this.player_,{track:s,selectable:true,multiSelectable:false}))}return t}}Ku.prototype.controlText_="Audio Track";yc.registerComponent("AudioTrackButton",Ku);class Qu extends $u{constructor(t,e){const i=e.rate;const s=parseFloat(i,10);e.label=i;e.selected=s===t.playbackRate();e.selectable=true;e.multiSelectable=false;super(t,e);this.label=i;this.rate=s;this.on(t,"ratechange",(t=>this.update(t)))}handleClick(t){super.handleClick();this.player().playbackRate(this.rate)}update(t){this.selected(this.player().playbackRate()===this.rate)}}Qu.prototype.contentElType="button";yc.registerComponent("PlaybackRateMenuItem",Qu);class Zu extends Lu{constructor(t,e){super(t,e);this.menuButton_.el_.setAttribute("aria-describedby",this.labelElId_);this.updateVisibility();this.updateLabel();this.on(t,"loadstart",(t=>this.updateVisibility(t)));this.on(t,"ratechange",(t=>this.updateLabel(t)));this.on(t,"playbackrateschange",(t=>this.handlePlaybackRateschange(t)))}createEl(){const t=super.createEl();this.labelElId_="vjs-playback-rate-value-label-"+this.id_;this.labelEl_=Qa("div",{className:"vjs-playback-rate-value",id:this.labelElId_,textContent:"1x"});t.appendChild(this.labelEl_);return t}dispose(){this.labelEl_=null;super.dispose()}buildCSSClass(){return`vjs-playback-rate ${super.buildCSSClass()}`}buildWrapperCSSClass(){return`vjs-playback-rate ${super.buildWrapperCSSClass()}`}createItems(){const t=this.playbackRates();const e=[];for(let i=t.length-1;i>=0;i--){e.push(new Qu(this.player(),{rate:t[i]+"x"}))}return e}handlePlaybackRateschange(t){this.update()}playbackRates(){const t=this.player();return t.playbackRates&&t.playbackRates()||[]}playbackRateSupported(){return this.player().tech_&&this.player().tech_.featuresPlaybackRate&&this.playbackRates()&&this.playbackRates().length>0}updateVisibility(t){if(this.playbackRateSupported()){this.removeClass("vjs-hidden")}else{this.addClass("vjs-hidden")}}updateLabel(t){if(this.playbackRateSupported()){this.labelEl_.textContent=this.player().playbackRate()+"x"}}}Zu.prototype.controlText_="Playback Rate";yc.registerComponent("PlaybackRateMenuButton",Zu);class tf extends yc{buildCSSClass(){return`vjs-spacer ${super.buildCSSClass()}`}createEl(t="div",e={},i={}){if(!e.className){e.className=this.buildCSSClass()}return super.createEl(t,e,i)}}yc.registerComponent("Spacer",tf);class ef extends tf{buildCSSClass(){return`vjs-custom-control-spacer ${super.buildCSSClass()}`}createEl(){return super.createEl("div",{className:this.buildCSSClass(),textContent:" "})}}yc.registerComponent("CustomControlSpacer",ef);class sf extends yc{createEl(){return super.createEl("div",{className:"vjs-control-bar",dir:"ltr"})}}sf.prototype.options_={children:["playToggle","skipBackward","skipForward","volumePanel","currentTimeDisplay","timeDivider","durationDisplay","progressControl","liveDisplay","seekToLive","remainingTimeDisplay","customControlSpacer","playbackRateMenuButton","chaptersButton","descriptionsButton","subsCapsButton","audioTrackButton","pictureInPictureToggle","fullscreenToggle"]};yc.registerComponent("ControlBar",sf);class nf extends Fc{constructor(t,e){super(t,e);this.on(t,"error",(t=>{this.open(t)}))}buildCSSClass(){return`vjs-error-display ${super.buildCSSClass()}`}content(){const t=this.player().error();return t?this.localize(t.message):""}}nf.prototype.options_=Object.assign({},Fc.prototype.options_,{pauseOnOpen:false,fillAlways:true,temporary:false,uncloseable:true});yc.registerComponent("ErrorDisplay",nf);class rf extends yc{constructor(t,e={}){super(t,e);this.el_.setAttribute("aria-labelledby",this.selectLabelledbyIds)}createEl(){this.selectLabelledbyIds=[this.options_.legendId,this.options_.labelId].join(" ").trim();const t=Qa("select",{id:this.options_.id},{},this.options_.SelectOptions.map((t=>{const e=(this.options_.labelId?this.options_.labelId:`vjs-track-option-${Lh()}`)+"-"+t[1].replace(/\W+/g,"");const i=Qa("option",{id:e,value:this.localize(t[0]),textContent:t[1]});i.setAttribute("aria-labelledby",`${this.selectLabelledbyIds} ${e}`);return i})));return t}}yc.registerComponent("TextTrackSelect",rf);class of extends yc{constructor(t,e={}){super(t,e);const i=Qa("legend",{textContent:this.localize(this.options_.legendText),id:this.options_.legendId});this.el().appendChild(i);const s=this.options_.selects;for(const e of s){const i=this.options_.selectConfigs[e];const s=i.className;const n=i.id.replace("%s",this.options_.id_);let r=null;const o=`vjs_select_${Lh()}`;if(this.options_.type==="colors"){r=Qa("span",{className:s});const t=Qa("label",{id:n,className:"vjs-label",textContent:i.label});t.setAttribute("for",o);r.appendChild(t)}const a=new rf(t,{SelectOptions:i.options,legendId:this.options_.legendId,id:o,labelId:n});this.addChild(a);if(this.options_.type==="colors"){r.appendChild(a.el());this.el().appendChild(r)}}}createEl(){const t=Qa("fieldset",{className:this.options_.className});return t}}yc.registerComponent("TextTrackFieldset",of);class af extends yc{constructor(t,e={}){super(t,e);const i=this.options_.textTrackComponentid;const s=new of(t,{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(s);const n=new of(t,{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 r=new of(t,{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(r)}createEl(){const t=Qa("div",{className:"vjs-track-settings-colors"});return t}}yc.registerComponent("TextTrackSettingsColors",af);class hf extends yc{constructor(t,e={}){super(t,e);const i=this.options_.textTrackComponentid;const s=new of(t,{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(s);const n=new of(t,{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 r=new of(t,{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(r)}createEl(){const t=Qa("div",{className:"vjs-track-settings-font"});return t}}yc.registerComponent("TextTrackSettingsFont",hf);class cf extends yc{constructor(t,e={}){super(t,e);const i=this.localize("restore all settings to the default values");const s=new Zl(t,{controlText:i,className:"vjs-default-button"});s.el().classList.remove("vjs-control","vjs-button");s.el().textContent=this.localize("Reset");this.addChild(s);const n=new Zl(t,{controlText:i,className:"vjs-done-button"});n.el().classList.remove("vjs-control","vjs-button");n.el().textContent=this.localize("Done");this.addChild(n)}createEl(){const t=Qa("div",{className:"vjs-track-settings-controls"});return t}}yc.registerComponent("TrackSettingsControls",cf);const lf="vjs-text-track-settings";const uf=["#000","Black"];const ff=["#00F","Blue"];const df=["#0FF","Cyan"];const pf=["#0F0","Green"];const vf=["#F0F","Magenta"];const mf=["#F00","Red"];const gf=["#FFF","White"];const bf=["#FF0","Yellow"];const yf=["1","Opaque"];const jf=["0.5","Semi-Transparent"];const wf=["0","Transparent"];const Tf={backgroundColor:{selector:".vjs-bg-color > select",id:"captions-background-color-%s",label:"Color",options:[uf,gf,mf,pf,ff,bf,vf,df],className:"vjs-bg-color"},backgroundOpacity:{selector:".vjs-bg-opacity > select",id:"captions-background-opacity-%s",label:"Opacity",options:[yf,jf,wf],className:"vjs-bg-opacity vjs-opacity"},color:{selector:".vjs-text-color > select",id:"captions-foreground-color-%s",label:"Color",options:[gf,uf,mf,pf,ff,bf,vf,df],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:t=>t==="1.00"?null:Number(t)},textOpacity:{selector:".vjs-text-opacity > select",id:"captions-foreground-opacity-%s",label:"Opacity",options:[yf,jf],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:[wf,jf,yf],className:"vjs-window-opacity vjs-opacity"}};Tf.windowColor.options=Tf.backgroundColor.options;function kf(t,e){if(e){t=e(t)}if(t&&t!=="none"){return t}}function Sf(t,e){const i=t.options[t.options.selectedIndex].value;return kf(i,e)}function xf(t,e,i){if(!e){return}for(let s=0;s<t.options.length;s++){if(kf(t.options[s].value,i)===e){t.selectedIndex=s;break}}}class Af extends Fc{constructor(t,e){e.temporary=false;super(t,e);this.updateDisplay=this.updateDisplay.bind(this);this.fill();this.hasBeenOpened_=this.hasBeenFilled_=true;this.renderModalComponents(t);this.endDialog=Qa("p",{className:"vjs-control-text",textContent:this.localize("End of dialog window.")});this.el().appendChild(this.endDialog);this.setDefaults();if(e.persistTextTrackSettings===undefined){this.options_.persistTextTrackSettings=this.options_.playerOptions.persistTextTrackSettings}this.bindFunctionsToSelectsAndButtons();if(this.options_.persistTextTrackSettings){this.restoreSettings()}}renderModalComponents(t){const e=new af(t,{textTrackComponentid:this.id_,selectConfigs:Tf,fieldSets:[["color","textOpacity"],["backgroundColor","backgroundOpacity"],["windowColor","windowOpacity"]]});this.addChild(e);const i=new hf(t,{textTrackComponentid:this.id_,selectConfigs:Tf,fieldSets:[["fontPercent"],["edgeStyle"],["fontFamily"]]});this.addChild(i);const s=new cf(t);this.addChild(s)}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()}));pa(Tf,(t=>{this.on(this.$(t.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 va(Tf,((t,e,i)=>{const s=Sf(this.$(e.selector),e.parser);if(s!==undefined){t[i]=s}return t}),{})}setValues(t){pa(Tf,((e,i)=>{xf(this.$(e.selector),t[i],e.parser)}))}setDefaults(){pa(Tf,(t=>{const e=t.hasOwnProperty("default")?t.default:0;this.$(t.selector).selectedIndex=e}))}restoreSettings(){let t;try{t=JSON.parse(z.localStorage.getItem(lf))}catch(t){la.warn(t)}if(t){this.setValues(t)}}saveSettings(){if(!this.options_.persistTextTrackSettings){return}const t=this.getValues();try{if(Object.keys(t).length){z.localStorage.setItem(lf,JSON.stringify(t))}else{z.localStorage.removeItem(lf)}}catch(t){la.warn(t)}}updateDisplay(){const t=this.player_.getChild("textTrackDisplay");if(t){t.updateDisplay()}}handleLanguagechange(){this.fill();this.renderModalComponents(this.player_);this.bindFunctionsToSelectsAndButtons()}}yc.registerComponent("TextTrackSettings",Af);class Ef extends yc{constructor(t,e){let i=e.ResizeObserver||z.ResizeObserver;if(e.ResizeObserver===null){i=false}const s=ba({createEl:!i,reportTouchActivity:false},e);super(t,s);this.ResizeObserver=e.ResizeObserver||z.ResizeObserver;this.loadListener_=null;this.resizeObserver_=null;this.debouncedHandler_=Qh((()=>{this.resizeHandler()}),100,false,this);if(i){this.resizeObserver_=new this.ResizeObserver(this.debouncedHandler_);this.resizeObserver_.observe(t.el())}else{this.loadListener_=()=>{if(!this.el_||!this.el_.contentWindow){return}const t=this.debouncedHandler_;let e=this.unloadListener_=function(){zh(this,"resize",t);zh(this,"unload",e);e=null};Vh(this.el_.contentWindow,"unload",e);Vh(this.el_.contentWindow,"resize",t)};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(){if(!this.player_||!this.player_.trigger){return}this.player_.trigger("playerresize")}dispose(){if(this.debouncedHandler_){this.debouncedHandler_.cancel()}if(this.resizeObserver_){if(this.player_.el()){this.resizeObserver_.unobserve(this.player_.el())}this.resizeObserver_.disconnect()}if(this.loadListener_){this.off("load",this.loadListener_)}if(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()}}yc.registerComponent("ResizeManager",Ef);const If={trackingThreshold:20,liveTolerance:15};class Df extends yc{constructor(t,e){const i=ba(If,e,{createEl:false});super(t,i);this.trackLiveHandler_=()=>this.trackLive_();this.handlePlay_=t=>this.handlePlay(t);this.handleFirstTimeupdate_=t=>this.handleFirstTimeupdate(t);this.handleSeeked_=t=>this.handleSeeked(t);this.seekToLiveEdge_=t=>this.seekToLiveEdge(t);this.reset_();this.on(this.player_,"durationchange",(t=>this.handleDurationchange(t)));this.on(this.player_,"canplay",(()=>this.toggleTracking()))}trackLive_(){const t=this.player_.seekable();if(!t||!t.length){return}const e=Number(z.performance.now().toFixed(4));const i=this.lastTime_===-1?0:(e-this.lastTime_)/1e3;this.lastTime_=e;this.pastSeekEnd_=this.pastSeekEnd()+i;const s=this.liveCurrentTime();const n=this.player_.currentTime();let r=this.player_.paused()||this.seekedBehindLive_||Math.abs(s-n)>this.options_.liveTolerance;if(!this.timeupdateSeen_||s===Infinity){r=false}if(r!==this.behindLiveEdge_){this.behindLiveEdge_=r;this.trigger("liveedgechange")}}handleDurationchange(){this.toggleTracking()}toggleTracking(){if(this.player_.duration()===Infinity&&this.liveWindow()>=this.options_.trackingThreshold){if(this.player_.options_.liveui){this.player_.addClass("vjs-liveui")}this.startTracking()}else{this.player_.removeClass("vjs-liveui");this.stopTracking()}}startTracking(){if(this.isTracking()){return}if(!this.timeupdateSeen_){this.timeupdateSeen_=this.player_.hasStarted()}this.trackingInterval_=this.setInterval(this.trackLiveHandler_,Wh);this.trackLive_();this.on(this.player_,["play","pause"],this.trackLiveHandler_);if(!this.timeupdateSeen_){this.one(this.player_,"play",this.handlePlay_);this.one(this.player_,"timeupdate",this.handleFirstTimeupdate_)}else{this.on(this.player_,"seeked",this.handleSeeked_)}}handleFirstTimeupdate(){this.timeupdateSeen_=true;this.on(this.player_,"seeked",this.handleSeeked_)}handleSeeked(){const t=Math.abs(this.liveCurrentTime()-this.player_.currentTime());this.seekedBehindLive_=this.nextSeekedFromUser_&&t>2;this.nextSeekedFromUser_=false;this.trackLive_()}handlePlay(){this.one(this.player_,"timeupdate",this.seekToLiveEdge_)}reset_(){this.lastTime_=-1;this.pastSeekEnd_=0;this.lastSeekEnd_=-1;this.behindLiveEdge_=true;this.timeupdateSeen_=false;this.seekedBehindLive_=false;this.nextSeekedFromUser_=false;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_=true}stopTracking(){if(!this.isTracking()){return}this.reset_();this.trigger("liveedgechange")}seekableEnd(){const t=this.player_.seekable();const e=[];let i=t?t.length:0;while(i--){e.push(t.end(i))}return e.length?e.sort()[e.length-1]:Infinity}seekableStart(){const t=this.player_.seekable();const e=[];let i=t?t.length:0;while(i--){e.push(t.start(i))}return e.length?e.sort()[0]:0}liveWindow(){const t=this.liveCurrentTime();if(t===Infinity){return 0}return t-this.seekableStart()}isLive(){return this.isTracking()}atLiveEdge(){return!this.behindLiveEdge()}liveCurrentTime(){return this.pastSeekEnd()+this.seekableEnd()}pastSeekEnd(){const t=this.seekableEnd();if(this.lastSeekEnd_!==-1&&t!==this.lastSeekEnd_){this.pastSeekEnd_=0}this.lastSeekEnd_=t;return this.pastSeekEnd_}behindLiveEdge(){return this.behindLiveEdge_}isTracking(){return typeof this.trackingInterval_==="number"}seekToLiveEdge(){this.seekedBehindLive_=false;if(this.atLiveEdge()){return}this.nextSeekedFromUser_=false;this.player_.currentTime(this.liveCurrentTime())}dispose(){this.stopTracking();super.dispose()}}yc.registerComponent("LiveTracker",Df);class Cf extends yc{constructor(t,e){super(t,e);this.on("statechanged",(t=>this.updateDom_()));this.updateDom_()}createEl(){this.els={title:Qa("div",{className:"vjs-title-bar-title",id:`vjs-title-bar-title-${Lh()}`}),description:Qa("div",{className:"vjs-title-bar-description",id:`vjs-title-bar-description-${Lh()}`})};return Qa("div",{className:"vjs-title-bar"},{},ya(this.els))}updateDom_(){const t=this.player_.tech_;const e=t&&t.el_;const i={title:"aria-labelledby",description:"aria-describedby"};["title","description"].forEach((t=>{const s=this.state[t];const n=this.els[t];const r=i[t];mh(n);if(s){Za(n,s)}if(e){e.removeAttribute(r);if(s){e.setAttribute(r,n.id)}}}));if(this.state.title||this.state.description){this.show()}else{this.hide()}}update(t){this.setState(t)}dispose(){const t=this.player_.tech_;const e=t&&t.el_;if(e){e.removeAttribute("aria-labelledby");e.removeAttribute("aria-describedby")}super.dispose();this.els=null}}yc.registerComponent("TitleBar",Cf);const Nf={initialDisplay:4e3,position:[],takeFocus:false};class _f extends Zl{constructor(t,e){e=ba(Nf,e);super(t,e);this.controlText(e.controlText);this.hide();this.on(this.player_,["useractive","userinactive"],(t=>{this.removeClass("force-display")}))}buildCSSClass(){return`vjs-transient-button focus-visible ${this.options_.position.map((t=>`vjs-${t}`)).join(" ")}`}createEl(){const t=Qa("button",{},{type:"button",class:this.buildCSSClass()},Qa("span"));this.controlTextEl_=t.querySelector("span");return t}show(){super.show();this.addClass("force-display");if(this.options_.takeFocus){this.el().focus({preventScroll:true})}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()}}yc.registerComponent("TransientButton",_f);const Of=t=>{const e=t.el();if(e.hasAttribute("src")){t.triggerSourceset(e.src);return true}const i=t.$$("source");const s=[];let n="";if(!i.length){return false}for(let t=0;t<i.length;t++){const e=i[t].src;if(e&&s.indexOf(e)===-1){s.push(e)}}if(!s.length){return false}if(s.length===1){n=s[0]}t.triggerSourceset(n);return true};const Mf=Object.defineProperty({},"innerHTML",{get(){return this.cloneNode(true).innerHTML},set(t){const e=K.createElement(this.nodeName.toLowerCase());e.innerHTML=t;const i=K.createDocumentFragment();while(e.childNodes.length){i.appendChild(e.childNodes[0])}this.innerText="";z.Element.prototype.appendChild.call(this,i);return this.innerHTML}});const Rf=(t,e)=>{let i={};for(let s=0;s<t.length;s++){i=Object.getOwnPropertyDescriptor(t[s],e);if(i&&i.set&&i.get){break}}i.enumerable=true;i.configurable=true;return i};const Lf=t=>Rf([t.el(),z.HTMLMediaElement.prototype,z.Element.prototype,Mf],"innerHTML");const Pf=function(t){const e=t.el();if(e.resetSourceWatch_){return}const i={};const s=Lf(t);const n=i=>(...s)=>{const n=i.apply(e,s);Of(t);return n};["append","appendChild","insertAdjacentHTML"].forEach((t=>{if(!e[t]){return}i[t]=e[t];e[t]=n(i[t])}));Object.defineProperty(e,"innerHTML",ba(s,{set:n(s.set)}));e.resetSourceWatch_=()=>{e.resetSourceWatch_=null;Object.keys(i).forEach((t=>{e[t]=i[t]}));Object.defineProperty(e,"innerHTML",s)};t.one("sourceset",e.resetSourceWatch_)};const $f=Object.defineProperty({},"src",{get(){if(this.hasAttribute("src")){return tl(z.Element.prototype.getAttribute.call(this,"src"))}return""},set(t){z.Element.prototype.setAttribute.call(this,"src",t);return t}});const Ff=t=>Rf([t.el(),z.HTMLMediaElement.prototype,$f],"src");const Uf=function(t){if(!t.featuresSourceset){return}const e=t.el();if(e.resetSourceset_){return}const i=Ff(t);const s=e.setAttribute;const n=e.load;Object.defineProperty(e,"src",ba(i,{set:s=>{const n=i.set.call(e,s);t.triggerSourceset(e.src);return n}}));e.setAttribute=(i,n)=>{const r=s.call(e,i,n);if(/src/i.test(i)){t.triggerSourceset(e.src)}return r};e.load=()=>{const i=n.call(e);if(!Of(t)){t.triggerSourceset("");Pf(t)}return i};if(e.currentSrc){t.triggerSourceset(e.currentSrc)}else if(!Of(t)){Pf(t)}e.resetSourceset_=()=>{e.resetSourceset_=null;e.load=n;e.setAttribute=s;Object.defineProperty(e,"src",i);if(e.resetSourceWatch_){e.resetSourceWatch_()}}};class Bf extends pl{constructor(t,e){super(t,e);const i=t.source;let s=false;this.featuresVideoFrameCallback=this.featuresVideoFrameCallback&&this.el_.tagName==="VIDEO";if(i&&(this.el_.currentSrc!==i.src||t.tag&&t.tag.initNetworkState_===3)){this.setSource(i)}else{this.handleLateInit_(this.el_)}if(t.enableSourceset){this.setupSourcesetHandling_()}this.isScrubbing_=false;if(this.el_.hasChildNodes()){const t=this.el_.childNodes;let e=t.length;const i=[];while(e--){const n=t[e];const r=n.nodeName.toLowerCase();if(r==="track"){if(!this.featuresNativeTextTracks){i.push(n)}else{this.remoteTextTrackEls().addTrackElement_(n);this.remoteTextTracks().addTrack(n.track);this.textTracks().addTrack(n.track);if(!s&&!this.el_.hasAttribute("crossorigin")&&il(n.src)){s=true}}}}for(let t=0;t<i.length;t++){this.el_.removeChild(i[t])}}this.proxyNativeTracks_();if(this.featuresNativeTextTracks&&s){la.warn("Text Tracks are being loaded from another origin but the crossorigin attribute isn't used.\n"+"This may prevent text tracks from loading.")}this.restoreMetadataTracksInIOSNativePlayer_();if((Ba||Pa)&&t.nativeControlsForTouch===true){this.setControls(true)}this.proxyWebkitFullscreen_();this.triggerReady()}dispose(){if(this.el_&&this.el_.resetSourceset_){this.el_.resetSourceset_()}Bf.disposeMediaElement(this.el_);this.options_=null;super.dispose()}setupSourcesetHandling_(){Uf(this)}restoreMetadataTracksInIOSNativePlayer_(){const t=this.textTracks();let e;const i=()=>{e=[];for(let i=0;i<t.length;i++){const s=t[i];if(s.kind==="metadata"){e.push({track:s,storedMode:s.mode})}}};i();t.addEventListener("change",i);this.on("dispose",(()=>t.removeEventListener("change",i)));const s=()=>{for(let t=0;t<e.length;t++){const i=e[t];if(i.track.mode==="disabled"&&i.track.mode!==i.storedMode){i.track.mode=i.storedMode}}t.removeEventListener("change",s)};this.on("webkitbeginfullscreen",(()=>{t.removeEventListener("change",i);t.removeEventListener("change",s);t.addEventListener("change",s)}));this.on("webkitendfullscreen",(()=>{t.removeEventListener("change",i);t.addEventListener("change",i);t.removeEventListener("change",s)}))}overrideNative_(t,e){if(e!==this[`featuresNative${t}Tracks`]){return}const i=t.toLowerCase();if(this[`${i}TracksListeners_`]){Object.keys(this[`${i}TracksListeners_`]).forEach((t=>{const e=this.el()[`${i}Tracks`];e.removeEventListener(t,this[`${i}TracksListeners_`][t])}))}this[`featuresNative${t}Tracks`]=!e;this[`${i}TracksListeners_`]=null;this.proxyNativeTracksForType_(i)}overrideNativeAudioTracks(t){this.overrideNative_("Audio",t)}overrideNativeVideoTracks(t){this.overrideNative_("Video",t)}proxyNativeTracksForType_(t){const e=ll[t];const i=this.el()[e.getterName];const s=this[e.getterName]();if(!this[`featuresNative${e.capitalName}Tracks`]||!i||!i.addEventListener){return}const n={change:e=>{const i={type:"change",target:s,currentTarget:s,srcElement:s};s.trigger(i);if(t==="text"){this[ul.remoteText.getterName]().trigger(i)}},addtrack(t){s.addTrack(t.track)},removetrack(t){s.removeTrack(t.track)}};const r=function(){const t=[];for(let e=0;e<s.length;e++){let n=false;for(let t=0;t<i.length;t++){if(i[t]===s[e]){n=true;break}}if(!n){t.push(s[e])}}while(t.length){s.removeTrack(t.shift())}};this[e.getterName+"Listeners_"]=n;Object.keys(n).forEach((t=>{const e=n[t];i.addEventListener(t,e);this.on("dispose",(s=>i.removeEventListener(t,e)))}));this.on("loadstart",r);this.on("dispose",(t=>this.off("loadstart",r)))}proxyNativeTracks_(){ll.names.forEach((t=>{this.proxyNativeTracksForType_(t)}))}createEl(){let t=this.options_.tag;if(!t||!(this.options_.playerElIngest||this.movingMediaElementInDOM)){if(t){const e=t.cloneNode(true);if(t.parentNode){t.parentNode.insertBefore(e,t)}Bf.disposeMediaElement(t);t=e}else{t=K.createElement("video");const e=this.options_.tag&&oh(this.options_.tag);const i=ba({},e);if(!Ba||this.options_.nativeControlsForTouch!==true){delete i.controls}rh(t,Object.assign(i,{id:this.options_.techId,class:"vjs-tech"}))}t.playerId=this.options_.playerId}if(typeof this.options_.preload!=="undefined"){hh(t,"preload",this.options_.preload)}if(this.options_.disablePictureInPicture!==undefined){t.disablePictureInPicture=this.options_.disablePictureInPicture}const e=["loop","muted","playsinline","autoplay"];for(let i=0;i<e.length;i++){const s=e[i];const n=this.options_[s];if(typeof n!=="undefined"){if(n){hh(t,s,s)}else{ch(t,s)}t[s]=n}}return t}handleLateInit_(t){if(t.networkState===0||t.networkState===3){return}if(t.readyState===0){let t=false;const e=function(){t=true};this.on("loadstart",e);const i=function(){if(!t){this.trigger("loadstart")}};this.on("loadedmetadata",i);this.ready((function(){this.off("loadstart",e);this.off("loadedmetadata",i);if(!t){this.trigger("loadstart")}}));return}const e=["loadstart"];e.push("loadedmetadata");if(t.readyState>=2){e.push("loadeddata")}if(t.readyState>=3){e.push("canplay")}if(t.readyState>=4){e.push("canplaythrough")}this.ready((function(){e.forEach((function(t){this.trigger(t)}),this)}))}setScrubbing(t){this.isScrubbing_=t}scrubbing(){return this.isScrubbing_}setCurrentTime(t){try{if(this.isScrubbing_&&this.el_.fastSeek&&za){this.el_.fastSeek(t)}else{this.el_.currentTime=t}}catch(t){la(t,"Video is not ready. (Video.js)")}}duration(){if(this.el_.duration===Infinity&&Sa&&Da&&this.el_.currentTime===0){const t=()=>{if(this.el_.currentTime>0){if(this.el_.duration===Infinity){this.trigger("durationchange")}this.off("timeupdate",t)}};this.on("timeupdate",t);return NaN}return this.el_.duration||NaN}width(){return this.el_.offsetWidth}height(){return this.el_.offsetHeight}proxyWebkitFullscreen_(){if(!("webkitDisplayingFullscreen"in this.el_)){return}const t=function(){this.trigger("fullscreenchange",{isFullscreen:false});if(this.el_.controls&&!this.options_.nativeControlsForTouch&&this.controls()){this.el_.controls=false}};const e=function(){if("webkitPresentationMode"in this.el_&&this.el_.webkitPresentationMode!=="picture-in-picture"){this.one("webkitendfullscreen",t);this.trigger("fullscreenchange",{isFullscreen:true,nativeIOSFullscreen:true})}};this.on("webkitbeginfullscreen",e);this.on("dispose",(()=>{this.off("webkitbeginfullscreen",e);this.off("webkitendfullscreen",t)}))}supportsFullScreen(){return typeof this.el_.webkitEnterFullScreen==="function"}enterFullScreen(){const t=this.el_;if(t.paused&&t.networkState<=t.HAVE_METADATA){Oc(this.el_.play());this.setTimeout((function(){t.pause();try{t.webkitEnterFullScreen()}catch(t){this.trigger("fullscreenerror",t)}}),0)}else{try{t.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(t){if(this.featuresVideoFrameCallback&&!this.el_.webkitKeys){return this.el_.requestVideoFrameCallback(t)}return super.requestVideoFrameCallback(t)}cancelVideoFrameCallback(t){if(this.featuresVideoFrameCallback&&!this.el_.webkitKeys){this.el_.cancelVideoFrameCallback(t)}else{super.cancelVideoFrameCallback(t)}}src(t){if(t===undefined){return this.el_.src}this.setSrc(t)}reset(){Bf.resetMediaElement(this.el_)}currentSrc(){if(this.currentSource_){return this.currentSource_.src}return this.el_.currentSrc}setControls(t){this.el_.controls=!!t}addTextTrack(t,e,i){if(!this.featuresNativeTextTracks){return super.addTextTrack(t,e,i)}return this.el_.addTextTrack(t,e,i)}createRemoteTextTrack(t){if(!this.featuresNativeTextTracks){return super.createRemoteTextTrack(t)}const e=K.createElement("track");if(t.kind){e.kind=t.kind}if(t.label){e.label=t.label}if(t.language||t.srclang){e.srclang=t.language||t.srclang}if(t.default){e.default=t.default}if(t.id){e.id=t.id}if(t.src){e.src=t.src}return e}addRemoteTextTrack(t,e){const i=super.addRemoteTextTrack(t,e);if(this.featuresNativeTextTracks){this.el().appendChild(i)}return i}removeRemoteTextTrack(t){super.removeRemoteTextTrack(t);if(this.featuresNativeTextTracks){const e=this.$$("track");let i=e.length;while(i--){if(t===e[i]||t===e[i].track){this.el().removeChild(e[i])}}}}getVideoPlaybackQuality(){if(typeof this.el().getVideoPlaybackQuality==="function"){return this.el().getVideoPlaybackQuality()}const t={};if(typeof this.el().webkitDroppedFrameCount!=="undefined"&&typeof this.el().webkitDecodedFrameCount!=="undefined"){t.droppedVideoFrames=this.el().webkitDroppedFrameCount;t.totalVideoFrames=this.el().webkitDecodedFrameCount}if(z.performance){t.creationTime=z.performance.now()}return t}}ja(Bf,"TEST_VID",(function(){if(!Ya()){return}const t=K.createElement("video");const e=K.createElement("track");e.kind="captions";e.srclang="en";e.label="English";t.appendChild(e);return t}));Bf.isSupported=function(){try{Bf.TEST_VID.volume=.5}catch(t){return false}return!!(Bf.TEST_VID&&Bf.TEST_VID.canPlayType)};Bf.canPlayType=function(t){return Bf.TEST_VID.canPlayType(t)};Bf.canPlaySource=function(t,e){return Bf.canPlayType(t.type)};Bf.canControlVolume=function(){try{const t=Bf.TEST_VID.volume;Bf.TEST_VID.volume=t/2+.1;const e=t!==Bf.TEST_VID.volume;if(e&&Va){z.setTimeout((()=>{if(Bf&&Bf.prototype){Bf.prototype.featuresVolumeControl=t!==Bf.TEST_VID.volume}}));return false}return e}catch(t){return false}};Bf.canMuteVolume=function(){try{const t=Bf.TEST_VID.muted;Bf.TEST_VID.muted=!t;if(Bf.TEST_VID.muted){hh(Bf.TEST_VID,"muted","muted")}else{ch(Bf.TEST_VID,"muted")}return t!==Bf.TEST_VID.muted}catch(t){return false}};Bf.canControlPlaybackRate=function(){if(Sa&&Da&&Na<58){return false}try{const t=Bf.TEST_VID.playbackRate;Bf.TEST_VID.playbackRate=t/2+.1;return t!==Bf.TEST_VID.playbackRate}catch(t){return false}};Bf.canOverrideAttributes=function(){try{const t=()=>{};Object.defineProperty(K.createElement("video"),"src",{get:t,set:t});Object.defineProperty(K.createElement("audio"),"src",{get:t,set:t});Object.defineProperty(K.createElement("video"),"innerHTML",{get:t,set:t});Object.defineProperty(K.createElement("audio"),"innerHTML",{get:t,set:t})}catch(t){return false}return true};Bf.supportsNativeTextTracks=function(){return za||Va&&Da};Bf.supportsNativeVideoTracks=function(){return!!(Bf.TEST_VID&&Bf.TEST_VID.videoTracks)};Bf.supportsNativeAudioTracks=function(){return!!(Bf.TEST_VID&&Bf.TEST_VID.audioTracks)};Bf.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([t,e]){ja(Bf.prototype,t,(()=>Bf[e]()),true)}));Bf.prototype.featuresVolumeControl=Bf.canControlVolume();Bf.prototype.movingMediaElementInDOM=!Va;Bf.prototype.featuresFullscreenResize=true;Bf.prototype.featuresProgressEvents=true;Bf.prototype.featuresTimeupdateEvents=true;Bf.prototype.featuresVideoFrameCallback=!!(Bf.TEST_VID&&Bf.TEST_VID.requestVideoFrameCallback);Bf.disposeMediaElement=function(t){if(!t){return}if(t.parentNode){t.parentNode.removeChild(t)}while(t.hasChildNodes()){t.removeChild(t.firstChild)}t.removeAttribute("src");if(typeof t.load==="function"){(function(){try{t.load()}catch(t){}})()}};Bf.resetMediaElement=function(t){if(!t){return}const e=t.querySelectorAll("source");let i=e.length;while(i--){t.removeChild(e[i])}t.removeAttribute("src");if(typeof t.load==="function"){(function(){try{t.load()}catch(t){}})()}};["muted","defaultMuted","autoplay","controls","loop","playsinline"].forEach((function(t){Bf.prototype[t]=function(){return this.el_[t]||this.el_.hasAttribute(t)}}));["muted","defaultMuted","autoplay","loop","playsinline"].forEach((function(t){Bf.prototype["set"+mc(t)]=function(e){this.el_[t]=e;if(e){this.el_.setAttribute(t,t)}else{this.el_.removeAttribute(t)}}}));["paused","currentTime","buffered","volume","poster","preload","error","seeking","seekable","ended","playbackRate","defaultPlaybackRate","disablePictureInPicture","played","networkState","readyState","videoWidth","videoHeight","crossOrigin"].forEach((function(t){Bf.prototype[t]=function(){return this.el_[t]}}));["volume","src","poster","preload","playbackRate","defaultPlaybackRate","disablePictureInPicture","crossOrigin"].forEach((function(t){Bf.prototype["set"+mc(t)]=function(e){this.el_[t]=e}}));["pause","load","play"].forEach((function(t){Bf.prototype[t]=function(){return this.el_[t]()}}));pl.withSourceHandlers(Bf);Bf.nativeSourceHandler={};Bf.nativeSourceHandler.canPlayType=function(t){try{return Bf.TEST_VID.canPlayType(t)}catch(t){return""}};Bf.nativeSourceHandler.canHandleSource=function(t,e){if(t.type){return Bf.nativeSourceHandler.canPlayType(t.type)}else if(t.src){const e=el(t.src);return Bf.nativeSourceHandler.canPlayType(`video/${e}`)}return""};Bf.nativeSourceHandler.handleSource=function(t,e,i){e.setSrc(t.src)};Bf.nativeSourceHandler.dispose=function(){};Bf.registerSourceHandler(Bf.nativeSourceHandler);pl.registerTech("Html5",Bf);const qf=["progress","abort","suspend","emptied","stalled","loadedmetadata","loadeddata","timeupdate","resize","volumechange","texttrackchange"];const Vf={canplay:"CanPlay",canplaythrough:"CanPlayThrough",playing:"Playing",seeked:"Seeked"};const zf=["tiny","xsmall","small","medium","large","xlarge","huge"];const Hf={};zf.forEach((t=>{const e=t.charAt(0)==="x"?`x-${t.substring(1)}`:t;Hf[t]=`vjs-layout-${e}`}));const Xf={tiny:210,xsmall:320,small:425,medium:768,large:1440,xlarge:2560,huge:Infinity};class Gf extends yc{constructor(t,e,i){t.id=t.id||e.id||`vjs_video_${Lh()}`;e=Object.assign(Gf.getTagSettings(t),e);e.initChildren=false;e.createEl=false;e.evented=false;e.reportTouchActivity=false;if(!e.language){const i=t.closest("[lang]");if(i){e.language=i.getAttribute("lang")}}super(null,e,i);this.boundDocumentFullscreenChange_=t=>this.documentFullscreenChange_(t);this.boundFullWindowOnEscKey_=t=>this.fullWindowOnEscKey(t);this.boundUpdateStyleEl_=t=>this.updateStyleEl_(t);this.boundApplyInitTime_=t=>this.applyInitTime_(t);this.boundUpdateCurrentBreakpoint_=t=>this.updateCurrentBreakpoint_(t);this.boundHandleTechClick_=t=>this.handleTechClick_(t);this.boundHandleTechDoubleClick_=t=>this.handleTechDoubleClick_(t);this.boundHandleTechTouchStart_=t=>this.handleTechTouchStart_(t);this.boundHandleTechTouchMove_=t=>this.handleTechTouchMove_(t);this.boundHandleTechTouchEnd_=t=>this.handleTechTouchEnd_(t);this.boundHandleTechTap_=t=>this.handleTechTap_(t);this.boundUpdatePlayerHeightOnAudioOnlyMode_=t=>this.updatePlayerHeightOnAudioOnlyMode_(t);this.isFullscreen_=false;this.log=ua(this.id_);this.fsApi_=sa;this.isPosterFromTech_=false;this.queuedCallbacks_=[];this.isReady_=false;this.hasStarted_=false;this.userActive_=false;this.debugEnabled_=false;this.audioOnlyMode_=false;this.audioPosterMode_=false;this.audioOnlyCache_={controlBarHeight:null,playerHeight:null,hiddenChildren:[]};if(!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?")}this.tag=t;this.tagAttributes=t&&oh(t);this.language(this.options_.language);if(e.languages){const t={};Object.getOwnPropertyNames(e.languages).forEach((function(i){t[i.toLowerCase()]=e.languages[i]}));this.languages_=t}else{this.languages_=Gf.prototype.options_.languages}this.resetCache_();this.poster_=e.poster||"";this.controls_=!!e.controls;t.controls=false;t.removeAttribute("controls");this.changingSrc_=false;this.playCallbacks_=[];this.playTerminatedQueue_=[];if(t.hasAttribute("autoplay")){this.autoplay(true)}else{this.autoplay(this.options_.autoplay)}if(e.plugins){Object.keys(e.plugins).forEach((t=>{if(typeof this[t]!=="function"){throw new Error(`plugin "${t}" does not exist`)}}))}this.scrubbing_=false;this.el_=this.createEl();fc(this,{eventBusKey:"el_"});if(this.fsApi_.requestFullscreen){Vh(K,this.fsApi_.fullscreenchange,this.boundDocumentFullscreenChange_);this.on(this.fsApi_.fullscreenchange,this.boundDocumentFullscreenChange_)}if(this.fluid_){this.on(["playerreset","resize"],this.boundUpdateStyleEl_)}const s=ba(this.options_);if(e.plugins){Object.keys(e.plugins).forEach((t=>{this[t](e.plugins[t])}))}if(e.debug){this.debug(true)}this.options_.playerOptions=s;this.middleware_=[];this.playbackRates(e.playbackRates);if(e.experimentalSvgIcons){const t=new z.DOMParser;const e=t.parseFromString(Pl,"image/svg+xml");const i=e.querySelector("parsererror");if(i){la.warn("Failed to load SVG Icons. Falling back to Font Icons.");this.options_.experimentalSvgIcons=null}else{const t=e.documentElement;t.style.display="none";this.el_.appendChild(t);this.addClass("vjs-svg-icons-enabled")}}this.initChildren();this.isAudio(t.nodeName.toLowerCase()==="audio");if(this.controls()){this.addClass("vjs-controls-enabled")}else{this.addClass("vjs-controls-disabled")}this.el_.setAttribute("role","region");if(this.isAudio()){this.el_.setAttribute("aria-label",this.localize("Audio Player"))}else{this.el_.setAttribute("aria-label",this.localize("Video Player"))}if(this.isAudio()){this.addClass("vjs-audio")}if(e.spatialNavigation&&e.spatialNavigation.enabled){this.spatialNavigation=new Bl(this);this.addClass("vjs-spatial-navigation-enabled")}if(Ba){this.addClass("vjs-touch-enabled")}if(!Va){this.addClass("vjs-workinghover")}Gf.players[this.id_]=this;const n=Ko.split(".")[0];this.addClass(`vjs-v${n}`);this.userActive(true);this.reportUserActivity();this.one("play",(t=>this.listenForUserActivity_(t)));this.on("keydown",(t=>this.handleKeyDown(t)));this.on("languagechange",(t=>this.handleLanguagechange(t)));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");zh(K,this.fsApi_.fullscreenchange,this.boundDocumentFullscreenChange_);zh(K,"keydown",this.boundFullWindowOnEscKey_);if(this.styleEl_&&this.styleEl_.parentNode){this.styleEl_.parentNode.removeChild(this.styleEl_);this.styleEl_=null}Gf.players[this.id_]=null;if(this.tag&&this.tag.player){this.tag.player=null}if(this.el_&&this.el_.player){this.el_.player=null}if(this.tech_){this.tech_.dispose();this.isPosterFromTech_=false;this.poster_=""}if(this.playerElIngest_){this.playerElIngest_=null}if(this.tag){this.tag=null}Dl(this);fl.names.forEach((t=>{const e=fl[t];const i=this[e.getterName]();if(i&&i.off){i.off()}}));super.dispose({restoreEl:this.options_.restoreEl})}createEl(){let t=this.tag;let e;let i=this.playerElIngest_=t.parentNode&&t.parentNode.hasAttribute&&t.parentNode.hasAttribute("data-vjs-player");const s=this.tag.tagName.toLowerCase()==="video-js";if(i){e=this.el_=t.parentNode}else if(!s){e=this.el_=super.createEl("div")}const n=oh(t);if(s){e=this.el_=t;t=this.tag=K.createElement("video");while(e.children.length){t.appendChild(e.firstChild)}if(!eh(e,"video-js")){ih(e,"video-js")}e.appendChild(t);i=this.playerElIngest_=e;Object.keys(e).forEach((i=>{try{t[i]=e[i]}catch(t){}}))}t.setAttribute("tabindex","-1");n.tabindex="-1";if(Da&&Ra){t.setAttribute("role","application");n.role="application"}t.removeAttribute("width");t.removeAttribute("height");if("width"in n){delete n.width}if("height"in n){delete n.height}Object.getOwnPropertyNames(n).forEach((function(i){if(!(s&&i==="class")){e.setAttribute(i,n[i])}if(s){t.setAttribute(i,n[i])}}));t.playerId=t.id;t.id+="_html5_api";t.className="vjs-tech";t.player=e.player=this;this.addClass("vjs-paused");const r=["IS_SMART_TV","IS_TIZEN","IS_WEBOS","IS_ANDROID","IS_IPAD","IS_IPHONE","IS_CHROMECAST_RECEIVER"].filter((t=>Ha[t])).map((t=>"vjs-device-"+t.substring(3).toLowerCase().replace(/\_/g,"-")));this.addClass(...r);if(z.VIDEOJS_NO_DYNAMIC_STYLE!==true){this.styleEl_=Nh("vjs-styles-dimensions");const t=wh(".vjs-styles-defaults");const e=wh("head");e.insertBefore(this.styleEl_,t?t.nextSibling:e.firstChild)}this.fill_=false;this.fluid_=false;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=t.getElementsByTagName("a");for(let t=0;t<o.length;t++){const e=o.item(t);ih(e,"vjs-hidden");e.setAttribute("hidden","hidden")}t.initNetworkState_=t.networkState;if(t.parentNode&&!i){t.parentNode.insertBefore(e,t)}th(t,e);this.children_.unshift(t);this.el_.setAttribute("lang",this.language_);this.el_.setAttribute("translate","no");this.el_=e;return e}crossOrigin(t){if(typeof t==="undefined"){return this.techGet_("crossOrigin")}if(t!==null&&t!=="anonymous"&&t!=="use-credentials"){la.warn(`crossOrigin must be null, "anonymous" or "use-credentials", given "${t}"`);return}this.techCall_("setCrossOrigin",t);if(this.posterImage){this.posterImage.crossOrigin(t)}return}width(t){return this.dimension("width",t)}height(t){return this.dimension("height",t)}dimension(t,e){const i=t+"_";if(e===undefined){return this[i]||0}if(e===""||e==="auto"){this[i]=undefined;this.updateStyleEl_();return}const s=parseFloat(e);if(isNaN(s)){la.error(`Improper value "${e}" supplied for for ${t}`);return}this[i]=s;this.updateStyleEl_()}fluid(t){if(t===undefined){return!!this.fluid_}this.fluid_=!!t;if(sc(this)){this.off(["playerreset","resize"],this.boundUpdateStyleEl_)}if(t){this.addClass("vjs-fluid");this.fill(false);nc(this,(()=>{this.on(["playerreset","resize"],this.boundUpdateStyleEl_)}))}else{this.removeClass("vjs-fluid")}this.updateStyleEl_()}fill(t){if(t===undefined){return!!this.fill_}this.fill_=!!t;if(t){this.addClass("vjs-fill");this.fluid(false)}else{this.removeClass("vjs-fill")}}aspectRatio(t){if(t===undefined){return this.aspectRatio_}if(!/^\d+\:\d+$/.test(t)){throw new Error("Improper value supplied for aspect ratio. The format should be width:height, for example 16:9.")}this.aspectRatio_=t;this.fluid(true);this.updateStyleEl_()}updateStyleEl_(){if(z.VIDEOJS_NO_DYNAMIC_STYLE===true){const t=typeof this.width_==="number"?this.width_:this.options_.width;const e=typeof this.height_==="number"?this.height_:this.options_.height;const i=this.tech_&&this.tech_.el();if(i){if(t>=0){i.width=t}if(e>=0){i.height=e}}return}let t;let e;let i;let s;if(this.aspectRatio_!==undefined&&this.aspectRatio_!=="auto"){i=this.aspectRatio_}else if(this.videoWidth()>0){i=this.videoWidth()+":"+this.videoHeight()}else{i="16:9"}const n=i.split(":");const r=n[1]/n[0];if(this.width_!==undefined){t=this.width_}else if(this.height_!==undefined){t=this.height_/r}else{t=this.videoWidth()||300}if(this.height_!==undefined){e=this.height_}else{e=t*r}if(/^[^a-zA-Z]/.test(this.id())){s="dimensions-"+this.id()}else{s=this.id()+"-dimensions"}this.addClass(s);_h(this.styleEl_,`\n .${s} {\n width: ${t}px;\n height: ${e}px;\n }\n\n .${s}.vjs-fluid:not(.vjs-audio-only-mode) {\n padding-top: ${r*100}%;\n }\n `)}loadTech_(t,e){if(this.tech_){this.unloadTech_()}const i=mc(t);const s=t.charAt(0).toLowerCase()+t.slice(1);if(i!=="Html5"&&this.tag){pl.getTech("Html5").disposeMediaElement(this.tag);this.tag.player=null;this.tag=null}this.techName_=i;this.isReady_=false;let n=this.autoplay();if(typeof this.autoplay()==="string"||this.autoplay()===true&&this.options_.normalizeAutoplay){n=false}const r={source:e,autoplay:n,nativeControlsForTouch:this.options_.nativeControlsForTouch,playerId:this.id(),techId:`${this.id()}_${s}_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_||false,"vtt.js":this.options_["vtt.js"],canOverridePoster:!!this.options_.techCanOverridePoster,enableSourceset:this.options_.enableSourceset};fl.names.forEach((t=>{const e=fl[t];r[e.getterName]=this[e.privateName]}));Object.assign(r,this.options_[i]);Object.assign(r,this.options_[s]);Object.assign(r,this.options_[t.toLowerCase()]);if(this.tag){r.tag=this.tag}if(e&&e.src===this.cache_.src&&this.cache_.currentTime>0){r.startTime=this.cache_.currentTime}const o=pl.getTech(t);if(!o){throw new Error(`No Tech named '${i}' exists! '${i}' should be registered using videojs.registerTech()'`)}this.tech_=new o(r);this.tech_.ready(Jh(this,this.handleTechReady_),true);Pc.jsonToTextTracks(this.textTracksJson_||[],this.tech_);qf.forEach((t=>{this.on(this.tech_,t,(e=>this[`handleTech${mc(t)}_`](e)))}));Object.keys(Vf).forEach((t=>{this.on(this.tech_,t,(e=>{if(this.tech_.playbackRate()===0&&this.tech_.seeking()){this.queuedCallbacks_.push({callback:this[`handleTech${Vf[t]}_`].bind(this),event:e});return}this[`handleTech${Vf[t]}_`](e)}))}));this.on(this.tech_,"loadstart",(t=>this.handleTechLoadStart_(t)));this.on(this.tech_,"sourceset",(t=>this.handleTechSourceset_(t)));this.on(this.tech_,"waiting",(t=>this.handleTechWaiting_(t)));this.on(this.tech_,"ended",(t=>this.handleTechEnded_(t)));this.on(this.tech_,"seeking",(t=>this.handleTechSeeking_(t)));this.on(this.tech_,"play",(t=>this.handleTechPlay_(t)));this.on(this.tech_,"pause",(t=>this.handleTechPause_(t)));this.on(this.tech_,"durationchange",(t=>this.handleTechDurationChange_(t)));this.on(this.tech_,"fullscreenchange",((t,e)=>this.handleTechFullscreenChange_(t,e)));this.on(this.tech_,"fullscreenerror",((t,e)=>this.handleTechFullscreenError_(t,e)));this.on(this.tech_,"enterpictureinpicture",(t=>this.handleTechEnterPictureInPicture_(t)));this.on(this.tech_,"leavepictureinpicture",(t=>this.handleTechLeavePictureInPicture_(t)));this.on(this.tech_,"error",(t=>this.handleTechError_(t)));this.on(this.tech_,"posterchange",(t=>this.handleTechPosterChange_(t)));this.on(this.tech_,"textdata",(t=>this.handleTechTextData_(t)));this.on(this.tech_,"ratechange",(t=>this.handleTechRateChange_(t)));this.on(this.tech_,"loadedmetadata",this.boundUpdateStyleEl_);this.usingNativeControls(this.techGet_("controls"));if(this.controls()&&!this.usingNativeControls()){this.addTechControlsListeners_()}if(this.tech_.el().parentNode!==this.el()&&(i!=="Html5"||!this.tag)){th(this.tech_.el(),this.el())}if(this.tag){this.tag.player=null;this.tag=null}}unloadTech_(){fl.names.forEach((t=>{const e=fl[t];this[e.privateName]=this[e.getterName]()}));this.textTracksJson_=Pc.textTracksToJson(this.tech_);this.isReady_=false;this.tech_.dispose();this.tech_=false;if(this.isPosterFromTech_){this.poster_="";this.trigger("posterchange")}this.isPosterFromTech_=false}tech(t){if(t===undefined){la.warn("Using the tech directly can be dangerous. I hope you know what you're doing.\n"+"See https://github.com/videojs/video.js/issues/2617 for more info.\n")}return this.tech_}version(){return{"video.js":Ko}}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();if(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_();if(!this.paused()){this.trigger("loadstart")}else{this.hasStarted(false);this.trigger("loadstart")}this.manualAutoplay_(this.autoplay()===true&&this.options_.normalizeAutoplay?"play":this.autoplay())}manualAutoplay_(t){if(!this.tech_||typeof t!=="string"){return}const e=()=>{const t=this.muted();this.muted(true);const e=()=>{this.muted(t)};this.playTerminatedQueue_.push(e);const i=this.play();if(!_c(i)){return}return i.catch((t=>{e();throw new Error(`Rejection at manualAutoplay. Restoring muted value. ${t?t:""}`)}))};let i;if(t==="any"&&!this.muted()){i=this.play();if(_c(i)){i=i.catch(e)}}else if(t==="muted"&&!this.muted()){i=e()}else{i=this.play()}if(!_c(i)){return}return i.then((()=>{this.trigger({type:"autoplay-success",autoplay:t})})).catch((()=>{this.trigger({type:"autoplay-failure",autoplay:t})}))}updateSourceCaches_(t=""){let e=t;let i="";if(typeof e!=="string"){e=t.src;i=t.type}this.cache_.source=this.cache_.source||{};this.cache_.sources=this.cache_.sources||[];if(e&&!i){i=Ml(this,e)}this.cache_.source=ba({},t,{src:e,type:i});const s=this.cache_.sources.filter((t=>t.src&&t.src===e));const n=[];const r=this.$$("source");const o=[];for(let t=0;t<r.length;t++){const i=oh(r[t]);n.push(i);if(i.src&&i.src===e){o.push(i.src)}}if(o.length&&!s.length){this.cache_.sources=n}else if(!s.length){this.cache_.sources=[this.cache_.source]}this.cache_.src=e}handleTechSourceset_(t){if(!this.changingSrc_){let e=t=>this.updateSourceCaches_(t);const i=this.currentSource().src;const s=t.src;if(i&&!/^blob:/.test(i)&&/^blob:/.test(s)){if(!this.lastSource_||this.lastSource_.tech!==s&&this.lastSource_.player!==i){e=()=>{}}}e(s);if(!t.src){this.tech_.any(["sourceset","loadstart"],(t=>{if(t.type==="sourceset"){return}const e=this.techGet_("currentSrc");this.lastSource_.tech=e;this.updateSourceCaches_(e)}))}}this.lastSource_={player:this.currentSource().src,tech:t.src};this.trigger({src:t.src,type:"sourceset"})}hasStarted(t){if(t===undefined){return this.hasStarted_}if(t===this.hasStarted_){return}this.hasStarted_=t;if(this.hasStarted_){this.addClass("vjs-has-started")}else{this.removeClass("vjs-has-started")}}handleTechPlay_(){this.removeClass("vjs-ended","vjs-paused");this.addClass("vjs-playing");this.hasStarted(true);this.trigger("play")}handleTechRateChange_(){if(this.tech_.playbackRate()>0&&this.cache_.lastPlaybackRate===0){this.queuedCallbacks_.forEach((t=>t.callback(t.event)));this.queuedCallbacks_=[]}this.cache_.lastPlaybackRate=this.tech_.playbackRate();this.trigger("ratechange")}handleTechWaiting_(){this.addClass("vjs-waiting");this.trigger("waiting");const t=this.currentTime();const e=()=>{if(t!==this.currentTime()){this.removeClass("vjs-waiting");this.off("timeupdate",e)}};this.on("timeupdate",e)}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");if(this.options_.loop){this.currentTime(0);this.play()}else if(!this.paused()){this.pause()}this.trigger("ended")}handleTechDurationChange_(){this.duration(this.techGet_("duration"))}handleTechClick_(t){if(!this.controls_){return}if(this.options_===undefined||this.options_.userActions===undefined||this.options_.userActions.click===undefined||this.options_.userActions.click!==false){if(this.options_!==undefined&&this.options_.userActions!==undefined&&typeof this.options_.userActions.click==="function"){this.options_.userActions.click.call(this,t)}else if(this.paused()){Oc(this.play())}else{this.pause()}}}handleTechDoubleClick_(t){if(!this.controls_){return}const e=Array.prototype.some.call(this.$$(".vjs-control-bar, .vjs-modal-dialog"),(e=>e.contains(t.target)));if(!e){if(this.options_===undefined||this.options_.userActions===undefined||this.options_.userActions.doubleClick===undefined||this.options_.userActions.doubleClick!==false){if(this.options_!==undefined&&this.options_.userActions!==undefined&&typeof this.options_.userActions.doubleClick==="function"){this.options_.userActions.doubleClick.call(this,t)}else if(this.isFullscreen()){this.exitFullscreen()}else{this.requestFullscreen()}}}}handleTechTap_(){this.userActive(!this.userActive())}handleTechTouchStart_(){this.userWasActive=this.userActive()}handleTechTouchMove_(){if(this.userWasActive){this.reportUserActivity()}}handleTechTouchEnd_(t){if(t.cancelable){t.preventDefault()}}toggleFullscreenClass_(){if(this.isFullscreen()){this.addClass("vjs-fullscreen")}else{this.removeClass("vjs-fullscreen")}}documentFullscreenChange_(t){const e=t.target.player;if(e&&e!==this){return}const i=this.el();let s=K[this.fsApi_.fullscreenElement]===i;if(!s&&i.matches){s=i.matches(":"+this.fsApi_.fullscreen)}this.isFullscreen(s)}handleTechFullscreenChange_(t,e){if(e){if(e.nativeIOSFullscreen){this.addClass("vjs-ios-native-fs");this.tech_.one("webkitendfullscreen",(()=>{this.removeClass("vjs-ios-native-fs")}))}this.isFullscreen(e.isFullscreen)}}handleTechFullscreenError_(t,e){this.trigger("fullscreenerror",e)}togglePictureInPictureClass_(){if(this.isInPictureInPicture()){this.addClass("vjs-picture-in-picture")}else{this.removeClass("vjs-picture-in-picture")}}handleTechEnterPictureInPicture_(t){this.isInPictureInPicture(true)}handleTechLeavePictureInPicture_(t){this.isInPictureInPicture(false)}handleTechError_(){const t=this.tech_.error();if(t){this.error(t)}}handleTechTextData_(){let t=null;if(arguments.length>1){t=arguments[1]}this.trigger("textdata",t)}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_(t,e){this.ready((function(){if(t in xl){return Tl(this.middleware_,this.tech_,t,e)}else if(t in Al){return kl(this.middleware_,this.tech_,t,e)}try{if(this.tech_){this.tech_[t](e)}}catch(t){la(t);throw t}}),true)}techGet_(t){if(!this.tech_||!this.tech_.isReady_){return}if(t in Sl){return wl(this.middleware_,this.tech_,t)}else if(t in Al){return kl(this.middleware_,this.tech_,t)}try{return this.tech_[t]()}catch(e){if(this.tech_[t]===undefined){la(`Video.js: ${t} method not defined for ${this.techName_} playback technology.`,e);throw e}if(e.name==="TypeError"){la(`Video.js: ${t} unavailable on ${this.techName_} playback technology element.`,e);this.tech_.isReady_=false;throw e}la(e);throw e}}play(){return new Promise((t=>{this.play_(t)}))}play_(t=Oc){this.playCallbacks_.push(t);const e=Boolean(!this.changingSrc_&&(this.src()||this.currentSrc()));const i=Boolean(za||Va);if(this.waitToPlay_){this.off(["ready","loadstart"],this.waitToPlay_);this.waitToPlay_=null}if(!this.isReady_||!e){this.waitToPlay_=t=>{this.play_()};this.one(["ready","loadstart"],this.waitToPlay_);if(!e&&i){this.load()}return}const s=this.techGet_("play");const n=i&&this.hasClass("vjs-ended");if(n){this.resetProgressBar_()}if(s===null){this.runPlayTerminatedQueue_()}else{this.runPlayCallbacks_(s)}}runPlayTerminatedQueue_(){const t=this.playTerminatedQueue_.slice(0);this.playTerminatedQueue_=[];t.forEach((function(t){t()}))}runPlayCallbacks_(t){const e=this.playCallbacks_.slice(0);this.playCallbacks_=[];this.playTerminatedQueue_=[];e.forEach((function(e){e(t)}))}pause(){this.techCall_("pause")}paused(){return this.techGet_("paused")===false?false:true}played(){return this.techGet_("played")||kc(0,0)}scrubbing(t){if(typeof t==="undefined"){return this.scrubbing_}this.scrubbing_=!!t;this.techCall_("setScrubbing",this.scrubbing_);if(t){this.addClass("vjs-scrubbing")}else{this.removeClass("vjs-scrubbing")}}currentTime(t){if(t===undefined){this.cache_.currentTime=this.techGet_("currentTime")||0;return this.cache_.currentTime}if(t<0){t=0}if(!this.isReady_||this.changingSrc_||!this.tech_||!this.tech_.isReady_){this.cache_.initTime=t;this.off("canplay",this.boundApplyInitTime_);this.one("canplay",this.boundApplyInitTime_);return}this.techCall_("setCurrentTime",t);this.cache_.initTime=0;if(isFinite(t)){this.cache_.currentTime=Number(t)}}applyInitTime_(){this.currentTime(this.cache_.initTime)}duration(t){if(t===undefined){return this.cache_.duration!==undefined?this.cache_.duration:NaN}t=parseFloat(t);if(t<0){t=Infinity}if(t!==this.cache_.duration){this.cache_.duration=t;if(t===Infinity){this.addClass("vjs-live")}else{this.removeClass("vjs-live")}if(!isNaN(t)){this.trigger("durationchange")}}}remainingTime(){return this.duration()-this.currentTime()}remainingTimeDisplay(){return Math.floor(this.duration())-Math.floor(this.currentTime())}buffered(){let t=this.techGet_("buffered");if(!t||!t.length){t=kc(0,0)}return t}seekable(){let t=this.techGet_("seekable");if(!t||!t.length){t=kc(0,0)}return t}seeking(){return this.techGet_("seeking")}ended(){return this.techGet_("ended")}networkState(){return this.techGet_("networkState")}readyState(){return this.techGet_("readyState")}bufferedPercent(){return Cc(this.buffered(),this.duration())}bufferedEnd(){const t=this.buffered();const e=this.duration();let i=t.end(t.length-1);if(i>e){i=e}return i}volume(t){let e;if(t!==undefined){e=Math.max(0,Math.min(1,t));this.cache_.volume=e;this.techCall_("setVolume",e);if(e>0){this.lastVolume_(e)}return}e=parseFloat(this.techGet_("volume"));return isNaN(e)?1:e}muted(t){if(t!==undefined){this.techCall_("setMuted",t);return}return this.techGet_("muted")||false}defaultMuted(t){if(t!==undefined){this.techCall_("setDefaultMuted",t)}return this.techGet_("defaultMuted")||false}lastVolume_(t){if(t!==undefined&&t!==0){this.cache_.lastVolume=t;return}return this.cache_.lastVolume}supportsFullScreen(){return this.techGet_("supportsFullScreen")||false}isFullscreen(t){if(t!==undefined){const e=this.isFullscreen_;this.isFullscreen_=Boolean(t);if(this.isFullscreen_!==e&&this.fsApi_.prefixed){this.trigger("fullscreenchange")}this.toggleFullscreenClass_();return}return this.isFullscreen_}requestFullscreen(t){if(this.isInPictureInPicture()){this.exitPictureInPicture()}const e=this;return new Promise(((i,s)=>{function n(){e.off("fullscreenerror",o);e.off("fullscreenchange",r)}function r(){n();i()}function o(t,e){n();s(e)}e.one("fullscreenchange",r);e.one("fullscreenerror",o);const a=e.requestFullscreenHelper_(t);if(a){a.then(n,n);a.then(i,s)}}))}requestFullscreenHelper_(t){let e;if(!this.fsApi_.prefixed){e=this.options_.fullscreen&&this.options_.fullscreen.options||{};if(t!==undefined){e=t}}if(this.fsApi_.requestFullscreen){const t=this.el_[this.fsApi_.requestFullscreen](e);if(t){t.then((()=>this.isFullscreen(true)),(()=>this.isFullscreen(false)))}return t}else if(this.tech_.supportsFullScreen()&&!this.options_.preferFullWindow===true){this.techCall_("enterFullScreen")}else{this.enterFullWindow()}}exitFullscreen(){const t=this;return new Promise(((e,i)=>{function s(){t.off("fullscreenerror",r);t.off("fullscreenchange",n)}function n(){s();e()}function r(t,e){s();i(e)}t.one("fullscreenchange",n);t.one("fullscreenerror",r);const o=t.exitFullscreenHelper_();if(o){o.then(s,s);o.then(e,i)}}))}exitFullscreenHelper_(){if(this.fsApi_.requestFullscreen){const t=K[this.fsApi_.exitFullscreen]();if(t){Oc(t.then((()=>this.isFullscreen(false))))}return t}else if(this.tech_.supportsFullScreen()&&!this.options_.preferFullWindow===true){this.techCall_("exitFullScreen")}else{this.exitFullWindow()}}enterFullWindow(){this.isFullscreen(true);this.isFullWindow=true;this.docOrigOverflow=K.documentElement.style.overflow;Vh(K,"keydown",this.boundFullWindowOnEscKey_);K.documentElement.style.overflow="hidden";ih(K.body,"vjs-full-window");this.trigger("enterFullWindow")}fullWindowOnEscKey(t){if(t.key==="Escape"){if(this.isFullscreen()===true){if(!this.isFullWindow){this.exitFullscreen()}else{this.exitFullWindow()}}}}exitFullWindow(){this.isFullscreen(false);this.isFullWindow=false;zh(K,"keydown",this.boundFullWindowOnEscKey_);K.documentElement.style.overflow=this.docOrigOverflow;sh(K.body,"vjs-full-window");this.trigger("exitFullWindow")}disablePictureInPicture(t){if(t===undefined){return this.techGet_("disablePictureInPicture")}this.techCall_("setDisablePictureInPicture",t);this.options_.disablePictureInPicture=t;this.trigger("disablepictureinpicturechanged")}isInPictureInPicture(t){if(t!==undefined){this.isInPictureInPicture_=!!t;this.togglePictureInPictureClass_();return}return!!this.isInPictureInPicture_}requestPictureInPicture(){if(this.options_.enableDocumentPictureInPicture&&z.documentPictureInPicture){const t=K.createElement(this.el().tagName);t.classList=this.el().classList;t.classList.add("vjs-pip-container");if(this.posterImage){t.appendChild(this.posterImage.el().cloneNode(true))}if(this.titleBar){t.appendChild(this.titleBar.el().cloneNode(true))}t.appendChild(Qa("p",{className:"vjs-pip-text"},{},this.localize("Playing in picture-in-picture")));return z.documentPictureInPicture.requestWindow({width:this.videoWidth(),height:this.videoHeight()}).then((e=>{Sh(e);this.el_.parentNode.insertBefore(t,this.el_);e.document.body.appendChild(this.el_);e.document.body.classList.add("vjs-pip-window");this.player_.isInPictureInPicture(true);this.player_.trigger({type:"enterpictureinpicture",pipWindow:e});e.addEventListener("pagehide",(e=>{const i=e.target.querySelector(".video-js");t.parentNode.replaceChild(i,t);this.player_.isInPictureInPicture(false);this.player_.trigger("leavepictureinpicture")}));return e}))}if("pictureInPictureEnabled"in K&&this.disablePictureInPicture()===false){return this.techGet_("requestPictureInPicture")}return Promise.reject("No PiP mode is available")}exitPictureInPicture(){if(z.documentPictureInPicture&&z.documentPictureInPicture.window){z.documentPictureInPicture.window.close();return Promise.resolve()}if("pictureInPictureEnabled"in K){return K.exitPictureInPicture()}}handleKeyDown(t){const{userActions:e}=this.options_;if(!e||!e.hotkeys){return}const i=t=>{const e=t.tagName.toLowerCase();if(t.isContentEditable){return true}const i=["button","checkbox","hidden","radio","reset","submit"];if(e==="input"){return i.indexOf(t.type)===-1}const s=["textarea"];return s.indexOf(e)!==-1};if(i(this.el_.ownerDocument.activeElement)){return}if(typeof e.hotkeys==="function"){e.hotkeys.call(this,t)}else{this.handleHotkeys(t)}}handleHotkeys(t){const e=this.options_.userActions?this.options_.userActions.hotkeys:{};const{fullscreenKey:i=(e=>t.key.toLowerCase()==="f"),muteKey:s=(e=>t.key.toLowerCase()==="m"),playPauseKey:n=(e=>t.key.toLowerCase()==="k"||t.key.toLowerCase()===" ")}=e;if(i.call(this,t)){t.preventDefault();t.stopPropagation();const e=yc.getComponent("FullscreenToggle");if(K[this.fsApi_.fullscreenEnabled]!==false){e.prototype.handleClick.call(this,t)}}else if(s.call(this,t)){t.preventDefault();t.stopPropagation();const e=yc.getComponent("MuteToggle");e.prototype.handleClick.call(this,t)}else if(n.call(this,t)){t.preventDefault();t.stopPropagation();const e=yc.getComponent("PlayToggle");e.prototype.handleClick.call(this,t)}}canPlayType(t){let e;for(let i=0,s=this.options_.techOrder;i<s.length;i++){const n=s[i];let r=pl.getTech(n);if(!r){r=yc.getComponent(n)}if(!r){la.error(`The "${n}" tech is undefined. Skipped browser support check for that tech.`);continue}if(r.isSupported()){e=r.canPlayType(t);if(e){return e}}}return""}selectSource(t){const e=this.options_.techOrder.map((t=>[t,pl.getTech(t)])).filter((([t,e])=>{if(e){return e.isSupported()}la.error(`The "${t}" tech is undefined. Skipped browser support check for that tech.`);return false}));const i=function(t,e,i){let s;t.some((t=>e.some((e=>{s=i(t,e);if(s){return true}}))));return s};let s;const n=t=>(e,i)=>t(i,e);const r=([t,e],i)=>{if(e.canPlaySource(i,this.options_[t.toLowerCase()])){return{source:i,tech:t}}};if(this.options_.sourceOrder){s=i(t,e,n(r))}else{s=i(e,t,r)}return s||false}handleSrc_(t,e){if(typeof t==="undefined"){return this.cache_.src||""}if(this.resetRetryOnError_){this.resetRetryOnError_()}const i=Rl(t);if(!i.length){this.setTimeout((function(){this.error({code:4,message:this.options_.notSupportedMessage})}),0);return}this.changingSrc_=true;if(!e){this.cache_.sources=i}this.updateSourceCaches_(i[0]);yl(this,i[0],((t,s)=>{this.middleware_=s;if(!e){this.cache_.sources=i}this.updateSourceCaches_(t);const n=this.src_(t);if(n){if(i.length>1){return this.handleSrc_(i.slice(1))}this.changingSrc_=false;this.setTimeout((function(){this.error({code:4,message:this.options_.notSupportedMessage})}),0);this.triggerReady();return}jl(s,this.tech_)}));if(i.length>1){const t=()=>{this.error(null);this.handleSrc_(i.slice(1),true)};const e=()=>{this.off("error",t)};this.one("error",t);this.one("playing",e);this.resetRetryOnError_=()=>{this.off("error",t);this.off("playing",e)}}}src(t){return this.handleSrc_(t,false)}src_(t){const e=this.selectSource([t]);if(!e){return true}if(!gc(e.tech,this.techName_)){this.changingSrc_=true;this.loadTech_(e.tech,e.source);this.tech_.ready((()=>{this.changingSrc_=false}));return false}this.ready((function(){if(this.tech_.constructor.prototype.hasOwnProperty("setSource")){this.techCall_("setSource",t)}else{this.techCall_("src",t.src)}this.changingSrc_=false}),true);return false}load(){if(this.tech_&&this.tech_.vhs){this.src(this.currentSource());return}this.techCall_("load")}reset(){if(this.paused()){this.doReset_()}else{const t=this.play();Oc(t.then((()=>this.doReset_())))}}doReset_(){if(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);if(this.titleBar){this.titleBar.update({title:undefined,description:undefined})}if(sc(this)){this.trigger("playerreset")}}resetControlBarUI_(){this.resetProgressBar_();this.resetPlaybackRate_();this.resetVolumeBar_()}resetProgressBar_(){this.currentTime(0);const{currentTimeDisplay:t,durationDisplay:e,progressControl:i,remainingTimeDisplay:s}=this.controlBar||{};const{seekBar:n}=i||{};if(t){t.updateContent()}if(e){e.updateContent()}if(s){s.updateContent()}if(n){n.update();if(n.loadProgressBar){n.loadProgressBar.update()}}}resetPlaybackRate_(){this.playbackRate(this.defaultPlaybackRate());this.handleTechRateChange_()}resetVolumeBar_(){this.volume(1);this.trigger("volumechange")}currentSources(){const t=this.currentSource();const e=[];if(Object.keys(t).length!==0){e.push(t)}return this.cache_.sources||e}currentSource(){return this.cache_.source||{}}currentSrc(){return this.currentSource()&&this.currentSource().src||""}currentType(){return this.currentSource()&&this.currentSource().type||""}preload(t){if(t!==undefined){this.techCall_("setPreload",t);this.options_.preload=t;return}return this.techGet_("preload")}autoplay(t){if(t===undefined){return this.options_.autoplay||false}let e;if(typeof t==="string"&&/(any|play|muted)/.test(t)||t===true&&this.options_.normalizeAutoplay){this.options_.autoplay=t;this.manualAutoplay_(typeof t==="string"?t:"play");e=false}else if(!t){this.options_.autoplay=false}else{this.options_.autoplay=true}e=typeof e==="undefined"?this.options_.autoplay:e;if(this.tech_){this.techCall_("setAutoplay",e)}}playsinline(t){if(t!==undefined){this.techCall_("setPlaysinline",t);this.options_.playsinline=t}return this.techGet_("playsinline")}loop(t){if(t!==undefined){this.techCall_("setLoop",t);this.options_.loop=t;return}return this.techGet_("loop")}poster(t){if(t===undefined){return this.poster_}if(!t){t=""}if(t===this.poster_){return}this.poster_=t;this.techCall_("setPoster",t);this.isPosterFromTech_=false;this.trigger("posterchange")}handleTechPosterChange_(){if((!this.poster_||this.options_.techCanOverridePoster)&&this.tech_&&this.tech_.poster){const t=this.tech_.poster()||"";if(t!==this.poster_){this.poster_=t;this.isPosterFromTech_=true;this.trigger("posterchange")}}}controls(t){if(t===undefined){return!!this.controls_}t=!!t;if(this.controls_===t){return}this.controls_=t;if(this.usingNativeControls()){this.techCall_("setControls",t)}if(this.controls_){this.removeClass("vjs-controls-disabled");this.addClass("vjs-controls-enabled");this.trigger("controlsenabled");if(!this.usingNativeControls()){this.addTechControlsListeners_()}}else{this.removeClass("vjs-controls-enabled");this.addClass("vjs-controls-disabled");this.trigger("controlsdisabled");if(!this.usingNativeControls()){this.removeTechControlsListeners_()}}}usingNativeControls(t){if(t===undefined){return!!this.usingNativeControls_}t=!!t;if(this.usingNativeControls_===t){return}this.usingNativeControls_=t;if(this.usingNativeControls_){this.addClass("vjs-using-native-controls");this.trigger("usingnativecontrols")}else{this.removeClass("vjs-using-native-controls");this.trigger("usingcustomcontrols")}}error(t){if(t===undefined){return this.error_||null}Zo("beforeerror").forEach((e=>{const i=e(this,t);if(!(ma(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}t=i}));if(this.options_.suppressNotSupportedError&&t&&t.code===4){const e=function(){this.error(t)};this.options_.suppressNotSupportedError=false;this.any(["click","touchstart"],e);this.one("loadstart",(function(){this.off(["click","touchstart"],e)}));return}if(t===null){this.error_=null;this.removeClass("vjs-error");if(this.errorDisplay){this.errorDisplay.close()}return}this.error_=new Nc(t);this.addClass("vjs-error");la.error(`(CODE:${this.error_.code} ${Nc.errorTypes[this.error_.code]})`,this.error_.message,this.error_);this.trigger("error");Zo("error").forEach((t=>t(this,this.error_)));return}reportUserActivity(t){this.userActivity_=true}userActive(t){if(t===undefined){return this.userActive_}t=!!t;if(t===this.userActive_){return}this.userActive_=t;if(this.userActive_){this.userActivity_=true;this.removeClass("vjs-user-inactive");this.addClass("vjs-user-active");this.trigger("useractive");return}if(this.tech_){this.tech_.one("mousemove",(function(t){t.stopPropagation();t.preventDefault()}))}this.userActivity_=false;this.removeClass("vjs-user-active");this.addClass("vjs-user-inactive");this.trigger("userinactive")}listenForUserActivity_(){let t;let e;let i;const s=Jh(this,this.reportUserActivity);const n=function(t){if(t.screenX!==e||t.screenY!==i){e=t.screenX;i=t.screenY;s()}};const r=function(){s();this.clearInterval(t);t=this.setInterval(s,250)};const o=function(e){s();this.clearInterval(t)};this.on("mousedown",r);this.on("mousemove",n);this.on("mouseup",o);this.on("mouseleave",o);const a=this.getChild("controlBar");if(a&&!Va&&!Sa){a.on("mouseenter",(function(t){if(this.player().options_.inactivityTimeout!==0){this.player().cache_.inactivityTimeout=this.player().options_.inactivityTimeout}this.player().options_.inactivityTimeout=0}));a.on("mouseleave",(function(t){this.player().options_.inactivityTimeout=this.player().cache_.inactivityTimeout}))}this.on("keydown",s);this.on("keyup",s);let h;const c=function(){if(!this.userActivity_){return}this.userActivity_=false;this.userActive(true);this.clearTimeout(h);const t=this.options_.inactivityTimeout;if(t<=0){return}h=this.setTimeout((function(){if(!this.userActivity_){this.userActive(false)}}),t)};this.setInterval(c,250)}playbackRate(t){if(t!==undefined){this.techCall_("setPlaybackRate",t);return}if(this.tech_&&this.tech_.featuresPlaybackRate){return this.cache_.lastPlaybackRate||this.techGet_("playbackRate")}return 1}defaultPlaybackRate(t){if(t!==undefined){return this.techCall_("setDefaultPlaybackRate",t)}if(this.tech_&&this.tech_.featuresPlaybackRate){return this.techGet_("defaultPlaybackRate")}return 1}isAudio(t){if(t!==undefined){this.isAudio_=!!t;return}return!!this.isAudio_}updatePlayerHeightOnAudioOnlyMode_(){const t=this.getChild("ControlBar");if(!t||this.audioOnlyCache_.controlBarHeight===t.currentHeight()){return}this.audioOnlyCache_.controlBarHeight=t.currentHeight();this.height(this.audioOnlyCache_.controlBarHeight)}enableAudioOnlyUI_(){this.addClass("vjs-audio-only-mode");const t=this.children();const e=this.getChild("ControlBar");const i=e&&e.currentHeight();t.forEach((t=>{if(t===e){return}if(t.el_&&!t.hasClass("vjs-hidden")){t.hide();this.audioOnlyCache_.hiddenChildren.push(t)}}));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((t=>t.show()));this.height(this.audioOnlyCache_.playerHeight);this.trigger("audioonlymodechange")}audioOnlyMode(t){if(typeof t!=="boolean"||t===this.audioOnlyMode_){return this.audioOnlyMode_}this.audioOnlyMode_=t;if(t){const t=[];if(this.isInPictureInPicture()){t.push(this.exitPictureInPicture())}if(this.isFullscreen()){t.push(this.exitFullscreen())}if(this.audioPosterMode()){t.push(this.audioPosterMode(false))}return Promise.all(t).then((()=>this.enableAudioOnlyUI_()))}return Promise.resolve().then((()=>this.disableAudioOnlyUI_()))}enablePosterModeUI_(){const t=this.tech_&&this.tech_;t.hide();this.addClass("vjs-audio-poster-mode");this.trigger("audiopostermodechange")}disablePosterModeUI_(){const t=this.tech_&&this.tech_;t.show();this.removeClass("vjs-audio-poster-mode");this.trigger("audiopostermodechange")}audioPosterMode(t){if(typeof t!=="boolean"||t===this.audioPosterMode_){return this.audioPosterMode_}this.audioPosterMode_=t;if(t){if(this.audioOnlyMode()){const t=this.audioOnlyMode(false);return t.then((()=>{this.enablePosterModeUI_()}))}return Promise.resolve().then((()=>{this.enablePosterModeUI_()}))}return Promise.resolve().then((()=>{this.disablePosterModeUI_()}))}addTextTrack(t,e,i){if(this.tech_){return this.tech_.addTextTrack(t,e,i)}}addRemoteTextTrack(t,e){if(this.tech_){return this.tech_.addRemoteTextTrack(t,e)}}removeRemoteTextTrack(t={}){let{track:e}=t;if(!e){e=t}if(this.tech_){return this.tech_.removeRemoteTextTrack(e)}}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(t){if(t===undefined){return this.language_}if(this.language_!==String(t).toLowerCase()){this.language_=String(t).toLowerCase();if(sc(this)){this.trigger("languagechange")}}}languages(){return ba(Gf.prototype.options_.languages,this.languages_)}toJSON(){const t=ba(this.options_);const e=t.tracks;t.tracks=[];for(let i=0;i<e.length;i++){let s=e[i];s=ba(s);s.player=undefined;t.tracks[i]=s}return t}createModal(t,e){e=e||{};e.content=t||"";const i=new Fc(this,e);this.addChild(i);i.on("dispose",(()=>{this.removeChild(i)}));i.open();return i}updateCurrentBreakpoint_(){if(!this.responsive()){return}const t=this.currentBreakpoint();const e=this.currentWidth();for(let i=0;i<zf.length;i++){const s=zf[i];const n=this.breakpoints_[s];if(e<=n){if(t===s){return}if(t){this.removeClass(Hf[t])}this.addClass(Hf[s]);this.breakpoint_=s;break}}}removeCurrentBreakpoint_(){const t=this.currentBreakpointClass();this.breakpoint_="";if(t){this.removeClass(t)}}breakpoints(t){if(t===undefined){return Object.assign(this.breakpoints_)}this.breakpoint_="";this.breakpoints_=Object.assign({},Xf,t);this.updateCurrentBreakpoint_();return Object.assign(this.breakpoints_)}responsive(t){if(t===undefined){return this.responsive_}t=Boolean(t);const e=this.responsive_;if(t===e){return}this.responsive_=t;if(t){this.on("playerresize",this.boundUpdateCurrentBreakpoint_);this.updateCurrentBreakpoint_()}else{this.off("playerresize",this.boundUpdateCurrentBreakpoint_);this.removeCurrentBreakpoint_()}return t}currentBreakpoint(){return this.breakpoint_}currentBreakpointClass(){return Hf[this.breakpoint_]||""}loadMedia(t,e){if(!t||typeof t!=="object"){return}const i=this.crossOrigin();this.reset();this.cache_.media=ba(t);const{artist:s,artwork:n,description:r,poster:o,src:a,textTracks:h,title:c}=this.cache_.media;if(!n&&o){this.cache_.media.artwork=[{src:o,type:Ol(o)}]}if(i){this.crossOrigin(i)}if(a){this.src(a)}if(o){this.poster(o)}if(Array.isArray(h)){h.forEach((t=>this.addRemoteTextTrack(t,false)))}if(this.titleBar){this.titleBar.update({title:c,description:r||s||""})}this.ready(e)}getMedia(){if(!this.cache_.media){const t=this.poster();const e=this.currentSources();const i=Array.prototype.map.call(this.remoteTextTracks(),(t=>({kind:t.kind,label:t.label,language:t.language,src:t.src})));const s={src:e,textTracks:i};if(t){s.poster=t;s.artwork=[{src:s.poster,type:Ol(s.poster)}]}return s}return ba(this.cache_.media)}static getTagSettings(t){const e={sources:[],tracks:[]};const i=oh(t);const s=i["data-setup"];if(eh(t,"vjs-fill")){i.fill=true}if(eh(t,"vjs-fluid")){i.fluid=true}if(s!==null){const[t,e]=Q(s||"{}");if(t){la.error(t)}Object.assign(i,e)}Object.assign(e,i);if(t.hasChildNodes()){const i=t.childNodes;for(let t=0,s=i.length;t<s;t++){const s=i[t];const n=s.nodeName.toLowerCase();if(n==="source"){e.sources.push(oh(s))}else if(n==="track"){e.tracks.push(oh(s))}}}return e}debug(t){if(t===undefined){return this.debugEnabled_}if(t){this.trigger("debugon");this.previousLogLevel_=this.log.level;this.log.level("debug");this.debugEnabled_=true}else{this.trigger("debugoff");this.log.level(this.previousLogLevel_);this.previousLogLevel_=undefined;this.debugEnabled_=false}}playbackRates(t){if(t===undefined){return this.cache_.playbackRates}if(!Array.isArray(t)){return}if(!t.every((t=>typeof t==="number"))){return}this.cache_.playbackRates=t;this.trigger("playbackrateschange")}}fl.names.forEach((function(t){const e=fl[t];Gf.prototype[e.getterName]=function(){if(this.tech_){return this.tech_[e.getterName]()}this[e.privateName]=this[e.privateName]||new e.ListClass;return this[e.privateName]}}));Gf.prototype.crossorigin=Gf.prototype.crossOrigin;Gf.players={};const Yf=z.navigator;Gf.prototype.options_={techOrder:pl.defaultTechOrder_,html5:{},enableSourceset:true,inactivityTimeout:2e3,playbackRates:[],liveui:false,children:["mediaLoader","posterImage","titleBar","textTrackDisplay","loadingSpinner","bigPlayButton","liveTracker","controlBar","errorDisplay","textTrackSettings","resizeManager"],language:Yf&&(Yf.languages&&Yf.languages[0]||Yf.userLanguage||Yf.language)||"en",languages:{},notSupportedMessage:"No compatible source was found for this media.",normalizeAutoplay:false,fullscreen:{options:{navigationUI:"hide"}},breakpoints:{},responsive:false,audioOnlyMode:false,audioPosterMode:false,spatialNavigation:{enabled:false,horizontalSeek:false},enableSmoothSeeking:false};qf.forEach((function(t){Gf.prototype[`handleTech${mc(t)}_`]=function(){return this.trigger(t)}}));yc.registerComponent("Player",Gf);const Wf="plugin";const Jf="activePlugins_";const Kf={};const Qf=t=>Kf.hasOwnProperty(t);const Zf=t=>Qf(t)?Kf[t]:undefined;const td=(t,e)=>{t[Jf]=t[Jf]||{};t[Jf][e]=true};const ed=(t,e,i)=>{const s=(i?"before":"")+"pluginsetup";t.trigger(s,e);t.trigger(s+":"+e.name,e)};const id=function(t,e){const i=function(){ed(this,{name:t,plugin:e,instance:null},true);const i=e.apply(this,arguments);td(this,t);ed(this,{name:t,plugin:e,instance:i});return i};Object.keys(e).forEach((function(t){i[t]=e[t]}));return i};const sd=(t,e)=>{e.prototype.name=t;return function(...i){ed(this,{name:t,plugin:e,instance:null},true);const s=new e(...[this,...i]);this[t]=()=>s;ed(this,s.getEventHash());return s}};class nd{constructor(t){if(this.constructor===nd){throw new Error("Plugin must be sub-classed; not directly instantiated.")}this.player=t;if(!this.log){this.log=this.player.log.createLogger(this.name)}fc(this);delete this.trigger;pc(this,this.constructor.defaultState);td(t,this.name);this.dispose=this.dispose.bind(this);t.on("dispose",this.dispose)}version(){return this.constructor.VERSION}getEventHash(t={}){t.name=this.name;t.plugin=this.constructor;t.instance=this;return t}trigger(t,e={}){return Hh(this.eventBusEl_,t,this.getEventHash(e))}handleStateChanged(t){}dispose(){const{name:t,player:e}=this;this.trigger("dispose");this.off();e.off("dispose",this.dispose);e[Jf][t]=false;this.player=this.state=null;e[t]=sd(t,Kf[t])}static isBasic(t){const e=typeof t==="string"?Zf(t):t;return typeof e==="function"&&!nd.prototype.isPrototypeOf(e.prototype)}static registerPlugin(t,e){if(typeof t!=="string"){throw new Error(`Illegal plugin name, "${t}", must be a string, was ${typeof t}.`)}if(Qf(t)){la.warn(`A plugin named "${t}" already exists. You may want to avoid re-registering plugins!`)}else if(Gf.prototype.hasOwnProperty(t)){throw new Error(`Illegal plugin name, "${t}", cannot share a name with an existing player method!`)}if(typeof e!=="function"){throw new Error(`Illegal plugin for "${t}", must be a function, was ${typeof e}.`)}Kf[t]=e;if(t!==Wf){if(nd.isBasic(e)){Gf.prototype[t]=id(t,e)}else{Gf.prototype[t]=sd(t,e)}}return e}static deregisterPlugin(t){if(t===Wf){throw new Error("Cannot de-register base plugin.")}if(Qf(t)){delete Kf[t];delete Gf.prototype[t]}}static getPlugins(t=Object.keys(Kf)){let e;t.forEach((t=>{const i=Zf(t);if(i){e=e||{};e[t]=i}}));return e}static getPluginVersion(t){const e=Zf(t);return e&&e.VERSION||""}}nd.getPlugin=Zf;nd.BASE_PLUGIN_NAME=Wf;nd.registerPlugin(Wf,nd);Gf.prototype.usingPlugin=function(t){return!!this[Jf]&&this[Jf][t]===true};Gf.prototype.hasPlugin=function(t){return!!Qf(t)};function rd(t,e){let i=false;return function(...s){if(!i){la.warn(t)}i=true;return e.apply(this,s)}}function od(t,e,i,s){return rd(`${e} is deprecated and will be removed in ${t}.0; please use ${i} instead.`,s)}var ad={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 hd=t=>t.indexOf("#")===0?t.slice(1):t;function cd(t,e,i){let s=cd.getPlayer(t);if(s){if(e){la.warn(`Player "${t}" is already initialised. Options will not be applied.`)}if(i){s.ready(i)}return s}const n=typeof t==="string"?wh("#"+hd(t)):t;if(!Wa(n)){throw new TypeError("The element or ID supplied is not valid. (videojs)")}const r="getRootNode"in n?n.getRootNode()instanceof z.ShadowRoot:false;const o=r?n.getRootNode():n.ownerDocument.body;if(!n.ownerDocument.defaultView||!o.contains(n)){la.warn("The element supplied is not included in the DOM")}e=e||{};if(e.restoreEl===true){e.restoreEl=(n.parentNode&&n.parentNode.hasAttribute&&n.parentNode.hasAttribute("data-vjs-player")?n.parentNode:n).cloneNode(true)}Zo("beforesetup").forEach((t=>{const i=t(n,ba(e));if(!ma(i)||Array.isArray(i)){la.error("please return an object in beforesetup hooks");return}e=ba(e,i)}));const a=yc.getComponent("Player");s=new a(n,e,i);Zo("setup").forEach((t=>t(s)));return s}cd.hooks_=Qo;cd.hooks=Zo;cd.hook=ta;cd.hookOnce=ia;cd.removeHook=ea;if(z.VIDEOJS_NO_DYNAMIC_STYLE!==true&&Ya()){let Pb=wh(".vjs-styles-defaults");if(!Pb){Pb=Nh("vjs-styles-defaults");const $b=wh("head");if($b){$b.insertBefore(Pb,$b.firstChild)}_h(Pb,`\n .video-js {\n width: 300px;\n height: 150px;\n }\n\n .vjs-fluid:not(.vjs-audio-only-mode) {\n padding-top: 56.25%\n }\n `)}}Dh(1,cd);cd.VERSION=Ko;cd.options=Gf.prototype.options_;cd.getPlayers=()=>Gf.players;cd.getPlayer=t=>{const e=Gf.players;let i;if(typeof t==="string"){const s=hd(t);const n=e[s];if(n){return n}i=wh("#"+s)}else{i=t}if(Wa(i)){const{player:t,playerId:s}=i;if(t||e[s]){return t||e[s]}}};cd.getAllPlayers=()=>Object.keys(Gf.players).map((t=>Gf.players[t])).filter(Boolean);cd.players=Gf.players;cd.getComponent=yc.getComponent;cd.registerComponent=(t,e)=>{if(pl.isTech(e)){la.warn(`The ${t} tech was registered as a component. It should instead be registered using videojs.registerTech(name, tech)`)}return yc.registerComponent.call(yc,t,e)};cd.getTech=pl.getTech;cd.registerTech=pl.registerTech;cd.use=bl;Object.defineProperty(cd,"middleware",{value:{},writeable:false,enumerable:true});Object.defineProperty(cd.middleware,"TERMINATOR",{value:gl,writeable:false,enumerable:true});cd.browser=Ha;cd.obj=wa;cd.mergeOptions=od(9,"videojs.mergeOptions","videojs.obj.merge",ba);cd.defineLazyProperty=od(9,"videojs.defineLazyProperty","videojs.obj.defineLazyProperty",ja);cd.bind=od(9,"videojs.bind","native Function.prototype.bind",Jh);cd.registerPlugin=nd.registerPlugin;cd.deregisterPlugin=nd.deregisterPlugin;cd.plugin=(t,e)=>{la.warn("videojs.plugin() is deprecated; use videojs.registerPlugin() instead");return nd.registerPlugin(t,e)};cd.getPlugins=nd.getPlugins;cd.getPlugin=nd.getPlugin;cd.getPluginVersion=nd.getPluginVersion;cd.addLanguage=function(t,e){t=(""+t).toLowerCase();cd.options.languages=ba(cd.options.languages,{[t]:e});return cd.options.languages[t]};cd.log=la;cd.createLogger=ua;cd.time=Dc;cd.createTimeRange=od(9,"videojs.createTimeRange","videojs.time.createTimeRanges",kc);cd.createTimeRanges=od(9,"videojs.createTimeRanges","videojs.time.createTimeRanges",kc);cd.formatTime=od(9,"videojs.formatTime","videojs.time.formatTime",Ic);cd.setFormatTime=od(9,"videojs.setFormatTime","videojs.time.setFormatTime",Ac);cd.resetFormatTime=od(9,"videojs.resetFormatTime","videojs.time.resetFormatTime",Ec);cd.parseUrl=od(9,"videojs.parseUrl","videojs.url.parseUrl",Zc);cd.isCrossOrigin=od(9,"videojs.isCrossOrigin","videojs.url.isCrossOrigin",il);cd.EventTarget=ec;cd.any=Gh;cd.on=Vh;cd.one=Xh;cd.off=zh;cd.trigger=Hh;cd.xhr=Nt;cd.TextTrack=ol;cd.AudioTrack=al;cd.VideoTrack=hl;["isEl","isTextNode","createEl","hasClass","addClass","removeClass","toggleClass","setAttributes","getAttributes","emptyEl","appendContent","insertContent"].forEach((t=>{cd[t]=function(){la.warn(`videojs.${t}() is deprecated; use videojs.dom.${t}() instead`);return xh[t].apply(null,arguments)}}));cd.computedStyle=od(9,"videojs.computedStyle","videojs.dom.computedStyle",kh);cd.dom=xh;cd.fn=Zh;cd.num=uu;cd.str=bc;cd.url=sl;cd.Error=ad;
|
|
22
|
-
/*! @name videojs-contrib-quality-levels @version 4.1.0 @license Apache-2.0 */class ld{constructor(t){let e=this;e.id=t.id;e.label=e.id;e.width=t.width;e.height=t.height;e.bitrate=t.bandwidth;e.frameRate=t.frameRate;e.enabled_=t.enabled;Object.defineProperty(e,"enabled",{get(){return e.enabled_()},set(t){e.enabled_(t)}});return e}}class ud extends cd.EventTarget{constructor(){super();let t=this;t.levels_=[];t.selectedIndex_=-1;Object.defineProperty(t,"selectedIndex",{get(){return t.selectedIndex_}});Object.defineProperty(t,"length",{get(){return t.levels_.length}});t[Symbol.iterator]=()=>t.levels_.values();return t}addQualityLevel(t){let e=this.getQualityLevelById(t.id);if(e){return e}const i=this.levels_.length;e=new ld(t);if(!(""+i in this)){Object.defineProperty(this,i,{get(){return this.levels_[i]}})}this.levels_.push(e);this.trigger({qualityLevel:e,type:"addqualitylevel"});return e}removeQualityLevel(t){let e=null;for(let i=0,s=this.length;i<s;i++){if(this[i]===t){e=this.levels_.splice(i,1)[0];if(this.selectedIndex_===i){this.selectedIndex_=-1}else if(this.selectedIndex_>i){this.selectedIndex_--}break}}if(e){this.trigger({qualityLevel:t,type:"removequalitylevel"})}return e}getQualityLevelById(t){for(let e=0,i=this.length;e<i;e++){const i=this[e];if(i.id===t){return i}}return null}dispose(){this.selectedIndex_=-1;this.levels_.length=0}}ud.prototype.allowedEvents_={change:"change",addqualitylevel:"addqualitylevel",removequalitylevel:"removequalitylevel"};for(const Fb in ud.prototype.allowedEvents_){ud.prototype["on"+Fb]=null}var fd="4.1.0";const dd=function(t,e){const i=t.qualityLevels;const s=new ud;const n=function(){s.dispose();t.qualityLevels=i;t.off("dispose",n)};t.on("dispose",n);t.qualityLevels=()=>s;t.qualityLevels.VERSION=fd;return s};const pd=function(t){return dd(this,cd.obj.merge({},t))};cd.registerPlugin("qualityLevels",pd);pd.VERSION=fd;
|
|
23
|
-
/*! @name @videojs/http-streaming @version 3.13.2 @license Apache-2.0 */const vd=Ee;const md=(t,e)=>{if(e&&e.responseURL&&t!==e.responseURL){return e.responseURL}return t};const gd=t=>{if(cd.log.debug){return cd.log.debug.bind(cd,"VHS:",`${t} >`)}return function(){}};function bd(...t){const e=cd.obj||cd;const i=e.merge||e.mergeOptions;return i.apply(e,t)}function yd(...t){const e=cd.time||cd;const i=e.createTimeRanges||e.createTimeRanges;return i.apply(e,t)}function jd(t){if(t.length===0){return"Buffered Ranges are empty"}let e="Buffered Ranges: \n";for(let i=0;i<t.length;i++){const s=t.start(i);const n=t.end(i);e+=`${s} --\x3e ${n}. Duration (${n-s})\n`}return e}const wd=1/30;const Td=wd*3;const kd=function(t,e){const i=[];let s;if(t&&t.length){for(s=0;s<t.length;s++){if(e(t.start(s),t.end(s))){i.push([t.start(s),t.end(s)])}}}return yd(i)};const Sd=function(t,e){return kd(t,(function(t,i){return t-Td<=e&&i+Td>=e}))};const xd=function(t,e){return kd(t,(function(t){return t-wd>=e}))};const Ad=function(t){if(t.length<2){return yd()}const e=[];for(let i=1;i<t.length;i++){const s=t.end(i-1);const n=t.start(i);e.push([s,n])}return yd(e)};const Ed=function(t,e){let i=null;let s=null;let n=0;const r=[];const o=[];if(!t||!t.length||!e||!e.length){return yd()}let a=t.length;while(a--){r.push({time:t.start(a),type:"start"});r.push({time:t.end(a),type:"end"})}a=e.length;while(a--){r.push({time:e.start(a),type:"start"});r.push({time:e.end(a),type:"end"})}r.sort((function(t,e){return t.time-e.time}));for(a=0;a<r.length;a++){if(r[a].type==="start"){n++;if(n===2){i=r[a].time}}else if(r[a].type==="end"){n--;if(n===1){s=r[a].time}}if(i!==null&&s!==null){o.push([i,s]);i=null;s=null}}return yd(o)};const Id=t=>{const e=[];if(!t||!t.length){return""}for(let i=0;i<t.length;i++){e.push(t.start(i)+" => "+t.end(i))}return e.join(", ")};const Dd=function(t,e,i=1){const s=t.length?t.end(t.length-1):0;return(s-e)/i};const Cd=t=>{const e=[];for(let i=0;i<t.length;i++){e.push({start:t.start(i),end:t.end(i)})}return e};const Nd=function(t,e){if(t===e){return false}if(!t&&e||!e&&t){return true}if(t.length!==e.length){return true}for(let i=0;i<t.length;i++){if(t.start(i)!==e.start(i)||t.end(i)!==e.end(i)){return true}}return false};const _d=function(t){if(!t||!t.length||!t.end){return}return t.end(t.length-1)};const Od=function(t,e){let i=0;if(!t||!t.length){return i}for(let s=0;s<t.length;s++){const n=t.start(s);const r=t.end(s);if(e>r){continue}if(e>n&&e<=r){i+=r-e;continue}i+=r-n}return i};const Md=(t,e)=>{if(!e.preload){return e.duration}let i=0;(e.parts||[]).forEach((function(t){i+=t.duration}));(e.preloadHints||[]).forEach((function(e){if(e.type==="PART"){i+=t.partTargetDuration}}));return i};const Rd=t=>(t.segments||[]).reduce(((t,e,i)=>{if(e.parts){e.parts.forEach((function(s,n){t.push({duration:s.duration,segmentIndex:i,partIndex:n,part:s,segment:e})}))}else{t.push({duration:e.duration,segmentIndex:i,partIndex:null,segment:e,part:null})}return t}),[]);const Ld=t=>{const e=t.segments&&t.segments.length&&t.segments[t.segments.length-1];return e&&e.parts||[]};const Pd=({preloadSegment:t})=>{if(!t){return}const{parts:e,preloadHints:i}=t;let s=(i||[]).reduce(((t,e)=>t+(e.type==="PART"?1:0)),0);s+=e&&e.length?e.length:0;return s};const $d=(t,e)=>{if(e.endList){return 0}if(t&&t.suggestedPresentationDelay){return t.suggestedPresentationDelay}const i=Ld(e).length>0;if(i&&e.serverControl&&e.serverControl.partHoldBack){return e.serverControl.partHoldBack}else if(i&&e.partTargetDuration){return e.partTargetDuration*3}else if(e.serverControl&&e.serverControl.holdBack){return e.serverControl.holdBack}else if(e.targetDuration){return e.targetDuration*3}return 0};const Fd=function(t,e){let i=0;let s=e-t.mediaSequence;let n=t.segments[s];if(n){if(typeof n.start!=="undefined"){return{result:n.start,precise:true}}if(typeof n.end!=="undefined"){return{result:n.end-n.duration,precise:true}}}while(s--){n=t.segments[s];if(typeof n.end!=="undefined"){return{result:i+n.end,precise:true}}i+=Md(t,n);if(typeof n.start!=="undefined"){return{result:i+n.start,precise:true}}}return{result:i,precise:false}};const Ud=function(t,e){let i=0;let s;let n=e-t.mediaSequence;for(;n<t.segments.length;n++){s=t.segments[n];if(typeof s.start!=="undefined"){return{result:s.start-i,precise:true}}i+=Md(t,s);if(typeof s.end!=="undefined"){return{result:s.end-i,precise:true}}}return{result:-1,precise:false}};const Bd=function(t,e,i){if(typeof e==="undefined"){e=t.mediaSequence+t.segments.length}if(e<t.mediaSequence){return 0}const s=Fd(t,e);if(s.precise){return s.result}const n=Ud(t,e);if(n.precise){return n.result}return s.result+i};const qd=function(t,e,i){if(!t){return 0}if(typeof i!=="number"){i=0}if(typeof e==="undefined"){if(t.totalDuration){return t.totalDuration}if(!t.endList){return z.Infinity}}return Bd(t,e,i)};const Vd=function({defaultDuration:t,durationList:e,startIndex:i,endIndex:s}){let n=0;if(i>s){[i,s]=[s,i]}if(i<0){for(let e=i;e<Math.min(0,s);e++){n+=t}i=0}for(let t=i;t<s;t++){n+=e[t].duration}return n};const zd=function(t,e,i,s){if(!t||!t.segments){return null}if(t.endList){return qd(t)}if(e===null){return null}e=e||0;let n=Bd(t,t.mediaSequence+t.segments.length,e);if(i){s=typeof s==="number"?s:$d(null,t);n-=s}return Math.max(0,n)};const Hd=function(t,e,i){const s=true;const n=e||0;let r=zd(t,e,s,i);if(r===null){return yd()}if(r<n){r=n}return yd(n,r)};const Xd=function({playlist:t,currentTime:e,startingSegmentIndex:i,startingPartIndex:s,startTime:n,exactManifestTimings:r}){let o=e-n;const a=Rd(t);let h=0;for(let t=0;t<a.length;t++){const e=a[t];if(i!==e.segmentIndex){continue}if(typeof s==="number"&&typeof e.partIndex==="number"&&s!==e.partIndex){continue}h=t;break}if(o<0){if(h>0){for(let e=h-1;e>=0;e--){const i=a[e];o+=i.duration;if(r){if(o<0){continue}}else if(o+wd<=0){continue}return{partIndex:i.partIndex,segmentIndex:i.segmentIndex,startTime:n-Vd({defaultDuration:t.targetDuration,durationList:a,startIndex:h,endIndex:e})}}}return{partIndex:a[0]&&a[0].partIndex||null,segmentIndex:a[0]&&a[0].segmentIndex||0,startTime:e}}if(h<0){for(let i=h;i<0;i++){o-=t.targetDuration;if(o<0){return{partIndex:a[0]&&a[0].partIndex||null,segmentIndex:a[0]&&a[0].segmentIndex||0,startTime:e}}}h=0}for(let e=h;e<a.length;e++){const i=a[e];o-=i.duration;const s=i.duration>wd;const c=o===0;const l=s&&o+wd>=0;if(c||l){if(e!==a.length-1){continue}}if(r){if(o>0){continue}}else if(o-wd>=0){continue}return{partIndex:i.partIndex,segmentIndex:i.segmentIndex,startTime:n+Vd({defaultDuration:t.targetDuration,durationList:a,startIndex:h,endIndex:e})}}return{segmentIndex:a[a.length-1].segmentIndex,partIndex:a[a.length-1].partIndex,startTime:e}};const Gd=function(t){return t.excludeUntil&&t.excludeUntil>Date.now()};const Yd=function(t){return t.excludeUntil&&t.excludeUntil===Infinity};const Wd=function(t){const e=Gd(t);return!t.disabled&&!e};const Jd=function(t){return t.disabled};const Kd=function(t){for(let e=0;e<t.segments.length;e++){if(t.segments[e].key){return true}}return false};const Qd=function(t,e){return e.attributes&&e.attributes[t]};const Zd=function(t,e,i,s=0){if(!Qd("BANDWIDTH",i)){return NaN}const n=t*i.attributes.BANDWIDTH;return(n-s*8)/e};const tp=(t,e)=>{if(t.playlists.length===1){return true}const i=e.attributes.BANDWIDTH||Number.MAX_VALUE;return t.playlists.filter((t=>{if(!Wd(t)){return false}return(t.attributes.BANDWIDTH||0)<i})).length===0};const ep=(t,e)=>{if(!t&&!e||!t&&e||t&&!e){return false}if(t===e){return true}if(t.id&&e.id&&t.id===e.id){return true}if(t.resolvedUri&&e.resolvedUri&&t.resolvedUri===e.resolvedUri){return true}if(t.uri&&e.uri&&t.uri===e.uri){return true}return false};const ip=function(t,e){const i=t&&t.mediaGroups&&t.mediaGroups.AUDIO||{};let s=false;for(const t in i){for(const n in i[t]){s=e(i[t][n]);if(s){break}}if(s){break}}return!!s};const sp=t=>{if(!t||!t.playlists||!t.playlists.length){const e=ip(t,(t=>t.playlists&&t.playlists.length||t.uri));return e}for(let e=0;e<t.playlists.length;e++){const i=t.playlists[e];const s=i.attributes&&i.attributes.CODECS;if(s&&s.split(",").every((t=>Ye(t)))){continue}const n=ip(t,(t=>ep(i,t)));if(n){continue}return false}return true};var np={liveEdgeDelay:$d,duration:qd,seekable:Hd,getMediaInfoForTime:Xd,isEnabled:Wd,isDisabled:Jd,isExcluded:Gd,isIncompatible:Yd,playlistEnd:zd,isAes:Kd,hasAttribute:Qd,estimateSegmentRequestTime:Zd,isLowestEnabledRendition:tp,isAudioOnly:sp,playlistMatch:ep,segmentDurationWithParts:Md};const{log:rp}=cd;const op=(t,e)=>`${t}-${e}`;const ap=(t,e,i)=>`placeholder-uri-${t}-${e}-${i}`;const hp=({onwarn:t,oninfo:e,manifestString:i,customTagParsers:s=[],customTagMappers:n=[],llhls:r})=>{const o=new Be;if(t){o.on("warn",t)}if(e){o.on("info",e)}s.forEach((t=>o.addParser(t)));n.forEach((t=>o.addTagMapper(t)));o.push(i);o.end();const a=o.manifest;if(!r){["preloadSegment","skip","serverControl","renditionReports","partInf","partTargetDuration"].forEach((function(t){if(a.hasOwnProperty(t)){delete a[t]}}));if(a.segments){a.segments.forEach((function(t){["parts","preloadHints"].forEach((function(e){if(t.hasOwnProperty(e)){delete t[e]}}))}))}}if(!a.targetDuration){let e=10;if(a.segments&&a.segments.length){e=a.segments.reduce(((t,e)=>Math.max(t,e.duration)),0)}if(t){t({message:`manifest has no targetDuration defaulting to ${e}`})}a.targetDuration=e}const h=Ld(a);if(h.length&&!a.partTargetDuration){const e=h.reduce(((t,e)=>Math.max(t,e.duration)),0);if(t){t({message:`manifest has no partTargetDuration defaulting to ${e}`});rp.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.")}a.partTargetDuration=e}return a};const cp=(t,e)=>{if(!t.mediaGroups){return}["AUDIO","SUBTITLES"].forEach((i=>{if(!t.mediaGroups[i]){return}for(const s in t.mediaGroups[i]){for(const n in t.mediaGroups[i][s]){const r=t.mediaGroups[i][s][n];e(r,i,s,n)}}}))};const lp=({playlist:t,uri:e,id:i})=>{t.id=i;t.playlistErrors_=0;if(e){t.uri=e}t.attributes=t.attributes||{}};const up=t=>{let e=t.playlists.length;while(e--){const i=t.playlists[e];lp({playlist:i,id:op(e,i.uri)});i.resolvedUri=vd(t.uri,i.uri);t.playlists[i.id]=i;t.playlists[i.uri]=i;if(!i.attributes.BANDWIDTH){rp.warn("Invalid playlist STREAM-INF detected. Missing BANDWIDTH attribute.")}}};const fp=t=>{cp(t,(e=>{if(e.uri){e.resolvedUri=vd(t.uri,e.uri)}}))};const dp=(t,e)=>{const i=op(0,e);const s={mediaGroups:{AUDIO:{},VIDEO:{},"CLOSED-CAPTIONS":{},SUBTITLES:{}},uri:z.location.href,resolvedUri:z.location.href,playlists:[{uri:e,id:i,resolvedUri:e,attributes:{}}]};s.playlists[i]=s.playlists[0];s.playlists[e]=s.playlists[0];return s};const pp=(t,e,i=ap)=>{t.uri=e;for(let e=0;e<t.playlists.length;e++){if(!t.playlists[e].uri){const i=`placeholder-uri-${e}`;t.playlists[e].uri=i}}const s=sp(t);cp(t,((e,n,r,o)=>{if(!e.playlists||!e.playlists.length){if(s&&n==="AUDIO"&&!e.uri){for(let e=0;e<t.playlists.length;e++){const i=t.playlists[e];if(i.attributes&&i.attributes.AUDIO&&i.attributes.AUDIO===r){return}}}e.playlists=[it({},e)]}e.playlists.forEach((function(e,s){const a=i(n,r,o,e);const h=op(s,a);if(e.uri){e.resolvedUri=e.resolvedUri||vd(t.uri,e.uri)}else{e.uri=s===0?a:h;e.resolvedUri=e.uri}e.id=e.id||h;e.attributes=e.attributes||{};t.playlists[e.id]=e;t.playlists[e.uri]=e}))}));up(t);fp(t)};class vp{constructor(){this.offset_=null;this.pendingDateRanges_=new Map;this.processedDateRanges_=new Map}setOffset(t=[]){if(this.offset_!==null){return}if(!t.length){return}const[e]=t;if(e.programDateTime===undefined){return}this.offset_=e.programDateTime/1e3}setPendingDateRanges(t=[]){if(!t.length){return}const[e]=t;const i=e.startDate.getTime();this.trimProcessedDateRanges_(i);this.pendingDateRanges_=t.reduce(((t,e)=>{t.set(e.id,e);return t}),new Map)}processDateRange(t){this.pendingDateRanges_.delete(t.id);this.processedDateRanges_.set(t.id,t)}getDateRangesToProcess(){if(this.offset_===null){return[]}const t={};const e=[];this.pendingDateRanges_.forEach(((i,s)=>{if(this.processedDateRanges_.has(s)){return}i.startTime=i.startDate.getTime()/1e3-this.offset_;i.processDateRange=()=>this.processDateRange(i);e.push(i);if(!i.class){return}if(t[i.class]){const e=t[i.class].push(i);i.classListIndex=e-1}else{t[i.class]=[i];i.classListIndex=0}}));for(const i of e){const e=t[i.class]||[];if(i.endDate){i.endTime=i.endDate.getTime()/1e3-this.offset_}else if(i.endOnNext&&e[i.classListIndex+1]){i.endTime=e[i.classListIndex+1].startTime}else if(i.duration){i.endTime=i.startTime+i.duration}else if(i.plannedDuration){i.endTime=i.startTime+i.plannedDuration}else{i.endTime=i.startTime}}return e}trimProcessedDateRanges_(t){const e=new Map(this.processedDateRanges_);e.forEach(((e,i)=>{if(e.startDate.getTime()<t){this.processedDateRanges_.delete(i)}}))}}const mp=22;const gp=({requestType:t,request:e,error:i,parseFailure:s})=>{const n=e.status<200||e.status>299;const r=e.status>=400&&e.status<=499;const o={uri:e.uri,requestType:t};const a=n&&!r||s;if(i&&r){o.error=it({},i);o.errorType=cd.Error.NetworkRequestFailed}else if(e.aborted){o.errorType=cd.Error.NetworkRequestAborted}else if(e.timedout){o.erroType=cd.Error.NetworkRequestTimeout}else if(a){const t=s?cd.Error.NetworkBodyParserFailed:cd.Error.NetworkBadStatus;o.errorType=t;o.status=e.status;o.headers=e.headers}return o};const{EventTarget:bp}=cd;const yp=(t,e)=>{if(e.endList||!e.serverControl){return t}const i={};if(e.serverControl.canBlockReload){const{preloadSegment:t}=e;let s=e.mediaSequence+e.segments.length;if(t){const n=t.parts||[];const r=Pd(e)-1;if(r>-1&&r!==n.length-1){i._HLS_part=r}if(r>-1||n.length){s--}}i._HLS_msn=s}if(e.serverControl&&e.serverControl.canSkipUntil){i._HLS_skip=e.serverControl.canSkipDateranges?"v2":"YES"}if(Object.keys(i).length){const e=new z.URL(t);["_HLS_skip","_HLS_msn","_HLS_part"].forEach((function(t){if(!i.hasOwnProperty(t)){return}e.searchParams.set(t,i[t])}));t=e.toString()}return t};const jp=(t,e)=>{if(!t){return e}const i=bd(t,e);if(t.preloadHints&&!e.preloadHints){delete i.preloadHints}if(t.parts&&!e.parts){delete i.parts}else if(t.parts&&e.parts){for(let s=0;s<e.parts.length;s++){if(t.parts&&t.parts[s]){i.parts[s]=bd(t.parts[s],e.parts[s])}}}if(!t.skipped&&e.skipped){i.skipped=false}if(t.preload&&!e.preload){i.preload=false}return i};const wp=(t,e,i)=>{const s=t.slice();const n=e.slice();i=i||0;const r=[];let o;for(let t=0;t<n.length;t++){const e=s[t+i];const a=n[t];if(e){o=e.map||o;r.push(jp(e,a))}else{if(o&&!a.map){a.map=o}r.push(a)}}return r};const Tp=(t,e)=>{if(!t.resolvedUri&&t.uri){t.resolvedUri=vd(e,t.uri)}if(t.key&&!t.key.resolvedUri){t.key.resolvedUri=vd(e,t.key.uri)}if(t.map&&!t.map.resolvedUri){t.map.resolvedUri=vd(e,t.map.uri)}if(t.map&&t.map.key&&!t.map.key.resolvedUri){t.map.key.resolvedUri=vd(e,t.map.key.uri)}if(t.parts&&t.parts.length){t.parts.forEach((t=>{if(t.resolvedUri){return}t.resolvedUri=vd(e,t.uri)}))}if(t.preloadHints&&t.preloadHints.length){t.preloadHints.forEach((t=>{if(t.resolvedUri){return}t.resolvedUri=vd(e,t.uri)}))}};const kp=function(t){const e=t.segments||[];const i=t.preloadSegment;if(i&&i.parts&&i.parts.length){if(i.preloadHints){for(let t=0;t<i.preloadHints.length;t++){if(i.preloadHints[t].type==="MAP"){return e}}}i.duration=t.targetDuration;i.preload=true;e.push(i)}return e};const Sp=(t,e)=>t===e||t.segments&&e.segments&&t.segments.length===e.segments.length&&t.endList===e.endList&&t.mediaSequence===e.mediaSequence&&t.preloadSegment===e.preloadSegment;const xp=(t,e,i=Sp)=>{const s=bd(t,{});const n=s.playlists[e.id];if(!n){return null}if(i(n,e)){return null}e.segments=kp(e);const r=bd(n,e);if(r.preloadSegment&&!e.preloadSegment){delete r.preloadSegment}if(n.segments){if(e.skip){e.segments=e.segments||[];for(let t=0;t<e.skip.skippedSegments;t++){e.segments.unshift({skipped:true})}}r.segments=wp(n.segments,e.segments,e.mediaSequence-n.mediaSequence)}r.segments.forEach((t=>{Tp(t,r.resolvedUri)}));for(let t=0;t<s.playlists.length;t++){if(s.playlists[t].id===e.id){s.playlists[t]=r}}s.playlists[e.id]=r;s.playlists[e.uri]=r;cp(t,((t,i,s,n)=>{if(!t.playlists){return}for(let i=0;i<t.playlists.length;i++){if(e.id===t.playlists[i].id){t.playlists[i]=r}}}));return s};const Ap=(t,e)=>{const i=t.segments||[];const s=i[i.length-1];const n=s&&s.parts&&s.parts[s.parts.length-1];const r=n&&n.duration||s&&s.duration;if(e&&r){return r*1e3}return(t.partTargetDuration||t.targetDuration||10)*500};const Ep=(t,e,i)=>{if(!t){return}const s=[];t.forEach((t=>{if(!t.attributes){return}const{BANDWIDTH:e,RESOLUTION:i,CODECS:n}=t.attributes;s.push({id:t.id,bandwidth:e,resolution:i,codecs:n})}));return{type:e,isLive:i,renditions:s}};class Ip extends bp{constructor(t,e,i={}){super();if(!t){throw new Error("A non-empty playlist URL or object is required")}this.logger_=gd("PlaylistLoader");const{withCredentials:s=false}=i;this.src=t;this.vhs_=e;this.withCredentials=s;this.addDateRangesToTextTrack_=i.addDateRangesToTextTrack;const n=e.options_;this.customTagParsers=n&&n.customTagParsers||[];this.customTagMappers=n&&n.customTagMappers||[];this.llhls=n&&n.llhls;this.dateRangesStorage_=new vp;this.state="HAVE_NOTHING";this.handleMediaupdatetimeout_=this.handleMediaupdatetimeout_.bind(this);this.on("mediaupdatetimeout",this.handleMediaupdatetimeout_);this.on("loadedplaylist",this.handleLoadedPlaylist_.bind(this))}handleLoadedPlaylist_(){const t=this.media();if(!t){return}this.dateRangesStorage_.setOffset(t.segments);this.dateRangesStorage_.setPendingDateRanges(t.dateRanges);const e=this.dateRangesStorage_.getDateRangesToProcess();if(!e.length||!this.addDateRangesToTextTrack_){return}this.addDateRangesToTextTrack_(e)}handleMediaupdatetimeout_(){if(this.state!=="HAVE_METADATA"){return}const t=this.media();let e=vd(this.main.uri,t.uri);if(this.llhls){e=yp(e,t)}this.state="HAVE_CURRENT_METADATA";this.request=this.vhs_.xhr({uri:e,withCredentials:this.withCredentials,requestType:"hls-playlist"},((t,e)=>{if(!this.request){return}if(t){return this.playlistRequestError(this.request,this.media(),"HAVE_METADATA")}this.haveMetadata({playlistString:this.request.responseText,url:this.media().uri,id:this.media().id})}))}playlistRequestError(t,e,i){const{uri:s,id:n}=e;this.request=null;if(i){this.state=i}this.error={playlist:this.main.playlists[n],status:t.status,message:`HLS playlist request error at URL: ${s}.`,responseText:t.responseText,code:t.status>=500?4:2,metadata:gp({requestType:t.requestType,request:t,error:t.error})};this.trigger("error")}parseManifest_({url:t,manifestString:e}){try{return hp({onwarn:({message:e})=>this.logger_(`m3u8-parser warn for ${t}: ${e}`),oninfo:({message:e})=>this.logger_(`m3u8-parser info for ${t}: ${e}`),manifestString:e,customTagParsers:this.customTagParsers,customTagMappers:this.customTagMappers,llhls:this.llhls})}catch(t){this.error=t;this.error.metadata={errorType:cd.Error.StreamingHlsPlaylistParserError,error:t}}}haveMetadata({playlistString:t,playlistObject:e,url:i,id:s}){this.request=null;this.state="HAVE_METADATA";const n={playlistInfo:{type:"media",uri:i}};this.trigger({type:"playlistparsestart",metadata:n});const r=e||this.parseManifest_({url:i,manifestString:t});r.lastRequest=Date.now();lp({playlist:r,uri:i,id:s});const o=xp(this.main,r);this.targetDuration=r.partTargetDuration||r.targetDuration;this.pendingMedia_=null;if(o){this.main=o;this.media_=this.main.playlists[s]}else{this.trigger("playlistunchanged")}this.updateMediaUpdateTimeout_(Ap(this.media(),!!o));n.parsedPlaylist=Ep(this.main.playlists,n.playlistInfo.type,!this.media_.endList);this.trigger({type:"playlistparsecomplete",metadata:n});this.trigger("loadedplaylist")}dispose(){this.trigger("dispose");this.stopRequest();z.clearTimeout(this.mediaUpdateTimeout);z.clearTimeout(this.finalRenditionTimeout);this.dateRangesStorage_=new vp;this.off()}stopRequest(){if(this.request){const t=this.request;this.request=null;t.onreadystatechange=null;t.abort()}}media(t,e){if(!t){return this.media_}if(this.state==="HAVE_NOTHING"){throw new Error("Cannot switch media playlist from "+this.state)}if(typeof t==="string"){if(!this.main.playlists[t]){throw new Error("Unknown playlist URI: "+t)}t=this.main.playlists[t]}z.clearTimeout(this.finalRenditionTimeout);if(e){const e=(t.partTargetDuration||t.targetDuration)/2*1e3||5*1e3;this.finalRenditionTimeout=z.setTimeout(this.media.bind(this,t,false),e);return}const i=this.state;const s=!this.media_||t.id!==this.media_.id;const n=this.main.playlists[t.id];if(n&&n.endList||t.endList&&t.segments.length){if(this.request){this.request.onreadystatechange=null;this.request.abort();this.request=null}this.state="HAVE_METADATA";this.media_=t;if(s){this.trigger("mediachanging");if(i==="HAVE_MAIN_MANIFEST"){this.trigger("loadedmetadata")}else{this.trigger("mediachange")}}return}this.updateMediaUpdateTimeout_(Ap(t,true));if(!s){return}this.state="SWITCHING_MEDIA";if(this.request){if(t.resolvedUri===this.request.url){return}this.request.onreadystatechange=null;this.request.abort();this.request=null}if(this.media_){this.trigger("mediachanging")}this.pendingMedia_=t;const r={playlistInfo:{type:"media",uri:t.uri}};this.trigger({type:"playlistrequeststart",metadata:r});this.request=this.vhs_.xhr({uri:t.resolvedUri,withCredentials:this.withCredentials,requestType:"hls-playlist"},((e,s)=>{if(!this.request){return}t.lastRequest=Date.now();t.resolvedUri=md(t.resolvedUri,s);if(e){return this.playlistRequestError(this.request,t,i)}this.trigger({type:"playlistrequestcomplete",metadata:r});this.haveMetadata({playlistString:s.responseText,url:t.uri,id:t.id});if(i==="HAVE_MAIN_MANIFEST"){this.trigger("loadedmetadata")}else{this.trigger("mediachange")}}))}pause(){if(this.mediaUpdateTimeout){z.clearTimeout(this.mediaUpdateTimeout);this.mediaUpdateTimeout=null}this.stopRequest();if(this.state==="HAVE_NOTHING"){this.started=false}if(this.state==="SWITCHING_MEDIA"){if(this.media_){this.state="HAVE_METADATA"}else{this.state="HAVE_MAIN_MANIFEST"}}else if(this.state==="HAVE_CURRENT_METADATA"){this.state="HAVE_METADATA"}}load(t){if(this.mediaUpdateTimeout){z.clearTimeout(this.mediaUpdateTimeout);this.mediaUpdateTimeout=null}const e=this.media();if(t){const t=e?(e.partTargetDuration||e.targetDuration)/2*1e3:5*1e3;this.mediaUpdateTimeout=z.setTimeout((()=>{this.mediaUpdateTimeout=null;this.load()}),t);return}if(!this.started){this.start();return}if(e&&!e.endList){this.trigger("mediaupdatetimeout")}else{this.trigger("loadedplaylist")}}updateMediaUpdateTimeout_(t){if(this.mediaUpdateTimeout){z.clearTimeout(this.mediaUpdateTimeout);this.mediaUpdateTimeout=null}if(!this.media()||this.media().endList){return}this.mediaUpdateTimeout=z.setTimeout((()=>{this.mediaUpdateTimeout=null;this.trigger("mediaupdatetimeout");this.updateMediaUpdateTimeout_(t)}),t)}start(){this.started=true;if(typeof this.src==="object"){if(!this.src.uri){this.src.uri=z.location.href}this.src.resolvedUri=this.src.uri;setTimeout((()=>{this.setupInitialPlaylist(this.src)}),0);return}const t={playlistInfo:{type:"multivariant",uri:this.src}};this.trigger({type:"playlistrequeststart",metadata:t});this.request=this.vhs_.xhr({uri:this.src,withCredentials:this.withCredentials,requestType:"hls-playlist"},((e,i)=>{if(!this.request){return}this.request=null;if(e){this.error={status:i.status,message:`HLS playlist request error at URL: ${this.src}.`,responseText:i.responseText,code:2,metadata:gp({requestType:i.requestType,request:i,error:e})};if(this.state==="HAVE_NOTHING"){this.started=false}return this.trigger("error")}this.trigger({type:"playlistrequestcomplete",metadata:t});this.src=md(this.src,i);this.trigger({type:"playlistparsestart",metadata:t});const s=this.parseManifest_({manifestString:i.responseText,url:this.src});t.parsedPlaylist=Ep(s.playlists,t.playlistInfo.type,false);this.trigger({type:"playlistparsecomplete",metadata:t});this.setupInitialPlaylist(s)}))}srcUri(){return typeof this.src==="string"?this.src:this.src.uri}setupInitialPlaylist(t){this.state="HAVE_MAIN_MANIFEST";if(t.playlists){this.main=t;pp(this.main,this.srcUri());t.playlists.forEach((t=>{t.segments=kp(t);t.segments.forEach((e=>{Tp(e,t.resolvedUri)}))}));this.trigger("loadedplaylist");if(!this.request){this.media(this.main.playlists[0])}return}const e=this.srcUri()||z.location.href;this.main=dp(t,e);this.haveMetadata({playlistObject:t,url:e,id:this.main.playlists[0].id});this.trigger("loadedmetadata")}updateOrDeleteClone(t,e){const i=this.main;const s=t.ID;let n=i.playlists.length;while(n--){const r=i.playlists[n];if(r.attributes["PATHWAY-ID"]===s){const o=r.resolvedUri;const a=r.id;if(e){const e=this.createCloneURI_(r.resolvedUri,t);const o=op(s,e);const a=this.createCloneAttributes_(s,r.attributes);const h=this.createClonePlaylist_(r,o,t,a);i.playlists[n]=h;i.playlists[o]=h;i.playlists[e]=h}else{i.playlists.splice(n,1)}delete i.playlists[a];delete i.playlists[o]}}this.updateOrDeleteCloneMedia(t,e)}updateOrDeleteCloneMedia(t,e){const i=this.main;const s=t.ID;["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach((t=>{if(!i.mediaGroups[t]||!i.mediaGroups[t][s]){return}for(const e in i.mediaGroups[t]){if(e===s){for(const s in i.mediaGroups[t][e]){const n=i.mediaGroups[t][e][s];n.playlists.forEach(((t,e)=>{const s=i.playlists[t.id];const n=s.id;const r=s.resolvedUri;delete i.playlists[n];delete i.playlists[r]}))}delete i.mediaGroups[t][e]}}}));if(e){this.createClonedMediaGroups_(t)}}addClonePathway(t,e={}){const i=this.main;const s=i.playlists.length;const n=this.createCloneURI_(e.resolvedUri,t);const r=op(t.ID,n);const o=this.createCloneAttributes_(t.ID,e.attributes);const a=this.createClonePlaylist_(e,r,t,o);i.playlists[s]=a;i.playlists[r]=a;i.playlists[n]=a;this.createClonedMediaGroups_(t)}createClonedMediaGroups_(t){const e=t.ID;const i=t["BASE-ID"];const s=this.main;["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach((n=>{if(!s.mediaGroups[n]||s.mediaGroups[n][e]){return}for(const r in s.mediaGroups[n]){if(r===i){s.mediaGroups[n][e]={}}else{continue}for(const i in s.mediaGroups[n][r]){const o=s.mediaGroups[n][r][i];s.mediaGroups[n][e][i]=it({},o);const a=s.mediaGroups[n][e][i];const h=this.createCloneURI_(o.resolvedUri,t);a.resolvedUri=h;a.uri=h;a.playlists=[];o.playlists.forEach(((r,o)=>{const h=s.playlists[r.id];const c=ap(n,e,i);const l=op(e,c);if(h&&!s.playlists[l]){const e=this.createClonePlaylist_(h,l,t);const i=e.resolvedUri;s.playlists[l]=e;s.playlists[i]=e}a.playlists[o]=this.createClonePlaylist_(r,l,t)}))}}}))}createClonePlaylist_(t,e,i,s){const n=this.createCloneURI_(t.resolvedUri,i);const r={resolvedUri:n,uri:n,id:e};if(t.segments){r.segments=[]}if(s){r.attributes=s}return bd(t,r)}createCloneURI_(t,e){const i=new URL(t);i.hostname=e["URI-REPLACEMENT"].HOST;const s=e["URI-REPLACEMENT"].PARAMS;for(const t of Object.keys(s)){i.searchParams.set(t,s[t])}return i.href}createCloneAttributes_(t,e){const i={["PATHWAY-ID"]:t};["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach((s=>{if(e[s]){i[s]=t}}));return i}getKeyIdSet(t){if(t.contentProtection){const e=new Set;for(const i in t.contentProtection){const s=t.contentProtection[i].attributes.keyId;if(s){e.add(s.toLowerCase())}}return e}}}const Dp=function(t,e,i,s){const n=t.responseType==="arraybuffer"?t.response:t.responseText;if(!e&&n){t.responseTime=Date.now();t.roundTripTime=t.responseTime-t.requestTime;t.bytesReceived=n.byteLength||n.length;if(!t.bandwidth){t.bandwidth=Math.floor(t.bytesReceived/t.roundTripTime*8*1e3)}}if(i.headers){t.responseHeaders=i.headers}if(e&&e.code==="ETIMEDOUT"){t.timedout=true}if(!e&&!t.aborted&&i.statusCode!==200&&i.statusCode!==206&&i.statusCode!==0){e=new Error("XHR Failed with a response of: "+(t&&(n||t.responseText)))}s(e,t)};const Cp=(t,e)=>{if(!t||!t.size){return}let i=e;t.forEach((t=>{i=t(i)}));return i};const Np=(t,e,i,s)=>{if(!t||!t.size){return}t.forEach((t=>{t(e,i,s)}))};const _p=function(){const t=function t(e,i){e=bd({timeout:45e3},e);const s=t.beforeRequest||cd.Vhs.xhr.beforeRequest;const n=t._requestCallbackSet||cd.Vhs.xhr._requestCallbackSet||new Set;const r=t._responseCallbackSet||cd.Vhs.xhr._responseCallbackSet;if(s&&typeof s==="function"){cd.log.warn("beforeRequest is deprecated, use onRequest instead.");n.add(s)}const o=cd.Vhs.xhr.original===true?cd.xhr:cd.Vhs.xhr;const a=Cp(n,e);n.delete(s);const h=o(a||e,(function(t,e){Np(r,h,t,e);return Dp(h,t,e,i)}));const c=h.abort;h.abort=function(){h.aborted=true;return c.apply(h,arguments)};h.uri=e.uri;h.requestType=e.requestType;h.requestTime=Date.now();return h};t.original=true;return t};const Op=function(t){let e;const i=t.offset;if(typeof t.offset==="bigint"||typeof t.length==="bigint"){e=z.BigInt(t.offset)+z.BigInt(t.length)-z.BigInt(1)}else{e=t.offset+t.length-1}return"bytes="+i+"-"+e};const Mp=function(t){const e={};if(t.byterange){e.Range=Op(t.byterange)}return e};const Rp=function(t,e){return t.start(e)+"-"+t.end(e)};const Lp=function(t,e){const i=t.toString(16);return"00".substring(0,2-i.length)+i+(e%2?" ":"")};const Pp=function(t){if(t>=32&&t<126){return String.fromCharCode(t)}return"."};const $p=function(t){const e={};Object.keys(t).forEach((i=>{const s=t[i];if(oi(s)){e[i]={bytes:s.buffer,byteOffset:s.byteOffset,byteLength:s.byteLength}}else{e[i]=s}}));return e};const Fp=function(t){const e=t.byterange||{length:Infinity,offset:0};return[e.length,e.offset,t.resolvedUri].join(",")};const Up=function(t){return t.resolvedUri};const Bp=t=>{const e=Array.prototype.slice.call(t);const i=16;let s="";let n;let r;for(let t=0;t<e.length/i;t++){n=e.slice(t*i,t*i+i).map(Lp).join("");r=e.slice(t*i,t*i+i).map(Pp).join("");s+=n+" "+r+"\n"}return s};const qp=({bytes:t})=>Bp(t);const Vp=t=>{let e="";let i;for(i=0;i<t.length;i++){e+=Rp(t,i)+" "}return e};var zp=Object.freeze({__proto__:null,createTransferableMessage:$p,initSegmentId:Fp,segmentKeyId:Up,hexDump:Bp,tagDump:qp,textRanges:Vp});const Hp=.25;const Xp=(t,e)=>{if(!e.dateTimeObject){return null}const i=e.videoTimingInfo.transmuxerPrependedSeconds;const s=e.videoTimingInfo.transmuxedPresentationStart;const n=s+i;const r=t-n;return new Date(e.dateTimeObject.getTime()+r*1e3)};const Gp=t=>t.transmuxedPresentationEnd-t.transmuxedPresentationStart-t.transmuxerPrependedSeconds;const Yp=(t,e)=>{let i;try{i=new Date(t)}catch(t){return null}if(!e||!e.segments||e.segments.length===0){return null}let s=e.segments[0];if(i<new Date(s.dateTimeObject)){return null}for(let t=0;t<e.segments.length-1;t++){s=e.segments[t];const n=new Date(e.segments[t+1].dateTimeObject);if(i<n){break}}const n=e.segments[e.segments.length-1];const r=n.dateTimeObject;const o=n.videoTimingInfo?Gp(n.videoTimingInfo):n.duration+n.duration*Hp;const a=new Date(r.getTime()+o*1e3);if(i>a){return null}if(i>new Date(r)){s=n}return{segment:s,estimatedStart:s.videoTimingInfo?s.videoTimingInfo.transmuxedPresentationStart:np.duration(e,e.mediaSequence+e.segments.indexOf(s)),type:s.videoTimingInfo?"accurate":"estimate"}};const Wp=(t,e)=>{if(!e||!e.segments||e.segments.length===0){return null}let i=0;let s;for(let n=0;n<e.segments.length;n++){s=e.segments[n];i=s.videoTimingInfo?s.videoTimingInfo.transmuxedPresentationEnd:i+s.duration;if(t<=i){break}}const n=e.segments[e.segments.length-1];if(n.videoTimingInfo&&n.videoTimingInfo.transmuxedPresentationEnd<t){return null}if(t>i){if(t>i+n.duration*Hp){return null}s=n}return{segment:s,estimatedStart:s.videoTimingInfo?s.videoTimingInfo.transmuxedPresentationStart:i-s.duration,type:s.videoTimingInfo?"accurate":"estimate"}};const Jp=(t,e)=>{let i;let s;try{i=new Date(t);s=new Date(e)}catch(t){}const n=i.getTime();const r=s.getTime();return(r-n)/1e3};const Kp=t=>{if(!t.segments||t.segments.length===0){return false}for(let e=0;e<t.segments.length;e++){const i=t.segments[e];if(!i.dateTimeObject){return false}}return true};const Qp=({playlist:t,time:e=undefined,callback:i})=>{if(!i){throw new Error("getProgramTime: callback must be provided")}if(!t||e===undefined){return i({message:"getProgramTime: playlist and time must be provided"})}const s=Wp(e,t);if(!s){return i({message:"valid programTime was not found"})}if(s.type==="estimate"){return i({message:"Accurate programTime could not be determined."+" Please seek to e.seekTime and try again",seekTime:s.estimatedStart})}const n={mediaSeconds:e};const r=Xp(e,s.segment);if(r){n.programDateTime=r.toISOString()}return i(null,n)};const Zp=({programTime:t,playlist:e,retryCount:i=2,seekTo:s,pauseAfterSeek:n=true,tech:r,callback:o})=>{if(!o){throw new Error("seekToProgramTime: callback must be provided")}if(typeof t==="undefined"||!e||!s){return o({message:"seekToProgramTime: programTime, seekTo and playlist must be provided"})}if(!e.endList&&!r.hasStarted_){return o({message:"player must be playing a live stream to start buffering"})}if(!Kp(e)){return o({message:"programDateTime tags must be provided in the manifest "+e.resolvedUri})}const a=Yp(t,e);if(!a){return o({message:`${t} was not found in the stream`})}const h=a.segment;const c=Jp(h.dateTimeObject,t);if(a.type==="estimate"){if(i===0){return o({message:`${t} is not buffered yet. Try again`})}s(a.estimatedStart+c);r.one("seeked",(()=>{Zp({programTime:t,playlist:e,retryCount:i-1,seekTo:s,pauseAfterSeek:n,tech:r,callback:o})}));return}const l=h.start+c;const u=()=>o(null,r.currentTime());r.one("seeked",u);if(n){r.pause()}s(l)};const tv=(t,e)=>{if(t.readyState===4){return e()}return};const ev=(t,e,i,s)=>{let n=[];let r;let o=false;const a=function(t,e,s,n){e.abort();o=true;return i(t,e,s,n)};const h=function(t,e){if(o){return}if(t){t.metadata=gp({requestType:s,request:e,error:t});return a(t,e,"",n)}const i=e.responseText.substring(n&&n.byteLength||0,e.responseText.length);n=pi(n,di(i,true));r=r||go(n);if(n.length<10||r&&n.length<r+2){return tv(e,(()=>a(t,e,"",n)))}const h=Uo(n);if(h==="ts"&&n.length<188){return tv(e,(()=>a(t,e,"",n)))}if(!h&&n.length<376){return tv(e,(()=>a(t,e,"",n)))}return a(null,e,h,n)};const c={uri:t,beforeSend(t){t.overrideMimeType("text/plain; charset=x-user-defined");t.addEventListener("progress",(function({total:e,loaded:i}){return Dp(t,null,{statusCode:t.status},h)}))}};const l=e(c,(function(t,e){return Dp(l,t,e,h)}));return l};const{EventTarget:iv}=cd;const sv=function(t,e){if(!Sp(t,e)){return false}if(t.sidx&&e.sidx&&(t.sidx.offset!==e.sidx.offset||t.sidx.length!==e.sidx.length)){return false}else if(!t.sidx&&e.sidx||t.sidx&&!e.sidx){return false}if(t.segments&&!e.segments||!t.segments&&e.segments){return false}if(!t.segments&&!e.segments){return true}for(let i=0;i<t.segments.length;i++){const s=t.segments[i];const n=e.segments[i];if(s.uri!==n.uri){return false}if(!s.byterange&&!n.byterange){continue}const r=s.byterange;const o=n.byterange;if(r&&!o||!r&&o){return false}if(r.offset!==o.offset||r.length!==o.length){return false}}return true};const nv=(t,e,i,s)=>{const n=s.attributes.NAME||i;return`placeholder-uri-${t}-${e}-${n}`};const rv=({mainXml:t,srcUrl:e,clientOffset:i,sidxMapping:s,previousManifest:n})=>{const r=oo(t,{manifestUri:e,clientOffset:i,sidxMapping:s,previousManifest:n});pp(r,e,nv);return r};const ov=(t,e)=>{cp(t,((i,s,n,r)=>{if(!(r in e.mediaGroups[s][n])){delete t.mediaGroups[s][n][r]}}))};const av=(t,e,i)=>{let s=true;let n=bd(t,{duration:e.duration,minimumUpdatePeriod:e.minimumUpdatePeriod,timelineStarts:e.timelineStarts});for(let t=0;t<e.playlists.length;t++){const r=e.playlists[t];if(r.sidx){const t=fr(r.sidx);if(i&&i[t]&&i[t].sidx){sr(r,i[t].sidx,r.sidx.resolvedUri)}}const o=xp(n,r,sv);if(o){n=o;s=false}}cp(e,((t,e,i,r)=>{if(t.playlists&&t.playlists.length){const o=t.playlists[0].id;const a=xp(n,t.playlists[0],sv);if(a){n=a;if(!(r in n.mediaGroups[e][i])){n.mediaGroups[e][i][r]=t}n.mediaGroups[e][i][r].playlists[0]=n.playlists[o];s=false}}}));ov(n,e);if(e.minimumUpdatePeriod!==t.minimumUpdatePeriod){s=false}if(s){return null}return n};const hv=(t,e)=>{const i=Boolean(!t.map&&!e.map);const s=i||Boolean(t.map&&e.map&&t.map.byterange.offset===e.map.byterange.offset&&t.map.byterange.length===e.map.byterange.length);return s&&t.uri===e.uri&&t.byterange.offset===e.byterange.offset&&t.byterange.length===e.byterange.length};const cv=(t,e)=>{const i={};for(const s in t){const n=t[s];const r=n.sidx;if(r){const t=fr(r);if(!e[t]){break}const s=e[t].sidxInfo;if(hv(s,r)){i[t]=e[t]}}}return i};const lv=(t,e)=>{const i=cv(t.playlists,e);let s=i;cp(t,((t,i,n,r)=>{if(t.playlists&&t.playlists.length){const i=t.playlists;s=bd(s,cv(i,e))}}));return s};class uv extends iv{constructor(t,e,i={},s){super();this.mainPlaylistLoader_=s||this;if(!s){this.isMain_=true}const{withCredentials:n=false}=i;this.vhs_=e;this.withCredentials=n;this.addMetadataToTextTrack=i.addMetadataToTextTrack;if(!t){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_=gd("DashPlaylistLoader");if(this.isMain_){this.mainPlaylistLoader_.srcUrl=t;this.mainPlaylistLoader_.sidxMapping_={}}else{this.childPlaylist_=t}}requestErrored_(t,e,i){if(!this.request){return true}this.request=null;if(t){this.error=typeof t==="object"&&!(t instanceof Error)?t:{status:e.status,message:"DASH request error at URL: "+e.uri,response:e.response,code:2,metadata:t.metadata};if(i){this.state=i}this.trigger("error");return true}}addSidxSegments_(t,e,i){const s=t.sidx&&fr(t.sidx);if(!t.sidx||!s||this.mainPlaylistLoader_.sidxMapping_[s]){this.mediaRequest_=z.setTimeout((()=>i(false)),0);return}const n=md(t.sidx.resolvedUri);const r=(n,r)=>{if(this.requestErrored_(n,r,e)){return}const o=this.mainPlaylistLoader_.sidxMapping_;const{requestType:a}=r;let h;try{h=po(hi(r.response).subarray(8))}catch(t){t.metadata=gp({requestType:a,request:r,parseFailure:true});this.requestErrored_(t,r,e);return}o[s]={sidxInfo:t.sidx,sidx:h};sr(t,h,t.sidx.resolvedUri);return i(true)};const o="dash-sidx";this.request=ev(n,this.vhs_.xhr,((e,i,s,o)=>{if(e){return r(e,i)}if(!s||s!=="mp4"){const e=s||"unknown";return r({status:i.status,message:`Unsupported ${e} container type for sidx segment at URL: ${n}`,response:"",playlist:t,internal:true,playlistExclusionDuration:Infinity,code:2},i)}const{offset:a,length:h}=t.sidx.byterange;if(o.length>=h+a){return r(e,{response:o.subarray(a,a+h),status:i.status,uri:i.uri})}this.request=this.vhs_.xhr({uri:n,responseType:"arraybuffer",requestType:"dash-sidx",headers:Mp({byterange:t.sidx.byterange})},r)}),o)}dispose(){this.trigger("dispose");this.stopRequest();this.loadedPlaylists_={};z.clearTimeout(this.minimumUpdatePeriodTimeout_);z.clearTimeout(this.mediaRequest_);z.clearTimeout(this.mediaUpdateTimeout);this.mediaUpdateTimeout=null;this.mediaRequest_=null;this.minimumUpdatePeriodTimeout_=null;if(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 t=this.request;this.request=null;t.onreadystatechange=null;t.abort()}}media(t){if(!t){return this.media_}if(this.state==="HAVE_NOTHING"){throw new Error("Cannot switch media playlist from "+this.state)}const e=this.state;if(typeof t==="string"){if(!this.mainPlaylistLoader_.main.playlists[t]){throw new Error("Unknown playlist URI: "+t)}t=this.mainPlaylistLoader_.main.playlists[t]}const i=!this.media_||t.id!==this.media_.id;if(i&&this.loadedPlaylists_[t.id]&&this.loadedPlaylists_[t.id].endList){this.state="HAVE_METADATA";this.media_=t;if(i){this.trigger("mediachanging");this.trigger("mediachange")}return}if(!i){return}if(this.media_){this.trigger("mediachanging")}this.addSidxSegments_(t,e,(i=>{this.haveMetadata({startingState:e,playlist:t})}))}haveMetadata({startingState:t,playlist:e}){this.state="HAVE_METADATA";this.loadedPlaylists_[e.id]=e;this.mediaRequest_=null;this.refreshMedia_(e.id);if(t==="HAVE_MAIN_MANIFEST"){this.trigger("loadedmetadata")}else{this.trigger("mediachange")}}pause(){if(this.mainPlaylistLoader_.createMupOnMedia_){this.off("loadedmetadata",this.mainPlaylistLoader_.createMupOnMedia_);this.mainPlaylistLoader_.createMupOnMedia_=null}this.stopRequest();z.clearTimeout(this.mediaUpdateTimeout);this.mediaUpdateTimeout=null;if(this.isMain_){z.clearTimeout(this.mainPlaylistLoader_.minimumUpdatePeriodTimeout_);this.mainPlaylistLoader_.minimumUpdatePeriodTimeout_=null}if(this.state==="HAVE_NOTHING"){this.started=false}}load(t){z.clearTimeout(this.mediaUpdateTimeout);this.mediaUpdateTimeout=null;const e=this.media();if(t){const t=e?e.targetDuration/2*1e3:5*1e3;this.mediaUpdateTimeout=z.setTimeout((()=>this.load()),t);return}if(!this.started){this.start();return}if(e&&!e.endList){if(this.isMain_&&!this.minimumUpdatePeriodTimeout_){this.trigger("minimumUpdatePeriod");this.updateMinimumUpdatePeriodTimeout_()}this.trigger("mediaupdatetimeout")}else{this.trigger("loadedplaylist")}}start(){this.started=true;if(!this.isMain_){this.mediaRequest_=z.setTimeout((()=>this.haveMain_()),0);return}this.requestMain_(((t,e)=>{this.haveMain_();if(!this.hasPendingRequest()&&!this.media_){this.media(this.mainPlaylistLoader_.main.playlists[0])}}))}requestMain_(t){const e={manifestInfo:{uri:this.mainPlaylistLoader_.srcUrl}};this.trigger({type:"manifestrequeststart",metadata:e});this.request=this.vhs_.xhr({uri:this.mainPlaylistLoader_.srcUrl,withCredentials:this.withCredentials,requestType:"dash-manifest"},((i,s)=>{if(i){const{requestType:t}=s;i.metadata=gp({requestType:t,request:s,error:i})}if(this.requestErrored_(i,s)){if(this.state==="HAVE_NOTHING"){this.started=false}return}this.trigger({type:"manifestrequestcomplete",metadata:e});const n=s.responseText!==this.mainPlaylistLoader_.mainXml_;this.mainPlaylistLoader_.mainXml_=s.responseText;if(s.responseHeaders&&s.responseHeaders.date){this.mainLoaded_=Date.parse(s.responseHeaders.date)}else{this.mainLoaded_=Date.now()}this.mainPlaylistLoader_.srcUrl=md(this.mainPlaylistLoader_.srcUrl,s);if(n){this.handleMain_();this.syncClientServerClock_((()=>t(s,n)));return}return t(s,n)}))}syncClientServerClock_(t){const e=ao(this.mainPlaylistLoader_.mainXml_);if(e===null){this.mainPlaylistLoader_.clientOffset_=this.mainLoaded_-Date.now();return t()}if(e.method==="DIRECT"){this.mainPlaylistLoader_.clientOffset_=e.value-Date.now();return t()}this.request=this.vhs_.xhr({uri:vd(this.mainPlaylistLoader_.srcUrl,e.value),method:e.method,withCredentials:this.withCredentials,requestType:"dash-clock-sync"},((i,s)=>{if(!this.request){return}if(i){const{requestType:e}=s;this.error.metadata=gp({requestType:e,request:s,error:i});this.mainPlaylistLoader_.clientOffset_=this.mainLoaded_-Date.now();return t()}let n;if(e.method==="HEAD"){if(!s.responseHeaders||!s.responseHeaders.date){n=this.mainLoaded_}else{n=Date.parse(s.responseHeaders.date)}}else{n=Date.parse(s.responseText)}this.mainPlaylistLoader_.clientOffset_=n-Date.now();t()}))}haveMain_(){this.state="HAVE_MAIN_MANIFEST";if(this.isMain_){this.trigger("loadedplaylist")}else if(!this.media_){this.media(this.childPlaylist_)}}handleMain_(){this.mediaRequest_=null;const t=this.mainPlaylistLoader_.main;const e={manifestInfo:{uri:this.mainPlaylistLoader_.srcUrl}};this.trigger({type:"manifestparsestart",metadata:e});let i;try{i=rv({mainXml:this.mainPlaylistLoader_.mainXml_,srcUrl:this.mainPlaylistLoader_.srcUrl,clientOffset:this.mainPlaylistLoader_.clientOffset_,sidxMapping:this.mainPlaylistLoader_.sidxMapping_,previousManifest:t})}catch(t){this.error=t;this.error.metadata={errorType:cd.Error.StreamingDashManifestParserError,error:t};this.trigger("error")}if(t){i=av(t,i,this.mainPlaylistLoader_.sidxMapping_)}this.mainPlaylistLoader_.main=i?i:t;const s=this.mainPlaylistLoader_.main.locations&&this.mainPlaylistLoader_.main.locations[0];if(s&&s!==this.mainPlaylistLoader_.srcUrl){this.mainPlaylistLoader_.srcUrl=s}if(!t||i&&i.minimumUpdatePeriod!==t.minimumUpdatePeriod){this.updateMinimumUpdatePeriodTimeout_()}this.addEventStreamToMetadataTrack_(i);if(i){const{duration:t,endList:s}=i;const n=[];i.playlists.forEach((t=>{n.push({id:t.id,bandwidth:t.attributes.BANDWIDTH,resolution:t.attributes.RESOLUTION,codecs:t.attributes.CODECS})}));const r={duration:t,isLive:!s,renditions:n};e.parsedManifest=r;this.trigger({type:"manifestparsecomplete",metadata:e})}return Boolean(i)}updateMinimumUpdatePeriodTimeout_(){const t=this.mainPlaylistLoader_;if(t.createMupOnMedia_){t.off("loadedmetadata",t.createMupOnMedia_);t.createMupOnMedia_=null}if(t.minimumUpdatePeriodTimeout_){z.clearTimeout(t.minimumUpdatePeriodTimeout_);t.minimumUpdatePeriodTimeout_=null}let e=t.main&&t.main.minimumUpdatePeriod;if(e===0){if(t.media()){e=t.media().targetDuration*1e3}else{t.createMupOnMedia_=t.updateMinimumUpdatePeriodTimeout_;t.one("loadedmetadata",t.createMupOnMedia_)}}if(typeof e!=="number"||e<=0){if(e<0){this.logger_(`found invalid minimumUpdatePeriod of ${e}, not setting a timeout`)}return}this.createMUPTimeout_(e)}createMUPTimeout_(t){const e=this.mainPlaylistLoader_;e.minimumUpdatePeriodTimeout_=z.setTimeout((()=>{e.minimumUpdatePeriodTimeout_=null;e.trigger("minimumUpdatePeriod");e.createMUPTimeout_(t)}),t)}refreshXml_(){this.requestMain_(((t,e)=>{if(!e){return}if(this.media_){this.media_=this.mainPlaylistLoader_.main.playlists[this.media_.id]}this.mainPlaylistLoader_.sidxMapping_=lv(this.mainPlaylistLoader_.main,this.mainPlaylistLoader_.sidxMapping_);this.addSidxSegments_(this.media(),this.state,(t=>{this.refreshMedia_(this.media().id)}))}))}refreshMedia_(t){if(!t){throw new Error("refreshMedia_ must take a media id")}if(this.media_&&this.isMain_){this.handleMain_()}const e=this.mainPlaylistLoader_.main.playlists;const i=!this.media_||this.media_!==e[t];if(i){this.media_=e[t]}else{this.trigger("playlistunchanged")}if(!this.mediaUpdateTimeout){const t=()=>{if(this.media().endList){return}this.mediaUpdateTimeout=z.setTimeout((()=>{this.trigger("mediaupdatetimeout");t()}),Ap(this.media(),Boolean(i)))};t()}this.trigger("loadedplaylist")}addEventStreamToMetadataTrack_(t){if(t&&this.mainPlaylistLoader_.main.eventStream){const t=this.mainPlaylistLoader_.main.eventStream.map((t=>({cueTime:t.start,frames:[{data:t.messageData}]})));this.addMetadataToTextTrack("EventStream",t,this.mainPlaylistLoader_.main.duration)}}getKeyIdSet(t){if(t.contentProtection){const e=new Set;for(const i in t.contentProtection){const s=t.contentProtection[i].attributes["cenc:default_KID"];if(s){e.add(s.replace(/-/g,"").toLowerCase())}}return e}}}var fv={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 dv=t=>{const e=new Uint8Array(new ArrayBuffer(t.length));for(let i=0;i<t.length;i++){e[i]=t.charCodeAt(i)}return e.buffer};const pv=function(t){t.on=t.addEventListener;t.off=t.removeEventListener;return t};const vv=function(t){try{return URL.createObjectURL(new Blob([t],{type:"application/javascript"}))}catch(e){const i=new BlobBuilder;i.append(t);return URL.createObjectURL(i.getBlob())}};const mv=function(t){return function(){const e=vv(t);const i=pv(new Worker(e));i.objURL=e;const s=i.terminate;i.on=i.addEventListener;i.off=i.removeEventListener;i.terminate=function(){URL.revokeObjectURL(e);return s.call(this)};return i}};const gv=function(t){return`var browserWorkerPolyFill = ${pv.toString()};\n`+"browserWorkerPolyFill(self);\n"+t};const bv=function(t){return t.toString().replace(/^function.+?{/,"").slice(0,-1)};const yv=gv(bv((function(){var t=typeof globalThis!=="undefined"?globalThis:typeof window!=="undefined"?window:typeof global!=="undefined"?global:typeof self!=="undefined"?self:{};var e=function(){this.init=function(){var t={};this.on=function(e,i){if(!t[e]){t[e]=[]}t[e]=t[e].concat(i)};this.off=function(e,i){var s;if(!t[e]){return false}s=t[e].indexOf(i);t[e]=t[e].slice();t[e].splice(s,1);return s>-1};this.trigger=function(e){var i,s,n,r;i=t[e];if(!i){return}if(arguments.length===2){n=i.length;for(s=0;s<n;++s){i[s].call(this,arguments[1])}}else{r=[];s=arguments.length;for(s=1;s<arguments.length;++s){r.push(arguments[s])}n=i.length;for(s=0;s<n;++s){i[s].apply(this,r)}}};this.dispose=function(){t={}}}};e.prototype.pipe=function(t){this.on("data",(function(e){t.push(e)}));this.on("done",(function(e){t.flush(e)}));this.on("partialdone",(function(e){t.partialFlush(e)}));this.on("endedtimeline",(function(e){t.endTimeline(e)}));this.on("reset",(function(e){t.reset(e)}));return t};e.prototype.push=function(t){this.trigger("data",t)};e.prototype.flush=function(t){this.trigger("done",t)};e.prototype.partialFlush=function(t){this.trigger("partialdone",t)};e.prototype.endTimeline=function(t){this.trigger("endedtimeline",t)};e.prototype.reset=function(t){this.trigger("reset",t)};var i=e;var s=Math.pow(2,32);var n=function(t){var e=new DataView(t.buffer,t.byteOffset,t.byteLength);var i;if(e.getBigUint64){i=e.getBigUint64(0);if(i<Number.MAX_SAFE_INTEGER){return Number(i)}return i}return e.getUint32(0)*s+e.getUint32(4)};var r={getUint64:n,MAX_UINT32:s};var o=r.MAX_UINT32;var a,h,c,l,u,f,d,p,v,m,g,b,y,j,w,T,k,S,x,A,E,I,D,C,N,_,O,M,R,L,P,$,F,U,B,q;(function(){var t;D={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:[]};if(typeof Uint8Array==="undefined"){return}for(t in D){if(D.hasOwnProperty(t)){D[t]=[t.charCodeAt(0),t.charCodeAt(1),t.charCodeAt(2),t.charCodeAt(3)]}}C=new Uint8Array(["i".charCodeAt(0),"s".charCodeAt(0),"o".charCodeAt(0),"m".charCodeAt(0)]);_=new Uint8Array(["a".charCodeAt(0),"v".charCodeAt(0),"c".charCodeAt(0),"1".charCodeAt(0)]);N=new Uint8Array([0,0,0,1]);O=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]);M=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]);R={video:O,audio:M};$=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]);P=new Uint8Array([0,0,0,0,0,0,0,0]);F=new Uint8Array([0,0,0,0,0,0,0,0]);U=F;B=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]);q=F;L=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0])})();a=function(t){var e=[],i=0,s,n,r;for(s=1;s<arguments.length;s++){e.push(arguments[s])}s=e.length;while(s--){i+=e[s].byteLength}n=new Uint8Array(i+8);r=new DataView(n.buffer,n.byteOffset,n.byteLength);r.setUint32(0,n.byteLength);n.set(t,4);for(s=0,i=8;s<e.length;s++){n.set(e[s],i);i+=e[s].byteLength}return n};h=function(){return a(D.dinf,a(D.dref,$))};c=function(t){return a(D.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,t.audioobjecttype<<3|t.samplingfrequencyindex>>>1,t.samplingfrequencyindex<<7|t.channelcount<<3,6,1,2]))};l=function(){return a(D.ftyp,C,N,C,_)};T=function(t){return a(D.hdlr,R[t])};u=function(t){return a(D.mdat,t)};w=function(t){var e=new Uint8Array([0,0,0,0,0,0,0,2,0,0,0,3,0,1,95,144,t.duration>>>24&255,t.duration>>>16&255,t.duration>>>8&255,t.duration&255,85,196,0,0]);if(t.samplerate){e[12]=t.samplerate>>>24&255;e[13]=t.samplerate>>>16&255;e[14]=t.samplerate>>>8&255;e[15]=t.samplerate&255}return a(D.mdhd,e)};j=function(t){return a(D.mdia,w(t),T(t.type),d(t))};f=function(t){return a(D.mfhd,new Uint8Array([0,0,0,0,(t&4278190080)>>24,(t&16711680)>>16,(t&65280)>>8,t&255]))};d=function(t){return a(D.minf,t.type==="video"?a(D.vmhd,L):a(D.smhd,P),h(),S(t))};p=function(t,e){var i=[],s=e.length;while(s--){i[s]=A(e[s])}return a.apply(null,[D.moof,f(t)].concat(i))};v=function(t){var e=t.length,i=[];while(e--){i[e]=b(t[e])}return a.apply(null,[D.moov,g(4294967295)].concat(i).concat(m(t)))};m=function(t){var e=t.length,i=[];while(e--){i[e]=E(t[e])}return a.apply(null,[D.mvex].concat(i))};g=function(t){var e=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,2,0,1,95,144,(t&4278190080)>>24,(t&16711680)>>16,(t&65280)>>8,t&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(D.mvhd,e)};k=function(t){var e=t.samples||[],i=new Uint8Array(4+e.length),s,n;for(n=0;n<e.length;n++){s=e[n].flags;i[n+4]=s.dependsOn<<4|s.isDependedOn<<2|s.hasRedundancy}return a(D.sdtp,i)};S=function(t){return a(D.stbl,x(t),a(D.stts,q),a(D.stsc,U),a(D.stsz,B),a(D.stco,F))};(function(){var t,e;x=function(i){return a(D.stsd,new Uint8Array([0,0,0,0,0,0,0,1]),i.type==="video"?t(i):e(i))};t=function(t){var e=t.sps||[],i=t.pps||[],s=[],n=[],r,o;for(r=0;r<e.length;r++){s.push((e[r].byteLength&65280)>>>8);s.push(e[r].byteLength&255);s=s.concat(Array.prototype.slice.call(e[r]))}for(r=0;r<i.length;r++){n.push((i[r].byteLength&65280)>>>8);n.push(i[r].byteLength&255);n=n.concat(Array.prototype.slice.call(i[r]))}o=[D.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(D.avcC,new Uint8Array([1,t.profileIdc,t.profileCompatibility,t.levelIdc,255].concat([e.length],s,[i.length],n))),a(D.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192]))];if(t.sarRatio){var h=t.sarRatio[0],c=t.sarRatio[1];o.push(a(D.pasp,new Uint8Array([(h&4278190080)>>24,(h&16711680)>>16,(h&65280)>>8,h&255,(c&4278190080)>>24,(c&16711680)>>16,(c&65280)>>8,c&255])))}return a.apply(null,o)};e=function(t){return a(D.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]),c(t))}})();y=function(t){var e=new Uint8Array([0,0,0,7,0,0,0,0,0,0,0,0,(t.id&4278190080)>>24,(t.id&16711680)>>16,(t.id&65280)>>8,t.id&255,0,0,0,0,(t.duration&4278190080)>>24,(t.duration&16711680)>>16,(t.duration&65280)>>8,t.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,(t.width&65280)>>8,t.width&255,0,0,(t.height&65280)>>8,t.height&255,0,0]);return a(D.tkhd,e)};A=function(t){var e,i,s,n,r,h,c;e=a(D.tfhd,new Uint8Array([0,0,0,58,(t.id&4278190080)>>24,(t.id&16711680)>>16,(t.id&65280)>>8,t.id&255,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0]));h=Math.floor(t.baseMediaDecodeTime/o);c=Math.floor(t.baseMediaDecodeTime%o);i=a(D.tfdt,new Uint8Array([1,0,0,0,h>>>24&255,h>>>16&255,h>>>8&255,h&255,c>>>24&255,c>>>16&255,c>>>8&255,c&255]));r=32+20+8+16+8+8;if(t.type==="audio"){s=I(t,r);return a(D.traf,e,i,s)}n=k(t);s=I(t,n.length+r);return a(D.traf,e,i,s,n)};b=function(t){t.duration=t.duration||4294967295;return a(D.trak,y(t),j(t))};E=function(t){var e=new Uint8Array([0,0,0,0,(t.id&4278190080)>>24,(t.id&16711680)>>16,(t.id&65280)>>8,t.id&255,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]);if(t.type!=="video"){e[e.length-1]=0}return a(D.trex,e)};(function(){var t,e,i;i=function(t,e){var i=0,s=0,n=0,r=0;if(t.length){if(t[0].duration!==undefined){i=1}if(t[0].size!==undefined){s=2}if(t[0].flags!==undefined){n=4}if(t[0].compositionTimeOffset!==undefined){r=8}}return[0,0,i|s|n|r,1,(t.length&4278190080)>>>24,(t.length&16711680)>>>16,(t.length&65280)>>>8,t.length&255,(e&4278190080)>>>24,(e&16711680)>>>16,(e&65280)>>>8,e&255]};e=function(t,e){var s,n,r,o,h,c;o=t.samples||[];e+=8+12+16*o.length;r=i(o,e);n=new Uint8Array(r.length+o.length*16);n.set(r);s=r.length;for(c=0;c<o.length;c++){h=o[c];n[s++]=(h.duration&4278190080)>>>24;n[s++]=(h.duration&16711680)>>>16;n[s++]=(h.duration&65280)>>>8;n[s++]=h.duration&255;n[s++]=(h.size&4278190080)>>>24;n[s++]=(h.size&16711680)>>>16;n[s++]=(h.size&65280)>>>8;n[s++]=h.size&255;n[s++]=h.flags.isLeading<<2|h.flags.dependsOn;n[s++]=h.flags.isDependedOn<<6|h.flags.hasRedundancy<<4|h.flags.paddingValue<<1|h.flags.isNonSyncSample;n[s++]=h.flags.degradationPriority&240<<8;n[s++]=h.flags.degradationPriority&15;n[s++]=(h.compositionTimeOffset&4278190080)>>>24;n[s++]=(h.compositionTimeOffset&16711680)>>>16;n[s++]=(h.compositionTimeOffset&65280)>>>8;n[s++]=h.compositionTimeOffset&255}return a(D.trun,n)};t=function(t,e){var s,n,r,o,h,c;o=t.samples||[];e+=8+12+8*o.length;r=i(o,e);s=new Uint8Array(r.length+o.length*8);s.set(r);n=r.length;for(c=0;c<o.length;c++){h=o[c];s[n++]=(h.duration&4278190080)>>>24;s[n++]=(h.duration&16711680)>>>16;s[n++]=(h.duration&65280)>>>8;s[n++]=h.duration&255;s[n++]=(h.size&4278190080)>>>24;s[n++]=(h.size&16711680)>>>16;s[n++]=(h.size&65280)>>>8;s[n++]=h.size&255}return a(D.trun,s)};I=function(i,s){if(i.type==="audio"){return t(i,s)}return e(i,s)}})();var V={ftyp:l,mdat:u,moof:p,moov:v,initSegment:function(t){var e=l(),i=v(t),s;s=new Uint8Array(e.byteLength+i.byteLength);s.set(e);s.set(i,e.byteLength);return s}};var z=function(t){var e,i,s=[],n=[];n.byteLength=0;n.nalCount=0;n.duration=0;s.byteLength=0;for(e=0;e<t.length;e++){i=t[e];if(i.nalUnitType==="access_unit_delimiter_rbsp"){if(s.length){s.duration=i.dts-s.dts;n.byteLength+=s.byteLength;n.nalCount+=s.length;n.duration+=s.duration;n.push(s)}s=[i];s.byteLength=i.data.byteLength;s.pts=i.pts;s.dts=i.dts}else{if(i.nalUnitType==="slice_layer_without_partitioning_rbsp_idr"){s.keyFrame=true}s.duration=i.dts-s.dts;s.byteLength+=i.data.byteLength;s.push(i)}}if(n.length&&(!s.duration||s.duration<=0)){s.duration=n[n.length-1].duration}n.byteLength+=s.byteLength;n.nalCount+=s.length;n.duration+=s.duration;n.push(s);return n};var H=function(t){var e,i,s=[],n=[];s.byteLength=0;s.nalCount=0;s.duration=0;s.pts=t[0].pts;s.dts=t[0].dts;n.byteLength=0;n.nalCount=0;n.duration=0;n.pts=t[0].pts;n.dts=t[0].dts;for(e=0;e<t.length;e++){i=t[e];if(i.keyFrame){if(s.length){n.push(s);n.byteLength+=s.byteLength;n.nalCount+=s.nalCount;n.duration+=s.duration}s=[i];s.nalCount=i.length;s.byteLength=i.byteLength;s.pts=i.pts;s.dts=i.dts;s.duration=i.duration}else{s.duration+=i.duration;s.nalCount+=i.length;s.byteLength+=i.byteLength;s.push(i)}}if(n.length&&s.duration<=0){s.duration=n[n.length-1].duration}n.byteLength+=s.byteLength;n.nalCount+=s.nalCount;n.duration+=s.duration;n.push(s);return n};var X=function(t){var e;if(!t[0][0].keyFrame&&t.length>1){e=t.shift();t.byteLength-=e.byteLength;t.nalCount-=e.nalCount;t[0][0].dts=e.dts;t[0][0].pts=e.pts;t[0][0].duration+=e.duration}return t};var G=function(){return{size:0,flags:{isLeading:0,dependsOn:1,isDependedOn:0,hasRedundancy:0,degradationPriority:0,isNonSyncSample:1}}};var Y=function(t,e){var i=G();i.dataOffset=e;i.compositionTimeOffset=t.pts-t.dts;i.duration=t.duration;i.size=4*t.length;i.size+=t.byteLength;if(t.keyFrame){i.flags.dependsOn=2;i.flags.isNonSyncSample=0}return i};var W=function(t,e){var i,s,n,r,o,a=e||0,h=[];for(i=0;i<t.length;i++){r=t[i];for(s=0;s<r.length;s++){o=r[s];n=Y(o,a);a+=n.size;h.push(n)}}return h};var J=function(t){var e,i,s,n,r,o,a=0,h=t.byteLength,c=t.nalCount,l=h+4*c,u=new Uint8Array(l),f=new DataView(u.buffer);for(e=0;e<t.length;e++){n=t[e];for(i=0;i<n.length;i++){r=n[i];for(s=0;s<r.length;s++){o=r[s];f.setUint32(a,o.data.byteLength);a+=4;u.set(o.data,a);a+=o.data.byteLength}}}return u};var K=function(t,e){var i,s=e||0,n=[];i=Y(t,s);n.push(i);return n};var Q=function(t){var e,i,s=0,n=t.byteLength,r=t.length,o=n+4*r,a=new Uint8Array(o),h=new DataView(a.buffer);for(e=0;e<t.length;e++){i=t[e];h.setUint32(s,i.data.byteLength);s+=4;a.set(i.data,s);s+=i.data.byteLength}return a};var Z={groupNalsIntoFrames:z,groupFramesIntoGops:H,extendFirstKeyFrame:X,generateSampleTable:W,concatenateNalData:J,generateSampleTableForFrame:K,concatenateNalDataForFrame:Q};var tt=[33,16,5,32,164,27];var et=[33,65,108,84,1,2,4,8,168,2,4,8,17,191,252];var it=function(t){var e=[];while(t--){e.push(0)}return e};var st=function(t){return Object.keys(t).reduce((function(e,i){e[i]=new Uint8Array(t[i].reduce((function(t,e){return t.concat(e)}),[]));return e}),{})};var nt;var rt=function(){if(!nt){var t={96e3:[tt,[227,64],it(154),[56]],88200:[tt,[231],it(170),[56]],64e3:[tt,[248,192],it(240),[56]],48e3:[tt,[255,192],it(268),[55,148,128],it(54),[112]],44100:[tt,[255,192],it(268),[55,163,128],it(84),[112]],32e3:[tt,[255,192],it(268),[55,234],it(226),[112]],24e3:[tt,[255,192],it(268),[55,255,128],it(268),[111,112],it(126),[224]],16e3:[tt,[255,192],it(268),[55,255,128],it(268),[111,255],it(269),[223,108],it(195),[1,192]],12e3:[et,it(268),[3,127,248],it(268),[6,255,240],it(268),[13,255,224],it(268),[27,253,128],it(259),[56]],11025:[et,it(268),[3,127,248],it(268),[6,255,240],it(268),[13,255,224],it(268),[27,255,192],it(268),[55,175,128],it(108),[112]],8e3:[et,it(268),[3,121,16],it(47),[7]]};nt=st(t)}return nt};var ot=9e4,at,ht,ct,lt,ut,ft,dt;at=function(t){return t*ot};ht=function(t,e){return t*e};ct=function(t){return t/ot};lt=function(t,e){return t/e};ut=function(t,e){return at(lt(t,e))};ft=function(t,e){return ht(ct(t),e)};dt=function(t,e,i){return ct(i?t:t-e)};var pt={ONE_SECOND_IN_TS:ot,secondsToVideoTs:at,secondsToAudioTs:ht,videoTsToSeconds:ct,audioTsToSeconds:lt,audioTsToVideoTs:ut,videoTsToAudioTs:ft,metadataTsToSeconds:dt};var vt=rt;var mt=pt;var gt=function(t){var e,i,s=0;for(e=0;e<t.length;e++){i=t[e];s+=i.data.byteLength}return s};var bt=function(t,e,i,s){var n,r=0,o=0,a=0,h=0,c,l,u;if(!e.length){return}n=mt.audioTsToVideoTs(t.baseMediaDecodeTime,t.samplerate);r=Math.ceil(mt.ONE_SECOND_IN_TS/(t.samplerate/1024));if(i&&s){o=n-Math.max(i,s);a=Math.floor(o/r);h=a*r}if(a<1||h>mt.ONE_SECOND_IN_TS/2){return}c=vt()[t.samplerate];if(!c){c=e[0].data}for(l=0;l<a;l++){u=e[0];e.splice(0,0,{data:c,dts:u.dts-r,pts:u.pts-r})}t.baseMediaDecodeTime-=Math.floor(mt.videoTsToAudioTs(h,t.samplerate));return h};var yt=function(t,e,i){if(e.minSegmentDts>=i){return t}e.minSegmentDts=Infinity;return t.filter((function(t){if(t.dts>=i){e.minSegmentDts=Math.min(e.minSegmentDts,t.dts);e.minSegmentPts=e.minSegmentDts;return true}return false}))};var jt=function(t){var e,i,s=[];for(e=0;e<t.length;e++){i=t[e];s.push({size:i.data.byteLength,duration:1024})}return s};var wt=function(t){var e,i,s=0,n=new Uint8Array(gt(t));for(e=0;e<t.length;e++){i=t[e];n.set(i.data,s);s+=i.data.byteLength}return n};var Tt={prefixWithSilence:bt,trimAdtsFramesByEarliestDts:yt,generateSampleTable:jt,concatenateFrameData:wt};var kt=pt.ONE_SECOND_IN_TS;var St=function(t,e){if(typeof e.pts==="number"){if(t.timelineStartInfo.pts===undefined){t.timelineStartInfo.pts=e.pts}if(t.minSegmentPts===undefined){t.minSegmentPts=e.pts}else{t.minSegmentPts=Math.min(t.minSegmentPts,e.pts)}if(t.maxSegmentPts===undefined){t.maxSegmentPts=e.pts}else{t.maxSegmentPts=Math.max(t.maxSegmentPts,e.pts)}}if(typeof e.dts==="number"){if(t.timelineStartInfo.dts===undefined){t.timelineStartInfo.dts=e.dts}if(t.minSegmentDts===undefined){t.minSegmentDts=e.dts}else{t.minSegmentDts=Math.min(t.minSegmentDts,e.dts)}if(t.maxSegmentDts===undefined){t.maxSegmentDts=e.dts}else{t.maxSegmentDts=Math.max(t.maxSegmentDts,e.dts)}}};var xt=function(t){delete t.minSegmentDts;delete t.maxSegmentDts;delete t.minSegmentPts;delete t.maxSegmentPts};var At=function(t,e){var i,s,n=t.minSegmentDts;if(!e){n-=t.timelineStartInfo.dts}i=t.timelineStartInfo.baseMediaDecodeTime;i+=n;i=Math.max(0,i);if(t.type==="audio"){s=t.samplerate/kt;i*=s;i=Math.floor(i)}return i};var Et={clearDtsInfo:xt,calculateTrackBaseMediaDecodeTime:At,collectDtsInfo:St};var It=4,Dt=128;var Ct=function(t){var e=0,i={payloadType:-1,payloadSize:0},s=0,n=0;while(e<t.byteLength){if(t[e]===Dt){break}while(t[e]===255){s+=255;e++}s+=t[e++];while(t[e]===255){n+=255;e++}n+=t[e++];if(!i.payload&&s===It){var r=String.fromCharCode(t[e+3],t[e+4],t[e+5],t[e+6]);if(r==="GA94"){i.payloadType=s;i.payloadSize=n;i.payload=t.subarray(e,e+n);break}else{i.payload=void 0}}e+=n;s=0;n=0}return i};var Nt=function(t){if(t.payload[0]!==181){return null}if((t.payload[1]<<8|t.payload[2])!==49){return null}if(String.fromCharCode(t.payload[3],t.payload[4],t.payload[5],t.payload[6])!=="GA94"){return null}if(t.payload[7]!==3){return null}return t.payload.subarray(8,t.payload.length-1)};var _t=function(t,e){var i=[],s,n,r,o;if(!(e[0]&64)){return i}n=e[0]&31;for(s=0;s<n;s++){r=s*3;o={type:e[r+2]&3,pts:t};if(e[r+2]&4){o.ccData=e[r+3]<<8|e[r+4];i.push(o)}}return i};var Ot=function(t){var e=t.byteLength,i=[],s=1,n,r;while(s<e-2){if(t[s]===0&&t[s+1]===0&&t[s+2]===3){i.push(s+2);s+=2}else{s++}}if(i.length===0){return t}n=e-i.length;r=new Uint8Array(n);var o=0;for(s=0;s<n;o++,s++){if(o===i[0]){o++;i.shift()}r[s]=t[o]}return r};var Mt={parseSei:Ct,parseUserData:Nt,parseCaptionPackets:_t,discardEmulationPreventionBytes:Ot,USER_DATA_REGISTERED_ITU_T_T35:It};var Rt=i;var Lt=Mt;var Pt=function(t){t=t||{};Pt.prototype.init.call(this);this.parse708captions_=typeof t.parse708captions==="boolean"?t.parse708captions:true;this.captionPackets_=[];this.ccStreams_=[new Wt(0,0),new Wt(0,1),new Wt(1,0),new Wt(1,1)];if(this.parse708captions_){this.cc708Stream_=new Vt({captionServices:t.captionServices})}this.reset();this.ccStreams_.forEach((function(t){t.on("data",this.trigger.bind(this,"data"));t.on("partialdone",this.trigger.bind(this,"partialdone"));t.on("done",this.trigger.bind(this,"done"))}),this);if(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"))}};Pt.prototype=new Rt;Pt.prototype.push=function(t){var e,i,s;if(t.nalUnitType!=="sei_rbsp"){return}e=Lt.parseSei(t.escapedRBSP);if(!e.payload){return}if(e.payloadType!==Lt.USER_DATA_REGISTERED_ITU_T_T35){return}i=Lt.parseUserData(e);if(!i){return}if(t.dts<this.latestDts_){this.ignoreNextEqualDts_=true;return}else if(t.dts===this.latestDts_&&this.ignoreNextEqualDts_){this.numSameDts_--;if(!this.numSameDts_){this.ignoreNextEqualDts_=false}return}s=Lt.parseCaptionPackets(t.pts,i);this.captionPackets_=this.captionPackets_.concat(s);if(this.latestDts_!==t.dts){this.numSameDts_=0}this.numSameDts_++;this.latestDts_=t.dts};Pt.prototype.flushCCStreams=function(t){this.ccStreams_.forEach((function(e){return t==="flush"?e.flush():e.partialFlush()}),this)};Pt.prototype.flushStream=function(t){if(!this.captionPackets_.length){this.flushCCStreams(t);return}this.captionPackets_.forEach((function(t,e){t.presortIndex=e}));this.captionPackets_.sort((function(t,e){if(t.pts===e.pts){return t.presortIndex-e.presortIndex}return t.pts-e.pts}));this.captionPackets_.forEach((function(t){if(t.type<2){this.dispatchCea608Packet(t)}else{this.dispatchCea708Packet(t)}}),this);this.captionPackets_.length=0;this.flushCCStreams(t)};Pt.prototype.flush=function(){return this.flushStream("flush")};Pt.prototype.partialFlush=function(){return this.flushStream("partialFlush")};Pt.prototype.reset=function(){this.latestDts_=null;this.ignoreNextEqualDts_=false;this.numSameDts_=0;this.activeCea608Channel_=[null,null];this.ccStreams_.forEach((function(t){t.reset()}))};Pt.prototype.dispatchCea608Packet=function(t){if(this.setsTextOrXDSActive(t)){this.activeCea608Channel_[t.type]=null}else if(this.setsChannel1Active(t)){this.activeCea608Channel_[t.type]=0}else if(this.setsChannel2Active(t)){this.activeCea608Channel_[t.type]=1}if(this.activeCea608Channel_[t.type]===null){return}this.ccStreams_[(t.type<<1)+this.activeCea608Channel_[t.type]].push(t)};Pt.prototype.setsChannel1Active=function(t){return(t.ccData&30720)===4096};Pt.prototype.setsChannel2Active=function(t){return(t.ccData&30720)===6144};Pt.prototype.setsTextOrXDSActive=function(t){return(t.ccData&28928)===256||(t.ccData&30974)===4138||(t.ccData&30974)===6186};Pt.prototype.dispatchCea708Packet=function(t){if(this.parse708captions_){this.cc708Stream_.push(t)}};var $t={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};var Ft=function(t){var e=$t[t]||t;if(t&4096&&t===e){return""}return String.fromCharCode(e)};var Ut=function(t){return 32<=t&&t<=127||160<=t&&t<=255};var Bt=function(t){this.windowNum=t;this.reset()};Bt.prototype.reset=function(){this.clearText();this.pendingNewLine=false;this.winAttr={};this.penAttr={};this.penLoc={};this.penColor={};this.visible=0;this.rowLock=0;this.columnLock=0;this.priority=0;this.relativePositioning=0;this.anchorVertical=0;this.anchorHorizontal=0;this.anchorPoint=0;this.rowCount=1;this.virtualRowCount=this.rowCount+1;this.columnCount=41;this.windowStyle=0;this.penStyle=0};Bt.prototype.getText=function(){return this.rows.join("\n")};Bt.prototype.clearText=function(){this.rows=[""];this.rowIdx=0};Bt.prototype.newLine=function(t){if(this.rows.length>=this.virtualRowCount&&typeof this.beforeRowOverflow==="function"){this.beforeRowOverflow(t)}if(this.rows.length>0){this.rows.push("");this.rowIdx++}while(this.rows.length>this.virtualRowCount){this.rows.shift();this.rowIdx--}};Bt.prototype.isEmpty=function(){if(this.rows.length===0){return true}else if(this.rows.length===1){return this.rows[0]===""}return false};Bt.prototype.addText=function(t){this.rows[this.rowIdx]+=t};Bt.prototype.backspace=function(){if(!this.isEmpty()){var t=this.rows[this.rowIdx];this.rows[this.rowIdx]=t.substr(0,t.length-1)}};var qt=function(t,e,i){this.serviceNum=t;this.text="";this.currentWindow=new Bt(-1);this.windows=[];this.stream=i;if(typeof e==="string"){this.createTextDecoder(e)}};qt.prototype.init=function(t,e){this.startPts=t;for(var i=0;i<8;i++){this.windows[i]=new Bt(i);if(typeof e==="function"){this.windows[i].beforeRowOverflow=e}}};qt.prototype.setCurrentWindow=function(t){this.currentWindow=this.windows[t]};qt.prototype.createTextDecoder=function(t){if(typeof TextDecoder==="undefined"){this.stream.trigger("log",{level:"warn",message:"The `encoding` option is unsupported without TextDecoder support"})}else{try{this.textDecoder_=new TextDecoder(t)}catch(e){this.stream.trigger("log",{level:"warn",message:"TextDecoder could not be created with "+t+" encoding. "+e})}}};var Vt=function(t){t=t||{};Vt.prototype.init.call(this);var e=this;var i=t.captionServices||{};var s={};var n;Object.keys(i).forEach((t=>{n=i[t];if(/^SERVICE/.test(t)){s[t]=n.encoding}}));this.serviceEncodings=s;this.current708Packet=null;this.services={};this.push=function(t){if(t.type===3){e.new708Packet();e.add708Bytes(t)}else{if(e.current708Packet===null){e.new708Packet()}e.add708Bytes(t)}}};Vt.prototype=new Rt;Vt.prototype.new708Packet=function(){if(this.current708Packet!==null){this.push708Packet()}this.current708Packet={data:[],ptsVals:[]}};Vt.prototype.add708Bytes=function(t){var e=t.ccData;var i=e>>>8;var s=e&255;this.current708Packet.ptsVals.push(t.pts);this.current708Packet.data.push(i);this.current708Packet.data.push(s)};Vt.prototype.push708Packet=function(){var t=this.current708Packet;var e=t.data;var i=null;var s=null;var n=0;var r=e[n++];t.seq=r>>6;t.sizeCode=r&63;for(;n<e.length;n++){r=e[n++];i=r>>5;s=r&31;if(i===7&&s>0){r=e[n++];i=r}this.pushServiceBlock(i,n,s);if(s>0){n+=s-1}}};Vt.prototype.pushServiceBlock=function(t,e,i){var s;var n=e;var r=this.current708Packet.data;var o=this.services[t];if(!o){o=this.initService(t,n)}for(;n<e+i&&n<r.length;n++){s=r[n];if(Ut(s)){n=this.handleText(n,o)}else if(s===24){n=this.multiByteCharacter(n,o)}else if(s===16){n=this.extendedCommands(n,o)}else if(128<=s&&s<=135){n=this.setCurrentWindow(n,o)}else if(152<=s&&s<=159){n=this.defineWindow(n,o)}else if(s===136){n=this.clearWindows(n,o)}else if(s===140){n=this.deleteWindows(n,o)}else if(s===137){n=this.displayWindows(n,o)}else if(s===138){n=this.hideWindows(n,o)}else if(s===139){n=this.toggleWindows(n,o)}else if(s===151){n=this.setWindowAttributes(n,o)}else if(s===144){n=this.setPenAttributes(n,o)}else if(s===145){n=this.setPenColor(n,o)}else if(s===146){n=this.setPenLocation(n,o)}else if(s===143){o=this.reset(n,o)}else if(s===8){o.currentWindow.backspace()}else if(s===12){o.currentWindow.clearText()}else if(s===13){o.currentWindow.pendingNewLine=true}else if(s===14){o.currentWindow.clearText()}else if(s===141){n++}else;}};Vt.prototype.extendedCommands=function(t,e){var i=this.current708Packet.data;var s=i[++t];if(Ut(s)){t=this.handleText(t,e,{isExtended:true})}return t};Vt.prototype.getPts=function(t){return this.current708Packet.ptsVals[Math.floor(t/2)]};Vt.prototype.initService=function(t,e){var i="SERVICE"+t;var s=this;var i;var n;if(i in this.serviceEncodings){n=this.serviceEncodings[i]}this.services[t]=new qt(t,n,s);this.services[t].init(this.getPts(e),(function(e){s.flushDisplayed(e,s.services[t])}));return this.services[t]};Vt.prototype.handleText=function(t,e,i){var s=i&&i.isExtended;var n=i&&i.isMultiByte;var r=this.current708Packet.data;var o=s?4096:0;var a=r[t];var h=r[t+1];var c=e.currentWindow;var l;var u;function f(t){return t.map((t=>("0"+(t&255).toString(16)).slice(-2))).join("")}if(n){u=[a,h];t++}else{u=[a]}if(e.textDecoder_&&!s){l=e.textDecoder_.decode(new Uint8Array(u))}else{if(n){const t=f(u);l=String.fromCharCode(parseInt(t,16))}else{l=Ft(o|a)}}if(c.pendingNewLine&&!c.isEmpty()){c.newLine(this.getPts(t))}c.pendingNewLine=false;c.addText(l);return t};Vt.prototype.multiByteCharacter=function(t,e){var i=this.current708Packet.data;var s=i[t+1];var n=i[t+2];if(Ut(s)&&Ut(n)){t=this.handleText(++t,e,{isMultiByte:true})}return t};Vt.prototype.setCurrentWindow=function(t,e){var i=this.current708Packet.data;var s=i[t];var n=s&7;e.setCurrentWindow(n);return t};Vt.prototype.defineWindow=function(t,e){var i=this.current708Packet.data;var s=i[t];var n=s&7;e.setCurrentWindow(n);var r=e.currentWindow;s=i[++t];r.visible=(s&32)>>5;r.rowLock=(s&16)>>4;r.columnLock=(s&8)>>3;r.priority=s&7;s=i[++t];r.relativePositioning=(s&128)>>7;r.anchorVertical=s&127;s=i[++t];r.anchorHorizontal=s;s=i[++t];r.anchorPoint=(s&240)>>4;r.rowCount=s&15;s=i[++t];r.columnCount=s&63;s=i[++t];r.windowStyle=(s&56)>>3;r.penStyle=s&7;r.virtualRowCount=r.rowCount+1;return t};Vt.prototype.setWindowAttributes=function(t,e){var i=this.current708Packet.data;var s=i[t];var n=e.currentWindow.winAttr;s=i[++t];n.fillOpacity=(s&192)>>6;n.fillRed=(s&48)>>4;n.fillGreen=(s&12)>>2;n.fillBlue=s&3;s=i[++t];n.borderType=(s&192)>>6;n.borderRed=(s&48)>>4;n.borderGreen=(s&12)>>2;n.borderBlue=s&3;s=i[++t];n.borderType+=(s&128)>>5;n.wordWrap=(s&64)>>6;n.printDirection=(s&48)>>4;n.scrollDirection=(s&12)>>2;n.justify=s&3;s=i[++t];n.effectSpeed=(s&240)>>4;n.effectDirection=(s&12)>>2;n.displayEffect=s&3;return t};Vt.prototype.flushDisplayed=function(t,e){var i=[];for(var s=0;s<8;s++){if(e.windows[s].visible&&!e.windows[s].isEmpty()){i.push(e.windows[s].getText())}}e.endPts=t;e.text=i.join("\n\n");this.pushCaption(e);e.startPts=t};Vt.prototype.pushCaption=function(t){if(t.text!==""){this.trigger("data",{startPts:t.startPts,endPts:t.endPts,text:t.text,stream:"cc708_"+t.serviceNum});t.text="";t.startPts=t.endPts}};Vt.prototype.displayWindows=function(t,e){var i=this.current708Packet.data;var s=i[++t];var n=this.getPts(t);this.flushDisplayed(n,e);for(var r=0;r<8;r++){if(s&1<<r){e.windows[r].visible=1}}return t};Vt.prototype.hideWindows=function(t,e){var i=this.current708Packet.data;var s=i[++t];var n=this.getPts(t);this.flushDisplayed(n,e);for(var r=0;r<8;r++){if(s&1<<r){e.windows[r].visible=0}}return t};Vt.prototype.toggleWindows=function(t,e){var i=this.current708Packet.data;var s=i[++t];var n=this.getPts(t);this.flushDisplayed(n,e);for(var r=0;r<8;r++){if(s&1<<r){e.windows[r].visible^=1}}return t};Vt.prototype.clearWindows=function(t,e){var i=this.current708Packet.data;var s=i[++t];var n=this.getPts(t);this.flushDisplayed(n,e);for(var r=0;r<8;r++){if(s&1<<r){e.windows[r].clearText()}}return t};Vt.prototype.deleteWindows=function(t,e){var i=this.current708Packet.data;var s=i[++t];var n=this.getPts(t);this.flushDisplayed(n,e);for(var r=0;r<8;r++){if(s&1<<r){e.windows[r].reset()}}return t};Vt.prototype.setPenAttributes=function(t,e){var i=this.current708Packet.data;var s=i[t];var n=e.currentWindow.penAttr;s=i[++t];n.textTag=(s&240)>>4;n.offset=(s&12)>>2;n.penSize=s&3;s=i[++t];n.italics=(s&128)>>7;n.underline=(s&64)>>6;n.edgeType=(s&56)>>3;n.fontStyle=s&7;return t};Vt.prototype.setPenColor=function(t,e){var i=this.current708Packet.data;var s=i[t];var n=e.currentWindow.penColor;s=i[++t];n.fgOpacity=(s&192)>>6;n.fgRed=(s&48)>>4;n.fgGreen=(s&12)>>2;n.fgBlue=s&3;s=i[++t];n.bgOpacity=(s&192)>>6;n.bgRed=(s&48)>>4;n.bgGreen=(s&12)>>2;n.bgBlue=s&3;s=i[++t];n.edgeRed=(s&48)>>4;n.edgeGreen=(s&12)>>2;n.edgeBlue=s&3;return t};Vt.prototype.setPenLocation=function(t,e){var i=this.current708Packet.data;var s=i[t];var n=e.currentWindow.penLoc;e.currentWindow.pendingNewLine=true;s=i[++t];n.row=s&15;s=i[++t];n.column=s&63;return t};Vt.prototype.reset=function(t,e){var i=this.getPts(t);this.flushDisplayed(i,e);return this.initService(e.serviceNum,t)};var zt={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};var Ht=function(t){if(t===null){return""}t=zt[t]||t;return String.fromCharCode(t)};var Xt=14;var Gt=[4352,4384,4608,4640,5376,5408,5632,5664,5888,5920,4096,4864,4896,5120,5152];var Yt=function(){var t=[],e=Xt+1;while(e--){t.push({text:"",indent:0,offset:0})}return t};var Wt=function(t,e){Wt.prototype.init.call(this);this.field_=t||0;this.dataChannel_=e||0;this.name_="CC"+((this.field_<<1|this.dataChannel_)+1);this.setConstants();this.reset();this.push=function(t){var e,i,s,n,r;e=t.ccData&32639;if(e===this.lastControlCode_){this.lastControlCode_=null;return}if((e&61440)===4096){this.lastControlCode_=e}else if(e!==this.PADDING_){this.lastControlCode_=null}s=e>>>8;n=e&255;if(e===this.PADDING_){return}else 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);i=this.displayed_;this.displayed_=this.nonDisplayed_;this.nonDisplayed_=i;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_){if(this.mode_==="popOn"){this.nonDisplayed_[this.row_].text=this.nonDisplayed_[this.row_].text.slice(0,-1)}else{this.displayed_[this.row_].text=this.displayed_[this.row_].text.slice(0,-1)}}else if(e===this.ERASE_DISPLAYED_MEMORY_){this.flushDisplayed(t.pts);this.displayed_=Yt()}else if(e===this.ERASE_NON_DISPLAYED_MEMORY_){this.nonDisplayed_=Yt()}else if(e===this.RESUME_DIRECT_CAPTIONING_){if(this.mode_!=="paintOn"){this.flushDisplayed(t.pts);this.displayed_=Yt()}this.mode_="paintOn";this.startPts_=t.pts}else if(this.isSpecialCharacter(s,n)){s=(s&3)<<8;r=Ht(s|n);this[this.mode_](t.pts,r);this.column_++}else if(this.isExtCharacter(s,n)){if(this.mode_==="popOn"){this.nonDisplayed_[this.row_].text=this.nonDisplayed_[this.row_].text.slice(0,-1)}else{this.displayed_[this.row_].text=this.displayed_[this.row_].text.slice(0,-1)}s=(s&3)<<8;r=Ht(s|n);this[this.mode_](t.pts,r);this.column_++}else if(this.isMidRowCode(s,n)){this.clearFormatting(t.pts);this[this.mode_](t.pts," ");this.column_++;if((n&14)===14){this.addFormatting(t.pts,["i"])}if((n&1)===1){this.addFormatting(t.pts,["u"])}}else if(this.isOffsetControlCode(s,n)){const t=n&3;this.nonDisplayed_[this.row_].offset=t;this.column_+=t}else if(this.isPAC(s,n)){var o=Gt.indexOf(e&7968);if(this.mode_==="rollUp"){if(o-this.rollUpRows_+1<0){o=this.rollUpRows_-1}this.setRollUp(t.pts,o)}if(o!==this.row_&&o>=0&&o<=14){this.clearFormatting(t.pts);this.row_=o}if(n&1&&this.formatting_.indexOf("u")===-1){this.addFormatting(t.pts,["u"])}if((e&16)===16){const t=(e&14)>>1;this.column_=t*4;this.nonDisplayed_[this.row_].indent+=t}if(this.isColorPAC(n)){if((n&14)===14){this.addFormatting(t.pts,["i"])}}}else if(this.isNormalChar(s)){if(n===0){n=null}r=Ht(s);r+=Ht(n);this[this.mode_](t.pts,r);this.column_+=r.length}}};Wt.prototype=new Rt;Wt.prototype.flushDisplayed=function(t){const e=t=>{this.trigger("log",{level:"warn",message:"Skipping a malformed 608 caption at index "+t+"."})};const i=[];this.displayed_.forEach(((t,s)=>{if(t&&t.text&&t.text.length){try{t.text=t.text.trim()}catch(t){e(s)}if(t.text.length){i.push({text:t.text,line:s+1,position:10+Math.min(70,t.indent*10)+t.offset*2.5})}}else if(t===undefined||t===null){e(s)}}));if(i.length){this.trigger("data",{startPts:this.startPts_,endPts:t,content:i,stream:this.name_})}};Wt.prototype.reset=function(){this.mode_="popOn";this.topRow_=0;this.startPts_=0;this.displayed_=Yt();this.nonDisplayed_=Yt();this.lastControlCode_=null;this.column_=0;this.row_=Xt;this.rollUpRows_=2;this.formatting_=[]};Wt.prototype.setConstants=function(){if(this.dataChannel_===0){this.BASE_=16;this.EXT_=17;this.CONTROL_=(20|this.field_)<<8;this.OFFSET_=23}else if(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};Wt.prototype.isSpecialCharacter=function(t,e){return t===this.EXT_&&e>=48&&e<=63};Wt.prototype.isExtCharacter=function(t,e){return(t===this.EXT_+1||t===this.EXT_+2)&&e>=32&&e<=63};Wt.prototype.isMidRowCode=function(t,e){return t===this.EXT_&&e>=32&&e<=47};Wt.prototype.isOffsetControlCode=function(t,e){return t===this.OFFSET_&&e>=33&&e<=35};Wt.prototype.isPAC=function(t,e){return t>=this.BASE_&&t<this.BASE_+8&&e>=64&&e<=127};Wt.prototype.isColorPAC=function(t){return t>=64&&t<=79||t>=96&&t<=127};Wt.prototype.isNormalChar=function(t){return t>=32&&t<=127};Wt.prototype.setRollUp=function(t,e){if(this.mode_!=="rollUp"){this.row_=Xt;this.mode_="rollUp";this.flushDisplayed(t);this.nonDisplayed_=Yt();this.displayed_=Yt()}if(e!==undefined&&e!==this.row_){for(var i=0;i<this.rollUpRows_;i++){this.displayed_[e-i]=this.displayed_[this.row_-i];this.displayed_[this.row_-i]={text:"",indent:0,offset:0}}}if(e===undefined){e=this.row_}this.topRow_=e-this.rollUpRows_+1};Wt.prototype.addFormatting=function(t,e){this.formatting_=this.formatting_.concat(e);var i=e.reduce((function(t,e){return t+"<"+e+">"}),"");this[this.mode_](t,i)};Wt.prototype.clearFormatting=function(t){if(!this.formatting_.length){return}var e=this.formatting_.reverse().reduce((function(t,e){return t+"</"+e+">"}),"");this.formatting_=[];this[this.mode_](t,e)};Wt.prototype.popOn=function(t,e){var i=this.nonDisplayed_[this.row_].text;i+=e;this.nonDisplayed_[this.row_].text=i};Wt.prototype.rollUp=function(t,e){var i=this.displayed_[this.row_].text;i+=e;this.displayed_[this.row_].text=i};Wt.prototype.shiftRowsUp_=function(){var t;for(t=0;t<this.topRow_;t++){this.displayed_[t]={text:"",indent:0,offset:0}}for(t=this.row_+1;t<Xt+1;t++){this.displayed_[t]={text:"",indent:0,offset:0}}for(t=this.topRow_;t<this.row_;t++){this.displayed_[t]=this.displayed_[t+1]}this.displayed_[this.row_]={text:"",indent:0,offset:0}};Wt.prototype.paintOn=function(t,e){var i=this.displayed_[this.row_].text;i+=e;this.displayed_[this.row_].text=i};var Jt={CaptionStream:Pt,Cea608Stream:Wt,Cea708Stream:Vt};var Kt={H264_STREAM_TYPE:27,ADTS_STREAM_TYPE:15,METADATA_STREAM_TYPE:21};var Qt=i;var Zt=8589934592;var te=4294967296;var ee="shared";var ie=function(t,e){var i=1;if(t>e){i=-1}while(Math.abs(e-t)>te){t+=i*Zt}return t};var se=function(t){var e,i;se.prototype.init.call(this);this.type_=t||ee;this.push=function(t){if(t.type==="metadata"){this.trigger("data",t);return}if(this.type_!==ee&&t.type!==this.type_){return}if(i===undefined){i=t.dts}t.dts=ie(t.dts,i);t.pts=ie(t.pts,i);e=t.dts;this.trigger("data",t)};this.flush=function(){i=e;this.trigger("done")};this.endTimeline=function(){this.flush();this.trigger("endedtimeline")};this.discontinuity=function(){i=void 0;e=void 0};this.reset=function(){this.discontinuity();this.trigger("reset")}};se.prototype=new Qt;var ne={TimestampRolloverStream:se,handleRollover:ie};var re=(t,e,i)=>{if(!t){return-1}var s=i;for(;s<t.length;s++){if(t[s]===e){return s}}return-1};var oe={typedArrayIndexOf:re};var ae=oe.typedArrayIndexOf,he={Iso88591:0,Utf16:1,Utf16be:2,Utf8:3},ce=function(t,e,i){var s,n="";for(s=e;s<i;s++){n+="%"+("00"+t[s].toString(16)).slice(-2)}return n},le=function(t,e,i){return decodeURIComponent(ce(t,e,i))},ue=function(t,e,i){return unescape(ce(t,e,i))},fe=function(t){return t[0]<<21|t[1]<<14|t[2]<<7|t[3]},de={APIC:function(t){var e=1,i,s,n="--\x3e";if(t.data[0]!==he.Utf8){return}i=ae(t.data,0,e);if(i<0){return}t.mimeType=ue(t.data,e,i);e=i+1;t.pictureType=t.data[e];e++;s=ae(t.data,0,e);if(s<0){return}t.description=le(t.data,e,s);e=s+1;if(t.mimeType===n){t.url=ue(t.data,e,t.data.length)}else{t.pictureData=t.data.subarray(e,t.data.length)}},"T*":function(t){if(t.data[0]!==he.Utf8){return}t.value=le(t.data,1,t.data.length).replace(/\0*$/,"");t.values=t.value.split("\0")},TXXX:function(t){var e;if(t.data[0]!==he.Utf8){return}e=ae(t.data,0,1);if(e===-1){return}t.description=le(t.data,1,e);t.value=le(t.data,e+1,t.data.length).replace(/\0*$/,"");t.data=t.value},"W*":function(t){t.url=ue(t.data,0,t.data.length).replace(/\0.*$/,"")},WXXX:function(t){var e;if(t.data[0]!==he.Utf8){return}e=ae(t.data,0,1);if(e===-1){return}t.description=le(t.data,1,e);t.url=ue(t.data,e+1,t.data.length).replace(/\0.*$/,"")},PRIV:function(t){var e;for(e=0;e<t.data.length;e++){if(t.data[e]===0){t.owner=ue(t.data,0,e);break}}t.privateData=t.data.subarray(e+1);t.data=t.privateData}};var pe=function(t){var e,i,s=10,n=0,r=[];if(t.length<10||t[0]!=="I".charCodeAt(0)||t[1]!=="D".charCodeAt(0)||t[2]!=="3".charCodeAt(0)){return}n=fe(t.subarray(6,10));n+=10;var o=t[5]&64;if(o){s+=4;s+=fe(t.subarray(10,14));n-=fe(t.subarray(16,20))}do{e=fe(t.subarray(s+4,s+8));if(e<1){break}i=String.fromCharCode(t[s],t[s+1],t[s+2],t[s+3]);var a={id:i,data:t.subarray(s+10,s+e+10)};a.key=a.id;if(de[a.id]){de[a.id](a)}else if(a.id[0]==="T"){de["T*"](a)}else if(a.id[0]==="W"){de["W*"](a)}r.push(a);s+=10;s+=e}while(s<n);return r};var ve={parseId3Frames:pe,parseSyncSafeInteger:fe,frameParsers:de};var me=i,ge=Kt,be=ve,ye;ye=function(t){var e={descriptor:t&&t.descriptor},i=0,s=[],n=0,r;ye.prototype.init.call(this);this.dispatchType=ge.METADATA_STREAM_TYPE.toString(16);if(e.descriptor){for(r=0;r<e.descriptor.length;r++){this.dispatchType+=("00"+e.descriptor[r].toString(16)).slice(-2)}}this.push=function(t){var e,r,o,a,h,c;if(t.type!=="timed-metadata"){return}if(t.dataAlignmentIndicator){n=0;s.length=0}if(s.length===0&&(t.data.length<10||t.data[0]!=="I".charCodeAt(0)||t.data[1]!=="D".charCodeAt(0)||t.data[2]!=="3".charCodeAt(0))){this.trigger("log",{level:"warn",message:"Skipping unrecognized metadata packet"});return}s.push(t);n+=t.data.byteLength;if(s.length===1){i=be.parseSyncSafeInteger(t.data.subarray(6,10));i+=10}if(n<i){return}e={data:new Uint8Array(i),frames:[],pts:s[0].pts,dts:s[0].dts};for(h=0;h<i;){e.data.set(s[0].data.subarray(0,i-h),h);h+=s[0].data.byteLength;n-=s[0].data.byteLength;s.shift()}r=10;if(e.data[5]&64){r+=4;r+=be.parseSyncSafeInteger(e.data.subarray(10,14));i-=be.parseSyncSafeInteger(e.data.subarray(16,20))}do{o=be.parseSyncSafeInteger(e.data.subarray(r+4,r+8));if(o<1){this.trigger("log",{level:"warn",message:"Malformed ID3 frame encountered. Skipping remaining metadata parsing."});break}c=String.fromCharCode(e.data[r],e.data[r+1],e.data[r+2],e.data[r+3]);a={id:c,data:e.data.subarray(r+10,r+o+10)};a.key=a.id;if(be.frameParsers[a.id]){be.frameParsers[a.id](a)}else if(a.id[0]==="T"){be.frameParsers["T*"](a)}else if(a.id[0]==="W"){be.frameParsers["W*"](a)}if(a.owner==="com.apple.streaming.transportStreamTimestamp"){var l=a.data,u=(l[3]&1)<<30|l[4]<<22|l[5]<<14|l[6]<<6|l[7]>>>2;u*=4;u+=l[7]&3;a.timeStamp=u;if(e.pts===undefined&&e.dts===undefined){e.pts=a.timeStamp;e.dts=a.timeStamp}this.trigger("timestamp",a)}e.frames.push(a);r+=10;r+=o}while(r<i);this.trigger("data",e)}};ye.prototype=new me;var je=ye;var we=i,Te=Jt,ke=Kt,Se=ne.TimestampRolloverStream;var xe,Ae,Ee;var Ie=188,De=71;xe=function(){var t=new Uint8Array(Ie),e=0;xe.prototype.init.call(this);this.push=function(i){var s=0,n=Ie,r;if(e){r=new Uint8Array(i.byteLength+e);r.set(t.subarray(0,e));r.set(i,e);e=0}else{r=i}while(n<r.byteLength){if(r[s]===De&&r[n]===De){this.trigger("data",r.subarray(s,n));s+=Ie;n+=Ie;continue}s++;n++}if(s<r.byteLength){t.set(r.subarray(s),0);e=r.byteLength-s}};this.flush=function(){if(e===Ie&&t[0]===De){this.trigger("data",t);e=0}this.trigger("done")};this.endTimeline=function(){this.flush();this.trigger("endedtimeline")};this.reset=function(){e=0;this.trigger("reset")}};xe.prototype=new we;Ae=function(){var t,e,i,s;Ae.prototype.init.call(this);s=this;this.packetsWaitingForPmt=[];this.programMapTable=undefined;t=function(t,s){var n=0;if(s.payloadUnitStartIndicator){n+=t[n]+1}if(s.type==="pat"){e(t.subarray(n),s)}else{i(t.subarray(n),s)}};e=function(t,e){e.section_number=t[7];e.last_section_number=t[8];s.pmtPid=(t[10]&31)<<8|t[11];e.pmtPid=s.pmtPid};i=function(t,e){var i,n,r,o;if(!(t[5]&1)){return}s.programMapTable={video:null,audio:null,"timed-metadata":{}};i=(t[1]&15)<<8|t[2];n=3+i-4;r=(t[10]&15)<<8|t[11];o=12+r;while(o<n){var a=t[o];var h=(t[o+1]&31)<<8|t[o+2];if(a===ke.H264_STREAM_TYPE&&s.programMapTable.video===null){s.programMapTable.video=h}else if(a===ke.ADTS_STREAM_TYPE&&s.programMapTable.audio===null){s.programMapTable.audio=h}else if(a===ke.METADATA_STREAM_TYPE){s.programMapTable["timed-metadata"][h]=a}o+=((t[o+3]&15)<<8|t[o+4])+5}e.programMapTable=s.programMapTable};this.push=function(e){var i={},s=4;i.payloadUnitStartIndicator=!!(e[1]&64);i.pid=e[1]&31;i.pid<<=8;i.pid|=e[2];if((e[3]&48)>>>4>1){s+=e[s]+1}if(i.pid===0){i.type="pat";t(e.subarray(s),i);this.trigger("data",i)}else if(i.pid===this.pmtPid){i.type="pmt";t(e.subarray(s),i);this.trigger("data",i);while(this.packetsWaitingForPmt.length){this.processPes_.apply(this,this.packetsWaitingForPmt.shift())}}else if(this.programMapTable===undefined){this.packetsWaitingForPmt.push([e,s,i])}else{this.processPes_(e,s,i)}};this.processPes_=function(t,e,i){if(i.pid===this.programMapTable.video){i.streamType=ke.H264_STREAM_TYPE}else if(i.pid===this.programMapTable.audio){i.streamType=ke.ADTS_STREAM_TYPE}else{i.streamType=this.programMapTable["timed-metadata"][i.pid]}i.type="pes";i.data=t.subarray(e);this.trigger("data",i)}};Ae.prototype=new we;Ae.STREAM_TYPES={h264:27,adts:15};Ee=function(){var t=this,e=false,i={data:[],size:0},s={data:[],size:0},n={data:[],size:0},r,o=function(t,e){var i;const s=t[0]<<16|t[1]<<8|t[2];e.data=new Uint8Array;if(s!==1){return}e.packetLength=6+(t[4]<<8|t[5]);e.dataAlignmentIndicator=(t[6]&4)!==0;i=t[7];if(i&192){e.pts=(t[9]&14)<<27|(t[10]&255)<<20|(t[11]&254)<<12|(t[12]&255)<<5|(t[13]&254)>>>3;e.pts*=4;e.pts+=(t[13]&6)>>>1;e.dts=e.pts;if(i&64){e.dts=(t[14]&14)<<27|(t[15]&255)<<20|(t[16]&254)<<12|(t[17]&255)<<5|(t[18]&254)>>>3;e.dts*=4;e.dts+=(t[18]&6)>>>1}}e.data=t.subarray(9+t[8])},a=function(e,i,s){var n=new Uint8Array(e.size),r={type:i},a=0,h=0,c=false,l;if(!e.data.length||e.size<9){return}r.trackId=e.data[0].pid;for(a=0;a<e.data.length;a++){l=e.data[a];n.set(l.data,h);h+=l.data.byteLength}o(n,r);c=i==="video"||r.packetLength<=e.size;if(s||c){e.size=0;e.data.length=0}if(c){t.trigger("data",r)}};Ee.prototype.init.call(this);this.push=function(o){({pat:function(){},pes:function(){var t,e;switch(o.streamType){case ke.H264_STREAM_TYPE:t=i;e="video";break;case ke.ADTS_STREAM_TYPE:t=s;e="audio";break;case ke.METADATA_STREAM_TYPE:t=n;e="timed-metadata";break;default:return}if(o.payloadUnitStartIndicator){a(t,e,true)}t.data.push(o);t.size+=o.data.byteLength},pmt:function(){var i={type:"metadata",tracks:[]};r=o.programMapTable;if(r.video!==null){i.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+r.video,codec:"avc",type:"video"})}if(r.audio!==null){i.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+r.audio,codec:"adts",type:"audio"})}e=true;t.trigger("data",i)}})[o.type]()};this.reset=function(){i.size=0;i.data.length=0;s.size=0;s.data.length=0;this.trigger("reset")};this.flushStreams_=function(){a(i,"video");a(s,"audio");a(n,"timed-metadata")};this.flush=function(){if(!e&&r){var i={type:"metadata",tracks:[]};if(r.video!==null){i.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+r.video,codec:"avc",type:"video"})}if(r.audio!==null){i.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+r.audio,codec:"adts",type:"audio"})}t.trigger("data",i)}e=false;this.flushStreams_();this.trigger("done")}};Ee.prototype=new we;var Ce={PAT_PID:0,MP2T_PACKET_LENGTH:Ie,TransportPacketStream:xe,TransportParseStream:Ae,ElementaryStream:Ee,TimestampRolloverStream:Se,CaptionStream:Te.CaptionStream,Cea608Stream:Te.Cea608Stream,Cea708Stream:Te.Cea708Stream,MetadataStream:je};for(var Ne in ke){if(ke.hasOwnProperty(Ne)){Ce[Ne]=ke[Ne]}}var _e=Ce;var Oe=i;var Me=pt.ONE_SECOND_IN_TS;var Re;var Le=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350];Re=function(t){var e,i=0;Re.prototype.init.call(this);this.skipWarn_=function(t,e){this.trigger("log",{level:"warn",message:`adts skiping bytes ${t} to ${e} in frame ${i} outside syncword`})};this.push=function(s){var n=0,r,o,a,h,c;if(!t){i=0}if(s.type!=="audio"){return}if(e&&e.length){a=e;e=new Uint8Array(a.byteLength+s.data.byteLength);e.set(a);e.set(s.data,a.byteLength)}else{e=s.data}var l;while(n+7<e.length){if(e[n]!==255||(e[n+1]&246)!==240){if(typeof l!=="number"){l=n}n++;continue}if(typeof l==="number"){this.skipWarn_(l,n);l=null}o=(~e[n+1]&1)*2;r=(e[n+3]&3)<<11|e[n+4]<<3|(e[n+5]&224)>>5;h=((e[n+6]&3)+1)*1024;c=h*Me/Le[(e[n+2]&60)>>>2];if(e.byteLength-n<r){break}this.trigger("data",{pts:s.pts+i*c,dts:s.dts+i*c,sampleCount:h,audioobjecttype:(e[n+2]>>>6&3)+1,channelcount:(e[n+2]&1)<<2|(e[n+3]&192)>>>6,samplerate:Le[(e[n+2]&60)>>>2],samplingfrequencyindex:(e[n+2]&60)>>>2,samplesize:16,data:e.subarray(n+7+o,n+r)});i++;n+=r}if(typeof l==="number"){this.skipWarn_(l,n);l=null}e=e.subarray(n)};this.flush=function(){i=0;this.trigger("done")};this.reset=function(){e=void 0;this.trigger("reset")};this.endTimeline=function(){e=void 0;this.trigger("endedtimeline")}};Re.prototype=new Oe;var Pe=Re;var $e;$e=function(t){var e=t.byteLength,i=0,s=0;this.length=function(){return 8*e};this.bitsAvailable=function(){return 8*e+s};this.loadWord=function(){var n=t.byteLength-e,r=new Uint8Array(4),o=Math.min(4,e);if(o===0){throw new Error("no bytes available")}r.set(t.subarray(n,n+o));i=new DataView(r.buffer).getUint32(0);s=o*8;e-=o};this.skipBits=function(t){var n;if(s>t){i<<=t;s-=t}else{t-=s;n=Math.floor(t/8);t-=n*8;e-=n;this.loadWord();i<<=t;s-=t}};this.readBits=function(t){var n=Math.min(s,t),r=i>>>32-n;s-=n;if(s>0){i<<=n}else if(e>0){this.loadWord()}n=t-n;if(n>0){return r<<n|this.readBits(n)}return r};this.skipLeadingZeros=function(){var t;for(t=0;t<s;++t){if((i&2147483648>>>t)!==0){i<<=t;s-=t;return t}}this.loadWord();return t+this.skipLeadingZeros()};this.skipUnsignedExpGolomb=function(){this.skipBits(1+this.skipLeadingZeros())};this.skipExpGolomb=function(){this.skipBits(1+this.skipLeadingZeros())};this.readUnsignedExpGolomb=function(){var t=this.skipLeadingZeros();return this.readBits(t+1)-1};this.readExpGolomb=function(){var t=this.readUnsignedExpGolomb();if(1&t){return 1+t>>>1}return-1*(t>>>1)};this.readBoolean=function(){return this.readBits(1)===1};this.readUnsignedByte=function(){return this.readBits(8)};this.loadWord()};var Fe=$e;var Ue=i;var Be=Fe;var qe,Ve;var ze;Ve=function(){var t=0,e,i;Ve.prototype.init.call(this);this.push=function(s){var n;if(!i){i=s.data}else{n=new Uint8Array(i.byteLength+s.data.byteLength);n.set(i);n.set(s.data,i.byteLength);i=n}var r=i.byteLength;for(;t<r-3;t++){if(i[t+2]===1){e=t+5;break}}while(e<r){switch(i[e]){case 0:if(i[e-1]!==0){e+=2;break}else if(i[e-2]!==0){e++;break}if(t+3!==e-2){this.trigger("data",i.subarray(t+3,e-2))}do{e++}while(i[e]!==1&&e<r);t=e-2;e+=3;break;case 1:if(i[e-1]!==0||i[e-2]!==0){e+=3;break}this.trigger("data",i.subarray(t+3,e-2));t=e-2;e+=3;break;default:e+=3;break}}i=i.subarray(t);e-=t;t=0};this.reset=function(){i=null;t=0;this.trigger("reset")};this.flush=function(){if(i&&i.byteLength>3){this.trigger("data",i.subarray(t+3))}i=null;t=0;this.trigger("done")};this.endTimeline=function(){this.flush();this.trigger("endedtimeline")}};Ve.prototype=new Ue;ze={100:true,110:true,122:true,244:true,44:true,83:true,86:true,118:true,128:true,138:true,139:true,134:true};qe=function(){var t=new Ve,e,i,s,n,r,o,a;qe.prototype.init.call(this);e=this;this.push=function(e){if(e.type!=="video"){return}i=e.trackId;s=e.pts;n=e.dts;t.push(e)};t.on("data",(function(t){var a={trackId:i,pts:s,dts:n,data:t,nalUnitTypeCode:t[0]&31};switch(a.nalUnitTypeCode){case 5:a.nalUnitType="slice_layer_without_partitioning_rbsp_idr";break;case 6:a.nalUnitType="sei_rbsp";a.escapedRBSP=r(t.subarray(1));break;case 7:a.nalUnitType="seq_parameter_set_rbsp";a.escapedRBSP=r(t.subarray(1));a.config=o(a.escapedRBSP);break;case 8:a.nalUnitType="pic_parameter_set_rbsp";break;case 9:a.nalUnitType="access_unit_delimiter_rbsp";break}e.trigger("data",a)}));t.on("done",(function(){e.trigger("done")}));t.on("partialdone",(function(){e.trigger("partialdone")}));t.on("reset",(function(){e.trigger("reset")}));t.on("endedtimeline",(function(){e.trigger("endedtimeline")}));this.flush=function(){t.flush()};this.partialFlush=function(){t.partialFlush()};this.reset=function(){t.reset()};this.endTimeline=function(){t.endTimeline()};a=function(t,e){var i=8,s=8,n,r;for(n=0;n<t;n++){if(s!==0){r=e.readExpGolomb();s=(i+r+256)%256}i=s===0?i:s}};r=function(t){var e=t.byteLength,i=[],s=1,n,r;while(s<e-2){if(t[s]===0&&t[s+1]===0&&t[s+2]===3){i.push(s+2);s+=2}else{s++}}if(i.length===0){return t}n=e-i.length;r=new Uint8Array(n);var o=0;for(s=0;s<n;o++,s++){if(o===i[0]){o++;i.shift()}r[s]=t[o]}return r};o=function(t){var e=0,i=0,s=0,n=0,r,o,h,c,l,u,f,d,p,v,m,g=[1,1],b,y;r=new Be(t);o=r.readUnsignedByte();c=r.readUnsignedByte();h=r.readUnsignedByte();r.skipUnsignedExpGolomb();if(ze[o]){l=r.readUnsignedExpGolomb();if(l===3){r.skipBits(1)}r.skipUnsignedExpGolomb();r.skipUnsignedExpGolomb();r.skipBits(1);if(r.readBoolean()){m=l!==3?8:12;for(y=0;y<m;y++){if(r.readBoolean()){if(y<6){a(16,r)}else{a(64,r)}}}}}r.skipUnsignedExpGolomb();u=r.readUnsignedExpGolomb();if(u===0){r.readUnsignedExpGolomb()}else if(u===1){r.skipBits(1);r.skipExpGolomb();r.skipExpGolomb();f=r.readUnsignedExpGolomb();for(y=0;y<f;y++){r.skipExpGolomb()}}r.skipUnsignedExpGolomb();r.skipBits(1);d=r.readUnsignedExpGolomb();p=r.readUnsignedExpGolomb();v=r.readBits(1);if(v===0){r.skipBits(1)}r.skipBits(1);if(r.readBoolean()){e=r.readUnsignedExpGolomb();i=r.readUnsignedExpGolomb();s=r.readUnsignedExpGolomb();n=r.readUnsignedExpGolomb()}if(r.readBoolean()){if(r.readBoolean()){b=r.readUnsignedByte();switch(b){case 1:g=[1,1];break;case 2:g=[12,11];break;case 3:g=[10,11];break;case 4:g=[16,11];break;case 5:g=[40,33];break;case 6:g=[24,11];break;case 7:g=[20,11];break;case 8:g=[32,11];break;case 9:g=[80,33];break;case 10:g=[18,11];break;case 11:g=[15,11];break;case 12:g=[64,33];break;case 13:g=[160,99];break;case 14:g=[4,3];break;case 15:g=[3,2];break;case 16:g=[2,1];break;case 255:{g=[r.readUnsignedByte()<<8|r.readUnsignedByte(),r.readUnsignedByte()<<8|r.readUnsignedByte()];break}}}}return{profileIdc:o,levelIdc:h,profileCompatibility:c,width:(d+1)*16-e*2-i*2,height:(2-v)*(p+1)*16-s*2-n*2,sarRatio:g}}};qe.prototype=new Ue;var He={H264Stream:qe,NalByteStream:Ve};var Xe=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350];var Ge=function(t,e){var i=t[e+6]<<21|t[e+7]<<14|t[e+8]<<7|t[e+9],s=t[e+5],n=(s&16)>>4;i=i>=0?i:0;if(n){return i+20}return i+10};var Ye=function(t,e){if(t.length-e<10||t[e]!=="I".charCodeAt(0)||t[e+1]!=="D".charCodeAt(0)||t[e+2]!=="3".charCodeAt(0)){return e}e+=Ge(t,e);return Ye(t,e)};var We=function(t){var e=Ye(t,0);return t.length>=e+2&&(t[e]&255)===255&&(t[e+1]&240)===240&&(t[e+1]&22)===16};var Je=function(t){return t[0]<<21|t[1]<<14|t[2]<<7|t[3]};var Ke=function(t,e,i){var s,n="";for(s=e;s<i;s++){n+="%"+("00"+t[s].toString(16)).slice(-2)}return n};var Qe=function(t,e,i){return unescape(Ke(t,e,i))};var Ze=function(t,e){var i=(t[e+5]&224)>>5,s=t[e+4]<<3,n=t[e+3]&3<<11;return n|s|i};var ti=function(t,e){if(t[e]==="I".charCodeAt(0)&&t[e+1]==="D".charCodeAt(0)&&t[e+2]==="3".charCodeAt(0)){return"timed-metadata"}else if(t[e]&255===255&&(t[e+1]&240)===240){return"audio"}return null};var ei=function(t){var e=0;while(e+5<t.length){if(t[e]!==255||(t[e+1]&246)!==240){e++;continue}return Xe[(t[e+2]&60)>>>2]}return null};var ii=function(t){var e,i,s,n;e=10;if(t[5]&64){e+=4;e+=Je(t.subarray(10,14))}do{i=Je(t.subarray(e+4,e+8));if(i<1){return null}n=String.fromCharCode(t[e],t[e+1],t[e+2],t[e+3]);if(n==="PRIV"){s=t.subarray(e+10,e+i+10);for(var r=0;r<s.byteLength;r++){if(s[r]===0){var o=Qe(s,0,r);if(o==="com.apple.streaming.transportStreamTimestamp"){var a=s.subarray(r+1);var h=(a[3]&1)<<30|a[4]<<22|a[5]<<14|a[6]<<6|a[7]>>>2;h*=4;h+=a[7]&3;return h}break}}}e+=10;e+=i}while(e<t.byteLength);return null};var si={isLikelyAacData:We,parseId3TagSize:Ge,parseAdtsSize:Ze,parseType:ti,parseSampleRate:ei,parseAacTimestamp:ii};var ni=i;var ri=si;var oi;oi=function(){var t=new Uint8Array,e=0;oi.prototype.init.call(this);this.setTimestamp=function(t){e=t};this.push=function(i){var s=0,n=0,r,o,a,h;if(t.length){h=t.length;t=new Uint8Array(i.byteLength+h);t.set(t.subarray(0,h));t.set(i,h)}else{t=i}while(t.length-n>=3){if(t[n]==="I".charCodeAt(0)&&t[n+1]==="D".charCodeAt(0)&&t[n+2]==="3".charCodeAt(0)){if(t.length-n<10){break}s=ri.parseId3TagSize(t,n);if(n+s>t.length){break}o={type:"timed-metadata",data:t.subarray(n,n+s)};this.trigger("data",o);n+=s;continue}else if((t[n]&255)===255&&(t[n+1]&240)===240){if(t.length-n<7){break}s=ri.parseAdtsSize(t,n);if(n+s>t.length){break}a={type:"audio",data:t.subarray(n,n+s),pts:e,dts:e};this.trigger("data",a);n+=s;continue}n++}r=t.length-n;if(r>0){t=t.subarray(n)}else{t=new Uint8Array}};this.reset=function(){t=new Uint8Array;this.trigger("reset")};this.endTimeline=function(){t=new Uint8Array;this.trigger("endedtimeline")}};oi.prototype=new ni;var ai=oi;var hi=["audioobjecttype","channelcount","samplerate","samplingfrequencyindex","samplesize"];var ci=hi;var li=["width","height","profileIdc","levelIdc","profileCompatibility","sarRatio"];var ui=li;var fi=i;var di=V;var pi=Z;var vi=Tt;var mi=Et;var gi=_e;var bi=pt;var yi=Pe;var ji=He.H264Stream;var wi=ai;var Ti=si.isLikelyAacData;var ki=pt.ONE_SECOND_IN_TS;var Si=ci;var xi=ui;var Ai,Ei,Ii,Di;var Ci=function(t,e){e.stream=t;this.trigger("log",e)};var Ni=function(t,e){var i=Object.keys(e);for(var s=0;s<i.length;s++){var n=i[s];if(n==="headOfPipeline"||!e[n].on){continue}e[n].on("log",Ci.bind(t,n))}};var _i=function(t,e){var i;if(t.length!==e.length){return false}for(i=0;i<t.length;i++){if(t[i]!==e[i]){return false}}return true};var Oi=function(t,e,i,s,n,r){var o=i-e,a=s-e,h=n-i;return{start:{dts:t,pts:t+o},end:{dts:t+a,pts:t+h},prependedContentDuration:r,baseMediaDecodeTime:t}};Ei=function(t,e){var i=[],s,n=0,r=0,o=Infinity;e=e||{};s=e.firstSequenceNumber||0;Ei.prototype.init.call(this);this.push=function(e){mi.collectDtsInfo(t,e);if(t){Si.forEach((function(i){t[i]=e[i]}))}i.push(e)};this.setEarliestDts=function(t){n=t};this.setVideoBaseMediaDecodeTime=function(t){o=t};this.setAudioAppendStart=function(t){r=t};this.flush=function(){var a,h,c,l,u,f,d;if(i.length===0){this.trigger("done","AudioSegmentStream");return}a=vi.trimAdtsFramesByEarliestDts(i,t,n);t.baseMediaDecodeTime=mi.calculateTrackBaseMediaDecodeTime(t,e.keepOriginalTimestamps);d=vi.prefixWithSilence(t,a,r,o);t.samples=vi.generateSampleTable(a);c=di.mdat(vi.concatenateFrameData(a));i=[];h=di.moof(s,[t]);l=new Uint8Array(h.byteLength+c.byteLength);s++;l.set(h);l.set(c,h.byteLength);mi.clearDtsInfo(t);u=Math.ceil(ki*1024/t.samplerate);if(a.length){f=a.length*u;this.trigger("segmentTimingInfo",Oi(bi.audioTsToVideoTs(t.baseMediaDecodeTime,t.samplerate),a[0].dts,a[0].pts,a[0].dts+f,a[0].pts+f,d||0));this.trigger("timingInfo",{start:a[0].pts,end:a[0].pts+f})}this.trigger("data",{track:t,boxes:l});this.trigger("done","AudioSegmentStream")};this.reset=function(){mi.clearDtsInfo(t);i=[];this.trigger("reset")}};Ei.prototype=new fi;Ai=function(t,e){var i,s=[],n=[],r,o;e=e||{};i=e.firstSequenceNumber||0;Ai.prototype.init.call(this);delete t.minPTS;this.gopCache_=[];this.push=function(e){mi.collectDtsInfo(t,e);if(e.nalUnitType==="seq_parameter_set_rbsp"&&!r){r=e.config;t.sps=[e.data];xi.forEach((function(e){t[e]=r[e]}),this)}if(e.nalUnitType==="pic_parameter_set_rbsp"&&!o){o=e.data;t.pps=[e.data]}s.push(e)};this.flush=function(){var r,o,a,h,c,l,u=0,f,d;while(s.length){if(s[0].nalUnitType==="access_unit_delimiter_rbsp"){break}s.shift()}if(s.length===0){this.resetStream_();this.trigger("done","VideoSegmentStream");return}r=pi.groupNalsIntoFrames(s);a=pi.groupFramesIntoGops(r);if(!a[0][0].keyFrame){o=this.getGopForFusion_(s[0],t);if(o){u=o.duration;a.unshift(o);a.byteLength+=o.byteLength;a.nalCount+=o.nalCount;a.pts=o.pts;a.dts=o.dts;a.duration+=o.duration}else{a=pi.extendFirstKeyFrame(a)}}if(n.length){var p;if(e.alignGopsAtEnd){p=this.alignGopsAtEnd_(a)}else{p=this.alignGopsAtStart_(a)}if(!p){this.gopCache_.unshift({gop:a.pop(),pps:t.pps,sps:t.sps});this.gopCache_.length=Math.min(6,this.gopCache_.length);s=[];this.resetStream_();this.trigger("done","VideoSegmentStream");return}mi.clearDtsInfo(t);a=p}mi.collectDtsInfo(t,a);t.samples=pi.generateSampleTable(a);c=di.mdat(pi.concatenateNalData(a));t.baseMediaDecodeTime=mi.calculateTrackBaseMediaDecodeTime(t,e.keepOriginalTimestamps);this.trigger("processedGopsInfo",a.map((function(t){return{pts:t.pts,dts:t.dts,byteLength:t.byteLength}})));f=a[0];d=a[a.length-1];this.trigger("segmentTimingInfo",Oi(t.baseMediaDecodeTime,f.dts,f.pts,d.dts+d.duration,d.pts+d.duration,u));this.trigger("timingInfo",{start:a[0].pts,end:a[a.length-1].pts+a[a.length-1].duration});this.gopCache_.unshift({gop:a.pop(),pps:t.pps,sps:t.sps});this.gopCache_.length=Math.min(6,this.gopCache_.length);s=[];this.trigger("baseMediaDecodeTime",t.baseMediaDecodeTime);this.trigger("timelineStartInfo",t.timelineStartInfo);h=di.moof(i,[t]);l=new Uint8Array(h.byteLength+c.byteLength);i++;l.set(h);l.set(c,h.byteLength);this.trigger("data",{track:t,boxes:l});this.resetStream_();this.trigger("done","VideoSegmentStream")};this.reset=function(){this.resetStream_();s=[];this.gopCache_.length=0;n.length=0;this.trigger("reset")};this.resetStream_=function(){mi.clearDtsInfo(t);r=undefined;o=undefined};this.getGopForFusion_=function(e){var i=45e3,s=1e4,n=Infinity,r,o,a,h,c;for(c=0;c<this.gopCache_.length;c++){h=this.gopCache_[c];a=h.gop;if(!(t.pps&&_i(t.pps[0],h.pps[0]))||!(t.sps&&_i(t.sps[0],h.sps[0]))){continue}if(a.dts<t.timelineStartInfo.dts){continue}r=e.dts-a.dts-a.duration;if(r>=-s&&r<=i){if(!o||n>r){o=h;n=r}}}if(o){return o.gop}return null};this.alignGopsAtStart_=function(t){var e,i,s,r,o,a,h,c;o=t.byteLength;a=t.nalCount;h=t.duration;e=i=0;while(e<n.length&&i<t.length){s=n[e];r=t[i];if(s.pts===r.pts){break}if(r.pts>s.pts){e++;continue}i++;o-=r.byteLength;a-=r.nalCount;h-=r.duration}if(i===0){return t}if(i===t.length){return null}c=t.slice(i);c.byteLength=o;c.duration=h;c.nalCount=a;c.pts=c[0].pts;c.dts=c[0].dts;return c};this.alignGopsAtEnd_=function(t){var e,i,s,r,o,a;e=n.length-1;i=t.length-1;o=null;a=false;while(e>=0&&i>=0){s=n[e];r=t[i];if(s.pts===r.pts){a=true;break}if(s.pts>r.pts){e--;continue}if(e===n.length-1){o=i}i--}if(!a&&o===null){return null}var h;if(a){h=i}else{h=o}if(h===0){return t}var c=t.slice(h);var l=c.reduce((function(t,e){t.byteLength+=e.byteLength;t.duration+=e.duration;t.nalCount+=e.nalCount;return t}),{byteLength:0,duration:0,nalCount:0});c.byteLength=l.byteLength;c.duration=l.duration;c.nalCount=l.nalCount;c.pts=c[0].pts;c.dts=c[0].dts;return c};this.alignGopsWith=function(t){n=t}};Ai.prototype=new fi;Di=function(t,e){this.numberOfTracks=0;this.metadataStream=e;t=t||{};if(typeof t.remux!=="undefined"){this.remuxTracks=!!t.remux}else{this.remuxTracks=true}if(typeof t.keepOriginalTimestamps==="boolean"){this.keepOriginalTimestamps=t.keepOriginalTimestamps}else{this.keepOriginalTimestamps=false}this.pendingTracks=[];this.videoTrack=null;this.pendingBoxes=[];this.pendingCaptions=[];this.pendingMetadata=[];this.pendingBytes=0;this.emittedTracks=0;Di.prototype.init.call(this);this.push=function(t){if(t.content||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;if(t.track.type==="video"){this.videoTrack=t.track;this.pendingBoxes.push(t.boxes)}if(t.track.type==="audio"){this.audioTrack=t.track;this.pendingBoxes.unshift(t.boxes)}}};Di.prototype=new fi;Di.prototype.flush=function(t){var e=0,i={captions:[],captionStreams:{},metadata:[],info:{}},s,n,r,o=0,a;if(this.pendingTracks.length<this.numberOfTracks){if(t!=="VideoSegmentStream"&&t!=="AudioSegmentStream"){return}else if(this.remuxTracks){return}else if(this.pendingTracks.length===0){this.emittedTracks++;if(this.emittedTracks>=this.numberOfTracks){this.trigger("done");this.emittedTracks=0}return}}if(this.videoTrack){o=this.videoTrack.timelineStartInfo.pts;xi.forEach((function(t){i.info[t]=this.videoTrack[t]}),this)}else if(this.audioTrack){o=this.audioTrack.timelineStartInfo.pts;Si.forEach((function(t){i.info[t]=this.audioTrack[t]}),this)}if(this.videoTrack||this.audioTrack){if(this.pendingTracks.length===1){i.type=this.pendingTracks[0].type}else{i.type="combined"}this.emittedTracks+=this.pendingTracks.length;r=di.initSegment(this.pendingTracks);i.initSegment=new Uint8Array(r.byteLength);i.initSegment.set(r);i.data=new Uint8Array(this.pendingBytes);for(a=0;a<this.pendingBoxes.length;a++){i.data.set(this.pendingBoxes[a],e);e+=this.pendingBoxes[a].byteLength}for(a=0;a<this.pendingCaptions.length;a++){s=this.pendingCaptions[a];s.startTime=bi.metadataTsToSeconds(s.startPts,o,this.keepOriginalTimestamps);s.endTime=bi.metadataTsToSeconds(s.endPts,o,this.keepOriginalTimestamps);i.captionStreams[s.stream]=true;i.captions.push(s)}for(a=0;a<this.pendingMetadata.length;a++){n=this.pendingMetadata[a];n.cueTime=bi.metadataTsToSeconds(n.pts,o,this.keepOriginalTimestamps);i.metadata.push(n)}i.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",i);for(a=0;a<i.captions.length;a++){s=i.captions[a];this.trigger("caption",s)}for(a=0;a<i.metadata.length;a++){n=i.metadata[a];this.trigger("id3Frame",n)}}if(this.emittedTracks>=this.numberOfTracks){this.trigger("done");this.emittedTracks=0}};Di.prototype.setRemux=function(t){this.remuxTracks=t};Ii=function(t){var e=this,i=true,s,n;Ii.prototype.init.call(this);t=t||{};this.baseMediaDecodeTime=t.baseMediaDecodeTime||0;this.transmuxPipeline_={};this.setupAacPipeline=function(){var i={};this.transmuxPipeline_=i;i.type="aac";i.metadataStream=new gi.MetadataStream;i.aacStream=new wi;i.audioTimestampRolloverStream=new gi.TimestampRolloverStream("audio");i.timedMetadataTimestampRolloverStream=new gi.TimestampRolloverStream("timed-metadata");i.adtsStream=new yi;i.coalesceStream=new Di(t,i.metadataStream);i.headOfPipeline=i.aacStream;i.aacStream.pipe(i.audioTimestampRolloverStream).pipe(i.adtsStream);i.aacStream.pipe(i.timedMetadataTimestampRolloverStream).pipe(i.metadataStream).pipe(i.coalesceStream);i.metadataStream.on("timestamp",(function(t){i.aacStream.setTimestamp(t.timeStamp)}));i.aacStream.on("data",(function(r){if(r.type!=="timed-metadata"&&r.type!=="audio"||i.audioSegmentStream){return}n=n||{timelineStartInfo:{baseMediaDecodeTime:e.baseMediaDecodeTime},codec:"adts",type:"audio"};i.coalesceStream.numberOfTracks++;i.audioSegmentStream=new Ei(n,t);i.audioSegmentStream.on("log",e.getLogTrigger_("audioSegmentStream"));i.audioSegmentStream.on("timingInfo",e.trigger.bind(e,"audioTimingInfo"));i.adtsStream.pipe(i.audioSegmentStream).pipe(i.coalesceStream);e.trigger("trackinfo",{hasAudio:!!n,hasVideo:!!s})}));i.coalesceStream.on("data",this.trigger.bind(this,"data"));i.coalesceStream.on("done",this.trigger.bind(this,"done"));Ni(this,i)};this.setupTsPipeline=function(){var i={};this.transmuxPipeline_=i;i.type="ts";i.metadataStream=new gi.MetadataStream;i.packetStream=new gi.TransportPacketStream;i.parseStream=new gi.TransportParseStream;i.elementaryStream=new gi.ElementaryStream;i.timestampRolloverStream=new gi.TimestampRolloverStream;i.adtsStream=new yi;i.h264Stream=new ji;i.captionStream=new gi.CaptionStream(t);i.coalesceStream=new Di(t,i.metadataStream);i.headOfPipeline=i.packetStream;i.packetStream.pipe(i.parseStream).pipe(i.elementaryStream).pipe(i.timestampRolloverStream);i.timestampRolloverStream.pipe(i.h264Stream);i.timestampRolloverStream.pipe(i.adtsStream);i.timestampRolloverStream.pipe(i.metadataStream).pipe(i.coalesceStream);i.h264Stream.pipe(i.captionStream).pipe(i.coalesceStream);i.elementaryStream.on("data",(function(r){var o;if(r.type==="metadata"){o=r.tracks.length;while(o--){if(!s&&r.tracks[o].type==="video"){s=r.tracks[o];s.timelineStartInfo.baseMediaDecodeTime=e.baseMediaDecodeTime}else if(!n&&r.tracks[o].type==="audio"){n=r.tracks[o];n.timelineStartInfo.baseMediaDecodeTime=e.baseMediaDecodeTime}}if(s&&!i.videoSegmentStream){i.coalesceStream.numberOfTracks++;i.videoSegmentStream=new Ai(s,t);i.videoSegmentStream.on("log",e.getLogTrigger_("videoSegmentStream"));i.videoSegmentStream.on("timelineStartInfo",(function(s){if(n&&!t.keepOriginalTimestamps){n.timelineStartInfo=s;i.audioSegmentStream.setEarliestDts(s.dts-e.baseMediaDecodeTime)}}));i.videoSegmentStream.on("processedGopsInfo",e.trigger.bind(e,"gopInfo"));i.videoSegmentStream.on("segmentTimingInfo",e.trigger.bind(e,"videoSegmentTimingInfo"));i.videoSegmentStream.on("baseMediaDecodeTime",(function(t){if(n){i.audioSegmentStream.setVideoBaseMediaDecodeTime(t)}}));i.videoSegmentStream.on("timingInfo",e.trigger.bind(e,"videoTimingInfo"));i.h264Stream.pipe(i.videoSegmentStream).pipe(i.coalesceStream)}if(n&&!i.audioSegmentStream){i.coalesceStream.numberOfTracks++;i.audioSegmentStream=new Ei(n,t);i.audioSegmentStream.on("log",e.getLogTrigger_("audioSegmentStream"));i.audioSegmentStream.on("timingInfo",e.trigger.bind(e,"audioTimingInfo"));i.audioSegmentStream.on("segmentTimingInfo",e.trigger.bind(e,"audioSegmentTimingInfo"));i.adtsStream.pipe(i.audioSegmentStream).pipe(i.coalesceStream)}e.trigger("trackinfo",{hasAudio:!!n,hasVideo:!!s})}}));i.coalesceStream.on("data",this.trigger.bind(this,"data"));i.coalesceStream.on("id3Frame",(function(t){t.dispatchType=i.metadataStream.dispatchType;e.trigger("id3Frame",t)}));i.coalesceStream.on("caption",this.trigger.bind(this,"caption"));i.coalesceStream.on("done",this.trigger.bind(this,"done"));Ni(this,i)};this.setBaseMediaDecodeTime=function(e){var i=this.transmuxPipeline_;if(!t.keepOriginalTimestamps){this.baseMediaDecodeTime=e}if(n){n.timelineStartInfo.dts=undefined;n.timelineStartInfo.pts=undefined;mi.clearDtsInfo(n);if(i.audioTimestampRolloverStream){i.audioTimestampRolloverStream.discontinuity()}}if(s){if(i.videoSegmentStream){i.videoSegmentStream.gopCache_=[]}s.timelineStartInfo.dts=undefined;s.timelineStartInfo.pts=undefined;mi.clearDtsInfo(s);i.captionStream.reset()}if(i.timestampRolloverStream){i.timestampRolloverStream.discontinuity()}};this.setAudioAppendStart=function(t){if(n){this.transmuxPipeline_.audioSegmentStream.setAudioAppendStart(t)}};this.setRemux=function(e){var i=this.transmuxPipeline_;t.remux=e;if(i&&i.coalesceStream){i.coalesceStream.setRemux(e)}};this.alignGopsWith=function(t){if(s&&this.transmuxPipeline_.videoSegmentStream){this.transmuxPipeline_.videoSegmentStream.alignGopsWith(t)}};this.getLogTrigger_=function(t){var e=this;return function(i){i.stream=t;e.trigger("log",i)}};this.push=function(t){if(i){var e=Ti(t);if(e&&this.transmuxPipeline_.type!=="aac"){this.setupAacPipeline()}else if(!e&&this.transmuxPipeline_.type!=="ts"){this.setupTsPipeline()}i=false}this.transmuxPipeline_.headOfPipeline.push(t)};this.flush=function(){i=true;this.transmuxPipeline_.headOfPipeline.flush()};this.endTimeline=function(){this.transmuxPipeline_.headOfPipeline.endTimeline()};this.reset=function(){if(this.transmuxPipeline_.headOfPipeline){this.transmuxPipeline_.headOfPipeline.reset()}};this.resetCaptions=function(){if(this.transmuxPipeline_.captionStream){this.transmuxPipeline_.captionStream.reset()}}};Ii.prototype=new fi;var Mi={Transmuxer:Ii,VideoSegmentStream:Ai,AudioSegmentStream:Ei,AUDIO_PROPERTIES:Si,VIDEO_PROPERTIES:xi,generateSegmentTimingInfo:Oi};var Ri=function(t){return t>>>0};var Li=function(t){return("00"+t.toString(16)).slice(-2)};var Pi={toUnsigned:Ri,toHexString:Li};var $i=function(t){var e="";e+=String.fromCharCode(t[0]);e+=String.fromCharCode(t[1]);e+=String.fromCharCode(t[2]);e+=String.fromCharCode(t[3]);return e};var Fi=$i;var Ui=Pi.toUnsigned;var Bi=Fi;var qi=function(t,e){var i=[],s,n,r,o,a;if(!e.length){return null}for(s=0;s<t.byteLength;){n=Ui(t[s]<<24|t[s+1]<<16|t[s+2]<<8|t[s+3]);r=Bi(t.subarray(s+4,s+8));o=n>1?s+n:t.byteLength;if(r===e[0]){if(e.length===1){i.push(t.subarray(s+8,o))}else{a=qi(t.subarray(s+8,o),e.slice(1));if(a.length){i=i.concat(a)}}}s=o}return i};var Vi=qi;var zi=Pi.toUnsigned;var Hi=r.getUint64;var Xi=function(t){var e={version:t[0],flags:new Uint8Array(t.subarray(1,4))};if(e.version===1){e.baseMediaDecodeTime=Hi(t.subarray(4))}else{e.baseMediaDecodeTime=zi(t[4]<<24|t[5]<<16|t[6]<<8|t[7])}return e};var Gi=Xi;var Yi=function(t){return{isLeading:(t[0]&12)>>>2,dependsOn:t[0]&3,isDependedOn:(t[1]&192)>>>6,hasRedundancy:(t[1]&48)>>>4,paddingValue:(t[1]&14)>>>1,isNonSyncSample:t[1]&1,degradationPriority:t[2]<<8|t[3]}};var Wi=Yi;var Ji=Wi;var Ki=function(t){var e={version:t[0],flags:new Uint8Array(t.subarray(1,4)),samples:[]},i=new DataView(t.buffer,t.byteOffset,t.byteLength),s=e.flags[2]&1,n=e.flags[2]&4,r=e.flags[1]&1,o=e.flags[1]&2,a=e.flags[1]&4,h=e.flags[1]&8,c=i.getUint32(4),l=8,u;if(s){e.dataOffset=i.getInt32(l);l+=4}if(n&&c){u={flags:Ji(t.subarray(l,l+4))};l+=4;if(r){u.duration=i.getUint32(l);l+=4}if(o){u.size=i.getUint32(l);l+=4}if(h){if(e.version===1){u.compositionTimeOffset=i.getInt32(l)}else{u.compositionTimeOffset=i.getUint32(l)}l+=4}e.samples.push(u);c--}while(c--){u={};if(r){u.duration=i.getUint32(l);l+=4}if(o){u.size=i.getUint32(l);l+=4}if(a){u.flags=Ji(t.subarray(l,l+4));l+=4}if(h){if(e.version===1){u.compositionTimeOffset=i.getInt32(l)}else{u.compositionTimeOffset=i.getUint32(l)}l+=4}e.samples.push(u)}return e};var Qi=Ki;var Zi=function(t){var e=new DataView(t.buffer,t.byteOffset,t.byteLength),i={version:t[0],flags:new Uint8Array(t.subarray(1,4)),trackId:e.getUint32(4)},s=i.flags[2]&1,n=i.flags[2]&2,r=i.flags[2]&8,o=i.flags[2]&16,a=i.flags[2]&32,h=i.flags[0]&65536,c=i.flags[0]&131072,l;l=8;if(s){l+=4;i.baseDataOffset=e.getUint32(12);l+=4}if(n){i.sampleDescriptionIndex=e.getUint32(l);l+=4}if(r){i.defaultSampleDuration=e.getUint32(l);l+=4}if(o){i.defaultSampleSize=e.getUint32(l);l+=4}if(a){i.defaultSampleFlags=e.getUint32(l)}if(h){i.durationIsEmpty=true}if(!s&&c){i.baseDataOffsetIsMoof=true}return i};var ts=Zi;var es;if(typeof window!=="undefined"){es=window}else if(typeof t!=="undefined"){es=t}else if(typeof self!=="undefined"){es=self}else{es={}}var is=es;var ss=Mt.discardEmulationPreventionBytes;var ns=Jt.CaptionStream;var rs=Vi;var os=Gi;var as=Qi;var hs=ts;var cs=is;var ls=function(t,e){var i=t;for(var s=0;s<e.length;s++){var n=e[s];if(i<n.size){return n}i-=n.size}return null};var us=function(t,e,i){var s=new DataView(t.buffer,t.byteOffset,t.byteLength),n={logs:[],seiNals:[]},r,o,a,h;for(o=0;o+4<t.length;o+=a){a=s.getUint32(o);o+=4;if(a<=0){continue}switch(t[o]&31){case 6:var c=t.subarray(o+1,o+1+a);var l=ls(o,e);r={nalUnitType:"sei_rbsp",size:a,data:c,escapedRBSP:ss(c),trackId:i};if(l){r.pts=l.pts;r.dts=l.dts;h=l}else if(h){r.pts=h.pts;r.dts=h.dts}else{n.logs.push({level:"warn",message:"We've encountered a nal unit without data at "+o+" for trackId "+i+". See mux.js#223."});break}n.seiNals.push(r);break}}return n};var fs=function(t,e,i){var s=e;var n=i.defaultSampleDuration||0;var r=i.defaultSampleSize||0;var o=i.trackId;var a=[];t.forEach((function(t){var e=as(t);var i=e.samples;i.forEach((function(t){if(t.duration===undefined){t.duration=n}if(t.size===undefined){t.size=r}t.trackId=o;t.dts=s;if(t.compositionTimeOffset===undefined){t.compositionTimeOffset=0}if(typeof s==="bigint"){t.pts=s+cs.BigInt(t.compositionTimeOffset);s+=cs.BigInt(t.duration)}else{t.pts=s+t.compositionTimeOffset;s+=t.duration}}));a=a.concat(i)}));return a};var ds=function(t,e){var i=rs(t,["moof","traf"]);var s=rs(t,["mdat"]);var n={};var r=[];s.forEach((function(t,e){var s=i[e];r.push({mdat:t,traf:s})}));r.forEach((function(t){var i=t.mdat;var s=t.traf;var r=rs(s,["tfhd"]);var o=hs(r[0]);var a=o.trackId;var h=rs(s,["tfdt"]);var c=h.length>0?os(h[0]).baseMediaDecodeTime:0;var l=rs(s,["trun"]);var u;var f;if(e===a&&l.length>0){u=fs(l,c,o);f=us(i,u,a);if(!n[a]){n[a]={seiNals:[],logs:[]}}n[a].seiNals=n[a].seiNals.concat(f.seiNals);n[a].logs=n[a].logs.concat(f.logs)}}));return n};var ps=function(t,e,i){var s;if(e===null){return null}s=ds(t,e);var n=s[e]||{};return{seiNals:n.seiNals,logs:n.logs,timescale:i}};var vs=function(){var t=false;var e;var i;var s;var n;var r;var o;this.isInitialized=function(){return t};this.init=function(i){e=new ns;t=true;o=i?i.isPartial:false;e.on("data",(function(t){t.startTime=t.startPts/n;t.endTime=t.endPts/n;r.captions.push(t);r.captionStreams[t.stream]=true}));e.on("log",(function(t){r.logs.push(t)}))};this.isNewInit=function(t,e){if(t&&t.length===0||e&&typeof e==="object"&&Object.keys(e).length===0){return false}return s!==t[0]||n!==e[s]};this.parse=function(t,e,o){var a;if(!this.isInitialized()){return null}else if(!e||!o){return null}else if(this.isNewInit(e,o)){s=e[0];n=o[s]}else if(s===null||!n){i.push(t);return null}while(i.length>0){var h=i.shift();this.parse(h,e,o)}a=ps(t,s,n);if(a&&a.logs){r.logs=r.logs.concat(a.logs)}if(a===null||!a.seiNals){if(r.logs.length){return{logs:r.logs,captions:[],captionStreams:[]}}return null}this.pushNals(a.seiNals);this.flushStream();return r};this.pushNals=function(t){if(!this.isInitialized()||!t||t.length===0){return null}t.forEach((function(t){e.push(t)}))};this.flushStream=function(){if(!this.isInitialized()){return null}if(!o){e.flush()}else{e.partialFlush()}};this.clearParsedCaptions=function(){r.captions=[];r.captionStreams={};r.logs=[]};this.resetCaptionStream=function(){if(!this.isInitialized()){return null}e.reset()};this.clearAllCaptions=function(){this.clearParsedCaptions();this.resetCaptionStream()};this.reset=function(){i=[];s=null;n=null;if(!r){r={captions:[],captionStreams:{},logs:[]}}else{this.clearParsedCaptions()}this.resetCaptionStream()};this.reset()};var ms=vs;var gs=function(t){var e=0;var i=String.fromCharCode(t[e]);var s="";while(i!=="\0"){s+=i;e++;i=String.fromCharCode(t[e])}s+=i;return s};var bs={uint8ToCString:gs};var ys=bs.uint8ToCString;var js=r.getUint64;var ws=function(t){var e=4;var i=t[0];var s,n,r,o,a,h,c,l;if(i===0){s=ys(t.subarray(e));e+=s.length;n=ys(t.subarray(e));e+=n.length;var u=new DataView(t.buffer);r=u.getUint32(e);e+=4;a=u.getUint32(e);e+=4;h=u.getUint32(e);e+=4;c=u.getUint32(e);e+=4}else if(i===1){var u=new DataView(t.buffer);r=u.getUint32(e);e+=4;o=js(t.subarray(e));e+=8;h=u.getUint32(e);e+=4;c=u.getUint32(e);e+=4;s=ys(t.subarray(e));e+=s.length;n=ys(t.subarray(e));e+=n.length}l=new Uint8Array(t.subarray(e,t.byteLength));var f={scheme_id_uri:s,value:n,timescale:r?r:1,presentation_time:o,presentation_time_delta:a,event_duration:h,id:c,message_data:l};return ks(i,f)?f:undefined};var Ts=function(t,e,i,s){return t||t===0?t/e:s+i/e};var ks=function(t,e){var i=e.scheme_id_uri!=="\0";var s=t===0&&Ss(e.presentation_time_delta)&&i;var n=t===1&&Ss(e.presentation_time)&&i;return!(t>1)&&s||n};var Ss=function(t){return t!==undefined||t!==null};var xs={parseEmsgBox:ws,scaleTime:Ts};var As=Pi.toUnsigned;var Es=Pi.toHexString;var Is=Vi;var Ds=Fi;var Cs=xs;var Ns=ts;var _s=Qi;var Os=Gi;var Ms=r.getUint64;var Rs,Ls,Ps,$s,Fs,Us,Bs;var qs=is;var Vs=ve.parseId3Frames;Rs=function(t){var e={},i=Is(t,["moov","trak"]);return i.reduce((function(t,e){var i,s,n,r,o;i=Is(e,["tkhd"])[0];if(!i){return null}s=i[0];n=s===0?12:20;r=As(i[n]<<24|i[n+1]<<16|i[n+2]<<8|i[n+3]);o=Is(e,["mdia","mdhd"])[0];if(!o){return null}s=o[0];n=s===0?12:20;t[r]=As(o[n]<<24|o[n+1]<<16|o[n+2]<<8|o[n+3]);return t}),e)};Ls=function(t,e){var i;i=Is(e,["moof","traf"]);var s=i.reduce((function(e,i){var s=Is(i,["tfhd"])[0];var n=As(s[4]<<24|s[5]<<16|s[6]<<8|s[7]);var r=t[n]||9e4;var o=Is(i,["tfdt"])[0];var a=new DataView(o.buffer,o.byteOffset,o.byteLength);var h;if(o[0]===1){h=Ms(o.subarray(4,12))}else{h=a.getUint32(4)}let c;if(typeof h==="bigint"){c=h/qs.BigInt(r)}else if(typeof h==="number"&&!isNaN(h)){c=h/r}if(c<Number.MAX_SAFE_INTEGER){c=Number(c)}if(c<e){e=c}return e}),Infinity);return typeof s==="bigint"||isFinite(s)?s:0};Ps=function(t,e){var i=Is(e,["moof","traf"]);var s=0;var n=0;var r;if(i&&i.length){var o=Is(i[0],["tfhd"])[0];var a=Is(i[0],["trun"])[0];var h=Is(i[0],["tfdt"])[0];if(o){var c=Ns(o);r=c.trackId}if(h){var l=Os(h);s=l.baseMediaDecodeTime}if(a){var u=_s(a);if(u.samples&&u.samples.length){n=u.samples[0].compositionTimeOffset||0}}}var f=t[r]||9e4;if(typeof s==="bigint"){n=qs.BigInt(n);f=qs.BigInt(f)}var d=(s+n)/f;if(typeof d==="bigint"&&d<Number.MAX_SAFE_INTEGER){d=Number(d)}return d};$s=function(t){var e=Is(t,["moov","trak"]);var i=[];e.forEach((function(t){var e=Is(t,["mdia","hdlr"]);var s=Is(t,["tkhd"]);e.forEach((function(t,e){var n=Ds(t.subarray(8,12));var r=s[e];var o;var a;var h;if(n==="vide"){o=new DataView(r.buffer,r.byteOffset,r.byteLength);a=o.getUint8(0);h=a===0?o.getUint32(12):o.getUint32(20);i.push(h)}}))}));return i};Us=function(t){var e=t[0];var i=e===0?12:20;return As(t[i]<<24|t[i+1]<<16|t[i+2]<<8|t[i+3])};Fs=function(t){var e=Is(t,["moov","trak"]);var i=[];e.forEach((function(t){var e={};var s=Is(t,["tkhd"])[0];var n,r;if(s){n=new DataView(s.buffer,s.byteOffset,s.byteLength);r=n.getUint8(0);e.id=r===0?n.getUint32(12):n.getUint32(20)}var o=Is(t,["mdia","hdlr"])[0];if(o){var a=Ds(o.subarray(8,12));if(a==="vide"){e.type="video"}else if(a==="soun"){e.type="audio"}else{e.type=a}}var h=Is(t,["mdia","minf","stbl","stsd"])[0];if(h){var c=h.subarray(8);e.codec=Ds(c.subarray(4,8));var l=Is(c,[e.codec])[0];var u,f;if(l){if(/^[asm]vc[1-9]$/i.test(e.codec)){u=l.subarray(78);f=Ds(u.subarray(4,8));if(f==="avcC"&&u.length>11){e.codec+=".";e.codec+=Es(u[9]);e.codec+=Es(u[10]);e.codec+=Es(u[11])}else{e.codec="avc1.4d400d"}}else if(/^mp4[a,v]$/i.test(e.codec)){u=l.subarray(28);f=Ds(u.subarray(4,8));if(f==="esds"&&u.length>20&&u[19]!==0){e.codec+="."+Es(u[19]);e.codec+="."+Es(u[20]>>>2&63).replace(/^0/,"")}else{e.codec="mp4a.40.2"}}else{e.codec=e.codec.toLowerCase()}}}var d=Is(t,["mdia","mdhd"])[0];if(d){e.timescale=Us(d)}i.push(e)}));return i};Bs=function(t,e=0){var i=Is(t,["emsg"]);return i.map((t=>{var i=Cs.parseEmsgBox(new Uint8Array(t));var s=Vs(i.message_data);return{cueTime:Cs.scaleTime(i.presentation_time,i.timescale,i.presentation_time_delta,e),duration:Cs.scaleTime(i.event_duration,i.timescale),frames:s}}))};var zs={findBox:Is,parseType:Ds,timescale:Rs,startTime:Ls,compositionStartTime:Ps,videoTrackIds:$s,tracks:Fs,getTimescaleFromMediaHeader:Us,getEmsgID3:Bs};var Hs=Kt;var Xs=function(t){var e=t[1]&31;e<<=8;e|=t[2];return e};var Gs=function(t){return!!(t[1]&64)};var Ys=function(t){var e=0;if((t[3]&48)>>>4>1){e+=t[4]+1}return e};var Ws=function(t,e){var i=Xs(t);if(i===0){return"pat"}else if(i===e){return"pmt"}else if(e){return"pes"}return null};var Js=function(t){var e=Gs(t);var i=4+Ys(t);if(e){i+=t[i]+1}return(t[i+10]&31)<<8|t[i+11]};var Ks=function(t){var e={};var i=Gs(t);var s=4+Ys(t);if(i){s+=t[s]+1}if(!(t[s+5]&1)){return}var n,r,o;n=(t[s+1]&15)<<8|t[s+2];r=3+n-4;o=(t[s+10]&15)<<8|t[s+11];var a=12+o;while(a<r){var h=s+a;e[(t[h+1]&31)<<8|t[h+2]]=t[h];a+=((t[h+3]&15)<<8|t[h+4])+5}return e};var Qs=function(t,e){var i=Xs(t);var s=e[i];switch(s){case Hs.H264_STREAM_TYPE:return"video";case Hs.ADTS_STREAM_TYPE:return"audio";case Hs.METADATA_STREAM_TYPE:return"timed-metadata";default:return null}};var Zs=function(t){var e=Gs(t);if(!e){return null}var i=4+Ys(t);if(i>=t.byteLength){return null}var s=null;var n;n=t[i+7];if(n&192){s={};s.pts=(t[i+9]&14)<<27|(t[i+10]&255)<<20|(t[i+11]&254)<<12|(t[i+12]&255)<<5|(t[i+13]&254)>>>3;s.pts*=4;s.pts+=(t[i+13]&6)>>>1;s.dts=s.pts;if(n&64){s.dts=(t[i+14]&14)<<27|(t[i+15]&255)<<20|(t[i+16]&254)<<12|(t[i+17]&255)<<5|(t[i+18]&254)>>>3;s.dts*=4;s.dts+=(t[i+18]&6)>>>1}}return s};var tn=function(t){switch(t){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}};var en=function(t){var e=4+Ys(t);var i=t.subarray(e);var s=0;var n=0;var r=false;var o;for(;n<i.byteLength-3;n++){if(i[n+2]===1){s=n+5;break}}while(s<i.byteLength){switch(i[s]){case 0:if(i[s-1]!==0){s+=2;break}else if(i[s-2]!==0){s++;break}if(n+3!==s-2){o=tn(i[n+3]&31);if(o==="slice_layer_without_partitioning_rbsp_idr"){r=true}}do{s++}while(i[s]!==1&&s<i.length);n=s-2;s+=3;break;case 1:if(i[s-1]!==0||i[s-2]!==0){s+=3;break}o=tn(i[n+3]&31);if(o==="slice_layer_without_partitioning_rbsp_idr"){r=true}n=s-2;s+=3;break;default:s+=3;break}}i=i.subarray(n);s-=n;n=0;if(i&&i.byteLength>3){o=tn(i[n+3]&31);if(o==="slice_layer_without_partitioning_rbsp_idr"){r=true}}return r};var sn={parseType:Ws,parsePat:Js,parsePmt:Ks,parsePayloadUnitStartIndicator:Gs,parsePesType:Qs,parsePesTime:Zs,videoPacketContainsKeyFrame:en};var nn=Kt;var rn=ne.handleRollover;var on={};on.ts=sn;on.aac=si;var an=pt.ONE_SECOND_IN_TS;var hn=188,cn=71;var ln=function(t,e){var i=0,s=hn,n,r;while(s<t.byteLength){if(t[i]===cn&&t[s]===cn){n=t.subarray(i,s);r=on.ts.parseType(n,e.pid);switch(r){case"pat":e.pid=on.ts.parsePat(n);break;case"pmt":var o=on.ts.parsePmt(n);e.table=e.table||{};Object.keys(o).forEach((function(t){e.table[t]=o[t]}));break}i+=hn;s+=hn;continue}i++;s++}};var un=function(t,e,i){var s=0,n=hn,r,o,a,h,c;var l=false;while(n<=t.byteLength){if(t[s]===cn&&(t[n]===cn||n===t.byteLength)){r=t.subarray(s,n);o=on.ts.parseType(r,e.pid);switch(o){case"pes":a=on.ts.parsePesType(r,e.table);h=on.ts.parsePayloadUnitStartIndicator(r);if(a==="audio"&&h){c=on.ts.parsePesTime(r);if(c){c.type="audio";i.audio.push(c);l=true}}break}if(l){break}s+=hn;n+=hn;continue}s++;n++}n=t.byteLength;s=n-hn;l=false;while(s>=0){if(t[s]===cn&&(t[n]===cn||n===t.byteLength)){r=t.subarray(s,n);o=on.ts.parseType(r,e.pid);switch(o){case"pes":a=on.ts.parsePesType(r,e.table);h=on.ts.parsePayloadUnitStartIndicator(r);if(a==="audio"&&h){c=on.ts.parsePesTime(r);if(c){c.type="audio";i.audio.push(c);l=true}}break}if(l){break}s-=hn;n-=hn;continue}s--;n--}};var fn=function(t,e,i){var s=0,n=hn,r,o,a,h,c,l,u,f;var d=false;var p={data:[],size:0};while(n<t.byteLength){if(t[s]===cn&&t[n]===cn){r=t.subarray(s,n);o=on.ts.parseType(r,e.pid);switch(o){case"pes":a=on.ts.parsePesType(r,e.table);h=on.ts.parsePayloadUnitStartIndicator(r);if(a==="video"){if(h&&!d){c=on.ts.parsePesTime(r);if(c){c.type="video";i.video.push(c);d=true}}if(!i.firstKeyFrame){if(h){if(p.size!==0){l=new Uint8Array(p.size);u=0;while(p.data.length){f=p.data.shift();l.set(f,u);u+=f.byteLength}if(on.ts.videoPacketContainsKeyFrame(l)){var v=on.ts.parsePesTime(l);if(v){i.firstKeyFrame=v;i.firstKeyFrame.type="video"}else{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.")}}p.size=0}}p.data.push(r);p.size+=r.byteLength}}break}if(d&&i.firstKeyFrame){break}s+=hn;n+=hn;continue}s++;n++}n=t.byteLength;s=n-hn;d=false;while(s>=0){if(t[s]===cn&&t[n]===cn){r=t.subarray(s,n);o=on.ts.parseType(r,e.pid);switch(o){case"pes":a=on.ts.parsePesType(r,e.table);h=on.ts.parsePayloadUnitStartIndicator(r);if(a==="video"&&h){c=on.ts.parsePesTime(r);if(c){c.type="video";i.video.push(c);d=true}}break}if(d){break}s-=hn;n-=hn;continue}s--;n--}};var dn=function(t,e){if(t.audio&&t.audio.length){var i=e;if(typeof i==="undefined"||isNaN(i)){i=t.audio[0].dts}t.audio.forEach((function(t){t.dts=rn(t.dts,i);t.pts=rn(t.pts,i);t.dtsTime=t.dts/an;t.ptsTime=t.pts/an}))}if(t.video&&t.video.length){var s=e;if(typeof s==="undefined"||isNaN(s)){s=t.video[0].dts}t.video.forEach((function(t){t.dts=rn(t.dts,s);t.pts=rn(t.pts,s);t.dtsTime=t.dts/an;t.ptsTime=t.pts/an}));if(t.firstKeyFrame){var n=t.firstKeyFrame;n.dts=rn(n.dts,s);n.pts=rn(n.pts,s);n.dtsTime=n.dts/an;n.ptsTime=n.pts/an}}};var pn=function(t){var e=false,i=0,s=null,n=null,r=0,o=0,a;while(t.length-o>=3){var h=on.aac.parseType(t,o);switch(h){case"timed-metadata":if(t.length-o<10){e=true;break}r=on.aac.parseId3TagSize(t,o);if(r>t.length){e=true;break}if(n===null){a=t.subarray(o,o+r);n=on.aac.parseAacTimestamp(a)}o+=r;break;case"audio":if(t.length-o<7){e=true;break}r=on.aac.parseAdtsSize(t,o);if(r>t.length){e=true;break}if(s===null){a=t.subarray(o,o+r);s=on.aac.parseSampleRate(a)}i++;o+=r;break;default:o++;break}if(e){return null}}if(s===null||n===null){return null}var c=an/s;var l={audio:[{type:"audio",dts:n,pts:n},{type:"audio",dts:n+i*1024*c,pts:n+i*1024*c}]};return l};var vn=function(t){var e={pid:null,table:null};var i={};ln(t,e);for(var s in e.table){if(e.table.hasOwnProperty(s)){var n=e.table[s];switch(n){case nn.H264_STREAM_TYPE:i.video=[];fn(t,e,i);if(i.video.length===0){delete i.video}break;case nn.ADTS_STREAM_TYPE:i.audio=[];un(t,e,i);if(i.audio.length===0){delete i.audio}break}}}return i};var mn=function(t,e){var i=on.aac.isLikelyAacData(t);var s;if(i){s=pn(t)}else{s=vn(t)}if(!s||!s.audio&&!s.video){return null}dn(s,e);return s};var gn={inspect:mn,parseAudioPes_:un};const bn=function(t,e){e.on("data",(function(e){const i=e.initSegment;e.initSegment={data:i.buffer,byteOffset:i.byteOffset,byteLength:i.byteLength};const s=e.data;e.data=s.buffer;t.postMessage({action:"data",segment:e,byteOffset:s.byteOffset,byteLength:s.byteLength},[e.data])}));e.on("done",(function(e){t.postMessage({action:"done"})}));e.on("gopInfo",(function(e){t.postMessage({action:"gopInfo",gopInfo:e})}));e.on("videoSegmentTimingInfo",(function(e){const i={start:{decode:pt.videoTsToSeconds(e.start.dts),presentation:pt.videoTsToSeconds(e.start.pts)},end:{decode:pt.videoTsToSeconds(e.end.dts),presentation:pt.videoTsToSeconds(e.end.pts)},baseMediaDecodeTime:pt.videoTsToSeconds(e.baseMediaDecodeTime)};if(e.prependedContentDuration){i.prependedContentDuration=pt.videoTsToSeconds(e.prependedContentDuration)}t.postMessage({action:"videoSegmentTimingInfo",videoSegmentTimingInfo:i})}));e.on("audioSegmentTimingInfo",(function(e){const i={start:{decode:pt.videoTsToSeconds(e.start.dts),presentation:pt.videoTsToSeconds(e.start.pts)},end:{decode:pt.videoTsToSeconds(e.end.dts),presentation:pt.videoTsToSeconds(e.end.pts)},baseMediaDecodeTime:pt.videoTsToSeconds(e.baseMediaDecodeTime)};if(e.prependedContentDuration){i.prependedContentDuration=pt.videoTsToSeconds(e.prependedContentDuration)}t.postMessage({action:"audioSegmentTimingInfo",audioSegmentTimingInfo:i})}));e.on("id3Frame",(function(e){t.postMessage({action:"id3Frame",id3Frame:e})}));e.on("caption",(function(e){t.postMessage({action:"caption",caption:e})}));e.on("trackinfo",(function(e){t.postMessage({action:"trackinfo",trackInfo:e})}));e.on("audioTimingInfo",(function(e){t.postMessage({action:"audioTimingInfo",audioTimingInfo:{start:pt.videoTsToSeconds(e.start),end:pt.videoTsToSeconds(e.end)}})}));e.on("videoTimingInfo",(function(e){t.postMessage({action:"videoTimingInfo",videoTimingInfo:{start:pt.videoTsToSeconds(e.start),end:pt.videoTsToSeconds(e.end)}})}));e.on("log",(function(e){t.postMessage({action:"log",log:e})}))};class yn{constructor(t,e){this.options=e||{};this.self=t;this.init()}init(){if(this.transmuxer){this.transmuxer.dispose()}this.transmuxer=new Mi.Transmuxer(this.options);bn(this.self,this.transmuxer)}pushMp4Captions(t){if(!this.captionParser){this.captionParser=new ms;this.captionParser.init()}const e=new Uint8Array(t.data,t.byteOffset,t.byteLength);const i=this.captionParser.parse(e,t.trackIds,t.timescales);this.self.postMessage({action:"mp4Captions",captions:i&&i.captions||[],logs:i&&i.logs||[],data:e.buffer},[e.buffer])}probeMp4StartTime({timescales:t,data:e}){const i=zs.startTime(t,e);this.self.postMessage({action:"probeMp4StartTime",startTime:i,data:e},[e.buffer])}probeMp4Tracks({data:t}){const e=zs.tracks(t);this.self.postMessage({action:"probeMp4Tracks",tracks:e,data:t},[t.buffer])}probeEmsgID3({data:t,offset:e}){const i=zs.getEmsgID3(t,e);this.self.postMessage({action:"probeEmsgID3",id3Frames:i,emsgData:t},[t.buffer])}probeTs({data:t,baseStartTime:e}){const i=typeof e==="number"&&!isNaN(e)?e*pt.ONE_SECOND_IN_TS:void 0;const s=gn.inspect(t,i);let n=null;if(s){n={hasVideo:s.video&&s.video.length===2||false,hasAudio:s.audio&&s.audio.length===2||false};if(n.hasVideo){n.videoStart=s.video[0].ptsTime}if(n.hasAudio){n.audioStart=s.audio[0].ptsTime}}this.self.postMessage({action:"probeTs",result:n,data:t},[t.buffer])}clearAllMp4Captions(){if(this.captionParser){this.captionParser.clearAllCaptions()}}clearParsedMp4Captions(){if(this.captionParser){this.captionParser.clearParsedCaptions()}}push(t){const e=new Uint8Array(t.data,t.byteOffset,t.byteLength);this.transmuxer.push(e)}reset(){this.transmuxer.reset()}setTimestampOffset(t){const e=t.timestampOffset||0;this.transmuxer.setBaseMediaDecodeTime(Math.round(pt.secondsToVideoTs(e)))}setAudioAppendStart(t){this.transmuxer.setAudioAppendStart(Math.ceil(pt.secondsToVideoTs(t.appendStart)))}setRemux(t){this.transmuxer.setRemux(t.remux)}flush(t){this.transmuxer.flush();self.postMessage({action:"done",type:"transmuxed"})}endTimeline(){this.transmuxer.endTimeline();self.postMessage({action:"endedtimeline",type:"transmuxed"})}alignGopsWith(t){this.transmuxer.alignGopsWith(t.gopsToAlignWith.slice())}}self.onmessage=function(t){if(t.data.action==="init"&&t.data.options){this.messageHandlers=new yn(self,t.data.options);return}if(!this.messageHandlers){this.messageHandlers=new yn(self)}if(t.data&&t.data.action&&t.data.action!=="init"){if(this.messageHandlers[t.data.action]){this.messageHandlers[t.data.action](t.data)}}}})));var jv=mv(yv);const wv=(t,e,i)=>{const{type:s,initSegment:n,captions:r,captionStreams:o,metadata:a,videoFrameDtsTime:h,videoFramePtsTime:c}=t.data.segment;e.buffer.push({captions:r,captionStreams:o,metadata:a});const l=t.data.segment.boxes||{data:t.data.segment.data};const u={type:s,data:new Uint8Array(l.data,l.data.byteOffset,l.data.byteLength),initSegment:new Uint8Array(n.data,n.byteOffset,n.byteLength)};if(typeof h!=="undefined"){u.videoFrameDtsTime=h}if(typeof c!=="undefined"){u.videoFramePtsTime=c}i(u)};const Tv=({transmuxedData:t,callback:e})=>{t.buffer=[];e(t)};const kv=(t,e)=>{e.gopInfo=t.data.gopInfo};const Sv=t=>{const{transmuxer:e,bytes:i,audioAppendStart:s,gopsToAlignWith:n,remux:r,onData:o,onTrackInfo:a,onAudioTimingInfo:h,onVideoTimingInfo:c,onVideoSegmentTimingInfo:l,onAudioSegmentTimingInfo:u,onId3:f,onCaptions:d,onDone:p,onEndedTimeline:v,onTransmuxerLog:m,isEndOfTimeline:g,segment:b,triggerSegmentEventFn:y}=t;const j={buffer:[]};let w=g;const T=i=>{if(e.currentTransmux!==t){return}if(i.data.action==="data"){wv(i,j,o)}if(i.data.action==="trackinfo"){a(i.data.trackInfo)}if(i.data.action==="gopInfo"){kv(i,j)}if(i.data.action==="audioTimingInfo"){h(i.data.audioTimingInfo)}if(i.data.action==="videoTimingInfo"){c(i.data.videoTimingInfo)}if(i.data.action==="videoSegmentTimingInfo"){l(i.data.videoSegmentTimingInfo)}if(i.data.action==="audioSegmentTimingInfo"){u(i.data.audioSegmentTimingInfo)}if(i.data.action==="id3Frame"){f([i.data.id3Frame],i.data.id3Frame.dispatchType)}if(i.data.action==="caption"){d(i.data.caption)}if(i.data.action==="endedtimeline"){w=false;v()}if(i.data.action==="log"){m(i.data.log)}if(i.data.type!=="transmuxed"){return}if(w){return}e.onmessage=null;Tv({transmuxedData:j,callback:p});xv(e)};const k=()=>{const t={message:"Received an error message from the transmuxer worker",metadata:{errorType:cd.Error.StreamingFailedToTransmuxSegment,segmentInfo:Gm({segment:b})}};p(null,t)};e.onmessage=T;e.onerror=k;if(s){e.postMessage({action:"setAudioAppendStart",appendStart:s})}if(Array.isArray(n)){e.postMessage({action:"alignGopsWith",gopsToAlignWith:n})}if(typeof r!=="undefined"){e.postMessage({action:"setRemux",remux:r})}if(i.byteLength){const t=i instanceof ArrayBuffer?i:i.buffer;const s=i instanceof ArrayBuffer?0:i.byteOffset;y({type:"segmenttransmuxingstart",segment:b});e.postMessage({action:"push",data:t,byteOffset:s,byteLength:i.byteLength},[t])}if(g){e.postMessage({action:"endTimeline"})}e.postMessage({action:"flush"})};const xv=t=>{t.currentTransmux=null;if(t.transmuxQueue.length){t.currentTransmux=t.transmuxQueue.shift();if(typeof t.currentTransmux==="function"){t.currentTransmux()}else{Sv(t.currentTransmux)}}};const Av=(t,e)=>{t.postMessage({action:e});xv(t)};const Ev=(t,e)=>{if(!e.currentTransmux){e.currentTransmux=t;Av(e,t);return}e.transmuxQueue.push(Av.bind(null,e,t))};const Iv=t=>{Ev("reset",t)};const Dv=t=>{Ev("endTimeline",t)};const Cv=t=>{if(!t.transmuxer.currentTransmux){t.transmuxer.currentTransmux=t;Sv(t);return}t.transmuxer.transmuxQueue.push(t)};const Nv=t=>{const e=new jv;e.currentTransmux=null;e.transmuxQueue=[];const i=e.terminate;e.terminate=()=>{e.currentTransmux=null;e.transmuxQueue.length=0;return i.call(e)};e.postMessage({action:"init",options:t});return e};var _v={reset:Iv,endTimeline:Dv,transmux:Cv,createTransmuxer:Nv};const Ov=function(t){const e=t.transmuxer;const i=t.endAction||t.action;const s=t.callback;const n=it({},t,{endAction:null,transmuxer:null,callback:null});const r=n=>{if(n.data.action!==i){return}e.removeEventListener("message",r);if(n.data.data){n.data.data=new Uint8Array(n.data.data,t.byteOffset||0,t.byteLength||n.data.data.byteLength);if(t.data){t.data=n.data.data}}s(n.data)};e.addEventListener("message",r);if(t.data){const i=t.data instanceof ArrayBuffer;n.byteOffset=i?0:t.data.byteOffset;n.byteLength=t.data.byteLength;const s=[i?t.data:t.data.buffer];e.postMessage(n,s)}else{e.postMessage(n)}};const Mv={FAILURE:2,TIMEOUT:-101,ABORTED:-102};const Rv=t=>{t.forEach((t=>{t.abort()}))};const Lv=t=>({bandwidth:t.bandwidth,bytesReceived:t.bytesReceived||0,roundTripTime:t.roundTripTime||0});const Pv=t=>{const e=t.target;const i=Date.now()-e.requestTime;const s={bandwidth:Infinity,bytesReceived:0,roundTripTime:i||0};s.bytesReceived=t.loaded;s.bandwidth=Math.floor(s.bytesReceived/s.roundTripTime*8*1e3);return s};const $v=(t,e)=>{const{requestType:i}=e;const s=gp({requestType:i,request:e,error:t});if(e.timedout){return{status:e.status,message:"HLS request timed-out at URL: "+e.uri,code:Mv.TIMEOUT,xhr:e,metadata:s}}if(e.aborted){return{status:e.status,message:"HLS request aborted at URL: "+e.uri,code:Mv.ABORTED,xhr:e,metadata:s}}if(t){return{status:e.status,message:"HLS request errored at URL: "+e.uri,code:Mv.FAILURE,xhr:e,metadata:s}}if(e.responseType==="arraybuffer"&&e.response.byteLength===0){return{status:e.status,message:"Empty HLS response at URL: "+e.uri,code:Mv.FAILURE,xhr:e,metadata:s}}return null};const Fv=(t,e,i,s)=>(n,r)=>{const o=r.response;const a=$v(n,r);if(a){return i(a,t)}if(o.byteLength!==16){return i({status:r.status,message:"Invalid HLS key at URL: "+r.uri,code:Mv.FAILURE,xhr:r},t)}const h=new DataView(o);const c=new Uint32Array([h.getUint32(0),h.getUint32(4),h.getUint32(8),h.getUint32(12)]);for(let t=0;t<e.length;t++){e[t].bytes=c}const l={uri:r.uri};s({type:"segmentkeyloadcomplete",segment:t,keyInfo:l});return i(null,t)};const Uv=(t,e)=>{const i=Uo(t.map.bytes);if(i!=="mp4"){const s=t.map.resolvedUri||t.map.uri;const n=i||"unknown";return e({internal:true,message:`Found unsupported ${n} container for initialization segment at URL: ${s}`,code:Mv.FAILURE,metadata:{mediaType:n}})}Ov({action:"probeMp4Tracks",data:t.map.bytes,transmuxer:t.transmuxer,callback:({tracks:i,data:s})=>{t.map.bytes=s;i.forEach((function(e){t.map.tracks=t.map.tracks||{};if(t.map.tracks[e.type]){return}t.map.tracks[e.type]=e;if(typeof e.id==="number"&&e.timescale){t.map.timescales=t.map.timescales||{};t.map.timescales[e.id]=e.timescale}}));return e(null)}})};const Bv=({segment:t,finishProcessingFn:e,triggerSegmentEventFn:i})=>(s,n)=>{const r=$v(s,n);if(r){return e(r,t)}const o=new Uint8Array(n.response);i({type:"segmentloaded",segment:t});if(t.map.key){t.map.encryptedBytes=o;return e(null,t)}t.map.bytes=o;Uv(t,(function(i){if(i){i.xhr=n;i.status=n.status;return e(i,t)}e(null,t)}))};const qv=({segment:t,finishProcessingFn:e,responseType:i,triggerSegmentEventFn:s})=>(n,r)=>{const o=$v(n,r);if(o){return e(o,t)}s({type:"segmentloaded",segment:t});const a=i==="arraybuffer"||!r.responseText?r.response:dv(r.responseText.substring(t.lastReachedChar||0));t.stats=Lv(r);if(t.key){t.encryptedBytes=new Uint8Array(a)}else{t.bytes=new Uint8Array(a)}return e(null,t)};const Vv=({segment:t,bytes:e,trackInfoFn:i,timingInfoFn:s,videoSegmentTimingInfoFn:n,audioSegmentTimingInfoFn:r,id3Fn:o,captionsFn:a,isEndOfTimeline:h,endedTimelineFn:c,dataFn:l,doneFn:u,onTransmuxerLog:f,triggerSegmentEventFn:d})=>{const p=t.map&&t.map.tracks||{};const v=Boolean(p.audio&&p.video);let m=s.bind(null,t,"audio","start");const g=s.bind(null,t,"audio","end");let b=s.bind(null,t,"video","start");const y=s.bind(null,t,"video","end");const j=()=>Cv({bytes:e,transmuxer:t.transmuxer,audioAppendStart:t.audioAppendStart,gopsToAlignWith:t.gopsToAlignWith,remux:v,onData:e=>{e.type=e.type==="combined"?"video":e.type;l(t,e)},onTrackInfo:e=>{if(i){if(v){e.isMuxed=true}i(t,e)}},onAudioTimingInfo:t=>{if(m&&typeof t.start!=="undefined"){m(t.start);m=null}if(g&&typeof t.end!=="undefined"){g(t.end)}},onVideoTimingInfo:t=>{if(b&&typeof t.start!=="undefined"){b(t.start);b=null}if(y&&typeof t.end!=="undefined"){y(t.end)}},onVideoSegmentTimingInfo:e=>{const i={pts:{start:e.start.presentation,end:e.end.presentation},dts:{start:e.start.decode,end:e.end.decode}};d({type:"segmenttransmuxingtiminginfoavailable",segment:t,timingInfo:i});n(e)},onAudioSegmentTimingInfo:e=>{const i={pts:{start:e.start.pts,end:e.end.pts},dts:{start:e.start.dts,end:e.end.dts}};d({type:"segmenttransmuxingtiminginfoavailable",segment:t,timingInfo:i});r(e)},onId3:(e,i)=>{o(t,e,i)},onCaptions:e=>{a(t,[e])},isEndOfTimeline:h,onEndedTimeline:()=>{c()},onTransmuxerLog:f,onDone:(e,i)=>{if(!u){return}e.type=e.type==="combined"?"video":e.type;d({type:"segmenttransmuxingcomplete",segment:t});u(i,t,e)},segment:t,triggerSegmentEventFn:d});Ov({action:"probeTs",transmuxer:t.transmuxer,data:e,baseStartTime:t.baseStartTime,callback:s=>{t.bytes=e=s.data;const n=s.result;if(n){i(t,{hasAudio:n.hasAudio,hasVideo:n.hasVideo,isMuxed:v});i=null}j()}})};const zv=({segment:t,bytes:e,trackInfoFn:i,timingInfoFn:s,videoSegmentTimingInfoFn:n,audioSegmentTimingInfoFn:r,id3Fn:o,captionsFn:a,isEndOfTimeline:h,endedTimelineFn:c,dataFn:l,doneFn:u,onTransmuxerLog:f,triggerSegmentEventFn:d})=>{let p=new Uint8Array(e);if(Bo(p)){t.isFmp4=true;const{tracks:n}=t.map;const r={isFmp4:true,hasVideo:!!n.video,hasAudio:!!n.audio};if(n.audio&&n.audio.codec&&n.audio.codec!=="enca"){r.audioCodec=n.audio.codec}if(n.video&&n.video.codec&&n.video.codec!=="encv"){r.videoCodec=n.video.codec}if(n.video&&n.audio){r.isMuxed=true}i(t,r);const h=(e,i)=>{l(t,{data:p,type:r.hasAudio&&!r.isMuxed?"audio":"video"});if(i&&i.length){o(t,i)}if(e&&e.length){a(t,e)}u(null,t,{})};Ov({action:"probeMp4StartTime",timescales:t.map.timescales,data:p,transmuxer:t.transmuxer,callback:({data:i,startTime:o})=>{e=i.buffer;t.bytes=p=i;if(r.hasAudio&&!r.isMuxed){s(t,"audio","start",o)}if(r.hasVideo){s(t,"video","start",o)}Ov({action:"probeEmsgID3",data:p,transmuxer:t.transmuxer,offset:o,callback:({emsgData:i,id3Frames:s})=>{e=i.buffer;t.bytes=p=i;if(!n.video||!i.byteLength||!t.transmuxer){h(undefined,s);return}Ov({action:"pushMp4Captions",endAction:"mp4Captions",transmuxer:t.transmuxer,data:p,timescales:t.map.timescales,trackIds:[n.video.id],callback:i=>{e=i.data.buffer;t.bytes=p=i.data;i.logs.forEach((function(t){f(bd(t,{stream:"mp4CaptionParser"}))}));h(i.captions,s)}})}})}});return}if(!t.transmuxer){u(null,t,{});return}if(typeof t.container==="undefined"){t.container=Uo(p)}if(t.container!=="ts"&&t.container!=="aac"){i(t,{hasAudio:false,hasVideo:false});u(null,t,{});return}Vv({segment:t,bytes:e,trackInfoFn:i,timingInfoFn:s,videoSegmentTimingInfoFn:n,audioSegmentTimingInfoFn:r,id3Fn:o,captionsFn:a,isEndOfTimeline:h,endedTimelineFn:c,dataFn:l,doneFn:u,onTransmuxerLog:f,triggerSegmentEventFn:d})};const Hv=function({id:t,key:e,encryptedBytes:i,decryptionWorker:s,segment:n,doneFn:r},o){const a=e=>{if(e.data.source===t){s.removeEventListener("message",a);const t=e.data.decrypted;o(new Uint8Array(t.bytes,t.byteOffset,t.byteLength))}};s.onerror=()=>{const t="An error occurred in the decryption worker";const e=Gm({segment:n});const i={message:t,metadata:{error:new Error(t),errorType:cd.Error.StreamingFailedToDecryptSegment,segmentInfo:e,keyInfo:{uri:n.key.resolvedUri||n.map.key.resolvedUri}}};r(i,n)};s.addEventListener("message",a);let h;if(e.bytes.slice){h=e.bytes.slice()}else{h=new Uint32Array(Array.prototype.slice.call(e.bytes))}s.postMessage($p({source:t,encrypted:i,key:h,iv:e.iv}),[i.buffer,h.buffer])};const Xv=({decryptionWorker:t,segment:e,trackInfoFn:i,timingInfoFn:s,videoSegmentTimingInfoFn:n,audioSegmentTimingInfoFn:r,id3Fn:o,captionsFn:a,isEndOfTimeline:h,endedTimelineFn:c,dataFn:l,doneFn:u,onTransmuxerLog:f,triggerSegmentEventFn:d})=>{d({type:"segmentdecryptionstart"});Hv({id:e.requestId,key:e.key,encryptedBytes:e.encryptedBytes,decryptionWorker:t,segment:e,doneFn:u},(t=>{e.bytes=t;d({type:"segmentdecryptioncomplete",segment:e});zv({segment:e,bytes:e.bytes,trackInfoFn:i,timingInfoFn:s,videoSegmentTimingInfoFn:n,audioSegmentTimingInfoFn:r,id3Fn:o,captionsFn:a,isEndOfTimeline:h,endedTimelineFn:c,dataFn:l,doneFn:u,onTransmuxerLog:f,triggerSegmentEventFn:d})}))};const Gv=({activeXhrs:t,decryptionWorker:e,trackInfoFn:i,timingInfoFn:s,videoSegmentTimingInfoFn:n,audioSegmentTimingInfoFn:r,id3Fn:o,captionsFn:a,isEndOfTimeline:h,endedTimelineFn:c,dataFn:l,doneFn:u,onTransmuxerLog:f,triggerSegmentEventFn:d})=>{let p=0;let v=false;return(m,g)=>{if(v){return}if(m){v=true;Rv(t);return u(m,g)}p+=1;if(p===t.length){const p=function(){if(g.encryptedBytes){return Xv({decryptionWorker:e,segment:g,trackInfoFn:i,timingInfoFn:s,videoSegmentTimingInfoFn:n,audioSegmentTimingInfoFn:r,id3Fn:o,captionsFn:a,isEndOfTimeline:h,endedTimelineFn:c,dataFn:l,doneFn:u,onTransmuxerLog:f,triggerSegmentEventFn:d})}zv({segment:g,bytes:g.bytes,trackInfoFn:i,timingInfoFn:s,videoSegmentTimingInfoFn:n,audioSegmentTimingInfoFn:r,id3Fn:o,captionsFn:a,isEndOfTimeline:h,endedTimelineFn:c,dataFn:l,doneFn:u,onTransmuxerLog:f,triggerSegmentEventFn:d})};g.endOfAllRequests=Date.now();if(g.map&&g.map.encryptedBytes&&!g.map.bytes){d({type:"segmentdecryptionstart",segment:g});return Hv({decryptionWorker:e,id:g.requestId+"-init",encryptedBytes:g.map.encryptedBytes,key:g.map.key,segment:g,doneFn:u},(e=>{g.map.bytes=e;d({type:"segmentdecryptioncomplete",segment:g});Uv(g,(e=>{if(e){Rv(t);return u(e,g)}p()}))}))}p()}}};const Yv=({loadendState:t,abortFn:e})=>i=>{const s=i.target;if(s.aborted&&e&&!t.calledAbortFn){e();t.calledAbortFn=true}};const Wv=({segment:t,progressFn:e,trackInfoFn:i,timingInfoFn:s,videoSegmentTimingInfoFn:n,audioSegmentTimingInfoFn:r,id3Fn:o,captionsFn:a,isEndOfTimeline:h,endedTimelineFn:c,dataFn:l})=>i=>{const s=i.target;if(s.aborted){return}t.stats=bd(t.stats,Pv(i));if(!t.stats.firstBytesReceivedAt&&t.stats.bytesReceived){t.stats.firstBytesReceivedAt=Date.now()}return e(i,t)};const Jv=({xhr:t,xhrOptions:e,decryptionWorker:i,segment:s,abortFn:n,progressFn:r,trackInfoFn:o,timingInfoFn:a,videoSegmentTimingInfoFn:h,audioSegmentTimingInfoFn:c,id3Fn:l,captionsFn:u,isEndOfTimeline:f,endedTimelineFn:d,dataFn:p,doneFn:v,onTransmuxerLog:m,triggerSegmentEventFn:g})=>{const b=[];const y=Gv({activeXhrs:b,decryptionWorker:i,trackInfoFn:o,timingInfoFn:a,videoSegmentTimingInfoFn:h,audioSegmentTimingInfoFn:c,id3Fn:l,captionsFn:u,isEndOfTimeline:f,endedTimelineFn:d,dataFn:p,doneFn:v,onTransmuxerLog:m,triggerSegmentEventFn:g});if(s.key&&!s.key.bytes){const i=[s.key];if(s.map&&!s.map.bytes&&s.map.key&&s.map.key.resolvedUri===s.key.resolvedUri){i.push(s.map.key)}const n=bd(e,{uri:s.key.resolvedUri,responseType:"arraybuffer",requestType:"segment-key"});const r=Fv(s,i,y,g);const o={uri:s.key.resolvedUri};g({type:"segmentkeyloadstart",segment:s,keyInfo:o});const a=t(n,r);b.push(a)}if(s.map&&!s.map.bytes){const i=s.map.key&&(!s.key||s.key.resolvedUri!==s.map.key.resolvedUri);if(i){const i=bd(e,{uri:s.map.key.resolvedUri,responseType:"arraybuffer",requestType:"segment-key"});const n=Fv(s,[s.map.key],y,g);const r={uri:s.map.key.resolvedUri};g({type:"segmentkeyloadstart",segment:s,keyInfo:r});const o=t(i,n);b.push(o)}const n=bd(e,{uri:s.map.resolvedUri,responseType:"arraybuffer",headers:Mp(s.map),requestType:"segment-media-initialization"});const r=Bv({segment:s,finishProcessingFn:y,triggerSegmentEventFn:g});g({type:"segmentloadstart",segment:s});const o=t(n,r);b.push(o)}const j=bd(e,{uri:s.part&&s.part.resolvedUri||s.resolvedUri,responseType:"arraybuffer",headers:Mp(s),requestType:"segment"});const w=qv({segment:s,finishProcessingFn:y,responseType:j.responseType,triggerSegmentEventFn:g});g({type:"segmentloadstart",segment:s});const T=t(j,w);T.addEventListener("progress",Wv({segment:s,progressFn:r,trackInfoFn:o,timingInfoFn:a,videoSegmentTimingInfoFn:h,audioSegmentTimingInfoFn:c,id3Fn:l,captionsFn:u,isEndOfTimeline:f,endedTimelineFn:d,dataFn:p}));b.push(T);const k={};b.forEach((t=>{t.addEventListener("loadend",Yv({loadendState:k,abortFn:n}))}));return()=>Rv(b)};const Kv=gd("CodecUtils");const Qv=function(t){const e=t.attributes||{};if(e.CODECS){return Xe(e.CODECS)}};const Zv=(t,e)=>{const i=e.attributes||{};return t&&t.mediaGroups&&t.mediaGroups.AUDIO&&i.AUDIO&&t.mediaGroups.AUDIO[i.AUDIO]};const tm=(t,e)=>{if(!Zv(t,e)){return true}const i=e.attributes||{};const s=t.mediaGroups.AUDIO[i.AUDIO];for(const t in s){if(!s[t].uri&&!s[t].playlists){return true}}return false};const em=function(t){const e={};t.forEach((({mediaType:t,type:i,details:s})=>{e[t]=e[t]||[];e[t].push(He(`${i}${s}`))}));Object.keys(e).forEach((function(t){if(e[t].length>1){Kv(`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]}));return e};const im=function(t){let e=0;if(t.audio){e++}if(t.video){e++}return e};const sm=function(t,e){const i=e.attributes||{};const s=em(Qv(e)||[]);if(Zv(t,e)&&!s.audio){if(!tm(t,e)){const e=em(Ge(t,i.AUDIO)||[]);if(e.audio){s.audio=e.audio}}}return s};const nm=gd("PlaylistSelector");const rm=function(t){if(!t||!t.playlist){return}const e=t.playlist;return JSON.stringify({id:e.id,bandwidth:t.bandwidth,width:t.width,height:t.height,codecs:e.attributes&&e.attributes.CODECS||""})};const om=function(t,e){if(!t){return""}const i=z.getComputedStyle(t);if(!i){return""}return i[e]};const am=function(t,e){const i=t.slice();t.sort((function(t,s){const n=e(t,s);if(n===0){return i.indexOf(t)-i.indexOf(s)}return n}))};const hm=function(t,e){let i;let s;if(t.attributes.BANDWIDTH){i=t.attributes.BANDWIDTH}i=i||z.Number.MAX_VALUE;if(e.attributes.BANDWIDTH){s=e.attributes.BANDWIDTH}s=s||z.Number.MAX_VALUE;return i-s};const cm=function(t,e){let i;let s;if(t.attributes.RESOLUTION&&t.attributes.RESOLUTION.width){i=t.attributes.RESOLUTION.width}i=i||z.Number.MAX_VALUE;if(e.attributes.RESOLUTION&&e.attributes.RESOLUTION.width){s=e.attributes.RESOLUTION.width}s=s||z.Number.MAX_VALUE;if(i===s&&t.attributes.BANDWIDTH&&e.attributes.BANDWIDTH){return t.attributes.BANDWIDTH-e.attributes.BANDWIDTH}return i-s};let lm=function(t,e,i,s,n,r){if(!t){return}const o={bandwidth:e,width:i,height:s,limitRenditionByPlayerDimensions:n};let a=t.playlists;if(np.isAudioOnly(t)){a=r.getAudioTrackPlaylists_();o.audioOnly=true}let h=a.map((t=>{let e;const i=t.attributes&&t.attributes.RESOLUTION&&t.attributes.RESOLUTION.width;const s=t.attributes&&t.attributes.RESOLUTION&&t.attributes.RESOLUTION.height;e=t.attributes&&t.attributes.BANDWIDTH;e=e||z.Number.MAX_VALUE;return{bandwidth:e,width:i,height:s,playlist:t}}));am(h,((t,e)=>t.bandwidth-e.bandwidth));h=h.filter((t=>!np.isIncompatible(t.playlist)));let c=h.filter((t=>np.isEnabled(t.playlist)));if(!c.length){c=h.filter((t=>!np.isDisabled(t.playlist)))}const l=c.filter((t=>t.bandwidth*fv.BANDWIDTH_VARIANCE<e));let u=l[l.length-1];const f=l.filter((t=>t.bandwidth===u.bandwidth))[0];if(n===false){const t=f||c[0]||h[0];if(t&&t.playlist){let e="sortedPlaylistReps";if(f){e="bandwidthBestRep"}if(c[0]){e="enabledPlaylistReps"}nm(`choosing ${rm(t)} using ${e} with options`,o);return t.playlist}nm("could not choose a playlist with options",o);return null}const d=l.filter((t=>t.width&&t.height));am(d,((t,e)=>t.width-e.width));const p=d.filter((t=>t.width===i&&t.height===s));u=p[p.length-1];const v=p.filter((t=>t.bandwidth===u.bandwidth))[0];let m;let g;let b;if(!v){m=d.filter((t=>t.width>i||t.height>s));g=m.filter((t=>t.width===m[0].width&&t.height===m[0].height));u=g[g.length-1];b=g.filter((t=>t.bandwidth===u.bandwidth))[0]}let y;if(r.leastPixelDiffSelector){const t=d.map((t=>{t.pixelDiff=Math.abs(t.width-i)+Math.abs(t.height-s);return t}));am(t,((t,e)=>{if(t.pixelDiff===e.pixelDiff){return e.bandwidth-t.bandwidth}return t.pixelDiff-e.pixelDiff}));y=t[0]}const j=y||b||v||f||c[0]||h[0];if(j&&j.playlist){let t="sortedPlaylistReps";if(y){t="leastPixelDiffRep"}else if(b){t="resolutionPlusOneRep"}else if(v){t="resolutionBestRep"}else if(f){t="bandwidthBestRep"}else if(c[0]){t="enabledPlaylistReps"}nm(`choosing ${rm(j)} using ${t} with options`,o);return j.playlist}nm("could not choose a playlist with options",o);return null};const um=function(){let t=this.useDevicePixelRatio?z.devicePixelRatio||1:1;if(!isNaN(this.customPixelRatio)){t=this.customPixelRatio}return lm(this.playlists.main,this.systemBandwidth,parseInt(om(this.tech_.el(),"width"),10)*t,parseInt(om(this.tech_.el(),"height"),10)*t,this.limitRenditionByPlayerDimensions,this.playlistController_)};const fm=function(t){let e=-1;let i=-1;if(t<0||t>1){throw new Error("Moving average bandwidth decay must be between 0 and 1.")}return function(){let s=this.useDevicePixelRatio?z.devicePixelRatio||1:1;if(!isNaN(this.customPixelRatio)){s=this.customPixelRatio}if(e<0){e=this.systemBandwidth;i=this.systemBandwidth}if(this.systemBandwidth>0&&this.systemBandwidth!==i){e=t*this.systemBandwidth+(1-t)*e;i=this.systemBandwidth}return lm(this.playlists.main,e,parseInt(om(this.tech_.el(),"width"),10)*s,parseInt(om(this.tech_.el(),"height"),10)*s,this.limitRenditionByPlayerDimensions,this.playlistController_)}};const dm=function(t){const{main:e,currentTime:i,bandwidth:s,duration:n,segmentDuration:r,timeUntilRebuffer:o,currentTimeline:a,syncController:h}=t;const c=e.playlists.filter((t=>!np.isIncompatible(t)));let l=c.filter(np.isEnabled);if(!l.length){l=c.filter((t=>!np.isDisabled(t)))}const u=l.filter(np.hasAttribute.bind(null,"BANDWIDTH"));const f=u.map((t=>{const e=h.getSyncPoint(t,n,a,i);const c=e?1:2;const l=np.estimateSegmentRequestTime(r,s,t);const u=l*c-o;return{playlist:t,rebufferingImpact:u}}));const d=f.filter((t=>t.rebufferingImpact<=0));am(d,((t,e)=>hm(e.playlist,t.playlist)));if(d.length){return d[0]}am(f,((t,e)=>t.rebufferingImpact-e.rebufferingImpact));return f[0]||null};const pm=function(){const t=this.playlists.main.playlists.filter(np.isEnabled);am(t,((t,e)=>hm(t,e)));const e=t.filter((t=>!!sm(this.playlists.main,t).video));return e[0]||null};const vm=t=>{let e=0;let i;if(t.bytes){i=new Uint8Array(t.bytes);t.segments.forEach((t=>{i.set(t,e);e+=t.byteLength}))}return i};function mm(t){try{return new URL(t).pathname.split("/").slice(-2).join("/")}catch(t){return""}}const gm=function(t,e,i){if(!t[i]){e.trigger({type:"usage",name:"vhs-608"});let s=i;if(/^cc708_/.test(i)){s="SERVICE"+i.split("_")[1]}const n=e.textTracks().getTrackById(s);if(n){t[i]=n}else{const n=e.options_.vhs&&e.options_.vhs.captionServices||{};let r=i;let o=i;let a=false;const h=n[s];if(h){r=h.label;o=h.language;a=h.default}t[i]=e.addRemoteTextTrack({kind:"captions",id:s,default:a,label:r,language:o},false).track}}};const bm=function({inbandTextTracks:t,captionArray:e,timestampOffset:i}){if(!e){return}const s=z.WebKitDataCue||z.VTTCue;e.forEach((e=>{const n=e.stream;if(e.content){e.content.forEach((r=>{const o=new s(e.startTime+i,e.endTime+i,r.text);o.line=r.line;o.align="left";o.position=r.position;o.positionAlign="line-left";t[n].addCue(o)}))}else{t[n].addCue(new s(e.startTime+i,e.endTime+i,e.text))}}))};const ym=function(t){Object.defineProperties(t.frame,{id:{get(){cd.log.warn("cue.frame.id is deprecated. Use cue.value.key instead.");return t.value.key}},value:{get(){cd.log.warn("cue.frame.value is deprecated. Use cue.value.data instead.");return t.value.data}},privateData:{get(){cd.log.warn("cue.frame.privateData is deprecated. Use cue.value.data instead.");return t.value.data}}})};const jm=({inbandTextTracks:t,metadataArray:e,timestampOffset:i,videoDuration:s})=>{if(!e){return}const n=z.WebKitDataCue||z.VTTCue;const r=t.metadataTrack_;if(!r){return}e.forEach((t=>{const e=t.cueTime+i;if(typeof e!=="number"||z.isNaN(e)||e<0||!(e<Infinity)){return}if(!t.frames||!t.frames.length){return}t.frames.forEach((t=>{const i=new n(e,e,t.value||t.url||t.data||"");i.frame=t;i.value=t;ym(i);r.addCue(i)}))}));if(!r.cues||!r.cues.length){return}const o=r.cues;const a=[];for(let t=0;t<o.length;t++){if(o[t]){a.push(o[t])}}const h=a.reduce(((t,e)=>{const i=t[e.startTime]||[];i.push(e);t[e.startTime]=i;return t}),{});const c=Object.keys(h).sort(((t,e)=>Number(t)-Number(e)));c.forEach(((t,e)=>{const i=h[t];const n=isFinite(s)?s:t;const r=Number(c[e+1])||n;i.forEach((t=>{t.endTime=r}))}))};const wm={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"};const Tm=new Set(["id","class","startDate","duration","endDate","endOnNext","startTime","endTime","processDateRange"]);const km=({inbandTextTracks:t,dateRanges:e})=>{const i=t.metadataTrack_;if(!i){return}const s=z.WebKitDataCue||z.VTTCue;e.forEach((t=>{for(const e of Object.keys(t)){if(Tm.has(e)){continue}const n=new s(t.startTime,t.endTime,"");n.id=t.id;n.type="com.apple.quicktime.HLS";n.value={key:wm[e],data:t[e]};if(e==="scte35Out"||e==="scte35In"){n.value.data=new Uint8Array(n.value.data.match(/[\da-f]{2}/gi)).buffer}i.addCue(n)}t.processDateRange()}))};const Sm=(t,e,i)=>{if(t.metadataTrack_){return}t.metadataTrack_=i.addRemoteTextTrack({kind:"metadata",label:"Timed Metadata"},false).track;if(!cd.browser.IS_ANY_SAFARI){t.metadataTrack_.inBandMetadataTrackDispatchType=e}};const xm=function(t,e,i){let s;let n;if(!i){return}if(!i.cues){return}s=i.cues.length;while(s--){n=i.cues[s];if(n.startTime>=t&&n.endTime<=e){i.removeCue(n)}}};const Am=function(t){const e=t.cues;if(!e){return}const i={};for(let s=e.length-1;s>=0;s--){const n=e[s];const r=`${n.startTime}-${n.endTime}-${n.text}`;if(i[r]){t.removeCue(n)}else{i[r]=n}}};const Em=(t,e,i)=>{if(typeof e==="undefined"||e===null||!t.length){return[]}const s=Math.ceil((e-i+3)*Jo.ONE_SECOND_IN_TS);let n;for(n=0;n<t.length;n++){if(t[n].pts>s){break}}return t.slice(n)};const Im=(t,e,i)=>{if(!e.length){return t}if(i){return e.slice()}const s=e[0].pts;let n=0;for(n;n<t.length;n++){if(t[n].pts>=s){break}}return t.slice(0,n).concat(e)};const Dm=(t,e,i,s)=>{const n=Math.ceil((e-s)*Jo.ONE_SECOND_IN_TS);const r=Math.ceil((i-s)*Jo.ONE_SECOND_IN_TS);const o=t.slice();let a=t.length;while(a--){if(t[a].pts<=r){break}}if(a===-1){return o}let h=a+1;while(h--){if(t[h].pts<=n){break}}h=Math.max(h,0);o.splice(h,a-h+1);return o};const Cm=function(t,e){if(!t&&!e||!t&&e||t&&!e){return false}if(t===e){return true}const i=Object.keys(t).sort();const s=Object.keys(e).sort();if(i.length!==s.length){return false}for(let n=0;n<i.length;n++){const r=i[n];if(r!==s[n]){return false}if(t[r]!==e[r]){return false}}return true};const Nm=function(t,e,i){e=e||[];const s=[];let n=0;for(let r=0;r<e.length;r++){const o=e[r];if(t===o.timeline){s.push(r);n+=o.duration;if(n>i){return r}}}if(s.length===0){return 0}return s[s.length-1]};const _m=1;const Om=500;const Mm=t=>typeof t==="number"&&isFinite(t);const Rm=1/60;const Lm=(t,e,i)=>{if(t!=="main"||!e||!i){return null}if(!i.hasAudio&&!i.hasVideo){return"Neither audio nor video found in segment."}if(e.hasVideo&&!i.hasVideo){return"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."}if(!e.hasVideo&&i.hasVideo){return"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."}return null};const Pm=(t,e,i)=>{let s=e-fv.BACK_BUFFER_LENGTH;if(t.length){s=Math.max(s,t.start(0))}const n=e-i;return Math.min(n,s)};const $m=t=>{const{startOfSegment:e,duration:i,segment:s,part:n,playlist:{mediaSequence:r,id:o,segments:a=[]},mediaIndex:h,partIndex:c,timeline:l}=t;const u=a.length-1;let f="mediaIndex/partIndex increment";if(t.getMediaInfoForTime){f=`getMediaInfoForTime (${t.getMediaInfoForTime})`}else if(t.isSyncRequest){f="getSyncSegmentCandidate (isSyncRequest)"}if(t.independent){f+=` with independent ${t.independent}`}const d=typeof c==="number";const p=t.segment.uri?"segment":"pre-segment";const v=d?Pd({preloadSegment:s})-1:0;return`${p} [${r+h}/${r+u}]`+(d?` part [${c}/${v}]`:"")+` segment start/end [${s.start} => ${s.end}]`+(d?` part start/end [${n.start} => ${n.end}]`:"")+` startOfSegment [${e}]`+` duration [${i}]`+` timeline [${l}]`+` selected by [${f}]`+` playlist [${o}]`};const Fm=t=>`${t}TimingInfo`;const Um=({segmentTimeline:t,currentTimeline:e,startOfSegment:i,buffered:s,overrideCheck:n})=>{if(!n&&t===e){return null}if(t<e){return i}return s.length?s.end(s.length-1):i};const Bm=({timelineChangeController:t,currentTimeline:e,segmentTimeline:i,loaderType:s,audioDisabled:n})=>{if(e===i){return false}if(s==="audio"){const e=t.lastTimelineChange({type:"main"});return!e||e.to!==i}if(s==="main"&&n){const e=t.pendingTimelineChange({type:"audio"});if(e&&e.to===i){return false}return true}return false};const qm=t=>{if(!t){return false}const e=t.pendingTimelineChange({type:"audio"});const i=t.pendingTimelineChange({type:"main"});const s=e&&i;const n=s&&e.to!==i.to;const r=s&&e.from!==-1&&i.from!==-1;if(r&&n){return true}return false};const Vm=t=>{if(!t){return}t.pause();t.resetEverything();t.load()};const zm=t=>{let e=0;["video","audio"].forEach((function(i){const s=t[`${i}TimingInfo`];if(!s){return}const{start:n,end:r}=s;let o;if(typeof n==="bigint"||typeof r==="bigint"){o=z.BigInt(r)-z.BigInt(n)}else if(typeof n==="number"&&typeof r==="number"){o=r-n}if(typeof o!=="undefined"&&o>e){e=o}}));if(typeof e==="bigint"&&e<Number.MAX_SAFE_INTEGER){e=Number(e)}return e};const Hm=({segmentDuration:t,maxDuration:e})=>{if(!t){return false}return Math.round(t)>e+wd};const Xm=(t,e)=>{if(e!=="hls"){return null}const i=zm({audioTimingInfo:t.audioTimingInfo,videoTimingInfo:t.videoTimingInfo});if(!i){return null}const s=t.playlist.targetDuration;const n=Hm({segmentDuration:i,maxDuration:s*2});const r=Hm({segmentDuration:i,maxDuration:s});const o=`Segment with index ${t.mediaIndex} `+`from playlist ${t.playlist.id} `+`has a duration of ${i} `+`when the reported duration is ${t.duration} `+`and the target duration is ${s}. `+"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";if(n||r){return{severity:n?"warn":"info",message:o}}return null};const Gm=({type:t,segment:e})=>{if(!e){return}const i=Boolean(e.key||e.map&&e.map.ke);const s=Boolean(e.map&&!e.map.bytes);const n=e.startOfSegment===undefined?e.start:e.startOfSegment;return{type:t||e.type,uri:e.resolvedUri||e.uri,start:n,duration:e.duration,isEncrypted:i,isMediaInitialization:s}};class Ym extends cd.EventTarget{constructor(t,e={}){super();if(!t){throw new TypeError("Initialization settings are required")}if(typeof t.currentTime!=="function"){throw new TypeError("No currentTime getter specified")}if(!t.mediaSource){throw new TypeError("No MediaSource specified")}this.bandwidth=t.bandwidth;this.throughput={rate:0,count:0};this.roundTrip=NaN;this.resetStats_();this.mediaIndex=null;this.partIndex=null;this.hasPlayed_=t.hasPlayed;this.currentTime_=t.currentTime;this.seekable_=t.seekable;this.seeking_=t.seeking;this.duration_=t.duration;this.mediaSource_=t.mediaSource;this.vhs_=t.vhs;this.loaderType_=t.loaderType;this.currentMediaInfo_=void 0;this.startingMediaInfo_=void 0;this.segmentMetadataTrack_=t.segmentMetadataTrack;this.goalBufferLength_=t.goalBufferLength;this.sourceType_=t.sourceType;this.sourceUpdater_=t.sourceUpdater;this.inbandTextTracks_=t.inbandTextTracks;this.state_="INIT";this.timelineChangeController_=t.timelineChangeController;this.shouldSaveSegmentTimingInfo_=true;this.parse708captions_=t.parse708captions;this.useDtsForTimestampOffset_=t.useDtsForTimestampOffset;this.captionServices_=t.captionServices;this.exactManifestTimings=t.exactManifestTimings;this.addMetadataToTextTrack=t.addMetadataToTextTrack;this.checkBufferTimeout_=null;this.error_=void 0;this.currentTimeline_=-1;this.shouldForceTimestampOffsetAfterResync_=false;this.pendingSegment_=null;this.xhrOptions_=null;this.pendingSegments_=[];this.audioDisabled_=false;this.isPendingTimestampOffset_=false;this.gopBuffer_=[];this.timeMapping_=0;this.safeAppend_=false;this.appendInitSegment_={audio:true,video:true};this.playlistOfLastInitSegment_={audio:null,video:null};this.callQueue_=[];this.loadQueue_=[];this.metadataQueue_={id3:[],caption:[]};this.waitingOnRemove_=false;this.quotaExceededErrorRetryTimeout_=null;this.activeInitSegmentId_=null;this.initSegments_={};this.cacheEncryptionKeys_=t.cacheEncryptionKeys;this.keyCache_={};this.decrypter_=t.decrypter;this.syncController_=t.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",(()=>{if(!this.isEndOfStream_()){this.ended_=false}}));this.fetchAtBuffer_=false;this.logger_=gd(`SegmentLoader[${this.loaderType_}]`);Object.defineProperty(this,"state",{get(){return this.state_},set(t){if(t!==this.state_){this.logger_(`${this.state_} -> ${t}`);this.state_=t;this.trigger("statechange")}}});this.sourceUpdater_.on("ready",(()=>{if(this.hasEnoughInfoToAppend_()){this.processCallQueue_()}}));this.sourceUpdater_.on("codecschange",(t=>{this.trigger(it({type:"codecschange"},t))}));if(this.loaderType_==="main"){this.timelineChangeController_.on("pendingtimelinechange",(()=>{if(this.hasEnoughInfoToAppend_()){this.processCallQueue_()}}))}if(this.loaderType_==="audio"){this.timelineChangeController_.on("timelinechange",(t=>{this.trigger(it({type:"timelinechange"},t));if(this.hasEnoughInfoToLoad_()){this.processLoadQueue_()}if(this.hasEnoughInfoToAppend_()){this.processCallQueue_()}}))}}get mediaSequenceSync_(){return this.syncController_.getMediaSequenceSync(this.loaderType_)}createTransmuxer_(){return _v.createTransmuxer({remux:false,alignGopsAtEnd:this.safeAppend_,keepOriginalTimestamps:true,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_();if(this.transmuxer_){this.transmuxer_.terminate()}this.resetStats_();if(this.checkBufferTimeout_){z.clearTimeout(this.checkBufferTimeout_)}if(this.syncController_&&this.triggerSyncInfoUpdate_){this.syncController_.off("syncinfoupdate",this.triggerSyncInfoUpdate_)}this.off()}setAudio(t){this.audioDisabled_=!t;if(t){this.appendInitSegment_.audio=true}else{this.sourceUpdater_.removeAudio(0,this.duration_())}}abort(){if(this.state!=="WAITING"){if(this.pendingSegment_){this.pendingSegment_=null}return}this.abort_();this.state="READY";if(!this.paused()){this.monitorBuffer_()}}abort_(){if(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_=false;z.clearTimeout(this.quotaExceededErrorRetryTimeout_);this.quotaExceededErrorRetryTimeout_=null}checkForAbort_(t){if(this.state==="APPENDING"&&!this.pendingSegment_){this.state="READY";return true}if(!this.pendingSegment_||this.pendingSegment_.requestId!==t){return true}return false}error(t){if(typeof t!=="undefined"){this.logger_("error occurred:",t);this.error_=t}this.pendingSegment_=null;return this.error_}endOfStream(){this.ended_=true;if(this.transmuxer_){_v.reset(this.transmuxer_)}this.gopBuffer_.length=0;this.pause();this.trigger("ended")}buffered_(){const t=this.getMediaInfo_();if(!this.sourceUpdater_||!t){return yd()}if(this.loaderType_==="main"){const{hasAudio:e,hasVideo:i,isMuxed:s}=t;if(i&&e&&!this.audioDisabled_&&!s){return this.sourceUpdater_.buffered()}if(i){return this.sourceUpdater_.videoBuffered()}}return this.sourceUpdater_.audioBuffered()}initSegmentForMap(t,e=false){if(!t){return null}const i=Fp(t);let s=this.initSegments_[i];if(e&&!s&&t.bytes){this.initSegments_[i]=s={resolvedUri:t.resolvedUri,byterange:t.byterange,bytes:t.bytes,tracks:t.tracks,timescales:t.timescales}}return s||t}segmentKey(t,e=false){if(!t){return null}const i=Up(t);let s=this.keyCache_[i];if(this.cacheEncryptionKeys_&&e&&!s&&t.bytes){this.keyCache_[i]=s={resolvedUri:t.resolvedUri,bytes:t.bytes}}const n={resolvedUri:(s||t).resolvedUri};if(s){n.bytes=s.bytes}return n}couldBeginLoading_(){return this.playlist_&&!this.paused()}load(){this.monitorBuffer_();if(!this.playlist_){return}if(this.state==="INIT"&&this.couldBeginLoading_()){return this.init_()}if(!this.couldBeginLoading_()||this.state!=="READY"&&this.state!=="INIT"){return}this.state="READY"}init_(){this.state="READY";this.resetEverything();return this.monitorBuffer_()}playlist(t,e={}){if(!t){return}const i=this.playlist_;const s=this.pendingSegment_;this.playlist_=t;this.xhrOptions_=e;if(this.state==="INIT"){t.syncInfo={mediaSequence:t.mediaSequence,time:0};if(this.loaderType_==="main"){this.syncController_.setDateTimeMappingForStart(t)}}let n=null;if(i){if(i.id){n=i.id}else if(i.uri){n=i.uri}}this.logger_(`playlist update [${n} => ${t.id||t.uri}]`);if(this.mediaSequenceSync_){this.mediaSequenceSync_.update(t,this.currentTime_());this.logger_(`Playlist update:\ncurrentTime: ${this.currentTime_()}\nbufferedEnd: ${_d(this.buffered_())}\n`,this.mediaSequenceSync_.diagnostics)}this.trigger("syncinfoupdate");if(this.state==="INIT"&&this.couldBeginLoading_()){return this.init_()}if(!i||i.uri!==t.uri){if(this.mediaIndex!==null){const e=!t.endList&&typeof t.partTargetDuration==="number";if(e){this.resetLoader()}else{this.resyncLoader()}}this.currentMediaInfo_=void 0;this.trigger("playlistupdate");return}const r=t.mediaSequence-i.mediaSequence;this.logger_(`live window shift [${r}]`);if(this.mediaIndex!==null){this.mediaIndex-=r;if(this.mediaIndex<0){this.mediaIndex=null;this.partIndex=null}else{const t=this.playlist_.segments[this.mediaIndex];if(this.partIndex&&(!t.parts||!t.parts.length||!t.parts[this.partIndex])){const t=this.mediaIndex;this.logger_(`currently processing part (index ${this.partIndex}) no longer exists.`);this.resetLoader();this.mediaIndex=t}}}if(s){s.mediaIndex-=r;if(s.mediaIndex<0){s.mediaIndex=null;s.partIndex=null}else{if(s.mediaIndex>=0){s.segment=t.segments[s.mediaIndex]}if(s.partIndex>=0&&s.segment.parts){s.part=s.segment.parts[s.partIndex]}}}this.syncController_.saveExpiredSegmentInfo(i,t)}pause(){if(this.checkBufferTimeout_){z.clearTimeout(this.checkBufferTimeout_);this.checkBufferTimeout_=null}}paused(){return this.checkBufferTimeout_===null}resetEverything(t){this.ended_=false;this.activeInitSegmentId_=null;this.appendInitSegment_={audio:true,video:true};this.resetLoader();this.remove(0,Infinity,t);if(this.transmuxer_){this.transmuxer_.postMessage({action:"clearAllMp4Captions"});this.transmuxer_.postMessage({action:"reset"})}}resetLoader(){this.fetchAtBuffer_=false;if(this.mediaSequenceSync_){this.mediaSequenceSync_.resetAppendedStatus()}this.resyncLoader()}resyncLoader(){if(this.transmuxer_){_v.reset(this.transmuxer_)}this.mediaIndex=null;this.partIndex=null;this.syncPoint_=null;this.isPendingTimestampOffset_=false;const t=this.currentMediaInfo_&&this.currentMediaInfo_.isFmp4;const e=this.sourceType_==="hls"&&!t;if(e){this.shouldForceTimestampOffsetAfterResync_=true}this.callQueue_=[];this.loadQueue_=[];this.metadataQueue_.id3=[];this.metadataQueue_.caption=[];this.abort();if(this.transmuxer_){this.transmuxer_.postMessage({action:"clearParsedMp4Captions"})}}remove(t,e,i=(()=>{}),s=false){if(e===Infinity){e=this.duration_()}if(e<=t){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 r=()=>{n--;if(n===0){i()}};if(s||!this.audioDisabled_){n++;this.sourceUpdater_.removeAudio(t,e,r)}if(s||this.loaderType_==="main"){this.gopBuffer_=Dm(this.gopBuffer_,t,e,this.timeMapping_);n++;this.sourceUpdater_.removeVideo(t,e,r)}for(const i in this.inbandTextTracks_){xm(t,e,this.inbandTextTracks_[i])}xm(t,e,this.segmentMetadataTrack_);r()}monitorBuffer_(){if(this.checkBufferTimeout_){z.clearTimeout(this.checkBufferTimeout_)}this.checkBufferTimeout_=z.setTimeout(this.monitorBufferTick_.bind(this),1)}monitorBufferTick_(){if(this.state==="READY"){this.fillBuffer_()}if(this.checkBufferTimeout_){z.clearTimeout(this.checkBufferTimeout_)}this.checkBufferTimeout_=z.setTimeout(this.monitorBufferTick_.bind(this),Om)}fillBuffer_(){if(this.sourceUpdater_.updating()){return}const t=this.chooseNextRequest_();if(!t){return}const e={segmentInfo:Gm({type:this.loaderType_,segment:t})};this.trigger({type:"segmentselected",metadata:e});if(typeof t.timestampOffset==="number"){this.isPendingTimestampOffset_=false;this.timelineChangeController_.pendingTimelineChange({type:this.loaderType_,from:this.currentTimeline_,to:t.timeline})}this.loadSegment_(t)}isEndOfStream_(t=this.mediaIndex,e=this.playlist_,i=this.partIndex){if(!e||!this.mediaSource_){return false}const s=typeof t==="number"&&e.segments[t];const n=t+1===e.segments.length;const r=!s||!s.parts||i+1===s.parts.length;return e.endList&&this.mediaSource_.readyState==="open"&&n&&r}chooseNextRequest_(){const t=this.buffered_();const e=_d(t)||0;const i=Od(t,this.currentTime_());const s=!this.hasPlayed_()&&i>=1;const n=i>=this.goalBufferLength_();const r=this.playlist_.segments;if(!r.length||s||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:Boolean(!this.syncPoint_)};if(o.isSyncRequest){o.mediaIndex=Nm(this.currentTimeline_,r,e);this.logger_(`choose next request. Can not find sync point. Fallback to media Index: ${o.mediaIndex}`)}else if(this.mediaIndex!==null){const t=r[this.mediaIndex];const i=typeof this.partIndex==="number"?this.partIndex:-1;o.startOfSegment=t.end?t.end:e;if(t.parts&&t.parts[i+1]){o.mediaIndex=this.mediaIndex;o.partIndex=i+1}else{o.mediaIndex=this.mediaIndex+1}}else{let t;let i;let s;const n=this.fetchAtBuffer_?e:this.currentTime_();if(this.mediaSequenceSync_){this.logger_(`chooseNextRequest_ request after Quality Switch:\nFor TargetTime: ${n}.\nCurrentTime: ${this.currentTime_()}\nBufferedEnd: ${e}\nFetch At Buffer: ${this.fetchAtBuffer_}\n`,this.mediaSequenceSync_.diagnostics)}if(this.mediaSequenceSync_&&this.mediaSequenceSync_.isReliable){const e=this.getSyncInfoFromMediaSequenceSync_(n);if(!e){const t="No sync info found while using media sequence sync";this.error({message:t,metadata:{errorType:cd.Error.StreamingFailedToSelectNextSegment,error:new Error(t)}});this.logger_("chooseNextRequest_ - no sync info found using media sequence sync");return null}this.logger_(`chooseNextRequest_ mediaSequence syncInfo (${e.start} --\x3e ${e.end})`);t=e.segmentIndex;i=e.partIndex;s=e.start}else{this.logger_("chooseNextRequest_ - fallback to a regular segment selection algorithm, based on a syncPoint.");const e=np.getMediaInfoForTime({exactManifestTimings:this.exactManifestTimings,playlist:this.playlist_,currentTime:n,startingPartIndex:this.syncPoint_.partIndex,startingSegmentIndex:this.syncPoint_.segmentIndex,startTime:this.syncPoint_.time});t=e.segmentIndex;i=e.partIndex;s=e.startTime}o.getMediaInfoForTime=this.fetchAtBuffer_?`bufferedEnd ${n}`:`currentTime ${n}`;o.mediaIndex=t;o.startOfSegment=s;o.partIndex=i;this.logger_(`choose next request. Playlist switched and we have a sync point. Media Index: ${o.mediaIndex} `)}const a=r[o.mediaIndex];let h=a&&typeof o.partIndex==="number"&&a.parts&&a.parts[o.partIndex];if(!a||typeof o.partIndex==="number"&&!h){return null}if(typeof o.partIndex!=="number"&&a.parts){o.partIndex=0;h=a.parts[0]}const c=this.vhs_.playlists&&this.vhs_.playlists.main&&this.vhs_.playlists.main.independentSegments||this.playlist_.independentSegments;if(!i&&h&&!c&&!h.independent){if(o.partIndex===0){const t=r[o.mediaIndex-1];const e=t.parts&&t.parts.length&&t.parts[t.parts.length-1];if(e&&e.independent){o.mediaIndex-=1;o.partIndex=t.parts.length-1;o.independent="previous segment"}}else if(a.parts[o.partIndex-1].independent){o.partIndex-=1;o.independent="previous part"}}const l=this.mediaSource_&&this.mediaSource_.readyState==="ended";if(o.mediaIndex>=r.length-1&&l&&!this.seeking_()){return null}if(this.shouldForceTimestampOffsetAfterResync_){this.shouldForceTimestampOffsetAfterResync_=false;o.forceTimestampOffset=true;this.logger_("choose next request. Force timestamp offset after loader resync")}return this.generateSegmentInfo_(o)}getSyncInfoFromMediaSequenceSync_(t){if(!this.mediaSequenceSync_){return null}const e=Math.max(t,this.mediaSequenceSync_.start);if(t!==e){this.logger_(`getSyncInfoFromMediaSequenceSync_. Pulled target time from ${t} to ${e}`)}const i=this.mediaSequenceSync_.getSyncInfoForTime(e);if(!i){return null}if(!i.isAppended){return i}const s=this.mediaSequenceSync_.getSyncInfoForTime(i.end);if(!s){return null}if(s.isAppended){this.logger_("getSyncInfoFromMediaSequenceSync_: We encounter unexpected scenario where next media sequence sync info is also appended!")}return s}generateSegmentInfo_(t){const{independent:e,playlist:i,mediaIndex:s,startOfSegment:n,isSyncRequest:r,partIndex:o,forceTimestampOffset:a,getMediaInfoForTime:h}=t;const c=i.segments[s];const l=typeof o==="number"&&c.parts[o];const u={requestId:"segment-loader-"+Math.random(),uri:l&&l.resolvedUri||c.resolvedUri,mediaIndex:s,partIndex:l?o:null,isSyncRequest:r,startOfSegment:n,playlist:i,bytes:null,encryptedBytes:null,timestampOffset:null,timeline:c.timeline,duration:l&&l.duration||c.duration,segment:c,part:l,byteLength:0,transmuxer:this.transmuxer_,getMediaInfoForTime:h,independent:e};const f=typeof a!=="undefined"?a:this.isPendingTimestampOffset_;u.timestampOffset=this.timestampOffsetForSegment_({segmentTimeline:c.timeline,currentTimeline:this.currentTimeline_,startOfSegment:n,buffered:this.buffered_(),overrideCheck:f});const d=_d(this.sourceUpdater_.audioBuffered());if(typeof d==="number"){u.audioAppendStart=d-this.sourceUpdater_.audioTimestampOffset()}if(this.sourceUpdater_.videoBuffered().length){u.gopsToAlignWith=Em(this.gopBuffer_,this.currentTime_()-this.sourceUpdater_.videoTimestampOffset(),this.timeMapping_)}return u}timestampOffsetForSegment_(t){return Um(t)}earlyAbortWhenNeeded_(t){if(this.vhs_.tech_.paused()||!this.xhrOptions_.timeout||!this.playlist_.attributes.BANDWIDTH){return}if(Date.now()-(t.firstBytesReceivedAt||Date.now())<1e3){return}const e=this.currentTime_();const i=t.bandwidth;const s=this.pendingSegment_.duration;const n=np.estimateSegmentRequestTime(s,i,this.playlist_,t.bytesReceived);const r=Dd(this.buffered_(),e,this.vhs_.tech_.playbackRate())-1;if(n<=r){return}const o=dm({main:this.vhs_.playlists.main,currentTime:e,bandwidth:i,duration:this.duration_(),segmentDuration:s,timeUntilRebuffer:r,currentTimeline:this.currentTimeline_,syncController:this.syncController_});if(!o){return}const a=n-r;const h=a-o.rebufferingImpact;let c=.5;if(r<=wd){c=1}if(!o.playlist||o.playlist.uri===this.playlist_.uri||h<c){return}this.bandwidth=o.playlist.attributes.BANDWIDTH*fv.BANDWIDTH_VARIANCE+1;this.trigger("earlyabort")}handleAbort_(t){this.logger_(`Aborting ${$m(t)}`);this.mediaRequestsAborted+=1}handleProgress_(t,e){this.earlyAbortWhenNeeded_(e.stats);if(this.checkForAbort_(e.requestId)){return}this.trigger("progress")}handleTrackInfo_(t,e){const{hasAudio:i,hasVideo:s}=e;const n={segmentInfo:Gm({type:this.loaderType_,segment:t}),trackInfo:{hasAudio:i,hasVideo:s}};this.trigger({type:"segmenttransmuxingtrackinfoavailable",metadata:n});this.earlyAbortWhenNeeded_(t.stats);if(this.checkForAbort_(t.requestId)){return}if(this.checkForIllegalMediaSwitch(e)){return}e=e||{};if(!Cm(this.currentMediaInfo_,e)){this.appendInitSegment_={audio:true,video:true};this.startingMediaInfo_=e;this.currentMediaInfo_=e;this.logger_("trackinfo update",e);this.trigger("trackinfo")}if(this.checkForAbort_(t.requestId)){return}this.pendingSegment_.trackInfo=e;if(this.hasEnoughInfoToAppend_()){this.processCallQueue_()}}handleTimingInfo_(t,e,i,s){this.earlyAbortWhenNeeded_(t.stats);if(this.checkForAbort_(t.requestId)){return}const n=this.pendingSegment_;const r=Fm(e);n[r]=n[r]||{};n[r][i]=s;this.logger_(`timinginfo: ${e} - ${i} - ${s}`);if(this.hasEnoughInfoToAppend_()){this.processCallQueue_()}}handleCaptions_(t,e){this.earlyAbortWhenNeeded_(t.stats);if(this.checkForAbort_(t.requestId)){return}if(e.length===0){this.logger_("SegmentLoader received no captions from a caption event");return}const i=this.pendingSegment_;if(!i.hasAppendedData_){this.metadataQueue_.caption.push(this.handleCaptions_.bind(this,t,e));return}const s=this.sourceUpdater_.videoTimestampOffset()===null?this.sourceUpdater_.audioTimestampOffset():this.sourceUpdater_.videoTimestampOffset();const n={};e.forEach((t=>{n[t.stream]=n[t.stream]||{startTime:Infinity,captions:[],endTime:0};const e=n[t.stream];e.startTime=Math.min(e.startTime,t.startTime+s);e.endTime=Math.max(e.endTime,t.endTime+s);e.captions.push(t)}));Object.keys(n).forEach((t=>{const{startTime:e,endTime:i,captions:r}=n[t];const o=this.inbandTextTracks_;this.logger_(`adding cues from ${e} -> ${i} for ${t}`);gm(o,this.vhs_.tech_,t);xm(e,i,o[t]);bm({captionArray:r,inbandTextTracks:o,timestampOffset:s})}));if(this.transmuxer_){this.transmuxer_.postMessage({action:"clearParsedMp4Captions"})}}handleId3_(t,e,i){this.earlyAbortWhenNeeded_(t.stats);if(this.checkForAbort_(t.requestId)){return}const s=this.pendingSegment_;if(!s.hasAppendedData_){this.metadataQueue_.id3.push(this.handleId3_.bind(this,t,e,i));return}this.addMetadataToTextTrack(i,e,this.duration_())}processMetadataQueue_(){this.metadataQueue_.id3.forEach((t=>t()));this.metadataQueue_.caption.forEach((t=>t()));this.metadataQueue_.id3=[];this.metadataQueue_.caption=[]}processCallQueue_(){const t=this.callQueue_;this.callQueue_=[];t.forEach((t=>t()))}processLoadQueue_(){const t=this.loadQueue_;this.loadQueue_=[];t.forEach((t=>t()))}hasEnoughInfoToLoad_(){if(this.loaderType_!=="audio"){return true}const t=this.pendingSegment_;if(!t){return false}if(!this.getCurrentMediaInfo_()){return true}if(Bm({timelineChangeController:this.timelineChangeController_,currentTimeline:this.currentTimeline_,segmentTimeline:t.timeline,loaderType:this.loaderType_,audioDisabled:this.audioDisabled_})){if(qm(this.timelineChangeController_)){Vm(this)}return false}return true}getCurrentMediaInfo_(t=this.pendingSegment_){return t&&t.trackInfo||this.currentMediaInfo_}getMediaInfo_(t=this.pendingSegment_){return this.getCurrentMediaInfo_(t)||this.startingMediaInfo_}getPendingSegmentPlaylist(){return this.pendingSegment_?this.pendingSegment_.playlist:null}hasEnoughInfoToAppend_(){if(!this.sourceUpdater_.ready()){return false}if(this.waitingOnRemove_||this.quotaExceededErrorRetryTimeout_){return false}const t=this.pendingSegment_;const e=this.getCurrentMediaInfo_();if(!t||!e){return false}const{hasAudio:i,hasVideo:s,isMuxed:n}=e;if(s&&!t.videoTimingInfo){return false}if(i&&!this.audioDisabled_&&!n&&!t.audioTimingInfo){return false}if(Bm({timelineChangeController:this.timelineChangeController_,currentTimeline:this.currentTimeline_,segmentTimeline:t.timeline,loaderType:this.loaderType_,audioDisabled:this.audioDisabled_})){if(qm(this.timelineChangeController_)){Vm(this)}return false}return true}handleData_(t,e){this.earlyAbortWhenNeeded_(t.stats);if(this.checkForAbort_(t.requestId)){return}if(this.callQueue_.length||!this.hasEnoughInfoToAppend_()){this.callQueue_.push(this.handleData_.bind(this,t,e));return}const i=this.pendingSegment_;this.setTimeMapping_(i.timeline);this.updateMediaSecondsLoaded_(i.part||i.segment);if(this.mediaSource_.readyState==="closed"){return}if(t.map){t.map=this.initSegmentForMap(t.map,true);i.segment.map=t.map}if(t.key){this.segmentKey(t.key,true)}i.isFmp4=t.isFmp4;i.timingInfo=i.timingInfo||{};if(i.isFmp4){this.trigger("fmp4");i.timingInfo.start=i[Fm(e.type)].start}else{const t=this.getCurrentMediaInfo_();const e=this.loaderType_==="main"&&t&&t.hasVideo;let s;if(e){s=i.videoTimingInfo.start}i.timingInfo.start=this.trueSegmentStart_({currentStart:i.timingInfo.start,playlist:i.playlist,mediaIndex:i.mediaIndex,currentVideoTimestampOffset:this.sourceUpdater_.videoTimestampOffset(),useVideoTimingInfo:e,firstVideoFrameTimeForData:s,videoTimingInfo:i.videoTimingInfo,audioTimingInfo:i.audioTimingInfo})}this.updateAppendInitSegmentStatus(i,e.type);this.updateSourceBufferTimestampOffset_(i);if(i.isSyncRequest){this.updateTimingInfoEnd_(i);this.syncController_.saveSegmentTimingInfo({segmentInfo:i,shouldSaveTimelineMapping:this.loaderType_==="main"});const t=this.chooseNextRequest_();if(t.mediaIndex!==i.mediaIndex||t.partIndex!==i.partIndex){this.logger_("sync segment was incorrect, not appending");return}this.logger_("sync segment was correct, appending")}i.hasAppendedData_=true;this.processMetadataQueue_();this.appendData_(i,e)}updateAppendInitSegmentStatus(t,e){if(this.loaderType_==="main"&&typeof t.timestampOffset==="number"&&!t.changedTimestampOffset){this.appendInitSegment_={audio:true,video:true}}if(this.playlistOfLastInitSegment_[e]!==t.playlist){this.appendInitSegment_[e]=true}}getInitSegmentAndUpdateState_({type:t,initSegment:e,map:i,playlist:s}){if(i){const t=Fp(i);if(this.activeInitSegmentId_===t){return null}e=this.initSegmentForMap(i,true).bytes;this.activeInitSegmentId_=t}if(e&&this.appendInitSegment_[t]){this.playlistOfLastInitSegment_[t]=s;this.appendInitSegment_[t]=false;this.activeInitSegmentId_=null;return e}return null}handleQuotaExceededError_({segmentInfo:t,type:e,bytes:i},s){const n=this.sourceUpdater_.audioBuffered();const r=this.sourceUpdater_.videoBuffered();if(n.length>1){this.logger_("On QUOTA_EXCEEDED_ERR, found gaps in the audio buffer: "+Cd(n).join(", "))}if(r.length>1){this.logger_("On QUOTA_EXCEEDED_ERR, found gaps in the video buffer: "+Cd(r).join(", "))}const o=n.length?n.start(0):0;const a=n.length?n.end(n.length-1):0;const h=r.length?r.start(0):0;const c=r.length?r.end(r.length-1):0;if(a-o<=_m&&c-h<=_m){this.logger_("On QUOTA_EXCEEDED_ERR, single segment too large to append to "+"buffer, triggering an error. "+`Appended byte length: ${i.byteLength}, `+`audio buffer: ${Cd(n).join(", ")}, `+`video buffer: ${Cd(r).join(", ")}, `);this.error({message:"Quota exceeded error with append of a single segment of content",excludeUntil:Infinity});this.trigger("error");return}this.waitingOnRemove_=true;this.callQueue_.push(this.appendToSourceBuffer_.bind(this,{segmentInfo:t,type:e,bytes:i}));const l=this.currentTime_();const u=l-_m;this.logger_(`On QUOTA_EXCEEDED_ERR, removing audio/video from 0 to ${u}`);this.remove(0,u,(()=>{this.logger_(`On QUOTA_EXCEEDED_ERR, retrying append in ${_m}s`);this.waitingOnRemove_=false;this.quotaExceededErrorRetryTimeout_=z.setTimeout((()=>{this.logger_("On QUOTA_EXCEEDED_ERR, re-processing call queue");this.quotaExceededErrorRetryTimeout_=null;this.processCallQueue_()}),_m*1e3)}),true)}handleAppendError_({segmentInfo:t,type:e,bytes:i},s){if(!s){return}if(s.code===mp){this.handleQuotaExceededError_({segmentInfo:t,type:e,bytes:i});return}this.logger_("Received non QUOTA_EXCEEDED_ERR on append",s);this.error({message:`${e} append of ${i.length}b failed for segment `+`#${t.mediaIndex} in playlist ${t.playlist.id}`,metadata:{errorType:cd.Error.StreamingFailedToAppendSegment}});this.trigger("appenderror")}appendToSourceBuffer_({segmentInfo:t,type:e,initSegment:i,data:s,bytes:n}){if(!n){const t=[s];let e=s.byteLength;if(i){t.unshift(i);e+=i.byteLength}n=vm({bytes:e,segments:t})}const r={segmentInfo:Gm({type:this.loaderType_,segment:t})};this.trigger({type:"segmentappendstart",metadata:r});this.sourceUpdater_.appendBuffer({segmentInfo:t,type:e,bytes:n},this.handleAppendError_.bind(this,{segmentInfo:t,type:e,bytes:n}))}handleSegmentTimingInfo_(t,e,i){if(!this.pendingSegment_||e!==this.pendingSegment_.requestId){return}const s=this.pendingSegment_.segment;const n=`${t}TimingInfo`;if(!s[n]){s[n]={}}s[n].transmuxerPrependedSeconds=i.prependedContentDuration||0;s[n].transmuxedPresentationStart=i.start.presentation;s[n].transmuxedDecodeStart=i.start.decode;s[n].transmuxedPresentationEnd=i.end.presentation;s[n].transmuxedDecodeEnd=i.end.decode;s[n].baseMediaDecodeTime=i.baseMediaDecodeTime}appendData_(t,e){const{type:i,data:s}=e;if(!s||!s.byteLength){return}if(i==="audio"&&this.audioDisabled_){return}const n=this.getInitSegmentAndUpdateState_({type:i,initSegment:e.initSegment,playlist:t.playlist,map:t.isFmp4?t.segment.map:null});this.appendToSourceBuffer_({segmentInfo:t,type:i,initSegment:n,data:s})}loadSegment_(t){this.state="WAITING";this.pendingSegment_=t;this.trimBackBuffer_(t);if(typeof t.timestampOffset==="number"){if(this.transmuxer_){this.transmuxer_.postMessage({action:"clearAllMp4Captions"})}}if(!this.hasEnoughInfoToLoad_()){this.loadQueue_.push((()=>{const e=it({},t,{forceTimestampOffset:true});it(t,this.generateSegmentInfo_(e));this.isPendingTimestampOffset_=false;this.updateTransmuxerAndRequestSegment_(t)}));return}this.updateTransmuxerAndRequestSegment_(t)}updateTransmuxerAndRequestSegment_(t){if(this.shouldUpdateTransmuxerTimestampOffset_(t.timestampOffset)){this.gopBuffer_.length=0;t.gopsToAlignWith=[];this.timeMapping_=0;this.transmuxer_.postMessage({action:"reset"});this.transmuxer_.postMessage({action:"setTimestampOffset",timestampOffset:t.timestampOffset})}const e=this.createSimplifiedSegmentObj_(t);const i=this.isEndOfStream_(t.mediaIndex,t.playlist,t.partIndex);const s=this.mediaIndex!==null;const n=t.timeline!==this.currentTimeline_&&t.timeline>0;const r=i||s&&n;this.logger_(`Requesting\n${mm(t.uri)}\n${$m(t)}`);if(e.map&&!e.map.bytes){this.logger_("going to request init segment.");this.appendInitSegment_={video:true,audio:true}}t.abortRequests=Jv({xhr:this.vhs_.xhr,xhrOptions:this.xhrOptions_,decryptionWorker:this.decrypter_,segment:e,abortFn:this.handleAbort_.bind(this,t),progressFn:this.handleProgress_.bind(this),trackInfoFn:this.handleTrackInfo_.bind(this),timingInfoFn:this.handleTimingInfo_.bind(this),videoSegmentTimingInfoFn:this.handleSegmentTimingInfo_.bind(this,"video",t.requestId),audioSegmentTimingInfoFn:this.handleSegmentTimingInfo_.bind(this,"audio",t.requestId),captionsFn:this.handleCaptions_.bind(this),isEndOfTimeline:r,endedTimelineFn:()=>{this.logger_("received endedtimeline callback")},id3Fn:this.handleId3_.bind(this),dataFn:this.handleData_.bind(this),doneFn:this.segmentRequestFinished_.bind(this),onTransmuxerLog:({message:e,level:i,stream:s})=>{this.logger_(`${$m(t)} logged from transmuxer stream ${s} as a ${i}: ${e}`)},triggerSegmentEventFn:({type:t,segment:e,keyInfo:i,trackInfo:s,timingInfo:n})=>{const r=Gm({segment:e});const o={segmentInfo:r};if(i){o.keyInfo=i}if(s){o.trackInfo=s}if(n){o.timingInfo=n}this.trigger({type:t,metadata:o})}})}trimBackBuffer_(t){const e=Pm(this.seekable_(),this.currentTime_(),this.playlist_.targetDuration||10);if(e>0){this.remove(0,e)}}createSimplifiedSegmentObj_(t){const e=t.segment;const i=t.part;const s=t.segment.key||t.segment.map&&t.segment.map.key;const n=t.segment.map&&!t.segment.map.bytes;const r={resolvedUri:i?i.resolvedUri:e.resolvedUri,byterange:i?i.byterange:e.byterange,requestId:t.requestId,transmuxer:t.transmuxer,audioAppendStart:t.audioAppendStart,gopsToAlignWith:t.gopsToAlignWith,part:t.part,type:this.loaderType_,start:t.startOfSegment,duration:t.duration,isEncrypted:s,isMediaInitialization:n};const o=t.playlist.segments[t.mediaIndex-1];if(o&&o.timeline===e.timeline){if(o.videoTimingInfo){r.baseStartTime=o.videoTimingInfo.transmuxedDecodeEnd}else if(o.audioTimingInfo){r.baseStartTime=o.audioTimingInfo.transmuxedDecodeEnd}}if(e.key){const i=e.key.iv||new Uint32Array([0,0,0,t.mediaIndex+t.playlist.mediaSequence]);r.key=this.segmentKey(e.key);r.key.iv=i}if(e.map){r.map=this.initSegmentForMap(e.map)}return r}saveTransferStats_(t){this.mediaRequests+=1;if(t){this.mediaBytesTransferred+=t.bytesReceived;this.mediaTransferDuration+=t.roundTripTime}}saveBandwidthRelatedStats_(t,e){this.pendingSegment_.byteLength=e.bytesReceived;if(t<Rm){this.logger_(`Ignoring segment's bandwidth because its duration of ${t}`+` is less than the min to record ${Rm}`);return}const i={bandwidthInfo:{from:this.bandwidth,to:e.bandwidth}};this.trigger({type:"bandwidthupdated",metadata:i});this.bandwidth=e.bandwidth;this.roundTrip=e.roundTripTime}handleTimeout_(){this.mediaRequestsTimedout+=1;this.bandwidth=1;this.roundTrip=NaN;this.trigger("bandwidthupdate");this.trigger("timeout")}segmentRequestFinished_(t,e,i){if(this.callQueue_.length){this.callQueue_.push(this.segmentRequestFinished_.bind(this,t,e,i));return}this.saveTransferStats_(e.stats);if(!this.pendingSegment_){return}if(e.requestId!==this.pendingSegment_.requestId){return}if(t){this.pendingSegment_=null;this.state="READY";if(t.code===Mv.ABORTED){return}this.pause();if(t.code===Mv.TIMEOUT){this.handleTimeout_();return}this.mediaRequestsErrored+=1;this.error(t);this.trigger("error");return}const s=this.pendingSegment_;this.saveBandwidthRelatedStats_(s.duration,e.stats);s.endOfAllRequests=e.endOfAllRequests;if(i.gopInfo){this.gopBuffer_=Im(this.gopBuffer_,i.gopInfo,this.safeAppend_)}this.state="APPENDING";this.trigger("appending");this.waitForAppendsToComplete_(s)}setTimeMapping_(t){const e=this.syncController_.mappingForTimeline(t);if(e!==null){this.timeMapping_=e}}updateMediaSecondsLoaded_(t){if(typeof t.start==="number"&&typeof t.end==="number"){this.mediaSecondsLoaded+=t.end-t.start}else{this.mediaSecondsLoaded+=t.duration}}shouldUpdateTransmuxerTimestampOffset_(t){if(t===null){return false}if(this.loaderType_==="main"&&t!==this.sourceUpdater_.videoTimestampOffset()){return true}if(!this.audioDisabled_&&t!==this.sourceUpdater_.audioTimestampOffset()){return true}return false}trueSegmentStart_({currentStart:t,playlist:e,mediaIndex:i,firstVideoFrameTimeForData:s,currentVideoTimestampOffset:n,useVideoTimingInfo:r,videoTimingInfo:o,audioTimingInfo:a}){if(typeof t!=="undefined"){return t}if(!r){return a.start}const h=e.segments[i-1];if(i===0||!h||typeof h.start==="undefined"||h.end!==s+n){return s}return o.start}waitForAppendsToComplete_(t){const e=this.getCurrentMediaInfo_(t);if(!e){this.error({message:"No starting media returned, likely due to an unsupported media format.",playlistExclusionDuration:Infinity});this.trigger("error");return}const{hasAudio:i,hasVideo:s,isMuxed:n}=e;const r=this.loaderType_==="main"&&s;const o=!this.audioDisabled_&&i&&!n;t.waitingOnAppends=0;if(!t.hasAppendedData_){if(!t.timingInfo&&typeof t.timestampOffset==="number"){this.isPendingTimestampOffset_=true}t.timingInfo={start:0};t.waitingOnAppends++;if(!this.isPendingTimestampOffset_){this.updateSourceBufferTimestampOffset_(t);this.processMetadataQueue_()}this.checkAppendsDone_(t);return}if(r){t.waitingOnAppends++}if(o){t.waitingOnAppends++}if(r){this.sourceUpdater_.videoQueueCallback(this.checkAppendsDone_.bind(this,t))}if(o){this.sourceUpdater_.audioQueueCallback(this.checkAppendsDone_.bind(this,t))}}checkAppendsDone_(t){if(this.checkForAbort_(t.requestId)){return}t.waitingOnAppends--;if(t.waitingOnAppends===0){this.handleAppendsDone_()}}checkForIllegalMediaSwitch(t){const e=Lm(this.loaderType_,this.getCurrentMediaInfo_(),t);if(e){this.error({message:e,playlistExclusionDuration:Infinity});this.trigger("error");return true}return false}updateSourceBufferTimestampOffset_(t){if(t.timestampOffset===null||typeof t.timingInfo.start!=="number"||t.changedTimestampOffset||this.loaderType_!=="main"){return}let e=false;t.timestampOffset-=this.getSegmentStartTimeForTimestampOffsetCalculation_({videoTimingInfo:t.segment.videoTimingInfo,audioTimingInfo:t.segment.audioTimingInfo,timingInfo:t.timingInfo});t.changedTimestampOffset=true;if(t.timestampOffset!==this.sourceUpdater_.videoTimestampOffset()){this.sourceUpdater_.videoTimestampOffset(t.timestampOffset);e=true}if(t.timestampOffset!==this.sourceUpdater_.audioTimestampOffset()){this.sourceUpdater_.audioTimestampOffset(t.timestampOffset);e=true}if(e){this.trigger("timestampoffset")}}getSegmentStartTimeForTimestampOffsetCalculation_({videoTimingInfo:t,audioTimingInfo:e,timingInfo:i}){if(!this.useDtsForTimestampOffset_){return i.start}if(t&&typeof t.transmuxedDecodeStart==="number"){return t.transmuxedDecodeStart}if(e&&typeof e.transmuxedDecodeStart==="number"){return e.transmuxedDecodeStart}return i.start}updateTimingInfoEnd_(t){t.timingInfo=t.timingInfo||{};const e=this.getMediaInfo_();const i=this.loaderType_==="main"&&e&&e.hasVideo;const s=i&&t.videoTimingInfo?t.videoTimingInfo:t.audioTimingInfo;if(!s){return}t.timingInfo.end=typeof s.end==="number"?s.end:s.start+t.duration}handleAppendsDone_(){if(this.pendingSegment_){const t={segmentInfo:Gm({type:this.loaderType_,segment:this.pendingSegment_})};this.trigger({type:"appendsdone",metadata:t})}if(!this.pendingSegment_){this.state="READY";if(!this.paused()){this.monitorBuffer_()}return}const t=this.pendingSegment_;if(t.part&&t.part.syncInfo){t.part.syncInfo.markAppended()}else if(t.segment.syncInfo){t.segment.syncInfo.markAppended()}this.updateTimingInfoEnd_(t);if(this.shouldSaveSegmentTimingInfo_){this.syncController_.saveSegmentTimingInfo({segmentInfo:t,shouldSaveTimelineMapping:this.loaderType_==="main"})}const e=Xm(t,this.sourceType_);if(e){if(e.severity==="warn"){cd.log.warn(e.message)}else{this.logger_(e.message)}}this.recordThroughput_(t);this.pendingSegment_=null;this.state="READY";if(t.isSyncRequest){this.trigger("syncinfoupdate");if(!t.hasAppendedData_){this.logger_(`Throwing away un-appended sync request ${$m(t)}`);return}}this.logger_(`Appended ${$m(t)}`);this.addSegmentMetadataCue_(t);this.fetchAtBuffer_=true;if(this.currentTimeline_!==t.timeline){this.timelineChangeController_.lastTimelineChange({type:this.loaderType_,from:this.currentTimeline_,to:t.timeline});if(this.loaderType_==="main"&&!this.audioDisabled_){this.timelineChangeController_.lastTimelineChange({type:"audio",from:this.currentTimeline_,to:t.timeline})}}this.currentTimeline_=t.timeline;this.trigger("syncinfoupdate");const i=t.segment;const s=t.part;const n=i.end&&this.currentTime_()-i.end>t.playlist.targetDuration*3;const r=s&&s.end&&this.currentTime_()-s.end>t.playlist.partTargetDuration*3;if(n||r){this.logger_(`bad ${n?"segment":"part"} ${$m(t)}`);this.resetEverything();return}const o=this.mediaIndex!==null;if(o){this.trigger("bandwidthupdate")}this.trigger("progress");this.mediaIndex=t.mediaIndex;this.partIndex=t.partIndex;if(this.isEndOfStream_(t.mediaIndex,t.playlist,t.partIndex)){this.endOfStream()}this.trigger("appended");if(t.hasAppendedData_){this.mediaAppends++}if(!this.paused()){this.monitorBuffer_()}}recordThroughput_(t){if(t.duration<Rm){this.logger_(`Ignoring segment's throughput because its duration of ${t.duration}`+` is less than the min to record ${Rm}`);return}const e=this.throughput.rate;const i=Date.now()-t.endOfAllRequests+1;const s=Math.floor(t.byteLength/i*8*1e3);this.throughput.rate+=(s-e)/++this.throughput.count}addSegmentMetadataCue_(t){if(!this.segmentMetadataTrack_){return}const e=t.segment;const i=e.start;const s=e.end;if(!Mm(i)||!Mm(s)){return}xm(i,s,this.segmentMetadataTrack_);const n=z.WebKitDataCue||z.VTTCue;const r={custom:e.custom,dateTimeObject:e.dateTimeObject,dateTimeString:e.dateTimeString,programDateTime:e.programDateTime,bandwidth:t.playlist.attributes.BANDWIDTH,resolution:t.playlist.attributes.RESOLUTION,codecs:t.playlist.attributes.CODECS,byteLength:t.byteLength,uri:t.uri,timeline:t.timeline,playlist:t.playlist.id,start:i,end:s};const o=JSON.stringify(r);const a=new n(i,s,o);a.value=r;this.segmentMetadataTrack_.addCue(a)}}function Wm(){}const Jm=function(t){if(typeof t!=="string"){return t}return t.replace(/./,(t=>t.toUpperCase()))};const Km=["video","audio"];const Qm=(t,e)=>{const i=e[`${t}Buffer`];return i&&i.updating||e.queuePending[t]};const Zm=(t,e)=>{for(let i=0;i<e.length;i++){const s=e[i];if(s.type==="mediaSource"){return null}if(s.type===t){return i}}return null};const tg=(t,e)=>{if(e.queue.length===0){return}let i=0;let s=e.queue[i];if(s.type==="mediaSource"){if(!e.updating()&&e.mediaSource.readyState!=="closed"){e.queue.shift();s.action(e);if(s.doneFn){s.doneFn()}tg("audio",e);tg("video",e)}return}if(t==="mediaSource"){return}if(!e.ready()||e.mediaSource.readyState==="closed"||Qm(t,e)){return}if(s.type!==t){i=Zm(t,e.queue);if(i===null){return}s=e.queue[i]}e.queue.splice(i,1);e.queuePending[t]=s;s.action(t,e);if(!s.doneFn){e.queuePending[t]=null;tg(t,e);return}};const eg=(t,e)=>{const i=e[`${t}Buffer`];const s=Jm(t);if(!i){return}i.removeEventListener("updateend",e[`on${s}UpdateEnd_`]);i.removeEventListener("error",e[`on${s}Error_`]);e.codecs[t]=null;e[`${t}Buffer`]=null};const ig=(t,e)=>t&&e&&Array.prototype.indexOf.call(t.sourceBuffers,e)!==-1;const sg={appendBuffer:(t,e,i)=>(s,n)=>{const r=n[`${s}Buffer`];if(!ig(n.mediaSource,r)){return}n.logger_(`Appending segment ${e.mediaIndex}'s ${t.length} bytes to ${s}Buffer`);try{r.appendBuffer(t)}catch(t){n.logger_(`Error with code ${t.code} `+(t.code===mp?"(QUOTA_EXCEEDED_ERR) ":"")+`when appending segment ${e.mediaIndex} to ${s}Buffer`);n.queuePending[s]=null;i(t)}},remove:(t,e)=>(i,s)=>{const n=s[`${i}Buffer`];if(!ig(s.mediaSource,n)){return}s.logger_(`Removing ${t} to ${e} from ${i}Buffer`);try{n.remove(t,e)}catch(n){s.logger_(`Remove ${t} to ${e} from ${i}Buffer failed`)}},timestampOffset:t=>(e,i)=>{const s=i[`${e}Buffer`];if(!ig(i.mediaSource,s)){return}i.logger_(`Setting ${e}timestampOffset to ${t}`);s.timestampOffset=t},callback:t=>(e,i)=>{t()},endOfStream:t=>e=>{if(e.mediaSource.readyState!=="open"){return}e.logger_(`Calling mediaSource endOfStream(${t||""})`);try{e.mediaSource.endOfStream(t)}catch(t){cd.log.warn("Failed to call media source endOfStream",t)}},duration:t=>e=>{e.logger_(`Setting mediaSource duration to ${t}`);try{e.mediaSource.duration=t}catch(t){cd.log.warn("Failed to set media source duration",t)}},abort:()=>(t,e)=>{if(e.mediaSource.readyState!=="open"){return}const i=e[`${t}Buffer`];if(!ig(e.mediaSource,i)){return}e.logger_(`calling abort on ${t}Buffer`);try{i.abort()}catch(e){cd.log.warn(`Failed to abort on ${t}Buffer`,e)}},addSourceBuffer:(t,e)=>i=>{const s=Jm(t);const n=Je(e);i.logger_(`Adding ${t}Buffer with codec ${e} to mediaSource`);const r=i.mediaSource.addSourceBuffer(n);r.addEventListener("updateend",i[`on${s}UpdateEnd_`]);r.addEventListener("error",i[`on${s}Error_`]);i.codecs[t]=e;i[`${t}Buffer`]=r},removeSourceBuffer:t=>e=>{const i=e[`${t}Buffer`];eg(t,e);if(!ig(e.mediaSource,i)){return}e.logger_(`Removing ${t}Buffer with codec ${e.codecs[t]} from mediaSource`);try{e.mediaSource.removeSourceBuffer(i)}catch(e){cd.log.warn(`Failed to removeSourceBuffer ${t}Buffer`,e)}},changeType:t=>(e,i)=>{const s=i[`${e}Buffer`];const n=Je(t);if(!ig(i.mediaSource,s)){return}const r=t.substring(0,t.indexOf("."));const o=i.codecs[e];const a=o.substring(0,o.indexOf("."));if(a===r){return}const h={codecsChangeInfo:{from:o,to:t}};i.trigger({type:"codecschange",metadata:h});i.logger_(`changing ${e}Buffer codec from ${o} to ${t}`);try{s.changeType(n);i.codecs[e]=t}catch(t){h.errorType=cd.Error.StreamingCodecsChangeError;h.error=t;t.metadata=h;i.error_=t;i.trigger("error");cd.log.warn(`Failed to changeType on ${e}Buffer`,t)}}};const ng=({type:t,sourceUpdater:e,action:i,doneFn:s,name:n})=>{e.queue.push({type:t,action:i,doneFn:s,name:n});tg(t,e)};const rg=(t,e)=>i=>{const s=e[`${t}Buffered`]();const n=jd(s);e.logger_(`received "updateend" event for ${t} Source Buffer: `,n);if(e.queuePending[t]){const i=e.queuePending[t].doneFn;e.queuePending[t]=null;if(i){i(e[`${t}Error_`])}}tg(t,e)};class og extends cd.EventTarget{constructor(t){super();this.mediaSource=t;this.sourceopenListener_=()=>tg("mediaSource",this);this.mediaSource.addEventListener("sourceopen",this.sourceopenListener_);this.logger_=gd("SourceUpdater");this.audioTimestampOffset_=0;this.videoTimestampOffset_=0;this.queue=[];this.queuePending={audio:null,video:null};this.delayedAudioAppendQueue_=[];this.videoAppendQueued_=false;this.codecs={};this.onVideoUpdateEnd_=rg("video",this);this.onAudioUpdateEnd_=rg("audio",this);this.onVideoError_=t=>{this.videoError_=t};this.onAudioError_=t=>{this.audioError_=t};this.createdSourceBuffers_=false;this.initializedEme_=false;this.triggeredReady_=false}initializedEme(){this.initializedEme_=true;this.triggerReady()}hasCreatedSourceBuffers(){return this.createdSourceBuffers_}hasInitializedAnyEme(){return this.initializedEme_}ready(){return this.hasCreatedSourceBuffers()&&this.hasInitializedAnyEme()}createSourceBuffers(t){if(this.hasCreatedSourceBuffers()){return}this.addOrChangeSourceBuffers(t);this.createdSourceBuffers_=true;this.trigger("createdsourcebuffers");this.triggerReady()}triggerReady(){if(this.ready()&&!this.triggeredReady_){this.triggeredReady_=true;this.trigger("ready")}}addSourceBuffer(t,e){ng({type:"mediaSource",sourceUpdater:this,action:sg.addSourceBuffer(t,e),name:"addSourceBuffer"})}abort(t){ng({type:t,sourceUpdater:this,action:sg.abort(t),name:"abort"})}removeSourceBuffer(t){if(!this.canRemoveSourceBuffer()){cd.log.error("removeSourceBuffer is not supported!");return}ng({type:"mediaSource",sourceUpdater:this,action:sg.removeSourceBuffer(t),name:"removeSourceBuffer"})}canRemoveSourceBuffer(){return!cd.browser.IS_FIREFOX&&z.MediaSource&&z.MediaSource.prototype&&typeof z.MediaSource.prototype.removeSourceBuffer==="function"}static canChangeType(){return z.SourceBuffer&&z.SourceBuffer.prototype&&typeof z.SourceBuffer.prototype.changeType==="function"}canChangeType(){return this.constructor.canChangeType()}changeType(t,e){if(!this.canChangeType()){cd.log.error("changeType is not supported!");return}ng({type:t,sourceUpdater:this,action:sg.changeType(e),name:"changeType"})}addOrChangeSourceBuffers(t){if(!t||typeof t!=="object"||Object.keys(t).length===0){throw new Error("Cannot addOrChangeSourceBuffers to undefined codecs")}Object.keys(t).forEach((e=>{const i=t[e];if(!this.hasCreatedSourceBuffers()){return this.addSourceBuffer(e,i)}if(this.canChangeType()){this.changeType(e,i)}}))}appendBuffer(t,e){const{segmentInfo:i,type:s,bytes:n}=t;this.processedAppend_=true;if(s==="audio"&&this.videoBuffer&&!this.videoAppendQueued_){this.delayedAudioAppendQueue_.push([t,e]);this.logger_(`delayed audio append of ${n.length} until video append`);return}const r=e;ng({type:s,sourceUpdater:this,action:sg.appendBuffer(n,i||{mediaIndex:-1},r),doneFn:e,name:"appendBuffer"});if(s==="video"){this.videoAppendQueued_=true;if(!this.delayedAudioAppendQueue_.length){return}const t=this.delayedAudioAppendQueue_.slice();this.logger_(`queuing delayed audio ${t.length} appendBuffers`);this.delayedAudioAppendQueue_.length=0;t.forEach((t=>{this.appendBuffer.apply(this,t)}))}}audioBuffered(){if(!ig(this.mediaSource,this.audioBuffer)){return yd()}return this.audioBuffer.buffered?this.audioBuffer.buffered:yd()}videoBuffered(){if(!ig(this.mediaSource,this.videoBuffer)){return yd()}return this.videoBuffer.buffered?this.videoBuffer.buffered:yd()}buffered(){const t=ig(this.mediaSource,this.videoBuffer)?this.videoBuffer:null;const e=ig(this.mediaSource,this.audioBuffer)?this.audioBuffer:null;if(e&&!t){return this.audioBuffered()}if(t&&!e){return this.videoBuffered()}return Ed(this.audioBuffered(),this.videoBuffered())}setDuration(t,e=Wm){ng({type:"mediaSource",sourceUpdater:this,action:sg.duration(t),name:"duration",doneFn:e})}endOfStream(t=null,e=Wm){if(typeof t!=="string"){t=undefined}ng({type:"mediaSource",sourceUpdater:this,action:sg.endOfStream(t),name:"endOfStream",doneFn:e})}removeAudio(t,e,i=Wm){if(!this.audioBuffered().length||this.audioBuffered().end(0)===0){i();return}ng({type:"audio",sourceUpdater:this,action:sg.remove(t,e),doneFn:i,name:"remove"})}removeVideo(t,e,i=Wm){if(!this.videoBuffered().length||this.videoBuffered().end(0)===0){i();return}ng({type:"video",sourceUpdater:this,action:sg.remove(t,e),doneFn:i,name:"remove"})}updating(){if(Qm("audio",this)||Qm("video",this)){return true}return false}audioTimestampOffset(t){if(typeof t!=="undefined"&&this.audioBuffer&&this.audioTimestampOffset_!==t){ng({type:"audio",sourceUpdater:this,action:sg.timestampOffset(t),name:"timestampOffset"});this.audioTimestampOffset_=t}return this.audioTimestampOffset_}videoTimestampOffset(t){if(typeof t!=="undefined"&&this.videoBuffer&&this.videoTimestampOffset_!==t){ng({type:"video",sourceUpdater:this,action:sg.timestampOffset(t),name:"timestampOffset"});this.videoTimestampOffset_=t}return this.videoTimestampOffset_}audioQueueCallback(t){if(!this.audioBuffer){return}ng({type:"audio",sourceUpdater:this,action:sg.callback(t),name:"callback"})}videoQueueCallback(t){if(!this.videoBuffer){return}ng({type:"video",sourceUpdater:this,action:sg.callback(t),name:"callback"})}dispose(){this.trigger("dispose");Km.forEach((t=>{this.abort(t);if(this.canRemoveSourceBuffer()){this.removeSourceBuffer(t)}else{this[`${t}QueueCallback`]((()=>eg(t,this)))}}));this.videoAppendQueued_=false;this.delayedAudioAppendQueue_.length=0;if(this.sourceopenListener_){this.mediaSource.removeEventListener("sourceopen",this.sourceopenListener_)}this.off()}}const ag=t=>decodeURIComponent(escape(String.fromCharCode.apply(null,t)));const hg=t=>{const e=new Uint8Array(t);return Array.from(e).map((t=>t.toString(16).padStart(2,"0"))).join("")};const cg=new Uint8Array("\n\n".split("").map((t=>t.charCodeAt(0))));class lg extends Error{constructor(){super("Trying to parse received VTT cues, but there is no WebVTT. Make sure vtt.js is loaded.")}}class ug extends Ym{constructor(t,e={}){super(t,e);this.mediaSource_=null;this.subtitlesTrack_=null;this.featuresNativeTextTracks_=t.featuresNativeTextTracks;this.loadVttJs=t.loadVttJs;this.shouldSaveSegmentTimingInfo_=false}createTransmuxer_(){return null}buffered_(){if(!this.subtitlesTrack_||!this.subtitlesTrack_.cues||!this.subtitlesTrack_.cues.length){return yd()}const t=this.subtitlesTrack_.cues;const e=t[0].startTime;const i=t[t.length-1].startTime;return yd([[e,i]])}initSegmentForMap(t,e=false){if(!t){return null}const i=Fp(t);let s=this.initSegments_[i];if(e&&!s&&t.bytes){const e=cg.byteLength+t.bytes.byteLength;const n=new Uint8Array(e);n.set(t.bytes);n.set(cg,t.bytes.byteLength);this.initSegments_[i]=s={resolvedUri:t.resolvedUri,byterange:t.byterange,bytes:n}}return s||t}couldBeginLoading_(){return this.playlist_&&this.subtitlesTrack_&&!this.paused()}init_(){this.state="READY";this.resetEverything();return this.monitorBuffer_()}track(t){if(typeof t==="undefined"){return this.subtitlesTrack_}this.subtitlesTrack_=t;if(this.state==="INIT"&&this.couldBeginLoading_()){this.init_()}return this.subtitlesTrack_}remove(t,e){xm(t,e,this.subtitlesTrack_)}fillBuffer_(){const t=this.chooseNextRequest_();if(!t){return}if(this.syncController_.timestampOffsetForTimeline(t.timeline)===null){const t=()=>{this.state="READY";if(!this.paused()){this.monitorBuffer_()}};this.syncController_.one("timestampoffset",t);this.state="WAITING_ON_TIMELINE";return}this.loadSegment_(t)}timestampOffsetForSegment_(){return null}chooseNextRequest_(){return this.skipEmptySegments_(super.chooseNextRequest_())}skipEmptySegments_(t){while(t&&t.segment.empty){if(t.mediaIndex+1>=t.playlist.segments.length){t=null;break}t=this.generateSegmentInfo_({playlist:t.playlist,mediaIndex:t.mediaIndex+1,startOfSegment:t.startOfSegment+t.duration,isSyncRequest:t.isSyncRequest})}return t}stopForError(t){this.error(t);this.state="READY";this.pause();this.trigger("error")}segmentRequestFinished_(t,e,i){if(!this.subtitlesTrack_){this.state="READY";return}this.saveTransferStats_(e.stats);if(!this.pendingSegment_){this.state="READY";this.mediaRequestsAborted+=1;return}if(t){if(t.code===Mv.TIMEOUT){this.handleTimeout_()}if(t.code===Mv.ABORTED){this.mediaRequestsAborted+=1}else{this.mediaRequestsErrored+=1}this.stopForError(t);return}const s=this.pendingSegment_;this.saveBandwidthRelatedStats_(s.duration,e.stats);if(e.key){this.segmentKey(e.key,true)}this.state="APPENDING";this.trigger("appending");const n=s.segment;if(n.map){n.map.bytes=e.map.bytes}s.bytes=e.bytes;if(typeof z.WebVTT!=="function"&&typeof this.loadVttJs==="function"){this.state="WAITING_ON_VTTJS";this.loadVttJs().then((()=>this.segmentRequestFinished_(t,e,i)),(()=>this.stopForError({message:"Error loading vtt.js"})));return}n.requested=true;try{this.parseVTTCues_(s)}catch(t){this.stopForError({message:t.message,metadata:{errorType:cd.Error.StreamingVttParserError,error:t}});return}this.updateTimeMapping_(s,this.syncController_.timelines[s.timeline],this.playlist_);if(s.cues.length){s.timingInfo={start:s.cues[0].startTime,end:s.cues[s.cues.length-1].endTime}}else{s.timingInfo={start:s.startOfSegment,end:s.startOfSegment+s.duration}}if(s.isSyncRequest){this.trigger("syncinfoupdate");this.pendingSegment_=null;this.state="READY";return}s.byteLength=s.bytes.byteLength;this.mediaSecondsLoaded+=n.duration;s.cues.forEach((t=>{this.subtitlesTrack_.addCue(this.featuresNativeTextTracks_?new z.VTTCue(t.startTime,t.endTime,t.text):t)}));Am(this.subtitlesTrack_);this.handleAppendsDone_()}handleData_(){}updateTimingInfoEnd_(){}parseVTTCues_(t){let e;let i=false;if(typeof z.WebVTT!=="function"){throw new lg}if(typeof z.TextDecoder==="function"){e=new z.TextDecoder("utf8")}else{e=z.WebVTT.StringDecoder();i=true}const s=new z.WebVTT.Parser(z,z.vttjs,e);t.cues=[];t.timestampmap={MPEGTS:0,LOCAL:0};s.oncue=t.cues.push.bind(t.cues);s.ontimestampmap=e=>{t.timestampmap=e};s.onparsingerror=t=>{cd.log.warn("Error encountered when parsing cues: "+t.message)};if(t.segment.map){let e=t.segment.map.bytes;if(i){e=ag(e)}s.parse(e)}let n=t.bytes;if(i){n=ag(n)}s.parse(n);s.flush()}updateTimeMapping_(t,e,i){const s=t.segment;if(!e){return}if(!t.cues.length){s.empty=true;return}const{MPEGTS:n,LOCAL:r}=t.timestampmap;const o=n/Jo.ONE_SECOND_IN_TS;const a=o-r+e.mapping;t.cues.forEach((t=>{const i=t.endTime-t.startTime;const s=n===0?t.startTime+a:this.handleRollover_(t.startTime+a,e.time);t.startTime=Math.max(s,0);t.endTime=Math.max(s+i,0)}));if(!i.syncInfo){const e=t.cues[0].startTime;const n=t.cues[t.cues.length-1].startTime;i.syncInfo={mediaSequence:i.mediaSequence+t.mediaIndex,time:Math.min(e,n-s.duration)}}}handleRollover_(t,e){if(e===null){return t}let i=t*Jo.ONE_SECOND_IN_TS;const s=e*Jo.ONE_SECOND_IN_TS;let n;if(s<i){n=-8589934592}else{n=8589934592}while(Math.abs(i-s)>4294967296){i+=n}return i/Jo.ONE_SECOND_IN_TS}}const fg=function(t,e){const i=t.cues;for(let t=0;t<i.length;t++){const s=i[t];if(e>=s.adStartTime&&e<=s.adEndTime){return s}}return null};const dg=function(t,e,i=0){if(!t.segments){return}let s=i;let n;for(let i=0;i<t.segments.length;i++){const r=t.segments[i];if(!n){n=fg(e,s+r.duration/2)}if(n){if("cueIn"in r){n.endTime=s;n.adEndTime=s;s+=r.duration;n=null;continue}if(s<n.endTime){s+=r.duration;continue}n.endTime+=r.duration}else{if("cueOut"in r){n=new z.VTTCue(s,s+r.duration,r.cueOut);n.adStartTime=s;n.adEndTime=s+parseFloat(r.cueOut);e.addCue(n)}if("cueOutCont"in r){const[t,i]=r.cueOutCont.split("/").map(parseFloat);n=new z.VTTCue(s,s+r.duration,"");n.adStartTime=s-t;n.adEndTime=n.adStartTime+i;e.addCue(n)}}s+=r.duration}};class pg{constructor({start:t,end:e,segmentIndex:i,partIndex:s=null,appended:n=false}){this.start_=t;this.end_=e;this.segmentIndex_=i;this.partIndex_=s;this.appended_=n}isInRange(t){return t>=this.start&&t<this.end}markAppended(){this.appended_=true}resetAppendedStatus(){this.appended_=false}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 vg{constructor(t,e=[]){this.segmentSyncInfo_=t;this.partsSyncInfo_=e}get segmentSyncInfo(){return this.segmentSyncInfo_}get partsSyncInfo(){return this.partsSyncInfo_}get hasPartsSyncInfo(){return this.partsSyncInfo_.length>0}resetAppendStatus(){this.segmentSyncInfo_.resetAppendedStatus();this.partsSyncInfo_.forEach((t=>t.resetAppendedStatus()))}}class mg{constructor(){this.storage_=new Map;this.diagnostics_="";this.isReliable_=false;this.start_=-Infinity;this.end_=Infinity}get start(){return this.start_}get end(){return this.end_}get diagnostics(){return this.diagnostics_}get isReliable(){return this.isReliable_}resetAppendedStatus(){this.storage_.forEach((t=>t.resetAppendStatus()))}update(t,e){const{mediaSequence:i,segments:s}=t;this.isReliable_=this.isReliablePlaylist_(i,s);if(!this.isReliable_){return}return this.updateStorage_(s,i,this.calculateBaseTime_(i,e))}getSyncInfoForTime(t){for(const{segmentSyncInfo:e,partsSyncInfo:i}of this.storage_.values()){if(!i.length){if(e.isInRange(t)){return e}}else{for(const e of i){if(e.isInRange(t)){return e}}}}return null}getSyncInfoForMediaSequence(t){return this.storage_.get(t)}updateStorage_(t,e,i){const s=new Map;let n="\n";let r=i;let o=e;this.start_=r;t.forEach(((t,e)=>{const i=this.storage_.get(o);const a=r;const h=a+t.duration;const c=Boolean(i&&i.segmentSyncInfo&&i.segmentSyncInfo.isAppended);const l=new pg({start:a,end:h,appended:c,segmentIndex:e});t.syncInfo=l;let u=r;const f=(t.parts||[]).map(((t,s)=>{const r=u;const a=u+t.duration;const h=Boolean(i&&i.partsSyncInfo&&i.partsSyncInfo[s]&&i.partsSyncInfo[s].isAppended);const c=new pg({start:r,end:a,appended:h,segmentIndex:e,partIndex:s});u=a;n+=`Media Sequence: ${o}.${s} | Range: ${r} --\x3e ${a} | Appended: ${h}\n`;t.syncInfo=c;return c}));s.set(o,new vg(l,f));n+=`${mm(t.resolvedUri)} | Media Sequence: ${o} | Range: ${a} --\x3e ${h} | Appended: ${c}\n`;o++;r=h}));this.end_=r;this.storage_=s;this.diagnostics_=n}calculateBaseTime_(t,e){if(!this.storage_.size){return 0}if(this.storage_.has(t)){return this.storage_.get(t).segmentSyncInfo.start}return e}isReliablePlaylist_(t,e){return t!==undefined&&t!==null&&Array.isArray(e)&&e.length}}class gg extends mg{constructor(t){super();this.parent_=t}calculateBaseTime_(t,e){if(!this.storage_.size){const e=this.parent_.getSyncInfoForMediaSequence(t);if(e){return e.segmentSyncInfo.start}return 0}return super.calculateBaseTime_(t,e)}}const bg=86400;const yg=[{name:"VOD",run:(t,e,i,s,n)=>{if(i!==Infinity){const t={time:0,segmentIndex:0,partIndex:null};return t}return null}},{name:"MediaSequence",run:(t,e,i,s,n,r)=>{const o=t.getMediaSequenceSync(r);if(!o){return null}if(!o.isReliable){return null}const a=o.getSyncInfoForTime(n);if(!a){return null}return{time:a.start,partIndex:a.partIndex,segmentIndex:a.segmentIndex}}},{name:"ProgramDateTime",run:(t,e,i,s,n)=>{if(!Object.keys(t.timelineToDatetimeMappings).length){return null}let r=null;let o=null;const a=Rd(e);n=n||0;for(let i=0;i<a.length;i++){const s=e.endList||n===0?i:a.length-(i+1);const h=a[s];const c=h.segment;const l=t.timelineToDatetimeMappings[c.timeline];if(!l||!c.dateTimeObject){continue}const u=c.dateTimeObject.getTime()/1e3;let f=u+l;if(c.parts&&typeof h.partIndex==="number"){for(let t=0;t<h.partIndex;t++){f+=c.parts[t].duration}}const d=Math.abs(n-f);if(o!==null&&(d===0||o<d)){break}o=d;r={time:f,segmentIndex:h.segmentIndex,partIndex:h.partIndex}}return r}},{name:"Segment",run:(t,e,i,s,n)=>{let r=null;let o=null;n=n||0;const a=Rd(e);for(let t=0;t<a.length;t++){const i=e.endList||n===0?t:a.length-(t+1);const h=a[i];const c=h.segment;const l=h.part&&h.part.start||c&&c.start;if(c.timeline===s&&typeof l!=="undefined"){const t=Math.abs(n-l);if(o!==null&&o<t){break}if(!r||o===null||o>=t){o=t;r={time:l,segmentIndex:h.segmentIndex,partIndex:h.partIndex}}}}return r}},{name:"Discontinuity",run:(t,e,i,s,n)=>{let r=null;n=n||0;if(e.discontinuityStarts&&e.discontinuityStarts.length){let i=null;for(let s=0;s<e.discontinuityStarts.length;s++){const o=e.discontinuityStarts[s];const a=e.discontinuitySequence+s+1;const h=t.discontinuities[a];if(h){const t=Math.abs(n-h.time);if(i!==null&&i<t){break}if(!r||i===null||i>=t){i=t;r={time:h.time,segmentIndex:o,partIndex:null}}}}}return r}},{name:"Playlist",run:(t,e,i,s,n)=>{if(e.syncInfo){const t={time:e.syncInfo.time,segmentIndex:e.syncInfo.mediaSequence-e.mediaSequence,partIndex:null};return t}return null}}];class jg extends cd.EventTarget{constructor(t={}){super();this.timelines=[];this.discontinuities=[];this.timelineToDatetimeMappings={};const e=new mg;const i=new gg(e);const s=new gg(e);this.mediaSequenceStorage_={main:e,audio:i,vtt:s};this.logger_=gd("SyncController")}getMediaSequenceSync(t){return this.mediaSequenceStorage_[t]||null}getSyncPoint(t,e,i,s,n){if(e!==Infinity){const i=yg.find((({name:t})=>t==="VOD"));return i.run(this,t,e)}const r=this.runStrategies_(t,e,i,s,n);if(!r.length){return null}for(const e of r){const{syncPoint:i,strategy:n}=e;const{segmentIndex:r,time:o}=i;if(r<0){continue}const a=t.segments[r];const h=o;const c=h+a.duration;this.logger_(`Strategy: ${n}. Current time: ${s}. selected segment: ${r}. Time: [${h} -> ${c}]}`);if(s>=h&&s<c){this.logger_("Found sync point with exact match: ",i);return i}}return this.selectSyncPoint_(r,{key:"time",value:s})}getExpiredTime(t,e){if(!t||!t.segments){return null}const i=this.runStrategies_(t,e,t.discontinuitySequence,0);if(!i.length){return null}const s=this.selectSyncPoint_(i,{key:"segmentIndex",value:0});if(s.segmentIndex>0){s.time*=-1}return Math.abs(s.time+Vd({defaultDuration:t.targetDuration,durationList:t.segments,startIndex:s.segmentIndex,endIndex:0}))}runStrategies_(t,e,i,s,n){const r=[];for(let o=0;o<yg.length;o++){const a=yg[o];const h=a.run(this,t,e,i,s,n);if(h){h.strategy=a.name;r.push({strategy:a.name,syncPoint:h})}}return r}selectSyncPoint_(t,e){let i=t[0].syncPoint;let s=Math.abs(t[0].syncPoint[e.key]-e.value);let n=t[0].strategy;for(let r=1;r<t.length;r++){const o=Math.abs(t[r].syncPoint[e.key]-e.value);if(o<s){s=o;i=t[r].syncPoint;n=t[r].strategy}}this.logger_(`syncPoint for [${e.key}: ${e.value}] chosen with strategy`+` [${n}]: [time:${i.time},`+` segmentIndex:${i.segmentIndex}`+(typeof i.partIndex==="number"?`,partIndex:${i.partIndex}`:"")+"]");return i}saveExpiredSegmentInfo(t,e){const i=e.mediaSequence-t.mediaSequence;if(i>bg){cd.log.warn(`Not saving expired segment info. Media sequence gap ${i} is too large.`);return}for(let s=i-1;s>=0;s--){const i=t.segments[s];if(i&&typeof i.start!=="undefined"){e.syncInfo={mediaSequence:t.mediaSequence+s,time:i.start};this.logger_(`playlist refresh sync: [time:${e.syncInfo.time},`+` mediaSequence: ${e.syncInfo.mediaSequence}]`);this.trigger("syncinfoupdate");break}}}setDateTimeMappingForStart(t){this.timelineToDatetimeMappings={};if(t.segments&&t.segments.length&&t.segments[0].dateTimeObject){const e=t.segments[0];const i=e.dateTimeObject.getTime()/1e3;this.timelineToDatetimeMappings[e.timeline]=-i}}saveSegmentTimingInfo({segmentInfo:t,shouldSaveTimelineMapping:e}){const i=this.calculateSegmentTimeMapping_(t,t.timingInfo,e);const s=t.segment;if(i){this.saveDiscontinuitySyncInfo_(t);if(!t.playlist.syncInfo){t.playlist.syncInfo={mediaSequence:t.playlist.mediaSequence+t.mediaIndex,time:s.start}}}const n=s.dateTimeObject;if(s.discontinuity&&e&&n){this.timelineToDatetimeMappings[s.timeline]=-(n.getTime()/1e3)}}timestampOffsetForTimeline(t){if(typeof this.timelines[t]==="undefined"){return null}return this.timelines[t].time}mappingForTimeline(t){if(typeof this.timelines[t]==="undefined"){return null}return this.timelines[t].mapping}calculateSegmentTimeMapping_(t,e,i){const s=t.segment;const n=t.part;let r=this.timelines[t.timeline];let o;let a;if(typeof t.timestampOffset==="number"){r={time:t.startOfSegment,mapping:t.startOfSegment-e.start};if(i){this.timelines[t.timeline]=r;this.trigger("timestampoffset");this.logger_(`time mapping for timeline ${t.timeline}: `+`[time: ${r.time}] [mapping: ${r.mapping}]`)}o=t.startOfSegment;a=e.end+r.mapping}else if(r){o=e.start+r.mapping;a=e.end+r.mapping}else{return false}if(n){n.start=o;n.end=a}if(!s.start||o<s.start){s.start=o}s.end=a;return true}saveDiscontinuitySyncInfo_(t){const e=t.playlist;const i=t.segment;if(i.discontinuity){this.discontinuities[i.timeline]={time:i.start,accuracy:0}}else if(e.discontinuityStarts&&e.discontinuityStarts.length){for(let s=0;s<e.discontinuityStarts.length;s++){const n=e.discontinuityStarts[s];const r=e.discontinuitySequence+s+1;const o=n-t.mediaIndex;const a=Math.abs(o);if(!this.discontinuities[r]||this.discontinuities[r].accuracy>a){let s;if(o<0){s=i.start-Vd({defaultDuration:e.targetDuration,durationList:e.segments,startIndex:t.mediaIndex,endIndex:n})}else{s=i.end+Vd({defaultDuration:e.targetDuration,durationList:e.segments,startIndex:t.mediaIndex+1,endIndex:n})}this.discontinuities[r]={time:s,accuracy:a}}}}}dispose(){this.trigger("dispose");this.off()}}class wg extends cd.EventTarget{constructor(){super();this.pendingTimelineChanges_={};this.lastTimelineChanges_={}}clearPendingTimelineChange(t){this.pendingTimelineChanges_[t]=null;this.trigger("pendingtimelinechange")}pendingTimelineChange({type:t,from:e,to:i}){if(typeof e==="number"&&typeof i==="number"){this.pendingTimelineChanges_[t]={type:t,from:e,to:i};this.trigger("pendingtimelinechange")}return this.pendingTimelineChanges_[t]}lastTimelineChange({type:t,from:e,to:i}){if(typeof e==="number"&&typeof i==="number"){this.lastTimelineChanges_[t]={type:t,from:e,to:i};delete this.pendingTimelineChanges_[t];const s={timelineChangeInfo:{from:e,to:i}};this.trigger({type:"timelinechange",metadata:s})}return this.lastTimelineChanges_[t]}dispose(){this.trigger("dispose");this.pendingTimelineChanges_={};this.lastTimelineChanges_={};this.off()}}const Tg=gv(bv((function(){var t=function(){function t(){this.listeners={}}var e=t.prototype;e.on=function t(e,i){if(!this.listeners[e]){this.listeners[e]=[]}this.listeners[e].push(i)};e.off=function t(e,i){if(!this.listeners[e]){return false}var s=this.listeners[e].indexOf(i);this.listeners[e]=this.listeners[e].slice(0);this.listeners[e].splice(s,1);return s>-1};e.trigger=function t(e){var i=this.listeners[e];if(!i){return}if(arguments.length===2){var s=i.length;for(var n=0;n<s;++n){i[n].call(this,arguments[1])}}else{var r=Array.prototype.slice.call(arguments,1);var o=i.length;for(var a=0;a<o;++a){i[a].apply(this,r)}}};e.dispose=function t(){this.listeners={}};e.pipe=function t(e){this.on("data",(function(t){e.push(t)}))};return t}();
|
|
24
|
-
/*! @name pkcs7 @version 1.0.4 @license Apache-2.0 */function e(t){return t.subarray(0,t.byteLength-t[t.byteLength-1])}
|
|
25
|
-
/*! @name aes-decrypter @version 4.0.1 @license Apache-2.0 */const i=function(){const t=[[[],[],[],[],[]],[[],[],[],[],[]]];const e=t[0];const i=t[1];const s=e[4];const n=i[4];let r;let o;let a;const h=[];const c=[];let l;let u;let f;let d;let p;let v;for(r=0;r<256;r++){c[(h[r]=r<<1^(r>>7)*283)^r]=r}for(o=a=0;!s[o];o^=l||1,a=c[a]||1){d=a^a<<1^a<<2^a<<3^a<<4;d=d>>8^d&255^99;s[o]=d;n[d]=o;f=h[u=h[l=h[o]]];v=f*16843009^u*65537^l*257^o*16843008;p=h[d]*257^d*16843008;for(r=0;r<4;r++){e[r][o]=p=p<<24^p>>>8;i[r][d]=v=v<<24^v>>>8}}for(r=0;r<5;r++){e[r]=e[r].slice(0);i[r]=i[r].slice(0)}return t};let s=null;class n{constructor(t){if(!s){s=i()}this._tables=[[s[0][0].slice(),s[0][1].slice(),s[0][2].slice(),s[0][3].slice(),s[0][4].slice()],[s[1][0].slice(),s[1][1].slice(),s[1][2].slice(),s[1][3].slice(),s[1][4].slice()]];let e;let n;let r;const o=this._tables[0][4];const a=this._tables[1];const h=t.length;let c=1;if(h!==4&&h!==6&&h!==8){throw new Error("Invalid aes key size")}const l=t.slice(0);const u=[];this._key=[l,u];for(e=h;e<4*h+28;e++){r=l[e-1];if(e%h===0||h===8&&e%h===4){r=o[r>>>24]<<24^o[r>>16&255]<<16^o[r>>8&255]<<8^o[r&255];if(e%h===0){r=r<<8^r>>>24^c<<24;c=c<<1^(c>>7)*283}}l[e]=l[e-h]^r}for(n=0;e;n++,e--){r=l[n&3?e:e-4];if(e<=4||n<4){u[n]=r}else{u[n]=a[0][o[r>>>24]]^a[1][o[r>>16&255]]^a[2][o[r>>8&255]]^a[3][o[r&255]]}}}decrypt(t,e,i,s,n,r){const o=this._key[1];let a=t^o[0];let h=s^o[1];let c=i^o[2];let l=e^o[3];let u;let f;let d;const p=o.length/4-2;let v;let m=4;const g=this._tables[1];const b=g[0];const y=g[1];const j=g[2];const w=g[3];const T=g[4];for(v=0;v<p;v++){u=b[a>>>24]^y[h>>16&255]^j[c>>8&255]^w[l&255]^o[m];f=b[h>>>24]^y[c>>16&255]^j[l>>8&255]^w[a&255]^o[m+1];d=b[c>>>24]^y[l>>16&255]^j[a>>8&255]^w[h&255]^o[m+2];l=b[l>>>24]^y[a>>16&255]^j[h>>8&255]^w[c&255]^o[m+3];m+=4;a=u;h=f;c=d}for(v=0;v<4;v++){n[(3&-v)+r]=T[a>>>24]<<24^T[h>>16&255]<<16^T[c>>8&255]<<8^T[l&255]^o[m++];u=a;a=h;h=c;c=l;l=u}}}class r extends t{constructor(){super(t);this.jobs=[];this.delay=1;this.timeout_=null}processJob_(){this.jobs.shift()();if(this.jobs.length){this.timeout_=setTimeout(this.processJob_.bind(this),this.delay)}else{this.timeout_=null}}push(t){this.jobs.push(t);if(!this.timeout_){this.timeout_=setTimeout(this.processJob_.bind(this),this.delay)}}}const o=function(t){return t<<24|(t&65280)<<8|(t&16711680)>>8|t>>>24};const a=function(t,e,i){const s=new Int32Array(t.buffer,t.byteOffset,t.byteLength>>2);const r=new n(Array.prototype.slice.call(e));const a=new Uint8Array(t.byteLength);const h=new Int32Array(a.buffer);let c;let l;let u;let f;let d;let p;let v;let m;let g;c=i[0];l=i[1];u=i[2];f=i[3];for(g=0;g<s.length;g+=4){d=o(s[g]);p=o(s[g+1]);v=o(s[g+2]);m=o(s[g+3]);r.decrypt(d,p,v,m,h,g);h[g]=o(h[g]^c);h[g+1]=o(h[g+1]^l);h[g+2]=o(h[g+2]^u);h[g+3]=o(h[g+3]^f);c=d;l=p;u=v;f=m}return a};class h{constructor(t,i,s,n){const a=h.STEP;const c=new Int32Array(t.buffer);const l=new Uint8Array(t.byteLength);let u=0;this.asyncStream_=new r;this.asyncStream_.push(this.decryptChunk_(c.subarray(u,u+a),i,s,l));for(u=a;u<c.length;u+=a){s=new Uint32Array([o(c[u-4]),o(c[u-3]),o(c[u-2]),o(c[u-1])]);this.asyncStream_.push(this.decryptChunk_(c.subarray(u,u+a),i,s,l))}this.asyncStream_.push((function(){n(null,e(l))}))}static get STEP(){return 32e3}decryptChunk_(t,e,i,s){return function(){const n=a(t,e,i);s.set(n,t.byteOffset)}}}var c=typeof globalThis!=="undefined"?globalThis:typeof window!=="undefined"?window:typeof global!=="undefined"?global:typeof self!=="undefined"?self:{};var l;if(typeof window!=="undefined"){l=window}else if(typeof c!=="undefined"){l=c}else if(typeof self!=="undefined"){l=self}else{l={}}var u=l;var f=function t(e){if(ArrayBuffer.isView==="function"){return ArrayBuffer.isView(e)}return e&&e.buffer instanceof ArrayBuffer};var d=u.BigInt||Number;[d("0x1"),d("0x100"),d("0x10000"),d("0x1000000"),d("0x100000000"),d("0x10000000000"),d("0x1000000000000"),d("0x100000000000000"),d("0x10000000000000000")];const p=function(t){const e={};Object.keys(t).forEach((i=>{const s=t[i];if(f(s)){e[i]={bytes:s.buffer,byteOffset:s.byteOffset,byteLength:s.byteLength}}else{e[i]=s}}));return e};self.onmessage=function(t){const e=t.data;const i=new Uint8Array(e.encrypted.bytes,e.encrypted.byteOffset,e.encrypted.byteLength);const s=new Uint32Array(e.key.bytes,e.key.byteOffset,e.key.byteLength/4);const n=new Uint32Array(e.iv.bytes,e.iv.byteOffset,e.iv.byteLength/4);new h(i,s,n,(function(t,i){self.postMessage(p({source:e.source,decrypted:i}),[i.buffer])}))}})));var kg=mv(Tg);const Sg=t=>{let e=t.default?"main":"alternative";if(t.characteristics&&t.characteristics.indexOf("public.accessibility.describes-video")>=0){e="main-desc"}return e};const xg=(t,e)=>{t.abort();t.pause();if(e&&e.activePlaylistLoader){e.activePlaylistLoader.pause();e.activePlaylistLoader=null}};const Ag=(t,e)=>{e.activePlaylistLoader=t;t.load()};const Eg=(t,e)=>()=>{const{segmentLoaders:{[t]:i,main:s},mediaTypes:{[t]:n}}=e;const r=n.activeTrack();const o=n.getActiveGroup();const a=n.activePlaylistLoader;const h=n.lastGroup_;if(o&&h&&o.id===h.id){return}n.lastGroup_=o;n.lastTrack_=r;xg(i,n);if(!o||o.isMainPlaylist){return}if(!o.playlistLoader){if(a){s.resetEverything()}return}i.resyncLoader();Ag(o.playlistLoader,n)};const Ig=(t,e)=>()=>{const{segmentLoaders:{[t]:i},mediaTypes:{[t]:s}}=e;s.lastGroup_=null;i.abort();i.pause()};const Dg=(t,e)=>()=>{const{mainPlaylistLoader:i,segmentLoaders:{[t]:s,main:n},mediaTypes:{[t]:r}}=e;const o=r.activeTrack();const a=r.getActiveGroup();const h=r.activePlaylistLoader;const c=r.lastTrack_;if(c&&o&&c.id===o.id){return}r.lastGroup_=a;r.lastTrack_=o;xg(s,r);if(!a){return}if(a.isMainPlaylist){if(!o||!c||o.id===c.id){return}const t=e.vhs.playlistController_;const s=t.selectPlaylist();if(t.media()===s){return}r.logger_(`track change. Switching main audio from ${c.id} to ${o.id}`);i.pause();n.resetEverything();t.fastQualityChange_(s);return}if(t==="AUDIO"){if(!a.playlistLoader){n.setAudio(true);n.resetEverything();return}s.setAudio(true);n.setAudio(false)}if(h===a.playlistLoader){Ag(a.playlistLoader,r);return}if(s.track){s.track(o)}s.resetEverything();Ag(a.playlistLoader,r)};const Cg={AUDIO:(t,e)=>()=>{const{mediaTypes:{[t]:i},excludePlaylist:s}=e;const n=i.activeTrack();const r=i.activeGroup();const o=(r.filter((t=>t.default))[0]||r[0]).id;const a=i.tracks[o];if(n===a){s({error:{message:"Problem encountered loading the default audio track."}});return}cd.log.warn("Problem encountered loading the alternate audio track."+"Switching back to default.");for(const t in i.tracks){i.tracks[t].enabled=i.tracks[t]===a}i.onTrackChanged()},SUBTITLES:(t,e)=>()=>{const{mediaTypes:{[t]:i}}=e;cd.log.warn("Problem encountered loading the subtitle track."+"Disabling subtitle track.");const s=i.activeTrack();if(s){s.mode="disabled"}i.onTrackChanged()}};const Ng={AUDIO:(t,e,i)=>{if(!e){return}const{tech:s,requestOptions:n,segmentLoaders:{[t]:r}}=i;e.on("loadedmetadata",(()=>{const t=e.media();r.playlist(t,n);if(!s.paused()||t.endList&&s.preload()!=="none"){r.load()}}));e.on("loadedplaylist",(()=>{r.playlist(e.media(),n);if(!s.paused()){r.load()}}));e.on("error",Cg[t](t,i))},SUBTITLES:(t,e,i)=>{const{tech:s,requestOptions:n,segmentLoaders:{[t]:r},mediaTypes:{[t]:o}}=i;e.on("loadedmetadata",(()=>{const t=e.media();r.playlist(t,n);r.track(o.activeTrack());if(!s.paused()||t.endList&&s.preload()!=="none"){r.load()}}));e.on("loadedplaylist",(()=>{r.playlist(e.media(),n);if(!s.paused()){r.load()}}));e.on("error",Cg[t](t,i))}};const _g={AUDIO:(t,e)=>{const{vhs:i,sourceType:s,segmentLoaders:{[t]:n},requestOptions:r,main:{mediaGroups:o},mediaTypes:{[t]:{groups:a,tracks:h,logger_:c}},mainPlaylistLoader:l}=e;const u=sp(l.main);if(!o[t]||Object.keys(o[t]).length===0){o[t]={main:{default:{default:true}}};if(u){o[t].main.default.playlists=l.main.playlists}}for(const n in o[t]){if(!a[n]){a[n]=[]}for(const f in o[t][n]){let d=o[t][n][f];let p;if(u){c(`AUDIO group '${n}' label '${f}' is a main playlist`);d.isMainPlaylist=true;p=null}else if(s==="vhs-json"&&d.playlists){p=new Ip(d.playlists[0],i,r)}else if(d.resolvedUri){p=new Ip(d.resolvedUri,i,r)}else if(d.playlists&&s==="dash"){p=new uv(d.playlists[0],i,r,l)}else{p=null}d=bd({id:f,playlistLoader:p},d);Ng[t](t,d.playlistLoader,e);a[n].push(d);if(typeof h[f]==="undefined"){const t=new cd.AudioTrack({id:f,kind:Sg(d),enabled:false,language:d.language,default:d.default,label:f});h[f]=t}}}n.on("error",Cg[t](t,e))},SUBTITLES:(t,e)=>{const{tech:i,vhs:s,sourceType:n,segmentLoaders:{[t]:r},requestOptions:o,main:{mediaGroups:a},mediaTypes:{[t]:{groups:h,tracks:c}},mainPlaylistLoader:l}=e;for(const r in a[t]){if(!h[r]){h[r]=[]}for(const u in a[t][r]){if(!s.options_.useForcedSubtitles&&a[t][r][u].forced){continue}let f=a[t][r][u];let d;if(n==="hls"){d=new Ip(f.resolvedUri,s,o)}else if(n==="dash"){const t=f.playlists.filter((t=>t.excludeUntil!==Infinity));if(!t.length){return}d=new uv(f.playlists[0],s,o,l)}else if(n==="vhs-json"){d=new Ip(f.playlists?f.playlists[0]:f.resolvedUri,s,o)}f=bd({id:u,playlistLoader:d},f);Ng[t](t,f.playlistLoader,e);h[r].push(f);if(typeof c[u]==="undefined"){const t=i.addRemoteTextTrack({id:u,kind:"subtitles",default:f.default&&f.autoselect,language:f.language,label:u},false).track;c[u]=t}}}r.on("error",Cg[t](t,e))},"CLOSED-CAPTIONS":(t,e)=>{const{tech:i,main:{mediaGroups:s},mediaTypes:{[t]:{groups:n,tracks:r}}}=e;for(const e in s[t]){if(!n[e]){n[e]=[]}for(const o in s[t][e]){const a=s[t][e][o];if(!/^(?:CC|SERVICE)/.test(a.instreamId)){continue}const h=i.options_.vhs&&i.options_.vhs.captionServices||{};let c={label:o,language:a.language,instreamId:a.instreamId,default:a.default&&a.autoselect};if(h[c.instreamId]){c=bd(c,h[c.instreamId])}if(c.default===undefined){delete c.default}n[e].push(bd({id:o},a));if(typeof r[o]==="undefined"){const t=i.addRemoteTextTrack({id:c.instreamId,kind:"captions",default:c.default,language:c.language,label:c.label},false).track;r[o]=t}}}}};const Og=(t,e)=>{for(let i=0;i<t.length;i++){if(ep(e,t[i])){return true}if(t[i].playlists&&Og(t[i].playlists,e)){return true}}return false};const Mg=(t,e)=>i=>{const{mainPlaylistLoader:s,mediaTypes:{[t]:{groups:n}}}=e;const r=s.media();if(!r){return null}let o=null;if(r.attributes[t]){o=n[r.attributes[t]]}const a=Object.keys(n);if(!o){if(t==="AUDIO"&&a.length>1&&sp(e.main)){for(let t=0;t<a.length;t++){const e=n[a[t]];if(Og(e,r)){o=e;break}}}else if(n.main){o=n.main}else if(a.length===1){o=n[a[0]]}}if(typeof i==="undefined"){return o}if(i===null||!o){return null}return o.filter((t=>t.id===i.id))[0]||null};const Rg={AUDIO:(t,e)=>()=>{const{mediaTypes:{[t]:{tracks:i}}}=e;for(const t in i){if(i[t].enabled){return i[t]}}return null},SUBTITLES:(t,e)=>()=>{const{mediaTypes:{[t]:{tracks:i}}}=e;for(const t in i){if(i[t].mode==="showing"||i[t].mode==="hidden"){return i[t]}}return null}};const Lg=(t,{mediaTypes:e})=>()=>{const i=e[t].activeTrack();if(!i){return null}return e[t].activeGroup(i)};const Pg=t=>{["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach((e=>{_g[e](e,t)}));const{mediaTypes:e,mainPlaylistLoader:i,tech:s,vhs:n,segmentLoaders:{["AUDIO"]:r,main:o}}=t;["AUDIO","SUBTITLES"].forEach((i=>{e[i].activeGroup=Mg(i,t);e[i].activeTrack=Rg[i](i,t);e[i].onGroupChanged=Eg(i,t);e[i].onGroupChanging=Ig(i,t);e[i].onTrackChanged=Dg(i,t);e[i].getActiveGroup=Lg(i,t)}));const a=e.AUDIO.activeGroup();if(a){const t=(a.filter((t=>t.default))[0]||a[0]).id;e.AUDIO.tracks[t].enabled=true;e.AUDIO.onGroupChanged();e.AUDIO.onTrackChanged();const i=e.AUDIO.getActiveGroup();if(!i.playlistLoader){o.setAudio(true)}else{o.setAudio(false);r.setAudio(true)}}i.on("mediachange",(()=>{["AUDIO","SUBTITLES"].forEach((t=>e[t].onGroupChanged()))}));i.on("mediachanging",(()=>{["AUDIO","SUBTITLES"].forEach((t=>e[t].onGroupChanging()))}));const h=()=>{e.AUDIO.onTrackChanged();s.trigger({type:"usage",name:"vhs-audio-change"})};s.audioTracks().addEventListener("change",h);s.remoteTextTracks().addEventListener("change",e.SUBTITLES.onTrackChanged);n.on("dispose",(()=>{s.audioTracks().removeEventListener("change",h);s.remoteTextTracks().removeEventListener("change",e.SUBTITLES.onTrackChanged)}));s.clearTracks("audio");for(const t in e.AUDIO.tracks){s.audioTracks().addTrack(e.AUDIO.tracks[t])}};const $g=()=>{const t={};["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach((e=>{t[e]={groups:{},tracks:{},activePlaylistLoader:null,activeGroup:Wm,activeTrack:Wm,getActiveGroup:Wm,onGroupChanged:Wm,onTrackChanged:Wm,lastTrack_:null,logger_:gd(`MediaGroups[${e}]`)}}));return t};class Fg{constructor(){this.priority_=[];this.pathwayClones_=new Map}set version(t){if(t===1){this.version_=t}}set ttl(t){this.ttl_=t||300}set reloadUri(t){if(t){this.reloadUri_=vd(this.reloadUri_,t)}}set priority(t){if(t&&t.length){this.priority_=t}}set pathwayClones(t){if(t&&t.length){this.pathwayClones_=new Map(t.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 Ug extends cd.EventTarget{constructor(t,e){super();this.currentPathway=null;this.defaultPathway=null;this.queryBeforeStart=false;this.availablePathways_=new Set;this.steeringManifest=new Fg;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_=gd("Content Steering");this.xhr_=t;this.getBandwidth_=e}assignTagProperties(t,e){this.manifestType_=e.serverUri?"HLS":"DASH";const i=e.serverUri||e.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=vd(t,i);this.defaultPathway=e.pathwayId||e.defaultServiceLocation;this.queryBeforeStart=e.queryBeforeStart;this.proxyServerUrl_=e.proxyServerURL;if(this.defaultPathway&&!this.queryBeforeStart){this.trigger("content-steering")}}requestSteeringManifest(t){const e=this.steeringManifest.reloadUri;if(!e){return}const i=t?e:this.getRequestURI(e);if(!i){this.logger_("No valid content steering manifest URIs. Stopping content steering.");this.trigger("error");this.dispose();return}const s={contentSteeringInfo:{uri:i}};this.trigger({type:"contentsteeringloadstart",metadata:s});this.request_=this.xhr_({uri:i,requestType:"content-steering-manifest"},((t,e)=>{if(t){if(e.status===410){this.logger_(`manifest request 410 ${t}.`);this.logger_(`There will be no more content steering requests to ${i} this session.`);this.excludedSteeringManifestURLs.add(i);return}if(e.status===429){const i=e.responseHeaders["retry-after"];this.logger_(`manifest request 429 ${t}.`);this.logger_(`content steering will retry in ${i} seconds.`);this.startTTLTimeout_(parseInt(i,10));return}this.logger_(`manifest failed to load ${t}.`);this.startTTLTimeout_();return}this.trigger({type:"contentsteeringloadcomplete",metadata:s});let n;try{n=JSON.parse(this.request_.responseText)}catch(t){const e={errorType:cd.Error.StreamingContentSteeringParserError,error:t};this.trigger({type:"error",metadata:e})}this.assignSteeringProperties_(n);const r={contentSteeringInfo:s.contentSteeringInfo,contentSteeringManifest:{version:this.steeringManifest.version,reloadUri:this.steeringManifest.reloadUri,priority:this.steeringManifest.priority}};this.trigger({type:"contentsteeringparsed",metadata:r});this.startTTLTimeout_()}))}setProxyServerUrl_(t){const e=new z.URL(t);const i=new z.URL(this.proxyServerUrl_);i.searchParams.set("url",encodeURI(e.toString()));return this.setSteeringParams_(i.toString())}decodeDataUriManifest_(t){const e=JSON.parse(z.atob(t));this.assignSteeringProperties_(e)}setSteeringParams_(t){const e=new z.URL(t);const i=this.getPathway();const s=this.getBandwidth_();if(i){const t=`_${this.manifestType_}_pathway`;e.searchParams.set(t,i)}if(s){const t=`_${this.manifestType_}_throughput`;e.searchParams.set(t,s)}return e.toString()}assignSteeringProperties_(t){this.steeringManifest.version=t.VERSION;if(!this.steeringManifest.version){this.logger_(`manifest version is ${t.VERSION}, which is not supported.`);this.trigger("error");return}this.steeringManifest.ttl=t.TTL;this.steeringManifest.reloadUri=t["RELOAD-URI"];this.steeringManifest.priority=t["PATHWAY-PRIORITY"]||t["SERVICE-LOCATION-PRIORITY"];this.steeringManifest.pathwayClones=t["PATHWAY-CLONES"];this.nextPathwayClones=this.steeringManifest.pathwayClones;if(!this.availablePathways_.size){this.logger_("There are no available pathways for content steering. Ending content steering.");this.trigger("error");this.dispose()}const e=t=>{for(const e of t){if(this.availablePathways_.has(e)){return e}}return[...this.availablePathways_][0]};const i=e(this.steeringManifest.priority);if(this.currentPathway!==i){this.currentPathway=i;this.trigger("content-steering")}}getPathway(){return this.currentPathway||this.defaultPathway}getRequestURI(t){if(!t){return null}const e=t=>this.excludedSteeringManifestURLs.has(t);if(this.proxyServerUrl_){const i=this.setProxyServerUrl_(t);if(!e(i)){return i}}const i=this.setSteeringParams_(t);if(!e(i)){return i}return null}startTTLTimeout_(t=this.steeringManifest.ttl){const e=t*1e3;this.ttlTimeout_=z.setTimeout((()=>{this.requestSteeringManifest()}),e)}clearTTLTimeout_(){z.clearTimeout(this.ttlTimeout_);this.ttlTimeout_=null}abort(){if(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 Fg}addAvailablePathway(t){if(t){this.availablePathways_.add(t)}}clearAvailablePathways(){this.availablePathways_.clear()}excludePathway(t){return this.availablePathways_.delete(t)}didDASHTagChange(t,e){return!e&&this.steeringManifest.reloadUri||e&&(vd(t,e.serverURL)!==this.steeringManifest.reloadUri||e.defaultServiceLocation!==this.defaultPathway||e.queryBeforeStart!==this.queryBeforeStart||e.proxyServerURL!==this.proxyServerUrl_)}getAvailablePathways(){return this.availablePathways_}}const Bg=10;let qg;const Vg=["mediaRequests","mediaRequestsAborted","mediaRequestsTimedout","mediaRequestsErrored","mediaTransferDuration","mediaBytesTransferred","mediaAppends"];const zg=function(t){return this.audioSegmentLoader_[t]+this.mainSegmentLoader_[t]};const Hg=function({currentPlaylist:t,buffered:e,currentTime:i,nextPlaylist:s,bufferLowWaterLine:n,bufferHighWaterLine:r,duration:o,bufferBasedABR:a,log:h}){if(!s){cd.log.warn("We received no playlist to switch to. Please check your stream.");return false}const c=`allowing switch ${t&&t.id||"null"} -> ${s.id}`;if(!t){h(`${c} as current playlist is not set`);return true}if(s.id===t.id){return false}const l=Boolean(Sd(e,i).length);if(!t.endList){if(!l&&typeof t.partTargetDuration==="number"){h(`not ${c} as current playlist is live llhls, but currentTime isn't in buffered.`);return false}h(`${c} as current playlist is live`);return true}const u=Od(e,i);const f=a?fv.EXPERIMENTAL_MAX_BUFFER_LOW_WATER_LINE:fv.MAX_BUFFER_LOW_WATER_LINE;if(o<f){h(`${c} as duration < max low water line (${o} < ${f})`);return true}const d=s.attributes.BANDWIDTH;const p=t.attributes.BANDWIDTH;if(d<p&&(!a||u<r)){let t=`${c} as next bandwidth < current bandwidth (${d} < ${p})`;if(a){t+=` and forwardBuffer < bufferHighWaterLine (${u} < ${r})`}h(t);return true}if((!a||d>p)&&u>=n){let t=`${c} as forwardBuffer >= bufferLowWaterLine (${u} >= ${n})`;if(a){t+=` and next bandwidth > current bandwidth (${d} > ${p})`}h(t);return true}h(`not ${c} as no switching criteria met`);return false};class Xg extends cd.EventTarget{constructor(t){super();const{src:e,withCredentials:i,tech:s,bandwidth:n,externVhs:r,useCueTags:o,playlistExclusionDuration:a,enableLowInitialPlaylist:h,sourceType:c,cacheEncryptionKeys:l,bufferBasedABR:u,leastPixelDiffSelector:f,captionServices:d}=t;if(!e){throw new Error("A non-empty playlist URL or JSON manifest string is required")}let{maxPlaylistRetries:p}=t;if(p===null||typeof p==="undefined"){p=Infinity}qg=r;this.bufferBasedABR=Boolean(u);this.leastPixelDiffSelector=Boolean(f);this.withCredentials=i;this.tech_=s;this.vhs_=s.vhs;this.player_=t.player_;this.sourceType_=c;this.useCueTags_=o;this.playlistExclusionDuration=a;this.maxPlaylistRetries=p;this.enableLowInitialPlaylist=h;if(this.useCueTags_){this.cueTagsTrack_=this.tech_.addTextTrack("metadata","ad-cues");this.cueTagsTrack_.inBandMetadataTrackDispatchType=""}this.requestOptions_={withCredentials:i,maxPlaylistRetries:p,timeout:null};this.on("error",this.pauseLoading);this.mediaTypes_=$g();this.mediaSource=new z.MediaSource;this.handleDurationChange_=this.handleDurationChange_.bind(this);this.handleSourceOpen_=this.handleSourceOpen_.bind(this);this.handleSourceEnded_=this.handleSourceEnded_.bind(this);this.mediaSource.addEventListener("durationchange",this.handleDurationChange_);this.mediaSource.addEventListener("sourceopen",this.handleSourceOpen_);this.mediaSource.addEventListener("sourceended",this.handleSourceEnded_);this.seekable_=yd();this.hasPlayed_=false;this.syncController_=new jg(t);this.segmentMetadataTrack_=s.addRemoteTextTrack({kind:"metadata",label:"segment-metadata"},false).track;this.decrypter_=new kg;this.sourceUpdater_=new og(this.mediaSource);this.inbandTextTracks_={};this.timelineChangeController_=new wg;this.keyStatusMap_=new Map;const v={vhs:this.vhs_,parse708captions:t.parse708captions,useDtsForTimestampOffset:t.useDtsForTimestampOffset,captionServices:d,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:l,sourceUpdater:this.sourceUpdater_,timelineChangeController:this.timelineChangeController_,exactManifestTimings:t.exactManifestTimings,addMetadataToTextTrack:this.addMetadataToTextTrack.bind(this)};this.mainPlaylistLoader_=this.sourceType_==="dash"?new uv(e,this.vhs_,bd(this.requestOptions_,{addMetadataToTextTrack:this.addMetadataToTextTrack.bind(this)})):new Ip(e,this.vhs_,bd(this.requestOptions_,{addDateRangesToTextTrack:this.addDateRangesToTextTrack_.bind(this)}));this.setupMainPlaylistLoaderListeners_();this.mainSegmentLoader_=new Ym(bd(v,{segmentMetadataTrack:this.segmentMetadataTrack_,loaderType:"main"}),t);this.audioSegmentLoader_=new Ym(bd(v,{loaderType:"audio"}),t);this.subtitleSegmentLoader_=new ug(bd(v,{loaderType:"vtt",featuresNativeTextTracks:this.tech_.featuresNativeTextTracks,loadVttJs:()=>new Promise(((t,e)=>{function i(){s.off("vttjserror",n);t()}function n(){s.off("vttjsloaded",i);e()}s.one("vttjsloaded",i);s.one("vttjserror",n);s.addWebVttScript_()}))}),t);const m=()=>this.mainSegmentLoader_.bandwidth;this.contentSteeringController_=new Ug(this.vhs_.xhr,m);this.setupSegmentLoaderListeners_();if(this.bufferBasedABR){this.mainPlaylistLoader_.one("loadedplaylist",(()=>this.startABRTimer_()));this.tech_.on("pause",(()=>this.stopABRTimer_()));this.tech_.on("play",(()=>this.startABRTimer_()))}Vg.forEach((t=>{this[t+"_"]=zg.bind(this,t)}));this.logger_=gd("pc");this.triggeredFmp4Usage=false;if(this.tech_.preload()==="none"){this.loadOnPlay_=()=>{this.loadOnPlay_=null;this.mainPlaylistLoader_.load()};this.tech_.one("play",this.loadOnPlay_)}else{this.mainPlaylistLoader_.load()}this.timeToLoadedData__=-1;this.mainAppendsToLoadedData__=-1;this.audioAppendsToLoadedData__=-1;const g=this.tech_.preload()==="none"?"play":"loadstart";this.tech_.one(g,(()=>{const t=Date.now();this.tech_.one("loadeddata",(()=>{this.timeToLoadedData__=Date.now()-t;this.mainAppendsToLoadedData__=this.mainSegmentLoader_.mediaAppends;this.audioAppendsToLoadedData__=this.audioSegmentLoader_.mediaAppends}))}))}mainAppendsToLoadedData_(){return this.mainAppendsToLoadedData__}audioAppendsToLoadedData_(){return this.audioAppendsToLoadedData__}appendsToLoadedData_(){const t=this.mainAppendsToLoadedData_();const e=this.audioAppendsToLoadedData_();if(t===-1||e===-1){return-1}return t+e}timeToLoadedData_(){return this.timeToLoadedData__}checkABR_(t="abr"){const e=this.selectPlaylist();if(e&&this.shouldSwitchToMedia_(e)){this.switchMedia_(e,t)}}switchMedia_(t,e,i){const s=this.media();const n=s&&(s.id||s.uri);const r=t&&(t.id||t.uri);if(n&&n!==r){this.logger_(`switch media ${n} -> ${r} from ${e}`);const i={renditionInfo:{id:r,bandwidth:t.attributes.BANDWIDTH,resolution:t.attributes.RESOLUTION,codecs:t.attributes.CODECS},cause:e};this.trigger({type:"renditionselected",metadata:i});this.tech_.trigger({type:"usage",name:`vhs-rendition-change-${e}`})}this.mainPlaylistLoader_.media(t,i)}switchMediaForDASHContentSteering_(){["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach((t=>{const e=this.mediaTypes_[t];const i=e?e.activeGroup():null;const s=this.contentSteeringController_.getPathway();if(i&&s){const e=i.length?i[0].playlists:i.playlists;const n=e.filter((t=>t.attributes.serviceLocation===s));if(n.length){this.mediaTypes_[t].activePlaylistLoader.media(n[0])}}}))}startABRTimer_(){this.stopABRTimer_();this.abrTimer_=z.setInterval((()=>this.checkABR_()),250)}stopABRTimer_(){if(this.tech_.scrubbing&&this.tech_.scrubbing()){return}z.clearInterval(this.abrTimer_);this.abrTimer_=null}getAudioTrackPlaylists_(){const t=this.main();const e=t&&t.playlists||[];if(!t||!t.mediaGroups||!t.mediaGroups.AUDIO){return e}const i=t.mediaGroups.AUDIO;const s=Object.keys(i);let n;if(Object.keys(this.mediaTypes_.AUDIO.groups).length){n=this.mediaTypes_.AUDIO.activeTrack()}else{const t=i.main||s.length&&i[s[0]];for(const e in t){if(t[e].default){n={label:e};break}}}if(!n){return e}const r=[];for(const e in i){if(i[e][n.label]){const s=i[e][n.label];if(s.playlists&&s.playlists.length){r.push.apply(r,s.playlists)}else if(s.uri){r.push(s)}else if(t.playlists.length){for(let i=0;i<t.playlists.length;i++){const s=t.playlists[i];if(s.attributes&&s.attributes.AUDIO&&s.attributes.AUDIO===e){r.push(s)}}}}}if(!r.length){return e}return r}setupMainPlaylistLoaderListeners_(){this.mainPlaylistLoader_.on("loadedmetadata",(()=>{const t=this.mainPlaylistLoader_.media();const e=t.targetDuration*1.5*1e3;if(tp(this.mainPlaylistLoader_.main,this.mainPlaylistLoader_.media())){this.requestOptions_.timeout=0}else{this.requestOptions_.timeout=e}if(t.endList&&this.tech_.preload()!=="none"){this.mainSegmentLoader_.playlist(t,this.requestOptions_);this.mainSegmentLoader_.load()}Pg({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();if(!this.mediaTypes_.AUDIO.activePlaylistLoader||this.mediaTypes_.AUDIO.activePlaylistLoader.media()){this.trigger("selectedinitialmedia")}else{this.mediaTypes_.AUDIO.activePlaylistLoader.one("loadedmetadata",(()=>{this.trigger("selectedinitialmedia")}))}}));this.mainPlaylistLoader_.on("loadedplaylist",(()=>{if(this.loadOnPlay_){this.tech_.off("play",this.loadOnPlay_)}let t=this.mainPlaylistLoader_.media();if(!t){this.attachContentSteeringListeners_();this.initContentSteeringController_();this.excludeUnsupportedVariants_();let e;if(this.enableLowInitialPlaylist){e=this.selectInitialPlaylist()}if(!e){e=this.selectPlaylist()}if(!e||!this.shouldSwitchToMedia_(e)){return}this.initialMedia_=e;this.switchMedia_(this.initialMedia_,"initial");const i=this.sourceType_==="vhs-json"&&this.initialMedia_.segments;if(!i){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();const e=t.targetDuration*1.5*1e3;if(tp(this.mainPlaylistLoader_.main,this.mainPlaylistLoader_.media())){this.requestOptions_.timeout=0}else{this.requestOptions_.timeout=e}if(this.sourceType_==="dash"){this.mainPlaylistLoader_.load()}this.mainSegmentLoader_.pause();this.mainSegmentLoader_.playlist(t,this.requestOptions_);if(this.waitingForFastQualityPlaylistReceived_){this.runFastQualitySwitch_()}else{this.mainSegmentLoader_.load()}this.tech_.trigger({type:"mediachange",bubbles:true})}));this.mainPlaylistLoader_.on("playlistunchanged",(()=>{const t=this.mainPlaylistLoader_.media();if(t.lastExcludeReason_==="playlist-unchanged"){return}const e=this.stuckAtPlaylistEnd_(t);if(e){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"})}));const t=["manifestrequeststart","manifestrequestcomplete","manifestparsestart","manifestparsecomplete","playlistrequeststart","playlistrequestcomplete","playlistparsestart","playlistparsecomplete","renditiondisabled","renditionenabled"];t.forEach((t=>{this.mainPlaylistLoader_.on(t,(t=>{this.player_.trigger(it({},t))}))}))}handleUpdatedMediaPlaylist(t){if(this.useCueTags_){this.updateAdCues_(t)}this.mainSegmentLoader_.pause();this.mainSegmentLoader_.playlist(t,this.requestOptions_);if(this.waitingForFastQualityPlaylistReceived_){this.runFastQualitySwitch_()}this.updateDuration(!t.endList);if(!this.tech_.paused()){this.mainSegmentLoader_.load();if(this.audioSegmentLoader_){this.audioSegmentLoader_.load()}}}triggerPresenceUsage_(t,e){const i=t.mediaGroups||{};let s=true;const n=Object.keys(i.AUDIO);for(const t in i.AUDIO){for(const e in i.AUDIO[t]){const n=i.AUDIO[t][e];if(!n.uri){s=false}}}if(s){this.tech_.trigger({type:"usage",name:"vhs-demuxed"})}if(Object.keys(i.SUBTITLES).length){this.tech_.trigger({type:"usage",name:"vhs-webvtt"})}if(qg.Playlist.isAes(e)){this.tech_.trigger({type:"usage",name:"vhs-aes"})}if(n.length&&Object.keys(i.AUDIO[n[0]]).length>1){this.tech_.trigger({type:"usage",name:"vhs-alternate-audio"})}if(this.useCueTags_){this.tech_.trigger({type:"usage",name:"vhs-playlist-cue-tags"})}}shouldSwitchToMedia_(t){const e=this.mainPlaylistLoader_.media()||this.mainPlaylistLoader_.pendingMedia_;const i=this.tech_.currentTime();const s=this.bufferLowWaterLine();const n=this.bufferHighWaterLine();const r=this.tech_.buffered();return Hg({buffered:r,currentTime:i,currentPlaylist:e,nextPlaylist:t,bufferLowWaterLine:s,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",(()=>{if(this.bufferBasedABR){this.mainSegmentLoader_.load()}}));if(!this.bufferBasedABR){this.mainSegmentLoader_.on("progress",(()=>{this.trigger("progress")}))}this.mainSegmentLoader_.on("error",(()=>{const t=this.mainSegmentLoader_.error();this.excludePlaylist({playlistToExclude:t.playlist,error:t})}));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.mainSegmentLoader_.on("earlyabort",(t=>{if(this.bufferBasedABR){return}this.delegateLoaders_("all",["abort"]);this.excludePlaylist({error:{message:"Aborted early because there isn't enough bandwidth to complete "+"the request without rebuffering."},playlistExclusionDuration:Bg})}));const t=()=>{if(!this.sourceUpdater_.hasCreatedSourceBuffers()){return this.tryToCreateSourceBuffers_()}const t=this.getCodecsOrExclude_();if(!t){return}this.sourceUpdater_.addOrChangeSourceBuffers(t)};this.mainSegmentLoader_.on("trackinfo",t);this.audioSegmentLoader_.on("trackinfo",t);this.mainSegmentLoader_.on("fmp4",(()=>{if(!this.triggeredFmp4Usage){this.tech_.trigger({type:"usage",name:"vhs-fmp4"});this.triggeredFmp4Usage=true}}));this.audioSegmentLoader_.on("fmp4",(()=>{if(!this.triggeredFmp4Usage){this.tech_.trigger({type:"usage",name:"vhs-fmp4"});this.triggeredFmp4Usage=true}}));this.audioSegmentLoader_.on("ended",(()=>{this.logger_("audioSegmentLoader ended");this.onEndOfStream()}));const e=["segmentselected","segmentloadstart","segmentloaded","segmentkeyloadstart","segmentkeyloadcomplete","segmentdecryptionstart","segmentdecryptioncomplete","segmenttransmuxingstart","segmenttransmuxingcomplete","segmenttransmuxingtrackinfoavailable","segmenttransmuxingtiminginfoavailable","segmentappendstart","appendsdone","bandwidthupdated","timelinechange","codecschange"];e.forEach((t=>{this.mainSegmentLoader_.on(t,(t=>{this.player_.trigger(it({},t))}));this.audioSegmentLoader_.on(t,(t=>{this.player_.trigger(it({},t))}));this.subtitleSegmentLoader_.on(t,(t=>{this.player_.trigger(it({},t))}))}))}mediaSecondsLoaded_(){return Math.max(this.audioSegmentLoader_.mediaSecondsLoaded+this.mainSegmentLoader_.mediaSecondsLoaded)}load(){this.mainSegmentLoader_.load();if(this.mediaTypes_.AUDIO.activePlaylistLoader){this.audioSegmentLoader_.load()}if(this.mediaTypes_.SUBTITLES.activePlaylistLoader){this.subtitleSegmentLoader_.load()}}fastQualityChange_(t=this.selectPlaylist()){if(t&&t===this.mainPlaylistLoader_.media()){this.logger_("skipping fastQualityChange because new media is same as old");return}this.switchMedia_(t,"fast-quality");this.waitingForFastQualityPlaylistReceived_=true}runFastQualitySwitch_(){this.waitingForFastQualityPlaylistReceived_=false;this.mainSegmentLoader_.pause();this.mainSegmentLoader_.resetEverything((()=>{this.mainSegmentLoader_.load()}))}play(){if(this.setupFirstPlay()){return}if(this.tech_.ended()){this.tech_.setCurrentTime(0)}if(this.hasPlayed_){this.load()}const t=this.tech_.seekable();if(this.tech_.duration()===Infinity){if(this.tech_.currentTime()<t.start(0)){return this.tech_.setCurrentTime(t.end(t.length-1))}}}setupFirstPlay(){const t=this.mainPlaylistLoader_.media();if(!t||this.tech_.paused()||this.hasPlayed_){return false}if(!t.endList||t.start){const e=this.seekable();if(!e.length){return false}const i=e.end(0);let s=i;if(t.start){const n=t.start.timeOffset;if(n<0){s=Math.max(i+n,e.start(0))}else{s=Math.min(i,n)}}this.trigger("firstplay");this.tech_.setCurrentTime(s)}this.hasPlayed_=true;this.load();return true}handleSourceOpen_(){this.tryToCreateSourceBuffers_();if(this.tech_.autoplay()){const t=this.tech_.play();if(typeof t!=="undefined"&&typeof t.then==="function"){t.then(null,(t=>{}))}}this.trigger("sourceopen")}handleSourceEnded_(){if(!this.inbandTextTracks_.metadataTrack_){return}const t=this.inbandTextTracks_.metadataTrack_.cues;if(!t||!t.length){return}const e=this.duration();t[t.length-1].endTime=isNaN(e)||Math.abs(e)===Infinity?Number.MAX_VALUE:e}handleDurationChange_(){this.tech_.trigger("durationchange")}onEndOfStream(){let t=this.mainSegmentLoader_.ended_;if(this.mediaTypes_.AUDIO.activePlaylistLoader){const e=this.mainSegmentLoader_.getCurrentMediaInfo_();if(!e||e.hasVideo){t=t&&this.audioSegmentLoader_.ended_}else{t=this.audioSegmentLoader_.ended_}}if(!t){return}this.stopABRTimer_();this.sourceUpdater_.endOfStream()}stuckAtPlaylistEnd_(t){const e=this.seekable();if(!e.length){return false}const i=this.syncController_.getExpiredTime(t,this.duration());if(i===null){return false}const s=qg.Playlist.playlistEnd(t,i);const n=this.tech_.currentTime();const r=this.tech_.buffered();if(!r.length){return s-n<=Td}const o=r.end(r.length-1);return o-n<=Td&&s-o<=Td}excludePlaylist({playlistToExclude:t=this.mainPlaylistLoader_.media(),error:e={},playlistExclusionDuration:i}){t=t||this.mainPlaylistLoader_.media();i=i||e.playlistExclusionDuration||this.playlistExclusionDuration;if(!t){this.error=e;if(this.mediaSource.readyState!=="open"){this.trigger("error")}else{this.sourceUpdater_.endOfStream("network")}return}t.playlistErrors_++;const s=this.mainPlaylistLoader_.main.playlists;const n=s.filter(Wd);const r=n.length===1&&n[0]===t;if(s.length===1&&i!==Infinity){cd.log.warn(`Problem encountered with playlist ${t.id}. `+"Trying again since it is the only playlist.");this.tech_.trigger("retryplaylist");return this.mainPlaylistLoader_.load(r)}if(r){if(this.main().contentSteering){const e=this.pathwayAttribute_(t);const i=this.contentSteeringController_.steeringManifest.ttl*1e3;this.contentSteeringController_.excludePathway(e);this.excludeThenChangePathway_();setTimeout((()=>{this.contentSteeringController_.addAvailablePathway(e)}),i);return}let e=false;s.forEach((i=>{if(i===t){return}const s=i.excludeUntil;if(typeof s!=="undefined"&&s!==Infinity){e=true;delete i.excludeUntil}}));if(e){cd.log.warn("Removing other playlists from the exclusion list because the last "+"rendition is about to be excluded.");this.tech_.trigger("retryplaylist")}}let o;if(t.playlistErrors_>this.maxPlaylistRetries){o=Infinity}else{o=Date.now()+i*1e3}t.excludeUntil=o;if(e.reason){t.lastExcludeReason_=e.reason}this.tech_.trigger("excludeplaylist");this.tech_.trigger({type:"usage",name:"vhs-rendition-excluded"});const a=this.selectPlaylist();if(!a){this.error="Playback cannot continue. No available working or supported playlists.";this.trigger("error");return}const h=e.internal?this.logger_:cd.log.warn;const c=e.message?" "+e.message:"";h(`${e.internal?"Internal problem":"Problem"} encountered with playlist ${t.id}.`+`${c} Switching to playlist ${a.id}.`);if(a.attributes.AUDIO!==t.attributes.AUDIO){this.delegateLoaders_("audio",["abort","pause"])}if(a.attributes.SUBTITLES!==t.attributes.SUBTITLES){this.delegateLoaders_("subtitle",["abort","pause"])}this.delegateLoaders_("main",["abort","pause"]);const l=a.targetDuration/2*1e3||5*1e3;const u=typeof a.lastRequest==="number"&&Date.now()-a.lastRequest<=l;return this.switchMedia_(a,"exclude",r||u)}pauseLoading(){this.delegateLoaders_("all",["abort","pause"]);this.stopABRTimer_()}delegateLoaders_(t,e){const i=[];const s=t==="all";if(s||t==="main"){i.push(this.mainPlaylistLoader_)}const n=[];if(s||t==="audio"){n.push("AUDIO")}if(s||t==="subtitle"){n.push("CLOSED-CAPTIONS");n.push("SUBTITLES")}n.forEach((t=>{const e=this.mediaTypes_[t]&&this.mediaTypes_[t].activePlaylistLoader;if(e){i.push(e)}}));["main","audio","subtitle"].forEach((e=>{const s=this[`${e}SegmentLoader_`];if(s&&(t===e||t==="all")){i.push(s)}}));i.forEach((t=>e.forEach((e=>{if(typeof t[e]==="function"){t[e]()}}))))}setCurrentTime(t){const e=Sd(this.tech_.buffered(),t);if(!(this.mainPlaylistLoader_&&this.mainPlaylistLoader_.media())){return 0}if(!this.mainPlaylistLoader_.media().segments){return 0}if(e&&e.length){return t}this.mainSegmentLoader_.pause();this.mainSegmentLoader_.resetEverything();if(this.mediaTypes_.AUDIO.activePlaylistLoader){this.audioSegmentLoader_.pause();this.audioSegmentLoader_.resetEverything()}if(this.mediaTypes_.SUBTITLES.activePlaylistLoader){this.subtitleSegmentLoader_.pause();this.subtitleSegmentLoader_.resetEverything()}this.load()}duration(){if(!this.mainPlaylistLoader_){return 0}const t=this.mainPlaylistLoader_.media();if(!t){return 0}if(!t.endList){return Infinity}if(this.mediaSource){return this.mediaSource.duration}return qg.Playlist.duration(t)}seekable(){return this.seekable_}onSyncInfoUpdate_(){let t;if(!this.mainPlaylistLoader_){return}let e=this.mainPlaylistLoader_.media();if(!e){return}let i=this.syncController_.getExpiredTime(e,this.duration());if(i===null){return}const s=this.mainPlaylistLoader_.main;const n=qg.Playlist.seekable(e,i,qg.Playlist.liveEdgeDelay(s,e));if(n.length===0){return}if(this.mediaTypes_.AUDIO.activePlaylistLoader){e=this.mediaTypes_.AUDIO.activePlaylistLoader.media();i=this.syncController_.getExpiredTime(e,this.duration());if(i===null){return}t=qg.Playlist.seekable(e,i,qg.Playlist.liveEdgeDelay(s,e));if(t.length===0){return}}let r;let o;if(this.seekable_&&this.seekable_.length){r=this.seekable_.end(0);o=this.seekable_.start(0)}if(!t){this.seekable_=n}else if(t.start(0)>n.end(0)||n.start(0)>t.end(0)){this.seekable_=n}else{this.seekable_=yd([[t.start(0)>n.start(0)?t.start(0):n.start(0),t.end(0)<n.end(0)?t.end(0):n.end(0)]])}if(this.seekable_&&this.seekable_.length){if(this.seekable_.end(0)===r&&this.seekable_.start(0)===o){return}}this.logger_(`seekable updated [${Id(this.seekable_)}]`);const a={seekableRanges:this.seekable_};this.trigger({type:"seekablerangeschanged",metadata:a});this.tech_.trigger("seekablechanged")}updateDuration(t){if(this.updateDuration_){this.mediaSource.removeEventListener("sourceopen",this.updateDuration_);this.updateDuration_=null}if(this.mediaSource.readyState!=="open"){this.updateDuration_=this.updateDuration.bind(this,t);this.mediaSource.addEventListener("sourceopen",this.updateDuration_);return}if(t){const t=this.seekable();if(!t.length){return}if(isNaN(this.mediaSource.duration)||this.mediaSource.duration<t.end(t.length-1)){this.sourceUpdater_.setDuration(t.end(t.length-1))}return}const e=this.tech_.buffered();let i=qg.Playlist.duration(this.mainPlaylistLoader_.media());if(e.length>0){i=Math.max(i,e.end(e.length-1))}if(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();if(this.loadOnPlay_){this.tech_.off("play",this.loadOnPlay_)}["AUDIO","SUBTITLES"].forEach((t=>{const e=this.mediaTypes_[t].groups;for(const t in e){e[t].forEach((t=>{if(t.playlistLoader){t.playlistLoader.dispose()}}))}}));this.audioSegmentLoader_.dispose();this.subtitleSegmentLoader_.dispose();this.sourceUpdater_.dispose();this.timelineChangeController_.dispose();this.stopABRTimer_();if(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 t=!!this.mediaTypes_.AUDIO.activePlaylistLoader;const e=!!this.mainSegmentLoader_.getCurrentMediaInfo_();const i=!t?true:!!this.audioSegmentLoader_.getCurrentMediaInfo_();if(!e||!i){return false}return true}getCodecsOrExclude_(){const t={main:this.mainSegmentLoader_.getCurrentMediaInfo_()||{},audio:this.audioSegmentLoader_.getCurrentMediaInfo_()||{}};const e=this.mainSegmentLoader_.getPendingSegmentPlaylist()||this.media();t.video=t.main;const i=sm(this.main(),e);const s={};const n=!!this.mediaTypes_.AUDIO.activePlaylistLoader;if(t.main.hasVideo){s.video=i.video||t.main.videoCodec||ti}if(t.main.isMuxed){s.video+=`,${i.audio||t.main.audioCodec||Ze}`}if(t.main.hasAudio&&!t.main.isMuxed||t.audio.hasAudio||n){s.audio=i.audio||t.main.audioCodec||t.audio.audioCodec||Ze;t.audio.isFmp4=t.main.hasAudio&&!t.main.isMuxed?t.main.isFmp4:t.audio.isFmp4}if(!s.audio&&!s.video){this.excludePlaylist({playlistToExclude:e,error:{message:"Could not determine codecs for playlist."},playlistExclusionDuration:Infinity});return}const r=(t,e)=>t?Ke(e):Qe(e);const o={};let a;["video","audio"].forEach((function(e){if(s.hasOwnProperty(e)&&!r(t[e].isFmp4,s[e])){const i=t[e].isFmp4?"browser":"muxer";o[i]=o[i]||[];o[i].push(s[e]);if(e==="audio"){a=i}}}));if(n&&a&&e.attributes.AUDIO){const t=e.attributes.AUDIO;this.main().playlists.forEach((i=>{const s=i.attributes&&i.attributes.AUDIO;if(s===t&&i!==e){i.excludeUntil=Infinity}}));this.logger_(`excluding audio group ${t} as ${a} does not support codec(s): "${s.audio}"`)}if(Object.keys(o).length){const t=Object.keys(o).reduce(((t,e)=>{if(t){t+=", "}t+=`${e} does not support codec(s): "${o[e].join(",")}"`;return t}),"")+".";this.excludePlaylist({playlistToExclude:e,error:{internal:true,message:t},playlistExclusionDuration:Infinity});return}if(this.sourceUpdater_.hasCreatedSourceBuffers()&&!this.sourceUpdater_.canChangeType()){const t=[];["video","audio"].forEach((e=>{const i=(Xe(this.sourceUpdater_.codecs[e]||"")[0]||{}).type;const n=(Xe(s[e]||"")[0]||{}).type;if(i&&n&&i.toLowerCase()!==n.toLowerCase()){t.push(`"${this.sourceUpdater_.codecs[e]}" -> "${s[e]}"`)}}));if(t.length){this.excludePlaylist({playlistToExclude:e,error:{message:`Codec switching not supported: ${t.join(", ")}.`,internal:true},playlistExclusionDuration:Infinity});return}}return s}tryToCreateSourceBuffers_(){if(this.mediaSource.readyState!=="open"||this.sourceUpdater_.hasCreatedSourceBuffers()){return}if(!this.areMediaTypesKnown_()){return}const t=this.getCodecsOrExclude_();if(!t){return}this.sourceUpdater_.createSourceBuffers(t);const e=[t.video,t.audio].filter(Boolean).join(",");this.excludeIncompatibleVariants_(e)}excludeUnsupportedVariants_(){const t=this.main().playlists;const e=[];Object.keys(t).forEach((i=>{const s=t[i];if(e.indexOf(s.id)!==-1){return}e.push(s.id);const n=sm(this.main,s);const r=[];if(n.audio&&!Qe(n.audio)&&!Ke(n.audio)){r.push(`audio codec ${n.audio}`)}if(n.video&&!Qe(n.video)&&!Ke(n.video)){r.push(`video codec ${n.video}`)}if(n.text&&n.text==="stpp.ttml.im1t"){r.push(`text codec ${n.text}`)}if(r.length){s.excludeUntil=Infinity;this.logger_(`excluding ${s.id} for unsupported: ${r.join(", ")}`)}}))}excludeIncompatibleVariants_(t){const e=[];const i=this.main().playlists;const s=em(Xe(t));const n=im(s);const r=s.video&&Xe(s.video)[0]||null;const o=s.audio&&Xe(s.audio)[0]||null;Object.keys(i).forEach((t=>{const s=i[t];if(e.indexOf(s.id)!==-1||s.excludeUntil===Infinity){return}e.push(s.id);const a=[];const h=sm(this.mainPlaylistLoader_.main,s);const c=im(h);if(!h.audio&&!h.video){return}if(c!==n){a.push(`codec count "${c}" !== "${n}"`)}if(!this.sourceUpdater_.canChangeType()){const t=h.video&&Xe(h.video)[0]||null;const e=h.audio&&Xe(h.audio)[0]||null;if(t&&r&&t.type.toLowerCase()!==r.type.toLowerCase()){a.push(`video codec "${t.type}" !== "${r.type}"`)}if(e&&o&&e.type.toLowerCase()!==o.type.toLowerCase()){a.push(`audio codec "${e.type}" !== "${o.type}"`)}}if(a.length){s.excludeUntil=Infinity;this.logger_(`excluding ${s.id}: ${a.join(" && ")}`)}}))}updateAdCues_(t){let e=0;const i=this.seekable();if(i.length){e=i.start(0)}dg(t,this.cueTagsTrack_,e)}goalBufferLength(){const t=this.tech_.currentTime();const e=fv.GOAL_BUFFER_LENGTH;const i=fv.GOAL_BUFFER_LENGTH_RATE;const s=Math.max(e,fv.MAX_GOAL_BUFFER_LENGTH);return Math.min(e+t*i,s)}bufferLowWaterLine(){const t=this.tech_.currentTime();const e=fv.BUFFER_LOW_WATER_LINE;const i=fv.BUFFER_LOW_WATER_LINE_RATE;const s=Math.max(e,fv.MAX_BUFFER_LOW_WATER_LINE);const n=Math.max(e,fv.EXPERIMENTAL_MAX_BUFFER_LOW_WATER_LINE);return Math.min(e+t*i,this.bufferBasedABR?n:s)}bufferHighWaterLine(){return fv.BUFFER_HIGH_WATER_LINE}addDateRangesToTextTrack_(t){Sm(this.inbandTextTracks_,"com.apple.streaming",this.tech_);km({inbandTextTracks:this.inbandTextTracks_,dateRanges:t})}addMetadataToTextTrack(t,e,i){const s=this.sourceUpdater_.videoBuffer?this.sourceUpdater_.videoTimestampOffset():this.sourceUpdater_.audioTimestampOffset();Sm(this.inbandTextTracks_,t,this.tech_);jm({inbandTextTracks:this.inbandTextTracks_,metadataArray:e,timestampOffset:s,videoDuration:i})}pathwayAttribute_(t){return t.attributes["PATHWAY-ID"]||t.attributes.serviceLocation}initContentSteeringController_(){const t=this.main();if(!t.contentSteering){return}for(const e of t.playlists){this.contentSteeringController_.addAvailablePathway(this.pathwayAttribute_(e))}this.contentSteeringController_.assignTagProperties(t.uri,t.contentSteering);if(this.contentSteeringController_.queryBeforeStart){this.contentSteeringController_.requestSteeringManifest(true);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));const t=["contentsteeringloadstart","contentsteeringloadcomplete","contentsteeringparsed"];t.forEach((t=>{this.contentSteeringController_.on(t,(t=>{this.trigger(it({},t))}))}));if(this.sourceType_==="dash"){this.mainPlaylistLoader_.on("loadedplaylist",(()=>{const t=this.main();const e=this.contentSteeringController_.didDASHTagChange(t.uri,t.contentSteering);const i=()=>{const e=this.contentSteeringController_.getAvailablePathways();const i=[];for(const s of t.playlists){const t=s.attributes.serviceLocation;if(t){i.push(t);if(!e.has(t)){return true}}}if(!i.length&&e.size){return true}return false};if(e||i()){this.resetContentSteeringController_()}}))}}excludeThenChangePathway_(){const t=this.contentSteeringController_.getPathway();if(!t){return}this.handlePathwayClones_();const e=this.main();const i=e.playlists;const s=new Set;let n=false;Object.keys(i).forEach((e=>{const r=i[e];const o=this.pathwayAttribute_(r);const a=o&&t!==o;const h=r.excludeUntil===Infinity&&r.lastExcludeReason_==="content-steering";if(h&&!a){delete r.excludeUntil;delete r.lastExcludeReason_;n=true}const c=!r.excludeUntil&&r.excludeUntil!==Infinity;const l=!s.has(r.id)&&a&&c;if(!l){return}s.add(r.id);r.excludeUntil=Infinity;r.lastExcludeReason_="content-steering";this.logger_(`excluding ${r.id} for ${r.lastExcludeReason_}`)}));if(this.contentSteeringController_.manifestType_==="DASH"){Object.keys(this.mediaTypes_).forEach((e=>{const i=this.mediaTypes_[e];if(i.activePlaylistLoader){const e=i.activePlaylistLoader.media_;if(e&&e.attributes.serviceLocation!==t){n=true}}}))}if(n){this.changeSegmentPathway_()}}handlePathwayClones_(){const t=this.main();const e=t.playlists;const i=this.contentSteeringController_.currentPathwayClones;const s=this.contentSteeringController_.nextPathwayClones;const n=i&&i.size||s&&s.size;if(!n){return}for(const[t,e]of i.entries()){const i=s.get(t);if(!i){this.mainPlaylistLoader_.updateOrDeleteClone(e);this.contentSteeringController_.excludePathway(t)}}for(const[t,n]of s.entries()){const s=i.get(t);if(!s){const i=e.filter((t=>t.attributes["PATHWAY-ID"]===n["BASE-ID"]));i.forEach((t=>{this.mainPlaylistLoader_.addClonePathway(n,t)}));this.contentSteeringController_.addAvailablePathway(t);continue}if(this.equalPathwayClones_(s,n)){continue}this.mainPlaylistLoader_.updateOrDeleteClone(n,true);this.contentSteeringController_.addAvailablePathway(t)}this.contentSteeringController_.currentPathwayClones=new Map(JSON.parse(JSON.stringify([...s])))}equalPathwayClones_(t,e){if(t["BASE-ID"]!==e["BASE-ID"]||t.ID!==e.ID||t["URI-REPLACEMENT"].HOST!==e["URI-REPLACEMENT"].HOST){return false}const i=t["URI-REPLACEMENT"].PARAMS;const s=e["URI-REPLACEMENT"].PARAMS;for(const t in i){if(i[t]!==s[t]){return false}}for(const t in s){if(i[t]!==s[t]){return false}}return true}changeSegmentPathway_(){const t=this.selectPlaylist();this.pauseLoading();if(this.contentSteeringController_.manifestType_==="DASH"){this.switchMediaForDASHContentSteering_()}this.switchMedia_(t,"content-steering")}excludeNonUsablePlaylistsByKeyId_(){if(!this.mainPlaylistLoader_||!this.mainPlaylistLoader_.main){return}let t=0;const e="non-usable";this.mainPlaylistLoader_.main.playlists.forEach((i=>{const s=this.mainPlaylistLoader_.getKeyIdSet(i);if(!s||!s.size){return}s.forEach((s=>{const n="usable";const r=this.keyStatusMap_.has(s)&&this.keyStatusMap_.get(s)===n;const o=i.lastExcludeReason_===e&&i.excludeUntil===Infinity;if(!r){if(i.excludeUntil!==Infinity&&i.lastExcludeReason_!==e){i.excludeUntil=Infinity;i.lastExcludeReason_=e;this.logger_(`excluding playlist ${i.id} because the key ID ${s} doesn't exist in the keyStatusMap or is not ${n}`)}t++}else if(r&&o){delete i.excludeUntil;delete i.lastExcludeReason_;this.logger_(`enabling playlist ${i.id} because key ID ${s} is ${n}`)}}))}));if(t>=this.mainPlaylistLoader_.main.playlists.length){this.mainPlaylistLoader_.main.playlists.forEach((t=>{const i=t&&t.attributes&&t.attributes.RESOLUTION&&t.attributes.RESOLUTION.height<720;const s=t.excludeUntil===Infinity&&t.lastExcludeReason_===e;if(i&&s){delete t.excludeUntil;cd.log.warn(`enabling non-HD playlist ${t.id} because all playlists were excluded due to ${e} key IDs`)}}))}}addKeyStatus_(t,e){const i=typeof t==="string";const s=i?t:hg(t);const n=s.slice(0,32).toLowerCase();this.logger_(`KeyStatus '${e}' with key ID ${n} added to the keyStatusMap`);this.keyStatusMap_.set(n,e)}updatePlaylistByKeyStatus(t,e){this.addKeyStatus_(t,e);if(!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 Gg=(t,e,i)=>s=>{const n=t.main.playlists[e];const r=Yd(n);const o=Wd(n);if(typeof s==="undefined"){return o}if(s){delete n.disabled}else{n.disabled=true}const a={renditionInfo:{id:e,bandwidth:n.attributes.BANDWIDTH,resolution:n.attributes.RESOLUTION,codecs:n.attributes.CODECS},cause:"fast-quality"};if(s!==o&&!r){i(n);if(s){t.trigger({type:"renditionenabled",metadata:a})}else{t.trigger({type:"renditiondisabled",metadata:a})}}return s};class Yg{constructor(t,e,i){const{playlistController_:s}=t;const n=s.fastQualityChange_.bind(s);if(e.attributes){const t=e.attributes.RESOLUTION;this.width=t&&t.width;this.height=t&&t.height;this.bandwidth=e.attributes.BANDWIDTH;this.frameRate=e.attributes["FRAME-RATE"]}this.codecs=sm(s.main(),e);this.playlist=e;this.id=i;this.enabled=Gg(t.playlists,e.id,n)}}const Wg=function(t){t.representations=()=>{const e=t.playlistController_.main();const i=sp(e)?t.playlistController_.getAudioTrackPlaylists_():e.playlists;if(!i){return[]}return i.filter((t=>!Yd(t))).map(((e,i)=>new Yg(t,e,e.id)))}};const Jg=["seeking","seeked","pause","playing","error"];class Kg extends cd.EventTarget{constructor(t){super();this.playlistController_=t.playlistController;this.tech_=t.tech;this.seekable=t.seekable;this.allowSeeksWithinUnsafeLiveWindow=t.allowSeeksWithinUnsafeLiveWindow;this.liveRangeSafeTimeDelta=t.liveRangeSafeTimeDelta;this.media=t.media;this.playedRanges_=[];this.consecutiveUpdates=0;this.lastRecordedTime=null;this.checkCurrentTimeTimeout_=null;this.logger_=gd("PlaybackWatcher");this.logger_("initialize");const e=()=>this.monitorCurrentTime_();const i=()=>this.monitorCurrentTime_();const s=()=>this.techWaiting_();const n=()=>this.resetTimeUpdate_();const r=this.playlistController_;const o=["main","subtitle","audio"];const a={};o.forEach((t=>{a[t]={reset:()=>this.resetSegmentDownloads_(t),updateend:()=>this.checkSegmentDownloads_(t)};r[`${t}SegmentLoader_`].on("appendsdone",a[t].updateend);r[`${t}SegmentLoader_`].on("playlistupdate",a[t].reset);this.tech_.on(["seeked","seeking"],a[t].reset)}));const h=t=>{["main","audio"].forEach((e=>{r[`${e}SegmentLoader_`][t]("appended",this.seekingAppendCheck_)}))};this.seekingAppendCheck_=()=>{if(this.fixesBadSeeks_()){this.consecutiveUpdates=0;this.lastRecordedTime=this.tech_.currentTime();h("off")}};this.clearSeekingAppendCheck_=()=>h("off");this.watchForBadSeeking_=()=>{this.clearSeekingAppendCheck_();h("on")};this.tech_.on("seeked",this.clearSeekingAppendCheck_);this.tech_.on("seeking",this.watchForBadSeeking_);this.tech_.on("waiting",s);this.tech_.on(Jg,n);this.tech_.on("canplay",i);this.tech_.one("play",e);this.dispose=()=>{this.clearSeekingAppendCheck_();this.logger_("dispose");this.tech_.off("waiting",s);this.tech_.off(Jg,n);this.tech_.off("canplay",i);this.tech_.off("play",e);this.tech_.off("seeking",this.watchForBadSeeking_);this.tech_.off("seeked",this.clearSeekingAppendCheck_);o.forEach((t=>{r[`${t}SegmentLoader_`].off("appendsdone",a[t].updateend);r[`${t}SegmentLoader_`].off("playlistupdate",a[t].reset);this.tech_.off(["seeked","seeking"],a[t].reset)}));if(this.checkCurrentTimeTimeout_){z.clearTimeout(this.checkCurrentTimeTimeout_)}this.resetTimeUpdate_()}}monitorCurrentTime_(){this.checkCurrentTime_();if(this.checkCurrentTimeTimeout_){z.clearTimeout(this.checkCurrentTimeTimeout_)}this.checkCurrentTimeTimeout_=z.setTimeout(this.monitorCurrentTime_.bind(this),250)}resetSegmentDownloads_(t){const e=this.playlistController_[`${t}SegmentLoader_`];if(this[`${t}StalledDownloads_`]>0){this.logger_(`resetting possible stalled download count for ${t} loader`)}this[`${t}StalledDownloads_`]=0;this[`${t}Buffered_`]=e.buffered_()}checkSegmentDownloads_(t){const e=this.playlistController_;const i=e[`${t}SegmentLoader_`];const s=i.buffered_();const n=Nd(this[`${t}Buffered_`],s);this[`${t}Buffered_`]=s;if(n){const i={bufferedRanges:s};e.trigger({type:"bufferedrangeschanged",metadata:i});this.resetSegmentDownloads_(t);return}this[`${t}StalledDownloads_`]++;this.logger_(`found #${this[`${t}StalledDownloads_`]} ${t} appends that did not increase buffer (possible stalled download)`,{playlistId:i.playlist_&&i.playlist_.id,buffered:Cd(s)});if(this[`${t}StalledDownloads_`]<10){return}this.logger_(`${t} loader stalled download exclusion`);this.resetSegmentDownloads_(t);this.tech_.trigger({type:"usage",name:`vhs-${t}-download-exclusion`});if(t==="subtitle"){return}e.excludePlaylist({error:{message:`Excessive ${t} segment downloading detected.`},playlistExclusionDuration:Infinity})}checkCurrentTime_(){if(this.tech_.paused()||this.tech_.seeking()){return}const t=this.tech_.currentTime();const e=this.tech_.buffered();if(this.lastRecordedTime===t&&(!e.length||t+Td>=e.end(e.length-1))){return this.techWaiting_()}if(this.consecutiveUpdates>=5&&t===this.lastRecordedTime){this.consecutiveUpdates++;this.waiting_()}else if(t===this.lastRecordedTime){this.consecutiveUpdates++}else{this.playedRanges_.push(yd([this.lastRecordedTime,t]));const e={playedRanges:this.playedRanges_};this.playlistController_.trigger({type:"playedrangeschanged",metadata:e});this.consecutiveUpdates=0;this.lastRecordedTime=t}}resetTimeUpdate_(){this.consecutiveUpdates=0}fixesBadSeeks_(){const t=this.tech_.seeking();if(!t){return false}const e=this.seekable();const i=this.tech_.currentTime();const s=this.afterSeekableWindow_(e,i,this.media(),this.allowSeeksWithinUnsafeLiveWindow);let n;if(s){const t=e.end(e.length-1);n=t}if(this.beforeSeekableWindow_(e,i)){const t=e.start(0);n=t+(t===e.end(0)?0:Td)}if(typeof n!=="undefined"){this.logger_(`Trying to seek outside of seekable at time ${i} with `+`seekable range ${Id(e)}. Seeking to `+`${n}.`);this.tech_.setCurrentTime(n);return true}const r=this.playlistController_.sourceUpdater_;const o=this.tech_.buffered();const a=r.audioBuffer?r.audioBuffered():null;const h=r.videoBuffer?r.videoBuffered():null;const c=this.media();const l=c.partTargetDuration?c.partTargetDuration:(c.targetDuration-wd)*2;const u=[a,h];for(let t=0;t<u.length;t++){if(!u[t]){continue}const e=Od(u[t],i);if(e<l){return false}}const f=xd(o,i);if(f.length===0){return false}n=f.start(0)+Td;this.logger_(`Buffered region starts (${f.start(0)}) `+` just beyond seek point (${i}). Seeking to ${n}.`);this.tech_.setCurrentTime(n);return true}waiting_(){if(this.techWaiting_()){return}const t=this.tech_.currentTime();const e=this.tech_.buffered();const i=Sd(e,t);if(i.length&&t+3<=i.end(0)){this.resetTimeUpdate_();this.tech_.setCurrentTime(t);this.logger_(`Stopped at ${t} 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 t=this.seekable();const e=this.tech_.currentTime();if(this.tech_.seeking()){return true}if(this.beforeSeekableWindow_(t,e)){const i=t.end(t.length-1);this.logger_(`Fell out of live window at time ${e}. Seeking to `+`live point (seekable end) ${i}`);this.resetTimeUpdate_();this.tech_.setCurrentTime(i);this.tech_.trigger({type:"usage",name:"vhs-live-resync"});return true}const i=this.tech_.vhs.playlistController_.sourceUpdater_;const s=this.tech_.buffered();const n=this.videoUnderflow_({audioBuffered:i.audioBuffered(),videoBuffered:i.videoBuffered(),currentTime:e});if(n){this.resetTimeUpdate_();this.tech_.setCurrentTime(e);this.tech_.trigger({type:"usage",name:"vhs-video-underflow"});return true}const r=xd(s,e);if(r.length>0){this.logger_(`Stopped at ${e} and seeking to ${r.start(0)}`);this.resetTimeUpdate_();this.skipTheGap_(e);return true}return false}afterSeekableWindow_(t,e,i,s=false){if(!t.length){return false}let n=t.end(t.length-1)+Td;const r=!i.endList;const o=typeof i.partTargetDuration==="number";if(r&&(o||s)){n=t.end(t.length-1)+i.targetDuration*3}if(e>n){return true}return false}beforeSeekableWindow_(t,e){if(t.length&&t.start(0)>0&&e<t.start(0)-this.liveRangeSafeTimeDelta){return true}return false}videoUnderflow_({videoBuffered:t,audioBuffered:e,currentTime:i}){if(!t){return}let s;if(t.length&&e.length){const n=Sd(t,i-3);const r=Sd(t,i);const o=Sd(e,i);if(o.length&&!r.length&&n.length){s={start:n.end(0),end:o.end(0)}}}else{const e=xd(t,i);if(!e.length){s=this.gapFromVideoUnderflow_(t,i)}}if(s){this.logger_(`Encountered a gap in video from ${s.start} to ${s.end}. `+`Seeking to current time ${i}`);return true}return false}skipTheGap_(t){const e=this.tech_.buffered();const i=this.tech_.currentTime();const s=xd(e,i);this.resetTimeUpdate_();if(s.length===0||i!==t){return}this.logger_("skipTheGap_:","currentTime:",i,"scheduled currentTime:",t,"nextRange start:",s.start(0));this.tech_.setCurrentTime(s.start(0)+wd);const n={gapInfo:{from:i,to:s.start(0)}};this.playlistController_.trigger({type:"gapjumped",metadata:n});this.tech_.trigger({type:"usage",name:"vhs-gap-skip"})}gapFromVideoUnderflow_(t,e){const i=Ad(t);for(let t=0;t<i.length;t++){const s=i.start(t);const n=i.end(t);if(e-s<4&&e-s>2){return{start:s,end:n}}}return null}}const Qg={errorInterval:30,getSource(t){const e=this.tech({IWillNotUseThisInPlugins:true});const i=e.currentSource_||this.currentSource();return t(i)}};const Zg=function(t,e){let i=0;let s=0;const n=bd(Qg,e);t.ready((()=>{t.trigger({type:"usage",name:"vhs-error-reload-initialized"})}));const r=function(){if(s){t.currentTime(s)}};const o=function(e){if(e===null||e===undefined){return}s=t.duration()!==Infinity&&t.currentTime()||0;t.one("loadedmetadata",r);t.src(e);t.trigger({type:"usage",name:"vhs-error-reload"});t.play()};const a=function(){if(Date.now()-i<n.errorInterval*1e3){t.trigger({type:"usage",name:"vhs-error-reload-canceled"});return}if(!n.getSource||typeof n.getSource!=="function"){cd.log.error("ERROR: reloadSourceOnError - The option getSource must be a function!");return}i=Date.now();return n.getSource.call(t,o)};const h=function(){t.off("loadedmetadata",r);t.off("error",a);t.off("dispose",h)};const c=function(e){h();Zg(t,e)};t.on("error",a);t.on("dispose",h);t.reloadSourceOnError=c};const tb=function(t){Zg(this,t)};var eb="3.13.2";var ib="7.0.3";var sb="1.3.0";var nb="7.1.0";var rb="4.0.1";const ob={PlaylistLoader:Ip,Playlist:np,utils:zp,STANDARD_PLAYLIST_SELECTOR:um,INITIAL_PLAYLIST_SELECTOR:pm,lastBandwidthSelector:um,movingAverageBandwidthSelector:fm,comparePlaylistBandwidth:hm,comparePlaylistResolution:cm,xhr:_p()};Object.keys(fv).forEach((t=>{Object.defineProperty(ob,t,{get(){cd.log.warn(`using Vhs.${t} is UNSAFE be sure you know what you are doing`);return fv[t]},set(e){cd.log.warn(`using Vhs.${t} is UNSAFE be sure you know what you are doing`);if(typeof e!=="number"||e<0){cd.log.warn(`value of Vhs.${t} must be greater than or equal to 0`);return}fv[t]=e}})}));const ab="videojs-vhs";const hb=function(t,e){const i=e.media();let s=-1;for(let e=0;e<t.length;e++){if(t[e].id===i.id){s=e;break}}t.selectedIndex_=s;t.trigger({selectedIndex:s,type:"change"})};const cb=function(t,e){e.representations().forEach((e=>{t.addQualityLevel(e)}));hb(t,e.playlists)};ob.canPlaySource=function(){return cd.log.warn("VHS is no longer a tech. Please remove it from "+"your player's techOrder.")};const lb=(t,e,i)=>{if(!t){return t}let s={};if(e&&e.attributes&&e.attributes.CODECS){s=em(Xe(e.attributes.CODECS))}if(i&&i.attributes&&i.attributes.CODECS){s.audio=i.attributes.CODECS}const n=Je(s.video);const r=Je(s.audio);const o={};for(const i in t){o[i]={};if(r){o[i].audioContentType=r}if(n){o[i].videoContentType=n}if(e.contentProtection&&e.contentProtection[i]&&e.contentProtection[i].pssh){o[i].pssh=e.contentProtection[i].pssh}if(typeof t[i]==="string"){o[i].url=t[i]}}return bd(t,o)};const ub=(t,e)=>t.reduce(((t,i)=>{if(!i.contentProtection){return t}const s=e.reduce(((t,e)=>{const s=i.contentProtection[e];if(s&&s.pssh){t[e]={pssh:s.pssh}}return t}),{});if(Object.keys(s).length){t.push(s)}return t}),[]);const fb=({player:t,sourceKeySystems:e,audioMedia:i,mainPlaylists:s})=>{if(!t.eme.initializeMediaKeys){return Promise.resolve()}const n=i?s.concat([i]):s;const r=ub(n,Object.keys(e));const o=[];const a=[];r.forEach((e=>{a.push(new Promise(((e,i)=>{t.tech_.one("keysessioncreated",e)})));o.push(new Promise(((i,s)=>{t.eme.initializeMediaKeys({keySystems:e},(t=>{if(t){s(t);return}i()}))})))}));return Promise.race([Promise.all(o),Promise.race(a)])};const db=({player:t,sourceKeySystems:e,media:i,audioMedia:s})=>{const n=lb(e,i,s);if(!n){return false}t.currentSource().keySystems=n;if(n&&!t.eme){cd.log.warn("DRM encrypted source cannot be decrypted without a DRM plugin");return false}return true};const pb=()=>{if(!z.localStorage){return null}const t=z.localStorage.getItem(ab);if(!t){return null}try{return JSON.parse(t)}catch(t){return null}};const vb=t=>{if(!z.localStorage){return false}let e=pb();e=e?bd(e,t):t;try{z.localStorage.setItem(ab,JSON.stringify(e))}catch(t){return false}return e};const mb=t=>{if(t.toLowerCase().indexOf("data:application/vnd.videojs.vhs+json,")===0){return JSON.parse(t.substring(t.indexOf(",")+1))}return t};const gb=(t,e)=>{if(!t._requestCallbackSet){t._requestCallbackSet=new Set}t._requestCallbackSet.add(e)};const bb=(t,e)=>{if(!t._responseCallbackSet){t._responseCallbackSet=new Set}t._responseCallbackSet.add(e)};const yb=(t,e)=>{if(!t._requestCallbackSet){return}t._requestCallbackSet.delete(e);if(!t._requestCallbackSet.size){delete t._requestCallbackSet}};const jb=(t,e)=>{if(!t._responseCallbackSet){return}t._responseCallbackSet.delete(e);if(!t._responseCallbackSet.size){delete t._responseCallbackSet}};ob.supportsNativeHls=function(){if(!K||!K.createElement){return false}const t=K.createElement("video");if(!cd.getTech("Html5").isSupported()){return false}const e=["application/vnd.apple.mpegurl","audio/mpegurl","audio/x-mpegurl","application/x-mpegurl","video/x-mpegurl","video/mpegurl","application/mpegurl"];return e.some((function(e){return/maybe|probably/i.test(t.canPlayType(e))}))}();ob.supportsNativeDash=function(){if(!K||!K.createElement||!cd.getTech("Html5").isSupported()){return false}return/maybe|probably/i.test(K.createElement("video").canPlayType("application/dash+xml"))}();ob.supportsTypeNatively=t=>{if(t==="hls"){return ob.supportsNativeHls}if(t==="dash"){return ob.supportsNativeDash}return false};ob.isSupported=function(){return cd.log.warn("VHS is no longer a tech. Please remove it from "+"your player's techOrder.")};ob.xhr.onRequest=function(t){gb(ob.xhr,t)};ob.xhr.onResponse=function(t){bb(ob.xhr,t)};ob.xhr.offRequest=function(t){yb(ob.xhr,t)};ob.xhr.offResponse=function(t){jb(ob.xhr,t)};const wb=cd.getComponent("Component");class Tb extends wb{constructor(t,e,i){super(e,i.vhs);if(typeof i.initialBandwidth==="number"){this.options_.bandwidth=i.initialBandwidth}this.logger_=gd("VhsHandler");if(e.options_&&e.options_.playerId){const t=cd.getPlayer(e.options_.playerId);this.player_=t}this.tech_=e;this.source_=t;this.stats={};this.ignoreNextSeekingEvent_=false;this.setOptions_();if(this.options_.overrideNative&&e.overrideNativeAudioTracks&&e.overrideNativeVideoTracks){e.overrideNativeAudioTracks(true);e.overrideNativeVideoTracks(true)}else if(this.options_.overrideNative&&(e.featuresNativeVideoTracks||e.featuresNativeAudioTracks)){throw new Error("Overriding native VHS requires emulated tracks. "+"See https://git.io/vMpjB")}this.on(K,["fullscreenchange","webkitfullscreenchange","mozfullscreenchange","MSFullscreenChange"],(t=>{const e=K.fullscreenElement||K.webkitFullscreenElement||K.mozFullScreenElement||K.msFullscreenElement;if(e&&e.contains(this.tech_.el())){this.playlistController_.fastQualityChange_()}else{this.playlistController_.checkABR_()}}));this.on(this.tech_,"seeking",(function(){if(this.ignoreNextSeekingEvent_){this.ignoreNextSeekingEvent_=false;return}this.setCurrentTime(this.tech_.currentTime())}));this.on(this.tech_,"error",(function(){if(this.tech_.error()&&this.playlistController_){this.playlistController_.pauseLoading()}}));this.on(this.tech_,"play",this.play)}setOptions_(t={}){this.options_=bd(this.options_,t);this.options_.withCredentials=this.options_.withCredentials||false;this.options_.limitRenditionByPlayerDimensions=this.options_.limitRenditionByPlayerDimensions===false?false:true;this.options_.useDevicePixelRatio=this.options_.useDevicePixelRatio||false;this.options_.useBandwidthFromLocalStorage=typeof this.source_.useBandwidthFromLocalStorage!=="undefined"?this.source_.useBandwidthFromLocalStorage:this.options_.useBandwidthFromLocalStorage||false;this.options_.useForcedSubtitles=this.options_.useForcedSubtitles||false;this.options_.useNetworkInformationApi=this.options_.useNetworkInformationApi||false;this.options_.useDtsForTimestampOffset=this.options_.useDtsForTimestampOffset||false;this.options_.customTagParsers=this.options_.customTagParsers||[];this.options_.customTagMappers=this.options_.customTagMappers||[];this.options_.cacheEncryptionKeys=this.options_.cacheEncryptionKeys||false;this.options_.llhls=this.options_.llhls===false?false:true;this.options_.bufferBasedABR=this.options_.bufferBasedABR||false;if(typeof this.options_.playlistExclusionDuration!=="number"){this.options_.playlistExclusionDuration=60}if(typeof this.options_.bandwidth!=="number"){if(this.options_.useBandwidthFromLocalStorage){const t=pb();if(t&&t.bandwidth){this.options_.bandwidth=t.bandwidth;this.tech_.trigger({type:"usage",name:"vhs-bandwidth-from-local-storage"})}if(t&&t.throughput){this.options_.throughput=t.throughput;this.tech_.trigger({type:"usage",name:"vhs-throughput-from-local-storage"})}}}if(typeof this.options_.bandwidth!=="number"){this.options_.bandwidth=fv.INITIAL_BANDWIDTH}this.options_.enableLowInitialPlaylist=this.options_.enableLowInitialPlaylist&&this.options_.bandwidth===fv.INITIAL_BANDWIDTH;["withCredentials","useDevicePixelRatio","customPixelRatio","limitRenditionByPlayerDimensions","bandwidth","customTagParsers","customTagMappers","cacheEncryptionKeys","playlistSelector","initialPlaylistSelector","bufferBasedABR","liveRangeSafeTimeDelta","llhls","useForcedSubtitles","useNetworkInformationApi","useDtsForTimestampOffset","exactManifestTimings","leastPixelDiffSelector"].forEach((t=>{if(typeof this.source_[t]!=="undefined"){this.options_[t]=this.source_[t]}}));this.limitRenditionByPlayerDimensions=this.options_.limitRenditionByPlayerDimensions;this.useDevicePixelRatio=this.options_.useDevicePixelRatio;const e=this.options_.customPixelRatio;if(typeof e==="number"&&e>=0){this.customPixelRatio=e}}setOptions(t={}){this.setOptions_(t)}src(t,e){if(!t){return}this.setOptions_();this.options_.src=mb(this.source_.src);this.options_.tech=this.tech_;this.options_.externVhs=ob;this.options_.sourceType=si(e);this.options_.seekTo=t=>{this.tech_.setCurrentTime(t)};this.options_.player_=this.player_;this.playlistController_=new Xg(this.options_);const i=bd({liveRangeSafeTimeDelta:Td},this.options_,{seekable:()=>this.seekable(),media:()=>this.playlistController_.media(),playlistController:this.playlistController_});this.playbackWatcher_=new Kg(i);this.attachStreamingEventListeners_();this.playlistController_.on("error",(()=>{const t=cd.players[this.tech_.options_.playerId];let e=this.playlistController_.error;if(typeof e==="object"&&!e.code){e.code=3}else if(typeof e==="string"){e={message:e,code:3}}t.error(e)}));const s=this.options_.bufferBasedABR?ob.movingAverageBandwidthSelector(.55):ob.STANDARD_PLAYLIST_SELECTOR;this.playlistController_.selectPlaylist=this.selectPlaylist?this.selectPlaylist.bind(this):s.bind(this);this.playlistController_.selectInitialPlaylist=ob.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(t){this.playlistController_.selectPlaylist=t.bind(this)}},throughput:{get(){return this.playlistController_.mainSegmentLoader_.throughput.rate},set(t){this.playlistController_.mainSegmentLoader_.throughput.rate=t;this.playlistController_.mainSegmentLoader_.throughput.count=1}},bandwidth:{get(){let t=this.playlistController_.mainSegmentLoader_.bandwidth;const e=z.navigator.connection||z.navigator.mozConnection||z.navigator.webkitConnection;const i=1e7;if(this.options_.useNetworkInformationApi&&e){const s=e.downlink*1e3*1e3;if(s>=i&&t>=i){t=Math.max(t,s)}else{t=s}}return t},set(t){this.playlistController_.mainSegmentLoader_.bandwidth=t;this.playlistController_.mainSegmentLoader_.throughput={rate:0,count:0}}},systemBandwidth:{get(){const t=1/(this.bandwidth||1);let e;if(this.throughput>0){e=1/this.throughput}else{e=0}const i=Math.floor(1/(t+e));return i},set(){cd.log.error('The "systemBandwidth" property is read-only')}}});if(this.options_.bandwidth){this.bandwidth=this.options_.bandwidth}if(this.options_.throughput){this.throughput=this.options_.throughput}Object.defineProperties(this.stats,{bandwidth:{get:()=>this.bandwidth||0,enumerable:true},mediaRequests:{get:()=>this.playlistController_.mediaRequests_()||0,enumerable:true},mediaRequestsAborted:{get:()=>this.playlistController_.mediaRequestsAborted_()||0,enumerable:true},mediaRequestsTimedout:{get:()=>this.playlistController_.mediaRequestsTimedout_()||0,enumerable:true},mediaRequestsErrored:{get:()=>this.playlistController_.mediaRequestsErrored_()||0,enumerable:true},mediaTransferDuration:{get:()=>this.playlistController_.mediaTransferDuration_()||0,enumerable:true},mediaBytesTransferred:{get:()=>this.playlistController_.mediaBytesTransferred_()||0,enumerable:true},mediaSecondsLoaded:{get:()=>this.playlistController_.mediaSecondsLoaded_()||0,enumerable:true},mediaAppends:{get:()=>this.playlistController_.mediaAppends_()||0,enumerable:true},mainAppendsToLoadedData:{get:()=>this.playlistController_.mainAppendsToLoadedData_()||0,enumerable:true},audioAppendsToLoadedData:{get:()=>this.playlistController_.audioAppendsToLoadedData_()||0,enumerable:true},appendsToLoadedData:{get:()=>this.playlistController_.appendsToLoadedData_()||0,enumerable:true},timeToLoadedData:{get:()=>this.playlistController_.timeToLoadedData_()||0,enumerable:true},buffered:{get:()=>Cd(this.tech_.buffered()),enumerable:true},currentTime:{get:()=>this.tech_.currentTime(),enumerable:true},currentSource:{get:()=>this.tech_.currentSource_,enumerable:true},currentTech:{get:()=>this.tech_.name_,enumerable:true},duration:{get:()=>this.tech_.duration(),enumerable:true},main:{get:()=>this.playlists.main,enumerable:true},playerDimensions:{get:()=>this.tech_.currentDimensions(),enumerable:true},seekable:{get:()=>Cd(this.tech_.seekable()),enumerable:true},timestamp:{get:()=>Date.now(),enumerable:true},videoPlaybackQuality:{get:()=>this.tech_.getVideoPlaybackQuality(),enumerable:true}});this.tech_.one("canplay",this.playlistController_.setupFirstPlay.bind(this.playlistController_));this.tech_.on("bandwidthupdate",(()=>{if(this.options_.useBandwidthFromLocalStorage){vb({bandwidth:this.bandwidth,throughput:Math.round(this.throughput)})}}));this.playlistController_.on("selectedinitialmedia",(()=>{Wg(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_=true}));this.setupQualityLevels_();if(!this.tech_.el()){return}this.mediaSourceUrl_=z.URL.createObjectURL(this.playlistController_.mediaSource);this.tech_.src(this.mediaSourceUrl_)}createKeySessions_(){const t=this.playlistController_.mediaTypes_.AUDIO.activePlaylistLoader;this.logger_("waiting for EME key session creation");fb({player:this.player_,sourceKeySystems:this.source_.keySystems,audioMedia:t&&t.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 t=this.playlistController_.mediaTypes_.AUDIO.activePlaylistLoader;const e=db({player:this.player_,sourceKeySystems:this.source_.keySystems,media:this.playlists.media(),audioMedia:t&&t.media()});this.player_.tech_.on("keystatuschange",(t=>{this.playlistController_.updatePlaylistByKeyStatus(t.keyId,t.status)}));this.handleWaitingForKey_=this.handleWaitingForKey_.bind(this);this.player_.tech_.on("waitingforkey",this.handleWaitingForKey_);if(!e){this.playlistController_.sourceUpdater_.initializedEme();return}this.createKeySessions_()}setupQualityLevels_(){const t=cd.players[this.tech_.options_.playerId];if(!t||!t.qualityLevels||this.qualityLevels_){return}this.qualityLevels_=t.qualityLevels();this.playlistController_.on("selectedinitialmedia",(()=>{cb(this.qualityLevels_,this)}));this.playlists.on("mediachange",(()=>{hb(this.qualityLevels_,this.playlists)}))}static version(){return{"@videojs/http-streaming":eb,"mux.js":ib,"mpd-parser":sb,"m3u8-parser":nb,"aes-decrypter":rb}}version(){return this.constructor.version()}canChangeType(){return og.canChangeType()}play(){this.playlistController_.play()}setCurrentTime(t){this.playlistController_.setCurrentTime(t)}duration(){return this.playlistController_.duration()}seekable(){return this.playlistController_.seekable()}dispose(){if(this.playbackWatcher_){this.playbackWatcher_.dispose()}if(this.playlistController_){this.playlistController_.dispose()}if(this.qualityLevels_){this.qualityLevels_.dispose()}if(this.tech_&&this.tech_.vhs){delete this.tech_.vhs}if(this.mediaSourceUrl_&&z.URL.revokeObjectURL){z.URL.revokeObjectURL(this.mediaSourceUrl_);this.mediaSourceUrl_=null}if(this.tech_){this.tech_.off("waitingforkey",this.handleWaitingForKey_)}super.dispose()}convertToProgramTime(t,e){return Qp({playlist:this.playlistController_.media(),time:t,callback:e})}seekToProgramTime(t,e,i=true,s=2){return Zp({programTime:t,playlist:this.playlistController_.media(),retryCount:s,pauseAfterSeek:i,seekTo:this.options_.seekTo,tech:this.options_.tech,callback:e})}setupXhrHooks_(){this.xhr.onRequest=t=>{gb(this.xhr,t)};this.xhr.onResponse=t=>{bb(this.xhr,t)};this.xhr.offRequest=t=>{yb(this.xhr,t)};this.xhr.offResponse=t=>{jb(this.xhr,t)};this.player_.trigger("xhr-hooks-ready")}attachStreamingEventListeners_(){const t=["seekablerangeschanged","bufferedrangeschanged","contentsteeringloadstart","contentsteeringloadcomplete","contentsteeringparsed"];const e=["gapjumped","playedrangeschanged"];t.forEach((t=>{this.playlistController_.on(t,(t=>{this.player_.trigger(it({},t))}))}));e.forEach((t=>{this.playbackWatcher_.on(t,(t=>{this.player_.trigger(it({},t))}))}))}}const kb={name:"videojs-http-streaming",VERSION:eb,canHandleSource(t,e={}){const i=bd(cd.options,e);return kb.canPlayType(t.type,i)},handleSource(t,e,i={}){const s=bd(cd.options,i);e.vhs=new Tb(t,e,s);e.vhs.xhr=_p();e.vhs.setupXhrHooks_();e.vhs.src(t.src,t.type);return e.vhs},canPlayType(t,e){const i=si(t);if(!i){return""}const s=kb.getOverrideNative(e);const n=ob.supportsTypeNatively(i);const r=!n||s;return r?"maybe":""},getOverrideNative(t={}){const{vhs:e={}}=t;const i=!(cd.browser.IS_ANY_SAFARI||cd.browser.IS_IOS);const{overrideNative:s=i}=e;return s}};const Sb=()=>Ke("avc1.4d400d,mp4a.40.2");if(Sb()){cd.getTech("Html5").registerSourceHandler(kb,0)}cd.VhsHandler=Tb;cd.VhsSourceHandler=kb;cd.Vhs=ob;if(!cd.use){cd.registerComponent("Vhs",ob)}cd.options.vhs=cd.options.vhs||{};if(!cd.getPlugin||!cd.getPlugin("reloadSourceOnError")){cd.registerPlugin("reloadSourceOnError",tb)}const xb=Object.freeze({__proto__:null,default:cd});var Ab={exports:{}};const Eb=q(xb);(function(t,e){(function(e,i){{var s=Eb;t.exports=i(s.default||s)}})(U,(function(t){var e=t.browser.IS_IOS||t.browser.IS_NATIVE_ANDROID;var i=t.getTech("Tech");class s extends i{constructor(t,i){super(t,i);this.setPoster(t.poster);this.setSrc(this.options_.source,true);this.setTimeout(function(){if(this.el_){this.el_.parentNode.className+=" vjs-youtube";if(e){this.el_.parentNode.className+=" vjs-youtube-mobile"}if(s.isApiReady){this.initYTPlayer()}else{s.apiReadyQueue.push(this)}}}.bind(this))}dispose(){if(this.ytPlayer){if(this.ytPlayer.stopVideo){this.ytPlayer.stopVideo()}if(this.ytPlayer.destroy){this.ytPlayer.destroy()}}else{var t=s.apiReadyQueue.indexOf(this);if(t!==-1){s.apiReadyQueue.splice(t,1)}}this.ytPlayer=null;this.el_.parentNode.className=this.el_.parentNode.className.replace(" vjs-youtube","").replace(" vjs-youtube-mobile","");this.el_.parentNode.removeChild(this.el_);i.prototype.dispose.call(this)}createEl(){var t=document.createElement("div");t.setAttribute("id",this.options_.techId);t.setAttribute("style","width:100%;height:100%;top:0;left:0;position:absolute");t.setAttribute("class","vjs-tech");var i=document.createElement("div");i.appendChild(t);if(!e&&!this.options_.ytControls){var s=document.createElement("div");s.setAttribute("class","vjs-iframe-blocker");s.setAttribute("style","position:absolute;top:0;left:0;width:100%;height:100%");s.onclick=function(){this.pause()}.bind(this);i.appendChild(s)}return i}initYTPlayer(){var t={controls:0,modestbranding:1,rel:0,showinfo:0,loop:this.options_.loop?1:0};if(typeof this.options_.autohide!=="undefined"){t.autohide=this.options_.autohide}if(typeof this.options_["cc_load_policy"]!=="undefined"){t["cc_load_policy"]=this.options_["cc_load_policy"]}if(typeof this.options_.ytControls!=="undefined"){t.controls=this.options_.ytControls}if(typeof this.options_.disablekb!=="undefined"){t.disablekb=this.options_.disablekb}if(typeof this.options_.color!=="undefined"){t.color=this.options_.color}if(!t.controls){t.fs=0}else if(typeof this.options_.fs!=="undefined"){t.fs=this.options_.fs}if(this.options_.source.src.indexOf("end=")!==-1){var e=this.options_.source.src.match(/end=([0-9]*)/);this.options_.end=parseInt(e[1])}if(typeof this.options_.end!=="undefined"){t.end=this.options_.end}if(typeof this.options_.hl!=="undefined"){t.hl=this.options_.hl}else if(typeof this.options_.language!=="undefined"){t.hl=this.options_.language.substr(0,2)}if(typeof this.options_["iv_load_policy"]!=="undefined"){t["iv_load_policy"]=this.options_["iv_load_policy"]}if(typeof this.options_.list!=="undefined"){t.list=this.options_.list}else if(this.url&&typeof this.url.listId!=="undefined"){t.list=this.url.listId}if(typeof this.options_.listType!=="undefined"){t.listType=this.options_.listType}if(typeof this.options_.modestbranding!=="undefined"){t.modestbranding=this.options_.modestbranding}if(typeof this.options_.playlist!=="undefined"){t.playlist=this.options_.playlist}if(typeof this.options_.playsinline!=="undefined"){t.playsinline=this.options_.playsinline}if(typeof this.options_.rel!=="undefined"){t.rel=this.options_.rel}if(typeof this.options_.showinfo!=="undefined"){t.showinfo=this.options_.showinfo}if(this.options_.source.src.indexOf("start=")!==-1){var i=this.options_.source.src.match(/start=([0-9]*)/);this.options_.start=parseInt(i[1])}if(typeof this.options_.start!=="undefined"){t.start=this.options_.start}if(typeof this.options_.theme!=="undefined"){t.theme=this.options_.theme}if(typeof this.options_.customVars!=="undefined"){var s=this.options_.customVars;Object.keys(s).forEach((function(e){t[e]=s[e]}))}this.activeVideoId=this.url?this.url.videoId:null;this.activeList=t.list;var n={videoId:this.activeVideoId,playerVars:t,events:{onReady:this.onPlayerReady.bind(this),onPlaybackQualityChange:this.onPlayerPlaybackQualityChange.bind(this),onPlaybackRateChange:this.onPlayerPlaybackRateChange.bind(this),onStateChange:this.onPlayerStateChange.bind(this),onVolumeChange:this.onPlayerVolumeChange.bind(this),onError:this.onPlayerError.bind(this)}};if(typeof this.options_.enablePrivacyEnhancedMode!=="undefined"&&this.options_.enablePrivacyEnhancedMode){n.host="https://www.youtube-nocookie.com"}this.ytPlayer=new YT.Player(this.options_.techId,n)}onPlayerReady(){if(this.options_.muted){this.ytPlayer.mute()}var t=this.ytPlayer.getAvailablePlaybackRates();if(t.length>1){this.featuresPlaybackRate=true}this.playerReady_=true;this.triggerReady();if(this.playOnReady){this.play()}else if(this.cueOnReady){this.cueVideoById_(this.url.videoId);this.activeVideoId=this.url.videoId}}onPlayerPlaybackQualityChange(){}onPlayerPlaybackRateChange(){this.trigger("ratechange")}onPlayerStateChange(t){var e=t.data;if(e===this.lastState||this.errorNumber){return}this.lastState=e;switch(e){case-1:this.trigger("loadstart");this.trigger("loadedmetadata");this.trigger("durationchange");this.trigger("ratechange");break;case YT.PlayerState.ENDED:this.trigger("ended");break;case YT.PlayerState.PLAYING:this.trigger("timeupdate");this.trigger("durationchange");this.trigger("playing");this.trigger("play");if(this.isSeeking){this.onSeeked()}break;case YT.PlayerState.PAUSED:this.trigger("canplay");if(this.isSeeking){this.onSeeked()}else{this.trigger("pause")}break;case YT.PlayerState.BUFFERING:this.player_.trigger("timeupdate");this.player_.trigger("waiting");break}}onPlayerVolumeChange(){this.trigger("volumechange")}onPlayerError(t){this.errorNumber=t.data;this.trigger("pause");this.trigger("error")}error(){var t=1e3+this.errorNumber;switch(this.errorNumber){case 5:return{code:t,message:"Error while trying to play the video"};case 2:case 100:return{code:t,message:"Unable to find the video"};case 101:case 150:return{code:t,message:"Playback on other Websites has been disabled by the video owner."}}return{code:t,message:"YouTube unknown error ("+this.errorNumber+")"}}loadVideoById_(t){var e={videoId:t};if(this.options_.start){e.startSeconds=this.options_.start}if(this.options_.end){e.endSeconds=this.options_.end}this.ytPlayer.loadVideoById(e)}cueVideoById_(t){var e={videoId:t};if(this.options_.start){e.startSeconds=this.options_.start}if(this.options_.end){e.endSeconds=this.options_.end}this.ytPlayer.cueVideoById(e)}src(t){if(t){this.setSrc({src:t})}return this.source}poster(){if(e){return null}return this.poster_}setPoster(t){this.poster_=t}setSrc(t){if(!t||!t.src){return}delete this.errorNumber;this.source=t;this.url=s.parseUrl(t.src);if(!this.options_.poster){if(this.url.videoId){this.poster_="https://img.youtube.com/vi/"+this.url.videoId+"/0.jpg";this.trigger("posterchange");this.checkHighResPoster()}}if(this.options_.autoplay&&!e){if(this.isReady_){this.play()}else{this.playOnReady=true}}else if(this.activeVideoId!==this.url.videoId){if(this.isReady_){this.cueVideoById_(this.url.videoId);this.activeVideoId=this.url.videoId}else{this.cueOnReady=true}}}autoplay(){return this.options_.autoplay}setAutoplay(t){this.options_.autoplay=t}loop(){return this.options_.loop}setLoop(t){this.options_.loop=t}play(){if(!this.url||!this.url.videoId){return}this.wasPausedBeforeSeek=false;if(this.isReady_){if(this.url.listId){if(this.activeList===this.url.listId){this.ytPlayer.playVideo()}else{this.ytPlayer.loadPlaylist(this.url.listId);this.activeList=this.url.listId}}if(this.activeVideoId===this.url.videoId){this.ytPlayer.playVideo()}else{this.loadVideoById_(this.url.videoId);this.activeVideoId=this.url.videoId}}else{this.trigger("waiting");this.playOnReady=true}}pause(){if(this.ytPlayer){this.ytPlayer.pauseVideo()}}paused(){return this.ytPlayer?this.lastState!==YT.PlayerState.PLAYING&&this.lastState!==YT.PlayerState.BUFFERING:true}currentTime(){return this.ytPlayer?this.ytPlayer.getCurrentTime():0}setCurrentTime(t){if(this.lastState===YT.PlayerState.PAUSED){this.timeBeforeSeek=this.currentTime()}if(!this.isSeeking){this.wasPausedBeforeSeek=this.paused()}this.ytPlayer.seekTo(t,true);this.trigger("timeupdate");this.trigger("seeking");this.isSeeking=true;if(this.lastState===YT.PlayerState.PAUSED&&this.timeBeforeSeek!==t){clearInterval(this.checkSeekedInPauseInterval);this.checkSeekedInPauseInterval=setInterval(function(){if(this.lastState!==YT.PlayerState.PAUSED||!this.isSeeking){clearInterval(this.checkSeekedInPauseInterval)}else if(this.currentTime()!==this.timeBeforeSeek){this.trigger("timeupdate");this.onSeeked()}}.bind(this),250)}}seeking(){return this.isSeeking}seekable(){if(!this.ytPlayer){return t.createTimeRange()}return t.createTimeRange(0,this.ytPlayer.getDuration())}onSeeked(){clearInterval(this.checkSeekedInPauseInterval);this.isSeeking=false;if(this.wasPausedBeforeSeek){this.pause()}this.trigger("seeked")}playbackRate(){return this.ytPlayer?this.ytPlayer.getPlaybackRate():1}setPlaybackRate(t){if(!this.ytPlayer){return}this.ytPlayer.setPlaybackRate(t)}duration(){return this.ytPlayer?this.ytPlayer.getDuration():0}currentSrc(){return this.source&&this.source.src}ended(){return this.ytPlayer?this.lastState===YT.PlayerState.ENDED:false}volume(){return this.ytPlayer?this.ytPlayer.getVolume()/100:1}setVolume(t){if(!this.ytPlayer){return}this.ytPlayer.setVolume(t*100)}muted(){return this.ytPlayer?this.ytPlayer.isMuted():false}setMuted(t){if(!this.ytPlayer){return}else{this.muted(true)}if(t){this.ytPlayer.mute()}else{this.ytPlayer.unMute()}this.setTimeout((function(){this.trigger("volumechange")}),50)}buffered(){if(!this.ytPlayer||!this.ytPlayer.getVideoLoadedFraction){return t.createTimeRange()}var e=this.ytPlayer.getVideoLoadedFraction()*this.ytPlayer.getDuration();return t.createTimeRange(0,e)}preload(){}load(){}reset(){}networkState(){if(!this.ytPlayer){return 0}switch(this.ytPlayer.getPlayerState()){case-1:return 0;case 3:return 2;default:return 1}}readyState(){if(!this.ytPlayer){return 0}switch(this.ytPlayer.getPlayerState()){case-1:return 0;case 5:return 1;case 3:return 2;default:return 4}}supportsFullScreen(){return document.fullscreenEnabled||document.webkitFullscreenEnabled||document.mozFullScreenEnabled||document.msFullscreenEnabled}checkHighResPoster(){var t="https://img.youtube.com/vi/"+this.url.videoId+"/maxresdefault.jpg";try{var e=new Image;e.onload=function(){if("naturalHeight"in e){if(e.naturalHeight<=90||e.naturalWidth<=120){return}}else if(e.height<=90||e.width<=120){return}this.poster_=t;this.trigger("posterchange")}.bind(this);e.onerror=function(){};e.src=t}catch(t){}}}s.isSupported=function(){return true};s.canPlaySource=function(t){return s.canPlayType(t.type)};s.canPlayType=function(t){return t==="video/youtube"};s.parseUrl=function(t){var e={videoId:null};var i=/^.*(youtu.be\/|v\/|u\/\w\/|embed\/|watch\?v=|\&v=)([^#\&\?]*).*/;var s=t.match(i);if(s&&s[2].length===11){e.videoId=s[2]}var n=/[?&]list=([^#\&\?]+)/;s=t.match(n);if(s&&s[1]){e.listId=s[1]}return e};function n(){YT.ready((function(){s.isApiReady=true;for(var t=0;t<s.apiReadyQueue.length;++t){s.apiReadyQueue[t].initYTPlayer()}}))}function r(t,e){var i=false;var s=document.createElement("script");var n=document.getElementsByTagName("script")[0];if(!n){return}n.parentNode.insertBefore(s,n);s.onload=function(){if(!i){i=true;e()}};s.onreadystatechange=function(){if(!i&&(this.readyState==="complete"||this.readyState==="loaded")){i=true;e()}};s.src=t}function o(){var t=".vjs-youtube .vjs-iframe-blocker { display: none; }"+".vjs-youtube.vjs-user-inactive .vjs-iframe-blocker { display: block; }"+".vjs-youtube .vjs-poster { background-size: cover; }"+".vjs-youtube-mobile .vjs-big-play-button { display: none; }";var e=document.head||document.getElementsByTagName("head")[0];var i=document.createElement("style");i.type="text/css";if(i.styleSheet){i.styleSheet.cssText=t}else{i.appendChild(document.createTextNode(t))}e.appendChild(i)}s.apiReadyQueue=[];if(typeof document!=="undefined"){r("https://www.youtube.com/iframe_api",n);o()}if(typeof t.registerTech!=="undefined"){t.registerTech("Youtube",s)}else{t.registerComponent("Youtube",s)}}))})(Ab);const Ib='.vjs-svg-icon{display:inline-block;background-repeat:no-repeat;background-position:center;fill:currentColor;height:1.8em;width:1.8em}.vjs-svg-icon:before{content:none!important}.vjs-control:focus .vjs-svg-icon,.vjs-svg-icon:hover{filter:drop-shadow(0 0 .25em #fff)}.video-js .vjs-big-play-button .vjs-icon-placeholder:before,.video-js .vjs-modal-dialog,.vjs-button>.vjs-icon-placeholder:before,.vjs-modal-dialog .vjs-modal-dialog-content{position:absolute;top:0;left:0;width:100%;height:100%}.video-js .vjs-big-play-button .vjs-icon-placeholder:before,.vjs-button>.vjs-icon-placeholder:before{text-align:center}@font-face{font-family:VideoJS;src:url(data:application/font-woff;charset=utf-8;base64,d09GRgABAAAAABTsAAsAAAAAIpAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAABHU1VCAAABCAAAADsAAABUIIslek9TLzIAAAFEAAAAPgAAAFZRiV32Y21hcAAAAYQAAAEJAAAD5p42+VxnbHlmAAACkAAADtIAABckI4l972hlYWQAABFkAAAAKwAAADYsvIjpaGhlYQAAEZAAAAAdAAAAJA+RCL1obXR4AAARsAAAABcAAAC8Q2YAAGxvY2EAABHIAAAAYAAAAGB7CIGGbWF4cAAAEigAAAAfAAAAIAFAAI9uYW1lAAASSAAAASUAAAIK1cf1oHBvc3QAABNwAAABfAAAAnXdFqh1eJxjYGRgYOBiMGCwY2BycfMJYeDLSSzJY5BiYGGAAJA8MpsxJzM9kYEDxgPKsYBpDiBmg4gCACY7BUgAeJxjYGR7yDiBgZWBgaWQ5RkDA8MvCM0cwxDOeI6BgYmBlZkBKwhIc01hcPjI+FGPHcRdyA4RZgQRADaGCyYAAHic7dPXbcMwAEXRK1vuvffem749XAbKV3bjBA6fXsaIgMMLEWoQJaAEFKNnlELyQ4K27zib5PNF6vl8yld+TKr5kH0+cUw0xv00Hwvx2DResUyFKrV4XoMmLdp06NKjz4AhI8ZMmDJjzoIlK9Zs2LJjz4EjJ85cuHLjziPe/0UWL17mf2tqKLz/9jK9f8tXpGCoRdPKhtS0RqFkWvVQNtSKoVYNtWaoddPXEBqG2jQ9XWgZattQO4baNdSeofYNdWCoQ0MdGerYUCeGOjXUmaHODXVhqEtDXRnq2lA3hro11J2h7g31YKhHQz0Z6tlQL4Z6NdSbod4N9WGoT9MfHF6GmhnZLxyDcRMAAAB4nJ1YC1hU17U+a5/HMA4iA3NmVBDmoQwP5TFnHlFeA4gYiUFRQINoSCBAyK3G2yi+0aipYtFcHYo2xsb4NiY3+VrNxSaX5uvt495ozNdoYoxmem2/L8HGpLc+InB279pnhlGr5mvL4eyz99nrrL32eu1/DQcc/okdYgdHOA6MQKp4r9gx0EcMHMezOalVasW5BM7NcXoSb9fFgE6KtSSBxWz1FYDPG+vMBGcKb9cebu2VS5s2aaTkCvRSf6C7Y+Ppibm5E09v7IDs2/3uZQtbD0zIyppwoHXh/93ukmyYgdePNRp65p5v+3v/9otQl2O7wP34cT88p8Md2YxpYLQZoRcy6FlSBRnwnGAe6BPMSCZo+7NJVqS0cE4uHendzhSnbPH6TDqL1+Nme5LZXkCHnGyoH0kne30WH+gswhm3q+pt/mTas9NLS64GnjmSlTPw0wVQT/ewRaBgxtydy3cuUB9/6SW+vb5yRvr+t0eOfPKJZ/9t3+4tL7xj32Xd3thCxi+ge6ifdsAN+l5+wi5HQ/cCoeull1AszS7CUfEcJzK7sKWJAdJhCd0sPM4+EY7QDm5ov08hXRQXE5bf6PV5Q5+IjW7X7Nku92Ask4l2hCRRD6TPqISiCJeQna3SCFwrhrNzXHzo4yFevBwxpzxk8WCIIfkvVEKVy32SbT8n68gzgaslpaiO2zIGIyuSb7RNf9HSuN26y/7OC1tgEmpiyA6aD4qcgTOiLThwGG0eB694FI8NHLLN6OBlRVaMxNAFS4JdXUG6mW8PwpKuYLCLXKGbu8iwYNdgO06Sn3Th+/vyZAxs8Ro30DjHe9gy8Fywi24OMm7Qyzh3MTZVOMYhLBnoC+J79lpTUyQmorjhnMwlcQ5uPEYGpDjsOkkH49BjQLQBqs3jFtFdJNlksYmoQFDArLh8Xh+Qd6Ghcsb6FUuehDi+U/lqD71K/qiegeV1imcwjl7ExwiSrf4BZyCujV6cVcFo6VX+G9IcPyFjJnUufbU/jzrL1X99as36reXl8K32nFaOr+E8jWJEcJ55DpMVfSMe95/AJaOsGBH2GJCNpiRQbK4C8BjdmQA22QY2j03Em13i2YHqtNLU1NI04Yj2HJgA6fQc6VPNpA/D+Ryks554NnVy2mB72uRUfPLsqR4N0LOBQKArwJYO+5W2fgZX8oC1HR6HjNaQTVIG2FPwnTcXXGZZfNB7TE6pTKZUwaw91XWLAoFFGcnB5PHjsckgBjbWutrL+0h5Y1xw3DRGDumsnXb3MJwXrJIN5U7m0rgJ3yG5w4he5ckFG4pmNEkOm0/xOO4r4yL87wqtQM+hiJIVp+6iG2wPBKD35ElGkDx+UfC2v1mFG1o+M3AjNFty8biKMXwzyxnZLds8wYD2BxmCPHAldPOeLsy/0BugftYhVYFAhO8SqQ0j3oK7dHJZnI/jxmUS4onlxskSF8thmvNZjIrRZwEPxr0lBuLRuz3oy/FOHCsxwOPYh2M+e9u3J5pgPYz9gp6G7C9m0A11F9ddqKMfV+4sbq45/YspOysXvT+3pdFdYNg2fHbW8Dz301MqDVuGrz0Fuh0YMW8mddrpqzST7rV9BcvqPoNvadRndWp0p8HvbiqrFj5yFQ/vNFSXDpxpLEFWp+DcrF3FT1afWshFcmCfeAMjEvO65i0Y6XijQfSRPWx3TV/Df7Km3E1l+kLt56s/rwVzuRusNMhudznkwdLaS+QNdeal2jDPP4l9qHc98vTYZOSkxzD+njBWVWjFPKgipx6DkWvXQiW8OYcewVHE5yukinDMcfGgc0opDltYKDxIGBedkzc6jSfE7tlvESCDFUw0Hx0opS+U0lHCxNottbNWSxX9zZVvEhKWUSyBpaXwBc2a98M6UqPeXAs/GDon8Ax7hsthO8cM5HU7Ad0UvRR9lHmtyQKZ4MAe814X5h9MSUkQmhf96eVJ6p90OjIiqSIjvykvr2l5U55O/fPQKD+jIomYpNyGJQ25uQ2kIikRfAmuBHCPsWqkSDEqgZ5KDI2sifS/R43MbZg0idFHbCPNxXxZws1ACVE6hAhOdJwRkJLFBLPZpRGYJ50pko6XzMkgmSx40ljik6AQcKhFnLcQE6rF7PXFe1Ocoj0T3AXgSgJTDIhHRfHlYZKuSzc6uievOJGXY+i5GJkkTp7UM3y0LqATDbtFcbdBxO7o4T25JYlEjoH0uynUh8rapkxp62QN70svSF+hT4gGPlovlmcm/ComLi7mV4kTykV9NFWjE/QrwgQ4uIcAP0rQF4VZYRP2o3PhHHzfPMJj9Ir+uzKUlrH49ntT18AVvj1sc3YGjUT/Mt2Dxawa8ArcA7bCQIpvfwAYu22vEG/No/5RvPdA7g+AelLrPwzy+LtkLPhnpIxH14m4EYq8eeMHbPEPNm6G7Nv9B4jcFPZ8bJj0SEjP3MPgQdKTqqEoy2v6G32P/Y6dxOv04AxnoAeq+GILvUavtYCBXm+BaIhuodcfrN5B/V2EYMCPh+SxavjGyPwV0x4CJgUPGT0mQaODGBACIJZGsMXwAD0LGXx7l3CdAcKMIKI+f5CepWeD0BvyU/GcdBxPF8SwejC6LGZmAURFdsSWKR5HyHld2kbdIZO1Ixx+bnnzU7n5+blPNV9jnUDWhP2tC68tbN3PVIldsQPxSAcSpjOav7Q05uXn5zW2LLvDXn9B6syscPy9iDLEMmSrJz6nYuWMipukjM0AH8JkGS+XFyMRkzSCH7KD/hwm172SAyZYumHlefr5AddrtA0O0TnwaVZxcRY9Bfukn9Gf05N1r9DV9MoBsJ1f+ZrqUvtPHizJAntWybv7hmqLt6QLuK6ZS9Fqi1jO5rDoWPZXXII5Tgajg53cIXCjDCGIcYrRIY2n6+mXOa/W0bdhau3ryiEYe2FV/5oeaIYK/5w5frCyll6/cYO8DiNhw6t1MBWmznt91QX62UF1N7l0eHBZTRGpKaqpKVIPF9UcIzmReud9TSY75+K899GHbBu6wjoR7RKKZVYiYxSPf5/2wJT5e3NAhmUbVn5KLx1Ujg0+BGvpAIh0DezInTkzF37KVocxrKU3r1+XLtAe2lO3l66kfQfB/unKY+q8N375Ru8bc4pJXfEcESU95q+p8ZNZRTWH1d9FzvUdYXk5rLkcdkEisoKKVHQW/b3GEx6tPaYcoJfOr9wAbSBnv1IHpep0OExr4LPMkpJM+j7sly7UHkOzXjoAZljHCGiyegtNlwljM0v+c19ET9Pvst09a2Mtgcf5/ZSzYO5h1156+eyydfAsxGa9XAuF6vzjh6CssLq6ECysperXX0sX5h5ZdpZe3guxsGIPEtHk/aqXX1hVqP5HYVVVISkrrNqvXorIc+5Ou91Hnr/LcD2afi6eX7UBloOcs7cOpqgGaNfs1g7bNbs9z6wASaylN69d0/TFTIz6Ws8+oGV3mE2612wRTHKcVUbhjKadebloMc+dyXgMVtVK6BwMB/+mVW09igdRBWaRtNQX59d/VD//xdQ0TCiYNj1KT9sq6Wdu5WTbqk3qDXyDaLa1fv621LS01G3z61sD6lH8lAxDLicV921s6Bf92JOYvzNYCL1khbqBXEFUzC521N5NyzNaQIWhjyFyDoBIVrAjmv2UEaLlI+c6zw1jmVIPLLLZZUTj6GxGHW+mq1tgHXR2D85p4Q934+jLbtjVLcyCdS10NVzpHqxp4Q/hK7WopY/NRGx9HGsPGdFjOjcpjBnGYMVqY/4eqT5khWEHWUup2A/pTw7pdWgsWft7ETUERL96nRg0HNFPmCYba6pylECaExX89A9WLUOVB4oKLu/o1oqSYHCgLzBUlAz8hNFDRpeSU1XT+LRmDUgPaKbYdHDn9suF/tu13nHJij0N97LfS0QmqONuyONk7zvUI6Qa0pF9f2+oABL92AT6e0U//z9YqAiWtJLU1JK0gS+1aacwamiNqK067u9ZQ8f1d4qLodMzz3uL89Z68V/Hnr++hXWUuHgw8dfi972PeTyPefu3aNNucemQ74qFuIaJnVkOu4Q+yjuwmmC1FqZpl1i4uzoPxjkpPf3Xv545tl26Rr+dOvUd+omqJzch9dOeU7f10Y64nMcKK137DccIZq2WdXtdZjbEoLSzHwiMtrjYLDxpHQW8gjMX6XFYAE2zSWVD04EGYSs9MbO6sEo20BMEAB4mpvSypsKjZ4Stgzb+c3A9/MQT2+vrBy+qvyFxLUtLlSRF/Ri2wjfZ2dus2Q8lXx4608/jnqK5OOap6NY2PSjYYnECCjiEeLJll/pbmqfeIK+ps3+MxrlEhqmTPipVP7kqlF4VhpEb6r+Q7YOJg38kJ9SHBf3NBl6+9YchfbUjb5ahLSzUM3kPHmwFAsZ5rpai0S7E5xWzZ1j+fW7zsUWP2g5NXTw52ySCTrgG0+lbw60l2Y/CB185CoA8NK+tbRKxfjy6pm5hzQRRR+cMqv1Jbiw6STivtEvt3DRcy0QEh92JlUGo2PG4tSKHl00YD6xc8CK+YPYyy3io2lN8BcSjKRzrIV6ypOAobqxViJPaT9M9Hy5szY33mp7OX/Zu89L/7Ww5vqY2Y8b0pKgoiUhG5cPDPzq8qTV/WkzUOIvXVVA96kmjcBrr3HrYC/Wn+fYP6Z7T1rqy3zknbvqma/FvVk96fNXGkuaXrdHW5JGSxZT/2I/O73v+yNWafMdzc5NdxYurHs6h86e01sLKLz9EBrg+x36rxAaED7hRnAMx7Vzu+9wabh3zG8XLQjx0ablUJzmxdErxYT3kzQSd0SSafVqF5PXgpp0OyYJ1EyNHpGUZmvK575ySzd85JSqF7IBzSAbMM04+MbE58xF3/njXOGecSaermlw2y9PsSQdytLJVr8t+wg+rR8cZYoeNxVIzNdk3Bngi8U5LAlgTFoQnzJCa5EsCgYhCaGL+qPj7TdhG31p9tej3R04N//PXxNwJvyUqwaJqRPJY98TJ5TPndmflRAkAhBfe46sfKW5wizSge08Xb7Ca/GUVs55trngkKkrUS2WPzKttaaqq+idmahugkY+W6fN0I6i3gPt/x88U4wAAeJxjYGRgYADiGU9YXsXz23xl4GZnAIFH7fO+IdMc/WBxDgYmEAUASbMKwAB4nGNgZGBgZwABjj4Ghv//OfoZGBlQgT4ARicDZAAAAHicY2BgYGAfxJijD8Fmu4EqBwCSpgKpAAAAAAAADgBoAH4AzADgAQIBQgFsAZgB7gIuAooC0AL8A2IDjAOoA+AEMASwBNoFCAVaBcAGCAYuBnAGrAb2B04HigfSCCoIcAiGCJwIyAkkCVYJiAmsCfIKIApWCsQLknicY2BkYGDQZ2hmYGcAASYg5gJCBob/YD4DABqrAdAAeJxdkE1qg0AYhl8Tk9AIoVDaVSmzahcF87PMARLIMoFAl0ZHY1BHdBJIT9AT9AQ9RQ9Qeqy+yteNMzDzfM+88w0K4BY/cNAMB6N2bUaPPBLukybCLvleeAAPj8JD+hfhMV7hC3u4wxs7OO4NzQSZcI/8Ltwnfwi75E/hAR7wJTyk/xYeY49fYQ/PztM+jbTZ7LY6OWdBJdX/pqs6NYWa+zMxa13oKrA6Uoerqi/JwtpYxZXJ1coUVmeZUWVlTjq0/tHacjmdxuL90OR8O0UEDYMNdtiSEpz5XQGqzlm30kzUdAYFFOb8R7NOZk0q2lwAyz1i7oAr1xoXvrOgtYhZx8wY5KRV269JZ5yGpmzPTjQhvY9je6vEElPOuJP3mWKnP5M3V+YAAAB4nG2ReVPbMBDF/ULi2EkDBFqO3gdHLxUzDB9IkdexBllydRD49ihO3Ckz7B/a31utZnafkkGyiXnyclxhgB0MMUKKMTLkmGCKV5hhF3vYxxwHOMRrvMERjnGCU7zFO7zHB3zEJ3zGF3zFN5zhHBe4xHf8wE/8wm8w/MEVimTYKv44XR9MSCsUjVoeHE3vjQoNsSZ4mmxZmVWPjSz7jlou6/0qKOWEJdKMtCe793/hQfqxa6XWZHMXFl56RS4TvPXSaDeoy0zUUZB109KstDK8lHo5q6Qi1hcOnqkImubPS6aqRq7mlnaEWabub4iYblba3SRmgldS0+FWdhNtt04F14JUaqkl7tcpOpJtErvNt3Bd9HRT5JWxK25Ldjvp6br4hzfFiIdSmlzTg2fSUzNrLd1LE1ynxq4OVaVoKLjzJ60UPtj1RKzHzsbjly6inVnFBS2MucviPncU7Rr7lfTxRepDs1A2j3ZHRc7PuzFYSfE3ZOd4kjwBy227hA==) format("woff");font-weight:400;font-style:normal}.video-js .vjs-big-play-button .vjs-icon-placeholder:before,.video-js .vjs-play-control .vjs-icon-placeholder,.vjs-icon-play{font-family:VideoJS;font-weight:400;font-style:normal}.video-js .vjs-big-play-button .vjs-icon-placeholder:before,.video-js .vjs-play-control .vjs-icon-placeholder:before,.vjs-icon-play:before{content:"\\f101"}.vjs-icon-play-circle{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-play-circle:before{content:"\\f102"}.video-js .vjs-play-control.vjs-playing .vjs-icon-placeholder,.vjs-icon-pause{font-family:VideoJS;font-weight:400;font-style:normal}.video-js .vjs-play-control.vjs-playing .vjs-icon-placeholder:before,.vjs-icon-pause:before{content:"\\f103"}.video-js .vjs-mute-control.vjs-vol-0 .vjs-icon-placeholder,.vjs-icon-volume-mute{font-family:VideoJS;font-weight:400;font-style:normal}.video-js .vjs-mute-control.vjs-vol-0 .vjs-icon-placeholder:before,.vjs-icon-volume-mute:before{content:"\\f104"}.video-js .vjs-mute-control.vjs-vol-1 .vjs-icon-placeholder,.vjs-icon-volume-low{font-family:VideoJS;font-weight:400;font-style:normal}.video-js .vjs-mute-control.vjs-vol-1 .vjs-icon-placeholder:before,.vjs-icon-volume-low:before{content:"\\f105"}.video-js .vjs-mute-control.vjs-vol-2 .vjs-icon-placeholder,.vjs-icon-volume-mid{font-family:VideoJS;font-weight:400;font-style:normal}.video-js .vjs-mute-control.vjs-vol-2 .vjs-icon-placeholder:before,.vjs-icon-volume-mid:before{content:"\\f106"}.video-js .vjs-mute-control .vjs-icon-placeholder,.vjs-icon-volume-high{font-family:VideoJS;font-weight:400;font-style:normal}.video-js .vjs-mute-control .vjs-icon-placeholder:before,.vjs-icon-volume-high:before{content:"\\f107"}.video-js .vjs-fullscreen-control .vjs-icon-placeholder,.vjs-icon-fullscreen-enter{font-family:VideoJS;font-weight:400;font-style:normal}.video-js .vjs-fullscreen-control .vjs-icon-placeholder:before,.vjs-icon-fullscreen-enter:before{content:"\\f108"}.video-js.vjs-fullscreen .vjs-fullscreen-control .vjs-icon-placeholder,.vjs-icon-fullscreen-exit{font-family:VideoJS;font-weight:400;font-style:normal}.video-js.vjs-fullscreen .vjs-fullscreen-control .vjs-icon-placeholder:before,.vjs-icon-fullscreen-exit:before{content:"\\f109"}.vjs-icon-spinner{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-spinner:before{content:"\\f10a"}.video-js .vjs-subs-caps-button .vjs-icon-placeholder,.video-js .vjs-subtitles-button .vjs-icon-placeholder,.video-js.video-js:lang(en-AU) .vjs-subs-caps-button .vjs-icon-placeholder,.video-js.video-js:lang(en-GB) .vjs-subs-caps-button .vjs-icon-placeholder,.video-js.video-js:lang(en-IE) .vjs-subs-caps-button .vjs-icon-placeholder,.video-js.video-js:lang(en-NZ) .vjs-subs-caps-button .vjs-icon-placeholder,.vjs-icon-subtitles{font-family:VideoJS;font-weight:400;font-style:normal}.video-js .vjs-subs-caps-button .vjs-icon-placeholder:before,.video-js .vjs-subtitles-button .vjs-icon-placeholder:before,.video-js.video-js:lang(en-AU) .vjs-subs-caps-button .vjs-icon-placeholder:before,.video-js.video-js:lang(en-GB) .vjs-subs-caps-button .vjs-icon-placeholder:before,.video-js.video-js:lang(en-IE) .vjs-subs-caps-button .vjs-icon-placeholder:before,.video-js.video-js:lang(en-NZ) .vjs-subs-caps-button .vjs-icon-placeholder:before,.vjs-icon-subtitles:before{content:"\\f10b"}.video-js .vjs-captions-button .vjs-icon-placeholder,.video-js:lang(en) .vjs-subs-caps-button .vjs-icon-placeholder,.video-js:lang(fr-CA) .vjs-subs-caps-button .vjs-icon-placeholder,.vjs-icon-captions{font-family:VideoJS;font-weight:400;font-style:normal}.video-js .vjs-captions-button .vjs-icon-placeholder:before,.video-js:lang(en) .vjs-subs-caps-button .vjs-icon-placeholder:before,.video-js:lang(fr-CA) .vjs-subs-caps-button .vjs-icon-placeholder:before,.vjs-icon-captions:before{content:"\\f10c"}.vjs-icon-hd{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-hd:before{content:"\\f10d"}.video-js .vjs-chapters-button .vjs-icon-placeholder,.vjs-icon-chapters{font-family:VideoJS;font-weight:400;font-style:normal}.video-js .vjs-chapters-button .vjs-icon-placeholder:before,.vjs-icon-chapters:before{content:"\\f10e"}.vjs-icon-downloading{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-downloading:before{content:"\\f10f"}.vjs-icon-file-download{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-file-download:before{content:"\\f110"}.vjs-icon-file-download-done{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-file-download-done:before{content:"\\f111"}.vjs-icon-file-download-off{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-file-download-off:before{content:"\\f112"}.vjs-icon-share{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-share:before{content:"\\f113"}.vjs-icon-cog{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-cog:before{content:"\\f114"}.vjs-icon-square{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-square:before{content:"\\f115"}.video-js .vjs-play-progress,.video-js .vjs-volume-level,.vjs-icon-circle,.vjs-seek-to-live-control .vjs-icon-placeholder{font-family:VideoJS;font-weight:400;font-style:normal}.video-js .vjs-play-progress:before,.video-js .vjs-volume-level:before,.vjs-icon-circle:before,.vjs-seek-to-live-control .vjs-icon-placeholder:before{content:"\\f116"}.vjs-icon-circle-outline{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-circle-outline:before{content:"\\f117"}.vjs-icon-circle-inner-circle{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-circle-inner-circle:before{content:"\\f118"}.video-js .vjs-control.vjs-close-button .vjs-icon-placeholder,.vjs-icon-cancel{font-family:VideoJS;font-weight:400;font-style:normal}.video-js .vjs-control.vjs-close-button .vjs-icon-placeholder:before,.vjs-icon-cancel:before{content:"\\f119"}.vjs-icon-repeat{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-repeat:before{content:"\\f11a"}.video-js .vjs-play-control.vjs-ended .vjs-icon-placeholder,.vjs-icon-replay{font-family:VideoJS;font-weight:400;font-style:normal}.video-js .vjs-play-control.vjs-ended .vjs-icon-placeholder:before,.vjs-icon-replay:before{content:"\\f11b"}.video-js .vjs-skip-backward-5 .vjs-icon-placeholder,.vjs-icon-replay-5{font-family:VideoJS;font-weight:400;font-style:normal}.video-js .vjs-skip-backward-5 .vjs-icon-placeholder:before,.vjs-icon-replay-5:before{content:"\\f11c"}.video-js .vjs-skip-backward-10 .vjs-icon-placeholder,.vjs-icon-replay-10{font-family:VideoJS;font-weight:400;font-style:normal}.video-js .vjs-skip-backward-10 .vjs-icon-placeholder:before,.vjs-icon-replay-10:before{content:"\\f11d"}.video-js .vjs-skip-backward-30 .vjs-icon-placeholder,.vjs-icon-replay-30{font-family:VideoJS;font-weight:400;font-style:normal}.video-js .vjs-skip-backward-30 .vjs-icon-placeholder:before,.vjs-icon-replay-30:before{content:"\\f11e"}.video-js .vjs-skip-forward-5 .vjs-icon-placeholder,.vjs-icon-forward-5{font-family:VideoJS;font-weight:400;font-style:normal}.video-js .vjs-skip-forward-5 .vjs-icon-placeholder:before,.vjs-icon-forward-5:before{content:"\\f11f"}.video-js .vjs-skip-forward-10 .vjs-icon-placeholder,.vjs-icon-forward-10{font-family:VideoJS;font-weight:400;font-style:normal}.video-js .vjs-skip-forward-10 .vjs-icon-placeholder:before,.vjs-icon-forward-10:before{content:"\\f120"}.video-js .vjs-skip-forward-30 .vjs-icon-placeholder,.vjs-icon-forward-30{font-family:VideoJS;font-weight:400;font-style:normal}.video-js .vjs-skip-forward-30 .vjs-icon-placeholder:before,.vjs-icon-forward-30:before{content:"\\f121"}.video-js .vjs-audio-button .vjs-icon-placeholder,.vjs-icon-audio{font-family:VideoJS;font-weight:400;font-style:normal}.video-js .vjs-audio-button .vjs-icon-placeholder:before,.vjs-icon-audio:before{content:"\\f122"}.vjs-icon-next-item{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-next-item:before{content:"\\f123"}.vjs-icon-previous-item{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-previous-item:before{content:"\\f124"}.vjs-icon-shuffle{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-shuffle:before{content:"\\f125"}.vjs-icon-cast{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-cast:before{content:"\\f126"}.video-js .vjs-picture-in-picture-control .vjs-icon-placeholder,.vjs-icon-picture-in-picture-enter{font-family:VideoJS;font-weight:400;font-style:normal}.video-js .vjs-picture-in-picture-control .vjs-icon-placeholder:before,.vjs-icon-picture-in-picture-enter:before{content:"\\f127"}.video-js.vjs-picture-in-picture .vjs-picture-in-picture-control .vjs-icon-placeholder,.vjs-icon-picture-in-picture-exit{font-family:VideoJS;font-weight:400;font-style:normal}.video-js.vjs-picture-in-picture .vjs-picture-in-picture-control .vjs-icon-placeholder:before,.vjs-icon-picture-in-picture-exit:before{content:"\\f128"}.vjs-icon-facebook{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-facebook:before{content:"\\f129"}.vjs-icon-linkedin{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-linkedin:before{content:"\\f12a"}.vjs-icon-twitter{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-twitter:before{content:"\\f12b"}.vjs-icon-tumblr{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-tumblr:before{content:"\\f12c"}.vjs-icon-pinterest{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-pinterest:before{content:"\\f12d"}.video-js .vjs-descriptions-button .vjs-icon-placeholder,.vjs-icon-audio-description{font-family:VideoJS;font-weight:400;font-style:normal}.video-js .vjs-descriptions-button .vjs-icon-placeholder:before,.vjs-icon-audio-description:before{content:"\\f12e"}.video-js{display:inline-block;vertical-align:top;box-sizing:border-box;color:#fff;background-color:#000;position:relative;padding:0;font-size:10px;line-height:1;font-weight:400;font-style:normal;font-family:Arial,Helvetica,sans-serif;word-break:initial}.video-js:-moz-full-screen{position:absolute}.video-js:-webkit-full-screen{width:100%!important;height:100%!important}.video-js[tabindex="-1"]{outline:0}.video-js *,.video-js :after,.video-js :before{box-sizing:inherit}.video-js ul{font-family:inherit;font-size:inherit;line-height:inherit;list-style-position:outside;margin-left:0;margin-right:0;margin-top:0;margin-bottom:0}.video-js.vjs-1-1,.video-js.vjs-16-9,.video-js.vjs-4-3,.video-js.vjs-9-16,.video-js.vjs-fluid{width:100%;max-width:100%}.video-js.vjs-1-1:not(.vjs-audio-only-mode),.video-js.vjs-16-9:not(.vjs-audio-only-mode),.video-js.vjs-4-3:not(.vjs-audio-only-mode),.video-js.vjs-9-16:not(.vjs-audio-only-mode),.video-js.vjs-fluid:not(.vjs-audio-only-mode){height:0}.video-js.vjs-16-9:not(.vjs-audio-only-mode){padding-top:56.25%}.video-js.vjs-4-3:not(.vjs-audio-only-mode){padding-top:75%}.video-js.vjs-9-16:not(.vjs-audio-only-mode){padding-top:177.7777777778%}.video-js.vjs-1-1:not(.vjs-audio-only-mode){padding-top:100%}.video-js.vjs-fill:not(.vjs-audio-only-mode){width:100%;height:100%}.video-js .vjs-tech{position:absolute;top:0;left:0;width:100%;height:100%}.video-js.vjs-audio-only-mode .vjs-tech{display:none}body.vjs-full-window,body.vjs-pip-window{padding:0;margin:0;height:100%}.vjs-full-window .video-js.vjs-fullscreen,body.vjs-pip-window .video-js{position:fixed;overflow:hidden;z-index:1000;left:0;top:0;bottom:0;right:0}.video-js.vjs-fullscreen:not(.vjs-ios-native-fs),body.vjs-pip-window .video-js{width:100%!important;height:100%!important;padding-top:0!important;display:block}.video-js.vjs-fullscreen.vjs-user-inactive{cursor:none}.vjs-pip-container .vjs-pip-text{position:absolute;bottom:10%;font-size:2em;background-color:rgba(0,0,0,.7);padding:.5em;text-align:center;width:100%}.vjs-layout-small.vjs-pip-container .vjs-pip-text,.vjs-layout-tiny.vjs-pip-container .vjs-pip-text,.vjs-layout-x-small.vjs-pip-container .vjs-pip-text{bottom:0;font-size:1.4em}.vjs-hidden{display:none!important}.vjs-disabled{opacity:.5;cursor:default}.video-js .vjs-offscreen{height:1px;left:-9999px;position:absolute;top:0;width:1px}.vjs-lock-showing{display:block!important;opacity:1!important;visibility:visible!important}.vjs-no-js{padding:20px;color:#fff;background-color:#000;font-size:18px;font-family:Arial,Helvetica,sans-serif;text-align:center;width:300px;height:150px;margin:0 auto}.vjs-no-js a,.vjs-no-js a:visited{color:#66a8cc}.video-js .vjs-big-play-button{font-size:3em;line-height:1.5em;height:1.63332em;width:3em;display:block;position:absolute;top:50%;left:50%;padding:0;margin-top:-.81666em;margin-left:-1.5em;cursor:pointer;opacity:1;border:.06666em solid #fff;background-color:#2b333f;background-color:rgba(43,51,63,.7);border-radius:.3em;transition:all .4s}.vjs-big-play-button .vjs-svg-icon{width:1em;height:1em;position:absolute;top:50%;left:50%;line-height:1;transform:translate(-50%,-50%)}.video-js .vjs-big-play-button:focus,.video-js:hover .vjs-big-play-button{border-color:#fff;background-color:#73859f;background-color:rgba(115,133,159,.5);transition:all 0s}.vjs-controls-disabled .vjs-big-play-button,.vjs-error .vjs-big-play-button,.vjs-has-started .vjs-big-play-button,.vjs-using-native-controls .vjs-big-play-button{display:none}.vjs-has-started.vjs-paused.vjs-show-big-play-button-on-pause:not(.vjs-seeking,.vjs-scrubbing,.vjs-error) .vjs-big-play-button{display:block}.video-js button{background:0 0;border:none;color:inherit;display:inline-block;font-size:inherit;line-height:inherit;text-transform:none;text-decoration:none;transition:none;-webkit-appearance:none;-moz-appearance:none;appearance:none}.video-js.vjs-spatial-navigation-enabled .vjs-button:focus{outline:.0625em solid #fff;box-shadow:none}.vjs-control .vjs-button{width:100%;height:100%}.video-js .vjs-control.vjs-close-button{cursor:pointer;height:3em;position:absolute;right:0;top:.5em;z-index:2}.video-js .vjs-modal-dialog{background:rgba(0,0,0,.8);background:linear-gradient(180deg,rgba(0,0,0,.8),rgba(255,255,255,0));overflow:auto}.video-js .vjs-modal-dialog>*{box-sizing:border-box}.vjs-modal-dialog .vjs-modal-dialog-content{font-size:1.2em;line-height:1.5;padding:20px 24px;z-index:1}.vjs-menu-button{cursor:pointer}.vjs-menu-button.vjs-disabled{cursor:default}.vjs-workinghover .vjs-menu-button.vjs-disabled:hover .vjs-menu{display:none}.vjs-menu .vjs-menu-content{display:block;padding:0;margin:0;font-family:Arial,Helvetica,sans-serif;overflow:auto}.vjs-menu .vjs-menu-content>*{box-sizing:border-box}.vjs-scrubbing .vjs-control.vjs-menu-button:hover .vjs-menu{display:none}.vjs-menu li{display:flex;justify-content:center;list-style:none;margin:0;padding:.2em 0;line-height:1.4em;font-size:1.2em;text-align:center;text-transform:lowercase}.js-focus-visible .vjs-menu li.vjs-menu-item:hover,.vjs-menu li.vjs-menu-item:focus,.vjs-menu li.vjs-menu-item:hover{background-color:#73859f;background-color:rgba(115,133,159,.5)}.js-focus-visible .vjs-menu li.vjs-selected:hover,.vjs-menu li.vjs-selected,.vjs-menu li.vjs-selected:focus,.vjs-menu li.vjs-selected:hover{background-color:#fff;color:#2b333f}.js-focus-visible .vjs-menu li.vjs-selected:hover .vjs-svg-icon,.vjs-menu li.vjs-selected .vjs-svg-icon,.vjs-menu li.vjs-selected:focus .vjs-svg-icon,.vjs-menu li.vjs-selected:hover .vjs-svg-icon{fill:#000}.js-focus-visible .vjs-menu :not(.vjs-selected):focus:not(.focus-visible),.video-js .vjs-menu :not(.vjs-selected):focus:not(:focus-visible){background:0 0}.vjs-menu li.vjs-menu-title{text-align:center;text-transform:uppercase;font-size:1em;line-height:2em;padding:0;margin:0 0 .3em 0;font-weight:700;cursor:default}.vjs-menu-button-popup .vjs-menu{display:none;position:absolute;bottom:0;width:10em;left:-3em;height:0;margin-bottom:1.5em;border-top-color:rgba(43,51,63,.7)}.vjs-pip-window .vjs-menu-button-popup .vjs-menu{left:unset;right:1em}.vjs-menu-button-popup .vjs-menu .vjs-menu-content{background-color:#2b333f;background-color:rgba(43,51,63,.7);position:absolute;width:100%;bottom:1.5em;max-height:15em}.vjs-layout-tiny .vjs-menu-button-popup .vjs-menu .vjs-menu-content,.vjs-layout-x-small .vjs-menu-button-popup .vjs-menu .vjs-menu-content{max-height:5em}.vjs-layout-small .vjs-menu-button-popup .vjs-menu .vjs-menu-content{max-height:10em}.vjs-layout-medium .vjs-menu-button-popup .vjs-menu .vjs-menu-content{max-height:14em}.vjs-layout-huge .vjs-menu-button-popup .vjs-menu .vjs-menu-content,.vjs-layout-large .vjs-menu-button-popup .vjs-menu .vjs-menu-content,.vjs-layout-x-large .vjs-menu-button-popup .vjs-menu .vjs-menu-content{max-height:25em}.vjs-menu-button-popup .vjs-menu.vjs-lock-showing,.vjs-workinghover .vjs-menu-button-popup.vjs-hover .vjs-menu{display:block}.video-js .vjs-menu-button-inline{transition:all .4s;overflow:hidden}.video-js .vjs-menu-button-inline:before{width:2.222222222em}.video-js .vjs-menu-button-inline.vjs-slider-active,.video-js .vjs-menu-button-inline:focus,.video-js .vjs-menu-button-inline:hover{width:12em}.vjs-menu-button-inline .vjs-menu{opacity:0;height:100%;width:auto;position:absolute;left:4em;top:0;padding:0;margin:0;transition:all .4s}.vjs-menu-button-inline.vjs-slider-active .vjs-menu,.vjs-menu-button-inline:focus .vjs-menu,.vjs-menu-button-inline:hover .vjs-menu{display:block;opacity:1}.vjs-menu-button-inline .vjs-menu-content{width:auto;height:100%;margin:0;overflow:hidden}.video-js .vjs-control-bar{display:none;width:100%;position:absolute;bottom:0;left:0;right:0;height:3em;background-color:#2b333f;background-color:rgba(43,51,63,.7)}.video-js.vjs-spatial-navigation-enabled .vjs-control-bar{gap:1px}.video-js:not(.vjs-controls-disabled,.vjs-using-native-controls,.vjs-error) .vjs-control-bar.vjs-lock-showing{display:flex!important}.vjs-audio-only-mode .vjs-control-bar,.vjs-has-started .vjs-control-bar{display:flex;visibility:visible;opacity:1;transition:visibility .1s,opacity .1s}.vjs-has-started.vjs-user-inactive.vjs-playing .vjs-control-bar{visibility:visible;opacity:0;pointer-events:none;transition:visibility 1s,opacity 1s}.vjs-controls-disabled .vjs-control-bar,.vjs-error .vjs-control-bar,.vjs-using-native-controls .vjs-control-bar{display:none!important}.vjs-audio-only-mode.vjs-has-started.vjs-user-inactive.vjs-playing .vjs-control-bar,.vjs-audio.vjs-has-started.vjs-user-inactive.vjs-playing .vjs-control-bar{opacity:1;visibility:visible;pointer-events:auto}.video-js .vjs-control{position:relative;text-align:center;margin:0;padding:0;height:100%;width:4em;flex:none}.video-js .vjs-control.vjs-visible-text{width:auto;padding-left:1em;padding-right:1em}.vjs-button>.vjs-icon-placeholder:before{font-size:1.8em;line-height:1.67}.vjs-button>.vjs-icon-placeholder{display:block}.vjs-button>.vjs-svg-icon{display:inline-block}.video-js .vjs-control:focus,.video-js .vjs-control:focus:before,.video-js .vjs-control:hover:before{text-shadow:0 0 1em #fff}.video-js :not(.vjs-visible-text)>.vjs-control-text{border:0;clip:rect(0 0 0 0);height:1px;overflow:hidden;padding:0;position:absolute;width:1px}.video-js .vjs-custom-control-spacer{display:none}.video-js .vjs-progress-control{cursor:pointer;flex:auto;display:flex;align-items:center;min-width:4em;touch-action:none}.video-js .vjs-progress-control.disabled{cursor:default}.vjs-live .vjs-progress-control{display:none}.vjs-liveui .vjs-progress-control{display:flex;align-items:center}.video-js .vjs-progress-holder{flex:auto;transition:all .2s;height:.3em}.video-js .vjs-progress-control .vjs-progress-holder{margin:0 10px}.video-js .vjs-progress-control:hover .vjs-progress-holder{font-size:1.6666666667em}.video-js .vjs-progress-control:hover .vjs-progress-holder.disabled{font-size:1em}.video-js .vjs-progress-holder .vjs-load-progress,.video-js .vjs-progress-holder .vjs-load-progress div,.video-js .vjs-progress-holder .vjs-play-progress{position:absolute;display:block;height:100%;margin:0;padding:0;width:0}.video-js .vjs-play-progress{background-color:#fff}.video-js .vjs-play-progress:before{font-size:.9em;position:absolute;right:-.5em;line-height:.35em;z-index:1}.vjs-svg-icons-enabled .vjs-play-progress:before{content:none!important}.vjs-play-progress .vjs-svg-icon{position:absolute;top:-.35em;right:-.4em;width:.9em;height:.9em;pointer-events:none;line-height:.15em;z-index:1}.video-js .vjs-load-progress{background:rgba(115,133,159,.5)}.video-js .vjs-load-progress div{background:rgba(115,133,159,.75)}.video-js .vjs-time-tooltip{background-color:#fff;background-color:rgba(255,255,255,.8);border-radius:.3em;color:#000;float:right;font-family:Arial,Helvetica,sans-serif;font-size:1em;padding:6px 8px 8px 8px;pointer-events:none;position:absolute;top:-3.4em;visibility:hidden;z-index:1}.video-js .vjs-progress-holder:focus .vjs-time-tooltip{display:none}.video-js .vjs-progress-control:hover .vjs-progress-holder:focus .vjs-time-tooltip,.video-js .vjs-progress-control:hover .vjs-time-tooltip{display:block;font-size:.6em;visibility:visible}.video-js .vjs-progress-control.disabled:hover .vjs-time-tooltip{font-size:1em}.video-js .vjs-progress-control .vjs-mouse-display{display:none;position:absolute;width:1px;height:100%;background-color:#000;z-index:1}.video-js .vjs-progress-control:hover .vjs-mouse-display{display:block}.video-js.vjs-user-inactive .vjs-progress-control .vjs-mouse-display{visibility:hidden;opacity:0;transition:visibility 1s,opacity 1s}.vjs-mouse-display .vjs-time-tooltip{color:#fff;background-color:#000;background-color:rgba(0,0,0,.8)}.video-js .vjs-slider{position:relative;cursor:pointer;padding:0;margin:0 .45em 0 .45em;-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;user-select:none;background-color:#73859f;background-color:rgba(115,133,159,.5)}.video-js .vjs-slider.disabled{cursor:default}.video-js .vjs-slider:focus{text-shadow:0 0 1em #fff;box-shadow:0 0 1em #fff}.video-js.vjs-spatial-navigation-enabled .vjs-slider:focus{outline:.0625em solid #fff}.video-js .vjs-mute-control{cursor:pointer;flex:none}.video-js .vjs-volume-control{cursor:pointer;margin-right:1em;display:flex}.video-js .vjs-volume-control.vjs-volume-horizontal{width:5em}.video-js .vjs-volume-panel .vjs-volume-control{visibility:visible;opacity:0;width:1px;height:1px;margin-left:-1px}.video-js .vjs-volume-panel{transition:width 1s}.video-js .vjs-volume-panel .vjs-volume-control.vjs-slider-active,.video-js .vjs-volume-panel .vjs-volume-control:active,.video-js .vjs-volume-panel.vjs-hover .vjs-mute-control~.vjs-volume-control,.video-js .vjs-volume-panel.vjs-hover .vjs-volume-control,.video-js .vjs-volume-panel:active .vjs-volume-control,.video-js .vjs-volume-panel:focus .vjs-volume-control{visibility:visible;opacity:1;position:relative;transition:visibility .1s,opacity .1s,height .1s,width .1s,left 0s,top 0s}.video-js .vjs-volume-panel .vjs-volume-control.vjs-slider-active.vjs-volume-horizontal,.video-js .vjs-volume-panel .vjs-volume-control:active.vjs-volume-horizontal,.video-js .vjs-volume-panel.vjs-hover .vjs-mute-control~.vjs-volume-control.vjs-volume-horizontal,.video-js .vjs-volume-panel.vjs-hover .vjs-volume-control.vjs-volume-horizontal,.video-js .vjs-volume-panel:active .vjs-volume-control.vjs-volume-horizontal,.video-js .vjs-volume-panel:focus .vjs-volume-control.vjs-volume-horizontal{width:5em;height:3em;margin-right:0}.video-js .vjs-volume-panel .vjs-volume-control.vjs-slider-active.vjs-volume-vertical,.video-js .vjs-volume-panel .vjs-volume-control:active.vjs-volume-vertical,.video-js .vjs-volume-panel.vjs-hover .vjs-mute-control~.vjs-volume-control.vjs-volume-vertical,.video-js .vjs-volume-panel.vjs-hover .vjs-volume-control.vjs-volume-vertical,.video-js .vjs-volume-panel:active .vjs-volume-control.vjs-volume-vertical,.video-js .vjs-volume-panel:focus .vjs-volume-control.vjs-volume-vertical{left:-3.5em;transition:left 0s}.video-js .vjs-volume-panel.vjs-volume-panel-horizontal.vjs-hover,.video-js .vjs-volume-panel.vjs-volume-panel-horizontal.vjs-slider-active,.video-js .vjs-volume-panel.vjs-volume-panel-horizontal:active{width:10em;transition:width .1s}.video-js .vjs-volume-panel.vjs-volume-panel-horizontal.vjs-mute-toggle-only{width:4em}.video-js .vjs-volume-panel .vjs-volume-control.vjs-volume-vertical{height:8em;width:3em;left:-3000em;transition:visibility 1s,opacity 1s,height 1s 1s,width 1s 1s,left 1s 1s,top 1s 1s}.video-js .vjs-volume-panel .vjs-volume-control.vjs-volume-horizontal{transition:visibility 1s,opacity 1s,height 1s 1s,width 1s,left 1s 1s,top 1s 1s}.video-js .vjs-volume-panel{display:flex}.video-js .vjs-volume-bar{margin:1.35em .45em}.vjs-volume-bar.vjs-slider-horizontal{width:5em;height:.3em}.vjs-volume-bar.vjs-slider-vertical{width:.3em;height:5em;margin:1.35em auto}.video-js .vjs-volume-level{position:absolute;bottom:0;left:0;background-color:#fff}.video-js .vjs-volume-level:before{position:absolute;font-size:.9em;z-index:1}.vjs-slider-vertical .vjs-volume-level{width:.3em}.vjs-slider-vertical .vjs-volume-level:before{top:-.5em;left:-.3em;z-index:1}.vjs-svg-icons-enabled .vjs-volume-level:before{content:none}.vjs-volume-level .vjs-svg-icon{position:absolute;width:.9em;height:.9em;pointer-events:none;z-index:1}.vjs-slider-horizontal .vjs-volume-level{height:.3em}.vjs-slider-horizontal .vjs-volume-level:before{line-height:.35em;right:-.5em}.vjs-slider-horizontal .vjs-volume-level .vjs-svg-icon{right:-.3em;transform:translateY(-50%)}.vjs-slider-vertical .vjs-volume-level .vjs-svg-icon{top:-.55em;transform:translateX(-50%)}.video-js .vjs-volume-panel.vjs-volume-panel-vertical{width:4em}.vjs-volume-bar.vjs-slider-vertical .vjs-volume-level{height:100%}.vjs-volume-bar.vjs-slider-horizontal .vjs-volume-level{width:100%}.video-js .vjs-volume-vertical{width:3em;height:8em;bottom:8em;background-color:#2b333f;background-color:rgba(43,51,63,.7)}.video-js .vjs-volume-horizontal .vjs-menu{left:-2em}.video-js .vjs-volume-tooltip{background-color:#fff;background-color:rgba(255,255,255,.8);border-radius:.3em;color:#000;float:right;font-family:Arial,Helvetica,sans-serif;font-size:1em;padding:6px 8px 8px 8px;pointer-events:none;position:absolute;top:-3.4em;visibility:hidden;z-index:1}.video-js .vjs-volume-control:hover .vjs-progress-holder:focus .vjs-volume-tooltip,.video-js .vjs-volume-control:hover .vjs-volume-tooltip{display:block;font-size:1em;visibility:visible}.video-js .vjs-volume-vertical:hover .vjs-progress-holder:focus .vjs-volume-tooltip,.video-js .vjs-volume-vertical:hover .vjs-volume-tooltip{left:1em;top:-12px}.video-js .vjs-volume-control.disabled:hover .vjs-volume-tooltip{font-size:1em}.video-js .vjs-volume-control .vjs-mouse-display{display:none;position:absolute;width:100%;height:1px;background-color:#000;z-index:1}.video-js .vjs-volume-horizontal .vjs-mouse-display{width:1px;height:100%}.video-js .vjs-volume-control:hover .vjs-mouse-display{display:block}.video-js.vjs-user-inactive .vjs-volume-control .vjs-mouse-display{visibility:hidden;opacity:0;transition:visibility 1s,opacity 1s}.vjs-mouse-display .vjs-volume-tooltip{color:#fff;background-color:#000;background-color:rgba(0,0,0,.8)}.vjs-poster{display:inline-block;vertical-align:middle;cursor:pointer;margin:0;padding:0;position:absolute;top:0;right:0;bottom:0;left:0;height:100%}.vjs-has-started .vjs-poster,.vjs-using-native-controls .vjs-poster{display:none}.vjs-audio.vjs-has-started .vjs-poster,.vjs-has-started.vjs-audio-poster-mode .vjs-poster,.vjs-pip-container.vjs-has-started .vjs-poster{display:block}.vjs-poster img{width:100%;height:100%;object-fit:contain}.video-js .vjs-live-control{display:flex;align-items:flex-start;flex:auto;font-size:1em;line-height:3em}.video-js.vjs-liveui .vjs-live-control,.video-js:not(.vjs-live) .vjs-live-control{display:none}.video-js .vjs-seek-to-live-control{align-items:center;cursor:pointer;flex:none;display:inline-flex;height:100%;padding-left:.5em;padding-right:.5em;font-size:1em;line-height:3em;width:auto;min-width:4em}.video-js.vjs-live:not(.vjs-liveui) .vjs-seek-to-live-control,.video-js:not(.vjs-live) .vjs-seek-to-live-control{display:none}.vjs-seek-to-live-control.vjs-control.vjs-at-live-edge{cursor:auto}.vjs-seek-to-live-control .vjs-icon-placeholder{margin-right:.5em;color:#888}.vjs-svg-icons-enabled .vjs-seek-to-live-control{line-height:0}.vjs-seek-to-live-control .vjs-svg-icon{width:1em;height:1em;pointer-events:none;fill:#888}.vjs-seek-to-live-control.vjs-control.vjs-at-live-edge .vjs-icon-placeholder{color:red}.vjs-seek-to-live-control.vjs-control.vjs-at-live-edge .vjs-svg-icon{fill:red}.video-js .vjs-time-control{flex:none;font-size:1em;line-height:3em;min-width:2em;width:auto;padding-left:1em;padding-right:1em}.video-js .vjs-current-time,.video-js .vjs-duration,.vjs-live .vjs-time-control,.vjs-live .vjs-time-divider{display:none}.vjs-time-divider{display:none;line-height:3em}.video-js .vjs-play-control{cursor:pointer}.video-js .vjs-play-control .vjs-icon-placeholder{flex:none}.vjs-text-track-display{position:absolute;bottom:3em;left:0;right:0;top:0;pointer-events:none}.vjs-error .vjs-text-track-display{display:none}.video-js.vjs-controls-disabled .vjs-text-track-display,.video-js.vjs-user-inactive.vjs-playing .vjs-text-track-display{bottom:1em}.video-js .vjs-text-track{font-size:1.4em;text-align:center;margin-bottom:.1em}.vjs-subtitles{color:#fff}.vjs-captions{color:#fc6}.vjs-tt-cue{display:block}video::-webkit-media-text-track-display{transform:translateY(-3em)}.video-js.vjs-controls-disabled video::-webkit-media-text-track-display,.video-js.vjs-user-inactive.vjs-playing video::-webkit-media-text-track-display{transform:translateY(-1.5em)}.video-js.vjs-force-center-align-cues .vjs-text-track-cue{text-align:center!important;width:80%!important}.video-js .vjs-picture-in-picture-control{cursor:pointer;flex:none}.video-js.vjs-audio-only-mode .vjs-picture-in-picture-control,.vjs-pip-window .vjs-picture-in-picture-control{display:none}.video-js .vjs-fullscreen-control{cursor:pointer;flex:none}.video-js.vjs-audio-only-mode .vjs-fullscreen-control,.vjs-pip-window .vjs-fullscreen-control{display:none}.vjs-playback-rate .vjs-playback-rate-value,.vjs-playback-rate>.vjs-menu-button{position:absolute;top:0;left:0;width:100%;height:100%}.vjs-playback-rate .vjs-playback-rate-value{pointer-events:none;font-size:1.5em;line-height:2;text-align:center}.vjs-playback-rate .vjs-menu{width:4em;left:0}.vjs-error .vjs-error-display .vjs-modal-dialog-content{font-size:1.4em;text-align:center}.vjs-loading-spinner{display:none;position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);opacity:.85;text-align:left;border:.6em solid rgba(43,51,63,.7);box-sizing:border-box;background-clip:padding-box;width:5em;height:5em;border-radius:50%;visibility:hidden}.vjs-seeking .vjs-loading-spinner,.vjs-waiting .vjs-loading-spinner{display:flex;justify-content:center;align-items:center;animation:vjs-spinner-show 0s linear .3s forwards}.vjs-error .vjs-loading-spinner{display:none}.vjs-loading-spinner:after,.vjs-loading-spinner:before{content:"";position:absolute;box-sizing:inherit;width:inherit;height:inherit;border-radius:inherit;opacity:1;border:inherit;border-color:transparent;border-top-color:#fff}.vjs-seeking .vjs-loading-spinner:after,.vjs-seeking .vjs-loading-spinner:before,.vjs-waiting .vjs-loading-spinner:after,.vjs-waiting .vjs-loading-spinner:before{animation:vjs-spinner-spin 1.1s cubic-bezier(.6,.2,0,.8) infinite,vjs-spinner-fade 1.1s linear infinite}.vjs-seeking .vjs-loading-spinner:before,.vjs-waiting .vjs-loading-spinner:before{border-top-color:#fff}.vjs-seeking .vjs-loading-spinner:after,.vjs-waiting .vjs-loading-spinner:after{border-top-color:#fff;animation-delay:.44s}@keyframes vjs-spinner-show{to{visibility:visible}}@keyframes vjs-spinner-spin{100%{transform:rotate(360deg)}}@keyframes vjs-spinner-fade{0%{border-top-color:#73859f}20%{border-top-color:#73859f}35%{border-top-color:#fff}60%{border-top-color:#73859f}100%{border-top-color:#73859f}}.video-js.vjs-audio-only-mode .vjs-captions-button{display:none}.vjs-chapters-button .vjs-menu ul{width:24em}.video-js.vjs-audio-only-mode .vjs-descriptions-button{display:none}.vjs-subs-caps-button+.vjs-menu .vjs-captions-menu-item .vjs-svg-icon{width:1.5em;height:1.5em}.video-js .vjs-subs-caps-button+.vjs-menu .vjs-captions-menu-item .vjs-menu-item-text .vjs-icon-placeholder{vertical-align:middle;display:inline-block;margin-bottom:-.1em}.video-js .vjs-subs-caps-button+.vjs-menu .vjs-captions-menu-item .vjs-menu-item-text .vjs-icon-placeholder:before{font-family:VideoJS;content:"\\f10c";font-size:1.5em;line-height:inherit}.video-js.vjs-audio-only-mode .vjs-subs-caps-button{display:none}.video-js .vjs-audio-button+.vjs-menu .vjs-descriptions-menu-item .vjs-menu-item-text .vjs-icon-placeholder,.video-js .vjs-audio-button+.vjs-menu .vjs-main-desc-menu-item .vjs-menu-item-text .vjs-icon-placeholder{vertical-align:middle;display:inline-block;margin-bottom:-.1em}.video-js .vjs-audio-button+.vjs-menu .vjs-descriptions-menu-item .vjs-menu-item-text .vjs-icon-placeholder:before,.video-js .vjs-audio-button+.vjs-menu .vjs-main-desc-menu-item .vjs-menu-item-text .vjs-icon-placeholder:before{font-family:VideoJS;content:" \\f12e";font-size:1.5em;line-height:inherit}.video-js.vjs-layout-small .vjs-current-time,.video-js.vjs-layout-small .vjs-duration,.video-js.vjs-layout-small .vjs-playback-rate,.video-js.vjs-layout-small .vjs-remaining-time,.video-js.vjs-layout-small .vjs-time-divider,.video-js.vjs-layout-small .vjs-volume-control,.video-js.vjs-layout-tiny .vjs-current-time,.video-js.vjs-layout-tiny .vjs-duration,.video-js.vjs-layout-tiny .vjs-playback-rate,.video-js.vjs-layout-tiny .vjs-remaining-time,.video-js.vjs-layout-tiny .vjs-time-divider,.video-js.vjs-layout-tiny .vjs-volume-control,.video-js.vjs-layout-x-small .vjs-current-time,.video-js.vjs-layout-x-small .vjs-duration,.video-js.vjs-layout-x-small .vjs-playback-rate,.video-js.vjs-layout-x-small .vjs-remaining-time,.video-js.vjs-layout-x-small .vjs-time-divider,.video-js.vjs-layout-x-small .vjs-volume-control{display:none}.video-js.vjs-layout-small .vjs-volume-panel.vjs-volume-panel-horizontal.vjs-hover,.video-js.vjs-layout-small .vjs-volume-panel.vjs-volume-panel-horizontal.vjs-slider-active,.video-js.vjs-layout-small .vjs-volume-panel.vjs-volume-panel-horizontal:active,.video-js.vjs-layout-small .vjs-volume-panel.vjs-volume-panel-horizontal:hover,.video-js.vjs-layout-tiny .vjs-volume-panel.vjs-volume-panel-horizontal.vjs-hover,.video-js.vjs-layout-tiny .vjs-volume-panel.vjs-volume-panel-horizontal.vjs-slider-active,.video-js.vjs-layout-tiny .vjs-volume-panel.vjs-volume-panel-horizontal:active,.video-js.vjs-layout-tiny .vjs-volume-panel.vjs-volume-panel-horizontal:hover,.video-js.vjs-layout-x-small .vjs-volume-panel.vjs-volume-panel-horizontal.vjs-hover,.video-js.vjs-layout-x-small .vjs-volume-panel.vjs-volume-panel-horizontal.vjs-slider-active,.video-js.vjs-layout-x-small .vjs-volume-panel.vjs-volume-panel-horizontal:active,.video-js.vjs-layout-x-small .vjs-volume-panel.vjs-volume-panel-horizontal:hover{width:auto;width:initial}.video-js.vjs-layout-tiny .vjs-progress-control,.video-js.vjs-layout-x-small .vjs-progress-control{display:none}.video-js.vjs-layout-x-small .vjs-custom-control-spacer{flex:auto;display:block}.vjs-modal-dialog.vjs-text-track-settings{background-color:#2b333f;background-color:rgba(43,51,63,.75);color:#fff;height:70%}.vjs-spatial-navigation-enabled .vjs-modal-dialog.vjs-text-track-settings{height:80%}.vjs-error .vjs-text-track-settings{display:none}.vjs-text-track-settings .vjs-modal-dialog-content{display:table}.vjs-text-track-settings .vjs-track-settings-colors,.vjs-text-track-settings .vjs-track-settings-controls,.vjs-text-track-settings .vjs-track-settings-font{display:table-cell}.vjs-text-track-settings .vjs-track-settings-controls{text-align:right;vertical-align:bottom}@supports (display:grid){.vjs-text-track-settings .vjs-modal-dialog-content{display:grid;grid-template-columns:1fr 1fr;grid-template-rows:1fr;padding:20px 24px 0 24px}.vjs-track-settings-controls .vjs-default-button{margin-bottom:20px}.vjs-text-track-settings .vjs-track-settings-controls{grid-column:1/-1}.vjs-layout-small .vjs-text-track-settings .vjs-modal-dialog-content,.vjs-layout-tiny .vjs-text-track-settings .vjs-modal-dialog-content,.vjs-layout-x-small .vjs-text-track-settings .vjs-modal-dialog-content{grid-template-columns:1fr}}.vjs-text-track-settings select{font-size:inherit}.vjs-track-setting>select{margin-right:1em;margin-bottom:.5em}.vjs-text-track-settings fieldset{margin:10px;border:none}.vjs-text-track-settings fieldset span{display:inline-block;padding:0 .6em .8em}.vjs-text-track-settings fieldset span>select{max-width:7.3em}.vjs-text-track-settings legend{color:#fff;font-weight:700;font-size:1.2em}.vjs-text-track-settings .vjs-label{margin:0 .5em .5em 0}.vjs-track-settings-controls button:active,.vjs-track-settings-controls button:focus{outline-style:solid;outline-width:medium;background-image:linear-gradient(0deg,#fff 88%,#73859f 100%)}.vjs-track-settings-controls button:hover{color:rgba(43,51,63,.75)}.vjs-track-settings-controls button{background-color:#fff;background-image:linear-gradient(-180deg,#fff 88%,#73859f 100%);color:#2b333f;cursor:pointer;border-radius:2px}.vjs-track-settings-controls .vjs-default-button{margin-right:1em}.vjs-title-bar{background:rgba(0,0,0,.9);background:linear-gradient(180deg,rgba(0,0,0,.9) 0,rgba(0,0,0,.7) 60%,rgba(0,0,0,0) 100%);font-size:1.2em;line-height:1.5;transition:opacity .1s;padding:.666em 1.333em 4em;pointer-events:none;position:absolute;top:0;width:100%}.vjs-error .vjs-title-bar{display:none}.vjs-title-bar-description,.vjs-title-bar-title{margin:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.vjs-title-bar-title{font-weight:700;margin-bottom:.333em}.vjs-playing.vjs-user-inactive .vjs-title-bar{opacity:0;transition:opacity 1s}.video-js .vjs-skip-forward-5{cursor:pointer}.video-js .vjs-skip-forward-10{cursor:pointer}.video-js .vjs-skip-forward-30{cursor:pointer}.video-js .vjs-skip-backward-5{cursor:pointer}.video-js .vjs-skip-backward-10{cursor:pointer}.video-js .vjs-skip-backward-30{cursor:pointer}.video-js .vjs-transient-button{position:absolute;height:3em;display:flex;align-items:center;justify-content:center;background-color:rgba(50,50,50,.5);cursor:pointer;opacity:1;transition:opacity 1s}.video-js:not(.vjs-has-started) .vjs-transient-button{display:none}.video-js.not-hover .vjs-transient-button:not(.force-display),.video-js.vjs-user-inactive .vjs-transient-button:not(.force-display){opacity:0}.video-js .vjs-transient-button span{padding:0 .5em}.video-js .vjs-transient-button.vjs-left{left:1em}.video-js .vjs-transient-button.vjs-right{right:1em}.video-js .vjs-transient-button.vjs-top{top:1em}.video-js .vjs-transient-button.vjs-near-top{top:4em}.video-js .vjs-transient-button.vjs-bottom{bottom:4em}.video-js .vjs-transient-button:hover{background-color:rgba(50,50,50,.9)}@media print{.video-js>:not(.vjs-tech):not(.vjs-poster){visibility:hidden}}.vjs-resize-manager{position:absolute;top:0;left:0;width:100%;height:100%;border:none;z-index:-1000}.js-focus-visible .video-js :focus:not(.focus-visible){outline:0}.video-js :focus:not(:focus-visible){outline:0}*{box-sizing:border-box}content-video{display:block;width:100%;position:relative}content-video.content-video--fit-container .video-js.vjs-fluid{height:100%;padding:0}content-video[fit-container=true]{height:100%}content-video .content-video__content{display:block;width:100%;height:100%}content-video .content-video__poster{position:relative}content-video .content-video__play{display:none}content-video .vjs-content-block-theme.video-js{width:100%;height:100%}content-video .vjs-content-block-theme.video-js video.vjs-tech{position:static}content-video .vjs-content-block-theme.vjs-ended .vjs-loading-spinner,content-video .vjs-content-block-theme.vjs-waiting .vjs-loading-spinner{display:none}content-video .vjs-content-block-theme:hover .vjs-big-play-button,content-video .vjs-content-block-theme:focus .vjs-big-play-button{background-color:transparent}content-video .vjs-content-block-theme .vjs-big-play-button{position:absolute;left:50%;top:50%;transform:translate(-50%, -50%);border:none;background:transparent}content-video .vjs-content-block-theme .vjs-big-play-button .vjs-icon-placeholder{display:block;width:100%;height:100%}content-video .vjs-content-block-theme .vjs-big-play-button .vjs-icon-placeholder:before{display:none}content-video .vjs-poster{display:none}';const Db=Ib;const Cb=class{constructor(e){t(this,e);this.method="youtube";this.autoplay=false;this.src="";this.width=16;this.height=9;this.type="video/mp4";this.playButtonAriaLabel="Play";this.classes=undefined;this.classString=undefined;this.controls=true;this.preload="metadata";this.fitContainer="false";this.isLoaded=false;this.hasPoster=false;this.isPlayed=false}computedVideoConfig(){let t={};t={fill:o(this.fitContainer)==="true",fluid:o(this.fitContainer)==="false",autoplay:this.autoplay===true?"muted":false,techOrder:["youtube"],src:this.src,sources:[{type:"video/youtube",src:this.src}],youtube:{showinfo:0,rel:0,modestbranding:1}};return t}initVideo(){this.isLoaded=true}componentWillLoad(){r.registerProp(this.classes).subscribe((t=>this.classString=t))}componentDidLoad(){let t={root:null,rootMargin:"0px",threshold:.1};let e=new IntersectionObserver((t=>{t.forEach((async t=>{if(t.isIntersecting){this.player=cd(this.videoElement,this.computedVideoConfig())}}))}),t);e.observe(this.hostElement)}onClickHandler(t){t.preventDefault();if(!this.isLoaded){return false}this.initVideo();this.isPlayed=true;this.player.play();if(this.method==="html5"){this.videoElement.play()}}render(){let t=!this.autoplay&&(this.hasPoster&&!this.isPlayed||!this.isPlayed);return e(i,{key:"4eb01a365b5cdada1754ef431c6b4d4d779d729a",class:this.classString},this.hasPoster&&!this.isLoaded&&e("div",{key:"13ece2dd90e34b04fc678bc0ac6b385016ac04d6",class:"content-video__poster"},e("slot",{key:"47896b0f5bf7b0f3ab33131e726cb20567c121e3",name:"poster"})),t&&e("button",{key:"ca90cce7e4ea02d2201cbaecf610fb87c11f86e1",class:"content-video__play","aria-label":this.playButtonAriaLabel,onClick:t=>this.onClickHandler(t)},e("slot",{key:"162cf783704d2bedcb03bb91612e7d86c6f0734b",name:"playButton"})),e("div",{key:"636a0de9100a7eafb18800bf1134fef64343053b",class:"content-video__content"},(!this.hasPoster||this.isLoaded)&&e("video",{key:"4a3abea2af63a8e93bfc1eebca323a05a3fbcbd3",ref:t=>this.videoElement=t,class:"video-js vjs-content-block-theme",controls:this.controls,preload:this.preload,width:this.width,height:this.height,crossorigin:"anonymous","data-setup":JSON.stringify(this.computedVideoConfig())},e("slot",{key:"6706262c92d34dbea5400699cc61f5614253300a",name:"no-js-message"}),e("slot",{key:"544c42a1feb5add98941e77a362df1e97cd3fac8",name:"content"}),e("slot",{key:"23c39f3b87587328097e8046f888e5e8469eeef3"}))))}get hostElement(){return s(this)}};Cb.style=Db;export{l as content_accordion,d as content_button,m as content_grid_formatter,y as content_hero_block,T as content_image,x as content_line,C as content_overlay,O as content_spacer,L as content_text_block,F as content_tout_block,Cb as content_video};
|
|
26
|
-
//# sourceMappingURL=p-8deb755c.entry.js.map
|